store profile status updated

This commit is contained in:
2026-10-09 16:29:30 +05:30
parent f91044e61a
commit 42cc08a407
4 changed files with 253 additions and 11 deletions

View File

@@ -267,6 +267,29 @@ export const tenantsApi = {
contactno?: string;
email?: string;
}) => api.put<unknown>(`${WEB}/tenants/updateownprofile`, body),
/**
* Open or close a branch for the day.
*
* `isopen: false` with no `closeduntil` means closed until somebody says
* otherwise — the right shape for a power cut nobody can put an end to.
* With a date, the branch reopens on that date BY ITSELF: the server works
* the answer out on read rather than running a job, so nobody has to
* remember.
*
* Reopening clears any date, so a branch switched back on cannot keep a
* stale "reopens on" that would read as still closed.
*
* Separate from the branch's `status`, which is how Nearle decommissions a
* branch. A day off must not look like a shop that shut down.
*/
setStoreOpen: (body: {
tenantid: number;
locationid: number;
isopen: boolean;
/** "YYYY-MM-DD", the first day back. Omitted when reopening. */
closeduntil?: string;
}) => api.put<unknown>(`${WEB}/tenants/storeopen`, body),
};
/**

View File

@@ -233,6 +233,20 @@ export interface TenantLocation {
deliverymins?: number;
cancelsecs?: number;
status: string;
/**
* Whether this branch is trading today.
*
* Separate from `status`, which is whether the branch exists at all —
* setting that to Inactive is how a branch is decommissioned. A shopkeeper
* closing for an afternoon is saying something else, and conflating the two
* would make a day off read as a shop that shut down.
*
* `closeduntil` is the first day back; the server works out on read whether
* that date has passed, so a branch reopens without anybody remembering.
*/
isopen?: boolean;
closeduntil?: string;
}
/* ────────────────────────────────────────────────────────────────────────────