From 1b9f494b692dd2a1f956428e121ddbd8b8e7ed65 Mon Sep 17 00:00:00 2001 From: Mahdi Date: Mon, 1 Jun 2026 13:22:07 +0330 Subject: [PATCH] update concurrentCapacity --- src/api/types.ts | 2 ++ src/views/app/AppOwnerView.vue | 21 +++++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/src/api/types.ts b/src/api/types.ts index 23b3362..b8ba013 100644 --- a/src/api/types.ts +++ b/src/api/types.ts @@ -23,6 +23,7 @@ export type Business = { longitude: number | null; isActive: boolean; serviceClassesEnabled?: boolean; + concurrentCapacity?: number; categoryId: string; ownerId?: string | null; category?: BusinessCategory; @@ -65,6 +66,7 @@ export type UpdateBusinessPayload = { latitude?: number | null; longitude?: number | null; serviceClassesEnabled?: boolean; + concurrentCapacity?: number; }; export type BusinessServiceClass = { diff --git a/src/views/app/AppOwnerView.vue b/src/views/app/AppOwnerView.vue index 68d9906..cd5f6dc 100644 --- a/src/views/app/AppOwnerView.vue +++ b/src/views/app/AppOwnerView.vue @@ -61,6 +61,19 @@ /> + +

+ حداکثر تعداد مشتری که همزمان می‌توانید پذیرش کنید. مثلاً ۳ یعنی هر ساعت تا ۳ رزرو هم‌پوشان. +

+ ذخیره تغییرات @@ -413,6 +426,7 @@ const form = ref({ description: '', contactPhone: '', address: '', + concurrentCapacity: '1', }); const serviceForm = ref({ @@ -536,6 +550,7 @@ onMounted(async () => { description: business.value.description ?? '', contactPhone: business.value.contactPhone ?? '', address: business.value.address ?? '', + concurrentCapacity: String(business.value.concurrentCapacity ?? 1), }; await loadServicesAndTemplates(); } @@ -548,6 +563,11 @@ onMounted(async () => { async function onSave() { if (!business.value) return; + const concurrentCapacity = Number.parseInt(form.value.concurrentCapacity, 10); + if (!Number.isFinite(concurrentCapacity) || concurrentCapacity < 1 || concurrentCapacity > 20) { + error.value = 'پذیرش همزمان باید عددی بین ۱ تا ۲۰ باشد.'; + return; + } saving.value = true; error.value = ''; message.value = ''; @@ -557,6 +577,7 @@ async function onSave() { description: form.value.description.trim() || null, contactPhone: form.value.contactPhone.trim() || null, address: form.value.address.trim() || null, + concurrentCapacity, }); message.value = 'اطلاعات ذخیره شد.'; } catch (e) {