#  -----------------------------------
# schema: test class
#  -----------------------------------

# schema
# test1 : all field types
# test2 : > test1 
# test3 : > test2 > test1
# test4 : > test3 > test2 > test1

# dataviews 
# test1_default
# test1_welcome
# test1_default
# test1_enumerate
# test1_enumerate_inject
# test4_external

# pipelines
# test1_pipeline
# test1_pipeline_regexp
# test1_pipeline_keep
# test1_pipeline_timestamp
# test1_pipeline_uuid





#  --------------------------------------------
# test4 > test3 > test2 > test1 (full) > test0
#  --------------------------------------------

# test0  - minimal - no class level permission
- classname: _schema
  keyname: test0
  displayname: "TestClass #0"
  is_enabled: yes
  order: 900
  page: Test        

  _options:
      icon: fa-diamond

  mystring:
      displayname: MyString
      dataformat: string
      description: A string 


# schema:test1

- classname: _schema
  keyname: test1
  displayname: "TestClass #1"
  is_enabled: yes
  order: 910
  page: Test        
  
  _options:
      icon: fa-diamond
      keyname_mode: edit
      "strange$€": "verystrange$€é''\""
      p_admin: p_test1_admin
      p_create: p_test1_create
      p_read: p_test1_read
      p_update: p_test1_update
      p_delete: p_test1_delete
  
  # -- string

  mystring:
      displayname: MyString
      dataformat: string
      description: A string
      page: string
      order: 100

  mystring_default:
      displayname: MyString Default
      dataformat: string
      description: A string with default value
      default_value: hello
      page: string


  # -- text

  text_raw:
    displayname: Text RAW
    dataformat: text
    order: 120
    page: text

  text_html:
    displayname: Text HTML
    dataformat: text
    dataformat_ext: html
    page: text

  text_json:
    displayname: Text JSON
    dataformat: text
    dataformat_ext: json
    page: text

  text_yaml:
    displayname: Text YAML
    dataformat: text
    dataformat_ext: yaml
    page: text

  text_markdown:
    displayname: Text MARKDOWN
    dataformat: text
    dataformat_ext: markdown
    page: text

  # -- int

  myint:
      displayname: MyInt
      dataformat: int
      page: int
      order: 140
  
  myint_multi:
      displayname: MyIntMulti
      dataformat: int
      description: separate values with blank
      cardinal_max: 0
      cardinal_max: 0
      page: int


  myint_default:
      displayname: MyInt default
      dataformat: int
      description: single int with default value
      default_value: 11
      page: int

  myint_default_multi:
      displayname: MyInt default multi
      description: separate values with blank
      dataformat: int
      default_value: 11 22
      cardinal_max: 0
      page: int


# -- Float

  myfloat:
      displayname: MyFloat
      dataformat: float
      description: float ; use dot as decimal separator
      page: float
      order: 160

  myfloat_multi:
      displayname: MyFloatMulti
      dataformat: float
      description: use dot for decimal - separate values with blank
      cardinal_max: 0
      cardinal_max: 0
      page: float

  myfloat_default:
      displayname: MyFloat default
      dataformat: float
      description: float ; use dot as decimal separator
      default_value: 11.11
      page: float

  myfloat_default_multi:
      displayname: MyFloat default multi
      dataformat: float
      description: float ; use dot as decimal separator ; separate values with blank
      default_value: 11.11 22.22
      cardinal_max: 0
      page: float

  # -- Boolean

  myboolean:
      displayname: MyBoolean
      dataformat: boolean
      page: boolean
      order: 180

  myboolean_default_true:
      displayname: MyBoolean Default True
      dataformat: boolean
      default_value: true
      page: boolean

  myboolean_default_false:
      displayname: MyBoolean Default False
      dataformat: boolean
      default_value: false
      page: boolean

  # -- Date

  mydate:
      displayname: MyDate
      description: format YYYY-MM-DD
      dataformat: date
      page: date
      order: 200

  date_auto_pipeline:
      displayname: DateAutoPipeline
      description: YYYY-MM-DD
      dataformat: date
      page: date
  
  time_auto_pipeline:
      displayname: TimeAutoPipeline
      description: HH:MM:SS
      dataformat: time
      page: date
  
  datetime_auto_pipeline:
      displayname: DateTimeAutoPipeline
      description: YYYY-MM-DD HH:MM:SS
      dataformat: datetime
      page: date

# --- IP

  myipv4:
      displayname: MyIPV4
      dataformat: ipv4
      description: A.B.C.D or A.B.C.D/mask
      page: ip
      order: 220

