web/docs/design/CLAIMS-HOME-BLOCK-BRIDGE.md

6.4 KiB
Raw Blame History

Claims: web-first catalogue and future Home Block bridge

Current batch: public rates and CP placeholders only. Catalogue: website/control-panel/public/cp-v2/cp-v2-claim-tariffs.mjs, shared by public guide, Claims page, clan settings and dashboard. It assigns no actual tier or claim. Capacity is total whole chunks per organisation; company/protected capacity is floored after ×1.5. Their cost factors are respectively ×1.5 and ×0.5, applied to both monthly and one-time prices. Do not stack multipliers or recalculate prices from rounded capacity. A chunk is 16×16 blocks, not a radius.

The dossier/workflow backend is UNDECIDED: osTicket or another implementation. Do not add ticket-schema assumptions, provision an osTicket instance or bind web forms to a chosen backend in this phase. Reserved API names describe an interface, not a selected storage/workflow implementation. Backend simulation tests below belong to the later backend/night run, not this placeholder-only web batch.

Subordination transfers claim rights and management authority to the mother organisation. Keep the original entitlement/claim origin traceable and count it only once. ORIGINAL ORGANISATION PAYS: upkeep and unlock/upgrade costs remain attached to that original clan/company even when the mother performs an upgrade. A mother's own tier change does not move the child's costs to the mother. Model acting/managing organisation separately from claim-origin/billable organisation and its applicable tariff. This is not direct bank-account ownership transfer. Future tests must verify child-scoped billing for parent-initiated upgrades and prevent duplicate capacity, wrong-payer charges or inherited tariff discounts merely from choosing the parent as actor.

Reuse existing Imperial Postbank mandates and payment-settlement checks; do not build a second authorisation/banking system. The existing mandate API currently handles per-account user/rank grantees, not an automatic mother-organisation principal. Add only a validated relationship adapter later; never insert a clan UUID as though it were a user, or bypass the account owner's mandate rules. Relationship-derived authority must end on release, remain uneditable as an ordinary personal mandate and not consume ordinary package mandate limits, per the agreed organisation policy. Model that lifecycle through the existing bank authorisation infrastructure. No mandates or balances change in this web batch.

Reserved API contract — not live endpoints

  • Root: /api/v1/claims/home-blocks.
  • Read one block: GET /api/v1/claims/home-blocks/{homeBlockId}.
  • Game intent: POST /api/v1/claims/home-blocks/{homeBlockId}/commands.
  • Verified game results/events: POST /api/v1/claims/home-blocks/{homeBlockId}/events.

Use a stable homeBlockId UUID for upgrades, conquest and server events. Record organisation kind/id, server/world UUID, anchor coordinates, desired/applied revision, mapped WorldGuard region IDs, request/event IDs and correlation IDs. Protected eligibility and authority come from server records, never a browser tariff selector. Protect game requests with the established bridge authentication, bounded freshness/replay checks and explicit server scope; no browser-held game credential or raw shell/WorldGuard command endpoint.

Command names reserved: claim.tier.upgrade, claim.conquest, claim.server-event. Events include claim.upgrade.requested, claim.upgrade.applied, claim.upgrade.failed, claim.conquest.started, claim.conquest.resolved, claim.server-event.started, claim.server-event.ended.

Claim-capacity upgrades originate ingame by RIGHT-CLICKING THE HOME BLOCK. The website reads limits, rates and status. Organisation-status keys continue to use central Redeem; they are distinct from the Home Block's capacity-tier action. Conquest is a later mother-house feature, not part of Basic. Server events also attach to this same Home Block identity. The game implementation comes later.

Future game adapter

Use the existing central API and DuneProtect integration with a WorldGuard adapter. Inspect installed versions and existing region/priority rules before implementing. Map only explicitly managed claim regions. Never overwrite unrelated/global/staff regions. Region dimensions, vertical bounds and overlap policy need confirmation. The web must distinguish requested/quoted, pending game application, applied, failed/reconciliation states. Do not report a changed region or paid upgrade merely because a command was accepted. Bank charging needs durable idempotency and an explicit failure/reconciliation policy across the bank and game systems.

Required backend tests before the ingame adapter exists

Use a fake authenticated game adapter and a dry-run developer command to simulate right-clicks, conquest and server events. Never mutate real balances, regions or ownership during dry runs. Tests must cover correct sequential price/capacity, key/status requirements, owner/officer permissions, protected restrictions, insufficient funds, forged organisation/server/world, stale revisions, duplicate requests/events, missing/occupied anchors, conflicting regions, WorldGuard timeout or rejection, failure/retry reconciliation and replayed conquest/server events. Distinguish simulated acceptance from actual game confirmation. Later run the same contract tests against a real WorldGuard adapter in a test world.

Additional agreed product / Transfer of Power rules

Reuse bank package/product, confirmation, authorisation and ledger patterns; claim tiers remain a separate product kind. Upkeep and unlocks go to the existing sys_tax_treasury account.

Prepare voluntary Transfer of Power for Basic; do NOT implement its backend yet. Sale price must cover the authoritative current debt payoff, including earned interest, rechecked at settlement. Clear debts first, credit the remaining purchase price to the acquired daughter's account and pay tax separately to sys_tax_treasury. No debt forgiveness or claimed debt-free state before confirmed settlement. Reuse existing bank payoff/repayment components later. Both daughter and mother leaders may apply for a loan on the daughter; the daughter remains the debtor.

Basic has NO conquest, organisation political powers or House candidacy. House candidacy requires Keyed/Royal status. Personal citizen voting rights remain absolute; Basic membership must not remove them. These are rules/placeholders, not newly activated political or financial actions.