Skip to content

✨(backend) add --owned-batch-orders option to create_dev_data#1331

Open
kernicPanel wants to merge 3 commits intobatch-orders-v2from
feat/owned-batch-orders-option
Open

✨(backend) add --owned-batch-orders option to create_dev_data#1331
kernicPanel wants to merge 3 commits intobatch-orders-v2from
feat/owned-batch-orders-option

Conversation

@kernicPanel
Copy link
Copy Markdown
Member

Purpose

When running make dev-data, batch orders are created without an explicit
owner, which makes it impossible to exercise the "owned batch orders" flow
as the user connected on Richie (user10). The code to wire user10 onto
batch orders existed but was commented out, so there was no way to opt in.

On top of that, make dev-data required the awkward
ARGS="--credential" form to forward flags to create_dev_data, which
hurt discoverability when stacking multiple flags.

Proposal

  • Uncomment the user10 batch-order owner fixture in generate_simple
    and gate it behind a new owned_batch_orders flag (disabled by
    default). The flag also surfaces in the interactive select_multiple
    menu as "Owned batch orders".
  • Expose the flag as --owned-batch-orders on the
    create_dev_data management command.
  • Rework the dev-data Makefile target so flags after -- are
    forwarded to create_dev_data, enabling:
    make dev-data -- --owned-batch-orders --credential

Allows assigning batch orders to user10, the default user used to
connect on Richie. Disabled by default to keep the dev-data command
fast when this fixture is not needed.
Using the GNU make `--` convention stops make from parsing trailing
flags as its own options, letting us write:

    make dev-data -- --owned-batch-orders --credential

instead of the awkward ARGS="..." form.
Copilot AI review requested due to automatic review settings April 13, 2026 13:24
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR improves the dev dataset generation workflow by making it possible to generate batch orders explicitly owned by Richie’s default user (user10), and by making it easier to forward flags to the create_dev_data Django management command from make dev-data.

Changes:

  • Add an owned_batch_orders toggle to Demo.generate_simple, including an interactive menu entry.
  • Expose the toggle as --owned-batch-orders on the create_dev_data management command.
  • Rework the dev-data Makefile target to forward extra CLI tokens to create_dev_data.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
src/backend/joanie/tests/testing_utils.py Adds an owned_batch_orders flag and gates creation/assignment of the user10 batch-order owner and related order ownership updates.
src/backend/joanie/demo/management/commands/create_dev_data.py Adds the --owned-batch-orders CLI flag and forwards it into Demo.generate_simple.
Makefile Introduces argument forwarding from make dev-data … to manage.py create_dev_data.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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