# -- UUID 

  uuid_auto:
      displayname: UUID auto
      dataformat: string
      description: UUID from pipeline
      page: uuid
      order: 240

# -- user

  my_user:      
      displayname: My User
      dataformat: user
      description: Choose a user
      cardinal_min: 0
      cardinal_max: 1
      page: iam
      order: 260

  my_user_multi:
      displayname: My User Multi
      dataformat: user
      description: Choose one or more users
      cardinal_min: 0
      cardinal_max: 0
      page: iam

  # -- group

  my_group:
      displayname: MyGroup
      dataformat: group
      description: Choose a Group
      cardinal_max: 0
      cardinal_max: 1
      page: iam

  my_group_multi:
      displayname: MyGroupMulti
      dataformat: group
      description: Choose one or more Groups
      cardinal_max: 0
      cardinal_max: 0
      page: iam

# -- role

  my_role:
      displayname: MyRole
      dataformat: role
      description: Choose a Role
      cardinal_max: 0
      cardinal_max: 1
      page: iam

  my_role_multi:
      displayname: MyRoleMulti
      dataformat: role
      description: Choose one or more Roles
      cardinal_max: 0
      cardinal_max: 0
      page: iam

# -- schema

  my_schema_test0:
      displayname: Schema Test0
      dataformat: schema
      dataformat_ext: test0
      description: Schema Test0 loop free
      cardinal_min: 0
      cardinal_max: 1
      page: schema
      order: 280

  my_schema_test0_multi:      
      displayname: Schema Test0 Multi
      dataformat: schema
      dataformat_ext: test0
      description: Choose one or more Test0 object
      cardinal_min: 0
      cardinal_max: 0
      page: schema

  my_schema_self:      
      displayname: Schema self Single
      dataformat: schema
      dataformat_ext: test1
      description: Choose a TEST (self)
      cardinal_min: 0
      cardinal_max: 1
      page: schema


# -- Enumerate

  my_enumerate_abcde:      
      displayname: Enumerate ABCDE
      dataformat: enumerate
      dataformat_ext: enumerate_test
      description: Choose a value
      cardinal_min: 0
      cardinal_max: 1
      page: enumerate
      order: 300

  my_enumerate_abcde_multi:      
      displayname: Enumerate Multi ABCDE
      dataformat: enumerate
      dataformat_ext: enumerate_test
      description: Choose one or more values
      cardinal_min: 0
      cardinal_max: 0
      page: enumerate

  my_enumerate_default:
      displayname: Enumerate with default
      dataformat: enumerate
      dataformat_ext: enumerate_test
      default_value: B
      page: enumerate

  my_enumerate_subfields:
      displayname: Enumerate with subfields
      dataformat: enumerate
      dataformat_ext: enumerate_test
      page: enumerate

# -- File

  my_file:
      displayname: My File
      description: Select a single test file
      dataformat: file
      page: file
      order: 320

  # my_file_multi:
  #     displayname: My File Multi
  #     dataformat: file
  #     cardinal_max: 0



# ------------------------
# test2  (> test1)
# -------------------------

- classname: _schema
  keyname: test2
  displayname: "TestClass #2"
  is_enabled: yes
  order: 920
  page: Test

  _options:
      icon: fa-diamond
      p_admin: p_test2_admin
      p_create: p_test2_create
      p_read: p_test2_read
      p_update: p_test2_update
      p_delete: p_test2_delete

  test1:      
      displayname: Test1 Object
      dataformat: schema
      dataformat_ext: test1 mystring myint myfloat myboolean
      description: Test1 Object with injected subfields


# ------------------------
# test3 (> test2)
# -------------------------



- classname: _schema
  keyname: test3
  displayname: "TestClass #3"
  is_enabled: yes
  order: 930
  page: Test

  _options:
      icon: fa-diamond
      p_admin: p_test3_admin
      p_create: p_test3_create
      p_read: p_test3_read
      p_update: p_test3_update
      p_delete: p_test3_delete

  test2:
      displayname: Test2 Object (schema)
      dataformat: schema
      dataformat_ext: test2


  _test1:
      displayname: Test1 Object (external)
      dataformat: external
      dataformat_ext: test2 test1 mystring myint myfloat myboolean


# ------------------------
# test4 (> test3)
# -------------------------

