POST /store/{store-code} — Mağaza Güncelleme
📋 Genel Bilgi
Mevcut bir mağazanın bilgilerini günceller. Mağaza kodu path parametre olarak gönderilir.
Base URL: {{url}}/store/{{store_code}}
Method: POST
Content-Type: application/json
🔐 Headers
| Header | Value |
|---|---|
| Authorization | Bearer {{masked_jwt_5}} |
| Content-Type | application/json |
📥 URL Parametreleri
| Parametre | Tip | Açıklama | Örnek |
|---|---|---|---|
store-code | string | Mağaza kodu (path param) | "mobildev-mq-api" |
📥 Request Body
{
"name": "Mobildev HQ",
"code": "mobildev-mq-api",
"address": "Esentepe Mah., D-100 Güney Yanyol Cad. Lapishan No:25 D:147-151 Kartal",
"phone": "444 0 554",
"cityId": 34,
"districtId": 440,
"neighborhood": "Esentepe Mahallesi",
"latitude": 40.91164357977882,
"longitude": 29.192971025276425,
"postalCode": "",
"status": "active"
}
Parametreler
| Alan | Tip | Zorunlu | Açıklama | Örnek |
|---|---|---|---|---|
name | string | ❌ | Mağaza adı | "Mobildev HQ" |
code | string | ❌ | Benzersiz mağaza kodu | "mobildev-mq-api" |
address | string | ❌ | Tam adres bilgisi | - |
phone | string | ❌ | Telefon numarası | "444 0 554" |
cityId | integer | ❌ | İl ID'si (81'den biri) | 34 |
districtId | integer | ❌ | İlçe ID'si | 440 |
neighborhood | string | ❌ | Mahalle bilgisi | "Esentepe Mahallesi" |
latitude | float | ❌ | Enlem (WGS84) | 40.91164357977882 |
longitude | float | ❌ | Boylam (WGS84) | 29.192971025276425 |
postalCode | string | ❌ | Posta kodu | "" |
status | string | ❌ | Durum (active, inactive, closed) | "active" |
✅ Response — 200 OK
{}
Açıklama
- Güncelleme başarılı olduğunda boş JSON döner.
- Hata durumunda HTTP 4xx/5xx ve hata mesajı döner.
❌ Error Responses
Tüm hata yanıtları aşağıdaki formatta döner:
{
"Response": {
"code": 3005,
"description": "A store with this code already exists"
},
"Success": false
}
| HTTP | code | Enum | description | Ne Zaman Oluşur |
|---|---|---|---|---|
| 400 | 3004 | StoreNameEmpty | Store name cannot be empty | name alanı boş gönderildi (not: parse()'ta ObjectUtil.populateFromJson sonrası kontrol edildiği için, name hiç gönderilmezse de mevcut değer boşsa tetiklenebilir) |
| 400 | 3001 | StoreCodeInvalid | Invalid store code | code alanı boş gönderildi |
| 409 | 3003 | StoreCodeExists | A store with this code already exists | Gönderilen code, aynı şirkette başka bir mağazada zaten kullanılıyor (kendi kaydı hariç tutularak kontrol ediliyor — exists(companyId, storeId, code)) |
| 500 | 3008 | StoreUpdateError | An error occurred while updating the store | UPDATE sorgusu veritabanı seviyesinde başarısız olduğunda fırlatılır |
Örnek — 400 Store Name Empty
{
"Response": {
"code": 3004,
"description": "Store name cannot be empty"
},
"Success": false
}
Örnek — 400 Store Code Empty/Invalid
{
"Response": {
"code": 3001,
"description": "Invalid store code"
},
"Success": false
}
Örnek — 409 Store Code Exists
{
"Response": {
"code": 3003,
"description": "A store with this code already exists"
},
"Success": false
}
Örnek — 500 Store Update Error
{
"Response": {
"code": 3008,
"description": "An error occurred while updating the store"
},
"Success": false
}
📝 Notlar
- Tüm alanlar opsiyoneldir. Sadece güncellenmek istenen alanlar gönderilir.
codedeğiştirilirse benzersizlik kontrolü yapılır (aynı kod ile başka mağaza varsa hata döner).status: inactive→ Mağaza pasif, işlem yapılamaz.status: closed→ Mağaza kapalı.- Hata response'larındaki
codealanıAppErrorenum'undaki uygulama-içi hata kodudur (Response.code); tüm hata gövdesiResponseadlı bir alt obje içinde döner, en dışta ayrıcaSuccess: falsealanı bulunur.