@kadconsulting/dry
Version:
KAD Reusable Component Library
122 lines • 3.52 kB
JavaScript
function generateMockServiceData(id) {
return {
id,
attributes: {
name: `Service ${id}`,
price: 50,
type: 'Golf',
stripePriceId: `price_${id}`,
stripeProductId: `product_${id}`,
createdAt: '2024-01-01T00:00:00.000Z',
updatedAt: '2024-01-01T00:00:00.000Z',
},
};
}
function generateMockCoachData(id) {
return {
id,
attributes: {
fullName: `Coach ${id}`,
description: 'Experienced golf instructor',
yearsOfExperience: 10,
bookingUrl: `/coaches/${id}`,
headshot: {
data: {
id: id,
attributes: {
name: `Coach ${id} Headshot`,
url: `/images/coach-${id}-headshot.jpg`,
},
},
},
cardImage: {
data: {
id: id,
attributes: {
name: `Coach ${id} Card Image`,
url: `/images/coach-${id}-card.jpg`,
},
},
},
createdAt: '2024-01-01T00:00:00.000Z',
updatedAt: '2024-01-01T00:00:00.000Z',
},
};
}
function generateMockBookingAttributes(id) {
return {
id,
price: 50,
startDateTime: '2024-05-01T10:00:00Z',
endDateTime: '2024-05-01T11:00:00Z',
title: 'Tee Time Booking',
notificationSent: false,
users: {
data: [
{
id: id,
attributes: {
firstName: `User ${id}`,
lastName: 'Smith',
email: `user${id}@example.com`,
},
},
],
},
location: {
data: {
id: id,
attributes: {
title: 'Golf Course',
address: '123 Main St, Anytown USA',
},
},
},
coaches: {
data: [
{
id: id,
attributes: {
fullName: `Coach ${id}`,
description: 'Experienced golf instructor',
yearsOfExperience: 10,
},
},
],
},
service: {
data: {
id: id,
attributes: {
name: 'Tee Time',
price: 50,
},
},
},
createdAt: '2024-01-01T00:00:00.000Z',
updatedAt: '2024-01-01T00:00:00.000Z',
};
}
function generateMockTeeTimes(numTeeTimes) {
const teeTimes = [];
for (let i = 0; i < numTeeTimes; i++) {
const teeTime = {
id: i + 1,
startTime: '2024-05-01T10:00:00Z',
address: '123 Main St, Anytown USA',
service: {
data: generateMockServiceData(i + 1),
},
occupancy: 4,
coach: {
data: generateMockCoachData(i + 1),
},
booking: generateMockBookingAttributes(i + 1),
occupancyLeft: 1,
};
teeTimes.push(teeTime);
}
return teeTimes;
}
export default generateMockTeeTimes;
//# sourceMappingURL=createMockTeeTimeData.js.map