Skip to content

svc-loyalty-rewards

NovaTrek Loyalty Rewards Service  |  Support  |  v1.0.0  |  NovaTrek Platform Team

Manages the NovaTrek Adventures loyalty program including points accrual,

Swagger UI Download OpenAPI Spec Live Service (Dev) Azure Portal CI/CD Pipeline Source Code Technology Stack

Delivery Status

Delivery Wave: 5 -- Analytics, Loyalty, and Media

Stage Status
Infrastructure (Bicep) ✅ complete
Database Schema (Flyway) ✅ complete
Deployed to Dev ✅ complete
Smoke Tested ✅ complete
Deployed to Prod not-started
Pipeline Status
CI Pipeline ✅ complete
CD Pipeline ✅ complete

Azure Resources (Dev):


Integration Context

svc-loyalty-rewards C4 context diagram

Generated from architecture/specs/svc-loyalty-rewards.yaml + cross-service-calls.yaml

Data Store

Entity Relationship Diagram

svc-loyalty-rewards entity relationship diagram

Generated from architecture/metadata/data-stores.yaml

Overview

Property Detail
Engine Couchbase 7
Schema loyalty
Tables members, point_transactions, tiers, redemptions
Estimated Volume ~1,000 transactions/day
Connection Pool min 5 / max 15 / idle timeout 30s
Backup Strategy XDCR to standby cluster, daily cbbackupmgr

Key Features

  • Document-oriented member profiles with flexible reward schemas
  • N1QL queries for tier recalculation and point aggregation
  • Sub-document operations for atomic point balance updates

Table Reference

members

Loyalty member documents with point balances and tier status

Column Type Constraints
document_key String members::{guest_id}
guest_id String NOT NULL
tier String NOT NULL (bronze/silver/gold/platinum)
points_balance Number NOT NULL
lifetime_points Number NOT NULL
tier_qualified_at ISO8601 String NOT NULL
enrolled_at ISO8601 String NOT NULL

Indexes:

  • idx_member_tier on tier (N1QL GSI)
  • idx_member_points on points_balance DESC (N1QL GSI)

point_transactions

Point earn and redeem transaction ledger

Column Type Constraints
document_key String txn::{transaction_id}
transaction_id String NOT NULL
guest_id String NOT NULL
type String NOT NULL (earn/redeem/expire/adjust)
points Number NOT NULL
description String NOT NULL
reference_id String NULL (reservation or trip ID)
created_at ISO8601 String NOT NULL

Indexes:

  • idx_txn_guest on guest_id, created_at DESC (N1QL GSI)

redemptions

Reward redemption records against point balances

Column Type Constraints
document_key String redemption::{redemption_id}
redemption_id String NOT NULL
guest_id String NOT NULL
reward_type String NOT NULL
points_spent Number NOT NULL
status String NOT NULL
redeemed_at ISO8601 String NOT NULL

Indexes:

  • idx_redeem_guest on guest_id (N1QL GSI)

Endpoints (5 total)


GET /members/{guest_id}/balance -- Get loyalty member balance and tier info

View in Swagger UI

GET /members/{guest_id}/balance sequence diagram

Generated from architecture/specs/svc-loyalty-rewards.yaml Auto-generated baseline — shows standard request flow. For detailed behavioral sequences, see the relevant solution design.


POST /members/{guest_id}/earn -- Award points to a member

View in Swagger UI

POST /members/{guest_id}/earn sequence diagram

Architect-authored — overrides auto-generated baseline Source: architecture/diagrams/endpoints/svc-loyalty-rewards--post-members-guest_id-earn.puml


POST /members/{guest_id}/redeem -- Redeem points for a reward

View in Swagger UI

POST /members/{guest_id}/redeem sequence diagram

Architect-authored — overrides auto-generated baseline Source: architecture/diagrams/endpoints/svc-loyalty-rewards--post-members-guest_id-redeem.puml


GET /members/{guest_id}/transactions -- List point transactions for a member

View in Swagger UI

GET /members/{guest_id}/transactions sequence diagram

Generated from architecture/specs/svc-loyalty-rewards.yaml Auto-generated baseline — shows standard request flow. For detailed behavioral sequences, see the relevant solution design.


GET /tiers -- List all loyalty tiers and their thresholds

View in Swagger UI

GET /tiers sequence diagram

Generated from architecture/specs/svc-loyalty-rewards.yaml Auto-generated baseline — shows standard request flow. For detailed behavioral sequences, see the relevant solution design.


Consuming Applications

Application Screens Using This Service
Guest Portal Guest Profile, Loyalty Dashboard
Adventure App Earn Loyalty Points

Events Consumed

Event Producer Channel
guest.registered svc-guest-profiles novatrek.guest-identity.guest.registered