forked from unimatrix/web
Publish versioned bank tariff PDFs and clarify author and credit layouts
This commit is contained in:
parent
4d8805326d
commit
f226ed39b4
2 changed files with 239 additions and 14 deletions
|
|
@ -6,5 +6,5 @@ export function bankRatesPage(){
|
|||
const version=createHash('sha256').update(JSON.stringify([PACKAGES,CREDIT_PRODUCTS])).digest('hex').slice(0,10);
|
||||
const packages=PACKAGES.map(p=>`<tr><th>${p.name}</th><td>${p.kinds.join(' / ')}</td><td>${(p.monthly/100).toFixed(2)} DM</td><td>${p.extra}</td><td>${p.extra?(p.extraFee/100).toFixed(2)+' DM':'—'}</td><td>${p.instant}</td></tr>`).join('');
|
||||
const credit=CREDIT_PRODUCTS.filter(p=>!p.revolving).map(p=>`<tr><th>${p.name}</th><td>${(p.annualBps/100).toFixed(2)}%</td><td>${p.min}–${p.max} DM</td><td>${p.terms?p.terms.join(', '):'Up to '+p.maxMonths} months</td></tr>`).join('');
|
||||
return `<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Rates & Charges | Imperial Postbank</title><meta name="description" content="Public Imperial Postbank package fees, credit rates and service conditions in Dunemarks."><link rel="stylesheet" href="/bank-rates.css"><link rel="stylesheet" href="/portal-navigation.css"><script src="/portal-navigation.js" defer></script></head><body>${SHARED_HEADER}<main><section class="hero"><img src="/assets/imperial-postbank-v2.png" alt="Imperial Postbank"><div><p class="eyebrow">YOUR MONEY. CLEAR TERMS.</p><h1>Rates & Charges</h1><p>A clear guide to your banking costs.</p><span class="stamp">PUBLIC TARIFF GUIDE · ${version}</span></div></section><nav class="sections" aria-label="Tariff sections"><a href="#packages">Accounts & packages</a><a href="#credit">Credit rates</a><a href="#services">Services & taxes</a></nav><aside class="notice"><strong>Alpha service notice</strong><p>All amounts are fictional Dunemarks (DM). Published monthly package prices are not yet collected automatically. This is a game economy, not a real-money banking service.</p></aside><section id="packages"><span class="eyebrow">01 / EVERYDAY BANKING</span><h2>Accounts & packages</h2><p>One current account is included in each package.</p><div class="table-wrap"><table><thead><tr><th>Package</th><th>Client</th><th>Monthly price</th><th>Extra current accounts¹</th><th>Each / month¹</th><th>Instant quota / month</th></tr></thead><tbody>${packages}</tbody></table></div><p class="fine">¹ Published additional-account limits and prices, subject to feature availability. Flow includes a savings account. Start has no instant payments. Instant quotas are server usage limits.</p></section><section id="credit"><span class="eyebrow">02 / BORROWING</span><h2>Credit rates</h2><p>Annual rates for new applications. Your accepted contract and repayment schedule govern your loan.</p><div class="table-wrap"><table><thead><tr><th>Product</th><th>Annual rate</th><th>Principal range</th><th>Available terms</th></tr></thead><tbody>${credit}</tbody></table></div><p class="fine">Launch grants are repayable at 0% interest. Ordinary loans require review and 25% blocked DM collateral. Eligibility, available funding and refinancing conditions apply. Existing fixed-rate contracts retain their agreed rate. Revolving credit is not available.</p></section><section id="services"><span class="eyebrow">03 / TRANSPARENCY</span><h2>Services & taxes</h2><div class="service-grid"><article><h3>Monthly statements</h3><strong>Free</strong><p>Automatically archived PDF statements after month-end.</p></article><article><h3>Balance Guard</h3><strong>1.00 DM / month</strong><p>Published optional price per eligible account. Preference saving is available; protection and charging are not active yet.</p></article><article><h3>Tax policy</h3><strong>Not yet published</strong><p>VAT and account-tax rates await central configuration. No unconfirmed rate is presented as active.</p></article></div></section><section class="document"><div><h2>Your tariff guide</h2><p>Generated from the bank catalogues on each build. Version ${version}. Package terms: ${BANK_VERSION}. Credit terms: ${CREDIT_VERSION}.</p><p class="fine">Catalogue references identify source terms, not a new effective date. Administrative rate editing and automatic downloadable PDF publication are planned. You can print or save this guide as PDF now.</p></div><button onclick="window.print()">Print / Save as PDF</button></section><p class="fine">No private account or transaction data is published here.</p></main><footer><a href="/">DuneRealms</a><a href="/rates-and-charges.html">Rates & Charges</a><a href="https://support.dunerealms.com/">Contact support</a></footer></body></html>`;
|
||||
return `<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Rates & Charges | Imperial Postbank</title><meta name="description" content="Public Imperial Postbank package fees, credit rates and service conditions in Dunemarks."><link rel="stylesheet" href="/bank-rates.css"><link rel="stylesheet" href="/portal-navigation.css"><script src="/portal-navigation.js" defer></script><script src="/bank-rates.js" defer></script></head><body>${SHARED_HEADER}<main><section class="hero"><img src="/assets/imperial-postbank-v2.png" alt="Imperial Postbank"><div><p class="eyebrow">YOUR MONEY. CLEAR TERMS.</p><h1>Rates & Charges</h1><p>A clear guide to your banking costs.</p><span class="stamp">PUBLIC TARIFF GUIDE · ${version}</span></div></section><nav class="sections" aria-label="Tariff sections"><a href="#packages">Accounts & packages</a><a href="#credit">Credit rates</a><a href="#services">Services & taxes</a></nav><aside class="notice"><strong>Alpha service notice</strong><p>All amounts are fictional Dunemarks (DM). Published monthly package prices are not yet collected automatically. This is a game economy, not a real-money banking service.</p></aside><section id="packages"><span class="eyebrow">01 / EVERYDAY BANKING</span><h2>Accounts & packages</h2><p>One current account is included in each package.</p><div class="table-wrap"><table><thead><tr><th>Package</th><th>Client</th><th>Monthly price</th><th>Extra current accounts¹</th><th>Each / month¹</th><th>Instant quota / month</th></tr></thead><tbody>${packages}</tbody></table></div><p class="fine">¹ Published additional-account limits and prices, subject to feature availability. Flow includes a savings account. Start has no instant payments. Instant quotas are server usage limits.</p></section><section id="credit"><span class="eyebrow">02 / BORROWING</span><h2>Credit rates</h2><p>Annual rates for new applications. Your accepted contract and repayment schedule govern your loan.</p><div class="table-wrap"><table><thead><tr><th>Product</th><th>Annual rate</th><th>Principal range</th><th>Available terms</th></tr></thead><tbody>${credit}</tbody></table></div><p class="fine">Launch grants are repayable at 0% interest. Ordinary loans require review and 25% blocked DM collateral. Eligibility, available funding and refinancing conditions apply. Existing fixed-rate contracts retain their agreed rate. Revolving credit is not available.</p></section><section id="services"><span class="eyebrow">03 / TRANSPARENCY</span><h2>Services & taxes</h2><div class="service-grid"><article><h3>Monthly statements</h3><strong>Free</strong><p>Automatically archived PDF statements after month-end.</p></article><article><h3>Balance Guard</h3><strong>1.00 DM / month</strong><p>Published optional price per eligible account. Preference saving is available; protection and charging are not active yet.</p></article><article><h3>Tax policy</h3><strong>Not yet published</strong><p>VAT and account-tax rates await central configuration. No unconfirmed rate is presented as active.</p></article></div></section><section class="document"><div><h2>Your tariff guide</h2><p>Generated from the bank catalogues on each build. Version ${version}. Package terms: ${BANK_VERSION}. Credit terms: ${CREDIT_VERSION}.</p><p class="fine">Catalogue references identify source terms, not a new effective date. Administrative rate editing and automatic downloadable PDF publication are planned. You can print or save this guide as PDF now.</p></div><button onclick="window.print()">Print / Save as PDF</button></section><p class="fine">No private account or transaction data is published here.</p></main><footer><a href="/">DuneRealms</a><a href="/rates-and-charges.html">Rates & Charges</a><a href="https://support.dunerealms.com/">Contact support</a></footer></body></html>`;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ import {openDatabase} from '../node/mysql.mjs';import {openPostbankDatabase} fro
|
|||
import {canRunScheduler} from '../node/scheduler-authority.mjs';import {PostbankPayroll} from '../node/postbank-payroll.mjs';
|
||||
import {PostbankFinancialPolicies} from '../node/postbank-financial-policy.mjs';import {createPostbankAuthority} from '../node/postbank-authority.mjs';
|
||||
import {randomUUID} from 'node:crypto';
|
||||
import {ensureRatesPublication,PostbankRatePublications} from '../node/postbank-rate-publications.mjs';
|
||||
if(process.argv[1]&&fileURLToPath(import.meta.url)===resolve(process.argv[1])){
|
||||
const central=await openDatabase(process.env),bank=await openPostbankDatabase(process.env);
|
||||
try{
|
||||
|
|
@ -11,6 +12,9 @@ if(process.argv[1]&&fileURLToPath(import.meta.url)===resolve(process.argv[1])){
|
|||
const payroll=new PostbankPayroll(central,bank),preview=await payroll.overview();
|
||||
if(!process.argv.includes('--apply'))console.log(JSON.stringify({plan:true,eligibleStaff:preview.eligibleCount,enabled:preview.policy.value.enabled,payDay:preview.policy.value.payDay,missingAccountPackage:'pb_start',missingAccountType:'108'}));
|
||||
else{
|
||||
const publication=await ensureRatesPublication(bank,user.id),publisher=new PostbankRatePublications(bank,{python:process.env.POSTBANK_PYTHON,logo:process.env.POSTBANK_STATEMENT_LOGO});
|
||||
for(let i=0;i<20;i++){const row=await bank.first('SELECT state FROM pb_rate_publications WHERE id=?',[publication]);if(row?.state==='ready')break;const result=await publisher.process();if(result.failed||!result.generated)throw Error('The tariff publication must be ready before payroll rollout. Retry after checking the publication worker.');}
|
||||
if((await bank.first('SELECT state FROM pb_rate_publications WHERE id=?',[publication]))?.state!=='ready')throw Error('Tariff publication is not ready.');
|
||||
if(!preview.policy.value.enabled)await new PostbankFinancialPolicies(bank,central,createPostbankAuthority(central,{bank})).save(user,'payroll',{requestId:randomUUID(),version:preview.policy.version,value:{...preview.policy.value,enabled:true},reason:'Owner-authorised P&O rollout and initial payroll tick',confirmed:true});
|
||||
console.log(JSON.stringify(await payroll.process({rollout:true})));
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue

Staff