Files
2026-08-17 23:45:32 +05:30

1371 lines
43 KiB
JavaScript

/**
* Bundled demo dataset — the local starting contents of every collection.
*
* These records are plain frontend constants. They are copied into the local
* store the first time a collection is read (see store.js) and from then on the
* user's own creates/edits take over, persisted in localStorage.
*
* Field names follow the app's data model (src/api/local/schemas.json), so the
* existing pages render this data with no changes. Any entity not listed here
* simply starts empty, which is the empty state the UI already handles.
*
* Dates are computed relative to today so "upcoming", "this week" and overdue
* filters stay meaningful however long after this file was written the app runs.
*/
const DAY_MS = 24 * 60 * 60 * 1000;
const today = new Date();
/** ISO calendar date (YYYY-MM-DD) `offset` days from today. */
const day = (offset) => new Date(today.getTime() + offset * DAY_MS).toISOString().slice(0, 10);
/* ------------------------------------------------------------ organisations */
const enterprises = [
{
id: 'ent-compass',
enterprise_name: 'Compass Group North America',
enterprise_code: 'CGNA',
enterprise_number: 'ENT-0001',
primary_contact_name: 'Dana Whitfield',
primary_contact_email: 'dana.whitfield@example.com',
headquarters_address: '2400 Yorkmont Rd, Charlotte, NC 28217',
brand_family: ['Bon Appétit', 'Eurest', 'Chartwells'],
is_active: true,
},
{
id: 'ent-legendary',
enterprise_name: 'Legendary Hospitality Group',
enterprise_code: 'LHG',
enterprise_number: 'ENT-0002',
primary_contact_name: 'Marcus Reed',
primary_contact_email: 'marcus.reed@example.com',
headquarters_address: '55 Mission St, San Francisco, CA 94105',
brand_family: ['Legendary Events'],
is_active: true,
},
];
const sectors = [
{
id: 'sec-ba-west',
sector_name: 'Bon Appétit — West',
sector_code: 'BA-WEST',
sector_number: 'SEC-1001',
sector_type: 'Food Service',
region: 'West',
region_code: 'W',
division: 'Corporate Dining',
division_code: 'CD',
district: 'Bay Area',
district_code: 'BA',
account_manager: 'Priya Raman',
account_manager_department: 'Operations',
parent_enterprise_id: 'ent-compass',
parent_enterprise_name: 'Compass Group North America',
main_contact_city: 'San Francisco',
main_contact_state: 'CA',
approved_vendors: ['ven-legendary', 'ven-goldengate'],
is_active: true,
},
{
id: 'sec-eurest-campus',
sector_name: 'Eurest — Campus Services',
sector_code: 'EU-CAMP',
sector_number: 'SEC-1002',
sector_type: 'Education',
region: 'West',
region_code: 'W',
division: 'Campus Dining',
division_code: 'CMP',
district: 'Northern California',
district_code: 'NC',
account_manager: 'Alan Ruiz',
account_manager_department: 'Operations',
parent_enterprise_id: 'ent-compass',
parent_enterprise_name: 'Compass Group North America',
main_contact_city: 'Palo Alto',
main_contact_state: 'CA',
approved_vendors: ['ven-legendary'],
is_active: true,
},
];
const partners = [
{
id: 'prt-northbay',
partner_name: 'Northbay Tech Campus',
partner_number: 'PRT-2001',
partner_type: 'Corporate',
sector_id: 'sec-ba-west',
sector_name: 'Bon Appétit — West',
primary_contact_name: 'Erin Castillo',
primary_contact_email: 'erin.castillo@example.com',
primary_contact_phone: '(415) 555-0142',
billing_address: '1 Northbay Way, San Francisco, CA 94107',
payment_terms: 'Net 30',
cost_centers: ['CC-1010', 'CC-1020'],
allowed_vendors: ['ven-legendary', 'ven-goldengate'],
is_active: true,
sites: [
{
site_name: 'Northbay HQ — Main Café',
address: '1 Northbay Way',
city: 'San Francisco',
state: 'CA',
zip_code: '94107',
site_manager: 'Tom Delgado',
site_manager_email: 'tom.delgado@example.com',
},
],
},
{
id: 'prt-stanford-dining',
partner_name: 'Peninsula University Dining',
partner_number: 'PRT-2002',
partner_type: 'Education',
sector_id: 'sec-eurest-campus',
sector_name: 'Eurest — Campus Services',
primary_contact_name: 'Grace Lin',
primary_contact_email: 'grace.lin@example.com',
primary_contact_phone: '(650) 555-0188',
billing_address: '450 Campus Dr, Palo Alto, CA 94305',
payment_terms: 'Net 45',
cost_centers: ['CC-3300'],
allowed_vendors: ['ven-legendary'],
is_active: true,
sites: [
{
site_name: 'Peninsula Commons',
address: '450 Campus Dr',
city: 'Palo Alto',
state: 'CA',
zip_code: '94305',
site_manager: 'Nina Ortiz',
site_manager_email: 'nina.ortiz@example.com',
},
],
},
{
id: 'prt-bayview-arena',
partner_name: 'Bayview Arena',
partner_number: 'PRT-2003',
partner_type: 'Sports & Entertainment',
sector_id: 'sec-ba-west',
sector_name: 'Bon Appétit — West',
primary_contact_name: 'Devon Marsh',
primary_contact_email: 'devon.marsh@example.com',
primary_contact_phone: '(510) 555-0119',
billing_address: '900 Harbor Blvd, Oakland, CA 94607',
payment_terms: 'Net 15',
cost_centers: ['CC-9001'],
allowed_vendors: ['ven-goldengate', 'ven-summit'],
is_active: true,
sites: [],
},
];
const sites = [
{
id: 'site-northbay-main',
site_name: 'Northbay HQ — Main Café',
partner_id: 'prt-northbay',
partner_name: 'Northbay Tech Campus',
address: '1 Northbay Way',
city: 'San Francisco',
state: 'CA',
zip_code: '94107',
site_manager: 'Tom Delgado',
site_manager_email: 'tom.delgado@example.com',
site_manager_phone: '(415) 555-0143',
is_active: true,
},
{
id: 'site-northbay-annex',
site_name: 'Northbay Annex — Conference Center',
partner_id: 'prt-northbay',
partner_name: 'Northbay Tech Campus',
address: '18 Brannan St',
city: 'San Francisco',
state: 'CA',
zip_code: '94107',
site_manager: 'Alicia Gomez',
site_manager_email: 'alicia.gomez@example.com',
site_manager_phone: '(415) 555-0166',
is_active: true,
},
{
id: 'site-peninsula-commons',
site_name: 'Peninsula Commons',
partner_id: 'prt-stanford-dining',
partner_name: 'Peninsula University Dining',
address: '450 Campus Dr',
city: 'Palo Alto',
state: 'CA',
zip_code: '94305',
site_manager: 'Nina Ortiz',
site_manager_email: 'nina.ortiz@example.com',
site_manager_phone: '(650) 555-0190',
is_active: true,
},
{
id: 'site-bayview-arena',
site_name: 'Bayview Arena — Club Level',
partner_id: 'prt-bayview-arena',
partner_name: 'Bayview Arena',
address: '900 Harbor Blvd',
city: 'Oakland',
state: 'CA',
zip_code: '94607',
site_manager: 'Devon Marsh',
site_manager_email: 'devon.marsh@example.com',
site_manager_phone: '(510) 555-0120',
is_active: true,
},
];
const businesses = [
{
id: 'biz-northbay',
business_name: 'Northbay Tech Campus',
contact_name: 'Erin Castillo',
email: 'erin.castillo@example.com',
phone: '(415) 555-0142',
rate_group: 'Enterprise',
sector: 'Bon Appétit',
area: 'Bay Area',
address: '1 Northbay Way',
city: 'San Francisco',
status: 'Active',
is_active: true,
po_required: true,
total_hubs: 2,
total_members: 6,
active_members: 5,
last_order_date: day(-3),
hub_building: 'Northbay HQ',
hubs: [
{
hub_name: 'Northbay HQ',
address: '1 Northbay Way',
city: 'San Francisco',
state: 'CA',
zip_code: '94107',
manager_name: 'Tom Delgado',
manager_email: 'tom.delgado@example.com',
is_active: true,
},
{
hub_name: 'Northbay Annex',
address: '18 Brannan St',
city: 'San Francisco',
state: 'CA',
zip_code: '94107',
manager_name: 'Alicia Gomez',
manager_email: 'alicia.gomez@example.com',
is_active: true,
},
],
},
{
id: 'biz-peninsula',
business_name: 'Peninsula University Dining',
contact_name: 'Grace Lin',
email: 'grace.lin@example.com',
phone: '(650) 555-0188',
rate_group: 'Standard',
sector: 'Eurest',
area: 'Northern California',
address: '450 Campus Dr',
city: 'Palo Alto',
status: 'Active',
is_active: true,
po_required: false,
total_hubs: 1,
total_members: 4,
active_members: 4,
last_order_date: day(-9),
hub_building: 'Peninsula Commons',
hubs: [
{
hub_name: 'Peninsula Commons',
address: '450 Campus Dr',
city: 'Palo Alto',
state: 'CA',
zip_code: '94305',
manager_name: 'Nina Ortiz',
manager_email: 'nina.ortiz@example.com',
is_active: true,
},
],
},
{
id: 'biz-bayview',
business_name: 'Bayview Arena',
contact_name: 'Devon Marsh',
email: 'devon.marsh@example.com',
phone: '(510) 555-0119',
rate_group: 'Premium',
sector: 'Other',
area: 'Bay Area',
address: '900 Harbor Blvd',
city: 'Oakland',
status: 'Active',
is_active: true,
po_required: true,
total_hubs: 1,
total_members: 3,
active_members: 3,
last_order_date: day(-1),
hub_building: 'Bayview Arena',
hubs: [
{
hub_name: 'Bayview Arena',
address: '900 Harbor Blvd',
city: 'Oakland',
state: 'CA',
zip_code: '94607',
manager_name: 'Devon Marsh',
manager_email: 'devon.marsh@example.com',
is_active: true,
},
],
},
];
const vendors = [
{
id: 'ven-legendary',
legal_name: 'Legendary Event Staffing LLC',
doing_business_as: 'Legendary Staffing',
vendor_number: 'VEN-4001',
primary_contact_name: 'Sasha Kim',
primary_contact_email: 'sasha.kim@example.com',
primary_contact_phone: '(415) 555-0201',
business_type: 'LLC',
approval_status: 'approved',
approved_by: 'procurement@krow.local',
approved_date: day(-120),
region: 'Bay Area',
state: 'CA',
city: 'San Francisco',
service_address: '340 Bryant St, San Francisco, CA 94107',
billing_address: '340 Bryant St, San Francisco, CA 94107',
service_specialty: 'Corporate dining and events',
platform_type: 'Building platform (KROW)',
coverage_regions: ['Bay Area', 'Northern California'],
eligible_roles: ['Server', 'Bartender', 'Prep Cook', 'Dishwasher', 'Event Captain'],
vendor_fee_percentage: 18,
workforce_count: 240,
insurance_expiry: day(210),
tax_id: '**-***4412',
is_active: true,
},
{
id: 'ven-goldengate',
legal_name: 'Golden Gate Hospitality Partners Inc.',
doing_business_as: 'GG Hospitality',
vendor_number: 'VEN-4002',
primary_contact_name: 'Ray Nolan',
primary_contact_email: 'ray.nolan@example.com',
primary_contact_phone: '(510) 555-0233',
business_type: 'Corporation',
approval_status: 'approved',
approved_by: 'procurement@krow.local',
approved_date: day(-260),
region: 'Bay Area',
state: 'CA',
city: 'Oakland',
service_address: '1200 Broadway, Oakland, CA 94612',
billing_address: '1200 Broadway, Oakland, CA 94612',
service_specialty: 'Arena concessions and high-volume service',
platform_type: 'Partial Tech',
coverage_regions: ['Bay Area'],
eligible_roles: ['Concessions Attendant', 'Bartender', 'Cashier', 'Supervisor'],
vendor_fee_percentage: 21,
workforce_count: 410,
insurance_expiry: day(48),
tax_id: '**-***9087',
is_active: true,
},
{
id: 'ven-summit',
legal_name: 'Summit Workforce Solutions LLC',
doing_business_as: 'Summit Workforce',
vendor_number: 'VEN-4003',
primary_contact_name: 'Elena Petrov',
primary_contact_email: 'elena.petrov@example.com',
primary_contact_phone: '(408) 555-0277',
business_type: 'LLC',
approval_status: 'pending',
region: 'Northern California',
state: 'CA',
city: 'San Jose',
service_address: '99 Almaden Blvd, San Jose, CA 95113',
service_specialty: 'Facilities and janitorial',
platform_type: 'Traditional',
coverage_regions: ['Northern California', 'Central Valley'],
eligible_roles: ['Janitor', 'Facilities Tech', 'Porter'],
vendor_fee_percentage: 16,
workforce_count: 85,
insurance_expiry: day(-12),
tax_id: '**-***2233',
is_active: true,
},
];
/* -------------------------------------------------------------------- people */
const STAFF_SEED = [
['stf-001', 'Marcus Johnson', 'Event Captain', 'Legendary Staffing', 'ven-legendary', 34, 4.9, 98, 'Skilled', 'Full Time', 'Northbay HQ'],
['stf-002', 'Amara Osei', 'Bartender', 'Legendary Staffing', 'ven-legendary', 29, 4.8, 96, 'Skilled', 'Part Time', 'Northbay HQ'],
['stf-003', 'Diego Fernandez', 'Server', 'Legendary Staffing', 'ven-legendary', 24, 4.6, 92, 'Cross-Trained', 'On call', 'Northbay Annex'],
['stf-004', 'Priya Raman', 'Prep Cook', 'Legendary Staffing', 'ven-legendary', 26, 4.7, 94, 'Skilled', 'Full Time', 'Peninsula Commons'],
['stf-005', 'Kelsey Moore', 'Server', 'Legendary Staffing', 'ven-legendary', 23, 4.4, 88, 'Beginner', 'Weekends', 'Peninsula Commons'],
['stf-006', 'Tobias Lang', 'Dishwasher', 'Legendary Staffing', 'ven-legendary', 21, 4.2, 85, 'Beginner', 'Part Time', 'Peninsula Commons'],
['stf-007', 'Nia Bennett', 'Concessions Attendant', 'GG Hospitality', 'ven-goldengate', 22, 4.5, 90, 'Cross-Trained', 'Weekends', 'Bayview Arena'],
['stf-008', 'Hugo Ramirez', 'Bartender', 'GG Hospitality', 'ven-goldengate', 28, 4.7, 93, 'Skilled', 'On call', 'Bayview Arena'],
['stf-009', 'Sofia Duarte', 'Supervisor', 'GG Hospitality', 'ven-goldengate', 33, 4.8, 97, 'Skilled', 'Full Time', 'Bayview Arena'],
['stf-010', 'Ethan Clarke', 'Cashier', 'GG Hospitality', 'ven-goldengate', 20, 4.1, 82, 'Beginner', 'Seasonal', 'Bayview Arena'],
['stf-011', 'Leila Haddad', 'Facilities Tech', 'Summit Workforce', 'ven-summit', 25, 4.5, 91, 'Skilled', 'Full Time', 'Northbay HQ'],
['stf-012', 'Owen Bradley', 'Porter', 'Summit Workforce', 'ven-summit', 19, 4.0, 79, 'Beginner', 'Part Time', 'Northbay Annex'],
];
const staff = STAFF_SEED.map(
(
[id, name, position, vendorName, vendorId, rate, rating, reliability, profileType, employment, hub],
index
) => ({
id,
employee_name: name,
initial: name
.split(' ')
.map((part) => part[0])
.join(''),
email: `${name.toLowerCase().replace(/[^a-z]+/g, '.')}@example.com`,
phone: `(415) 555-0${(300 + index).toString().padStart(3, '0')}`,
contact_number: `(415) 555-0${(300 + index).toString().padStart(3, '0')}`,
position,
department: position === 'Facilities Tech' || position === 'Porter' ? 'Logistics' : 'Operations',
vendor_id: vendorId,
vendor_name: vendorName,
hub_location: hub,
city: hub.startsWith('Bayview') ? 'Oakland' : hub.startsWith('Peninsula') ? 'Palo Alto' : 'San Francisco',
pay_rate: rate,
pay_rate_type: 'Hourly',
pay_rate_overtime: Math.round(rate * 1.5 * 100) / 100,
pay_rate_double_time: rate * 2,
rating,
reliability_score: reliability,
shift_coverage_percentage: reliability,
profile_type: profileType,
employment_type: employment,
english: 'Fluent',
background_check_status: 'cleared',
background_check_date: day(-90 - index * 3),
total_shifts: 40 + index * 7,
no_show_count: index % 5 === 0 ? 1 : 0,
cancellation_count: index % 4 === 0 ? 1 : 0,
certifications:
position === 'Bartender'
? [{ name: 'RBS Alcohol Server', issuer: 'CA ABC', issued_date: day(-200), expiry_date: day(160) }]
: position === 'Prep Cook'
? [{ name: 'ServSafe Food Handler', issuer: 'NRA', issued_date: day(-320), expiry_date: day(40) }]
: [],
})
);
const workerAvailability = staff.slice(0, 8).map((member, index) => ({
id: `wav-${member.id}`,
staff_id: member.id,
staff_name: member.employee_name,
availability_status: index % 3 === 0 ? 'CONFIRMED_AVAILABLE' : index % 3 === 1 ? 'UNKNOWN' : 'BLOCKED',
available_dates: [day(1), day(2), day(4), day(6)],
blocked_dates: index % 3 === 2 ? [day(3), day(5)] : [],
last_shift_date: day(-(index + 1)),
days_since_last_shift: index + 1,
desired_hours_this_period: 32,
scheduled_hours_this_period: 12 + index * 2,
total_shifts_this_period: 2 + (index % 4),
utilization_percentage: Math.min(100, 40 + index * 6),
acceptance_rate: 78 + index,
need_work_index: Math.max(0, 80 - index * 6),
predicted_availability_score: Math.max(20, 92 - index * 5),
}));
/* -------------------------------------------------------------------- orders */
/** Roles on a shift, with the derived money fields the UI reads. */
const role = (name, count, start, end, costPerHour, assigned = 0) => {
const [sh, sm] = start.split(':').map(Number);
const [eh, em] = end.split(':').map(Number);
const hours = Math.max(0, eh + em / 60 - (sh + sm / 60));
return {
role: name,
count,
assigned,
department: 'Operations',
start_time: start,
end_time: end,
hours,
break_minutes: hours > 6 ? 30 : 0,
cost_per_hour: costPerHour,
total_value: Math.round(hours * count * costPerHour * 100) / 100,
uniform: 'Black tie, white shirt',
};
};
const shiftTotal = (shifts) =>
shifts.reduce(
(sum, shift) =>
sum + (shift.roles || []).reduce((roleSum, r) => roleSum + (r.total_value || 0), 0),
0
);
const requestedTotal = (shifts) =>
shifts.reduce(
(sum, shift) => sum + (shift.roles || []).reduce((roleSum, r) => roleSum + (r.count || 0), 0),
0
);
function order({
id,
name,
date,
status,
business,
businessId,
hub,
location,
address,
vendorId,
vendorName,
clientName,
clientEmail,
shifts,
assigned = [],
isRapid = false,
notes,
po,
}) {
return {
id,
event_name: name,
date,
status,
business_id: businessId,
business_name: business,
hub,
event_location: location,
client_name: clientName,
client_email: clientEmail,
client_phone: '(415) 555-0142',
vendor_id: vendorId,
vendor_name: vendorName,
contract_type: 'W2',
is_rapid: isRapid,
is_recurring: false,
is_multi_day: false,
conflict_detection_enabled: true,
buffer_time_before: 30,
buffer_time_after: 30,
po_reference: po,
notes,
requested: requestedTotal(shifts),
total: shiftTotal(shifts),
shifts: shifts.map((shift) => ({ location, location_address: address, ...shift })),
assigned_staff: assigned,
};
}
const staffRef = (id, roleName) => {
const member = staff.find((s) => s.id === id);
return {
staff_id: id,
staff_name: member?.employee_name || 'Unknown',
email: member?.email,
role: roleName || member?.position,
};
};
const events = [
order({
id: 'evt-1000',
name: 'Daily Café Service — Lunch Peak',
date: day(0),
status: 'Active',
business: 'Northbay Tech Campus',
businessId: 'biz-northbay',
hub: 'Northbay HQ',
location: 'Northbay HQ — Main Café',
address: '1 Northbay Way, San Francisco, CA 94107',
vendorId: 'ven-legendary',
vendorName: 'Legendary Staffing',
clientName: 'Erin Castillo',
clientEmail: 'erin.castillo@example.com',
po: 'PO-77160',
notes: 'Running today. Standing lunch coverage for the main café.',
shifts: [
{
shift_name: 'Lunch',
shift_contact: 'Tom Delgado',
roles: [role('Server', 3, '10:30', '15:00', 32, 3), role('Prep Cook', 1, '08:00', '15:00', 34, 1), role('Dishwasher', 1, '10:00', '15:30', 28, 1)],
},
],
assigned: [
staffRef('stf-003', 'Server'),
staffRef('stf-005', 'Server'),
staffRef('stf-002', 'Server'),
staffRef('stf-004', 'Prep Cook'),
staffRef('stf-006', 'Dishwasher'),
],
}),
order({
id: 'evt-1001',
name: 'Q3 All-Hands Reception',
date: day(2),
status: 'Partial Staffed',
business: 'Northbay Tech Campus',
businessId: 'biz-northbay',
hub: 'Northbay HQ',
location: 'Northbay HQ — Main Café',
address: '1 Northbay Way, San Francisco, CA 94107',
vendorId: 'ven-legendary',
vendorName: 'Legendary Staffing',
clientName: 'Erin Castillo',
clientEmail: 'erin.castillo@example.com',
po: 'PO-77120',
notes: 'Passed appetizers plus two bars. Client requests same captain as last quarter.',
shifts: [
{
shift_name: 'Evening Reception',
shift_contact: 'Tom Delgado',
roles: [role('Event Captain', 1, '15:00', '22:00', 46, 1), role('Server', 6, '16:00', '22:00', 32, 2), role('Bartender', 2, '16:00', '22:00', 38, 1)],
},
],
assigned: [staffRef('stf-001', 'Event Captain'), staffRef('stf-003', 'Server'), staffRef('stf-005', 'Server'), staffRef('stf-002', 'Bartender')],
}),
order({
id: 'evt-1002',
name: 'Board Dinner — Executive Floor',
date: day(5),
status: 'Fully Staffed',
business: 'Northbay Tech Campus',
businessId: 'biz-northbay',
hub: 'Northbay Annex',
location: 'Northbay Annex — Conference Center',
address: '18 Brannan St, San Francisco, CA 94107',
vendorId: 'ven-legendary',
vendorName: 'Legendary Staffing',
clientName: 'Alicia Gomez',
clientEmail: 'alicia.gomez@example.com',
po: 'PO-77145',
notes: 'Plated four-course service for 24 guests.',
shifts: [
{
shift_name: 'Dinner Service',
shift_contact: 'Alicia Gomez',
roles: [role('Server', 3, '16:30', '21:30', 32, 3), role('Prep Cook', 1, '14:00', '21:00', 30, 1)],
},
],
assigned: [staffRef('stf-003', 'Server'), staffRef('stf-005', 'Server'), staffRef('stf-006', 'Server'), staffRef('stf-004', 'Prep Cook')],
}),
order({
id: 'evt-1003',
name: 'Season Opener — Club Level Concessions',
date: day(1),
status: 'Partial Staffed',
business: 'Bayview Arena',
businessId: 'biz-bayview',
hub: 'Bayview Arena',
location: 'Bayview Arena — Club Level',
address: '900 Harbor Blvd, Oakland, CA 94607',
vendorId: 'ven-goldengate',
vendorName: 'GG Hospitality',
clientName: 'Devon Marsh',
clientEmail: 'devon.marsh@example.com',
po: 'PO-90014',
isRapid: true,
notes: 'Doors at 17:30. Two additional attendants still needed for the upper concourse.',
shifts: [
{
shift_name: 'Gates + Game',
shift_contact: 'Sofia Duarte',
roles: [role('Supervisor', 1, '15:00', '23:00', 44, 1), role('Concessions Attendant', 8, '16:00', '23:00', 26, 2), role('Bartender', 3, '16:00', '23:00', 36, 1)],
},
],
assigned: [staffRef('stf-009', 'Supervisor'), staffRef('stf-007', 'Concessions Attendant'), staffRef('stf-010', 'Concessions Attendant'), staffRef('stf-008', 'Bartender')],
}),
order({
id: 'evt-1004',
name: 'Freshman Move-In Dining Surge',
date: day(9),
status: 'Pending',
business: 'Peninsula University Dining',
businessId: 'biz-peninsula',
hub: 'Peninsula Commons',
location: 'Peninsula Commons',
address: '450 Campus Dr, Palo Alto, CA 94305',
vendorId: 'ven-legendary',
vendorName: 'Legendary Staffing',
clientName: 'Grace Lin',
clientEmail: 'grace.lin@example.com',
notes: 'Three meal periods across the day. Awaiting final headcount from the university.',
shifts: [
{
shift_name: 'Breakfast + Lunch',
shift_contact: 'Nina Ortiz',
roles: [role('Server', 5, '06:30', '14:30', 28), role('Dishwasher', 2, '07:00', '15:00', 24)],
},
{
shift_name: 'Dinner',
shift_contact: 'Nina Ortiz',
roles: [role('Server', 4, '15:30', '21:30', 28), role('Prep Cook', 2, '14:00', '21:00', 30)],
},
],
}),
order({
id: 'evt-1005',
name: 'Vendor Fair — Facilities Support',
date: day(14),
status: 'Draft',
business: 'Northbay Tech Campus',
businessId: 'biz-northbay',
hub: 'Northbay HQ',
location: 'Northbay HQ — Main Café',
address: '1 Northbay Way, San Francisco, CA 94107',
vendorId: 'ven-summit',
vendorName: 'Summit Workforce',
clientName: 'Erin Castillo',
clientEmail: 'erin.castillo@example.com',
notes: 'Draft — pending budget approval.',
shifts: [
{
shift_name: 'Setup + Teardown',
shift_contact: 'Leila Haddad',
roles: [role('Facilities Tech', 2, '07:00', '15:00', 27), role('Porter', 3, '08:00', '16:00', 22)],
},
],
}),
order({
id: 'evt-1006',
name: 'Investor Breakfast Briefing',
date: day(-2),
status: 'Completed',
business: 'Northbay Tech Campus',
businessId: 'biz-northbay',
hub: 'Northbay Annex',
location: 'Northbay Annex — Conference Center',
address: '18 Brannan St, San Francisco, CA 94107',
vendorId: 'ven-legendary',
vendorName: 'Legendary Staffing',
clientName: 'Alicia Gomez',
clientEmail: 'alicia.gomez@example.com',
po: 'PO-77098',
shifts: [
{
shift_name: 'Morning Service',
shift_contact: 'Alicia Gomez',
roles: [role('Server', 2, '06:00', '11:00', 32, 2), role('Event Captain', 1, '05:30', '11:00', 46, 1)],
},
],
assigned: [staffRef('stf-003', 'Server'), staffRef('stf-005', 'Server'), staffRef('stf-001', 'Event Captain')],
}),
order({
id: 'evt-1007',
name: 'Playoff Night — Premium Bars',
date: day(-6),
status: 'Completed',
business: 'Bayview Arena',
businessId: 'biz-bayview',
hub: 'Bayview Arena',
location: 'Bayview Arena — Club Level',
address: '900 Harbor Blvd, Oakland, CA 94607',
vendorId: 'ven-goldengate',
vendorName: 'GG Hospitality',
clientName: 'Devon Marsh',
clientEmail: 'devon.marsh@example.com',
po: 'PO-89977',
shifts: [
{
shift_name: 'Game Night',
shift_contact: 'Sofia Duarte',
roles: [role('Bartender', 4, '16:00', '23:30', 36, 4), role('Cashier', 2, '16:00', '23:30', 24, 2)],
},
],
assigned: [staffRef('stf-008', 'Bartender'), staffRef('stf-002', 'Bartender'), staffRef('stf-007', 'Bartender'), staffRef('stf-009', 'Bartender'), staffRef('stf-010', 'Cashier')],
}),
order({
id: 'evt-1008',
name: 'Holiday Party (Canceled)',
date: day(-15),
status: 'Canceled',
business: 'Peninsula University Dining',
businessId: 'biz-peninsula',
hub: 'Peninsula Commons',
location: 'Peninsula Commons',
address: '450 Campus Dr, Palo Alto, CA 94305',
vendorId: 'ven-legendary',
vendorName: 'Legendary Staffing',
clientName: 'Grace Lin',
clientEmail: 'grace.lin@example.com',
notes: 'Canceled by client — venue conflict.',
shifts: [
{
shift_name: 'Evening',
shift_contact: 'Nina Ortiz',
roles: [role('Server', 6, '17:00', '23:00', 30)],
},
],
}),
];
const assignments = [
{
id: 'asg-001',
assignment_number: 'ASG-5001',
order_id: 'evt-1001',
order_number: 'evt-1001',
workforce_id: 'stf-001',
workforce_name: 'Marcus Johnson',
vendor_id: 'ven-legendary',
vendor_name: 'Legendary Staffing',
partner_id: 'prt-northbay',
role: 'Event Captain',
department: 'Operations',
assignment_status: 'Confirmed',
scheduled_start: `${day(2)}T15:00:00`,
scheduled_end: `${day(2)}T22:00:00`,
pay_rate: 34,
bill_rate: 46,
total_pay: 238,
total_bill: 322,
},
{
id: 'asg-002',
assignment_number: 'ASG-5002',
order_id: 'evt-1003',
order_number: 'evt-1003',
workforce_id: 'stf-009',
workforce_name: 'Sofia Duarte',
vendor_id: 'ven-goldengate',
vendor_name: 'GG Hospitality',
partner_id: 'prt-bayview-arena',
role: 'Supervisor',
department: 'Operations',
assignment_status: 'Checked In',
scheduled_start: `${day(1)}T15:00:00`,
scheduled_end: `${day(1)}T23:00:00`,
pay_rate: 33,
bill_rate: 44,
total_pay: 264,
total_bill: 352,
},
{
id: 'asg-003',
assignment_number: 'ASG-5003',
order_id: 'evt-1006',
order_number: 'evt-1006',
workforce_id: 'stf-003',
workforce_name: 'Diego Fernandez',
vendor_id: 'ven-legendary',
vendor_name: 'Legendary Staffing',
partner_id: 'prt-northbay',
role: 'Server',
department: 'Operations',
assignment_status: 'Completed',
scheduled_start: `${day(-2)}T06:00:00`,
scheduled_end: `${day(-2)}T11:00:00`,
actual_start: `${day(-2)}T05:55:00`,
actual_end: `${day(-2)}T11:10:00`,
pay_rate: 24,
bill_rate: 32,
total_pay: 126,
total_bill: 168,
},
];
/* ------------------------------------------------------------------- finance */
const invoices = [
{
id: 'inv-001',
invoice_number: 'INV-2401',
business_name: 'Northbay Tech Campus',
event_id: 'evt-1006',
event_name: 'Investor Breakfast Briefing',
event_date: day(-2),
hub: 'Northbay Annex',
vendor_id: 'ven-legendary',
vendor_name: 'Legendary Staffing',
manager_name: 'Alicia Gomez',
status: 'Pending Review',
issue_date: day(-1),
due_date: day(29),
subtotal: 573,
tax_rate: 8.5,
tax_amount: 48.71,
other_charges: 0,
amount: 621.71,
po_reference: 'PO-77098',
cost_center: 'CC-1010',
is_auto_generated: true,
roles: [
{
role_name: 'Server',
role_subtotal: 320,
staff_entries: [
{ staff_name: 'Diego Fernandez', hours: 5, rate: 32, subtotal: 160 },
{ staff_name: 'Kelsey Moore', hours: 5, rate: 32, subtotal: 160 },
],
},
{
role_name: 'Event Captain',
role_subtotal: 253,
staff_entries: [{ staff_name: 'Marcus Johnson', hours: 5.5, rate: 46, subtotal: 253 }],
},
],
},
{
id: 'inv-002',
invoice_number: 'INV-2402',
business_name: 'Bayview Arena',
event_id: 'evt-1007',
event_name: 'Playoff Night — Premium Bars',
event_date: day(-6),
hub: 'Bayview Arena',
vendor_id: 'ven-goldengate',
vendor_name: 'GG Hospitality',
manager_name: 'Devon Marsh',
status: 'Approved',
issue_date: day(-5),
due_date: day(10),
subtotal: 1440,
tax_rate: 8.5,
tax_amount: 122.4,
other_charges: 0,
amount: 1562.4,
po_reference: 'PO-89977',
cost_center: 'CC-9001',
approved_by: 'procurement@krow.local',
approved_date: day(-3),
roles: [
{
role_name: 'Bartender',
role_subtotal: 1080,
staff_entries: [
{ staff_name: 'Hugo Ramirez', hours: 7.5, rate: 36, subtotal: 270 },
{ staff_name: 'Amara Osei', hours: 7.5, rate: 36, subtotal: 270 },
{ staff_name: 'Nia Bennett', hours: 7.5, rate: 36, subtotal: 270 },
{ staff_name: 'Sofia Duarte', hours: 7.5, rate: 36, subtotal: 270 },
],
},
{
role_name: 'Cashier',
role_subtotal: 360,
staff_entries: [{ staff_name: 'Ethan Clarke', hours: 15, rate: 24, subtotal: 360 }],
},
],
},
{
id: 'inv-003',
invoice_number: 'INV-2398',
business_name: 'Peninsula University Dining',
event_name: 'Summer Session Dining',
event_date: day(-40),
hub: 'Peninsula Commons',
vendor_id: 'ven-legendary',
vendor_name: 'Legendary Staffing',
manager_name: 'Nina Ortiz',
status: 'Paid',
issue_date: day(-38),
due_date: day(-8),
paid_date: day(-11),
payment_method: 'ACH',
payment_reference: 'ACH-55210',
subtotal: 2260,
tax_rate: 8.5,
tax_amount: 192.1,
amount: 2452.1,
cost_center: 'CC-3300',
},
{
id: 'inv-004',
invoice_number: 'INV-2390',
business_name: 'Northbay Tech Campus',
event_name: 'Summer Offsite Catering',
event_date: day(-62),
hub: 'Northbay HQ',
vendor_id: 'ven-legendary',
vendor_name: 'Legendary Staffing',
manager_name: 'Tom Delgado',
status: 'Overdue',
issue_date: day(-58),
due_date: day(-28),
subtotal: 1875,
tax_rate: 8.5,
tax_amount: 159.38,
amount: 2034.38,
cost_center: 'CC-1020',
notes: 'Second reminder sent to accounts payable.',
},
{
id: 'inv-005',
invoice_number: 'INV-2405',
business_name: 'Bayview Arena',
event_name: 'Concert Series — Night 2',
event_date: day(-9),
hub: 'Bayview Arena',
vendor_id: 'ven-goldengate',
vendor_name: 'GG Hospitality',
manager_name: 'Devon Marsh',
status: 'Disputed',
issue_date: day(-7),
due_date: day(8),
subtotal: 3120,
tax_rate: 8.5,
tax_amount: 265.2,
amount: 3385.2,
dispute_reason: 'Hours mismatch',
dispute_details: 'Client reports two attendants left before the end of the shift.',
disputed_by: 'devon.marsh@example.com',
disputed_date: day(-4),
cost_center: 'CC-9001',
},
];
const saleRecords = invoices.slice(0, 3).map((invoice, index) => ({
id: `sale-00${index + 1}`,
invoice_id: invoice.id,
invoice_number: invoice.invoice_number,
client_name: invoice.business_name,
event_name: invoice.event_name,
event_date: invoice.event_date,
vendor_id: invoice.vendor_id,
vendor_name: invoice.vendor_name,
gross_amount: invoice.amount,
vendor_fee_percentage: 18,
vendor_fee_amount: Math.round(invoice.amount * 0.18 * 100) / 100,
net_amount: Math.round(invoice.amount * 0.82 * 100) / 100,
amount_paid: invoice.status === 'Paid' ? invoice.amount : 0,
balance_due: invoice.status === 'Paid' ? 0 : invoice.amount,
payment_status: invoice.status === 'Paid' ? 'Paid' : 'Unpaid',
payment_history:
invoice.status === 'Paid'
? [{ payment_date: invoice.paid_date, amount: invoice.amount, method: 'ACH', reference: 'ACH-55210', recorded_by: 'finance@krow.local' }]
: [],
}));
const payrollRecords = [
{
id: 'pay-001',
pay_period_start: day(-14),
pay_period_end: day(-1),
vendor_id: 'ven-legendary',
vendor_name: 'Legendary Staffing',
payroll_status: 'Approved',
total_regular_pay: 8420,
total_overtime_pay: 640,
total_gross_pay: 9060,
entries: staff.slice(0, 4).map((member) => ({
staff_id: member.id,
employee_name: member.employee_name,
email: member.email,
regular_hours: 64,
overtime_hours: 4,
overtime_rate: member.pay_rate_overtime,
double_time_hours: 0,
gross_pay: Math.round((64 * member.pay_rate + 4 * member.pay_rate_overtime) * 100) / 100,
status: 'approved',
})),
},
{
id: 'pay-002',
pay_period_start: day(-28),
pay_period_end: day(-15),
vendor_id: 'ven-goldengate',
vendor_name: 'GG Hospitality',
payroll_status: 'Paid',
total_regular_pay: 7150,
total_overtime_pay: 410,
total_gross_pay: 7560,
entries: staff.slice(6, 10).map((member) => ({
staff_id: member.id,
employee_name: member.employee_name,
email: member.email,
regular_hours: 58,
overtime_hours: 2,
overtime_rate: member.pay_rate_overtime,
double_time_hours: 0,
gross_pay: Math.round((58 * member.pay_rate + 2 * member.pay_rate_overtime) * 100) / 100,
status: 'approved',
})),
},
];
const RATE_SEED = [
['Server', 'Event Staff', 24, 32],
['Bartender', 'Bartending', 29, 38],
['Event Captain', 'Management', 34, 46],
['Prep Cook', 'Kitchen and Culinary', 26, 34],
['Dishwasher', 'Kitchen and Culinary', 21, 28],
['Concessions Attendant', 'Concessions', 22, 29],
];
const vendorRates = RATE_SEED.map(([roleName, category, wage, clientRate], index) => ({
id: `rate-00${index + 1}`,
vendor_id: 'ven-legendary',
vendor_name: 'Legendary Staffing',
rate_book_name: 'Bay Area Standard 2025',
rate_book_type: 'default',
category,
role_name: roleName,
region: 'Bay Area',
shift_type: 'regular',
employee_wage: wage,
client_rate: clientRate,
overtime_rate: Math.round(clientRate * 1.5 * 100) / 100,
double_time_rate: clientRate * 2,
markup_percentage: Math.round(((clientRate - wage) / wage) * 1000) / 10,
vendor_fee_percentage: 18,
minimum_wage_compliance: true,
is_active: true,
is_approved_rate: true,
approved_by_procurement: 'procurement@krow.local',
approved_date: day(-60),
valid_from: day(-60),
valid_until: day(300),
negotiation_allowed: true,
is_editable_by_vendor: false,
}));
/* --------------------------------------------------------- teams and tasks */
const teams = [
{
id: 'team-ops-west',
team_name: 'Bay Area Operations',
owner_id: 'local-user',
owner_name: 'KROW Operator',
owner_role: 'admin',
full_name: 'KROW Operator',
email: 'operator@krow.local',
phone: '(415) 555-0100',
city: 'San Francisco',
zip_code: '94107',
departments: ['Operations', 'Scheduling'],
total_members: 3,
active_members: 3,
total_hubs: 2,
},
{
id: 'team-arena',
team_name: 'Arena Event Crew',
owner_id: 'local-user',
owner_name: 'KROW Operator',
owner_role: 'admin',
full_name: 'KROW Operator',
email: 'operator@krow.local',
city: 'Oakland',
zip_code: '94607',
departments: ['Concessions'],
total_members: 2,
active_members: 2,
total_hubs: 1,
},
];
const teamMembers = [
{ id: 'tm-001', team_id: 'team-ops-west', member_name: 'Tom Delgado', email: 'tom.delgado@example.com', role: 'manager', title: 'Site Manager', department: 'Operations', hub: 'Northbay HQ', is_active: true },
{ id: 'tm-002', team_id: 'team-ops-west', member_name: 'Alicia Gomez', email: 'alicia.gomez@example.com', role: 'manager', title: 'Conference Services Lead', department: 'Operations', hub: 'Northbay Annex', is_active: true },
{ id: 'tm-003', team_id: 'team-ops-west', member_name: 'Priya Raman', email: 'priya.raman@example.com', role: 'member', title: 'Scheduler', department: 'Scheduling', hub: 'Northbay HQ', is_active: true },
{ id: 'tm-004', team_id: 'team-arena', member_name: 'Sofia Duarte', email: 'sofia.duarte@example.com', role: 'manager', title: 'Floor Supervisor', department: 'Concessions', hub: 'Bayview Arena', is_active: true },
{ id: 'tm-005', team_id: 'team-arena', member_name: 'Devon Marsh', email: 'devon.marsh@example.com', role: 'admin', title: 'Venue Director', department: 'Concessions', hub: 'Bayview Arena', is_active: true },
];
const TASK_SEED = [
['task-001', 'Confirm final headcount for Move-In surge', 'team-ops-west', 'in_progress', 'high', 2, 60, ['tm-003']],
['task-002', 'Fill 2 open concessions slots for Season Opener', 'team-arena', 'in_progress', 'high', 1, 40, ['tm-004']],
['task-003', 'Collect updated COI from Summit Workforce', 'team-ops-west', 'pending', 'high', 3, 0, ['tm-001']],
['task-004', 'Resolve INV-2405 hours dispute', 'team-arena', 'on_hold', 'normal', 4, 25, ['tm-005']],
['task-005', 'Approve Legendary payroll for last period', 'team-ops-west', 'completed', 'normal', -1, 100, ['tm-002']],
['task-006', 'Refresh Bay Area rate book for Q4', 'team-ops-west', 'pending', 'low', 12, 0, ['tm-003']],
];
const tasks = TASK_SEED.map(([id, name, teamId, status, priority, dueOffset, progress, memberIds], index) => ({
id,
task_name: name,
team_id: teamId,
status,
priority,
progress,
order_index: index,
due_date: day(dueOffset),
owner_id: 'local-user',
owner_name: 'KROW Operator',
description: '',
comment_count: index % 3,
attachment_count: 0,
assigned_members: memberIds.map((memberId) => {
const member = teamMembers.find((m) => m.id === memberId);
return { member_id: memberId, member_name: member?.member_name || 'Member', avatar_url: '' };
}),
}));
/* --------------------------------------------------------------- activity */
const announcements = [
{
id: 'ann-001',
team_id: 'team-ops-west',
title: 'New uniform standard starts next month',
body: 'All front-of-house staff move to the black-tie standard on the 1st. Vendors: please confirm inventory by the end of this week.',
audience: ['Operations', 'Scheduling'],
status: 'active',
priority: 'normal',
publish_date: day(-2),
expire_date: day(20),
created_by_name: 'KROW Operator',
pin_to_top: true,
view_count: 34,
},
{
id: 'ann-002',
team_id: 'team-arena',
title: 'Season Opener — call time moved to 15:00',
body: 'Gates open 30 minutes earlier than planned. Supervisors, please brief your sections at 15:15.',
audience: ['Concessions'],
status: 'active',
priority: 'urgent',
publish_date: day(-1),
expire_date: day(2),
created_by_name: 'Sofia Duarte',
pin_to_top: false,
view_count: 12,
},
];
const activityLog = [
{
id: 'act-001',
title: 'Order partially staffed',
description: 'Q3 All-Hands Reception is 4 of 9 filled.',
activity_type: 'staff_assigned',
user_id: 'local-user',
related_entity_type: 'event',
related_entity_id: 'evt-1001',
icon_type: 'user',
icon_color: 'blue',
is_read: false,
action_label: 'View order',
action_link: '/Events',
},
{
id: 'act-002',
title: 'Invoice disputed',
description: 'Bayview Arena disputed INV-2405 (hours mismatch).',
activity_type: 'invoice_created',
user_id: 'local-user',
related_entity_type: 'invoice',
related_entity_id: 'inv-005',
icon_type: 'alert',
icon_color: 'red',
is_read: false,
action_label: 'Review invoice',
action_link: '/Invoices',
},
{
id: 'act-003',
title: 'RAPID order created',
description: 'Season Opener — Club Level Concessions needs 12 staff tomorrow.',
activity_type: 'event_created',
user_id: 'local-user',
related_entity_type: 'event',
related_entity_id: 'evt-1003',
icon_type: 'calendar',
icon_color: 'yellow',
is_read: false,
action_label: 'Open order',
action_link: '/Events',
},
{
id: 'act-004',
title: 'Invoice paid',
description: 'INV-2398 was paid by Peninsula University Dining.',
activity_type: 'invoice_paid',
user_id: 'local-user',
related_entity_type: 'invoice',
related_entity_id: 'inv-003',
icon_type: 'invoice',
icon_color: 'green',
is_read: true,
},
{
id: 'act-005',
title: 'Order completed',
description: 'Investor Breakfast Briefing closed out with full coverage.',
activity_type: 'event_updated',
user_id: 'local-user',
related_entity_type: 'event',
related_entity_id: 'evt-1006',
icon_type: 'check',
icon_color: 'green',
is_read: true,
},
];
/**
* Teammates for the User Management page. The local operator (see local/auth.js)
* is added to this collection on first load and is always row one.
*/
const users = [
{
id: 'usr-client-erin',
full_name: 'Erin Castillo',
email: 'erin.castillo@example.com',
role: 'user',
user_role: 'client',
company_name: 'Northbay Tech Campus',
phone: '(415) 555-0142',
is_active: true,
},
{
id: 'usr-vendor-sasha',
full_name: 'Sasha Kim',
email: 'sasha.kim@example.com',
role: 'user',
user_role: 'vendor',
company_name: 'Legendary Staffing',
phone: '(415) 555-0201',
vendor_id: 'ven-legendary',
is_active: true,
},
];
/* ------------------------------------------------------------------ exports */
export const seedData = {
User: users,
Enterprise: enterprises,
Sector: sectors,
Partner: partners,
Site: sites,
Business: businesses,
Vendor: vendors,
Staff: staff,
WorkerAvailability: workerAvailability,
Event: events,
Assignment: assignments,
Invoice: invoices,
SaleRecord: saleRecords,
PayrollRecord: payrollRecords,
VendorRate: vendorRates,
Team: teams,
TeamMember: teamMembers,
Task: tasks,
Announcement: announcements,
ActivityLog: activityLog,
};
export default seedData;