Collections

Business Day and Reporting

Business day lifecycle and daily summaries collections.

Business days collection

Path

tenants/{tenantId}/locations/{locationId}/businessDays/{dateKey}

Operations

  • openBusinessDay(dateKey, locationId?)
  • closeBusinessDay(dateKey, { closedByUid?, locationId? })

Recommended dateKey format: YYYY-MM-DD (for example 2026-02-24).

await client.openBusinessDay("2026-02-24")

await client.closeBusinessDay("2026-02-24", {
  closedByUid: "uid_manager_1",
})

Daily summaries collection

Path

tenants/{tenantId}/locations/{locationId}/dailySummaries/{dateKey}

Operation

  • setDailySummary(dateKey, summary, { locationId?, merge? })

By default this uses merge semantics (merge: true), so incremental metrics can be updated without replacing the entire document.

Set merge: false when you want a full overwrite.

await client.setDailySummary("2026-02-24", {
  ordersCount: 12,
  revenue: 210.5,
  topItems: [{ productId: "latte", qty: 4, revenue: 48 }],
  channelMix: { in_store: 9, delivery: 3 },
  avgTicket: 17.54,
})

await client.setDailySummary(
  "2026-02-24",
  {
    ordersCount: 13,
    revenue: 226.0,
    topItems: [{ productId: "latte", qty: 5, revenue: 60 }],
    channelMix: { in_store: 10, delivery: 3 },
  },
  { merge: false },
)

Example

await client.openBusinessDay("2026-02-24")

await client.setDailySummary("2026-02-24", {
  ordersCount: 12,
  revenue: 210.5,
  topItems: [{ productId: "latte", qty: 4, revenue: 48 }],
  channelMix: { in_store: 9, delivery: 3 },
})

await client.closeBusinessDay("2026-02-24")
Copyright © 2026