MRA-09 — Reseller app — invitation attribution
App links for /i/{code}, Play install-referrer read on first open, code prefill at sign-up, catalog-viewed signal.
| Field | Details |
|---|---|
| Task code | MRA-09 |
| Phase | P1 — V1 build & integration |
| Product scope | V1 |
| Status | Planned |
| Start | Sun 22 Nov 2026 |
| Due | Mon 23 Nov 2026 |
| Responsible | Imad — Mobile developer (Flutter) |
| Co-responsible | — |
| Effort | 0.75 person-day(s) planned · 3 from scratch · size S |
| Area · app | Reseller app · mobile |
| Depends on | MOB-06 |
| Unblocks | DQA-02 |
| Milestones | — |
Summary
App links for /i/{code}, Play install-referrer read on first open, code prefill at sign-up, catalog-viewed signal.
Description
Delegates are judged on the resellers they convert, so a sign-up started from a delegate's invitation link or QR must be attributed to that delegate even when the app is installed from the Play Store in between (IVT-03, IVT-04). Scope: Android App Links for https://app.hoco.dz/i/{code}, reading the Play Install Referrer on first open, reporting first open through invitations.attribute (public, idempotent, device-scoped), resolving the code with invitations.resolve to prefill RA-03 with « Invité par … », and the catalog-viewed signal that advances the delegate's activation steps. It needs from Anis the /.well-known/assetlinks.json on app.hoco.dz with each flavor's signing fingerprints, the /i/{code} landing page that redirects to the store with the referrer, SRV-22 attribution rules and the catalog-viewed event shape. MDA-08 shows the steps this task triggers.
Subtasks
| # | Subtask | Owner |
|---|---|---|
| 1 | Android intent-filter with autoVerify for https://app.hoco.dz/i/* (and the staging host for the staging flavor); route /i/:code in the MOB-05 registry | Imad |
| 2 | InstallReferrerService (Play Install Referrer API) read once on first launch; parse invite_code from the referrer string; result persisted so it is never re-read | Imad |
| 3 | AttributionService: POST /public/invitations/attribution with deviceId, code, referrer and app version, Idempotency-Key fixed per install; retried until acknowledged | Imad |
| 4 | Code resolution with GET /public/invitations/{code}: inviter first name and store name shown on RA-02/RA-03; invalid or expired code → « Ce lien d'invitation n'est plus valide » and normal sign-up | Imad |
| 5 | PendingInvitation store: code kept until sign-up and sent as invitationCode in auth.signup.reseller; manual entry AB12-CD34 still possible | Imad |
| 6 | Catalog-viewed signal after the first authenticated catalog view (event shape agreed with Anis), sent once | Imad |
| 7 | Already signed-in user opening an invitation link: link ignored with « Vous avez déjà un compte » | Imad |
| 8 | Publish assetlinks.json and the /i/{code} landing page with the Play Store referrer redirect | Anis |
Deliverables
- apps/reseller/lib/src/features/invitation/ (referrer, attribution, pending invitation)
- apps/reseller/android/app/src/main/AndroidManifest.xml app-link intent filters per flavor
- SHA-256 signing fingerprints of each flavor handed to Anis for assetlinks.json
Acceptance criteria
- With the app installed, tapping https://app.hoco.dz/i/AB12CD34 opens the app on sign-up with the code prefilled and « Invité par Karim » shown (IVT-04)
- Without the app, the same link leads to the Play Store; after install, the first open reads the referrer and the sign-up is attributed to the inviting delegate
- The delegate's activation steps advance to « Application téléchargée », « Compte créé », « Téléphone vérifié » and « Catalogue consulté » as the reseller progresses (IVT-03)
- Reopening the app or reinstalling on the same device does not send duplicate attributions
- An expired code never blocks sign-up
Requirements covered
| Requirement | Title | Release |
|---|---|---|
| IVT-03 | Activation steps updated automatically: app installed, account created, phone verified, catalog viewed, first order | V1 |
| IVT-04 | The link opens the right app or store and attributes the sign-up to the inviting delegate | V1 |
Screens
| Screen | Name | App |
|---|---|---|
| RA-02 | Welcome (sign in, sign up, browse as guest) | RA |
| RA-03 | Sign-up — phone & invitation code | RA |
API surface
| Endpoint group | Operations |
|---|---|
| Invitations & attribution (public + reseller) | 3 |
Test measures
- Unit tests of the referrer parser and of the attribution retry/once logic
- Device test with Play internal testing: link → store → install → first open → attribution visible in the back-office
- adb am start tests of the app link on the installed app for each flavor
Risks
- Install referrer only works for Play Store installs — keep manual code entry and the prefilled code from the resolved link as fallbacks
- App Link verification fails if fingerprints change (Play App Signing) — use the Play signing certificate fingerprint and re-verify after MOB-14
KPI
- Delivered by Mon 23 Nov 2026 within 0.75 person-day(s).
- Every acceptance criterion above demonstrated before hand-off; linked requirements' acceptance criteria pass.
- Zero open critical defects, permission gaps or data-integrity regressions at sign-off.
Generated from content/plan/tasks.json by scripts/generate-team-tasks.mjs. Dates are computed by the scheduler (Sunday–Thursday weeks, holidays excluded) — change the plan, not this page.
MRA-08 — Reseller app — notifications & support
Notification inbox with deep links and badge, announcements, tickets and after-sales claims (order items, issue, photos), conversation, and the regional WhatsApp support button.
MRA-10 — Reseller app — returns & live order updates
Return request from a delivered order (lines, quantities, reason, photos) and its tracking; the SSE client that keeps order screens live while the app is open.