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

Greencode module #429

Open
wants to merge 18 commits into
base: main
Choose a base branch
from
Open

Greencode module #429

wants to merge 18 commits into from

Conversation

guillaumetavernier
Copy link
Contributor

@guillaumetavernier guillaumetavernier commented May 10, 2024

Description

Doc : https://hedgedoc.eclair.ec-lyon.fr/CQfERrCRSuacIMpqEaPfng

Checklist

  • Created tests which fail without the change (if possible)
  • All tests passing
  • Extended the documentation, if necessary

Copy link

codecov bot commented May 10, 2024

Codecov Report

Attention: Patch coverage is 90.05525% with 18 lines in your changes are missing coverage. Please review.

Project coverage is 82.95%. Comparing base (05a210b) to head (f8340e7).

Files Patch % Lines
app/modules/greencode/cruds_greencode.py 77.94% 15 Missing ⚠️
app/modules/greencode/endpoints_greencode.py 96.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #429      +/-   ##
==========================================
+ Coverage   82.74%   82.95%   +0.21%     
==========================================
  Files          97      101       +4     
  Lines        6078     6259     +181     
==========================================
+ Hits         5029     5192     +163     
- Misses       1049     1067      +18     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@guillaumetavernier guillaumetavernier added enhancement New feature or request python Pull requests that update Python code module ready for review This PR is ready to be reviewed feat New feature or request don't merge labels May 10, 2024
app/modules/greencode/models_greencode.py Outdated Show resolved Hide resolved
status_code=201,
)
async def create_item(
item: schemas_greencode.ItemBase,
Copy link
Member

Choose a reason for hiding this comment

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

You should probably check the qr_code_content does not already exist

"/greencode/item/{item_id}",
status_code=204,
)
async def update_advertiser(
Copy link
Member

Choose a reason for hiding this comment

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

You should probably check the qr_code_content does not already exist

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Isn't it redundant with the unique=true in models ?

app/modules/greencode/models_greencode.py Outdated Show resolved Hide resolved
app/modules/greencode/endpoints_greencode.py Show resolved Hide resolved
app/modules/greencode/models_greencode.py Show resolved Hide resolved
)

completion = schemas_greencode.Completion(
user=schemas_greencode.CoreUserSimple(**user.__dict__),
Copy link
Member

Choose a reason for hiding this comment

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

Is it useful to return the user, as we need to know the user_id to get this object?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do you suggest using different schemas for the single and list endpoints ?
On a frontend perspective, I think it would add some complexity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
don't merge enhancement New feature or request feat New feature or request module python Pull requests that update Python code ready for review This PR is ready to be reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants