@appcorp/fusion-storybook 0.5.33 → 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.
- package/base-modules/admission/context/use-admission-module.d.ts +10 -1
- package/base-modules/admission/context/use-admission-module.js +140 -37
- package/base-modules/admission/context.d.ts +45 -0
- package/base-modules/admission/context.js +9 -0
- package/base-modules/admission/form.js +45 -2
- package/base-modules/admission/validate.d.ts +12 -3
- package/base-modules/admission/validate.js +52 -4
- package/base-modules/admission/view.js +18 -3
- package/base-modules/family-member/context.d.ts +12 -0
- package/base-modules/family-member/context.js +15 -3
- package/base-modules/family-member/form.js +3 -2
- package/base-modules/family-member/validate.d.ts +3 -0
- package/base-modules/family-member/validate.js +35 -2
- package/base-modules/family-member/view.js +12 -3
- package/components/government-id-type-select.d.ts +18 -0
- package/components/government-id-type-select.js +16 -0
- package/package.json +1 -1
- package/pdf-templates/admission-form-template.d.ts +3 -0
- package/pdf-templates/admission-form-template.js +20 -0
- package/tsconfig.build.tsbuildinfo +1 -1
- package/types/academics.d.ts +3 -1
- package/types/admission.d.ts +7 -1
- package/types/enums.d.ts +14 -0
- package/types/enums.js +15 -0
- package/utils/government-id.d.ts +51 -0
- package/utils/government-id.js +71 -0
- package/utils/id-number.d.ts +10 -1
- package/utils/id-number.js +12 -1
|
@@ -37,7 +37,7 @@ export declare const useAdmissionModule: () => {
|
|
|
37
37
|
listLoading: boolean;
|
|
38
38
|
rowActions: RowAction[];
|
|
39
39
|
updateLoading: boolean;
|
|
40
|
-
uploadAdmissionDocuments: (files: File[], registrationCode: string) => Promise<string[]>;
|
|
40
|
+
uploadAdmissionDocuments: (files: File[], registrationCode: string, prefix?: string) => Promise<string[]>;
|
|
41
41
|
state: {
|
|
42
42
|
items: AdmissionBE[];
|
|
43
43
|
count: number;
|
|
@@ -48,7 +48,10 @@ export declare const useAdmissionModule: () => {
|
|
|
48
48
|
drawer: string | null;
|
|
49
49
|
errors: Record<string, string>;
|
|
50
50
|
id: string;
|
|
51
|
+
studentIdType: string;
|
|
51
52
|
studentIdNumber: string;
|
|
53
|
+
studentIdImages: string[];
|
|
54
|
+
studentIdImagesFiles: File[];
|
|
52
55
|
discountCodeId: string | null;
|
|
53
56
|
dob: string;
|
|
54
57
|
emergencyContact: string;
|
|
@@ -58,13 +61,19 @@ export declare const useAdmissionModule: () => {
|
|
|
58
61
|
lastName: string;
|
|
59
62
|
orphan: boolean;
|
|
60
63
|
registrationCode: string;
|
|
64
|
+
fatherIdType: string;
|
|
61
65
|
fatherIdNumber: string;
|
|
66
|
+
fatherIdImages: string[];
|
|
67
|
+
fatherIdImagesFiles: File[];
|
|
62
68
|
fatherFirstName: string;
|
|
63
69
|
fatherLastName: string;
|
|
64
70
|
fatherMobile: string;
|
|
65
71
|
fatherOccupation: string;
|
|
66
72
|
fatherOrganization: string;
|
|
73
|
+
motherIdType: string;
|
|
67
74
|
motherIdNumber: string;
|
|
75
|
+
motherIdImages: string[];
|
|
76
|
+
motherIdImagesFiles: File[];
|
|
68
77
|
motherFirstName: string;
|
|
69
78
|
motherLastName: string;
|
|
70
79
|
motherMobile: string;
|
|
@@ -19,6 +19,7 @@ import { fileToBase64 } from "../../../utils/file-to-base64";
|
|
|
19
19
|
import { compressPdf, DocumentTooLargeError, isPdfFile, MAX_DOCUMENT_SIZE_BYTES, } from "../../../utils/compress-pdf";
|
|
20
20
|
import { wakeStorageServer } from "../../../utils/wake-storage";
|
|
21
21
|
import { normalizeIdNumber } from "../../../utils/id-number";
|
|
22
|
+
import { isGovernmentIdType, } from "../../../utils/government-id";
|
|
22
23
|
import { toE164Phone } from "../../../utils/to-e164-phone";
|
|
23
24
|
import { Filter, Plus } from "lucide-react";
|
|
24
25
|
import { ADMISSION_DRAWER, ADMISSION_ACTION_TYPES, useAdmissionContext, } from "../context";
|
|
@@ -74,7 +75,9 @@ export const useAdmissionModule = () => {
|
|
|
74
75
|
address: state.address || "",
|
|
75
76
|
admissionNotes: state.admissionNotes || "",
|
|
76
77
|
admissionStatus: state.status || ADMISSION_STATUS.PENDING,
|
|
78
|
+
studentIdType: state.studentIdType || "",
|
|
77
79
|
studentIdNumber: state.studentIdNumber || "",
|
|
80
|
+
studentIdImages: state.studentIdImages || [],
|
|
78
81
|
city: state.city || "",
|
|
79
82
|
classForAdmission: state.classForAdmission || "",
|
|
80
83
|
country: state.country || "",
|
|
@@ -83,7 +86,9 @@ export const useAdmissionModule = () => {
|
|
|
83
86
|
documents: state.documents || [],
|
|
84
87
|
emergencyContact: state.emergencyContact || "",
|
|
85
88
|
enabled: (_a = state.enabled) !== null && _a !== void 0 ? _a : true,
|
|
89
|
+
fatherIdType: state.fatherIdType || "",
|
|
86
90
|
fatherIdNumber: state.fatherIdNumber || "",
|
|
91
|
+
fatherIdImages: state.fatherIdImages || [],
|
|
87
92
|
fatherFirstName: state.fatherFirstName || "",
|
|
88
93
|
fatherLastName: state.fatherLastName || "",
|
|
89
94
|
fatherMobile: toE164Phone(state.fatherMobile, (_b = workspace === null || workspace === void 0 ? void 0 : workspace.school) === null || _b === void 0 ? void 0 : _b.country),
|
|
@@ -94,7 +99,9 @@ export const useAdmissionModule = () => {
|
|
|
94
99
|
hafiz: (_c = state.hafiz) !== null && _c !== void 0 ? _c : false,
|
|
95
100
|
id: state.id || "",
|
|
96
101
|
lastName: state.lastName || "",
|
|
102
|
+
motherIdType: state.motherIdType || "",
|
|
97
103
|
motherIdNumber: state.motherIdNumber || "",
|
|
104
|
+
motherIdImages: state.motherIdImages || [],
|
|
98
105
|
motherFirstName: state.motherFirstName || "",
|
|
99
106
|
motherLastName: state.motherLastName || "",
|
|
100
107
|
motherMobile: toE164Phone(state.motherMobile, (_d = workspace === null || workspace === void 0 ? void 0 : workspace.school) === null || _d === void 0 ? void 0 : _d.country),
|
|
@@ -119,7 +126,9 @@ export const useAdmissionModule = () => {
|
|
|
119
126
|
state.emergencyContact,
|
|
120
127
|
state.enabled,
|
|
121
128
|
state.fatherFirstName,
|
|
129
|
+
state.fatherIdImages,
|
|
122
130
|
state.fatherIdNumber,
|
|
131
|
+
state.fatherIdType,
|
|
123
132
|
state.fatherLastName,
|
|
124
133
|
state.fatherMobile,
|
|
125
134
|
state.fatherOccupation,
|
|
@@ -130,7 +139,9 @@ export const useAdmissionModule = () => {
|
|
|
130
139
|
state.id,
|
|
131
140
|
state.lastName,
|
|
132
141
|
state.motherFirstName,
|
|
142
|
+
state.motherIdImages,
|
|
133
143
|
state.motherIdNumber,
|
|
144
|
+
state.motherIdType,
|
|
134
145
|
state.motherLastName,
|
|
135
146
|
state.motherMobile,
|
|
136
147
|
state.notes,
|
|
@@ -141,7 +152,9 @@ export const useAdmissionModule = () => {
|
|
|
141
152
|
state.siblings,
|
|
142
153
|
state.state,
|
|
143
154
|
state.status,
|
|
155
|
+
state.studentIdImages,
|
|
144
156
|
state.studentIdNumber,
|
|
157
|
+
state.studentIdType,
|
|
145
158
|
(_c = workspace === null || workspace === void 0 ? void 0 : workspace.school) === null || _c === void 0 ? void 0 : _c.country,
|
|
146
159
|
(_d = workspace === null || workspace === void 0 ? void 0 : workspace.school) === null || _d === void 0 ? void 0 : _d.id,
|
|
147
160
|
]);
|
|
@@ -212,7 +225,7 @@ export const useAdmissionModule = () => {
|
|
|
212
225
|
}
|
|
213
226
|
}, [resetFormAndCloseDrawer, showToast, t]);
|
|
214
227
|
const byIdCallback = useCallback(({ data, error }) => {
|
|
215
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12;
|
|
228
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21;
|
|
216
229
|
if (error) {
|
|
217
230
|
showToast(t("messagesDetailsFetchFailed"), TOAST_VARIANT.ERROR);
|
|
218
231
|
return;
|
|
@@ -228,9 +241,17 @@ export const useAdmissionModule = () => {
|
|
|
228
241
|
setField("id", admission.id);
|
|
229
242
|
setField("firstName", (_c = admission.studentDetails) === null || _c === void 0 ? void 0 : _c.firstName);
|
|
230
243
|
setField("lastName", (_d = admission.studentDetails) === null || _d === void 0 ? void 0 : _d.lastName);
|
|
231
|
-
setField("
|
|
244
|
+
setField("studentIdType", (_e = admission.studentDetails) === null || _e === void 0 ? void 0 : _e.studentIdType);
|
|
245
|
+
setField("studentIdNumber", (_f = admission.studentDetails) === null || _f === void 0 ? void 0 : _f.studentIdNumber);
|
|
246
|
+
dispatch({
|
|
247
|
+
type: ADMISSION_ACTION_TYPES.SET_INPUT_FIELD,
|
|
248
|
+
payload: {
|
|
249
|
+
key: "studentIdImages",
|
|
250
|
+
value: (_h = (_g = admission.studentDetails) === null || _g === void 0 ? void 0 : _g.studentIdImages) !== null && _h !== void 0 ? _h : [],
|
|
251
|
+
},
|
|
252
|
+
});
|
|
232
253
|
// Normalise gender to match GENDER enum values (e.g. 'Male' → 'MALE')
|
|
233
|
-
const rawGender = (
|
|
254
|
+
const rawGender = (_j = admission.studentDetails) === null || _j === void 0 ? void 0 : _j.gender;
|
|
234
255
|
let normalizedGender = null;
|
|
235
256
|
if (typeof rawGender === "string" && rawGender.length > 0) {
|
|
236
257
|
const upper = rawGender.toUpperCase();
|
|
@@ -239,43 +260,59 @@ export const useAdmissionModule = () => {
|
|
|
239
260
|
: rawGender;
|
|
240
261
|
}
|
|
241
262
|
setField("gender", normalizedGender);
|
|
242
|
-
setField("dob", (
|
|
243
|
-
setField("registrationCode", (
|
|
244
|
-
setField("discountCodeId", (
|
|
245
|
-
setField("hafiz", (
|
|
246
|
-
setField("orphan", (
|
|
247
|
-
setField("fatherFirstName", (
|
|
248
|
-
setField("fatherLastName", (
|
|
249
|
-
setField("
|
|
250
|
-
setField("
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
setField("
|
|
259
|
-
setField("
|
|
260
|
-
setField("
|
|
261
|
-
setField("
|
|
262
|
-
setField("
|
|
263
|
-
setField("
|
|
264
|
-
setField("
|
|
265
|
-
|
|
263
|
+
setField("dob", (_k = admission.studentDetails) === null || _k === void 0 ? void 0 : _k.dob);
|
|
264
|
+
setField("registrationCode", (_l = admission.studentDetails) === null || _l === void 0 ? void 0 : _l.registrationCode);
|
|
265
|
+
setField("discountCodeId", (_m = admission.studentDetails) === null || _m === void 0 ? void 0 : _m.discountCodeId);
|
|
266
|
+
setField("hafiz", (_o = admission.studentDetails) === null || _o === void 0 ? void 0 : _o.hafiz);
|
|
267
|
+
setField("orphan", (_p = admission.studentDetails) === null || _p === void 0 ? void 0 : _p.orphan);
|
|
268
|
+
setField("fatherFirstName", (_q = admission.fatherDetails) === null || _q === void 0 ? void 0 : _q.fatherFirstName);
|
|
269
|
+
setField("fatherLastName", (_r = admission.fatherDetails) === null || _r === void 0 ? void 0 : _r.fatherLastName);
|
|
270
|
+
setField("fatherIdType", (_s = admission.fatherDetails) === null || _s === void 0 ? void 0 : _s.fatherIdType);
|
|
271
|
+
setField("fatherIdNumber", (_t = admission.fatherDetails) === null || _t === void 0 ? void 0 : _t.fatherIdNumber);
|
|
272
|
+
dispatch({
|
|
273
|
+
type: ADMISSION_ACTION_TYPES.SET_INPUT_FIELD,
|
|
274
|
+
payload: {
|
|
275
|
+
key: "fatherIdImages",
|
|
276
|
+
value: (_v = (_u = admission.fatherDetails) === null || _u === void 0 ? void 0 : _u.fatherIdImages) !== null && _v !== void 0 ? _v : [],
|
|
277
|
+
},
|
|
278
|
+
});
|
|
279
|
+
setField("fatherMobile", (_x = (_w = admission.fatherDetails) === null || _w === void 0 ? void 0 : _w.fatherMobile) !== null && _x !== void 0 ? _x : undefined);
|
|
280
|
+
setField("fatherOccupation", (_y = admission.fatherDetails) === null || _y === void 0 ? void 0 : _y.fatherOccupation);
|
|
281
|
+
setField("fatherOrganization", (_z = admission.fatherDetails) === null || _z === void 0 ? void 0 : _z.fatherOrganization);
|
|
282
|
+
setField("motherFirstName", (_0 = admission.motherDetails) === null || _0 === void 0 ? void 0 : _0.motherFirstName);
|
|
283
|
+
setField("motherLastName", (_1 = admission.motherDetails) === null || _1 === void 0 ? void 0 : _1.motherLastName);
|
|
284
|
+
setField("motherIdType", (_2 = admission.motherDetails) === null || _2 === void 0 ? void 0 : _2.motherIdType);
|
|
285
|
+
setField("motherIdNumber", (_3 = admission.motherDetails) === null || _3 === void 0 ? void 0 : _3.motherIdNumber);
|
|
286
|
+
dispatch({
|
|
287
|
+
type: ADMISSION_ACTION_TYPES.SET_INPUT_FIELD,
|
|
288
|
+
payload: {
|
|
289
|
+
key: "motherIdImages",
|
|
290
|
+
value: (_5 = (_4 = admission.motherDetails) === null || _4 === void 0 ? void 0 : _4.motherIdImages) !== null && _5 !== void 0 ? _5 : [],
|
|
291
|
+
},
|
|
292
|
+
});
|
|
293
|
+
setField("motherMobile", (_7 = (_6 = admission.motherDetails) === null || _6 === void 0 ? void 0 : _6.motherMobile) !== null && _7 !== void 0 ? _7 : undefined);
|
|
294
|
+
setField("address", (_8 = admission.homeDetails) === null || _8 === void 0 ? void 0 : _8.address);
|
|
295
|
+
setField("city", (_9 = admission.homeDetails) === null || _9 === void 0 ? void 0 : _9.city);
|
|
296
|
+
setField("country", (_10 = admission.homeDetails) === null || _10 === void 0 ? void 0 : _10.country);
|
|
297
|
+
setField("postalCode", (_11 = admission.homeDetails) === null || _11 === void 0 ? void 0 : _11.postalCode);
|
|
298
|
+
setField("state", (_12 = admission.homeDetails) === null || _12 === void 0 ? void 0 : _12.state);
|
|
299
|
+
setField("notes", (_13 = admission.officeUse) === null || _13 === void 0 ? void 0 : _13.notes);
|
|
300
|
+
setField("admissionNotes", (_14 = admission.officeUse) === null || _14 === void 0 ? void 0 : _14.admissionNotes);
|
|
301
|
+
setField("previousSchool", (_15 = admission.admissionDetails) === null || _15 === void 0 ? void 0 : _15.previousSchool);
|
|
302
|
+
setField("siblings", (_16 = admission.admissionDetails) === null || _16 === void 0 ? void 0 : _16.siblings);
|
|
266
303
|
dispatch({
|
|
267
304
|
type: ADMISSION_ACTION_TYPES.SET_INPUT_FIELD,
|
|
268
305
|
payload: {
|
|
269
306
|
key: "documents",
|
|
270
|
-
value: (
|
|
307
|
+
value: (_18 = (_17 = admission.admissionDetails) === null || _17 === void 0 ? void 0 : _17.documents) !== null && _18 !== void 0 ? _18 : [],
|
|
271
308
|
},
|
|
272
309
|
});
|
|
273
|
-
setField("classForAdmission", (
|
|
310
|
+
setField("classForAdmission", (_19 = admission.admissionDetails) === null || _19 === void 0 ? void 0 : _19.classForAdmission);
|
|
274
311
|
setField("status", admission.status || ADMISSION_STATUS.PENDING);
|
|
275
|
-
setField("enabled", (
|
|
312
|
+
setField("enabled", (_20 = admission.enabled) !== null && _20 !== void 0 ? _20 : true);
|
|
276
313
|
// Populate AI analysis if present
|
|
277
|
-
const aiAnalysis = (
|
|
278
|
-
.aiAnalysis) !== null &&
|
|
314
|
+
const aiAnalysis = (_21 = admission
|
|
315
|
+
.aiAnalysis) !== null && _21 !== void 0 ? _21 : null;
|
|
279
316
|
dispatch({
|
|
280
317
|
type: ADMISSION_ACTION_TYPES.SET_FORM_DATA,
|
|
281
318
|
payload: { form: { aiAnalysis } },
|
|
@@ -293,7 +330,7 @@ export const useAdmissionModule = () => {
|
|
|
293
330
|
(_a = listFetchNowRef.current) === null || _a === void 0 ? void 0 : _a.call(listFetchNowRef);
|
|
294
331
|
}
|
|
295
332
|
}, [showToast, t]);
|
|
296
|
-
const uploadAdmissionDocuments = useCallback(async (files, registrationCode) => {
|
|
333
|
+
const uploadAdmissionDocuments = useCallback(async (files, registrationCode, prefix) => {
|
|
297
334
|
var _a;
|
|
298
335
|
const schoolId = (_a = workspace === null || workspace === void 0 ? void 0 : workspace.school) === null || _a === void 0 ? void 0 : _a.id;
|
|
299
336
|
if (!schoolId) {
|
|
@@ -306,7 +343,7 @@ export const useAdmissionModule = () => {
|
|
|
306
343
|
}
|
|
307
344
|
}
|
|
308
345
|
const payload = await Promise.all(prepared.map(async (file) => ({
|
|
309
|
-
fileName: file.name,
|
|
346
|
+
fileName: prefix ? `${prefix}-${file.name}` : file.name,
|
|
310
347
|
contentType: file.type || "application/octet-stream",
|
|
311
348
|
fileBase64: await fileToBase64(file),
|
|
312
349
|
})));
|
|
@@ -524,6 +561,7 @@ export const useAdmissionModule = () => {
|
|
|
524
561
|
const pdfData = {
|
|
525
562
|
firstName: studentDetails.firstName || "",
|
|
526
563
|
lastName: studentDetails.lastName || "",
|
|
564
|
+
studentIdType: studentDetails.studentIdType || "",
|
|
527
565
|
studentIdNumber: studentDetails.studentIdNumber || "",
|
|
528
566
|
gender: studentDetails.gender || "",
|
|
529
567
|
dob: studentDetails.dob || "",
|
|
@@ -533,12 +571,14 @@ export const useAdmissionModule = () => {
|
|
|
533
571
|
: undefined,
|
|
534
572
|
fatherFirstName: fatherDetails.fatherFirstName || "",
|
|
535
573
|
fatherLastName: fatherDetails.fatherLastName || "",
|
|
574
|
+
fatherIdType: fatherDetails.fatherIdType || "",
|
|
536
575
|
fatherIdNumber: fatherDetails.fatherIdNumber || "",
|
|
537
576
|
fatherMobile: fatherDetails.fatherMobile || "",
|
|
538
577
|
fatherOccupation: fatherDetails.fatherOccupation,
|
|
539
578
|
fatherOrganization: fatherDetails.fatherOrganization,
|
|
540
579
|
motherFirstName: motherDetails.motherFirstName || "",
|
|
541
580
|
motherLastName: motherDetails.motherLastName || "",
|
|
581
|
+
motherIdType: motherDetails.motherIdType || "",
|
|
542
582
|
motherIdNumber: motherDetails.motherIdNumber || "",
|
|
543
583
|
motherMobile: motherDetails.motherMobile || "",
|
|
544
584
|
address: homeDetails.address || "",
|
|
@@ -732,6 +772,33 @@ export const useAdmissionModule = () => {
|
|
|
732
772
|
...(await uploadAdmissionDocuments(state.documentsFiles, updateParams.registrationCode)),
|
|
733
773
|
]
|
|
734
774
|
: state.documents || [];
|
|
775
|
+
const studentIdImages = state.studentIdImagesFiles.length
|
|
776
|
+
? [
|
|
777
|
+
...(state.studentIdImages || []),
|
|
778
|
+
...(await uploadAdmissionDocuments(state.studentIdImagesFiles, updateParams.registrationCode, "student-id")),
|
|
779
|
+
]
|
|
780
|
+
: state.studentIdImages || [];
|
|
781
|
+
const fatherIdImages = state.fatherIdImagesFiles.length
|
|
782
|
+
? [
|
|
783
|
+
...(state.fatherIdImages || []),
|
|
784
|
+
...(await uploadAdmissionDocuments(state.fatherIdImagesFiles, updateParams.registrationCode, "father-id")),
|
|
785
|
+
]
|
|
786
|
+
: state.fatherIdImages || [];
|
|
787
|
+
const motherIdImages = state.motherIdImagesFiles.length
|
|
788
|
+
? [
|
|
789
|
+
...(state.motherIdImages || []),
|
|
790
|
+
...(await uploadAdmissionDocuments(state.motherIdImagesFiles, updateParams.registrationCode, "mother-id")),
|
|
791
|
+
]
|
|
792
|
+
: state.motherIdImages || [];
|
|
793
|
+
const studentIdType = isGovernmentIdType(updateParams.studentIdType)
|
|
794
|
+
? updateParams.studentIdType
|
|
795
|
+
: undefined;
|
|
796
|
+
const fatherIdType = isGovernmentIdType(updateParams.fatherIdType)
|
|
797
|
+
? updateParams.fatherIdType
|
|
798
|
+
: undefined;
|
|
799
|
+
const motherIdType = isGovernmentIdType(updateParams.motherIdType)
|
|
800
|
+
? updateParams.motherIdType
|
|
801
|
+
: undefined;
|
|
735
802
|
dispatch({
|
|
736
803
|
type: ADMISSION_ACTION_TYPES.SET_INPUT_FIELD,
|
|
737
804
|
payload: { key: "documents", value: merged },
|
|
@@ -740,6 +807,30 @@ export const useAdmissionModule = () => {
|
|
|
740
807
|
type: ADMISSION_ACTION_TYPES.SET_INPUT_FIELD,
|
|
741
808
|
payload: { key: "documentsFiles", value: [] },
|
|
742
809
|
});
|
|
810
|
+
dispatch({
|
|
811
|
+
type: ADMISSION_ACTION_TYPES.SET_INPUT_FIELD,
|
|
812
|
+
payload: { key: "studentIdImages", value: studentIdImages },
|
|
813
|
+
});
|
|
814
|
+
dispatch({
|
|
815
|
+
type: ADMISSION_ACTION_TYPES.SET_INPUT_FIELD,
|
|
816
|
+
payload: { key: "fatherIdImages", value: fatherIdImages },
|
|
817
|
+
});
|
|
818
|
+
dispatch({
|
|
819
|
+
type: ADMISSION_ACTION_TYPES.SET_INPUT_FIELD,
|
|
820
|
+
payload: { key: "motherIdImages", value: motherIdImages },
|
|
821
|
+
});
|
|
822
|
+
dispatch({
|
|
823
|
+
type: ADMISSION_ACTION_TYPES.SET_INPUT_FIELD,
|
|
824
|
+
payload: { key: "studentIdImagesFiles", value: [] },
|
|
825
|
+
});
|
|
826
|
+
dispatch({
|
|
827
|
+
type: ADMISSION_ACTION_TYPES.SET_INPUT_FIELD,
|
|
828
|
+
payload: { key: "fatherIdImagesFiles", value: [] },
|
|
829
|
+
});
|
|
830
|
+
dispatch({
|
|
831
|
+
type: ADMISSION_ACTION_TYPES.SET_INPUT_FIELD,
|
|
832
|
+
payload: { key: "motherIdImagesFiles", value: [] },
|
|
833
|
+
});
|
|
743
834
|
updateFetchNow(undefined, {
|
|
744
835
|
body: JSON.stringify({
|
|
745
836
|
// Without the id the API would create a duplicate on every edit.
|
|
@@ -752,7 +843,9 @@ export const useAdmissionModule = () => {
|
|
|
752
843
|
documents: merged,
|
|
753
844
|
},
|
|
754
845
|
fatherDetails: {
|
|
755
|
-
|
|
846
|
+
fatherIdType: fatherIdType !== null && fatherIdType !== void 0 ? fatherIdType : null,
|
|
847
|
+
fatherIdNumber: normalizeIdNumber(updateParams.fatherIdNumber, fatherIdType),
|
|
848
|
+
fatherIdImages,
|
|
756
849
|
fatherFirstName: updateParams.fatherFirstName,
|
|
757
850
|
fatherLastName: updateParams.fatherLastName,
|
|
758
851
|
fatherMobile: updateParams.fatherMobile,
|
|
@@ -761,7 +854,9 @@ export const useAdmissionModule = () => {
|
|
|
761
854
|
emergencyContact: updateParams.emergencyContact === "Father",
|
|
762
855
|
},
|
|
763
856
|
motherDetails: {
|
|
764
|
-
|
|
857
|
+
motherIdType: motherIdType !== null && motherIdType !== void 0 ? motherIdType : null,
|
|
858
|
+
motherIdNumber: normalizeIdNumber(updateParams.motherIdNumber || "", motherIdType),
|
|
859
|
+
motherIdImages,
|
|
765
860
|
motherFirstName: updateParams.motherFirstName || "N/A",
|
|
766
861
|
motherLastName: updateParams.motherLastName || "N/A",
|
|
767
862
|
motherMobile: updateParams.motherMobile,
|
|
@@ -779,7 +874,9 @@ export const useAdmissionModule = () => {
|
|
|
779
874
|
admissionNotes: updateParams.admissionNotes,
|
|
780
875
|
},
|
|
781
876
|
studentDetails: {
|
|
782
|
-
|
|
877
|
+
studentIdType: studentIdType !== null && studentIdType !== void 0 ? studentIdType : null,
|
|
878
|
+
studentIdNumber: normalizeIdNumber(updateParams.studentIdNumber, studentIdType),
|
|
879
|
+
studentIdImages,
|
|
783
880
|
discountCodeId: updateParams.discountCodeId,
|
|
784
881
|
dob: updateParams.dob,
|
|
785
882
|
firstName: updateParams.firstName,
|
|
@@ -822,6 +919,12 @@ export const useAdmissionModule = () => {
|
|
|
822
919
|
updateFetchNow,
|
|
823
920
|
state.documents,
|
|
824
921
|
state.documentsFiles,
|
|
922
|
+
state.studentIdImages,
|
|
923
|
+
state.studentIdImagesFiles,
|
|
924
|
+
state.fatherIdImages,
|
|
925
|
+
state.fatherIdImagesFiles,
|
|
926
|
+
state.motherIdImages,
|
|
927
|
+
state.motherIdImagesFiles,
|
|
825
928
|
uploadAdmissionDocuments,
|
|
826
929
|
(_o = workspace === null || workspace === void 0 ? void 0 : workspace.school) === null || _o === void 0 ? void 0 : _o.id,
|
|
827
930
|
]);
|
|
@@ -27,7 +27,10 @@ export declare const ADMISSION_ACTION_TYPES: {
|
|
|
27
27
|
drawer: string | null;
|
|
28
28
|
errors: Record<string, string>;
|
|
29
29
|
id: string;
|
|
30
|
+
studentIdType: string;
|
|
30
31
|
studentIdNumber: string;
|
|
32
|
+
studentIdImages: string[];
|
|
33
|
+
studentIdImagesFiles: File[];
|
|
31
34
|
discountCodeId: string | null;
|
|
32
35
|
dob: string;
|
|
33
36
|
emergencyContact: string;
|
|
@@ -37,13 +40,19 @@ export declare const ADMISSION_ACTION_TYPES: {
|
|
|
37
40
|
lastName: string;
|
|
38
41
|
orphan: boolean;
|
|
39
42
|
registrationCode: string;
|
|
43
|
+
fatherIdType: string;
|
|
40
44
|
fatherIdNumber: string;
|
|
45
|
+
fatherIdImages: string[];
|
|
46
|
+
fatherIdImagesFiles: File[];
|
|
41
47
|
fatherFirstName: string;
|
|
42
48
|
fatherLastName: string;
|
|
43
49
|
fatherMobile: string;
|
|
44
50
|
fatherOccupation: string;
|
|
45
51
|
fatherOrganization: string;
|
|
52
|
+
motherIdType: string;
|
|
46
53
|
motherIdNumber: string;
|
|
54
|
+
motherIdImages: string[];
|
|
55
|
+
motherIdImagesFiles: File[];
|
|
47
56
|
motherFirstName: string;
|
|
48
57
|
motherLastName: string;
|
|
49
58
|
motherMobile: string;
|
|
@@ -85,7 +94,10 @@ export declare const ADMISSION_ACTION_TYPES: {
|
|
|
85
94
|
drawer: string | null;
|
|
86
95
|
errors: Record<string, string>;
|
|
87
96
|
id: string;
|
|
97
|
+
studentIdType: string;
|
|
88
98
|
studentIdNumber: string;
|
|
99
|
+
studentIdImages: string[];
|
|
100
|
+
studentIdImagesFiles: File[];
|
|
89
101
|
discountCodeId: string | null;
|
|
90
102
|
dob: string;
|
|
91
103
|
emergencyContact: string;
|
|
@@ -95,13 +107,19 @@ export declare const ADMISSION_ACTION_TYPES: {
|
|
|
95
107
|
lastName: string;
|
|
96
108
|
orphan: boolean;
|
|
97
109
|
registrationCode: string;
|
|
110
|
+
fatherIdType: string;
|
|
98
111
|
fatherIdNumber: string;
|
|
112
|
+
fatherIdImages: string[];
|
|
113
|
+
fatherIdImagesFiles: File[];
|
|
99
114
|
fatherFirstName: string;
|
|
100
115
|
fatherLastName: string;
|
|
101
116
|
fatherMobile: string;
|
|
102
117
|
fatherOccupation: string;
|
|
103
118
|
fatherOrganization: string;
|
|
119
|
+
motherIdType: string;
|
|
104
120
|
motherIdNumber: string;
|
|
121
|
+
motherIdImages: string[];
|
|
122
|
+
motherIdImagesFiles: File[];
|
|
105
123
|
motherFirstName: string;
|
|
106
124
|
motherLastName: string;
|
|
107
125
|
motherMobile: string;
|
|
@@ -145,7 +163,10 @@ export declare const ADMISSION_ACTION_TYPES: {
|
|
|
145
163
|
drawer: string | null;
|
|
146
164
|
errors: Record<string, string>;
|
|
147
165
|
id: string;
|
|
166
|
+
studentIdType: string;
|
|
148
167
|
studentIdNumber: string;
|
|
168
|
+
studentIdImages: string[];
|
|
169
|
+
studentIdImagesFiles: File[];
|
|
149
170
|
discountCodeId: string | null;
|
|
150
171
|
dob: string;
|
|
151
172
|
emergencyContact: string;
|
|
@@ -155,13 +176,19 @@ export declare const ADMISSION_ACTION_TYPES: {
|
|
|
155
176
|
lastName: string;
|
|
156
177
|
orphan: boolean;
|
|
157
178
|
registrationCode: string;
|
|
179
|
+
fatherIdType: string;
|
|
158
180
|
fatherIdNumber: string;
|
|
181
|
+
fatherIdImages: string[];
|
|
182
|
+
fatherIdImagesFiles: File[];
|
|
159
183
|
fatherFirstName: string;
|
|
160
184
|
fatherLastName: string;
|
|
161
185
|
fatherMobile: string;
|
|
162
186
|
fatherOccupation: string;
|
|
163
187
|
fatherOrganization: string;
|
|
188
|
+
motherIdType: string;
|
|
164
189
|
motherIdNumber: string;
|
|
190
|
+
motherIdImages: string[];
|
|
191
|
+
motherIdImagesFiles: File[];
|
|
165
192
|
motherFirstName: string;
|
|
166
193
|
motherLastName: string;
|
|
167
194
|
motherMobile: string;
|
|
@@ -203,7 +230,10 @@ export declare const ADMISSION_ACTION_TYPES: {
|
|
|
203
230
|
drawer: string | null;
|
|
204
231
|
errors: Record<string, string>;
|
|
205
232
|
id: string;
|
|
233
|
+
studentIdType: string;
|
|
206
234
|
studentIdNumber: string;
|
|
235
|
+
studentIdImages: string[];
|
|
236
|
+
studentIdImagesFiles: File[];
|
|
207
237
|
discountCodeId: string | null;
|
|
208
238
|
dob: string;
|
|
209
239
|
emergencyContact: string;
|
|
@@ -213,13 +243,19 @@ export declare const ADMISSION_ACTION_TYPES: {
|
|
|
213
243
|
lastName: string;
|
|
214
244
|
orphan: boolean;
|
|
215
245
|
registrationCode: string;
|
|
246
|
+
fatherIdType: string;
|
|
216
247
|
fatherIdNumber: string;
|
|
248
|
+
fatherIdImages: string[];
|
|
249
|
+
fatherIdImagesFiles: File[];
|
|
217
250
|
fatherFirstName: string;
|
|
218
251
|
fatherLastName: string;
|
|
219
252
|
fatherMobile: string;
|
|
220
253
|
fatherOccupation: string;
|
|
221
254
|
fatherOrganization: string;
|
|
255
|
+
motherIdType: string;
|
|
222
256
|
motherIdNumber: string;
|
|
257
|
+
motherIdImages: string[];
|
|
258
|
+
motherIdImagesFiles: File[];
|
|
223
259
|
motherFirstName: string;
|
|
224
260
|
motherLastName: string;
|
|
225
261
|
motherMobile: string;
|
|
@@ -261,7 +297,10 @@ export declare const ADMISSION_ACTION_TYPES: {
|
|
|
261
297
|
drawer: string | null;
|
|
262
298
|
errors: Record<string, string>;
|
|
263
299
|
id: string;
|
|
300
|
+
studentIdType: string;
|
|
264
301
|
studentIdNumber: string;
|
|
302
|
+
studentIdImages: string[];
|
|
303
|
+
studentIdImagesFiles: File[];
|
|
265
304
|
discountCodeId: string | null;
|
|
266
305
|
dob: string;
|
|
267
306
|
emergencyContact: string;
|
|
@@ -271,13 +310,19 @@ export declare const ADMISSION_ACTION_TYPES: {
|
|
|
271
310
|
lastName: string;
|
|
272
311
|
orphan: boolean;
|
|
273
312
|
registrationCode: string;
|
|
313
|
+
fatherIdType: string;
|
|
274
314
|
fatherIdNumber: string;
|
|
315
|
+
fatherIdImages: string[];
|
|
316
|
+
fatherIdImagesFiles: File[];
|
|
275
317
|
fatherFirstName: string;
|
|
276
318
|
fatherLastName: string;
|
|
277
319
|
fatherMobile: string;
|
|
278
320
|
fatherOccupation: string;
|
|
279
321
|
fatherOrganization: string;
|
|
322
|
+
motherIdType: string;
|
|
280
323
|
motherIdNumber: string;
|
|
324
|
+
motherIdImages: string[];
|
|
325
|
+
motherIdImagesFiles: File[];
|
|
281
326
|
motherFirstName: string;
|
|
282
327
|
motherLastName: string;
|
|
283
328
|
motherMobile: string;
|
|
@@ -51,7 +51,10 @@ const admissionConfig = {
|
|
|
51
51
|
errors: {},
|
|
52
52
|
// Form — student detail
|
|
53
53
|
id: "",
|
|
54
|
+
studentIdType: "",
|
|
54
55
|
studentIdNumber: "",
|
|
56
|
+
studentIdImages: [],
|
|
57
|
+
studentIdImagesFiles: [],
|
|
55
58
|
discountCodeId: null,
|
|
56
59
|
dob: new Date().toISOString().slice(0, 10),
|
|
57
60
|
emergencyContact: "Mother",
|
|
@@ -62,14 +65,20 @@ const admissionConfig = {
|
|
|
62
65
|
orphan: false,
|
|
63
66
|
registrationCode: "",
|
|
64
67
|
// Form — father detail
|
|
68
|
+
fatherIdType: "",
|
|
65
69
|
fatherIdNumber: "",
|
|
70
|
+
fatherIdImages: [],
|
|
71
|
+
fatherIdImagesFiles: [],
|
|
66
72
|
fatherFirstName: "",
|
|
67
73
|
fatherLastName: "",
|
|
68
74
|
fatherMobile: "",
|
|
69
75
|
fatherOccupation: "",
|
|
70
76
|
fatherOrganization: "",
|
|
71
77
|
// Form — mother detail
|
|
78
|
+
motherIdType: "",
|
|
72
79
|
motherIdNumber: "",
|
|
80
|
+
motherIdImages: [],
|
|
81
|
+
motherIdImagesFiles: [],
|
|
73
82
|
motherFirstName: "",
|
|
74
83
|
motherLastName: "",
|
|
75
84
|
motherMobile: "",
|