# Citizens

***

## Type

```typescript
type Citizen = {
    identifier: string,
    firstname: string,
    lastname: string,
    gender: string,
    image?: string,
    notes?: string,
    birthdate: string,
    job: string,
    job_grade: string,
    vehicles: string[],
    images: {
        id: number,
        value: string,
        description: string
    }[],
    incidents: {
        id: number,
        createdAt: string
    }[],
    evidences: {
        id: number,
        createdAt: string
    }[],
    warrants: {
        id: number,
        createdAt: string
    }[],
    bolos: {
        id: number,
        createdAt: string
    }[],
    weapons: {
        serial: string,
        label: string
    }[]
}
```

## Exports

The exports can contain data from the type field.

### SearchCitizen

```lua
exports['redutzu-mdt']:SearchCitizen(identifier: string) // CitizenType | null

```

### RegisterCitizen

```lua
exports['redutzu-mdt']:RegisterCitizen({
  identifier = 'license:1234',
  firstname = 'Firstname',
  lastname = 'Lastname',
  gender = 'm',
  birthdate = '10/05/2000',
  job = { name = 'police', label = 'Law Enforcement', grade = 'Chief' },
  fingerprint = 'abc123',
  notes = 'Citizen notes',
  image = 'https://yourwebsite.com/'
}) -- boolean
```

### UpdateCitizen

```lua
-- It returns a boolean (if it was successfully updated)
exports['redutzu-mdt']:UpdateCitizen(identifier, {
  notes = 'New notes',
  incidents = { 1, 7, 10 }
}) -- boolean
```

```lua
local success = exports['redutzu-mdt']:UpdateCitizen('license:1234', {
    image = 'https://i.pinimg.com/736x/98/1d/6b/981d6b2e0ccb5e968a0618c8d47671da.jpg',
    vehicles = { 'XYZ987' }
})

if not success then
    print('There was an error updating the citizen')
    return
end

print('Citizen updated')
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.redutzu.com/resources/redutzu-mdt/exports-events/server-exports/citizens.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
