Initial commit: Meshkee dashboards monorepo.

Includes business, customer, and super-admin apps with shared packages and production deploy scripts.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Alireza Hassani
2026-07-22 13:48:53 +03:30
co-authored by Cursor
commit f566387c61
509 changed files with 62690 additions and 0 deletions
@@ -0,0 +1,62 @@
import { apiRequest } from '../lib/api'
import { getActiveBusinessId } from '../lib/businessContext'
import type { StoreSpecial } from '../types/storeSpecial'
export interface StoreSpecialsListResponse {
items: StoreSpecial[]
total: number
page: number
pageSize: number
}
export interface CreateStoreSpecialPayload {
title: string
storeItemIds?: string[]
sortOrder?: number
isActive?: boolean
}
export interface UpdateStoreSpecialPayload {
title?: string
storeItemIds?: string[]
sortOrder?: number
isActive?: boolean
}
function businessPath(suffix = '') {
const businessId = getActiveBusinessId()
if (!businessId) {
throw new Error('No active business selected. Please sign in again.')
}
return `/businesses/${businessId}/store-specials${suffix}`
}
export async function listStoreSpecials(page = 1, pageSize = 50, signal?: AbortSignal) {
return apiRequest<StoreSpecialsListResponse>(
`${businessPath()}?page=${page}&pageSize=${pageSize}`,
{ auth: true, signal },
)
}
export async function createStoreSpecial(payload: CreateStoreSpecialPayload) {
return apiRequest<{ message: string; special: StoreSpecial }>(businessPath(), {
method: 'POST',
auth: true,
body: payload,
})
}
export async function updateStoreSpecial(specialId: string, payload: UpdateStoreSpecialPayload) {
return apiRequest<{ message: string; special: StoreSpecial }>(businessPath(`/${specialId}`), {
method: 'PATCH',
auth: true,
body: payload,
})
}
export async function deleteStoreSpecial(specialId: string) {
return apiRequest<{ message: string }>(businessPath(`/${specialId}`), {
method: 'DELETE',
auth: true,
})
}