karrio-server-graph 2025.5.7__py3-none-any.whl → 2026.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -599,6 +599,10 @@ class SharedZoneInput(utils.BaseInput):
599
599
  radius: typing.Optional[float] = strawberry.UNSET
600
600
  latitude: typing.Optional[float] = strawberry.UNSET
601
601
  longitude: typing.Optional[float] = strawberry.UNSET
602
+ # Weight constraints for this zone
603
+ min_weight: typing.Optional[float] = strawberry.UNSET
604
+ max_weight: typing.Optional[float] = strawberry.UNSET
605
+ weight_unit: typing.Optional[utils.WeightUnitEnum] = strawberry.UNSET
602
606
 
603
607
 
604
608
  @strawberry.input
@@ -1172,6 +1172,11 @@ class SharedZoneType:
1172
1172
  postal_codes: typing.Optional[typing.List[str]] = None
1173
1173
  country_codes: typing.Optional[typing.List[str]] = None
1174
1174
 
1175
+ # Weight constraints for this zone
1176
+ min_weight: typing.Optional[float] = None
1177
+ max_weight: typing.Optional[float] = None
1178
+ weight_unit: typing.Optional[utils.WeightUnitEnum] = None
1179
+
1175
1180
  @staticmethod
1176
1181
  def parse(zone: dict):
1177
1182
  return SharedZoneType(
@@ -1186,6 +1191,9 @@ class SharedZoneType:
1186
1191
  cities=zone.get("cities"),
1187
1192
  postal_codes=zone.get("postal_codes"),
1188
1193
  country_codes=zone.get("country_codes"),
1194
+ min_weight=zone.get("min_weight"),
1195
+ max_weight=zone.get("max_weight"),
1196
+ weight_unit=zone.get("weight_unit"),
1189
1197
  )
1190
1198
 
1191
1199
 
@@ -88,6 +88,9 @@ class TestRateSheets(GraphTestCase):
88
88
  label
89
89
  cities
90
90
  country_codes
91
+ min_weight
92
+ max_weight
93
+ weight_unit
91
94
  }
92
95
  surcharges {
93
96
  id
@@ -121,9 +124,10 @@ class TestRateSheets(GraphTestCase):
121
124
  )
122
125
  response_data = response.data
123
126
 
127
+ print(response) # Debug print as per AGENTS.md guidelines
124
128
  self.assertResponseNoErrors(response)
125
129
  self.assertDictEqual(
126
- lib.to_dict(response_data),
130
+ lib.to_dict(response_data, clear_empty=False),
127
131
  RATE_SHEETS_RESPONSE,
128
132
  )
129
133
 
@@ -544,6 +548,88 @@ class TestRateSheetZones(GraphTestCase):
544
548
  self.assertEqual(new_zone["transit_days"], 3)
545
549
  self.assertEqual(new_zone["radius"], 100.0)
546
550
 
551
+ def test_add_shared_zone_with_weight_limits(self):
552
+ """Test adding a zone with weight limits."""
553
+ response = self.query(
554
+ """
555
+ mutation add_zone($data: AddSharedZoneMutationInput!) {
556
+ add_shared_zone(input: $data) {
557
+ rate_sheet {
558
+ id
559
+ zones {
560
+ id
561
+ label
562
+ country_codes
563
+ min_weight
564
+ max_weight
565
+ weight_unit
566
+ }
567
+ }
568
+ }
569
+ }
570
+ """,
571
+ operation_name="add_zone",
572
+ variables={
573
+ "data": {
574
+ "rate_sheet_id": self.rate_sheet.id,
575
+ "zone": {
576
+ "label": "Weight Limited Zone",
577
+ "country_codes": ["US"],
578
+ "min_weight": 0.0,
579
+ "max_weight": 30.0,
580
+ "weight_unit": "KG",
581
+ },
582
+ },
583
+ },
584
+ )
585
+
586
+ self.assertResponseNoErrors(response)
587
+ zones = response.data["data"]["add_shared_zone"]["rate_sheet"]["zones"]
588
+ new_zone = zones[-1]
589
+ self.assertEqual(new_zone["label"], "Weight Limited Zone")
590
+ self.assertEqual(new_zone["min_weight"], 0.0)
591
+ self.assertEqual(new_zone["max_weight"], 30.0)
592
+ self.assertEqual(new_zone["weight_unit"], "KG")
593
+
594
+ def test_update_shared_zone_weight_limits(self):
595
+ """Test updating a zone's weight limits."""
596
+ response = self.query(
597
+ """
598
+ mutation update_zone($data: UpdateSharedZoneMutationInput!) {
599
+ update_shared_zone(input: $data) {
600
+ rate_sheet {
601
+ zones {
602
+ id
603
+ label
604
+ min_weight
605
+ max_weight
606
+ weight_unit
607
+ }
608
+ }
609
+ }
610
+ }
611
+ """,
612
+ operation_name="update_zone",
613
+ variables={
614
+ "data": {
615
+ "rate_sheet_id": self.rate_sheet.id,
616
+ "zone_id": "zone_1",
617
+ "zone": {
618
+ "label": "Zone 1",
619
+ "min_weight": 0.5,
620
+ "max_weight": 20.0,
621
+ "weight_unit": "LB",
622
+ },
623
+ },
624
+ },
625
+ )
626
+
627
+ self.assertResponseNoErrors(response)
628
+ zone = response.data["data"]["update_shared_zone"]["rate_sheet"]["zones"][0]
629
+ self.assertEqual(zone["min_weight"], 0.5)
630
+ self.assertEqual(zone["max_weight"], 20.0)
631
+ self.assertEqual(zone["weight_unit"], "LB")
632
+
547
633
  def test_add_multiple_zones_sequentially(self):
