Skip to content

Conversation

jonathanreveille
Copy link
Member

@jonathanreveille jonathanreveille commented Oct 2, 2025

Purpose

When an order is created from a batch order, there were no indication that the order was generated
from there. We now added a new key into the serializer's response, which is from_batch_order. It
returns a boolean value whether the order was created from a batch order or not.

Proposal

  • Add property on Order model from_batch_order
  • Add from_batch_order on client API OrderSerializer
  • Add from_batch_order on admin API OrderSerializer
  • Refactor BatchOrderFactory when state completed with payment method purchase_order for tests

@jonathanreveille jonathanreveille self-assigned this Oct 2, 2025
@jonathanreveille jonathanreveille force-pushed the feature/order_serializers_add_when_order_is_from_batch_order branch 2 times, most recently from 06818d1 to 678fff4 Compare October 2, 2025 15:03
@jonathanreveille jonathanreveille force-pushed the feature/order_serializers_add_when_order_is_from_batch_order branch 3 times, most recently from c4ff108 to 212381a Compare October 6, 2025 09:29
Copy link
Member

@kernicPanel kernicPanel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not use a model property ?

Copy link
Member

@kernicPanel kernicPanel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, didn't see you used a model property.

@jonathanreveille
Copy link
Member Author

I am using a model property here

@jonathanreveille jonathanreveille force-pushed the feature/order_serializers_add_when_order_is_from_batch_order branch from 2ba88b5 to 48e8215 Compare October 6, 2025 14:13
@jonathanreveille jonathanreveille force-pushed the feature/order_serializers_add_when_order_is_from_batch_order branch 3 times, most recently from 454c5be to 367d63d Compare October 8, 2025 09:52
When an order was created from a batch order, the client API
did not return any information indicating this. We have added
a new key to the serializer, `from_batch_order`, which returns
a boolean value specifying whether the order was created from
a batch order or not.
When using the batch order factory in tests, setting the
state to `completed` did not succeed. With this fix, preparing
a batch order in the `completed` state with the payment
method `purchase_order` now works as expected
When an order was created from a batch order, the admin API
did not return any information indicating this, except for the
status `to_own` when it had not yet been assigned an owner.
We have decided to add a new key to the serializers
(`AdminOrderLightSerializer` and `AdminOrderSerializer`)
to explicitly indicate whether an order was created from a
batch order.
@jonathanreveille jonathanreveille force-pushed the feature/order_serializers_add_when_order_is_from_batch_order branch from 367d63d to 0f1da2a Compare October 8, 2025 10:14
@jonathanreveille jonathanreveille merged commit f9ad52f into main Oct 8, 2025
16 of 17 checks passed
@jonathanreveille jonathanreveille deleted the feature/order_serializers_add_when_order_is_from_batch_order branch October 8, 2025 11:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants