Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/schemas/ingestion/job.schema.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import z from 'zod';
import { CORE_VALIDATIONS } from '../../constants';
import { CORE_VALIDATIONS, JobTypes } from '../../constants';
import { urlsArraySchema } from '../core';
import { newAdditionalParamsSchema, swapUpdateAdditionalParamsSchema, updateAdditionalParamsSchema } from './additionalParams.schema';
import { inputFilesSchema } from './inputFiles.schema';
import { newRasterLayerMetadataSchema, updateRasterLayerMetadataSchema } from './metadata.schema';

export const ingestionJobTypeSchema = z.enum([JobTypes.Ingestion_New, JobTypes.Ingestion_Swap_Update, JobTypes.Ingestion_Update]);

export const ingestionResolutionSchema = z
.number({ message: 'Resolution degree should be a number' })
.min(CORE_VALIDATIONS.resolutionDeg.min, {
Expand Down
3 changes: 2 additions & 1 deletion src/schemas/ingestion/polygonParts.schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
resourceIdSchema,
versionSchema,
} from '../core';
import { ingestionJobTypeSchema } from './job.schema';
import { polygonPartsEntityPatternSchema } from './layerNameFormats.schema';

export const partSchema = z
Expand Down Expand Up @@ -89,7 +90,7 @@ export const polygonPartsFeatureSchema = featureSchema(polygonSchema.or(multiPol
export const polygonPartsFeatureCollectionSchema = featureCollectionSchema(polygonPartsFeatureSchema);

export const polygonPartsPayloadSchema = z.object({
jobType: z.string(),
jobType: ingestionJobTypeSchema,
productType: rasterProductTypeSchema,
catalogId: z.string().uuid({ message: 'Catalog ID should be a valid UUID' }),
productId: resourceIdSchema,
Expand Down
9 changes: 8 additions & 1 deletion src/types/ingestion/job.type.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
import { z } from 'zod';
import { ingestionNewJobParamsSchema, ingestionSwapUpdateJobParamsSchema, ingestionUpdateJobParamsSchema } from '../../schemas';
import {
ingestionNewJobParamsSchema,
ingestionSwapUpdateJobParamsSchema,
ingestionUpdateJobParamsSchema,
type ingestionJobTypeSchema,
} from '../../schemas';

//#region IngestionJobParams
export type IngestionNewJobParams = z.infer<typeof ingestionNewJobParamsSchema>;
export type IngestionUpdateJobParams = z.infer<typeof ingestionUpdateJobParamsSchema>;
export type IngestionSwapUpdateJobParams = z.infer<typeof ingestionSwapUpdateJobParamsSchema>;
//#endregion

export type IngestionJobType = z.infer<typeof ingestionJobTypeSchema>;
Loading