Skip to content

Commit

Permalink
module2-task1
Browse files Browse the repository at this point in the history
  • Loading branch information
SergeySofronov committed Dec 17, 2024
1 parent 4c5b5b4 commit 19c2aee
Show file tree
Hide file tree
Showing 32 changed files with 1,205 additions and 549 deletions.
Empty file removed mocks/const.js
Empty file.
108 changes: 108 additions & 0 deletions mocks/destination.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
export const DESTINATIONS = [
{
id: 'c7fcf894-e8ef-4347-94cf-8c76aa6c6833',
description: 'Chamonix - a perfect place to stay with a family',
name: 'Chamonix',
pictures: []
},
{
id: '82a3bad6-6498-4989-ae4f-815082508c30',
description: '',
name: 'Venice',
pictures: []
},
{
id: 'ec9110f7-4767-4179-b856-5d8bb23324ec',
description: '',
name: 'Moscow',
pictures: []
},
{
id: '070ea513-2210-42df-bad4-ede76ba22a3e',
description: 'Sochi - is a beautiful city',
name: 'Sochi',
pictures: []
},
{
id: 'e4bc89ed-4df2-40a4-b8d1-21b953502799',
description: 'Berlin - for those who value comfort and coziness',
name: 'Berlin',
pictures: [
{
src: 'https://22.objects.htmlacademy.pro/static/destinations/18.jpg',
description: 'Berlin a perfect place to stay with a family'
},
{
src: 'https://22.objects.htmlacademy.pro/static/destinations/13.jpg',
description: 'Berlin with a beautiful old town'
}
]
},
{
id: '13a37338-b4b1-466e-aafe-092f3c247708',
description: 'Geneva - full of of cozy canteens where you can try the best coffee in the Middle East',
name: 'Geneva',
pictures: [
{
src: 'https://22.objects.htmlacademy.pro/static/destinations/18.jpg',
description: 'Geneva middle-eastern paradise'
},
{
src: 'https://22.objects.htmlacademy.pro/static/destinations/4.jpg',
description: 'Geneva a true asian pearl'
},
{
src: 'https://22.objects.htmlacademy.pro/static/destinations/8.jpg',
description: 'Geneva with crowded streets'
}
]
},
{
id: '64a8701c-632e-48ae-9052-353c1a3465df',
description: 'Frankfurt - for those who value comfort and coziness',
name: 'Frankfurt',
pictures: [
{
src: 'https://22.objects.htmlacademy.pro/static/destinations/10.jpg',
description: 'Frankfurt a perfect place to stay with a family'
}
]
},
{
id: 'fdd837e1-fd2d-463c-9a2d-555cf8efa89e',
description: 'Valencia - a true asian pearl',
name: 'Valencia',
pictures: [
{
src: 'https://22.objects.htmlacademy.pro/static/destinations/20.jpg',
description: 'Valencia with an embankment of a mighty river as a centre of attraction'
},
{
src: 'https://22.objects.htmlacademy.pro/static/destinations/15.jpg',
description: 'Valencia for those who value comfort and coziness'
},
{
src: 'https://22.objects.htmlacademy.pro/static/destinations/16.jpg',
description: 'Valencia famous for its crowded street markets with the best street food in Asia'
}
]
},
{
id: 'fed714ef-b342-45dc-8788-633def721433',
description: '',
name: 'Monaco',
pictures: []
},
{
id: '466c2985-2db8-47fa-85e4-0d07cb9e48fe',
description: 'Vien - is a beautiful city',
name: 'Vien',
pictures: [
{
src: 'https://22.objects.htmlacademy.pro/static/destinations/1.jpg',
description: 'Vien a true asian pearl'
}
]
}
];

9 changes: 9 additions & 0 deletions mocks/generate-data.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { mix } from '../src/utils';
import { DESTINATIONS } from './destination';
import { OFFERS } from './offer';
import { POINTS } from './point';

const EVENT_QUANTITY = 5;

export const generateTripData = (quantity = EVENT_QUANTITY) => [mix(POINTS, quantity), OFFERS, DESTINATIONS];

