<?xml version="1.0" encoding="UTF-8"?>
<archimate:model xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                 xmlns:archimate="http://www.archimatetool.com/archimate"
                 name="Priostack Loan Origination Reference Model"
                 id="id-priostack-model" version="4.0">
  <folder name="Strategy" id="id-folder-strategy" type="strategy">
    <element xsi:type="archimate:Resource" name="Human Underwriter Pool" id="an-underwriter_pool">
      <documentation>Licensed underwriters handling manual review cases</documentation>
    </element>
    <element xsi:type="archimate:CourseOfAction" name="Accelerate Digital Lending" id="an-accelerate_digital_lending">
      <documentation>Three-step plan: IFML portal → real-time ML scoring → BPMN STP.</documentation>
    </element>
    <element xsi:type="archimate:ValueStream" name="Loan Origination Value Stream" id="an-loan_origination_vs">
      <documentation>End-to-end journey from application receipt to fund disbursement.</documentation>
    </element>
  </folder>
  <folder name="Motivation" id="id-folder-motivation" type="motivation">
    <element xsi:type="archimate:Stakeholder" name="Customer" id="an-customer">
      <documentation>Individual or organisation applying for a loan</documentation>
    </element>
    <element xsi:type="archimate:Stakeholder" name="Regulatory Authority" id="an-regulator"/>
    <element xsi:type="archimate:Driver" name="Customer Experience Demand" id="an-customer_experience">
      <documentation>Applicants expect real-time digital loan decisions</documentation>
    </element>
    <element xsi:type="archimate:Driver" name="Regulatory Compliance Pressure" id="an-regulatory_pressure">
      <documentation>GDPR, AML, KYC requirements driving process automation</documentation>
    </element>
    <element xsi:type="archimate:Goal" name="Approve 90% of clean applications within 48 hours" id="an-approve_90pct_within_48h"/>
    <element xsi:type="archimate:Goal" name="Detect fraudulent applications with ≥99% accuracy" id="an-fraud_detection_rate_99"/>
    <element xsi:type="archimate:Outcome" name="Fast Loan Decision" id="an-fast_loan_decision">
      <documentation>Applicant receives a binding decision within 48 h</documentation>
    </element>
    <element xsi:type="archimate:Outcome" name="Reduced Fraud-Related Loss" id="an-reduced_fraud_loss">
      <documentation>Fraud identified before disbursement</documentation>
    </element>
    <element xsi:type="archimate:Constraint" name="Identity Verification Mandatory" id="an-identity_verification_mandatory">
      <documentation>Process cannot proceed to underwriting unless identity is confirmed</documentation>
    </element>
    <element xsi:type="archimate:Constraint" name="Maximum Loan Cap" id="an-max_loan_amount">
      <documentation>No loan may exceed 500 000 currency units (regulatory mandate)</documentation>
    </element>
  </folder>
  <folder name="Business" id="id-folder-business" type="business">
    <element xsi:type="archimate:BusinessObject" name="Audit Record" id="an-audit_record"/>
    <element xsi:type="archimate:BusinessObject" name="Credit Profile" id="an-credit_profile"/>
    <element xsi:type="archimate:BusinessObject" name="Loan Application" id="an-loan_application">
      <documentation>A formal request for a loan with applicant and financial data</documentation>
    </element>
    <element xsi:type="archimate:BusinessRole" name="Applicant" id="an-applicant">
      <documentation>Party requesting the loan</documentation>
    </element>
    <element xsi:type="archimate:BusinessRole" name="Compliance Officer" id="an-compliance_officer">
      <documentation>Ensures regulatory adherence</documentation>
    </element>
    <element xsi:type="archimate:BusinessRole" name="Fraud Investigator" id="an-fraud_investigator">
      <documentation>Investigates anomalous cases</documentation>
    </element>
    <element xsi:type="archimate:BusinessRole" name="Loan Officer" id="an-loan_officer">
      <documentation>Evaluates loan eligibility</documentation>
    </element>
    <element xsi:type="archimate:BusinessRole" name="Risk Analyst" id="an-risk_analyst">
      <documentation>Assesses credit risk</documentation>
    </element>
    <element xsi:type="archimate:BusinessCapability" name="Loan Origination" id="an-loan_origination"/>
    <element xsi:type="archimate:BusinessCapability" name="Compliance &amp; Fraud Detection" id="an-compliance"/>
    <element xsi:type="archimate:BusinessCapability" name="Credit Assessment" id="an-credit_assessment"/>
    <element xsi:type="archimate:BusinessCapability" name="Risk Management" id="an-risk_management"/>
    <element xsi:type="archimate:BusinessService" name="Credit Scoring Service" id="an-credit_scoring_svc"/>
    <element xsi:type="archimate:BusinessService" name="Fraud Detection Service" id="an-fraud_detection_svc"/>
    <element xsi:type="archimate:BusinessService" name="Identity Verification Service" id="an-identity_verification_svc"/>
    <element xsi:type="archimate:BusinessService" name="Applicant Notification Service" id="an-notification_svc"/>
    <element xsi:type="archimate:BusinessProcess" name="Fraud Investigation Case" id="an-fraud_investigation"/>
    <element xsi:type="archimate:BusinessProcess" name="Loan Approval Process" id="an-loan_approval">
      <documentation>Structured BPMN backbone; adaptive CMMN overlay for anomalous cases</documentation>
    </element>
    <element xsi:type="archimate:BusinessFunction" name="Approve Loan" id="an-fn_approve"/>
    <element xsi:type="archimate:BusinessFunction" name="Assess Risk" id="an-fn_assess"/>
    <element xsi:type="archimate:BusinessFunction" name="Fraud Investigation" id="an-fn_investigate"/>
    <element xsi:type="archimate:BusinessFunction" name="Manual Review" id="an-fn_manual_review"/>
    <element xsi:type="archimate:BusinessFunction" name="Notify Applicant" id="an-fn_notify"/>
    <element xsi:type="archimate:BusinessFunction" name="Validate Identity" id="an-fn_validate"/>
    <element xsi:type="archimate:BusinessEvent" name="Anomalous Trajectory Detected" id="an-evt_anomaly_detected"/>
    <element xsi:type="archimate:BusinessEvent" name="Decision Made" id="an-evt_decided"/>
    <element xsi:type="archimate:BusinessEvent" name="Risk Assessment Completed" id="an-evt_risk_assessed"/>
    <element xsi:type="archimate:BusinessEvent" name="Application Submitted" id="an-evt_submitted"/>
    <element xsi:type="archimate:BusinessInteraction" name="Loan Application Submission" id="an-ia_application_submission"/>
    <element xsi:type="archimate:BusinessInteraction" name="Decision Notification" id="an-ia_decision_notification"/>
  </folder>
  <folder name="Application" id="id-folder-application" type="application">
    <element xsi:type="archimate:ApplicationComponent" name="Loan Application Portal" id="an-loan_portal"/>
    <element xsi:type="archimate:ApplicationService" name="Loan Submission Service" id="an-loan_submission_svc"/>
    <element xsi:type="archimate:DataObject" name="Decision Result" id="an-decision_result"/>
    <element xsi:type="archimate:DataObject" name="Loan Form Data" id="an-loan_form_data"/>
  </folder>
  <folder name="Technology &amp; Physical" id="id-folder-technology" type="technology">
    <element xsi:type="archimate:TechnologyComponent" name="Audit Log Database" id="an-audit_log_db">
      <documentation>Immutable compliance audit store</documentation>
    </element>
    <element xsi:type="archimate:TechnologyComponent" name="Credit Bureau API" id="an-credit_bureau_api">
      <documentation>External credit scoring REST endpoint</documentation>
    </element>
    <element xsi:type="archimate:TechnologyComponent" name="Notification Gateway" id="an-notification_gateway">
      <documentation>SMS/email delivery service</documentation>
    </element>
    <element xsi:type="archimate:TechnologyService" name="Audit Logger" id="an-tsvc_audit"/>
    <element xsi:type="archimate:TechnologyService" name="Credit Check Service" id="an-tsvc_credit_check"/>
    <element xsi:type="archimate:TechnologyService" name="Notification Dispatch Service" id="an-tsvc_notify"/>
    <element xsi:type="archimate:TechnologyInterface" name="Credit Bureau Inbound" id="an-ti_credit_bureau_inbound"/>
    <element xsi:type="archimate:TechnologyInterface" name="Notification Outbound" id="an-ti_notification_outbound"/>
    <element xsi:type="archimate:TechnologyProcess" name="Credit Check Pipeline" id="an-tp_credit_pipeline"/>
  </folder>
  <folder name="Implementation &amp; Migration" id="id-folder-migration" type="implementation_migration">
    <element xsi:type="archimate:Plateau" name="Current State — As-Is (2024)" id="an-plateau_current">
      <documentation>Mostly manual process: paper ID checks, batch overnight credit scoring.</documentation>
    </element>
    <element xsi:type="archimate:Plateau" name="Target State — To-Be (2027)" id="an-plateau_target_2027">
      <documentation>Fully digital: IFML portal, real-time ML fraud scoring, BPMN STP.</documentation>
    </element>
    <element xsi:type="archimate:WorkPackage" name="Automate BPMN Straight-Through Processing" id="an-wp_bpmn_stp"/>
    <element xsi:type="archimate:WorkPackage" name="Build &amp; Deploy IFML Self-Service Portal" id="an-wp_ifml_portal"/>
    <element xsi:type="archimate:WorkPackage" name="Deploy Real-time ML Fraud Scoring Pipeline" id="an-wp_realtime_ml"/>
    <element xsi:type="archimate:Deliverable" name="Loan Portal v1.0" id="an-del_loan_portal_v1">
      <documentation>Customer-facing IFML portal integrated with BPMN loan process.</documentation>
    </element>
    <element xsi:type="archimate:Deliverable" name="ML Fraud Scoring Service v2.0" id="an-del_ml_scoring_v2">
      <documentation>Real-time inference microservice replacing nightly batch job.</documentation>
    </element>
    <element xsi:type="archimate:Deliverable" name="BPMN STP Process v1.0" id="an-del_stp_process">
      <documentation>Automated straight-through path for clean low-risk applications.</documentation>
    </element>
    <element xsi:type="archimate:Gap" name="Digital Front-End Gap" id="an-gap_digital_frontend">
      <documentation>No self-service portal; customers apply only via branch office.</documentation>
    </element>
    <element xsi:type="archimate:Gap" name="Real-time Fraud Scoring Gap" id="an-gap_realtime_scoring">
      <documentation>Batch scoring introduces 24 h delay; target requires &lt; 500 ms ML inference.</documentation>
    </element>
  </folder>
  <folder name="Relations" id="id-folder-relations" type="relations">
    <element xsi:type="archimate:RealizationRelationship" id="rel-1" source="an-accelerate_digital_lending" target="an-loan_origination"/>
    <element xsi:type="archimate:RealizationRelationship" id="rel-2" source="an-accelerate_digital_lending" target="an-credit_assessment"/>
    <element xsi:type="archimate:RealizationRelationship" id="rel-3" source="an-accelerate_digital_lending" target="an-fraud_detection"/>
    <element xsi:type="archimate:AssociationRelationship" id="rel-4" source="an-accelerate_digital_lending" target="an-plateau_target_2027"/>
    <element xsi:type="archimate:AssociationRelationship" id="rel-5" source="an-loan_origination_vs" target="an-loan_origination"/>
    <element xsi:type="archimate:AssociationRelationship" id="rel-6" source="an-loan_origination_vs" target="an-credit_assessment"/>
    <element xsi:type="archimate:AssociationRelationship" id="rel-7" source="an-loan_origination_vs" target="an-loan_origination"/>
    <element xsi:type="archimate:AssociationRelationship" id="rel-8" source="an-loan_origination_vs" target="an-loan_origination"/>
    <element xsi:type="archimate:AssociationRelationship" id="rel-9" source="an-underwriter_pool" target="an-loan_origination"/>
    <element xsi:type="archimate:AssociationRelationship" id="rel-10" source="an-customer_experience" target="an-customer"/>
    <element xsi:type="archimate:AssociationRelationship" id="rel-11" source="an-regulatory_pressure" target="an-regulator"/>
    <element xsi:type="archimate:RealizationRelationship" id="rel-12" source="an-approve_90pct_within_48h" target="an-fast_loan_decision"/>
    <element xsi:type="archimate:RealizationRelationship" id="rel-13" source="an-fraud_detection_rate_99" target="an-reduced_fraud_loss"/>
    <element xsi:type="archimate:CompositionRelationship" id="rel-14" source="an-compliance" target="an-loan_origination"/>
    <element xsi:type="archimate:CompositionRelationship" id="rel-15" source="an-credit_assessment" target="an-loan_origination"/>
    <element xsi:type="archimate:CompositionRelationship" id="rel-16" source="an-risk_management" target="an-loan_origination"/>
    <element xsi:type="archimate:ServingRelationship" id="rel-17" source="an-credit_scoring_svc" target="an-credit_assessment"/>
    <element xsi:type="archimate:ServingRelationship" id="rel-18" source="an-credit_scoring_svc" target="an-risk_management"/>
    <element xsi:type="archimate:AssignmentRelationship" id="rel-19" source="an-risk_analyst" target="an-credit_scoring_svc"/>
    <element xsi:type="archimate:ServingRelationship" id="rel-20" source="an-fraud_detection_svc" target="an-compliance"/>
    <element xsi:type="archimate:AssignmentRelationship" id="rel-21" source="an-fraud_investigator" target="an-fraud_detection_svc"/>
    <element xsi:type="archimate:ServingRelationship" id="rel-22" source="an-identity_verification_svc" target="an-credit_assessment"/>
    <element xsi:type="archimate:AssignmentRelationship" id="rel-23" source="an-loan_officer" target="an-identity_verification_svc"/>
    <element xsi:type="archimate:ServingRelationship" id="rel-24" source="an-notification_svc" target="an-loan_origination"/>
    <element xsi:type="archimate:AssignmentRelationship" id="rel-25" source="an-loan_officer" target="an-notification_svc"/>
    <element xsi:type="archimate:RealizationRelationship" id="rel-26" source="an-fn_approve" target="an-credit_assessment"/>
    <element xsi:type="archimate:RealizationRelationship" id="rel-27" source="an-fn_assess" target="an-risk_management"/>
    <element xsi:type="archimate:RealizationRelationship" id="rel-28" source="an-fn_investigate" target="an-compliance"/>
    <element xsi:type="archimate:RealizationRelationship" id="rel-29" source="an-fn_manual_review" target="an-credit_assessment"/>
    <element xsi:type="archimate:RealizationRelationship" id="rel-30" source="an-fn_notify" target="an-loan_origination"/>
    <element xsi:type="archimate:RealizationRelationship" id="rel-31" source="an-fn_validate" target="an-credit_assessment"/>
    <element xsi:type="archimate:AssociationRelationship" id="rel-32" source="an-fraud_investigation" target="an-fn_investigate"/>
    <element xsi:type="archimate:AssignmentRelationship" id="rel-33" source="an-fraud_investigator" target="an-fraud_investigation"/>
    <element xsi:type="archimate:AssignmentRelationship" id="rel-34" source="an-compliance_officer" target="an-fraud_investigation"/>
    <element xsi:type="archimate:AssociationRelationship" id="rel-35" source="an-loan_approval" target="an-fn_validate"/>
    <element xsi:type="archimate:AssociationRelationship" id="rel-36" source="an-loan_approval" target="an-fn_assess"/>
    <element xsi:type="archimate:AssociationRelationship" id="rel-37" source="an-loan_approval" target="an-fn_approve"/>
    <element xsi:type="archimate:AssociationRelationship" id="rel-38" source="an-loan_approval" target="an-fn_manual_review"/>
    <element xsi:type="archimate:AssociationRelationship" id="rel-39" source="an-loan_approval" target="an-fn_notify"/>
    <element xsi:type="archimate:AssignmentRelationship" id="rel-40" source="an-loan_officer" target="an-loan_approval"/>
    <element xsi:type="archimate:AssignmentRelationship" id="rel-41" source="an-risk_analyst" target="an-loan_approval"/>
    <element xsi:type="archimate:AssociationRelationship" id="rel-42" source="an-ia_application_submission" target="an-applicant"/>
    <element xsi:type="archimate:AssociationRelationship" id="rel-43" source="an-ia_application_submission" target="an-loan_officer"/>
    <element xsi:type="archimate:AssociationRelationship" id="rel-44" source="an-ia_decision_notification" target="an-loan_officer"/>
    <element xsi:type="archimate:AssociationRelationship" id="rel-45" source="an-ia_decision_notification" target="an-applicant"/>
    <element xsi:type="archimate:ServingRelationship" id="rel-46" source="an-loan_submission_svc" target="an-loan_origination"/>
    <element xsi:type="archimate:CompositionRelationship" id="rel-47" source="an-loan_portal" target="an-loan_submission_svc"/>
    <element xsi:type="archimate:RealizationRelationship" id="rel-48" source="an-wp_bpmn_stp" target="an-plateau_target_2027"/>
    <element xsi:type="archimate:RealizationRelationship" id="rel-49" source="an-wp_ifml_portal" target="an-plateau_target_2027"/>
    <element xsi:type="archimate:RealizationRelationship" id="rel-50" source="an-wp_realtime_ml" target="an-plateau_target_2027"/>
    <element xsi:type="archimate:AssociationRelationship" id="rel-51" source="an-del_loan_portal_v1" target="an-wp_ifml_portal"/>
    <element xsi:type="archimate:AssociationRelationship" id="rel-52" source="an-del_ml_scoring_v2" target="an-wp_realtime_ml"/>
    <element xsi:type="archimate:AssociationRelationship" id="rel-53" source="an-del_stp_process" target="an-wp_bpmn_stp"/>
    <element xsi:type="archimate:AssociationRelationship" id="rel-54" source="an-gap_digital_frontend" target="an-plateau_current"/>
    <element xsi:type="archimate:AssociationRelationship" id="rel-55" source="an-gap_digital_frontend" target="an-plateau_target_2027"/>
    <element xsi:type="archimate:AssociationRelationship" id="rel-56" source="an-gap_realtime_scoring" target="an-plateau_current"/>
    <element xsi:type="archimate:AssociationRelationship" id="rel-57" source="an-gap_realtime_scoring" target="an-plateau_target_2027"/>
  </folder>
  <folder name="Views" id="id-folder-views" type="diagrams"/>
</archimate:model>
