basic stracture and auth
in memory db :)
This commit is contained in:
commit
3a554ba434
71 files changed
+28535
No files matched your search
@@ -0,0 +1,46 @@
|
||||
import { z } from 'zod'
|
||||
|
||||
export const UserSchema = z.object({
|
||||
id: z.string(),
|
||||
email: z.string().email(),
|
||||
firstName: z.string().min(1),
|
||||
lastName: z.string().min(1),
|
||||
role: z.enum(['admin', 'trainer', 'client']),
|
||||
createdAt: z.date(),
|
||||
updatedAt: z.date(),
|
||||
})
|
||||
|
||||
export const ClientSchema = z.object({
|
||||
id: z.string(),
|
||||
userId: z.string(),
|
||||
membershipType: z.enum(['basic', 'premium', 'vip']),
|
||||
membershipStatus: z.enum(['active', 'inactive', 'suspended']),
|
||||
joinDate: z.date(),
|
||||
lastVisit: z.date().optional(),
|
||||
emergencyContact: z.object({
|
||||
name: z.string(),
|
||||
phone: z.string(),
|
||||
relationship: z.string(),
|
||||
}),
|
||||
})
|
||||
|
||||
export const PaymentSchema = z.object({
|
||||
id: z.string(),
|
||||
clientId: z.string(),
|
||||
amount: z.number().positive(),
|
||||
currency: z.string(),
|
||||
status: z.enum(['pending', 'completed', 'failed', 'refunded']),
|
||||
paymentMethod: z.enum(['cash', 'card', 'bank_transfer']),
|
||||
dueDate: z.date(),
|
||||
paidAt: z.date().optional(),
|
||||
description: z.string(),
|
||||
})
|
||||
|
||||
export const AttendanceSchema = z.object({
|
||||
id: z.string(),
|
||||
clientId: z.string(),
|
||||
checkInTime: z.date(),
|
||||
checkOutTime: z.date().optional(),
|
||||
type: z.enum(['gym', 'class', 'personal_training']),
|
||||
notes: z.string().optional(),
|
||||
})
|
||||
Reference in new issue
Block a user