adbcc4b9af
feat: implement conversations API with message retrieval and posting feat: add avatar URL handling for users and update user role definitions feat: create chat system tables in the database with initial seed data fix: update user roles from "sales_user" to "sales" for consistency chore: add middleware for system API route access fixed fuckups on john's side, added a benchmark Made Graphs actualy load from database and realtime data, graphs will update and percentages will be mathematically made, and made realtime added chatcart edits, made graphs glow. added in some little small home feeling fuctions added in a slide show, in login with qoutes from creators because i want to leave a print on it saying we made this shit, we built it brick for brick login page added qoutes some random, and made them shuffle from left to right one dissapears other come in adding shape to the textbox for the qoutes Fixed my chat fuckups when it comes to chats
98 lines
2.7 KiB
TypeScript
98 lines
2.7 KiB
TypeScript
import { User, UserRole } from "@/types"
|
|
|
|
export const users: User[] = [
|
|
{
|
|
id: "u-super",
|
|
name: "Jason Oosthuizen",
|
|
email: "jason@coastalit.com",
|
|
role: "super_admin",
|
|
active: true,
|
|
avatar: "https://ui-avatars.com/api/?name=Jason+Oosthuizen&background=0f172a&color=fff&size=128",
|
|
createdAt: "2025-01-01T08:00:00Z",
|
|
},
|
|
{
|
|
id: "u1",
|
|
name: "Sarah Chen",
|
|
email: "SarahChen@coastit.co.za",
|
|
role: "admin",
|
|
active: true,
|
|
avatar: "https://ui-avatars.com/api/?name=Sarah+Chen&background=1d4ed8&color=fff&size=128",
|
|
createdAt: "2025-01-15T08:00:00Z",
|
|
},
|
|
{
|
|
id: "u2",
|
|
name: "Marcus Johnson",
|
|
email: "marcus@coastalit.com",
|
|
role: "sales",
|
|
active: true,
|
|
avatar: "https://ui-avatars.com/api/?name=Marcus+Johnson&background=2563eb&color=fff&size=128",
|
|
createdAt: "2025-02-01T09:00:00Z",
|
|
},
|
|
{
|
|
id: "u3",
|
|
name: "Emily Rodriguez",
|
|
email: "emily@coastalit.com",
|
|
role: "sales",
|
|
active: true,
|
|
avatar: "https://ui-avatars.com/api/?name=Emily+Rodriguez&background=3b82f6&color=fff&size=128",
|
|
createdAt: "2025-02-15T10:00:00Z",
|
|
},
|
|
{
|
|
id: "u4",
|
|
name: "David Kim",
|
|
email: "david@coastalit.com",
|
|
role: "sales",
|
|
active: true,
|
|
avatar: "https://ui-avatars.com/api/?name=David+Kim&background=60a5fa&color=fff&size=128",
|
|
createdAt: "2025-03-01T08:00:00Z",
|
|
},
|
|
{
|
|
id: "u5",
|
|
name: "Jessica Patel",
|
|
email: "jessica@coastalit.com",
|
|
role: "sales",
|
|
active: false,
|
|
avatar: "https://ui-avatars.com/api/?name=Jessica+Patel&background=93c5fd&color=fff&size=128",
|
|
createdAt: "2025-03-10T09:00:00Z",
|
|
},
|
|
{
|
|
id: "u6",
|
|
name: "Alex Thompson",
|
|
email: "alex@coastalit.com",
|
|
role: "sales",
|
|
active: true,
|
|
avatar: "https://ui-avatars.com/api/?name=Alex+Thompson&background=1d4ed8&color=fff&size=128",
|
|
createdAt: "2025-04-01T08:00:00Z",
|
|
},
|
|
{
|
|
id: "u7",
|
|
name: "Rachel Williams",
|
|
email: "rachel@coastalit.com",
|
|
role: "sales",
|
|
active: true,
|
|
avatar: "https://ui-avatars.com/api/?name=Rachel+Williams&background=2563eb&color=fff&size=128",
|
|
createdAt: "2025-04-15T10:00:00Z",
|
|
},
|
|
{
|
|
id: "u8",
|
|
name: "Tom Nakamura",
|
|
email: "tom@coastalit.com",
|
|
role: "admin",
|
|
active: true,
|
|
avatar: "https://ui-avatars.com/api/?name=Tom+Nakamura&background=3b82f6&color=fff&size=128",
|
|
createdAt: "2025-05-01T09:00:00Z",
|
|
},
|
|
]
|
|
|
|
export function getUserById(id: string): User | undefined {
|
|
return users.find((u) => u.id === id)
|
|
}
|
|
|
|
export function getUsersByRole(role: UserRole): User[] {
|
|
return users.filter((u) => u.role === role)
|
|
}
|
|
|
|
export function getActiveUsers(): User[] {
|
|
return users.filter((u) => u.active)
|
|
}
|