Initial project setup with domain, UoW, and API structure
Added .gitignore, solution, and project files for .NET 10. Introduced AGENTS.md and PLAN.md for guidelines and planning. Implemented appsettings.json, launchSettings.json, and MySQL config. Created AppDBContext and all domain models with composite keys. Added IUnitOfWork and EFUnitOfWork. Structured feature folders for Region, Route, Vehicle, Store, Warehouse, and Order with DTOs, repositories, services, and controllers. Added initial EF Core migrations and sample HTTP request. Registered dependencies and enabled OpenAPI in development.
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Distribution.Models
|
||||
{
|
||||
public class DeliveryRun : Template
|
||||
{
|
||||
public Guid FK_VehicleId { get; set; }
|
||||
[ForeignKey("FK_VehicleId")]
|
||||
public Vehicle Vehicle { get; set; }
|
||||
//public Guid FK_DriverId { get; set; }
|
||||
//[ForeignKey("FK_DriverId")]
|
||||
//public Driver Driver { get; set; }
|
||||
public int Meterstart { get; set; }
|
||||
public int Meterend { get; set; }
|
||||
public Guid FK_RouteId { get; set; }
|
||||
[ForeignKey("FK_RouteId")]
|
||||
public Route Route { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
namespace Distribution.Models
|
||||
{
|
||||
public class Item : Template
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Distribution.Models
|
||||
{
|
||||
public class Order : Template
|
||||
{
|
||||
public DateTime OrderDate { get; set; }
|
||||
public Guid FK_StoreId { get; set; }
|
||||
[ForeignKey("FK_StoreId")]
|
||||
public Store Store { get; set; }
|
||||
public decimal TotalAmount { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Distribution.Models
|
||||
{
|
||||
public class OrderItem : Template
|
||||
{
|
||||
public Guid FK_OrderId { get; set; }
|
||||
[ForeignKey("FK_OrderId")]
|
||||
public Order Order { get; set; }
|
||||
public Guid FK_ItemId { get; set; }
|
||||
[ForeignKey("FK_ItemId")]
|
||||
public Item Item { get; set; }
|
||||
public int Quantity { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
namespace Distribution.Models
|
||||
{
|
||||
public class Region : Template
|
||||
{
|
||||
public string Name { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
namespace Distribution.Models
|
||||
{
|
||||
public class Route : Template
|
||||
{
|
||||
public String RouteName { get; set; }
|
||||
public String StartPoint { get; set; }
|
||||
public String EndPoint { get; set; }
|
||||
public decimal Length { get; set; } = 0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
namespace Distribution.Models
|
||||
{
|
||||
public class SaleRoute : Template
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
namespace Distribution.Models
|
||||
{
|
||||
public class Store : Template
|
||||
{
|
||||
public String OwnerName { get; set; }
|
||||
public String StoreName { get; set; }
|
||||
public String StoreAddress { get; set; }
|
||||
public decimal Latitude { get; set; } = 0;
|
||||
public decimal Longitude { get; set; } = 0;
|
||||
public decimal OneTimeAmount { get; set; } = 0;
|
||||
public decimal CreditAmount { get; set; } = 0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
namespace Distribution.Models
|
||||
{
|
||||
public class Template
|
||||
{
|
||||
public Guid Id { get; set; } = Guid.NewGuid();
|
||||
public DateTime CreatedAt { get; set; } = DateTime.Now;
|
||||
public bool IsActive { get; set; } = true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
namespace Distribution.Models
|
||||
{
|
||||
public class Vehicle : Template
|
||||
{
|
||||
public string RegNumber { get; set; }
|
||||
public string NumberPlate { get; set; }
|
||||
public VehicleType Type { get; set; }
|
||||
}
|
||||
public enum VehicleType
|
||||
{
|
||||
Car,
|
||||
Truck,
|
||||
Van,
|
||||
Motorcycle,
|
||||
Bicycle
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Distribution.Models
|
||||
{
|
||||
public class Warehouse : Template
|
||||
{
|
||||
public string Name { get; set; }
|
||||
public string Location { get; set; }
|
||||
public WareHouseType Type { get; set; }
|
||||
public Guid? VehicleId { get; set; }
|
||||
[ForeignKey("VehicleId")]
|
||||
public Vehicle Vehicle { get; set; }
|
||||
}
|
||||
|
||||
public enum WareHouseType
|
||||
{
|
||||
DistributionCenter,
|
||||
FulfillmentCenter,
|
||||
CrossDocking,
|
||||
ColdStorage,
|
||||
BondedWarehouse,
|
||||
AutomatedWarehouse
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user