2022-10-30 16:58:47 -04:00
|
|
|
|
using Microsoft.AspNetCore.Identity;
|
2022-11-01 12:24:04 -04:00
|
|
|
|
using System.ComponentModel.DataAnnotations;
|
2022-10-30 16:58:47 -04:00
|
|
|
|
|
|
|
|
|
namespace GrossesMitainesAPI.Data;
|
|
|
|
|
public class InventoryUser : IdentityUser {
|
2022-11-01 12:24:04 -04:00
|
|
|
|
public class Address {
|
|
|
|
|
[Key]
|
|
|
|
|
public int Id { get; set; }
|
|
|
|
|
[Required, Range(1, int.MaxValue)]
|
|
|
|
|
public int CivicNumber { get; set; }
|
|
|
|
|
public string? Appartment { get; set; }
|
|
|
|
|
[Required, MinLength(3), MaxLength(50)]
|
|
|
|
|
public string Street { get; set; }
|
|
|
|
|
[Required, MinLength(4), MaxLength(50)]
|
|
|
|
|
public string City { get; set; }
|
|
|
|
|
[Required, MaxLength(2)]
|
|
|
|
|
public string Province { get; set; }
|
|
|
|
|
[Required, MinLength(4), MaxLength(30)]
|
|
|
|
|
public string Country { 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 PostalCode { get; set; }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public List<Address> Adresses { get; set; }
|
|
|
|
|
|
2022-10-30 16:58:47 -04:00
|
|
|
|
}
|
|
|
|
|
|