-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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(role): determine level of role entity #5488
Conversation
@@ -0,0 +1,2 @@ | |||
-- Your SQL goes here | |||
ALTER TABLE roles ADD COLUMN entity_type VARCHAR(64); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It need not to be nullable, we can put default as merchant.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For now i have put that in application side. From DB it is option and we can remove it when removing option from user_role table.
If we made Default here and somehow forgot to remove at accurate point of time while migration then all the roles will be at merchant level in V2 and we don't want that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, we don't have to remove the default at all.
When we insert the roles we are anyways always inserting the entity_type of the role.
Putting the default value will remove the burden of running the backfill queries. Like we did for version.
Schema consistency is failing for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's better to add comments wherever there will be changes when we remove V1.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can make the DB layer also enum instead of varchar.
In |
…ypress-x2 * 'main' of github.com:juspay/hyperswitch: refactor(cypress): pass `connector_type` externally (#5522) refactor(router): refactor merchant_connector update v2 flow (#5484) feat(router): add accept language header middleware (#5500) chore(version): 2024.08.05.0 chore(postman): update Postman collection files fix(pm_auth): Added mca status check in pml (#5421) refactor(payment_methods): List the Payment Methods for Merchant , based on the connector type (#4909) fix(router): [Iatapay] make error status and error message optional (#5382) chore(version): 2024.08.02.0 feat(business_profile): introduce domain models for business profile v1 and v2 APIs (#5497) feat(auth): Add `profile_id` in `AuthenticationData` (#5492) feat(core): accept business profile in core functions for payments, refund, payout and disputes (#5498) refactor(router): domain and diesel model changes for merchant_connector_account create v2 flow (#5462) fix(open_payment_links): send displaySavedPaymentMethods as false explicitly for open payment links (#5501) refactor(role): determine level of role entity (#5488)
* 'main' of github.com:juspay/hyperswitch: (37 commits) fix(connector): Fixed status mapping for Plaid (#5525) feat(core): accept profile_id in merchant_account, connectors and customers core functions (#5505) refactor(auth): Pass `profile_id` from the auth to core functions (#5520) refactor(routing): Refactor api v2 routes for deactivating and retrieving the routing config (#5478) refactor(cypress): pass `connector_type` externally (#5522) refactor(router): refactor merchant_connector update v2 flow (#5484) feat(router): add accept language header middleware (#5500) chore(version): 2024.08.05.0 chore(postman): update Postman collection files fix(pm_auth): Added mca status check in pml (#5421) refactor(payment_methods): List the Payment Methods for Merchant , based on the connector type (#4909) fix(router): [Iatapay] make error status and error message optional (#5382) chore(version): 2024.08.02.0 feat(business_profile): introduce domain models for business profile v1 and v2 APIs (#5497) feat(auth): Add `profile_id` in `AuthenticationData` (#5492) feat(core): accept business profile in core functions for payments, refund, payout and disputes (#5498) refactor(router): domain and diesel model changes for merchant_connector_account create v2 flow (#5462) fix(open_payment_links): send displaySavedPaymentMethods as false explicitly for open payment links (#5501) refactor(role): determine level of role entity (#5488) feat(cypress): add corner cases (#5481) ...
Type of Change
Description
Add entity type to roles (predefined and customs)
This can be used to determine at which level a current entity exist, and can perform operations accordingly.
Additional Changes
Motivation and Context
Closes #5487
How did you test it?
The change is at DB level and can be tested with the upcoming application changes PRs.
Checklist
cargo +nightly fmt --all
cargo clippy