@appcorp/fusion-storybook 0.2.88 → 0.2.90

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.
Files changed (146) hide show
  1. package/base-modules/admission/filter.js +3 -3
  2. package/base-modules/admission/form.js +1 -1
  3. package/base-modules/admission/more-actions.js +288 -2
  4. package/base-modules/admission/view.js +1 -1
  5. package/base-modules/attendance/form.js +3 -3
  6. package/base-modules/campus/form.js +2 -1
  7. package/base-modules/campus/validate.d.ts +13 -5
  8. package/base-modules/campus/validate.js +24 -19
  9. package/base-modules/class/form.js +2 -1
  10. package/base-modules/class/more-actions.js +2 -2
  11. package/base-modules/class/validate.d.ts +10 -5
  12. package/base-modules/class/validate.js +18 -16
  13. package/base-modules/class/view.js +2 -2
  14. package/base-modules/course/form.js +2 -1
  15. package/base-modules/course/validate.d.ts +7 -5
  16. package/base-modules/course/validate.js +12 -13
  17. package/base-modules/course/view.js +3 -3
  18. package/base-modules/discount-code/constants.d.ts +1 -1
  19. package/base-modules/discount-code/constants.js +1 -1
  20. package/base-modules/discount-code/form.js +2 -1
  21. package/base-modules/discount-code/more-actions.js +1 -1
  22. package/base-modules/discount-code/page.d.ts +10 -10
  23. package/base-modules/discount-code/page.js +31 -31
  24. package/base-modules/discount-code/validate.d.ts +5 -0
  25. package/base-modules/discount-code/validate.js +8 -3
  26. package/base-modules/discount-code/view.js +2 -2
  27. package/base-modules/enrollment/form.js +3 -2
  28. package/base-modules/enrollment/more-actions.js +5 -5
  29. package/base-modules/enrollment/page.d.ts +10 -10
  30. package/base-modules/enrollment/page.js +31 -31
  31. package/base-modules/enrollment/validate.d.ts +6 -0
  32. package/base-modules/enrollment/validate.js +13 -5
  33. package/base-modules/enrollment/view.js +2 -2
  34. package/base-modules/expense/filter.js +1 -1
  35. package/base-modules/expense/form.js +3 -3
  36. package/base-modules/expense/more-actions.js +6 -6
  37. package/base-modules/expense/page.d.ts +11 -11
  38. package/base-modules/expense/page.js +34 -34
  39. package/base-modules/expense/validate.d.ts +8 -0
  40. package/base-modules/expense/validate.js +13 -5
  41. package/base-modules/expense/view.js +2 -2
  42. package/base-modules/family/context.js +1 -1
  43. package/base-modules/family/form.js +1 -1
  44. package/base-modules/family/more-actions.js +2 -2
  45. package/base-modules/family/page.d.ts +10 -10
  46. package/base-modules/family/page.js +31 -31
  47. package/base-modules/family/validate.d.ts +4 -0
  48. package/base-modules/family/validate.js +8 -1
  49. package/base-modules/family/view.js +1 -1
  50. package/base-modules/family-member/context.js +1 -1
  51. package/base-modules/family-member/form.js +2 -1
  52. package/base-modules/family-member/more-actions.js +5 -5
  53. package/base-modules/family-member/page.d.ts +40 -13
  54. package/base-modules/family-member/page.js +34 -34
  55. package/base-modules/family-member/validate.d.ts +8 -0
  56. package/base-modules/family-member/validate.js +20 -5
  57. package/base-modules/family-member/view.js +3 -3
  58. package/base-modules/fee-structure/form.js +5 -4
  59. package/base-modules/fee-structure/more-actions.js +2 -2
  60. package/base-modules/fee-structure/page.d.ts +11 -11
  61. package/base-modules/fee-structure/page.js +34 -34
  62. package/base-modules/fee-structure/validate.d.ts +6 -0
  63. package/base-modules/fee-structure/validate.js +12 -3
  64. package/base-modules/fee-structure/view.js +3 -3
  65. package/base-modules/rbac/assign-permissions.js +9 -5
  66. package/base-modules/rbac/filter.js +5 -3
  67. package/base-modules/rbac/form.js +2 -1
  68. package/base-modules/rbac/more-actions.d.ts +0 -5
  69. package/base-modules/rbac/more-actions.js +3 -1
  70. package/base-modules/rbac/validate.d.ts +3 -0
  71. package/base-modules/rbac/validate.js +7 -1
  72. package/base-modules/rbac/view.js +7 -5
  73. package/base-modules/school/drawer.js +3 -1
  74. package/base-modules/school/form.js +2 -1
  75. package/base-modules/school/validate.d.ts +8 -0
  76. package/base-modules/school/validate.js +17 -6
  77. package/base-modules/school/view.js +2 -2
  78. package/base-modules/section/filter.js +1 -1
  79. package/base-modules/section/form.js +3 -2
  80. package/base-modules/section/page.d.ts +8 -8
  81. package/base-modules/section/page.js +25 -25
  82. package/base-modules/section/validate.d.ts +7 -0
  83. package/base-modules/section/validate.js +15 -5
  84. package/base-modules/section/view.js +3 -3
  85. package/base-modules/student-fee/filter.js +1 -1
  86. package/base-modules/student-fee/form.js +3 -2
  87. package/base-modules/student-fee/page.d.ts +13 -13
  88. package/base-modules/student-fee/page.js +40 -40
  89. package/base-modules/student-fee/validate.d.ts +11 -3
  90. package/base-modules/student-fee/validate.js +20 -12
  91. package/base-modules/student-fee/view.js +4 -4
  92. package/base-modules/student-profile/context/use-student-profile-module.js +2 -2
  93. package/base-modules/student-profile/filter.js +2 -2
  94. package/base-modules/student-profile/form.js +6 -5
  95. package/base-modules/student-profile/page.d.ts +10 -10
  96. package/base-modules/student-profile/page.js +31 -31
  97. package/base-modules/student-profile/validate.d.ts +8 -2
  98. package/base-modules/student-profile/validate.js +13 -10
  99. package/base-modules/student-profile/view.js +2 -2
  100. package/base-modules/subject/filter.js +1 -1
  101. package/base-modules/subject/form.js +2 -1
  102. package/base-modules/subject/more-actions.js +3 -3
  103. package/base-modules/subject/page.d.ts +9 -9
  104. package/base-modules/subject/page.js +28 -28
  105. package/base-modules/subject/validate.d.ts +12 -1
  106. package/base-modules/subject/validate.js +24 -10
  107. package/base-modules/subject/view.js +3 -3
  108. package/base-modules/teacher/context.js +3 -3
  109. package/base-modules/teacher/filter.js +1 -1
  110. package/base-modules/teacher/form.js +9 -32
  111. package/base-modules/teacher/more-actions.js +2 -2
  112. package/base-modules/teacher/page.d.ts +10 -10
  113. package/base-modules/teacher/page.js +31 -31
  114. package/base-modules/teacher/validate.d.ts +5 -1
  115. package/base-modules/teacher/validate.js +10 -25
  116. package/base-modules/teacher/view.js +3 -3
  117. package/base-modules/user/filter.js +1 -1
  118. package/base-modules/user/form.js +3 -2
  119. package/base-modules/user/page.d.ts +9 -9
  120. package/base-modules/user/page.js +28 -28
  121. package/base-modules/user/validate.d.ts +8 -1
  122. package/base-modules/user/validate.js +16 -6
  123. package/base-modules/user/view.js +1 -1
  124. package/base-modules/workspace/context.js +3 -3
  125. package/base-modules/workspace/drawer.js +1 -1
  126. package/base-modules/workspace/filter.js +1 -1
  127. package/base-modules/workspace/form.js +6 -1
  128. package/base-modules/workspace/more-actions.js +1 -1
  129. package/base-modules/workspace/page.d.ts +1 -1
  130. package/base-modules/workspace/page.js +2 -2
  131. package/base-modules/workspace/validate.d.ts +4 -0
  132. package/base-modules/workspace/validate.js +6 -2
  133. package/base-modules/workspace/view.js +2 -2
  134. package/base-modules/workspace-user/context.js +6 -6
  135. package/base-modules/workspace-user/form.js +2 -1
  136. package/base-modules/workspace-user/page.d.ts +9 -9
  137. package/base-modules/workspace-user/page.js +28 -28
  138. package/base-modules/workspace-user/validate.d.ts +4 -5
  139. package/base-modules/workspace-user/validate.js +6 -10
  140. package/base-modules/workspace-user/view.js +1 -1
  141. package/constants.d.ts +5 -1
  142. package/constants.js +2 -0
  143. package/package.json +1 -1
  144. package/tsconfig.build.tsbuildinfo +1 -1
  145. package/utils/get-translated-error.d.ts +5 -0
  146. package/utils/get-translated-error.js +5 -0
