HOCO B2B
Team tasksAnis

SRV-39 — Smart notifications — contract & schema (groups, actions, flash sales, complementary products)

Additive contract and Prisma changes for document 03: NotificationGroup and AnnouncementKind enums, group and action on notifications and templates, per-group preferences, Promotion.isFlashSale, ProductComplement, Product.announceAsNew/publishedAt, announcement targets, query and response fields.

FieldDetails
Task codeSRV-39
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.5 person-day(s) planned · 2 from scratch · size XS
Area · appServer · server
Depends onSRV-08, SRV-11, SRV-19
UnblocksSRV-40, MRA-11
Milestones—

Summary

Additive contract and Prisma changes for document 03: NotificationGroup and AnnouncementKind enums, group and action on notifications and templates, per-group preferences, Promotion.isFlashSale, ProductComplement, Product.announceAsNew/publishedAt, announcement targets, query and response fields.

Description

Implements the data and API impact table of /docs/srs/smart-notifications#data-api so that the mobile and web work (MRA-11, WEB-06) can start against the mock server while the triggers are built (SRV-40). Every change is additive: no operation is renamed, no field removed, no op id added to endpoints.json. Done early in the lane, right after the promotions module (SRV-19), because Imad needs the contract before his November reseller-app tasks end.

Subtasks

#SubtaskOwner
1Prisma: enums NotificationGroup and AnnouncementKind; Notification.group/actionLabel/actionRoute with index (userId, group, createdAt); NotificationTemplate.group/actionLabel; NotificationRule.priority/mergeWindowHours; NotificationPreference.groupAnis
2Prisma: Promotion.isFlashSale with the 2 h–48 h validation (FLASH_SALE_DURATION) and the exclusivity with isDailyOffer; ProductComplement (unique pair, max 5, no self-reference); Product.announceAsNew and publishedAt; Announcement.kind, group, productId, promotionId, categoryId, brandId, fileId, actionLabelAnis
3Contracts: notifications.list items group and action { label, deepLink }, ?group=; notifications.unreadCount byGroup; preferences per group (422 PREFERENCE_NOT_EDITABLE on URGENT)Anis
4Contracts: promotions.list isFlashSale and ?tab=promotions|flash; catalog.home flashSales[]; admin product payload complementProductIds[], announceAsNew; admin.announcements kind/target/actionLabel and the push / inbox-only split in the send responseAnis
5Push payload: data.actionLabel, data.group; settings keys smart.* and notifications.promotionalWeeklyCap in the settings catalogue with defaultsAnis
6Seed: group and action label for every existing reseller template (defaults of /docs/srs/smart-notifications#actions-existing); OpenAPI export and mock examplesAnis

Deliverables

  • packages/db/prisma/schema/{support,promotions,catalog,enums}.prisma + migration
  • packages/contracts/src/{notifications,promotions,catalog}.ts and admin counterparts
  • Regenerated OpenAPI document and mock server examples

Acceptance criteria

  • The migration applies on a copy of staging data without loss; existing notifications read with group null and action null
  • OpenAPI shows the new fields; the Dart client regenerates without breaking MRA-08 code
  • A flash sale of 72 h is refused with FLASH_SALE_DURATION; a ProductComplement to itself is refused

Requirements covered

RequirementTitleRelease
NOT-09Notification groups and the Notification Centre on the reseller home (Urgent, Promotions, Nouveautés, Points et niveaux, Academy, Suggestions)V1
NOT-10An action button (label and deep link) on every reseller notificationV1
NOT-15Complementary product suggestions from pairs configured on the productV1
NOT-16Commercial push: HOCO picks a product and an audienceV1
NOT-17Anti-fatigue rules: promotional push caps, priority, merge, quiet hours, opt-out per groupV1
PRM-07Flash sales (2 h to 48 h) with countdown and the promotion tabs Promotions / Flash SalesV1

API surface

Test measures

  • Contract snapshot tests of notifications.list and promotions.list
  • Migration test on the seed database

Risks

  • Late renames break Imad's generated client — freeze the field names on the day of the export and announce them

KPI

  • Delivered by Mon 19 Oct 2026 within 0.5 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