Redo entities and configs, plus dummy aspnet identity config
This commit is contained in:
10
src/Printbase.Domain/Entities/EntityBase.cs
Normal file
10
src/Printbase.Domain/Entities/EntityBase.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
namespace Printbase.Domain.Entities;
|
||||
|
||||
public abstract class EntityBase
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public DateTime CreatedAt { get; set; }
|
||||
public DateTime ModifiedAt { get; set; }
|
||||
public string CreatedBy { get; set; }
|
||||
public string ModifiedBy { get; set; }
|
||||
}
|
||||
17
src/Printbase.Domain/Entities/Orders/Order.cs
Normal file
17
src/Printbase.Domain/Entities/Orders/Order.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
namespace Printbase.Domain.Entities;
|
||||
|
||||
public class Order : EntityBase
|
||||
{
|
||||
public string UserId { get; set; }
|
||||
public DateTime OrderDate { get; set; }
|
||||
public decimal TotalPrice { get; set; }
|
||||
public int OrderStatusId { get; set; }
|
||||
public int ShippingStatusId { get; set; }
|
||||
public string OrderNumber { get; set; }
|
||||
public string Notes { get; set; }
|
||||
|
||||
public virtual OrderStatus OrderStatus { get; set; }
|
||||
public virtual ShippingStatus ShippingStatus { get; set; }
|
||||
public virtual OrderAddress OrderAddress { get; set; }
|
||||
public virtual ICollection<OrderItem> OrderItems { get; set; } = new List<OrderItem>();
|
||||
}
|
||||
13
src/Printbase.Domain/Entities/Orders/OrderAddress.cs
Normal file
13
src/Printbase.Domain/Entities/Orders/OrderAddress.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
namespace Printbase.Domain.Entities;
|
||||
|
||||
public class OrderAddress : EntityBase
|
||||
{
|
||||
public Guid OrderId { get; set; }
|
||||
public string Street { get; set; }
|
||||
public string City { get; set; }
|
||||
public string State { get; set; }
|
||||
public string PostalCode { get; set; }
|
||||
public string Country { get; set; }
|
||||
|
||||
public virtual Order Order { get; set; }
|
||||
}
|
||||
17
src/Printbase.Domain/Entities/Orders/OrderItem.cs
Normal file
17
src/Printbase.Domain/Entities/Orders/OrderItem.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
namespace Printbase.Domain.Entities;
|
||||
|
||||
public class OrderItem : EntityBase
|
||||
{
|
||||
public Guid OrderId { get; set; }
|
||||
public Guid ProductId { get; set; }
|
||||
public Guid? ProductVariantId { get; set; }
|
||||
public int Quantity { get; set; }
|
||||
public decimal UnitPrice { get; set; }
|
||||
public decimal TotalPrice { get; set; }
|
||||
public string CustomizationImageUrl { get; set; }
|
||||
public string CustomizationDescription { get; set; }
|
||||
|
||||
public virtual Order Order { get; set; }
|
||||
public virtual Product Product { get; set; }
|
||||
public virtual ProductVariant ProductVariant { get; set; }
|
||||
}
|
||||
9
src/Printbase.Domain/Entities/Orders/OrderStatus.cs
Normal file
9
src/Printbase.Domain/Entities/Orders/OrderStatus.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
namespace Printbase.Domain.Entities;
|
||||
|
||||
public class OrderStatus
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string Name { get; set; }
|
||||
|
||||
public virtual ICollection<Order> Orders { get; set; } = new List<Order>();
|
||||
}
|
||||
9
src/Printbase.Domain/Entities/Orders/ShippingStatus.cs
Normal file
9
src/Printbase.Domain/Entities/Orders/ShippingStatus.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
namespace Printbase.Domain.Entities;
|
||||
|
||||
public class ShippingStatus
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string Name { get; set; }
|
||||
|
||||
public virtual ICollection<Order> Orders { get; set; } = new List<Order>();
|
||||
}
|
||||
15
src/Printbase.Domain/Entities/Product/Category.cs
Normal file
15
src/Printbase.Domain/Entities/Product/Category.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
namespace Printbase.Domain.Entities;
|
||||
|
||||
public class Category : EntityBase
|
||||
{
|
||||
public string Name { get; set; }
|
||||
public string Description { get; set; }
|
||||
public string ImageUrl { get; set; }
|
||||
public int SortOrder { get; set; }
|
||||
public bool IsActive { get; set; }
|
||||
public Guid? ParentCategoryId { get; set; }
|
||||
|
||||
public virtual Category ParentCategory { get; set; }
|
||||
public virtual ICollection<Category> SubCategories { get; set; } = new List<Category>();
|
||||
public virtual ICollection<Product> Products { get; set; } = new List<Product>();
|
||||
}
|
||||
16
src/Printbase.Domain/Entities/Product/Product.cs
Normal file
16
src/Printbase.Domain/Entities/Product/Product.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
namespace Printbase.Domain.Entities;
|
||||
|
||||
public class Product : EntityBase
|
||||
{
|
||||
public string Name { get; set; }
|
||||
public string Description { get; set; }
|
||||
public decimal BasePrice { get; set; }
|
||||
public bool IsCustomizable { get; set; }
|
||||
public bool IsActive { get; set; }
|
||||
public string ImageUrl { get; set; }
|
||||
public Guid? CategoryId { get; set; }
|
||||
|
||||
public virtual Category Category { get; set; }
|
||||
public virtual ICollection<ProductVariant> ProductVariants { get; set; } = new List<ProductVariant>();
|
||||
public virtual ICollection<OrderItem> OrderItems { get; set; } = new List<OrderItem>();
|
||||
}
|
||||
16
src/Printbase.Domain/Entities/Product/ProductVariant.cs
Normal file
16
src/Printbase.Domain/Entities/Product/ProductVariant.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
namespace Printbase.Domain.Entities;
|
||||
|
||||
public class ProductVariant : EntityBase
|
||||
{
|
||||
public Guid ProductId { get; set; }
|
||||
public string Size { get; set; }
|
||||
public string Color { get; set; }
|
||||
public decimal Price { get; set; }
|
||||
public string ImageUrl { get; set; }
|
||||
public string SKU { get; set; }
|
||||
public int StockQuantity { get; set; }
|
||||
public bool IsActive { get; set; }
|
||||
|
||||
public virtual Product Product { get; set; }
|
||||
public virtual ICollection<OrderItem> OrderItems { get; set; } = new List<OrderItem>();
|
||||
}
|
||||
14
src/Printbase.Domain/Entities/Users/Address.cs
Normal file
14
src/Printbase.Domain/Entities/Users/Address.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
namespace Printbase.Domain.Entities;
|
||||
|
||||
public class Address : EntityBase
|
||||
{
|
||||
public string UserId { get; set; }
|
||||
public string AddressType { get; set; }
|
||||
public string Street { get; set; }
|
||||
public string City { get; set; }
|
||||
public string State { get; set; }
|
||||
public string PostalCode { get; set; }
|
||||
public string Country { get; set; }
|
||||
public bool IsDefault { get; set; }
|
||||
public bool IsActive { get; set; }
|
||||
}
|
||||
16
src/Printbase.Domain/Entities/Users/ApplicationRole.cs
Normal file
16
src/Printbase.Domain/Entities/Users/ApplicationRole.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using Microsoft.AspNetCore.Identity;
|
||||
|
||||
public class ApplicationRole : IdentityRole
|
||||
{
|
||||
public string Description { get; set; }
|
||||
public DateTime CreatedAt { get; set; }
|
||||
public bool IsActive { get; set; }
|
||||
|
||||
public ApplicationRole() : base()
|
||||
{
|
||||
}
|
||||
|
||||
public ApplicationRole(string roleName) : base(roleName)
|
||||
{
|
||||
}
|
||||
}
|
||||
17
src/Printbase.Domain/Entities/Users/ApplicationUser.cs
Normal file
17
src/Printbase.Domain/Entities/Users/ApplicationUser.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
using Microsoft.AspNetCore.Identity;
|
||||
|
||||
namespace Printbase.Domain.Entities.Users;
|
||||
|
||||
public class ApplicationUser : IdentityUser
|
||||
{
|
||||
public string FirstName { get; set; }
|
||||
public string LastName { get; set; }
|
||||
public DateTime? DateOfBirth { get; set; }
|
||||
public DateTime CreatedAt { get; set; }
|
||||
public DateTime LastLoginAt { get; set; }
|
||||
public bool IsActive { get; set; }
|
||||
public string ProfileImageUrl { get; set; }
|
||||
|
||||
public virtual ICollection<Address> Addresses { get; set; } = new List<Address>();
|
||||
public virtual ICollection<Order> Orders { get; set; } = new List<Order>();
|
||||
}
|
||||
Reference in New Issue
Block a user