version: 2
tables:
- table:
    schema: public
    name: associations
  object_relationships:
  - name: bodyshop
    using:
      foreign_key_constraint_on: bodyshopid
  - name: user
    using:
      foreign_key_constraint_on: email
  select_permissions:
  - role: user
    permission:
      columns:
      - bodyshopid
      - email
      - id
      filter:
        user:
          authid:
            _eq: X-Hasura-User-Id
- table:
    schema: public
    name: bodyshops
  array_relationships:
  - name: associations
    using:
      foreign_key_constraint_on:
        column: bodyshopid
        table:
          schema: public
          name: associations
  - name: jobs
    using:
      foreign_key_constraint_on:
        column: bodyshopid
        table:
          schema: public
          name: jobs
  select_permissions:
  - role: user
    permission:
      columns:
      - accepted_ins_co
      - created_at
      - groups
      - id
      - ppd_diff_alert
      - shopname
      - targets
      - updated_at
      filter:
        associations:
          user:
            authid:
              _eq: X-Hasura-User-Id
  update_permissions:
  - role: user
    permission:
      columns:
      - accepted_ins_co
      - groups
      - ppd_diff_alert
      - shopname
      - targets
      filter:
        associations:
          user:
            authid:
              _eq: X-Hasura-User-Id
      check: null
- table:
    schema: public
    name: groupings
  select_permissions:
  - role: user
    permission:
      columns:
      - id
      - created_at
      - updated_at
      - effective_date
      - end_date
      - make
      - group
      - type
      filter: {}
- table:
    schema: public
    name: joblines
  object_relationships:
  - name: job
    using:
      foreign_key_constraint_on: jobid
  insert_permissions:
  - role: user
    permission:
      check:
        job:
          bodyshop:
            associations:
              user:
                authid:
                  _eq: X-Hasura-User-Id
      columns:
      - act_price
      - created_at
      - db_price
      - db_ref
      - id
      - ignore
      - jobid
      - line_desc
      - line_ind
      - line_no
      - oem_partno
      - part_qty
      - part_type
      - price_diff
      - price_diff_pc
      - unq_seq
      - updated_at
      backend_only: false
  select_permissions:
  - role: user
    permission:
      columns:
      - act_price
      - created_at
      - db_price
      - db_ref
      - id
      - ignore
      - jobid
      - line_desc
      - line_ind
      - line_no
      - oem_partno
      - part_qty
      - part_type
      - price_diff
      - price_diff_pc
      - unq_seq
      - updated_at
      filter:
        job:
          bodyshop:
            associations:
              user:
                authid:
                  _eq: X-Hasura-User-Id
  update_permissions:
  - role: user
    permission:
      columns:
      - act_price
      - created_at
      - db_price
      - db_ref
      - id
      - ignore
      - jobid
      - line_desc
      - line_ind
      - line_no
      - oem_partno
      - part_qty
      - part_type
      - price_diff
      - price_diff_pc
      - unq_seq
      - updated_at
      filter:
        job:
          bodyshop:
            associations:
              user:
                authid:
                  _eq: X-Hasura-User-Id
      check: null
  delete_permissions:
  - role: user
    permission:
      filter:
        job:
          bodyshop:
            associations:
              user:
                authid:
                  _eq: X-Hasura-User-Id
- table:
    schema: public
    name: jobs
  object_relationships:
  - name: bodyshop
    using:
      foreign_key_constraint_on: bodyshopid
  array_relationships:
  - name: joblines
    using:
      foreign_key_constraint_on:
        column: jobid
        table:
          schema: public
          name: joblines
  insert_permissions:
  - role: user
    permission:
      check:
        bodyshop:
          associations:
            user:
              authid:
                _eq: X-Hasura-User-Id
      columns:
      - bodyshopid
      - clm_no
      - clm_total
      - close_date
      - created_at
      - group
      - group_verified
      - id
      - ins_co_nm
      - loss_date
      - ownr_fn
      - ownr_ln
      - ro_number
      - updated_at
      - v_age
      - v_makedesc
      - v_mileage
      - v_model
      - v_model_yr
      - v_type
      - v_vin
      backend_only: false
  select_permissions:
  - role: user
    permission:
      columns:
      - bodyshopid
      - clm_no
      - clm_total
      - close_date
      - created_at
      - group
      - group_verified
      - id
      - ins_co_nm
      - loss_date
      - ownr_fn
      - ownr_ln
      - ro_number
      - updated_at
      - v_age
      - v_makedesc
      - v_mileage
      - v_model
      - v_model_yr
      - v_type
      - v_vin
      filter:
        bodyshop:
          associations:
            user:
              authid:
                _eq: X-Hasura-User-Id
      allow_aggregations: true
  update_permissions:
  - role: user
    permission:
      columns:
      - bodyshopid
      - clm_no
      - clm_total
      - close_date
      - created_at
      - group
      - group_verified
      - id
      - ins_co_nm
      - loss_date
      - ownr_fn
      - ownr_ln
      - ro_number
      - updated_at
      - v_age
      - v_makedesc
      - v_mileage
      - v_model
      - v_model_yr
      - v_type
      - v_vin
      filter:
        bodyshop:
          associations:
            user:
              authid:
                _eq: X-Hasura-User-Id
      check: null
  delete_permissions:
  - role: user
    permission:
      filter:
        bodyshop:
          associations:
            user:
              authid:
                _eq: X-Hasura-User-Id
- table:
    schema: public
    name: users
  array_relationships:
  - name: associations
    using:
      foreign_key_constraint_on:
        column: email
        table:
          schema: public
          name: associations
  insert_permissions:
  - role: user
    permission:
      check: {}
      columns:
      - email
      - authid
      - created_at
      - updated_at
      backend_only: false
  select_permissions:
  - role: user
    permission:
      columns:
      - authid
      - created_at
      - email
      - id
      - updated_at
      filter:
        authid:
          _eq: X-Hasura-User-Id
  update_permissions:
  - role: user
    permission:
      columns:
      - authid
      filter:
        authid:
          _eq: X-Hasura-User-Id
      check: null
- table:
    schema: public
    name: veh_groups
  select_permissions:
  - role: user
    permission:
      columns:
      - id
      - created_at
      - updated_at
      - make
      - type
      - group
      filter: {}
functions:
- function:
    schema: public
    name: search_jobs
