{"version":3,"file":"unit.schema.cjs","sources":["../../../../../src/schema/public/unit/unit.schema.ts"],"sourcesContent":["import { z } from \"zod\";\nimport zodToCamelCase from \"zod-to-camel-case\";\n\nimport {\n  _stateSchema,\n  _cohortSchema,\n  newState,\n  publishedState,\n} from \"@/schema/public/components/base/base.schema\";\n\nexport const unitSchema = z.object({\n  unit_id: z.number(),\n  unit_uid: z.string(),\n  description: z.string().nullable(),\n  slug: z.string(),\n  tags: z.array(z.number()).nullable(),\n  deprecated_fields: z.record(z.string(), z.unknown()).nullish(),\n  title: z.string(),\n  subjectcategories: z.array(z.union([z.number(), z.string()])).nullable(),\n  prior_knowledge_requirements: z.array(z.string()).nullish(),\n  _state: _stateSchema,\n  _cohort: _cohortSchema,\n  expiration_date: z.string().nullable(),\n});\nexport type Unit = z.infer<typeof unitSchema>;\n\nexport const unitNewSchema = unitSchema\n  .pick({\n    unit_id: true,\n    unit_uid: true,\n    description: true,\n    tags: true,\n    deprecated_fields: true,\n    subjectcategories: true,\n    prior_knowledge_requirements: true,\n    _cohort: true,\n    expiration_date: true,\n  })\n  .extend({\n    _state: newState,\n  });\n\nexport const unitPublishedSchema = unitSchema.extend({\n  _state: publishedState,\n});\n\nexport type UnitNew = z.infer<typeof unitNewSchema>;\nexport type UnitPublished = z.infer<typeof unitPublishedSchema>;\n\nexport const unitSchemaCamel = zodToCamelCase(unitSchema);\nexport type UnitCamel = z.infer<typeof unitSchemaCamel>;\n\nexport const unitNewSchemaCamel = zodToCamelCase(unitNewSchema);\nexport type UnitNewCamel = z.infer<typeof unitNewSchemaCamel>;\n\nexport const unitPublishedSchemaCamel = zodToCamelCase(unitPublishedSchema);\nexport type UnitPublishedCamel = z.infer<typeof unitPublishedSchemaCamel>;\n"],"names":["unitSchema","z","object","unit_id","number","unit_uid","string","description","nullable","slug","tags","array","deprecated_fields","record","unknown","nullish","title","subjectcategories","union","prior_knowledge_requirements","_state","_stateSchema","_cohort","_cohortSchema","expiration_date","unitNewSchema","pick","extend","newState","unitPublishedSchema","publishedState","unitSchemaCamel","zodToCamelCase","unitNewSchemaCamel","unitPublishedSchemaCamel"],"mappings":"+KAUO,MAAMA,EAAaC,EAAAA,EAAEC,OAAO,CACjCC,QAASF,EAAAA,EAAEG,SACXC,SAAUJ,EAAAA,EAAEK,SACZC,YAAaN,EAAAA,EAAEK,SAASE,WACxBC,KAAMR,EAAAA,EAAEK,SACRI,KAAMT,EAAAA,EAAEU,MAAMV,EAAAA,EAAEG,UAAUI,WAC1BI,kBAAmBX,EAAAA,EAAEY,OAAOZ,IAAEK,SAAUL,IAAEa,WAAWC,UACrDC,MAAOf,EAAAA,EAAEK,SACTW,kBAAmBhB,EAAAA,EAAEU,MAAMV,EAAAA,EAAEiB,MAAM,CAACjB,EAAAA,EAAEG,SAAUH,EAAAA,EAAEK,YAAYE,WAC9DW,6BAA8BlB,EAAAA,EAAEU,MAAMV,EAAAA,EAAEK,UAAUS,UAClDK,OAAQC,EAAAA,aACRC,QAASC,EAAAA,cACTC,gBAAiBvB,EAAAA,EAAEK,SAASE,aAIjBiB,EAAgBzB,EAC1B0B,KAAK,CACJvB,SAAS,EACTE,UAAU,EACVE,aAAa,EACbG,MAAM,EACNE,mBAAmB,EACnBK,mBAAmB,EACnBE,8BAA8B,EAC9BG,SAAS,EACTE,iBAAiB,IAElBG,OAAO,CACNP,OAAQQ,EAAAA,WAGCC,EAAsB7B,EAAW2B,OAAO,CACnDP,OAAQU,EAAAA,iBAMGC,EAAkBC,EAAAA,QAAehC,GAGjCiC,EAAqBD,EAAAA,QAAeP,GAGpCS,EAA2BF,EAAAA,QAAeH"}