API Spesifikasyonu Özeti¶
Bu sayfa, Gezen mobil uygulamasının kullandığı backend API yüzeyini özetler.
Runtime Yapılandırması¶
Uygulama backend URL'lerini .env dosyasından app.config.ts ve app/config/runtimeConfig.ts üzerinden okur. Axios bunları app/services/apiClient.ts içinde kullanır.
| Değişken | Kullanım | Örnek |
|---|---|---|
EXPO_PUBLIC_API_URL |
Ana backend | http://192.168.10.135:8000/api |
EXPO_PUBLIC_TASK_PHOTO_API_URL |
Legacy görev fotoğrafı backend'i | http://192.168.10.135:8000/api/v1 |
Kurallar:
- Path soneki dahil tam URL kullanın. Uygulama
/auth/tokengibi göreli yollarıEXPO_PUBLIC_API_URLüzerine ekler. - Backend URL'lerini
app/constants.tsiçinde yapılandırmayın; bu dosya legacy'dir ve API çağrılarında kullanılmaz. .envdeğiştirdikten sonra Metro'yu durdurun venpx expo start -cile yeniden başlatın.- Testlerde kullanılan örnek üretim değerleri
https://sales.iqvizyon.com/apivehttps://api.iqv.com.tr/api/v1olabilir; gerçek değerler kendi.envdosyanızdan gelir.
Kurulum ayrıntıları: setup.md
Kimlik Doğrulama¶
Korumalı tüm istekler SecureStore'dan alınan Bearer token kullanır:
Authorization: Bearer <token>
Auth endpoint'leri¶
POST /auth/token- Form-encoded username ve password ile giriş
GET /users/me- Mevcut kimliği doğrulanmış kullanıcıyı döndürür
Auth token'ı user_token anahtarında saklanır.
Ana Kaynak Grupları¶
Fabrikalar¶
GET /factoriesPOST /factoriesPUT /factories/{factoryId}
Mevcut frontend gerektiğinde tekil fabrika detayını liste yanıtından türetiyor, ayrı bir detail endpoint'e bağlı kalmıyor.
Makineler¶
GET /machinesGET /machines/{machineId}POST /machinesPUT /machines/{machineId}DELETE /machines/{machineId}GET /machines/{machineId}/images/POST /machines/{machineId}/images/DELETE /machines/{machineId}/images/{imageId}
Makine görsel URL'leri ayrıca ana backend host ve legacy /uploads/machine_images/{machineId}/{fileName} yolu ile client tarafında oluşturulur.
Makine Referans Verileri¶
GET /machine-brandsPOST /machine-brandsGET /machine-modelsPOST /machine-modelsGET /machine-typesPOST /machine-typesPUT /machine-types/{id}DELETE /machine-types/{id}GET /control-panel-brandsPOST /control-panel-brandsGET /control-panel-modelsPOST /control-panel-models
Görevler¶
GET /tasksGET /tasks/{taskId}POST /tasksPUT /tasks/{taskId}DELETE /tasks/{taskId}PUT /tasks/{taskId}/statusPOST /tasks/{taskId}/notes
Teklifler¶
GET /devicesGET /quotesGET /quotes/{quoteId}POST /quotesPUT /quotes/{quoteId}GET /quotes/{quoteId}/proforma/POST /quotes/{quoteId}/send-proforma/GET /quote-itemsGET /quote-items/{id}POST /quote-itemsPUT /quote-items/{id}DELETE /quote-items/{id}POST /quotes/{quoteId}/create-followup-event
Takvim¶
GET /calendar-eventsGET /calendar-events/{eventId}POST /calendar-eventsPUT /calendar-events/{eventId}DELETE /calendar-events/{eventId}
Bildirimler¶
GET /notificationsGET /notifications/unread-countPUT /notifications/{notificationId}/readPUT /notifications/mark-all-readPOST /user/push-token
Üretim Kataloğu¶
GET /sectorsPOST /sectorsGET /production-categoriesPOST /production-categoriesGET /production-areasPOST /production-areasGET /production-modulesPOST /production-sub-modules
Kullanıcılar¶
GET /users
ROI ve Solution Center¶
POST /simple-roi-analysis/{factoryId}- Daha uzun bir client timeout kullanır
POST /solution-center
Legacy Görev-Fotoğraf Backend'i¶
Görev fotoğrafı işlemleri ayrı bir istemci ve base URL üzerinden yürütülür:
POST /tasks/{taskId}/photosDELETE /tasks/{taskId}/photos/{photoId}
Bu backend özellikle app/services/taskPhotoService.ts içinde izole edilmiştir.
Frontend Uyum Katmanları¶
Kod tabanında hâlâ birkaç ince uyumluluk katmanı vardır:
app/services/calendarEventApi.tscanonical calendar istemcisini sararapp/services/mobileApi.tsmakineler ve fabrikalar için eski liste yardımcılarını sunarapp/services/machineApi.tseski ekranlar tarafından kullanılan küçük bir mobil makine yardımcısı sağlar
Canonical API modülleri artık app/services/api/* altında yer alır.