690326:2139 Fixing Refactor ADR-019 Naming convention uuid #07
CI / CD Pipeline / build (push) Successful in 10m6s
CI / CD Pipeline / deploy (push) Failing after 1m16s

This commit is contained in:
2026-03-26 21:39:03 +07:00
parent 25ea2fcd0f
commit 0a1ea1e4bb
8 changed files with 190 additions and 34 deletions
@@ -21,6 +21,18 @@ export default function DisciplinesPage() {
header: 'Code',
cell: ({ row }) => <span className="font-mono font-bold">{row.getValue('disciplineCode')}</span>,
},
{
accessorKey: 'contract',
header: 'Contract',
cell: ({ row }) => {
const contract = row.original.contract;
return contract ? (
<span className="text-sm">{contract.contractName} ({contract.contractCode})</span>
) : (
<span className="text-muted-foreground text-sm">-</span>
);
},
},
{
accessorKey: 'codeNameTh',
header: 'Name (TH)',
@@ -44,9 +56,9 @@ export default function DisciplinesPage() {
},
];
const contractOptions = contracts.map((c: { id: number; contractCode: string; contractName: string }) => ({
const contractOptions = contracts.map((c: { id?: number; publicId?: string; contractCode: string; contractName: string }) => ({
label: `${c.contractName} (${c.contractCode})`,
value: String(c.id),
value: String(c.publicId ?? c.id ?? ''),
}));
return (
@@ -86,8 +98,8 @@ export default function DisciplinesPage() {
</SelectTrigger>
<SelectContent>
<SelectItem value="all">All Contracts</SelectItem>
{contracts.map((c: { id: number; contractCode: string; contractName: string }) => (
<SelectItem key={c.id} value={String(c.id)}>
{contracts.map((c: { id?: number; publicId?: string; contractCode: string; contractName: string }) => (
<SelectItem key={String(c.publicId ?? c.id ?? '')} value={String(c.publicId ?? c.id ?? '')}>
{c.contractName} ({c.contractCode})
</SelectItem>
))}
@@ -21,6 +21,18 @@ export default function RfaTypesPage() {
header: 'Code',
cell: ({ row }) => <span className="font-mono font-bold">{row.getValue('typeCode')}</span>,
},
{
accessorKey: 'contract',
header: 'Contract',
cell: ({ row }) => {
const contract = row.original.contract;
return contract ? (
<span className="text-sm">{contract.contractName} ({contract.contractCode})</span>
) : (
<span className="text-muted-foreground text-sm">-</span>
);
},
},
{
accessorKey: 'typeNameTh',
header: 'Name (TH)',
@@ -48,9 +60,9 @@ export default function RfaTypesPage() {
},
];
const contractOptions = contracts.map((c: { id: number | string; contract_name?: string; contract_code?: string; contractName?: string; contractCode?: string }) => ({
const contractOptions = contracts.map((c: { id?: number; publicId?: string; contract_name?: string; contract_code?: string; contractName?: string; contractCode?: string }) => ({
label: `${c.contractName || c.contract_name} (${c.contractCode || c.contract_code})`,
value: String(c.id),
value: String(c.publicId ?? c.id ?? ''),
}));
return (
@@ -87,8 +99,8 @@ export default function RfaTypesPage() {
</SelectTrigger>
<SelectContent>
<SelectItem value="all">All Contracts</SelectItem>
{contracts.map((c: { id: number | string; contract_name?: string; contract_code?: string; contractName?: string; contractCode?: string }) => (
<SelectItem key={c.id} value={String(c.id)}>
{contracts.map((c: { id?: number; publicId?: string; contract_name?: string; contract_code?: string; contractName?: string; contractCode?: string }) => (
<SelectItem key={String(c.publicId ?? c.id ?? '')} value={String(c.publicId ?? c.id ?? '')}>
{c.contractName || c.contract_name} ({c.contractCode || c.contract_code})
</SelectItem>
))}
@@ -104,11 +116,11 @@ export default function RfaTypesPage() {
required: true,
options: contractOptions,
},
{ name: 'type_code', label: 'Code', type: 'text', required: true },
{ name: 'type_name_th', label: 'Name (TH)', type: 'text', required: true },
{ name: 'type_name_en', label: 'Name (EN)', type: 'text' },
{ name: 'typeCode', label: 'Code', type: 'text', required: true },
{ name: 'typeNameTh', label: 'Name (TH)', type: 'text', required: true },
{ name: 'typeNameEn', label: 'Name (EN)', type: 'text' },
{ name: 'remark', label: 'Remark', type: 'textarea' },
{ name: 'is_active', label: 'Active', type: 'checkbox' },
{ name: 'isActive', label: 'Active', type: 'checkbox' },
]}
/>
</div>
@@ -16,9 +16,9 @@ export default function TagsPage() {
const projectOptions = [
{ label: 'Global (All Projects)', value: '__none__' },
...(projectsData || []).map((p: { id: number | string; projectName?: string; projectCode?: string }) => ({
label: (p.projectName || p.projectCode || `Project ${p.id}`) as string,
value: String(p.id), // p.id = UUID string via serialization
...(projectsData || []).map((p: { id?: number; publicId?: string; projectName?: string; projectCode?: string }) => ({
label: (p.projectName || p.projectCode || `Project ${p.publicId || p.id}`) as string,
value: String(p.publicId ?? p.id ?? ''), // ADR-019: publicId is the UUID exposed in API
})),
];