Initial commit

This commit is contained in:
2026-08-24 20:35:18 +05:30
commit 1dc582ba07
85 changed files with 21081 additions and 0 deletions

69
src/demo/accounts.ts Normal file
View File

@@ -0,0 +1,69 @@
/**
* The three demo accounts.
*
* Split from `src/demo/index.ts` so they can be reached only through the lazily
* loaded demo panel — a static import would put these session objects in the
* production bundle, and a build that ships fake accounts is a build that
* eventually ships one to a customer.
*
* DEV ONLY.
*/
import type { SessionUser } from '@/auth/roles';
export interface DemoAccount {
session: SessionUser;
/** What this role is for, in one line, shown on the button. */
blurb: string;
/** The real login this stands in for, so it is obvious what it maps to. */
standsFor: string;
}
/**
* One per role, matching how `resolveRole` actually decides:
* `issuperadmin` first, then roleid 1 or 3, then everything else.
*/
export const DEMO_ACCOUNTS: Record<string, DemoAccount> = {
'nearle-admin': {
session: {
userid: 9001,
role: 'nearle-admin',
name: 'Suriya Kumar',
email: 'suriya@superadmin.com',
roleid: 0,
tenantid: 0,
locationid: 0,
issuperadmin: true,
},
blurb: 'Onboard tenants and branches, browse the global catalogue, see every store.',
standsFor: 'issuperadmin = true',
},
'store-admin': {
session: {
userid: 9002,
role: 'store-admin',
name: 'Rmart Operations',
email: 'rmart@gmail.com',
roleid: 1,
tenantid: 1135,
locationid: 1,
issuperadmin: false,
},
blurb: 'One merchant group — its branches, catalogue, reports and tills.',
standsFor: 'roleid 1',
},
'store-manager': {
session: {
userid: 9003,
role: 'store-manager',
name: 'R Mart User',
email: 'rmartuser@gmail.com',
roleid: 5,
tenantid: 1135,
locationid: 1,
issuperadmin: false,
},
blurb: 'A single store — its orders, stock, customers and counter sales.',
standsFor: 'any other roleid',
},
};