From 51e8cfc536eac2eec18500e1f37c0f2c79bb8d4b Mon Sep 17 00:00:00 2001 From: grabowski Date: Wed, 15 Apr 2026 10:02:17 +0700 Subject: [PATCH] Include personal/address/emergency columns in financial export employees.csv Extends the employees.csv builder to include all 14 new fields (DOB, gender, nationality, marital status, full Thai address, emergency contact). Order matches the on-screen detail page so auditors and accountants get the complete record. Co-Authored-By: Claude Opus 4.6 (1M context) --- src/lib/server/export/financial.ts | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/lib/server/export/financial.ts b/src/lib/server/export/financial.ts index a518927..7417fcb 100644 --- a/src/lib/server/export/financial.ts +++ b/src/lib/server/export/financial.ts @@ -171,7 +171,14 @@ export async function buildFinancialExport( [ 'id', 'employeeCode', 'firstName', 'lastName', 'displayName', 'email', 'phone', 'position', 'department', 'hireDate', 'terminationDate', 'nationalId', 'taxId', - 'bankName', 'bankAccount', 'isActive', 'deletedAt', 'createdAt', 'updatedAt' + 'bankName', 'bankAccount', + // Personal + 'dateOfBirth', 'gender', 'nationality', 'maritalStatus', + // Address + 'addressLine1', 'addressLine2', 'subdistrict', 'district', 'province', 'postalCode', 'country', + // Emergency contact + 'emergencyContactName', 'emergencyContactPhone', 'emergencyContactRelationship', + 'isActive', 'deletedAt', 'createdAt', 'updatedAt' ] ]; for (const e of employeeRows) { @@ -180,6 +187,10 @@ export async function buildFinancialExport( e.email ?? '', e.phone ?? '', e.position ?? '', e.department ?? '', e.hireDate, e.terminationDate ?? '', e.nationalId ?? '', e.taxId ?? '', e.bankName ?? '', e.bankAccount ?? '', + e.dateOfBirth ?? '', e.gender ?? '', e.nationality ?? '', e.maritalStatus ?? '', + e.addressLine1 ?? '', e.addressLine2 ?? '', e.subdistrict ?? '', e.district ?? '', + e.province ?? '', e.postalCode ?? '', e.country ?? '', + e.emergencyContactName ?? '', e.emergencyContactPhone ?? '', e.emergencyContactRelationship ?? '', e.isActive, e.deletedAt ? e.deletedAt.toISOString() : '', e.createdAt.toISOString(), e.updatedAt.toISOString() ]);