Hello, my name is Bill.

This commit is contained in:
MarcEricMartel
2022-12-12 12:28:21 -08:00
parent 23284fc514
commit 7a89d78e4a
7 changed files with 139 additions and 62 deletions

View File

@@ -1,4 +1,6 @@
namespace GrossesMitainesAPI.Models;
using System.ComponentModel.DataAnnotations;
namespace GrossesMitainesAPI.Models;
public class ChargeReturnModel {
public string Token { get; set; }
public string Description { get; set; }
@@ -9,4 +11,5 @@ public class ChargeReturnModel {
public string Phone { get; set; }
public int Invoice { get; set; }
public string LastFourDigits { get; set; }
public AddressModel ShippingAddress { get; set; }
}

View File

@@ -12,4 +12,5 @@ public class ChargesModel {
public string Email { get; set; }
public string Phone { get; set; }
public string LastFourDigits { get; set; }
public AddressModel BillingAddress { get; set; }
}

View File

@@ -36,4 +36,20 @@ namespace GrossesMitainesAPI.Models;
public string Email { get; set; }
public string Phone { get; set; }
public string LastFourDigits { get; set; }
[Required, Range(1, int.MaxValue)]
public int BillCivicNumber { get; set; }
public string? BillAppartment { get; set; }
[Required, MinLength(3), MaxLength(50)]
public string BillStreet { get; set; }
[Required, MinLength(4), MaxLength(50)]
public string BillCity { get; set; }
[Required, MaxLength(3)]
public string BillProvince { get; set; }
[Required, MinLength(4), MaxLength(30)]
public string BillCountry { get; set; }
// Source pour regex: https://stackoverflow.com/questions/15774555/efficient-regex-for-canadian-postal-code-function
//[Required, RegularExpression(@"/^[ABCEGHJ-NPRSTVXY]\d[ABCEGHJ-NPRSTV-Z][ -]?\d[ABCEGHJ-NPRSTV-Z]\d$/i")]
public string BillPostalCode { get; set; }
}