-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Latest project notification related changes (#1086)
* event template import related changes * latest project notification and related changes
- Loading branch information
1 parent
0bc7332
commit c860b10
Showing
20 changed files
with
290 additions
and
56 deletions.
There are no files selected for viewing
53 changes: 53 additions & 0 deletions
53
epictrack-api/migrations/versions/449afdbe4d0d_state_enums_for_work_and_project.py
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,53 @@ | ||
"""state enums for work and project | ||
Revision ID: 449afdbe4d0d | ||
Revises: cff39cd2d471 | ||
Create Date: 2023-10-24 20:43:26.313149 | ||
""" | ||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision = '449afdbe4d0d' | ||
down_revision = 'cff39cd2d471' | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.execute("UPDATE event_types set name='Interregnum', event_category_id=8 where id = 11") | ||
op.execute("CREATE TYPE projectstateenum AS ENUM('UNDER_EAC_ASSESSMENT', 'UNDER_EXEMPTION_REQUEST', 'UNDER_AMENDMENT', 'UNDER_DISPUTE_RESOLUTION', 'PRE_CONSTRUCTION', 'CONSTRUCTION', 'OPERATION', 'CARE_AND_MAINTENANCE', 'DECOMMISSION', 'UNKNOWN')") | ||
op.execute("CREATE TYPE workstateenum AS ENUM('SUSPENDED', 'IN_PROGRESS', 'WITHDRAWN', 'TERMINATED', 'CLOSED', 'COMPLETED')") | ||
with op.batch_alter_table('projects', schema=None) as batch_op: | ||
batch_op.add_column(sa.Column('project_state', sa.Enum('UNDER_EAC_ASSESSMENT', 'UNDER_EXEMPTION_REQUEST', 'UNDER_AMENDMENT', 'UNDER_DISPUTE_RESOLUTION', 'PRE_CONSTRUCTION', 'CONSTRUCTION', 'OPERATION', 'CARE_AND_MAINTENANCE', 'DECOMMISSION', 'UNKNOWN', name='projectstateenum'), nullable=True)) | ||
|
||
with op.batch_alter_table('projects_history', schema=None) as batch_op: | ||
batch_op.add_column(sa.Column('project_state', sa.Enum('UNDER_EAC_ASSESSMENT', 'UNDER_EXEMPTION_REQUEST', 'UNDER_AMENDMENT', 'UNDER_DISPUTE_RESOLUTION', 'PRE_CONSTRUCTION', 'CONSTRUCTION', 'OPERATION', 'CARE_AND_MAINTENANCE', 'DECOMMISSION', 'UNKNOWN', name='projectstateenum'), autoincrement=False, nullable=True)) | ||
|
||
with op.batch_alter_table('works', schema=None) as batch_op: | ||
batch_op.add_column(sa.Column('work_state', sa.Enum('SUSPENDED', 'IN_PROGRESS', 'WITHDRAWN', 'TERMINATED', 'CLOSED', 'COMPLETED', name='workstateenum'), nullable=True)) | ||
|
||
with op.batch_alter_table('works_history', schema=None) as batch_op: | ||
batch_op.add_column(sa.Column('work_state', sa.Enum('SUSPENDED', 'IN_PROGRESS', 'WITHDRAWN', 'TERMINATED', 'CLOSED', 'COMPLETED', name='workstateenum'), autoincrement=False, nullable=True)) | ||
|
||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
with op.batch_alter_table('works_history', schema=None) as batch_op: | ||
batch_op.drop_column('work_state') | ||
|
||
with op.batch_alter_table('works', schema=None) as batch_op: | ||
batch_op.drop_column('work_state') | ||
|
||
with op.batch_alter_table('projects_history', schema=None) as batch_op: | ||
batch_op.drop_column('project_state') | ||
|
||
with op.batch_alter_table('projects', schema=None) as batch_op: | ||
batch_op.drop_column('project_state') | ||
|
||
# ### end Alembic commands ### |
44 changes: 44 additions & 0 deletions
44
epictrack-api/migrations/versions/4b5f3a264271_act_sections.py
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,44 @@ | ||
"""act_sections | ||
Revision ID: 4b5f3a264271 | ||
Revises: 449afdbe4d0d | ||
Create Date: 2023-10-24 21:24:14.502652 | ||
""" | ||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision = '4b5f3a264271' | ||
down_revision = '449afdbe4d0d' | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
with op.batch_alter_table('act_sections', schema=None) as batch_op: | ||
batch_op.add_column(sa.Column('ea_act_id', sa.Integer(), nullable=False)) | ||
batch_op.create_foreign_key(None, 'ea_acts', ['ea_act_id'], ['id']) | ||
|
||
with op.batch_alter_table('act_sections_history', schema=None) as batch_op: | ||
batch_op.add_column(sa.Column('ea_act_id', sa.Integer(), autoincrement=False, nullable=False)) | ||
batch_op.create_foreign_key(None, 'ea_acts', ['ea_act_id'], ['id']) | ||
for sort_order, act in enumerate(["Time Limit Extension 38(1)(a)", "Time Limit Suspension 45(1)"]): | ||
op.execute(f"INSERT INTO act_sections(name, ea_act_id, sort_order)VALUES('{act}',3,{sort_order + 1})") | ||
|
||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
with op.batch_alter_table('act_sections_history', schema=None) as batch_op: | ||
batch_op.drop_constraint(None, type_='foreignkey') | ||
batch_op.drop_column('ea_act_id') | ||
|
||
with op.batch_alter_table('act_sections', schema=None) as batch_op: | ||
batch_op.drop_constraint(None, type_='foreignkey') | ||
batch_op.drop_column('ea_act_id') | ||
|
||
# ### end Alembic commands ### |
60 changes: 60 additions & 0 deletions
60
epictrack-api/migrations/versions/cff39cd2d471_event_types_event_categories_actions.py
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,60 @@ | ||
"""event_types, event_categories, actions | ||
Revision ID: cff39cd2d471 | ||
Revises: eed10a65e3c3 | ||
Create Date: 2023-10-24 17:59:01.979152 | ||
""" | ||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision = 'cff39cd2d471' | ||
down_revision = 'eed10a65e3c3' | ||
branch_labels = None | ||
depends_on = None | ||
|
||
actions = [ | ||
"SetEventDate", | ||
"AddEvent", | ||
"SetPhasesStatus", | ||
"SetEventsStatus", | ||
"SetWorkState", | ||
"SetProjectStatus", | ||
"LockWorkStartDate", | ||
"SetWorkDecisionMaker", | ||
"AddPhase", | ||
"SetPhaseLegislation", | ||
"CreateWork" | ||
] | ||
|
||
def upgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
with op.batch_alter_table('work_phases', schema=None) as batch_op: | ||
batch_op.add_column(sa.Column('legislated', sa.Boolean(), nullable=True)) | ||
|
||
with op.batch_alter_table('work_phases_history', schema=None) as batch_op: | ||
batch_op.add_column(sa.Column('legislated', sa.Boolean(), autoincrement=False, nullable=True)) | ||
op.execute("TRUNCATE actions RESTART IDENTITY CASCADE") | ||
for action in actions: | ||
op.execute(f"INSERT INTO actions(name) VALUES('{action}')") | ||
op.execute("INSERT INTO event_categories(name, sort_order)VALUES('Special Extension',8)") | ||
op.execute("UPDATE event_types set name='PCP Time Limit Extension' where id = 25") | ||
op.execute("alter sequence event_types_id_seq restart with 37") | ||
op.execute("alter sequence event_categories_id_seq restart with 8") | ||
op.execute("INSERT INTO event_types(name, event_category_id, sort_order) VALUES ('Date Capture', 1, 10)") | ||
op.execute("INSERT INTO event_types(name, event_category_id, sort_order) VALUES ('Time Limit Resumption', 3, 2)") | ||
|
||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
with op.batch_alter_table('work_phases_history', schema=None) as batch_op: | ||
batch_op.drop_column('legislated') | ||
|
||
with op.batch_alter_table('work_phases', schema=None) as batch_op: | ||
batch_op.drop_column('legislated') | ||
|
||
# ### end Alembic commands ### |
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
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
Binary file modified
BIN
+15.4 KB
(200%)
...-api/src/api/templates/event_templates/project_notification/001-Project_Notification.xlsx
Binary file not shown.
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.