Initial commit: Mana Collection NestJS backend.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
import { UserRole } from '@prisma/client';
|
||||
|
||||
export type AuthUser = {
|
||||
id: string;
|
||||
cellNumber: string;
|
||||
role: UserRole;
|
||||
firstName: string;
|
||||
lastName: string;
|
||||
storeId?: string | null;
|
||||
};
|
||||
|
||||
export function isStoreAdmin(role: UserRole): boolean {
|
||||
return role === UserRole.STORE_ADMIN;
|
||||
}
|
||||
|
||||
export function isSuperAdmin(role: UserRole): boolean {
|
||||
return role === UserRole.SUPER_ADMIN;
|
||||
}
|
||||
|
||||
export function displayName(user: {
|
||||
firstName: string;
|
||||
lastName: string;
|
||||
}): string {
|
||||
return `${user.firstName} ${user.lastName}`.trim();
|
||||
}
|
||||
Reference in New Issue
Block a user