@sekolaos/shared-schema 0.0.0-stage → 1.0.0
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/README.md +117 -3
- package/dist/cjs/academic/academic-year.schema.js +16 -0
- package/dist/cjs/academic/academic-year.schema.js.map +1 -0
- package/dist/cjs/academic/class-room.schema.js +15 -0
- package/dist/cjs/academic/class-room.schema.js.map +1 -0
- package/dist/cjs/attendance/attendance-class.schema.js +19 -0
- package/dist/cjs/attendance/attendance-class.schema.js.map +1 -0
- package/dist/cjs/attendance/attendance-kiosk.schema.js +35 -0
- package/dist/cjs/attendance/attendance-kiosk.schema.js.map +1 -0
- package/dist/cjs/attendance/barcode-rolling.schema.js +18 -0
- package/dist/cjs/attendance/barcode-rolling.schema.js.map +1 -0
- package/dist/cjs/auth/auth.schema.js +25 -0
- package/dist/cjs/auth/auth.schema.js.map +1 -0
- package/dist/cjs/auth/role.schema.js +34 -0
- package/dist/cjs/auth/role.schema.js.map +1 -0
- package/dist/cjs/common/common.schema.js +21 -0
- package/dist/cjs/common/common.schema.js.map +1 -0
- package/dist/cjs/common/pagination.schema.js +22 -0
- package/dist/cjs/common/pagination.schema.js.map +1 -0
- package/dist/cjs/index.js +29 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/package.json +3 -0
- package/dist/cjs/tenant/tenant.schema.js +23 -0
- package/dist/cjs/tenant/tenant.schema.js.map +1 -0
- package/dist/cjs/user/student.schema.js +26 -0
- package/dist/cjs/user/student.schema.js.map +1 -0
- package/dist/cjs/user/user.schema.js +14 -0
- package/dist/cjs/user/user.schema.js.map +1 -0
- package/dist/esm/academic/academic-year.schema.js +13 -0
- package/dist/esm/academic/academic-year.schema.js.map +1 -0
- package/dist/esm/academic/class-room.schema.js +12 -0
- package/dist/esm/academic/class-room.schema.js.map +1 -0
- package/dist/esm/attendance/attendance-class.schema.js +16 -0
- package/dist/esm/attendance/attendance-class.schema.js.map +1 -0
- package/dist/esm/attendance/attendance-kiosk.schema.js +32 -0
- package/dist/esm/attendance/attendance-kiosk.schema.js.map +1 -0
- package/dist/esm/attendance/barcode-rolling.schema.js +15 -0
- package/dist/esm/attendance/barcode-rolling.schema.js.map +1 -0
- package/dist/esm/auth/auth.schema.js +22 -0
- package/dist/esm/auth/auth.schema.js.map +1 -0
- package/dist/esm/auth/role.schema.js +31 -0
- package/dist/esm/auth/role.schema.js.map +1 -0
- package/dist/esm/common/common.schema.js +17 -0
- package/dist/esm/common/common.schema.js.map +1 -0
- package/dist/esm/common/pagination.schema.js +18 -0
- package/dist/esm/common/pagination.schema.js.map +1 -0
- package/dist/esm/index.js +13 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/tenant/tenant.schema.js +20 -0
- package/dist/esm/tenant/tenant.schema.js.map +1 -0
- package/dist/esm/user/student.schema.js +23 -0
- package/dist/esm/user/student.schema.js.map +1 -0
- package/dist/esm/user/user.schema.js +11 -0
- package/dist/esm/user/user.schema.js.map +1 -0
- package/dist/types/academic/academic-year.schema.d.ts +29 -0
- package/dist/types/academic/class-room.schema.d.ts +27 -0
- package/dist/types/attendance/attendance-class.schema.d.ts +55 -0
- package/dist/types/attendance/attendance-kiosk.schema.d.ts +108 -0
- package/dist/types/attendance/barcode-rolling.schema.d.ts +35 -0
- package/dist/types/auth/auth.schema.d.ts +105 -0
- package/dist/types/auth/role.schema.d.ts +57 -0
- package/dist/types/common/common.schema.d.ts +47 -0
- package/dist/types/common/pagination.schema.d.ts +58 -0
- package/dist/types/index.d.ts +12 -0
- package/dist/types/tenant/tenant.schema.d.ts +54 -0
- package/dist/types/user/student.schema.d.ts +63 -0
- package/dist/types/user/user.schema.d.ts +24 -0
- package/package.json +55 -6
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { uuidSchema } from "../common/common.schema.js";
|
|
3
|
+
export const loginRequestSchema = z.object({
|
|
4
|
+
usernameOrEmail: z.string().min(3).trim(),
|
|
5
|
+
password: z.string().min(6, "Password minimal 6 karakter"),
|
|
6
|
+
tenantSlug: z.string().min(2).optional(),
|
|
7
|
+
});
|
|
8
|
+
export const authenticatedUserRoleSummarySchema = z.object({
|
|
9
|
+
roleId: uuidSchema,
|
|
10
|
+
roleName: z.string(),
|
|
11
|
+
roleSlug: z.string(),
|
|
12
|
+
permissions: z.record(z.string(), z.array(z.string())),
|
|
13
|
+
});
|
|
14
|
+
export const authSessionSchema = z.object({
|
|
15
|
+
userId: uuidSchema,
|
|
16
|
+
tenantId: uuidSchema,
|
|
17
|
+
tenantSlug: z.string(),
|
|
18
|
+
activeAcademicYearId: uuidSchema,
|
|
19
|
+
activeRole: authenticatedUserRoleSummarySchema,
|
|
20
|
+
availableRoles: z.array(authenticatedUserRoleSummarySchema),
|
|
21
|
+
});
|
|
22
|
+
//# sourceMappingURL=auth.schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.schema.js","sourceRoot":"","sources":["../../../src/auth/auth.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAExD,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IACzC,eAAe,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE;IACzC,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,6BAA6B,CAAC;IAC1D,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;CACzC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,kCAAkC,GAAG,CAAC,CAAC,MAAM,CAAC;IACzD,MAAM,EAAE,UAAU;IAClB,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;IACpB,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;IACpB,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;CACvD,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC;IACxC,MAAM,EAAE,UAAU;IAClB,QAAQ,EAAE,UAAU;IACpB,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;IACtB,oBAAoB,EAAE,UAAU;IAChC,UAAU,EAAE,kCAAkC;IAC9C,cAAc,EAAE,CAAC,CAAC,KAAK,CAAC,kCAAkC,CAAC;CAC5D,CAAC,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { uuidSchema } from "../common/common.schema.js";
|
|
3
|
+
export const systemRoleSlugSchema = z.enum([
|
|
4
|
+
"superadmin",
|
|
5
|
+
"admin_sekolah",
|
|
6
|
+
"guru_piket",
|
|
7
|
+
"guru_pengajar",
|
|
8
|
+
"tata_usaha",
|
|
9
|
+
"kepala_sekolah",
|
|
10
|
+
"siswa"
|
|
11
|
+
]);
|
|
12
|
+
export const roleSchema = z.object({
|
|
13
|
+
id: uuidSchema,
|
|
14
|
+
tenantId: uuidSchema.nullable(),
|
|
15
|
+
name: z.string().min(2).max(100),
|
|
16
|
+
slug: z.string().min(2).max(100),
|
|
17
|
+
permissions: z.record(z.string(), z.array(z.string())),
|
|
18
|
+
});
|
|
19
|
+
export const userRolePivotSchema = z.object({
|
|
20
|
+
id: uuidSchema,
|
|
21
|
+
tenantId: uuidSchema,
|
|
22
|
+
userId: uuidSchema,
|
|
23
|
+
roleId: uuidSchema,
|
|
24
|
+
academicYearId: uuidSchema,
|
|
25
|
+
isActive: z.boolean().default(true),
|
|
26
|
+
});
|
|
27
|
+
export const switchRoleRequestSchema = z.object({
|
|
28
|
+
targetRoleId: uuidSchema,
|
|
29
|
+
academicYearId: uuidSchema,
|
|
30
|
+
});
|
|
31
|
+
//# sourceMappingURL=role.schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"role.schema.js","sourceRoot":"","sources":["../../../src/auth/role.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAExD,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,IAAI,CAAC;IACzC,YAAY;IACZ,eAAe;IACf,YAAY;IACZ,eAAe;IACf,YAAY;IACZ,gBAAgB;IAChB,OAAO;CACR,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,CAAC,MAAM,CAAC;IACjC,EAAE,EAAE,UAAU;IACd,QAAQ,EAAE,UAAU,CAAC,QAAQ,EAAE;IAC/B,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC;IAChC,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC;IAChC,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;CACvD,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC1C,EAAE,EAAE,UAAU;IACd,QAAQ,EAAE,UAAU;IACpB,MAAM,EAAE,UAAU;IAClB,MAAM,EAAE,UAAU;IAClB,cAAc,EAAE,UAAU;IAC1B,QAAQ,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC;CACpC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC9C,YAAY,EAAE,UAAU;IACxB,cAAc,EAAE,UAAU;CAC3B,CAAC,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export const uuidSchema = z.string().uuid({ message: "Format UUID tidak valid" });
|
|
3
|
+
export const timestampSchema = z.string().datetime({ message: "Format ISO datetime tidak valid" });
|
|
4
|
+
export const baseResponseSchema = (dataSchema) => z.object({
|
|
5
|
+
success: z.boolean(),
|
|
6
|
+
message: z.string(),
|
|
7
|
+
data: dataSchema,
|
|
8
|
+
});
|
|
9
|
+
export const apiErrorResponseSchema = z.object({
|
|
10
|
+
success: z.literal(false),
|
|
11
|
+
message: z.string(),
|
|
12
|
+
errors: z.array(z.object({
|
|
13
|
+
field: z.string().optional(),
|
|
14
|
+
message: z.string(),
|
|
15
|
+
})).optional(),
|
|
16
|
+
});
|
|
17
|
+
//# sourceMappingURL=common.schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common.schema.js","sourceRoot":"","sources":["../../../src/common/common.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,yBAAyB,EAAE,CAAC,CAAC;AAElF,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,OAAO,EAAE,iCAAiC,EAAE,CAAC,CAAC;AAEnG,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAyB,UAAa,EAAE,EAAE,CAC1E,CAAC,CAAC,MAAM,CAAC;IACP,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE;IACpB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,IAAI,EAAE,UAAU;CACjB,CAAC,CAAC;AAEL,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC7C,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC;IACzB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,MAAM,EAAE,CAAC,CAAC,KAAK,CACb,CAAC,CAAC,MAAM,CAAC;QACP,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QAC5B,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;KACpB,CAAC,CACH,CAAC,QAAQ,EAAE;CACb,CAAC,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export const paginationQuerySchema = z.object({
|
|
3
|
+
page: z.coerce.number().int().positive().default(1),
|
|
4
|
+
limit: z.coerce.number().int().positive().max(100).default(20),
|
|
5
|
+
search: z.string().trim().optional(),
|
|
6
|
+
sortBy: z.string().trim().optional(),
|
|
7
|
+
sortOrder: z.enum(["asc", "desc"]).default("desc"),
|
|
8
|
+
});
|
|
9
|
+
export const paginatedDataSchema = (itemSchema) => z.object({
|
|
10
|
+
items: z.array(itemSchema),
|
|
11
|
+
meta: z.object({
|
|
12
|
+
currentPage: z.number().int(),
|
|
13
|
+
pageSize: z.number().int(),
|
|
14
|
+
totalItems: z.number().int(),
|
|
15
|
+
totalPages: z.number().int(),
|
|
16
|
+
}),
|
|
17
|
+
});
|
|
18
|
+
//# sourceMappingURL=pagination.schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pagination.schema.js","sourceRoot":"","sources":["../../../src/common/pagination.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5C,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;IACnD,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;IAC9D,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,QAAQ,EAAE;IACpC,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,QAAQ,EAAE;IACpC,SAAS,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC;CACnD,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAyB,UAAa,EAAE,EAAE,CAC3E,CAAC,CAAC,MAAM,CAAC;IACP,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC;IAC1B,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC;QACb,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE;QAC7B,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE;QAC1B,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE;QAC5B,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE;KAC7B,CAAC;CACH,CAAC,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export * from "./common/common.schema.js";
|
|
2
|
+
export * from "./common/pagination.schema.js";
|
|
3
|
+
export * from "./tenant/tenant.schema.js";
|
|
4
|
+
export * from "./auth/role.schema.js";
|
|
5
|
+
export * from "./auth/auth.schema.js";
|
|
6
|
+
export * from "./academic/academic-year.schema.js";
|
|
7
|
+
export * from "./academic/class-room.schema.js";
|
|
8
|
+
export * from "./user/user.schema.js";
|
|
9
|
+
export * from "./user/student.schema.js";
|
|
10
|
+
export * from "./attendance/attendance-kiosk.schema.js";
|
|
11
|
+
export * from "./attendance/attendance-class.schema.js";
|
|
12
|
+
export * from "./attendance/barcode-rolling.schema.js";
|
|
13
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC;AAC1C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,oCAAoC,CAAC;AACnD,cAAc,iCAAiC,CAAC;AAChD,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,yCAAyC,CAAC;AACxD,cAAc,yCAAyC,CAAC;AACxD,cAAc,wCAAwC,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { uuidSchema, timestampSchema } from "../common/common.schema.js";
|
|
3
|
+
export const tenantSchema = z.object({
|
|
4
|
+
id: uuidSchema,
|
|
5
|
+
slug: z.string().min(3).max(50).regex(/^[a-z0-9-]+$/, "Slug hanya boleh berisi huruf kecil, angka, dan strip"),
|
|
6
|
+
name: z.string().min(3).max(255),
|
|
7
|
+
npsn: z.string().regex(/^\d{8}$/, "NPSN harus berupa 8 digit angka").optional().nullable(),
|
|
8
|
+
logoUrl: z.string().url().optional().nullable(),
|
|
9
|
+
timezone: z.string().default("Asia/Jakarta"),
|
|
10
|
+
createdAt: timestampSchema,
|
|
11
|
+
updatedAt: timestampSchema,
|
|
12
|
+
});
|
|
13
|
+
export const createTenantSchema = tenantSchema.pick({
|
|
14
|
+
slug: true,
|
|
15
|
+
name: true,
|
|
16
|
+
npsn: true,
|
|
17
|
+
logoUrl: true,
|
|
18
|
+
timezone: true,
|
|
19
|
+
});
|
|
20
|
+
//# sourceMappingURL=tenant.schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tenant.schema.js","sourceRoot":"","sources":["../../../src/tenant/tenant.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAEzE,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,CAAC,MAAM,CAAC;IACnC,EAAE,EAAE,UAAU;IACd,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,cAAc,EAAE,uDAAuD,CAAC;IAC9G,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC;IAChC,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,SAAS,EAAE,iCAAiC,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;IAC1F,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;IAC/C,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,cAAc,CAAC;IAC5C,SAAS,EAAE,eAAe;IAC1B,SAAS,EAAE,eAAe;CAC3B,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,kBAAkB,GAAG,YAAY,CAAC,IAAI,CAAC;IAClD,IAAI,EAAE,IAAI;IACV,IAAI,EAAE,IAAI;IACV,IAAI,EAAE,IAAI;IACV,OAAO,EAAE,IAAI;IACb,QAAQ,EAAE,IAAI;CACf,CAAC,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { uuidSchema } from "../common/common.schema.js";
|
|
3
|
+
export const studentSchema = z.object({
|
|
4
|
+
id: uuidSchema,
|
|
5
|
+
tenantId: uuidSchema,
|
|
6
|
+
nis: z.string().min(3).max(30),
|
|
7
|
+
nisn: z.string().length(10, "NISN harus 10 digit").optional().nullable(),
|
|
8
|
+
fullName: z.string().min(2).max(255),
|
|
9
|
+
gender: z.enum(["L", "P"]),
|
|
10
|
+
classRoomId: uuidSchema,
|
|
11
|
+
classRoomName: z.string(),
|
|
12
|
+
barcodeValue: z.string().min(3).max(50),
|
|
13
|
+
isActive: z.boolean().default(true),
|
|
14
|
+
});
|
|
15
|
+
export const studentOfflineSyncCacheSchema = studentSchema.pick({
|
|
16
|
+
id: true,
|
|
17
|
+
nis: true,
|
|
18
|
+
fullName: true,
|
|
19
|
+
classRoomId: true,
|
|
20
|
+
classRoomName: true,
|
|
21
|
+
barcodeValue: true,
|
|
22
|
+
});
|
|
23
|
+
//# sourceMappingURL=student.schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"student.schema.js","sourceRoot":"","sources":["../../../src/user/student.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAExD,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,CAAC,MAAM,CAAC;IACpC,EAAE,EAAE,UAAU;IACd,QAAQ,EAAE,UAAU;IACpB,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC;IAC9B,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,MAAM,CAAC,EAAE,EAAE,qBAAqB,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;IACxE,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC;IACpC,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IAC1B,WAAW,EAAE,UAAU;IACvB,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE;IACzB,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC;IACvC,QAAQ,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC;CACpC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,6BAA6B,GAAG,aAAa,CAAC,IAAI,CAAC;IAC9D,EAAE,EAAE,IAAI;IACR,GAAG,EAAE,IAAI;IACT,QAAQ,EAAE,IAAI;IACd,WAAW,EAAE,IAAI;IACjB,aAAa,EAAE,IAAI;IACnB,YAAY,EAAE,IAAI;CACnB,CAAC,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { uuidSchema } from "../common/common.schema.js";
|
|
3
|
+
export const userSchema = z.object({
|
|
4
|
+
id: uuidSchema,
|
|
5
|
+
tenantId: uuidSchema,
|
|
6
|
+
username: z.string().min(3).max(50).regex(/^[a-zA-Z0-9._-]+$/, "Username hanya boleh berisi huruf, angka, titik, underscore, dan strip"),
|
|
7
|
+
email: z.string().email().optional().nullable(),
|
|
8
|
+
fullName: z.string().min(2).max(255),
|
|
9
|
+
isActive: z.boolean().default(true),
|
|
10
|
+
});
|
|
11
|
+
//# sourceMappingURL=user.schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user.schema.js","sourceRoot":"","sources":["../../../src/user/user.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAExD,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,CAAC,MAAM,CAAC;IACjC,EAAE,EAAE,UAAU;IACd,QAAQ,EAAE,UAAU;IACpB,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,mBAAmB,EAAE,wEAAwE,CAAC;IACxI,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;IAC/C,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC;IACpC,QAAQ,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC;CACpC,CAAC,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const semesterEnum: z.ZodEnum<["GANJIL", "GENAP"]>;
|
|
3
|
+
export declare const academicYearSchema: z.ZodObject<{
|
|
4
|
+
id: z.ZodString;
|
|
5
|
+
tenantId: z.ZodString;
|
|
6
|
+
name: z.ZodString;
|
|
7
|
+
semester: z.ZodEnum<["GANJIL", "GENAP"]>;
|
|
8
|
+
isActive: z.ZodBoolean;
|
|
9
|
+
startDate: z.ZodString;
|
|
10
|
+
endDate: z.ZodString;
|
|
11
|
+
}, "strip", z.ZodTypeAny, {
|
|
12
|
+
id: string;
|
|
13
|
+
name: string;
|
|
14
|
+
tenantId: string;
|
|
15
|
+
isActive: boolean;
|
|
16
|
+
semester: "GANJIL" | "GENAP";
|
|
17
|
+
startDate: string;
|
|
18
|
+
endDate: string;
|
|
19
|
+
}, {
|
|
20
|
+
id: string;
|
|
21
|
+
name: string;
|
|
22
|
+
tenantId: string;
|
|
23
|
+
isActive: boolean;
|
|
24
|
+
semester: "GANJIL" | "GENAP";
|
|
25
|
+
startDate: string;
|
|
26
|
+
endDate: string;
|
|
27
|
+
}>;
|
|
28
|
+
export type Semester = z.infer<typeof semesterEnum>;
|
|
29
|
+
export type AcademicYear = z.infer<typeof academicYearSchema>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const classRoomSchema: z.ZodObject<{
|
|
3
|
+
id: z.ZodString;
|
|
4
|
+
tenantId: z.ZodString;
|
|
5
|
+
academicYearId: z.ZodString;
|
|
6
|
+
name: z.ZodString;
|
|
7
|
+
level: z.ZodString;
|
|
8
|
+
homeroomTeacherUserId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
9
|
+
isActive: z.ZodDefault<z.ZodBoolean>;
|
|
10
|
+
}, "strip", z.ZodTypeAny, {
|
|
11
|
+
id: string;
|
|
12
|
+
name: string;
|
|
13
|
+
tenantId: string;
|
|
14
|
+
academicYearId: string;
|
|
15
|
+
isActive: boolean;
|
|
16
|
+
level: string;
|
|
17
|
+
homeroomTeacherUserId?: string | null | undefined;
|
|
18
|
+
}, {
|
|
19
|
+
id: string;
|
|
20
|
+
name: string;
|
|
21
|
+
tenantId: string;
|
|
22
|
+
academicYearId: string;
|
|
23
|
+
level: string;
|
|
24
|
+
isActive?: boolean | undefined;
|
|
25
|
+
homeroomTeacherUserId?: string | null | undefined;
|
|
26
|
+
}>;
|
|
27
|
+
export type ClassRoom = z.infer<typeof classRoomSchema>;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const classAttendanceUpdateItemSchema: z.ZodObject<{
|
|
3
|
+
studentId: z.ZodString;
|
|
4
|
+
status: z.ZodEnum<["HADIR", "TERLAMBAT", "IZIN", "SAKIT", "ALPA"]>;
|
|
5
|
+
notes: z.ZodOptional<z.ZodString>;
|
|
6
|
+
}, "strip", z.ZodTypeAny, {
|
|
7
|
+
status: "HADIR" | "TERLAMBAT" | "IZIN" | "SAKIT" | "ALPA";
|
|
8
|
+
studentId: string;
|
|
9
|
+
notes?: string | undefined;
|
|
10
|
+
}, {
|
|
11
|
+
status: "HADIR" | "TERLAMBAT" | "IZIN" | "SAKIT" | "ALPA";
|
|
12
|
+
studentId: string;
|
|
13
|
+
notes?: string | undefined;
|
|
14
|
+
}>;
|
|
15
|
+
export declare const updateClassAttendanceRequestSchema: z.ZodObject<{
|
|
16
|
+
teachingScheduleId: z.ZodString;
|
|
17
|
+
academicYearId: z.ZodString;
|
|
18
|
+
classRoomId: z.ZodString;
|
|
19
|
+
date: z.ZodString;
|
|
20
|
+
attendances: z.ZodArray<z.ZodObject<{
|
|
21
|
+
studentId: z.ZodString;
|
|
22
|
+
status: z.ZodEnum<["HADIR", "TERLAMBAT", "IZIN", "SAKIT", "ALPA"]>;
|
|
23
|
+
notes: z.ZodOptional<z.ZodString>;
|
|
24
|
+
}, "strip", z.ZodTypeAny, {
|
|
25
|
+
status: "HADIR" | "TERLAMBAT" | "IZIN" | "SAKIT" | "ALPA";
|
|
26
|
+
studentId: string;
|
|
27
|
+
notes?: string | undefined;
|
|
28
|
+
}, {
|
|
29
|
+
status: "HADIR" | "TERLAMBAT" | "IZIN" | "SAKIT" | "ALPA";
|
|
30
|
+
studentId: string;
|
|
31
|
+
notes?: string | undefined;
|
|
32
|
+
}>, "many">;
|
|
33
|
+
}, "strip", z.ZodTypeAny, {
|
|
34
|
+
date: string;
|
|
35
|
+
academicYearId: string;
|
|
36
|
+
classRoomId: string;
|
|
37
|
+
teachingScheduleId: string;
|
|
38
|
+
attendances: {
|
|
39
|
+
status: "HADIR" | "TERLAMBAT" | "IZIN" | "SAKIT" | "ALPA";
|
|
40
|
+
studentId: string;
|
|
41
|
+
notes?: string | undefined;
|
|
42
|
+
}[];
|
|
43
|
+
}, {
|
|
44
|
+
date: string;
|
|
45
|
+
academicYearId: string;
|
|
46
|
+
classRoomId: string;
|
|
47
|
+
teachingScheduleId: string;
|
|
48
|
+
attendances: {
|
|
49
|
+
status: "HADIR" | "TERLAMBAT" | "IZIN" | "SAKIT" | "ALPA";
|
|
50
|
+
studentId: string;
|
|
51
|
+
notes?: string | undefined;
|
|
52
|
+
}[];
|
|
53
|
+
}>;
|
|
54
|
+
export type ClassAttendanceUpdateItem = z.infer<typeof classAttendanceUpdateItemSchema>;
|
|
55
|
+
export type UpdateClassAttendanceRequest = z.infer<typeof updateClassAttendanceRequestSchema>;
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const attendanceStatusEnum: z.ZodEnum<["HADIR", "TERLAMBAT", "IZIN", "SAKIT", "ALPA"]>;
|
|
3
|
+
export declare const kioskScanItemSchema: z.ZodObject<{
|
|
4
|
+
clientUuid: z.ZodString;
|
|
5
|
+
tenantId: z.ZodString;
|
|
6
|
+
studentId: z.ZodString;
|
|
7
|
+
barcodeScanned: z.ZodString;
|
|
8
|
+
scannedAt: z.ZodString;
|
|
9
|
+
status: z.ZodDefault<z.ZodEnum<["HADIR", "TERLAMBAT", "IZIN", "SAKIT", "ALPA"]>>;
|
|
10
|
+
notes: z.ZodOptional<z.ZodString>;
|
|
11
|
+
}, "strip", z.ZodTypeAny, {
|
|
12
|
+
status: "HADIR" | "TERLAMBAT" | "IZIN" | "SAKIT" | "ALPA";
|
|
13
|
+
tenantId: string;
|
|
14
|
+
clientUuid: string;
|
|
15
|
+
studentId: string;
|
|
16
|
+
barcodeScanned: string;
|
|
17
|
+
scannedAt: string;
|
|
18
|
+
notes?: string | undefined;
|
|
19
|
+
}, {
|
|
20
|
+
tenantId: string;
|
|
21
|
+
clientUuid: string;
|
|
22
|
+
studentId: string;
|
|
23
|
+
barcodeScanned: string;
|
|
24
|
+
scannedAt: string;
|
|
25
|
+
status?: "HADIR" | "TERLAMBAT" | "IZIN" | "SAKIT" | "ALPA" | undefined;
|
|
26
|
+
notes?: string | undefined;
|
|
27
|
+
}>;
|
|
28
|
+
export declare const batchSyncAttendanceRequestSchema: z.ZodObject<{
|
|
29
|
+
tenantId: z.ZodString;
|
|
30
|
+
gateKeeperUserId: z.ZodString;
|
|
31
|
+
academicYearId: z.ZodString;
|
|
32
|
+
syncedAt: z.ZodString;
|
|
33
|
+
records: z.ZodArray<z.ZodObject<{
|
|
34
|
+
clientUuid: z.ZodString;
|
|
35
|
+
tenantId: z.ZodString;
|
|
36
|
+
studentId: z.ZodString;
|
|
37
|
+
barcodeScanned: z.ZodString;
|
|
38
|
+
scannedAt: z.ZodString;
|
|
39
|
+
status: z.ZodDefault<z.ZodEnum<["HADIR", "TERLAMBAT", "IZIN", "SAKIT", "ALPA"]>>;
|
|
40
|
+
notes: z.ZodOptional<z.ZodString>;
|
|
41
|
+
}, "strip", z.ZodTypeAny, {
|
|
42
|
+
status: "HADIR" | "TERLAMBAT" | "IZIN" | "SAKIT" | "ALPA";
|
|
43
|
+
tenantId: string;
|
|
44
|
+
clientUuid: string;
|
|
45
|
+
studentId: string;
|
|
46
|
+
barcodeScanned: string;
|
|
47
|
+
scannedAt: string;
|
|
48
|
+
notes?: string | undefined;
|
|
49
|
+
}, {
|
|
50
|
+
tenantId: string;
|
|
51
|
+
clientUuid: string;
|
|
52
|
+
studentId: string;
|
|
53
|
+
barcodeScanned: string;
|
|
54
|
+
scannedAt: string;
|
|
55
|
+
status?: "HADIR" | "TERLAMBAT" | "IZIN" | "SAKIT" | "ALPA" | undefined;
|
|
56
|
+
notes?: string | undefined;
|
|
57
|
+
}>, "many">;
|
|
58
|
+
}, "strip", z.ZodTypeAny, {
|
|
59
|
+
tenantId: string;
|
|
60
|
+
academicYearId: string;
|
|
61
|
+
gateKeeperUserId: string;
|
|
62
|
+
syncedAt: string;
|
|
63
|
+
records: {
|
|
64
|
+
status: "HADIR" | "TERLAMBAT" | "IZIN" | "SAKIT" | "ALPA";
|
|
65
|
+
tenantId: string;
|
|
66
|
+
clientUuid: string;
|
|
67
|
+
studentId: string;
|
|
68
|
+
barcodeScanned: string;
|
|
69
|
+
scannedAt: string;
|
|
70
|
+
notes?: string | undefined;
|
|
71
|
+
}[];
|
|
72
|
+
}, {
|
|
73
|
+
tenantId: string;
|
|
74
|
+
academicYearId: string;
|
|
75
|
+
gateKeeperUserId: string;
|
|
76
|
+
syncedAt: string;
|
|
77
|
+
records: {
|
|
78
|
+
tenantId: string;
|
|
79
|
+
clientUuid: string;
|
|
80
|
+
studentId: string;
|
|
81
|
+
barcodeScanned: string;
|
|
82
|
+
scannedAt: string;
|
|
83
|
+
status?: "HADIR" | "TERLAMBAT" | "IZIN" | "SAKIT" | "ALPA" | undefined;
|
|
84
|
+
notes?: string | undefined;
|
|
85
|
+
}[];
|
|
86
|
+
}>;
|
|
87
|
+
export declare const batchSyncAttendanceResponseSchema: z.ZodObject<{
|
|
88
|
+
totalReceived: z.ZodNumber;
|
|
89
|
+
totalSaved: z.ZodNumber;
|
|
90
|
+
totalDuplicates: z.ZodNumber;
|
|
91
|
+
duplicateClientUuids: z.ZodArray<z.ZodString, "many">;
|
|
92
|
+
}, "strip", z.ZodTypeAny, {
|
|
93
|
+
totalReceived: number;
|
|
94
|
+
totalSaved: number;
|
|
95
|
+
totalDuplicates: number;
|
|
96
|
+
duplicateClientUuids: string[];
|
|
97
|
+
}, {
|
|
98
|
+
totalReceived: number;
|
|
99
|
+
totalSaved: number;
|
|
100
|
+
totalDuplicates: number;
|
|
101
|
+
duplicateClientUuids: string[];
|
|
102
|
+
}>;
|
|
103
|
+
export type AttendanceStatus = z.infer<typeof attendanceStatusEnum>;
|
|
104
|
+
export type KioskScanItem = z.infer<typeof kioskScanItemSchema>;
|
|
105
|
+
export type KioskScanItemInput = z.input<typeof kioskScanItemSchema>;
|
|
106
|
+
export type BatchSyncAttendanceRequest = z.infer<typeof batchSyncAttendanceRequestSchema>;
|
|
107
|
+
export type BatchSyncAttendanceRequestInput = z.input<typeof batchSyncAttendanceRequestSchema>;
|
|
108
|
+
export type BatchSyncAttendanceResponse = z.infer<typeof batchSyncAttendanceResponseSchema>;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const rollingBarcodePayloadSchema: z.ZodObject<{
|
|
3
|
+
tenantId: z.ZodString;
|
|
4
|
+
kioskToken: z.ZodString;
|
|
5
|
+
expiresAt: z.ZodNumber;
|
|
6
|
+
hash: z.ZodString;
|
|
7
|
+
}, "strip", z.ZodTypeAny, {
|
|
8
|
+
tenantId: string;
|
|
9
|
+
kioskToken: string;
|
|
10
|
+
expiresAt: number;
|
|
11
|
+
hash: string;
|
|
12
|
+
}, {
|
|
13
|
+
tenantId: string;
|
|
14
|
+
kioskToken: string;
|
|
15
|
+
expiresAt: number;
|
|
16
|
+
hash: string;
|
|
17
|
+
}>;
|
|
18
|
+
export declare const teacherScanDynamicBarcodeRequestSchema: z.ZodObject<{
|
|
19
|
+
tenantId: z.ZodString;
|
|
20
|
+
teacherUserId: z.ZodString;
|
|
21
|
+
scannedPayload: z.ZodString;
|
|
22
|
+
scannedAt: z.ZodString;
|
|
23
|
+
}, "strip", z.ZodTypeAny, {
|
|
24
|
+
tenantId: string;
|
|
25
|
+
scannedAt: string;
|
|
26
|
+
teacherUserId: string;
|
|
27
|
+
scannedPayload: string;
|
|
28
|
+
}, {
|
|
29
|
+
tenantId: string;
|
|
30
|
+
scannedAt: string;
|
|
31
|
+
teacherUserId: string;
|
|
32
|
+
scannedPayload: string;
|
|
33
|
+
}>;
|
|
34
|
+
export type RollingBarcodePayload = z.infer<typeof rollingBarcodePayloadSchema>;
|
|
35
|
+
export type TeacherScanDynamicBarcodeRequest = z.infer<typeof teacherScanDynamicBarcodeRequestSchema>;
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const loginRequestSchema: z.ZodObject<{
|
|
3
|
+
usernameOrEmail: z.ZodString;
|
|
4
|
+
password: z.ZodString;
|
|
5
|
+
tenantSlug: z.ZodOptional<z.ZodString>;
|
|
6
|
+
}, "strip", z.ZodTypeAny, {
|
|
7
|
+
usernameOrEmail: string;
|
|
8
|
+
password: string;
|
|
9
|
+
tenantSlug?: string | undefined;
|
|
10
|
+
}, {
|
|
11
|
+
usernameOrEmail: string;
|
|
12
|
+
password: string;
|
|
13
|
+
tenantSlug?: string | undefined;
|
|
14
|
+
}>;
|
|
15
|
+
export declare const authenticatedUserRoleSummarySchema: z.ZodObject<{
|
|
16
|
+
roleId: z.ZodString;
|
|
17
|
+
roleName: z.ZodString;
|
|
18
|
+
roleSlug: z.ZodString;
|
|
19
|
+
permissions: z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString, "many">>;
|
|
20
|
+
}, "strip", z.ZodTypeAny, {
|
|
21
|
+
permissions: Record<string, string[]>;
|
|
22
|
+
roleId: string;
|
|
23
|
+
roleName: string;
|
|
24
|
+
roleSlug: string;
|
|
25
|
+
}, {
|
|
26
|
+
permissions: Record<string, string[]>;
|
|
27
|
+
roleId: string;
|
|
28
|
+
roleName: string;
|
|
29
|
+
roleSlug: string;
|
|
30
|
+
}>;
|
|
31
|
+
export declare const authSessionSchema: z.ZodObject<{
|
|
32
|
+
userId: z.ZodString;
|
|
33
|
+
tenantId: z.ZodString;
|
|
34
|
+
tenantSlug: z.ZodString;
|
|
35
|
+
activeAcademicYearId: z.ZodString;
|
|
36
|
+
activeRole: z.ZodObject<{
|
|
37
|
+
roleId: z.ZodString;
|
|
38
|
+
roleName: z.ZodString;
|
|
39
|
+
roleSlug: z.ZodString;
|
|
40
|
+
permissions: z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString, "many">>;
|
|
41
|
+
}, "strip", z.ZodTypeAny, {
|
|
42
|
+
permissions: Record<string, string[]>;
|
|
43
|
+
roleId: string;
|
|
44
|
+
roleName: string;
|
|
45
|
+
roleSlug: string;
|
|
46
|
+
}, {
|
|
47
|
+
permissions: Record<string, string[]>;
|
|
48
|
+
roleId: string;
|
|
49
|
+
roleName: string;
|
|
50
|
+
roleSlug: string;
|
|
51
|
+
}>;
|
|
52
|
+
availableRoles: z.ZodArray<z.ZodObject<{
|
|
53
|
+
roleId: z.ZodString;
|
|
54
|
+
roleName: z.ZodString;
|
|
55
|
+
roleSlug: z.ZodString;
|
|
56
|
+
permissions: z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString, "many">>;
|
|
57
|
+
}, "strip", z.ZodTypeAny, {
|
|
58
|
+
permissions: Record<string, string[]>;
|
|
59
|
+
roleId: string;
|
|
60
|
+
roleName: string;
|
|
61
|
+
roleSlug: string;
|
|
62
|
+
}, {
|
|
63
|
+
permissions: Record<string, string[]>;
|
|
64
|
+
roleId: string;
|
|
65
|
+
roleName: string;
|
|
66
|
+
roleSlug: string;
|
|
67
|
+
}>, "many">;
|
|
68
|
+
}, "strip", z.ZodTypeAny, {
|
|
69
|
+
tenantId: string;
|
|
70
|
+
userId: string;
|
|
71
|
+
tenantSlug: string;
|
|
72
|
+
activeAcademicYearId: string;
|
|
73
|
+
activeRole: {
|
|
74
|
+
permissions: Record<string, string[]>;
|
|
75
|
+
roleId: string;
|
|
76
|
+
roleName: string;
|
|
77
|
+
roleSlug: string;
|
|
78
|
+
};
|
|
79
|
+
availableRoles: {
|
|
80
|
+
permissions: Record<string, string[]>;
|
|
81
|
+
roleId: string;
|
|
82
|
+
roleName: string;
|
|
83
|
+
roleSlug: string;
|
|
84
|
+
}[];
|
|
85
|
+
}, {
|
|
86
|
+
tenantId: string;
|
|
87
|
+
userId: string;
|
|
88
|
+
tenantSlug: string;
|
|
89
|
+
activeAcademicYearId: string;
|
|
90
|
+
activeRole: {
|
|
91
|
+
permissions: Record<string, string[]>;
|
|
92
|
+
roleId: string;
|
|
93
|
+
roleName: string;
|
|
94
|
+
roleSlug: string;
|
|
95
|
+
};
|
|
96
|
+
availableRoles: {
|
|
97
|
+
permissions: Record<string, string[]>;
|
|
98
|
+
roleId: string;
|
|
99
|
+
roleName: string;
|
|
100
|
+
roleSlug: string;
|
|
101
|
+
}[];
|
|
102
|
+
}>;
|
|
103
|
+
export type LoginRequest = z.infer<typeof loginRequestSchema>;
|
|
104
|
+
export type AuthenticatedUserRoleSummary = z.infer<typeof authenticatedUserRoleSummarySchema>;
|
|
105
|
+
export type AuthSession = z.infer<typeof authSessionSchema>;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const systemRoleSlugSchema: z.ZodEnum<["superadmin", "admin_sekolah", "guru_piket", "guru_pengajar", "tata_usaha", "kepala_sekolah", "siswa"]>;
|
|
3
|
+
export declare const roleSchema: z.ZodObject<{
|
|
4
|
+
id: z.ZodString;
|
|
5
|
+
tenantId: z.ZodNullable<z.ZodString>;
|
|
6
|
+
name: z.ZodString;
|
|
7
|
+
slug: z.ZodString;
|
|
8
|
+
permissions: z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString, "many">>;
|
|
9
|
+
}, "strip", z.ZodTypeAny, {
|
|
10
|
+
id: string;
|
|
11
|
+
slug: string;
|
|
12
|
+
name: string;
|
|
13
|
+
tenantId: string | null;
|
|
14
|
+
permissions: Record<string, string[]>;
|
|
15
|
+
}, {
|
|
16
|
+
id: string;
|
|
17
|
+
slug: string;
|
|
18
|
+
name: string;
|
|
19
|
+
tenantId: string | null;
|
|
20
|
+
permissions: Record<string, string[]>;
|
|
21
|
+
}>;
|
|
22
|
+
export declare const userRolePivotSchema: z.ZodObject<{
|
|
23
|
+
id: z.ZodString;
|
|
24
|
+
tenantId: z.ZodString;
|
|
25
|
+
userId: z.ZodString;
|
|
26
|
+
roleId: z.ZodString;
|
|
27
|
+
academicYearId: z.ZodString;
|
|
28
|
+
isActive: z.ZodDefault<z.ZodBoolean>;
|
|
29
|
+
}, "strip", z.ZodTypeAny, {
|
|
30
|
+
id: string;
|
|
31
|
+
tenantId: string;
|
|
32
|
+
userId: string;
|
|
33
|
+
roleId: string;
|
|
34
|
+
academicYearId: string;
|
|
35
|
+
isActive: boolean;
|
|
36
|
+
}, {
|
|
37
|
+
id: string;
|
|
38
|
+
tenantId: string;
|
|
39
|
+
userId: string;
|
|
40
|
+
roleId: string;
|
|
41
|
+
academicYearId: string;
|
|
42
|
+
isActive?: boolean | undefined;
|
|
43
|
+
}>;
|
|
44
|
+
export declare const switchRoleRequestSchema: z.ZodObject<{
|
|
45
|
+
targetRoleId: z.ZodString;
|
|
46
|
+
academicYearId: z.ZodString;
|
|
47
|
+
}, "strip", z.ZodTypeAny, {
|
|
48
|
+
academicYearId: string;
|
|
49
|
+
targetRoleId: string;
|
|
50
|
+
}, {
|
|
51
|
+
academicYearId: string;
|
|
52
|
+
targetRoleId: string;
|
|
53
|
+
}>;
|
|
54
|
+
export type SystemRoleSlug = z.infer<typeof systemRoleSlugSchema>;
|
|
55
|
+
export type Role = z.infer<typeof roleSchema>;
|
|
56
|
+
export type UserRolePivot = z.infer<typeof userRolePivotSchema>;
|
|
57
|
+
export type SwitchRoleRequest = z.infer<typeof switchRoleRequestSchema>;
|