Add extra wage cycles, recheck bank tickers and apply first loan instalments

This commit is contained in:
unimatrixgit 2026-11-15 22:13:52 +01:00
commit ff06ac894e
3 changed files with 184 additions and 74 deletions

View file

@ -25,3 +25,7 @@ explicit --apply --actor=UUID links existing submitted non-grant applications.
Native idempotency mapping and an advisory lock prevent duplicate tickets after
retries. An interrupted creation with an ambiguous native result stops for review
rather than creating another ticket. No native core code is replaced.
## Manual recheck of all bank tickers
The owner-authorized Run Due Scheduled Tasks action rechecks every registered bank ticker, including the bank settlement ticker's loan engine. It also invokes credit support, standing instructions, monthly payroll, tariff publication and statement workers. A completed scheduler slot does not suppress a manual recheck, but an active lease still does. The original cutoff is passed to each worker; payment dates, four-hour settlements, maturity dates and domain idempotency remain authoritative. Intent is audited before workers start, and authority is checked again between tickers. Additional wage cycles are never triggered by this scheduler action.

View file

@ -10,7 +10,7 @@ Website-only credit engine, using the existing central identity API and the inde
- Launch grants: one per personal client, zero interest, borrower-selected monthly repayment within the published term. Consent queues acceptance; bank liquidity is still required.
- Personal, Business and Civic loans: staff review, seven-day offer, separate borrower acceptance, then payout on the bank ticker. A manager cannot approve their own controlled client.
- 25% own-DM collateral is reserved before payout and moved to blocked type106. No inventory collateral. Corporate/Civic obligations and collateral remain within their own client identity.
- New ordinary loans require a first instalment of 5% of the requested loan amount, rounded up to a whole DM cent. Own funds are reserved on offer acceptance and paid to the lender before principal is issued, in the same atomic disbursement transaction. This instalment is a repayment: it reduces remaining principal and the subsequent repayment schedule, with interest calculated on that reduced balance. No new blocked collateral is collected. Launch grants remain exempt. Historical contracts keep their recorded collateral and release rules.
- Refinancing replaces all active interest-bearing contracts for one client; zero-interest grants remain separate. Historical contracts and ledger entries are retained; no additional cash is paid out. Current payoff changes invalidate the queued refinance rather than overpay.
- Election concessions use actual current winning terms, not provisional/custom ranks. Personal discount is limited to the first5,000DM per eligible election event; corporate concessions require a real CEO change. Reuse is prevented by an atomic event claim.
- The one-month advance is a fixed loan paid into the current account; it does not enable a negative account balance. True account-overdraft permissions remain a later integration.

View file

@ -58,3 +58,9 @@ or individual payslips. The public Rates & Charges page uses this same register.
Validation includes concurrent-run idempotency, account 108 provisioning,
salary/tax conservation and rollback on insufficient funds. The same concurrent
rollout was verified in isolated MySQL tables without production payments.
## Additional owner-confirmed wage cycles
The monthly cycle remains one salary per eligible person per month. The separate Additional Wage Cycle control previews a full extra payment for the current eligible staff and saved wage/tax policy, even after the monthly cycle has completed. Big Four authority, same-origin JSON requests, fresh previews, reason and confirmation remain required.
Additional runs, items and payslips use additive `pb_payroll_additional_*` tables keyed by a distinct cycle UUID. The existing P&O issuer, account provisioning, tax legs and recipient eligibility checks perform the payments. No monthly records are reset. The intent audit precedes the cycle freeze and payment; duplicate requests replay their result. Concurrent confirmations of the same preview cannot create two cycles. Partial failures resume only unpaid items in that additional cycle. A further full payment requires a new preview and confirmation. Scheduled payroll never creates an additional cycle.