-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5491a0c
commit acb484d
Showing
11 changed files
with
392 additions
and
36 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
using System.ComponentModel.DataAnnotations; | ||
|
||
namespace eShop.Ordering.API.Models; | ||
|
||
public class BasketItem | ||
{ | ||
[Required] | ||
public int ProductId { get; init; } | ||
|
||
[Required] | ||
public required string ProductName { get; init; } | ||
|
||
[Required, Range(0, double.MaxValue)] | ||
public decimal UnitPrice { get; init; } | ||
|
||
[Required] | ||
[Range(0, 10000)] | ||
public int Quantity { get; init; } | ||
} |
42 changes: 42 additions & 0 deletions
42
labs/5-Add-Checkout/end/Ordering.API/Models/CreateOrderRequest.cs
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,42 @@ | ||
using System.ComponentModel.DataAnnotations; | ||
|
||
namespace eShop.Ordering.API.Models; | ||
|
||
public class CreateOrderRequest | ||
{ | ||
[Required] | ||
public required string UserName { get; set; } | ||
|
||
[Required] | ||
public required string City { get; set; } | ||
|
||
[Required] | ||
public required string Street { get; set; } | ||
|
||
[Required] | ||
public required string State { get; set; } | ||
|
||
[Required] | ||
public required string Country { get; set; } | ||
|
||
[Required] | ||
public required string ZipCode { get; set; } | ||
|
||
[Required] | ||
public required string CardNumber { get; set; } | ||
|
||
[Required] | ||
public required string CardHolderName { get; set; } | ||
|
||
[Required] | ||
public DateTime CardExpiration { get; set; } | ||
|
||
[Required] | ||
public required string CardSecurityNumber { get; set; } | ||
|
||
[Required] | ||
public int CardTypeId { get; set; } | ||
|
||
[Required] | ||
public required IReadOnlyCollection<BasketItem> Items { get; set; } | ||
} |
2 changes: 1 addition & 1 deletion
2
...ut/end/Ordering.API/Model/OrderSummary.cs → ...t/end/Ordering.API/Models/OrderSummary.cs
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 was deleted.
Oops, something went wrong.
Oops, something went wrong.