@appcorp/fusion-storybook 0.5.34 → 0.5.36

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,6 +5,7 @@
5
5
  */
6
6
  import { z } from "zod";
7
7
  import { normalizeIdNumber } from "../../utils/id-number";
8
+ import { isGovernmentIdType, isValidIdNumberForType, } from "../../utils/government-id";
8
9
  import { phoneSchema } from "../../utils/phone-validation";
9
10
  // ============================================================================
10
11
  // VALIDATION KEYS (used as Zod error messages, translated via getTranslatedError)
@@ -17,11 +18,14 @@ export const VALIDATION_KEYS = {
17
18
  emailInvalid: "validationFamilyMemberEmailInvalid",
18
19
  idForUpdate: "validationFamilyMemberIdForUpdateRequired",
19
20
  phoneInvalid: "validationFamilyMemberPhoneInvalid",
21
+ idTypeRequired: "validationFamilyMemberIdTypeRequired",
22
+ idNumberInvalid: "validationFamilyMemberIdNumberInvalid",
20
23
  };
21
24
  // ============================================================================
22
25
  // VALIDATION SCHEMA
23
26
  // ============================================================================
24
- export const familyMemberFormValidation = z.object({
27
+ export const familyMemberFormValidation = z
28
+ .object({
25
29
  familyId: z.string().min(1, VALIDATION_KEYS.familyId),
26
30
  firstName: z.string().min(1, VALIDATION_KEYS.firstName),
27
31
  lastName: z.string().min(1, VALIDATION_KEYS.lastName),
@@ -38,8 +42,37 @@ export const familyMemberFormValidation = z.object({
38
42
  relationship: z.string().optional(),
39
43
  occupation: z.string().optional(),
40
44
  emergencyPhone: phoneSchema(VALIDATION_KEYS.phoneInvalid),
41
- idNumber: z.string().optional().transform((val) => (val ? normalizeIdNumber(val) : val)),
45
+ idType: z
46
+ .string()
47
+ .optional()
48
+ .refine((value) => !value || isGovernmentIdType(value), VALIDATION_KEYS.idTypeRequired),
49
+ idNumber: z
50
+ .string()
51
+ .optional()
52
+ .transform((val) => (val ? normalizeIdNumber(val) : val)),
42
53
  avatar: z.string().optional(),
43
54
  isPrimary: z.boolean().optional(),
44
55
  enabled: z.boolean().optional(),
56
+ })
57
+ .superRefine((data, ctx) => {
58
+ var _a, _b;
59
+ const hasIdNumber = Boolean((_a = data.idNumber) === null || _a === void 0 ? void 0 : _a.trim());
60
+ if (hasIdNumber && !data.idType) {
61
+ ctx.addIssue({
62
+ code: z.ZodIssueCode.custom,
63
+ path: ["idType"],
64
+ message: VALIDATION_KEYS.idTypeRequired,
65
+ });
66
+ return;
67
+ }
68
+ if (hasIdNumber &&
69
+ data.idType &&
70
+ isGovernmentIdType(data.idType) &&
71
+ !isValidIdNumberForType((_b = data.idNumber) !== null && _b !== void 0 ? _b : "", data.idType)) {
72
+ ctx.addIssue({
73
+ code: z.ZodIssueCode.custom,
74
+ path: ["idNumber"],
75
+ message: VALIDATION_KEYS.idNumberInvalid,
76
+ });
77
+ }
45
78
  });
@@ -10,15 +10,21 @@ import { Badge } from "@appcorp/shadcn/components/ui/badge";
10
10
  import { Card, CardContent, CardDescription, CardHeader, CardTitle, } from "@appcorp/shadcn/components/ui/card";
11
11
  import { Separator } from "@appcorp/shadcn/components/ui/separator";
12
12
  import { DATE_FORMATS, formatDate, } from "@react-pakistan/util-functions/general/format-date";
13
- import { Briefcase, Calendar, CheckCircle2, Heart, Mail, Phone, ShieldCheck, User, Users, XCircle, } from "lucide-react";
13
+ import { Briefcase, Calendar, CheckCircle2, ExternalLink, Heart, Mail, Phone, ShieldCheck, User, Users, XCircle, } from "lucide-react";
14
14
  import { useFamilyMemberModule } from "./context";
15
15
  import { useTranslations } from "next-intl";
16
16
  import { formatValue } from "@react-pakistan/util-functions/general/format-value";
17
17
  import { formatPhoneDisplay } from "@react-pakistan/util-functions/general/format-phone-display";
18
+ import { governmentIdTypeLabelKey } from "../../utils/government-id";
18
19
  export const FamilyMemberView = () => {
19
20
  const { state } = useFamilyMemberModule();
20
- const { avatar, bloodGroup, dateOfBirth, email, emergencyPhone, enabled, firstName, gender, idNumber, isPrimary, lastName, occupation, phone, relationship, role, } = state;
21
+ const { avatar, bloodGroup, dateOfBirth, email, emergencyPhone, enabled, firstName, gender, idType, idNumber, idImages, isPrimary, lastName, occupation, phone, relationship, role, } = state;
21
22
  const t = useTranslations("familyMember");
23
+ const governmentIdT = useTranslations("governmentId");
24
+ const formatIdType = (value) => {
25
+ const key = governmentIdTypeLabelKey(value);
26
+ return key ? governmentIdT(key) : "—";
27
+ };
22
28
  const fullName = [firstName, lastName].filter(Boolean).join(" ") ||
23
29
  t("viewFieldFamilyMember");
24
30
  const initials = `${(firstName === null || firstName === void 0 ? void 0 : firstName[0]) || ""}${(lastName === null || lastName === void 0 ? void 0 : lastName[0]) || ""}`
@@ -34,7 +40,10 @@ export const FamilyMemberView = () => {
34
40
  return "—";
35
41
  return formatDate(new Date(value).toISOString(), DATE_FORMATS.LOCALE_DATE);
36
42
  };
37
- return (_jsxs("div", { className: "space-y-4", children: [_jsx(Card, { children: _jsx(CardContent, { className: "pt-6", children: _jsxs("div", { className: "flex items-center gap-6", children: [_jsxs(Avatar, { className: "h-24 w-24", children: [_jsx(AvatarImage, { src: avatar || undefined, alt: fullName }), _jsx(AvatarFallback, { className: "text-2xl", children: initials || "FM" })] }), _jsxs("div", { className: "flex-1", children: [_jsxs("div", { className: "flex items-center gap-3", children: [_jsx("h2", { className: "text-2xl font-bold", children: fullName }), enabled ? (_jsxs(Badge, { variant: "default", className: "gap-1", children: [_jsx(CheckCircle2, { className: "h-3 w-3" }), t("badgeActive")] })) : (_jsxs(Badge, { variant: "secondary", className: "gap-1", children: [_jsx(XCircle, { className: "h-3 w-3" }), t("badgeInactive")] })), isPrimary && (_jsxs(Badge, { variant: "outline", className: "gap-1", children: [_jsx(ShieldCheck, { className: "h-3 w-3" }), t("formPrimaryContactLabel")] }))] }), _jsx("p", { className: "text-muted-foreground mt-1 text-sm", children: t("viewFieldFamilyMemberProfile") }), _jsxs("div", { className: "mt-3 flex flex-wrap items-center gap-2", children: [role ? (_jsx(Badge, { variant: "secondary", className: "capitalize", children: formatEnumValue(role) })) : null, relationship ? (_jsx(Badge, { variant: "outline", className: "capitalize", children: formatEnumValue(relationship) })) : null, gender ? (_jsx(Badge, { variant: "outline", className: "capitalize", children: formatEnumValue(gender) })) : null] })] })] }) }) }), _jsxs(Card, { children: [_jsxs(CardHeader, { className: "pb-3", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(User, { className: "text-primary h-5 w-5" }), _jsx(CardTitle, { className: "text-lg", children: t("formSectionPersonalInformation") })] }), _jsx(CardDescription, { children: t("viewSectionBasicIdentityAndProfileDetails") })] }), _jsx(Separator, {}), _jsx(CardContent, { className: "pt-6", children: _jsxs("div", { className: "grid grid-cols-1 gap-6 md:grid-cols-2", children: [_jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("formFirstNameLabel") }), _jsx("p", { className: "text-base", children: formatValue(firstName) })] }), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("formLastNameLabel") }), _jsx("p", { className: "text-base", children: formatValue(lastName) })] }), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("formRoleLabel") }), role ? (_jsx(Badge, { variant: "secondary", className: "capitalize", children: formatEnumValue(role) })) : (_jsx("p", { className: "text-base", children: "\u2014" }))] }), _jsxs("div", { className: "space-y-1", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Calendar, { className: "text-muted-foreground h-4 w-4" }), _jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("formDateOfBirthLabel") })] }), _jsx("p", { className: "text-base", children: formatDateValue(dateOfBirth) })] }), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("formGenderLabel") }), gender ? (_jsx(Badge, { variant: "outline", className: "capitalize", children: formatEnumValue(gender) })) : (_jsx("p", { className: "text-base", children: "\u2014" }))] }), _jsxs("div", { className: "space-y-1", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Heart, { className: "text-muted-foreground h-4 w-4" }), _jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("formBloodGroupLabel") })] }), _jsx("p", { className: "text-base", children: formatValue(bloodGroup) })] }), _jsxs("div", { className: "space-y-1 md:col-span-2", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("formIdNumberLabel") }), _jsx("p", { className: "text-base", children: formatValue(idNumber) })] })] }) })] }), _jsxs(Card, { children: [_jsxs(CardHeader, { className: "pb-3", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Phone, { className: "text-primary h-5 w-5" }), _jsx(CardTitle, { className: "text-lg", children: t("formSectionContactInformation") })] }), _jsx(CardDescription, { children: t("viewSectionReachabilityAndEmergencyContactDetails") })] }), _jsx(Separator, {}), _jsx(CardContent, { className: "pt-6", children: _jsxs("div", { className: "grid grid-cols-1 gap-6 md:grid-cols-2", children: [_jsxs("div", { className: "space-y-1", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Phone, { className: "text-muted-foreground h-4 w-4" }), _jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("formPhoneLabel") })] }), _jsx("p", { className: "text-base", children: formatPhoneDisplay(phone) || formatValue(phone) })] }), _jsxs("div", { className: "space-y-1", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Mail, { className: "text-muted-foreground h-4 w-4" }), _jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("formEmailLabel") })] }), _jsx("p", { className: "text-base", children: formatValue(email) })] }), _jsxs("div", { className: "space-y-1 md:col-span-2", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Phone, { className: "text-muted-foreground h-4 w-4" }), _jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("formEmergencyPhoneLabel") })] }), _jsx("p", { className: "text-base", children: formatPhoneDisplay(emergencyPhone) ||
43
+ return (_jsxs("div", { className: "space-y-4", children: [_jsx(Card, { children: _jsx(CardContent, { className: "pt-6", children: _jsxs("div", { className: "flex items-center gap-6", children: [_jsxs(Avatar, { className: "h-24 w-24", children: [_jsx(AvatarImage, { src: avatar || undefined, alt: fullName }), _jsx(AvatarFallback, { className: "text-2xl", children: initials || "FM" })] }), _jsxs("div", { className: "flex-1", children: [_jsxs("div", { className: "flex items-center gap-3", children: [_jsx("h2", { className: "text-2xl font-bold", children: fullName }), enabled ? (_jsxs(Badge, { variant: "default", className: "gap-1", children: [_jsx(CheckCircle2, { className: "h-3 w-3" }), t("badgeActive")] })) : (_jsxs(Badge, { variant: "secondary", className: "gap-1", children: [_jsx(XCircle, { className: "h-3 w-3" }), t("badgeInactive")] })), isPrimary && (_jsxs(Badge, { variant: "outline", className: "gap-1", children: [_jsx(ShieldCheck, { className: "h-3 w-3" }), t("formPrimaryContactLabel")] }))] }), _jsx("p", { className: "text-muted-foreground mt-1 text-sm", children: t("viewFieldFamilyMemberProfile") }), _jsxs("div", { className: "mt-3 flex flex-wrap items-center gap-2", children: [role ? (_jsx(Badge, { variant: "secondary", className: "capitalize", children: formatEnumValue(role) })) : null, relationship ? (_jsx(Badge, { variant: "outline", className: "capitalize", children: formatEnumValue(relationship) })) : null, gender ? (_jsx(Badge, { variant: "outline", className: "capitalize", children: formatEnumValue(gender) })) : null] })] })] }) }) }), _jsxs(Card, { children: [_jsxs(CardHeader, { className: "pb-3", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(User, { className: "text-primary h-5 w-5" }), _jsx(CardTitle, { className: "text-lg", children: t("formSectionPersonalInformation") })] }), _jsx(CardDescription, { children: t("viewSectionBasicIdentityAndProfileDetails") })] }), _jsx(Separator, {}), _jsx(CardContent, { className: "pt-6", children: _jsxs("div", { className: "grid grid-cols-1 gap-6 md:grid-cols-2", children: [_jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("formFirstNameLabel") }), _jsx("p", { className: "text-base", children: formatValue(firstName) })] }), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("formLastNameLabel") }), _jsx("p", { className: "text-base", children: formatValue(lastName) })] }), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("formRoleLabel") }), role ? (_jsx(Badge, { variant: "secondary", className: "capitalize", children: formatEnumValue(role) })) : (_jsx("p", { className: "text-base", children: "\u2014" }))] }), _jsxs("div", { className: "space-y-1", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Calendar, { className: "text-muted-foreground h-4 w-4" }), _jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("formDateOfBirthLabel") })] }), _jsx("p", { className: "text-base", children: formatDateValue(dateOfBirth) })] }), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("formGenderLabel") }), gender ? (_jsx(Badge, { variant: "outline", className: "capitalize", children: formatEnumValue(gender) })) : (_jsx("p", { className: "text-base", children: "\u2014" }))] }), _jsxs("div", { className: "space-y-1", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Heart, { className: "text-muted-foreground h-4 w-4" }), _jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("formBloodGroupLabel") })] }), _jsx("p", { className: "text-base", children: formatValue(bloodGroup) })] }), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: governmentIdT("typeLabel") }), _jsx("p", { className: "text-base", children: formatIdType(idType) })] }), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("formIdNumberLabel") }), _jsx("p", { className: "text-base", children: formatValue(idNumber) })] }), _jsxs("div", { className: "space-y-2 md:col-span-2", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: governmentIdT("imagesLabel") }), idImages && idImages.length > 0 ? (_jsx("div", { className: "space-y-2", children: idImages.map((url, idx) => {
44
+ const fileName = url.split("/").pop() || url;
45
+ return (_jsxs("a", { href: url, target: "_blank", rel: "noopener noreferrer", className: "bg-muted/50 flex items-center gap-2 rounded-lg border p-3 text-sm hover:underline", children: [_jsx("span", { className: "flex-1 truncate", children: fileName }), _jsx(ExternalLink, { className: "text-muted-foreground h-3.5 w-3.5 shrink-0" })] }, `${url}-${idx}`));
46
+ }) })) : (_jsx("p", { className: "text-muted-foreground text-sm", children: governmentIdT("imagesEmpty") }))] })] }) })] }), _jsxs(Card, { children: [_jsxs(CardHeader, { className: "pb-3", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Phone, { className: "text-primary h-5 w-5" }), _jsx(CardTitle, { className: "text-lg", children: t("formSectionContactInformation") })] }), _jsx(CardDescription, { children: t("viewSectionReachabilityAndEmergencyContactDetails") })] }), _jsx(Separator, {}), _jsx(CardContent, { className: "pt-6", children: _jsxs("div", { className: "grid grid-cols-1 gap-6 md:grid-cols-2", children: [_jsxs("div", { className: "space-y-1", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Phone, { className: "text-muted-foreground h-4 w-4" }), _jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("formPhoneLabel") })] }), _jsx("p", { className: "text-base", children: formatPhoneDisplay(phone) || formatValue(phone) })] }), _jsxs("div", { className: "space-y-1", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Mail, { className: "text-muted-foreground h-4 w-4" }), _jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("formEmailLabel") })] }), _jsx("p", { className: "text-base", children: formatValue(email) })] }), _jsxs("div", { className: "space-y-1 md:col-span-2", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Phone, { className: "text-muted-foreground h-4 w-4" }), _jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("formEmergencyPhoneLabel") })] }), _jsx("p", { className: "text-base", children: formatPhoneDisplay(emergencyPhone) ||
38
47
  formatValue(emergencyPhone) })] })] }) })] }), _jsxs(Card, { children: [_jsxs(CardHeader, { className: "pb-3", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Users, { className: "text-primary h-5 w-5" }), _jsx(CardTitle, { className: "text-lg", children: t("viewFieldFamilyRole") })] }), _jsx(CardDescription, { children: t("viewFieldRelationshipAndHouseholdResponsibilities") })] }), _jsx(Separator, {}), _jsx(CardContent, { className: "pt-6", children: _jsxs("div", { className: "grid grid-cols-1 gap-6 md:grid-cols-2", children: [_jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("formRelationshipLabel") }), relationship ? (_jsx(Badge, { variant: "secondary", className: "capitalize", children: formatEnumValue(relationship) })) : (_jsx("p", { className: "text-base", children: "\u2014" }))] }), _jsxs("div", { className: "space-y-1", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Briefcase, { className: "text-muted-foreground h-4 w-4" }), _jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("formOccupationLabel") })] }), _jsx("p", { className: "text-base", children: formatValue(occupation) })] })] }) })] }), _jsxs(Card, { children: [_jsxs(CardHeader, { className: "pb-3", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(ShieldCheck, { className: "text-primary h-5 w-5" }), _jsx(CardTitle, { className: "text-lg", children: t("viewFieldStatus") })] }), _jsx(CardDescription, { children: t("viewFieldPrimaryContactAndAccountActivity") })] }), _jsx(Separator, {}), _jsx(CardContent, { className: "pt-6", children: _jsxs("div", { className: "grid grid-cols-1 gap-6 md:grid-cols-2", children: [_jsxs("div", { className: "flex items-start gap-3", children: [_jsx(ShieldCheck, { className: "text-primary mt-0.5 h-5 w-5" }), _jsxs("div", { children: [_jsx("p", { className: "font-medium", children: isPrimary
39
48
  ? t("formPrimaryContactLabel")
40
49
  : t("viewFieldSecondaryContact") }), _jsx("p", { className: "text-muted-foreground text-sm", children: isPrimary
@@ -0,0 +1,18 @@
1
+ import { type GovernmentIdType } from "../utils/government-id";
2
+ export interface GovernmentIdTypeSelectProps {
3
+ id: string;
4
+ value?: string | null;
5
+ onChange: (value: GovernmentIdType | "") => void;
6
+ error?: string;
7
+ required?: boolean;
8
+ disabled?: boolean;
9
+ label?: string;
10
+ info?: string;
11
+ placeholder?: string;
12
+ className?: string;
13
+ }
14
+ /**
15
+ * Shared picker for the global list of government-issued ID types.
16
+ * Labels come from the `governmentId` translation namespace.
17
+ */
18
+ export declare function GovernmentIdTypeSelect({ id, value, onChange, error, required, disabled, label, info, placeholder, className, }: GovernmentIdTypeSelectProps): import("react").JSX.Element;
@@ -0,0 +1,16 @@
1
+ "use client";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { EnhancedCombobox } from "@appcorp/shadcn/components/enhanced-combobox";
4
+ import { useTranslations } from "next-intl";
5
+ import { GOVERNMENT_ID_TYPES, } from "../utils/government-id";
6
+ /**
7
+ * Shared picker for the global list of government-issued ID types.
8
+ * Labels come from the `governmentId` translation namespace.
9
+ */
10
+ export function GovernmentIdTypeSelect({ id, value, onChange, error, required = false, disabled = false, label, info, placeholder, className, }) {
11
+ const t = useTranslations("governmentId");
12
+ return (_jsx(EnhancedCombobox, { className: className, disabled: disabled, emptyText: t("typeEmptyText"), error: error, id: id, info: info !== null && info !== void 0 ? info : t("typeInfo"), label: label !== null && label !== void 0 ? label : t("typeLabel"), onValueChange: (next) => onChange(next), options: GOVERNMENT_ID_TYPES.map((type) => ({
13
+ value: type.value,
14
+ label: t(type.labelKey),
15
+ })), placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : t("typePlaceholder"), required: required, searchPlaceholder: t("typeSearchPlaceholder"), value: value !== null && value !== void 0 ? value : "" }));
16
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appcorp/fusion-storybook",
3
- "version": "0.5.34",
3
+ "version": "0.5.36",
4
4
  "scripts": {
5
5
  "build-storybook": "storybook build",
6
6
  "build:next": "next build",
@@ -1,6 +1,7 @@
1
1
  export interface AdmissionPDFData {
2
2
  firstName: string;
3
3
  lastName: string;
4
+ studentIdType?: string;
4
5
  studentIdNumber: string;
5
6
  gender: string;
6
7
  dob: string;
@@ -8,12 +9,14 @@ export interface AdmissionPDFData {
8
9
  discountCode?: string;
9
10
  fatherFirstName: string;
10
11
  fatherLastName: string;
12
+ fatherIdType?: string;
11
13
  fatherIdNumber: string;
12
14
  fatherMobile: string;
13
15
  fatherOccupation?: string;
14
16
  fatherOrganization?: string;
15
17
  motherFirstName: string;
16
18
  motherLastName: string;
19
+ motherIdType?: string;
17
20
  motherIdNumber: string;
18
21
  motherMobile: string;
19
22
  address: string;
@@ -19,6 +19,23 @@ function section(title, content) {
19
19
  <div class="section-body">${content}</div>
20
20
  </div>`;
21
21
  }
22
+ const ID_TYPE_LABELS = {
23
+ NATIONAL_ID: "National ID / CNIC",
24
+ PASSPORT: "Passport",
25
+ DRIVING_LICENCE: "Driving Licence",
26
+ BIRTH_CERTIFICATE: "Birth Certificate / B-Form",
27
+ VOTER_ID: "Voter ID",
28
+ RESIDENCE_PERMIT: "Residence Permit",
29
+ REFUGEE_ID: "Refugee / Asylum ID",
30
+ MILITARY_ID: "Military ID",
31
+ OTHER: "Other",
32
+ };
33
+ function idTypeLabel(value) {
34
+ var _a;
35
+ if (!value)
36
+ return "";
37
+ return (_a = ID_TYPE_LABELS[value]) !== null && _a !== void 0 ? _a : value;
38
+ }
22
39
  function row(label, value) {
23
40
  return `
24
41
  <div class="field-row">
@@ -244,6 +261,7 @@ export function buildAdmissionFormHtml(data) {
244
261
  <div class="two-col">
245
262
  ${row("Student Name", studentName)}
246
263
  ${row("Class for Admission", fmt(data.classForAdmission))}
264
+ ${row("Government ID Type", idTypeLabel(data.studentIdType))}
247
265
  ${row("Government ID", fmt(data.studentIdNumber))}
248
266
  <div class="field-row">
249
267
  <span class="field-label">Gender:</span>
@@ -261,6 +279,7 @@ export function buildAdmissionFormHtml(data) {
261
279
  <h4>Father</h4>
262
280
  <div class="two-col">
263
281
  ${row("Name", fatherName)}
282
+ ${row("ID Type", idTypeLabel(data.fatherIdType))}
264
283
  ${row("ID / CNIC", fmt(data.fatherIdNumber))}
265
284
  ${row("Occupation", fmt(data.fatherOccupation))}
266
285
  ${row("Organization", fmt(data.fatherOrganization))}
@@ -271,6 +290,7 @@ export function buildAdmissionFormHtml(data) {
271
290
  <h4>Mother</h4>
272
291
  <div class="two-col">
273
292
  ${row("Name", motherName)}
293
+ ${row("ID Type", idTypeLabel(data.motherIdType))}
274
294
  ${row("ID / CNIC", fmt(data.motherIdNumber))}
275
295
  ${row("Mobile", fmt(data.motherMobile))}
276
296
  </div>