Share template keys across email and push with independent editors and revisions. Render localized actions and preserve version-one delivery. Ref: IT-1627
3.0 KiB
Supported incoming message types
Current push version selection (owner decision 2026-10-31): the AMQP type remains Notification.SendPush.v1. Its data.version defaults to 1 when omitted. Version 1 retains title/body, optional route defaulting to /home, and the original identity, token and expiry validation; no template fields are required. Explicit version 2 requires templateKey/languageCode/templateData and renders buttons. Unknown versions are rejected with an unsupported-version error. Version 1 emits version=1/route=/home to FCM; version 2 emits version=2/actions. The historical no-legacy note below is superseded by this decision. See channel-template-model.md for the current contract.
The Worker uses SupportedMessageType for its two incoming commands:
| AMQP MessageType (unchanged) | Public enum | Consumer queue |
|---|---|---|
Notification.SendEmail.v1 |
SendEmailV1 |
notification.send-email |
Notification.SendPush.v1 |
SendPushV1 |
notification.send-push |
SupportedMessageTypeParser maps the transport string at the validation boundary.
Matching is exact and case-sensitive. Unknown versions, missing values, whitespace
variants, enum names and numeric strings return no enum value and are rejected.
Each consumer's delivery validator accepts only its own enum member; a supported
command sent to the other consumer is also rejected before delivery.
The public enum lives in HrynCo.NotificationService.Contracts/Messages/SupportedMessageType.cs,
in namespace HrynCo.NotificationService.Contracts.Messages, and is included in the existing
HrynCo.NotificationService.Contracts package. The Worker parser remains internal and all
consumers, validators and tests reference this single Contracts enum. It does not change RabbitMQ headers, serialized
payloads, queues, producers or the shared RabbitMQ library. Result messages are not
incoming delivery commands and are outside this enum's scope. Existing payload and
correlation validation remains unchanged.
The Push Channels change removes the draft Firebase project/access-token fields from SendPushMessageData. The enum and AMQP header stay unchanged; see push channels for producer compatibility and rollout order.
New templated push payload (IT-1627, owner decision 2026-10-31)
The push command now supplies templateKey, languageCode and templateData with bindings and action metadata, replacing ready-made title/body/route. No legacy payload acceptance branch is provided. Action keys are consumer-owned, with only objectId in their metadata; labels are localized in the template. See channel templates for the exact shape, validation and client integration still required.
Version-selection regression coverage: omitted/explicit version 1 legacy input and its original FCM fields, explicit version 2 section buttons, unknown-version errors, and both channel test modes passed. See channel-template-model.md for runtime and review evidence and the remaining installed-client validation gap.