Separate client service subscriptions from engagement instances
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user