diff --git a/index.html b/index.html index 1d055e6..7d5edf2 100644 --- a/index.html +++ b/index.html @@ -3,7 +3,7 @@ - مون‌تایم — پنل مدیریت + منتایم — پنل مدیریت diff --git a/src/api/business-registrations.ts b/src/api/business-registrations.ts new file mode 100644 index 0000000..0f90deb --- /dev/null +++ b/src/api/business-registrations.ts @@ -0,0 +1,20 @@ +import { api } from './client'; +import type { BusinessRegistrationRequest } from './types'; + +export function fetchBusinessRegistrationRequests(status?: 'pending' | 'approved' | 'rejected') { + const query = status ? `?status=${status}` : ''; + return api(`/business-registration-requests${query}`); +} + +export function approveBusinessRegistration(id: string) { + return api(`/business-registration-requests/${id}/approve`, { + method: 'POST', + }); +} + +export function rejectBusinessRegistration(id: string, adminNote?: string) { + return api(`/business-registration-requests/${id}/reject`, { + method: 'POST', + body: JSON.stringify({ adminNote: adminNote || undefined }), + }); +} diff --git a/src/api/types.ts b/src/api/types.ts index 039b66a..b053ec5 100644 --- a/src/api/types.ts +++ b/src/api/types.ts @@ -94,6 +94,25 @@ export type BookingStatus = | 'cancelled' | 'completed'; +export type BusinessRegistrationStatus = 'pending' | 'approved' | 'rejected'; + +export type BusinessRegistrationRequest = { + id: string; + applicantId: string; + status: BusinessRegistrationStatus; + title: string; + slug: string; + categoryId: string; + description: string | null; + contactPhone: string | null; + address: string | null; + adminNote: string | null; + businessId: string | null; + createdAt: string; + category?: BusinessCategory; + applicant?: User; +}; + export type Booking = { id: string; customerId: string; diff --git a/src/components/admin/BusinessListCard.vue b/src/components/admin/BusinessListCard.vue index 465a891..8a46873 100644 --- a/src/components/admin/BusinessListCard.vue +++ b/src/components/admin/BusinessListCard.vue @@ -1,6 +1,32 @@ @@ -46,13 +54,7 @@ import { businessCoverUrl } from '@/utils/media'; const props = defineProps<{ business: Business; ownerText?: string | null; - actionCols?: number; }>(); const cover = computed(() => businessCoverUrl(props.business.images)); - -const actionGridClass = computed(() => { - const cols = props.actionCols ?? 3; - return cols === 2 ? 'grid-cols-2' : 'grid-cols-3'; -}); diff --git a/src/components/ui/SearchInput.vue b/src/components/ui/SearchInput.vue new file mode 100644 index 0000000..ce59123 --- /dev/null +++ b/src/components/ui/SearchInput.vue @@ -0,0 +1,29 @@ + + + diff --git a/src/layouts/AdminLayout.vue b/src/layouts/AdminLayout.vue index a2209f9..7c73b88 100644 --- a/src/layouts/AdminLayout.vue +++ b/src/layouts/AdminLayout.vue @@ -4,10 +4,8 @@ class="sticky top-0 z-10 flex items-center justify-between border-b border-brand-500/30 bg-surface/95 px-4 py-3 backdrop-blur" > -

پنل مدیریت

-

- {{ auth.user?.fullName ?? auth.user?.mobile ?? 'adm.montime.ir' }} -

+

منتایم

+

پنل مدیریت