feat(F-163): completed feature

This commit is contained in:
chattie
2026-08-22 18:33:24 +02:00
parent 08af6caf50
commit 5d90dd32de
19 changed files with 403 additions and 37 deletions

View File

@@ -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' }),
};