23 lines
741 B
TypeScript
23 lines
741 B
TypeScript
import { type TypeOf, number, array, boolean } from 'zod'
|
|
import { UserSchema } from './user'
|
|
import { TaskSchema } from './task'
|
|
import { DateSchema } from './common/date'
|
|
import { IdSchema } from './common/id'
|
|
import { AbstractSchema } from './abstract'
|
|
import { TextFieldSchema } from './common/textField'
|
|
|
|
export const BucketSchema = AbstractSchema.extend({
|
|
id: IdSchema.default(0),
|
|
title: TextFieldSchema,
|
|
listId: IdSchema.default(0),
|
|
limit: number().default(0),
|
|
tasks: array(TaskSchema).default([]),
|
|
isDoneBucket: boolean().default(false),
|
|
position: number().default(0),
|
|
|
|
createdBy: UserSchema.nullable(),
|
|
created: DateSchema.nullable(),
|
|
updated: DateSchema.nullable(),
|
|
})
|
|
|
|
export type IBucket = TypeOf<typeof BucketSchema>
|