Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
"""add in_progress status in package model

Revision ID: e77a59c88dac
Revises: d4ea378228e4
Create Date: 2026-04-15 17:41:20.993941

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = 'e77a59c88dac'
down_revision = 'd4ea378228e4'
branch_labels = None
depends_on = None


def upgrade():
op.execute("ALTER TYPE packagestatus ADD VALUE IF NOT EXISTS 'IN_PROGRESS';")


def downgrade():
# Note: PostgreSQL does not support removing enum values directly
# This would require recreating the enum type, which is complex and risky
# If rollback is needed, it should be done manually or with a new migration
pass
1 change: 1 addition & 0 deletions submit-api/src/submit_api/models/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ class PackageStatus(enum.Enum):
COMPLETED = 'COMPLETED'
NEW_SUBMISSION = 'NEW_SUBMISSION'
NEW = 'NEW'
IN_PROGRESS = 'IN_PROGRESS'
PASSED_CONSULTATION_CHECK = 'PASSED_CONSULTATION_CHECK'
FAILED_CONSULTATION_CHECK = 'FAILED_CONSULTATION_CHECK'
UNDER_REVIEW = 'UNDER_REVIEW'
Expand Down
4 changes: 4 additions & 0 deletions submit-api/src/submit_api/schemas/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,10 @@ def get_package_status(status, user_type, version_obj):
UserType.PROPONENT: PackageStatus.REVIEWED.value,
UserType.STAFF: PackageStatus.REVIEWED.value
},
PackageStatus.IN_PROGRESS.value: {
UserType.PROPONENT: PackageStatus.IN_PROGRESS.value,
UserType.STAFF: PackageStatus.IN_PROGRESS.value
},
}

if status in package_status_mapping:
Expand Down
15 changes: 15 additions & 0 deletions submit-api/src/submit_api/services/package_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,13 @@ def _create_package(session, account_project_id, request_data, package_type):
# Use account_project_work_id from request if provided
if request_data.get("account_project_work_id"):
package_data["account_project_work_id"] = request_data.get("account_project_work_id")
# Set IN_PROGRESS status for work-related packages
if not package_data.get("status"):
package_data["status"] = [PackageStatus.IN_PROGRESS.value]
work_id = request_data.get('account_project_work_id')
current_app.logger.info(
f"Setting IN_PROGRESS status for work-related package with work_id: {work_id}"
)
current_app.logger.info(
f"Using account_project_work_id from request: {request_data.get('account_project_work_id')}"
)
Expand Down Expand Up @@ -394,6 +401,14 @@ def submit_package(cls, package_id):
@classmethod
def _submit_package(cls, package, session):
"""Submit the package by updating its status and items."""
# For work-related packages with IN_PROGRESS status, explicitly set to SUBMITTED
if package.account_project_work_id and PackageStatus.IN_PROGRESS.value in package.status:
package.status = [PackageStatus.SUBMITTED.value]
session.add(package)
current_app.logger.info(
f"Changed status from IN_PROGRESS to SUBMITTED for work-related package {package.id}"
)

cls._update_items_status(
package.items, ItemStatus.SUBMITTED.value, session)
cls._update_package_status(package.id, session, package)
Expand Down
9 changes: 9 additions & 0 deletions submit-web/src/components/App/PackageStatusChip/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,15 @@ const statusStyles: Record<
},
label: "New",
},
IN_PROGRESS: {
sx: {
borderRadius: 1,
border: `1px solid ${BCDesignTokens.themeBlue100}`,
background: BCDesignTokens.themeBlue20,
height: "24px",
},
label: "In Progress",
},
NEW_SUBMISSION: {
sx: {
borderRadius: 1,
Expand Down
5 changes: 5 additions & 0 deletions submit-web/src/models/Package.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ export type PackageStatus =
| "PARTIALLY_COMPLETED"
| "NEW_SUBMISSION"
| "NEW"
| "IN_PROGRESS"
| "UNDER_CONSULTATION_CHECK"
| "PASSED_CONSULTATION_CHECK"
| "AWAITING_MANAGER_APPROVAL"
Expand Down Expand Up @@ -96,6 +97,10 @@ export const PACKAGE_STATUS: Record<
value: "NEW",
label: "New",
},
IN_PROGRESS: {
value: "IN_PROGRESS",
label: "In Progress",
},
NEW_SUBMISSION: {
value: "NEW_SUBMISSION",
label: "New Submission",
Expand Down
Loading