16 lines
9.2 KiB
JavaScript
16 lines
9.2 KiB
JavaScript
import {ECONOMY_POLICY as p} from '../node/jarvis-economy-policy.mjs';
|
||
import {CAMPAIGN_RATES} from '../node/election-campaigns.mjs';
|
||
import {OFFICE_AUCTION_RULES} from '../node/jarvis-office-auctions.mjs';
|
||
import {CLAIM_ORGANISATIONS,claimTariffs,claimMoney} from '../control-panel/public/cp-v2/cp-v2-claim-tariffs.mjs';
|
||
const dm=n=>(n/100).toFixed(2)+' DM';
|
||
export const RATES_GUIDE_EDITION='alpha-1.0.1.2-20261118';
|
||
export function ratesReferenceSections(){return [
|
||
{id:'tax-rules',title:'Tax rules & payment destinations',art:'imperial-postbank-v2.png',paragraphs:['A configured tax rate does not make every website or Minecraft action taxable. The relevant transaction handler must apply the tax and record its ledger entries. No blanket extra tax is added to the prices below.','Rihla: 1% for transfers up to and including 3,000 DM; 5% on the full amount above 3,000 DM. The sender pays principal plus tax; the recipient receives the full principal. Tax rounds upward to the next cent. In-game sending and collection remain a separate integration.'],headers:['Charge','Who pays / basis','Destination / status'],rows:[['Applicable game-sales VAT','Configured public VAT rate; supported taxable sales only','Tax treasury; game-flow integration dependent'],['VAT on bank fees','Configured bank-fee VAT rate shown in the live register','Tax treasury; a zero rate adds no VAT'],['Monthly account tax','Configured fixed amount shown in the live register','A zero amount adds no account tax'],['Package and account charges','Accepted package terms; automated monthly billing remains disabled','Website bank treasury; published fees are not yet monthly collection'],['Rihla transfer tax','Sender; 1% / 5% of full principal','Tax treasury on collection; game execution pending'],['Payroll deductions','Employee social contribution and income tax; employer social contribution is additional','Tax treasury through supported P&O payroll posting'],['Recruitment and campaigns','Publishing organisation or officeholder; accepted quote','Tax treasury; listing charge is distinct from VAT'],['Office auction','Winning bidder; accepted final bid','Tax treasury; losing holds released'],['Claim upkeep / unlock','Original organisation, including upgrades by its mother','Tax treasury; published schedule and supported claim flow apply'],['Server project funding','Approved budget paid from available Tax funds','Dedicated 979 project account; project workflow in development']]},
|
||
{id:'publication-charges',title:'Recruitment, campaigns & office auctions',art:'exchange-political-positions-v1.png',paragraphs:['Recruitment: Basic clans are free. Keyed/Royal recruitment uses 10 DM + 0.25 DM per occupied member. Protected institutions do not use ordinary recruitment. Political custom vacancies use the same agreed recruitment tariff.','Campaign bookings use whole hourly slots, may cover multiple hours and open no earlier than seven days before the election. A featured slot is exclusive for its election scope and hour. Forum/Discord promotion is optional: 25 DM per selected channel per booking, not per hour; retries do not create another charge.'],headers:['Election campaign','Standard / hour','Featured / hour'],rows:Object.entries(CAMPAIGN_RATES).map(([kind,price])=>[({clan_delegate:'Clan Delegate',house:'House leader',bene:'Veiled Concord',guild:'Vaerkring',imperial:'Emperor'})[kind],dm(price),dm(price*1.5)]).concat([['Office auction opening bid',dm(OFFICE_AUCTION_RULES.startMinor),'Minimum increase '+dm(OFFICE_AUCTION_RULES.incrementMinor)]])},
|
||
{id:'reserve-instruments',title:'Federal Reserve & J.A.R.V.I.S. instruments',art:'imperial-postbank-v2.png',paragraphs:['An instrument records a purpose and authority; knowing a reference is not permission. Public references never disclose secret codes. These are fictional game-economy instruments, not real-world securities.','Reserve issuance is restricted to the designated reserve owner and existing administration checks. It uses balanced grant postings to the Tax treasury; this guide creates no reserve budget or money. The new baseline and seasonal budget still require configuration.'],headers:['Instrument / flow','Purpose','Availability'],rows:[['Economic snapshot · ECO-SNAP','Sealed observation, baseline, policy version, index and rates; immutable payload hash','Implemented archival instrument; automatic collection is not connected'],['Reserve grant','Existing owner-controlled issuance to the Tax treasury, recorded in both ledgers','Existing restricted bank flow; no public redeemable reserve key'],['Policy / baseline change','Versioned configuration followed by a new observation','Requires a reviewed implementation or supported dev batch; no invented player code'],['Developer batch instrument','Exact manifest, server identity, short expiry, once-only action and audit receipt','Server/CLI only; never a website generator, download or player entitlement'],['Rihla instrument · RIA','Account-bound transfer reference, parties, amount and state','Private website register; in-game execution pending'],['News record · NEWS','Sealed public fact linked to its source and article','Gazette backend batch; not a redeemable reward']]},
|
||
{id:'economy-formulas',title:'Economic formulas & limits',art:'imperial-postbank-v2.png',paragraphs:['Calculation policy v'+p.version+'. Formula support is implemented; automatic price, savings-interest, lending-rate and wage adjustments are not enabled by publishing this guide. Existing accepted loans keep their contracted rates. Player-set listing prices are not silently rewritten.','M = verified circulating DM; M0 = a strictly positive approved baseline. E is an index, not a direct annual inflation percentage. Unfunded issuance positions and system reserves must be classified by the approved collector; issued minus returned alone is not a complete inflation measure.'],headers:['Calculation','Formula','Limits / meaning'],rows:[['Money index','E = (M / M0)^'+p.moneyExponent,'M0 > 0; a fresh baseline starts at E = 1'],['Demand factor','D = ((sold + '+p.demandSmoothing+') / (offered + '+p.demandSmoothing+'))^'+p.demandExponent,'Verified counts; smoothing avoids empty-market division'],['System price target','target = clamp(base price × E × D, 0.5 × base, 2 × base)','System catalogue prices only; quote policy/version must be stored'],['Published system price','clamp(target, 0.95 × previous, 1.05 × previous)','Maximum ±5% per daily step; round in cents within bounds'],['Savings rate','S = clamp(round(S0 + 500 × (E − 1)), Smin, Smax)','Basis points; +5 percentage points per +1 index unit. Base and bounds require configuration'],['New lending rate','L = clamp(round(L0 + 1000 × (E − 1)), Lmin, Lmax)','Basis points; +10 percentage points per +1 index unit. Existing contracts unchanged'],['Indexed staff wage','target = base wage × E; next = clamp(target, 0.95 × previous, 1.05 × previous)','Maximum ±5% per monthly step; use P&O approved wages'],['Tax-inclusive price','gross = net + applicable tax','Only when that transaction implements the relevant tax rule']]},
|
||
{id:'payroll-formulas',title:'Payroll calculation',art:'nav-staff-v2.webp',paragraphs:['All amounts use integer DM cents. Contribution and tax calculations round to the nearest cent using the existing payroll model. This is a fictional game model with selected Belgian-inspired parameters; household deductions and real-world tax advice are outside its scope.'],headers:['Step','Calculation'],rows:[['Employee contribution','round(gross monthly × employee social rate)'],['Monthly taxable pay','gross monthly − employee contribution'],['Annual progressive tax','Apply the configured marginal bands to 12 × monthly taxable pay'],['Basic allowance credit','Apply the same tax bands to the annual basic allowance; subtract this credit from annual tax, floor at zero'],['Monthly income tax','round(max(annual tax − allowance credit, 0) / 12)'],['Net wage','gross monthly − employee contribution − monthly income tax'],['Employer cost','gross monthly + round(gross monthly × employer social rate)'],['Tax treasury receipt','employee contribution + monthly income tax + employer contribution']]},
|
||
...Object.entries(CLAIM_ORGANISATIONS).map(([kind,group])=>({id:'guide-claims-'+kind,title:group.name+' · claim schedule',paragraphs:['Capacity and price schedule; the published guide does not itself reserve land, upgrade a deed or enable recurring billing.'],headers:['Tier','Chunks','Monthly','Unlock'],rows:claimTariffs(kind).map(r=>[r.code,String(r.chunks),claimMoney(r.upkeepMinor),claimMoney(r.unlockMinor)])}))
|
||
];}
|
||
const escape=s=>String(s).replaceAll('&','&').replaceAll('<','<').replaceAll('>','>').replaceAll('"','"');
|
||
export function ratesReferenceHTML(){return ratesReferenceSections().filter(s=>!s.id.startsWith('guide-claims-')).map(s=>`<section id="${s.id}" class="reference-section"><div class="reference-heading"><img src="/assets/${s.art}" alt=""><div><span class="eyebrow">PUBLIC ECONOMIC REGISTER</span><h2>${escape(s.title)}</h2></div></div>${s.paragraphs.map(t=>`<p>${escape(t)}</p>`).join('')}<div class="table-wrap"><table><thead><tr>${s.headers.map(h=>`<th scope="col">${escape(h)}</th>`).join('')}</tr></thead><tbody>${s.rows.map(row=>`<tr>${row.map(c=>`<td>${escape(c)}</td>`).join('')}</tr>`).join('')}</tbody></table></div></section>`).join('');}
|

Staff