Implement org credit line debt and bank repayment flow #2

Merged
J.Schmidt92 merged 14 commits from development into master 2026-04-02 16:50:38 -05:00
Owner

Summary

This finishes the org credit line workflow so it behaves like reserved treasury-backed credit instead of a simple member allowance.

What changed

  • reserve org funds immediately when a credit line is assigned
  • track credit lines with:
    • approved amount
    • available amount
    • outstanding principal
    • interest rate
    • amount due
  • consume reserved credit during store checkout without charging org funds a second time
  • add credit line repayment through the bank app
  • sync richer credit line state into org and bank payloads/UI
  • keep legacy amount compatibility mapped to available credit for older consumers

User-facing behavior

  • assigning a credit line now reduces available org funds immediately
  • spending on credit_line reduces available credit and creates debt with interest
  • the bank app now shows outstanding credit debt and allows repayment from personal bank funds
  • the org treasury view now shows reserved credit and outstanding due totals

Validation

  • cargo fmt
  • npm run build:webui
  • cargo test -p forge-services --quiet
  • cargo test -p forge-server --quiet

Follow-up checks

  • validate in-game that assigning a credit line reduces org funds immediately
  • validate store checkout with credit_line updates available credit and debt correctly
  • validate bank repayment decreases player bank balance, increases org funds, and reduces amount due
## Summary This finishes the org credit line workflow so it behaves like reserved treasury-backed credit instead of a simple member allowance. ## What changed - reserve org funds immediately when a credit line is assigned - track credit lines with: - approved amount - available amount - outstanding principal - interest rate - amount due - consume reserved credit during store checkout without charging org funds a second time - add credit line repayment through the bank app - sync richer credit line state into org and bank payloads/UI - keep legacy `amount` compatibility mapped to available credit for older consumers ## User-facing behavior - assigning a credit line now reduces available org funds immediately - spending on `credit_line` reduces available credit and creates debt with interest - the bank app now shows outstanding credit debt and allows repayment from personal bank funds - the org treasury view now shows reserved credit and outstanding due totals ## Validation - `cargo fmt` - `npm run build:webui` - `cargo test -p forge-services --quiet` - `cargo test -p forge-server --quiet` ## Follow-up checks - validate in-game that assigning a credit line reduces org funds immediately - validate store checkout with `credit_line` updates available credit and debt correctly - validate bank repayment decreases player bank balance, increases org funds, and reduces amount due
J.Schmidt92 added 14 commits 2026-04-02 16:50:16 -05:00
- Split BankBaseStore into SessionManager, Messenger, Model, Store, Validator
- Extract validation logic into BankValidator with try/catch and per-action methods
- Remove duplicate notifications from transaction actions
- Update event handlers to call validator first, forward context to store/session
- Fix locker grantItems: add missing 'attachment' category mapping to 'item'
- Fix locker grantItems: replace exitWith with if/else to prevent skipping remaining items

Co-Authored-By: Oz <oz-agent@warp.dev>
- add the imported server task addon to the current framework with task ownership, task catalog, mission-manager attack generation, org-owned reward routing, participant notifications, and reputation syncing
- restructure org persistence so core org data, assets, fleet, and members are handled through the current Redis/extension model with matching Rust repository and service updates
- wire the client CAD addon into the framework, actor device action, shared web UI bridge pattern, and task listing/acceptance flow
- add a source-driven CAD web UI layout with ui.config.mjs and extend the shared web UI builder to support custom HTML template pages for multi-surface UIs
- Replace task-only refresh flow with hydrate/assignment/group events
- Add contracts, groups, and activity tabs to the client sidepanel
- Introduce server-side CAD store and request handlers
- Add a dispatcher web view and layout switching
- Route group role updates and dispatcher hydration through the UI bridge
- Refresh top bar and hide map/side panel outside operations mode
- Add dispatchView state to the CAD repository and hydrate payloads
- Toggle the dispatcher between board and map layouts in the UI bridge
- Update side panel logic to hide contract tabs in dispatch map mode
- Update CAD client UI and generated site assets
- Keep dispatcher and sidepanel status lists aligned with server defaults
- Refresh task, assignment, and group repository initialization
- Add request hydration, submission, closing, and response handling
- Wire UI events for dispatch orders, support requests, and map focus
- Expand dispatcher layout for alerts, requests, and detail views
- Route bank sync payloads through the client bridge
- Refresh account state without rebuilding the full session
- Split CAD dispatcher UI into modular source files
- Replace bank payment flow with a checkout mutation using explicit source context
- Return backend errors to players instead of silently falling back to local state
- Queue hot state persistence for actors, garages, lockers, orgs, and owned assets
- Add shared store payload handling in server and extension code
- Remove obsolete org member and treasury service split
- Update client repositories and portal UI/store hydration
- Thread request data through UI bridge and dispatcher events
- Add task models, repositories, services, and extension wiring
- Include submitted request fields in converted order notes
- Wire bank client and server for credit line repayment requests
- Show credit line balance and repay action in the banking view
- Extend org/bank payloads and models with credit line fields
J.Schmidt92 merged commit ff7ff0c4e5 into master 2026-04-02 16:50:38 -05:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: IDSolutions/forge#2
No description provided.