@brite-future-schools-contracts/contracts 2.0.34 → 2.0.38

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/index.cjs CHANGED
@@ -555,7 +555,7 @@ var CreateStudentInputSchema = z4.object({
555
555
  relationship: z4.string().min(1).max(50).meta({
556
556
  description: "e.g. mother, father, uncle, guardian"
557
557
  }),
558
- phone: z4.string().min(9).max(30),
558
+ phone: z4.string().regex(/^\+[1-9]\d{1,14}$/, "Must be a valid E.164 phone number, e.g. +254712345678"),
559
559
  email: z4.email().optional(),
560
560
  nationalId: z4.string().max(20).optional(),
561
561
  occupation: z4.string().max(100).optional()
@@ -663,7 +663,7 @@ var LinkGuardianInputSchema = z4.object({
663
663
  middleName: z4.string().max(100).optional(),
664
664
  lastName: z4.string().min(1).max(100),
665
665
  relationship: z4.string().min(1).max(50),
666
- phone: z4.string().min(9).max(30),
666
+ phone: z4.string().regex(/^\+[1-9]\d{1,14}$/, "Must be a valid E.164 phone number, e.g. +254712345678"),
667
667
  email: z4.email().optional(),
668
668
  nationalId: z4.string().max(20).optional(),
669
669
  occupation: z4.string().max(100).optional(),
@@ -1339,7 +1339,15 @@ var blocksContract = {
1339
1339
  };
1340
1340
 
1341
1341
  // src/roles/helpers.ts
1342
+ var ORG_SCOPED_ROLES = /* @__PURE__ */ new Set([
1343
+ "PROPRIETOR",
1344
+ "DIRECTOR",
1345
+ "SYSTEM_ADMIN"
1346
+ ]);
1342
1347
  function hasRole(user, role) {
1348
+ if (ORG_SCOPED_ROLES.has(role)) {
1349
+ return user.roles.some((r) => r.name === role);
1350
+ }
1343
1351
  return user.roles.some(
1344
1352
  (r) => r.name === role && (!user.activeBranchId || r.branchId === user.activeBranchId)
1345
1353
  );