Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bundles – Handle Location for Multi-Item Orders #1982

Merged
merged 6 commits into from
Oct 12, 2023

Conversation

pavelbrm
Copy link
Contributor

@pavelbrm pavelbrm commented Sep 13, 2023

Summary

This PR updates order creation in the new endpoint (/v1/orders-new) with allowing NULL location on multi-item orders. It resolves #1968.

Main Changes

The main change is that the new endpoint for creating orders (which is not yet in use in Production) supports orders with multiple items that have different locations.

Secondary Changes

To enable that, I've done some refactoring:

  • The Create method on the Order repository requires an order prototype object instead of all the details in the open.
  • Updated the CreateOrder method on the legacy datastore:
    • It now accepts an object, a prototype of the order, instead of messing around with all the fields.
    • Transaction management must be handled by the caller.
  • Updated the legacy CreateOrderFromRequest method on the service to support the changes above.
  • Decoupled Stripe checkout session creation from Order. It must not be a method on the Order type.

Type of Change

  • Product feature
  • Bug fix
  • Performance improvement
  • Refactor
  • Other

Tested Environments

  • Development
  • Staging
  • Production

Before Requesting Review

  • Does your code build cleanly without any errors or warnings?
  • Have you used auto closing keywords?
  • Have you added tests for new functionality?
  • Have validated query efficiency for new database queries?
  • Have documented new functionality in README or in comments?
  • Have you squashed all intermediate commits?
  • Is there a clear title that explains what the PR does?
  • Have you used intuitive function, variable and other naming?
  • Have you requested security/privacy review if needed
  • Have you performed a self review of this PR?

Base automatically changed from allow-empty-location-01 to master September 13, 2023 11:51
@pavelbrm pavelbrm self-assigned this Sep 14, 2023
@pavelbrm pavelbrm force-pushed the allow-empty-location-02 branch from 7013ea4 to d8961c1 Compare September 15, 2023 07:13
@pavelbrm pavelbrm marked this pull request as ready for review September 15, 2023 07:34
@pavelbrm pavelbrm requested review from clD11 and husobee September 15, 2023 07:35
services/skus/datastore.go Outdated Show resolved Hide resolved
@pavelbrm pavelbrm merged commit b64db37 into master Oct 12, 2023
9 checks passed
@pavelbrm pavelbrm deleted the allow-empty-location-02 branch October 12, 2023 11:13
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.

Allow Multiple Items With Different Locations
2 participants