source: StockMaster/Models/Warehouse.cs

main
Last change on this file was dfe03b8, checked in by Ceyda <ceyda.huseini@…>, 3 days ago

Initialize StockMaster project

  • Property mode set to 100644
File size: 955 bytes
RevLine 
[dfe03b8]1using System;
2using System.ComponentModel.DataAnnotations;
3using System.ComponentModel.DataAnnotations.Schema;
4
5namespace StockMaster.Models
6{
7 [Table("warehouse", Schema = "stock_management")]
8 public class Warehouse
9 {
10 [Key]
11 [Column("warehouse_id")]
12 public int WarehouseId { get; set; }
13
14 [Required(ErrorMessage = "Warehouse name is required")]
15 [MaxLength(100)]
16 [Column("name")]
17 public string Name { get; set; }
18
19 [Required(ErrorMessage = "Location is required")]
20 [MaxLength(255)]
21 [Column("location")]
22 public string Location { get; set; }
23
24 [Required(ErrorMessage = "Capacity is required")]
25 [Range(1, int.MaxValue, ErrorMessage = "Capacity must be greater than 0")]
26 [Column("capacity")]
27 public int Capacity { get; set; }
28
29 [Column("created_at")]
30 public DateTime CreatedAt { get; set; } = DateTime.Now;
31 }
32}
Note: See TracBrowser for help on using the repository browser.