2022-11-02 21:00:48 -04:00
|
|
|
|
using System.ComponentModel.DataAnnotations;
|
|
|
|
|
|
|
|
|
|
namespace GrossesMitainesAPI.Models;
|
|
|
|
|
public class SignUpUserModel {
|
|
|
|
|
[Required, MinLength(2), MaxLength(30)]
|
|
|
|
|
public string FirstName { get; set; }
|
|
|
|
|
[Required, MinLength(1), MaxLength(30)]
|
|
|
|
|
public string LastName { get; set; }
|
|
|
|
|
[Required, EmailAddress]
|
|
|
|
|
public string Email { get; set; }
|
|
|
|
|
[Required, Phone]
|
|
|
|
|
public string Phone { get; set; }
|
|
|
|
|
[Required]
|
|
|
|
|
public string Password { get; set; }
|
2022-11-06 12:10:41 -05:00
|
|
|
|
[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(3)]
|
|
|
|
|
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")] TODO: REGEX
|
|
|
|
|
public string PostalCode { get; set; }
|
2022-11-02 21:00:48 -04:00
|
|
|
|
}
|
|
|
|
|
|