# Installation

* [ ] Download the `alex_burgershot_job` resource into your server’s `resources` folder.
* [ ] Ensure dependencies are installed and started before this resource:
  * [ESX](https://github.com/esx-framework/esx_core/releases) or QBCore
  * [ox\_inventory](https://github.com/communityox/ox_inventory/releases) (recommended)
  * ox\_lib (if using ox\_inventory or ox\_target)
  * [PolyZone](https://github.com/mkafrin/PolyZone)
* [ ] Add to `server.cfg`:

<pre><code><strong>ensure ox_lib
</strong>ensure ox_inventory
ensure alex_burgershot_job
</code></pre>

* [ ] Configure the script in `config.lua`: job name/grades, society accounts, locale, craft stations, recipes (`Config.CraftingRecipes`), shop items (`Config.ShopItems`), permissions, webhooks. More info on the [configuration](https://alexstore.gitbook.io/alexstore/scripts/burgershot-job/configuration "mention") page.

### **Database**

* Import the SQL provided by the resource.

```sql
CREATE TABLE IF NOT EXISTS `burgershot_employee_stats` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `uniqueID` varchar(60) NOT NULL,
  `player_name` varchar(255) NOT NULL,
  `orders_completed` int(11) DEFAULT 0,
  `items_crafted` int(11) DEFAULT 0,
  `deliveries_completed` int(11) DEFAULT 0,
  `total_earnings` int(11) DEFAULT 0,
  `hire_date` timestamp DEFAULT CURRENT_TIMESTAMP,
  `last_activity` timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `uniqueID` (`uniqueID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE IF NOT EXISTS `burgershot_orders` (
  `order_id` int(11) NOT NULL AUTO_INCREMENT,
  `order_number` varchar(20) NOT NULL,
  `customer_id` varchar(60) NOT NULL,
  `employee_id` varchar(60) NOT NULL,
  `employee_name` varchar(255) NOT NULL,
  `customer_name` varchar(255) NOT NULL,
  `order_details` text NOT NULL,
  `order_price` decimal(10,2) NOT NULL,
  `earning_society` decimal(10,2) NOT NULL,
  `order_time` timestamp DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`order_id`),
  FOREIGN KEY (`employee_id`) REFERENCES `burgershot_employee_stats`(`uniqueID`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE IF NOT EXISTS `burgershot_deliveries` (
  `delivery_id` int(11) NOT NULL AUTO_INCREMENT,
  `employee_id` varchar(60) NOT NULL,
  `employee_name` varchar(255) NOT NULL,
  `delivery_content` text NOT NULL,
  `delivery_time` timestamp DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`delivery_id`),
  FOREIGN KEY (`employee_id`) REFERENCES `burgershot_employee_stats`(`uniqueID`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
```

### **Ox Inventory items generation**

* From server console, run:\
  `/bs_gen_oxitems`\
  Copy the printed entries into `ox_inventory/data/items.lua`, then restart `ox_inventory`.

### **Troubleshooting**

* Ensure the locale in `config.lua` matches available translations.
* Verify item names in recipes and shop items exist in ox\_inventory after generation.
* Check permissions/groups align with your framework (ESX groups or QB perms).
