@brite-future-schools-contracts/contracts 2.0.26 → 2.0.30
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-LIPNVYGK.js +374 -0
- package/dist/chunk-LIPNVYGK.js.map +1 -0
- package/dist/chunk-W3NAS6DL.js +1 -0
- package/dist/{chunk-CL7UHAQE.js → chunk-WGPI4GGP.js} +362 -10
- package/dist/chunk-WGPI4GGP.js.map +1 -0
- package/dist/contracts/index.cjs +494 -0
- package/dist/contracts/index.cjs.map +1 -1
- package/dist/contracts/index.d.cts +2084 -1
- package/dist/contracts/index.d.ts +2084 -1
- package/dist/contracts/index.js +84 -2
- package/dist/index.cjs +613 -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 +404 -9
- package/dist/schemas/index.cjs.map +1 -1
- package/dist/schemas/index.d.cts +545 -1
- package/dist/schemas/index.d.ts +545 -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,498 @@ 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
|
+
deliveryChannels: z18.array(NotificationChannelSchema).optional(),
|
|
1016
|
+
scheduledAt: z18.string().datetime().optional(),
|
|
1017
|
+
recurrence: z18.record(z18.string(), z18.unknown()).optional(),
|
|
1018
|
+
audience: z18.array(NotificationAudienceItemSchema)
|
|
1019
|
+
});
|
|
1020
|
+
var ListNotificationTemplatesInputSchema = z18.object({
|
|
1021
|
+
status: z18.string().optional(),
|
|
1022
|
+
branchId: UuidSchema.optional()
|
|
1023
|
+
});
|
|
1024
|
+
var NotificationTemplateSchema = z18.object({
|
|
1025
|
+
id: UuidSchema,
|
|
1026
|
+
branchId: UuidSchema.nullable(),
|
|
1027
|
+
title: z18.string(),
|
|
1028
|
+
body: z18.string(),
|
|
1029
|
+
urgency: NotificationUrgencySchema,
|
|
1030
|
+
isBlocking: z18.boolean(),
|
|
1031
|
+
deadlineHours: z18.number().nullable(),
|
|
1032
|
+
redirectPath: z18.string().nullable(),
|
|
1033
|
+
redirectParams: z18.record(z18.string(), z18.string()).nullable(),
|
|
1034
|
+
requiresResponse: z18.boolean(),
|
|
1035
|
+
responseOptions: z18.array(z18.string()).nullable(),
|
|
1036
|
+
deliveryChannels: z18.array(NotificationChannelSchema),
|
|
1037
|
+
scheduledAt: z18.string().nullable(),
|
|
1038
|
+
recurrence: z18.record(z18.string(), z18.unknown()).nullable(),
|
|
1039
|
+
lastFiredAt: z18.string().nullable(),
|
|
1040
|
+
nextFireAt: z18.string().nullable(),
|
|
1041
|
+
status: NotificationTemplateStatusSchema,
|
|
1042
|
+
createdBy: UuidSchema,
|
|
1043
|
+
approvedBy: UuidSchema.nullable(),
|
|
1044
|
+
approvedAt: z18.string().nullable(),
|
|
1045
|
+
sentAt: z18.string().nullable(),
|
|
1046
|
+
createdAt: z18.string(),
|
|
1047
|
+
updatedAt: z18.string()
|
|
1048
|
+
});
|
|
1049
|
+
var RejectNotificationInputSchema = z18.object({
|
|
1050
|
+
id: UuidSchema,
|
|
1051
|
+
reason: z18.string().optional()
|
|
1052
|
+
});
|
|
1053
|
+
var ListDeliveriesInputSchema = z18.object({
|
|
1054
|
+
isRead: z18.boolean().optional(),
|
|
1055
|
+
isBlocking: z18.boolean().optional()
|
|
1056
|
+
});
|
|
1057
|
+
var NotificationDeliverySchema = z18.object({
|
|
1058
|
+
id: UuidSchema,
|
|
1059
|
+
notificationId: UuidSchema,
|
|
1060
|
+
userId: UuidSchema,
|
|
1061
|
+
channel: NotificationChannelSchema,
|
|
1062
|
+
deliveredAt: z18.string().nullable(),
|
|
1063
|
+
readAt: z18.string().nullable(),
|
|
1064
|
+
isRead: z18.boolean(),
|
|
1065
|
+
markedUnreadAt: z18.string().nullable(),
|
|
1066
|
+
acknowledgedAt: z18.string().nullable(),
|
|
1067
|
+
response: z18.string().nullable(),
|
|
1068
|
+
isBlocking: z18.boolean(),
|
|
1069
|
+
isResolved: z18.boolean(),
|
|
1070
|
+
resolvedAt: z18.string().nullable(),
|
|
1071
|
+
returnPath: z18.string().nullable(),
|
|
1072
|
+
createdAt: z18.string()
|
|
1073
|
+
});
|
|
1074
|
+
var AcknowledgeDeliveryInputSchema = z18.object({
|
|
1075
|
+
deliveryId: UuidSchema,
|
|
1076
|
+
response: z18.string().optional()
|
|
1077
|
+
});
|
|
1078
|
+
var RespondToDeliveryInputSchema = z18.object({
|
|
1079
|
+
deliveryId: UuidSchema,
|
|
1080
|
+
response: z18.string().min(1)
|
|
1081
|
+
});
|
|
1082
|
+
var ResponseSummarySchema = z18.record(z18.string(), z18.number());
|
|
1083
|
+
var NotificationResponseItemSchema = z18.object({
|
|
1084
|
+
deliveryId: UuidSchema,
|
|
1085
|
+
userId: UuidSchema,
|
|
1086
|
+
userName: z18.string(),
|
|
1087
|
+
userEmail: z18.string(),
|
|
1088
|
+
response: z18.string().nullable(),
|
|
1089
|
+
acknowledgedAt: z18.string().nullable(),
|
|
1090
|
+
isResolved: z18.boolean()
|
|
1091
|
+
});
|
|
1092
|
+
var PortalBlockSchema = z18.object({
|
|
1093
|
+
id: UuidSchema,
|
|
1094
|
+
userId: UuidSchema,
|
|
1095
|
+
blockType: PortalBlockTypeSchema,
|
|
1096
|
+
sourceId: UuidSchema,
|
|
1097
|
+
redirectPath: z18.string(),
|
|
1098
|
+
redirectParams: z18.record(z18.string(), z18.string()).nullable(),
|
|
1099
|
+
returnPath: z18.string().nullable(),
|
|
1100
|
+
severity: NotificationUrgencySchema,
|
|
1101
|
+
isActive: z18.boolean(),
|
|
1102
|
+
activatedAt: z18.string(),
|
|
1103
|
+
resolvedAt: z18.string().nullable(),
|
|
1104
|
+
resolvedBy: UuidSchema.nullable(),
|
|
1105
|
+
resolvedVia: z18.string().nullable(),
|
|
1106
|
+
requiresResponse: z18.boolean(),
|
|
1107
|
+
responseOptions: z18.array(z18.string()).nullable(),
|
|
1108
|
+
createdAt: z18.string()
|
|
1109
|
+
});
|
|
1110
|
+
var RespondToBlockInputSchema = z18.object({
|
|
1111
|
+
blockId: UuidSchema,
|
|
1112
|
+
response: z18.string().min(1)
|
|
1113
|
+
});
|
|
1114
|
+
var RespondToBlockOutputSchema = z18.unknown();
|
|
1115
|
+
|
|
1116
|
+
// src/contracts/notifications.ts
|
|
1117
|
+
var EmptyOutput3 = z19.object({});
|
|
1118
|
+
var IdInput2 = z19.object({ id: UuidSchema });
|
|
1119
|
+
var listTemplatesContract = import_contract9.oc.route({ method: "GET", path: "/notifications/templates" }).input(ListNotificationTemplatesInputSchema).output(z19.array(NotificationTemplateSchema));
|
|
1120
|
+
var getTemplateContract = import_contract9.oc.route({ method: "GET", path: "/notifications/templates/{id}" }).input(IdInput2).output(NotificationTemplateSchema);
|
|
1121
|
+
var createNotificationContract = import_contract9.oc.route({ method: "POST", path: "/notifications/templates" }).input(CreateNotificationInputSchema).output(NotificationTemplateSchema);
|
|
1122
|
+
var submitContract = import_contract9.oc.route({ method: "PATCH", path: "/notifications/templates/{id}/submit" }).input(IdInput2).output(NotificationTemplateSchema);
|
|
1123
|
+
var approveContract = import_contract9.oc.route({ method: "PATCH", path: "/notifications/templates/{id}/approve" }).input(IdInput2).output(NotificationTemplateSchema);
|
|
1124
|
+
var rejectContract = import_contract9.oc.route({ method: "PATCH", path: "/notifications/templates/{id}/reject" }).input(RejectNotificationInputSchema).output(NotificationTemplateSchema);
|
|
1125
|
+
var cancelContract = import_contract9.oc.route({ method: "PATCH", path: "/notifications/templates/{id}/cancel" }).input(IdInput2).output(NotificationTemplateSchema);
|
|
1126
|
+
var listDeliveriesContract = import_contract9.oc.route({ method: "GET", path: "/notifications/deliveries" }).input(ListDeliveriesInputSchema).output(z19.array(NotificationDeliverySchema));
|
|
1127
|
+
var markReadContract = import_contract9.oc.route({ method: "PATCH", path: "/notifications/deliveries/{deliveryId}/read" }).input(z19.object({ deliveryId: UuidSchema })).output(NotificationDeliverySchema);
|
|
1128
|
+
var markUnreadContract = import_contract9.oc.route({ method: "PATCH", path: "/notifications/deliveries/{deliveryId}/unread" }).input(z19.object({ deliveryId: UuidSchema })).output(NotificationDeliverySchema);
|
|
1129
|
+
var acknowledgeContract = import_contract9.oc.route({ method: "PATCH", path: "/notifications/deliveries/{deliveryId}/acknowledge" }).input(AcknowledgeDeliveryInputSchema).output(NotificationDeliverySchema);
|
|
1130
|
+
var respondContract = import_contract9.oc.route({ method: "PATCH", path: "/notifications/deliveries/{deliveryId}/respond" }).input(RespondToDeliveryInputSchema).output(NotificationDeliverySchema);
|
|
1131
|
+
var getResponseSummaryContract = import_contract9.oc.route({ method: "GET", path: "/notifications/templates/{id}/response-summary" }).input(IdInput2).output(ResponseSummarySchema);
|
|
1132
|
+
var listResponsesContract = import_contract9.oc.route({ method: "GET", path: "/notifications/templates/{id}/responses" }).input(IdInput2).output(z19.array(NotificationResponseItemSchema));
|
|
1133
|
+
var resolveBlockContract = import_contract9.oc.route({ method: "PATCH", path: "/notifications/blocks/{blockId}/resolve" }).input(z19.object({ blockId: UuidSchema })).output(PortalBlockSchema);
|
|
1134
|
+
var notificationsContract = {
|
|
1135
|
+
listTemplates: listTemplatesContract,
|
|
1136
|
+
getTemplate: getTemplateContract,
|
|
1137
|
+
create: createNotificationContract,
|
|
1138
|
+
submit: submitContract,
|
|
1139
|
+
approve: approveContract,
|
|
1140
|
+
reject: rejectContract,
|
|
1141
|
+
cancel: cancelContract,
|
|
1142
|
+
listDeliveries: listDeliveriesContract,
|
|
1143
|
+
markRead: markReadContract,
|
|
1144
|
+
markUnread: markUnreadContract,
|
|
1145
|
+
acknowledge: acknowledgeContract,
|
|
1146
|
+
respond: respondContract,
|
|
1147
|
+
getResponseSummary: getResponseSummaryContract,
|
|
1148
|
+
listResponses: listResponsesContract,
|
|
1149
|
+
resolveBlock: resolveBlockContract
|
|
1150
|
+
};
|
|
1151
|
+
var listActiveBlocksContract = import_contract9.oc.route({ method: "GET", path: "/blocks/active" }).input(z19.object({})).output(z19.array(PortalBlockSchema));
|
|
1152
|
+
var resolveBlockAltContract = import_contract9.oc.route({ method: "PATCH", path: "/blocks/{blockId}/resolve" }).input(z19.object({ blockId: UuidSchema })).output(PortalBlockSchema);
|
|
1153
|
+
var respondToBlockContract = import_contract9.oc.route({ method: "PATCH", path: "/blocks/{blockId}/respond" }).input(RespondToBlockInputSchema).output(RespondToBlockOutputSchema);
|
|
1154
|
+
var blocksContract = {
|
|
1155
|
+
listActive: listActiveBlocksContract,
|
|
1156
|
+
resolve: resolveBlockAltContract,
|
|
1157
|
+
respond: respondToBlockContract
|
|
1158
|
+
};
|
|
706
1159
|
// Annotate the CommonJS export names for ESM import in node:
|
|
707
1160
|
0 && (module.exports = {
|
|
1161
|
+
acknowledgeContract,
|
|
1162
|
+
acknowledgeDiaryEntryContract,
|
|
1163
|
+
approveContract,
|
|
1164
|
+
approveLiftContract,
|
|
708
1165
|
attendanceContract,
|
|
709
1166
|
authContract,
|
|
1167
|
+
bankingContract,
|
|
1168
|
+
blocksContract,
|
|
710
1169
|
bulkUploadStudentsContract,
|
|
711
1170
|
calendarContract,
|
|
712
1171
|
calendarListTermsContract,
|
|
1172
|
+
cancelContract,
|
|
713
1173
|
changePasswordContract,
|
|
1174
|
+
createBankAccountContract,
|
|
1175
|
+
createCategoryContract,
|
|
714
1176
|
createDepartmentContract,
|
|
1177
|
+
createEntryContract,
|
|
715
1178
|
createGradeContract,
|
|
1179
|
+
createNotificationContract,
|
|
716
1180
|
createStaffContract,
|
|
717
1181
|
createStudentContract,
|
|
718
1182
|
createTermContract,
|
|
719
1183
|
createYearContract,
|
|
1184
|
+
deactivateContract,
|
|
1185
|
+
diaryContract,
|
|
720
1186
|
getByClassContract,
|
|
1187
|
+
getByIdContract,
|
|
721
1188
|
getByStudentContract,
|
|
1189
|
+
getEntryContract,
|
|
722
1190
|
getMeContract,
|
|
1191
|
+
getResponseSummaryContract,
|
|
723
1192
|
getStaffByIdContract,
|
|
724
1193
|
getStudentByIdContract,
|
|
1194
|
+
getTemplateContract,
|
|
725
1195
|
gradesContract,
|
|
726
1196
|
hrContract,
|
|
727
1197
|
linkGuardianContract,
|
|
1198
|
+
listAccountsContract,
|
|
1199
|
+
listAcknowledgementsContract,
|
|
1200
|
+
listActiveBlocksContract,
|
|
1201
|
+
listBanksContract,
|
|
1202
|
+
listCategoriesContract,
|
|
728
1203
|
listClassesContract,
|
|
1204
|
+
listDeliveriesContract,
|
|
729
1205
|
listDepartmentsContract,
|
|
1206
|
+
listEntriesContract,
|
|
1207
|
+
listForGuardianContract,
|
|
730
1208
|
listGradesContract,
|
|
1209
|
+
listResponsesContract,
|
|
731
1210
|
listStaffContract,
|
|
732
1211
|
listStudentsContract,
|
|
1212
|
+
listTemplatesContract,
|
|
733
1213
|
listTermsContract,
|
|
734
1214
|
listYearsContract,
|
|
735
1215
|
loginContract,
|
|
736
1216
|
logoutContract,
|
|
737
1217
|
markAttendanceContract,
|
|
1218
|
+
markReadContract,
|
|
1219
|
+
markUnreadContract,
|
|
1220
|
+
notificationsContract,
|
|
738
1221
|
refreshTokenContract,
|
|
1222
|
+
rejectContract,
|
|
1223
|
+
requestLiftContract,
|
|
739
1224
|
requestPasswordResetContract,
|
|
740
1225
|
resetPasswordContract,
|
|
1226
|
+
resolveBlockAltContract,
|
|
1227
|
+
resolveBlockContract,
|
|
1228
|
+
respondContract,
|
|
1229
|
+
respondToBlockContract,
|
|
1230
|
+
respondToDiaryEntryContract,
|
|
741
1231
|
setCurrentTermContract,
|
|
742
1232
|
setCurrentYearContract,
|
|
1233
|
+
setDefaultContract,
|
|
743
1234
|
studentsContract,
|
|
1235
|
+
submitContract,
|
|
744
1236
|
switchBranchContract,
|
|
1237
|
+
updateBankAccountContract,
|
|
1238
|
+
updateCategoryContract,
|
|
745
1239
|
updateStaffStatusContract
|
|
746
1240
|
});
|
|
747
1241
|
//# sourceMappingURL=index.cjs.map
|