{
    "schemes": [],
    "swagger": "2.0",
    "info": {
        "description": "REST API for digital public services, applications, and grievances.",
        "title": "eGovernance API",
        "contact": {},
        "version": "1.0.0"
    },
    "host": "",
    "basePath": "/",
    "paths": {
        "/v1/applications": {
            "get": {
                "description": "Exact-match filters: citizen_id,service_id,reference_number,status,priority. Sorts: created_at,updated_at,reference_number,status,priority,submitted_at,due_at.",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "eGovernance Applications"
                ],
                "summary": "List applications",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "type": "integer",
                        "description": "Page size, default 50, max 100",
                        "name": "limit",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Offset, default 0",
                        "name": "offset",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Single allowlisted sort field",
                        "name": "sort",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "description": "Include archived rows",
                        "name": "include_archived",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Exact reference number filter",
                        "name": "reference_number",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Exact status filter",
                        "name": "status",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/dto.ApplicationListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            },
            "post": {
                "description": "Creates an application with server-generated immutable APP-YYYYMMDD-XXXXXXXX reference_number. citizen_id and service_id must belong to the same tenant.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "eGovernance Applications"
                ],
                "summary": "Create application",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Application create request",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/dto.ApplicationCreateRequest"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "$ref": "#/definitions/dto.ApplicationResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "409": {
                        "description": "Conflict",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/v1/applications/{id}": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "eGovernance Applications"
                ],
                "summary": "Get application",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Application ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/dto.ApplicationResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            },
            "delete": {
                "description": "Archive-only delete. Sets status=archived and returns 204.",
                "tags": [
                    "eGovernance Applications"
                ],
                "summary": "Archive application",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Application ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "204": {
                        "description": "No Content"
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            },
            "patch": {
                "description": "reference_number is immutable and rejected with application.reference_immutable.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "eGovernance Applications"
                ],
                "summary": "Patch application",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Application ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Application patch request",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/dto.ApplicationPatchRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/dto.ApplicationResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "409": {
                        "description": "Conflict",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/v1/citizens": {
            "get": {
                "description": "Lists tenant-scoped citizens. Exact-match filters: full_name,email,phone,verification,status. Sorts: created_at,updated_at,full_name,verification,status. Archived rows are excluded unless include_archived=true.",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "eGovernance Citizens"
                ],
                "summary": "List citizens",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "type": "integer",
                        "description": "Page size, default 50, max 100",
                        "name": "limit",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Offset, default 0",
                        "name": "offset",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Single allowlisted sort field, prefix with - for descending",
                        "name": "sort",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "description": "Include archived rows",
                        "name": "include_archived",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Exact status filter",
                        "name": "status",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/dto.CitizenListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            },
            "post": {
                "description": "Creates a tenant-scoped citizen. X-TENANT-ID is required. Request body tenant_id/id/timestamps are rejected; national_id is accepted on write but omitted from default responses.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "eGovernance Citizens"
                ],
                "summary": "Create citizen",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Citizen create request",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/dto.CitizenCreateRequest"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "$ref": "#/definitions/dto.CitizenResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/v1/citizens/{id}": {
            "get": {
                "description": "Gets a tenant-scoped citizen by id, including archived rows.",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "eGovernance Citizens"
                ],
                "summary": "Get citizen",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Citizen ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/dto.CitizenResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            },
            "delete": {
                "description": "Archive-only delete. Sets status=archived and returns 204; archiving an already archived row is idempotent.",
                "tags": [
                    "eGovernance Citizens"
                ],
                "summary": "Archive citizen",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Citizen ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "204": {
                        "description": "No Content"
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            },
            "patch": {
                "description": "Patches allowlisted citizen fields. Archived rows return resource.archived.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "eGovernance Citizens"
                ],
                "summary": "Patch citizen",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Citizen ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Citizen patch request",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/dto.CitizenPatchRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/dto.CitizenResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "409": {
                        "description": "Conflict",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/v1/grievances": {
            "get": {
                "description": "Exact-match filters: citizen_id,reference_number,category,status,severity,channel,assigned_to. Sorts: created_at,updated_at,reference_number,status,severity,resolved_at.",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "eGovernance Grievances"
                ],
                "summary": "List grievances",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "type": "integer",
                        "description": "Page size, default 50, max 100",
                        "name": "limit",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Offset, default 0",
                        "name": "offset",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Single allowlisted sort field",
                        "name": "sort",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "description": "Include archived rows",
                        "name": "include_archived",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Exact reference number filter",
                        "name": "reference_number",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Exact status filter",
                        "name": "status",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/dto.GrievanceListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            },
            "post": {
                "description": "Creates a grievance with server-generated immutable GRV-YYYYMMDD-XXXXXXXX reference_number. citizen_id is optional but must belong to the same tenant when supplied.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "eGovernance Grievances"
                ],
                "summary": "Create grievance",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Grievance create request",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/dto.GrievanceCreateRequest"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "$ref": "#/definitions/dto.GrievanceResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "409": {
                        "description": "Conflict",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/v1/grievances/{id}": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "eGovernance Grievances"
                ],
                "summary": "Get grievance",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Grievance ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/dto.GrievanceResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            },
            "delete": {
                "description": "Archive-only delete. Sets status=archived and returns 204.",
                "tags": [
                    "eGovernance Grievances"
                ],
                "summary": "Archive grievance",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Grievance ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "204": {
                        "description": "No Content"
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            },
            "patch": {
                "description": "reference_number is immutable and rejected with grievance.reference_immutable.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "eGovernance Grievances"
                ],
                "summary": "Patch grievance",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Grievance ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Grievance patch request",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/dto.GrievancePatchRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/dto.GrievanceResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "409": {
                        "description": "Conflict",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/v1/service-catalog": {
            "get": {
                "description": "Lists tenant-scoped service catalog entries. Exact-match filters: code,name,category,department,status. Sorts: created_at,updated_at,code,name,status.",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "eGovernance Service Catalog"
                ],
                "summary": "List service catalog entries",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "type": "integer",
                        "description": "Page size, default 50, max 100",
                        "name": "limit",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Offset, default 0",
                        "name": "offset",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Single allowlisted sort field",
                        "name": "sort",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "description": "Include archived rows",
                        "name": "include_archived",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Exact status filter",
                        "name": "status",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/dto.ServiceCatalogListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            },
            "post": {
                "description": "Creates a tenant-scoped service catalog entry. code is unique within tenant.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "eGovernance Service Catalog"
                ],
                "summary": "Create service catalog entry",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Service catalog create request",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/dto.ServiceCatalogCreateRequest"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "$ref": "#/definitions/dto.ServiceCatalogResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "409": {
                        "description": "Conflict",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/v1/service-catalog/{id}": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "eGovernance Service Catalog"
                ],
                "summary": "Get service catalog entry",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Service ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/dto.ServiceCatalogResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            },
            "delete": {
                "description": "Archive-only delete. Sets status=archived and returns 204.",
                "tags": [
                    "eGovernance Service Catalog"
                ],
                "summary": "Archive service catalog entry",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Service ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "204": {
                        "description": "No Content"
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            },
            "patch": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "eGovernance Service Catalog"
                ],
                "summary": "Patch service catalog entry",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Service ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Service catalog patch request",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/dto.ServiceCatalogPatchRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/dto.ServiceCatalogResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "409": {
                        "description": "Conflict",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            }
        }
    },
    "definitions": {
        "dto.ApplicationCreateRequest": {
            "type": "object",
            "required": [
                "citizen_id",
                "service_id"
            ],
            "properties": {
                "citizen_id": {
                    "type": "string"
                },
                "due_at": {
                    "type": "string"
                },
                "notes": {
                    "type": "string"
                },
                "payload": {
                    "type": "string"
                },
                "priority": {
                    "type": "string",
                    "enum": [
                        "low",
                        "normal",
                        "high",
                        "urgent"
                    ]
                },
                "service_id": {
                    "type": "string"
                },
                "status": {
                    "type": "string",
                    "enum": [
                        "submitted",
                        "under_review",
                        "returned_for_correction",
                        "approved",
                        "rejected",
                        "withdrawn",
                        "expired",
                        "fulfilled",
                        "closed",
                        "archived"
                    ]
                },
                "submitted_at": {
                    "type": "string"
                }
            }
        },
        "dto.ApplicationListResponse": {
            "type": "object",
            "properties": {
                "items": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/dto.ApplicationResponse"
                    }
                },
                "limit": {
                    "type": "integer"
                },
                "next_cursor": {
                    "type": "string"
                },
                "offset": {
                    "type": "integer"
                },
                "total": {
                    "type": "integer"
                }
            }
        },
        "dto.ApplicationPatchRequest": {
            "type": "object",
            "properties": {
                "due_at": {
                    "type": "string"
                },
                "notes": {
                    "type": "string"
                },
                "payload": {
                    "type": "string"
                },
                "priority": {
                    "type": "string",
                    "enum": [
                        "low",
                        "normal",
                        "high",
                        "urgent"
                    ]
                },
                "status": {
                    "type": "string",
                    "enum": [
                        "submitted",
                        "under_review",
                        "returned_for_correction",
                        "approved",
                        "rejected",
                        "withdrawn",
                        "expired",
                        "fulfilled",
                        "closed",
                        "archived"
                    ]
                }
            }
        },
        "dto.ApplicationResponse": {
            "type": "object",
            "properties": {
                "citizen_id": {
                    "type": "string"
                },
                "created_at": {
                    "type": "string"
                },
                "due_at": {
                    "type": "string"
                },
                "id": {
                    "type": "string"
                },
                "notes": {
                    "type": "string"
                },
                "payload": {
                    "type": "string"
                },
                "priority": {
                    "type": "string"
                },
                "reference_number": {
                    "type": "string"
                },
                "service_id": {
                    "type": "string"
                },
                "status": {
                    "type": "string"
                },
                "submitted_at": {
                    "type": "string"
                },
                "tenant_id": {
                    "type": "string"
                },
                "updated_at": {
                    "type": "string"
                }
            }
        },
        "dto.CitizenCreateRequest": {
            "type": "object",
            "required": [
                "full_name"
            ],
            "properties": {
                "address": {
                    "type": "string"
                },
                "email": {
                    "type": "string"
                },
                "full_name": {
                    "type": "string"
                },
                "national_id": {
                    "type": "string"
                },
                "phone": {
                    "type": "string"
                },
                "status": {
                    "type": "string",
                    "enum": [
                        "active",
                        "inactive",
                        "blocked",
                        "archived"
                    ]
                },
                "verification": {
                    "type": "string",
                    "enum": [
                        "pending",
                        "verified",
                        "rejected",
                        "expired"
                    ]
                }
            }
        },
        "dto.CitizenListResponse": {
            "type": "object",
            "properties": {
                "items": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/dto.CitizenResponse"
                    }
                },
                "limit": {
                    "type": "integer"
                },
                "next_cursor": {
                    "type": "string"
                },
                "offset": {
                    "type": "integer"
                },
                "total": {
                    "type": "integer"
                }
            }
        },
        "dto.CitizenPatchRequest": {
            "type": "object",
            "properties": {
                "address": {
                    "type": "string"
                },
                "email": {
                    "type": "string"
                },
                "full_name": {
                    "type": "string"
                },
                "national_id": {
                    "type": "string"
                },
                "phone": {
                    "type": "string"
                },
                "status": {
                    "type": "string",
                    "enum": [
                        "active",
                        "inactive",
                        "blocked",
                        "archived"
                    ]
                },
                "verification": {
                    "type": "string",
                    "enum": [
                        "pending",
                        "verified",
                        "rejected",
                        "expired"
                    ]
                }
            }
        },
        "dto.CitizenResponse": {
            "type": "object",
            "properties": {
                "address": {
                    "type": "string"
                },
                "created_at": {
                    "type": "string"
                },
                "email": {
                    "type": "string"
                },
                "full_name": {
                    "type": "string"
                },
                "id": {
                    "type": "string"
                },
                "phone": {
                    "type": "string"
                },
                "status": {
                    "type": "string"
                },
                "tenant_id": {
                    "type": "string"
                },
                "updated_at": {
                    "type": "string"
                },
                "verification": {
                    "type": "string"
                }
            }
        },
        "dto.GrievanceCreateRequest": {
            "type": "object",
            "required": [
                "category",
                "description",
                "subject"
            ],
            "properties": {
                "assigned_to": {
                    "type": "string"
                },
                "category": {
                    "type": "string"
                },
                "channel": {
                    "type": "string",
                    "enum": [
                        "web",
                        "mobile",
                        "kiosk",
                        "office",
                        "phone",
                        "email"
                    ]
                },
                "citizen_id": {
                    "type": "string"
                },
                "description": {
                    "type": "string"
                },
                "resolved_at": {
                    "type": "string"
                },
                "severity": {
                    "type": "string",
                    "enum": [
                        "low",
                        "medium",
                        "high",
                        "critical"
                    ]
                },
                "status": {
                    "type": "string",
                    "enum": [
                        "open",
                        "triaged",
                        "assigned",
                        "in_progress",
                        "resolved",
                        "closed",
                        "reopened",
                        "rejected",
                        "archived"
                    ]
                },
                "subject": {
                    "type": "string"
                }
            }
        },
        "dto.GrievanceListResponse": {
            "type": "object",
            "properties": {
                "items": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/dto.GrievanceResponse"
                    }
                },
                "limit": {
                    "type": "integer"
                },
                "next_cursor": {
                    "type": "string"
                },
                "offset": {
                    "type": "integer"
                },
                "total": {
                    "type": "integer"
                }
            }
        },
        "dto.GrievancePatchRequest": {
            "type": "object",
            "properties": {
                "assigned_to": {
                    "type": "string"
                },
                "category": {
                    "type": "string"
                },
                "channel": {
                    "type": "string",
                    "enum": [
                        "web",
                        "mobile",
                        "kiosk",
                        "office",
                        "phone",
                        "email"
                    ]
                },
                "citizen_id": {
                    "type": "string"
                },
                "description": {
                    "type": "string"
                },
                "resolved_at": {
                    "type": "string"
                },
                "severity": {
                    "type": "string",
                    "enum": [
                        "low",
                        "medium",
                        "high",
                        "critical"
                    ]
                },
                "status": {
                    "type": "string",
                    "enum": [
                        "open",
                        "triaged",
                        "assigned",
                        "in_progress",
                        "resolved",
                        "closed",
                        "reopened",
                        "rejected",
                        "archived"
                    ]
                },
                "subject": {
                    "type": "string"
                }
            }
        },
        "dto.GrievanceResponse": {
            "type": "object",
            "properties": {
                "assigned_to": {
                    "type": "string"
                },
                "category": {
                    "type": "string"
                },
                "channel": {
                    "type": "string"
                },
                "citizen_id": {
                    "type": "string"
                },
                "created_at": {
                    "type": "string"
                },
                "description": {
                    "type": "string"
                },
                "id": {
                    "type": "string"
                },
                "reference_number": {
                    "type": "string"
                },
                "resolved_at": {
                    "type": "string"
                },
                "severity": {
                    "type": "string"
                },
                "status": {
                    "type": "string"
                },
                "subject": {
                    "type": "string"
                },
                "tenant_id": {
                    "type": "string"
                },
                "updated_at": {
                    "type": "string"
                }
            }
        },
        "dto.ServiceCatalogCreateRequest": {
            "type": "object",
            "required": [
                "code",
                "name"
            ],
            "properties": {
                "category": {
                    "type": "string"
                },
                "code": {
                    "type": "string"
                },
                "department": {
                    "type": "string"
                },
                "description": {
                    "type": "string"
                },
                "eligibility": {
                    "type": "string"
                },
                "fee_cents": {
                    "type": "integer"
                },
                "name": {
                    "type": "string"
                },
                "sla_hours": {
                    "type": "integer"
                },
                "status": {
                    "type": "string",
                    "enum": [
                        "draft",
                        "active",
                        "inactive",
                        "archived"
                    ]
                }
            }
        },
        "dto.ServiceCatalogListResponse": {
            "type": "object",
            "properties": {
                "items": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/dto.ServiceCatalogResponse"
                    }
                },
                "limit": {
                    "type": "integer"
                },
                "next_cursor": {
                    "type": "string"
                },
                "offset": {
                    "type": "integer"
                },
                "total": {
                    "type": "integer"
                }
            }
        },
        "dto.ServiceCatalogPatchRequest": {
            "type": "object",
            "properties": {
                "category": {
                    "type": "string"
                },
                "department": {
                    "type": "string"
                },
                "description": {
                    "type": "string"
                },
                "eligibility": {
                    "type": "string"
                },
                "fee_cents": {
                    "type": "integer"
                },
                "name": {
                    "type": "string"
                },
                "sla_hours": {
                    "type": "integer"
                },
                "status": {
                    "type": "string",
                    "enum": [
                        "draft",
                        "active",
                        "inactive",
                        "archived"
                    ]
                }
            }
        },
        "dto.ServiceCatalogResponse": {
            "type": "object",
            "properties": {
                "category": {
                    "type": "string"
                },
                "code": {
                    "type": "string"
                },
                "created_at": {
                    "type": "string"
                },
                "department": {
                    "type": "string"
                },
                "description": {
                    "type": "string"
                },
                "eligibility": {
                    "type": "string"
                },
                "fee_cents": {
                    "type": "integer"
                },
                "id": {
                    "type": "string"
                },
                "name": {
                    "type": "string"
                },
                "sla_hours": {
                    "type": "integer"
                },
                "status": {
                    "type": "string"
                },
                "tenant_id": {
                    "type": "string"
                },
                "updated_at": {
                    "type": "string"
                }
            }
        },
        "handlers.ErrorResponse": {
            "type": "object",
            "properties": {
                "code": {
                    "type": "string"
                },
                "details": {},
                "message": {
                    "type": "string"
                },
                "request_id": {
                    "type": "string"
                }
            }
        }
    }
}