Skip to content

Commit

Permalink
fix: use current date for group_id to ensure all end of day manifest …
Browse files Browse the repository at this point in the history
…are bundle into a single group
  • Loading branch information
danh91 committed Sep 11, 2024
1 parent 5af99fd commit 3ae1bf9
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import karrio.schemas.canadapost.shipment as canadapost
import uuid
import typing
import datetime
import karrio.lib as lib
import karrio.core.units as units
import karrio.core.models as models
Expand Down Expand Up @@ -89,8 +90,8 @@ def shipment_request(
label_encoding, label_format = provider_units.LabelType.map(
payload.label_type or "PDF_4x6"
).value
group_id = str(uuid.uuid4().hex)
customer_request_ids = [f"{group_id}" for _ in range(len(packages))]
group_id = lib.to_date(datetime.datetime.now(), "%Y%m%d")
customer_request_ids = [f"{group_id}{_}" for _ in range(len(packages))]
submit_shipment = lib.identity(
# set to true if canadapost_submit_shipment is true
options.canadapost_submit_shipment.state
Expand Down

0 comments on commit 3ae1bf9

Please sign in to comment.