@@ -19,6 +19,7 @@ import { API_METHODS, DATE_FORMATS, formatDate, } from "@react-pakistan/util-fun
19
19
  import { DISCOUNT_TYPE, } from "../../type";
20
20
  import { useTranslations } from "next-intl";
21
21
  import { useFetch } from "@react-pakistan/util-functions/hooks/use-fetch";
22
+ import { getTranslatedError } from "../../utils/get-translated-error";
22
23
  export const StudentFeeForm = () => {
23
24
  var _a, _b, _c, _d, _e;
24
25
  const { state, handleChange } = useStudentFeeModule();
@@ -128,7 +129,7 @@ export const StudentFeeForm = () => {
128
129
  emptyText: t("formNoStatusEmpty"),
129
130
  id: "status",
130
131
  info: t("formStatusInfo"),
131
- label: t("formOptionStatus"),
132
+ label: t("formStatusLabel"),
132
133
  onValueChange: (value) => handleChange("status", value),
133
134
  options: PAYMENT_STATUS_OPTIONS.map((opt) => ({
134
135
  value: opt.value,
@@ -147,5 +148,5 @@ export const StudentFeeForm = () => {
147
148
  },
148
149
  value: status,
149
150
  });
150
- return (_jsxs("div", { className: "grid grid-cols-1 gap-4", children: [studentProfileIdCombo, feeStructureIdCombo, discountCodeIdCombo, _jsx(EnhancedInput, { error: errors.discountAmount, id: "discountAmount", info: t("formDiscountAmountInfo"), label: t("formDiscountAmountLabel"), min: "0", onChange: (e) => handleChange("discountAmount", Number(e.target.value)), placeholder: "0.00", required: true, step: "0.01", type: "number", value: discountAmount || 0 }), _jsx(EnhancedInput, { error: errors.amount, id: "amount", info: t("formTotalAmountInfo"), label: t("formTotalAmountLabel"), min: "0", onChange: (e) => handleChange("amount", Number(e.target.value)), placeholder: "0.00", required: true, step: "0.01", type: "number", value: amount }), _jsx(EnhancedInput, { error: errors.amountPaid, id: "amountPaid", info: t("formAmountPaidInfo"), label: t("formAmountPaidLabel"), min: "0", onChange: (e) => handleChange("amountPaid", Number(e.target.value)), placeholder: "0.00", step: "0.01", type: "number", value: amountPaid }), _jsx(EnhancedInput, { disabled: true, error: errors.amountDue, id: "amountDue", info: t("formAmountDueInfo"), label: t("formAmountDueLabel"), min: "0", onChange: (e) => handleChange("amountDue", Number(e.target.value)), placeholder: "0.00", step: "0.01", type: "number", value: amountDue }), _jsx(EnhancedInput, { error: errors.dueDate, id: "dueDate", info: t("formDueDateInfo"), label: t("formDueDateLabel"), onChange: (e) => handleChange("dueDate", e.target.value), required: true, type: "date", value: formatDate(dueDate, DATE_FORMATS.YYYY_MM_DD) }), statusCombo, _jsx(EnhancedTextarea, { error: errors.remarks, id: "remarks", label: t("formRemarksLabel"), onChange: (e) => handleChange("remarks", e.target.value), placeholder: t("formRemarksPlaceholder"), value: remarks || "" }), _jsx(EnhancedCheckbox, { checked: enabled, error: errors.enabled, id: "enabled", info: t("formEnabledInfo"), label: t("badgeActive"), onCheckedChange: (checked) => handleChange("enabled", !!checked) })] }));
151
+ return (_jsxs("div", { className: "grid grid-cols-1 gap-4", children: [studentProfileIdCombo, feeStructureIdCombo, discountCodeIdCombo, _jsx(EnhancedInput, { error: errors.discountAmount, id: "discountAmount", info: t("formDiscountAmountInfo"), label: t("formDiscountAmountLabel"), min: "0", onChange: (e) => handleChange("discountAmount", Number(e.target.value)), placeholder: "0.00", required: true, step: "0.01", type: "number", value: discountAmount || 0 }), _jsx(EnhancedInput, { error: getTranslatedError({ errors, key: "amount", t }), id: "amount", info: t("formTotalAmountInfo"), label: t("formTotalAmountLabel"), min: "0", onChange: (e) => handleChange("amount", Number(e.target.value)), placeholder: "0.00", required: true, step: "0.01", type: "number", value: amount }), _jsx(EnhancedInput, { error: getTranslatedError({ errors, key: "amountPaid", t }), id: "amountPaid", info: t("formAmountPaidInfo"), label: t("formAmountPaidLabel"), min: "0", onChange: (e) => handleChange("amountPaid", Number(e.target.value)), placeholder: "0.00", step: "0.01", type: "number", value: amountPaid }), _jsx(EnhancedInput, { disabled: true, error: getTranslatedError({ errors, key: "amountDue", t }), id: "amountDue", info: t("formAmountDueInfo"), label: t("formAmountDueLabel"), min: "0", onChange: (e) => handleChange("amountDue", Number(e.target.value)), placeholder: "0.00", step: "0.01", type: "number", value: amountDue }), _jsx(EnhancedInput, { error: getTranslatedError({ errors, key: "dueDate", t }), id: "dueDate", info: t("formDueDateInfo"), label: t("formDueDateLabel"), onChange: (e) => handleChange("dueDate", e.target.value), required: true, type: "date", value: formatDate(dueDate, DATE_FORMATS.YYYY_MM_DD) }), statusCombo, _jsx(EnhancedTextarea, { error: getTranslatedError({ errors, key: "remarks", t }), id: "remarks", label: t("formRemarksLabel"), onChange: (e) => handleChange("remarks", e.target.value), placeholder: t("formRemarksPlaceholder"), value: remarks || "" }), _jsx(EnhancedCheckbox, { checked: enabled, error: getTranslatedError({ errors, key: "enabled", t }), id: "enabled", info: t("formEnabledInfo"), label: t("formEnabledLabel"), onCheckedChange: (checked) => handleChange("enabled", !!checked) })] }));
151
152
  };
@@ -15,7 +15,8 @@
15
15
  import { FC } from "react";
16
16
  import { USER_ROLE } from "../../type";
17
17
  interface Props {
18
- cancelLabel: string;
18
+ drawerButtonCancel: string;
19
+ drawerButtonSave: string;
19
20
  drawerFilterDescription: string;
20
21
  drawerFilterTitle: string;
21
22
  drawerFormDescription: string;
@@ -24,19 +25,18 @@ interface Props {
24
25
  drawerMoreActionsTitle: string;
25
26
  drawerViewDescription: string;
26
27
  drawerViewTitle: string;
27
- labelActions: string;
28
- labelAmount: string;
29
- labelAmountDue: string;
30
- labelAmountPaid: string;
31
- labelDueDate: string;
32
- labelFeeStructure: string;
33
- labelId: string;
34
- labelRemarks: string;
35
- labelStatus: string;
36
- labelStudent: string;
37
- saveLabel: string;
38
- searchPlaceholder: string;
28
+ tableColumnHeaderActions: string;
29
+ tableColumnHeaderAmount: string;
30
+ tableColumnHeaderAmountDue: string;
31
+ tableColumnHeaderAmountPaid: string;
32
+ tableColumnHeaderDueDate: string;
33
+ tableColumnHeaderFeeStructure: string;
34
+ tableColumnHeaderId: string;
35
+ tableColumnHeaderRemarks: string;
36
+ tableColumnHeaderStatus: string;
37
+ tableColumnHeaderStudent: string;
39
38
  tableDescription: string;
39
+ tableSearchPlaceholder: string;
40
40
  tableTitle: string;
41
41
  userRole: USER_ROLE;
42
42
  }
@@ -74,23 +74,23 @@ const createComponentInstances = () => ({
74
74
  moreActions: _jsx(StudentFeeMoreActions, {}),
75
75
  view: _jsx(StudentFeeView, {}),
76
76
  });
77
- const createStudentFeeConfig = ({ cancelLabel, dispatch, drawerFilterDescription, drawerFilterTitle, drawerFormDescription, drawerFormTitle, drawerMoreActionsDescription, drawerMoreActionsTitle, drawerViewDescription, drawerViewTitle, labelActions, labelAmount, labelAmountDue, labelAmountPaid, labelDueDate, labelFeeStructure, labelId, labelRemarks, labelStatus, labelStudent, saveLabel, searchPlaceholder, tableDescription, tableTitle, }) => {
77
+ const createStudentFeeConfig = ({ dispatch, drawerButtonCancel, drawerButtonSave, drawerFilterDescription, drawerFilterTitle, drawerFormDescription, drawerFormTitle, drawerMoreActionsDescription, drawerMoreActionsTitle, drawerViewDescription, drawerViewTitle, tableColumnHeaderActions, tableColumnHeaderAmount, tableColumnHeaderAmountDue, tableColumnHeaderAmountPaid, tableColumnHeaderDueDate, tableColumnHeaderFeeStructure, tableColumnHeaderId, tableColumnHeaderRemarks, tableColumnHeaderStatus, tableColumnHeaderStudent, tableDescription, tableSearchPlaceholder, tableTitle, }) => {
78
78
  const components = createComponentInstances();
79
79
  return {
80
80
  moduleName: "studentFee",
81
81
  tableColumns: [
82
- { label: labelId, width: "5%" },
83
- { label: labelStudent, width: "12%" },
84
- { label: labelFeeStructure, width: "12%" },
85
- { label: labelAmount, width: "10%" },
86
- { label: labelAmountPaid, width: "10%" },
87
- { label: labelAmountDue, width: "10%" },
88
- { label: labelDueDate, width: "10%" },
89
- { label: labelStatus, width: "10%" },
90
- { label: labelRemarks, width: "11%" },
91
- { label: labelActions, width: "5%" },
82
+ { label: tableColumnHeaderId, width: "5%" },
83
+ { label: tableColumnHeaderStudent, width: "12%" },
84
+ { label: tableColumnHeaderFeeStructure, width: "12%" },
85
+ { label: tableColumnHeaderAmount, width: "10%" },
86
+ { label: tableColumnHeaderAmountPaid, width: "10%" },
87
+ { label: tableColumnHeaderAmountDue, width: "10%" },
88
+ { label: tableColumnHeaderDueDate, width: "10%" },
89
+ { label: tableColumnHeaderStatus, width: "10%" },
90
+ { label: tableColumnHeaderRemarks, width: "11%" },
91
+ { label: tableColumnHeaderActions, width: "5%" },
92
92
  ],
93
- cancelLabel,
93
+ cancelLabel: drawerButtonCancel,
94
94
  drawerFilterDescription,
95
95
  drawerFilterTitle,
96
96
  drawerFormDescription,
@@ -102,8 +102,8 @@ const createStudentFeeConfig = ({ cancelLabel, dispatch, drawerFilterDescription
102
102
  filterContent: components.filter,
103
103
  formContent: components.form,
104
104
  moreActionsContent: components.moreActions,
105
- saveLabel,
106
- searchPlaceholder,
105
+ saveLabel: drawerButtonSave,
106
+ searchPlaceholder: tableSearchPlaceholder,
107
107
  tableDescription,
108
108
  tableTitle,
109
109
  viewContent: components.view,
@@ -121,7 +121,8 @@ const StudentFeePageInner = (props) => {
121
121
  // Memoize config creation - destructure props to avoid object reference changes
122
122
  const studentFeeConfig = useMemo(() => createStudentFeeConfig({
123
123
  dispatch: context.dispatch,
124
- cancelLabel: props.cancelLabel,
124
+ drawerButtonCancel: props.drawerButtonCancel,
125
+ drawerButtonSave: props.drawerButtonSave,
125
126
  drawerFormTitle: props.drawerFormTitle,
126
127
  drawerFormDescription: props.drawerFormDescription,
127
128
  drawerViewTitle: props.drawerViewTitle,
@@ -130,23 +131,23 @@ const StudentFeePageInner = (props) => {
130
131
  drawerFilterDescription: props.drawerFilterDescription,
131
132
  drawerMoreActionsTitle: props.drawerMoreActionsTitle,
132
133
  drawerMoreActionsDescription: props.drawerMoreActionsDescription,
133
- labelActions: props.labelActions,
134
- labelAmount: props.labelAmount,
135
- labelAmountDue: props.labelAmountDue,
136
- labelAmountPaid: props.labelAmountPaid,
137
- labelDueDate: props.labelDueDate,
138
- labelFeeStructure: props.labelFeeStructure,
139
- labelId: props.labelId,
140
- labelRemarks: props.labelRemarks,
141
- labelStatus: props.labelStatus,
142
- labelStudent: props.labelStudent,
143
- saveLabel: props.saveLabel,
144
- searchPlaceholder: props.searchPlaceholder,
134
+ tableColumnHeaderActions: props.tableColumnHeaderActions,
135
+ tableColumnHeaderAmount: props.tableColumnHeaderAmount,
136
+ tableColumnHeaderAmountDue: props.tableColumnHeaderAmountDue,
137
+ tableColumnHeaderAmountPaid: props.tableColumnHeaderAmountPaid,
138
+ tableColumnHeaderDueDate: props.tableColumnHeaderDueDate,
139
+ tableColumnHeaderFeeStructure: props.tableColumnHeaderFeeStructure,
140
+ tableColumnHeaderId: props.tableColumnHeaderId,
141
+ tableColumnHeaderRemarks: props.tableColumnHeaderRemarks,
142
+ tableColumnHeaderStatus: props.tableColumnHeaderStatus,
143
+ tableColumnHeaderStudent: props.tableColumnHeaderStudent,
145
144
  tableDescription: props.tableDescription,
145
+ tableSearchPlaceholder: props.tableSearchPlaceholder,
146
146
  tableTitle: props.tableTitle,
147
147
  }), [
148
148
  context.dispatch,
149
- props.cancelLabel,
149
+ props.drawerButtonCancel,
150
+ props.drawerButtonSave,
150
151
  props.drawerFormTitle,
151
152
  props.drawerFormDescription,
152
153
  props.drawerViewTitle,
@@ -155,19 +156,18 @@ const StudentFeePageInner = (props) => {
155
156
  props.drawerFilterDescription,
156
157
  props.drawerMoreActionsTitle,
157
158
  props.drawerMoreActionsDescription,
158
- props.labelActions,
159
- props.labelAmount,
160
- props.labelAmountDue,
161
- props.labelAmountPaid,
162
- props.labelDueDate,
163
- props.labelFeeStructure,
164
- props.labelId,
165
- props.labelRemarks,
166
- props.labelStatus,
167
- props.labelStudent,
168
- props.saveLabel,
169
- props.searchPlaceholder,
159
+ props.tableColumnHeaderActions,
160
+ props.tableColumnHeaderAmount,
161
+ props.tableColumnHeaderAmountDue,
162
+ props.tableColumnHeaderAmountPaid,
163
+ props.tableColumnHeaderDueDate,
164
+ props.tableColumnHeaderFeeStructure,
165
+ props.tableColumnHeaderId,
166
+ props.tableColumnHeaderRemarks,
167
+ props.tableColumnHeaderStatus,
168
+ props.tableColumnHeaderStudent,
170
169
  props.tableDescription,
170
+ props.tableSearchPlaceholder,
171
171
  props.tableTitle,
172
172
  ]);
173
173
  const hasPermission = resolveRbacPermissions({
@@ -1,11 +1,19 @@
1
1
  /**
2
- * StudentFee Validation
2
+ * StudentFee Validation Schema
3
3
  *
4
- * Zod schema for `StudentFee` form validation. Matches the style used in
5
- * the `user` module validation file.
4
+ * Zod validation schemas for student-fee form data.
6
5
  */
7
6
  import { z } from "zod";
8
7
  import { PAYMENT_STATUS } from "../../type";
8
+ export declare const VALIDATION_KEYS: {
9
+ readonly familyId: "validationStudentFeeFamilyIdRequired";
10
+ readonly studentProfileId: "validationStudentFeeStudentProfileIdRequired";
11
+ readonly feeStructureId: "validationStudentFeeFeeStructureIdRequired";
12
+ readonly amountPositive: "validationStudentFeeAmountPositive";
13
+ readonly dueDateRequired: "validationStudentFeeDueDateRequired";
14
+ readonly dueDateInvalid: "validationStudentFeeDueDateInvalid";
15
+ readonly statusInvalid: "validationStudentFeeStatusInvalid";
16
+ };
9
17
  export declare const studentFeeFormValidation: z.ZodObject<{
10
18
  familyId: z.ZodString;
11
19
  studentProfileId: z.ZodString;
@@ -1,25 +1,33 @@
1
1
  /**
2
- * StudentFee Validation
2
+ * StudentFee Validation Schema
3
3
  *
4
- * Zod schema for `StudentFee` form validation. Matches the style used in
5
- * the `user` module validation file.
4
+ * Zod validation schemas for student-fee form data.
6
5
  */
7
6
  import { z } from "zod";
8
7
  import { PAYMENT_STATUS } from "../../type";
8
+ export const VALIDATION_KEYS = {
9
+ familyId: "validationStudentFeeFamilyIdRequired",
10
+ studentProfileId: "validationStudentFeeStudentProfileIdRequired",
11
+ feeStructureId: "validationStudentFeeFeeStructureIdRequired",
12
+ amountPositive: "validationStudentFeeAmountPositive",
13
+ dueDateRequired: "validationStudentFeeDueDateRequired",
14
+ dueDateInvalid: "validationStudentFeeDueDateInvalid",
15
+ statusInvalid: "validationStudentFeeStatusInvalid",
16
+ };
9
17
  export const studentFeeFormValidation = z.object({
10
- familyId: z.string().min(1, "Family ID is required"),
11
- studentProfileId: z.string().min(1, "Student Profile ID is required"),
12
- feeStructureId: z.string().min(1, "Fee Structure ID is required"),
18
+ familyId: z.string().min(1, VALIDATION_KEYS.familyId),
19
+ studentProfileId: z.string().min(1, VALIDATION_KEYS.studentProfileId),
20
+ feeStructureId: z.string().min(1, VALIDATION_KEYS.feeStructureId),
13
21
  discountCodeId: z.string().optional().nullable(),
14
- amount: z.number().positive("Amount must be positive"),
15
- amountPaid: z.number().min(0, "Amount must be positive").optional(),
16
- amountDue: z.number().min(0, "Amount must be positive").optional(),
22
+ amount: z.number().positive(VALIDATION_KEYS.amountPositive),
23
+ amountPaid: z.number().min(0, VALIDATION_KEYS.amountPositive).optional(),
24
+ amountDue: z.number().min(0, VALIDATION_KEYS.amountPositive).optional(),
17
25
  dueDate: z
18
26
  .string()
19
- .min(1, "Enrollment date is required")
20
- .refine((v) => !isNaN(Date.parse(v)), "Invalid date format"),
27
+ .min(1, VALIDATION_KEYS.dueDateRequired)
28
+ .refine((v) => !isNaN(Date.parse(v)), VALIDATION_KEYS.dueDateInvalid),
21
29
  status: z.nativeEnum(PAYMENT_STATUS, {
22
- error: "Invalid or missing status",
30
+ error: VALIDATION_KEYS.statusInvalid,
23
31
  }),
24
32
  remarks: z.string().optional().nullable(),
25
33
  enabled: z.boolean().optional(),
@@ -24,9 +24,9 @@ export const StudentFeeView = () => {
24
24
  method: API_METHODS.GET,
25
25
  params: { id: feeStructureId, workspaceId: workspace === null || workspace === void 0 ? void 0 : workspace.id },
26
26
  });
27
- return (_jsx("div", { className: "space-y-4", children: _jsxs(Card, { children: [_jsxs(CardHeader, { className: "pb-3", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(FileText, { className: "text-primary h-5 w-5" }), _jsx(CardTitle, { className: "text-lg", children: t("viewSectionStudentFeeDetails") })] }), _jsx(CardDescription, { children: t("viewSectionReadOnlyStudentFeeInformation") })] }), _jsx(Separator, {}), _jsx(CardContent, { className: "pt-6", children: _jsxs("div", { className: "grid grid-cols-1 gap-6", children: [_jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldStudent") }), _jsx("p", { className: "text-base", children: studentProfile
27
+ return (_jsx("div", { className: "space-y-4", children: _jsxs(Card, { children: [_jsxs(CardHeader, { className: "pb-3", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(FileText, { className: "text-primary h-5 w-5" }), _jsx(CardTitle, { className: "text-lg", children: t("viewSectionStudentFeeDetails") })] }), _jsx(CardDescription, { children: t("viewSectionReadOnlyStudentFeeInformation") })] }), _jsx(Separator, {}), _jsx(CardContent, { className: "pt-6", children: _jsxs("div", { className: "grid grid-cols-1 gap-6", children: [_jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("formStudentLabel") }), _jsx("p", { className: "text-base", children: studentProfile
28
28
  ? `${studentProfile.firstName} ${studentProfile.lastName}`
29
- : "—" })] }), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldComputerNumber") }), _jsx("p", { className: "text-base", children: (studentProfile === null || studentProfile === void 0 ? void 0 : studentProfile.computerNumber) || "—" })] }), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldFeeStructure") }), _jsx("p", { className: "text-base", children: (feeStructure === null || feeStructure === void 0 ? void 0 : feeStructure.name) || "—" })] }), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldTotalAmount") }), _jsxs("p", { className: "text-base", children: [currency, " ", (amount !== null && amount !== void 0 ? amount : 0).toFixed(2)] })] }), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldAmountPaid") }), _jsxs("p", { className: "text-base", children: [currency, " ", (amountPaid !== null && amountPaid !== void 0 ? amountPaid : 0).toFixed(2)] })] }), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldAmountDue") }), _jsxs("p", { className: "text-base", children: [currency, " ", (amountDue !== null && amountDue !== void 0 ? amountDue : 0).toFixed(2)] })] }), _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("viewFieldDueDate") })] }), _jsx("p", { className: "text-base", children: formatDate(dueDate, DATE_FORMATS.LOCALE_DATE) })] }), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldStatus") }), _jsx(Badge, { variant: "secondary", children: status || "—" })] }), remarks && (_jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldRemarks") }), _jsx("p", { className: "text-base", children: remarks })] })), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldRecordState") }), _jsxs(Badge, { className: "gap-1", variant: enabled ? "default" : "destructive", children: [enabled ? (_jsx(CheckCircle2, { className: "h-3 w-3" })) : (_jsx(XCircle, { className: "h-3 w-3" })), enabled
30
- ? t("viewFieldStatusActive")
31
- : t("viewFieldStatusInactive")] })] })] }) })] }) }));
29
+ : "—" })] }), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldComputerNumber") }), _jsx("p", { className: "text-base", children: (studentProfile === null || studentProfile === void 0 ? void 0 : studentProfile.computerNumber) || "—" })] }), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("formFeeStructureLabel") }), _jsx("p", { className: "text-base", children: (feeStructure === null || feeStructure === void 0 ? void 0 : feeStructure.name) || "—" })] }), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("formTotalAmountLabel") }), _jsxs("p", { className: "text-base", children: [currency, " ", (amount !== null && amount !== void 0 ? amount : 0).toFixed(2)] })] }), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("formAmountPaidLabel") }), _jsxs("p", { className: "text-base", children: [currency, " ", (amountPaid !== null && amountPaid !== void 0 ? amountPaid : 0).toFixed(2)] })] }), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("formAmountDueLabel") }), _jsxs("p", { className: "text-base", children: [currency, " ", (amountDue !== null && amountDue !== void 0 ? amountDue : 0).toFixed(2)] })] }), _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("formDueDateLabel") })] }), _jsx("p", { className: "text-base", children: formatDate(dueDate, DATE_FORMATS.LOCALE_DATE) })] }), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("formStatusLabel") }), _jsx(Badge, { variant: "secondary", children: status || "—" })] }), remarks && (_jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("formRemarksLabel") }), _jsx("p", { className: "text-base", children: remarks })] })), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldRecordState") }), _jsxs(Badge, { className: "gap-1", variant: enabled ? "default" : "destructive", children: [enabled ? (_jsx(CheckCircle2, { className: "h-3 w-3" })) : (_jsx(XCircle, { className: "h-3 w-3" })), enabled
30
+ ? t("badgeActive")
31
+ : t("badgeInactive")] })] })] }) })] }) }));
32
32
  };
