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

Refactor using RESTX and Swagger #57

Merged
merged 17 commits into from
Apr 12, 2024
Merged

Refactor using RESTX and Swagger #57

merged 17 commits into from
Apr 12, 2024

Conversation

EricYoung37
Copy link
Contributor

@EricYoung37 EricYoung37 commented Apr 12, 2024

  • The app is refactored from REST to RESTX.

  • It now supports Swagger API documentations on localhost:8000/apidocs. Link also avialable at the bottom of the root localhost:8000.

  • Restock action no longer takes user-input number to add to item quantity (user-input number can be assigned to item quantity via update method). The restock logic is resolved internally in the backend when the restock button is clicked. The idea is: the more we sold, the more we add, vice versa. More sophisticated algorithm may be adopted in the future.

if item.quantity < item.restock_level:
    item.quantity = 2*item.restock_level - item.quantity  # = item.restock_level + (item.restock_level - quantity)
  • Code achieves 95% PyTest coverage.

  • Code passed all behave tests.

  • Added BDD badge in README

  • Updated README with documentations for restcok action

  • Updated README with documentations for two model attributes condition and restock_level

@EricYoung37 EricYoung37 merged commit 802f168 into master Apr 12, 2024
2 checks passed
@EricYoung37 EricYoung37 deleted the flask-restx-swagger branch April 12, 2024 08:20
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.

1 participant