update concurrentCapacity
This commit is contained in:
@@ -23,6 +23,7 @@ export type Business = {
|
|||||||
longitude: number | null;
|
longitude: number | null;
|
||||||
isActive: boolean;
|
isActive: boolean;
|
||||||
serviceClassesEnabled?: boolean;
|
serviceClassesEnabled?: boolean;
|
||||||
|
concurrentCapacity?: number;
|
||||||
categoryId: string;
|
categoryId: string;
|
||||||
ownerId?: string | null;
|
ownerId?: string | null;
|
||||||
category?: BusinessCategory;
|
category?: BusinessCategory;
|
||||||
@@ -65,6 +66,7 @@ export type UpdateBusinessPayload = {
|
|||||||
latitude?: number | null;
|
latitude?: number | null;
|
||||||
longitude?: number | null;
|
longitude?: number | null;
|
||||||
serviceClassesEnabled?: boolean;
|
serviceClassesEnabled?: boolean;
|
||||||
|
concurrentCapacity?: number;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type BusinessServiceClass = {
|
export type BusinessServiceClass = {
|
||||||
|
|||||||
@@ -61,6 +61,19 @@
|
|||||||
/>
|
/>
|
||||||
<AppInput id="ownerAddress" v-model="form.address" label="آدرس" />
|
<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>
|
<AppButton type="submit" :loading="saving">ذخیره تغییرات</AppButton>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
@@ -413,6 +426,7 @@ const form = ref({
|
|||||||
description: '',
|
description: '',
|
||||||
contactPhone: '',
|
contactPhone: '',
|
||||||
address: '',
|
address: '',
|
||||||
|
concurrentCapacity: '1',
|
||||||
});
|
});
|
||||||
|
|
||||||
const serviceForm = ref({
|
const serviceForm = ref({
|
||||||
@@ -536,6 +550,7 @@ onMounted(async () => {
|
|||||||
description: business.value.description ?? '',
|
description: business.value.description ?? '',
|
||||||
contactPhone: business.value.contactPhone ?? '',
|
contactPhone: business.value.contactPhone ?? '',
|
||||||
address: business.value.address ?? '',
|
address: business.value.address ?? '',
|
||||||
|
concurrentCapacity: String(business.value.concurrentCapacity ?? 1),
|
||||||
};
|
};
|
||||||
await loadServicesAndTemplates();
|
await loadServicesAndTemplates();
|
||||||
}
|
}
|
||||||
@@ -548,6 +563,11 @@ onMounted(async () => {
|
|||||||
|
|
||||||
async function onSave() {
|
async function onSave() {
|
||||||
if (!business.value) return;
|
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;
|
saving.value = true;
|
||||||
error.value = '';
|
error.value = '';
|
||||||
message.value = '';
|
message.value = '';
|
||||||
@@ -557,6 +577,7 @@ async function onSave() {
|
|||||||
description: form.value.description.trim() || null,
|
description: form.value.description.trim() || null,
|
||||||
contactPhone: form.value.contactPhone.trim() || null,
|
contactPhone: form.value.contactPhone.trim() || null,
|
||||||
address: form.value.address.trim() || null,
|
address: form.value.address.trim() || null,
|
||||||
|
concurrentCapacity,
|
||||||
});
|
});
|
||||||
message.value = 'اطلاعات ذخیره شد.';
|
message.value = 'اطلاعات ذخیره شد.';
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|||||||
Reference in New Issue
Block a user