Overview
Deltalytix supports three types of subscriptions:- Subscription - Individual user subscriptions
- BusinessSubscription - Subscriptions for business accounts
- TeamSubscription - Subscriptions for team accounts
Subscription Model
Individual user subscription with trial support and billing management.Schema Fields
Unique identifier for the subscription
- Constraint: Primary key, unique
- Default: Auto-generated UUID
Email address associated with the subscription
- Constraint: Unique
- Indexed: Yes (performance optimization)
- Used for billing notifications
Subscription plan identifier
- Examples: “PRO”, “PREMIUM”, “BASIC”
Timestamp when the subscription was created
- Default: Current timestamp
ID of the user who owns this subscription
- Constraint: Unique (one subscription per user)
- Foreign Key: References
User.idwith cascade delete
Subscription end date
nullfor active subscriptions without end date- Set when subscription is cancelled or expires
Current subscription status
- Default: “ACTIVE”
- Common values: “ACTIVE”, “CANCELLED”, “EXPIRED”, “PAST_DUE”
Trial period end date
nullif no trial or trial has ended- Used to determine when billing starts
Billing interval
- Common values: “MONTHLY”, “YEARLY”
Indexes
email- Fast lookup by email for billing operations
Relationships
The user who owns this subscription
- Foreign Key:
userId→User.id - Delete Behavior: Cascade (subscription deleted when user is deleted)
Unique Constraints
emailmust be unique across all individual subscriptionsuserIdmust be unique (one subscription per user)
BusinessSubscription Model
Subscription for business accounts with multi-user access.Schema Fields
Unique identifier for the business subscription
- Constraint: Primary key, unique
- Default: Auto-generated UUID
Email address for billing notifications
- Constraint: Unique
- Indexed: Yes
Business subscription plan
- Examples: “BUSINESS_PRO”, “BUSINESS_PREMIUM”
Timestamp when the subscription was created
- Default: Current timestamp
ID of the user who owns this subscription
- Constraint: Unique (one business subscription per user)
- Foreign Key: References
User.idwith cascade delete - Indexed: Yes
ID of the business this subscription is for
- Constraint: Unique (one subscription per business)
- Foreign Key: References
Business.idwith cascade delete - Indexed: Yes
Subscription end date
nullfor active subscriptions
Current subscription status
- Default: “ACTIVE”
- Common values: “ACTIVE”, “CANCELLED”, “EXPIRED”, “PAST_DUE”
Trial period end date
nullif no trial or trial has ended
Billing interval
- Common values: “MONTHLY”, “YEARLY”
Indexes
email- Fast lookup by emailuserId- Filter subscriptions by userbusinessId- Query subscriptions by business
Relationships
The user who owns this subscription
- Foreign Key:
userId→User.id - Delete Behavior: Cascade
The business this subscription is for
- Foreign Key:
businessId→Business.id - Delete Behavior: Cascade
Unique Constraints
emailmust be unique across all business subscriptionsuserIdmust be uniquebusinessIdmust be unique
TeamSubscription Model
Subscription for team accounts enabling collaborative features.Schema Fields
Unique identifier for the team subscription
- Constraint: Primary key, unique
- Default: Auto-generated UUID
Email address for billing notifications
- Constraint: Unique
- Indexed: Yes
Team subscription plan
- Examples: “TEAM_PRO”, “TEAM_PREMIUM”
Timestamp when the subscription was created
- Default: Current timestamp
ID of the user who owns this subscription
- Constraint: Unique (one team subscription per user)
- Foreign Key: References
User.idwith cascade delete - Indexed: Yes
ID of the team this subscription is for
- Constraint: Unique (one subscription per team)
- Foreign Key: References
Team.idwith cascade delete - Indexed: Yes
Subscription end date
nullfor active subscriptions
Current subscription status
- Default: “ACTIVE”
- Common values: “ACTIVE”, “CANCELLED”, “EXPIRED”, “PAST_DUE”
Trial period end date
nullif no trial or trial has ended
Billing interval
- Common values: “MONTHLY”, “YEARLY”
Indexes
email- Fast lookup by emailuserId- Filter subscriptions by userteamId- Query subscriptions by team
Relationships
The user who owns this subscription
- Foreign Key:
userId→User.id - Delete Behavior: Cascade
The team this subscription is for
- Foreign Key:
teamId→Team.id - Delete Behavior: Cascade
Unique Constraints
emailmust be unique across all team subscriptionsuserIdmust be uniqueteamIdmust be unique
SubscriptionFeedback Model
Captures user feedback during subscription lifecycle events (cancellations, renewals).Schema Fields
Unique identifier for the feedback
- Constraint: Primary key
- Default: Auto-generated UUID
Email of the user providing feedback
- Indexed: Yes
Subscription event that triggered feedback
- Examples: “CANCELLATION”, “DOWNGRADE”, “PAUSE”
Timestamp when the feedback was submitted
- Default: Current timestamp
Reason for cancellation (if applicable)
- Optional structured reason code
Additional feedback text from the user
- Optional free-form feedback
Indexes
email- Group feedback by user email
Related Models
Team Model
Teams enable collaborative trading analysis and management.Unique team identifier (UUID)
Team name (unique per user)
Team owner’s user ID
Array of trader IDs in the team (default: empty array)
Team creation timestamp
Last update timestamp (auto-updated)
Business Model
Businesses enable multi-trader management and analytics.Unique business identifier (UUID)
Business name (unique per user)
Business owner’s user ID
Array of trader IDs in the business (default: empty array)
Business creation timestamp
Last update timestamp (auto-updated)