- classname: _schema
  keyname: test4
  displayname: "TestClass #4"
  is_enabled: yes
  order: 940
  page: Test

  _options:
      icon: fa-diamond
      p_admin: p_test4_admin
      p_create: p_test4_create
      p_read: p_test4_read
      p_update: p_test4_update
      p_delete: p_test4_delete

  test3:      
      displayname: Test3 Object
      dataformat: schema
      dataformat_ext: test3

  _test1:
      displayname: Test1 (external)
      dataformat: external
      dataformat_ext: test3 test1 displayname is_enabled mystring myint myfloat myboolean



# ##################################################################################
# DATA
# test4 > test3 > test2 > test1 (full) > test0
# ##################################################################################


# ----------------------------------------------------
# data:test0
# ----------------------------------------------------


- classname: test0
  keyname: test0-01
  displayname: test0-01
  mystring: data for test0-01

- classname: test0
  keyname: test0-02
  displayname: test0-02
  mystring: data for test0-02

- classname: test0
  keyname: test0-03
  displayname: test0-03
  mystring: data for test0-03


# -----------------------------------------------------
# data:test1
# ----------------------------------------------------

- classname: test1
  keyname: test1-01
  displayname: test1-01
  mystring: data for test1-01
  myint: 11
  myint_multi: [111, 222]
  myfloat: 27.19
  myfloat_multi: [111.1, 222.2]
  myboolean: true
  mydate: "2024-11-01"
  myipv4: "10.1.2.3"
  my_enumerate_abcde: "A"
  my_enumerate_abcde_multi: A, B, C
  my_enumerate_subfields: A
  my_schema_test0: test0-01
  my_schema_test0_multi: 
    - test0-02
    - test0-03
  my_schema_self: test1-03
  my_user: testuser01
  my_user_multi: 
  - testuser01
  - testuser02
  my_notify_group: testgroup01
  my_notify_group_multi: [testgroup01, testgroup02]

- classname: test1
  keyname: test1-02
  displayname: test1-02
  mystring: data for test1-02
  myint: 11
  myfloat: 27.19
  myboolean: true
  mydate: "2024-11-01"
  myipv4: "10.1.2.3"
  my_enumerate_abcde: "B"
  my_enumerate_abcde_multi: A, B, C
  my_enumerate_subfields: B
  my_schema_test0: test0-01
  my_schema_test0_multi: 
    - test0-02
    - test0-03
  my_schema_self: test1-03

- classname: test1
  keyname: test1-03
  displayname: test1-03
  mystring: data for test1-03
  myint: 11
  myfloat: 27.19
  myboolean: true
  mydate: "2024-11-01"
  myipv4: "10.1.2.3"
  my_enumerate_abcde: "C"
  my_enumerate_abcde_multi: A, B, C
  my_enumerate_subfields: complex
  my_schema_test0: test0-01
  my_schema_test0_multi: 
    - test0-02
    - test0-03
  my_schema_self: test1-03


- classname: test1
  keyname: test1-pipeline
  displayname: test1-pipeline
  description: test1 instance unittest through pipeline"
  mystring: "Exotic chars ÀàÈÊéèêôûäëïöüù€ç"
  myint: "12 345"
  myint_multi: "12 345"
  myfloat: "12 345.67"
  myfloat_multi: "12 345.67"


# ----------------------------------------------------
# data:test2
# ----------------------------------------------------

- classname: test2
  keyname: test2-01
  displayname: test2-01
  mystring: data for test2-01
  test1: test1-01  

- classname: test2
  keyname: test2-02
  displayname: test2-02
  mystring: data for test2-02
  test1: test1-02

- classname: test2
  keyname: test2-03
  displayname: test2-03
  mystring: data for test2-03
  test1: test1-03


# ----------------------------------------------------
# data:test3
# ----------------------------------------------------

- classname: test3
  keyname: test3-01
  displayname: test3-01
  mystring: data for test3-01
  test2: test2-01

- classname: test3
  keyname: test3-02
  displayname: test3-02
  mystring: data for test3-02
  test2: test2-02

- classname: test3
  keyname: test3-03
  displayname: test3-03
  mystring: data for test3-03
  test2: test2-03


# ----------------------------------------------------
# data:test4
# ----------------------------------------------------


- classname: test4
  keyname: test4-01
  displayname: test4-01
  mystring: data for test4-01
  test3: test3-01

- classname: test4
  keyname: test4-02
  displayname: test4-02
  mystring: data for test4-02
  test3: test3-02

- classname: test4
  keyname: test4-03
  displayname: test4-03
  mystring: data for test'-03
  test3: test3-03



