entity: PageView
version: "1.0"
description: "Page configuration and layout definition"

fields:
  id:
    type: uuid
    primary: true
    generated: true
    
  slug:
    type: string
    required: true
    unique: true
    max_length: 255
    pattern: "^[a-z0-9-/]+$"
    description: "URL path for this page"
    
  title:
    type: string
    required: true
    max_length: 255
    description: "Page title"
    
  description:
    type: text
    optional: true
    description: "Page description"
    
  level:
    type: integer
    required: true
    min: 1
    max: 5
    description: "Access level required (1=public, 5=supergod)"
    
  layout:
    type: json
    required: true
    description: "Page layout configuration"
    
  is_active:
    type: boolean
    required: true
    default: true
    
  created_at:
    type: datetime
    generated: true
    immutable: true
    
  updated_at:
    type: datetime
    auto_update: true

indexes:
  - fields: [slug]
    unique: true
  - fields: [level]
  - fields: [is_active]

acl:
  create:
    role: [god, supergod]
  read:
    public: true
  update:
    role: [god, supergod]
  delete:
    role: [god, supergod]
