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

✨ Optional extra_credits in invitations #4850

Merged
merged 15 commits into from
Oct 11, 2023

Conversation

pcrespov
Copy link
Member

@pcrespov pcrespov commented Oct 10, 2023

What do these changes do?

This PR introduces an optional new field extra_credits: PositiveInt to invitations that permits a PRODUCT_OWNER user to assign a number of credits to the newly created account's wallet upon confirmation.

Extra details

APIs affected are:

  • services/invitations version: 1.0.2 → 1.1.0: see openapi.json specs
    • ✨ new field extra_credits to define an invitation
  • services/webserver api version: 0.32.0 → 0.33.0: see openapi.json specs
    • ✨stores invitation in confirmation.data column. Loads upon confirmation and passes it to the notification so the wallets._events can add extra credits in the wallet.
    • 🐛 sends notification also when confirmation email is disabled.

Related issue/s

How to test

  • Acceptance-test:
    • PO user creates invitation with extraCredits=10
    • Use invitation link
    • Complete registration and confirm to activate account
    • Login account
    • Account has a wallet with 10 credits

DevOps

None

@pcrespov pcrespov self-assigned this Oct 10, 2023
@pcrespov pcrespov added a:webserver issue related to the webserver service a:invitations invitations service labels Oct 10, 2023
@pcrespov pcrespov added this to the the nameless milestone Oct 10, 2023
@codecov
Copy link

codecov bot commented Oct 10, 2023

Codecov Report

Merging #4850 (22d7489) into master (a8d2126) will increase coverage by 1.4%.
The diff coverage is 89.5%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #4850      +/-   ##
=========================================
+ Coverage    82.9%   84.3%    +1.4%     
=========================================
  Files         724    1040     +316     
  Lines       25732   41690   +15958     
  Branches     1063    1063              
=========================================
+ Hits        21338   35168   +13830     
- Misses       4169    6297    +2128     
  Partials      225     225              
Flag Coverage Δ
unittests 84.3% <89.5%> (+1.4%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
...rc/models_library/api_schemas_webserver/product.py 100.0% <100.0%> (ø)
...s/models-library/src/models_library/invitations.py 91.6% <100.0%> (+0.7%) ⬆️
...ons/src/simcore_service_invitations/invitations.py 100.0% <ø> (ø)
...erver/src/simcore_service_webserver/application.py 98.1% <100.0%> (ø)
...e_service_webserver/login/handlers_registration.py 90.3% <100.0%> (ø)
...erver/src/simcore_service_webserver/login/utils.py 96.3% <100.0%> (ø)
...ervice_webserver/products/_invitations_handlers.py 100.0% <ø> (ø)
...r/src/simcore_service_webserver/wallets/_events.py 100.0% <100.0%> (ø)
...e_service_webserver/login/handlers_confirmation.py 90.9% <91.6%> (ø)
...c/simcore_service_webserver/login/_registration.py 74.1% <57.1%> (ø)

... and 358 files with indirect coverage changes

@pcrespov pcrespov changed the title ✨ Optional extra_credits in invitations WIP: ✨ Optional extra_credits in invitations Oct 10, 2023
@pcrespov pcrespov force-pushed the is4752/invitations-credits branch 2 times, most recently from f7c47c4 to 3f14402 Compare October 11, 2023 10:55
@pcrespov pcrespov changed the title WIP: ✨ Optional extra_credits in invitations ✨ Optional extra_credits in invitations Oct 11, 2023
@pcrespov pcrespov marked this pull request as ready for review October 11, 2023 10:55
Copy link
Contributor

@matusdrobuliak66 matusdrobuliak66 left a comment

Choose a reason for hiding this comment

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

Looking good 👍

Copy link
Member

@odeimaiz odeimaiz left a comment

Choose a reason for hiding this comment

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

Merci!

Copy link
Contributor

@bisgaard-itis bisgaard-itis left a comment

Choose a reason for hiding this comment

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

Looks great! Thanks

bisgaard-itis

This comment was marked as duplicate.

@pcrespov pcrespov force-pushed the is4752/invitations-credits branch from 3f14402 to 22d7489 Compare October 11, 2023 13:48
@pcrespov pcrespov enabled auto-merge (squash) October 11, 2023 13:48
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

No Coverage information No Coverage information
0.0% 0.0% Duplication

@codeclimate
Copy link

codeclimate bot commented Oct 11, 2023

Code Climate has analyzed commit 22d7489 and detected 0 issues on this pull request.

View more on Code Climate.

@pcrespov pcrespov disabled auto-merge October 11, 2023 14:04
@pcrespov pcrespov enabled auto-merge (squash) October 11, 2023 14:04
@pcrespov pcrespov disabled auto-merge October 11, 2023 14:41
@pcrespov pcrespov merged commit a41530d into ITISFoundation:master Oct 11, 2023
@pcrespov pcrespov deleted the is4752/invitations-credits branch October 11, 2023 14:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:invitations invitations service a:webserver issue related to the webserver service
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants