Skip to content

Regulatory Compliance

Context

Compliance rules verify that the client is not under sanctions and is not a Politically Exposed Person (PEP).

Compliance Check Dependencies

Legend

:green_square: check_compliance — entry point · :blue_square: Internal business function · :orange_square: External service (blackbox)

graph LR
    check_compliance["check_compliance"]:::entry
    CheckBlacklist(["CheckBlacklist"]):::service
    CheckPEP(["CheckPEP"]):::service
    check_compliance -->|.call| CheckBlacklist
    check_compliance -->|.call| CheckPEP

    classDef service fill:#fff3e0,stroke:#e65100,stroke-width:2px,color:#e65100
    classDef func fill:#e3f2fd,stroke:#1565c0,stroke-width:2px,color:#1565c0
    classDef entry fill:#e8f5e9,stroke:#2e7d32,stroke-width:3px,color:#2e7d32

Source Code

def check_compliance(client_id: str) -> ComplianceResult:
    """Check whether the client meets regulatory requirements.

    Verifies against the sanctions blacklist and PEP status.
    """
    on_blacklist = CheckBlacklist().call(client_id)
    pep_info = CheckPEP().call(client_id)

    return ComplianceResult(
        compliant=not on_blacklist and not pep_info.is_pep,
        blacklisted=on_blacklist,
        pep=pep_info.is_pep,
    )

Full Evaluation (Credit + Compliance)

This function orchestrates all verifications:

Legend

:green_square: full_evaluation — entry point · :blue_square: Internal business function · :orange_square: External service (blackbox)

graph LR
    full_evaluation["full_evaluation"]:::entry
    CheckBlacklist(["CheckBlacklist"]):::service
    CheckClientBalance(["CoreBanking / CheckClientBalance"]):::service
    CheckPEP(["CheckPEP"]):::service
    check_compliance["check_compliance"]:::func
    evaluate_credit["evaluate_credit"]:::func
    check_compliance -->|.call| CheckBlacklist
    check_compliance -->|.call| CheckPEP
    full_evaluation --> evaluate_credit
    full_evaluation --> check_compliance
    evaluate_credit -->|.call| CheckClientBalance

    classDef service fill:#fff3e0,stroke:#e65100,stroke-width:2px,color:#e65100
    classDef func fill:#e3f2fd,stroke:#1565c0,stroke-width:2px,color:#1565c0
    classDef entry fill:#e8f5e9,stroke:#2e7d32,stroke-width:3px,color:#2e7d32
def full_evaluation(client_id: str, amount: float) -> FullEvaluationResult:
    """Full evaluation: credit + compliance.

    Combines credit verification and compliance checks
    to produce a final decision.
    """
    credit_ok = evaluate_credit(client_id, amount)
    compliance = check_compliance(client_id)

    return FullEvaluationResult(
        decision="APPROVED" if credit_ok and compliance.compliant else "DENIED",
        credit_ok=credit_ok,
        compliance=compliance,
    )

Playground — full_evaluation

Full evaluation: credit + compliance. Combines credit verification and compliance checks to produce a final decision.

View source code
def full_evaluation(client_id: str, amount: float) -> FullEvaluationResult:
    """Full evaluation: credit + compliance.

    Combines credit verification and compliance checks
    to produce a final decision.
    """
    credit_ok = evaluate_credit(client_id, amount)
    compliance = check_compliance(client_id)

    return FullEvaluationResult(
        decision="APPROVED" if credit_ok and compliance.compliant else "DENIED",
        credit_ok=credit_ok,
        compliance=compliance,
    )
Mock configuration
Test cases
  • No test cases saved yet.