Skip to content

Commit

Permalink
doc: updated documentation for BulkShapeSchema
Browse files Browse the repository at this point in the history
  • Loading branch information
MacQSL committed Jul 31, 2024
1 parent fa304f7 commit 7c118f2
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/api/bulk/bulk.utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,12 @@ import { QualitativeCreateSchema, QuantitativeCreateSchema } from '../measuremen
const OptionalRecordArraySchema = z.array(z.record(z.string(), z.unknown())).optional();

/**
* Pre parse bulk create schema
* Bulk shape schema - pre-parse for BulkCreateSchema
*
* This validates the request body contains the correct properties (arrays of critter attributes)
* before parsing with BulkCreationSchema.
*
* Why? Makes patching the request body easier with defined properties existing. (critters: [], markings: [] etc)
*
*/
const BulkShapeSchema = z.object({
Expand All @@ -37,7 +42,7 @@ const BulkShapeSchema = z.object({
});

/**
* Bulk create schema - after parsed with BulkShapeSchema
* Bulk creation schema - after parsing with BulkShapeSchema
*
*/
const BulkCreationSchema = z.object({
Expand Down

0 comments on commit 7c118f2

Please sign in to comment.