21 lines
639 B
TypeScript
21 lines
639 B
TypeScript
import { type TypeOf, string } from 'zod'
|
|
import { AbstractSchema } from './abstract'
|
|
import { DateSchema } from './common/date'
|
|
import { FilterSchema } from './common/filter'
|
|
import { IdSchema } from './common/id'
|
|
import { UserSchema } from './user'
|
|
|
|
// FIXME: is it correct that this extends the Abstract Schema?
|
|
export const SavedFilterSchema = AbstractSchema.extend({
|
|
id: IdSchema.default(0),
|
|
title: string().default(''),
|
|
description: string().default(''),
|
|
filters: FilterSchema,
|
|
|
|
owner: UserSchema,
|
|
created: DateSchema.nullable(),
|
|
updated: DateSchema.nullable(),
|
|
})
|
|
|
|
export type SavedFilter = TypeOf<typeof SavedFilterSchema>
|