# Impound System

# Impound Overview

# Impound Overview

Impounds are deliberately separate from normal garage locations.

`GetGarages()` does not include impound yards. Use `GetImpounds()` for impound-specific integrations.

## Core features

- Public recovery yards.
- Job-managed impounds.
- Field impound action for authorised jobs.
- Configurable fines.
- Optional release delays.
- Automatic missing-entity recovery.
- Strict vehicle-type routing.
- History/audit entries.

## Default configuration

Important values under `Config.Impound` include default fine, recovery fee, release time, missing-entity grace periods and optional preferred default impound.


# Impound Vehicle Type Safety

# Impound Vehicle Type Safety

Nord Garages validates vehicle type server-side before assigning an impound.

Expected routing:

- Land vehicle → compatible land impound.
- Boat → boat impound.
- Plane → compatible air/plane impound.
- Helicopter → compatible air/helicopter impound.

The resolver prioritizes reliable runtime/model information and framework metadata, then repairs known legacy type values where possible.

Existing incorrect impound assignments can be reconciled automatically through the impound reconciliation system.

Useful exports:

```lua
exports['nord_garages']:ResolveVehicleType(model, fallback, netId, secondaryModel)
exports['nord_garages']:AuditVehicleTypes()
exports['nord_garages']:ReconcileImpounds(options)
```


# Job Impounds

# Job Impounds

Job impound **locations and permissions are created in-game** from the admin interface.

Authorised employees can use the configured field command/key while near a vehicle.

Defaults:

```lua
jobFieldCommand = 'impoundvehicle'
jobFieldKey = 'F7'
jobFieldDistance = 6.0
jobFieldServerDistance = 10.0
```

The player may rebind the FiveM keybind through game settings.

## Server exports

```lua
exports['nord_garages']:GetJobImpounds(source)
exports['nord_garages']:CanJobManageImpound(source, identifier)
exports['nord_garages']:JobImpoundVehicle(source, plate, impoundIdentifier, reason, fine, releaseSeconds)
exports['nord_garages']:JobReleaseImpound(source, plate)
```

Job/grade/category validation remains server-side.


# Automatic Recovery

# Automatic Recovery

When enabled, vehicles that were active/parked but whose OneSync entity disappears may be routed to recovery/impound instead of silently returning for free.

Important grace values distinguish normal missing entities from disconnect/migration races.

Defaults include:

- Entity removed grace: 3 seconds
- Disconnect grace: 20 seconds
- Fallback scan interval: 10 seconds
- Missing grace: 20 seconds
- Startup grace: 15 seconds

## Why the delays exist

OneSync ownership migration and player disconnects can briefly remove or move an entity. Immediate impound on every removal can create false positives, so Nord Garages uses short context-specific grace windows plus a slower fallback scan.

## Explicit deletion

Server-side entity removal is monitored. Trusted staff integrations should use the dedicated staff exports so the desired garage state is explicit rather than relying only on entity disappearance detection.