Init
This commit is contained in:
25
drinkMe/drinkMe.Client.Models/CreditCardForm.cs
Normal file
25
drinkMe/drinkMe.Client.Models/CreditCardForm.cs
Normal file
@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace drinkMe.Client.Models
|
||||
{
|
||||
public class CreditCardForm
|
||||
{
|
||||
[Required, Display(Name = "Credit card number"),
|
||||
MaxLength(16), MinLength(16)]
|
||||
public string Number { get; set; }
|
||||
[Required, Display(Name = "Expiration month"),
|
||||
Range(2, 2), RegularExpression(@"^((0[1-9])|(1[0-2]))$", ErrorMessage = "Invalid month")]
|
||||
public string ExpirationMonth { get; set; }
|
||||
[Required, Display(Name = "Expiration year"),
|
||||
Range(2, 2), RegularExpression(@"^(\d{2})$", ErrorMessage = "Invalid year")]
|
||||
public string ExpirationYear { get; set; }
|
||||
[Required, Display(Name = "CVV code"),
|
||||
Range(3, 3), RegularExpression(@"^(\d{3})$", ErrorMessage = "Invalid CVV code")]
|
||||
public string CVVCode { get; set; }
|
||||
}
|
||||
}
|
11
drinkMe/drinkMe.Client.Models/DiscountForm.cs
Normal file
11
drinkMe/drinkMe.Client.Models/DiscountForm.cs
Normal file
@ -0,0 +1,11 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace drinkMe.Client.Models
|
||||
{
|
||||
public class DiscountForm
|
||||
{
|
||||
[Required,
|
||||
Display(Name = "Discount code")]
|
||||
public string DiscountCode { get; set; }
|
||||
}
|
||||
}
|
9
drinkMe/drinkMe.Client.Models/PaymentMethod.cs
Normal file
9
drinkMe/drinkMe.Client.Models/PaymentMethod.cs
Normal file
@ -0,0 +1,9 @@
|
||||
namespace drinkMe.Client.Models
|
||||
{
|
||||
public enum PaymentMethod
|
||||
{
|
||||
Undefined,
|
||||
Cash,
|
||||
CreditCard
|
||||
}
|
||||
}
|
9
drinkMe/drinkMe.Client.Models/PurchaseStep.cs
Normal file
9
drinkMe/drinkMe.Client.Models/PurchaseStep.cs
Normal file
@ -0,0 +1,9 @@
|
||||
namespace drinkMe.Client.Models
|
||||
{
|
||||
public enum PurchaseStep
|
||||
{
|
||||
ChoosingProducts,
|
||||
PaymentSetup,
|
||||
SuccessfulPurchase
|
||||
}
|
||||
}
|
@ -0,0 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net5.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
Reference in New Issue
Block a user