206 changes: 206 additions & 0 deletions mocks/offer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,206 @@
export const OFFERS = [
{
type: 'taxi',
offers: [
{
id: 'df01f087-8af8-4024-ade2-434e572a1939',
title: 'Upgrade to a business class',
price: 187
},
{
id: '0690c5cc-879c-4aa5-80c1-244935547967',
title: 'Choose the radio station',
price: 193
},
{
id: 'bba6b2a4-115c-4470-9e70-bab52e7b6da9',
title: 'Choose temperature',
price: 36
},
{
id: '61a27c8e-492d-4194-8d09-c85e8fbc0ed2',
title: 'Drive quickly, I\'m in a hurry',
price: 133
},
{
id: '428136ce-b310-4e4e-bb3e-e09946178b81',
title: 'Drive slowly',
price: 50
}
]
},
{
type: 'bus',
offers: [
{
id: '3529d1ca-96d4-4530-8cf5-3f3b0f570ed4',
title: 'Infotainment system',
price: 68
},
{
id: '32f9d674-3739-427f-903f-daa3c2cf722b',
title: 'Order meal',
price: 116
},
{
id: '199e8e51-dc14-4795-9638-5f707452da51',
title: 'Choose seats',
price: 134
}
]
},
{
type: 'train',
offers: [
{
id: 'b64cbb73-09c3-4d68-be36-95d4478d344c',
title: 'Book a taxi at the arrival point',
price: 42
},
{
id: 'f7429a41-90e3-448e-af6a-91f77c1d1f49',
title: 'Order a breakfast',
price: 139
},
{
id: '5093df18-a4d0-42f7-b9cd-b6ef378563fa',
title: 'Wake up at a certain time',
price: 69
}
]
},
{
type: 'flight',
offers: [
{
id: '9b77d7bc-4650-465d-98da-c12fe7f3495c',
title: 'Choose meal',
price: 63
},
{
id: '1021812a-82b3-4fb5-a657-51d6b005d366',
title: 'Choose seats',
price: 122
},
{
id: '4dc8e801-b123-489e-816a-1b900e12d270',
title: 'Upgrade to comfort class',
price: 157
},
{
id: '151f488d-e03a-4347-8837-2e7171061983',
title: 'Upgrade to business class',
price: 140
},
{
id: '7511ff9e-227d-4732-9e27-d4cd1b78c220',
title: 'Add luggage',
price: 158
},
{
id: '52cfccc0-c186-4dea-9fe4-b04528650af9',
title: 'Business lounge',
price: 41
}
]
},
{
type: 'check-in',
offers: [
{
id: 'e3dbdc12-23b8-453f-afd1-e0dcb281bf7a',
title: 'Choose the time of check-in',
price: 195
},
{
id: '56b72afa-d7d0-4dab-9d80-e64a2442783e',
title: 'Choose the time of check-out',
price: 155
},
{
id: '73522a17-f05d-49b9-a141-5ebccae6fb24',
title: 'Add breakfast',
price: 107
},
{
id: 'd658acef-46f7-4c88-b7ed-df131ffabe0c',
title: 'Laundry',
price: 183
},
{
id: '4a956f99-a055-4143-969f-b29f2be5da50',
title: 'Order a meal from the restaurant',
price: 101
}
]
},
{
type: 'sightseeing',
offers: []
},
{
type: 'ship',
offers: [
{
id: 'ed0ddafb-1f70-4d26-b212-c40f42b92c4f',
title: 'Choose meal',
price: 146
},
{
id: '35aa9a64-dbfd-4059-bb77-117e839bfcc2',
title: 'Choose seats',
price: 60
},
{
id: '0a72ec19-d026-4a7b-9158-f00431ff883f',
title: 'Upgrade to comfort class',
price: 160
},
{
id: '1ca8aa30-0131-4b9f-956a-b7f90d2bf6a8',
title: 'Upgrade to business class',
price: 57
},
{
id: '00fdf487-91f5-4175-97cc-4b8cf30240a0',
title: 'Add luggage',
price: 81
},
{
id: '6e21cc5e-e5ef-453d-a401-86846f294d02',
title: 'Business lounge',
price: 146
}
]
},
{
type: 'drive',
offers: [
{
id: '50cd2308-6764-4111-9800-4027c4516b90',
title: 'With automatic transmission',
price: 34
},
{
id: 'd82abaa6-4c4e-4bb4-a49d-83e80c37cdd5',
title: 'With air conditioning',
price: 101
}
]
},
{
type: 'restaurant',
offers: [
{
id: '89b4eb84-3d09-475f-814a-879bcf96a900',
title: 'Choose live music',
price: 110
},
{
id: 'd1d46527-003a-43e2-a3c1-714db831a54e',
title: 'Choose VIP area',
price: 33
}
]
}
];
Loading

0 comments on commit 19c2aee

Please sign in to comment.