- Replace Bun with pnpm 9 + Turborepo + tsx; apps/api renamed to apps/backend - Split backend into http/, modules/, lib/ layers mirroring tai-specguard - Add use-case + Result pattern, Problem Details RFC 7807, basePath /api/v1 - Mount Better Auth at /api/v1/auth, keep session-auth whitelist - Split Prisma schema into prisma/models/*, generate into generated/ - Rework packages/shared into lib/ + schemas/ with pagination DTOs - Implement health, groups, students, payments, waitlist modules - Add vitest suite with prisma mocks (21 tests), biome lint - Point web client to /api/v1/auth and /api/v1/groups/from-organization
18 lines
489 B
TypeScript
18 lines
489 B
TypeScript
import { z } from 'zod';
|
|
|
|
export function createPageSchema() {
|
|
return z.coerce.number().int().min(1).default(1);
|
|
}
|
|
|
|
export function createPageSizeSchema(defaultValue: number = 10) {
|
|
return z.coerce.number().int().min(1).max(100).default(defaultValue);
|
|
}
|
|
|
|
export function createPaginationSchema() {
|
|
return z.object({
|
|
page: z.number().int().min(1),
|
|
pageSize: z.number().int().min(1).max(100),
|
|
total: z.number().int().min(0),
|
|
totalPages: z.number().int().min(0),
|
|
});
|
|
} |