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/namespace.ts

25 lines
760 B
TypeScript

import { type TypeOf, boolean, string, array } from 'zod'
import { AbstractSchema } from './abstract'
import { ListSchema } from './list'
import { UserSchema } from './user'
import { SubscriptionSchema } from './subscription'
import { IdSchema } from './common/id'
import { HexColorSchema } from './common/hexColor'
export const NamespaceSchema = AbstractSchema.extend({
id: IdSchema.default(0),
title: string().default(''),
description: string().default(''),
owner: UserSchema,
lists: array(ListSchema),
isArchived: boolean().default(false),
hexColor: HexColorSchema.default(''),
subscription: SubscriptionSchema.nullable(),
created: IdSchema.nullable(),
updated: IdSchema.nullable(),
})
export type Namespace = TypeOf<typeof NamespaceSchema>