@@ -353,7 +353,7 @@ export const useStudentProfileModule = () => {
353
353
  });
354
354
  }, [updateFetchNow]);
355
355
  const handleWithdrawStudent = useCallback(async () => {
356
- if (!confirm(t("areYouSureYouWantToWithdrawThisStudent")))
356
+ if (!confirm(t("messagesWithdrawConfirmation")))
357
357
  return;
358
358
  dispatch({
359
359
  type: STUDENT_PROFILE_ACTION_TYPES.SET_INPUT_FIELD,
@@ -366,7 +366,7 @@ export const useStudentProfileModule = () => {
366
366
  }, [dispatch, t]);
367
367
  const handleReAdmitStudent = useCallback(async (row) => {
368
368
  var _a;
369
- if (!confirm(t("areYouSureYouWantToReAdmitThisStudent")))
369
+ if (!confirm(t("messagesReAdmitConfirmation")))
370
370
  return;
371
371
  const { data, error } = await fetchData({
372
372
  url: "/api/v1/readmit-student",
@@ -25,8 +25,8 @@ export const StudentProfileFilter = () => {
25
25
  };
26
26
  const { enhancedComboboxElement: filterStatusCombo } = useEnhancedCombobox({
27
27
  id: "filterStatus",
28
- label: t("filterOptionStatus"),
29
- info: t("filterByStudentStatus"),
28
+ label: t("filterStatusLabel"),
29
+ info: t("filterStatusInfo"),
30
30
  options: [...STATUS_OPTIONS].map((opt) => ({
31
31
  value: opt.value,
32
32
  label: statusLabelMap[opt.value] || opt.label,
@@ -8,6 +8,7 @@ import { useTranslations } from "next-intl";
8
8
  import { useStudentProfileModule } from "./context";
9
9
  import { STATUS_OPTIONS, GENDER_OPTIONS } from "./constants";
10
10
  import { STUDENT_PROFILE_API_ROUTES } from "../../constants";
11
+ import { getTranslatedError } from "../../utils/get-translated-error";
11
12
  export const StudentProfileForm = () => {
12
13
  const t = useTranslations("studentProfile");
13
14
  const genderLabelMap = {
@@ -21,7 +22,7 @@ export const StudentProfileForm = () => {
21
22
  const { handleChange } = context;
22
23
  const { enhancedComboboxElement: genderCombo } = useEnhancedCombobox({
23
24
  id: "gender",
24
- info: t("formGenderPlaceholder"),
25
+ info: t("formGenderInfo"),
25
26
  label: t("formGenderLabel"),
26
27
  onValueChange: (value) => handleChange("gender", value),
27
28
  options: GENDER_OPTIONS.map((opt) => ({
@@ -41,8 +42,8 @@ export const StudentProfileForm = () => {
41
42
  });
42
43
  const { enhancedComboboxElement: statusCombo } = useEnhancedCombobox({
43
44
  id: "status",
44
- info: t("formStudentStatusPlaceholder"),
45
- label: t("formOptionStatus"),
45
+ info: t("formStatusInfo"),
46
+ label: t("formStatusLabel"),
46
47
  onValueChange: (value) => handleChange("status", value),
47
48
  options: STATUS_OPTIONS.map((opt) => ({
48
49
  value: opt.value,
@@ -60,7 +61,7 @@ export const StudentProfileForm = () => {
60
61
  },
61
62
  value: status,
62
63
  });
63
- return (_jsxs("div", { className: "space-y-4", children: [_jsxs("div", { className: "space-y-4", children: [_jsx("h3", { className: "text-lg font-semibold", children: t("formSectionPersonalInformation") }), _jsxs("div", { className: "grid grid-cols-1 gap-4", children: [_jsx(EnhancedInput, { error: errors.firstName, id: "firstName", info: t("formStudentsFirstNamePlaceholder"), label: t("formFirstNameLabel"), onChange: (e) => handleChange("firstName", e.target.value), placeholder: t("formFirstNamePlaceholder"), required: true, value: firstName }), _jsx(EnhancedInput, { error: errors.lastName, id: "lastName", info: t("formStudentsLastNamePlaceholder"), label: t("formLastNameLabel"), onChange: (e) => handleChange("lastName", e.target.value), placeholder: t("formLastNamePlaceholder"), required: true, value: lastName }), _jsx(EnhancedInput, { error: errors.dateOfBirth, id: "dateOfBirth", info: t("formDateOfBirthPlaceholder"), label: t("formDateOfBirthLabel"), onChange: (e) => handleChange("dateOfBirth", e.target.value), onClick: (e) => { var _a, _b; return (_b = (_a = e.currentTarget).showPicker) === null || _b === void 0 ? void 0 : _b.call(_a); }, type: "date", value: dateOfBirth
64
+ return (_jsxs("div", { className: "space-y-4", children: [_jsxs("div", { className: "space-y-4", children: [_jsx("h3", { className: "text-lg font-semibold", children: t("formSectionPersonalInformation") }), _jsxs("div", { className: "grid grid-cols-1 gap-4", children: [_jsx(EnhancedInput, { error: getTranslatedError({ errors, key: "firstName", t }), id: "firstName", info: t("formFirstNameInfo"), label: t("formFirstNameLabel"), onChange: (e) => handleChange("firstName", e.target.value), placeholder: t("formFirstNamePlaceholder"), required: true, value: firstName }), _jsx(EnhancedInput, { error: getTranslatedError({ errors, key: "lastName", t }), id: "lastName", info: t("formLastNameInfo"), label: t("formLastNameLabel"), onChange: (e) => handleChange("lastName", e.target.value), placeholder: t("formLastNamePlaceholder"), required: true, value: lastName }), _jsx(EnhancedInput, { error: getTranslatedError({ errors, key: "dateOfBirth", t }), id: "dateOfBirth", info: t("formDateOfBirthInfo"), label: t("formDateOfBirthLabel"), onChange: (e) => handleChange("dateOfBirth", e.target.value), onClick: (e) => { var _a, _b; return (_b = (_a = e.currentTarget).showPicker) === null || _b === void 0 ? void 0 : _b.call(_a); }, type: "date", value: dateOfBirth
64
65
  ? new Date(dateOfBirth).toISOString().split("formTLabel")[0]
65
- : "" }), genderCombo] })] }), _jsxs("div", { className: "space-y-4", children: [_jsx("h3", { className: "text-lg font-semibold", children: t("formSectionContactInformation") }), _jsxs("div", { className: "grid grid-cols-1 gap-4", children: [_jsx(EnhancedInput, { error: errors.phone, id: "phone", info: t("formStudentsPhoneNumberPlaceholder"), label: t("formPhoneLabel"), onChange: (e) => handleChange("phone", e.target.value), placeholder: t("formPhonePlaceholder"), type: "tel", value: phone || "" }), _jsx(EnhancedInput, { error: errors.emergencyPhone, id: "emergencyPhone", info: t("formStudentsEmergencyPhoneNumberPlaceholder"), label: t("formEmergencyPhoneLabel"), onChange: (e) => handleChange("emergencyPhone", e.target.value), placeholder: t("formEmergencyPhonePlaceholder"), type: "tel", value: emergencyPhone || "" })] }), _jsx(EnhancedInput, { error: errors.address, id: "address", info: t("formStudentsAddressPlaceholder"), label: t("formAddressLabel"), onChange: (e) => handleChange("address", e.target.value), placeholder: t("formAddressPlaceholder"), value: address || "" }), _jsxs("div", { className: "grid grid-cols-1 gap-4", children: [_jsx(EnhancedInput, { error: errors.city, id: "city", info: t("formStudentsCityPlaceholder"), label: t("formCityLabel"), onChange: (e) => handleChange("city", e.target.value), placeholder: t("formCityPlaceholder"), value: city || "" }), _jsx(EnhancedInput, { error: errors.state, id: "state", info: t("formStudentsStateOrProvincePlaceholder"), label: t("formStateProvinceLabel"), onChange: (e) => handleChange("state", e.target.value), placeholder: t("formStatePlaceholder"), value: stateValue || "" }), _jsx(EnhancedInput, { error: errors.country, id: "country", info: t("formStudentsCountryPlaceholder"), label: t("formCountryLabel"), onChange: (e) => handleChange("country", e.target.value), placeholder: t("formCountryPlaceholder"), value: country || "" }), _jsx(EnhancedInput, { error: errors.postalCode, id: "postalCode", info: t("formStudentsPostalCodePlaceholder"), label: t("formPostalCodeLabel"), onChange: (e) => handleChange("postalCode", e.target.value), placeholder: t("formPostalCodePlaceholder"), value: postalCode || "" })] })] }), _jsxs("div", { className: "space-y-4", children: [_jsx("h3", { className: "text-lg font-semibold", children: t("formSectionAcademicInformation") }), _jsxs("div", { className: "grid grid-cols-1 gap-4", children: [statusCombo, _jsx(EnhancedTextarea, { error: errors.remarks, id: "remarks", info: t("formAnyAdditionalRemarksPlaceholder"), label: t("formRemarksLabel"), onChange: (e) => handleChange("remarks", e.target.value), placeholder: t("formRemarksPlaceholder"), rows: 4, value: remarks || "" })] }), _jsx(EnhancedCheckbox, { checked: enabled, info: t("actionToggleActivateOrDeactivate"), label: t("formActiveStudentLabel"), onCheckedChange: (checked) => handleChange("enabled", checked) })] })] }));
66
+ : "" }), genderCombo] })] }), _jsxs("div", { className: "space-y-4", children: [_jsx("h3", { className: "text-lg font-semibold", children: t("formSectionContactInformation") }), _jsxs("div", { className: "grid grid-cols-1 gap-4", children: [_jsx(EnhancedInput, { error: getTranslatedError({ errors, key: "phone", t }), id: "phone", info: t("formPhoneInfo"), label: t("formPhoneLabel"), onChange: (e) => handleChange("phone", e.target.value), placeholder: t("formPhonePlaceholder"), type: "tel", value: phone || "" }), _jsx(EnhancedInput, { error: getTranslatedError({ errors, key: "emergencyPhone", t }), id: "emergencyPhone", info: t("formEmergencyPhoneInfo"), label: t("formEmergencyPhoneLabel"), onChange: (e) => handleChange("emergencyPhone", e.target.value), placeholder: t("formEmergencyPhonePlaceholder"), type: "tel", value: emergencyPhone || "" })] }), _jsx(EnhancedInput, { error: getTranslatedError({ errors, key: "address", t }), id: "address", info: t("formAddressInfo"), label: t("formAddressLabel"), onChange: (e) => handleChange("address", e.target.value), placeholder: t("formAddressPlaceholder"), value: address || "" }), _jsxs("div", { className: "grid grid-cols-1 gap-4", children: [_jsx(EnhancedInput, { error: getTranslatedError({ errors, key: "city", t }), id: "city", info: t("formCityInfo"), label: t("formCityLabel"), onChange: (e) => handleChange("city", e.target.value), placeholder: t("formCityPlaceholder"), value: city || "" }), _jsx(EnhancedInput, { error: getTranslatedError({ errors, key: "state", t }), id: "state", info: t("formStateInfo"), label: t("formStateProvinceLabel"), onChange: (e) => handleChange("state", e.target.value), placeholder: t("formStatePlaceholder"), value: stateValue || "" }), _jsx(EnhancedInput, { error: getTranslatedError({ errors, key: "country", t }), id: "country", info: t("formCountryInfo"), label: t("formCountryLabel"), onChange: (e) => handleChange("country", e.target.value), placeholder: t("formCountryPlaceholder"), value: country || "" }), _jsx(EnhancedInput, { error: getTranslatedError({ errors, key: "postalCode", t }), id: "postalCode", info: t("formPostalCodeInfo"), label: t("formPostalCodeLabel"), onChange: (e) => handleChange("postalCode", e.target.value), placeholder: t("formPostalCodePlaceholder"), value: postalCode || "" })] })] }), _jsxs("div", { className: "space-y-4", children: [_jsx("h3", { className: "text-lg font-semibold", children: t("formSectionAcademicInformation") }), _jsxs("div", { className: "grid grid-cols-1 gap-4", children: [statusCombo, _jsx(EnhancedTextarea, { error: getTranslatedError({ errors, key: "remarks", t }), id: "remarks", info: t("formRemarksInfo"), label: t("formRemarksLabel"), onChange: (e) => handleChange("remarks", e.target.value), placeholder: t("formRemarksPlaceholder"), rows: 4, value: remarks || "" })] }), _jsx(EnhancedCheckbox, { checked: enabled, info: t("formEnabledInfo"), label: t("formEnabledLabel"), onCheckedChange: (checked) => handleChange("enabled", checked) })] })] }));
66
67
  };
@@ -18,7 +18,8 @@
18
18
  import { FC } from "react";
19
19
  import { USER_ROLE } from "../../type";
20
20
  interface Props {
21
- cancelLabel: string;
21
+ drawerButtonCancel: string;
22
+ drawerButtonSave: string;
22
23
  drawerFilterDescription: string;
23
24
  drawerFilterTitle: string;
24
25
  drawerFormDescription: string;
@@ -27,16 +28,15 @@ interface Props {
27
28
  drawerMoreActionsTitle: string;
28
29
  drawerViewDescription: string;
29
30
  drawerViewTitle: string;
30
- labelActions: string;
31
- labelEnabled: string;
32
- labelName: string;
33
- labelId: string;
34
- labelComputerCode: string;
35
- labelClassSection: string;
36
- labelStudentCode: string;
37
- saveLabel: string;
38
- searchPlaceholder: string;
31
+ tableColumnHeaderActions: string;
32
+ tableColumnHeaderEnabled: string;
33
+ tableColumnHeaderName: string;
34
+ tableColumnHeaderId: string;
35
+ tableColumnHeaderComputerCode: string;
36
+ tableColumnHeaderClassSection: string;
37
+ tableColumnHeaderStudentCode: string;
39
38
  tableDescription: string;
39
+ tableSearchPlaceholder: string;
40
40
  tableTitle: string;
41
41
  userRole: USER_ROLE;
42
42
  }
@@ -71,20 +71,20 @@ const createComponentInstances = () => ({
71
71
  moreActions: _jsx(StudentProfileMoreActions, {}),
72
72
  view: _jsx(StudentProfileView, {}),
73
73
  });
74
- const createStudentProfileConfig = ({ cancelLabel, dispatch, drawerFilterDescription, drawerFilterTitle, drawerFormDescription, drawerFormTitle, drawerMoreActionsDescription, drawerMoreActionsTitle, drawerViewDescription, drawerViewTitle, labelActions, labelEnabled, labelName, labelId, labelComputerCode, labelClassSection, labelStudentCode, saveLabel, searchPlaceholder, tableDescription, tableTitle, }) => {
74
+ const createStudentProfileConfig = ({ dispatch, drawerButtonCancel, drawerButtonSave, drawerFilterDescription, drawerFilterTitle, drawerFormDescription, drawerFormTitle, drawerMoreActionsDescription, drawerMoreActionsTitle, drawerViewDescription, drawerViewTitle, tableColumnHeaderActions, tableColumnHeaderEnabled, tableColumnHeaderName, tableColumnHeaderId, tableColumnHeaderComputerCode, tableColumnHeaderClassSection, tableColumnHeaderStudentCode, tableDescription, tableSearchPlaceholder, tableTitle, }) => {
75
75
  const components = createComponentInstances();
76
76
  return {
77
77
  moduleName: "studentProfile",
78
78
  tableColumns: [
79
- { label: labelId, width: "5%" },
80
- { label: labelName, width: "15%" },
81
- { label: labelComputerCode, width: "15%" },
82
- { label: labelStudentCode, width: "15%" },
83
- { label: labelClassSection, width: "20%" },
84
- { label: labelEnabled, width: "10%" },
85
- { label: labelActions, width: "5%" },
79
+ { label: tableColumnHeaderId, width: "5%" },
80
+ { label: tableColumnHeaderName, width: "15%" },
81
+ { label: tableColumnHeaderComputerCode, width: "15%" },
82
+ { label: tableColumnHeaderStudentCode, width: "15%" },
83
+ { label: tableColumnHeaderClassSection, width: "20%" },
84
+ { label: tableColumnHeaderEnabled, width: "10%" },
85
+ { label: tableColumnHeaderActions, width: "5%" },
86
86
  ],
87
- cancelLabel,
87
+ cancelLabel: drawerButtonCancel,
88
88
  drawerFilterDescription,
89
89
  drawerFilterTitle,
90
90
  drawerFormDescription,
@@ -96,8 +96,8 @@ const createStudentProfileConfig = ({ cancelLabel, dispatch, drawerFilterDescrip
96
96
  filterContent: components.filter,
97
97
  formContent: components.form,
98
98
  moreActionsContent: components.moreActions,
99
- saveLabel,
100
- searchPlaceholder,
99
+ saveLabel: drawerButtonSave,
100
+ searchPlaceholder: tableSearchPlaceholder,
101
101
  tableDescription,
102
102
  tableTitle,
103
103
  viewContent: components.view,
@@ -114,7 +114,8 @@ const StudentProfilePageInner = (props) => {
114
114
  const context = useStudentProfileModule();
115
115
  const studentProfileConfig = useMemo(() => createStudentProfileConfig({
116
116
  dispatch: context.dispatch,
117
- cancelLabel: props.cancelLabel,
117
+ drawerButtonCancel: props.drawerButtonCancel,
118
+ drawerButtonSave: props.drawerButtonSave,
118
119
  drawerFormTitle: props.drawerFormTitle,
119
120
  drawerFormDescription: props.drawerFormDescription,
120
121
  drawerViewTitle: props.drawerViewTitle,
@@ -123,20 +124,20 @@ const StudentProfilePageInner = (props) => {
123
124
  drawerFilterDescription: props.drawerFilterDescription,
124
125
  drawerMoreActionsTitle: props.drawerMoreActionsTitle,
125
126
  drawerMoreActionsDescription: props.drawerMoreActionsDescription,
126
- labelActions: props.labelActions,
127
- labelEnabled: props.labelEnabled,
128
- labelName: props.labelName,
129
- labelId: props.labelId,
130
- labelComputerCode: props.labelComputerCode,
131
- labelClassSection: props.labelClassSection,
132
- labelStudentCode: props.labelStudentCode,
133
- saveLabel: props.saveLabel,
134
- searchPlaceholder: props.searchPlaceholder,
127
+ tableColumnHeaderActions: props.tableColumnHeaderActions,
128
+ tableColumnHeaderEnabled: props.tableColumnHeaderEnabled,
129
+ tableColumnHeaderName: props.tableColumnHeaderName,
130
+ tableColumnHeaderId: props.tableColumnHeaderId,
131
+ tableColumnHeaderComputerCode: props.tableColumnHeaderComputerCode,
132
+ tableColumnHeaderClassSection: props.tableColumnHeaderClassSection,
133
+ tableColumnHeaderStudentCode: props.tableColumnHeaderStudentCode,
135
134
  tableDescription: props.tableDescription,
135
+ tableSearchPlaceholder: props.tableSearchPlaceholder,
136
136
  tableTitle: props.tableTitle,
137
137
  }), [
138
138
  context.dispatch,
139
- props.cancelLabel,
139
+ props.drawerButtonCancel,
140
+ props.drawerButtonSave,
140
141
  props.drawerFormTitle,
141
142
  props.drawerFormDescription,
142
143
  props.drawerViewTitle,
@@ -145,16 +146,15 @@ const StudentProfilePageInner = (props) => {
145
146
  props.drawerFilterDescription,
146
147
  props.drawerMoreActionsTitle,
147
148
  props.drawerMoreActionsDescription,
148
- props.labelActions,
149
- props.labelEnabled,
150
- props.labelName,
151
- props.labelId,
152
- props.labelComputerCode,
153
- props.labelClassSection,
154
- props.labelStudentCode,
155
- props.saveLabel,
156
- props.searchPlaceholder,
149
+ props.tableColumnHeaderActions,
150
+ props.tableColumnHeaderEnabled,
151
+ props.tableColumnHeaderName,
152
+ props.tableColumnHeaderId,
153
+ props.tableColumnHeaderComputerCode,
154
+ props.tableColumnHeaderClassSection,
155
+ props.tableColumnHeaderStudentCode,
157
156
  props.tableDescription,
157
+ props.tableSearchPlaceholder,
158
158
  props.tableTitle,
159
159
  ]);
160
160
  const hasPermission = resolveRbacPermissions({
@@ -1,9 +1,15 @@
1
1
  /**
2
- * Student Validation Schema
2
+ * Student Profile Validation Schema
3
3
  *
4
- * Zod validation schemas for student form data.
4
+ * Zod validation schemas for student profile form data.
5
5
  */
6
6
  import { z } from "zod";
7
+ export declare const VALIDATION_KEYS: {
8
+ readonly firstNameRequired: "validationStudentProfileFirstNameRequired";
9
+ readonly lastNameRequired: "validationStudentProfileLastNameRequired";
10
+ readonly phoneInvalid: "validationStudentProfilePhoneInvalid";
11
+ readonly statusRequired: "validationStudentProfileStatusRequired";
12
+ };
7
13
  export declare const studentProfileFormValidation: z.ZodObject<{
8
14
  firstName: z.ZodString;
9
15
  lastName: z.ZodString;
@@ -1,26 +1,29 @@
1
1
  /**
2
- * Student Validation Schema
2
+ * Student Profile Validation Schema
3
3
  *
4
- * Zod validation schemas for student form data.
4
+ * Zod validation schemas for student profile form data.
5
5
  */
6
6
  import { z } from "zod";
7
- // ============================================================================
8
- // VALIDATION SCHEMA
9
- // ============================================================================
7
+ export const VALIDATION_KEYS = {
8
+ firstNameRequired: "validationStudentProfileFirstNameRequired",
9
+ lastNameRequired: "validationStudentProfileLastNameRequired",
10
+ phoneInvalid: "validationStudentProfilePhoneInvalid",
11
+ statusRequired: "validationStudentProfileStatusRequired",
12
+ };
10
13
  export const studentProfileFormValidation = z.object({
11
- firstName: z.string().min(1, "First name is required"),
12
- lastName: z.string().min(1, "Last name is required"),
14
+ firstName: z.string().min(1, VALIDATION_KEYS.firstNameRequired),
15
+ lastName: z.string().min(1, VALIDATION_KEYS.lastNameRequired),
13
16
  phone: z
14
17
  .string()
15
18
  .optional()
16
19
  .refine((val) => !val ||
17
- /^([+]?[\s0-9]+)?(\d{3}|[(]?[0-9]+[)]?)?([-]?[\s]?[0-9])+$/.test(val), "Invalid phone number format"),
20
+ /^([+]?[\s0-9]+)?(\d{3}|[(]?[0-9]+[)]?)?([-]?[\s]?[0-9])+$/.test(val), VALIDATION_KEYS.phoneInvalid),
18
21
  emergencyPhone: z
19
22
  .string()
20
23
  .optional()
21
24
  .refine((val) => !val ||
22
- /^([+]?[\s0-9]+)?(\d{3}|[(]?[0-9]+[)]?)?([-]?[\s]?[0-9])+$/.test(val), "Invalid phone number format"),
23
- status: z.string().min(1, "Status is required"),
25
+ /^([+]?[\s0-9]+)?(\d{3}|[(]?[0-9]+[)]?)?([-]?[\s]?[0-9])+$/.test(val), VALIDATION_KEYS.phoneInvalid),
26
+ status: z.string().min(1, VALIDATION_KEYS.statusRequired),
24
27
  dateOfBirth: z.string().optional(),
25
28
  enrollmentDate: z.string().optional(),
26
29
  gender: z.string().optional(),