@brite-future-schools-contracts/contracts 2.0.36 → 2.0.40

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.
@@ -51,6 +51,7 @@ import {
51
51
  NotificationResponseItemSchema,
52
52
  NotificationTemplateSchema,
53
53
  PortalBlockSchema,
54
+ ProfileOutputSchema,
54
55
  RefreshTokenInputSchema,
55
56
  RefreshTokenOutputSchema,
56
57
  RejectNotificationInputSchema,
@@ -73,8 +74,11 @@ import {
73
74
  TermSchema,
74
75
  UpdateBankAccountInputSchema,
75
76
  UpdateDiaryCategoryInputSchema,
76
- UuidSchema
77
- } from "./chunk-E3VLQFEY.js";
77
+ UpdateProfileInputSchema,
78
+ UuidSchema,
79
+ VerifyPasswordInputSchema,
80
+ VerifyPasswordOutputSchema
81
+ } from "./chunk-VNZGHQ6T.js";
78
82
 
79
83
  // src/contracts/auth.ts
80
84
  import { oc } from "@orpc/contract";
@@ -88,6 +92,9 @@ var changePasswordContract = oc.route({ method: "POST", path: "/auth/change-pass
88
92
  var requestPasswordResetContract = oc.route({ method: "POST", path: "/auth/request-password-reset" }).input(RequestPasswordResetInputSchema).output(EmptyOutputSchema);
89
93
  var resetPasswordContract = oc.route({ method: "POST", path: "/auth/reset-password" }).input(ResetPasswordInputSchema).output(EmptyOutputSchema);
90
94
  var switchBranchContract = oc.route({ method: "POST", path: "/auth/switch-branch" }).input(SwitchBranchInputSchema).output(SessionUserOutputSchema);
95
+ var verifyPasswordContract = oc.route({ method: "POST", path: "/auth/verify-password" }).input(VerifyPasswordInputSchema).output(VerifyPasswordOutputSchema);
96
+ var getProfileContract = oc.route({ method: "GET", path: "/auth/profile" }).output(ProfileOutputSchema);
97
+ var updateProfileContract = oc.route({ method: "PATCH", path: "/auth/profile" }).input(UpdateProfileInputSchema).output(ProfileOutputSchema);
91
98
  var authContract = {
92
99
  login: loginContract,
93
100
  refreshToken: refreshTokenContract,
@@ -96,7 +103,10 @@ var authContract = {
96
103
  changePassword: changePasswordContract,
97
104
  requestPasswordReset: requestPasswordResetContract,
98
105
  resetPassword: resetPasswordContract,
99
- switchBranch: switchBranchContract
106
+ switchBranch: switchBranchContract,
107
+ verifyPassword: verifyPasswordContract,
108
+ profile: getProfileContract,
109
+ updateProfile: updateProfileContract
100
110
  };
101
111
 
102
112
  // src/contracts/hr.ts
@@ -299,6 +309,9 @@ export {
299
309
  requestPasswordResetContract,
300
310
  resetPasswordContract,
301
311
  switchBranchContract,
312
+ verifyPasswordContract,
313
+ getProfileContract,
314
+ updateProfileContract,
302
315
  authContract,
303
316
  createStaffContract,
304
317
  listStaffContract,
@@ -371,4 +384,4 @@ export {
371
384
  respondToBlockContract,
372
385
  blocksContract
373
386
  };
374
- //# sourceMappingURL=chunk-RV423CEB.js.map
387
+ //# sourceMappingURL=chunk-KTEC74C2.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/contracts/auth.ts","../src/contracts/hr.ts","../src/contracts/students.ts","../src/contracts/attendance.ts","../src/contracts/calendar.ts","../src/contracts/grades.ts","../src/contracts/diary.ts","../src/contracts/banking.ts","../src/contracts/notifications.ts"],"sourcesContent":["/**\n * Brite Future Schools — bfs-contracts\n * Auth oRPC contract.\n *\n * Defines the API surface for authentication. The bfs-api module\n * imports this and passes it to `implement()` — no logic lives here.\n *\n * HTTP method + path pairs follow REST conventions and feed into the\n * OpenAPI spec that oRPC generates automatically.\n *\n * Phase History:\n * Phase 0.1 (2026-06-05): Initial creation\n *\n * @module src/contracts/auth\n * @since Phase 0.1\n */\n\nimport { oc } from '@orpc/contract'\nimport * as z from 'zod'\nimport {\n ChangePasswordInputSchema,\n LoginInputSchema,\n LoginOutputSchema,\n LogoutInputSchema,\n RefreshTokenInputSchema,\n RefreshTokenOutputSchema,\n RequestPasswordResetInputSchema,\n ResetPasswordInputSchema,\n SessionUserOutputSchema,\n SwitchBranchInputSchema,\n VerifyPasswordInputSchema,\n VerifyPasswordOutputSchema,\n ProfileOutputSchema,\n UpdateProfileInputSchema,\n} from '../schemas/auth.js'\n\n/** Reusable empty-success output — used by mutations that return nothing */\nconst EmptyOutputSchema = z.object({}).meta({ description: 'Empty success response' })\n\n// ── Individual procedure contracts ────────────────────────────────────────────\n\n/** Exchange email + password for access/refresh token pair */\nexport const loginContract = oc\n .route({ method: 'POST', path: '/auth/login' })\n .input(LoginInputSchema)\n .output(LoginOutputSchema)\n\n/** Exchange a refresh token for a new access token */\nexport const refreshTokenContract = oc\n .route({ method: 'POST', path: '/auth/refresh' })\n .input(RefreshTokenInputSchema)\n .output(RefreshTokenOutputSchema)\n\n/** Revoke the current refresh token and end the session */\nexport const logoutContract = oc\n .route({ method: 'POST', path: '/auth/logout' })\n .input(LogoutInputSchema)\n .output(EmptyOutputSchema)\n\n/** Return the session user object for the current access token */\nexport const getMeContract = oc\n .route({ method: 'GET', path: '/auth/me' })\n .output(SessionUserOutputSchema)\n\n/** Change password (authenticated, requires current password) */\nexport const changePasswordContract = oc\n .route({ method: 'POST', path: '/auth/change-password' })\n .input(ChangePasswordInputSchema)\n .output(EmptyOutputSchema)\n\n/** Request a password-reset email */\nexport const requestPasswordResetContract = oc\n .route({ method: 'POST', path: '/auth/request-password-reset' })\n .input(RequestPasswordResetInputSchema)\n .output(EmptyOutputSchema)\n\n/** Complete a password reset using the emailed one-time token */\nexport const resetPasswordContract = oc\n .route({ method: 'POST', path: '/auth/reset-password' })\n .input(ResetPasswordInputSchema)\n .output(EmptyOutputSchema)\n\n/** Switch the active branch within an existing session */\nexport const switchBranchContract = oc\n .route({ method: 'POST', path: '/auth/switch-branch' })\n .input(SwitchBranchInputSchema)\n .output(SessionUserOutputSchema)\n\n/** Confirm the current password before a sensitive change (e.g. email change) */\nexport const verifyPasswordContract = oc\n .route({ method: 'POST', path: '/auth/verify-password' })\n .input(VerifyPasswordInputSchema)\n .output(VerifyPasswordOutputSchema)\n\n/** Return the full self-service profile for the current user */\nexport const getProfileContract = oc\n .route({ method: 'GET', path: '/auth/profile' })\n .output(ProfileOutputSchema)\n\n/** Update the current user's own profile fields (name, phone) */\nexport const updateProfileContract = oc\n .route({ method: 'PATCH', path: '/auth/profile' })\n .input(UpdateProfileInputSchema)\n .output(ProfileOutputSchema)\n\n// ── Auth contract router ──────────────────────────────────────────────────────\n\nexport const authContract = {\n login: loginContract,\n refreshToken: refreshTokenContract,\n logout: logoutContract,\n me: getMeContract,\n changePassword: changePasswordContract,\n requestPasswordReset: requestPasswordResetContract,\n resetPassword: resetPasswordContract,\n switchBranch: switchBranchContract,\n verifyPassword: verifyPasswordContract,\n profile: getProfileContract,\n updateProfile: updateProfileContract,\n}\n","/**\n * Brite Future Schools — bfs-contracts\n * HR oRPC contract — staff and department procedure definitions.\n *\n * Phase History:\n * Phase 1 (2026-06-07): Initial creation\n *\n * @module src/contracts/hr\n * @since Phase 1\n */\n\nimport { oc } from '@orpc/contract'\nimport * as z from 'zod'\nimport { UuidSchema, PaginationInputSchema } from '../schemas/base.js'\nimport {\n CreateStaffInputSchema,\n CreateStaffOutputSchema,\n StaffProfileSchema,\n StaffListItemSchema,\n ListStaffInputSchema,\n DepartmentSchema,\n CreateDepartmentInputSchema,\n} from '../schemas/hr.js'\n\nconst EmptyOutput = z.object({})\n\n// ── Staff ──────────────────────────────────────────────────────────────────────\n\nexport const createStaffContract = oc\n .route({ method: 'POST', path: '/hr/staff' })\n .input(CreateStaffInputSchema)\n .output(CreateStaffOutputSchema)\n\nexport const listStaffContract = oc\n .route({ method: 'GET', path: '/hr/staff' })\n .input(ListStaffInputSchema)\n .output(z.object({\n items: z.array(StaffListItemSchema),\n total: z.number(),\n nextCursor: UuidSchema.nullable(),\n }))\n\nexport const getStaffByIdContract = oc\n .route({ method: 'GET', path: '/hr/staff/{id}' })\n .input(z.object({ id: UuidSchema }))\n .output(StaffProfileSchema)\n\nexport const updateStaffStatusContract = oc\n .route({ method: 'PATCH', path: '/hr/staff/{id}/status' })\n .input(z.object({\n id: UuidSchema,\n status: z.enum(['active', 'inactive', 'suspended']),\n }))\n .output(EmptyOutput)\n\n// ── Departments ────────────────────────────────────────────────────────────────\n\nexport const listDepartmentsContract = oc\n .route({ method: 'GET', path: '/hr/departments' })\n .input(z.object({ branchId: UuidSchema.optional() }))\n .output(z.array(DepartmentSchema))\n\nexport const createDepartmentContract = oc\n .route({ method: 'POST', path: '/hr/departments' })\n .input(CreateDepartmentInputSchema)\n .output(DepartmentSchema)\n\n// ── HR contract router ─────────────────────────────────────────────────────────\n\nexport const hrContract = {\n createStaff: createStaffContract,\n listStaff: listStaffContract,\n getStaffById: getStaffByIdContract,\n updateStaffStatus: updateStaffStatusContract,\n listDepartments: listDepartmentsContract,\n createDepartment: createDepartmentContract,\n}","/**\n * Brite Future Schools — bfs-contracts\n * Students oRPC contract — student and guardian procedure definitions.\n *\n * Phase History:\n * Phase 1 (2026-06-07): Initial creation\n *\n * @module src/contracts/students\n * @since Phase 1\n */\n\nimport { oc } from '@orpc/contract'\nimport * as z from 'zod'\nimport { UuidSchema } from '../schemas/base.js'\nimport {\n CreateStudentInputSchema,\n CreateStudentOutputSchema,\n StudentProfileSchema,\n StudentListItemSchema,\n ListStudentsInputSchema,\n BulkUploadStudentsInputSchema,\n BulkUploadStudentsOutputSchema,\n LinkGuardianInputSchema,\n ClassSummarySchema,\n} from '../schemas/students.js'\n\nconst EmptyOutput = z.object({})\n\n// ── Students ───────────────────────────────────────────────────────────────────\n\nexport const createStudentContract = oc\n .route({ method: 'POST', path: '/students' })\n .input(CreateStudentInputSchema)\n .output(CreateStudentOutputSchema)\n\nexport const bulkUploadStudentsContract = oc\n .route({ method: 'POST', path: '/students/bulk' })\n .input(BulkUploadStudentsInputSchema)\n .output(BulkUploadStudentsOutputSchema)\n\nexport const listStudentsContract = oc\n .route({ method: 'GET', path: '/students' })\n .input(ListStudentsInputSchema)\n .output(z.object({\n items: z.array(StudentListItemSchema),\n total: z.number(),\n nextCursor: UuidSchema.nullable(),\n }))\n\nexport const getStudentByIdContract = oc\n .route({ method: 'GET', path: '/students/{id}' })\n .input(z.object({ id: UuidSchema }))\n .output(StudentProfileSchema)\n\n// ── Guardians ──────────────────────────────────────────────────────────────────\n\nexport const linkGuardianContract = oc\n .route({ method: 'POST', path: '/students/guardians' })\n .input(LinkGuardianInputSchema)\n .output(z.object({ guardianId: UuidSchema }))\n\n// ── Classes (selector data) ────────────────────────────────────────────────────\n\nexport const listClassesContract = oc\n .route({ method: 'GET', path: '/students/classes' })\n .input(z.object({\n termId: UuidSchema.optional(),\n gradeLevel: z.string().optional(),\n }))\n .output(z.array(ClassSummarySchema))\n\n// ── Students contract router ───────────────────────────────────────────────────\n\nexport const studentsContract = {\n create: createStudentContract,\n bulkUpload: bulkUploadStudentsContract,\n list: listStudentsContract,\n getById: getStudentByIdContract,\n linkGuardian: linkGuardianContract,\n listClasses: listClassesContract,\n}","/**\n * Brite Future Schools — bfs-contracts\n * Attendance oRPC contract — class attendance procedure definitions.\n *\n * Phase History:\n * Phase 2.1 (2026-06-08): Initial — mark, getByClass, getByStudent, listTerms\n *\n * @module src/contracts/attendance\n * @since Phase 2.1\n */\n\nimport { oc } from '@orpc/contract'\nimport * as z from 'zod'\nimport { UuidSchema } from '../schemas/base.js'\nimport {\n MarkAttendanceInputSchema,\n MarkAttendanceOutputSchema,\n GetByClassInputSchema,\n GetByStudentInputSchema,\n ClassAttendanceRowSchema,\n StudentAttendanceRowSchema,\n TermSchema,\n} from '../schemas/attendance.js'\n\n// ── Class attendance ───────────────────────────────────────────────────────────\n\nexport const markAttendanceContract = oc\n .route({ method: 'POST', path: '/attendance/class/mark' })\n .input(MarkAttendanceInputSchema)\n .output(MarkAttendanceOutputSchema)\n\nexport const getByClassContract = oc\n .route({ method: 'GET', path: '/attendance/class' })\n .input(GetByClassInputSchema)\n .output(z.array(ClassAttendanceRowSchema))\n\nexport const getByStudentContract = oc\n .route({ method: 'GET', path: '/attendance/student' })\n .input(GetByStudentInputSchema)\n .output(z.array(StudentAttendanceRowSchema))\n\n// ── Terms ──────────────────────────────────────────────────────────────────────\n\nexport const listTermsContract = oc\n .route({ method: 'GET', path: '/terms' })\n .input(z.object({}))\n .output(z.array(TermSchema))\n\n// ── Attendance contract router ─────────────────────────────────────────────────\n\nexport const attendanceContract = {\n mark: markAttendanceContract,\n getByClass: getByClassContract,\n getByStudent: getByStudentContract,\n listTerms: listTermsContract,\n}","/**\n * Brite Future Schools — bfs-contracts\n * Calendar oRPC contract — academic year and term procedure definitions.\n *\n * Phase History:\n * Phase 4.1 (2026-06-12): Initial creation\n *\n * @module src/contracts/calendar\n * @since Phase 4.1\n */\n\nimport { oc } from '@orpc/contract'\nimport * as z from 'zod'\nimport {\n AcademicYearSchema,\n AcademicTermSchema,\n CreateYearInputSchema,\n CreateTermInputSchema,\n SetCurrentYearInputSchema,\n SetCurrentTermInputSchema,\n ListTermsInputSchema,\n} from '../schemas/calendar.js'\n\n// ── Academic Years ─────────────────────────────────────────────────────────────\n\nexport const listYearsContract = oc\n .route({ method: 'GET', path: '/calendar/years' })\n .input(z.object({}))\n .output(z.array(AcademicYearSchema))\n\nexport const createYearContract = oc\n .route({ method: 'POST', path: '/calendar/years' })\n .input(CreateYearInputSchema)\n .output(AcademicYearSchema)\n\nexport const setCurrentYearContract = oc\n .route({ method: 'POST', path: '/calendar/years/current' })\n .input(SetCurrentYearInputSchema)\n .output(AcademicYearSchema)\n\n// ── Terms ──────────────────────────────────────────────────────────────────────\n// Prefixed with \"calendarList\" to avoid clash with attendance.listTermsContract\n\nexport const calendarListTermsContract = oc\n .route({ method: 'GET', path: '/calendar/terms' })\n .input(ListTermsInputSchema)\n .output(z.array(AcademicTermSchema))\n\nexport const createTermContract = oc\n .route({ method: 'POST', path: '/calendar/terms' })\n .input(CreateTermInputSchema)\n .output(AcademicTermSchema)\n\nexport const setCurrentTermContract = oc\n .route({ method: 'POST', path: '/calendar/terms/current' })\n .input(SetCurrentTermInputSchema)\n .output(AcademicTermSchema)\n\n// ── Calendar contract router ───────────────────────────────────────────────────\n\nexport const calendarContract = {\n listYears: listYearsContract,\n createYear: createYearContract,\n setCurrentYear: setCurrentYearContract,\n listTerms: calendarListTermsContract,\n createTerm: createTermContract,\n setCurrentTerm: setCurrentTermContract,\n}","/**\n * Brite Future Schools — bfs-contracts\n * Grades oRPC contract — grade procedure definitions.\n *\n * Phase History:\n * Phase 4.1 (2026-06-12): Initial creation\n *\n * @module src/contracts/grades\n * @since Phase 4.1\n */\n\nimport { oc } from '@orpc/contract'\nimport * as z from 'zod'\nimport {\n GradeSchema,\n CreateGradeInputSchema,\n} from '../schemas/grades.js'\n\n// ── Grades ─────────────────────────────────────────────────────────────────────\n\nexport const listGradesContract = oc\n .route({ method: 'GET', path: '/grades' })\n .input(z.object({}))\n .output(z.array(GradeSchema))\n\nexport const createGradeContract = oc\n .route({ method: 'POST', path: '/grades' })\n .input(CreateGradeInputSchema)\n .output(GradeSchema)\n\n// ── Grades contract router ─────────────────────────────────────────────────────\n\nexport const gradesContract = {\n list: listGradesContract,\n create: createGradeContract,\n}","/**\n * Brite Future Schools — bfs-contracts\n * E-Diary oRPC contract — categories, entries, acknowledgements, block lift chain.\n *\n * Phase History:\n * Phase 8 (2026-07-20): Initial creation — Module 2 (E-Diary)\n *\n * @module src/contracts/diary\n * @since Phase 8\n */\n\nimport { oc } from '@orpc/contract'\nimport * as z from 'zod'\nimport { UuidSchema } from '../schemas/base.js'\nimport {\n CreateDiaryCategoryInputSchema,\n UpdateDiaryCategoryInputSchema,\n DiaryCategorySchema,\n ListDiaryEntriesInputSchema,\n DiaryEntrySchema,\n DiaryEntryDetailSchema,\n DiaryEntryForGuardianSchema,\n CreateDiaryEntryInputSchema,\n AcknowledgeDiaryEntryInputSchema,\n RespondToDiaryEntryInputSchema,\n DiaryAcknowledgementSchema,\n DiaryBlockIdInputSchema,\n DiaryBlockSchema,\n ListDiaryAcknowledgementsInputSchema,\n} from '../schemas/diary.js'\n\nconst IdInput = z.object({ id: UuidSchema })\n\n// ── diary.listCategories ─────────────────────────────────────────────────────\n\nexport const listCategoriesContract = oc\n .route({ method: 'GET', path: '/diary/categories' })\n .input(z.object({}))\n .output(z.array(DiaryCategorySchema))\n\n// ── diary.createCategory ─────────────────────────────────────────────────────\n\nexport const createCategoryContract = oc\n .route({ method: 'POST', path: '/diary/categories' })\n .input(CreateDiaryCategoryInputSchema)\n .output(DiaryCategorySchema)\n\n// ── diary.updateCategory ─────────────────────────────────────────────────────\n\nexport const updateCategoryContract = oc\n .route({ method: 'PATCH', path: '/diary/categories/{id}' })\n .input(UpdateDiaryCategoryInputSchema)\n .output(DiaryCategorySchema)\n\n// ── diary.listEntries ─────────────────────────────────────────────────────────\n\nexport const listEntriesContract = oc\n .route({ method: 'GET', path: '/diary/entries' })\n .input(ListDiaryEntriesInputSchema)\n .output(z.array(DiaryEntrySchema))\n\n// ── diary.listForGuardian ─────────────────────────────────────────────────────\n// Guardian-facing, authed not branched — no activeBranchId in scope.\n\nexport const listForGuardianContract = oc\n .route({ method: 'GET', path: '/diary/entries/guardian' })\n .input(z.object({}))\n .output(z.array(DiaryEntryForGuardianSchema))\n\n// ── diary.getEntry ────────────────────────────────────────────────────────────\n\nexport const getEntryContract = oc\n .route({ method: 'GET', path: '/diary/entries/{id}' })\n .input(IdInput)\n .output(DiaryEntryDetailSchema)\n\n// ── diary.createEntry ─────────────────────────────────────────────────────────\n\nexport const createEntryContract = oc\n .route({ method: 'POST', path: '/diary/entries' })\n .input(CreateDiaryEntryInputSchema)\n .output(DiaryEntrySchema)\n\n// ── diary.acknowledge ─────────────────────────────────────────────────────────\n\nexport const acknowledgeDiaryEntryContract = oc\n .route({ method: 'PATCH', path: '/diary/entries/{entryId}/acknowledge' })\n .input(AcknowledgeDiaryEntryInputSchema)\n .output(DiaryAcknowledgementSchema)\n\n// ── diary.respond ─────────────────────────────────────────────────────────────\n\nexport const respondToDiaryEntryContract = oc\n .route({ method: 'PATCH', path: '/diary/entries/{entryId}/respond' })\n .input(RespondToDiaryEntryInputSchema)\n .output(DiaryAcknowledgementSchema)\n\n// ── diary.requestLift ─────────────────────────────────────────────────────────\n\nexport const requestLiftContract = oc\n .route({ method: 'PATCH', path: '/diary/blocks/{blockId}/request-lift' })\n .input(DiaryBlockIdInputSchema)\n .output(DiaryBlockSchema)\n\n// ── diary.approveLift ─────────────────────────────────────────────────────────\n\nexport const approveLiftContract = oc\n .route({ method: 'PATCH', path: '/diary/blocks/{blockId}/approve-lift' })\n .input(DiaryBlockIdInputSchema)\n .output(DiaryBlockSchema)\n\n// ── diary.listAcknowledgements ────────────────────────────────────────────────\n\nexport const listAcknowledgementsContract = oc\n .route({ method: 'GET', path: '/diary/entries/{entryId}/acknowledgements' })\n .input(ListDiaryAcknowledgementsInputSchema)\n .output(z.array(DiaryAcknowledgementSchema))\n\n// ── Diary contract router ────────────────────────────────────────────────────\n\nexport const diaryContract = {\n listCategories: listCategoriesContract,\n createCategory: createCategoryContract,\n updateCategory: updateCategoryContract,\n listEntries: listEntriesContract,\n listForGuardian: listForGuardianContract,\n getEntry: getEntryContract,\n createEntry: createEntryContract,\n acknowledge: acknowledgeDiaryEntryContract,\n respond: respondToDiaryEntryContract,\n requestLift: requestLiftContract,\n approveLift: approveLiftContract,\n listAcknowledgements: listAcknowledgementsContract,\n}\n","/**\n * Brite Future Schools — bfs-contracts\n * Banking oRPC contract — branch bank account procedure definitions.\n *\n * Phase History:\n * Phase 8 (2026-07-20): Initial creation — Module 1 (Branch Banking)\n *\n * @module src/contracts/banking\n * @since Phase 8\n */\n\nimport { oc } from '@orpc/contract'\nimport * as z from 'zod'\nimport { UuidSchema } from '../schemas/base.js'\nimport {\n CreateBankAccountInputSchema,\n UpdateBankAccountInputSchema,\n ListBankAccountsInputSchema,\n BranchBankAccountSchema,\n KenyanBankSchema,\n} from '../schemas/banking.js'\n\n// ── banking.listAccounts ─────────────────────────────────────────────────────\n\nexport const listAccountsContract = oc\n .route({ method: 'GET', path: '/banking/accounts' })\n .input(ListBankAccountsInputSchema)\n .output(z.array(BranchBankAccountSchema))\n\n// ── banking.getById ──────────────────────────────────────────────────────────\n\nexport const getByIdContract = oc\n .route({ method: 'GET', path: '/banking/accounts/{id}' })\n .input(z.object({ id: UuidSchema }))\n .output(BranchBankAccountSchema)\n\n// ── banking.create ───────────────────────────────────────────────────────────\n\nexport const createBankAccountContract = oc\n .route({ method: 'POST', path: '/banking/accounts' })\n .input(CreateBankAccountInputSchema)\n .output(BranchBankAccountSchema)\n\n// ── banking.update ───────────────────────────────────────────────────────────\n\nexport const updateBankAccountContract = oc\n .route({ method: 'PATCH', path: '/banking/accounts/{id}' })\n .input(UpdateBankAccountInputSchema)\n .output(BranchBankAccountSchema)\n\n// ── banking.setDefault ───────────────────────────────────────────────────────\n\nexport const setDefaultContract = oc\n .route({ method: 'PATCH', path: '/banking/accounts/{id}/default' })\n .input(z.object({ id: UuidSchema }))\n .output(BranchBankAccountSchema)\n\n// ── banking.deactivate ───────────────────────────────────────────────────────\n\nexport const deactivateContract = oc\n .route({ method: 'PATCH', path: '/banking/accounts/{id}/deactivate' })\n .input(z.object({ id: UuidSchema }))\n .output(BranchBankAccountSchema)\n\n// ── banking.listBanks ────────────────────────────────────────────────────────\n\nexport const listBanksContract = oc\n .route({ method: 'GET', path: '/banking/banks' })\n .input(z.object({}))\n .output(z.array(KenyanBankSchema))\n\n// ── Banking contract router ──────────────────────────────────────────────────\n\nexport const bankingContract = {\n listAccounts: listAccountsContract,\n getById: getByIdContract,\n create: createBankAccountContract,\n update: updateBankAccountContract,\n setDefault: setDefaultContract,\n deactivate: deactivateContract,\n listBanks: listBanksContract,\n}\n","/**\n * Brite Future Schools — bfs-contracts\n * Notifications oRPC contract — templates, approval workflow, deliveries,\n * and the universal portal block gate.\n *\n * Two contract routers are exported, matching bfs-api's two-namespace\n * split: notificationsContract (template/delivery lifecycle) and\n * blocksContract (BlockGate's universal cross-module gate).\n *\n * Phase History:\n * Phase 8 (2026-07-20): Initial creation — Module 3 (Notification System)\n *\n * @module src/contracts/notifications\n * @since Phase 8\n */\n\nimport { oc } from '@orpc/contract'\nimport * as z from 'zod'\nimport { UuidSchema } from '../schemas/base.js'\nimport {\n CreateNotificationInputSchema,\n ListNotificationTemplatesInputSchema,\n NotificationTemplateSchema,\n RejectNotificationInputSchema,\n ListDeliveriesInputSchema,\n NotificationDeliverySchema,\n AcknowledgeDeliveryInputSchema,\n RespondToDeliveryInputSchema,\n ResponseSummarySchema,\n NotificationResponseItemSchema,\n PortalBlockSchema,\n RespondToBlockInputSchema,\n RespondToBlockOutputSchema,\n} from '../schemas/notifications.js'\n\nconst EmptyOutput = z.object({})\nconst IdInput = z.object({ id: UuidSchema })\n\n// ── notifications.listTemplates ──────────────────────────────────────────────\n\nexport const listTemplatesContract = oc\n .route({ method: 'GET', path: '/notifications/templates' })\n .input(ListNotificationTemplatesInputSchema)\n .output(z.array(NotificationTemplateSchema))\n\n// ── notifications.getTemplate ────────────────────────────────────────────────\n\nexport const getTemplateContract = oc\n .route({ method: 'GET', path: '/notifications/templates/{id}' })\n .input(IdInput)\n .output(NotificationTemplateSchema)\n\n// ── notifications.create ─────────────────────────────────────────────────────\n\nexport const createNotificationContract = oc\n .route({ method: 'POST', path: '/notifications/templates' })\n .input(CreateNotificationInputSchema)\n .output(NotificationTemplateSchema)\n\n// ── notifications.submit ─────────────────────────────────────────────────────\n\nexport const submitContract = oc\n .route({ method: 'PATCH', path: '/notifications/templates/{id}/submit' })\n .input(IdInput)\n .output(NotificationTemplateSchema)\n\n// ── notifications.approve ────────────────────────────────────────────────────\n\nexport const approveContract = oc\n .route({ method: 'PATCH', path: '/notifications/templates/{id}/approve' })\n .input(IdInput)\n .output(NotificationTemplateSchema)\n\n// ── notifications.reject ─────────────────────────────────────────────────────\n\nexport const rejectContract = oc\n .route({ method: 'PATCH', path: '/notifications/templates/{id}/reject' })\n .input(RejectNotificationInputSchema)\n .output(NotificationTemplateSchema)\n\n// ── notifications.cancel ─────────────────────────────────────────────────────\n\nexport const cancelContract = oc\n .route({ method: 'PATCH', path: '/notifications/templates/{id}/cancel' })\n .input(IdInput)\n .output(NotificationTemplateSchema)\n\n// ── notifications.listDeliveries ─────────────────────────────────────────────\n\nexport const listDeliveriesContract = oc\n .route({ method: 'GET', path: '/notifications/deliveries' })\n .input(ListDeliveriesInputSchema)\n .output(z.array(NotificationDeliverySchema))\n\n// ── notifications.markRead / markUnread ──────────────────────────────────────\n\nexport const markReadContract = oc\n .route({ method: 'PATCH', path: '/notifications/deliveries/{deliveryId}/read' })\n .input(z.object({ deliveryId: UuidSchema }))\n .output(NotificationDeliverySchema)\n\nexport const markUnreadContract = oc\n .route({ method: 'PATCH', path: '/notifications/deliveries/{deliveryId}/unread' })\n .input(z.object({ deliveryId: UuidSchema }))\n .output(NotificationDeliverySchema)\n\n// ── notifications.acknowledge / respond ──────────────────────────────────────\n\nexport const acknowledgeContract = oc\n .route({ method: 'PATCH', path: '/notifications/deliveries/{deliveryId}/acknowledge' })\n .input(AcknowledgeDeliveryInputSchema)\n .output(NotificationDeliverySchema)\n\nexport const respondContract = oc\n .route({ method: 'PATCH', path: '/notifications/deliveries/{deliveryId}/respond' })\n .input(RespondToDeliveryInputSchema)\n .output(NotificationDeliverySchema)\n\n// ── notifications.getResponseSummary ─────────────────────────────────────────\n\nexport const getResponseSummaryContract = oc\n .route({ method: 'GET', path: '/notifications/templates/{id}/response-summary' })\n .input(IdInput)\n .output(ResponseSummarySchema)\n\n// ── notifications.listResponses ──────────────────────────────────────────────\n\nexport const listResponsesContract = oc\n .route({ method: 'GET', path: '/notifications/templates/{id}/responses' })\n .input(IdInput)\n .output(z.array(NotificationResponseItemSchema))\n\n// ── notifications.resolveBlock ───────────────────────────────────────────────\n\nexport const resolveBlockContract = oc\n .route({ method: 'PATCH', path: '/notifications/blocks/{blockId}/resolve' })\n .input(z.object({ blockId: UuidSchema }))\n .output(PortalBlockSchema)\n\n// ── Notifications contract router ────────────────────────────────────────────\n\nexport const notificationsContract = {\n listTemplates: listTemplatesContract,\n getTemplate: getTemplateContract,\n create: createNotificationContract,\n submit: submitContract,\n approve: approveContract,\n reject: rejectContract,\n cancel: cancelContract,\n listDeliveries: listDeliveriesContract,\n markRead: markReadContract,\n markUnread: markUnreadContract,\n acknowledge: acknowledgeContract,\n respond: respondContract,\n getResponseSummary: getResponseSummaryContract,\n listResponses: listResponsesContract,\n resolveBlock: resolveBlockContract,\n}\n\n// ── blocks.listActive / blocks.resolve / blocks.respond ──────────────────────\n// Separate namespace per bfs-api's own router split — same underlying\n// resolveBlock action as notifications.resolveBlock above for `resolve`,\n// plus the cross-module dispatch procedure `respond`.\n\nexport const listActiveBlocksContract = oc\n .route({ method: 'GET', path: '/blocks/active' })\n .input(z.object({}))\n .output(z.array(PortalBlockSchema))\n\nexport const resolveBlockAltContract = oc\n .route({ method: 'PATCH', path: '/blocks/{blockId}/resolve' })\n .input(z.object({ blockId: UuidSchema }))\n .output(PortalBlockSchema)\n\nexport const respondToBlockContract = oc\n .route({ method: 'PATCH', path: '/blocks/{blockId}/respond' })\n .input(RespondToBlockInputSchema)\n .output(RespondToBlockOutputSchema)\n\nexport const blocksContract = {\n listActive: listActiveBlocksContract,\n resolve: resolveBlockAltContract,\n respond: respondToBlockContract,\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiBA,SAAS,UAAU;AACnB,YAAY,OAAO;AAmBnB,IAAM,oBAAsB,SAAO,CAAC,CAAC,EAAE,KAAK,EAAE,aAAa,yBAAyB,CAAC;AAK9E,IAAM,gBAAgB,GAC1B,MAAM,EAAE,QAAQ,QAAQ,MAAM,cAAc,CAAC,EAC7C,MAAM,gBAAgB,EACtB,OAAO,iBAAiB;AAGpB,IAAM,uBAAuB,GACjC,MAAM,EAAE,QAAQ,QAAQ,MAAM,gBAAgB,CAAC,EAC/C,MAAM,uBAAuB,EAC7B,OAAO,wBAAwB;AAG3B,IAAM,iBAAiB,GAC3B,MAAM,EAAE,QAAQ,QAAQ,MAAM,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MAAM,EAAE,QAAQ,SAAS,MAAM,4BAA4B,CAAC,EAC5D,MAAM,yBAAyB,EAC/B,OAAO,0BAA0B;AAE/B,IAAM,iBAAiB;AAAA,EAC1B,YAAY;AAAA,EACZ,SAAS;AAAA,EACT,SAAS;AACb;","names":["oc","z","oc","oc","z","EmptyOutput","oc","oc","z","oc","oc","z","oc","oc","z","oc","oc","z","oc","oc","z","oc","oc","z","EmptyOutput","IdInput","oc"]}
@@ -102,6 +102,27 @@ var ResetPasswordInputSchema = z2.object({
102
102
  var SwitchBranchInputSchema = z2.object({
103
103
  branchId: z2.string().uuid().meta({ description: "Branch to switch the active session to" })
104
104
  });
105
+ var VerifyPasswordInputSchema = z2.object({
106
+ password: z2.string().min(1).meta({ description: "User's current password, for step-up confirmation" })
107
+ });
108
+ var VerifyPasswordOutputSchema = z2.object({
109
+ valid: z2.boolean()
110
+ });
111
+ var ProfileOutputSchema = z2.object({
112
+ id: z2.string().uuid(),
113
+ email: z2.email(),
114
+ firstName: z2.string(),
115
+ middleName: z2.string().nullable(),
116
+ lastName: z2.string(),
117
+ phone: z2.string().nullable(),
118
+ avatarUrl: z2.string().nullable()
119
+ });
120
+ var UpdateProfileInputSchema = z2.object({
121
+ firstName: z2.string().min(1),
122
+ middleName: z2.string().optional(),
123
+ lastName: z2.string().min(1),
124
+ phone: z2.string().regex(/^\+[1-9]\d{1,14}$/, { error: "Phone must be in E.164 format, e.g. +254712345678" })
125
+ });
105
126
 
106
127
  // src/schemas/hr.ts
107
128
  import * as z3 from "zod";
@@ -272,7 +293,7 @@ var CreateStudentInputSchema = z4.object({
272
293
  relationship: z4.string().min(1).max(50).meta({
273
294
  description: "e.g. mother, father, uncle, guardian"
274
295
  }),
275
- phone: z4.string().min(9).max(30),
296
+ phone: z4.string().regex(/^\+[1-9]\d{1,14}$/, "Must be a valid E.164 phone number, e.g. +254712345678"),
276
297
  email: z4.email().optional(),
277
298
  nationalId: z4.string().max(20).optional(),
278
299
  occupation: z4.string().max(100).optional()
@@ -380,7 +401,7 @@ var LinkGuardianInputSchema = z4.object({
380
401
  middleName: z4.string().max(100).optional(),
381
402
  lastName: z4.string().min(1).max(100),
382
403
  relationship: z4.string().min(1).max(50),
383
- phone: z4.string().min(9).max(30),
404
+ phone: z4.string().regex(/^\+[1-9]\d{1,14}$/, "Must be a valid E.164 phone number, e.g. +254712345678"),
384
405
  email: z4.email().optional(),
385
406
  nationalId: z4.string().max(20).optional(),
386
407
  occupation: z4.string().max(100).optional(),
@@ -861,6 +882,10 @@ export {
861
882
  RequestPasswordResetInputSchema,
862
883
  ResetPasswordInputSchema,
863
884
  SwitchBranchInputSchema,
885
+ VerifyPasswordInputSchema,
886
+ VerifyPasswordOutputSchema,
887
+ ProfileOutputSchema,
888
+ UpdateProfileInputSchema,
864
889
  EmploymentTypeSchema,
865
890
  CreateStaffInputSchema,
866
891
  StaffProfileSchema,
@@ -945,4 +970,4 @@ export {
945
970
  GradeSchema,
946
971
  CreateGradeInputSchema
947
972
  };
948
- //# sourceMappingURL=chunk-E3VLQFEY.js.map
973
+ //# sourceMappingURL=chunk-VNZGHQ6T.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/schemas/base.ts","../src/schemas/auth.ts","../src/schemas/hr.ts","../src/schemas/students.ts","../src/schemas/attendance.ts","../src/schemas/calendar.ts","../src/schemas/banking.ts","../src/schemas/notifications.ts","../src/schemas/diary.ts","../src/schemas/grades.ts"],"sourcesContent":["/**\n * Brite Future Schools — bfs-contracts\n * Base Zod schemas: reusable primitives shared across all domain schemas.\n *\n * Phase History:\n * Phase 0.1 (2026-06-05): Initial creation\n *\n * @module src/schemas/base\n * @since Phase 0.1\n */\n\nimport * as z from 'zod'\n\n// ── ID ─────────────────────────────────────────────────────────────────────────\n\nexport const CuidSchema = z\n .string()\n .regex(/^[a-z][a-z0-9]{24}$/, 'Invalid cuid2 identifier')\n .meta({ description: 'cuid2 — prefixed, collision-resistant identifier' })\n\n// ── UUID ───────────────────────────────────────────────────────────────────────\n\nexport const UuidSchema = z\n .uuidv4()\n .meta({ description: 'RFC-4122 UUID v4' })\n\n// ── Timestamps ─────────────────────────────────────────────────────────────────\n\nconst IsoDatetime = z.iso.datetime()\n\nexport const TimestampsSchema = z.object({\n createdAt: IsoDatetime.meta({ description: 'ISO-8601 creation time (UTC)' }),\n updatedAt: IsoDatetime.meta({ description: 'ISO-8601 last update time (UTC)' }),\n})\n\n// ── Soft-delete ────────────────────────────────────────────────────────────────\n\nexport const SoftDeleteSchema = z.object({\n deletedAt: IsoDatetime.nullable().meta({\n description: 'Set when the record is soft-deleted; null if active',\n }),\n})\n\n// ── Pagination ─────────────────────────────────────────────────────────────────\n\nexport const PaginationInputSchema = z.object({\n cursor: z.string().optional().meta({\n description: 'Opaque cursor from the previous page response',\n }),\n limit: z\n .int()\n .min(1)\n .max(200)\n .default(20)\n .meta({ description: 'Number of items to return (1–200, default 20)' }),\n})\n\nexport function paginatedOutputSchema<T extends z.ZodTypeAny>(itemSchema: T) {\n return z.object({\n items: z.array(itemSchema),\n nextCursor: z.string().nullable().meta({\n description: 'Pass as `cursor` on the next request; null when no more pages',\n }),\n total: z\n .int()\n .nonnegative()\n .meta({ description: 'Total matching records (before pagination)' }),\n })\n}\n\n// ── Branch reference ───────────────────────────────────────────────────────────\n\nexport const BranchRefSchema = z.object({\n branchId: CuidSchema.meta({ description: 'The branch this record belongs to' }),\n})\n\n// ── Inferred types ─────────────────────────────────────────────────────────────\n\nexport type Timestamps = z.infer<typeof TimestampsSchema>\nexport type SoftDelete = z.infer<typeof SoftDeleteSchema>\nexport type PaginationInput = z.infer<typeof PaginationInputSchema>","/**\n * Brite Future Schools — bfs-contracts\n * Auth-related Zod schemas.\n *\n * Phase History:\n * Phase 0.1 (2026-06-05): Initial creation\n * Phase 3 (2026-06-10): Replaced CuidSchema with z.string().uuid() per R-052\n *\n * @module src/schemas/auth\n * @since Phase 0.1\n */\n\nimport * as z from 'zod'\n\n// ── Session user (defined first — referenced by LoginOutputSchema below) ───────\n\nexport const SessionUserRoleSchema = z.object({\n id: z.string().uuid(),\n name: z.string().meta({ description: 'Role name, e.g. HEAD_TEACHER' }),\n branchId: z.string().uuid(),\n isPrimary: z.boolean(),\n})\n\nexport const SessionUserSubRoleSchema = z.object({\n id: z.string().uuid(),\n name: z.string().meta({ description: 'Sub-role name, e.g. HEAD_PREFECT' }),\n branchId: z.string().uuid(),\n})\n\nexport const SessionUserOutputSchema = z.object({\n id: z.string().uuid(),\n email: z.email(),\n firstName: z.string(),\n lastName: z.string(),\n activeBranchId: z.string().uuid(),\n roles: z.array(SessionUserRoleSchema),\n subRoles: z.array(SessionUserSubRoleSchema),\n isActive: z.boolean(),\n mustChangePassword: z.boolean(),\n})\n\n// ── Login ──────────────────────────────────────────────────────────────────────\n\nexport const LoginInputSchema = z.object({\n email: z.email().meta({ description: 'User email address' }),\n password: z.string().min(1).meta({ description: 'Plain-text password (sent over TLS)' }),\n branchId: z.string().uuid().optional().meta({\n description: 'Branch to activate on login; defaults to user primary branch',\n }),\n})\n\nexport const LoginOutputSchema = z.object({\n accessToken: z.string().meta({ description: 'Short-lived JWT (15 min)' }),\n refreshToken: z.string().meta({ description: 'Long-lived opaque refresh token (7 days)' }),\n expiresIn: z.int().positive().meta({ description: 'Access token TTL in seconds' }),\n user: SessionUserOutputSchema,\n})\n\n// ── Token refresh ──────────────────────────────────────────────────────────────\n\nexport const RefreshTokenInputSchema = z.object({\n refreshToken: z.string().min(1),\n})\n\nexport const RefreshTokenOutputSchema = z.object({\n accessToken: z.string(),\n expiresIn: z.int().positive(),\n})\n\n// ── Logout ─────────────────────────────────────────────────────────────────────\n\nexport const LogoutInputSchema = z.object({\n refreshToken: z.string().min(1).meta({\n description: 'The refresh token to revoke; also invalidated server-side',\n }),\n})\n\n// ── Password change ─────────────────────────────────────────────────────────────\n\nexport const ChangePasswordInputSchema = z\n .object({\n currentPassword: z.string().min(1),\n newPassword: z\n .string()\n .min(8, { error: 'Password must be at least 8 characters' }),\n confirmPassword: z.string().min(1),\n })\n .refine((v) => v.newPassword === v.confirmPassword, {\n error: 'Passwords do not match',\n path: ['confirmPassword'],\n })\n\n// ── Password reset ─────────────────────────────────────────────────────────────\n\nexport const RequestPasswordResetInputSchema = z.object({\n email: z.email(),\n})\n\nexport const ResetPasswordInputSchema = z\n .object({\n token: z.string().min(1).meta({ description: 'One-time reset token from email link' }),\n newPassword: z.string().min(8, { error: 'Password must be at least 8 characters' }),\n confirmPassword: z.string().min(1),\n })\n .refine((v) => v.newPassword === v.confirmPassword, {\n error: 'Passwords do not match',\n path: ['confirmPassword'],\n })\n\n// ── Branch switch ───────────────────────────────────────────────────────────────\n\nexport const SwitchBranchInputSchema = z.object({\n branchId: z.string().uuid().meta({ description: 'Branch to switch the active session to' }),\n})\n\n// ── Verify password (step-up auth before sensitive changes) ────────────────────\n\nexport const VerifyPasswordInputSchema = z.object({\n password: z.string().min(1).meta({ description: \"User's current password, for step-up confirmation\" }),\n})\n\nexport const VerifyPasswordOutputSchema = z.object({\n valid: z.boolean(),\n})\n\n// ── Profile (self-service view/update — distinct from SessionUserOutputSchema,\n// which is intentionally minimal for session enrichment) ───────────────────────\n\nexport const ProfileOutputSchema = z.object({\n id: z.string().uuid(),\n email: z.email(),\n firstName: z.string(),\n middleName: z.string().nullable(),\n lastName: z.string(),\n phone: z.string().nullable(),\n avatarUrl: z.string().nullable(),\n})\n\nexport const UpdateProfileInputSchema = z.object({\n firstName: z.string().min(1),\n middleName: z.string().optional(),\n lastName: z.string().min(1),\n phone: z\n .string()\n .regex(/^\\+[1-9]\\d{1,14}$/, { error: 'Phone must be in E.164 format, e.g. +254712345678' }),\n})\n\n// ── Inferred types ──────────────────────────────────────────────────────────────\n\nexport type LoginInput = z.infer<typeof LoginInputSchema>\nexport type LoginOutput = z.infer<typeof LoginOutputSchema>\nexport type SessionUserOutput = z.infer<typeof SessionUserOutputSchema>\nexport type RefreshTokenInput = z.infer<typeof RefreshTokenInputSchema>\nexport type RefreshTokenOutput = z.infer<typeof RefreshTokenOutputSchema>\nexport type ChangePasswordInput = z.infer<typeof ChangePasswordInputSchema>\nexport type SwitchBranchInput = z.infer<typeof SwitchBranchInputSchema>\nexport type VerifyPasswordInput = z.infer<typeof VerifyPasswordInputSchema>\nexport type VerifyPasswordOutput = z.infer<typeof VerifyPasswordOutputSchema>\nexport type ProfileOutput = z.infer<typeof ProfileOutputSchema>\nexport type UpdateProfileInput = z.infer<typeof UpdateProfileInputSchema>","/**\n * Brite Future Schools — bfs-contracts\n * HR domain Zod schemas — staff creation, listing, and profiles.\n *\n * Phase History:\n * Phase 1 (2026-06-07): Initial creation\n * Phase 4.2 (2026-06-13): Removed hardcoded RoleNameSchema — role is now\n * a plain string (DB-driven). Removed salary fields\n * from CreateStaffInput — remuneration module owns\n * salary. Added helbNo, saccoNo statutory fields.\n * Updated StaffProfile to remove salary columns.\n *\n * @module src/schemas/hr\n * @since Phase 1\n */\n\nimport * as z from 'zod'\nimport { UuidSchema, PaginationInputSchema } from './base.js'\n\n// ── Enums ──────────────────────────────────────────────────────────────────────\n\nexport const EmploymentTypeSchema = z.enum([\n 'permanent',\n 'contract',\n 'temporary',\n 'intern',\n])\n\n// ── Create staff ───────────────────────────────────────────────────────────────\n\nexport const CreateStaffInputSchema = z.object({\n // Personal details\n firstName: z.string().min(1).max(100),\n middleName: z.string().max(100).optional(),\n lastName: z.string().min(1).max(100),\n email: z.email(),\n phone: z.string().min(9).max(30),\n nationalId: z.string().min(1).max(20),\n\n // Role assignment — DB-driven, any valid role code accepted\n roleName: z.string().min(1).meta({\n description: 'Role code from the roles table — e.g. TEACHER, HEAD_TEACHER',\n }),\n isPrimaryRole: z.boolean().default(true),\n // Oversight-only override — Proprietor/Director/System Admin can\n // target a branch other than their own active one. Ignored server-side\n // for non-oversight callers, who are always scoped to their own branch.\n branchId: UuidSchema.optional(),\n\n // Employment details\n departmentId: UuidSchema.optional(),\n designation: z.string().min(1).max(100).meta({\n description: 'Job title, e.g. \"Mathematics Teacher\", \"Head of Finance\"',\n }),\n employmentType: EmploymentTypeSchema,\n contractStart: z.iso.date().meta({ description: 'ISO date, e.g. 2026-01-15' }),\n contractEnd: z.iso.date().optional(),\n\n // Banking (optional at creation — can be completed later)\n bankName: z.string().max(100).optional(),\n bankAccount: z.string().max(30).optional(),\n bankBranch: z.string().max(100).optional(),\n\n // Statutory (optional at creation)\n tscNumber: z.string().max(30).optional(),\n kraPin: z.string().max(20).optional(),\n nhifNo: z.string().max(20).optional(),\n nssfNo: z.string().max(20).optional(),\n helbNo: z.string().max(20).optional(),\n saccoNo: z.string().max(20).optional(),\n})\n\nexport type CreateStaffInput = z.infer<typeof CreateStaffInputSchema>\n\n// ── Staff profile (output) ─────────────────────────────────────────────────────\n\nexport const StaffProfileSchema = z.object({\n id: UuidSchema,\n userId: UuidSchema,\n branchId: UuidSchema,\n firstName: z.string(),\n middleName: z.string().nullable(),\n lastName: z.string(),\n phone: z.string(),\n nationalId: z.string(),\n tscNumber: z.string().nullable(),\n kraPin: z.string().nullable(),\n nhifNo: z.string().nullable(),\n nssfNo: z.string().nullable(),\n helbNo: z.string().nullable(),\n saccoNo: z.string().nullable(),\n designation: z.string(),\n employmentType: EmploymentTypeSchema,\n contractStart: z.string(),\n contractEnd: z.string().nullable(),\n bankName: z.string().nullable(),\n bankAccount: z.string().nullable(),\n bankBranch: z.string().nullable(),\n status: z.string(),\n createdAt: z.string(),\n email: z.string(),\n mustChangePassword: z.boolean(),\n departmentId: UuidSchema.nullable(),\n departmentName: z.string().nullable(),\n // Role — DB-driven code string, not a fixed enum\n roleName: z.string().nullable(),\n roleId: UuidSchema.nullable(),\n})\n\nexport type StaffProfile = z.infer<typeof StaffProfileSchema>\n\n// ── Staff list item ────────────────────────────────────────────────────────────\n\nexport const StaffListItemSchema = z.object({\n id: UuidSchema,\n userId: UuidSchema,\n firstName: z.string(),\n middleName: z.string().nullable(),\n lastName: z.string(),\n email: z.string(),\n phone: z.string(),\n designation: z.string(),\n employmentType: EmploymentTypeSchema,\n status: z.string(),\n departmentName: z.string().nullable(),\n roleName: z.string().nullable(),\n createdAt: z.string(),\n})\n\nexport type StaffListItem = z.infer<typeof StaffListItemSchema>\n\n// ── List staff input ───────────────────────────────────────────────────────────\n\nexport const ListStaffInputSchema = PaginationInputSchema.extend({\n search: z.string().optional().meta({\n description: 'Search by name or email',\n }),\n departmentId: UuidSchema.optional(),\n roleName: z.string().optional(),\n status: z.enum(['active', 'inactive']).optional(),\n})\n\nexport type ListStaffInput = z.infer<typeof ListStaffInputSchema>\n\n// ── Create staff output ────────────────────────────────────────────────────────\n\nexport const CreateStaffOutputSchema = z.object({\n staffId: UuidSchema,\n userId: UuidSchema,\n email: z.string(),\n emailSent: z.boolean(),\n})\n\nexport type CreateStaffOutput = z.infer<typeof CreateStaffOutputSchema>\n\n// ── Department ─────────────────────────────────────────────────────────────────\n\nexport const DepartmentSchema = z.object({\n id: UuidSchema,\n branchId: UuidSchema,\n name: z.string(),\n hodId: UuidSchema.nullable(),\n})\n\nexport type Department = z.infer<typeof DepartmentSchema>\n\nexport const CreateDepartmentInputSchema = z.object({\n name: z.string().min(1).max(100),\n hodId: UuidSchema.optional(),\n})\n\nexport type CreateDepartmentInput = z.infer<typeof CreateDepartmentInputSchema>","/**\n * Brite Future Schools — bfs-contracts\n * Students domain Zod schemas.\n *\n * Phase History:\n * Phase 1 (2026-06-07): Initial creation — student create, list,\n * bulk upload, guardian linkage\n *\n * @module src/schemas/students\n * @since Phase 1\n */\n\nimport * as z from 'zod'\nimport { UuidSchema, PaginationInputSchema } from './base.js'\n\n// ── Enums ──────────────────────────────────────────────────────────────────────\n\nexport const GenderSchema = z.enum(['male', 'female'])\n\nexport const StudentStatusSchema = z.enum([\n 'active',\n 'transferred',\n 'graduated',\n 'suspended',\n 'withdrawn',\n])\n\nexport const GradeLevelSchema = z.enum([\n 'PP1', 'PP2',\n 'G1', 'G2', 'G3', 'G4', 'G5', 'G6', 'G7', 'G8', 'G9',\n])\n\n// ── Create single student ──────────────────────────────────────────────────────\n\nexport const CreateStudentInputSchema = z.object({\n // Identity\n firstName: z.string().min(1).max(100),\n middleName: z.string().max(100).optional(),\n lastName: z.string().min(1).max(100),\n dateOfBirth: z.iso.date().meta({ description: 'ISO date, e.g. 2015-03-22' }),\n gender: GenderSchema,\n admissionNo: z.string().max(50).optional().meta({\n description: 'School-assigned admission number — auto-generated if not provided',\n }),\n nemisNo: z.string().max(50).optional(),\n admissionDate: z.iso.date(),\n bloodGroup: z.string().max(10).optional(),\n medicalNotes: z.string().optional(),\n\n // Class placement (optional at creation — can be enrolled later)\n classId: UuidSchema.optional().meta({\n description: 'Class to enrol student in for the current term',\n }),\n termId: UuidSchema.optional().meta({\n description: 'Term for class enrolment — required if classId is provided',\n }),\n\n // Guardian (optional at creation — can be linked later)\n guardian: z.object({\n firstName: z.string().min(1).max(100),\n middleName: z.string().max(100).optional(),\n lastName: z.string().min(1).max(100),\n relationship: z.string().min(1).max(50).meta({\n description: 'e.g. mother, father, uncle, guardian',\n }),\n phone: z.string().regex(/^\\+[1-9]\\d{1,14}$/, 'Must be a valid E.164 phone number, e.g. +254712345678'),\n email: z.email().optional(),\n nationalId: z.string().max(20).optional(),\n occupation: z.string().max(100).optional(),\n }).optional(),\n})\n\nexport type CreateStudentInput = z.infer<typeof CreateStudentInputSchema>\n\n// ── Student profile (output) ───────────────────────────────────────────────────\n\nexport const StudentProfileSchema = z.object({\n id: UuidSchema,\n branchId: UuidSchema,\n admissionNo: z.string(),\n nemisNo: z.string().nullable(),\n firstName: z.string(),\n middleName: z.string().nullable(),\n lastName: z.string(),\n dateOfBirth: z.string(),\n gender: GenderSchema,\n photoUrl: z.string().nullable(),\n bloodGroup: z.string().nullable(),\n medicalNotes: z.string().nullable(),\n admissionDate: z.string(),\n status: StudentStatusSchema,\n createdAt: z.string(),\n\n // Current class (from latest enrollment)\n currentClass: z.object({\n classId: UuidSchema,\n className: z.string(),\n gradeLevel: GradeLevelSchema,\n termId: UuidSchema,\n termName: z.string(),\n }).nullable(),\n\n // Guardians\n guardians: z.array(z.object({\n id: UuidSchema,\n firstName: z.string(),\n middleName: z.string().nullable(),\n lastName: z.string(),\n relationship: z.string(),\n phone: z.string(),\n email: z.string().nullable(),\n isPrimary: z.boolean(),\n })),\n})\n\nexport type StudentProfile = z.infer<typeof StudentProfileSchema>\n\n// ── Student list item ──────────────────────────────────────────────────────────\n\nexport const StudentListItemSchema = z.object({\n id: UuidSchema,\n admissionNo: z.string(),\n firstName: z.string(),\n middleName: z.string().nullable(),\n lastName: z.string(),\n gender: GenderSchema,\n status: StudentStatusSchema,\n className: z.string().nullable(),\n gradeLevel: GradeLevelSchema.nullable(),\n primaryGuardianName: z.string().nullable(),\n primaryGuardianPhone: z.string().nullable(),\n createdAt: z.string(),\n})\n\nexport type StudentListItem = z.infer<typeof StudentListItemSchema>\n\n// ── List students input ────────────────────────────────────────────────────────\n\nexport const ListStudentsInputSchema = PaginationInputSchema.extend({\n search: z.string().optional().meta({\n description: 'Search by name or admission number',\n }),\n classId: UuidSchema.optional(),\n gradeLevel: GradeLevelSchema.optional(),\n status: StudentStatusSchema.optional(),\n termId: UuidSchema.optional(),\n})\n\nexport type ListStudentsInput = z.infer<typeof ListStudentsInputSchema>\n\n// ── Bulk upload ────────────────────────────────────────────────────────────────\n\n/**\n * One row from a CSV bulk upload.\n * Column mapping is flexible — the upload endpoint accepts this shape\n * after the CSV parser maps headers to these field names.\n */\nexport const BulkUploadStudentRowSchema = z.object({\n firstName: z.string().min(1),\n middleName: z.string().optional(),\n lastName: z.string().min(1),\n dateOfBirth: z.string().min(1).meta({ description: 'Any parseable date string' }),\n gender: z.string().min(1).meta({ description: 'male | female (case-insensitive)' }),\n admissionNo: z.string().min(1),\n nemisNo: z.string().optional(),\n admissionDate: z.string().optional(),\n bloodGroup: z.string().optional(),\n\n // Guardian columns (all optional in CSV)\n guardianFirstName: z.string().optional(),\n guardianLastName: z.string().optional(),\n guardianRelationship: z.string().optional(),\n guardianPhone: z.string().optional(),\n guardianEmail: z.string().optional(),\n})\n\nexport type BulkUploadStudentRow = z.infer<typeof BulkUploadStudentRowSchema>\n\nexport const BulkUploadStudentsInputSchema = z.object({\n classId: UuidSchema.meta({\n description: 'Class to enrol all uploaded students into',\n }),\n termId: UuidSchema,\n rows: z.array(BulkUploadStudentRowSchema).min(1).max(500),\n})\n\nexport type BulkUploadStudentsInput = z.infer<typeof BulkUploadStudentsInputSchema>\n\nexport const BulkUploadStudentsOutputSchema = z.object({\n created: z.int().nonnegative(),\n skipped: z.int().nonnegative(),\n errors: z.array(z.object({\n row: z.int().positive(),\n admissionNo: z.string().optional(),\n reason: z.string(),\n })),\n})\n\nexport type BulkUploadStudentsOutput = z.infer<typeof BulkUploadStudentsOutputSchema>\n\n// ── Create student output ──────────────────────────────────────────────────────\n\nexport const CreateStudentOutputSchema = z.object({\n studentId: UuidSchema,\n admissionNo: z.string(),\n})\n\nexport type CreateStudentOutput = z.infer<typeof CreateStudentOutputSchema>\n\n// ── Link guardian ──────────────────────────────────────────────────────────────\n\nexport const LinkGuardianInputSchema = z.object({\n studentId: UuidSchema,\n firstName: z.string().min(1).max(100),\n middleName: z.string().max(100).optional(),\n lastName: z.string().min(1).max(100),\n relationship: z.string().min(1).max(50),\n phone: z.string().regex(/^\\+[1-9]\\d{1,14}$/, 'Must be a valid E.164 phone number, e.g. +254712345678'),\n email: z.email().optional(),\n nationalId: z.string().max(20).optional(),\n occupation: z.string().max(100).optional(),\n isPrimary: z.boolean().default(false),\n})\n\nexport type LinkGuardianInput = z.infer<typeof LinkGuardianInputSchema>\n\n// ── Classes (for selectors) ────────────────────────────────────────────────────\n\nexport const ClassSummarySchema = z.object({\n id: UuidSchema,\n name: z.string(),\n gradeLevel: GradeLevelSchema,\n gradeName: z.string(),\n capacity: z.number().nullable(),\n enrolledCount: z.number(),\n classTeacherId: UuidSchema.nullable(),\n})\n\nexport type ClassSummary = z.infer<typeof ClassSummarySchema>","/**\n * Brite Future Schools — bfs-contracts\n * Attendance domain Zod schemas.\n *\n * Phase History:\n * Phase 2.1 (2026-06-08): Initial — class attendance mark, getByClass,\n * getByStudent, listTerms\n *\n * @module src/schemas/attendance\n * @since Phase 2.1\n */\n\nimport * as z from 'zod'\nimport { UuidSchema } from './base.js'\n\n// ── Enums ──────────────────────────────────────────────────────────────────────\n\nexport const AttendanceStatusSchema = z.enum([\n 'present',\n 'absent',\n 'late',\n 'excused',\n])\n\nexport type AttendanceStatusEnum = z.infer<typeof AttendanceStatusSchema>\n\n// ── Term ───────────────────────────────────────────────────────────────────────\n\nexport const TermSchema = z.object({\n id: UuidSchema,\n branchId: UuidSchema,\n academicYearId: UuidSchema,\n name: z.string(),\n startDate: z.string(),\n endDate: z.string(),\n isCurrent: z.boolean(),\n})\n\nexport type Term = z.infer<typeof TermSchema>\n\n// ── Mark attendance ────────────────────────────────────────────────────────────\n\nexport const AttendanceRecordInputSchema = z.object({\n studentId: UuidSchema,\n status: AttendanceStatusSchema,\n notes: z.string().max(500).optional(),\n})\n\nexport const MarkAttendanceInputSchema = z.object({\n classId: UuidSchema,\n termId: UuidSchema,\n date: z.iso.date(),\n records: z.array(AttendanceRecordInputSchema).min(1),\n})\n\nexport type MarkAttendanceInput = z.infer<typeof MarkAttendanceInputSchema>\n\nexport const MarkAttendanceOutputSchema = z.object({\n count: z.number(),\n date: z.string(),\n classId: UuidSchema,\n})\n\nexport type MarkAttendanceOutput = z.infer<typeof MarkAttendanceOutputSchema>\n\n// ── Get by class ───────────────────────────────────────────────────────────────\n\nexport const GetByClassInputSchema = z.object({\n classId: UuidSchema,\n date: z.iso.date(),\n})\n\nexport type GetByClassInput = z.infer<typeof GetByClassInputSchema>\n\nexport const ClassAttendanceRowSchema = z.object({\n id: UuidSchema,\n studentId: UuidSchema,\n firstName: z.string(),\n middleName: z.string().nullable(),\n lastName: z.string(),\n admissionNo: z.string(),\n status: AttendanceStatusSchema,\n notes: z.string().nullable(),\n markedBy: UuidSchema,\n updatedAt: z.string(),\n})\n\nexport type ClassAttendanceRow = z.infer<typeof ClassAttendanceRowSchema>\n\n// ── Get by student ─────────────────────────────────────────────────────────────\n\nexport const GetByStudentInputSchema = z.object({\n studentId: UuidSchema,\n termId: UuidSchema,\n})\n\nexport type GetByStudentInput = z.infer<typeof GetByStudentInputSchema>\n\nexport const StudentAttendanceRowSchema = z.object({\n id: UuidSchema,\n date: z.string(),\n status: AttendanceStatusSchema,\n notes: z.string().nullable(),\n classId: UuidSchema,\n className: z.string(),\n})\n\nexport type StudentAttendanceRow = z.infer<typeof StudentAttendanceRowSchema>","/**\n * Brite Future Schools — bfs-contracts\n * Calendar schemas — academic years and terms.\n *\n * Phase History:\n * Phase 4.1 (2026-06-12): Initial creation\n *\n * @module src/schemas/calendar\n * @since Phase 4.1\n */\n\nimport * as z from 'zod'\n\n// ── Academic Year ──────────────────────────────────────────────────────────────\n\nexport const AcademicYearSchema = z.object({\n id: z.string().uuid(),\n branchId: z.string().uuid(),\n name: z.string(),\n startDate: z.string(),\n endDate: z.string(),\n isCurrent: z.boolean(),\n createdAt: z.string(),\n})\n\nexport const CreateYearInputSchema = z.object({\n name: z.string().min(1).max(50),\n startDate: z.string().regex(/^\\d{4}-\\d{2}-\\d{2}$/, 'Must be YYYY-MM-DD'),\n endDate: z.string().regex(/^\\d{4}-\\d{2}-\\d{2}$/, 'Must be YYYY-MM-DD'),\n})\n\nexport const SetCurrentYearInputSchema = z.object({\n yearId: z.string().uuid(),\n})\n\n// ── Academic Term ──────────────────────────────────────────────────────────────\n// Prefixed with \"Academic\" to avoid clash with attendance.ts TermSchema / Term\n\nexport const AcademicTermSchema = z.object({\n id: z.string().uuid(),\n branchId: z.string().uuid(),\n academicYearId: z.string().uuid(),\n name: z.string(),\n startDate: z.string(),\n endDate: z.string(),\n isCurrent: z.boolean(),\n createdAt: z.string(),\n})\n\nexport const CreateTermInputSchema = z.object({\n academicYearId: z.string().uuid(),\n name: z.string().min(1).max(50),\n startDate: z.string().regex(/^\\d{4}-\\d{2}-\\d{2}$/, 'Must be YYYY-MM-DD'),\n endDate: z.string().regex(/^\\d{4}-\\d{2}-\\d{2}$/, 'Must be YYYY-MM-DD'),\n})\n\nexport const SetCurrentTermInputSchema = z.object({\n termId: z.string().uuid(),\n})\n\nexport const ListTermsInputSchema = z.object({\n yearId: z.string().uuid().optional(),\n})\n\n// ── Inferred types ─────────────────────────────────────────────────────────────\n\nexport type AcademicYear = z.infer<typeof AcademicYearSchema>\nexport type AcademicTerm = z.infer<typeof AcademicTermSchema>\nexport type CreateYearInput = z.infer<typeof CreateYearInputSchema>\nexport type CreateTermInput = z.infer<typeof CreateTermInputSchema>","/**\n * Brite Future Schools — bfs-contracts\n * Banking schemas — branch bank account Zod shapes.\n *\n * Phase History:\n * Phase 8 (2026-07-20): Initial creation — Module 1 (Branch Banking)\n *\n * @module src/schemas/banking\n * @since Phase 8\n */\n\nimport * as z from 'zod'\nimport { UuidSchema } from './base.js'\n\n// ── Enums ──────────────────────────────────────────────────────────────────────\n\nexport const BankAccountTypeSchema = z.enum(['current', 'savings'])\n\n// ── Bank account (output) ───────────────────────────────────────────────────────\n\nexport const BranchBankAccountSchema = z.object({\n id: UuidSchema,\n branchId: UuidSchema,\n bankName: z.string(),\n bankCode: z.string().nullable(),\n bankBranchName: z.string().nullable(),\n accountNumber: z.string(),\n accountName: z.string(),\n accountType: BankAccountTypeSchema,\n currency: z.string(),\n isDefault: z.boolean(),\n isActive: z.boolean(),\n reconciliationContactId: UuidSchema.nullable(),\n notes: z.string().nullable(),\n createdAt: z.string(),\n updatedAt: z.string(),\n})\n\n// ── banking.create ───────────────────────────────────────────────────────────\n\nexport const CreateBankAccountInputSchema = z.object({\n branchId: UuidSchema,\n bankName: z.string().min(1).max(100),\n bankCode: z.string().max(10).optional(),\n bankBranchName: z.string().max(100).optional(),\n accountNumber: z.string().min(1).max(30),\n accountName: z.string().min(1).max(200),\n accountType: BankAccountTypeSchema,\n currency: z.string().length(3).optional(),\n isDefault: z.boolean().optional(),\n reconciliationContactId: UuidSchema.optional(),\n notes: z.string().optional(),\n})\n\nexport type CreateBankAccountInput = z.infer<typeof CreateBankAccountInputSchema>\n\n// ── banking.update ───────────────────────────────────────────────────────────\n\nexport const UpdateBankAccountInputSchema = z.object({\n id: UuidSchema,\n bankName: z.string().min(1).max(100).optional(),\n bankCode: z.string().max(10).optional(),\n bankBranchName: z.string().max(100).optional(),\n accountNumber: z.string().min(1).max(30).optional(),\n accountName: z.string().min(1).max(200).optional(),\n accountType: BankAccountTypeSchema.optional(),\n currency: z.string().length(3).optional(),\n reconciliationContactId: UuidSchema.optional(),\n notes: z.string().optional(),\n})\n\nexport type UpdateBankAccountInput = z.infer<typeof UpdateBankAccountInputSchema>\n\n// ── banking.listAccounts ─────────────────────────────────────────────────────\n\nexport const ListBankAccountsInputSchema = z.object({\n branchId: UuidSchema.optional(),\n})\n\n// ── Kenyan bank reference (output) ──────────────────────────────────────────\n\nexport const KenyanBankSchema = z.object({\n id: UuidSchema,\n name: z.string(),\n code: z.string(),\n isActive: z.boolean(),\n createdAt: z.string(),\n})\n","/**\n * Brite Future Schools — bfs-contracts\n * Notifications schemas — templates, audience, deliveries, portal blocks.\n *\n * Phase History:\n * Phase 8 (2026-07-20): Initial creation — Module 3 (Notification System)\n *\n * @module src/schemas/notifications\n * @since Phase 8\n */\n\nimport * as z from 'zod'\nimport { UuidSchema } from './base.js'\n\n// ── Enums ──────────────────────────────────────────────────────────────────────\n\nexport const NotificationUrgencySchema = z.enum(['critical', 'urgent', 'important', 'info'])\n\nexport const NotificationTemplateStatusSchema = z.enum([\n 'draft', 'pending_approval', 'approved', 'scheduled',\n 'sent', 'cancelled', 'recurring_active',\n])\n\nexport const NotificationAudienceTypeSchema = z.enum([\n 'all_branches', 'branch', 'grade', 'class', 'role', 'individual',\n])\n\nexport const NotificationChannelSchema = z.enum(['in_app', 'sms', 'email', 'push'])\n\nexport const PortalBlockTypeSchema = z.enum(['diary', 'notification', 'fee', 'custom'])\n\n// ── Audience item (shared input/output shape) ───────────────────────────────\n\nexport const NotificationAudienceItemSchema = z.object({\n audienceType: NotificationAudienceTypeSchema,\n audienceId: z.string(),\n})\n\n// ── notifications.create ─────────────────────────────────────────────────────\n\nexport const CreateNotificationInputSchema = z.object({\n branchId: UuidSchema.optional(),\n title: z.string().min(1).max(200),\n body: z.string().min(1),\n urgency: NotificationUrgencySchema,\n isBlocking: z.boolean().optional(),\n deadlineHours: z.number().int().positive().optional(),\n redirectPath: z.string().max(500).optional(),\n redirectParams: z.record(z.string(), z.string()).optional(),\n requiresResponse: z.boolean().optional(),\n responseOptions: z.array(z.string()).optional(),\n // Deliberately narrower than NotificationChannelSchema (excludes\n // 'push') — matches the router's original inline restriction and\n // NotificationsService's Channel type; 'push' exists in the DB enum\n // but isn't yet wired end-to-end for template creation.\n deliveryChannels: z.array(z.enum(['in_app', 'sms', 'email'])).optional(),\n scheduledAt: z.string().datetime().optional(),\n recurrence: z.record(z.string(), z.unknown()).optional(),\n audience: z.array(NotificationAudienceItemSchema),\n})\n\nexport type CreateNotificationInput = z.infer<typeof CreateNotificationInputSchema>\n\n// ── notifications.listTemplates ──────────────────────────────────────────────\n\nexport const ListNotificationTemplatesInputSchema = z.object({\n status: z.string().optional(),\n branchId: UuidSchema.optional(),\n})\n\n// ── Notification template (output) ──────────────────────────────────────────\n\nexport const NotificationTemplateSchema = z.object({\n id: UuidSchema,\n branchId: UuidSchema.nullable(),\n title: z.string(),\n body: z.string(),\n urgency: NotificationUrgencySchema,\n isBlocking: z.boolean(),\n deadlineHours: z.number().nullable(),\n redirectPath: z.string().nullable(),\n redirectParams: z.record(z.string(), z.string()).nullable(),\n requiresResponse: z.boolean(),\n responseOptions: z.array(z.string()).nullable(),\n deliveryChannels: z.array(NotificationChannelSchema),\n scheduledAt: z.string().nullable(),\n recurrence: z.record(z.string(), z.unknown()).nullable(),\n lastFiredAt: z.string().nullable(),\n nextFireAt: z.string().nullable(),\n status: NotificationTemplateStatusSchema,\n createdBy: UuidSchema,\n approvedBy: UuidSchema.nullable(),\n approvedAt: z.string().nullable(),\n sentAt: z.string().nullable(),\n createdAt: z.string(),\n updatedAt: z.string(),\n})\n\n// ── notifications.reject ─────────────────────────────────────────────────────\n\nexport const RejectNotificationInputSchema = z.object({\n id: UuidSchema,\n reason: z.string().optional(),\n})\n\n// ── notifications.listDeliveries ─────────────────────────────────────────────\n\nexport const ListDeliveriesInputSchema = z.object({\n isRead: z.boolean().optional(),\n isBlocking: z.boolean().optional(),\n})\n\n// ── Notification delivery (output) ──────────────────────────────────────────\n\nexport const NotificationDeliverySchema = z.object({\n id: UuidSchema,\n notificationId: UuidSchema,\n userId: UuidSchema,\n channel: NotificationChannelSchema,\n deliveredAt: z.string().nullable(),\n readAt: z.string().nullable(),\n isRead: z.boolean(),\n markedUnreadAt: z.string().nullable(),\n acknowledgedAt: z.string().nullable(),\n response: z.string().nullable(),\n isBlocking: z.boolean(),\n isResolved: z.boolean(),\n resolvedAt: z.string().nullable(),\n returnPath: z.string().nullable(),\n createdAt: z.string(),\n})\n\n// ── notifications.acknowledge / respond ──────────────────────────────────────\n\nexport const AcknowledgeDeliveryInputSchema = z.object({\n deliveryId: UuidSchema,\n response: z.string().optional(),\n})\n\nexport const RespondToDeliveryInputSchema = z.object({\n deliveryId: UuidSchema,\n response: z.string().min(1),\n})\n\n// ── notifications.getResponseSummary (output) ───────────────────────────────\n// Grouped counts keyed by exact response text (or 'unspecified' for\n// deliveries with a null response). Free-text responses will scatter\n// into many count-of-1 keys — see listResponses for the raw per-user\n// view this doesn't replace.\n\nexport const ResponseSummarySchema = z.record(z.string(), z.number())\n\n// ── notifications.listResponses (output) ────────────────────────────────────\n\nexport const NotificationResponseItemSchema = z.object({\n deliveryId: UuidSchema,\n userId: UuidSchema,\n userName: z.string(),\n userEmail: z.string(),\n response: z.string().nullable(),\n acknowledgedAt: z.string().nullable(),\n isResolved: z.boolean(),\n})\n\n// ── Portal block (output) ────────────────────────────────────────────────────\n\nexport const PortalBlockSchema = z.object({\n id: UuidSchema,\n userId: UuidSchema,\n blockType: PortalBlockTypeSchema,\n sourceId: UuidSchema,\n redirectPath: z.string(),\n redirectParams: z.record(z.string(), z.string()).nullable(),\n returnPath: z.string().nullable(),\n severity: NotificationUrgencySchema,\n isActive: z.boolean(),\n activatedAt: z.string(),\n resolvedAt: z.string().nullable(),\n resolvedBy: UuidSchema.nullable(),\n resolvedVia: z.string().nullable(),\n requiresResponse: z.boolean(),\n responseOptions: z.array(z.string()).nullable(),\n createdAt: z.string(),\n})\n\n// ── blocks.respond ────────────────────────────────────────────────────────────\n// Dispatches to either NotificationsService.respond or DiaryService.respond\n// at runtime depending on block.blockType — no single fixed return shape\n// exists across both branches. Left as z.unknown() deliberately rather\n// than guessed; this is an honest reflection of the router's own logic,\n// not a gap in this schema file.\n\nexport const RespondToBlockInputSchema = z.object({\n blockId: UuidSchema,\n response: z.string().min(1),\n})\n\nexport const RespondToBlockOutputSchema = z.unknown()\n","/**\n * Brite Future Schools — bfs-contracts\n * E-Diary schemas — categories, entries, acknowledgements, blocks.\n *\n * Phase History:\n * Phase 8 (2026-07-20): Initial creation — Module 2 (E-Diary)\n *\n * @module src/schemas/diary\n * @since Phase 8\n */\n\nimport * as z from 'zod'\nimport { UuidSchema } from './base.js'\n\n// ── Enums ──────────────────────────────────────────────────────────────────────\n\nexport const DiarySeveritySchema = z.enum(['info', 'moderate', 'serious', 'critical'])\n\nexport const DiaryEntryStatusSchema = z.enum(['active', 'resolved', 'lifted'])\n\nexport const BlockResolutionMethodSchema = z.enum(['guardian_acknowledge', 'staff_lift'])\n\n// ── Diary category (output) ──────────────────────────────────────────────────\n\nexport const DiaryCategorySchema = z.object({\n id: UuidSchema,\n branchId: UuidSchema,\n name: z.string(),\n description: z.string().nullable(),\n isActive: z.boolean(),\n createdBy: UuidSchema.nullable(),\n createdAt: z.string(),\n})\n\n// ── diary.createCategory ─────────────────────────────────────────────────────\n\nexport const CreateDiaryCategoryInputSchema = z.object({\n name: z.string().min(1).max(100),\n description: z.string().optional(),\n})\n\n// ── diary.updateCategory ─────────────────────────────────────────────────────\n\nexport const UpdateDiaryCategoryInputSchema = z.object({\n id: UuidSchema,\n name: z.string().min(1).max(100).optional(),\n description: z.string().optional(),\n isActive: z.boolean().optional(),\n})\n\n// ── diary.listEntries ─────────────────────────────────────────────────────────\n\nexport const ListDiaryEntriesInputSchema = z.object({\n classId: UuidSchema.optional(),\n studentId: UuidSchema.optional(),\n postedBy: UuidSchema.optional(),\n})\n\n// ── Diary entry (output) ─────────────────────────────────────────────────────\n\nexport const DiaryEntrySchema = z.object({\n id: UuidSchema,\n branchId: UuidSchema,\n classId: UuidSchema,\n studentId: UuidSchema.nullable(),\n postedBy: UuidSchema,\n categoryId: UuidSchema,\n title: z.string(),\n body: z.string(),\n severity: DiarySeveritySchema,\n requiresResponse: z.boolean(),\n responseDeadlineDays: z.number(),\n isBlockingPortal: z.boolean(),\n isBlockingReportCard: z.boolean(),\n status: DiaryEntryStatusSchema,\n resolvedAt: z.string().nullable(),\n resolvedBy: UuidSchema.nullable(),\n liftApprovedBy: UuidSchema.nullable(),\n liftApprovedAt: z.string().nullable(),\n createdAt: z.string(),\n updatedAt: z.string(),\n})\n\n// ── diary.createEntry ─────────────────────────────────────────────────────────\n\nexport const CreateDiaryEntryInputSchema = z.object({\n classId: UuidSchema,\n studentId: UuidSchema.optional(),\n categoryId: UuidSchema,\n title: z.string().min(1).max(200),\n body: z.string().min(1),\n severity: DiarySeveritySchema,\n requiresResponse: z.boolean().optional(),\n responseDeadlineDays: z.number().int().positive().optional(),\n isBlockingPortal: z.boolean().optional(),\n isBlockingReportCard: z.boolean().optional(),\n})\n\n// ── Diary acknowledgement (output) ───────────────────────────────────────────\n\nexport const DiaryAcknowledgementSchema = z.object({\n id: UuidSchema,\n entryId: UuidSchema,\n guardianId: UuidSchema,\n studentId: UuidSchema,\n acknowledgedAt: z.string().nullable(),\n response: z.string().nullable(),\n isAcknowledged: z.boolean(),\n createdAt: z.string(),\n})\n\n// ── Diary block (output) ─────────────────────────────────────────────────────\n\nexport const DiaryBlockSchema = z.object({\n id: UuidSchema,\n entryId: UuidSchema,\n guardianId: UuidSchema,\n studentId: UuidSchema,\n blockedAt: z.string(),\n resolvedAt: z.string().nullable(),\n resolvedBy: UuidSchema.nullable(),\n resolvedVia: BlockResolutionMethodSchema.nullable(),\n liftApprovedBy: UuidSchema.nullable(),\n liftApprovedAt: z.string().nullable(),\n isActive: z.boolean(),\n createdAt: z.string(),\n})\n\n// ── diary.getEntry (output) ──────────────────────────────────────────────────\n// entry fields spread at the top level, plus joined acknowledgements/blocks\n// and a guardian-scoped \"myAcknowledgement\" summary (null for staff callers\n// or guardians who haven't acknowledged yet). See diary.service.ts's\n// getEntry — this composed shape is real, not a simplification.\n\nexport const MyAcknowledgementSchema = z.object({\n isAcknowledged: z.boolean(),\n response: z.string().nullable(),\n})\n\nexport const DiaryEntryDetailSchema = DiaryEntrySchema.extend({\n acknowledgements: z.array(DiaryAcknowledgementSchema),\n blocks: z.array(DiaryBlockSchema),\n myAcknowledgement: MyAcknowledgementSchema.nullable(),\n})\n\n// ── diary.listForGuardian (output) ───────────────────────────────────────────\n// Each entry plus the calling guardian's own acknowledgement status —\n// see diary.service.ts's listForGuardian, which computes this per-entry\n// from a separate acknowledgements lookup, not a raw table row.\n\nexport const DiaryEntryForGuardianSchema = DiaryEntrySchema.extend({\n myAcknowledgement: MyAcknowledgementSchema.nullable(),\n})\n\n// ── diary.acknowledge ─────────────────────────────────────────────────────────\n\nexport const AcknowledgeDiaryEntryInputSchema = z.object({\n entryId: UuidSchema,\n studentId: UuidSchema,\n})\n\n// ── diary.respond ─────────────────────────────────────────────────────────────\n\nexport const RespondToDiaryEntryInputSchema = z.object({\n entryId: UuidSchema,\n studentId: UuidSchema,\n response: z.string().min(1),\n})\n\n// ── diary.requestLift / approveLift ──────────────────────────────────────────\n\nexport const DiaryBlockIdInputSchema = z.object({\n blockId: UuidSchema,\n})\n\n// ── diary.listAcknowledgements ───────────────────────────────────────────────\n\nexport const ListDiaryAcknowledgementsInputSchema = z.object({\n entryId: UuidSchema,\n})\n","/**\n * Brite Future Schools — bfs-contracts\n * Grades schemas.\n *\n * Phase History:\n * Phase 4.1 (2026-06-12): Initial creation\n *\n * @module src/schemas/grades\n * @since Phase 4.1\n */\n\nimport * as z from 'zod'\nimport { GradeLevelSchema } from './students.js'\n\n// Re-export so consumers can import GradeLevel from grades if needed\nexport { GradeLevelSchema }\n\nexport const GRADE_LEVELS = [\n 'PP1', 'PP2',\n 'G1', 'G2', 'G3', 'G4', 'G5', 'G6',\n 'G7', 'G8', 'G9',\n] as const\n\nexport type GradeLevel = typeof GRADE_LEVELS[number]\n\nexport const GradeSchema = z.object({\n id: z.string().uuid(),\n branchId: z.string().uuid(),\n name: z.string(),\n level: GradeLevelSchema,\n description: z.string().nullable(),\n})\n\nexport const CreateGradeInputSchema = z.object({\n name: z.string().min(1).max(50),\n level: GradeLevelSchema,\n description: z.string().max(300).optional(),\n})\n\n// ── Inferred types ─────────────────────────────────────────────────────────────\n\nexport type Grade = z.infer<typeof GradeSchema>\nexport type CreateGradeInput = z.infer<typeof CreateGradeInputSchema>"],"mappings":";AAWA,YAAY,OAAO;AAIZ,IAAM,aACR,SAAO,EACP,MAAM,uBAAuB,0BAA0B,EACvD,KAAK,EAAE,aAAa,wDAAmD,CAAC;AAItE,IAAM,aACR,SAAO,EACP,KAAK,EAAE,aAAa,mBAAmB,CAAC;AAI7C,IAAM,cAAgB,MAAI,SAAS;AAE5B,IAAM,mBAAqB,SAAO;AAAA,EACrC,WAAW,YAAY,KAAK,EAAE,aAAa,+BAA+B,CAAC;AAAA,EAC3E,WAAW,YAAY,KAAK,EAAE,aAAa,kCAAkC,CAAC;AAClF,CAAC;AAIM,IAAM,mBAAqB,SAAO;AAAA,EACrC,WAAW,YAAY,SAAS,EAAE,KAAK;AAAA,IACnC,aAAa;AAAA,EACjB,CAAC;AACL,CAAC;AAIM,IAAM,wBAA0B,SAAO;AAAA,EAC1C,QAAU,SAAO,EAA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AAO;AAAA,EACzD,SAAS;AACb,CAAC;;;ACxKD,YAAYC,SAAO;AAMZ,IAAM,eAAe;AAAA,EACxB;AAAA,EAAO;AAAA,EACP;AAAA,EAAM;AAAA,EAAM;AAAA,EAAM;AAAA,EAAM;AAAA,EAAM;AAAA,EAC9B;AAAA,EAAM;AAAA,EAAM;AAChB;AAIO,IAAM,cAAgB,WAAO;AAAA,EAChC,IAAM,WAAO,EAAE,KAAK;AAAA,EACpB,UAAY,WAAO,EAAE,KAAK;AAAA,EAC1B,MAAQ,WAAO;AAAA,EACf,OAAO;AAAA,EACP,aAAe,WAAO,EAAE,SAAS;AACrC,CAAC;AAEM,IAAM,yBAA2B,WAAO;AAAA,EAC3C,MAAQ,WAAO,EAAE,IAAI,CAAC,EAAE,IAAI,EAAE;AAAA,EAC9B,OAAO;AAAA,EACP,aAAe,WAAO,EAAE,IAAI,GAAG,EAAE,SAAS;AAC9C,CAAC;","names":["z","z","z","z","z","z","z","z","z"]}
@@ -60,6 +60,7 @@ __export(contracts_exports, {
60
60
  getByStudentContract: () => getByStudentContract,
61
61
  getEntryContract: () => getEntryContract,
62
62
  getMeContract: () => getMeContract,
63
+ getProfileContract: () => getProfileContract,
63
64
  getResponseSummaryContract: () => getResponseSummaryContract,
64
65
  getStaffByIdContract: () => getStaffByIdContract,
65
66
  getStudentByIdContract: () => getStudentByIdContract,
@@ -108,7 +109,9 @@ __export(contracts_exports, {
108
109
  switchBranchContract: () => switchBranchContract,
109
110
  updateBankAccountContract: () => updateBankAccountContract,
110
111
  updateCategoryContract: () => updateCategoryContract,
111
- updateStaffStatusContract: () => updateStaffStatusContract
112
+ updateProfileContract: () => updateProfileContract,
113
+ updateStaffStatusContract: () => updateStaffStatusContract,
114
+ verifyPasswordContract: () => verifyPasswordContract
112
115
  });
113
116
  module.exports = __toCommonJS(contracts_exports);
114
117
 
@@ -187,6 +190,27 @@ var ResetPasswordInputSchema = z.object({
187
190
  var SwitchBranchInputSchema = z.object({
188
191
  branchId: z.string().uuid().meta({ description: "Branch to switch the active session to" })
189
192
  });
193
+ var VerifyPasswordInputSchema = z.object({
194
+ password: z.string().min(1).meta({ description: "User's current password, for step-up confirmation" })
195
+ });
196
+ var VerifyPasswordOutputSchema = z.object({
197
+ valid: z.boolean()
198
+ });
199
+ var ProfileOutputSchema = z.object({
200
+ id: z.string().uuid(),
201
+ email: z.email(),
202
+ firstName: z.string(),
203
+ middleName: z.string().nullable(),
204
+ lastName: z.string(),
205
+ phone: z.string().nullable(),
206
+ avatarUrl: z.string().nullable()
207
+ });
208
+ var UpdateProfileInputSchema = z.object({
209
+ firstName: z.string().min(1),
210
+ middleName: z.string().optional(),
211
+ lastName: z.string().min(1),
212
+ phone: z.string().regex(/^\+[1-9]\d{1,14}$/, { error: "Phone must be in E.164 format, e.g. +254712345678" })
213
+ });
190
214
 
191
215
  // src/contracts/auth.ts
192
216
  var EmptyOutputSchema = z2.object({}).meta({ description: "Empty success response" });
@@ -198,6 +222,9 @@ var changePasswordContract = import_contract.oc.route({ method: "POST", path: "/
198
222
  var requestPasswordResetContract = import_contract.oc.route({ method: "POST", path: "/auth/request-password-reset" }).input(RequestPasswordResetInputSchema).output(EmptyOutputSchema);
199
223
  var resetPasswordContract = import_contract.oc.route({ method: "POST", path: "/auth/reset-password" }).input(ResetPasswordInputSchema).output(EmptyOutputSchema);
200
224
  var switchBranchContract = import_contract.oc.route({ method: "POST", path: "/auth/switch-branch" }).input(SwitchBranchInputSchema).output(SessionUserOutputSchema);
225
+ var verifyPasswordContract = import_contract.oc.route({ method: "POST", path: "/auth/verify-password" }).input(VerifyPasswordInputSchema).output(VerifyPasswordOutputSchema);
226
+ var getProfileContract = import_contract.oc.route({ method: "GET", path: "/auth/profile" }).output(ProfileOutputSchema);
227
+ var updateProfileContract = import_contract.oc.route({ method: "PATCH", path: "/auth/profile" }).input(UpdateProfileInputSchema).output(ProfileOutputSchema);
201
228
  var authContract = {
202
229
  login: loginContract,
203
230
  refreshToken: refreshTokenContract,
@@ -206,7 +233,10 @@ var authContract = {
206
233
  changePassword: changePasswordContract,
207
234
  requestPasswordReset: requestPasswordResetContract,
208
235
  resetPassword: resetPasswordContract,
209
- switchBranch: switchBranchContract
236
+ switchBranch: switchBranchContract,
237
+ verifyPassword: verifyPasswordContract,
238
+ profile: getProfileContract,
239
+ updateProfile: updateProfileContract
210
240
  };
211
241
 
212
242
  // src/contracts/hr.ts
@@ -434,7 +464,7 @@ var CreateStudentInputSchema = z6.object({
434
464
  relationship: z6.string().min(1).max(50).meta({
435
465
  description: "e.g. mother, father, uncle, guardian"
436
466
  }),
437
- phone: z6.string().min(9).max(30),
467
+ phone: z6.string().regex(/^\+[1-9]\d{1,14}$/, "Must be a valid E.164 phone number, e.g. +254712345678"),
438
468
  email: z6.email().optional(),
439
469
  nationalId: z6.string().max(20).optional(),
440
470
  occupation: z6.string().max(100).optional()
@@ -542,7 +572,7 @@ var LinkGuardianInputSchema = z6.object({
542
572
  middleName: z6.string().max(100).optional(),
543
573
  lastName: z6.string().min(1).max(100),
544
574
  relationship: z6.string().min(1).max(50),
545
- phone: z6.string().min(9).max(30),
575
+ phone: z6.string().regex(/^\+[1-9]\d{1,14}$/, "Must be a valid E.164 phone number, e.g. +254712345678"),
546
576
  email: z6.email().optional(),
547
577
  nationalId: z6.string().max(20).optional(),
548
578
  occupation: z6.string().max(100).optional(),
@@ -1196,6 +1226,7 @@ var blocksContract = {
1196
1226
  getByStudentContract,
1197
1227
  getEntryContract,
1198
1228
  getMeContract,
1229
+ getProfileContract,
1199
1230
  getResponseSummaryContract,
1200
1231
  getStaffByIdContract,
1201
1232
  getStudentByIdContract,
@@ -1244,6 +1275,8 @@ var blocksContract = {
1244
1275
  switchBranchContract,
1245
1276
  updateBankAccountContract,
1246
1277
  updateCategoryContract,
1247
- updateStaffStatusContract
1278
+ updateProfileContract,
1279
+ updateStaffStatusContract,
1280
+ verifyPasswordContract
1248
1281
  });
1249
1282
  //# sourceMappingURL=index.cjs.map