548
634
  """Test adding multiple zones one after another."""
549
635
  for i in range(2, 5):
@@ -1915,6 +2001,9 @@ RATE_SHEETS_RESPONSE = {
1915
2001
  "label": "Zone 1",
1916
2002
  "cities": ["New York", "Los Angeles"],
1917
2003
  "country_codes": ["US"],
2004
+ "min_weight": None,
2005
+ "max_weight": None,
2006
+ "weight_unit": None,
1918
2007
  }
1919
2008
  ],
1920
2009
  "surcharges": [
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: karrio_server_graph
3
- Version: 2025.5.7
3
+ Version: 2026.1
4
4
  Summary: Multi-carrier shipping API Graph module
5
5
  Author-email: karrio <hello@karrio.io>
6
6
  License-Expression: LGPL-3.0
@@ -16,9 +16,9 @@ karrio/server/graph/migrations/0002_auto_20210512_1353.py,sha256=TnUwR9EP0qp3gJ3
16
16
  karrio/server/graph/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
17
17
  karrio/server/graph/schemas/__init__.py,sha256=Kn-I1j3HP3jwZccpz6FL9r1k6b3UEAMVh2kFPCKNS0w,80
18
18
  karrio/server/graph/schemas/base/__init__.py,sha256=ewLY8IpjYtQPYEVkYcrujR-EchAcTNKIV04be_mNjzQ,19026
19
- karrio/server/graph/schemas/base/inputs.py,sha256=9E6OqUE7JSkRmaaD2uSPI8BZdFnar89-X_S19SIDqkc,27128
19
+ karrio/server/graph/schemas/base/inputs.py,sha256=dARizKIHp5UFqmWjtPn9_s5TqO2xgrz9XB7eIe03bsg,27357
20
20
  karrio/server/graph/schemas/base/mutations.py,sha256=sWwUb64DkxnWL9k-tOu1uAC65yyB4IJGryraOssMqz4,41284
21
- karrio/server/graph/schemas/base/types.py,sha256=vyZeiJUGBCxeAAs903CT5bhQMm46gW5aS-3CEbXWveE,53162
21
+ karrio/server/graph/schemas/base/types.py,sha256=wbB_fUIBwh0ZHiwKVMNbjfpijT1YZdthIHMwbVKiBL4,53499
22
22
  karrio/server/graph/templates/graphql/graphiql.html,sha256=MQjQbBqoRE0QLsOUck8SaXo6B2oJO8dT6YZzUqbDan0,3786
23
23
  karrio/server/graph/templates/karrio/email_change_email.html,sha256=gr55F97GYzY27TVKGl49037yd60eSYD0b0GXRlyoco4,552
24
24
  karrio/server/graph/templates/karrio/email_change_email.txt,sha256=NXXuzLR63hn2F1fVAjzmuguptuuTvujwqI7YLSrQoio,431
@@ -28,12 +28,12 @@ karrio/server/graph/tests/base.py,sha256=dzLiva3eTAsbBM5Ga8SI2fxSanBQgAqswS0YVdt
28
28
  karrio/server/graph/tests/test_carrier_connections.py,sha256=qZ1OL8CgZrHuluKJd7cjFXaRZ0VpogN5Srjk2EApLWU,6892
29
29
  karrio/server/graph/tests/test_metafield.py,sha256=K7Oon0CLEm_MUMbmcu0t2iAZvFN8Wl7Kp4QAWeUXo_Y,12783
30
30
  karrio/server/graph/tests/test_partial_shipments.py,sha256=dPIdIq4wiyovOaIIzbIX69eZnBqCA4ZvBSiGKYADM2g,19031
31
- karrio/server/graph/tests/test_rate_sheets.py,sha256=-fhAYSjw4HPD5jlp7QkSfVPxUic3Eeiph1S1QKff-18,71063
31
+ karrio/server/graph/tests/test_rate_sheets.py,sha256=m-UR9vpfUrQ_bB-c9ZMk6Q_9LsdRlIq-Q3DfhBO-CQs,74188
32
32
  karrio/server/graph/tests/test_registration.py,sha256=0vCTqlsLc0cl2m78umgfm7grnDgTI_NZJWNUrRUlQBY,7107
33
33
  karrio/server/graph/tests/test_templates.py,sha256=WVU6vcfr6tEk917uSn1dECU8bkQtgD7FNuE-GJuFido,21626
34
34
  karrio/server/graph/tests/test_user_info.py,sha256=K91BL7SgxLWflCZriSVI8Vt5M5RIqmSCHKrgN2w8GmM,1928
35
35
  karrio/server/settings/graph.py,sha256=cz2yQHbp3xCfyFKuUkPEFfkI2fFVggExIY49wGz7mt0,106
36
- karrio_server_graph-2025.5.7.dist-info/METADATA,sha256=oBo7iZ6r92PqDFm2yF29MvDaR4gczryRuvSy1hHjctA,740
37
- karrio_server_graph-2025.5.7.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
38
- karrio_server_graph-2025.5.7.dist-info/top_level.txt,sha256=D1D7x8R3cTfjF_15mfiO7wCQ5QMtuM4x8GaPr7z5i78,12
39
- karrio_server_graph-2025.5.7.dist-info/RECORD,,
36
+ karrio_server_graph-2026.1.dist-info/METADATA,sha256=SmRJX9g2w3Yk02JUWnfvctsPHnsp-5wr8sIly0ijh7g,738
37
+ karrio_server_graph-2026.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
38
+ karrio_server_graph-2026.1.dist-info/top_level.txt,sha256=D1D7x8R3cTfjF_15mfiO7wCQ5QMtuM4x8GaPr7z5i78,12
39
+ karrio_server_graph-2026.1.dist-info/RECORD,,