> For the complete documentation index, see [llms.txt](https://tyrix.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://tyrix.gitbook.io/docs/script-resources/tyrix-business/integration.md).

# Integration

Tyrix Business exposes a read-only surface for sibling resources (`tyrix_droply`, `tyrix_multijob`, etc.) so they can identify bosses / employees, resolve society accounts, and drive the DeliveryPanel without duplicating logic.

Nothing here writes to tyrix\_business state - every export is idempotent and safe to call from any load-order.

## Server exports

| Export                                        | Purpose                                                                                                                          | Source                       |
| --------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | ---------------------------- |
| `isBossOf(source)`                            | Returns the businessId the player is a boss of, or `nil`. Checks `Config.BossGrades` + QB `job.isboss`.                          | `server/exports.lua:17-37`   |
| `getEmployeeBusiness(source)`                 | Returns `{ businessId, job, grade }` if the player's job maps to a `tyrix_businesses` row, else `nil`.                           | `server/exports.lua:43-57`   |
| `getBusinessIdentity(businessId)`             | Returns `{ job, societyAccount, bossGradeName }` for a businessId; `societyAccount` = `'society_' .. businessId`.                | `server/exports.lua:63-84`   |
| `isPlayerAdmin(src)`                          | Wraps the config-driven admin check (`Config.AdminGroups` + `Config.AdminIdentifiers`).                                          | `server/exports.lua:90-94`   |
| `getStationMenuItems(businessId, stationIds)` | Deduped `[{item, label}]` — the crafted outputs those stations produce, filtered through `ox_inventory:Items()`.                 | `server/exports.lua:104-139` |
| `getOnlineEmployees(businessId, onDutyOnly?)` | Returns `{ [src] = grade }` for online players employed by that business. In-memory index; no player scan.                       | `server/job_index.lua:77-92` |
| `useBox(event, item, inventory, slot, data)`  | `ox_inventory` item-use callback for `business_box`. Opens the per-instance stash, decrements `uses`, destroys on last.          | `server/main.lua:5058-5119`  |
| `getCarriedBoxes(source)`                     | Read-only enumeration of `business_box` slots a player carries. Returns `[{ slot, stashid, business, label, metadata, items }]`. | `server/main.lua:5126-5169`  |

## Client exports

All four drive the DeliveryPanel NUI. Sibling resources can open, update, and close the panel without touching tyrix\_business's own delivery flow.

| Export                                         | Purpose                                                                                                                                                                                                |
| ---------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `openDeliveryPanel(payload)`                   | Opens the panel. `payload = { order, business, payout, status?, labels }`. `status` is `'crafting'` or `'enroute'`. `labels = { craftingDone, enrouteDone }` overrides the default status-header text. |
| `updateDeliveryInventory(counts, allAcquired)` | Updates per-item counts and the "all acquired" flag. `counts` is `{ [itemName] = number }`.                                                                                                            |
| `updateDeliveryStatus(status, locationCoords)` | Flips the status header (`'crafting'` → `'enroute'`) and sets a GPS location.                                                                                                                          |
| `closeDeliveryPanel()`                         | Closes the panel and clears state.                                                                                                                                                                     |

All four live in `client/delivery.lua:516-545`.

**Consistency tip** - if your resource sends `allAcquired = true`, make sure `counts` reflects the per-item satisfied numbers. Otherwise the panel shows "Ready to deliver" in the header but `0/N` per row, which reads as bugged.

## Bridges

Bridges pluggable via `Config.Bridge`:

| Bridge        | Supported integrations                                                                    |
| ------------- | ----------------------------------------------------------------------------------------- |
| Notifications | `ox_lib`, `vms_notify`, `esx`, custom                                                     |
| Boss Menu     | `esx_society`, `wasabi_multijob`, `tyrix_multijob`, custom                                |
| Clothing      | `illenium-appearance`, `fivem-appearance`, `esx_skin`, custom                             |
| Garage        | `jg-advancedgarages`, `cd_garage`, custom                                                 |
| Vehicle Keys  | `wasabi_carlock`, `qb-vehiclekeys`, `mk_vehiclekeys`, `Renewed-Vehiclekeys`, none, custom |

Each family also accepts `custom = { ... }` - see [Configuration → Bridge](broken://pages/c6e27ddf07b0d52846fd94c86c0722e047b9c9e5#bridge) for the shape.

## Target system

`bridge/client.lua` auto-detects whichever of `ox_target` / `qb-target` is started. Neither is a hard dependency in `fxmanifest.lua`; the resource boots cleanly on servers that ship only one. Sibling resources targeting the same player entity can rely on the same detection.
