MC/website/scripts/bank-rates-page.mjs
2026-11-27 23:43:05 +00:00

13 lines
5.8 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import {ratesReferenceHTML,RATES_GUIDE_EDITION} from './rates-reference.mjs';
import {rihlaRatesSection} from './rihla-rates-section.mjs';
import {claimRatesSection} from './claim-rates-section.mjs';
import {SHARED_HEADER} from './portal-navigation.mjs';
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.unlimitedInstant?'Unlimited':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, organisation claim tariffs 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 &amp; Charges</h1><p>Banking, taxation, reserve policy and the rules behind the realm economy.</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><a href="#claims">Land claims</a><a href="#tax-rules">Tax rules</a><a href="#publication-charges">Publication charges</a><a href="#reserve-instruments">Reserve &amp; keys</a><a href="#economy-formulas">Formulas</a><a href="#payroll-tax">Payroll tax</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 and Pro include a savings account. Pro includes unlimited instant payments with no per-transfer fee. Transfers have no package amount cap; available funds and payment security apply. 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 a first instalment of 5% from your own funds before issue. This instalment counts toward repayment and reduces the remaining loan balance. 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>Public register</strong><p>Configured VAT, account tax and payroll deductions are loaded from the public bank publication. The tax-rule tables below explain their application.</p></article></div></section>${rihlaRatesSection()}${claimRatesSection()}${ratesReferenceHTML()}<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. The live financial register supplies configured bank and tax values. The expanded handbook also records reserve instruments, calculation rules and availability.</p></div><div class="document-actions"><a class="pdf-download guide-download" href="/downloads/dunerealms-rates-guide-20261121.pdf">Download complete guide · PDF</a><span class="fine">Handbook ${RATES_GUIDE_EDITION}</span></div></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>`;
}