Skip to content

Commit

Permalink
Merge pull request #2586 from HHS/OPS-2010/requisition-number-and-date
Browse files Browse the repository at this point in the history
Adding requisition number and date to BLI
  • Loading branch information
rajohnson90 authored Jul 23, 2024
2 parents 00ea20f + 6a2b787 commit 8a102c7
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 28 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Adding document table
Revision ID: f8ef3a3d90d7
Revises: 5d3916a592a6
Revises: a4a04f1f868e
Create Date: 2024-07-17 21:08:10.094647+00:00
"""
Expand All @@ -13,7 +13,7 @@

# revision identifiers, used by Alembic.
revision: str = 'f8ef3a3d90d7'
down_revision: Union[str, None] = '5d3916a592a6'
down_revision: Union[str, None] = 'a4a04f1f868e'
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
"""Adding requisition number and requisition date to BLI
Revision ID: 046c78099374
Revises: f8ef3a3d90d7
Create Date: 2024-07-19 15:05:23.462440+00:00
"""
from typing import Sequence, Union

import sqlalchemy as sa
from alembic import op
from alembic_postgresql_enum import TableReference

# revision identifiers, used by Alembic.
revision: str = '046c78099374'
down_revision: Union[str, None] = 'f8ef3a3d90d7'
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None


def upgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('budget_line_item', sa.Column('requisition_number', sa.Integer(), nullable=True))
op.add_column('budget_line_item', sa.Column('requisition_date', sa.Date(), nullable=True))
op.add_column('budget_line_item_version', sa.Column('requisition_number', sa.Integer(), autoincrement=False, nullable=True))
op.add_column('budget_line_item_version', sa.Column('requisition_date', sa.Date(), autoincrement=False, nullable=True))
op.sync_enum_values('ops', 'opseventtype', ['LOGIN_ATTEMPT', 'CREATE_BLI', 'UPDATE_BLI', 'DELETE_BLI', 'CREATE_PROJECT', 'CREATE_NEW_AGREEMENT', 'UPDATE_AGREEMENT', 'SEND_BLI_FOR_APPROVAL', 'DELETE_AGREEMENT', 'ACKNOWLEDGE_NOTIFICATION', 'LOGOUT', 'CREATE_USER', 'UPDATE_USER', 'DEACTIVATE_USER', 'CREATE_BLI_PACKAGE', 'UPDATE_BLI_PACKAGE', 'CREATE_SERVICES_COMPONENT', 'UPDATE_SERVICES_COMPONENT', 'DELETE_SERVICES_COMPONENT', 'CREATE_PROCUREMENT_ACQUISITION_PLANNING', 'UPDATE_PROCUREMENT_ACQUISITION_PLANNING', 'DELETE_PROCUREMENT_ACQUISITION_PLANNING', 'CREATE_DOCUMENT'],
[TableReference(table_schema='ops', table_name='ops_event', column_name='event_type'), TableReference(table_schema='ops', table_name='ops_event_version', column_name='event_type')],
enum_values_to_rename=[])
# ### end Alembic commands ###


def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.sync_enum_values('ops', 'opseventtype', ['LOGIN_ATTEMPT', 'CREATE_BLI', 'UPDATE_BLI', 'DELETE_BLI', 'CREATE_PROJECT', 'CREATE_NEW_AGREEMENT', 'UPDATE_AGREEMENT', 'SEND_BLI_FOR_APPROVAL', 'DELETE_AGREEMENT', 'ACKNOWLEDGE_NOTIFICATION', 'LOGOUT', 'CREATE_USER', 'UPDATE_USER', 'DEACTIVATE_USER', 'CREATE_BLI_PACKAGE', 'UPDATE_BLI_PACKAGE', 'CREATE_SERVICES_COMPONENT', 'UPDATE_SERVICES_COMPONENT', 'DELETE_SERVICES_COMPONENT', 'CREATE_PROCUREMENT_ACQUISITION_PLANNING', 'UPDATE_PROCUREMENT_ACQUISITION_PLANNING', 'DELETE_PROCUREMENT_ACQUISITION_PLANNING'],
[TableReference(table_schema='ops', table_name='ops_event', column_name='event_type'), TableReference(table_schema='ops', table_name='ops_event_version', column_name='event_type')],
enum_values_to_rename=[])
op.drop_column('budget_line_item_version', 'requisition_date')
op.drop_column('budget_line_item_version', 'requisition_number')
op.drop_column('budget_line_item', 'requisition_date')
op.drop_column('budget_line_item', 'requisition_number')
# ### end Alembic commands ###

This file was deleted.

5 changes: 4 additions & 1 deletion backend/models/cans.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ class ContractAgreement(Agreement):
secondary=contract_support_contacts,
back_populates="contracts",
)
invoice_line_nbr: Mapped[Optional[int]] = mapped_column(Integer())
invoice_line_nbr: Mapped[Optional[int]] = mapped_column(Integer)
service_requirement_type: Mapped[Optional[ServiceRequirementType]] = mapped_column(
ENUM(ServiceRequirementType)
)
Expand Down Expand Up @@ -594,6 +594,9 @@ class BudgetLineItem(BaseModel):
certified: Mapped[bool] = mapped_column(Boolean, default=False)
closed: Mapped[bool] = mapped_column(Boolean, default=False)

requisition_number: Mapped[Optional[int]] = mapped_column(Integer)
requisition_date: Mapped[Optional[date]] = mapped_column(Date)

date_needed: Mapped[Optional[date]] = mapped_column(Date)

proc_shop_fee_percentage: Mapped[Optional[decimal]] = mapped_column(
Expand Down

0 comments on commit 8a102c7

Please sign in to comment.