karrioapi / karrio

Programmable Shipping APIs (self-hosted)
https://karrio.io
Apache License 2.0
562 stars 104 forks source link

scheduledShipDate defaults to 00:00:00 causing carrier rejection issues #693

Closed minchaminder closed 1 month ago

minchaminder commented 2 months ago

Describe the bug
When scheduledShipDate is sent without a timestamp, it defaults to 00:00:00. Some carriers reject this as 00:00:00 is interpreted as a time in the past, which causes issues in scheduling shipments. The default should instead be the current timestamp to avoid these rejections.

Expected behavior
If no timestamp is provided, the system should default to the current timestamp rather than 00:00:00, ensuring the time is valid and acceptable to all carriers.

Additional context
This issue has caused scheduling rejections with specific carriers that don't accept 00:00:00 as a valid time. The problem occurs because 00:00:00 represents the start of the day, and when sent as today's timestamp, it will always be in the past by the time the request is processed. As a result, carriers interpret this as an invalid or outdated time. Adjusting the default behavior to use the current timestamp would ensure the time is always valid and prevents these rejections.

danh91 commented 1 month ago

Hi @minchaminder , Can you please provide more context as to which carrier has that issue.

Related to that, I am introducing a shipping_date field of datetime type to eventually shipment_date of date type to capture time for carriers that expect full future datetime ship date values.