Legenda step
| Step | Chiamata / evento | Quando |
|---|---|---|
| #69 | uid_resolve (body | cookie __utp JWT sub | Bearer) | QNTerm / QNTermUpgrade |
| #70 | subscription/list | Già cliente (type=upgrade + uid) |
| #71 | term/change/can (una per ogni change_option) | Già cliente — sub attive con option |
| #73 | term/get (dettaglio completo per ogni term eleggibile) | Già cliente — dopo can ok |
| #72 | esito upgrade (type=upgrade oppure type="") | Già cliente — fine |
| #1 | subscription/list | Prospect Utente loggato |
| #3/#4 | skip / term/change/can su change_options | Prospect Utente loggato — sub active |
| #5 | riepilogo decision | Prospect Utente loggato — dopo i can |
| #6 | offer/term/list (+ publisher/user/access/list per filtro rid) | Prospect Guest; Prospect loggato active NO → offer; can ko → offer senza rid attivi (sub + access) |
Se uid non è nel body, si legge il cookie __utp (alias _utp) e si usa il claim JWT sub. In risposta: uid_source = body | cookie_utp | bearer | none.
A) Già cliente — type=upgrade + uid
Nessun offer/term/list. Candidati = change_options. Dopo term/change/can ok: #73 publisher/term/get sul term di destinazione (to_term_id), non sul term corrente.
{ "id": "QN", "type": "upgrade", "uid": "PNIlMQ3nqtmne2o" }
Casistiche
| # | Situazione | Chiamate | Risposta |
|---|---|---|---|
| A1 | Nessuna sub active |
#70 → #72 | type: "", terms: [], reason no_active_subscription |
| A2 | Sub active ma senza change_options |
#70 → skip #71 → #72 | type: "", reason no_change_options |
| A3 | change_options presenti, tutti i can false/errore |
#70 → N× #71 → #72 | type: "", reason upgrade_not_eligible |
| A4 | Almeno un can ok |
#70 → N× #71 → N× #73 → #72 | type: "upgrade", terms[] da term/get (+ subscription_id) |
B) Prospect Utente Guest — senza uid
Solo offer/term/list da config (id × type).
| # | Input | Chiamate | Risposta |
|---|---|---|---|
| B1 | {} o type=offer | term/list offer | type=offer + terms |
| B2 | type=upgrade senza uid | term/list upgrade | type=upgrade + terms |
C) Prospect Utente loggato — uid senza type=upgrade
Auto offer/upgrade. Active SI: can su change_options. Se can ko → #6 offer/term/list con offer_terms.ids.*.offer_active (fallback offer), risposta type=offer. Su ogni type=offer + #6 si escludono i term con resource.rid già attiva da subscription/list e da publisher/user/access/list (granted e non scaduti), e quelli delle testate di quelle risorse (decision.owned_testate, da config.resources): il Local di una testata ha una risorsa diversa dal Full o dall’abbonamento in app della stessa testata.
| # | Situazione | Chiamate | Risposta |
|---|---|---|---|
| C1 | Nessuna sub active | #1 → #6 + access/list | type=offer + terms offerta (esclusi rid attivi in access/list) |
| C2 | Active + almeno un can ok | #1 → #3/#4 → #5 | type=upgrade + terms filtrati (da change_options) |
| C3 | Active ma can ko | #1 → #3/#4 → #5 → #6 + access/list | type=offer + terms da offer_active, esclusi rid attivi da sub e access/list |
Come leggere i log Chrome / debug[]
OTPLOGIN … STEP #70 subscription_list
OTPLOGIN … STEP #71 term_change_can { subscription_id, to_term_id, allowed }
OTPLOGIN … STEP #72 upgrade_result { type: "upgrade"|"" }
Flusso A (Già cliente): con type=upgrade + uid non devono comparire step offer_term_list.