Skip to content

Commit b4f0803

Browse files
Sync public snapshot from freebuff-private
Source: CodebuffAI/freebuff-private@755a597cd784a65c0f348844b87500f93ae31ee4
1 parent 69d0623 commit b4f0803

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

common/src/constants/freebuff-ads.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,27 @@
3232
* UP rather than down.
3333
*/
3434

35+
// ---------------------------------------------------------------------------
36+
// The day boundary
37+
// ---------------------------------------------------------------------------
38+
39+
/**
40+
* Every daily boundary in the ads system — spend caps, per-user engagement
41+
* ceilings, delivery reporting, the placements spend ledger's `day` column —
42+
* is a PACIFIC calendar day.
43+
*
44+
* Not UTC, and this is worth one line of explanation: every other daily budget
45+
* in the product already resets Pacific (session pools, spend ceilings,
46+
* `freebuff_daily_usage`), and an advertiser whose "day" ended at a different
47+
* hour than the user quota that feeds it would see delivery that appears to
48+
* arrive before it was funded.
49+
*
50+
* It lives in `common` rather than beside the console because the Stripe
51+
* webhook — in `web/`, which cannot import `freebuff/web` — has to compute the
52+
* same day the console does.
53+
*/
54+
export const AD_RESET_TIMEZONE = 'America/Los_Angeles'
55+
3556
// ---------------------------------------------------------------------------
3657
// Pricing
3758
// ---------------------------------------------------------------------------

0 commit comments

Comments
 (0)