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 a maximum order quantity #98

Draft
wants to merge 56 commits into
base: master
Choose a base branch
from

Conversation

yksflip
Copy link
Collaborator

@yksflip yksflip commented Aug 29, 2024

ToDo:

  • csv/foodsoft file import
  • update api / swagger
  • check stock order bug:
    • +2 save
    • -1 --> 0
    • +2 impossible

lentschi and others added 30 commits July 26, 2024 10:34
- made article model spec work again
- removed some more dead shared db code
Explanation of why this only occurs now: The previous rails version ignored invalid ids
for `accepts_nested_attributes_for` parameters, the new one doesn't.
-> We need to avoid sending them.
This also fixes several actual bugs (partially caused by the rabase) detected by the specs
Changed decimals to 3 as requested
lentschi and others added 22 commits July 26, 2024 10:34
…onvertability (#70)

* On #42: Fax pdf/csv: Decimals dependant on supplier_order_unit's si convertability

* Solve #42: Improve fax PDF, CSV, text

- outsource format_units_to_order to OrderHelper
- fax text: include unit, adjust column width
- fax PDF & text: only include order number if any present

* On #42:

- Adapted order_txt to generalized creating the text table and added
  spec
- Code style fixes for order_fax

* On #42 Fixes error dad0bb9#r143648091

---------

Co-authored-by: twothreenine <[email protected]>
Closes #16 

Merged the hackathon and small seeds and updated the articles to handle the new unit system.
Dropped the .nl and .de seed files, because I think it's unnecessary work to further maintain them.
* Fixes #66

* Fixes broken integration tests

* chore: refactor extract articles_helper article_version test setup function

* chore: make helper functions private

* On #66 Fixes https://github.com/foodcoopsat/foodsoft_hackathon/pull/74/files/b078cfaa87d334dba8eaafff5b2be152f293c448#r1670426999

---------

Co-authored-by: Philipp Rothmann <[email protected]>
- rearrange CSV columns as I suggested in #47
- add locales for column headings according to my suggestions in #50 (to do: adjust terms across menus -- post-merge?)
- update documentation of CSV layout (#46)

TO DO:
any adaptations for rearranged tables necessary which I've overlooked? (for example sync feature)
All newly added TODOs supplemented by GitHub issue links
- added missing keys used in sources to de/en
- fixes `import_search_results` key position in all locales
@coveralls
Copy link

coveralls commented Aug 29, 2024

Pull Request Test Coverage Report for Build 10653285104

Details

  • 13 of 15 (86.67%) changed or added relevant lines in 4 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+19.9%) to 68.151%

Changes Missing Coverage Covered Lines Changed/Added Lines %
app/models/group_order.rb 2 4 50.0%
Totals Coverage Status
Change from base Build 10229920942: 19.9%
Covered Lines: 4699
Relevant Lines: 6895

💛 - Coveralls

@yksflip yksflip force-pushed the feat/maximum-order-quantity branch from 8a88ad9 to 9cd0d22 Compare August 29, 2024 22:35
@@ -81,6 +81,8 @@ def update_results!
# 4 | 5 | 4 | 2
#
def calculate_units_to_order(quantity, tolerance = 0)
quantity = [price.maximum_order_quantity || quantity, quantity].min
return 0 if price.minimum_order_quantity && quantity < price.minimum_order_quantity
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'm not sure if I misunderstand the expected behavior of minimum_order_quantity of this function, or if this case was just missing and just doesn't occur here as it is handled somewhere in client-side already?

Copy link
Contributor

Choose a reason for hiding this comment

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

You're right - at least at a first glance something seems broken here - I've created #99 to address the issue. (I'll take a closer look asap.)

@yksflip yksflip force-pushed the feat/maximum-order-quantity branch 2 times, most recently from 2665d81 to 1bafa9a Compare September 1, 2024 10:32
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.

4 participants