Feat/ Add endpoint for purchasing privileges#272
Merged
isabeleliassen merged 32 commits intocsg-org:developmentfrom Oct 30, 2024
Merged
Feat/ Add endpoint for purchasing privileges#272isabeleliassen merged 32 commits intocsg-org:developmentfrom
isabeleliassen merged 32 commits intocsg-org:developmentfrom
Conversation
We need to fetch the provider record in order get their military status, so this brings in all the schema files that are needed in order to load the records. Also updated the common test files to upload this data.
This fetches all the jurisdiction configuration for the jurisdictions a user has selected to buy privileges in and sends that information to the purchase client to process the charge to their card.
Collaborator
Author
|
@jusdino The tests are failing due to an import error, which I can't figure out: I have the dependency included in the requirements.in file here So I'm not sure why the test runner can't find the module. |
This handles creating the records if the transaction is successful as well as voiding the transaction if the privilege records cannot be created for whatever reason.
Improves type safety and makes fields read-only
jusdino
suggested changes
Oct 25, 2024
Contributor
jusdino
left a comment
There was a problem hiding this comment.
Phew! Good work! I've got a few thoughts to ponder on this one:
backend/compact-connect/lambdas/purchases/handlers/privileges.py
Outdated
Show resolved
Hide resolved
backend/compact-connect/lambdas/purchases/data_model/schema/compact.py
Outdated
Show resolved
Hide resolved
backend/compact-connect/lambdas/purchases/handlers/privileges.py
Outdated
Show resolved
Hide resolved
backend/compact-connect/lambdas/purchases/handlers/privileges.py
Outdated
Show resolved
Hide resolved
backend/compact-connect/lambdas/purchases/handlers/privileges.py
Outdated
Show resolved
Hide resolved
- enforcing valid jurisdiction check at APIGW level - setting min and max lengths for API values - Fix secret arn to include required * - checking for best matching license - rename variables - update exception type
Collaborator
Author
|
@jlkravitz This PR is now ready for CSG review |
Collaborator
|
jlkravitz
requested changes
Oct 29, 2024
Collaborator
jlkravitz
left a comment
There was a problem hiding this comment.
a few comments but generally looks great! thanks for the thorough testing!
backend/compact-connect/lambdas/provider-data-v1/data_model/schema/privilege.py
Show resolved
Hide resolved
backend/compact-connect/lambdas/purchases/handlers/privileges.py
Outdated
Show resolved
Hide resolved
backend/compact-connect/lambdas/purchases/tests/function/__init__.py
Outdated
Show resolved
Hide resolved
...d/compact-connect/lambdas/purchases/tests/function/test_handlers/test_purchase_privileges.py
Outdated
Show resolved
Hide resolved
backend/compact-connect/lambdas/purchases/tests/unit/test_purchase_client.py
Show resolved
Hide resolved
backend/compact-connect/lambdas/purchases/tests/unit/test_purchase_client.py
Show resolved
Hide resolved
jlkravitz
approved these changes
Oct 29, 2024
Collaborator
jlkravitz
left a comment
There was a problem hiding this comment.
@isabeleliassen good to merge!
isabeleliassen
approved these changes
Oct 30, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR includes a new endpoint
POST /v1/purchases/privilegeswhich takes in a list of jurisdictions that a provider hasselected to purchase, as well as card billing information, to process a transaction using the compact's payment processor
of choice.
After the transaction is successfully completed, this endpoint then adds the associated privilege records under the provider's list of privileges.
We also have another ticket for adding an endpoint to store these authorize.net credentials securely in secrets manager. See #267
Requirements List
Description List
POST /v1/purchases/privilegeswith lambda handler and testsTesting List
yarn test:unit:allshould run without errors or warningsyarn serveshould run without errors or warningsyarn buildshould run without errors or warningsbackend/compact-connect/tests/unit/test_api.pyCloses #261