Ana içeriğe geç

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

HeaderValue
AuthorizationBearer {{masked_jwt_5}}
Content-Typeapplication/json

📥 URL Parametreleri

ParametreTipAçıklamaÖrnek
store-codestringMağ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

AlanTipZorunluAçıklamaÖrnek
namestringMağaza adı"Mobildev HQ"
codestringBenzersiz mağaza kodu"mobildev-mq-api"
addressstringTam adres bilgisi-
phonestringTelefon numarası"444 0 554"
cityIdintegerİl ID'si (81'den biri)34
districtIdintegerİlçe ID'si440
neighborhoodstringMahalle bilgisi"Esentepe Mahallesi"
latitudefloatEnlem (WGS84)40.91164357977882
longitudefloatBoylam (WGS84)29.192971025276425
postalCodestringPosta kodu""
statusstringDurum (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
}
HTTPcodeEnumdescriptionNe Zaman Oluşur
4003004StoreNameEmptyStore name cannot be emptyname 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)
4003001StoreCodeInvalidInvalid store codecode alanı boş gönderildi
4093003StoreCodeExistsA store with this code already existsGönderilen code, aynı şirkette başka bir mağazada zaten kullanılıyor (kendi kaydı hariç tutularak kontrol ediliyor — exists(companyId, storeId, code))
5003008StoreUpdateErrorAn error occurred while updating the storeUPDATE 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.
  • code değ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 code alanı AppError enum'undaki uygulama-içi hata kodudur (Response.code); tüm hata gövdesi Response adlı bir alt obje içinde döner, en dışta ayrıca Success: false alanı bulunur.