NC
HomeGuidesMechanics

Changelog entry

Surrender terms data model + composer API (P3.3A)

2026-03-24

  • New `SurrenderTerms` model tracks formal negotiation records per war: proposer, typed term conditions (JSON array), custom treaty name, status (`PROPOSED`/`ACCEPTED`/`DECLINED`/`COUNTERED`/`EXPIRED`), and counter-round.
  • New `ReparationObligation` model stores post-war debt rows created when terms are accepted: debtor/creditor nation, asset, total/paid amount, per-tick payment schedule, start/end tick, and status.
  • Five term condition types supported: **cash lump sum**, **cash installment**, **resource tribute**, **forced treaty**, and **non-aggression window**.
  • Propose/accept/decline/counter API under `POST /api/wars/[id]/surrender-terms` and `/api/wars/[id]/surrender-terms/[termsId]/{accept,decline,counter}`.
  • Counter-offer negotiation is capped at 3 rounds (`WAR_SURRENDER_TERMS_MAX_COUNTER_ROUNDS`); fourth counter returns a 400.
  • Accepting terms ends the war immediately and creates `ReparationObligation` rows for all payable conditions.