Skip to content
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

changes for new caf ministry #5402

Merged
merged 2 commits into from
Sep 6, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion forms-flow-web/src/constants/FOI/enum.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,8 @@ const MinistryNeedsScanning = [

const MinistryNeedsLANPages = [
"CFD",
"MCF"
"MCF",
"CAF"
]

const RequestTypes = Object.freeze({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const MINISTRYGROUPS = {
AGR : "AGR Ministry Team",
BRD : "BRD Ministry Team",
CAS : "CAS Ministry Team",
CAF : "CAF Ministry Team",
MCF : "MCF Ministry Team",
CLB : "CLB Ministry Team",
CITZ : "CITZ Ministry Team",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
"""empty message

Revision ID: ec27defe9178
Revises: 1d60153653db
Create Date: 2024-09-06 19:46:07.867757

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = 'ec27defe9178'
down_revision = '1d60153653db'
branch_labels = None
depends_on = None


def upgrade():
op.execute('''INSERT INTO public."ProgramAreas"(name, type, isactive, bcgovcode, iaocode) VALUES ('Ministry of Children and Family Development (Generals)', 'BC GOV Ministry', True, 'CAF', 'CAF');commit;''')

op.execute('''INSERT INTO public."ProgramAreaDivisions"(
programareaid, name, isactive, created_at, createdby, sortorder, updated_at, updatedby, issection, parentid, specifictopersonalrequests, type)
SELECT
(select programareaid from public."ProgramAreas" where bcgovcode='CAF'), name, isactive, created_at, createdby, sortorder, updated_at, updatedby, issection, parentid, specifictopersonalrequests, type
FROM public."ProgramAreaDivisions"
where programareaid = (select programareaid from public."ProgramAreas" where bcgovcode = 'MCF')
and specifictopersonalrequests is false
and isactive = true
ORDER BY divisionid ASC ''')

op.execute('''INSERT INTO public."OperatingTeams"(name, description, isactive, type) VALUES ('CAF Ministry Team', 'CAF Ministry Team', True, 'ministry');commit;''')

op.execute('''INSERT INTO public."FOIRequestTeams"(
requesttype, requeststatusid, teamid, programareaid, isactive, requeststatuslabel)
SELECT
requesttype, requeststatusid,
case when ot.name = 'MCF Ministry Team'
then (select teamid from public."OperatingTeams" where name = 'CAF Ministry Team')
else (rt.teamid) end,
(select programareaid from public."ProgramAreas" where bcgovcode = 'CAF'), rt.isactive, requeststatuslabel
FROM public."FOIRequestTeams" rt
join public."OperatingTeams" ot on rt.teamid = ot.teamid
where
programareaid = (select programareaid from public."ProgramAreas" where bcgovcode = 'MCF') and
requesttype = 'General' and rt.isactive = true''')

def downgrade():
op.execute('''delete from public."FOIRequestTeams" where programareaid in (select programareaid from public."ProgramAreas" where bcgovcode = 'CAF')''')

op.execute('''delete from public."OperatingTeams" where name = 'CAF Ministry Team' ''')

op.execute('''delete from public."ProgramAreaDivisions" where programareaid in (select programareaid from public."ProgramAreas" where bcgovcode = 'CAF')''')

op.execute('''delete from public."ProgramAreas" where bcgovcode = 'CAF' ''')
#
1 change: 1 addition & 0 deletions request-management-api/request_api/utils/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ class MinistryTeamWithKeycloackGroup(Enum):
AG = "AG Ministry Team"
BRD = "BRD Ministry Team"
CAS = "CAS Ministry Team"
CAF = "CAF Ministry Team"
CITZ = "CITZ Ministry Team"
CLB = "CLB Ministry Team"
DAS = "DAS Ministry Team"
Expand Down
Loading