title: Magic Offers

scope:
  getStaff:
    description: Gets the list of staff party and role.
  setStaff:
    description: Sets the list of staff party and role.
  getOffers:
    description: Gets the list of offers on this party (shop).
  setOffers:
    description: Sets the list of offers on this party (shop).
  getClaims:
    description: Gets the claims made by this party (consumer).
  setClaims:
    description: Sets the claims made by this party (consumer).
  postLog:
    description: Posts a log entry.

grant:
  '%':
  - getStaff    # This returns empty unless you _are_ staff or owner!
  - getOffers
  - getClaims
  - postLog

  $party:
  - setStaff
  - setOffers
  - setClaims

tab:
  v1:
    src: agent/offers.ts
    importmap: agent/offers.ts.json
    ttl: 3600
    config:
      logDaemon: ${logDaemon}

drive:
  public: # Addressable at https://daemon.id/drive/PREFIX/public
    read:
    - public
    write:
    - ${party}

log:
  offers:
    rotateEvery: 1 day
    rotateToDrive: true
    timestamp: false
  claims:
    rotateEvery: 1 day
    rotateToDrive: true
    timestamp: false
  staff:
    rotateEvery: 1 day
    rotateToDrive: true
    timestamp: false
  wc_visit:
    rotateEvery: 1 day
    rotateToDrive: true
    timestamp: false
  wc_basket:
    rotateEvery: 1 day
    rotateToDrive: true
    timestamp: false
  wc_checkout:
    rotateEvery: 1 day
    rotateToDrive: true
    timestamp: false
