# Requêtes CRUD statuses

list:
  query: >
    SELECT id, project_id, code, name, color, position, created_at
    FROM statuses
  filters:
    default: "user_id = :user_id"
    admin: ""
  order: "code ASC"

list_by_project:
  query: >
    SELECT id, project_id, code, name, color, position, created_at
    FROM statuses WHERE (project_id = :project_id OR project_id IS NULL)
  filters:
    default: "user_id = :user_id"
    admin: ""
  order: "code ASC"

show:
  query: >
    SELECT id, project_id, code, name, color, position, created_at
    FROM statuses WHERE id = :id
  filters:
    default: "user_id = :user_id"
    admin: ""

create:
  table: statuses
  fields:
    - user_id
    - project_id
    - code
    - name
    - color
    - position

update:
  table: statuses
  fields:
    - project_id
    - code
    - name
    - color
    - position
  filters:
    default: "user_id = :user_id"
    admin: ""

delete:
  table: statuses
  filters:
    default: "user_id = :user_id"
    admin: ""
