Skip to content

Commit

Permalink
fix(fedex): Signature option type
Browse files Browse the repository at this point in the history
  • Loading branch information
danh91 committed Mar 28, 2024
1 parent 4b9c65c commit 012fd16
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,7 @@ def shipment_request(
units=package.weight.unit,
value=package.weight.value,
),
dimensions=(
dimensions=lib.identity(
fedex.DimensionsType(
length=package.length.value,
width=package.width.value,
Expand Down Expand Up @@ -584,7 +584,9 @@ def shipment_request(
],
priorityAlertDetail=None,
signatureOptionType=(
package.options.fedex_signature_option.state
provider_units.SignatureOptionType.map(
package.options.fedex_signature_option.state
).value
or "SERVICE_DEFAULT"
),
signatureOptionDetail=None,
Expand Down
10 changes: 9 additions & 1 deletion modules/connectors/fedex/karrio/providers/fedex/units.py
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ class ShippingOption(lib.Enum):
fedex_priority_alert_plus = lib.OptionEnum("PRIORITY_ALERT_PLUS", bool)
fedex_non_standard_container = lib.OptionEnum("NON_STANDARD_CONTAINER", bool)
fedex_piece_count_verification = lib.OptionEnum("PIECE_COUNT_VERIFICATION", bool)
fedex_signature_option = lib.OptionEnum("SIGNATURE_OPTION", bool)
fedex_signature_option = lib.OptionEnum("SIGNATURE_OPTION")
fedex_evening = lib.OptionEnum("EVENING", bool)
fedex_date_certain = lib.OptionEnum("DATE_CERTAIN", bool)

Expand Down Expand Up @@ -453,6 +453,14 @@ class RateType(lib.Enum):
preferred_list_shipment = "PREFERRED_LIST_SHIPMENT"


class SignatureOptionType(lib.Enum):
adult = "ADULT"
direct = "DIRECT"
indirect = "INDIRECT"
no_signature_required = "NO_SIGNATURE_REQUIRED"
service_default = "SERVICE_DEFAULT"


class UploadDocumentType(lib.Enum):
fedex_usmca_commercial_invoice_certification_of_origin = (
"USMCA_COMMERCIAL_INVOICE_CERTIFICATION_OF_ORIGIN"
Expand Down
6 changes: 3 additions & 3 deletions modules/connectors/fedex/tests/fedex/test_shipment.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ def test_parse_cancel_shipment_response(self):
"width": 12.0,
},
"packageSpecialServices": {
"signatureOptionType": True,
"signatureOptionType": "SERVICE_DEFAULT",
"specialServiceTypes": ["SIGNATURE_OPTION"],
},
"sequenceNumber": 1,
Expand Down Expand Up @@ -450,7 +450,7 @@ def test_parse_cancel_shipment_response(self):
"width": 12.0,
},
"packageSpecialServices": {
"signatureOptionType": True,
"signatureOptionType": "SERVICE_DEFAULT",
"specialServiceTypes": ["SIGNATURE_OPTION"],
},
"sequenceNumber": 1,
Expand Down Expand Up @@ -610,7 +610,7 @@ def test_parse_cancel_shipment_response(self):
"width": 11.0,
},
"packageSpecialServices": {
"signatureOptionType": True,
"signatureOptionType": "SERVICE_DEFAULT",
"specialServiceTypes": ["SIGNATURE_OPTION"],
},
"sequenceNumber": 2,
Expand Down

0 comments on commit 012fd16

Please sign in to comment.