Skip to content

Commit

Permalink
feat: add end time and station in order
Browse files Browse the repository at this point in the history
  • Loading branch information
katyastan committed Aug 25, 2024
1 parent 7d43932 commit 6964238
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/app/api/ordersService/orders.data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export const ordersDummyData: Order[] = [
schedule: {
segments: [
{
time: ['2021-08-11T08:00:00', '2021-08-11T08:30:00'],
time: ['2021-09-11T07:00:00', '2021-09-11T08:30:00'],
price: {
adult: 1000,
child: 500,
Expand All @@ -72,7 +72,7 @@ export const ordersDummyData: Order[] = [
occupiedSeats: [33],
},
{
time: ['2021-08-11T08:30:00', '2021-08-11T09:00:00'],
time: ['2021-09-11T08:30:00', '2021-09-11T10:00:00'],
price: {
adult: 1000,
child: 500,
Expand Down
Empty file removed src/app/orders/components/.gitkeep
Empty file.
16 changes: 13 additions & 3 deletions src/app/orders/components/order/order.component.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,23 @@
<hr />
<div class="wrapper">
<p>Order ID: {{ order.id }}</p>
<p>
Start Time: <b>{{ order.schedule.segments[0].time[0] | date: 'MMMM dd HH:mm' }}</b>
</p>
<p>
Start Station:
@if (stationsService.findStationById(order.path[0]); as startStation) {
<b>{{ startStation.city }}</b>
}
</p>
<p>
Start Time: <b>{{ order.schedule.segments[0].time[0] | date: 'MMMM dd HH:mm' }}</b>
</p>
<p>
End Station:
@if (stationsService.findStationById(order.path[order.path.length - 1]); as endStation) {
<b>{{ endStation.city }}</b>
}
</p>
<p>
End Time:
<b>{{ order.schedule.segments[order.schedule.segments.length - 1].time[1] | date: 'MMMM dd HH:mm' }}</b>
</p>
</div>
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<div>
orders-list works!
<div>
@for (order of orders; track order.id) {
<app-order [order]="order"></app-order>
Expand Down
2 changes: 0 additions & 2 deletions src/app/orders/pages/orders/orders.component.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
<p>orders works!</p>

<div class="wrapper">
@let orders = ordersService.allOrders();
@if (orders.length) {
Expand Down

0 comments on commit 6964238

Please sign in to comment.