feat(ads): server-driven ad-banner backend, wire & admin console (PR1)
CI / changes (pull_request) Successful in 2s
CI / unit (pull_request) Successful in 9s
CI / integration (pull_request) Successful in 14s
CI / ui (pull_request) Successful in 49s
CI / gate (pull_request) Successful in 0s
CI / deploy (pull_request) Successful in 1m12s
CI / changes (pull_request) Successful in 2s
CI / unit (pull_request) Successful in 9s
CI / integration (pull_request) Successful in 14s
CI / ui (pull_request) Successful in 49s
CI / gate (pull_request) Successful in 0s
CI / deploy (pull_request) Successful in 1m12s
Turn the gated-off mock banner into a real advertising subsystem (backend + admin half; the UI rotation lands in PR2). - internal/ads: campaigns (percent weight + validity window; a perpetual, undeletable default that fills the remainder up to 100%), 1..N bilingual messages (en+ru), global display timings; ActiveSet computes the window-filtered, default-remainder, GCD-reduced, language-resolved rotation feed. Smooth-weighted-round-robin math is unit-tested. - migration 00006 (+ jetgen): ad_campaigns / ad_messages / ad_settings, seeded default campaign + house message + default timings. - eligibility = !paid_account && hint_balance==0 && !no_banner role (new role; guests qualify). The resolved feed rides the profile.get response (no new RPC, works for guests, nothing distinct to filter); language by service_language. - live update: a notify `banner` sub-kind (re-poll signal) published when an operator grants hints or grants/revokes no_banner, so the client shows/hides in place. - admin console /_gm/banners (+ /_gm/banner-settings): campaign + message CRUD with reorder, default protection, clamped timings. - wire: fbs BannerInfo/BannerCampaign on Profile; gateway transcode forwards it. - docs: ARCHITECTURE §10, FUNCTIONAL (+ _ru), backend README, PRERELEASE tracker (incl. the deferred app.load aggregator note).
This commit is contained in:
+30
-2
@@ -137,12 +137,39 @@ table Ack {
|
||||
ok:bool;
|
||||
}
|
||||
|
||||
// --- advertising banner ---
|
||||
|
||||
// BannerCampaign is one campaign in the rotation feed: a GCD-reduced show weight
|
||||
// (the client runs a smooth weighted round-robin over campaigns by this weight)
|
||||
// and its messages in display order, each already resolved to the viewer's bot
|
||||
// language (the stored en/ru pair is picked server-side).
|
||||
table BannerCampaign {
|
||||
weight:int;
|
||||
messages:[string];
|
||||
}
|
||||
|
||||
// BannerInfo is the advertising-banner block of an eligible viewer's profile: the
|
||||
// campaigns to rotate and the global display timings the client rotator reads.
|
||||
// It is present (set on Profile.banner) only when the viewer is eligible to see a
|
||||
// banner; absent otherwise. The transition between messages is fade_out_ms, then
|
||||
// gap_ms, then fade_in_ms.
|
||||
table BannerInfo {
|
||||
campaigns:[BannerCampaign];
|
||||
hold_ms:int;
|
||||
edge_pause_ms:int;
|
||||
scroll_px_per_sec:int;
|
||||
fade_out_ms:int;
|
||||
gap_ms:int;
|
||||
fade_in_ms:int;
|
||||
}
|
||||
|
||||
// --- profile (authenticated) ---
|
||||
|
||||
// Profile is the authenticated account's own profile view. away_start/away_end are
|
||||
// the "HH:MM" daily away-window bounds. notifications_in_app_only (default true)
|
||||
// suppresses out-of-app platform push, leaving only the in-app live stream (both
|
||||
// added trailing — backward-compatible).
|
||||
// suppresses out-of-app platform push, leaving only the in-app live stream. banner
|
||||
// carries the advertising-banner block for an eligible viewer, absent otherwise
|
||||
// (all added trailing — backward-compatible).
|
||||
table Profile {
|
||||
user_id:string;
|
||||
display_name:string;
|
||||
@@ -155,6 +182,7 @@ table Profile {
|
||||
away_start:string;
|
||||
away_end:string;
|
||||
notifications_in_app_only:bool = true;
|
||||
banner:BannerInfo;
|
||||
}
|
||||
|
||||
// BlockStatus reports the caller's current manual block. The UI fetches it after any operation
|
||||
|
||||
Reference in New Issue
Block a user