Skip to content

Commit

Permalink
Merge pull request #39 from huntario/PSE-696
Browse files Browse the repository at this point in the history
fix: PSE-696 / GH Issue #38 an unknown value was passed
  • Loading branch information
huntario authored Jul 6, 2023
2 parents bcb0249 + f416312 commit 5937878
Showing 1 changed file with 21 additions and 5 deletions.
26 changes: 21 additions & 5 deletions shared/payloads/product/VariantPayload.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import SubscriptionConfigPayload from "../subscription/SubscriptionConfigPayload";
import { ValidateIf } from "class-validator";

interface VariantOptionPayload {
id: number;
Expand All @@ -11,17 +12,32 @@ export default class VariantPayload {
product_id: number;
sku: string;
sku_id: number;
price: number;
@ValidateIf((_object, value) => value !== null)
price: number | null;
calculated_price: number;
@ValidateIf((_object, value) => value !== null)
sale_price: number | null;
@ValidateIf((_object, value) => value !== null)
retail_price: number | null;
@ValidateIf((_object, value) => value !== null)
map_price: number | null;
width: number;
calculated_weight: number;
weight: number;
height: number;
depth: number;
image_url: string;
cost_price: number;
inventory_level: number;
inventory_warning_level: number;
bin_picking_number: string;
option_values: VariantOptionPayload[];
sub_config?: SubscriptionConfigPayload;
height: number;
depth: number;
weight: number;
width: number;
@ValidateIf((_object, value) => value !== null)
fixed_cost_shipping_price: number | null;
purchasing_disabled: boolean;
purchasing_disabled_message: string;
upc: string;
mpn: string;
gtin: string;
}

0 comments on commit 5937878

Please sign in to comment.