-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ids-api): Add legal representative delegation type and return in…
… delegation list. (#15837) * Add legal representative delegation type and return in delegation list. * Remove directive. * Add type to domain model. * Fix mocks. * Fix import. * Fix index service mocking. * Add missing mock for company registry. * Testing. * Revert test change. Add try/catch for index. * Fix name and import. * Make types required on delegation dto. * Type fixes. * Reuse constant. * Callback for rejected promise. * Combine imports. * Remove mock. * Refactor name lookup. * Fix export. * Remove unused import. * Move function to class member. * Move index mocking to the shared setup function. --------- Co-authored-by: Sævar Már Atlason <saevar.m.atlason@gmail.com> Co-authored-by: Valur Einarsson <valure@live.com> Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
- Loading branch information
Showing
21 changed files
with
274 additions
and
41 deletions.
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
47 changes: 47 additions & 0 deletions
47
libs/auth-api-lib/seeders/20240829140032-add-delegation-type-legal-representative.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,47 @@ | ||
module.exports = { | ||
up(queryInterface) { | ||
return queryInterface.sequelize.query(` | ||
BEGIN; | ||
INSERT INTO delegation_provider | ||
(id, name, description) | ||
VALUES | ||
('syslumenn', 'Sýslumenn', 'Provider for district commissioners registry'); | ||
INSERT INTO delegation_type | ||
(id, provider, name, description) | ||
VALUES | ||
('LegalRepresentative', 'syslumenn', 'Legal Representative', 'Legal Representative delegation type'); | ||
INSERT INTO api_scope_delegation_types | ||
(api_scope_name, delegation_type) | ||
VALUES | ||
('@island.is/documents', 'LegalRepresentative'); | ||
INSERT INTO client_delegation_types | ||
(client_id, delegation_type) | ||
VALUES | ||
('@island.is/web', 'LegalRepresentative'); | ||
COMMIT; | ||
`) | ||
}, | ||
|
||
down(queryInterface) { | ||
return queryInterface.sequelize.query(` | ||
BEGIN; | ||
DELETE FROM client_delegation_types | ||
WHERE client_id = '@island.is/web' AND delegation_type = 'LegalRepresentative'; | ||
DELETE FROM api_scope_delegation_types | ||
WHERE api_scope_name = '@island.is/documents' AND delegation_type = 'LegalRepresentative'; | ||
DELETE FROM delegation_type | ||
WHERE id = 'LegalRepresentative'; | ||
DELETE FROM delegation_provider | ||
WHERE id = 'syslumenn'; | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export const UNKNOWN_NAME = 'Óþekkt nafn' |
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.