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
Integration Context¶
Data Store¶
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_tierontier(N1QL GSI)idx_member_pointsonpoints_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_guestonguest_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_guestonguest_id(N1QL GSI)
Endpoints (5 total)¶
GET /members/{guest_id}/balance -- Get loyalty member balance and tier info¶
POST /members/{guest_id}/earn -- Award points to a member¶
POST /members/{guest_id}/redeem -- Redeem points for a reward¶
GET /members/{guest_id}/transactions -- List point transactions for a member¶
GET /tiers -- List all loyalty tiers and their thresholds¶
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 |