bar.openapi.yml

Summary

Maintainability
Test Coverage
openapi: 3.0.3
info:
  title: OpenAPI - Bar
  license:
    name: MIT
    url: https://opensource.org/license/mit/
  version: 1.0.11
servers:
  - url: http://localhost:8080
  - url: https://le-bar.telecomnancy.net/api/v1
  - url: https://bar.yewolf.fr/api
tags:
  - name: auth
    description: Related to user's authentication
  - name: accounts
    description: Related to user's accounts
  - name: transactions
    description: Related to user's transactions
  - name: refills
    description: Related to user's refills (real money)
  - name: categories
    description: Categories of items in the shop
  - name: items
    description: Items on sales in the shop
  - name: carousel
    description: Carousel texts and images
  - name: deleted
    description: Restore or delete permanently
paths:
  /auth/google/begin/{qr_nonce}:
    description: Connect account to Google
    get:
      summary: ""
      description: Connect account to Google
      operationId: connectAccount
      parameters:
        - name: qr_nonce
          in: path
          description: QR nonce
          required: true
          schema:
            type: string
      responses:
        "301":
          description: "Redirect to the google oauth page"
          headers:
            Location:
              description: "Redirect to the google oauth page"
              schema:
                type: string
        "400":
          description: "Bad request"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "500":
          description: "Internal server error"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
      tags:
        - auth
  /auth/google/callback:
    description: Callback for Google OAuth
    get:
      summary: ""
      description: Callback for Google OAuth
      operationId: callback
      parameters:
        - name: code
          in: query
          description: Google OAuth code
          required: true
          schema:
            type: string
        - name: state
          in: query
          description: Google OAuth state
          required: true
          schema:
            type: string
      responses:
        "301":
          description: "Redirect to the correct endpoint"
          headers:
            Location:
              description: "Redirect to the correct endpoint"
              schema:
                type: string
        "500":
          description: "Internal server error"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
      tags:
        - auth
  /auth/google:
    description: Connect to account with Google
    get:
      summary: ""
      description: Connect account to Google
      operationId: connectGoogle
      parameters:
        - name: r
          in: query
          description: Redirect to this url after connecting
          required: true
          schema:
            type: string
      responses:
        "301":
          description: "Redirect to the google oauth page"
          headers:
            Location:
              description: "Redirect to the google oauth page"
              schema:
                type: string
        "400":
          description: "Bad request"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "401":
          description: "Not connected"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "500":
          description: "Internal server error"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
      tags:
        - auth
  /auth/card:
    description: Connect to account with card
    post:
      summary: ""
      description: Connect account to card
      operationId: connectCard
      requestBody:
        description: Card id
        content:
          application/json:
            schema:
              type: object
              properties:
                card_id:
                  type: string
                card_pin:
                  type: string
              required:
                - card_id
                - card_pin
      responses:
        "200":
          description: "Successfully connected"
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    $ref: "#/components/schemas/Messages"
                  account:
                    $ref: "#/components/schemas/Account"
        "400":
          description: "Bad request"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "401":
          description: "Not connected"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "500":
          description: "Internal server error"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
      security:
        - local_token: []
      tags:
        - auth
  /auth/password:
    description: Connect to account with password
    post:
      summary: ""
      description: Connect account with password
      operationId: connectPassword
      requestBody:
        description: Password
        content:
          application/json:
            schema:
              type: object
              properties:
                card_id:
                  type: string
                password:
                  type: string
              required:
                - card_id
                - password
      responses:
        "200":
          description: "Successfully connected"
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    $ref: "#/components/schemas/Messages"
                  account:
                    $ref: "#/components/schemas/Account"
        "400":
          description: "Bad request"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "401":
          description: "Not connected"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "500":
          description: "Internal server error"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
      security:
        - local_token: []
      tags:
        - auth
  /auth/qr:
    description: Get the QR code to connect account to Google
    get:
      description: Websocket to listen for scan & callback (for cool animations)
      summary: ""
      operationId: getBorneAuthQRWebsocket
      responses:
        "101":
          description: "Switching Protocols"
          headers:
            Connection:
              schema:
                type: string
                enum:
                  - Upgrade
              required: true
            Upgrade:
              schema:
                type: string
                enum:
                  - websocket
              required: true
            Sec-WebSocket-Accept:
              schema:
                type: string
              required: true
      security:
        - local_token: []
    post:
      description: Validate the connection to connect
      summary: ""
      operationId: postBorneAuthQR
      requestBody:
        description: Nonce
        content:
          application/json:
            schema:
              type: object
              properties:
                nonce:
                  type: string
              required:
                - nonce
      responses:
        "200":
          description: "Successfully connected"
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    $ref: "#/components/schemas/Messages"
                  account:
                    $ref: "#/components/schemas/Account"
        "400":
          description: "Bad request"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "401":
          description: "Not connected"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "500":
          description: "Internal server error"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
  /account/qr:
    description: Get the QR code to connect account to Google
    get:
      description: Websocket to listen for scan & callback (for cool animations)
      summary: ""
      operationId: getAccountQRWebsocket
      responses:
        "101":
          description: "Switching Protocols"
          headers:
            Connection:
              schema:
                type: string
                enum:
                  - Upgrade
              required: true
            Upgrade:
              schema:
                type: string
                enum:
                  - websocket
              required: true
            Sec-WebSocket-Accept:
              schema:
                type: string
              required: true
    post:
      summary: ""
      description: Get the QR code to connect account to Google
      operationId: getAccountQR
      requestBody:
        description: Card pin
        content:
          application/json:
            schema:
              type: object
              properties:
                card_pin:
                  type: string
              required:
                - card_pin
      responses:
        "200":
          description: Successfully got QR code
          content:
            image/png:
              schema:
                type: string
                format: base64
        "401":
          description: "Not connected"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "500":
          description: "Internal server error"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
      security:
        - auth: []
        - not_onboarded: []
      tags:
        - auth
  /logout:
    description: Logout
    get:
      summary: ""
      description: Logout
      operationId: logout
      responses:
        "204":
          description: Successfully logged out
        "401":
          description: "Not connected"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "500":
          description: "Internal server error"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
      security:
        - auth: []
        - not_onboarded: []
      tags:
        - auth
  /account:
    description: Get the basic current account's information
    get:
      summary: ""
      description: Get the basic current account's information
      operationId: getAccount
      responses:
        "200":
          description: Successfully got account's info
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    $ref: "#/components/schemas/Messages"
                  account:
                    $ref: "#/components/schemas/Account"
        "401":
          description: "Not connected"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "500":
          description: "Internal server error"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
      security:
        - auth: []
      tags:
        - accounts
  /account/pin:
    patch:
      description: Update's account card pin / id
      operationId: patchAccountPin
      requestBody:
        description: Card pin / id
        content:
          application/json:
            schema:
              type: object
              properties:
                card_id:
                  type: string
                old_card_pin:
                  type: string
                new_card_pin:
                  type: string
              required:
                - old_card_pin
                - new_card_pin
      responses:
        "200":
          description: Successfully updated account's card pin
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    $ref: "#/components/schemas/Messages"
                  account:
                    $ref: "#/components/schemas/Account"
        "400":
          description: "Bad request"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "401":
          description: "Not connected"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "404":
          description: "Account not found"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "409":
          description: "Conflict"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "500":
          description: "Internal server error"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
      security:
        - auth: []
      tags:
        - accounts
  /account/{account_id}/reset_pin:
    description: Reset the account's pin
    post:
      summary: ""
      description: Reset the account's pin
      operationId: resetAccountPin
      parameters:
        - name: account_id
          in: path
          description: ID of the account
          required: true
          schema:
            $ref: "#/components/schemas/UUID"
      responses:
        "200":
          description: Successfully reset account's pin
        "401":
          description: "Not authorized"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "403":
          description: "Forbidden"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "404":
          description: "Account not found"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "500":
          description: "Internal server error"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
      security:
        - admin_auth: []
      tags:
        - accounts
  /account/password:
    patch:
      description: Update account's password
      operationId: patchAccountPassword
      requestBody:
        description: Passwords
        content:
          application/json:
            schema:
              type: object
              properties:
                old_password:
                  type: string
                new_password:
                  type: string
              required:
                - old_password
                - new_password
      responses:
        "200":
          description: Successfully updated account's card pin
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    $ref: "#/components/schemas/Messages"
                  account:
                    $ref: "#/components/schemas/Account"
        "400":
          description: "Bad request"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "401":
          description: "Not connected"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "404":
          description: "Account not found"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "409":
          description: "Conflict"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "500":
          description: "Internal server error"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
      security:
        - auth: []
      tags:
        - accounts
  /account/watch:
    description: Listen for changes on account
    get:
      summary: ""
      description: Listen for changes on account
      operationId: watchAccount
      responses:
        "200":
          description: Successfully got account's info
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    $ref: "#/components/schemas/Messages"
                  account:
                    $ref: "#/components/schemas/Account"
        "401":
          description: "Not connected"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
      security:
        - auth: []
      tags:
        - accounts
  /account/admin:
    get:
      description: Check if the current account can access the admin panel
      summary: ""
      operationId: getAccountAdmin
      responses:
        "200":
          description: Successfully got account's info
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    $ref: "#/components/schemas/Messages"
                  is_allowed:
                    type: boolean
                  can_restore:
                    type: boolean
                required:
                  - is_allowed
                  - can_restore
        "401":
          description: "Not connected"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "404":
          description: "Account not found"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "409":
          description: "Conflict"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "500":
          description: "Internal server error"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
      security:
        - auth: []
      tags:
        - accounts
  /account/toggles/wants_to_staff:
    get:
      description: Toggles the wants_to_staff flag
      summary: ""
      operationId: toggleAccountWantsToStaff
      responses:
        "200":
          description: Changed account's wants_to_staff flag
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    $ref: "#/components/schemas/Messages"
                  wants_to_staff:
                    type: boolean
                required:
                  - wants_to_staff
        "401":
          description: "Not connected"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "404":
          description: "Account not found"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "409":
          description: "Conflict"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "500":
          description: "Internal server error"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
      security:
        - auth: []
      tags:
        - accounts
  /accounts:
    description: Get all accounts informations
    get:
      summary: ""
      description: Get all accounts informations
      operationId: getAccounts
      parameters:
        - name: page
          in: query
          description: page to get
          schema:
            type: integer
            format: uint64
            default: 0
        - name: limit
          in: query
          description: number of accounts to get
          schema:
            type: integer
            format: uint64
            default: 10
        - name: search
          in: query
          description: search string
          schema:
            type: string
      responses:
        "200":
          description: Returns new account's info
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    $ref: "#/components/schemas/Messages"
                  accounts:
                    type: array
                    items:
                      $ref: "#/components/schemas/Account"
                  page:
                    type: integer
                    format: uint64
                  limit:
                    type: integer
                    format: uint64
                  max_page:
                    type: integer
                    format: uint64
                required:
                  - page
                  - limit
                  - max_page
                  - accounts
        "401":
          description: "Not authorized"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "403":
          description: "Forbidden"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "500":
          description: "Internal server error"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
      security:
        - admin_auth: []
      tags:
        - accounts
    post:
      summary: ""
      description: Add an account to the database
      operationId: postAccounts
      requestBody:
        description: Add an account to the database
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/NewAccount"
      responses:
        "200":
          description: Successfully got accounts infos
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Account"
        "401":
          description: "Not authorized"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "403":
          description: "Forbidden"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "409":
          description: "Conflict"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "500":
          description: "Internal server error"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
      security:
        - admin_auth: []
      tags:
        - accounts
  /import/accounts:
    post:
      description: Import accounts from a CSV file
      summary: ""
      operationId: importAccounts
      requestBody:
        description: Import accounts from a CSV file
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                file:
                  type: string
                  format: binary
      responses:
        "200":
          description: Successfully imported accounts
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    $ref: "#/components/schemas/Messages"
                  not_accepted:
                    type: array
                    items:
                      type: string
        "400":
          description: "Bad request"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "401":
          description: "Not authorized"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "403":
          description: "Forbidden"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "409":
          description: "Conflict"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "500":
          description: "Internal server error"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
      security:
        - admin_auth: []
      tags:
        - accounts
  /accounts/{account_id}:
    description: Get the account's information
    get:
      summary: ""
      description: Get the account's information
      operationId: getAccountId
      parameters:
        - name: account_id
          in: path
          description: ID of the account
          required: true
          schema:
            $ref: "#/components/schemas/UUID"
      responses:
        "200":
          description: Successfully got account's info
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Account"
        "401":
          description: "Not authorized"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "403":
          description: "Forbidden"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "404":
          description: "Account not found"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "500":
          description: "Internal server error"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
      security:
        - admin_auth: []
      tags:
        - accounts
    patch:
      summary: ""
      description: Update account
      operationId: patchAccountId
      parameters:
        - name: account_id
          in: path
          description: ID of the account
          required: true
          schema:
            $ref: "#/components/schemas/UUID"
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/UpdateAccountAdmin"
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Account"
        "401":
          description: "Not authorized"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "403":
          description: "Forbidden"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "404":
          description: "Account not found"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "500":
          description: "Internal server error"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
      security:
        - admin_auth: []
      tags:
        - accounts
    delete:
      summary: ""
      description: Delete account
      operationId: markDeleteAccountId
      parameters:
        - name: account_id
          in: path
          description: ID of the account
          required: true
          schema:
            $ref: "#/components/schemas/UUID"
      responses:
        "204":
          description: ""
        "401":
          description: "Not authorized"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "403":
          description: "Forbidden"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "404":
          description: "Account not found"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "500":
          description: "Internal server error"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
      security:
        - admin_auth: []
      tags:
        - accounts
  /accounts/{account_id}/toggles/wants_to_staff:
    get:
      description: Toggles the wants_to_staff flag
      summary: ""
      operationId: adminToggleAccountWantsToStaff
      parameters:
        - name: account_id
          in: path
          description: ID of the account
          required: true
          schema:
            $ref: "#/components/schemas/UUID"
      responses:
        "200":
          description: Changed account's wants_to_staff flag
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    $ref: "#/components/schemas/Messages"
                  wants_to_staff:
                    type: boolean
                required:
                  - wants_to_staff
        "401":
          description: "Not connected"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "404":
          description: "Account not found"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "409":
          description: "Conflict"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "500":
          description: "Internal server error"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
      security:
        - admin_auth: []
      tags:
        - accounts
  /transactions:
    get:
      description: Get all active transactions (orders)
      summary: ""
      operationId: getTransactions
      parameters:
        - name: page
          in: query
          description: Page number
          required: false
          schema:
            type: integer
            format: uint64
        - name: limit
          in: query
          description: Number of transactions per page
          required: false
          schema:
            type: integer
            format: uint64
        - name: state
          in: query
          description: Filter by state
          required: false
          schema:
            type: string
            $ref: "#/components/schemas/TransactionState"
        - name: name
          in: query
          description: Filter by account name
          required: false
          schema:
            type: string
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                type: object
                properties:
                  transactions:
                    type: array
                    items:
                      $ref: "#/components/schemas/Transaction"
                  page:
                    type: integer
                    format: uint64
                  limit:
                    type: integer
                    format: uint64
                  max_page:
                    type: integer
                    format: uint64
                required:
                  - transactions
                  - page
                  - limit
                  - max_page
        "401":
          description: "Not authorized"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "403":
          description: "Forbidden"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "500":
          description: "Internal server error"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
      security:
        - admin_auth: []
      tags:
        - transactions
  /transactions/items:
    get:
      description: Get all items in active transactions (ordered items)
      summary: ""
      operationId: getTransactionsItems
      parameters:
        - name: name
          in: query
          description: Filter by item name
          required: false
          schema:
            type: string
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/TransactionItem"
        "401":
          description: "Not authorized"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "403":
          description: "Forbidden"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "500":
          description: "Internal server error"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
      security:
        - admin_auth: []
      tags:
        - transactions
  /account/transactions:
    get:
      summary: ""
      description: Get all transactions
      operationId: getCurrentAccountTransactions
      parameters:
        - name: page
          in: query
          description: Page number
          required: false
          schema:
            type: integer
            format: uint64
        - name: limit
          in: query
          description: Number of transactions per page
          required: false
          schema:
            type: integer
            format: uint64
        - name: state
          in: query
          description: Filter by state
          required: false
          schema:
            type: string
            $ref: "#/components/schemas/TransactionState"
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                type: object
                properties:
                  transactions:
                    type: array
                    items:
                      $ref: "#/components/schemas/Transaction"
                  page:
                    type: integer
                    format: uint64
                  limit:
                    type: integer
                    format: uint64
                  max_page:
                    type: integer
                    format: uint64
                required:
                  - page
                  - limit
                  - max_page
                  - transactions
        "401":
          description: "Not authorized"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "403":
          description: "Forbidden"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
      security:
        - auth: []
      tags:
        - transactions
    post:
      summary: ""
      description: Create a new transaction
      operationId: postTransactions
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/NewTransaction"
      responses:
        "201":
          description: ""
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Transaction"
        "401":
          description: "Not connected"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "403":
          description: "Forbidden"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "404":
          description: "Account not found"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "500":
          description: "Internal server error"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
      security:
        - auth: []
      tags:
        - transactions
  /accounts/{account_id}/transactions:
    get:
      summary: ""
      description: Get all transactions
      operationId: getAccountTransactions
      parameters:
        - name: account_id
          in: path
          description: ID of the account
          required: true
          schema:
            $ref: "#/components/schemas/UUID"
        - name: page
          in: query
          description: Page number
          required: false
          schema:
            type: integer
            format: uint64
        - name: limit
          in: query
          description: Number of transactions per page
          required: false
          schema:
            type: integer
            format: uint64
        - name: state
          in: query
          description: Filter by state
          required: false
          schema:
            type: string
            $ref: "#/components/schemas/TransactionState"
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                type: object
                properties:
                  transactions:
                    type: array
                    items:
                      $ref: "#/components/schemas/Transaction"
                  page:
                    type: integer
                    format: uint64
                  limit:
                    type: integer
                    format: uint64
                  max_page:
                    type: integer
                    format: uint64
                required:
                  - page
                  - limit
                  - max_page
                  - transactions
        "401":
          description: "Not authorized"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "403":
          description: "Forbidden"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "500":
          description: "Internal server error"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
      security:
        - admin_auth: []
      tags:
        - transactions
  /accounts/{account_id}/transactions/{transaction_id}:
    get:
      summary: ""
      description: Get transaction
      operationId: getTransactionId
      parameters:
        - name: account_id
          in: path
          description: ID of the account
          required: true
          schema:
            $ref: "#/components/schemas/UUID"
        - name: transaction_id
          in: path
          description: ID of the transaction
          required: true
          schema:
            $ref: "#/components/schemas/UUID"
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Transaction"
        "401":
          description: "Not authorized"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "403":
          description: "Forbidden"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "404":
          description: "Transaction not found"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "500":
          description: "Internal server error"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
      security:
        - admin_auth: []
      tags:
        - transactions
    patch:
      description: Update transaction's state
      operationId: patchTransactionId
      parameters:
        - name: account_id
          in: path
          description: ID of the account
          required: true
          schema:
            $ref: "#/components/schemas/UUID"
        - name: transaction_id
          in: path
          description: ID of the transaction
          required: true
          schema:
            $ref: "#/components/schemas/UUID"
        - name: state
          in: query
          description: New state of the transaction
          required: true
          schema:
            type: string
            $ref: "#/components/schemas/TransactionState"
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "401":
          description: "Not authorized"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "403":
          description: "Forbidden"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "404":
          description: "Account or transaction not found"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "500":
          description: "Internal server error"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
      security:
        - admin_auth: []
      tags:
        - transactions
    delete:
      summary: ""
      description: Delete transaction
      operationId: markDeleteTransactionId
      parameters:
        - name: account_id
          in: path
          description: ID of the account
          required: true
          schema:
            $ref: "#/components/schemas/UUID"
        - name: transaction_id
          in: path
          description: ID of the transaction
          required: true
          schema:
            $ref: "#/components/schemas/UUID"
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "401":
          description: "Not authorized"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "403":
          description: "Forbidden"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "404":
          description: "Transaction not found"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "500":
          description: "Internal server error"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
      security:
        - admin_auth: []
      tags:
        - transactions
  /accounts/{account_id}/transactions/{transaction_id}/{item_id}:
    patch:
      description: Update transaction's item state
      operationId: patchTransactionItemId
      parameters:
        - name: account_id
          in: path
          description: ID of the account
          required: true
          schema:
            $ref: "#/components/schemas/UUID"
        - name: transaction_id
          in: path
          description: ID of the transaction
          required: true
          schema:
            $ref: "#/components/schemas/UUID"
        - name: item_id
          in: path
          description: ID of the item
          required: true
          schema:
            $ref: "#/components/schemas/UUID"
        - name: state
          in: query
          description: New state of the item
          required: false
          schema:
            $ref: "#/components/schemas/TransactionItemState"
        - name: amount
          in: query
          description: New amount of the item
          required: false
          schema:
            type: integer
            format: uint64
        - name: already_done
          in: query
          description: Update item's already done
          required: false
          schema:
            type: integer
            format: uint64
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "401":
          description: "Not authorized"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "403":
          description: "Forbidden"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "404":
          description: "Account, transaction or item not found"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "500":
          description: "Internal server error"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
      security:
        - admin_auth: []
      tags:
        - transactions
  /refills:
    get:
      description: Get all refills
      operationId: getRefills
      parameters:
        - name: page
          in: query
          description: Page number
          required: false
          schema:
            type: integer
            format: uint64
        - name: limit
          in: query
          description: Number of transactions per page
          required: false
          schema:
            type: integer
            format: uint64
        - name: start_date
          in: query
          description: Start date of the refill
          required: false
          schema:
            type: string
        - name: end_date
          in: query
          description: End date of the refill
          required: false
          schema:
            type: string
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                type: object
                properties:
                  refills:
                    type: array
                    items:
                      $ref: "#/components/schemas/Refill"
                  page:
                    type: integer
                    format: uint64
                  limit:
                    type: integer
                    format: uint64
                  max_page:
                    type: integer
                    format: uint64
                required:
                  - page
                  - limit
                  - max_page
                  - refills
        "401":
          description: "Not authorized"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "403":
          description: "Forbidden"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "500":
          description: "Internal server error"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
      security:
        - admin_auth: []
      tags:
        - refills
  /account/refills:
    get:
      description: Get all refills
      operationId: getSelfRefills
      parameters:
        - name: page
          in: query
          description: Page number
          required: false
          schema:
            type: integer
            format: uint64
        - name: limit
          in: query
          description: Number of transactions per page
          required: false
          schema:
            type: integer
            format: uint64
        - name: start_date
          in: query
          description: Start date of the refill
          required: false
          schema:
            type: string
            format: date
        - name: end_date
          in: query
          description: End date of the refill
          required: false
          schema:
            type: string
            format: date
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                type: object
                properties:
                  refills:
                    type: array
                    items:
                      $ref: "#/components/schemas/Refill"
                  page:
                    type: integer
                    format: uint64
                  limit:
                    type: integer
                    format: uint64
                  max_page:
                    type: integer
                    format: uint64
                required:
                  - refills
                  - page
                  - limit
                  - max_page
        "401":
          description: "Not authorized"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "500":
          description: "Internal server error"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
      security:
        - auth: []
      tags:
        - refills
  /accounts/{account_id}/refills:
    get:
      description: Get all refills of an account
      operationId: getAccountRefills
      parameters:
        - name: account_id
          in: path
          description: ID or CardID of the account
          required: true
          schema:
            type: string
        - name: page
          in: query
          description: Page number
          required: false
          schema:
            type: integer
            format: uint64
        - name: limit
          in: query
          description: Number of transactions per page
          required: false
          schema:
            type: integer
            format: uint64
        - name: start_date
          in: query
          description: Start date of the refill
          required: false
          schema:
            type: string
            format: date
        - name: end_date
          in: query
          description: End date of the refill
          required: false
          schema:
            type: string
            format: date
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                type: object
                properties:
                  refills:
                    type: array
                    items:
                      $ref: "#/components/schemas/Refill"
                  page:
                    type: integer
                    format: uint64
                  limit:
                    type: integer
                    format: uint64
                  max_page:
                    type: integer
                    format: uint64
                required:
                  - refills
                  - page
                  - limit
                  - max_page
        "401":
          description: "Not authorized"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "403":
          description: "Forbidden"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "404":
          description: "Account not found"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "500":
          description: "Internal server error"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
      security:
        - admin_auth: []
      tags:
        - refills
    post:
      description: Create a new refill
      operationId: postRefill
      parameters:
        - name: account_id
          in: path
          description: ID or CardID of the account
          required: true
          schema:
            type: string
        - name: amount
          in: query
          description: Amount of the refill
          required: true
          schema:
            type: integer
            format: int64
        - name: type
          in: query
          description: Type of the refill
          required: true
          schema:
            type: string
            $ref: "#/components/schemas/RefillType"
      responses:
        "201":
          description: ""
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Refill"
        "400":
          description: "Bad request"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "401":
          description: "Not authorized"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "403":
          description: "Forbidden"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "404":
          description: "Account not found"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "500":
          description: "Internal server error"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
      security:
        - admin_auth: []
      tags:
        - refills
  /accounts/{account_id}/refills/{refill_id}:
    patch:
      description: Update refill's state
      operationId: patchRefillId
      parameters:
        - name: account_id
          in: path
          description: ID of the account
          required: true
          schema:
            $ref: "#/components/schemas/UUID"
        - name: refill_id
          in: path
          description: ID of the refill
          required: true
          schema:
            $ref: "#/components/schemas/UUID"
        - name: state
          in: query
          description: New state of the refill
          required: false
          schema:
            type: string
            $ref: "#/components/schemas/RefillState"
        - name: type
          in: query
          description: New type of the refill
          required: false
          schema:
            type: string
            $ref: "#/components/schemas/RefillType"
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Refill"
        "400":
          description: "Bad request"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "401":
          description: "Not connected"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "403":
          description: "Forbidden"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "404":
          description: "Account or refill not found"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "409":
          description: "Conflict"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "500":
          description: "Internal server error"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
      security:
        - auth: []
      tags:
        - refills
    delete:
      description: Cancels a refill
      operationId: markDeleteRefill
      parameters:
        - name: account_id
          in: path
          description: ID of the account
          required: true
          schema:
            $ref: "#/components/schemas/UUID"
        - name: refill_id
          in: path
          description: ID of the refill
          required: true
          schema:
            $ref: "#/components/schemas/UUID"
      responses:
        "204":
          description: ""
        "401":
          description: "Not authorized"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "403":
          description: "Forbidden"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "404":
          description: "Account or refill not found"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "500":
          description: "Internal server error"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
      security:
        - admin_auth: []
      tags:
        - refills
  /categories:
    get:
      description: Get all categories
      operationId: getCategories
      parameters:
        - name: hidden
          in: query
          description: Show hidden categories (admin only)
          required: false
          schema:
            type: boolean
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Category"
        "500":
          description: "Internal server error"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
      security:
        - auth: []
      tags:
        - categories
    post:
      description: Create a new category
      operationId: postCategory
      requestBody:
        description: Category object
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/NewCategory"
      responses:
        "201":
          description: ""
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Category"
        "400":
          description: "Bad request"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "401":
          description: "Not authorized"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "403":
          description: "Forbidden"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "409":
          description: "Category already exists"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "500":
          description: "Internal server error"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
      security:
        - admin_auth: []
      tags:
        - categories
  /categories/{category_id}:
    get:
      description: Get a category
      operationId: getCategory
      parameters:
        - name: category_id
          in: path
          description: ID of the category
          required: true
          schema:
            $ref: "#/components/schemas/UUID"
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Category"
        "404":
          description: "Category not found"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "500":
          description: "Internal server error"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
      security:
        - auth: []
      tags:
        - categories
    patch:
      description: Update a category
      operationId: patchCategory
      parameters:
        - name: category_id
          in: path
          description: ID of the category
          required: true
          schema:
            $ref: "#/components/schemas/UUID"
      requestBody:
        description: Category object
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/UpdateCategory"
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Category"
        "400":
          description: "Bad request"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "401":
          description: "Not authorized"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "403":
          description: "Forbidden"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "404":
          description: "Category not found"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "500":
          description: "Internal server error"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
      security:
        - admin_auth: []
      tags:
        - categories
    delete:
      description: Delete a category
      operationId: markDeleteCategory
      parameters:
        - name: category_id
          in: path
          description: ID of the category
          required: true
          schema:
            $ref: "#/components/schemas/UUID"
      responses:
        "204":
          description: ""
        "404":
          description: "Category not found"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "500":
          description: "Internal server error"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
      security:
        - admin_auth: []
      tags:
        - categories
  /categories/{category_id}/picture:
    get:
      description: "Get a category picture"
      operationId: getCategoryPicture
      parameters:
        - name: category_id
          in: path
          description: ID of the category
          required: true
          schema:
            $ref: "#/components/schemas/UUID"
      responses:
        "200":
          description: ""
          content:
            image/png:
              schema:
                type: string
                format: binary
        "404":
          description: "Category not found"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "500":
          description: "Internal server error"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
      security:
        - auth: []
      tags:
        - categories
  /items:
    get:
      description: (admin) Get all items with filters and pagination
      operationId: getAllItems
      parameters:
        - name: page
          in: query
          description: Page number
          required: false
          schema:
            type: integer
            format: uint64
        - name: limit
          in: query
          description: Number of items per page
          required: false
          schema:
            type: integer
            format: uint64
        - name: state
          in: query
          description: Filter by state
          required: false
          schema:
            type: string
            $ref: "#/components/schemas/ItemState"
        - name: category_id
          in: query
          description: Filter by category
          required: false
          schema:
            $ref: "#/components/schemas/UUID"
        - name: name
          in: query
          description: Filter by name
          required: false
          schema:
            type: string
        - name: fournisseur
          in: query
          description: Filter by fournisseur
          required: false
          schema:
            $ref: "#/components/schemas/Fournisseur"
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                type: object
                properties:
                  items:
                    type: array
                    items:
                      $ref: "#/components/schemas/Item"
                  page:
                    type: integer
                    format: uint64
                  limit:
                    type: integer
                    format: uint64
                  max_page:
                    type: integer
                    format: uint64
                required:
                  - items
                  - page
                  - limit
                  - max_page
        "403":
          description: "Forbidden"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "500":
          description: "Internal server error"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
      security:
        - admin_auth: []
      tags:
        - items
  /items/incoherent:
    get:
      description: (admin) Get all incoherent items with filters and pagination
      operationId: getAllIncoherentItems
      parameters:
        - name: page
          in: query
          description: Page number
          required: false
          schema:
            type: integer
            format: uint64
        - name: limit
          in: query
          description: Number of items per page
          required: false
          schema:
            type: integer
            format: uint64
        - name: state
          in: query
          description: Filter by state
          required: false
          schema:
            type: string
            $ref: "#/components/schemas/ItemState"
        - name: category_id
          in: query
          description: Filter by category
          required: false
          schema:
            $ref: "#/components/schemas/UUID"
        - name: name
          in: query
          description: Filter by name
          required: false
          schema:
            type: string
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                type: object
                properties:
                  items:
                    type: array
                    items:
                      $ref: "#/components/schemas/Item"
                  page:
                    type: integer
                    format: uint64
                  limit:
                    type: integer
                    format: uint64
                  max_page:
                    type: integer
                    format: uint64
                required:
                  - items
                  - page
                  - limit
                  - max_page
        "403":
          description: "Forbidden"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "500":
          description: "Internal server error"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
      security:
        - admin_auth: []
      tags:
        - items
  /categories/{category_id}/items:
    get:
      description: Get all items of a category
      operationId: getCategoryItems
      parameters:
        - name: category_id
          in: path
          description: ID of the category
          required: true
          schema:
            $ref: "#/components/schemas/UUID"
        - name: page
          in: query
          description: Page number
          required: false
          schema:
            type: integer
            format: uint64
        - name: limit
          in: query
          description: Number of items per page
          required: false
          schema:
            type: integer
            format: uint64
        - name: state
          in: query
          description: Filter by state
          required: false
          schema:
            type: string
            $ref: "#/components/schemas/ItemState"
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                type: object
                properties:
                  items:
                    type: array
                    items:
                      $ref: "#/components/schemas/Item"
                  page:
                    type: integer
                    format: uint64
                  limit:
                    type: integer
                    format: uint64
                  max_page:
                    type: integer
                    format: uint64
                required:
                  - items
                  - page
                  - limit
                  - max_page

        "404":
          description: "Category not found"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "500":
          description: "Internal server error"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
      security:
        - auth: []
      tags:
        - items
    post:
      description: Create a new item
      operationId: postItem
      parameters:
        - name: category_id
          in: path
          description: ID of the category
          required: true
          schema:
            $ref: "#/components/schemas/UUID"
      requestBody:
        description: Item object
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/NewItem"
      responses:
        "201":
          description: ""
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Item"
        "400":
          description: "Bad request"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "401":
          description: "Not authorized"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "403":
          description: "Forbidden"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "409":
          description: "Item already exists"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "500":
          description: "Internal server error"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
      security:
        - admin_auth: []
      tags:
        - items
  /categories/{category_id}/items/{item_id}:
    patch:
      description: Update an item
      operationId: patchItem
      parameters:
        - name: category_id
          in: path
          description: ID of the category
          required: true
          schema:
            $ref: "#/components/schemas/UUID"
        - name: item_id
          in: path
          description: ID of the item
          required: true
          schema:
            $ref: "#/components/schemas/UUID"
      requestBody:
        description: Item object
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/UpdateItem"
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Item"
        "400":
          description: "Bad request"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "401":
          description: "Not authorized"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "403":
          description: "Forbidden"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "404":
          description: "Item not found"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "500":
          description: "Internal server error"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
      security:
        - admin_auth: []
      tags:
        - items
    delete:
      description: Delete an item
      operationId: markDeleteItem
      parameters:
        - name: category_id
          in: path
          description: ID of the category
          required: true
          schema:
            $ref: "#/components/schemas/UUID"
        - name: item_id
          in: path
          description: ID of the item
          required: true
          schema:
            $ref: "#/components/schemas/UUID"
      responses:
        "204":
          description: ""
        "401":
          description: "Not authorized"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "403":
          description: "Forbidden"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "404":
          description: "Item not found"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "500":
          description: "Internal server error"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
      security:
        - admin_auth: []
      tags:
        - items
  /categories/{category_id}/items/{item_id}/picture:
    get:
      description: "Get an item picture"
      operationId: getItemPicture
      parameters:
        - name: category_id
          in: path
          description: ID of the category
          required: true
          schema:
            $ref: "#/components/schemas/UUID"
        - name: item_id
          in: path
          description: ID of the item
          required: true
          schema:
            $ref: "#/components/schemas/UUID"
      responses:
        "200":
          description: ""
          content:
            image/png:
              schema:
                type: string
                format: binary
        "404":
          description: "Item not found"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "500":
          description: "Internal server error"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
      security:
        - auth: []
      tags:
        - items
  /carousel/images:
    get:
      description: "Get carousel images"
      operationId: getCarouselImages
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/CarouselImage"
        "500":
          description: "Internal server error"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
      tags:
        - carousel
    post:
      description: "Add a carousel image"
      operationId: addCarouselImage
      requestBody:
        description: Carousel image object
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: "#/components/schemas/CarouselImageUpload"
      responses:
        "201":
          description: ""
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CarouselImage"
        "400":
          description: "Bad request"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "401":
          description: "Not authorized"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "403":
          description: "Forbidden"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "409":
          description: "Item already exists"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "500":
          description: "Internal server error"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
      security:
        - admin_auth: []
      tags:
        - carousel
  /carousel/images/{image_id}:
    get:
      description: "Get a carousel image"
      operationId: getCarouselImage
      parameters:
        - name: image_id
          in: path
          description: ID of the image
          required: true
          schema:
            $ref: "#/components/schemas/UUID"
      responses:
        "200":
          description: ""
          content:
            image/*:
              schema:
                type: string
                format: binary
        "404":
          description: "Image not found"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "500":
          description: "Internal server error"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
      tags:
        - carousel
    delete:
      description: "Delete a carousel image"
      operationId: markDeleteCarouselImage
      parameters:
        - name: image_id
          in: path
          description: ID of the image
          required: true
          schema:
            $ref: "#/components/schemas/UUID"
      responses:
        "204":
          description: "Success"
        "401":
          description: "Not authorized"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "403":
          description: "Forbidden"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "404":
          description: "Image not found"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "500":
          description: "Internal server error"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
      security:
        - admin_auth: []
      tags:
        - carousel
  /carousel/texts:
    get:
      description: "Get carousel texts"
      operationId: getCarouselTexts
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/CarouselText"
        "500":
          description: "Internal server error"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
      tags:
        - carousel
    post:
      description: "Add a carousel text"
      operationId: addCarouselText
      requestBody:
        description: Carousel text object
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CarouselTextCreate"
      responses:
        "201":
          description: ""
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CarouselText"
        "400":
          description: "Bad request"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "401":
          description: "Not authorized"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "403":
          description: "Forbidden"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "409":
          description: "Item already exists"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "500":
          description: "Internal server error"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
      security:
        - admin_auth: []
      tags:
        - carousel
  /carousel/texts/{text_id}:
    delete:
      description: "Delete a carousel text"
      operationId: markDeleteCarouselText
      parameters:
        - name: text_id
          in: path
          description: ID of the text
          required: true
          schema:
            $ref: "#/components/schemas/UUID"
      responses:
        "204":
          description: "Success"
        "401":
          description: "Not authorized"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "403":
          description: "Forbidden"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "404":
          description: "Text not found"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "500":
          description: "Internal server error"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
      security:
        - admin_auth: []
      tags:
        - carousel
  /restocks:
    get:
      description: "Get restocks"
      operationId: getRestocks
      parameters:
        - name: page
          in: query
          description: Page number
          required: false
          schema:
            type: integer
            format: uint64
        - name: limit
          in: query
          description: Number of restocks per page
          required: false
          schema:
            type: integer
            format: uint64
        - name: search
          in: query
          description: search string
          schema:
            type: string
        - name: sort
          in: query
          description: sort string
          schema:
            type: string
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                type: object
                properties:
                  restocks:
                    type: array
                    items:
                      $ref: "#/components/schemas/Restock"
                  page:
                    type: integer
                    format: uint64
                  limit:
                    type: integer
                    format: uint64
                  max_page:
                    type: integer
                    format: uint64
                required:
                  - restocks
                  - page
                  - limit
                  - max_page
        "400":
          description: "Bad request"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "401":
          description: "Not authenticated"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "403":
          description: "Forbidden"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "500":
          description: "Internal server error"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
      security:
        - admin_auth: []
      tags:
        - restocks
    post:
      description: "Create a restock"
      operationId: createRestock
      requestBody:
        description: "Restock to create"
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/NewRestock"
      responses:
        "201":
          description: "Created"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Restock"
        "400":
          description: "Bad request"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "401":
          description: "Not authenticated"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "403":
          description: "Forbidden"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "409":
          description: "Restock already exists"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "500":
          description: "Internal server error"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
      tags:
        - restocks
  /restocks/{restock_id}:
    delete:
      description: "Delete a restock"
      operationId: deleteRestock
      parameters:
        - name: restock_id
          in: path
          description: ID of the restock
          required: true
          schema:
            $ref: "#/components/schemas/UUID"
      responses:
        "204":
          description: "Deleted"
        "401":
          description: "Not authenticated"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "403":
          description: "Forbidden"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "404":
          description: "Restock not found"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "500":
          description: "Internal server error"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
      tags:
        - restocks
  /cash_movements:
    get:
      description: "Get cash movements"
      operationId: getCashMovements
      parameters:
        - name: page
          in: query
          description: Page number
          required: false
          schema:
            type: integer
            format: uint64
        - name: limit
          in: query
          description: Number of cash movements per page
          required: false
          schema:
            type: integer
            format: uint64
        - name: search
          in: query
          description: search string
          schema:
            type: string
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                type: object
                properties:
                  cash_movements:
                    type: array
                    items:
                      $ref: "#/components/schemas/CashMovement"
                  page:
                    type: integer
                    format: uint64
                  limit:
                    type: integer
                    format: uint64
                  max_page:
                    type: integer
                    format: uint64
                required:
                  - cash_movements
                  - page
                  - limit
                  - max_page
        "400":
          description: "Bad request"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "401":
          description: "Not authenticated"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "403":
          description: "Forbidden"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
      security:
        - admin_auth: []
      tags:
        - cash_movements
    post:
      description: "Create a cash movement"
      operationId: createCashMovement
      requestBody:
        description: "Cash movement to create"
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/NewCashMovement"
      responses:
        "201":
          description: "Created"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CashMovement"
        "400":
          description: "Bad request"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "401":
          description: "Not authenticated"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "403":
          description: "Forbidden"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "409":
          description: "Cash movement already exists"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
      security:
        - admin_auth: []
      tags:
        - cash_movements
  /cash_movements/{cash_movement_id}:
    delete:
      description: "Delete a cash movement"
      operationId: deleteCashMovement
      parameters:
        - name: cash_movement_id
          in: path
          description: ID of the cash movement
          required: true
          schema:
            $ref: "#/components/schemas/UUID"
      responses:
        "204":
          description: "Deleted"
        "401":
          description: "Not authenticated"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "403":
          description: "Forbidden"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "404":
          description: "Cash movement not found"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
      security:
        - admin_auth: []
      tags:
        - cash_movements
  /deleted/accounts:
    get:
      description: "Get deleted accounts"
      operationId: getDeletedAccounts
      parameters:
        - name: page
          in: query
          description: Page number
          required: false
          schema:
            type: integer
            format: uint64
        - name: limit
          in: query
          description: Number of accounts per page
          required: false
          schema:
            type: integer
            format: uint64
        - name: search
          in: query
          description: search string
          schema:
            type: string
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                type: object
                properties:
                  accounts:
                    type: array
                    items:
                      $ref: "#/components/schemas/Account"
                  page:
                    type: integer
                    format: uint64
                  limit:
                    type: integer
                    format: uint64
                  max_page:
                    type: integer
                    format: uint64
                required:
                  - accounts
                  - page
                  - limit
                  - max_page
        "401":
          description: "Not authorized"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "403":
          description: "Forbidden"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "500":
          description: "Internal server error"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
      security:
        - admin_auth: []
      tags:
        - deleted
  /deleted/accounts/{account_id}:
    patch:
      description: "Restore a deleted account"
      operationId: restoreDeletedAccount
      parameters:
        - name: account_id
          in: path
          description: ID of the account
          required: true
          schema:
            $ref: "#/components/schemas/UUID"
      responses:
        "204":
          description: "Success"
        "400":
          description: "Bad request"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "401":
          description: "Not authorized"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "403":
          description: "Forbidden"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "404":
          description: "Account not found"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "409":
          description: "Account already exists"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "500":
          description: "Internal server error"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
      security:
        - admin_auth: []
      tags:
        - deleted
    delete:
      description: "Permanently deletes an account (SUPERADMIN)"
      operationId: deleteAccount
      parameters:
        - name: account_id
          in: path
          description: ID of the account
          required: true
          schema:
            $ref: "#/components/schemas/UUID"
      responses:
        "204":
          description: "Success"
        "401":
          description: "Not authorized"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "403":
          description: "Forbidden"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "404":
          description: "Account not found"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "409":
          description: "Account already exists"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "500":
          description: "Internal server error"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
      security:
        - admin_auth: []
      tags:
        - deleted
  /deleted/transactions:
    get:
      description: "Get deleted transactions"
      operationId: getDeletedTransactions
      parameters:
        - name: page
          in: query
          description: Page number
          required: false
          schema:
            type: integer
            format: uint64
        - name: limit
          in: query
          description: Number of accounts per page
          required: false
          schema:
            type: integer
            format: uint64
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                type: object
                properties:
                  transactions:
                    type: array
                    items:
                      $ref: "#/components/schemas/Transaction"
                  page:
                    type: integer
                    format: uint64
                  limit:
                    type: integer
                    format: uint64
                  max_page:
                    type: integer
                    format: uint64
                required:
                  - transactions
                  - page
                  - limit
                  - max_page
        "401":
          description: "Not authorized"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "403":
          description: "Forbidden"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "500":
          description: "Internal server error"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
      security:
        - admin_auth: []
      tags:
        - deleted
  /deleted/transactions/{transaction_id}:
    patch:
      description: "Restore a deleted transaction"
      operationId: restoreDeletedTransaction
      parameters:
        - name: transaction_id
          in: path
          description: ID of the transaction
          required: true
          schema:
            $ref: "#/components/schemas/UUID"
      responses:
        "204":
          description: "Success"
        "400":
          description: "Bad request"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "401":
          description: "Not authorized"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "403":
          description: "Forbidden"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "404":
          description: "Transaction not found"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "409":
          description: "Transaction already exists"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "500":
          description: "Internal server error"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
      security:
        - admin_auth: []
      tags:
        - deleted
    delete:
      description: "Permanently deletes a transaction (SUPERADMIN)"
      operationId: deleteTransaction
      parameters:
        - name: transaction_id
          in: path
          description: ID of the transaction
          required: true
          schema:
            $ref: "#/components/schemas/UUID"
      responses:
        "204":
          description: "Success"
        "401":
          description: "Not authorized"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "403":
          description: "Forbidden"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "404":
          description: "Transaction not found"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "409":
          description: "Transaction already exists"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "500":
          description: "Internal server error"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
      security:
        - admin_auth: []
      tags:
        - deleted
  /deleted/refills:
    get:
      description: "Get deleted refills"
      operationId: getDeletedRefills
      parameters:
        - name: page
          in: query
          description: Page number
          required: false
          schema:
            type: integer
            format: uint64
        - name: limit
          in: query
          description: Number of accounts per page
          required: false
          schema:
            type: integer
            format: uint64
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                type: object
                properties:
                  refills:
                    type: array
                    items:
                      $ref: "#/components/schemas/Refill"
                  page:
                    type: integer
                    format: uint64
                  limit:
                    type: integer
                    format: uint64
                  max_page:
                    type: integer
                    format: uint64
                required:
                  - refills
                  - page
                  - limit
                  - max_page
        "401":
          description: "Not authorized"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "403":
          description: "Forbidden"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "500":
          description: "Internal server error"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
      security:
        - admin_auth: []
      tags:
        - deleted
  /deleted/refills/{refill_id}:
    patch:
      description: "Restore a deleted refill"
      operationId: restoreDeletedRefill
      parameters:
        - name: refill_id
          in: path
          description: ID of the refill
          required: true
          schema:
            $ref: "#/components/schemas/UUID"
      responses:
        "204":
          description: "Success"
        "400":
          description: "Bad request"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "401":
          description: "Not authorized"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "403":
          description: "Forbidden"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "404":
          description: "Refill not found"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "409":
          description: "Refill already exists"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "500":
          description: "Internal server error"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
      security:
        - admin_auth: []
      tags:
        - deleted
    delete:
      description: "Permanently deletes a refill (SUPERADMIN)"
      operationId: deleteRefill
      parameters:
        - name: refill_id
          in: path
          description: ID of the refill
          required: true
          schema:
            $ref: "#/components/schemas/UUID"
      responses:
        "204":
          description: "Success"
        "401":
          description: "Not authorized"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "403":
          description: "Forbidden"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "404":
          description: "Refill not found"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "409":
          description: "Refill already exists"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "500":
          description: "Internal server error"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
      security:
        - admin_auth: []
      tags:
        - deleted
  /deleted/categories:
    get:
      description: "Get deleted categories"
      operationId: getDeletedCategories
      parameters:
        - name: page
          in: query
          description: Page number
          required: false
          schema:
            type: integer
            format: uint64
        - name: limit
          in: query
          description: Number of categories per page
          required: false
          schema:
            type: integer
            format: uint64
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                type: object
                properties:
                  categories:
                    type: array
                    items:
                      $ref: "#/components/schemas/Category"
                  page:
                    type: integer
                    format: uint64
                  limit:
                    type: integer
                    format: uint64
                  max_page:
                    type: integer
                    format: uint64
                required:
                  - categories
                  - page
                  - limit
                  - max_page
        "401":
          description: "Not authorized"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "403":
          description: "Forbidden"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "500":
          description: "Internal server error"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
      security:
        - admin_auth: []
      tags:
        - deleted
  /deleted/categories/{category_id}:
    patch:
      description: "Restore a deleted category"
      operationId: restoreDeletedCategory
      parameters:
        - name: category_id
          in: path
          description: ID of the category
          required: true
          schema:
            $ref: "#/components/schemas/UUID"
      responses:
        "204":
          description: "Success"
        "400":
          description: "Bad request"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "401":
          description: "Not authorized"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "403":
          description: "Forbidden"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "404":
          description: "Category not found"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "409":
          description: "Category already exists"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "500":
          description: "Internal server error"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
      security:
        - admin_auth: []
      tags:
        - deleted
    delete:
      description: "Permanently deletes a category (SUPERADMIN)"
      operationId: deleteCategory
      parameters:
        - name: category_id
          in: path
          description: ID of the category
          required: true
          schema:
            $ref: "#/components/schemas/UUID"
      responses:
        "204":
          description: "Success"
        "401":
          description: "Not authorized"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "403":
          description: "Forbidden"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "404":
          description: "Category not found"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "409":
          description: "Category already exists"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "500":
          description: "Internal server error"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
      security:
        - admin_auth: []
      tags:
        - deleted
  /deleted/items:
    get:
      description: "Get deleted items"
      operationId: getDeletedItems
      parameters:
        - name: page
          in: query
          description: Page number
          required: false
          schema:
            type: integer
            format: uint64
        - name: limit
          in: query
          description: Number of accounts per page
          required: false
          schema:
            type: integer
            format: uint64
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                type: object
                properties:
                  items:
                    type: array
                    items:
                      $ref: "#/components/schemas/Item"
                  page:
                    type: integer
                    format: uint64
                  limit:
                    type: integer
                    format: uint64
                  max_page:
                    type: integer
                    format: uint64
                required:
                  - items
                  - page
                  - limit
                  - max_page
        "401":
          description: "Not authorized"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "403":
          description: "Forbidden"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "500":
          description: "Internal server error"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
      security:
        - admin_auth: []
      tags:
        - deleted
  /deleted/items/{item_id}:
    patch:
      description: "Restore a deleted item"
      operationId: restoreDeletedItem
      parameters:
        - name: item_id
          in: path
          description: ID of the item
          required: true
          schema:
            $ref: "#/components/schemas/UUID"
      responses:
        "204":
          description: "Success"
        "400":
          description: "Bad request"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "401":
          description: "Not authorized"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "403":
          description: "Forbidden"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "404":
          description: "Item not found"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "409":
          description: "Item already exists"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "500":
          description: "Internal server error"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
      security:
        - admin_auth: []
      tags:
        - deleted
    delete:
      description: "Permanently deletes an item (SUPERADMIN)"
      operationId: deleteItem
      parameters:
        - name: item_id
          in: path
          description: ID of the item
          required: true
          schema:
            $ref: "#/components/schemas/UUID"
      responses:
        "204":
          description: "Success"
        "401":
          description: "Not authorized"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "403":
          description: "Forbidden"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "404":
          description: "Item not found"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "409":
          description: "Item already exists"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "500":
          description: "Internal server error"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
      security:
        - admin_auth: []
      tags:
        - deleted
  /deleted/carousel/images:
    get:
      description: "Get deleted carousel images"
      operationId: getDeletedCarouselImages
      parameters:
        - name: page
          in: query
          description: Page number
          required: false
          schema:
            type: integer
            format: uint64
        - name: limit
          in: query
          description: Number of accounts per page
          required: false
          schema:
            type: integer
            format: uint64
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                type: object
                properties:
                  items:
                    type: array
                    items:
                      $ref: "#/components/schemas/CarouselImage"
                  page:
                    type: integer
                    format: uint64
                  limit:
                    type: integer
                    format: uint64
                  max_page:
                    type: integer
                    format: uint64
                required:
                  - items
                  - page
                  - limit
                  - max_page
        "401":
          description: "Not authorized"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "403":
          description: "Forbidden"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "500":
          description: "Internal server error"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
      security:
        - admin_auth: []
      tags:
        - deleted
  /deleted/carousel/images/{image_id}:
    patch:
      description: "Restore a deleted carousel image"
      operationId: restoreDeletedCarouselImage
      parameters:
        - name: image_id
          in: path
          description: ID of the carousel image
          required: true
          schema:
            $ref: "#/components/schemas/UUID"
      responses:
        "204":
          description: "Success"
        "400":
          description: "Bad request"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "401":
          description: "Not authorized"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "403":
          description: "Forbidden"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "404":
          description: "Carousel image not found"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "409":
          description: "Carousel image already exists"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "500":
          description: "Internal server error"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
      security:
        - admin_auth: []
      tags:
        - deleted
    delete:
      description: "Permanently deletes a carousel image (SUPERADMIN)"
      operationId: deleteCarouselImage
      parameters:
        - name: image_id
          in: path
          description: ID of the carousel image
          required: true
          schema:
            $ref: "#/components/schemas/UUID"
      responses:
        "204":
          description: "Success"
        "401":
          description: "Not authorized"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "403":
          description: "Forbidden"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "404":
          description: "Carousel image not found"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "409":
          description: "Carousel image already exists"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "500":
          description: "Internal server error"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
      security:
        - admin_auth: []
      tags:
        - deleted
  /deleted/carousel/texts:
    get:
      description: "Get deleted carousel texts"
      operationId: getDeletedCarouselTexts
      parameters:
        - name: page
          in: query
          description: Page number
          required: false
          schema:
            type: integer
            format: uint64
        - name: limit
          in: query
          description: Number of accounts per page
          required: false
          schema:
            type: integer
            format: uint64
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                type: object
                properties:
                  items:
                    type: array
                    items:
                      $ref: "#/components/schemas/CarouselText"
                  page:
                    type: integer
                    format: uint64

                  limit:
                    type: integer
                    format: uint64

                  max_page:
                    type: integer
                    format: uint64

                required:
                  - items
                  - page
                  - limit
                  - max_page
        "401":
          description: "Not authorized"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "403":
          description: "Forbidden"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "500":
          description: "Internal server error"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
      security:
        - admin_auth: []
      tags:
        - deleted
  /deleted/carousel/texts/{text_id}:
    patch:
      description: "Restore a deleted carousel text"
      operationId: restoreDeletedCarouselText
      parameters:
        - name: text_id
          in: path
          description: ID of the carousel text
          required: true
          schema:
            $ref: "#/components/schemas/UUID"
      responses:
        "204":
          description: "Success"
        "400":
          description: "Bad request"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "401":
          description: "Not authorized"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "403":
          description: "Forbidden"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "404":
          description: "Carousel text not found"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "409":
          description: "Carousel text already exists"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "500":
          description: "Internal server error"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
      security:
        - admin_auth: []
      tags:
        - deleted
    delete:
      description: "Permanently deletes a carousel text (SUPERADMIN)"
      operationId: deleteCarouselText
      parameters:
        - name: text_id
          in: path
          description: ID of the carousel text
          required: true
          schema:
            $ref: "#/components/schemas/UUID"
      responses:
        "204":
          description: "Success"
        "401":
          description: "Not authorized"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "403":
          description: "Forbidden"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "404":
          description: "Carousel text not found"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "409":
          description: "Carousel text already exists"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "500":
          description: "Internal server error"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
      security:
        - admin_auth: []
      tags:
        - deleted
  /course:
    get:
      description: "Get generated course"
      operationId: getCourse
      parameters:
        - name: fournisseur
          in: query
          description: Fournisseur name
          required: false
          schema:
            type: string
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                type: object
                properties:
                  items:
                    type: array
                    items:
                      $ref: "#/components/schemas/CourseItem"
                required:
                  - items
        "401":
          description: "Not authorized"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "403":
          description: "Forbidden"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
        "500":
          description: "Internal server error"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
      security:
        - admin_auth: []
      tags:
        - course
components:
  schemas:
    UUID:
      type: string
      format: uuid
      example: 4be0643f-1d98-573b-97cd-ca98a65347dd
    ErrorCodes:
      type: string
      enum:
        - bad_request
        - forbidden
        - account_not_found
        - qr_invalid
        - internal_server_error
        - not_authenticated
        - image_not_found
        - text_not_found
        - category_not_found
        - item_not_found
        - refill_not_found
        - transaction_not_found
      x-enum-varnames:
        - ErrBadRequest
        - ErrForbidden
        - ErrAccountNotFound
        - ErrQRInvalid
        - ErrInternalServerError
        - ErrNotAuthenticated
        - ErrImageNotFound
        - ErrTextNotFound
        - ErrCategoryNotFound
        - ErrItemNotFound
        - ErrRefillNotFound
        - ErrTransactionNotFound
    Messages:
      type: string
      enum:
        - Bad request
        - Not connected
        - Missing fields %v
        - Account already exists
        - Account not found
        - Account is not allowed to use ressource
        - Account cannot use ressource at the time being
        - Invalid QR Code nonce
        - Internal server error
        - You are not authenticated
        - Image does not exists
        - Text does not exists
        - Category does not exists
        - Item does not exists
        - Refill does not exists
        - Transaction does not exists
      x-enum-varnames:
        - MsgBadRequest
        - MsgNotConnected
        - MsgMissingFields
        - MsgAccountAlreadyExists
        - MsgAccountNotFound
        - MsgAccountNotAllowed
        - MsgAccountNotAvailable
        - MsgQRInvalid
        - MsgInternalServerError
        - MsgNotAuthenticated
        - MsgImageNotFound
        - MsgTextNotFound
        - MsgCategoryNotFound
        - MsgItemNotFound
        - MsgRefillNotFound
        - MsgTransactionNotFound
    HTTPError:
      type: object
      properties:
        message:
          $ref: "#/components/schemas/Messages"
        error_code:
          $ref: "#/components/schemas/ErrorCodes"
      required:
        - message
        - error_code
    NewAccount:
      type: object
      properties:
        first_name:
          type: string
        last_name:
          type: string
        email_address:
          type: string
        card_id:
          type: string
        balance:
          type: integer
          format: int64
          example: 1000 (10.00€)
        role:
          $ref: "#/components/schemas/AccountRole"
        price_role:
          $ref: "#/components/schemas/AccountPriceRole"
      required:
        - first_name
        - last_name
        - email_address
        - role
        - balance
    UpdateAccountAdmin:
      type: object
      properties:
        first_name:
          type: string
        last_name:
          type: string
        nickname:
          type: string
        email_address:
          type: string
        card_id:
          type: string
        # balance:
        #   type: integer
        #   format: int64
        #   example: 1000
        role:
          $ref: "#/components/schemas/AccountRole"
        price_role:
          $ref: "#/components/schemas/AccountPriceRole"
        restrictions:
          type: array
          items:
            $ref: "#/components/schemas/AccountRestrictions"
        state:
          $ref: "#/components/schemas/AccountState"
    AccountState:
      type: string
      description: State of the account
      example: account_ok
      enum:
        - not_onboarded
        - account_ok
      x-enum-varnames:
        - AccountNotOnBoarded
        - AccountOK
    AccountRestrictions:
      type: string
      description: Restrictions of the account
      example: remote_restricted
      enum:
        - remote_restricted
        - blocked
      x-enum-varnames:
        - AccountRemoteRestricted
        - AccountBlocked
    AccountRole:
      type: string
      description: Role of the account
      example: student
      enum:
        - student
        - student_with_benefits
        - member
        - admin
        - ghost
        - superadmin
      x-enum-varnames:
        - AccountStudent
        - AccountStudentWithBenefits
        - AccountMember
        - AccountAdmin
        - AccountGhost
        - AccountSuperAdmin
    AccountPriceRole:
      type: string
      description: Role of the account
      example: student
      enum:
        - coutant
        - privilegies
        - staff_bar
        - menu
        - ceten
        - externe
      x-enum-varnames:
        - AccountPriceCoutant
        - AccountPriceStaffBar
        - AccountPricePrivilegies
        - AccountPriceMenu
        - AccountPriceCeten
        - AccountPriceExterne
    Account:
      type: object
      properties:
        id:
          $ref: "#/components/schemas/UUID"
        first_name:
          type: string
        last_name:
          type: string
        nickname:
          type: string
        google_id:
          type: string
        google_picture:
          type: string
        email_address:
          type: string
        balance:
          type: integer
          format: int64
          example: 1000
        points:
          type: integer
          format: int64
          example: 1000
        card_id:
          type: string
        card_pin:
          type: string
          x-oapi-codegen-extra-tags:
            json: "-" # ignore this field in json
        password:
          type: string
          x-oapi-codegen-extra-tags:
            json: "-" # ignore this field in json
        role:
          $ref: "#/components/schemas/AccountRole"
        price_role:
          $ref: "#/components/schemas/AccountPriceRole"
        restrictions:
          type: array
          items:
            $ref: "#/components/schemas/AccountRestrictions"
        state:
          $ref: "#/components/schemas/AccountState"
        deleted_at:
          type: integer
          format: uint64
        deleted_by:
          $ref: "#/components/schemas/UUID"
        wants_to_staff:
          type: boolean
      required:
        - id
        - first_name
        - last_name
        - email_address
        - balance
        - role
        - price_role
        - restrictions
        - state
        - card_pin
        - points
        - wants_to_staff
    ItemState:
      type: string
      description: State of the item
      example: buyable
      enum:
        - buyable
        - not_buyable
      x-enum-varnames:
        - ItemBuyable
        - ItemNotBuyable
    UpdateItem:
      type: object
      properties:
        prices:
          $ref: "#/components/schemas/ItemPrices"
        amount_left:
          type: integer
          format: uint64
          example: 32
        buy_limit:
          type: integer
          format: int64
          example: 32
        optimal_amount:
          type: integer
          format: uint64
          example: 32
        category_id:
          $ref: "#/components/schemas/UUID"
        name:
          type: string
          description: Name of the current item
        picture:
          type: string
          format: base64
          description: Picture of the current item
        promotion:
          type: integer
          format: uint64
        promotion_ends_at:
          type: integer
          format: uint64
        state:
          $ref: "#/components/schemas/ItemState"
        available_from:
          type: integer
          format: uint64
        available_until:
          type: integer
          format: uint64
        is_menu:
          type: boolean
        menu_items:
          type: array
          items:
            $ref: "#/components/schemas/MenuItem"
        menu_categories:
          type: array
          items:
            $ref: "#/components/schemas/MenuCategory"
        amount_per_bundle:
          type: integer
          format: uint64
        ref_bundle:
          type: string
        fournisseur:
          $ref: "#/components/schemas/Fournisseur"        
    ItemPrices:
      type: object
      properties:
        coutant:
          type: integer
          format: uint64
          example: 1000
        staff_bar:
          type: integer
          format: uint64
          example: 1000
        privilegies:
          type: integer
          format: uint64
          example: 1000
        menu:
          type: integer
          format: uint64
          example: 1000
        ceten:
          type: integer
          format: uint64
          example: 1000
        externe:
          type: integer
          format: uint64
          example: 1000
      required:
        - coutant
        - staff_bar
        - privilegies
        - menu
        - ceten
        - externe
    NewItem:
      type: object
      properties:
        prices:
          $ref: "#/components/schemas/ItemPrices"
        promotion:
          type: integer
          format: uint64
        promotion_ends_at:
          type: integer
          format: uint64
        amount_left:
          type: integer
          format: uint64
          example: 32
        optimal_amount:
          type: integer
          format: uint64
          example: 32
        buy_limit:
          type: integer
          format: uint64
          example: 32
        available_from:
          type: integer
          format: uint64
        available_until:
          type: integer
          format: uint64
        is_menu:
          type: boolean
        menu_items:
          type: array
          items:
            $ref: "#/components/schemas/MenuItem"
        menu_categories:
          type: array
          items:
            $ref: "#/components/schemas/MenuCategory"
        name:
          type: string
          description: Name of the current item
        picture:
          type: string
          format: base64
          description: Picture of the current item
        state:
          $ref: "#/components/schemas/ItemState"
      required:
        - prices
        - amount_left
        - optimal_amount
        - category_id
        - name
        - picture
        - state
    Item:
      type: object
      properties:
        id:
          $ref: "#/components/schemas/UUID"
        prices:
          $ref: "#/components/schemas/ItemPrices"
        display_prices:
          $ref: "#/components/schemas/ItemPrices"
        display_price:
          type: integer
          format: uint64
          example: 1000
        promotion:
          type: integer
          format: uint64
          example: 3000 (-30%)
        promotion_ends_at:
          type: integer
          format: uint64
        amount_left:
          type: integer
          format: uint64
          example: 32
        optimal_amount:
          type: integer
          format: uint64
          example: 32
        buy_limit:
          type: integer
          format: uint64
          example: 32
        category_id:
          $ref: "#/components/schemas/UUID"
        name:
          type: string
          description: Name of the current item
        picture_uri:
          type: string
          description: Link to picture of the current item
        available_from:
          type: integer
          format: uint64
        available_until:
          type: integer
          format: uint64
        is_menu:
          type: boolean
        menu_items:
          type: array
          items:
            $ref: "#/components/schemas/MenuItem"
        menu_categories:
          type: array
          items:
            $ref: "#/components/schemas/MenuCategory"
        state:
          $ref: "#/components/schemas/ItemState"
        last_tva:
          type: integer
          format: uint64
        deleted_at:
          type: integer
          format: uint64
        deleted_by:
          $ref: "#/components/schemas/UUID"
        amount_per_bundle:
          type: integer
          format: uint64
        ref_bundle:
          type: string
          description: Referal code of the product in the Drive
        fournisseur:
          $ref: "#/components/schemas/Fournisseur"
      required:
        - id
        - prices
        - amount_left
        - optimal_amount
        - category_id
        - name
        - picture_uri
        - state
        - is_menu
    MenuItem:
      type: object
      properties:
        id:
          $ref: "#/components/schemas/UUID"
        name:
          type: string
          description: Name of the current item
        picture_uri:
          type: string
          description: Link to picture of the current item
        promotion:
          type: integer
          format: uint64
          example: 3000 (-30%)
        amount:
          type: integer
          format: uint64
          example: 32
      required:
        - id
        - amount
        - name
        - picture_uri
    CourseItem:
      type: object
      properties:
        amountToBuy:
          type: integer
          format: uint64
        item:
          $ref: "#/components/schemas/Item"
      required:
        - amountToBuy
        - item
    MenuCategory:
      type: object
      properties:
        id:
          $ref: "#/components/schemas/UUID"
        name:
          type: string
          description: Name of the category
        picture_uri:
          type: string
          description: Link to picture of the category
        amount:
          type: integer
          format: uint64
          example: 32
      required:
        - id
        - amount
        - name
        - picture_uri
    UpdateCategory:
      type: object
      properties:
        name:
          type: string
          description: Name of the current category
        picture:
          type: string
          format: base64
        position:
          type: integer
          format: uint64
        hidden:
          type: boolean
    NewCategory:
      type: object
      properties:
        name:
          type: string
          description: Name of the current category
        picture:
          type: string
          format: base64
        position:
          type: integer
          format: uint64
      required:
        - name
        - picture
        - position
    Category:
      type: object
      properties:
        id:
          $ref: "#/components/schemas/UUID"
        name:
          type: string
          description: Name of the current category
        picture_uri:
          type: string
          description: Link to picture of the current category
        position:
          type: integer
          format: uint64
        hidden:
          type: boolean
        deleted_at:
          type: integer
          format: uint64
        deleted_by:
          $ref: "#/components/schemas/UUID"
      required:
        - id
        - name
        - picture_uri
        - position
        - items
        - hidden
    TransactionState:
      type: string
      enum:
        - started
        - taken_care_of
        - finished
        - canceled
      x-enum-varnames:
        - TransactionStarted
        - TransactionTakenCareOf
        - TransactionFinished
        - TransactionCanceled
    TransactionItemState:
      type: string
      enum:
        - started
        - taken_care_of
        - finished
        - canceled
      x-enum-varnames:
        - TransactionItemStarted
        - TransactionItemTakenCareOf
        - TransactionItemFinished
        - TransactionItemCanceled
    TransactionItem:
      type: object
      properties:
        item_id:
          $ref: "#/components/schemas/UUID"
        picture_uri:
          type: string
          description: Link to picture of the current item
        item_name:
          type: string
          description: Name of the current item
        item_amount:
          type: integer
          format: uint64
        item_already_done:
          type: integer
          format: uint64
        unit_cost:
          type: integer
          format: uint64
        is_menu:
          type: boolean
        menu_items:
          type: array
          items:
            $ref: "#/components/schemas/MenuItem"
        menu_categories:
          type: array
          items:
            $ref: "#/components/schemas/MenuCategory"
        picked_categories_items:
          type: array
          items:
            $ref: "#/components/schemas/TransactionItem"
        total_cost:
          type: integer
          format: uint64
        state:
          $ref: "#/components/schemas/TransactionItemState"
      required:
        - item_id
        - item_name
        - item_amount
        - item_already_done
        - unit_cost
        - total_cost
        - state
        - picture_uri
        - is_menu
    Transaction:
      type: object
      properties:
        id:
          $ref: "#/components/schemas/UUID"
        items:
          type: array
          items:
            $ref: "#/components/schemas/TransactionItem"
        account_id:
          type: string
        account_name:
          type: string
          description: Name of the account
        account_nick_name:
          type: string
          description: Nickname of the account
        total_cost:
          type: integer
          format: uint64
        state:
          $ref: "#/components/schemas/TransactionState"
        deleted_at:
          type: integer
          format: uint64
        deleted_by:
          $ref: "#/components/schemas/UUID"
        created_at:
          type: integer
          format: uint64
      required:
        - id
        - items
        - account_id
        - account_name
        - total_cost
        - state
        - created_at
    NewTransactionItem:
      type: object
      properties:
        item_id:
          $ref: "#/components/schemas/UUID"
        amount:
          type: integer
          format: uint64
        picked_categories_items:
          type: array
          items:
            $ref: "#/components/schemas/NewTransactionItem"
      required:
        - item_id
        - amount
    NewTransaction:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: "#/components/schemas/NewTransactionItem"
        card_pin:
          type: string
          description: Pin of the card
      required:
        - items
        - card_pin
    RefillState:
      type: string
      enum:
        - valid
        - canceled
    RefillType:
      type: string
      enum:
        - cash
        - card
        - tranfer
        - check
        - other
      x-enum-varnames:
        - RefillCash
        - RefillCard
        - RefillTransfer
        - RefillCheck
        - RefillOther
    Refill:
      type: object
      properties:
        id:
          $ref: "#/components/schemas/UUID"
        account_id:
          $ref: "#/components/schemas/UUID"
        account_name:
          type: string
          description: Name of the account
        amount:
          type: integer
          format: int64
          example: 1050 (10.50€)
        state:
          $ref: "#/components/schemas/RefillState"
        issued_at:
          type: integer
          format: uint64
        issued_by:
          $ref: "#/components/schemas/UUID"
        issued_by_name:
          type: string
        canceled_by:
          $ref: "#/components/schemas/UUID"
        canceled_by_name:
          type: string
        type:
          $ref: "#/components/schemas/RefillType"
        deleted_at:
          type: integer
          format: uint64
        deleted_by:
          $ref: "#/components/schemas/UUID"
      required:
        - id
        - account_id
        - account_name
        - amount
        - state
        - issued_at
        - issued_by
        - issued_by_name
        - type
    CarouselTextCreate:
      type: object
      properties:
        text:
          type: string
          description: Text to display
        color:
          type: string
          description: Color of the text
          example: "#FFFFFF"
      required:
        - text
    CarouselText:
      type: object
      properties:
        id:
          $ref: "#/components/schemas/UUID"
        text:
          type: string
          description: Text to display
        color:
          type: string
          description: Color of the text
          example: "#FFFFFF"
        deleted_at:
          type: integer
          format: uint64
        deleted_by:
          $ref: "#/components/schemas/UUID"
      required:
        - id
        - text
        - color
    CarouselImageUpload:
      type: object
      properties:
        image:
          type: string
          description: Image to display
          format: binary
      required:
        - image
    CarouselImage:
      type: object
      properties:
        id:
          $ref: "#/components/schemas/UUID"
        image_url:
          type: string
          description: Image to display
        deleted_at:
          type: integer
          format: uint64
        deleted_by:
          $ref: "#/components/schemas/UUID"
      required:
        - id
        - image_url
    NewRestockItem:
      type: object
      properties:
        item_id:
          $ref: "#/components/schemas/UUID"
        amount_of_bundle:
          type: integer
          format: uint64
        amount_per_bundle:
          type: integer
          format: uint64
        bundle_cost_ht:
          type: integer
          format: uint64
        bundle_cost_ttc:
          type: integer
          format: uint64
        bundle_cost_float_ttc:
          type: number
          format: float
        tva:
          type: integer
          format: uint64
      required:
        - item_id
        - amount_of_bundle
        - amount_per_bundle
        - bundle_cost_ht
        - bundle_cost_ttc
        - tva
    NewRestock:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: "#/components/schemas/NewRestockItem"
        total_cost_ht:
          type: integer
          format: uint64
        total_cost_ttc:
          type: integer
          format: uint64
        driver_id:
          $ref: "#/components/schemas/UUID"
        type:
          $ref: "#/components/schemas/RestockType"
      required:
        - items
        - total_cost_ht
        - total_cost_ttc
        - type
    RestockItem:
      type: object
      properties:
        item_id:
          $ref: "#/components/schemas/UUID"
        item_name:
          type: string
          description: Name of the current item
        item_picture_uri:
          type: string
          description: Link to picture of the current item
        amount_of_bundle:
          type: integer
          format: uint64
        amount_per_bundle:
          type: integer
          format: uint64
        bundle_cost_ht:
          type: integer
          format: uint64
        bundle_cost_ttc:  
          type: integer
          format: uint64
        tva:
          type: integer
          format: uint64
      required:
        - item_id
        - item_name
        - item_picture_uri
        - amount_of_bundle
        - amount_per_bundle
        - bundle_cost_ht
        - bundle_cost_ttc
        - tva
    RestockType:
      type: string
      enum:
        - auchan
        - auchan_drive
        - viennoiserie
        - promocash
      x-enum-varnames:
        - RestockAuchan
        - RestockAuchanDrive
        - RestockViennoiserie
        - RestockPromocash
    Fournisseur:
      type: string
      enum:
        - auchan
        - auchan_drive
        - viennoiserie
        - promocash
      x-enum-varnames:
        - Auchan
        - Auchan_Drive
        - Viennoiserie
        - Promocash
    Restock:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: "#/components/schemas/RestockItem"
        total_cost_ht:
          type: integer
          format: uint64
        total_cost_ttc:
          type: integer
          format: uint64
        driver_id:
          $ref: "#/components/schemas/UUID"
        driver_name:
          type: string
          description: Name of the driver
        id:
          $ref: "#/components/schemas/UUID"
        type:
          $ref: "#/components/schemas/RestockType"
        created_at:
          type: integer
          format: uint64
        created_by:
          $ref: "#/components/schemas/UUID"
        created_by_name:
          type: string
        deleted_at:
          type: integer
          format: uint64
        deleted_by:
          $ref: "#/components/schemas/UUID"
      required:
        - items
        - total_cost_ht
        - total_cost_ttc
        - id
        - type
        - created_at
        - created_by
        - created_by_name
    NewCashMovement:
      type: object
      properties:
        amount:
          type: integer
          format: int64
        reason:
          type: string
      required:
        - amount
        - reason
    CashMovement:
      type: object
      properties:
        id:
          $ref: "#/components/schemas/UUID"
        amount:
          type: integer
          format: int64
        old_amount:
          type: integer
          format: int64
        reason:
          type: string
        created_at:
          type: integer
          format: uint64
        created_by:
          $ref: "#/components/schemas/UUID"
        created_by_name:
          type: string
        deleted_at:
          type: integer
          format: uint64
        deleted_by:
          $ref: "#/components/schemas/UUID"
        deleted_by_name:
          type: string
      required:
        - id
        - amount
        - old_amount
        - reason
        - created_at
        - created_by
        - created_by_name
  securitySchemes:
    auth:
      type: apiKey
      name: BAR_SESS
      in: cookie
    local_token:
      type: apiKey
      name: X-Local-Token
      in: header
    admin_auth:
      type: apiKey
      name: BAR_ADMIN_SESS
      in: cookie
    not_onboarded:
      type: apiKey
      name: BAR_ONBOARD_SESS
      in: cookie