diff --git a/shipday/bo/__init__.py b/shipday/bo/__init__.py new file mode 100644 index 0000000..c55806a --- /dev/null +++ b/shipday/bo/__init__.py @@ -0,0 +1 @@ +from shipday.bo.pod_type import PodType \ No newline at end of file diff --git a/shipday/bo/pod_type.py b/shipday/bo/pod_type.py new file mode 100644 index 0000000..65f5c90 --- /dev/null +++ b/shipday/bo/pod_type.py @@ -0,0 +1,7 @@ +from enum import Enum + +class PodType(Enum): + PHOTO = "PHOTO" + SIGNATURE = "SIGNATURE" + PIN = "PIN" + NONE = "NONE" diff --git a/shipday/services/on_demand_delivery_service.py b/shipday/services/on_demand_delivery_service.py index c88abbd..44147c2 100644 --- a/shipday/services/on_demand_delivery_service.py +++ b/shipday/services/on_demand_delivery_service.py @@ -1,3 +1,4 @@ +from shipday.bo import PodType from shipday.utils.verifiers import verify_instance_of, verify_none_or_instance_of from shipday.exeptions.shipday_exeption import ShipdayException from shipday.httpclient.shipdayclient import ShipdayClient @@ -58,7 +59,7 @@ def check_availability(self, *args, pickup_address: Address, delivery_address: A res = self.httpclient.post(self.AVAILABILITY_PATH, data) return res - def assign(self, *args, order_id:int, service_name: str, tip: float = 0, estimate_reference=None, **kwargs) -> dict: + def assign(self, *args, order_id:int, service_name: str, tip: float = 0, estimate_reference=None, contactless_delivery: bool = False, pod_types: list[PodType] = None, **kwargs) -> dict: verify_instance_of(int, order_id, 'Order id must be integer') verify_instance_of([int, float], tip, 'Tip must be a number') verify_none_or_instance_of(str, estimate_reference, 'Invalid Reference') @@ -68,7 +69,9 @@ def assign(self, *args, order_id:int, service_name: str, tip: float = 0, estimat data = { 'name': service_name, 'orderId': order_id, - 'tip': tip + 'tip': tip, + 'contactlessDelivery': contactless_delivery, + 'podTypes': [pod.value for pod in pod_types] if pod_types is not None else None } if estimate_reference is not None: data['estimateReference'] = estimate_reference diff --git a/shipday/version.py b/shipday/version.py index 1df6d5c..792e32f 100644 --- a/shipday/version.py +++ b/shipday/version.py @@ -1 +1 @@ -VERSION = '1.4.3' +VERSION = '1.4.4'