Skip to content

Commit 000b66c

Browse files
authored
Merge pull request #6037 from bcgov/feat/6005
feat(6005): migrate HMA ministry records
2 parents 14de7e9 + cc61a1d commit 000b66c

File tree

9 files changed

+31
-17
lines changed

9 files changed

+31
-17
lines changed

app/constants/common.ts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,6 @@ export const ministryOptions = [
7979
value: 'LDB',
8080
label: 'Liquor Distribution Branch',
8181
},
82-
{
83-
value: 'MAH',
84-
label: 'Municipal Affairs and Housing',
85-
},
8682
{
8783
value: 'MCF',
8884
label: 'Children and Family Development',
@@ -112,16 +108,16 @@ export const ministryOptions = [
112108
label: 'Transportation and Infrastructure',
113109
},
114110
{
115-
value: 'HOUS',
116-
label: 'Ministry of Housing',
111+
value: 'HMA',
112+
label: 'Housing and Municipal Affairs',
117113
},
118114
{
119115
value: 'WLRS',
120116
label: 'Water, Land and Resource Stewardship',
121117
},
122118
];
123119

124-
export const AGMinistries = ['AG', 'PSSG', 'EMCR', 'HOUS'];
120+
export const AGMinistries = ['AG', 'PSSG', 'EMCR', 'HMA'];
125121

126122
export const TEAM_SA_PREFIX = 'z_pltsvc-tsa-';
127123

app/prisma/schema.prisma

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -601,12 +601,11 @@ enum Ministry {
601601
FIN
602602
FLNR
603603
HLTH
604-
HOUS
605604
IRR
606605
JEDC
607606
LBR
608607
LDB
609-
MAH
608+
HMA
610609
MCF
611610
MMHA
612611
PSA

app/services/nats/private-cloud/index.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,7 @@ export default async function createPrivateCloudNatsMessage(
3434
switch (ministry) {
3535
case Ministry.AG:
3636
case Ministry.EMCR:
37-
case Ministry.HOUS:
38-
case Ministry.MAH:
37+
case Ministry.HMA:
3938
case Ministry.PSSG:
4039
allianceLabel = 'JAG';
4140
break;
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
export const up = async (db, client) => {
2+
const session = client.startSession();
3+
4+
await session.withTransaction(async () => {
5+
const result = await Promise.all(
6+
['PrivateCloudProduct', 'PrivateCloudRequestData', 'PublicCloudProduct', 'PublicCloudRequestData'].map(
7+
(schemaName) => {
8+
return db
9+
.collection(schemaName)
10+
.updateMany({ ministry: { $in: ['MAH', 'HOUS'] } }, [{ $set: { ministry: 'HMA' } }], { session });
11+
},
12+
),
13+
);
14+
15+
console.log('migreate_HMA_ministry:', result);
16+
});
17+
18+
session.endSession();
19+
};
20+
21+
export const down = async (db, client) => {};

sandbox/keycloak-provision/main.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,15 +113,14 @@ async function main() {
113113
'jedc',
114114
'lbr',
115115
'ldb',
116-
'mah',
117116
'mcf',
118117
'mmha',
119118
'psa',
120119
'pssg',
121120
'sdpr',
122121
'tca',
123122
'tran',
124-
'hous',
123+
'hma',
125124
'wlrs',
126125
].forEach(async (ministry) => {
127126
await kc.createClientRole(AUTH_REALM_NAME, authClient?.id as string, `ministry-${ministry}-reader`);

terraform/keycloak/dev/ministry-roles.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
locals {
2-
ministry_codes = ["aest", "ag", "agri", "alc", "bcpc", "citz", "dbc", "eao", "educ", "emcr", "empr", "env", "fin", "flnr", "hlth", "irr", "jedc", "lbr", "ldb", "mah", "mcf", "mmha", "psa", "pssg", "sdpr", "tca", "tran", "hous", "wlrs"]
2+
ministry_codes = ["aest", "ag", "agri", "alc", "bcpc", "citz", "dbc", "eao", "educ", "emcr", "empr", "env", "fin", "flnr", "hlth", "irr", "jedc", "lbr", "ldb", "mah", "mcf", "mmha", "psa", "pssg", "sdpr", "tca", "tran", "hous", "hma","wlrs"]
33
}
44

55
resource "keycloak_role" "pltsvc_ministry_editor" {

terraform/keycloak/prod/ministry-roles.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
locals {
2-
ministry_codes = ["aest", "ag", "agri", "alc", "bcpc", "citz", "dbc", "eao", "educ", "emcr", "empr", "env", "fin", "flnr", "hlth", "irr", "jedc", "lbr", "ldb", "mah", "mcf", "mmha", "psa", "pssg", "sdpr", "tca", "tran", "hous", "wlrs"]
2+
ministry_codes = ["aest", "ag", "agri", "alc", "bcpc", "citz", "dbc", "eao", "educ", "emcr", "empr", "env", "fin", "flnr", "hlth", "irr", "jedc", "lbr", "ldb", "mah", "mcf", "mmha", "psa", "pssg", "sdpr", "tca", "tran", "hous", "hma","wlrs"]
33
}
44

55
resource "keycloak_role" "pltsvc_ministry_editor" {

terraform/keycloak/test/ministry-roles.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
locals {
2-
ministry_codes = ["aest", "ag", "agri", "alc", "bcpc", "citz", "dbc", "eao", "educ", "emcr", "empr", "env", "fin", "flnr", "hlth", "irr", "jedc", "lbr", "ldb", "mah", "mcf", "mmha", "psa", "pssg", "sdpr", "tca", "tran", "hous", "wlrs"]
2+
ministry_codes = ["aest", "ag", "agri", "alc", "bcpc", "citz", "dbc", "eao", "educ", "emcr", "empr", "env", "fin", "flnr", "hlth", "irr", "jedc", "lbr", "ldb", "mah", "mcf", "mmha", "psa", "pssg", "sdpr", "tca", "tran", "hous", "hma","wlrs"]
33
}
44

55
resource "keycloak_role" "pltsvc_ministry_editor" {

testing/testing-checklist.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
2. For the User in Private Cloud Clusters dropdown is showing SILVER, GOLD, EMERALD
1414
3. For the User in Private Cloud Clusters dropdown is showing SILVER, GOLD, EMERALD, CLAB, KLAB, KLAB2
1515
4. Ministries dropdown is showing 28 ministries with no duplicates.
16-
5. If one of AG, EMCR, HOUS or PSSG ministries is chosen, the disclaimer with checkbox is shown.
16+
5. If one of AG, EMCR, HMA or PSSG ministries is chosen, the disclaimer with checkbox is shown.
1717
6. For Public Cloud the Providers dropdown has Amazon Web Services option only.
1818
7. Typing letters in the Email field of the Contacts section shows live search results for every of PO and TLs.
1919
8. Clicking one of the contact search results populates all of the fields for every of PO and TLs with corresponding data from IDIR.

0 commit comments

Comments
 (0)