VIP Subscription Overview
Core Relationships Diagram
User
The account holder who owns the VIP subscription.
VipPackage
The specific subscription plan (defined by price, duration, features) that the user is subscribed to.
Order
The transaction record through which the VIP subscription was initially purchased or renewed.
VipSubscription
The central model representing a user's active or inactive VIP status. It links the User, VipPackage, and initiating Order. It holds the core details like start/end dates, duration, status (ongoing, expired, etc.), type (free trial, renewal), and IAP identifiers. It also connects to related history, callback logs, and notification templates.
VipSubscriptionHistory
An audit trail recording significant events (like renewals or expirations) in the lifecycle of a specific VipSubscription instance.
CallbackLog
Logs containing raw data received from external payment providers (e.g., App Store, Google Play) via callbacks, often related to subscription status changes or renewals. Linked via vip_subscription_id.
NotificationTemplate
Defines reusable templates for notifications. Can be linked polymorphically (typeable) to a VipSubscription to trigger specific notifications based on subscription events (e.g., renewal reminders, expiration notices).