Collection: stores
Menyimpan data toko digital — features yang aktif, paket subscription, dan expiry.
Struktur Dokumen
{
"_id": "uuid-string",
"name": "Toko ABC",
"username": "tokoabc",
"email": "owner@tokoabc.com",
"phone": "+6281234567890",
"plan": "Premium",
"addon_plan": ["CRM"],
"features": ["product", "order", "wallet", "broadcast", "crm"],
"status": "active",
"expired_at": "2026-07-25 14:30",
"invoice_id": "uuid-string",
"registration_source": {
"type": "partner",
"partner_id": "uuid-string"
},
"created_at": "2026-01-01T00:00:00.000000Z",
"updated_at": "2026-06-25T14:30:00.000000Z"
}Field
| Field | Type | Deskripsi |
|---|---|---|
_id | string (UUID) | Primary key |
name | string | Nama toko |
username | string | Username unik |
email | string | Email owner |
phone | string | Nomor telepon |
plan | string | Nama paket subscription |
addon_plan | array | Daftar addon aktif |
features | array | Fitur yang bisa diakses |
status | string | Status: active, inactive, suspended |
expired_at | string | Waktu expiry ('Y-m-d H:i' format) |
invoice_id | string | Invoice terakhir |
registration_source | object | Sumber registrasi |
registration_source.type | string | Tipe: direct, partner, affiliate, promo, trial |
registration_source.partner_id | string | ID partner/covendor |
Features
Fitur yang tersedia (dari Package.features + Addon.features):
| Feature | Deskripsi |
|---|---|
product | Manajemen produk |
order | Manajemen order |
wallet | Wallet & withdraw |
broadcast | Broadcast message |
crm | CRM addon |
live_chat | Live chat |
ai_agent | AI agent |
team_chat | Team chat |
shipping | Shipping integration |
report | Laporan |
Relasi
| Relasi | Type | Ke |
|---|---|---|
user_store | hasOne | user_stores via store_id |
subscriptions | hasMany | subscription_invoices via store_id |
latestSubscription | hasOne | subscription_invoices (latest) |
wallet | hasOne | wallets via store_id |
Query Umum
// Store aktif
db.stores.find({ status: "active" })
// Store expired
db.stores.find({ expired_at: { $lt: "2026-06-25 23:59" } })
// Store by plan
db.stores.find({ plan: "Premium" })
// Store dengan feature CRM
db.stores.find({ features: "crm" })