new changes in api base url

This commit is contained in:
2026-07-09 15:49:45 +05:30
parent 7cd0ae85ef
commit 4ef9cd9085
29 changed files with 2714 additions and 1191 deletions

View File

@@ -29,7 +29,9 @@ import { firstRow, num, str, type Row } from './fiestaApi';
* failure: { code: 409, message: "Invalid Email", status: false }
* success: status !== false (Fiesta envelope, optionally with `details`)
*/
const LOGIN_ENDPOINT = 'https://fiesta.nearle.app/live/api/v1/web/users/applogin';
const LOGIN_ENDPOINT = import.meta.env.VITE_FIESTA_URL
? `${import.meta.env.VITE_FIESTA_URL}/users/applogin`
: 'http://localhost:1122/live/api/v1/web/users/applogin';
/** Request body field names the endpoint expects for the credentials. */
const REQUEST_FIELDS = {

View File

@@ -17,8 +17,8 @@
* these functions directly.
*/
const FIESTA_BASE = 'https://fiesta.nearle.app/live/api/v1/web';
const FIESTA_MOB_BASE = 'https://fiesta.nearle.app/live/api/v1/mob';
const FIESTA_BASE = import.meta.env.VITE_FIESTA_URL || 'http://localhost:1122/live/api/v1/web';
const FIESTA_MOB_BASE = import.meta.env.VITE_FIESTA_MOB_URL || 'http://localhost:1122/live/api/v1/mob';
/** Tenant / location scope shared by the merchant console (Ragul Stores, Coimbatore). */
export const FIESTA_TENANT_ID = 1087;
@@ -141,25 +141,20 @@ export interface FiestaRevenueSummary {
/** /orders/getrevenuesummary?tenantid=&locationid=&fromdate=&todate= — tenant revenue and location breakdown. */
export async function getRevenueSummary(opts: {
tenantid: number;
fromdate: string;
todate: string;
fromdate?: string;
todate?: string;
locationid?: number;
}) {
const res = await fiestaGet('orders/getrevenuesummary', opts);
return firstRow<{
tenantid: number;
locationid: number | null;
grossrevenue: number;
netrevenue: number;
profit: number;
marginpct: number;
ordercount: number;
deliveredcount: number;
cancelledcount: number;
otifpct: number;
avgordervalue: number;
prev_grossrevenue: number;
prev_ordercount: number;
tenantname: string;
overallrevenue: number;
locationrevenue: Array<{
locationid: number;
locationname: string;
revenue: number;
}>;
}>(res);
}
@@ -803,6 +798,10 @@ export interface StockRequestInput {
productid: number;
qty: number;
status?: string;
locationname?: string;
productname?: string;
productimage?: string;
tenantname?: string;
}
/** POST /products/createstockrequest — Store user requests stock. */
@@ -816,6 +815,7 @@ export async function getStockRequests(opts: {
tenantid: number;
locationid?: number;
status?: string;
date?: string;
pageno?: number;
pagesize?: number;
}): Promise<Row[]> {
@@ -824,6 +824,7 @@ export async function getStockRequests(opts: {
tenantid: opts.tenantid,
locationid: opts.locationid,
status: opts.status ?? '',
date: opts.date,
pageno: opts.pageno ?? 1,
pagesize: opts.pagesize ?? 50,
}),

File diff suppressed because it is too large Load Diff