swagger: '2.0'
info:
  title: Resolutions API
  description: Endpoints for managing board/company resolutions, workflow states,
    and results.
  version: v1
host: eboard.devsgraphics.com
schemes:
- https
basePath: /api/resolutions
consumes:
- application/json
produces:
- application/json
securityDefinitions:
  Basic:
    type: basic
security:
- Basic: []
paths:
  /resolutions/:
    get:
      operationId: resolutions_list
      summary: API for managing Resolutions and their workflow.
      description: |-
        Standard endpoints:
          - GET    /resolutions/
          - POST   /resolutions/
          - GET    /resolutions/{id}/
          - PATCH  /resolutions/{id}/
          - DELETE /resolutions/{id}/   (if you allow deletion)

        Workflow actions:
          - POST /resolutions/{id}/propose/
          - POST /resolutions/{id}/open/
          - POST /resolutions/{id}/close-approved/
          - POST /resolutions/{id}/close-rejected/
          - POST /resolutions/{id}/file/
      parameters: []
      responses:
        '200':
          description: ''
          schema:
            type: array
            items:
              $ref: '#/definitions/Resolution'
      tags:
      - resolutions
    post:
      operationId: resolutions_create
      summary: API for managing Resolutions and their workflow.
      description: |-
        Standard endpoints:
          - GET    /resolutions/
          - POST   /resolutions/
          - GET    /resolutions/{id}/
          - PATCH  /resolutions/{id}/
          - DELETE /resolutions/{id}/   (if you allow deletion)

        Workflow actions:
          - POST /resolutions/{id}/propose/
          - POST /resolutions/{id}/open/
          - POST /resolutions/{id}/close-approved/
          - POST /resolutions/{id}/close-rejected/
          - POST /resolutions/{id}/file/
      parameters:
      - name: data
        in: body
        required: true
        schema:
          $ref: '#/definitions/Resolution'
      responses:
        '201':
          description: ''
          schema:
            $ref: '#/definitions/Resolution'
      tags:
      - resolutions
    parameters: []
  /resolutions/{id}/:
    get:
      operationId: resolutions_read
      summary: API for managing Resolutions and their workflow.
      description: |-
        Standard endpoints:
          - GET    /resolutions/
          - POST   /resolutions/
          - GET    /resolutions/{id}/
          - PATCH  /resolutions/{id}/
          - DELETE /resolutions/{id}/   (if you allow deletion)

        Workflow actions:
          - POST /resolutions/{id}/propose/
          - POST /resolutions/{id}/open/
          - POST /resolutions/{id}/close-approved/
          - POST /resolutions/{id}/close-rejected/
          - POST /resolutions/{id}/file/
      parameters: []
      responses:
        '200':
          description: ''
          schema:
            $ref: '#/definitions/Resolution'
      tags:
      - resolutions
    put:
      operationId: resolutions_update
      summary: API for managing Resolutions and their workflow.
      description: |-
        Standard endpoints:
          - GET    /resolutions/
          - POST   /resolutions/
          - GET    /resolutions/{id}/
          - PATCH  /resolutions/{id}/
          - DELETE /resolutions/{id}/   (if you allow deletion)

        Workflow actions:
          - POST /resolutions/{id}/propose/
          - POST /resolutions/{id}/open/
          - POST /resolutions/{id}/close-approved/
          - POST /resolutions/{id}/close-rejected/
          - POST /resolutions/{id}/file/
      parameters:
      - name: data
        in: body
        required: true
        schema:
          $ref: '#/definitions/Resolution'
      responses:
        '200':
          description: ''
          schema:
            $ref: '#/definitions/Resolution'
      tags:
      - resolutions
    patch:
      operationId: resolutions_partial_update
      summary: API for managing Resolutions and their workflow.
      description: |-
        Standard endpoints:
          - GET    /resolutions/
          - POST   /resolutions/
          - GET    /resolutions/{id}/
          - PATCH  /resolutions/{id}/
          - DELETE /resolutions/{id}/   (if you allow deletion)

        Workflow actions:
          - POST /resolutions/{id}/propose/
          - POST /resolutions/{id}/open/
          - POST /resolutions/{id}/close-approved/
          - POST /resolutions/{id}/close-rejected/
          - POST /resolutions/{id}/file/
      parameters:
      - name: data
        in: body
        required: true
        schema:
          $ref: '#/definitions/Resolution'
      responses:
        '200':
          description: ''
          schema:
            $ref: '#/definitions/Resolution'
      tags:
      - resolutions
    delete:
      operationId: resolutions_delete
      summary: API for managing Resolutions and their workflow.
      description: |-
        Standard endpoints:
          - GET    /resolutions/
          - POST   /resolutions/
          - GET    /resolutions/{id}/
          - PATCH  /resolutions/{id}/
          - DELETE /resolutions/{id}/   (if you allow deletion)

        Workflow actions:
          - POST /resolutions/{id}/propose/
          - POST /resolutions/{id}/open/
          - POST /resolutions/{id}/close-approved/
          - POST /resolutions/{id}/close-rejected/
          - POST /resolutions/{id}/file/
      parameters: []
      responses:
        '204':
          description: ''
      tags:
      - resolutions
    parameters:
    - name: id
      in: path
      description: A UUID string identifying this Resolution.
      required: true
      type: string
      format: uuid
  /resolutions/{id}/close-approved/:
    post:
      operationId: resolutions_close_approved
      summary: OPEN → APPROVED
      description: |-
        This assumes the approval decision is already made
        (e.g. via voting or manual decision) and simply records it.
      parameters:
      - name: data
        in: body
        required: true
        schema:
          $ref: '#/definitions/Resolution'
      responses:
        '201':
          description: ''
          schema:
            $ref: '#/definitions/Resolution'
      tags:
      - resolutions
    parameters:
    - name: id
      in: path
      description: A UUID string identifying this Resolution.
      required: true
      type: string
      format: uuid
  /resolutions/{id}/close-rejected/:
    post:
      operationId: resolutions_close_rejected
      description: OPEN → REJECTED
      parameters:
      - name: data
        in: body
        required: true
        schema:
          $ref: '#/definitions/Resolution'
      responses:
        '201':
          description: ''
          schema:
            $ref: '#/definitions/Resolution'
      tags:
      - resolutions
    parameters:
    - name: id
      in: path
      description: A UUID string identifying this Resolution.
      required: true
      type: string
      format: uuid
  /resolutions/{id}/file/:
    post:
      operationId: resolutions_file
      description: APPROVED → FILED
      parameters:
      - name: data
        in: body
        required: true
        schema:
          $ref: '#/definitions/Resolution'
      responses:
        '201':
          description: ''
          schema:
            $ref: '#/definitions/Resolution'
      tags:
      - resolutions
    parameters:
    - name: id
      in: path
      description: A UUID string identifying this Resolution.
      required: true
      type: string
      format: uuid
  /resolutions/{id}/open/:
    post:
      operationId: resolutions_open_for_voting
      description: PROPOSED → OPEN (for voting/decision)
      parameters:
      - name: data
        in: body
        required: true
        schema:
          $ref: '#/definitions/Resolution'
      responses:
        '201':
          description: ''
          schema:
            $ref: '#/definitions/Resolution'
      tags:
      - resolutions
    parameters:
    - name: id
      in: path
      description: A UUID string identifying this Resolution.
      required: true
      type: string
      format: uuid
  /resolutions/{id}/propose/:
    post:
      operationId: resolutions_propose
      description: DRAFT → PROPOSED
      parameters:
      - name: data
        in: body
        required: true
        schema:
          $ref: '#/definitions/Resolution'
      responses:
        '201':
          description: ''
          schema:
            $ref: '#/definitions/Resolution'
      tags:
      - resolutions
    parameters:
    - name: id
      in: path
      description: A UUID string identifying this Resolution.
      required: true
      type: string
      format: uuid
