Skip to content

Commit

Permalink
Added pricingV2 option in CreateInspectionOptions
Browse files Browse the repository at this point in the history
  • Loading branch information
souyahia-monk committed Sep 17, 2024
1 parent 9b7e9f7 commit 7cac350
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions documentation/src/utils/schemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
1 change: 1 addition & 0 deletions packages/network/src/api/inspection/mappers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
"damage_severity": {
"output_format": "toyota"
},
"pricing": {
"output_format": "toyota"
},
"additional_data": {
"damage_detection_version": "v2",
"use_dynamic_crops": true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@ export default {
],
vehicleType: 'hatchback',
useDynamicCrops: true,
usePricingV2: true,
isVideoCapture: true,
};
6 changes: 6 additions & 0 deletions packages/types/src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down

0 comments on commit 7cac350

Please sign in to comment.