#
# Custom (dynamic) lists. This data is used as the initial,
# minimal data for dynamic list that ships with the system.
#
# Fields:
# id:           Primary id (not recommended)
# name:         Name of the list
# name_plural:  Name in plural (optional)
# sort_mode:    Sorting order (Alpha, -Alpha, SortCol)
# masks:        Edit masks to indicate various statuses of the list
#                (e.g  if editable or deletable..etc)
# notes:        Notes for the list
# items:        List of items for the list
#   id:         Primary id
#   value:      Value (name) of the list item
#   extra:      Abbreviated version of the value
#   status:     If enabled (1 - enabled, 0 - disabled)
#   sort:       Sort order  (optional)
#   properties: Item-specific config based on Ticket Flags form fields
#     (key):  (value)
# properties:   List properties form (see form.yaml for details)
#
---
# Ticket statuses
- type: ticket-status #notrans
  name: Ticket Status
  name_plural: Ticket Statuses
  sort_mode: SortCol  # notrans
  masks: 13
  notes: |
    Ticket statuses
  properties:
    title: Ticket Status Properties
    instructions: Properties that can be set on a ticket status.
    deletable: false
    fields:
      - type: state # notrans
        name: state # notrans
        label: State
        required: true
        sort: 1
        edit_mask: 63
        configuration:
            prompt: State of a ticket
      - type: flags # notrans
        name: flags # notrans
        label: Flags
        required: false
        sort: 2
        edit_mask: 63
        configuration:
            prompt: Ticket Flags
            multiselect: true
      - type: memo # notrans
        name: description # notrans
        label: Description
        required: false
        sort: 3
        edit_mask: 15
        configuration:
            rows: 2
            cols: 40
            html: false
            length: 100
  configuration:
    handler: TicketStatusList

# Ticket flags
- type: ticket-flag # notrans
  name: Ticket Flag
  name_plural: Ticket Flags
  sort_mode: Alpha  # notrans
  masks: 15
  notes: |
    Flags that can be set on tickets
  properties:
    title: Flag Properties
    instructions: Properties that can be set on a flag.
    deletable: false
    fields:
      - type: state # notrans
        name: states # notrans
        label: Allowed States
        required: true
        sort: 1
        edit_mask: 63
        configuration:
            prompt: Allowed Ticket States
            multiselect: true
      - type: memo # notrans
        name: description # notrans
        label: Description
        required: false
        sort: 2
        edit_mask: 15
        configuration:
            rows: 2
            cols: 40
            html: false
            length: 100
  items: # Note that id doubles as a bit mask for the flag (must be preset)
    - id: 1 # notrans
      value: Answered
      extra: answered
      status: 3
      sort: 1
      configuration:
        states:
            open: Open
        description:|
            Marked as Answered
    - id: 2 # notrans
      value: Onhold
      extra: onhold
      status: 3
      sort: 2
      configuration:
        states:
            open: Open
        description:|
            Put on hold
    - id: 4  # notrans
      value: Overdue
      extra: overdue
      status: 3
      sort: 3
      configuration:
        states:
            open: Open
        description:|
            Marked overdue
