Skip to content

Commit

Permalink
Merge pull request #468 from karrioapi/fix-allied-express-missing-def…
Browse files Browse the repository at this point in the history
…aults

fix: allied_express extension required defaults
  • Loading branch information
danh91 authored Dec 18, 2023
2 parents 5c15bdc + 602cfa7 commit 3f4cfa0
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,9 @@ def rate_request(
for pkg in packages
],
jobStopsP=allied.JobStopsType(
companyName=shipper.company_name,
companyName=(shipper.company_name or shipper.contact),
contact=shipper.contact,
emailAddress=shipper.email,
emailAddress=shipper.email or " ",
geographicAddress=allied.GeographicAddressType(
address1=shipper.address_line1,
address2=shipper.address_line2 or " ",
Expand All @@ -104,12 +104,12 @@ def rate_request(
state=shipper.state_code,
suburb=shipper.city,
),
phoneNumber=shipper.phone_number,
phoneNumber=shipper.phone_number or "(00) 0000 0000",
),
jobStopsD=allied.JobStopsType(
companyName=recipient.company_name,
companyName=(recipient.company_name or recipient.contact),
contact=recipient.contact,
emailAddress=recipient.email,
emailAddress=recipient.email or " ",
geographicAddress=allied.GeographicAddressType(
address1=recipient.address_line1,
address2=recipient.address_line2 or " ",
Expand All @@ -118,7 +118,7 @@ def rate_request(
state=recipient.state_code,
suburb=recipient.city,
),
phoneNumber=recipient.phone_number,
phoneNumber=recipient.phone_number or "(00) 0000 0000",
),
referenceNumbers=([payload.reference] if any(payload.reference or "") else []),
serviceLevel=(service.value if service else "R"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,9 @@ def shipment_request(
for pkg in packages
],
jobStopsP=allied.JobStopsType(
companyName=shipper.company_name,
companyName=(shipper.company_name or shipper.contact),
contact=shipper.contact,
emailAddress=shipper.email,
emailAddress=shipper.email or " ",
geographicAddress=allied.GeographicAddressType(
address1=shipper.address_line1,
address2=shipper.address_line2 or " ",
Expand All @@ -95,12 +95,12 @@ def shipment_request(
state=shipper.state_code,
suburb=shipper.city,
),
phoneNumber=shipper.phone_number,
phoneNumber=shipper.phone_number or "(00) 0000 0000",
),
jobStopsD=allied.JobStopsType(
companyName=recipient.company_name,
companyName=(recipient.company_name or recipient.contact),
contact=recipient.contact,
emailAddress=recipient.email,
emailAddress=recipient.email or " ",
geographicAddress=allied.GeographicAddressType(
address1=recipient.address_line1,
address2=recipient.address_line2 or " ",
Expand All @@ -109,7 +109,7 @@ def shipment_request(
state=recipient.state_code,
suburb=recipient.city,
),
phoneNumber=recipient.phone_number,
phoneNumber=recipient.phone_number or "(00) 0000 0000",
),
referenceNumbers=([payload.reference] if any(payload.reference or "") else []),
weight=packages.weight.KG,
Expand Down
3 changes: 1 addition & 2 deletions modules/connectors/allied_express/setup.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

"""Warning: This setup.py is only there for git install until poetry support git subdirectory"""
from setuptools import setup, find_namespace_packages

Expand All @@ -7,7 +6,7 @@

setup(
name="karrio.allied_express",
version="2023.12",
version="2023.12.1",
description="Karrio - Allied Express Shipping Extension",
long_description=long_description,
long_description_content_type="text/markdown",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ def test_parse_error_response(self):
"state": "WA",
"suburb": "CANNING VALE",
},
"phoneNumber": "(00) 0000 0000",
},
"jobStops_P": {
"companyName": "TESTING COMPANY",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ def test_parse_error_response(self):
"state": "WA",
"suburb": "CANNING VALE",
},
"phoneNumber": "(00) 0000 0000",
},
"jobStops_P": {
"companyName": "TESTING COMPANY",
Expand Down

0 comments on commit 3f4cfa0

Please sign in to comment.