app:
  slug: reach
  name: Reach Messaging (WhatsApp/omni)
  group: messaging
  enabled: true

  capabilities:
    install: true
    uninstall: true
    update_settings: true
    events:
      - list_templates
      - send_template_message

  settings:
    # Auth & base
    api_key:        { type: string, required: true,  secret: true }
    base_url:       { type: url,    required: true,  default: "https://api.reach.tools/api/v1" }

    # Defaults (puedes override en cada request)
    channel_identifier: { type: string, required: false }   # p.ej. 103537872506108
    default_locale:     { type: string, required: false, default: "es" }

    # Webhooks
    webhook_verify_token: { type: string, required: false, secret: true }  # opcional si validas firma/secret
    webhook_enabled:       { type: boolean, required: false, default: true }

    # Endpoints (configurables por si cambian)
    endpoints:
      templates_find_by_type:   "/templates/find-by-type"        # operationId: TemplateController_findByType
      conversations_send_msg:   "/conversations/sendMessage"     # operationId: ConversationController_sendMessage

  validators:
    install:
      api_key: required|string
      base_url: required|url
    update_settings:
      api_key: sometimes|string
      base_url: sometimes|url
      channel_identifier: sometimes|string
      default_locale: sometimes|string
    events:
      list_templates:
        type: required|string        # ej: "whatsapp" o "message"
      send_template_message:
        to: required|string          # ej: 50230711913
        template_id: sometimes|string
        template_name: sometimes|string
        template_type: sometimes|string
        channel_identifier: sometimes|string
        language: sometimes|string
        components: sometimes|array   # variables/params del template

  adapter: App\Apps\Adapters\ReachAdapter
