Separate client service subscriptions from engagement instances

This commit is contained in:
A R R R Associates
2026-08-05 13:42:11 +05:30
parent 3bba0c1e32
commit 0e9eb2bef2
11 changed files with 273 additions and 2 deletions
+9
View File
@@ -22,6 +22,7 @@ from app.modules.core.iam.models import User
from app.modules.services.client_services import (
SUBSCRIPTION_STATUSES,
assessment_year_from_financial_year,
attach_engagement_to_plan,
current_financial_year,
get_enabled_firm_service,
get_existing_subscription,
@@ -366,6 +367,10 @@ def subscription_create_submit(
row.remarks = remarks.strip() or None
row.is_active = is_active is not None
row.updated_by_user_id = user.id
attach_engagement_to_plan(
db, engagement=row, client=client, catalogue=firm_selection.catalogue,
firm_selection=firm_selection, actor_user_id=user.id,
)
apply_due_date_rule_to_subscription(db, row, force=True)
ensure_engagement_quality_workflow(db, subscription=row, actor_user_id=user.id, create_declarations=False)
enforce_quality_gate_on_subscription(row)
@@ -619,6 +624,10 @@ def subscription_bulk_create_submit(
)
db.add(row)
db.flush()
attach_engagement_to_plan(
db, engagement=row, client=client, catalogue=firm_selection.catalogue,
firm_selection=firm_selection, actor_user_id=user.id,
)
apply_due_date_rule_to_subscription(db, row, force=True)
ensure_engagement_quality_workflow(db, subscription=row, actor_user_id=user.id, create_declarations=False)
enforce_quality_gate_on_subscription(row)