feat(F-163): completed feature
This commit is contained in:
@@ -35,6 +35,12 @@ export const posApi = {
|
||||
}),
|
||||
/** Get POS config (store + terminal + payment methods + session status). */
|
||||
config: <T>() => apiFetch<T>('/pos/config'),
|
||||
/** Open the daily cash session for the bound terminal. */
|
||||
openSession: (openingCashCents: number) =>
|
||||
apiFetch<{ id: string; status: 'OPEN' }>('/pos/sessions', {
|
||||
method: 'POST',
|
||||
body: JSON.stringify({ openingCashCents }),
|
||||
}),
|
||||
/** List products by query. */
|
||||
searchProducts: (q: string, storeId?: string, limit = 20) =>
|
||||
apiFetch(`/pos/products/search?q=${encodeURIComponent(q)}&storeId=${storeId ?? ''}&limit=${limit}`),
|
||||
@@ -46,6 +52,6 @@ export const posApi = {
|
||||
|
||||
export const authApi = {
|
||||
login: (email: string, password: string) =>
|
||||
apiFetch('/auth/login', { method: 'POST', body: JSON.stringify({ email, password }) }),
|
||||
logout: () => apiFetch('/auth/logout', { method: 'POST' }),
|
||||
apiFetch('/backoffice/auth/login', { method: 'POST', body: JSON.stringify({ email, password }) }),
|
||||
logout: () => apiFetch('/backoffice/auth/logout', { method: 'POST' }),
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user