Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions shipday/bo/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from shipday.bo.pod_type import PodType
7 changes: 7 additions & 0 deletions shipday/bo/pod_type.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from enum import Enum

class PodType(Enum):
PHOTO = "PHOTO"
SIGNATURE = "SIGNATURE"
PIN = "PIN"
NONE = "NONE"
7 changes: 5 additions & 2 deletions shipday/services/on_demand_delivery_service.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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')
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion shipday/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
VERSION = '1.4.3'
VERSION = '1.4.4'
Loading