Events

Event contracts for the User Service: what it publishes, what it consumes, and the vendor notifications it sends. Flow behaviour lives on the domain pages linked from each row.

Topology

event architecture

Published: {env}-user-service-users (Kinesis)

The kinesis-feeder reads the DynamoDB stream of the users table and forwards two entity types; every other db_type is skipped. Errors are logged and the batch is never failed. Partition key: user_id.

Field Value

service

USER

version

v1

type

The record’s event_type attribute

id

user_id

payload

USER: the API User model (pkg/api/models.gen.go); MEMBERSHIP: the repository Membership JSON (pkg/repository/memberships.go)

db_type type values Written by

USER

USER_CREATED, USER_ACTIVE, USER_UPDATED

User writes when USE_LEGACY_ONLY is false — with the flag on (both environments) no USER events are produced; see DynamoDB Tables

MEMBERSHIP

Membership event types

Every membership write

Source: pkg/feeder/feeder.go, pkg/events/events.go

Consumed

Event Source Transport Handled by

CHARGED_BACK payment (FLOAT_DEBIT_CHARGED_BACK, SUBSCRIPTION_CHARGED_BACK)

Payments Service

Kinesis {env}-payments

payment-worker — Chargeback ban

pause-skipped, pause-resume (payment-failed passes the filter and is ignored)

Subscription Service

Kinesis {env}-subscriptions

subscriptions Lambda — Subscription worker

cancel-successful, account-closed

Subscription Service

Kinesis {env}-subscriptions

subscriptions Lambda — settlement participant cancellation

Users table change records

DynamoDB Streams (NEW_AND_OLD_IMAGES)

{env}-user-service-users table stream

kinesis-feeder — Published: {env}-user-service-users (Kinesis)

Cleanup message

This service (API)

SQS {env}-user-service-cleanup

cleanup Lambda — Janitor message

Typeform webhook payload

webhook-handler (Typeform)

SQS {env}-typeform-events

typeform Lambda — Typeform cancellation

user_floatmetrics_event (detail-type)

EventBridge default bus

Rule → SQS {env}-floatmetrics-queue

floatmetrics Lambda — floatmetrics

App metric (user_id or install_id, event_name, app_version, app_build_number, time_of_event, metric_properties)

Mobile app via {env}-floatmetrics-api

Gateway → SQS {env}-floatmetrics-queue

floatmetrics Lambda — floatmetrics

The API Lambda holds an EventBridge client (user-service.api) but publishes nothing through it.

Vendor Events

Event Vendor Payload Sent from

cancellation_finished

Segment

email

Account closure

cancellation_outstanding_float

Segment

email, amount, fees, repayment_date, total_due

Typeform cancellation

membership_paused

Segment

email, pause_duration, unpause_date

Pause

membership_paused_plaid

Segment

email, pause_duration, unpause_date

Admin pause

membership_manual_unpaused

Segment

email, unpause_date

Unpause

membership_unpaused

Segment

email, unpause_date

Subscription worker

user-reactivation-receipt

Segment

Receipt fields

Collect-on-reactivation

consent_agreement_signed, mvp_beta_agreement_signed

Segment

The agreement row

Consent

first_debit_card_connected (_test in test)

Segment, AppsFlyer

appsflyer_id, app_platform, firebase_install_id

First debit card event

user_personal_info_updated

Iterable

changed_field (name, phone number, email, address)

Profile updates

the request’s `notification_event`

Iterable

event_type, user_id, cohort, cell, and for a cell with an offer offer_length and expires_at (MM/DD/YYYY, the last Eastern day the offer can be redeemed)

GrantWaiverOffer: one event name per reactivation offer test cell, chosen by the caller; none for a cell without an email (OFFER_COHORT tag)

subscription-prorated-digital-receipt

Iterable

mask, confirmation_id, proration_amount, upgrade_tier, next_subscription_amount, next_subscription_date

Upgrade

Source: pkg/notification/notifier.go, pkg/api/, pkg/subscriptions/handler.go, pkg/webhooks/typeform.go