Files
martbost 325d2273de Network Weekend (Marty 2026-11-17): +3 board days per Boost bought Fri 11-27 00:00 CT to Tue 12-01 00:00 CT, ribbon, chatbot facts
weekend.js (WEEKEND_BOOST_DAYS=0 off, WEEKEND_NOW test clock); wire.js stacks SKU days + the bonus by the purchase's chain time,
so it needs no contract change (the SKU holds 7 board days; a Boost is days, not views). /api/config, quote, order show the
weekend days. netdeals.js + /assets/netweekend.js ribbon via common.js (not admin, never framed), common.js?v=3. Chatbot FACTS line
and chatcore finish hook while live. qa/weekend.test.cjs; e2e 63/63.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 07:30:55 -06:00

16 lines
1.4 KiB
JavaScript

// Network Weekend (Marty 2026-11-17, Black Friday to Cyber Monday 2026): every Boost bought from Fri 11-27 00:00 CT to Tue 12-01
// 00:00 CT (CST = UTC-6) stays on top of the reshare board 3 extra days per unit, same $5 price, same split. No contract change:
// the chain's SKU says 7 board days (VASShop setSku boardDays; the old "500 views" line in Seed.sol was replaced by days), and this
// app adds the bonus when it stacks board time (wire.js), by the purchase's own chain time, so it switches on and off by itself.
// WEEKEND_BOOST_DAYS extra days per unit (default 3, 0 = off, max 30)
// WEEKEND_NOW test clock (ISO), tests only: never set it on the server
'use strict';
const START = Date.parse('2026-11-27T06:00:00Z');
const END = Date.parse('2026-12-01T06:00:00Z');
function nowMs() { const o = process.env.WEEKEND_NOW; const t = o ? Date.parse(o) : NaN; return Number.isNaN(t) ? Date.now() : t; }
function extra() { const r = process.env.WEEKEND_BOOST_DAYS; const v = Number(r === undefined || r === '' ? 3 : r); return Number.isInteger(v) && v >= 0 && v <= 30 ? v : 0; }
function live(ms) { ms = ms === undefined ? nowMs() : ms; return extra() > 0 && ms >= START && ms < END; }
// extra board days per unit for a Boost bought at `ms` (default: now)
function bonusDays(ms) { return live(ms) ? extra() : 0; }
module.exports = { START, END, nowMs, live, bonusDays, extra };