MC/website/node/codex-credit-dossier.mjs
2026-11-27 23:43:05 +00:00

6 lines
703 B
JavaScript

import {codexLoanReference,codexLoanStatus} from '../control-panel/public/codex-dossier-format.mjs';
// Projection adapter: the bank is authoritative. No copied balances or parallel
// decision state. Call only after the existing bank access check has succeeded.
export function creditCodexDossier(loan){
return {id:loan.id,type:'loan-application',reference:codexLoanReference(loan.id),status:codexLoanStatus(loan.state),sourceState:loan.state,revision:Number(loan.version||1),createdAt:Number(loan.created_at),updatedAt:Number(loan.updated_at),links:{user:'/?codexLoan='+encodeURIComponent(loan.id)+'#bank/bank-loans',staff:'/?codexLoan='+encodeURIComponent(loan.id)+'#bank/loan-administration'}};
}