-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocument-data.ts
More file actions
26 lines (22 loc) · 990 Bytes
/
document-data.ts
File metadata and controls
26 lines (22 loc) · 990 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import { z } from 'zod'
import { makeJsonCodecSimple } from '../utils/json'
import { DocumentStateDataSchema } from './document-state-data'
import { DocumentTemplateFormatDataSchema } from './document-template-format-data'
import { DocumentTemplateInfoDataSchema } from './document-template-info-data'
import { ProjectInfoDataSchema } from './project-info-data'
export const DocumentDataSchema = z.object({
uuid: z.uuid(),
name: z.string(),
createdAt: z.iso.datetime(),
project: ProjectInfoDataSchema,
projectEventUuid: z.uuid().nullable(),
projectVersion: z.string().nullable(),
documentTemplate: DocumentTemplateInfoDataSchema,
format: DocumentTemplateFormatDataSchema,
state: DocumentStateDataSchema,
createdBy: z.uuid().nullable(),
fileSize: z.int().nullable(),
workerLog: z.string().nullable(),
})
export type DocumentData = z.infer<typeof DocumentDataSchema>
export const DocumentDataCodec = makeJsonCodecSimple(DocumentDataSchema)