refactor: migrate backend to pnpm monorepo with Hono module architecture
- 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
This commit is contained in:
31
packages/shared/src/schemas/waitlist.ts
Normal file
31
packages/shared/src/schemas/waitlist.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
import { z } from 'zod';
|
||||
import { createPageSchema, createPageSizeSchema, createPaginationSchema } from './pagination.js';
|
||||
|
||||
const isoDateTimeSchema = z.string().datetime();
|
||||
const pageSchema = createPageSchema();
|
||||
const pageSizeSchema = createPageSizeSchema(10);
|
||||
const paginationSchema = createPaginationSchema();
|
||||
|
||||
export const waitlistStatusSchema = z.enum(['PENDING', 'INVITED', 'JOINED', 'DECLINED']);
|
||||
|
||||
export const WaitlistEntryDtoSchema = z.object({
|
||||
id: z.string(),
|
||||
email: z.string(),
|
||||
name: z.string().nullable(),
|
||||
status: waitlistStatusSchema,
|
||||
createdAt: isoDateTimeSchema,
|
||||
updatedAt: isoDateTimeSchema,
|
||||
});
|
||||
export type WaitlistEntryDto = z.output<typeof WaitlistEntryDtoSchema>;
|
||||
|
||||
export const WaitlistQuerySchema = z.object({
|
||||
page: pageSchema,
|
||||
pageSize: pageSizeSchema,
|
||||
});
|
||||
export type WaitlistQuery = z.output<typeof WaitlistQuerySchema>;
|
||||
|
||||
export const WaitlistListSchema = z.object({
|
||||
data: z.array(WaitlistEntryDtoSchema),
|
||||
pagination: paginationSchema,
|
||||
});
|
||||
export type WaitlistList = z.output<typeof WaitlistListSchema>;
|
||||
Reference in New Issue
Block a user