using LiteCharms.Models; 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() { Id = entity.Id, CreatedAt = entity.CreatedAt, Message = entity.Message, Direction = entity.Direction, CorrelationId = entity.CorrelationId, CorrelationIdType = entity.CorrelationIdType, IsInternal = entity.IsInternal, Sender = entity.Sender, Platform = entity.Platform, Recipient = entity.Recipient, Subject = entity.Subject, Processed = entity.Processed }; public static Customer ToModel(this Entities.Customer entity) => new() { Id = entity.Id, CreatedAt = entity.CreatedAt, UpdatedAt = entity.UpdatedAt, Active = entity.Active, Address = entity.Address, City = entity.City, Company = entity.Company, Country = entity.Country, Discord = entity.Discord, Email = entity.Email, LastName = entity.LastName, LinkedIn = entity.LinkedIn, Name = entity.Name, Phone = entity.Phone, PostalCode = entity.PostalCode, Region = entity.Region, Slack = entity.Slack, Tax = entity.Tax, Website = entity.Website, Whatsapp = entity.Whatsapp }; public static Lead ToModel(this Entities.Lead entity) => new() { Id = entity.Id, CreatedAt = entity.CreatedAt, UpdatedAt = entity.UpdatedAt, AdGroupId = entity.AdGroupId, AdName = entity.AdName, AppClickId = entity.AppClickId, AttributionHash = entity.AttributionHash, CampaignId = entity.CampaignId, ClickLocation = entity.ClickLocation, CustomerId = entity.CustomerId, FeedItemId = entity.FeedItemId, Source = entity.Source, ClickId = entity.ClickId, TargetId = entity.TargetId, WebClickId = entity.WebClickId, Status = entity.Status }; public static Order ToModel(this Entities.Order entity) => new() { Id = entity.Id, CreatedAt = entity.CreatedAt, UpdatedAt = entity.UpdatedAt, CustomerId = entity.CustomerId, Notes = entity.Notes, RefundId = entity.RefundId, QuoteId = entity.QuoteId, Status = entity.Status, ShoppingCartId = entity.ShoppingCartId }; public static OrderRefund ToModel(this Entities.OrderRefund entity) => new() { Id = entity.Id, CreatedAt = entity.CreatedAt, OrderId = entity.OrderId, Reason = entity.Reason, Amount = entity.Amount }; public static Product ToModel(this Entities.Product entity) => new() { Id = entity.Id, Name = entity.Name, Description = entity.Description, Active = entity.Active }; public static ProductPrice ToModel(this Entities.ProductPrice entity) => new() { Id = entity.Id, ProductId = entity.ProductId, Price = entity.Price, Active = entity.Active, CreatedAt = entity.CreatedAt, Discount = entity.Discount, UpdatedAt = entity.UpdatedAt }; }