1- import { replacer , reviver , yearsPassed } from '@douglasneuroinformatics/libjs' ;
1+ import { isZodType , replacer , reviver , yearsPassed } from '@douglasneuroinformatics/libjs' ;
22import { accessibleQuery , InjectModel } from '@douglasneuroinformatics/libnest' ;
33import type { Model } from '@douglasneuroinformatics/libnest' ;
44import { linearRegression } from '@douglasneuroinformatics/libstats' ;
@@ -17,6 +17,7 @@ import { Prisma } from '@prisma/client';
1717import type { $Enums , Session } from '@prisma/client' ;
1818import { isNumber , mergeWith , pickBy } from 'lodash-es' ;
1919import { err , ok } from 'neverthrow' ;
20+ import z from 'zod/v4' ;
2021
2122import type { EntityOperationOptions } from '@/core/types' ;
2223import { GroupsService } from '@/groups/groups.service' ;
@@ -131,7 +132,7 @@ export class InstrumentRecordsService {
131132 }
132133
133134 //TODO
134- // Chech if instrument schema is zod4 version, if so use the toJSONSchema method to convert to json
135+ // Check if instrument schema is zod4 version, if so use the toJSONSchema method to convert to json
135136 // and expand the data from there
136137 async exportRecords ( { groupId } : { groupId ?: string } = { } , { ability } : EntityOperationOptions = { } ) {
137138 const data : InstrumentRecordsExport = [ ] ;
@@ -169,6 +170,11 @@ export class InstrumentRecordsService {
169170 instruments . set ( record . instrumentId , instrument ) ;
170171 }
171172
173+ // if (isZodType(instrument.validationSchema, { version: 4})) {
174+ // const zodToJson = z.toJSONSchema(instrument.validationSchema)
175+
176+ // }
177+
172178 for ( const [ measureKey , measureValue ] of Object . entries ( record . computedMeasures ) ) {
173179 let list ;
174180 try {
0 commit comments