This repository has been archived on 2024-02-08. You can view files and clone it, but cannot push or open issues or pull requests.
frontend/src/modelSchema/bucket.ts

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>