UNPKG

@tmlmobilidade/types

Version:
26 lines (25 loc) 1.05 kB
/* * */ import { GtfsAgencySchema } from '../gtfs/agency.js'; import { GtfsFeedInfoSchema } from '../gtfs/feed-info.js'; import { PlanAppStatusSchema } from './plan-app-status.js'; import { PlanPcgiLegacySchema } from './plan-pcgi-legacy.js'; import { DocumentSchema } from '@tmlmobilidade/go-types-shared'; import { z } from 'zod'; /* * */ export const PlanSchema = DocumentSchema.extend({ apex_file_id: z.string().nullable().default(null), apps: z.object({ controller: PlanAppStatusSchema, hub_gtfs: PlanAppStatusSchema, hub_schedules: PlanAppStatusSchema, merger: PlanAppStatusSchema, }).default({}), gtfs_agency: GtfsAgencySchema, gtfs_feed_info: GtfsFeedInfoSchema, hash: z.string(), is_locked: z.boolean().default(false), operation_file_id: z.string(), pcgi_legacy: PlanPcgiLegacySchema, }); export const CreatePlanSchema = PlanSchema.omit({ _id: true, created_at: true, updated_at: true }); export const UpdatePlanSchema = CreatePlanSchema.omit({ created_by: true }).partial();