HOCO B2B
Team tasksAnis

SRV-24 — Support module — tickets & announcements

Tickets with types, related order and items, messages and internal notes, assignment and statuses; announcements with targeting; support contacts/FAQ; support regions with WhatsApp numbers resolved from the declared region or device location.

FieldDetails
Task codeSRV-24
PhaseP1 — V1 build & integration
Product scopeV1
StatusDone (Mon 19 Oct 2026)
StartMon 19 Oct 2026
DueMon 19 Oct 2026
ResponsibleAnis — Full-stack developer
Co-responsible—
Effort0.75 person-day(s) planned · 3 from scratch · size S
Area · appServer · server
Depends onSRV-08
UnblocksSRV-20, DSH-10, MOB-12, SRV-40
Milestones—

Summary

Tickets with types, related order and items, messages and internal notes, assignment and statuses; announcements with targeting; support contacts/FAQ; support regions with WhatsApp numbers resolved from the declared region or device location.

Description

Support replaces informal WhatsApp exchanges with traceable tickets while keeping WhatsApp as the human channel (cahier §2.1, §5, §6.1; SUP-01…SUP-03, SUP-05, NOT-07, ADM-08). This task implements tickets (TKT-YYYY-NNNNNN) with TicketType (including AFTER_SALES claims carrying TicketItem order lines, quantities, AfterSalesIssue and photos), the TicketStatus lifecycle, messages with attachments and staff-only internal notes, assignment and the support.autoClose job; announcements with targeting and read tracking; support contacts and FAQ; and the regional WhatsApp support of decision 8: SupportRegion (WhatsApp number, hours, default flag) grouping wilayas through SupportRegionWilaya, admin.supportRegions.crud, and support.whatsapp (auth: optional) that resolves the region from the signed-in user's declared wilaya, otherwise from device coordinates (nearest commune → wilaya → region), otherwise from a chosen wilaya or the default region. Out of scope: after-sales resolution (SRV-20) and support pages (DSH-10).

Subtasks

#SubtaskOwner
1Ticket model service: tickets.create (type, related order, items for AFTER_SALES, issue, attachments), list, get, reply, close; TKT numberingAnis
2AFTER_SALES validation: order belongs to the reseller, items and quantities within the order, at least one photo when the issue is DEFECTIVE or DAMAGEDAnis
3Back-office handling admin.tickets.list/get/reply/update: assignment, internal notes, status transitions, notificationsAnis
4Job support.autoClose after support.autoCloseDays (default 7) with reminder at half the delayAnis
5Announcements: admin.announcements.crud/send with audience (delegates, resellers, zone, wilaya, segment, customer type) and schedule; announcements.list/markReadAnis
6support.contacts and FAQ content (editable reference content)Anis
7SupportRegion and SupportRegionWilaya services with admin.supportRegions.crud (each wilaya in exactly one region, one default region)Anis
8support.whatsapp resolver: declared wilaya → device lat/lng (nearest commune) → wilayaCode param → default; returns number, wa.me link with prefilled message, hours and isOpenNowAnis
9Ticket and announcement events to the reseller and back-office streams and notificationsAnis

Deliverables

  • apps/server/src/modules/support/{tickets,announcements,contacts,regions,whatsapp}.{service,router}.ts and jobs.ts
  • packages/contracts/src/{support.ts,admin/support.ts}
  • Default support region seed and FAQ seed content

Acceptance criteria

  • An AFTER_SALES ticket on another reseller's order returns 404 NOT_FOUND; quantities above the ordered quantity return 422 VALIDATION_FAILED (SUP-04)
  • Internal notes are never returned by reseller endpoints (SUP-02)
  • A signed-in reseller whose declared wilaya is in region West receives the West WhatsApp number regardless of device location (SUP-05)
  • A guest sending coordinates in Constantine gets the East region number; without coordinates or wilaya the default number is returned (SUP-05)
  • Saving a region map that leaves a wilaya unassigned or assigns it twice returns 422 VALIDATION_FAILED (ADM-08)
  • An announcement targeted to delegates of one zone appears only in their announcements.list (NOT-07)

Requirements covered

RequirementTitleRelease
SUP-01Reseller tickets: type, related order, message, attachments, conversation, statusesV1
SUP-02Back-office ticket handling: assignment, internal notes, replies, statuses, notificationsV1
SUP-03Support contacts and FAQV1
NOT-07Announcements from the back-office to delegates or resellers by target ('Messages')V1
SUP-05Regional WhatsApp support: a fixed WhatsApp button in both reseller apps opens the support number of the user's region — declared region when signed in, device location otherwiseV1
ADM-08Support regions: wilayas grouped into regions, each with its WhatsApp support number and hoursV1

Screens

ScreenNameApp
BO-55Tickets listBO
BO-56Ticket detailBO
BO-57AnnouncementsBO

API surface

Test measures

  • Unit tests for the WhatsApp resolution order with fixtures per case
  • DB tests for ticket lifecycle and auto-close with a fake clock
  • Contract test that reseller ticket schemas have no internal-note fields

Risks

  • Regional numbers change often — regions editable in BO-70 and support.whatsapp responses cached for at most 5 minutes

KPI

  • Delivered by Mon 19 Oct 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.

On this page