# Big thanks to https://github.com/files-community/Files/ for a template of the code_quality_issue

name: Code Quality Issue
description: Create a code quality issue to help InvoiceShelf keep a clean codebase
labels:
  - code quality
  - triage
projects: ['InvoiceShelf/2']
assignees:
  - rihards-simanovics

body:
  # Tip to warn of checking for existing issues
  - type: markdown
    attributes:
      value: >
        > [!TIP]

        > Have you checked for similar code quality issues? There's a
        possibility your suggestion is already being tracked. Please do a
        thorough search before creating a new issue.

  # Ask user to confirm they've tried to fix or research the issue before
  # posting a bug report.
  - type: checkboxes
    id: confirm-read-documentation
    attributes:
      label: Issue filing prerequisites
      description: 'Prior to filing an issue please confirm that:'
      options:
        - label: I've checked the [documentation](https://docs.invoiceshelf.com/).
          required: true
        - label: I've looked for similar issues both Open and Closed.
          required: true
        - label: >-
            I've tried clearing both cache and cookies in my browser or tried
            opening the app in the Incognito/InPrivate window.
          required: true

  # Issue body
  - type: textarea
    id: description
    attributes:
      label: Description
      description: A clear and concise description of what the code quality issue is.
    validations:
      required: true

  # Related code
  - type: textarea
    id: code-in-question
    attributes:
      label: The code in question
      description: >-
        A list of the different InvoiceShelf and/or areas of the code concerned by the issue.
    validations:
      required: true

  # Gains
  - type: textarea
    id: gains
    attributes:
      label: Gains
      description: What would fixing this code quality issue bring to the source code?
      placeholder: >-
        - e.g. Better readability.

        - e.g. Uncoupling concepts X and Y.

        - e.g. Clarifying the responsibility of class C.
    validations:
      required: true

  # Requirements
  - type: textarea
    id: requirements
    attributes:
      label: Requirements
      description: Describe all the requirements to solve the code quality issue.
      placeholder: >-
        - e.g. Using a specific design pattern.

        - e.g. Separating Interface I into three new interfaces I1, I2 and I3.

        - e.g. Regrouping the duplicated process into a new helper.

  # Remarks
  - type: textarea
    id: comments
    attributes:
      label: Comments
      description: >-
        Additional information, comments or screenshots about the code quality
        issue.
