- Move task implementations from prototype scripts into `functions/objects`
- Keep public task functions as compatibility adapters
- Update docs and init wiring for the new object-based layout
- Let defend tasks use synced enemy groups as wave templates
- Record task status changes on fail/success
- Route end conditions through the server-side mission end helper
- Increase client ready timeout to 30s
- Apply all SurrealDB schemas during initialization and fail fast on errors
- Remove schema application from the connection helper
- Factor spectator cleanup into a reusable handler
- Delay the healed server event until spectator init finishes
- Restore camera, HUD, and user input when leaving medical spectator
- Introduced `EntityControllerBaseClass` for managing object-based entity controllers.
- Added `HostageEntityController` to handle hostage-specific behaviors and interactions.
- Created `HostageTaskBaseClass` to define the structure and logic for hostage-related tasks.
- Updated `README.md` to include new prototypes and their purposes.
- Refactored `taskObjectPrototypes.sqf` to load new classes and maintain organization.
- Updated fnc_extCall.sqf to suppress logging for specific functions.
- Added object model prototypes for task instances in prototypes/taskObjectPrototypes.sqf.
- Enhanced README.md to document the new object model and its purpose.
- Modified XEH_postInit.sqf to improve event handling for defuse tasks.
- Updated various task functions (fnc_attack, fnc_defend, fnc_defuse, fnc_delivery, fnc_destroy, fnc_heartBeat, fnc_hostage, fnc_hvt) to include task acceptance checks.
- Improved fnc_makeHostage and fnc_makeIED to ensure proper task registration and state management.
- Introduced new methods in task object prototypes for better state management and task flow control.
- Created package.json for Docus with necessary scripts and dependencies.
- Implemented sync-docus-docs.mjs to automate the generation of documentation files from source markdown.
- Defined mappings for generated pages and virtual routes to ensure proper linking in documentation.
- Added static content files for the documentation structure, including navigation and index pages.
- Implemented requestRefuel and requestRepair functions in bridge.js to handle vehicle service requests.
- Updated AppShell.js to include buttons for refueling and repairing nearby vehicles, with appropriate state management.
- Added requestRefuelSelected and requestRepairSelected actions in events.js to validate and process service requests.
- Enhanced economy README and usage guides to document new refuel and repair service functionalities.
- Introduced server-side handling for refuel requests in FEconomyStore, ensuring organization billing and fuel management.
- Expanded README.md to detail economy addon functionalities including refueling, medical services, and service charges.
- Updated XEH_PREP.hpp to include initSEconomyStore preparation.
- Modified XEH_postInit.sqf to ensure MEconomyStore initializes only if not nil.
- Adjusted XEH_preInit.sqf to initialize SEconomyStore correctly.
- Updated config.cpp to include forge_server_common as a required addon.
- Enhanced fnc_initFEconomyStore.sqf to manage fuel refueling sessions and organization charges.
- Improved fnc_initMEconomyStore.sqf to handle medical billing and fallback to organization funds.
- Created fnc_initSEconomyStore.sqf for organization-funded service charges and repairs.
- Updated org.rs and org.rs service layer to support member debt recording and organization fund charging.
- Added ECONOMY_USAGE_GUIDE.md for comprehensive documentation on economy functionalities.
- Updated MODULE_REFERENCE.md and README.md to include links to the new economy guide.
- Revised README.md for the Forge Client Example Addon to clarify its purpose as a template.
- Enhanced MODULE_REFERENCE.md to categorize guides into Server and Extension guides and Client guides.
- Created detailed usage guides for various client addons including Actor, Bank, CAD, Garage, Locker, Notifications, Organization, Phone, and Store.
- Added a Client Common Usage Guide to outline shared browser UI bridge patterns.
- Introduced a Client Main Usage Guide to define the foundational elements for client addons.
- Established authoritative state notes and usage rules across new guides to ensure clarity on server ownership and client responsibilities.
- Updated README.md files for extension, garage, locker, main, organization, phone, store, and task addons to provide clearer overviews, dependencies, main components, and usage notes.
- Improved task module documentation to clarify timer semantics and server task flows, ensuring accurate usage of time limits.
- Adjusted default values for task time limits and IED timers to enforce positive countdown requirements.
- Added new CAD addon for dispatch coordination, including its overview, dependencies, main components, and event handling.
- Updated fnc_defuseModule, fnc_deliveryModule, fnc_destroyModule, fnc_hostageModule, fnc_hvtModule to enhance parameter retrieval and logging.
- Introduced error handling for missing task IDs across modules.
- Consolidated task initialization logic into fnc_startTask for better maintainability.
- Added fnc_cargoModule as a sync target for cargo entities in delivery tasks.
- Improved logging to provide clearer insights into task parameters and synced entities.
- Wire phone, garage, and locker stores to the new storage layer
- Add delete flows for messages and emails in the phone UI
- Update contact, mail, and message views for the new data model
- Introduce client phone addon, UI, and XEH handlers
- Route actor phone interaction to the new phone UI
- Add initial phone state, event handling, and persistence
- Hydrate portal/session data from login and sync payloads
- Add treasury notices for credit, invite, leave, and disband actions
- Improve portal cards and modal UI for members, fleet, and treasury
- Wire invite request, accept, and decline events through the UI bridge
- Add client and server handlers for invite success and failure responses
- Extend portal state and UI to support member invite actions
- Clarify client loading status text
- Document server-side actor hydration and snapshot recovery
- Stop hot reads from forcing repository initialization
- Require actor records to exist in storage before hot load
- Fall back to player snapshots to fill missing actor fields and org defaults
- Refresh org member names when a better value is available
- Keep bootstrap extension calls on the direct path by default
- Remove in-SQF registry mirroring for actor, bank, CAD, org, and task state
- Add validation harness and persistence warnings for hot-state flows
- Treat CAD and task operational state as restart-scoped
## 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
Co-authored-by: Jacob Schmidt <innovativestudios@outlook.com>
Reviewed-on: #2
- 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
- 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
- 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
- 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
- Route bank sync payloads through the client bridge
- Refresh account state without rebuilding the full session
- Split CAD dispatcher UI into modular source files