T2 // Economy & Business

coe_businesses

Enterprise & Corporation Management

Player Enterprise Ownership with Automated Payroll and Corporate Vaults

INTERFACE // CAPTURE
Enterprise & Corporation Management
01 // OVERVIEW

Empowers players to purchase and operate gas stations, 24/7 retail convenience stores, mechanic shops, and car dealerships. Features a complete corporate management dashboard to hire employees, configure commissions, purchase wholesale supply stock, and track local taxes.

On FiveM Enhanced

Secure transactions processed via coe_audit and coe_database with immediate persistence and zero ledger discrepancies.

02 // FEATURES

What the module delivers

01

Commercial Property Deeds

Physical brick-and-mortar storefronts on the map with passive income and stock management.

02

Hiring & Tiered Roles

Configure wages, custom employee access levels, and sales commissions.

03

Secure Corporate Vault

Stores corporate revenues with withdrawal authority restricted to business partners.

04

Automated Fiscal Ledger

Detailed profit/loss statements with automated municipal tax calculations.

ARCHITECTURAL LAYERS // CLEAN ARCHITECTURE

4-Layer Isolation with 0.00 ms Idle

Every COE Framework script strictly follows the principle of separation of concerns. Interact with the 3D stack below:

L4
Presentation & NUI
HTML5 · CSS tokens · CoE UI
CEF DX12
L3
Application & Server
Atomic locks · Rate limiting
Auth Server
L2
Platform & HAL
Core.Platform · Mock natives
Gen9 HAL
L1
Domain & ACID Database
Prepared SQL · MariaDB pool
ACID Pool
LAYER 04 // PRESENTATION & NUI

Responsive NUI & CoE UI Design System

Built with vanilla HTML5, CSS3 tokens, and modern JavaScript. No heavyweight frameworks (React/Vue/Electron). Rendered directly in FiveM DX12's Chromium Embedded Framework at 0.00 ms while closed.

Five themes supported in real time through CSS variables (--coe-accent, --coe-surface)
Fully keyboard-navigable (Tab, Esc, Enter) and ARIA-accessible
Secure asynchronous communication with the FiveM client via fetch("https://...")
ADMIN POWERS // OPERATION & MANAGEMENT

What this script delivers to Server Owners

Manage your city without relying on developers. Runtime parameters, auditing, and ACE-protected commands:

🛡️
ACE Permissions
Administrative operations strictly protected by coe.staff and coe.admin principals.
IsPlayerAceAllowed(src, "coe.admin")
📊
Ledger Auditing
Relevant actions write audit records to the database through coe_audit.
exports.coe_audit:Record(severity, category, event, context)
⚡
0.00ms Idle Telemetry
Event-driven thread dispatch that stays dormant until network events fire.
Clean Architecture & HAL
03 // EXPORTS

Public API 28

Typed contracts to call from other resources. Full types live in types.lua and in the docs reference.

exports['coe_businesses']:IsReady() → boolean

Returns whether the business registry is fully initialized.

No parameters.

LUA
local result = exports['coe_businesses']:IsReady()
exports['coe_businesses']:Categories() → table

Business category definitions from `BusinessesConfig.Categories`.

No parameters.

LUA
local result = exports['coe_businesses']:Categories()
exports['coe_businesses']:RuleSchema() → table

Configurable business rule schemas (`BusinessesConfig.Rules`).

No parameters.

LUA
local result = exports['coe_businesses']:RuleSchema()
exports['coe_businesses']:List(category) → table[]

List of registered businesses (optionally filtered by category). Empty before `IsReady`.

ParameterType
categorystring|nil
LUA
local result = exports['coe_businesses']:List(category)
exports['coe_businesses']:Get(id) → table|nil

Retrieves business data by unique business ID.

ParameterType
idstring
LUA
local result = exports['coe_businesses']:Get(id)
exports['coe_businesses']:Save(raw, by) → table|CoeBusinessesError

Creates or updates a business (zones, duty stations, owner, staff, grades). Requires `coe.businesses.write`.

ParameterType
rawtable
bystring|integer|nil
LUA
local result = exports['coe_businesses']:Save(raw, by)
exports['coe_businesses']:Seed(raw) → table|CoeBusinessesError

Creates business only if it does not already exist (package seed, e.g. coe_shops). Requires `coe.businesses.write`.

ParameterType
rawtable
LUA
local result = exports['coe_businesses']:Seed(raw)
exports['coe_businesses']:Delete(id, by) → true|CoeBusinessesError

Deletes a business registry entry. Requires `coe.businesses.write`.

ParameterType
idstring
bystring|integer|nil
LUA
local result = exports['coe_businesses']:Delete(id, by)
exports['coe_businesses']:ClockIn(source, characterId, businessId, at, atStation) → true|CoeBusinessesError

Clocks a character into active duty. Requires `coe.businesses.write`.

ParameterType
sourceinteger
characterIdstring|integer
businessIdstring
atvector3|table|nil
atStationboolean|nil
LUA
local result = exports['coe_businesses']:ClockIn(source, characterId, businessId, at, atStation)
exports['coe_businesses']:ClockOut(source, reason) → true|CoeBusinessesError

Clocks out a character. Requires `coe.businesses.write` or `coe.businesses.clock`.

