Data Model
Conceptual data models for the ThreeU platform.
Developer
The Developer entity represents a registered third-party developer. Key traits:
- Authenticatable (login, tokens, sessions)
- HasApiTokens (developer API tokens for CI/CD)
- HasWallet (QAR wallet for earnings)
- Owns Plugin records through owner morph
Plugin
| Field | Type | Description |
|---|---|---|
id | integer | Unique identifier |
slug | string | URL-safe identifier |
name / name_ar | string | Display name (EN/AR) |
category | string | Plugin category |
surface_type | string | "plugin" or "page" |
trigger_mode | string | "manual" or "automatic" |
ownership | string | "official", "community", "custom" |
version | string | Current version |
config_schema | json | Merchant settings form |
manifest | json | Runtime contract |
webhook_events | json | Subscribed events |
provider_class | string | Internal provider class |
Brand Plugin Install
| Field | Type | Description |
|---|---|---|
brand_id | integer | Installing brand |
plugin_id | integer | Installed plugin |
status | string | Installation status |
config | json (encrypted) | Merchant's values |
credentials | json (encrypted) | Merchant's secrets |
enabled_actions | json | Enabled actions |
permissions | json | Approved permissions |
webhook_secret | string | Per-install secret |
AccountContract
Contracts define commercial relationships:
- Developer can be initiator or counterparty
- Partner, Brand, or ThreeU as counterparty
- Status:
proposed→accepted→active→terminated/declined
Wallet
QAR-denominated developer wallet:
- Balance tracking (available, pending, total)
- Payout requests and processing
- Transaction history
- Contract-linked revenue