-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add legal representative delegation type and return in delegation list.
- Loading branch information
1 parent
bc38e3e
commit 556f437
Showing
14 changed files
with
248 additions
and
18 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
49 changes: 49 additions & 0 deletions
49
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,49 @@ | ||
'use strict' | ||
|
||
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
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.