Added notifications

Added shopping cart and items
Added quotes
Refactored relatinoships
Migrated changes
Refactored cqrs commands and queries
Refactored mappings
This commit is contained in:
Khwezi Mngoma
2026-05-05 23:59:31 +02:00
parent 4b822c63b2
commit 83f51c6a23
67 changed files with 3051 additions and 42 deletions
+45 -7
View File
@@ -4,6 +4,41 @@ namespace LiteCharms.Extensions;
public static class EntityModeMappers
{
public static ShoppingCartItem ToModel(this Entities.ShoppingCartItem entity) =>
new()
{
Id = entity.Id,
CreatedAt = entity.CreatedAt,
UpdatedAt = entity.UpdatedAt,
ProductPriceId = entity.ProductPriceId,
Quantity = entity.Quantity,
ShoppingCartId = entity.ShoppingCartId
};
public static ShoppingCart ToModel(this Entities.ShoppingCart entity) =>
new()
{
Id = entity.Id,
CreatedAt = entity.CreatedAt,
UpdatedAt = entity.UpdatedAt,
CustomerId = entity.CustomerId,
OrderId = entity.OrderId,
QuoteId = entity.QuoteId
};
public static Quote ToModel(this Entities.Quote entity) =>
new()
{
Id = entity.Id,
CreatedAt = entity.CreatedAt,
UpdatedAt = entity.UpdatedAt,
CustomerId = entity.CustomerId,
ExpiredAt = entity.ExpiredAt,
Reason = entity.Reason,
ShoppingCartId = entity.ShoppingCartId,
Status = entity.Status
};
public static Notification ToModel(this Entities.Notification entity) =>
new()
{
@@ -17,7 +52,8 @@ public static class EntityModeMappers
Author = entity.Author,
Platform = entity.Platform,
PlatformAddress = entity.PlatformAddress,
Title = entity.Title
Title = entity.Title,
Processed = entity.Processed
};
public static Customer ToModel(this Entities.Customer entity) =>
@@ -42,7 +78,7 @@ public static class EntityModeMappers
Slack = entity.Slack,
Tax = entity.Tax,
Website = entity.Website,
Whatsapp = entity.Whatsapp
Whatsapp = entity.Whatsapp
};
public static Lead ToModel(this Entities.Lead entity) =>
@@ -63,7 +99,7 @@ public static class EntityModeMappers
ClickId = entity.ClickId,
TargetId = entity.TargetId,
WebClickId = entity.WebClickId,
Status = entity.Status
Status = entity.Status
};
public static Order ToModel(this Entities.Order entity) =>
@@ -72,10 +108,12 @@ public static class EntityModeMappers
Id = entity.Id,
CreatedAt = entity.CreatedAt,
UpdatedAt = entity.UpdatedAt,
CustomerId = entity.CustomerId,
ProductPriceId = entity.ProductPriceId,
CustomerId = entity.CustomerId,
Notes = entity.Notes,
RefundId = entity.RefundId
RefundId = entity.RefundId,
QuoteId = entity.QuoteId,
Status = entity.Status,
ShoppingCartId = entity.ShoppingCartId
};
public static OrderRefund ToModel(this Entities.OrderRefund entity) =>
@@ -106,6 +144,6 @@ public static class EntityModeMappers
Active = entity.Active,
CreatedAt = entity.CreatedAt,
Discount = entity.Discount,
UpdatedAt = entity.UpdatedAt
UpdatedAt = entity.UpdatedAt
};
}