Add project files.
This commit is contained in:
35
Models/Orders.cs
Normal file
35
Models/Orders.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace LogisticsApp.Server.Models
|
||||
{
|
||||
public class Order
|
||||
{
|
||||
[Key]
|
||||
public int Id { get; set; }
|
||||
|
||||
[Required]
|
||||
[StringLength(200)]
|
||||
public string ClientName { get; set; } = string.Empty;
|
||||
|
||||
[Required]
|
||||
[Column(TypeName = "decimal(18,2)")]
|
||||
public decimal OrderCost { get; set; }
|
||||
|
||||
[Required]
|
||||
public DateTime OrderDate { get; set; } = DateTime.UtcNow;
|
||||
|
||||
[Required]
|
||||
[StringLength(20)]
|
||||
public string Status { get; set; } = "pending"; // pending, in_progress, completed, cancelled
|
||||
|
||||
[Required]
|
||||
[StringLength(500)]
|
||||
public string Address { get; set; } = string.Empty;
|
||||
|
||||
public string Description { get; set; } = string.Empty;
|
||||
|
||||
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
|
||||
public DateTime? UpdatedAt { get; set; } = DateTime.UtcNow;
|
||||
}
|
||||
}
|
||||
22
Models/User.cs
Normal file
22
Models/User.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace LogisticsApp.Server.Models
|
||||
{
|
||||
public class User
|
||||
{
|
||||
[Key]
|
||||
public int Id { get; set; }
|
||||
|
||||
[Required]
|
||||
[StringLength(50)]
|
||||
public string Username { get; set; } = string.Empty;
|
||||
|
||||
[Required]
|
||||
public string PasswordHash { get; set; } = string.Empty;
|
||||
|
||||
[Required]
|
||||
public string Role { get; set; } = "admin"; // admin, user
|
||||
|
||||
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
|
||||
}
|
||||
}
|
||||
24
Models/Vehicle.cs
Normal file
24
Models/Vehicle.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace LogisticsApp.Server.Models
|
||||
{
|
||||
public class Vehicle
|
||||
{
|
||||
[Key]
|
||||
public int Id { get; set; }
|
||||
|
||||
[Required]
|
||||
[StringLength(100)]
|
||||
public string DriverName { get; set; } = string.Empty;
|
||||
|
||||
[Required]
|
||||
[StringLength(50)]
|
||||
public string VehicleType { get; set; } = string.Empty;
|
||||
|
||||
[Required]
|
||||
[StringLength(20)]
|
||||
public string LicensePlate { get; set; } = string.Empty;
|
||||
|
||||
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
|
||||
}
|
||||
}
|
||||
32
Models/WaybillEntry.cs
Normal file
32
Models/WaybillEntry.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace LogisticsApp.Server.Models
|
||||
{
|
||||
public class WaybillEntry
|
||||
{
|
||||
[Key]
|
||||
public int Id { get; set; }
|
||||
|
||||
[Required]
|
||||
[ForeignKey("Vehicle")]
|
||||
public int VehicleId { get; set; }
|
||||
|
||||
[Required]
|
||||
[ForeignKey("Order")]
|
||||
public int OrderId { get; set; }
|
||||
|
||||
[Required]
|
||||
[StringLength(5)]
|
||||
public string StartTime { get; set; } = string.Empty; // Format: "HH:mm"
|
||||
|
||||
[Required]
|
||||
[StringLength(5)]
|
||||
public string EndTime { get; set; } = string.Empty; // Format: "HH:mm"
|
||||
|
||||
[Required]
|
||||
public DateOnly Date { get; set; }
|
||||
|
||||
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user