Subscriptions¶
subscription_plans¶
Table: public.subscription_plans
| Column | Type | Default | Description |
|---|---|---|---|
id |
uuid |
PK | UUID |
name |
text |
NOT NULL | Plan name |
description |
text |
nullable | |
price |
numeric |
NOT NULL | Monthly fee |
duration_days |
int |
30 |
Billing period |
max_products |
int |
0 |
Product limit (0 = unlimited) |
max_featured_products |
int |
0 |
Featured slots |
has_delivery |
boolean |
false |
Delivery feature |
has_analytics |
boolean |
false |
Reports access |
has_promotions |
boolean |
false |
Offer creation |
visibility_priority |
int |
0 |
Higher = better rank |
is_active |
boolean |
true |
|
created_at |
timestamptz |
now() |
pharmacy_subscriptions¶
Table: public.pharmacy_subscriptions
| Column | Type | Default | Description |
|---|---|---|---|
id |
uuid |
PK | UUID |
seller_id |
uuid |
FK → sellers(id) |
Pharmacy |
plan_id |
uuid |
FK → subscription_plans(id) |
Plan |
status |
text |
'active' |
active, expired, cancelled, pending |
start_date |
timestamptz |
NOT NULL | |
end_date |
timestamptz |
NOT NULL | |
auto_renew |
boolean |
true |
|
payment_status |
text |
'pending' |
|
price_paid |
numeric |
NOT NULL | |
created_at |
timestamptz |
now() |
Indexes¶
idx_subscriptions_selleronpharmacy_subscriptions(seller_id)idx_subscriptions_statusonpharmacy_subscriptions(status)
Related¶
- Admin: Subscriptions — Plan + subscription management
- Seller: Subscriptions — Plan viewing
- Mobile: Featured Subscriptions — Mobile plan listing