Add public branded Postbank rates guide and footer link

This commit is contained in:
unimatrixgit 2026-11-15 00:11:42 +01:00
commit 458125d04d
5 changed files with 15 additions and 0 deletions

View file

@ -0,0 +1,9 @@
import {PACKAGES,BANK_VERSION} from '../node/postbank-catalogue.mjs';
import {CREDIT_PRODUCTS,CREDIT_VERSION} from '../node/postbank-credit-model.mjs';
import {createHash} from 'node:crypto';
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 &amp; 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"><script src="/portal-navigation.js" defer></script></head><body><header><a href="/">DuneRealms</a></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 &amp; 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 &amp; packages</a><a href="#credit">Credit rates</a><a href="#services">Services &amp; 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 &amp; 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 &amp; 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 &amp; Charges</a><a href="https://support.dunerealms.com/">Contact support</a></footer></body></html>`;
}

View file

@ -1,3 +1,4 @@
import {bankRatesPage} from './bank-rates-page.mjs';
import{withCanonicalMenu,MAIN_MENU}from'./main-menu.mjs';
import{recordPageUpdates,withMenuBadges}from'./menu-updates.mjs';
import{updatePortalNavigation}from'./portal-navigation.mjs';
@ -28,6 +29,7 @@ function preparePublicHtml(html){
}
return result;
}
writeFileSync(path.join(web,'rates-and-charges.html'),bankRatesPage());
let assetCount=0;let assetWriter=null;const types={'.html':'text/html; charset=utf-8','.css':'text/css; charset=utf-8','.js':'text/javascript; charset=utf-8','.json':'application/json; charset=utf-8','.webp':'image/webp','.png':'image/png','.mp4':'video/mp4','.zip':'application/zip','.svg':'image/svg+xml'};
function collect(directory){for(const entry of readdirSync(directory).sort()){const p=path.join(directory,entry);if(statSync(p).isDirectory())collect(p);else{const relative=path.relative(web,p).split(path.sep).join('/');if(/^assets\/seals\/[^/]+-provenance\.txt$/.test(relative))continue;const type=types[path.extname(entry)];if(!type)throw Error('Unexpected asset: '+entry);const bytes=readFileSync(p);const payload=relative.endsWith('.html')?Buffer.from(preparePublicHtml(bytes.toString('utf8'))):relative==='portal-navigation.js'?Buffer.from(withCanonicalMenu(withMenuBadges(bytes.toString('utf8')))):bytes;writeSync(assetWriter,JSON.stringify('/'+relative)+':['+JSON.stringify(type)+','+JSON.stringify(payload.toString('base64'))+'],');assetCount++}}}if(existsSync(dist)){const resolved=path.resolve(dist);if(resolved!==path.join(root,'dist'))throw Error('Invalid dist directory');rmSync(resolved,{recursive:true,force:true})}
mkdirSync(path.join(dist,'server'),{recursive:true});mkdirSync(path.join(dist,'.openai'),{recursive:true});assetWriter=openSync(path.join(dist,'server/index.js'),'w');writeSync(assetWriter,'const ASSET_DATA={');collect(web);writeSync(assetWriter,'};\n');

View file

@ -0,0 +1 @@
*{box-sizing:border-box}html{scroll-behavior:smooth}body{margin:0;background:#091f18;color:#e9eadb;font:16px/1.6 Arial,sans-serif}body>header,footer{padding:22px 5%;border-bottom:1px solid #756337}a{color:#e7cc88}main{max-width:1240px;margin:48px auto;padding:0 28px}.hero{display:flex;gap:48px;align-items:center;padding:54px;border:1px solid #b99a53;border-radius:24px;background:radial-gradient(at top left,#355540,#102e24 70%)}.hero img{width:260px;height:160px;object-fit:contain}.eyebrow{font-size:11px;letter-spacing:.2em;color:#c8af70}h1{font:54px/1.12 Georgia,serif;color:#f2da9d;margin:12px 0}h2{font:32px/1.3 Georgia,serif;color:#f2da9d;margin:10px 0}h3{font-size:18px;color:#ecd79e}.stamp{display:inline-block;border:1px solid #8c8158;border-radius:40px;padding:6px 14px;font-size:11px}.sections{display:flex;gap:12px;margin:24px 0}.sections a,button{border:1px solid #9f874f;border-radius:9px;padding:12px 20px;text-decoration:none;background:#19382c;color:#efdaa3;font-weight:bold}.notice{border-left:4px solid #c5aa64;background:#203c30;border-radius:8px;padding:20px 26px;margin:32px 0}.notice p{margin:5px 0}section[id]{margin:48px 0}.table-wrap{overflow:auto;border:1px solid #55765a;border-radius:14px}table{width:100%;border-collapse:collapse;font-size:14px;text-align:left}thead{background:#294e3d;color:#e2c77d}th,td{padding:17px 20px;border-bottom:1px solid #365342}tbody tr:last-child>*{border:0}tbody th{color:#f2e0b4}tbody tr:nth-child(even){background:#112e23}.fine{font-size:12px;color:#b6c9bc}.service-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:18px}.service-grid article{border:1px solid #597659;border-radius:14px;padding:24px;background:#153328}.service-grid strong{font:26px Georgia,serif;color:#abd8c4}.service-grid p{font-size:14px;color:#c2d0c4}.document{display:flex;align-items:center;gap:35px;padding:28px;border:1px solid #9f874f;border-radius:14px}.document p{font-size:13px}.document button{white-space:nowrap;cursor:pointer}footer{display:flex;gap:26px;margin-top:55px}@media print{body{background:white;color:#182d23}body>header,.sections,button,footer{display:none}main{margin:0;max-width:none}.hero{padding:20px}.hero img{width:170px;height:90px}h1{font-size:32px}h1,h2,h3,.fine{color:#263c2c}section[id]{margin:24px 0}th,td{padding:9px}section,article{break-inside:avoid}.service-grid{display:block}.service-grid article,.notice{background:white}.service-grid article{padding:8px}.document{padding:12px}}

View file

@ -61,3 +61,5 @@
/* Public developer API portal link in the shared footer */
(()=>{function sync(){const nav=document.querySelector('.dune-shared-footer nav');if(!nav)return;let a=nav.querySelector('[data-dune-api-footer]');if(!a){a=document.createElement('a');a.dataset.duneApiFooter='1';nav.append(a);}a.href='https://www.dunerealms.com/api.html';a.textContent='Developer API';}sync();new MutationObserver(sync).observe(document.body,{childList:true});})();
(()=>{function sync(){const nav=document.querySelector('.dune-shared-footer nav');if(!nav||nav.querySelector('[data-bank-rates]'))return;const a=document.createElement('a');a.dataset.bankRates='1';a.href='https://www.dunerealms.com/rates-and-charges.html';a.textContent='Rates & Charges';nav.append(a);}sync();new MutationObserver(sync).observe(document.body,{childList:true,subtree:true});})();

File diff suppressed because one or more lines are too long