update concurrentCapacity

This commit is contained in:
2026-06-01 13:22:07 +03:30
parent 3f3572dc89
commit 1b9f494b69
2 changed files with 23 additions and 0 deletions
+2
View File
@@ -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 = {
+21
View File
@@ -61,6 +61,19 @@
/>
<AppInput id="ownerAddress" v-model="form.address" label="آدرس" />
<AppInput
id="ownerConcurrentCapacity"
v-model="form.concurrentCapacity"
label="پذیرش همزمان"
type="number"
inputmode="numeric"
ltr
required
/>
<p class="-mt-2 text-xs text-muted">
حداکثر تعداد مشتری که همزمان می‌توانید پذیرش کنید. مثلاً ۳ یعنی هر ساعت تا ۳ رزرو هم‌پوشان.
</p>
<AppButton type="submit" :loading="saving">ذخیره تغییرات</AppButton>
</form>
@@ -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) {