app:
  slug: delivery_lab
  name: Delivery Lab
  group: logistics
  enabled: true

  capabilities:
    install: true
    uninstall: true
    update_settings: true
    token_costs:
      create_diligence: 4
    events:
      - login

      - hello
      - get_neighbor_locations
      - get_locations_by_owner_code
      - create_location
      - create_diligence
      - get_diligence

  settings:
    # Base & Auth
    base_url: { type: url, required: true, default: "https://apideliverylab.com" }
    api_key: { type: string, required: true, secret: true }
    base_location_id: { type: integer, required: true }
    delivery_lab_installed: { type: boolean, required: false, default: true }

  endpoints:
    hello: "/service/clientapi/hello"
    neighborlocation: "/service/clientapi/neighborlocation"
    createlocation: "/service/clientapi/createlocation"
    creatediligence: "/service/clientapi/creatediligence"
    diligence: "/service/clientapi/diligence"

  validators:
    install:
      base_url: required|url
      api_key: required|string
      base_location_id: required|integer

    update_settings:
      base_url: sometimes|url
      api_key: sometimes|string
      base_location_id: sometimes|integer

    events:
      login: {}

      hello: {}

      get_neighbor_locations:
        lat: numeric|required
        lng: numeric|required
        offset: integer|sometimes

      get_locations_by_owner_code:
        location_owner_code: string|required
        offset: integer|sometimes

      create_location:
        lat: numeric|required
        lng: numeric|required
        name: string|required
        address: string|required
        address_ref: string|required
        location_owner_code: string|required

      create_diligence:
        base_location_id: integer|sometimes
        user_code: string|required
        order_num: string|required
        ref_payment_method: required|in:5,6,7,CASH,TRANSFER,CANCELLED
        ref_payment_amount: numeric|required
        ref_payment_change: numeric|sometimes
        client_notes: string|sometimes

      get_diligence:
        id: integer|required

  adapter: App\Apps\Adapters\DeliveryLabAdapter
