260326:1347 Fixing Refactor ADR-019 Naming convention uuid #01
CI / CD Pipeline / build (push) Failing after 17m29s
CI / CD Pipeline / deploy (push) Has been skipped

This commit is contained in:
admin
2026-03-26 13:47:07 +07:00
parent 978d66e49e
commit 1aff83214f
34 changed files with 217 additions and 222 deletions
@@ -37,7 +37,7 @@ export default function TagsPage() {
accessorKey: 'tag_name',
header: 'Tag Name',
cell: ({ row }) => {
const color = String(row.original.color_code || 'default');
const color = String(row.original.colorCode || 'default');
const isHex = color.startsWith('#');
return (
<div className="flex items-center gap-2">
@@ -45,7 +45,7 @@ export default function TagsPage() {
className="w-3 h-3 rounded-full border border-border"
style={{ backgroundColor: isHex ? color : color === 'default' ? '#e2e8f0' : color }}
/>
{String(row.original.tag_name)}
{String(row.original.tagName)}
</div>
);
},
@@ -97,13 +97,13 @@ export default function TagsPage() {
required: false,
},
{
name: 'tag_name',
name: 'tagName',
label: 'Tag Name',
type: 'text',
required: true,
},
{
name: 'color_code',
name: 'colorCode',
label: 'Color Code (Hex or Name)',
type: 'text',
required: false,
@@ -52,13 +52,13 @@ export default function WorkflowEditPage() {
try {
const dto: CreateWorkflowDefinitionDto = {
workflow_code: workflowData.workflowType || 'CORRESPONDENCE',
workflowCode: workflowData.workflowType || 'CORRESPONDENCE',
dsl: {
workflowName: workflowData.workflowName,
description: workflowData.description,
dslDefinition: workflowData.dslDefinition,
},
is_active: workflowData.isActive,
isActive: workflowData.isActive,
};
if (id) {
@@ -124,13 +124,13 @@ export default function CirculationDetailPage() {
<CardContent className="grid gap-4 md:grid-cols-2">
<div>
<p className="text-sm text-muted-foreground">Organization</p>
<p className="font-medium">{circulation.organization?.organization_name || '-'}</p>
<p className="font-medium">{circulation.organization?.organizationName || '-'}</p>
</div>
<div>
<p className="text-sm text-muted-foreground">Created By</p>
<p className="font-medium">
{circulation.creator
? `${circulation.creator.first_name || ''} ${circulation.creator.last_name || ''}`.trim() ||
? `${circulation.creator.firstName || ''} ${circulation.creator.lastName || ''}`.trim() ||
circulation.creator.username
: '-'}
</p>
@@ -146,7 +146,7 @@ export default function CirculationDetailPage() {
href={`/correspondences/${circulation.correspondence.uuid}`}
className="font-medium text-primary hover:underline"
>
{circulation.correspondence.correspondence_number}
{circulation.correspondence.correspondenceNumber}
</Link>
</div>
)}
@@ -166,13 +166,13 @@ export default function CirculationDetailPage() {
<div className="flex items-center gap-3">
<Avatar>
<AvatarFallback>
{getInitials(routing.assignee?.first_name, routing.assignee?.last_name)}
{getInitials(routing.assignee?.firstName, routing.assignee?.lastName)}
</AvatarFallback>
</Avatar>
<div>
<p className="font-medium">
{routing.assignee
? `${routing.assignee.first_name || ''} ${routing.assignee.last_name || ''}`.trim() ||
? `${routing.assignee.firstName || ''} ${routing.assignee.lastName || ''}`.trim() ||
routing.assignee.username
: 'Unassigned'}
</p>
@@ -63,7 +63,7 @@ export function CirculationList({ data }: CirculationListProps) {
header: 'Organization',
cell: ({ row }) => {
const org = row.original.organization;
return org?.organization_name || '-';
return org?.organizationName || '-';
},
},
{
@@ -30,7 +30,7 @@ function RoutingStep({ routing }: { routing: CirculationRouting }) {
const meta = ROUTING_STATUS_META[routing.status] ?? ROUTING_STATUS_META.PENDING;
const Icon = meta.icon;
const assigneeName = routing.assignee
? `${routing.assignee.first_name ?? ''} ${routing.assignee.last_name ?? ''}`.trim() ||
? `${routing.assignee.firstName ?? ''} ${routing.assignee.lastName ?? ''}`.trim() ||
routing.assignee.username
: '—';
@@ -74,16 +74,16 @@ export function TagManager({ uuid, canEdit }: TagManagerProps) {
key={tag.id}
className="inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium border"
style={{
backgroundColor: `${getTagColor(tag.color_code)}22`,
borderColor: `${getTagColor(tag.color_code)}66`,
color: getTagColor(tag.color_code) === '#e2e8f0' ? 'inherit' : getTagColor(tag.color_code),
backgroundColor: `${getTagColor(tag.colorCode)}22`,
borderColor: `${getTagColor(tag.colorCode)}66`,
color: getTagColor(tag.colorCode) === '#e2e8f0' ? 'inherit' : getTagColor(tag.colorCode),
}}
>
<span
className="w-1.5 h-1.5 rounded-full shrink-0"
style={{ backgroundColor: getTagColor(tag.color_code) }}
style={{ backgroundColor: getTagColor(tag.colorCode) }}
/>
{tag.tag_name}
{tag.tagName}
{canEdit && (
<button
onClick={() => handleRemove(tag.id)}
@@ -117,9 +117,9 @@ export function TagManager({ uuid, canEdit }: TagManagerProps) {
>
<span
className="w-2 h-2 rounded-full shrink-0"
style={{ backgroundColor: getTagColor(tag.color_code) }}
style={{ backgroundColor: getTagColor(tag.colorCode) }}
/>
{tag.tag_name}
{tag.tagName}
</button>
))
)}
+4 -4
View File
@@ -38,7 +38,7 @@ export interface CirculationRouting {
* Main Circulation entity
*/
export interface Circulation {
uuid: string;
publicId: string; // ADR-019: exposed as 'id' in API responses
id?: number; // Excluded from API responses (ADR-019)
correspondenceId?: number;
organizationId: number;
@@ -53,18 +53,18 @@ export interface Circulation {
// Joined relations from API
routings?: CirculationRouting[];
correspondence?: {
uuid: string;
publicId: string;
id?: number;
correspondenceNumber: string;
};
organization?: {
uuid: string;
publicId: string;
id?: number;
organizationCode: string;
organizationName: string;
};
creator?: {
uuid: string;
publicId: string;
userId?: number;
username: string;
firstName?: string;
+7 -7
View File
@@ -1,12 +1,12 @@
export interface Organization {
uuid: string;
publicId: string; // ADR-019: exposed as 'id' in API responses
id?: number; // Excluded from API responses (ADR-019)
organizationName: string;
organizationCode: string;
}
export interface Attachment {
uuid: string;
publicId: string; // ADR-019: exposed as 'id' in API responses
id?: number; // Excluded from API responses (ADR-019)
name: string;
url: string;
@@ -17,7 +17,7 @@ export interface Attachment {
// Used in List View mainly
export interface CorrespondenceRevision {
uuid: string;
publicId: string; // ADR-019: exposed as 'id' in API responses
id?: number; // Excluded from API responses (ADR-019)
revisionNumber: number;
revisionLabel?: string; // e.g. "A", "00"
@@ -42,21 +42,21 @@ export interface CorrespondenceRevision {
// Nested Relation from Backend Refactor
correspondence: {
uuid: string;
publicId: string;
id?: number; // Excluded from API responses (ADR-019)
correspondenceNumber: string;
projectId: number;
originatorId?: number;
isInternal: boolean;
originator?: Organization;
project?: { uuid: string; id?: number; projectName: string; projectCode: string };
project?: { publicId: string; id?: number; projectName: string; projectCode: string };
type?: { id: number; typeName: string; typeCode: string };
};
}
// Keep explicit Correspondence for Detail View if needed, or merge concepts
export interface Correspondence {
uuid: string;
publicId: string; // ADR-019: exposed as 'id' in API responses
id?: number; // Excluded from API responses (ADR-019)
correspondenceNumber: string;
projectId: number;
@@ -67,7 +67,7 @@ export interface Correspondence {
// Relations
originator?: Organization;
project?: { uuid: string; id?: number; projectName: string; projectCode: string };
project?: { publicId: string; id?: number; projectName: string; projectCode: string };
type?: { id: number; typeName: string; typeCode: string };
revisions?: CorrespondenceRevision[]; // Nested revisions
recipients?: {
+5 -5
View File
@@ -1,6 +1,6 @@
// Entity Interfaces
export interface DrawingRevision {
uuid: string;
publicId: string; // ADR-019: exposed as 'id' in API responses
revisionId?: number; // Excluded from API responses (ADR-019)
revisionNumber: string;
title?: string; // Added
@@ -15,7 +15,7 @@ export interface DrawingRevision {
}
export interface ContractDrawing {
uuid: string;
publicId: string; // ADR-019: exposed as 'id' in API responses
id?: number; // Excluded from API responses (ADR-019)
contractDrawingNo: string;
title: string;
@@ -28,7 +28,7 @@ export interface ContractDrawing {
}
export interface ShopDrawing {
uuid: string;
publicId: string; // ADR-019: exposed as 'id' in API responses
id?: number; // Excluded from API responses (ADR-019)
drawingNumber: string;
projectId: number;
@@ -41,7 +41,7 @@ export interface ShopDrawing {
}
export interface AsBuiltDrawing {
uuid: string;
publicId: string; // ADR-019: exposed as 'id' in API responses
id?: number; // Excluded from API responses (ADR-019)
drawingNumber: string;
projectId: number;
@@ -54,7 +54,7 @@ export interface AsBuiltDrawing {
// Unified Type for List
export interface Drawing {
uuid?: string;
publicId?: string; // ADR-019: exposed as 'id' in API responses
drawingId?: number; // Excluded from API responses (ADR-019)
drawingNumber: string;
title: string; // Display title (from current revision for Shop/AsBuilt)
+1 -1
View File
@@ -1,5 +1,5 @@
export interface Notification {
uuid: string;
publicId: string; // ADR-019: exposed as 'id' in API responses
notificationId?: number; // Excluded from API responses (ADR-019)
title: string;
message: string;
+1 -1
View File
@@ -1,5 +1,5 @@
export interface Organization {
uuid: string;
publicId: string; // ADR-019: exposed as 'id' in API responses
id?: number; // Excluded from API responses (ADR-019)
organizationCode: string;
organizationName: string;
+7 -7
View File
@@ -2,33 +2,33 @@ export interface RFAItem {
id?: number;
itemType: 'SHOP' | 'AS_BUILT';
shopDrawingRevision?: {
uuid?: string;
publicId?: string;
revisionLabel?: string;
revisionNumber?: number;
title?: string;
legacyDrawingNumber?: string;
attachments?: { id?: number; url?: string; name?: string }[];
shopDrawing?: {
uuid?: string;
publicId?: string;
drawingNumber?: string;
};
};
asBuiltDrawingRevision?: {
uuid?: string;
publicId?: string;
revisionLabel?: string;
revisionNumber?: number;
title?: string;
legacyDrawingNumber?: string;
attachments?: { id?: number; url?: string; name?: string }[];
asBuiltDrawing?: {
uuid?: string;
publicId?: string;
drawingNumber?: string;
};
};
}
export interface RFA {
uuid: string; // ADR-019: from correspondence.uuid
publicId: string; // ADR-019: from correspondence.publicId
id?: number; // Excluded from API responses (ADR-019)
rfaTypeId: number;
createdBy: number;
@@ -56,14 +56,14 @@ export interface RFA {
};
// Shared Correspondence Relation
correspondence?: {
uuid: string;
publicId: string;
id?: number; // Excluded from API responses (ADR-019)
correspondenceNumber: string;
projectId: number;
originatorId?: number;
createdAt?: string;
project?: {
uuid: string;
publicId: string;
projectName: string;
projectCode: string;
};
+1 -1
View File
@@ -1,5 +1,5 @@
export interface SearchResult {
uuid: string;
publicId: string; // ADR-019: exposed as 'id' in API responses
id?: number; // Excluded from API responses (ADR-019)
type: 'correspondence' | 'rfa' | 'drawing';
title: string;
+2 -2
View File
@@ -28,7 +28,7 @@ export interface TransmittalItem {
* Main Transmittal entity
*/
export interface Transmittal {
uuid: string; // ADR-019: from correspondence.uuid
publicId: string; // ADR-019: from correspondence.publicId
id?: number; // Excluded from API responses (ADR-019)
correspondenceId?: number | string;
transmittalNo: string;
@@ -39,7 +39,7 @@ export interface Transmittal {
// Joined relations from API
items?: TransmittalItem[];
correspondence?: {
uuid: string;
publicId: string;
id?: number;
correspondenceNumber: string;
projectId: number;
+1 -1
View File
@@ -12,7 +12,7 @@ export interface UserOrganization {
}
export interface User {
uuid: string;
publicId: string; // ADR-019: exposed as 'id' in API responses
userId?: number; // Excluded from API responses (ADR-019)
username: string;
email: string;