@@ -68,9 +68,13 @@ class Card(NetworkModel):
6868 # unit="LTR", available_count=29.2, package_quantity=0.5, package_unit="LTR"
6969 unit : Literal ["PCE" , "KGM" , "LTR" ] | None = None
7070 available_count : int | float | None = None
71- package_quantity : float | None = None
71+ package_quantity_net : float | None = None
72+ """Кол-во в нетто"""
73+ package_quantity_gross : float | None = None
74+ """Кол-во в брутто"""
7275 package_unit : Literal ["KGM" , "LTR" ] | None = None
7376
77+ # All in meters
7478 dimension_height : float | None = None
7579 dimension_width : float | None = None
7680 dimension_depth : float | None = None
@@ -88,8 +92,12 @@ def validate_business_rules(self) -> Card:
8892
8993 if is_piece_unit and has_count and not count_is_int :
9094 raise ValueError ("For unit='PCE', available_count must be int." )
91- if (self .package_quantity is None ) != (self .package_unit is None ):
95+ if (self .package_quantity_net is None ) != (self .package_unit is None ):
9296 raise ValueError (
93- "package_quantity and package_unit must be set together or both set to None."
97+ "package_quantity_net and package_unit must be set together or both set to None."
98+ )
99+ if (self .package_quantity_gross is None ) != (self .package_unit is None ):
100+ raise ValueError (
101+ "package_quantity_gross and package_unit must be set together or both set to None."
94102 )
95103 return self
0 commit comments