Align client onboarding documents and engagement AQMM workflow
This commit is contained in:
@@ -3,6 +3,7 @@ from __future__ import annotations
|
||||
from fastapi import APIRouter, File, Form, Request, UploadFile
|
||||
from fastapi.responses import FileResponse, HTMLResponse, JSONResponse, RedirectResponse, Response
|
||||
from pydantic import ValidationError
|
||||
from sqlalchemy import func, select
|
||||
|
||||
from app.core.db.common import CommonSessionLocal
|
||||
from app.core.security.csrf import get_or_create_csrf_token, validate_csrf
|
||||
@@ -74,6 +75,7 @@ from app.modules.billing.client_portal_service import (
|
||||
)
|
||||
from app.modules.billing.services import build_invoice_print_context, create_cashfree_transaction, create_payumoney_transaction, process_cashfree_return, process_cashfree_webhook, process_payumoney_response
|
||||
from app.modules.email_integration.services import send_auth_otp_email
|
||||
from app.modules.documents.models import PermanentClientDocument
|
||||
from app.modules.documents.services import (
|
||||
get_permanent_version,
|
||||
get_version,
|
||||
@@ -623,7 +625,7 @@ async def client_create(request: Request):
|
||||
portal_password=(form.get("portal_password") or "").strip() or None,
|
||||
portal_password_confirm=(form.get("portal_password_confirm") or "").strip() or None,
|
||||
)
|
||||
return RedirectResponse(url=f"/clients/{row.id}", status_code=303)
|
||||
return RedirectResponse(url=f"/documents/permanent/clients/{row.id}?onboarding=1", status_code=303)
|
||||
except Exception as exc:
|
||||
return _render(
|
||||
request,
|
||||
@@ -662,7 +664,12 @@ def client_detail(request: Request, client_id: int):
|
||||
return _redirect_denied()
|
||||
|
||||
audit_logs = list_client_audit_logs(db, row=type("Tmp", (), {"id": row["id"]})(), limit=10) if has("clients.audit_log.view") else []
|
||||
workflow = build_client_acceptance_workflow_payload(db, client_id=client_id)
|
||||
permanent_document_count = db.execute(
|
||||
select(func.count(PermanentClientDocument.id)).where(
|
||||
PermanentClientDocument.client_id == client_id,
|
||||
PermanentClientDocument.is_deleted.is_(False),
|
||||
)
|
||||
).scalar_one()
|
||||
return _render(
|
||||
request,
|
||||
"modules/clients/templates/clients/detail.html",
|
||||
@@ -671,12 +678,7 @@ def client_detail(request: Request, client_id: int):
|
||||
title=f"Client • {row['client_name']}",
|
||||
row=row,
|
||||
audit_logs=audit_logs,
|
||||
acceptance_declarations=workflow.get("acceptance_declarations", []),
|
||||
kyc_verification=workflow.get("kyc_verification"),
|
||||
engagement_letter=workflow.get("engagement_letter"),
|
||||
permanent_document_summary=workflow.get("permanent_document_summary"),
|
||||
permanent_document_count=workflow.get("permanent_document_count", 0),
|
||||
workflow_ready=workflow.get("workflow_ready", False),
|
||||
permanent_document_count=permanent_document_count,
|
||||
scope=scope,
|
||||
can_edit=has("clients.edit"),
|
||||
can_deactivate=has("clients.deactivate"),
|
||||
|
||||
Reference in New Issue
Block a user