# Installation

## Items Installation

{% tabs %}
{% tab title="qb-core/shared/items.lua" %}
```lua
['vehicle_inspection'] = {['name'] = 'vehicle_inspection', ['label'] = 'Vehicle Inspection', ['weight'] = 500, ['type'] = 'item', ['image'] = 'vehicle_inspection.png', ['unique'] = true, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = ''},
```
{% endtab %}

{% tab title="ox_inventory/data/items.lua" %}
```lua
["vehicle_inspection"] = {
    label = "Vehicle Inspection",
    weight = 5,
    stack = true,
    close = true,
    client = {
        image = "vehicle_inspection.png",
    }
},
```
{% endtab %}
{% endtabs %}

## Metadata Installation

{% hint style="warning" %}
If you are using **ox\_inventory** or **qb-inventory** new version, ignore this step.
{% endhint %}

{% tabs %}
{% tab title="qb-inventory/app" %}
```javascript
} else if (itemData.name == "vehicle_inspection") {
    $(".item-info-title").html("<p>" + itemData.label + "</p>");
    $(".item-info-description").html(
        '<p><strong>Plate: </strong><span>' + itemData.info.plate + '</span></p>' +
        '<p><strong>Model: </strong><span>' + itemData.info.model + '</span></p>' +
        '<p><strong>Status: </strong><span>' + itemData.info.status + '</span></p>' +
        '<p><strong>Expires At: </strong><span>' + itemData.info.expires_at + '</span></p>' +
        '<p><strong>Company: </strong><span>' + itemData.info.company_accepted + '</span></p>' +
        '<p><strong>Mileage: </strong><span>' + itemData.info.mileage + '</span></p>'
    );
```
{% endtab %}

{% tab title="qs-inventory/metadata" %}
```javascript
} else if (itemData.name == "vehicle_inspection") {
    $(".item-info-title").html("<p>" + itemData.label + "</p>");
    $(".item-info-description").html(
        '<p><strong>Plate: </strong><span>' + itemData.info.plate + '</span></p>' +
        '<p><strong>Model: </strong><span>' + itemData.info.model + '</span></p>' +
        '<p><strong>Status: </strong><span>' + itemData.info.status + '</span></p>' +
        '<p><strong>Expires At: </strong><span>' + itemData.info.expires_at + '</span></p>' +
        '<p><strong>Company: </strong><span>' + itemData.info.company_accepted + '</span></p>' +
        '<p><strong>Mileage: </strong><span>' + itemData.info.mileage + '</span></
    );
```
{% endtab %}

{% tab title="codem/metadata" %}
```javascript
} else if (item.name == "vehicle_inspection") {
    let infoData = [
        { label: "Plate", value: item.info.plate || "Unknown" },
        { label: "Model", value: item.info.model || "Unknown" },
        { label: "Status", value: item.info.status || "Unknown" },
        { label: "Expires At", value: item.info.expires_at || "Unknown" },
        { label: "Company", value: item.info.company_accepted },
        { label: "Mileage", value: item.info.mileage}
    ];

    let returnString = '';
```
{% endtab %}

{% tab title="tgiann-inventory/metadata" %}
```javascript
vehicle_inspection = {
    { metadata = "plate",                value = "Plate:" },
    { metadata = "model",                value = "Model:" },
    { metadata = "status",               value = "Status:" },
    { metadata = "expires_at",           value = "Expires At:" },
    { metadata = "company_accepted",     value = "Company:" },
    { metadata = "mileage",              value = "Mileage:" },
},
```
{% endtab %}
{% endtabs %}

## Database Installation

{% hint style="warning" %}
You have the option **Config.AutoDatabase** on **config.lua** file to insert this automatic.
{% endhint %}

```sql
CREATE TABLE IF NOT EXISTS `m_inspections` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `plate` varchar(20) NOT NULL,
  `char_id` varchar(100) NOT NULL,
  `vehicle_model` varchar(100) NOT NULL,
  `status` enum('valid','expired','suspended') NOT NULL DEFAULT 'valid',
  `reason` text DEFAULT NULL,
  `created_at` int(11) NOT NULL,
  `expires_at` int(11) NOT NULL,
  `company_accepted` varchar(255) DEFAULT NULL,
  `mileage_at_inspection` varchar(50) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
```
