Visibility internal Owner _ Approver _ Created _ Updated _
TaxonomySchema.ts
| Field | Value |
|---|---|
| Type | TypeScript |
| Source | Product/Projects/Taxonomy/Schemas/TaxonomySchema.ts |
| Parent | Product |
| GitHub | Product/Projects/Taxonomy/Schemas/TaxonomySchema.ts |
This page is auto-generated. Edit the source to change the content.
//import { PublishStatusSchema } from '@dakoda/database/zod/enums/PublishStatus.schema';
//import { LifeDomainIdSchema } from '@dakoda/database/zod/enums/LifeDomainId.schema';
//import { TaxonomyTypeSchema } from '@dakoda/database/zod/enums/TaxonomyType.schema';
import { z } from 'zod';
export const PublishStatusSchema = z.enum([
'draft',
'review',
'approve',
'published',
'rejected',
'archived',
]);
export const LifeDomainIdSchema = z.enum([
'body',
'mind',
'home',
'intimacy',
'connection',
'community',
'school',
'work',
'business',
'money',
'parenting',
'caregiving',
'play',
'meaning',
'growth',
'legacy',
'purpose',
'general',
]);
export const TaxonomyTypeSchema = z.enum(['issue', 'aspiration', 'practice']);
export const TaxonomySchema = z.object({
id: z.string(),
createdAt: z.coerce.date().default(() => new Date()),
updatedAt: z.coerce.date(),
status: PublishStatusSchema.default('draft'),
publishedAt: z.coerce.date().nullish(),
version: z.number().default(1),
indexedAt: z.coerce.date().nullish(),
processingAt: z.coerce.date().nullish(),
warnings: z.array(z.string()),
name: z
.string()
.min(1, { message: 'Name must be between 1 and 50 characters' })
.max(50, { message: 'Name must be between 1 and 50 characters' }),
description: z.string(),
domain: LifeDomainIdSchema.default('body'),
type: TaxonomyTypeSchema,
tags: z.array(z.string()),
embedding: z.any().nullish(),
});
export const TaxonomyMapSchema = z.object({
id: z.string(),
createdAt: z.coerce.date().default(() => new Date()),
updatedAt: z.coerce.date(),
status: PublishStatusSchema.default('draft'),
publishedAt: z.coerce.date().nullish(),
version: z.number().default(1),
indexedAt: z.coerce.date().nullish(),
processingAt: z.coerce.date().nullish(),
warnings: z.array(z.string()),
fromId: z.string(),
from: TaxonomySchema,
toId: z.string(),
to: TaxonomySchema,
});