ParameterType
sourceinteger
reasonstring|nil
LUA
local result = exports['coe_businesses']:ClockOut(source, reason)
exports['coe_businesses']:Clock(source, businessId, stationId) → {

Full clock in/out flow at a duty station (validation, notifications, audit). Requires `coe.businesses.clock`.

ParameterType
sourceinteger
businessIdstring
stationIdstring
LUA
local result = exports['coe_businesses']:Clock(source, businessId, stationId)
exports['coe_businesses']:IsOnDuty(businessId, characterId) → boolean

Returns whether character is currently on duty for the business.

ParameterType
businessIdstring
characterIdstring|integer
LUA
local result = exports['coe_businesses']:IsOnDuty(businessId, characterId)
exports['coe_businesses']:DutySummary() → {

Returns total and per-business active duty headcounts. Requires `coe.businesses.admin`.

No parameters.

LUA
local result = exports['coe_businesses']:DutySummary()
exports['coe_businesses']:CurrentDuty(source) → string|nil

Returns the business ID where the player is currently clocked in.

ParameterType
sourceinteger
LUA
local result = exports['coe_businesses']:CurrentDuty(source)
exports['coe_businesses']:Access(businessId, characterId) → CoeBusinessAccess

Resolves permissions and role capabilities for a character within a business.

ParameterType
businessIdstring
characterIdstring|integer
LUA
local result = exports['coe_businesses']:Access(businessId, characterId)
exports['coe_businesses']:Partners(businessId) → {

Lists registered partners of a business.

ParameterType
businessIdstring
LUA
local result = exports['coe_businesses']:Partners(businessId)
exports['coe_businesses']:Debtors(businessId) → (string|integer)[]

List of liability contacts: business owner first, then partners. Empty if no owner.

ParameterType
businessIdstring
LUA
local result = exports['coe_businesses']:Debtors(businessId)
exports['coe_businesses']:Permissions() → table<string,

Dictionary of known role permissions (`name = label`), including third-party registrations.

No parameters.

LUA
local ok, detail = exports['coe_businesses']:Permissions()
exports['coe_businesses']:RegisterPermissions(list) → true|CoeBusinessesError

Registers custom grade permissions from a package. Prefix defaults to resource name without `coe_` (e.g. `police.arrest`). Requires `coe.businesses.permissions`.

ParameterType
list{
LUA
local result = exports['coe_businesses']:RegisterPermissions(list)
exports['coe_businesses']:Grades(businessId) → table[]

List of configured job grades for the business.

ParameterType
businessIdstring
LUA
local result = exports['coe_businesses']:Grades(businessId)
exports['coe_businesses']:GradeOf(businessId, characterId) → table|nil

Returns the grade assigned to a character in this business.

ParameterType
businessIdstring
characterIdstring|integer
LUA
local result = exports['coe_businesses']:GradeOf(businessId, characterId)
exports['coe_businesses']:Can(businessId, characterId, permission, remoteOnly) → boolean

Checks if a character is authorized for a specific permission. Owners have all; staff have grade permissions (while on duty, unless remote access).

ParameterType
businessIdstring
characterIdstring|integer
permissionstring
remoteOnlyboolean|nil
LUA
local result = exports['coe_businesses']:Can(businessId, characterId, permission, remoteOnly)
exports['coe_businesses']:Salary(businessId, characterId) → integer

Returns the salary rate for the character's grade. Requires `coe.businesses.payroll` (otherwise returns 0).

ParameterType
businessIdstring
characterIdstring|integer
LUA
local result = exports['coe_businesses']:Salary(businessId, characterId)
exports['coe_businesses']:Payroll(businessId) → {

Retrieves full payroll schedule for business staff. Requires `coe.businesses.payroll` (otherwise empty list).

ParameterType
businessIdstring
LUA
local result = exports['coe_businesses']:Payroll(businessId)
exports['coe_businesses']:RegisterTab(def) → true|CoeBusinessesError

Registers an extension tab on the business tablet application. Requires `coe.businesses.extend`. Unregisters on caller stop.

ParameterType
deftable
LUA
local result = exports['coe_businesses']:RegisterTab(def)
exports['coe_businesses']:RegisterProvider(kind, def) → true|CoeBusinessesError

Registers a data provider for Fleet (`fleet`: `{ list, setStaff? }`) and Property (`properties`: `{ list }`) tabs. Requires `coe.businesses.extend`.

ParameterType
kind'fleet'|'properties'
deftable
LUA
local result = exports['coe_businesses']:RegisterProvider(kind, def)
exports['coe_businesses']:TabletInstances(playerId) → table[]

Lists business apps accessible to player on tablet (one per owned or employed business). Requires `coe.businesses.tablet`.

ParameterType
playerIdinteger
LUA
local result = exports['coe_businesses']:TabletInstances(playerId)
exports['coe_businesses']:TabletCall(playerId, appId, action, payload, instance) → table

Handles business tablet app actions. `instance` specifies business context (never trusted from payload). Requires `coe.businesses.tablet`.

ParameterType
playerIdinteger
appId'business'
actionstring
payloadtable|nil
instancestring
LUA
local result = exports['coe_businesses']:TabletCall(playerId, appId, action, payload, instance)
04 // COMMANDS

In-game commands 1

/ponto

Clocks in or out at the nearest duty station.