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: add category price per unit toggle #266

Merged
merged 3 commits into from
Jan 31, 2024
Merged

Conversation

dq18
Copy link
Collaborator

@dq18 dq18 commented Jan 30, 2024

What

  • Added a choice selector to enable changing price_per between KILOGRAM or UNIT when inputting a price for a product without barcode
  • Default behavior: automatically set to Kilogram

Screenshot

image

@dq18 dq18 requested a review from raphodn January 30, 2024 21:12
@dq18 dq18 self-assigned this Jan 30, 2024
@dq18 dq18 linked an issue Jan 30, 2024 that may be closed by this pull request
Copy link
Member

@raphodn raphodn left a comment

Choose a reason for hiding this comment

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

awesome !

Copy link
Member

@raphodn raphodn Jan 31, 2024

Choose a reason for hiding this comment

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

i see a few things missing :

  • when a user submits a price - createPrice() - with barcode, we should set the price_per to null (currently i see a price_per: KILOGRAM sent to the backend, there's no error but we should avoid sending it nevertheless)
  • we need to change the PriceCard as well to display prices "per unit"

Copy link
Member

Choose a reason for hiding this comment

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

and i added a screenshot (helpful for reviewers and people stumbling on the PR !)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

  • that indeed happened in AddPriceMultiple. I added a cleanup in both AddPriceMultiple and AddPriceSingle for peace of mind
  • PriceCard: Updated
    image

Copy link
Member

Choose a reason for hiding this comment

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

top !

Copy link
Member

Choose a reason for hiding this comment

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

Kg -> kg and Unit -> unit no ?
appart from that it's mergable :)

@dq18 dq18 merged commit 02c97c0 into master Jan 31, 2024
2 checks passed
@dq18 dq18 deleted the add_category_price_per_unit branch January 31, 2024 21:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Add price per unit choice for category products
2 participants