-
Notifications
You must be signed in to change notification settings - Fork 273
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding pagination on orders-api when we getting all orders (#152)
* Adding pagination on orders-api when we getting all orders * fixing the unit tests * fixing the fetchAll not returning all items * fixing checkout consumer issue: still some issues * Orders page in the dashboard app - order-api: added new type OrdersDto
- Loading branch information
Showing
20 changed files
with
301 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
...end/services/order-api/src/main/java/org/jurabek/restaurant/order/api/dtos/OrdersDto.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package org.jurabek.restaurant.order.api.dtos; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Data; | ||
import java.util.List; | ||
|
||
@Data | ||
@AllArgsConstructor | ||
public class OrdersDto { | ||
private List<OrderDto> orders; | ||
private Long total; | ||
private Integer offset; | ||
private Integer limit; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
src/backend/services/web.admin/dashboard-app/src/app/(dashboard)/orders/order-table-row.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { Button } from "@/components/ui/button"; | ||
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuTrigger } from "@/components/ui/dropdown-menu"; | ||
import { TableCell, TableRow } from "@/components/ui/table"; | ||
import { calculateTotalPrice, Order } from "@/lib/types/order"; | ||
import { MoreHorizontal } from "lucide-react"; | ||
|
||
export function OrderRow({ order }: { order: Order }) { | ||
return ( | ||
<TableRow> | ||
<TableCell className="font-medium">{order.orderedDate.toString()}</TableCell> | ||
<TableCell className="font-medium">{calculateTotalPrice(order)}</TableCell> | ||
<TableCell className="font-medium">{order.cartId}</TableCell> | ||
<TableCell className="font-medium">{order.checkoutId}</TableCell> | ||
<TableCell> | ||
<DropdownMenu> | ||
<DropdownMenuTrigger asChild> | ||
<Button aria-haspopup="true" size="icon" variant="ghost"> | ||
<MoreHorizontal className="h-4 w-4" /> | ||
<span className="sr-only">Toggle menu</span> | ||
</Button> | ||
</DropdownMenuTrigger> | ||
<DropdownMenuContent align="end"> | ||
<DropdownMenuLabel>Actions</DropdownMenuLabel> | ||
<DropdownMenuItem>Edit</DropdownMenuItem> | ||
<DropdownMenuItem> | ||
<form action={() => {}}> | ||
<button type="submit">Delete</button> | ||
</form> | ||
</DropdownMenuItem> | ||
</DropdownMenuContent> | ||
</DropdownMenu> | ||
</TableCell> | ||
</TableRow> | ||
); | ||
} |
Oops, something went wrong.