openapi: 3.0.3
info:
  title: Camera Deputaților — API Deschis
  description: |
    API REST public pentru datele Camerei Deputaților din România.

    Această specificație descrie atât **endpoint-urile implementate** (servite ca
    fișiere JSON statice prin GitHub Pages, scraped automat din cdep.ro), cât și
    **propunerile de extindere** (servite de Camera Deputaților după adopție).

    Datele sunt deja publice pe [cdep.ro](https://www.cdep.ro) — acest API le
    expune într-un format structurat, machine-readable, accesibil oricărui
    developer, jurnalist sau cetățean.

    **Autor:** Cătălin Popa — în colaborare cu Comisia pentru Tehnologia Informației și Comunicațiilor pentru transparentizarea activității parlamentare

    **Sursă date:** www.cdep.ro (date publice)

    **Licență:** Open Government License v3.0

    **Repository:** [github.com/Endimion2k/cdep-api-poc](https://github.com/Endimion2k/cdep-api-poc)

    **Search full-text:** [/search](https://endimion2k.github.io/cdep-api-poc/search.html) (Pagefind, ~14k entități)
  version: "1.0.0-poc"
  contact:
    name: Cătălin Popa
    url: https://github.com/Endimion2k/cdep-api-poc
  license:
    name: Open Government License v3.0
    url: https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/

servers:
  - url: https://endimion2k.github.io/cdep-api-poc/data/v1
    description: POC live (GitHub Pages, fișiere JSON statice)
  - url: https://cdep.ro/api/v1
    description: Server propus (după adopție de către Camera Deputaților)

tags:
  - name: Deputați
    description: Membrii Camerei Deputaților, biografii, comisii, activitate
  - name: Voturi
    description: Voturi electronice în plen — agregate și defalcare nominală
  - name: Sancțiuni
    description: Sancțiuni disciplinare aplicate deputaților
  - name: Interpelări
    description: Interpelări și întrebări parlamentare adresate Guvernului
  - name: Comisii
    description: Comisii parlamentare (permanente, speciale comune) cu lista membrilor
  - name: Proiecte
    description: Proiecte legislative cu stadiu, inițiator, timeline, voturi
  - name: Amendamente
    description: View derivat — proiectele cele mai disputate (cu cele mai multe amendamente)
  - name: Moțiuni
    description: Moțiuni simple și de cenzură cu vot final, semnatari, rezultat
  - name: Feeds
    description: Atom + JSON Feed cu ultimele 50 evenimente, pentru abonare RSS
  - name: Propuse
    description: Endpoint-uri propuse, încă neimplementate

paths:
  /deputati/legislatura-{legislatura}.json:
    get:
      tags: [Deputați]
      summary: Listă deputați (legislatura completă)
      description: |
        Returnează toți deputații dintr-o legislatură, cu profile complete:
        biografie, comisii, delegații, contoare de activitate.
      parameters:
        - name: legislatura
          in: path
          required: true
          description: Anul de start al legislaturii
          schema:
            type: integer
            enum: [2016, 2020, 2024]
            example: 2024
      responses:
        "200":
          description: Succes
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/DeputatiResponse"

  /voturi/{legislatura}/_index.json:
    get:
      tags: [Voturi]
      summary: Index voturi
      description: |
        Listă agregată a tuturor voturilor electronice din plen pentru o legislatură.
        Conține metadate (data, descriere, counts) — fără defalcare nominală.
      parameters:
        - name: legislatura
          in: path
          required: true
          schema:
            type: integer
            example: 2024
      responses:
        "200":
          description: Succes
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/VoturiIndexResponse"

  /voturi/{legislatura}/{idv}.json:
    get:
      tags: [Voturi]
      summary: Detalii vot (cu defalcare nominală)
      description: |
        Returnează un vot specific, cu lista completă a deputaților și opțiunile lor
        (DA / NU / abținere / nu au votat).
      parameters:
        - name: legislatura
          in: path
          required: true
          schema:
            type: integer
            example: 2024
        - name: idv
          in: path
          required: true
          description: ID votului (cdep_idv)
          schema:
            type: integer
            example: 36892
      responses:
        "200":
          description: Succes
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/VoteEvent"
        "404":
          description: Vot inexistent

  /sanctiuni/legislatura-{legislatura}.json:
    get:
      tags: [Sancțiuni]
      summary: Sancțiuni disciplinare
      description: |
        Listă de sancțiuni aplicate deputaților (diminuare indemnizație, avertismente,
        chemări la ordine, retragere cuvânt).
      parameters:
        - name: legislatura
          in: path
          required: true
          schema:
            type: integer
            example: 2024
      responses:
        "200":
          description: Succes
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SanctiuniResponse"

  /interpelari/legislatura-{legislatura}.json:
    get:
      tags: [Interpelări]
      summary: Interpelări și întrebări parlamentare
      description: |
        Listă de interpelări și întrebări adresate de deputați Guvernului sau
        ministerelor, cu informații despre răspuns dacă a fost primit.
      parameters:
        - name: legislatura
          in: path
          required: true
          schema:
            type: integer
            example: 2024
      responses:
        "200":
          description: Succes
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/InterpelariResponse"

  /comisii/legislatura-{legislatura}.json:
    get:
      tags: [Comisii]
      summary: Lista comisiilor parlamentare
      description: |
        Lista comisiilor permanente și speciale comune ale Camerei Deputaților,
        cu membrii și conducerea fiecăreia.

        **Sursa**: agregat derivat din `/deputati/legislatura-{legislatura}.json`
        — datele despre apartenența la comisii sunt incluse în profilurile deputaților.
      parameters:
        - name: legislatura
          in: path
          required: true
          schema:
            type: integer
            example: 2024
      responses:
        "200":
          description: Succes
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ComisiiResponse"

  /proiecte/legislatura-{legislatura}.json:
    get:
      tags: [Proiecte]
      summary: Proiecte legislative
      description: |
        Lista proiectelor și propunerilor legislative depuse într-o legislatură,
        cu stadiu, inițiator, timeline procedural, rezultatul votului final și
        metadate amendamente (admise/respinse, termen depunere, link raport comisie).
      parameters:
        - name: legislatura
          in: path
          required: true
          schema:
            type: integer
            example: 2024
      responses:
        "200":
          description: Succes
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ProiecteResponse"

  /feed.atom:
    get:
      tags: [Feeds]
      summary: Atom feed (RFC 4287)
      description: |
        Ultimele 50 de evenimente din toate endpoint-urile (voturi, proiecte, interpelări,
        sancțiuni), sortate descrescător după dată. Compatibil cu cititoare RSS standard
        (Feedly, Inoreader, NetNewsWire, etc.).
      responses:
        "200":
          description: Atom feed XML
          content:
            application/atom+xml:
              schema:
                type: string

  /feed.json:
    get:
      tags: [Feeds]
      summary: JSON Feed v1.1 (https://jsonfeed.org)
      description: |
        Aceleași evenimente ca Atom feed, dar în format JSON Feed v1.1.
      responses:
        "200":
          description: JSON Feed v1.1
          content:
            application/feed+json:
              schema:
                type: object

  /motiuni/legislatura-{legislatura}.json:
    get:
      tags: [Moțiuni]
      summary: Moțiuni simple și de cenzură
      description: |
        Lista moțiunilor (simple și de cenzură) depuse într-o legislatură,
        cu vot final, rezultat (adoptată/respinsă/retrasă) și semnatari nominali.
      parameters:
        - name: legislatura
          in: path
          required: true
          schema:
            type: integer
            example: 2024
      responses:
        "200":
          description: Succes
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/MotiuniResponse"

  /amendamente/legislatura-{legislatura}.json:
    get:
      tags: [Amendamente]
      summary: Proiectele cu cele mai multe amendamente
      description: |
        View derivat din `/proiecte` — doar proiectele cu amendamente admise sau respinse,
        sortate descrescător după total amendamente. Util pentru identificarea proiectelor
        celor mai disputate.

        **Notă**: lista completă a textelor amendamentelor e disponibilă doar în PDF-ul
        raportului comisiei (`raport_comisie_pdf`); aici sunt doar metadatele agregate.
      parameters:
        - name: legislatura
          in: path
          required: true
          schema:
            type: integer
            example: 2024
      responses:
        "200":
          description: Succes
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AmendamenteResponse"

  /ordine-zi/legislatura-{legislatura}.json:
    get:
      tags: [OrdineZi]
      summary: Ordinea de zi a ședințelor plenului
      description: |
        Lista ședințelor plenului Camerei Deputaților dintr-o legislatură, cu agendă
        detaliată per ședință (punctele de pe ordinea de zi). Fiecare punct cu
        proiect de lege are cross-link `idp` la `/proiecte`.

        Sursa: `/ords/pls/caseta/ecaseta2015.OrdineZi?dat=YYYYMMDD`
      parameters:
        - name: legislatura
          in: path
          required: true
          schema:
            type: integer
            example: 2024
      responses:
        "200":
          description: Succes
          content:
            application/json:
              schema:
                type: object
                properties:
                  meta: { $ref: "#/components/schemas/Meta" }
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        id: { type: string }
                        session_date: { type: string, format: date }
                        session_date_end: { type: string, format: date, nullable: true }
                        titlu: { type: string }
                        data_aprobare: { type: string, format: date, nullable: true }
                        pdf_url: { type: string, format: uri, nullable: true }
                        items:
                          type: array
                          items:
                            type: object
                            properties:
                              pozitie: { type: integer, nullable: true }
                              nr_inregistrare: { type: string, nullable: true, example: "Pl-x 464/2023" }
                              idp: { type: integer, nullable: true, description: "Cross-link cu /proiecte" }
                              descriere: { type: string }
                              doc_pdf_url: { type: string, format: uri, nullable: true }
                              ozitm: { type: integer, nullable: true }

  /declaratii/legislatura-{legislatura}.json:
    get:
      tags: [Declaratii]
      summary: Declarații de avere și interese
      description: |
        Link-uri PDF la declarațiile de avere și interese pentru toți deputații
        dintr-o legislatură, cu data depunerii. Multi-PDF per tip suportat
        (declarații inițiale + modificări). Cross-link `cdep_idm` la `/deputati`.

        Sursa: `/ords/pls/dic/declaratii2015.deputati?tip=ai&leg=YYYY`
      parameters:
        - name: legislatura
          in: path
          required: true
          schema:
            type: integer
            example: 2024
      responses:
        "200":
          description: Succes
          content:
            application/json:
              schema:
                type: object
                properties:
                  meta: { $ref: "#/components/schemas/Meta" }
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        id: { type: string }
                        cdep_idm: { type: integer, description: "Cross-link cu /deputati" }
                        deputat_nume: { type: string }
                        deputat_canonical_id: { type: string, nullable: true }
                        legislatura: { type: integer }
                        partid_short: { type: string, nullable: true, example: "PSD" }
                        avere:
                          type: array
                          items:
                            type: object
                            properties:
                              url: { type: string, format: uri }
                              data: { type: string, format: date, nullable: true }
                        interese:
                          type: array
                          items:
                            type: object
                            properties:
                              url: { type: string, format: uri }
                              data: { type: string, format: date, nullable: true }

  /declaratii-avere/legislatura-{legislatura}.json:
    get:
      tags: [Declaratii]
      summary: Sumar averi parsate per deputat (evoluție temporală)
      description: |
        Pentru fiecare deputat: ultima declarație + delta față de prima declarație.
        Valori extrase din PDF-uri ANI cu pdfplumber. Util pentru jurnalism de
        investigație: identificare deputați cu schimbări mari de avere în timp.

        **IMPORTANT** — limitări:
        - Sume sunt BEST-EFFORT (regex pe text PDF). Pentru cifre precise verifică PDF-urile.
        - Formularul ANI NU cere valoare în RON pentru imobile — folosim ca proxy
          numărul de terenuri + clădiri + suprafață totală (m²).
        - PDF-urile scanate (fără text) sunt raportate cu `text_extracted: false`.
        - Curs valutar fix (mai 2026) pentru normalizare la RON.
      parameters:
        - name: legislatura
          in: path
          required: true
          schema: { type: integer, example: 2024 }
      responses:
        "200":
          description: Succes
          content:
            application/json:
              schema:
                type: object
                properties:
                  meta: { $ref: "#/components/schemas/Meta" }
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        id: { type: string }
                        cdep_idm: { type: integer }
                        deputat_nume: { type: string }
                        legislatura: { type: integer }
                        partid_short: { type: string, nullable: true }
                        n_declaratii: { type: integer, description: "Nr. declarații depuse în mandat" }
                        ultima_data: { type: string, format: date, nullable: true }
                        ultima_conturi_ron: { type: number, format: float }
                        ultima_venituri_ron: { type: number, format: float }
                        ultima_imobile_count: { type: integer }
                        delta_conturi_ron:
                          type: number
                          description: "Schimbare în RON între prima și ultima declarație"
                        delta_imobile:
                          type: integer
                          description: "Schimbare nr. imobile între prima și ultima declarație"
                        detail_url: { type: string }

  /declaratii-avere/legislatura-{legislatura}/{cdep_idm}.json:
    get:
      tags: [Declaratii]
      summary: Detalii avere per deputat cu evoluție temporală
      description: |
        Cronologia completă a declarațiilor de avere pentru un deputat. Fiecare
        declarație individuală cu data depunerii + valori parsate.

        Permite tracking-ul evoluției averii pe parcursul mandatului.
      parameters:
        - name: legislatura
          in: path
          required: true
          schema: { type: integer, example: 2024 }
        - name: cdep_idm
          in: path
          required: true
          schema: { type: integer, example: 189 }
      responses:
        "200":
          description: Succes
          content:
            application/json:
              schema:
                type: object
                properties:
                  meta: { $ref: "#/components/schemas/Meta" }
                  data:
                    type: object
                    properties:
                      id: { type: string }
                      cdep_idm: { type: integer }
                      deputat_nume: { type: string }
                      legislatura: { type: integer }
                      partid_short: { type: string, nullable: true }
                      declaratii:
                        type: array
                        description: "Cronologic — prima declarație întâi"
                        items:
                          type: object
                          properties:
                            data_depunere: { type: string, format: date, nullable: true }
                            pdf_url: { type: string, format: uri }
                            text_extracted: { type: boolean }
                            error: { type: string, nullable: true }
                            terenuri_count: { type: integer }
                            cladiri_count: { type: integer }
                            suprafata_total_mp: { type: number, format: float }
                            conturi_total_ron: { type: number, format: float }
                            venituri_anuale_ron: { type: number, format: float }
                            datorii_total_ron: { type: number, format: float }
                            auto_count: { type: integer }

  /stenograme/legislatura-{legislatura}/_index.json:
    get:
      tags: [Stenograme]
      summary: Index sumar stenograme
      description: |
        Index al tuturor stenogramelor dintr-o legislatură. Fiecare entry
        conține `detail_url` care indică la fișierul cu textul complet.
      parameters:
        - name: legislatura
          in: path
          required: true
          schema:
            type: integer
            example: 2024
      responses:
        "200":
          description: Succes
          content:
            application/json:
              schema:
                type: object
                properties:
                  meta: { $ref: "#/components/schemas/Meta" }
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        id: { type: string }
                        session_date: { type: string, format: date }
                        cam: { type: integer, description: "2=CD, 1=Senat, 0=ședință comună" }
                        legislatura: { type: integer }
                        titlu: { type: string, nullable: true }
                        n_interventions: { type: integer }
                        text_complet_len: { type: integer, nullable: true }
                        detail_url: { type: string }

  /stenograme/legislatura-{legislatura}/{yyyymmdd}.json:
    get:
      tags: [Stenograme]
      summary: Stenograma unei zile de ședință
      description: |
        Stenograma propriu-zisă pentru o ședință specifică. Acoperire din februarie 1996.

        **Notă**: parser-ul pentru intervenții individuale (per vorbitor + partid) e WIP.
        Momentan extragem text complet + metadate; lista de intervenții va fi populată
        în versiuni viitoare după calibrare.
      parameters:
        - name: legislatura
          in: path
          required: true
          schema: { type: integer, example: 2024 }
        - name: yyyymmdd
          in: path
          required: true
          schema: { type: string, example: "20260518" }
      responses:
        "200":
          description: Succes

  /doc-comisii/all.json:
    get:
      tags: [DocComisii]
      summary: Documente comisii — rapoarte, avize, sinteze, procese verbale
      description: |
        Toate documentele oficiale emise de comisii parlamentare. Tipuri:
        `raport` (la proiect de lege), `aviz` (specialitate), `sinteza`
        (lucrări ședință), `proces_verbal`. Volum mare: ~85.895 documente.

        Cross-link `idp` (la `/proiecte`) pentru rapoarte/avize; `comisii[].idc`
        pentru identificarea comisiilor emitente.

        Sursa: `/ords/pls/proiecte/upl_com2015.lista`
      responses:
        "200":
          description: Succes
          content:
            application/json:
              schema:
                type: object
                properties:
                  meta: { $ref: "#/components/schemas/Meta" }
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        id: { type: string }
                        pdf_url: { type: string, format: uri }
                        data: { type: string, format: date, nullable: true }
                        tip:
                          type: string
                          enum: [raport, aviz, sinteza, proces_verbal, other]
                        titlu: { type: string }
                        idp: { type: integer, nullable: true, description: "Cross-link cu /proiecte" }
                        nr_proiect: { type: string, nullable: true, example: "553/2025" }
                        comisii:
                          type: array
                          items:
                            type: object
                            properties:
                              idc: { type: integer }
                              nume: { type: string }
                              leg: { type: integer, nullable: true }

components:
  schemas:
    Meta:
      type: object
      description: Metadate de generare (envelope-ul oricărui răspuns)
      properties:
        generated_at:
          type: string
          format: date-time
          description: Timestamp UTC când a fost generat fișierul
        source_url:
          type: string
          format: uri
          description: URL sursa cdep.ro de unde au fost extrase datele
        scraper_version:
          type: string
          example: "0.1.0"
        count:
          type: integer

    Deputat:
      type: object
      properties:
        id:
          type: string
          description: Hash stabil (canonical_id) — folosit pentru cross-link cu voturi
          example: "db10f9f10a669adb"
        name:
          type: string
          example: "Adomnicăi Mirela Elena"
        given_name:
          type: string
          example: "Mirela Elena"
        family_name:
          type: string
          example: "Adomnicăi"
        gender:
          type: string
          enum: [male, female]
          nullable: true
        birth_date:
          type: string
          format: date
          nullable: true
        image:
          type: string
          format: uri
          nullable: true
        cdep_idm:
          type: integer
          description: ID-ul intern cdep.ro (folosit în URL-ul `structura2015.mp?idm=N`)
          example: 1
        legislatura:
          type: integer
          example: 2024
        judet:
          type: string
          nullable: true
          example: "Suceava"
        circumscriptie:
          type: integer
          nullable: true
          example: 35
        profile_url:
          type: string
          format: uri
        data_validare:
          type: string
          format: date
          nullable: true
        hcd_validare:
          type: string
          nullable: true
          example: "HCD nr.109/2024"
        current_party:
          type: string
          nullable: true
          example: "Partidul Social Democrat"
        current_group:
          type: string
          nullable: true
        group_role:
          type: string
          nullable: true
          enum: [Lider, Vicelider, Secretar, Membru, null]
        comisii:
          type: array
          items:
            $ref: "#/components/schemas/ComisieMembership"
        delegatii:
          type: array
          items:
            type: string
        grupuri_prietenie:
          type: array
          items:
            type: string
        activitate_luari_cuvant:
          type: integer
        activitate_sedinte:
          type: integer
        activitate_declaratii_politice:
          type: integer
        activitate_propuneri_legislative:
          type: integer
        activitate_legi_promulgate:
          type: integer
        activitate_intrebari_interpelari:
          type: integer
        birou_parlamentar:
          type: string
          nullable: true

    ComisieMembership:
      type: object
      properties:
        comisia:
          type: string
          example: "Comisia pentru muncă şi protecţie socială"
        rol:
          type: string
          nullable: true
          enum: [Președinte, Vicepreședinte, Secretar, Membru, null]
        tip:
          type: string
          enum: [permanenta, speciala, comuna, speciala_comuna]

    DeputatiResponse:
      type: object
      properties:
        meta:
          $ref: "#/components/schemas/Meta"
        data:
          type: array
          items:
            $ref: "#/components/schemas/Deputat"

    VoteCounts:
      type: object
      properties:
        prezenti:
          type: integer
        pentru:
          type: integer
        contra:
          type: integer
        abtineri:
          type: integer
        nu_au_votat:
          type: integer

    VoteEventSummary:
      type: object
      description: Înregistrare în `_index.json` (fără defalcare nominală)
      properties:
        id:
          type: string
        cdep_idv:
          type: integer
          example: 36892
        legislatura:
          type: integer
        cam:
          type: integer
          enum: [1, 2]
          description: 1=Senat, 2=Camera Deputaților
        timestamp:
          type: string
          format: date-time
        descriere:
          type: string
          example: "PL-x 218/2026 - Vot final adoptare"
        counts:
          $ref: "#/components/schemas/VoteCounts"
        detail_url:
          type: string
          description: URL relativ la fișierul JSON cu defalcare nominală

    VoteIndividual:
      type: object
      properties:
        voter_canonical_id:
          type: string
          description: Match cu `Deputat.id`
        voter_name:
          type: string
        party:
          type: string
          nullable: true
        option:
          type: string
          enum: [yes, "no", abstain, absent, not_voting]

    VoteEvent:
      type: object
      description: Vot complet (fișier per `idv`)
      allOf:
        - $ref: "#/components/schemas/VoteEventSummary"
        - type: object
          properties:
            votes:
              type: array
              items:
                $ref: "#/components/schemas/VoteIndividual"
            source_url:
              type: string
              format: uri

    VoturiIndexResponse:
      type: object
      properties:
        meta:
          $ref: "#/components/schemas/Meta"
        data:
          type: array
          items:
            $ref: "#/components/schemas/VoteEventSummary"

    Sanctiune:
      type: object
      properties:
        id:
          type: string
        legislatura:
          type: integer
        deputat_nume:
          type: string
        deputat_canonical_id:
          type: string
          nullable: true
        data:
          type: string
          format: date
          nullable: true
        tip:
          type: string
          enum: [DIMINUARE_INDEMNIZATIE, AVERTISMENT_SCRIS, CHEMARE_ORDINE, RETRAGERE_CUVANT, OTHER]
        procent:
          type: integer
          nullable: true
          description: Pentru DIMINUARE_INDEMNIZATIE
        durata_luni:
          type: integer
          nullable: true
        nr_decizie:
          type: string
          nullable: true
        descriere:
          type: string

    SanctiuniResponse:
      type: object
      properties:
        meta:
          $ref: "#/components/schemas/Meta"
        data:
          type: array
          items:
            $ref: "#/components/schemas/Sanctiune"

    Interpelare:
      type: object
      properties:
        id:
          type: string
        cdep_idi:
          type: integer
        legislatura:
          type: integer
        nr_inregistrare:
          type: string
          example: "14149A"
        data_inregistrare:
          type: string
          format: date
          nullable: true
        data_prezentare:
          type: string
          format: date
          nullable: true
        data_comunicare:
          type: string
          format: date
          nullable: true
        termen_raspuns:
          type: string
          format: date
          nullable: true
        titlu:
          type: string
        mod_adresare:
          type: string
          nullable: true
        adresant_nume:
          type: string
        adresant_canonical_id:
          type: string
          nullable: true
          description: Match cu `Deputat.id`
        adresant_grup:
          type: string
          nullable: true
        destinatar:
          type: string
          example: "Ministerul Afacerilor Interne"
        text_pdf_url:
          type: string
          format: uri
          nullable: true
        raspuns_solicitat:
          type: string
          nullable: true
        raspuns_primit:
          type: boolean
        raspuns_nr_inregistrare:
          type: string
          nullable: true
        raspuns_data:
          type: string
          format: date
          nullable: true
        raspuns_sursa:
          type: string
          nullable: true
        raspuns_comunicat_de:
          type: string
          nullable: true
        raspuns_pdf_url:
          type: string
          format: uri
          nullable: true
        source_url:
          type: string
          format: uri

    InterpelariResponse:
      type: object
      properties:
        meta:
          $ref: "#/components/schemas/Meta"
        data:
          type: array
          items:
            $ref: "#/components/schemas/Interpelare"

    ComisieMembru:
      type: object
      properties:
        deputat_canonical_id:
          type: string
          description: Match cu `Deputat.id`
        deputat_nume:
          type: string
        deputat_cdep_idm:
          type: integer
        partid:
          type: string
          nullable: true
        rol:
          type: string
          enum: [Președinte, Vicepreședinte, Secretar, Membru]

    Comisie:
      type: object
      properties:
        id:
          type: string
          description: Hash stabil pe (legislatură, nume, tip)
        nume:
          type: string
          example: "Comisia pentru tehnologia informaţiei şi comunicaţiilor"
        tip:
          type: string
          enum: [permanenta, speciala, comuna, speciala_comuna]
        legislatura:
          type: integer
        nr_membri:
          type: integer
        presedinte:
          type: string
          nullable: true
        vicepresedinti:
          type: array
          items:
            type: string
        secretari:
          type: array
          items:
            type: string
        membri:
          type: array
          items:
            $ref: "#/components/schemas/ComisieMembru"

    ComisiiResponse:
      type: object
      properties:
        meta:
          $ref: "#/components/schemas/Meta"
        data:
          type: array
          items:
            $ref: "#/components/schemas/Comisie"

    TimelineEvent:
      type: object
      properties:
        data:
          type: string
          format: date
          nullable: true
        eveniment:
          type: string

    Proiect:
      type: object
      properties:
        id:
          type: string
        cdep_idp:
          type: integer
          example: 22201
        cam:
          type: integer
          enum: [0, 1, 2]
          description: 1=Senat, 2=Camera Deputaților, 0=ambele
        legislatura:
          type: integer
        nr_inregistrare:
          type: string
          nullable: true
          example: "1/01.02.2025"
        nr_camera_deputati:
          type: string
          nullable: true
        nr_senat:
          type: string
          nullable: true
        nr_guvern:
          type: string
          nullable: true
        nr_bpi:
          type: string
          nullable: true
        titlu:
          type: string
        tip:
          type: string
          enum: [proiect_lege, propunere_legislativa, ordonanta_urgenta, ordonanta_guvern, other]
        caracter:
          type: string
          enum: [ordinar, organic, other]
        procedura_urgenta:
          type: boolean
        initiator:
          type: string
          nullable: true
        camera_decizionala:
          type: string
          nullable: true
        stadiu:
          type: string
          nullable: true
          example: "Lege 9/2025"
        lege_nr:
          type: string
          nullable: true
        decret_nr:
          type: string
          nullable: true
        data_prezentare:
          type: string
          format: date
          nullable: true
        data_inregistrare_cd:
          type: string
          format: date
          nullable: true
        data_adoptare_cd:
          type: string
          format: date
          nullable: true
        data_adoptare_senat:
          type: string
          format: date
          nullable: true
        data_promulgare:
          type: string
          format: date
          nullable: true
        vot_pentru:
          type: integer
          nullable: true
        vot_contra:
          type: integer
          nullable: true
        vot_abtineri:
          type: integer
          nullable: true
        amendamente_termen_depunere:
          type: string
          format: date
          nullable: true
        amendamente_admise:
          type: integer
          nullable: true
        amendamente_respinse:
          type: integer
          nullable: true
        raport_comisie_pdf:
          type: string
          format: uri
          nullable: true
          description: PDF cu lista completă de amendamente (admise + respinse)
        timeline:
          type: array
          items:
            $ref: "#/components/schemas/TimelineEvent"
        documente_pdf:
          type: array
          items:
            type: string
            format: uri
        source_url:
          type: string
          format: uri

    ProiecteResponse:
      type: object
      properties:
        meta:
          $ref: "#/components/schemas/Meta"
        data:
          type: array
          items:
            $ref: "#/components/schemas/Proiect"

    AmendamentSummary:
      type: object
      description: View derivat — un proiect cu amendamente, slim
      properties:
        proiect_id:
          type: string
        cdep_idp:
          type: integer
        cam:
          type: integer
        legislatura:
          type: integer
        nr_inregistrare:
          type: string
          nullable: true
        titlu:
          type: string
          nullable: true
        initiator:
          type: string
          nullable: true
        stadiu:
          type: string
          nullable: true
        lege_nr:
          type: string
          nullable: true
        amendamente_termen_depunere:
          type: string
          format: date
          nullable: true
        amendamente_admise:
          type: integer
        amendamente_respinse:
          type: integer
        amendamente_total:
          type: integer
        raport_comisie_pdf:
          type: string
          format: uri
          nullable: true
        source_url:
          type: string
          format: uri

    AmendamenteResponse:
      type: object
      properties:
        meta:
          $ref: "#/components/schemas/Meta"
        data:
          type: array
          items:
            $ref: "#/components/schemas/AmendamentSummary"

    SemnatarMotiune:
      type: object
      properties:
        nume:
          type: string
        canonical_id:
          type: string
          nullable: true
          description: Match cu Deputat.id
        partid:
          type: string
          nullable: true

    Motiune:
      type: object
      properties:
        id:
          type: string
        cdep_idm:
          type: integer
        cam:
          type: integer
        legislatura:
          type: integer
        nr_inregistrare:
          type: string
          nullable: true
        data_inregistrare:
          type: string
          format: date
          nullable: true
        titlu:
          type: string
        tip:
          type: string
          enum: [simpla, cenzura, other]
        initiatori_descriere:
          type: string
          nullable: true
        data_vot:
          type: string
          format: date
          nullable: true
        vot_pentru:
          type: integer
          nullable: true
        vot_contra:
          type: integer
          nullable: true
        vot_abtineri:
          type: integer
          nullable: true
        rezultat:
          type: string
          enum: [adoptata, respinsa, retrasa, in_procedura, other]
        nr_semnatari:
          type: integer
          nullable: true
        semnatari:
          type: array
          items:
            $ref: "#/components/schemas/SemnatarMotiune"
        pdf_url:
          type: string
          format: uri
          nullable: true
        source_url:
          type: string
          format: uri

    MotiuniResponse:
      type: object
      properties:
        meta:
          $ref: "#/components/schemas/Meta"
        data:
          type: array
          items:
            $ref: "#/components/schemas/Motiune"
