update concurrentCapacity
This commit is contained in:
@@ -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 = {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user