Skip to content

Commit 29dfbc1

Browse files
authored
Merge pull request #18 from shipday/multi-pod
On demand pod_types added
2 parents ebacf70 + c0f3cd0 commit 29dfbc1

4 files changed

Lines changed: 14 additions & 3 deletions

File tree

shipday/bo/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from shipday.bo.pod_type import PodType

shipday/bo/pod_type.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
from enum import Enum
2+
3+
class PodType(Enum):
4+
PHOTO = "PHOTO"
5+
SIGNATURE = "SIGNATURE"
6+
PIN = "PIN"
7+
NONE = "NONE"

shipday/services/on_demand_delivery_service.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from shipday.bo import PodType
12
from shipday.utils.verifiers import verify_instance_of, verify_none_or_instance_of
23
from shipday.exeptions.shipday_exeption import ShipdayException
34
from shipday.httpclient.shipdayclient import ShipdayClient
@@ -58,7 +59,7 @@ def check_availability(self, *args, pickup_address: Address, delivery_address: A
5859
res = self.httpclient.post(self.AVAILABILITY_PATH, data)
5960
return res
6061

61-
def assign(self, *args, order_id:int, service_name: str, tip: float = 0, estimate_reference=None, **kwargs) -> dict:
62+
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:
6263
verify_instance_of(int, order_id, 'Order id must be integer')
6364
verify_instance_of([int, float], tip, 'Tip must be a number')
6465
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
6869
data = {
6970
'name': service_name,
7071
'orderId': order_id,
71-
'tip': tip
72+
'tip': tip,
73+
'contactlessDelivery': contactless_delivery,
74+
'podTypes': [pod.value for pod in pod_types] if pod_types is not None else None
7275
}
7376
if estimate_reference is not None:
7477
data['estimateReference'] = estimate_reference

shipday/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
VERSION = '1.4.3'
1+
VERSION = '1.4.4'

0 commit comments

Comments
 (0)