definitions:
  Resolution:
    required:
    - org
    - title
    - description
    type: object
    properties:
      id:
        title: Id
        type: string
        format: uuid
        readOnly: true
      org:
        title: Org
        type: integer
      board:
        title: Board
        description: 'Optional: resolution can be board-specific or org-wide'
        type: integer
        x-nullable: true
      meeting:
        title: Meeting
        description: 'Optional: resolution may be linked to a specific meeting'
        type: integer
        x-nullable: true
      document:
        title: Document
        description: 'Optional: resolution may be about a specific document'
        type: string
        format: uuid
        x-nullable: true
      attachments:
        description: Supporting documents related to this resolution
        type: array
        items:
          description: Supporting documents related to this resolution
          type: string
          format: uuid
        uniqueItems: true
      poll:
        title: Poll
        description: 'Optional: resolution can be decided via a linked poll'
        type: string
        format: uuid
        x-nullable: true
      title:
        title: Title
        type: string
        maxLength: 255
        minLength: 1
      description:
        title: Description
        description: The text/body of the resolution
        type: string
        minLength: 1
      proposer:
        title: Proposer
        type: integer
        x-nullable: true
      seconder:
        title: Seconder
        type: integer
        x-nullable: true
      status:
        title: Status
        type: string
        enum:
        - draft
        - proposed
        - open
        - approved
        - rejected
        - filed
      status_display:
        title: Status display
        type: string
        readOnly: true
        minLength: 1
      decided_at:
        title: Decided at
        type: string
        format: date-time
        readOnly: true
        x-nullable: true
      filed_at:
        title: Filed at
        type: string
        format: date-time
        readOnly: true
        x-nullable: true
      created_by:
        title: Created by
        type: integer
        readOnly: true
        x-nullable: true
      updated_by:
        title: Updated by
        type: integer
        readOnly: true
        x-nullable: true
      created_at:
        title: Created at
        type: string
        format: date-time
        readOnly: true
      updated_at:
        title: Updated at
        type: string
        format: date-time
        readOnly: true
