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

✨ Enhancements for product-owner users and invitations #4862

Merged
merged 18 commits into from
Oct 16, 2023

Conversation

pcrespov
Copy link
Member

@pcrespov pcrespov commented Oct 13, 2023

What do these changes do?

  • ✨ Change name of auto-created wallet upon registration to include user name
    • wallet_name=f"{user_name} Credits"
    • description=f"Credits purchased by {user_name} end up in here"
  • Invitation: extra-credits in dollars instead of number of credits
    • generate_invitation field extra_credits is renamed as extra_credits_in_usd
  • ✨ Adds credit price in Product model
    • as product.credits_per_usd, i.e. number of credits per dollar
  • ✨ New get_product entrypoints restricted to PRODUCT_OWNERS
    • @odeimaiz can you please add it as a read-only tab in PO center
    • 'services/webserver api version: 0.33.0 → 0.34.0'

Detail on get_product

 /v0/products/{product_name}:
    get:
      tags:
      - products
      summary: Get Product
      operationId: get_product
      parameters:
      - required: true
        schema:
          title: Product Name
          anyOf:
          - minLength: 1
            type: string
          - enum:
            - current
            type: string
        name: product_name
        in: path
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Envelope_GetProduct_'

More details in products section of openapi.json swagger

Related issue/s

How to test

Driving tests:

  • tests/unit/with_dbs/03/wallets/test_wallets.py::test_wallets_events_auto_add_default_wallet_on_user_confirmation
  • tests/unit/with_dbs/03/invitations/test_products_invitations.py
  • tests/unit/with_dbs/03/products/test_products_handlers.py

DevOps

None

Copy link

@codeclimate codeclimate bot left a comment

Choose a reason for hiding this comment

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

The PR diff size of 6656 lines exceeds the maximum allowed for the inline comments feature.

@pcrespov pcrespov self-assigned this Oct 13, 2023
@pcrespov pcrespov added the a:webserver issue related to the webserver service label Oct 13, 2023
@pcrespov pcrespov added this to the the nameless milestone Oct 13, 2023
Copy link

@codeclimate codeclimate bot left a comment

Choose a reason for hiding this comment

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

The PR diff size of 6666 lines exceeds the maximum allowed for the inline comments feature.

@codecov
Copy link

codecov bot commented Oct 13, 2023

Codecov Report

Merging #4862 (1be7019) into master (f2e6292) will decrease coverage by 2.6%.
The diff coverage is 94.0%.

Impacted file tree graph

@@           Coverage Diff            @@
##           master   #4862     +/-   ##
========================================
- Coverage    86.8%   84.2%   -2.6%     
========================================
  Files        1179    1179             
  Lines       48920   48981     +61     
  Branches     1063    1063             
========================================
- Hits        42500   41283   -1217     
- Misses       6185    7473   +1288     
+ Partials      235     225     -10     
Flag Coverage Δ
integrationtests 62.5% <61.9%> (-2.8%) ⬇️
unittests 84.3% <94.0%> (-0.2%) ⬇️

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%> (ø)
...imcore_postgres_database/models/products_prices.py 100.0% <100.0%> (ø)
...simcore_postgres_database/utils_products_prices.py 100.0% <100.0%> (ø)
...ons/src/simcore_service_invitations/invitations.py 100.0% <ø> (ø)
...c/simcore_service_webserver/login/_registration.py 74.1% <100.0%> (ø)
...e_service_webserver/login/handlers_registration.py 90.3% <ø> (ø)
...erver/src/simcore_service_webserver/login/utils.py 96.3% <ø> (ø)
...ver/src/simcore_service_webserver/products/_api.py 69.2% <100.0%> (+1.4%) ⬆️
...rver/src/simcore_service_webserver/products/_db.py 85.1% <100.0%> (+5.1%) ⬆️
... and 9 more

... and 64 files with indirect coverage changes

@pcrespov pcrespov force-pushed the is4752/enh-invitations branch from 5452865 to 306249a Compare October 14, 2023 21:38
Copy link

@codeclimate codeclimate bot left a comment

Choose a reason for hiding this comment

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

The PR diff size of 6872 lines exceeds the maximum allowed for the inline comments feature.

Copy link

@codeclimate codeclimate bot left a comment

Choose a reason for hiding this comment

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

The PR diff size of 6899 lines exceeds the maximum allowed for the inline comments feature.

@pcrespov pcrespov changed the title WIP: ✨ Is4752/enh invitations ✨ Enhancements for product-owner users and invitations Oct 14, 2023
@pcrespov pcrespov marked this pull request as ready for review October 14, 2023 23:54
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, I'll expose the object returned in get_product

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.

Thanks, looks good 👍

Copy link
Contributor

@GitHK GitHK 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. Please find a few questions below.

@pcrespov pcrespov requested a review from GitHK October 16, 2023 09:07
Copy link
Contributor

@GitHK GitHK left a comment

Choose a reason for hiding this comment

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

👍

@pcrespov pcrespov force-pushed the is4752/enh-invitations branch from 57dff06 to 93d83c9 Compare October 16, 2023 12:22
@codeclimate
Copy link

codeclimate bot commented Oct 16, 2023

Code Climate has analyzed commit 1be7019 and detected 0 issues on this pull request.

View more on Code Climate.

@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 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@pcrespov pcrespov enabled auto-merge (squash) October 16, 2023 13:02
@pcrespov pcrespov disabled auto-merge October 16, 2023 15:16
@pcrespov pcrespov merged commit 707d185 into ITISFoundation:master Oct 16, 2023
@pcrespov pcrespov deleted the is4752/enh-invitations branch October 16, 2023 15:17
@matusdrobuliak66 matusdrobuliak66 mentioned this pull request Oct 20, 2023
36 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:webserver issue related to the webserver service
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants