260322:1648 Correct Coresspondence / Doing RFA / Correct CI
CI Pipeline / build (push) Failing after 12m41s
Build and Deploy / deploy (push) Failing after 2m44s

This commit is contained in:
admin
2026-03-22 16:48:12 +07:00
parent e5deedb42e
commit 11984bfa29
683 changed files with 105251 additions and 29068 deletions
+30 -30
View File
@@ -1,60 +1,60 @@
import { User, CreateUserDto, Organization, AuditLog } from "@/types/admin";
import { User, CreateUserDto, Organization, AuditLog } from '@/types/admin';
// Mock Data
const mockUsers: User[] = [
{
userId: 1,
username: "admin",
email: "admin@example.com",
firstName: "System",
lastName: "Admin",
username: 'admin',
email: 'admin@example.com',
firstName: 'System',
lastName: 'Admin',
isActive: true,
roles: [{ roleId: 1, roleName: "ADMIN", description: "Administrator" }],
roles: [{ roleId: 1, roleName: 'ADMIN', description: 'Administrator' }],
},
{
userId: 2,
username: "jdoe",
email: "john.doe@example.com",
firstName: "John",
lastName: "Doe",
username: 'jdoe',
email: 'john.doe@example.com',
firstName: 'John',
lastName: 'Doe',
isActive: true,
roles: [{ roleId: 2, roleName: "USER", description: "Regular User" }],
roles: [{ roleId: 2, roleName: 'USER', description: 'Regular User' }],
},
];
const mockOrgs: Organization[] = [
{
orgId: 1,
orgCode: "PAT",
orgName: "Port Authority of Thailand",
orgNameTh: "การท่าเรือแห่งประเทศไทย",
description: "Owner",
orgCode: 'PAT',
orgName: 'Port Authority of Thailand',
orgNameTh: 'การท่าเรือแห่งประเทศไทย',
description: 'Owner',
},
{
orgId: 2,
orgCode: "CNPC",
orgName: "CNPC Consortium",
description: "Main Contractor",
orgCode: 'CNPC',
orgName: 'CNPC Consortium',
description: 'Main Contractor',
},
];
const mockLogs: AuditLog[] = [
{
auditLogId: 1,
userName: "admin",
action: "CREATE",
entityType: "user",
userName: 'admin',
action: 'CREATE',
entityType: 'user',
description: "Created user 'jdoe'",
ipAddress: "192.168.1.1",
ipAddress: '192.168.1.1',
createdAt: new Date(Date.now() - 1000 * 60 * 60 * 24).toISOString(),
},
{
auditLogId: 2,
userName: "jdoe",
action: "UPDATE",
entityType: "rfa",
description: "Updated status of RFA-001 to APPROVED",
ipAddress: "192.168.1.5",
userName: 'jdoe',
action: 'UPDATE',
entityType: 'rfa',
description: 'Updated status of RFA-001 to APPROVED',
ipAddress: '192.168.1.5',
createdAt: new Date(Date.now() - 1000 * 60 * 30).toISOString(),
},
];
@@ -76,8 +76,8 @@ export const adminApi = {
isActive: data.isActive,
roles: data.roles.map((id) => ({
roleId: id,
roleName: id === 1 ? "ADMIN" : "USER",
description: "",
roleName: id === 1 ? 'ADMIN' : 'USER',
description: '',
})),
};
mockUsers.push(newUser);
@@ -89,7 +89,7 @@ export const adminApi = {
return [...mockOrgs];
},
createOrganization: async (data: Omit<Organization, "orgId">): Promise<Organization> => {
createOrganization: async (data: Omit<Organization, 'orgId'>): Promise<Organization> => {
await new Promise((resolve) => setTimeout(resolve, 600));
const newOrg = { ...data, orgId: Math.max(...mockOrgs.map((o) => o.orgId)) + 1 };
mockOrgs.push(newOrg);