egress_policies
egress_policies, Qapu verisinin CRM/ERP/SCADA gibi dis sistemlere hangi kuralla aktarilacagini tanimlayan policy tablosudur. Hangi eventin, hangi hedefe, hangi guvenlik ve retry profiliyle gidecegi burada belirlenir.
Bu tablo sayesinde entegrasyon ayarlari kod degisikligi olmadan API veya panel uzerinden yonetilebilir.
Kolonlar
| Kolon | Tip | Null | Anlami |
|---|---|---|---|
id | bigint | hayır | Policy birincil anahtarı |
project_id | int | hayır | Policy'nin bagli oldugu proje; projects.id |
name | varchar(100) | hayır | Policy adi |
source_event | varchar(64) | hayır | Dinlenen kaynak event (window.ready.v1, automation.job.completed.v1 vb.) |
target_system | varchar(80) | hayır | Musteri/hedef sistem kodu (acme-erp, delta-scada) |
target_type | varchar(16) | hayır | webhook | api | mq |
target_url | text | evet | HTTP tabanli hedef endpoint |
method | varchar(8) | evet | HTTP metodu (POST, PUT) |
headers_template | jsonb | evet | Header map/sablon bilgisi |
transform_profile | jsonb | evet | Payload map/transform profili |
security_profile | jsonb | evet | Auth/sign/mTLS konfigurasyonu |
retry_max | int | hayır | Maksimum retry sayisi |
backoff_profile | varchar(64) | hayır | Backoff profili (1s,5s,15s) |
notify_on_fail | boolean | hayır | Kalici hata durumunda aksiyon bildirimi tetiklensin mi |
is_active | boolean | hayır | Policy aktif mi |
created_by | int | hayır | Kaydi olusturan actor; sistem islemlerinde 0 |
updated_by | int | hayır | Son guncelleyen actor; sistem islemlerinde 0 |
create_time | timestamp | hayır | Olusturma zamani |
update_time | timestamp | hayır | Son guncelleme zamani |
İndeksler
| İndeks | Tip | Açıklama |
|---|---|---|
id | Primary Key | Tablo birincil anahtarı |
(project_id, name) | Unique | Proje icinde policy adi tekildir |
(project_id, source_event, is_active) | Index | Event consume sirasinda hizli policy secimi |
Örnek Kayıtlar
- CRM Telemetri Push
- SCADA Komut Sonucu
{
"id": 101,
"project_id": 5,
"name": "CRM Telemetry Window Export",
"source_event": "window.ready.v1",
"target_system": "acme-crm",
"target_type": "webhook",
"target_url": "https://crm.acme.com/iot/window",
"method": "POST",
"headers_template": {"Content-Type": "application/json"},
"transform_profile": {"include": ["base", "synthesis", "window"]},
"security_profile": {"auth_type": "api_key", "header": "x-api-key"},
"retry_max": 3,
"backoff_profile": "1s,5s,15s",
"notify_on_fail": true,
"is_active": true,
"created_by": 1,
"updated_by": 1,
"create_time": "2026-04-15 10:00:00",
"update_time": "2026-04-15 10:00:00"
}
Özet: Telemetri zinciri tamamlandiginda CRM'e policy bazli veri aktarimi.
{
"id": 102,
"project_id": 5,
"name": "SCADA Automation Result Bridge",
"source_event": "automation.job.completed.v1",
"target_system": "delta-scada",
"target_type": "api",
"target_url": "https://scada.delta.local/api/command-result",
"method": "POST",
"headers_template": {"Content-Type": "application/json"},
"transform_profile": {"include": ["automation", "result"]},
"security_profile": {"auth_type": "mtls"},
"retry_max": 5,
"backoff_profile": "1s,5s,15s,30s,60s",
"notify_on_fail": true,
"is_active": true,
"created_by": 0,
"updated_by": 0,
"create_time": "2026-04-15 10:05:00",
"update_time": "2026-04-15 10:05:00"
}
Özet: Sistem tarafindan acilmis policy; otomasyon komut sonucunu SCADA API'sine iletir.