Add Login and Dashboard
This commit is contained in:
2
src/types/auth/index.ts
Normal file
2
src/types/auth/index.ts
Normal file
@@ -0,0 +1,2 @@
|
||||
export * from "./user";
|
||||
export * from "./upstream";
|
||||
19
src/types/auth/upstream.ts
Normal file
19
src/types/auth/upstream.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
export type UpstreamLoginUser = {
|
||||
userId: string;
|
||||
tenantId: string;
|
||||
email?: string;
|
||||
tenantKey?: string;
|
||||
};
|
||||
|
||||
export type UpstreamLoginResponse = {
|
||||
user: UpstreamLoginUser;
|
||||
access_token?: string;
|
||||
token_type?: string;
|
||||
expires_at?: string;
|
||||
};
|
||||
|
||||
export type UpstreamRefreshResponse = {
|
||||
access_token?: string;
|
||||
token_type?: string;
|
||||
expires_at?: string;
|
||||
};
|
||||
18
src/types/auth/user.ts
Normal file
18
src/types/auth/user.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
export type UserDebug = {
|
||||
alg: string | undefined;
|
||||
hasExp: boolean;
|
||||
hasNbf: boolean;
|
||||
iss: unknown;
|
||||
aud: unknown;
|
||||
sid: unknown;
|
||||
jti: unknown;
|
||||
};
|
||||
|
||||
export type UserSession = {
|
||||
id: string;
|
||||
email?: string;
|
||||
tenantId?: string;
|
||||
tenantKey?: string;
|
||||
roles: string[];
|
||||
_dbg?: UserDebug;
|
||||
};
|
||||
1
src/types/crm/index.ts
Normal file
1
src/types/crm/index.ts
Normal file
@@ -0,0 +1 @@
|
||||
export * from "./loyalty";
|
||||
13
src/types/crm/loyalty.ts
Normal file
13
src/types/crm/loyalty.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
export type RedeemRequest = {
|
||||
transactionId: string;
|
||||
contact: { phone: string };
|
||||
metadata?: Record<string, unknown>;
|
||||
};
|
||||
|
||||
export type RedeemResponse = {
|
||||
balance?: number;
|
||||
voucherCode?: string;
|
||||
ledgerEntryId?: string;
|
||||
redeemed?: boolean;
|
||||
message?: string;
|
||||
};
|
||||
Reference in New Issue
Block a user