diff --git a/documentation/src/utils/schemas.ts b/documentation/src/utils/schemas.ts index b64eda6f6..d9b126577 100644 --- a/documentation/src/utils/schemas.ts +++ b/documentation/src/utils/schemas.ts @@ -198,6 +198,7 @@ export const CreateInspectionOptionsSchema = z.object({ tasks: z.array(InspectionCreateTaskSchema), vehicleType: z.nativeEnum(VehicleType).optional(), useDynamicCrops: z.boolean().optional(), + usePricingV2: z.boolean().optional(), }); export const CreateInspectionDiscriminatedUnionSchema = z.discriminatedUnion( diff --git a/packages/network/src/api/inspection/mappers.ts b/packages/network/src/api/inspection/mappers.ts index 87356a5a7..c8c1c48a1 100644 --- a/packages/network/src/api/inspection/mappers.ts +++ b/packages/network/src/api/inspection/mappers.ts @@ -495,6 +495,7 @@ export function mapApiInspectionPost(options: CreateInspectionOptions): ApiInspe tasks: getTasksOptions(options), vehicle: options.vehicleType ? { vehicle_type: options.vehicleType } : undefined, damage_severity: { output_format: 'toyota' }, + pricing: options.useDynamicCrops ? { output_format: 'toyota' } : undefined, additional_data: { user_agent: navigator.userAgent, connection: navigator.connection, diff --git a/packages/network/test/api/inspection/data/apiInspectionPost.data.json b/packages/network/test/api/inspection/data/apiInspectionPost.data.json index 1c38ae0e6..bb244d084 100644 --- a/packages/network/test/api/inspection/data/apiInspectionPost.data.json +++ b/packages/network/test/api/inspection/data/apiInspectionPost.data.json @@ -22,6 +22,9 @@ "damage_severity": { "output_format": "toyota" }, + "pricing": { + "output_format": "toyota" + }, "additional_data": { "damage_detection_version": "v2", "use_dynamic_crops": true, diff --git a/packages/network/test/api/inspection/data/apiInspectionPost.data.ts b/packages/network/test/api/inspection/data/apiInspectionPost.data.ts index 12e6f135e..ba7a394bf 100644 --- a/packages/network/test/api/inspection/data/apiInspectionPost.data.ts +++ b/packages/network/test/api/inspection/data/apiInspectionPost.data.ts @@ -13,5 +13,6 @@ export default { ], vehicleType: 'hatchback', useDynamicCrops: true, + usePricingV2: true, isVideoCapture: true, }; diff --git a/packages/types/src/api.ts b/packages/types/src/api.ts index f2c228fdb..46cd8ab14 100644 --- a/packages/types/src/api.ts +++ b/packages/types/src/api.ts @@ -126,6 +126,12 @@ export interface CreateInspectionOptions { * @default true */ useDynamicCrops?: boolean; + /** + * Boolean indicating if the pricing V2 (format Toyota) should be enabled or not. + * + * @default false + */ + usePricingV2?: boolean; /** * Boolean indicating if the inspection to create will be used with the VideoCapture workflow or not. *