-
Notifications
You must be signed in to change notification settings - Fork 61
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
feat(auth-api): Add column to delegation type indicating if actor discretion is required #16226
Open
valurefugl
wants to merge
10
commits into
main
Choose a base branch
from
auth-api/add-actor-discretion
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 7 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
c039332
Add column to delegation type indicating if actor discretion is requi…
valurefugl e0c79bd
Add sequelize to esbuild external.
valurefugl 30e7ec1
Add sequelize to esbuild external for pers. repr.
valurefugl ec0b168
Fix mock.
valurefugl 19ac0e3
Fix tests.
valurefugl eacbd15
Add sequelize to esbuild external in api.
valure 4a9e5e0
Import type. Revert esbuild changes.
valurefugl cbc6e1a
Merge branch 'main' into auth-api/add-actor-discretion
valure 5cf439e
Fix tests.
valure 913f20e
Fix tests.
valure File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
22 changes: 22 additions & 0 deletions
22
libs/auth-api-lib/migrations/20240927103047-add-discretion-column-to-delegation-type.js
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
'use strict' | ||
|
||
module.exports = { | ||
async up(queryInterface, Sequelize) { | ||
return Promise.all([ | ||
queryInterface.addColumn('delegation_type', 'actor_discretion_required', { | ||
type: Sequelize.BOOLEAN, | ||
allowNull: false, | ||
defaultValue: false, | ||
}), | ||
]) | ||
}, | ||
|
||
async down(queryInterface) { | ||
return Promise.all([ | ||
queryInterface.removeColumn( | ||
'delegation_type', | ||
'actor_discretion_required', | ||
), | ||
]) | ||
}, | ||
} |
39 changes: 39 additions & 0 deletions
39
libs/auth-api-lib/migrations/20240927153835-add_fk_constraints_to_delegation_index.js
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
'use strict' | ||
|
||
module.exports = { | ||
up: (queryInterface) => { | ||
return Promise.all([ | ||
queryInterface.addConstraint('delegation_index', { | ||
fields: ['type'], | ||
type: 'foreign key', | ||
name: 'FK_delegation_index_delegation_type', | ||
references: { | ||
table: 'delegation_type', | ||
field: 'id', | ||
}, | ||
}), | ||
queryInterface.addConstraint('delegation_index', { | ||
fields: ['provider'], | ||
type: 'foreign key', | ||
name: 'FK_delegation_index_delegation_provider', | ||
references: { | ||
table: 'delegation_provider', | ||
field: 'id', | ||
}, | ||
}), | ||
]) | ||
}, | ||
|
||
down: (queryInterface) => { | ||
return Promise.all([ | ||
queryInterface.removeConstraint( | ||
'delegation_index', | ||
'FK_delegation_index_delegation_type', | ||
), | ||
queryInterface.removeConstraint( | ||
'delegation_index', | ||
'FK_delegation_index_delegation_provider', | ||
), | ||
]) | ||
}, | ||
} |
23 changes: 23 additions & 0 deletions
23
libs/auth-api-lib/seeders/20241001144241-set-actor-discretion-for-legal-repr.js
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
module.exports = { | ||
up(queryInterface) { | ||
return queryInterface.sequelize.query(` | ||
BEGIN; | ||
UPDATE delegation_type | ||
SET actor_discretion_required = true | ||
WHERE id = 'LegalRepresentative'; | ||
|
||
COMMIT; | ||
`) | ||
}, | ||
|
||
down(queryInterface) { | ||
return queryInterface.sequelize.query(` | ||
BEGIN; | ||
UPDATE delegation_type | ||
SET actor_discretion_required = false | ||
WHERE id = 'LegalRepresentative'; | ||
|
||
COMMIT; | ||
`) | ||
}, | ||
} |
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.
Oops, something went wrong.
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.
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.
Handle potential undefined 'actorDiscretionRequired' in DTO.
Since
delegationType
might not be loaded,actorDiscretionRequired
could beundefined
. Consider providing a default value or handling this case to ensure consistent behavior for consumers of the DTO.