Skip to content

Commit b43c421

Browse files
Added pricingV2 option in CreateInspectionOptions (#848)
1 parent c1f7869 commit b43c421

File tree

5 files changed

+12
-0
lines changed

5 files changed

+12
-0
lines changed

documentation/src/utils/schemas.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ export const CreateInspectionOptionsSchema = z.object({
198198
tasks: z.array(InspectionCreateTaskSchema),
199199
vehicleType: z.nativeEnum(VehicleType).optional(),
200200
useDynamicCrops: z.boolean().optional(),
201+
usePricingV2: z.boolean().optional(),
201202
});
202203

203204
export const CreateInspectionDiscriminatedUnionSchema = z.discriminatedUnion(

packages/network/src/api/inspection/mappers.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -495,6 +495,7 @@ export function mapApiInspectionPost(options: CreateInspectionOptions): ApiInspe
495495
tasks: getTasksOptions(options),
496496
vehicle: options.vehicleType ? { vehicle_type: options.vehicleType } : undefined,
497497
damage_severity: { output_format: 'toyota' },
498+
pricing: options.useDynamicCrops ? { output_format: 'toyota' } : undefined,
498499
additional_data: {
499500
user_agent: navigator.userAgent,
500501
connection: navigator.connection,

packages/network/test/api/inspection/data/apiInspectionPost.data.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@
2222
"damage_severity": {
2323
"output_format": "toyota"
2424
},
25+
"pricing": {
26+
"output_format": "toyota"
27+
},
2528
"additional_data": {
2629
"damage_detection_version": "v2",
2730
"use_dynamic_crops": true,

packages/network/test/api/inspection/data/apiInspectionPost.data.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,6 @@ export default {
1313
],
1414
vehicleType: 'hatchback',
1515
useDynamicCrops: true,
16+
usePricingV2: true,
1617
isVideoCapture: true,
1718
};

packages/types/src/api.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,12 @@ export interface CreateInspectionOptions {
126126
* @default true
127127
*/
128128
useDynamicCrops?: boolean;
129+
/**
130+
* Boolean indicating if the pricing V2 (format Toyota) should be enabled or not.
131+
*
132+
* @default false
133+
*/
134+
usePricingV2?: boolean;
129135
/**
130136
* Boolean indicating if the inspection to create will be used with the VideoCapture workflow or not.
131137
*

0 commit comments

Comments
 (0)