Reject Batch Policy

## Toplu Poliçe İsteğini Reddet ### Endpoint Bilgileri | Alan | Değer | | --- | --- | | **Method** | `POST` | | **URL** | `{{baseUrl}}/api/Offline/jobs/{jobId}/Policies/reject-batch` | | **Content-Type** | `application/json` | | **Yetkilendirme** | Bearer Token + `Update` politikası | --- Bir işin toplu poliçe talebini, seçilen red sebebi ve açıklama ile reddeder. Başarılı istekte iş `Toplu Poliçe Reddedildi` (`BatchPolicyRejected`) aşamasına geçer, red aksiyonu oluşturulur, platforma iletilir ve varsa ek dosya kaydedilir. > İşin aşaması `Toplu Poliçe İsteği` olmalıdır; aksi halde geçiş reddedilir. --- ### Route Parametreleri | Parametre | Tip | Zorunlu | Açıklama | | --- | --- | --- | --- | | `jobId` | `integer` | Evet | Reddedilecek toplu poliçe talebinin ait olduğu iş Id | --- ### Kimlik Doğrulama Geçerli bir bearer token gerektirir. Token şunları içermelidir: - Tanınan bir rol (`InsuranceCompanyAPIUser`, `InsuranceCompanyAPIAdmin` veya `Supervizor`) - İlgili route için `Update` yetkisi - Geçerli bir sigorta şirketi ataması - Çözümlenebilir bir kullanıcı kimliği > `InsuranceCompanyAPIUser` yalnızca kendi sahibi olduğu işleri reddedebilir. `InsuranceCompanyAPIAdmin` ve `Supervizor` şirketin tüm işlerine erişebilir. --- ### İstek Modeli — `RejectBatchPolicyRequest` | Alan | Tip | Zorunlu | Açıklama | Doğrulama | | --- | --- | --- | --- | --- | | `Message` | `string` | Evet | Red açıklaması | Boş olamaz: `"Message is required."` <br>Maks. 1000 karakter: `"Message cannot exceed 1000 characters."` | | `RejectReasonId` | `integer` | Evet | Red sebebi Id | 0'dan büyük olmalı: `"RejectReasonId must be greater than zero."` | | `Attachment` | `PolicyFileRequest` | Hayır | Redde dayanak oluşturan belge | Gönderilirse `PolicyFileRequest` doğrulamaları uygulanır | > `JobId` gövdeden alınmaz; route parametresinden set edilir. 0'dan büyük olmalıdır: `"JobId must be greater than zero."` #### Ek Dosya — `PolicyFileRequest` | Alan | Tip | Zorunlu | Açıklama | Doğrulama | | --- | --- | --- | --- | --- | | `FileName` | `string` | Evet\* | Dosya adı | Boş olamaz: `"FileName must not be empty."` <br>`.pdf` ile bitmeli: `"Only PDF files are allowed."` | | `Base64Content` | `string` | Evet\* | Base64 kodlu dosya içeriği | Boş olamaz: `"Base64Content must not be empty."` <br>Geçerli bir PDF olmalı: `"Base64Content must be a valid base64-encoded PDF."` | | `ContentType` | `string` | Hayır | MIME türü | Doğrulanmaz | > \* Bu alanlar yalnızca `Attachment` nesnesi gönderildiğinde doğrulanır. İçerik, base64 çözüldükten sonra PDF imzasıyla (`%PDF`) başlamalıdır. --- ### Red Sebebi Kontrolleri Gönderilen `RejectReasonId` sırasıyla şu kontrollerden geçer: 1. Sistemde kayıtlı olmalıdır. 2. `Policy` kategorisinde olmalıdır. 3. İşin sigorta şirketi, red sebebinin dahil/hariç listesi tarafından engellenmemiş olmalıdır. --- ### Yanıt #### `204 No Content` — Başarılı Yanıt Gövde boştur. --- ### Hata Senaryoları #### `400 Bad Request` — Doğrulama Hatası İstek modeli doğrulamadan geçemediğinde döner. Hatalı alanlar `Response` içinde listelenir. ``` json { "Status": false, "Code": "Validation.General", "Message": "One or more validation errors occurred", "Response": [ { "Field": "Message", "Message": "Message is required." }, { "Field": "RejectReasonId", "Message": "RejectReasonId must be greater than zero." } ] } ``` --- #### `400 Bad Request` — Red Sebebi Bulunamadı Gönderilen `RejectReasonId` sistemde kayıtlı değilse döner. ``` json { "Status": false, "Code": "Validation.General", "Message": "One or more validation errors occurred", "Response": [ { "Field": "JobRejectReason.RejectReasonNotFound", "Message": "The specified reject reason was not found." } ] } ``` --- #### `400 Bad Request` — Red Sebebi Kategorisi Geçersiz Red sebebi `Policy` kategorisinde değilse döner. ``` json { "Status": false, "Code": "Validation.General", "Message": "One or more validation errors occurred", "Response": [ { "Field": "JobRejectReason.InvalidRejectReasonCategory", "Message": "The reject reason must be in the Policy category." } ] } ``` --- #### `400 Bad Request` — Red Sebebi Şirket İçin Kullanılamaz Red sebebi, işin sigorta şirketi için dahil/hariç listesiyle engellenmişse döner. ``` json { "Status": false, "Code": "Validation.General", "Message": "One or more validation errors occurred", "Response": [ { "Field": "JobRejectReason.RejectReasonNotAllowedForInsuranceCompany", "Message": "The specified reject reason is not allowed for your insurance company." } ] } ``` --- #### `400 Bad Request` — State Geçişi Başarısız İş uygun aşamada değilse ya da red aksiyonu platforma iletilemezse döner. `Message` alanı iş kuralı hatasının detayını içerir. ``` json { "Status": false, "Code": "OfflinePolicies.StateTransitionFailed", "Message": "Policy rejection failed: 'Toplu Poliçe Gerçekleşti' aşamasından 'Toplu Poliçe Reddedildi' aşamasına geçiş yapılamaz.", "Response": null } ``` > Aksiyon platforma iletilemediğinde (red sebebi teknik hata kategorisinde değilse) oluşturulan aksiyon silinir ve iş `Toplu Poliçe İsteği` aşamasına geri döndürülür. --- #### `403 Forbidden` — Geçerli Sigorta Şirketi Ataması Bulunamadı Token'da geçerli bir sigorta şirketi ataması bulunmadığında döner. ``` json { "Status": false, "Code": "OfflineUsers.InsuranceCompanyNotFound", "Message": "No valid insurance company assignment found in token.", "Response": null } ``` --- #### `403 Forbidden` — Kullanıcı Kimliği Çözümlenemedi Token'dan kullanıcı kimliği okunamadığında döner. ``` json { "Status": false, "Code": "OfflineUsers.UserIdentityNotResolved", "Message": "User identity could not be resolved from token.", "Response": null } ``` --- #### `403 Forbidden` — İşe Erişim Reddedildi İş, çağıranın sahipliğinde değilse döner. ``` json { "Status": false, "Code": "OfflineJobs.JobOwnershipDenied", "Message": "You do not have permission to access this job.", "Response": null } ``` --- #### `403 Forbidden` — Rol veya Yetki Yetersiz Kullanıcı tanınan rollerden birine sahip değilse ya da `Update` yetkisi yoksa döner. **Gövde boştur.** --- #### `401 Unauthorized` — Token Yok veya Geçersiz Token gönderilmediğinde, geçersiz olduğunda veya süresi dolduğunda döner. **Gövde boştur.** --- #### `404 Not Found` — İş Bulunamadı Belirtilen `jobId` ile bir iş bulunamadığında döner. ``` json { "Status": false, "Code": "OfflineJobs.JobNotFound", "Message": "No job found for the requested JobId: 100931.", "Response": null } ``` --- #### `500 Internal Server Error` — State Geçişinde Beklenmeyen Hata Geçiş sırasında iş kuralı dışında bir hata oluştuğunda döner. ``` json { "Status": false, "Code": "JobState.TransitionError", "Message": "An unexpected error occurred during job state transition.", "Response": null } ```

Authentication

AuthorizationBearer

Bearer authentication of the form Bearer <token>, where token is your auth token.

Path parameters

jobIdintegerRequired

Request

This endpoint expects an object.

Response

No Content

Errors

400
Bad Request Error
403
Forbidden Error
404
Not Found Error
500
Internal Server Error