Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added option to disabled Pricing V1 #871

Merged
merged 1 commit into from
Nov 14, 2024
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
2 changes: 2 additions & 0 deletions documentation/src/utils/schemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ export const CreateHinlTaskOptionsSchema = z.object({
export const CreatePricingTaskOptionsSchema = z.object({
name: z.literal(TaskName.PRICING),
outputFormat: z.nativeEnum(BusinessClients).optional(),
config: z.string().optional(),
});

export const InspectionCreateTaskSchema = z
Expand Down Expand Up @@ -232,6 +233,7 @@ export const CreateInspectionOptionsSchema = z.object({
tasks: z.array(InspectionCreateTaskSchema),
vehicle: InspectionCreateVehicleSchema.optional(),
useDynamicCrops: z.boolean().optional(),
enablePricingV1: z.boolean().optional(),
additionalData: AdditionalDataSchema.optional(),
});

Expand Down
2 changes: 1 addition & 1 deletion packages/network/src/api/inspection/mappers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,7 @@ export function mapApiInspectionPost(options: CreateInspectionOptions): ApiInspe
additional_data: options.vehicle.additionalData,
}
: undefined,
damage_severity: { output_format: 'toyota' },
damage_severity: options.enablePricingV1 === false ? undefined : { output_format: 'toyota' },
additional_data: {
user_agent: navigator.userAgent,
connection: navigator.connection,
Expand Down
6 changes: 6 additions & 0 deletions packages/types/src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,12 @@ export interface CreateInspectionOptions {
* @default true
*/
useDynamicCrops?: boolean;
/**
* Boolean indicating if the Pricing V1 (damage severity) feature should be enabled or not.
*
* @default true
*/
enablePricingV1?: boolean;
/**
* Boolean indicating if the inspection to create will be used with the VideoCapture workflow or not.
*
Expand Down