Interface: ActivityWindow
Defined in: packages/sdk/src/types/generated/activity_feed.ts:832
A half-open time window, [occurredFrom, occurredBefore).
Half-open so adjacent windows tile without double-counting — the property that makes a month's total equal the sum of its days.
Both bounds are timezone-aware, and basis says what that means.
At an aggregate grain the bounds are compared to
activity_rollup_hourly.bucket_hour, which is workspace-local naive
time. Under either basis the comparison is against the wall clock as
written: an ABSOLUTE bound's own offset chooses the label — a client
asking for "this clinic's March" sends the clinic's local midnight and gets
the clinic's March — and a WORKSPACE_LOCAL bound is the label. Across
workspaces in different zones an ABSOLUTE aggregate window therefore
mixes local clocks at the edges: the design's accepted approximation for
fleet overlays.
At the event grain the bounds are compared to
activity_events.occurred_at, which is UTC truth, and the two bases stop
agreeing. ABSOLUTE compares the instant directly. WORKSPACE_LOCAL
cannot — a local label is a different instant in every zone — so the server
converts the span per workspace (lib.activity.buckets) and the leaf
query carries one arm per distinct clock. That is what keeps a drill exact
across a group key naming many workspaces, where no single UTC window
exists at all.
Properties
basis?
optionalbasis:ActivityWindowBasis
Defined in: packages/sdk/src/types/generated/activity_feed.ts:835
occurredBefore
occurredBefore:
string
Defined in: packages/sdk/src/types/generated/activity_feed.ts:834
occurredFrom
occurredFrom:
string
Defined in: packages/sdk/src/types/generated/activity_feed.ts:833