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

feat(orders): ORDERS-5715 add OrderFee interface, add fees field to Order interface #2066

Merged
merged 1 commit into from
Jul 19, 2023

Conversation

matt-evangelidis
Copy link
Contributor

What?

This PR adds an OrderFee interface and a fees field to the Order interface in order.ts.

Why?

This adds some interfaces for fees specific to the Orders domain to provide separation between Checkout and Orders, as each domain's definitions of fees are likely to drift further apart over time.

Testing / Proof

N/A

@bigcommerce/team-checkout @bigcommerce/team-orders

@matt-evangelidis matt-evangelidis requested a review from a team as a code owner July 19, 2023 03:30
@@ -34,6 +34,15 @@ export default interface Order {
taxes: Tax[];
taxTotal: number;
channelId: number;
fees?: OrderFee[];
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this supposed to an optional?

Copy link
Contributor Author

@matt-evangelidis matt-evangelidis Jul 19, 2023

Choose a reason for hiding this comment

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

I marked it as optional because fees are only included by default when coming from api/storefront/orders/ if PROJECT-5577.support_order_level_fee is on.

I suppose that the field itself should always be in the payload (even if it's just an empty array), so it should be fine to have as mandatory.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think that makes sense to mark it mandatory.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Marked as mandatory now.

@animesh1987
Copy link
Contributor

@matt-evangelidis For commit validation the scope needs to be order compared to orders 😄

Copy link
Contributor

@animesh1987 animesh1987 left a comment

Choose a reason for hiding this comment

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

Nicely done, looks good. Can you please check if checkout js build works fine with this change before merging.

@matt-evangelidis
Copy link
Contributor Author

Nicely done, looks good. Can you please check if checkout js build works fine with this change before merging.

image

@matt-evangelidis
Copy link
Contributor Author

@animesh1987 I don't have write access to this repo. Are you alright to merge?

@animesh1987 animesh1987 merged commit 9b09886 into bigcommerce:master Jul 19, 2023
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