واجهات TenantStores#
جدول ملخص الEndpoints#
| المسار | Method | الوصف | الجسم المطلوب | 200 Response |
|---|
/TenantStores | GET | استرجاع قائمة متاجر المستأجر وفق مرشحات | SelectTenantStore | SelectTenantStoreResult[] |
/TenantStores | POST | إنشاء متجر مستأجر | InsertTenantStore | InsertTenantStoreResult |
/TenantStores | PUT | تعديل متجر مستأجر | UpdateTenantStore | UpdateTenantStoreResult |
/TenantStores | DELETE | حذف متجر مستأجر | TenantStoreKey | UpdateTenantStoreResult |
/TenantStores/One | GET | استرجاع متجر محدّد بالمفتاح | TenantStoreKey | SelectOneTenantStoreResult |
/TenantStores/default | POST | إنشاء مجموعة المتاجر الافتراضية للمستأجر الحالي | — | CreateDefaultTenantStoreResult[] |
/TenantStores/active | PUT | تفعيل متجر مستأجر | TenantStoreKey | UpdateTenantStoreResult |
/TenantStores/block | PUT | حظر متجر مستأجر | TenantStoreKey | UpdateTenantStoreResult |
Security في هذا الملف: غير محدد (قيمة security: []). في البيئات الفعلية قد تعتمد Bearer JWT.
1) GET /TenantStores — استرجاع متاجر المستأجر#
Tag: TenantStores
OperationId: TenantStore_Getالوصف#
إرجاع قائمة متاجر بناءً على مرشحات اختيارية.الرؤوس#
Content-Type: application/json
Body — SelectTenantStore (اختياري)#
{
"tenantId": 1,
"accountId": 10,
"text": "main",
"status": 1,
"createdAfter": "2024-01-01",
"createdBefore": "2024-12-31",
"updatedAfter": "2024-06-01",
"offset": 0,
"limit": 20
}
مثال طلب (HTTP)#
مثال cURL#
200 — SelectTenantStoreResult[]#
[
{
"id": 1,
"status": 1,
"description": "المتجر الرئيسي",
"createdAt": "2024-01-01T00:00:00Z",
"updatedAt": "2024-06-10T12:30:00Z"
}
]
400 — CustomErrorResponse#
{
"errorCode": "ERR_VALIDATION",
"category": "validation",
"severity": "error",
"serviceId": 101,
"verbId": "select",
"tableName": "TenantStore",
"timestamp": "2025-09-05T18:00:00Z",
"context": "{\"field\":\"limit\",\"min\":1}",
"message": "قيمة limit يجب أن تكون أكبر من 0."
}
2) POST /TenantStores — إنشاء متجر مستأجر#
Tag: TenantStores
OperationId: TenantStore_Postالوصف#
إنشاء سجل متجر جديد للمستأجر.الرؤوس#
Content-Type: application/json
Body — InsertTenantStore (إلزامي)#
الحقول المطلوبة: tenantId, description.
{
"tenantId": 1,
"description": {
"names": {
"ar": "المتجر الرئيسي",
"en": "Main Store"
},
"note": "المستودع الافتراضي للمواد"
}
}
قيود الطول للأسماء: ar و en طول من 6 إلى 50 حرفًا.
مثال cURL#
200 — InsertTenantStoreResult#
{
"id": 5,
"status": 1,
"description": "المتجر الرئيسي",
"createdAt": "2024-01-01T00:00:00Z",
"updatedAt": "2024-01-01T00:00:00Z"
}
400 — CustomErrorResponse#
{
"errorCode": "ERR_VALIDATION",
"category": "validation",
"severity": "error",
"serviceId": 101,
"verbId": "create",
"tableName": "TenantStore",
"timestamp": "2025-09-05T18:00:00Z",
"context": "{\"field\":\"description.names.ar\",\"minLength\":6}",
"message": "اسم المتجر العربي يجب ألا يقل عن 6 أحرف."
}
3) PUT /TenantStores — تعديل متجر مستأجر#
Tag: TenantStores
OperationId: TenantStore_Putالوصف#
الرؤوس#
Content-Type: application/json
Body — UpdateTenantStore#
{
"tenantId": 1,
"id": 5,
"description": "تعديل اسم المتجر"
}
ملاحظة: حقل description هنا نصي وفق المخطط.
مثال HTTP#
200 — UpdateTenantStoreResult#
400 — CustomErrorResponse#
{
"errorCode": "ERR_NOT_FOUND",
"category": "business",
"severity": "error",
"serviceId": 101,
"verbId": "update",
"tableName": "TenantStore",
"timestamp": "2025-09-05T18:00:00Z",
"context": "{\"id\":5,\"tenantId\":1}",
"message": "لا يوجد متجر مطابق."
}
4) DELETE /TenantStores — حذف متجر مستأجر#
Tag: TenantStores
OperationId: TenantStore_Deleteالوصف#
حذف متجر بناءً على المفتاح.الرؤوس#
Content-Type: application/json
Body — TenantStoreKey#
{
"tenantId": 1,
"id": 5
}
مثال cURL#
200 — UpdateTenantStoreResult#
400 — CustomErrorResponse#
{
"errorCode": "ERR_CONFLICT",
"category": "business",
"severity": "error",
"serviceId": 101,
"verbId": "delete",
"tableName": "TenantStore",
"timestamp": "2025-09-05T18:00:00Z",
"context": "{\"id\":5,\"tenantId\":1}",
"message": "لا يمكن حذف المتجر لارتباطه بسجلات أخرى."
}
5) GET /TenantStores/One — استرجاع متجر محدّد#
Tag: TenantStores
OperationId: TenantStore_Getالوصف#
جلب متجر واحد عبر المفتاح.الرؤوس#
Content-Type: application/json
Body — TenantStoreKey#
{
"tenantId": 1,
"id": 5
}
مثال HTTP#
200 — SelectOneTenantStoreResult#
{
"id": 5,
"status": 1,
"description": "المتجر الرئيسي",
"createdAt": "2024-01-01T00:00:00Z",
"updatedAt": "2024-06-10T12:30:00Z"
}
400 — CustomErrorResponse#
{
"errorCode": "ERR_NOT_FOUND",
"category": "business",
"severity": "error",
"serviceId": 101,
"verbId": "select",
"tableName": "TenantStore",
"timestamp": "2025-09-05T18:00:00Z",
"context": "{\"id\":5,\"tenantId\":1}",
"message": "السجل غير موجود."
}
6) POST /TenantStores/default — إنشاء المتاجر الافتراضية#
Tag: TenantStores
OperationId: TenantStore_CreateDefaultالوصف#
إنشاء مجموعة المتاجر الابتدائية للمستأجر الحالي (لا يوجد جسم للطلب).مثال cURL#
200 — CreateDefaultTenantStoreResult[]#
[
{
"id": 1,
"status": 1,
"description": "Default Store A",
"createdAt": "2024-01-01T00:00:00Z",
"updatedAt": "2024-01-01T00:00:00Z"
},
{
"id": 2,
"status": 1,
"description": "Default Store B",
"createdAt": "2024-01-01T00:00:00Z",
"updatedAt": "2024-01-01T00:00:00Z"
}
]
400 — CustomErrorResponse#
{
"errorCode": "ERR_ALREADY_EXISTS",
"category": "business",
"severity": "warning",
"serviceId": 101,
"verbId": "seed",
"tableName": "TenantStore",
"timestamp": "2025-09-05T18:00:00Z",
"context": "{\"tenantId\":1}",
"message": "تم إنشاء المتاجر الافتراضية مسبقًا."
}
7) PUT /TenantStores/active — تفعيل متجر#
Tag: TenantStores
OperationId: TenantStore_ActiveBody — TenantStoreKey#
{
"tenantId": 1,
"id": 5
}
مثال cURL#
200 — UpdateTenantStoreResult#
8) PUT /TenantStores/block — حظر متجر#
Tag: TenantStores
OperationId: TenantStore_BlockBody — TenantStoreKey#
{
"tenantId": 1,
"id": 5
}
مثال cURL#
200 — UpdateTenantStoreResult#
ملاحظات عامة#
تاريخ/وقت الحقول في الاستجابات بصيغة ISO 8601.
Names.ar و Names.en: طول بين 6 و 50. استخدم أسماء وصفية (مثال: "المتجر الرئيسي", "Main Store").
قد تختلف أخطاء CustomErrorResponse حسب تنفيذ الخدمة؛ صيغ الأمثلة أعلاه متوافقة مع المخطط.
Modified at 2025-09-05 07:29:35