🔍 Overview
The OfferLink model stores partner offer URLs (for example, trafficback URLs) that are monitored separately from regular Links.
Offer links are checked via Google Safe Browsing and DNS, and notifications are sent via the offers Telegram bot (see Telegram Messages).
📑 Fields
| Field | Type | Description |
|---|
root_domain | str | Root domain extracted from link. |
domain | str | Domain extracted from link. |
link | URLField | Offer URL (unique). |
partner | str | Partner identifier/name. |
status | str | Current status (active/blocked/unblocked). |
owner | Foreign Key User | Optional owner. |
created_at | datetime | Creation timestamp. |
updated_at | datetime | Last update timestamp. |
blocked_at | datetime | When blocked. |
reason | str | Block reason (DNS_NOT_RESOLVABLE or Google Safe Browsing threat types, etc.). |
unblocked_at | datetime | When unblocked. |
changed_by | str | Actor identifier (system/user). |
🧩 Methods
| Method | Description |
|---|
get_domains_map(statuses, reason_exclude=None) | Returns {domain -> [OfferLink...]} for the given statuses. |
set_block(reason, action_by="system") | Sets blocked status and sends an offers-bot Telegram notification. |
set_unblock(action_by="system") | Sets unblocked status and sends an offers-bot Telegram notification. |
🏷 Statuses
| Status | Description |
|---|
active | Offer link is active and monitored. |
blocked | Offer link is blocked. |
unblocked | Offer link is unblocked by Google and can be used again. |
💡 Notes
domain and root_domain are derived from link on save.