GGMM/GrossesMitaines/GrossesMitainesAPI/Models/Product.cs

32 lines
1.2 KiB
C#
Raw Normal View History

2022-10-09 14:23:46 -04:00
using Microsoft.Data.SqlClient.Server;
using System.ComponentModel.DataAnnotations;
2022-10-08 13:22:12 -04:00
namespace GrossesMitainesAPI.Models;
2022-10-09 14:23:46 -04:00
// nom du produit,
// catégories, description, quantité disponible, images, prix normal et
// autres informations pertinentes
2022-10-08 13:22:12 -04:00
public class Product {
2022-10-16 11:25:21 -04:00
public enum States {
Available,
BackOrder,
Unavailable,
Clearance,
Promotion,
Discontinued
}
2022-10-08 13:22:12 -04:00
[Key]
public int Id { get; set; }
[Required, MaxLength(255)]
2022-10-08 13:41:55 -04:00
public string Title { get; set; } = "Erreur Aucun Objet";
2022-10-08 13:22:12 -04:00
[Required]
2022-10-09 14:23:46 -04:00
public string Category { get; set; } = "Inconnue";
[Required]
2022-10-08 13:41:55 -04:00
public string Description { get; set; } = "Lorem Ipsum.";
2022-10-09 14:23:46 -04:00
[Required, Range(0.01, (double)decimal.MaxValue)] // Range qui prend pas les decimals!
2022-10-08 13:22:12 -04:00
public decimal Price { get; set; } = 0;
2022-10-16 20:33:58 -04:00
[Required, Range(0.00, (double)decimal.MaxValue)]
public decimal PromoPrice { get; set; } = 0;
2022-10-09 14:23:46 -04:00
public uint Quantity { get; set; } = 0;
2022-10-16 11:25:21 -04:00
public States Status { get; set; } = States.Available;
2022-10-09 14:23:46 -04:00
public string? ImageName { get; set; } // Base pour sortir les images ({ImageName}.jpg , {ImageName}_thumbnail.jpg, etc...)
2022-10-08 13:22:12 -04:00
}