@brite-future-schools-contracts/contracts 2.0.28 → 2.0.32
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/dist/chunk-2B5AQI2I.js +374 -0
- package/dist/chunk-2B5AQI2I.js.map +1 -0
- package/dist/{chunk-CL7UHAQE.js → chunk-7AJ4LRST.js} +366 -10
- package/dist/chunk-7AJ4LRST.js.map +1 -0
- package/dist/chunk-W3NAS6DL.js +1 -0
- package/dist/contracts/index.cjs +498 -0
- package/dist/contracts/index.cjs.map +1 -1
- package/dist/contracts/index.d.cts +2082 -1
- package/dist/contracts/index.d.ts +2082 -1
- package/dist/contracts/index.js +84 -2
- package/dist/index.cjs +617 -39
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +171 -3
- package/dist/index.js.map +1 -1
- package/dist/schemas/index.cjs +408 -9
- package/dist/schemas/index.cjs.map +1 -1
- package/dist/schemas/index.d.cts +544 -1
- package/dist/schemas/index.d.ts +544 -1
- package/dist/schemas/index.js +88 -2
- package/package.json +1 -1
- package/dist/chunk-CL7UHAQE.js.map +0 -1
- package/dist/chunk-NCAGCDZV.js +0 -1
- package/dist/chunk-YKK4SQI7.js +0 -204
- package/dist/chunk-YKK4SQI7.js.map +0 -1
- /package/dist/{chunk-NCAGCDZV.js.map → chunk-W3NAS6DL.js.map} +0 -0
package/dist/contracts/index.cjs
CHANGED
|
@@ -30,43 +30,84 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
30
30
|
// src/contracts/index.ts
|
|
31
31
|
var contracts_exports = {};
|
|
32
32
|
__export(contracts_exports, {
|
|
33
|
+
acknowledgeContract: () => acknowledgeContract,
|
|
34
|
+
acknowledgeDiaryEntryContract: () => acknowledgeDiaryEntryContract,
|
|
35
|
+
approveContract: () => approveContract,
|
|
36
|
+
approveLiftContract: () => approveLiftContract,
|
|
33
37
|
attendanceContract: () => attendanceContract,
|
|
34
38
|
authContract: () => authContract,
|
|
39
|
+
bankingContract: () => bankingContract,
|
|
40
|
+
blocksContract: () => blocksContract,
|
|
35
41
|
bulkUploadStudentsContract: () => bulkUploadStudentsContract,
|
|
36
42
|
calendarContract: () => calendarContract,
|
|
37
43
|
calendarListTermsContract: () => calendarListTermsContract,
|
|
44
|
+
cancelContract: () => cancelContract,
|
|
38
45
|
changePasswordContract: () => changePasswordContract,
|
|
46
|
+
createBankAccountContract: () => createBankAccountContract,
|
|
47
|
+
createCategoryContract: () => createCategoryContract,
|
|
39
48
|
createDepartmentContract: () => createDepartmentContract,
|
|
49
|
+
createEntryContract: () => createEntryContract,
|
|
40
50
|
createGradeContract: () => createGradeContract,
|
|
51
|
+
createNotificationContract: () => createNotificationContract,
|
|
41
52
|
createStaffContract: () => createStaffContract,
|
|
42
53
|
createStudentContract: () => createStudentContract,
|
|
43
54
|
createTermContract: () => createTermContract,
|
|
44
55
|
createYearContract: () => createYearContract,
|
|
56
|
+
deactivateContract: () => deactivateContract,
|
|
57
|
+
diaryContract: () => diaryContract,
|
|
45
58
|
getByClassContract: () => getByClassContract,
|
|
59
|
+
getByIdContract: () => getByIdContract,
|
|
46
60
|
getByStudentContract: () => getByStudentContract,
|
|
61
|
+
getEntryContract: () => getEntryContract,
|
|
47
62
|
getMeContract: () => getMeContract,
|
|
63
|
+
getResponseSummaryContract: () => getResponseSummaryContract,
|
|
48
64
|
getStaffByIdContract: () => getStaffByIdContract,
|
|
49
65
|
getStudentByIdContract: () => getStudentByIdContract,
|
|
66
|
+
getTemplateContract: () => getTemplateContract,
|
|
50
67
|
gradesContract: () => gradesContract,
|
|
51
68
|
hrContract: () => hrContract,
|
|
52
69
|
linkGuardianContract: () => linkGuardianContract,
|
|
70
|
+
listAccountsContract: () => listAccountsContract,
|
|
71
|
+
listAcknowledgementsContract: () => listAcknowledgementsContract,
|
|
72
|
+
listActiveBlocksContract: () => listActiveBlocksContract,
|
|
73
|
+
listBanksContract: () => listBanksContract,
|
|
74
|
+
listCategoriesContract: () => listCategoriesContract,
|
|
53
75
|
listClassesContract: () => listClassesContract,
|
|
76
|
+
listDeliveriesContract: () => listDeliveriesContract,
|
|
54
77
|
listDepartmentsContract: () => listDepartmentsContract,
|
|
78
|
+
listEntriesContract: () => listEntriesContract,
|
|
79
|
+
listForGuardianContract: () => listForGuardianContract,
|
|
55
80
|
listGradesContract: () => listGradesContract,
|
|
81
|
+
listResponsesContract: () => listResponsesContract,
|
|
56
82
|
listStaffContract: () => listStaffContract,
|
|
57
83
|
listStudentsContract: () => listStudentsContract,
|
|
84
|
+
listTemplatesContract: () => listTemplatesContract,
|
|
58
85
|
listTermsContract: () => listTermsContract,
|
|
59
86
|
listYearsContract: () => listYearsContract,
|
|
60
87
|
loginContract: () => loginContract,
|
|
61
88
|
logoutContract: () => logoutContract,
|
|
62
89
|
markAttendanceContract: () => markAttendanceContract,
|
|
90
|
+
markReadContract: () => markReadContract,
|
|
91
|
+
markUnreadContract: () => markUnreadContract,
|
|
92
|
+
notificationsContract: () => notificationsContract,
|
|
63
93
|
refreshTokenContract: () => refreshTokenContract,
|
|
94
|
+
rejectContract: () => rejectContract,
|
|
95
|
+
requestLiftContract: () => requestLiftContract,
|
|
64
96
|
requestPasswordResetContract: () => requestPasswordResetContract,
|
|
65
97
|
resetPasswordContract: () => resetPasswordContract,
|
|
98
|
+
resolveBlockAltContract: () => resolveBlockAltContract,
|
|
99
|
+
resolveBlockContract: () => resolveBlockContract,
|
|
100
|
+
respondContract: () => respondContract,
|
|
101
|
+
respondToBlockContract: () => respondToBlockContract,
|
|
102
|
+
respondToDiaryEntryContract: () => respondToDiaryEntryContract,
|
|
66
103
|
setCurrentTermContract: () => setCurrentTermContract,
|
|
67
104
|
setCurrentYearContract: () => setCurrentYearContract,
|
|
105
|
+
setDefaultContract: () => setDefaultContract,
|
|
68
106
|
studentsContract: () => studentsContract,
|
|
107
|
+
submitContract: () => submitContract,
|
|
69
108
|
switchBranchContract: () => switchBranchContract,
|
|
109
|
+
updateBankAccountContract: () => updateBankAccountContract,
|
|
110
|
+
updateCategoryContract: () => updateCategoryContract,
|
|
70
111
|
updateStaffStatusContract: () => updateStaffStatusContract
|
|
71
112
|
});
|
|
72
113
|
module.exports = __toCommonJS(contracts_exports);
|
|
@@ -703,45 +744,502 @@ var gradesContract = {
|
|
|
703
744
|
list: listGradesContract,
|
|
704
745
|
create: createGradeContract
|
|
705
746
|
};
|
|
747
|
+
|
|
748
|
+
// src/contracts/diary.ts
|
|
749
|
+
var import_contract7 = require("@orpc/contract");
|
|
750
|
+
var z15 = __toESM(require("zod"), 1);
|
|
751
|
+
|
|
752
|
+
// src/schemas/diary.ts
|
|
753
|
+
var z14 = __toESM(require("zod"), 1);
|
|
754
|
+
var DiarySeveritySchema = z14.enum(["info", "moderate", "serious", "critical"]);
|
|
755
|
+
var DiaryEntryStatusSchema = z14.enum(["active", "resolved", "lifted"]);
|
|
756
|
+
var BlockResolutionMethodSchema = z14.enum(["guardian_acknowledge", "staff_lift"]);
|
|
757
|
+
var DiaryCategorySchema = z14.object({
|
|
758
|
+
id: UuidSchema,
|
|
759
|
+
branchId: UuidSchema,
|
|
760
|
+
name: z14.string(),
|
|
761
|
+
description: z14.string().nullable(),
|
|
762
|
+
isActive: z14.boolean(),
|
|
763
|
+
createdBy: UuidSchema.nullable(),
|
|
764
|
+
createdAt: z14.string()
|
|
765
|
+
});
|
|
766
|
+
var CreateDiaryCategoryInputSchema = z14.object({
|
|
767
|
+
name: z14.string().min(1).max(100),
|
|
768
|
+
description: z14.string().optional()
|
|
769
|
+
});
|
|
770
|
+
var UpdateDiaryCategoryInputSchema = z14.object({
|
|
771
|
+
id: UuidSchema,
|
|
772
|
+
name: z14.string().min(1).max(100).optional(),
|
|
773
|
+
description: z14.string().optional(),
|
|
774
|
+
isActive: z14.boolean().optional()
|
|
775
|
+
});
|
|
776
|
+
var ListDiaryEntriesInputSchema = z14.object({
|
|
777
|
+
classId: UuidSchema.optional(),
|
|
778
|
+
studentId: UuidSchema.optional(),
|
|
779
|
+
postedBy: UuidSchema.optional()
|
|
780
|
+
});
|
|
781
|
+
var DiaryEntrySchema = z14.object({
|
|
782
|
+
id: UuidSchema,
|
|
783
|
+
branchId: UuidSchema,
|
|
784
|
+
classId: UuidSchema,
|
|
785
|
+
studentId: UuidSchema.nullable(),
|
|
786
|
+
postedBy: UuidSchema,
|
|
787
|
+
categoryId: UuidSchema,
|
|
788
|
+
title: z14.string(),
|
|
789
|
+
body: z14.string(),
|
|
790
|
+
severity: DiarySeveritySchema,
|
|
791
|
+
requiresResponse: z14.boolean(),
|
|
792
|
+
responseDeadlineDays: z14.number(),
|
|
793
|
+
isBlockingPortal: z14.boolean(),
|
|
794
|
+
isBlockingReportCard: z14.boolean(),
|
|
795
|
+
status: DiaryEntryStatusSchema,
|
|
796
|
+
resolvedAt: z14.string().nullable(),
|
|
797
|
+
resolvedBy: UuidSchema.nullable(),
|
|
798
|
+
liftApprovedBy: UuidSchema.nullable(),
|
|
799
|
+
liftApprovedAt: z14.string().nullable(),
|
|
800
|
+
createdAt: z14.string(),
|
|
801
|
+
updatedAt: z14.string()
|
|
802
|
+
});
|
|
803
|
+
var CreateDiaryEntryInputSchema = z14.object({
|
|
804
|
+
classId: UuidSchema,
|
|
805
|
+
studentId: UuidSchema.optional(),
|
|
806
|
+
categoryId: UuidSchema,
|
|
807
|
+
title: z14.string().min(1).max(200),
|
|
808
|
+
body: z14.string().min(1),
|
|
809
|
+
severity: DiarySeveritySchema,
|
|
810
|
+
requiresResponse: z14.boolean().optional(),
|
|
811
|
+
responseDeadlineDays: z14.number().int().positive().optional(),
|
|
812
|
+
isBlockingPortal: z14.boolean().optional(),
|
|
813
|
+
isBlockingReportCard: z14.boolean().optional()
|
|
814
|
+
});
|
|
815
|
+
var DiaryAcknowledgementSchema = z14.object({
|
|
816
|
+
id: UuidSchema,
|
|
817
|
+
entryId: UuidSchema,
|
|
818
|
+
guardianId: UuidSchema,
|
|
819
|
+
studentId: UuidSchema,
|
|
820
|
+
acknowledgedAt: z14.string().nullable(),
|
|
821
|
+
response: z14.string().nullable(),
|
|
822
|
+
isAcknowledged: z14.boolean(),
|
|
823
|
+
createdAt: z14.string()
|
|
824
|
+
});
|
|
825
|
+
var DiaryBlockSchema = z14.object({
|
|
826
|
+
id: UuidSchema,
|
|
827
|
+
entryId: UuidSchema,
|
|
828
|
+
guardianId: UuidSchema,
|
|
829
|
+
studentId: UuidSchema,
|
|
830
|
+
blockedAt: z14.string(),
|
|
831
|
+
resolvedAt: z14.string().nullable(),
|
|
832
|
+
resolvedBy: UuidSchema.nullable(),
|
|
833
|
+
resolvedVia: BlockResolutionMethodSchema.nullable(),
|
|
834
|
+
liftApprovedBy: UuidSchema.nullable(),
|
|
835
|
+
liftApprovedAt: z14.string().nullable(),
|
|
836
|
+
isActive: z14.boolean(),
|
|
837
|
+
createdAt: z14.string()
|
|
838
|
+
});
|
|
839
|
+
var MyAcknowledgementSchema = z14.object({
|
|
840
|
+
isAcknowledged: z14.boolean(),
|
|
841
|
+
response: z14.string().nullable()
|
|
842
|
+
});
|
|
843
|
+
var DiaryEntryDetailSchema = DiaryEntrySchema.extend({
|
|
844
|
+
acknowledgements: z14.array(DiaryAcknowledgementSchema),
|
|
845
|
+
blocks: z14.array(DiaryBlockSchema),
|
|
846
|
+
myAcknowledgement: MyAcknowledgementSchema.nullable()
|
|
847
|
+
});
|
|
848
|
+
var DiaryEntryForGuardianSchema = DiaryEntrySchema.extend({
|
|
849
|
+
myAcknowledgement: MyAcknowledgementSchema.nullable()
|
|
850
|
+
});
|
|
851
|
+
var AcknowledgeDiaryEntryInputSchema = z14.object({
|
|
852
|
+
entryId: UuidSchema,
|
|
853
|
+
studentId: UuidSchema
|
|
854
|
+
});
|
|
855
|
+
var RespondToDiaryEntryInputSchema = z14.object({
|
|
856
|
+
entryId: UuidSchema,
|
|
857
|
+
studentId: UuidSchema,
|
|
858
|
+
response: z14.string().min(1)
|
|
859
|
+
});
|
|
860
|
+
var DiaryBlockIdInputSchema = z14.object({
|
|
861
|
+
blockId: UuidSchema
|
|
862
|
+
});
|
|
863
|
+
var ListDiaryAcknowledgementsInputSchema = z14.object({
|
|
864
|
+
entryId: UuidSchema
|
|
865
|
+
});
|
|
866
|
+
|
|
867
|
+
// src/contracts/diary.ts
|
|
868
|
+
var IdInput = z15.object({ id: UuidSchema });
|
|
869
|
+
var listCategoriesContract = import_contract7.oc.route({ method: "GET", path: "/diary/categories" }).input(z15.object({})).output(z15.array(DiaryCategorySchema));
|
|
870
|
+
var createCategoryContract = import_contract7.oc.route({ method: "POST", path: "/diary/categories" }).input(CreateDiaryCategoryInputSchema).output(DiaryCategorySchema);
|
|
871
|
+
var updateCategoryContract = import_contract7.oc.route({ method: "PATCH", path: "/diary/categories/{id}" }).input(UpdateDiaryCategoryInputSchema).output(DiaryCategorySchema);
|
|
872
|
+
var listEntriesContract = import_contract7.oc.route({ method: "GET", path: "/diary/entries" }).input(ListDiaryEntriesInputSchema).output(z15.array(DiaryEntrySchema));
|
|
873
|
+
var listForGuardianContract = import_contract7.oc.route({ method: "GET", path: "/diary/entries/guardian" }).input(z15.object({})).output(z15.array(DiaryEntryForGuardianSchema));
|
|
874
|
+
var getEntryContract = import_contract7.oc.route({ method: "GET", path: "/diary/entries/{id}" }).input(IdInput).output(DiaryEntryDetailSchema);
|
|
875
|
+
var createEntryContract = import_contract7.oc.route({ method: "POST", path: "/diary/entries" }).input(CreateDiaryEntryInputSchema).output(DiaryEntrySchema);
|
|
876
|
+
var acknowledgeDiaryEntryContract = import_contract7.oc.route({ method: "PATCH", path: "/diary/entries/{entryId}/acknowledge" }).input(AcknowledgeDiaryEntryInputSchema).output(DiaryAcknowledgementSchema);
|
|
877
|
+
var respondToDiaryEntryContract = import_contract7.oc.route({ method: "PATCH", path: "/diary/entries/{entryId}/respond" }).input(RespondToDiaryEntryInputSchema).output(DiaryAcknowledgementSchema);
|
|
878
|
+
var requestLiftContract = import_contract7.oc.route({ method: "PATCH", path: "/diary/blocks/{blockId}/request-lift" }).input(DiaryBlockIdInputSchema).output(DiaryBlockSchema);
|
|
879
|
+
var approveLiftContract = import_contract7.oc.route({ method: "PATCH", path: "/diary/blocks/{blockId}/approve-lift" }).input(DiaryBlockIdInputSchema).output(DiaryBlockSchema);
|
|
880
|
+
var listAcknowledgementsContract = import_contract7.oc.route({ method: "GET", path: "/diary/entries/{entryId}/acknowledgements" }).input(ListDiaryAcknowledgementsInputSchema).output(z15.array(DiaryAcknowledgementSchema));
|
|
881
|
+
var diaryContract = {
|
|
882
|
+
listCategories: listCategoriesContract,
|
|
883
|
+
createCategory: createCategoryContract,
|
|
884
|
+
updateCategory: updateCategoryContract,
|
|
885
|
+
listEntries: listEntriesContract,
|
|
886
|
+
listForGuardian: listForGuardianContract,
|
|
887
|
+
getEntry: getEntryContract,
|
|
888
|
+
createEntry: createEntryContract,
|
|
889
|
+
acknowledge: acknowledgeDiaryEntryContract,
|
|
890
|
+
respond: respondToDiaryEntryContract,
|
|
891
|
+
requestLift: requestLiftContract,
|
|
892
|
+
approveLift: approveLiftContract,
|
|
893
|
+
listAcknowledgements: listAcknowledgementsContract
|
|
894
|
+
};
|
|
895
|
+
|
|
896
|
+
// src/contracts/banking.ts
|
|
897
|
+
var import_contract8 = require("@orpc/contract");
|
|
898
|
+
var z17 = __toESM(require("zod"), 1);
|
|
899
|
+
|
|
900
|
+
// src/schemas/banking.ts
|
|
901
|
+
var z16 = __toESM(require("zod"), 1);
|
|
902
|
+
var BankAccountTypeSchema = z16.enum(["current", "savings"]);
|
|
903
|
+
var BranchBankAccountSchema = z16.object({
|
|
904
|
+
id: UuidSchema,
|
|
905
|
+
branchId: UuidSchema,
|
|
906
|
+
bankName: z16.string(),
|
|
907
|
+
bankCode: z16.string().nullable(),
|
|
908
|
+
bankBranchName: z16.string().nullable(),
|
|
909
|
+
accountNumber: z16.string(),
|
|
910
|
+
accountName: z16.string(),
|
|
911
|
+
accountType: BankAccountTypeSchema,
|
|
912
|
+
currency: z16.string(),
|
|
913
|
+
isDefault: z16.boolean(),
|
|
914
|
+
isActive: z16.boolean(),
|
|
915
|
+
reconciliationContactId: UuidSchema.nullable(),
|
|
916
|
+
notes: z16.string().nullable(),
|
|
917
|
+
createdAt: z16.string(),
|
|
918
|
+
updatedAt: z16.string()
|
|
919
|
+
});
|
|
920
|
+
var CreateBankAccountInputSchema = z16.object({
|
|
921
|
+
branchId: UuidSchema,
|
|
922
|
+
bankName: z16.string().min(1).max(100),
|
|
923
|
+
bankCode: z16.string().max(10).optional(),
|
|
924
|
+
bankBranchName: z16.string().max(100).optional(),
|
|
925
|
+
accountNumber: z16.string().min(1).max(30),
|
|
926
|
+
accountName: z16.string().min(1).max(200),
|
|
927
|
+
accountType: BankAccountTypeSchema,
|
|
928
|
+
currency: z16.string().length(3).optional(),
|
|
929
|
+
isDefault: z16.boolean().optional(),
|
|
930
|
+
reconciliationContactId: UuidSchema.optional(),
|
|
931
|
+
notes: z16.string().optional()
|
|
932
|
+
});
|
|
933
|
+
var UpdateBankAccountInputSchema = z16.object({
|
|
934
|
+
id: UuidSchema,
|
|
935
|
+
bankName: z16.string().min(1).max(100).optional(),
|
|
936
|
+
bankCode: z16.string().max(10).optional(),
|
|
937
|
+
bankBranchName: z16.string().max(100).optional(),
|
|
938
|
+
accountNumber: z16.string().min(1).max(30).optional(),
|
|
939
|
+
accountName: z16.string().min(1).max(200).optional(),
|
|
940
|
+
accountType: BankAccountTypeSchema.optional(),
|
|
941
|
+
currency: z16.string().length(3).optional(),
|
|
942
|
+
reconciliationContactId: UuidSchema.optional(),
|
|
943
|
+
notes: z16.string().optional()
|
|
944
|
+
});
|
|
945
|
+
var ListBankAccountsInputSchema = z16.object({
|
|
946
|
+
branchId: UuidSchema.optional()
|
|
947
|
+
});
|
|
948
|
+
var KenyanBankSchema = z16.object({
|
|
949
|
+
id: UuidSchema,
|
|
950
|
+
name: z16.string(),
|
|
951
|
+
code: z16.string(),
|
|
952
|
+
isActive: z16.boolean(),
|
|
953
|
+
createdAt: z16.string()
|
|
954
|
+
});
|
|
955
|
+
|
|
956
|
+
// src/contracts/banking.ts
|
|
957
|
+
var listAccountsContract = import_contract8.oc.route({ method: "GET", path: "/banking/accounts" }).input(ListBankAccountsInputSchema).output(z17.array(BranchBankAccountSchema));
|
|
958
|
+
var getByIdContract = import_contract8.oc.route({ method: "GET", path: "/banking/accounts/{id}" }).input(z17.object({ id: UuidSchema })).output(BranchBankAccountSchema);
|
|
959
|
+
var createBankAccountContract = import_contract8.oc.route({ method: "POST", path: "/banking/accounts" }).input(CreateBankAccountInputSchema).output(BranchBankAccountSchema);
|
|
960
|
+
var updateBankAccountContract = import_contract8.oc.route({ method: "PATCH", path: "/banking/accounts/{id}" }).input(UpdateBankAccountInputSchema).output(BranchBankAccountSchema);
|
|
961
|
+
var setDefaultContract = import_contract8.oc.route({ method: "PATCH", path: "/banking/accounts/{id}/default" }).input(z17.object({ id: UuidSchema })).output(BranchBankAccountSchema);
|
|
962
|
+
var deactivateContract = import_contract8.oc.route({ method: "PATCH", path: "/banking/accounts/{id}/deactivate" }).input(z17.object({ id: UuidSchema })).output(BranchBankAccountSchema);
|
|
963
|
+
var listBanksContract = import_contract8.oc.route({ method: "GET", path: "/banking/banks" }).input(z17.object({})).output(z17.array(KenyanBankSchema));
|
|
964
|
+
var bankingContract = {
|
|
965
|
+
listAccounts: listAccountsContract,
|
|
966
|
+
getById: getByIdContract,
|
|
967
|
+
create: createBankAccountContract,
|
|
968
|
+
update: updateBankAccountContract,
|
|
969
|
+
setDefault: setDefaultContract,
|
|
970
|
+
deactivate: deactivateContract,
|
|
971
|
+
listBanks: listBanksContract
|
|
972
|
+
};
|
|
973
|
+
|
|
974
|
+
// src/contracts/notifications.ts
|
|
975
|
+
var import_contract9 = require("@orpc/contract");
|
|
976
|
+
var z19 = __toESM(require("zod"), 1);
|
|
977
|
+
|
|
978
|
+
// src/schemas/notifications.ts
|
|
979
|
+
var z18 = __toESM(require("zod"), 1);
|
|
980
|
+
var NotificationUrgencySchema = z18.enum(["critical", "urgent", "important", "info"]);
|
|
981
|
+
var NotificationTemplateStatusSchema = z18.enum([
|
|
982
|
+
"draft",
|
|
983
|
+
"pending_approval",
|
|
984
|
+
"approved",
|
|
985
|
+
"scheduled",
|
|
986
|
+
"sent",
|
|
987
|
+
"cancelled",
|
|
988
|
+
"recurring_active"
|
|
989
|
+
]);
|
|
990
|
+
var NotificationAudienceTypeSchema = z18.enum([
|
|
991
|
+
"all_branches",
|
|
992
|
+
"branch",
|
|
993
|
+
"grade",
|
|
994
|
+
"class",
|
|
995
|
+
"role",
|
|
996
|
+
"individual"
|
|
997
|
+
]);
|
|
998
|
+
var NotificationChannelSchema = z18.enum(["in_app", "sms", "email", "push"]);
|
|
999
|
+
var PortalBlockTypeSchema = z18.enum(["diary", "notification", "fee", "custom"]);
|
|
1000
|
+
var NotificationAudienceItemSchema = z18.object({
|
|
1001
|
+
audienceType: NotificationAudienceTypeSchema,
|
|
1002
|
+
audienceId: z18.string()
|
|
1003
|
+
});
|
|
1004
|
+
var CreateNotificationInputSchema = z18.object({
|
|
1005
|
+
branchId: UuidSchema.optional(),
|
|
1006
|
+
title: z18.string().min(1).max(200),
|
|
1007
|
+
body: z18.string().min(1),
|
|
1008
|
+
urgency: NotificationUrgencySchema,
|
|
1009
|
+
isBlocking: z18.boolean().optional(),
|
|
1010
|
+
deadlineHours: z18.number().int().positive().optional(),
|
|
1011
|
+
redirectPath: z18.string().max(500).optional(),
|
|
1012
|
+
redirectParams: z18.record(z18.string(), z18.string()).optional(),
|
|
1013
|
+
requiresResponse: z18.boolean().optional(),
|
|
1014
|
+
responseOptions: z18.array(z18.string()).optional(),
|
|
1015
|
+
// Deliberately narrower than NotificationChannelSchema (excludes
|
|
1016
|
+
// 'push') — matches the router's original inline restriction and
|
|
1017
|
+
// NotificationsService's Channel type; 'push' exists in the DB enum
|
|
1018
|
+
// but isn't yet wired end-to-end for template creation.
|
|
1019
|
+
deliveryChannels: z18.array(z18.enum(["in_app", "sms", "email"])).optional(),
|
|
1020
|
+
scheduledAt: z18.string().datetime().optional(),
|
|
1021
|
+
recurrence: z18.record(z18.string(), z18.unknown()).optional(),
|
|
1022
|
+
audience: z18.array(NotificationAudienceItemSchema)
|
|
1023
|
+
});
|
|
1024
|
+
var ListNotificationTemplatesInputSchema = z18.object({
|
|
1025
|
+
status: z18.string().optional(),
|
|
1026
|
+
branchId: UuidSchema.optional()
|
|
1027
|
+
});
|
|
1028
|
+
var NotificationTemplateSchema = z18.object({
|
|
1029
|
+
id: UuidSchema,
|
|
1030
|
+
branchId: UuidSchema.nullable(),
|
|
1031
|
+
title: z18.string(),
|
|
1032
|
+
body: z18.string(),
|
|
1033
|
+
urgency: NotificationUrgencySchema,
|
|
1034
|
+
isBlocking: z18.boolean(),
|
|
1035
|
+
deadlineHours: z18.number().nullable(),
|
|
1036
|
+
redirectPath: z18.string().nullable(),
|
|
1037
|
+
redirectParams: z18.record(z18.string(), z18.string()).nullable(),
|
|
1038
|
+
requiresResponse: z18.boolean(),
|
|
1039
|
+
responseOptions: z18.array(z18.string()).nullable(),
|
|
1040
|
+
deliveryChannels: z18.array(NotificationChannelSchema),
|
|
1041
|
+
scheduledAt: z18.string().nullable(),
|
|
1042
|
+
recurrence: z18.record(z18.string(), z18.unknown()).nullable(),
|
|
1043
|
+
lastFiredAt: z18.string().nullable(),
|
|
1044
|
+
nextFireAt: z18.string().nullable(),
|
|
1045
|
+
status: NotificationTemplateStatusSchema,
|
|
1046
|
+
createdBy: UuidSchema,
|
|
1047
|
+
approvedBy: UuidSchema.nullable(),
|
|
1048
|
+
approvedAt: z18.string().nullable(),
|
|
1049
|
+
sentAt: z18.string().nullable(),
|
|
1050
|
+
createdAt: z18.string(),
|
|
1051
|
+
updatedAt: z18.string()
|
|
1052
|
+
});
|
|
1053
|
+
var RejectNotificationInputSchema = z18.object({
|
|
1054
|
+
id: UuidSchema,
|
|
1055
|
+
reason: z18.string().optional()
|
|
1056
|
+
});
|
|
1057
|
+
var ListDeliveriesInputSchema = z18.object({
|
|
1058
|
+
isRead: z18.boolean().optional(),
|
|
1059
|
+
isBlocking: z18.boolean().optional()
|
|
1060
|
+
});
|
|
1061
|
+
var NotificationDeliverySchema = z18.object({
|
|
1062
|
+
id: UuidSchema,
|
|
1063
|
+
notificationId: UuidSchema,
|
|
1064
|
+
userId: UuidSchema,
|
|
1065
|
+
channel: NotificationChannelSchema,
|
|
1066
|
+
deliveredAt: z18.string().nullable(),
|
|
1067
|
+
readAt: z18.string().nullable(),
|
|
1068
|
+
isRead: z18.boolean(),
|
|
1069
|
+
markedUnreadAt: z18.string().nullable(),
|
|
1070
|
+
acknowledgedAt: z18.string().nullable(),
|
|
1071
|
+
response: z18.string().nullable(),
|
|
1072
|
+
isBlocking: z18.boolean(),
|
|
1073
|
+
isResolved: z18.boolean(),
|
|
1074
|
+
resolvedAt: z18.string().nullable(),
|
|
1075
|
+
returnPath: z18.string().nullable(),
|
|
1076
|
+
createdAt: z18.string()
|
|
1077
|
+
});
|
|
1078
|
+
var AcknowledgeDeliveryInputSchema = z18.object({
|
|
1079
|
+
deliveryId: UuidSchema,
|
|
1080
|
+
response: z18.string().optional()
|
|
1081
|
+
});
|
|
1082
|
+
var RespondToDeliveryInputSchema = z18.object({
|
|
1083
|
+
deliveryId: UuidSchema,
|
|
1084
|
+
response: z18.string().min(1)
|
|
1085
|
+
});
|
|
1086
|
+
var ResponseSummarySchema = z18.record(z18.string(), z18.number());
|
|
1087
|
+
var NotificationResponseItemSchema = z18.object({
|
|
1088
|
+
deliveryId: UuidSchema,
|
|
1089
|
+
userId: UuidSchema,
|
|
1090
|
+
userName: z18.string(),
|
|
1091
|
+
userEmail: z18.string(),
|
|
1092
|
+
response: z18.string().nullable(),
|
|
1093
|
+
acknowledgedAt: z18.string().nullable(),
|
|
1094
|
+
isResolved: z18.boolean()
|
|
1095
|
+
});
|
|
1096
|
+
var PortalBlockSchema = z18.object({
|
|
1097
|
+
id: UuidSchema,
|
|
1098
|
+
userId: UuidSchema,
|
|
1099
|
+
blockType: PortalBlockTypeSchema,
|
|
1100
|
+
sourceId: UuidSchema,
|
|
1101
|
+
redirectPath: z18.string(),
|
|
1102
|
+
redirectParams: z18.record(z18.string(), z18.string()).nullable(),
|
|
1103
|
+
returnPath: z18.string().nullable(),
|
|
1104
|
+
severity: NotificationUrgencySchema,
|
|
1105
|
+
isActive: z18.boolean(),
|
|
1106
|
+
activatedAt: z18.string(),
|
|
1107
|
+
resolvedAt: z18.string().nullable(),
|
|
1108
|
+
resolvedBy: UuidSchema.nullable(),
|
|
1109
|
+
resolvedVia: z18.string().nullable(),
|
|
1110
|
+
requiresResponse: z18.boolean(),
|
|
1111
|
+
responseOptions: z18.array(z18.string()).nullable(),
|
|
1112
|
+
createdAt: z18.string()
|
|
1113
|
+
});
|
|
1114
|
+
var RespondToBlockInputSchema = z18.object({
|
|
1115
|
+
blockId: UuidSchema,
|
|
1116
|
+
response: z18.string().min(1)
|
|
1117
|
+
});
|
|
1118
|
+
var RespondToBlockOutputSchema = z18.unknown();
|
|
1119
|
+
|
|
1120
|
+
// src/contracts/notifications.ts
|
|
1121
|
+
var EmptyOutput3 = z19.object({});
|
|
1122
|
+
var IdInput2 = z19.object({ id: UuidSchema });
|
|
1123
|
+
var listTemplatesContract = import_contract9.oc.route({ method: "GET", path: "/notifications/templates" }).input(ListNotificationTemplatesInputSchema).output(z19.array(NotificationTemplateSchema));
|
|
1124
|
+
var getTemplateContract = import_contract9.oc.route({ method: "GET", path: "/notifications/templates/{id}" }).input(IdInput2).output(NotificationTemplateSchema);
|
|
1125
|
+
var createNotificationContract = import_contract9.oc.route({ method: "POST", path: "/notifications/templates" }).input(CreateNotificationInputSchema).output(NotificationTemplateSchema);
|
|
1126
|
+
var submitContract = import_contract9.oc.route({ method: "PATCH", path: "/notifications/templates/{id}/submit" }).input(IdInput2).output(NotificationTemplateSchema);
|
|
1127
|
+
var approveContract = import_contract9.oc.route({ method: "PATCH", path: "/notifications/templates/{id}/approve" }).input(IdInput2).output(NotificationTemplateSchema);
|
|
1128
|
+
var rejectContract = import_contract9.oc.route({ method: "PATCH", path: "/notifications/templates/{id}/reject" }).input(RejectNotificationInputSchema).output(NotificationTemplateSchema);
|
|
1129
|
+
var cancelContract = import_contract9.oc.route({ method: "PATCH", path: "/notifications/templates/{id}/cancel" }).input(IdInput2).output(NotificationTemplateSchema);
|
|
1130
|
+
var listDeliveriesContract = import_contract9.oc.route({ method: "GET", path: "/notifications/deliveries" }).input(ListDeliveriesInputSchema).output(z19.array(NotificationDeliverySchema));
|
|
1131
|
+
var markReadContract = import_contract9.oc.route({ method: "PATCH", path: "/notifications/deliveries/{deliveryId}/read" }).input(z19.object({ deliveryId: UuidSchema })).output(NotificationDeliverySchema);
|
|
1132
|
+
var markUnreadContract = import_contract9.oc.route({ method: "PATCH", path: "/notifications/deliveries/{deliveryId}/unread" }).input(z19.object({ deliveryId: UuidSchema })).output(NotificationDeliverySchema);
|
|
1133
|
+
var acknowledgeContract = import_contract9.oc.route({ method: "PATCH", path: "/notifications/deliveries/{deliveryId}/acknowledge" }).input(AcknowledgeDeliveryInputSchema).output(NotificationDeliverySchema);
|
|
1134
|
+
var respondContract = import_contract9.oc.route({ method: "PATCH", path: "/notifications/deliveries/{deliveryId}/respond" }).input(RespondToDeliveryInputSchema).output(NotificationDeliverySchema);
|
|
1135
|
+
var getResponseSummaryContract = import_contract9.oc.route({ method: "GET", path: "/notifications/templates/{id}/response-summary" }).input(IdInput2).output(ResponseSummarySchema);
|
|
1136
|
+
var listResponsesContract = import_contract9.oc.route({ method: "GET", path: "/notifications/templates/{id}/responses" }).input(IdInput2).output(z19.array(NotificationResponseItemSchema));
|
|
1137
|
+
var resolveBlockContract = import_contract9.oc.route({ method: "PATCH", path: "/notifications/blocks/{blockId}/resolve" }).input(z19.object({ blockId: UuidSchema })).output(PortalBlockSchema);
|
|
1138
|
+
var notificationsContract = {
|
|
1139
|
+
listTemplates: listTemplatesContract,
|
|
1140
|
+
getTemplate: getTemplateContract,
|
|
1141
|
+
create: createNotificationContract,
|
|
1142
|
+
submit: submitContract,
|
|
1143
|
+
approve: approveContract,
|
|
1144
|
+
reject: rejectContract,
|
|
1145
|
+
cancel: cancelContract,
|
|
1146
|
+
listDeliveries: listDeliveriesContract,
|
|
1147
|
+
markRead: markReadContract,
|
|
1148
|
+
markUnread: markUnreadContract,
|
|
1149
|
+
acknowledge: acknowledgeContract,
|
|
1150
|
+
respond: respondContract,
|
|
1151
|
+
getResponseSummary: getResponseSummaryContract,
|
|
1152
|
+
listResponses: listResponsesContract,
|
|
1153
|
+
resolveBlock: resolveBlockContract
|
|
1154
|
+
};
|
|
1155
|
+
var listActiveBlocksContract = import_contract9.oc.route({ method: "GET", path: "/blocks/active" }).input(z19.object({})).output(z19.array(PortalBlockSchema));
|
|
1156
|
+
var resolveBlockAltContract = import_contract9.oc.route({ method: "PATCH", path: "/blocks/{blockId}/resolve" }).input(z19.object({ blockId: UuidSchema })).output(PortalBlockSchema);
|
|
1157
|
+
var respondToBlockContract = import_contract9.oc.route({ method: "PATCH", path: "/blocks/{blockId}/respond" }).input(RespondToBlockInputSchema).output(RespondToBlockOutputSchema);
|
|
1158
|
+
var blocksContract = {
|
|
1159
|
+
listActive: listActiveBlocksContract,
|
|
1160
|
+
resolve: resolveBlockAltContract,
|
|
1161
|
+
respond: respondToBlockContract
|
|
1162
|
+
};
|
|
706
1163
|
// Annotate the CommonJS export names for ESM import in node:
|
|
707
1164
|
0 && (module.exports = {
|
|
1165
|
+
acknowledgeContract,
|
|
1166
|
+
acknowledgeDiaryEntryContract,
|
|
1167
|
+
approveContract,
|
|
1168
|
+
approveLiftContract,
|
|
708
1169
|
attendanceContract,
|
|
709
1170
|
authContract,
|
|
1171
|
+
bankingContract,
|
|
1172
|
+
blocksContract,
|
|
710
1173
|
bulkUploadStudentsContract,
|
|
711
1174
|
calendarContract,
|
|
712
1175
|
calendarListTermsContract,
|
|
1176
|
+
cancelContract,
|
|
713
1177
|
changePasswordContract,
|
|
1178
|
+
createBankAccountContract,
|
|
1179
|
+
createCategoryContract,
|
|
714
1180
|
createDepartmentContract,
|
|
1181
|
+
createEntryContract,
|
|
715
1182
|
createGradeContract,
|
|
1183
|
+
createNotificationContract,
|
|
716
1184
|
createStaffContract,
|
|
717
1185
|
createStudentContract,
|
|
718
1186
|
createTermContract,
|
|
719
1187
|
createYearContract,
|
|
1188
|
+
deactivateContract,
|
|
1189
|
+
diaryContract,
|
|
720
1190
|
getByClassContract,
|
|
1191
|
+
getByIdContract,
|
|
721
1192
|
getByStudentContract,
|
|
1193
|
+
getEntryContract,
|
|
722
1194
|
getMeContract,
|
|
1195
|
+
getResponseSummaryContract,
|
|
723
1196
|
getStaffByIdContract,
|
|
724
1197
|
getStudentByIdContract,
|
|
1198
|
+
getTemplateContract,
|
|
725
1199
|
gradesContract,
|
|
726
1200
|
hrContract,
|
|
727
1201
|
linkGuardianContract,
|
|
1202
|
+
listAccountsContract,
|
|
1203
|
+
listAcknowledgementsContract,
|
|
1204
|
+
listActiveBlocksContract,
|
|
1205
|
+
listBanksContract,
|
|
1206
|
+
listCategoriesContract,
|
|
728
1207
|
listClassesContract,
|
|
1208
|
+
listDeliveriesContract,
|
|
729
1209
|
listDepartmentsContract,
|
|
1210
|
+
listEntriesContract,
|
|
1211
|
+
listForGuardianContract,
|
|
730
1212
|
listGradesContract,
|
|
1213
|
+
listResponsesContract,
|
|
731
1214
|
listStaffContract,
|
|
732
1215
|
listStudentsContract,
|
|
1216
|
+
listTemplatesContract,
|
|
733
1217
|
listTermsContract,
|
|
734
1218
|
listYearsContract,
|
|
735
1219
|
loginContract,
|
|
736
1220
|
logoutContract,
|
|
737
1221
|
markAttendanceContract,
|
|
1222
|
+
markReadContract,
|
|
1223
|
+
markUnreadContract,
|
|
1224
|
+
notificationsContract,
|
|
738
1225
|
refreshTokenContract,
|
|
1226
|
+
rejectContract,
|
|
1227
|
+
requestLiftContract,
|
|
739
1228
|
requestPasswordResetContract,
|
|
740
1229
|
resetPasswordContract,
|
|
1230
|
+
resolveBlockAltContract,
|
|
1231
|
+
resolveBlockContract,
|
|
1232
|
+
respondContract,
|
|
1233
|
+
respondToBlockContract,
|
|
1234
|
+
respondToDiaryEntryContract,
|
|
741
1235
|
setCurrentTermContract,
|
|
742
1236
|
setCurrentYearContract,
|
|
1237
|
+
setDefaultContract,
|
|
743
1238
|
studentsContract,
|
|
1239
|
+
submitContract,
|
|
744
1240
|
switchBranchContract,
|
|
1241
|
+
updateBankAccountContract,
|
|
1242
|
+
updateCategoryContract,
|
|
745
1243
|
updateStaffStatusContract
|
|
746
1244
|
});
|
|
747
1245
|
//# sourceMappingURL=index.cjs.map
|