kyc user and upload partial update encrypt nik and picture

This commit is contained in:
2026-04-27 21:48:24 +07:00
parent b31fe675ae
commit a92b4a8fd9
51 changed files with 5180 additions and 452 deletions
+12
View File
@@ -0,0 +1,12 @@
/** Daftar email admin (comma-separated, lowercase). */
function adminEmails(): string[] {
return (process.env.ADMIN_EMAILS ?? "")
.split(",")
.map((e) => e.trim().toLowerCase())
.filter(Boolean);
}
export function isAdminEmail(email: string | null | undefined): boolean {
if (!email) return false;
return adminEmails().includes(email.toLowerCase());
}
+6
View File
@@ -18,4 +18,10 @@ export const LIMITS = {
MAX_URL_LENGTH: 2048,
MAX_NAME_LENGTH: 80,
MAX_PASSWORD_LENGTH: 72,
/** Verifikasi organizer (KTP + bank) */
MAX_ADDRESS_LENGTH: 500,
MAX_BANK_NAME_LENGTH: 60,
MAX_BANK_ACCOUNT_NUMBER_LENGTH: 32,
MAX_REJECTION_REASON_LENGTH: 500,
NIK_LENGTH: 16,
} as const;
+12
View File
@@ -1,2 +1,14 @@
/** Minimal trip sebagai organizer untuk badge "Trip leader" (heuristik MVP). */
export const TRIP_LEADER_MIN_TRIPS = 2;
/** Bentuk data minimal untuk cek status verifikasi organizer. */
type WithOrganizerVerification = {
organizerVerification?: { status: "PENDING" | "APPROVED" | "REJECTED" } | null;
};
/** True kalau user punya OrganizerVerification berstatus APPROVED. */
export function isVerifiedOrganizer(
user: WithOrganizerVerification | null | undefined
): boolean {
return user?.organizerVerification?.status === "APPROVED";
}