Adds comprehensive mock data repositories and seeding infrastructure
Implements polymorphic data seeding mechanism for initial application setup - Adds Mock repositories for Event, Booking, Customer, and Resource entities - Creates DataSeeder to automatically populate IndexedDB from JSON sources - Enhances index.ts initialization process with data seeding step - Adds mock JSON data files for comprehensive test data Improves offline-first and development testing capabilities
This commit is contained in:
parent
871f5c5682
commit
5648c7c304
11 changed files with 1641 additions and 40 deletions
306
wwwroot/data/mock-bookings.json
Normal file
306
wwwroot/data/mock-bookings.json
Normal file
|
|
@ -0,0 +1,306 @@
|
|||
[
|
||||
{
|
||||
"id": "BOOK001",
|
||||
"customerId": "CUST001",
|
||||
"status": "arrived",
|
||||
"createdAt": "2025-08-05T08:00:00Z",
|
||||
"services": [
|
||||
{
|
||||
"serviceId": "SRV001",
|
||||
"serviceName": "Klipning og styling",
|
||||
"baseDuration": 60,
|
||||
"basePrice": 500,
|
||||
"customPrice": 500,
|
||||
"resourceId": "EMP001"
|
||||
}
|
||||
],
|
||||
"totalPrice": 500,
|
||||
"notes": "Kunde ønsker lidt kortere"
|
||||
},
|
||||
{
|
||||
"id": "BOOK002",
|
||||
"customerId": "CUST002",
|
||||
"status": "paid",
|
||||
"createdAt": "2025-08-05T09:00:00Z",
|
||||
"services": [
|
||||
{
|
||||
"serviceId": "SRV002",
|
||||
"serviceName": "Hårvask",
|
||||
"baseDuration": 30,
|
||||
"basePrice": 100,
|
||||
"customPrice": 100,
|
||||
"resourceId": "STUDENT001"
|
||||
},
|
||||
{
|
||||
"serviceId": "SRV003",
|
||||
"serviceName": "Bundfarve",
|
||||
"baseDuration": 90,
|
||||
"basePrice": 800,
|
||||
"customPrice": 800,
|
||||
"resourceId": "EMP001"
|
||||
}
|
||||
],
|
||||
"totalPrice": 900,
|
||||
"notes": "Split booking: Elev laver hårvask, master laver farve"
|
||||
},
|
||||
{
|
||||
"id": "BOOK003",
|
||||
"customerId": "CUST003",
|
||||
"status": "created",
|
||||
"createdAt": "2025-08-05T07:00:00Z",
|
||||
"services": [
|
||||
{
|
||||
"serviceId": "SRV004A",
|
||||
"serviceName": "Bryllupsfrisure - Del 1",
|
||||
"baseDuration": 60,
|
||||
"basePrice": 750,
|
||||
"customPrice": 750,
|
||||
"resourceId": "EMP001"
|
||||
},
|
||||
{
|
||||
"serviceId": "SRV004B",
|
||||
"serviceName": "Bryllupsfrisure - Del 2",
|
||||
"baseDuration": 60,
|
||||
"basePrice": 750,
|
||||
"customPrice": 750,
|
||||
"resourceId": "EMP002"
|
||||
}
|
||||
],
|
||||
"totalPrice": 1500,
|
||||
"notes": "Equal-split: To master stylister arbejder sammen"
|
||||
},
|
||||
{
|
||||
"id": "BOOK004",
|
||||
"customerId": "CUST004",
|
||||
"status": "arrived",
|
||||
"createdAt": "2025-08-05T10:00:00Z",
|
||||
"services": [
|
||||
{
|
||||
"serviceId": "SRV005",
|
||||
"serviceName": "Herreklipning",
|
||||
"baseDuration": 30,
|
||||
"basePrice": 350,
|
||||
"customPrice": 350,
|
||||
"resourceId": "EMP003"
|
||||
}
|
||||
],
|
||||
"totalPrice": 350
|
||||
},
|
||||
{
|
||||
"id": "BOOK005",
|
||||
"customerId": "CUST005",
|
||||
"status": "paid",
|
||||
"createdAt": "2025-08-05T11:00:00Z",
|
||||
"services": [
|
||||
{
|
||||
"serviceId": "SRV006",
|
||||
"serviceName": "Balayage langt hår",
|
||||
"baseDuration": 120,
|
||||
"basePrice": 1200,
|
||||
"customPrice": 1200,
|
||||
"resourceId": "EMP002"
|
||||
}
|
||||
],
|
||||
"totalPrice": 1200,
|
||||
"notes": "Kunde ønsker naturlig blond tone"
|
||||
},
|
||||
{
|
||||
"id": "BOOK006",
|
||||
"customerId": "CUST006",
|
||||
"status": "created",
|
||||
"createdAt": "2025-08-06T08:00:00Z",
|
||||
"services": [
|
||||
{
|
||||
"serviceId": "SRV007",
|
||||
"serviceName": "Permanent",
|
||||
"baseDuration": 90,
|
||||
"basePrice": 900,
|
||||
"customPrice": 900,
|
||||
"resourceId": "EMP004"
|
||||
}
|
||||
],
|
||||
"totalPrice": 900
|
||||
},
|
||||
{
|
||||
"id": "BOOK007",
|
||||
"customerId": "CUST007",
|
||||
"status": "arrived",
|
||||
"createdAt": "2025-08-06T09:00:00Z",
|
||||
"services": [
|
||||
{
|
||||
"serviceId": "SRV008",
|
||||
"serviceName": "Highlights",
|
||||
"baseDuration": 90,
|
||||
"basePrice": 850,
|
||||
"customPrice": 850,
|
||||
"resourceId": "EMP001"
|
||||
},
|
||||
{
|
||||
"serviceId": "SRV009",
|
||||
"serviceName": "Styling",
|
||||
"baseDuration": 30,
|
||||
"basePrice": 200,
|
||||
"customPrice": 200,
|
||||
"resourceId": "EMP001"
|
||||
}
|
||||
],
|
||||
"totalPrice": 1050,
|
||||
"notes": "Highlights + styling samme stylist"
|
||||
},
|
||||
{
|
||||
"id": "BOOK008",
|
||||
"customerId": "CUST008",
|
||||
"status": "paid",
|
||||
"createdAt": "2025-08-06T10:00:00Z",
|
||||
"services": [
|
||||
{
|
||||
"serviceId": "SRV010",
|
||||
"serviceName": "Klipning",
|
||||
"baseDuration": 45,
|
||||
"basePrice": 450,
|
||||
"customPrice": 450,
|
||||
"resourceId": "EMP004"
|
||||
}
|
||||
],
|
||||
"totalPrice": 450
|
||||
},
|
||||
{
|
||||
"id": "BOOK009",
|
||||
"customerId": "CUST001",
|
||||
"status": "created",
|
||||
"createdAt": "2025-08-07T08:00:00Z",
|
||||
"services": [
|
||||
{
|
||||
"serviceId": "SRV011",
|
||||
"serviceName": "Farve behandling",
|
||||
"baseDuration": 120,
|
||||
"basePrice": 950,
|
||||
"customPrice": 950,
|
||||
"resourceId": "EMP002"
|
||||
}
|
||||
],
|
||||
"totalPrice": 950
|
||||
},
|
||||
{
|
||||
"id": "BOOK010",
|
||||
"customerId": "CUST002",
|
||||
"status": "arrived",
|
||||
"createdAt": "2025-08-07T09:00:00Z",
|
||||
"services": [
|
||||
{
|
||||
"serviceId": "SRV012",
|
||||
"serviceName": "Skæg trimning",
|
||||
"baseDuration": 20,
|
||||
"basePrice": 200,
|
||||
"customPrice": 200,
|
||||
"resourceId": "EMP003"
|
||||
}
|
||||
],
|
||||
"totalPrice": 200
|
||||
},
|
||||
{
|
||||
"id": "BOOK011",
|
||||
"customerId": "CUST003",
|
||||
"status": "paid",
|
||||
"createdAt": "2025-08-07T10:00:00Z",
|
||||
"services": [
|
||||
{
|
||||
"serviceId": "SRV002",
|
||||
"serviceName": "Hårvask",
|
||||
"baseDuration": 30,
|
||||
"basePrice": 100,
|
||||
"customPrice": 100,
|
||||
"resourceId": "STUDENT002"
|
||||
},
|
||||
{
|
||||
"serviceId": "SRV013",
|
||||
"serviceName": "Ombré",
|
||||
"baseDuration": 100,
|
||||
"basePrice": 1100,
|
||||
"customPrice": 1100,
|
||||
"resourceId": "EMP002"
|
||||
}
|
||||
],
|
||||
"totalPrice": 1200,
|
||||
"notes": "Split booking: Student hårvask, master ombré"
|
||||
},
|
||||
{
|
||||
"id": "BOOK012",
|
||||
"customerId": "CUST004",
|
||||
"status": "created",
|
||||
"createdAt": "2025-08-08T08:00:00Z",
|
||||
"services": [
|
||||
{
|
||||
"serviceId": "SRV014",
|
||||
"serviceName": "Føntørring",
|
||||
"baseDuration": 30,
|
||||
"basePrice": 250,
|
||||
"customPrice": 250,
|
||||
"resourceId": "STUDENT001"
|
||||
}
|
||||
],
|
||||
"totalPrice": 250
|
||||
},
|
||||
{
|
||||
"id": "BOOK013",
|
||||
"customerId": "CUST005",
|
||||
"status": "arrived",
|
||||
"createdAt": "2025-08-08T09:00:00Z",
|
||||
"services": [
|
||||
{
|
||||
"serviceId": "SRV015",
|
||||
"serviceName": "Opsætning",
|
||||
"baseDuration": 60,
|
||||
"basePrice": 700,
|
||||
"customPrice": 700,
|
||||
"resourceId": "EMP004"
|
||||
}
|
||||
],
|
||||
"totalPrice": 700,
|
||||
"notes": "Fest opsætning"
|
||||
},
|
||||
{
|
||||
"id": "BOOK014",
|
||||
"customerId": "CUST006",
|
||||
"status": "created",
|
||||
"createdAt": "2025-08-09T08:00:00Z",
|
||||
"services": [
|
||||
{
|
||||
"serviceId": "SRV016A",
|
||||
"serviceName": "Ekstensions - Del 1",
|
||||
"baseDuration": 90,
|
||||
"basePrice": 1250,
|
||||
"customPrice": 1250,
|
||||
"resourceId": "EMP001"
|
||||
},
|
||||
{
|
||||
"serviceId": "SRV016B",
|
||||
"serviceName": "Ekstensions - Del 2",
|
||||
"baseDuration": 90,
|
||||
"basePrice": 1250,
|
||||
"customPrice": 1250,
|
||||
"resourceId": "EMP004"
|
||||
}
|
||||
],
|
||||
"totalPrice": 2500,
|
||||
"notes": "Equal-split: To stylister arbejder sammen om extensions"
|
||||
},
|
||||
{
|
||||
"id": "BOOK015",
|
||||
"customerId": "CUST007",
|
||||
"status": "noshow",
|
||||
"createdAt": "2025-08-09T09:00:00Z",
|
||||
"services": [
|
||||
{
|
||||
"serviceId": "SRV001",
|
||||
"serviceName": "Klipning og styling",
|
||||
"baseDuration": 60,
|
||||
"basePrice": 500,
|
||||
"customPrice": 500,
|
||||
"resourceId": "EMP002"
|
||||
}
|
||||
],
|
||||
"totalPrice": 500,
|
||||
"notes": "Kunde mødte ikke op"
|
||||
}
|
||||
]
|
||||
49
wwwroot/data/mock-customers.json
Normal file
49
wwwroot/data/mock-customers.json
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
[
|
||||
{
|
||||
"id": "CUST001",
|
||||
"name": "Sofie Nielsen",
|
||||
"phone": "+45 23 45 67 89",
|
||||
"email": "sofie.nielsen@email.dk"
|
||||
},
|
||||
{
|
||||
"id": "CUST002",
|
||||
"name": "Emma Andersen",
|
||||
"phone": "+45 31 24 56 78",
|
||||
"email": "emma.andersen@email.dk"
|
||||
},
|
||||
{
|
||||
"id": "CUST003",
|
||||
"name": "Freja Christensen",
|
||||
"phone": "+45 42 67 89 12",
|
||||
"email": "freja.christensen@email.dk"
|
||||
},
|
||||
{
|
||||
"id": "CUST004",
|
||||
"name": "Laura Pedersen",
|
||||
"phone": "+45 51 98 76 54"
|
||||
},
|
||||
{
|
||||
"id": "CUST005",
|
||||
"name": "Ida Larsen",
|
||||
"phone": "+45 29 87 65 43",
|
||||
"email": "ida.larsen@email.dk"
|
||||
},
|
||||
{
|
||||
"id": "CUST006",
|
||||
"name": "Caroline Jensen",
|
||||
"phone": "+45 38 76 54 32",
|
||||
"email": "caroline.jensen@email.dk"
|
||||
},
|
||||
{
|
||||
"id": "CUST007",
|
||||
"name": "Mathilde Hansen",
|
||||
"phone": "+45 47 65 43 21",
|
||||
"email": "mathilde.hansen@email.dk"
|
||||
},
|
||||
{
|
||||
"id": "CUST008",
|
||||
"name": "Olivia Sørensen",
|
||||
"phone": "+45 56 54 32 10",
|
||||
"email": "olivia.sorensen@email.dk"
|
||||
}
|
||||
]
|
||||
80
wwwroot/data/mock-resources.json
Normal file
80
wwwroot/data/mock-resources.json
Normal file
|
|
@ -0,0 +1,80 @@
|
|||
[
|
||||
{
|
||||
"id": "EMP001",
|
||||
"name": "camilla.jensen",
|
||||
"displayName": "Camilla Jensen",
|
||||
"type": "person",
|
||||
"avatarUrl": "/avatars/camilla.jpg",
|
||||
"color": "#9c27b0",
|
||||
"isActive": true,
|
||||
"metadata": {
|
||||
"role": "master stylist",
|
||||
"specialties": ["balayage", "color", "bridal"]
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "EMP002",
|
||||
"name": "isabella.hansen",
|
||||
"displayName": "Isabella Hansen",
|
||||
"type": "person",
|
||||
"avatarUrl": "/avatars/isabella.jpg",
|
||||
"color": "#e91e63",
|
||||
"isActive": true,
|
||||
"metadata": {
|
||||
"role": "master stylist",
|
||||
"specialties": ["highlights", "ombre", "styling"]
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "EMP003",
|
||||
"name": "alexander.nielsen",
|
||||
"displayName": "Alexander Nielsen",
|
||||
"type": "person",
|
||||
"avatarUrl": "/avatars/alexander.jpg",
|
||||
"color": "#3f51b5",
|
||||
"isActive": true,
|
||||
"metadata": {
|
||||
"role": "master stylist",
|
||||
"specialties": ["men's cuts", "beard", "fade"]
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "EMP004",
|
||||
"name": "viktor.andersen",
|
||||
"displayName": "Viktor Andersen",
|
||||
"type": "person",
|
||||
"avatarUrl": "/avatars/viktor.jpg",
|
||||
"color": "#009688",
|
||||
"isActive": true,
|
||||
"metadata": {
|
||||
"role": "stylist",
|
||||
"specialties": ["cuts", "styling", "perms"]
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "STUDENT001",
|
||||
"name": "line.pedersen",
|
||||
"displayName": "Line Pedersen (Elev)",
|
||||
"type": "person",
|
||||
"avatarUrl": "/avatars/line.jpg",
|
||||
"color": "#8bc34a",
|
||||
"isActive": true,
|
||||
"metadata": {
|
||||
"role": "student",
|
||||
"specialties": ["wash", "blow-dry", "basic cuts"]
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "STUDENT002",
|
||||
"name": "mads.larsen",
|
||||
"displayName": "Mads Larsen (Elev)",
|
||||
"type": "person",
|
||||
"avatarUrl": "/avatars/mads.jpg",
|
||||
"color": "#ff9800",
|
||||
"isActive": true,
|
||||
"metadata": {
|
||||
"role": "student",
|
||||
"specialties": ["wash", "styling assistance"]
|
||||
}
|
||||
}
|
||||
]
|
||||
Loading…
Add table
Add a link
Reference in a new issue