// using System; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; using TakeoutSaaS.Infrastructure.App.Persistence; #nullable disable namespace TakeoutSaaS.Infrastructure.App.Migrations { [DbContext(typeof(TakeoutAppDbContext))] [Migration("20251201055852_ExpandDomainSchema")] partial class ExpandDomainSchema { /// protected override void BuildTargetModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder .HasAnnotation("ProductVersion", "10.0.0") .HasAnnotation("Relational:MaxIdentifierLength", 63); NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); modelBuilder.Entity("TakeoutSaaS.Domain.Analytics.Entities.MetricAlertRule", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("uuid"); b.Property("ConditionJson") .IsRequired() .HasColumnType("text"); b.Property("CreatedAt") .HasColumnType("timestamp with time zone"); b.Property("CreatedBy") .HasColumnType("uuid"); b.Property("DeletedAt") .HasColumnType("timestamp with time zone"); b.Property("DeletedBy") .HasColumnType("uuid"); b.Property("Enabled") .HasColumnType("boolean"); b.Property("MetricDefinitionId") .HasColumnType("uuid"); b.Property("NotificationChannels") .IsRequired() .HasMaxLength(256) .HasColumnType("character varying(256)"); b.Property("Severity") .HasColumnType("integer"); b.Property("TenantId") .HasColumnType("uuid"); b.Property("UpdatedAt") .HasColumnType("timestamp with time zone"); b.Property("UpdatedBy") .HasColumnType("uuid"); b.HasKey("Id"); b.HasIndex("TenantId", "MetricDefinitionId", "Severity"); b.ToTable("metric_alert_rules", (string)null); }); modelBuilder.Entity("TakeoutSaaS.Domain.Analytics.Entities.MetricDefinition", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("uuid"); b.Property("Code") .IsRequired() .HasMaxLength(64) .HasColumnType("character varying(64)"); b.Property("CreatedAt") .HasColumnType("timestamp with time zone"); b.Property("CreatedBy") .HasColumnType("uuid"); b.Property("DefaultAggregation") .IsRequired() .HasMaxLength(32) .HasColumnType("character varying(32)"); b.Property("DeletedAt") .HasColumnType("timestamp with time zone"); b.Property("DeletedBy") .HasColumnType("uuid"); b.Property("Description") .HasMaxLength(512) .HasColumnType("character varying(512)"); b.Property("DimensionsJson") .HasColumnType("text"); b.Property("Name") .IsRequired() .HasMaxLength(128) .HasColumnType("character varying(128)"); b.Property("TenantId") .HasColumnType("uuid"); b.Property("UpdatedAt") .HasColumnType("timestamp with time zone"); b.Property("UpdatedBy") .HasColumnType("uuid"); b.HasKey("Id"); b.HasIndex("TenantId", "Code") .IsUnique(); b.ToTable("metric_definitions", (string)null); }); modelBuilder.Entity("TakeoutSaaS.Domain.Analytics.Entities.MetricSnapshot", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("uuid"); b.Property("CreatedAt") .HasColumnType("timestamp with time zone"); b.Property("CreatedBy") .HasColumnType("uuid"); b.Property("DeletedAt") .HasColumnType("timestamp with time zone"); b.Property("DeletedBy") .HasColumnType("uuid"); b.Property("DimensionKey") .IsRequired() .HasMaxLength(256) .HasColumnType("character varying(256)"); b.Property("MetricDefinitionId") .HasColumnType("uuid"); b.Property("TenantId") .HasColumnType("uuid"); b.Property("UpdatedAt") .HasColumnType("timestamp with time zone"); b.Property("UpdatedBy") .HasColumnType("uuid"); b.Property("Value") .HasPrecision(18, 4) .HasColumnType("numeric(18,4)"); b.Property("WindowEnd") .HasColumnType("timestamp with time zone"); b.Property("WindowStart") .HasColumnType("timestamp with time zone"); b.HasKey("Id"); b.HasIndex("TenantId", "MetricDefinitionId", "DimensionKey", "WindowStart", "WindowEnd") .IsUnique(); b.ToTable("metric_snapshots", (string)null); }); modelBuilder.Entity("TakeoutSaaS.Domain.Coupons.Entities.Coupon", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("uuid"); b.Property("Code") .IsRequired() .HasMaxLength(32) .HasColumnType("character varying(32)"); b.Property("CouponTemplateId") .HasColumnType("uuid"); b.Property("CreatedAt") .HasColumnType("timestamp with time zone"); b.Property("CreatedBy") .HasColumnType("uuid"); b.Property("DeletedAt") .HasColumnType("timestamp with time zone"); b.Property("DeletedBy") .HasColumnType("uuid"); b.Property("ExpireAt") .HasColumnType("timestamp with time zone"); b.Property("IssuedAt") .HasColumnType("timestamp with time zone"); b.Property("OrderId") .HasColumnType("uuid"); b.Property("Status") .HasColumnType("integer"); b.Property("TenantId") .HasColumnType("uuid"); b.Property("UpdatedAt") .HasColumnType("timestamp with time zone"); b.Property("UpdatedBy") .HasColumnType("uuid"); b.Property("UsedAt") .HasColumnType("timestamp with time zone"); b.Property("UserId") .HasColumnType("uuid"); b.HasKey("Id"); b.HasIndex("TenantId", "Code") .IsUnique(); b.ToTable("coupons", (string)null); }); modelBuilder.Entity("TakeoutSaaS.Domain.Coupons.Entities.CouponTemplate", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("uuid"); b.Property("AllowStack") .HasColumnType("boolean"); b.Property("ChannelsJson") .HasColumnType("text"); b.Property("ClaimedQuantity") .HasColumnType("integer"); b.Property("CouponType") .HasColumnType("integer"); b.Property("CreatedAt") .HasColumnType("timestamp with time zone"); b.Property("CreatedBy") .HasColumnType("uuid"); b.Property("DeletedAt") .HasColumnType("timestamp with time zone"); b.Property("DeletedBy") .HasColumnType("uuid"); b.Property("Description") .HasMaxLength(512) .HasColumnType("character varying(512)"); b.Property("DiscountCap") .HasColumnType("numeric"); b.Property("MinimumSpend") .HasColumnType("numeric"); b.Property("Name") .IsRequired() .HasMaxLength(128) .HasColumnType("character varying(128)"); b.Property("ProductScopeJson") .HasColumnType("text"); b.Property("RelativeValidDays") .HasColumnType("integer"); b.Property("Status") .HasColumnType("integer"); b.Property("StoreScopeJson") .HasColumnType("text"); b.Property("TenantId") .HasColumnType("uuid"); b.Property("TotalQuantity") .HasColumnType("integer"); b.Property("UpdatedAt") .HasColumnType("timestamp with time zone"); b.Property("UpdatedBy") .HasColumnType("uuid"); b.Property("ValidFrom") .HasColumnType("timestamp with time zone"); b.Property("ValidTo") .HasColumnType("timestamp with time zone"); b.Property("Value") .HasColumnType("numeric"); b.HasKey("Id"); b.ToTable("coupon_templates", (string)null); }); modelBuilder.Entity("TakeoutSaaS.Domain.Coupons.Entities.PromotionCampaign", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("uuid"); b.Property("AudienceDescription") .HasMaxLength(512) .HasColumnType("character varying(512)"); b.Property("BannerUrl") .HasMaxLength(512) .HasColumnType("character varying(512)"); b.Property("Budget") .HasColumnType("numeric"); b.Property("CreatedAt") .HasColumnType("timestamp with time zone"); b.Property("CreatedBy") .HasColumnType("uuid"); b.Property("DeletedAt") .HasColumnType("timestamp with time zone"); b.Property("DeletedBy") .HasColumnType("uuid"); b.Property("EndAt") .HasColumnType("timestamp with time zone"); b.Property("Name") .IsRequired() .HasMaxLength(128) .HasColumnType("character varying(128)"); b.Property("PromotionType") .HasColumnType("integer"); b.Property("RulesJson") .IsRequired() .HasColumnType("text"); b.Property("StartAt") .HasColumnType("timestamp with time zone"); b.Property("Status") .HasColumnType("integer"); b.Property("TenantId") .HasColumnType("uuid"); b.Property("UpdatedAt") .HasColumnType("timestamp with time zone"); b.Property("UpdatedBy") .HasColumnType("uuid"); b.HasKey("Id"); b.ToTable("promotion_campaigns", (string)null); }); modelBuilder.Entity("TakeoutSaaS.Domain.CustomerService.Entities.ChatMessage", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("uuid"); b.Property("ChatSessionId") .HasColumnType("uuid"); b.Property("Content") .IsRequired() .HasMaxLength(1024) .HasColumnType("character varying(1024)"); b.Property("ContentType") .IsRequired() .HasMaxLength(64) .HasColumnType("character varying(64)"); b.Property("CreatedAt") .HasColumnType("timestamp with time zone"); b.Property("CreatedBy") .HasColumnType("uuid"); b.Property("DeletedAt") .HasColumnType("timestamp with time zone"); b.Property("DeletedBy") .HasColumnType("uuid"); b.Property("IsRead") .HasColumnType("boolean"); b.Property("ReadAt") .HasColumnType("timestamp with time zone"); b.Property("SenderType") .HasColumnType("integer"); b.Property("SenderUserId") .HasColumnType("uuid"); b.Property("TenantId") .HasColumnType("uuid"); b.Property("UpdatedAt") .HasColumnType("timestamp with time zone"); b.Property("UpdatedBy") .HasColumnType("uuid"); b.HasKey("Id"); b.HasIndex("TenantId", "ChatSessionId", "CreatedAt"); b.ToTable("chat_messages", (string)null); }); modelBuilder.Entity("TakeoutSaaS.Domain.CustomerService.Entities.ChatSession", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("uuid"); b.Property("AgentUserId") .HasColumnType("uuid"); b.Property("CreatedAt") .HasColumnType("timestamp with time zone"); b.Property("CreatedBy") .HasColumnType("uuid"); b.Property("CustomerUserId") .HasColumnType("uuid"); b.Property("DeletedAt") .HasColumnType("timestamp with time zone"); b.Property("DeletedBy") .HasColumnType("uuid"); b.Property("EndedAt") .HasColumnType("timestamp with time zone"); b.Property("IsBotActive") .HasColumnType("boolean"); b.Property("SessionCode") .IsRequired() .HasMaxLength(64) .HasColumnType("character varying(64)"); b.Property("StartedAt") .HasColumnType("timestamp with time zone"); b.Property("Status") .HasColumnType("integer"); b.Property("StoreId") .HasColumnType("uuid"); b.Property("TenantId") .HasColumnType("uuid"); b.Property("UpdatedAt") .HasColumnType("timestamp with time zone"); b.Property("UpdatedBy") .HasColumnType("uuid"); b.HasKey("Id"); b.HasIndex("TenantId", "SessionCode") .IsUnique(); b.ToTable("chat_sessions", (string)null); }); modelBuilder.Entity("TakeoutSaaS.Domain.CustomerService.Entities.SupportTicket", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("uuid"); b.Property("AssignedAgentId") .HasColumnType("uuid"); b.Property("ClosedAt") .HasColumnType("timestamp with time zone"); b.Property("CreatedAt") .HasColumnType("timestamp with time zone"); b.Property("CreatedBy") .HasColumnType("uuid"); b.Property("CustomerUserId") .HasColumnType("uuid"); b.Property("DeletedAt") .HasColumnType("timestamp with time zone"); b.Property("DeletedBy") .HasColumnType("uuid"); b.Property("Description") .IsRequired() .HasColumnType("text"); b.Property("OrderId") .HasColumnType("uuid"); b.Property("Priority") .HasColumnType("integer"); b.Property("Status") .HasColumnType("integer"); b.Property("Subject") .IsRequired() .HasMaxLength(128) .HasColumnType("character varying(128)"); b.Property("TenantId") .HasColumnType("uuid"); b.Property("TicketNo") .IsRequired() .HasMaxLength(32) .HasColumnType("character varying(32)"); b.Property("UpdatedAt") .HasColumnType("timestamp with time zone"); b.Property("UpdatedBy") .HasColumnType("uuid"); b.HasKey("Id"); b.HasIndex("TenantId", "TicketNo") .IsUnique(); b.ToTable("support_tickets", (string)null); }); modelBuilder.Entity("TakeoutSaaS.Domain.CustomerService.Entities.TicketComment", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("uuid"); b.Property("AttachmentsJson") .HasColumnType("text"); b.Property("AuthorUserId") .HasColumnType("uuid"); b.Property("Content") .IsRequired() .HasMaxLength(1024) .HasColumnType("character varying(1024)"); b.Property("CreatedAt") .HasColumnType("timestamp with time zone"); b.Property("CreatedBy") .HasColumnType("uuid"); b.Property("DeletedAt") .HasColumnType("timestamp with time zone"); b.Property("DeletedBy") .HasColumnType("uuid"); b.Property("IsInternal") .HasColumnType("boolean"); b.Property("SupportTicketId") .HasColumnType("uuid"); b.Property("TenantId") .HasColumnType("uuid"); b.Property("UpdatedAt") .HasColumnType("timestamp with time zone"); b.Property("UpdatedBy") .HasColumnType("uuid"); b.HasKey("Id"); b.HasIndex("TenantId", "SupportTicketId"); b.ToTable("ticket_comments", (string)null); }); modelBuilder.Entity("TakeoutSaaS.Domain.Deliveries.Entities.DeliveryEvent", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("uuid"); b.Property("CreatedAt") .HasColumnType("timestamp with time zone"); b.Property("CreatedBy") .HasColumnType("uuid"); b.Property("DeletedAt") .HasColumnType("timestamp with time zone"); b.Property("DeletedBy") .HasColumnType("uuid"); b.Property("DeliveryOrderId") .HasColumnType("uuid"); b.Property("EventType") .HasColumnType("integer"); b.Property("Message") .IsRequired() .HasMaxLength(256) .HasColumnType("character varying(256)"); b.Property("OccurredAt") .HasColumnType("timestamp with time zone"); b.Property("Payload") .HasColumnType("text"); b.Property("TenantId") .HasColumnType("uuid"); b.Property("UpdatedAt") .HasColumnType("timestamp with time zone"); b.Property("UpdatedBy") .HasColumnType("uuid"); b.HasKey("Id"); b.HasIndex("TenantId", "DeliveryOrderId", "EventType"); b.ToTable("delivery_events", (string)null); }); modelBuilder.Entity("TakeoutSaaS.Domain.Deliveries.Entities.DeliveryOrder", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("uuid"); b.Property("CourierName") .HasMaxLength(64) .HasColumnType("character varying(64)"); b.Property("CourierPhone") .HasMaxLength(32) .HasColumnType("character varying(32)"); b.Property("CreatedAt") .HasColumnType("timestamp with time zone"); b.Property("CreatedBy") .HasColumnType("uuid"); b.Property("DeletedAt") .HasColumnType("timestamp with time zone"); b.Property("DeletedBy") .HasColumnType("uuid"); b.Property("DeliveredAt") .HasColumnType("timestamp with time zone"); b.Property("DeliveryFee") .HasPrecision(18, 2) .HasColumnType("numeric(18,2)"); b.Property("DispatchedAt") .HasColumnType("timestamp with time zone"); b.Property("FailureReason") .HasMaxLength(256) .HasColumnType("character varying(256)"); b.Property("OrderId") .HasColumnType("uuid"); b.Property("PickedUpAt") .HasColumnType("timestamp with time zone"); b.Property("Provider") .HasColumnType("integer"); b.Property("ProviderOrderId") .HasMaxLength(64) .HasColumnType("character varying(64)"); b.Property("Status") .HasColumnType("integer"); b.Property("TenantId") .HasColumnType("uuid"); b.Property("UpdatedAt") .HasColumnType("timestamp with time zone"); b.Property("UpdatedBy") .HasColumnType("uuid"); b.HasKey("Id"); b.HasIndex("TenantId", "OrderId") .IsUnique(); b.ToTable("delivery_orders", (string)null); }); modelBuilder.Entity("TakeoutSaaS.Domain.Distribution.Entities.AffiliateOrder", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("uuid"); b.Property("AffiliatePartnerId") .HasColumnType("uuid"); b.Property("BuyerUserId") .HasColumnType("uuid"); b.Property("CreatedAt") .HasColumnType("timestamp with time zone"); b.Property("CreatedBy") .HasColumnType("uuid"); b.Property("DeletedAt") .HasColumnType("timestamp with time zone"); b.Property("DeletedBy") .HasColumnType("uuid"); b.Property("EstimatedCommission") .HasPrecision(18, 2) .HasColumnType("numeric(18,2)"); b.Property("OrderAmount") .HasPrecision(18, 2) .HasColumnType("numeric(18,2)"); b.Property("OrderId") .HasColumnType("uuid"); b.Property("SettledAt") .HasColumnType("timestamp with time zone"); b.Property("Status") .HasColumnType("integer"); b.Property("TenantId") .HasColumnType("uuid"); b.Property("UpdatedAt") .HasColumnType("timestamp with time zone"); b.Property("UpdatedBy") .HasColumnType("uuid"); b.HasKey("Id"); b.HasIndex("TenantId", "AffiliatePartnerId", "OrderId") .IsUnique(); b.ToTable("affiliate_orders", (string)null); }); modelBuilder.Entity("TakeoutSaaS.Domain.Distribution.Entities.AffiliatePartner", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("uuid"); b.Property("ChannelType") .HasColumnType("integer"); b.Property("CommissionRate") .HasColumnType("numeric"); b.Property("CreatedAt") .HasColumnType("timestamp with time zone"); b.Property("CreatedBy") .HasColumnType("uuid"); b.Property("DeletedAt") .HasColumnType("timestamp with time zone"); b.Property("DeletedBy") .HasColumnType("uuid"); b.Property("DisplayName") .IsRequired() .HasMaxLength(64) .HasColumnType("character varying(64)"); b.Property("Phone") .HasMaxLength(32) .HasColumnType("character varying(32)"); b.Property("Remarks") .HasMaxLength(256) .HasColumnType("character varying(256)"); b.Property("Status") .HasColumnType("integer"); b.Property("TenantId") .HasColumnType("uuid"); b.Property("UpdatedAt") .HasColumnType("timestamp with time zone"); b.Property("UpdatedBy") .HasColumnType("uuid"); b.Property("UserId") .HasColumnType("uuid"); b.HasKey("Id"); b.HasIndex("TenantId", "DisplayName"); b.ToTable("affiliate_partners", (string)null); }); modelBuilder.Entity("TakeoutSaaS.Domain.Distribution.Entities.AffiliatePayout", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("uuid"); b.Property("AffiliatePartnerId") .HasColumnType("uuid"); b.Property("Amount") .HasPrecision(18, 2) .HasColumnType("numeric(18,2)"); b.Property("CreatedAt") .HasColumnType("timestamp with time zone"); b.Property("CreatedBy") .HasColumnType("uuid"); b.Property("DeletedAt") .HasColumnType("timestamp with time zone"); b.Property("DeletedBy") .HasColumnType("uuid"); b.Property("PaidAt") .HasColumnType("timestamp with time zone"); b.Property("Period") .IsRequired() .HasMaxLength(32) .HasColumnType("character varying(32)"); b.Property("Remarks") .HasMaxLength(256) .HasColumnType("character varying(256)"); b.Property("Status") .HasColumnType("integer"); b.Property("TenantId") .HasColumnType("uuid"); b.Property("UpdatedAt") .HasColumnType("timestamp with time zone"); b.Property("UpdatedBy") .HasColumnType("uuid"); b.HasKey("Id"); b.HasIndex("TenantId", "AffiliatePartnerId", "Period") .IsUnique(); b.ToTable("affiliate_payouts", (string)null); }); modelBuilder.Entity("TakeoutSaaS.Domain.Engagement.Entities.CheckInCampaign", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("uuid"); b.Property("AllowMakeupCount") .HasColumnType("integer"); b.Property("CreatedAt") .HasColumnType("timestamp with time zone"); b.Property("CreatedBy") .HasColumnType("uuid"); b.Property("DeletedAt") .HasColumnType("timestamp with time zone"); b.Property("DeletedBy") .HasColumnType("uuid"); b.Property("Description") .HasMaxLength(512) .HasColumnType("character varying(512)"); b.Property("EndDate") .HasColumnType("timestamp with time zone"); b.Property("Name") .IsRequired() .HasMaxLength(128) .HasColumnType("character varying(128)"); b.Property("RewardsJson") .IsRequired() .HasColumnType("text"); b.Property("StartDate") .HasColumnType("timestamp with time zone"); b.Property("Status") .HasColumnType("integer"); b.Property("TenantId") .HasColumnType("uuid"); b.Property("UpdatedAt") .HasColumnType("timestamp with time zone"); b.Property("UpdatedBy") .HasColumnType("uuid"); b.HasKey("Id"); b.HasIndex("TenantId", "Name"); b.ToTable("checkin_campaigns", (string)null); }); modelBuilder.Entity("TakeoutSaaS.Domain.Engagement.Entities.CheckInRecord", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("uuid"); b.Property("CheckInCampaignId") .HasColumnType("uuid"); b.Property("CheckInDate") .HasColumnType("timestamp with time zone"); b.Property("CreatedAt") .HasColumnType("timestamp with time zone"); b.Property("CreatedBy") .HasColumnType("uuid"); b.Property("DeletedAt") .HasColumnType("timestamp with time zone"); b.Property("DeletedBy") .HasColumnType("uuid"); b.Property("IsMakeup") .HasColumnType("boolean"); b.Property("RewardJson") .IsRequired() .HasColumnType("text"); b.Property("TenantId") .HasColumnType("uuid"); b.Property("UpdatedAt") .HasColumnType("timestamp with time zone"); b.Property("UpdatedBy") .HasColumnType("uuid"); b.Property("UserId") .HasColumnType("uuid"); b.HasKey("Id"); b.HasIndex("TenantId", "CheckInCampaignId", "UserId", "CheckInDate") .IsUnique(); b.ToTable("checkin_records", (string)null); }); modelBuilder.Entity("TakeoutSaaS.Domain.Engagement.Entities.CommunityComment", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("uuid"); b.Property("AuthorUserId") .HasColumnType("uuid"); b.Property("Content") .IsRequired() .HasMaxLength(512) .HasColumnType("character varying(512)"); b.Property("CreatedAt") .HasColumnType("timestamp with time zone"); b.Property("CreatedBy") .HasColumnType("uuid"); b.Property("DeletedAt") .HasColumnType("timestamp with time zone"); b.Property("DeletedBy") .HasColumnType("uuid"); b.Property("IsDeleted") .HasColumnType("boolean"); b.Property("ParentId") .HasColumnType("uuid"); b.Property("PostId") .HasColumnType("uuid"); b.Property("TenantId") .HasColumnType("uuid"); b.Property("UpdatedAt") .HasColumnType("timestamp with time zone"); b.Property("UpdatedBy") .HasColumnType("uuid"); b.HasKey("Id"); b.HasIndex("TenantId", "PostId", "CreatedAt"); b.ToTable("community_comments", (string)null); }); modelBuilder.Entity("TakeoutSaaS.Domain.Engagement.Entities.CommunityPost", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("uuid"); b.Property("AuthorUserId") .HasColumnType("uuid"); b.Property("CommentCount") .HasColumnType("integer"); b.Property("Content") .IsRequired() .HasColumnType("text"); b.Property("CreatedAt") .HasColumnType("timestamp with time zone"); b.Property("CreatedBy") .HasColumnType("uuid"); b.Property("DeletedAt") .HasColumnType("timestamp with time zone"); b.Property("DeletedBy") .HasColumnType("uuid"); b.Property("LikeCount") .HasColumnType("integer"); b.Property("MediaJson") .HasColumnType("text"); b.Property("Status") .HasColumnType("integer"); b.Property("TenantId") .HasColumnType("uuid"); b.Property("Title") .HasMaxLength(128) .HasColumnType("character varying(128)"); b.Property("UpdatedAt") .HasColumnType("timestamp with time zone"); b.Property("UpdatedBy") .HasColumnType("uuid"); b.HasKey("Id"); b.HasIndex("TenantId", "AuthorUserId", "CreatedAt"); b.ToTable("community_posts", (string)null); }); modelBuilder.Entity("TakeoutSaaS.Domain.Engagement.Entities.CommunityReaction", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("uuid"); b.Property("CreatedAt") .HasColumnType("timestamp with time zone"); b.Property("CreatedBy") .HasColumnType("uuid"); b.Property("DeletedAt") .HasColumnType("timestamp with time zone"); b.Property("DeletedBy") .HasColumnType("uuid"); b.Property("PostId") .HasColumnType("uuid"); b.Property("ReactedAt") .HasColumnType("timestamp with time zone"); b.Property("ReactionType") .HasColumnType("integer"); b.Property("TenantId") .HasColumnType("uuid"); b.Property("UpdatedAt") .HasColumnType("timestamp with time zone"); b.Property("UpdatedBy") .HasColumnType("uuid"); b.Property("UserId") .HasColumnType("uuid"); b.HasKey("Id"); b.HasIndex("TenantId", "PostId", "UserId") .IsUnique(); b.ToTable("community_reactions", (string)null); }); modelBuilder.Entity("TakeoutSaaS.Domain.GroupBuying.Entities.GroupOrder", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("uuid"); b.Property("CancelledAt") .HasColumnType("timestamp with time zone"); b.Property("CreatedAt") .HasColumnType("timestamp with time zone"); b.Property("CreatedBy") .HasColumnType("uuid"); b.Property("CurrentCount") .HasColumnType("integer"); b.Property("DeletedAt") .HasColumnType("timestamp with time zone"); b.Property("DeletedBy") .HasColumnType("uuid"); b.Property("EndAt") .HasColumnType("timestamp with time zone"); b.Property("GroupOrderNo") .IsRequired() .HasMaxLength(32) .HasColumnType("character varying(32)"); b.Property("GroupPrice") .HasPrecision(18, 2) .HasColumnType("numeric(18,2)"); b.Property("LeaderUserId") .HasColumnType("uuid"); b.Property("ProductId") .HasColumnType("uuid"); b.Property("StartAt") .HasColumnType("timestamp with time zone"); b.Property("Status") .HasColumnType("integer"); b.Property("StoreId") .HasColumnType("uuid"); b.Property("SucceededAt") .HasColumnType("timestamp with time zone"); b.Property("TargetCount") .HasColumnType("integer"); b.Property("TenantId") .HasColumnType("uuid"); b.Property("UpdatedAt") .HasColumnType("timestamp with time zone"); b.Property("UpdatedBy") .HasColumnType("uuid"); b.HasKey("Id"); b.HasIndex("TenantId", "GroupOrderNo") .IsUnique(); b.ToTable("group_orders", (string)null); }); modelBuilder.Entity("TakeoutSaaS.Domain.GroupBuying.Entities.GroupParticipant", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("uuid"); b.Property("CreatedAt") .HasColumnType("timestamp with time zone"); b.Property("CreatedBy") .HasColumnType("uuid"); b.Property("DeletedAt") .HasColumnType("timestamp with time zone"); b.Property("DeletedBy") .HasColumnType("uuid"); b.Property("GroupOrderId") .HasColumnType("uuid"); b.Property("JoinedAt") .HasColumnType("timestamp with time zone"); b.Property("OrderId") .HasColumnType("uuid"); b.Property("Status") .HasColumnType("integer"); b.Property("TenantId") .HasColumnType("uuid"); b.Property("UpdatedAt") .HasColumnType("timestamp with time zone"); b.Property("UpdatedBy") .HasColumnType("uuid"); b.Property("UserId") .HasColumnType("uuid"); b.HasKey("Id"); b.HasIndex("TenantId", "GroupOrderId", "UserId") .IsUnique(); b.ToTable("group_participants", (string)null); }); modelBuilder.Entity("TakeoutSaaS.Domain.Inventory.Entities.InventoryAdjustment", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("uuid"); b.Property("AdjustmentType") .HasColumnType("integer"); b.Property("CreatedAt") .HasColumnType("timestamp with time zone"); b.Property("CreatedBy") .HasColumnType("uuid"); b.Property("DeletedAt") .HasColumnType("timestamp with time zone"); b.Property("DeletedBy") .HasColumnType("uuid"); b.Property("InventoryItemId") .HasColumnType("uuid"); b.Property("OccurredAt") .HasColumnType("timestamp with time zone"); b.Property("OperatorId") .HasColumnType("uuid"); b.Property("Quantity") .HasColumnType("integer"); b.Property("Reason") .HasMaxLength(256) .HasColumnType("character varying(256)"); b.Property("TenantId") .HasColumnType("uuid"); b.Property("UpdatedAt") .HasColumnType("timestamp with time zone"); b.Property("UpdatedBy") .HasColumnType("uuid"); b.HasKey("Id"); b.HasIndex("TenantId", "InventoryItemId", "OccurredAt"); b.ToTable("inventory_adjustments", (string)null); }); modelBuilder.Entity("TakeoutSaaS.Domain.Inventory.Entities.InventoryBatch", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("uuid"); b.Property("BatchNumber") .IsRequired() .HasMaxLength(64) .HasColumnType("character varying(64)"); b.Property("CreatedAt") .HasColumnType("timestamp with time zone"); b.Property("CreatedBy") .HasColumnType("uuid"); b.Property("DeletedAt") .HasColumnType("timestamp with time zone"); b.Property("DeletedBy") .HasColumnType("uuid"); b.Property("ExpireDate") .HasColumnType("timestamp with time zone"); b.Property("ProductSkuId") .HasColumnType("uuid"); b.Property("ProductionDate") .HasColumnType("timestamp with time zone"); b.Property("Quantity") .HasColumnType("integer"); b.Property("RemainingQuantity") .HasColumnType("integer"); b.Property("StoreId") .HasColumnType("uuid"); b.Property("TenantId") .HasColumnType("uuid"); b.Property("UpdatedAt") .HasColumnType("timestamp with time zone"); b.Property("UpdatedBy") .HasColumnType("uuid"); b.HasKey("Id"); b.HasIndex("TenantId", "StoreId", "ProductSkuId", "BatchNumber") .IsUnique(); b.ToTable("inventory_batches", (string)null); }); modelBuilder.Entity("TakeoutSaaS.Domain.Inventory.Entities.InventoryItem", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("uuid"); b.Property("BatchNumber") .HasMaxLength(64) .HasColumnType("character varying(64)"); b.Property("CreatedAt") .HasColumnType("timestamp with time zone"); b.Property("CreatedBy") .HasColumnType("uuid"); b.Property("DeletedAt") .HasColumnType("timestamp with time zone"); b.Property("DeletedBy") .HasColumnType("uuid"); b.Property("ExpireDate") .HasColumnType("timestamp with time zone"); b.Property("Location") .HasMaxLength(64) .HasColumnType("character varying(64)"); b.Property("ProductSkuId") .HasColumnType("uuid"); b.Property("QuantityOnHand") .HasColumnType("integer"); b.Property("QuantityReserved") .HasColumnType("integer"); b.Property("SafetyStock") .HasColumnType("integer"); b.Property("StoreId") .HasColumnType("uuid"); b.Property("TenantId") .HasColumnType("uuid"); b.Property("UpdatedAt") .HasColumnType("timestamp with time zone"); b.Property("UpdatedBy") .HasColumnType("uuid"); b.HasKey("Id"); b.HasIndex("TenantId", "StoreId", "ProductSkuId", "BatchNumber"); b.ToTable("inventory_items", (string)null); }); modelBuilder.Entity("TakeoutSaaS.Domain.Membership.Entities.MemberGrowthLog", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("uuid"); b.Property("ChangeValue") .HasColumnType("integer"); b.Property("CreatedAt") .HasColumnType("timestamp with time zone"); b.Property("CreatedBy") .HasColumnType("uuid"); b.Property("CurrentValue") .HasColumnType("integer"); b.Property("DeletedAt") .HasColumnType("timestamp with time zone"); b.Property("DeletedBy") .HasColumnType("uuid"); b.Property("MemberId") .HasColumnType("uuid"); b.Property("Notes") .HasMaxLength(256) .HasColumnType("character varying(256)"); b.Property("OccurredAt") .HasColumnType("timestamp with time zone"); b.Property("TenantId") .HasColumnType("uuid"); b.Property("UpdatedAt") .HasColumnType("timestamp with time zone"); b.Property("UpdatedBy") .HasColumnType("uuid"); b.HasKey("Id"); b.HasIndex("TenantId", "MemberId", "OccurredAt"); b.ToTable("member_growth_logs", (string)null); }); modelBuilder.Entity("TakeoutSaaS.Domain.Membership.Entities.MemberPointLedger", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("uuid"); b.Property("BalanceAfterChange") .HasColumnType("integer"); b.Property("ChangeAmount") .HasColumnType("integer"); b.Property("CreatedAt") .HasColumnType("timestamp with time zone"); b.Property("CreatedBy") .HasColumnType("uuid"); b.Property("DeletedAt") .HasColumnType("timestamp with time zone"); b.Property("DeletedBy") .HasColumnType("uuid"); b.Property("ExpireAt") .HasColumnType("timestamp with time zone"); b.Property("MemberId") .HasColumnType("uuid"); b.Property("OccurredAt") .HasColumnType("timestamp with time zone"); b.Property("Reason") .HasColumnType("integer"); b.Property("SourceId") .HasColumnType("uuid"); b.Property("TenantId") .HasColumnType("uuid"); b.Property("UpdatedAt") .HasColumnType("timestamp with time zone"); b.Property("UpdatedBy") .HasColumnType("uuid"); b.HasKey("Id"); b.HasIndex("TenantId", "MemberId", "OccurredAt"); b.ToTable("member_point_ledgers", (string)null); }); modelBuilder.Entity("TakeoutSaaS.Domain.Membership.Entities.MemberProfile", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("uuid"); b.Property("AvatarUrl") .HasMaxLength(256) .HasColumnType("character varying(256)"); b.Property("BirthDate") .HasColumnType("timestamp with time zone"); b.Property("CreatedAt") .HasColumnType("timestamp with time zone"); b.Property("CreatedBy") .HasColumnType("uuid"); b.Property("DeletedAt") .HasColumnType("timestamp with time zone"); b.Property("DeletedBy") .HasColumnType("uuid"); b.Property("GrowthValue") .HasColumnType("integer"); b.Property("JoinedAt") .HasColumnType("timestamp with time zone"); b.Property("MemberTierId") .HasColumnType("uuid"); b.Property("Mobile") .IsRequired() .HasMaxLength(32) .HasColumnType("character varying(32)"); b.Property("Nickname") .HasMaxLength(64) .HasColumnType("character varying(64)"); b.Property("PointsBalance") .HasColumnType("integer"); b.Property("Status") .HasColumnType("integer"); b.Property("TenantId") .HasColumnType("uuid"); b.Property("UpdatedAt") .HasColumnType("timestamp with time zone"); b.Property("UpdatedBy") .HasColumnType("uuid"); b.Property("UserId") .HasColumnType("uuid"); b.HasKey("Id"); b.HasIndex("TenantId", "Mobile") .IsUnique(); b.ToTable("member_profiles", (string)null); }); modelBuilder.Entity("TakeoutSaaS.Domain.Membership.Entities.MemberTier", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("uuid"); b.Property("BenefitsJson") .IsRequired() .HasColumnType("text"); b.Property("CreatedAt") .HasColumnType("timestamp with time zone"); b.Property("CreatedBy") .HasColumnType("uuid"); b.Property("DeletedAt") .HasColumnType("timestamp with time zone"); b.Property("DeletedBy") .HasColumnType("uuid"); b.Property("Name") .IsRequired() .HasMaxLength(64) .HasColumnType("character varying(64)"); b.Property("RequiredGrowth") .HasColumnType("integer"); b.Property("SortOrder") .HasColumnType("integer"); b.Property("TenantId") .HasColumnType("uuid"); b.Property("UpdatedAt") .HasColumnType("timestamp with time zone"); b.Property("UpdatedBy") .HasColumnType("uuid"); b.HasKey("Id"); b.HasIndex("TenantId", "Name") .IsUnique(); b.ToTable("member_tiers", (string)null); }); modelBuilder.Entity("TakeoutSaaS.Domain.Merchants.Entities.Merchant", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("uuid"); b.Property("Address") .HasMaxLength(256) .HasColumnType("character varying(256)"); b.Property("BrandAlias") .HasMaxLength(64) .HasColumnType("character varying(64)"); b.Property("BrandName") .IsRequired() .HasMaxLength(128) .HasColumnType("character varying(128)"); b.Property("BusinessLicenseImageUrl") .HasColumnType("text"); b.Property("BusinessLicenseNumber") .HasMaxLength(64) .HasColumnType("character varying(64)"); b.Property("Category") .HasColumnType("text"); b.Property("City") .HasMaxLength(64) .HasColumnType("character varying(64)"); b.Property("ContactEmail") .HasMaxLength(128) .HasColumnType("character varying(128)"); b.Property("ContactPhone") .IsRequired() .HasMaxLength(32) .HasColumnType("character varying(32)"); b.Property("CreatedAt") .HasColumnType("timestamp with time zone"); b.Property("CreatedBy") .HasColumnType("uuid"); b.Property("DeletedAt") .HasColumnType("timestamp with time zone"); b.Property("DeletedBy") .HasColumnType("uuid"); b.Property("District") .HasMaxLength(64) .HasColumnType("character varying(64)"); b.Property("JoinedAt") .HasColumnType("timestamp with time zone"); b.Property("LastReviewedAt") .HasColumnType("timestamp with time zone"); b.Property("Latitude") .HasColumnType("double precision"); b.Property("LegalPerson") .HasMaxLength(64) .HasColumnType("character varying(64)"); b.Property("LogoUrl") .HasColumnType("text"); b.Property("Longitude") .HasColumnType("double precision"); b.Property("Province") .HasMaxLength(64) .HasColumnType("character varying(64)"); b.Property("ReviewRemarks") .HasMaxLength(512) .HasColumnType("character varying(512)"); b.Property("ServicePhone") .HasColumnType("text"); b.Property("Status") .HasColumnType("integer"); b.Property("SupportEmail") .HasColumnType("text"); b.Property("TaxNumber") .HasColumnType("text"); b.Property("TenantId") .HasColumnType("uuid"); b.Property("UpdatedAt") .HasColumnType("timestamp with time zone"); b.Property("UpdatedBy") .HasColumnType("uuid"); b.HasKey("Id"); b.HasIndex("TenantId"); b.ToTable("merchants", (string)null); }); modelBuilder.Entity("TakeoutSaaS.Domain.Merchants.Entities.MerchantContract", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("uuid"); b.Property("ContractNumber") .IsRequired() .HasMaxLength(64) .HasColumnType("character varying(64)"); b.Property("CreatedAt") .HasColumnType("timestamp with time zone"); b.Property("CreatedBy") .HasColumnType("uuid"); b.Property("DeletedAt") .HasColumnType("timestamp with time zone"); b.Property("DeletedBy") .HasColumnType("uuid"); b.Property("EndDate") .HasColumnType("timestamp with time zone"); b.Property("FileUrl") .IsRequired() .HasMaxLength(512) .HasColumnType("character varying(512)"); b.Property("MerchantId") .HasColumnType("uuid"); b.Property("SignedAt") .HasColumnType("timestamp with time zone"); b.Property("StartDate") .HasColumnType("timestamp with time zone"); b.Property("Status") .HasColumnType("integer"); b.Property("TenantId") .HasColumnType("uuid"); b.Property("TerminatedAt") .HasColumnType("timestamp with time zone"); b.Property("TerminationReason") .HasMaxLength(256) .HasColumnType("character varying(256)"); b.Property("UpdatedAt") .HasColumnType("timestamp with time zone"); b.Property("UpdatedBy") .HasColumnType("uuid"); b.HasKey("Id"); b.HasIndex("TenantId", "MerchantId", "ContractNumber") .IsUnique(); b.ToTable("merchant_contracts", (string)null); }); modelBuilder.Entity("TakeoutSaaS.Domain.Merchants.Entities.MerchantDocument", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("uuid"); b.Property("CreatedAt") .HasColumnType("timestamp with time zone"); b.Property("CreatedBy") .HasColumnType("uuid"); b.Property("DeletedAt") .HasColumnType("timestamp with time zone"); b.Property("DeletedBy") .HasColumnType("uuid"); b.Property("DocumentNumber") .HasMaxLength(64) .HasColumnType("character varying(64)"); b.Property("DocumentType") .HasColumnType("integer"); b.Property("ExpiresAt") .HasColumnType("timestamp with time zone"); b.Property("FileUrl") .IsRequired() .HasMaxLength(512) .HasColumnType("character varying(512)"); b.Property("IssuedAt") .HasColumnType("timestamp with time zone"); b.Property("MerchantId") .HasColumnType("uuid"); b.Property("Remarks") .HasColumnType("text"); b.Property("Status") .HasColumnType("integer"); b.Property("TenantId") .HasColumnType("uuid"); b.Property("UpdatedAt") .HasColumnType("timestamp with time zone"); b.Property("UpdatedBy") .HasColumnType("uuid"); b.HasKey("Id"); b.HasIndex("TenantId", "MerchantId", "DocumentType"); b.ToTable("merchant_documents", (string)null); }); modelBuilder.Entity("TakeoutSaaS.Domain.Merchants.Entities.MerchantStaff", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("uuid"); b.Property("CreatedAt") .HasColumnType("timestamp with time zone"); b.Property("CreatedBy") .HasColumnType("uuid"); b.Property("DeletedAt") .HasColumnType("timestamp with time zone"); b.Property("DeletedBy") .HasColumnType("uuid"); b.Property("Email") .HasMaxLength(128) .HasColumnType("character varying(128)"); b.Property("IdentityUserId") .HasColumnType("uuid"); b.Property("MerchantId") .HasColumnType("uuid"); b.Property("Name") .IsRequired() .HasMaxLength(64) .HasColumnType("character varying(64)"); b.Property("PermissionsJson") .HasColumnType("text"); b.Property("Phone") .IsRequired() .HasMaxLength(32) .HasColumnType("character varying(32)"); b.Property("RoleType") .HasColumnType("integer"); b.Property("Status") .HasColumnType("integer"); b.Property("StoreId") .HasColumnType("uuid"); b.Property("TenantId") .HasColumnType("uuid"); b.Property("UpdatedAt") .HasColumnType("timestamp with time zone"); b.Property("UpdatedBy") .HasColumnType("uuid"); b.HasKey("Id"); b.HasIndex("TenantId", "MerchantId", "Phone"); b.ToTable("merchant_staff", (string)null); }); modelBuilder.Entity("TakeoutSaaS.Domain.Navigation.Entities.MapLocation", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("uuid"); b.Property("Address") .IsRequired() .HasMaxLength(256) .HasColumnType("character varying(256)"); b.Property("CreatedAt") .HasColumnType("timestamp with time zone"); b.Property("CreatedBy") .HasColumnType("uuid"); b.Property("DeletedAt") .HasColumnType("timestamp with time zone"); b.Property("DeletedBy") .HasColumnType("uuid"); b.Property("Landmark") .HasMaxLength(128) .HasColumnType("character varying(128)"); b.Property("Latitude") .HasColumnType("double precision"); b.Property("Longitude") .HasColumnType("double precision"); b.Property("Name") .IsRequired() .HasMaxLength(128) .HasColumnType("character varying(128)"); b.Property("StoreId") .HasColumnType("uuid"); b.Property("TenantId") .HasColumnType("uuid"); b.Property("UpdatedAt") .HasColumnType("timestamp with time zone"); b.Property("UpdatedBy") .HasColumnType("uuid"); b.HasKey("Id"); b.HasIndex("TenantId", "StoreId"); b.ToTable("map_locations", (string)null); }); modelBuilder.Entity("TakeoutSaaS.Domain.Navigation.Entities.NavigationRequest", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("uuid"); b.Property("Channel") .HasColumnType("integer"); b.Property("CreatedAt") .HasColumnType("timestamp with time zone"); b.Property("CreatedBy") .HasColumnType("uuid"); b.Property("DeletedAt") .HasColumnType("timestamp with time zone"); b.Property("DeletedBy") .HasColumnType("uuid"); b.Property("RequestedAt") .HasColumnType("timestamp with time zone"); b.Property("StoreId") .HasColumnType("uuid"); b.Property("TargetApp") .HasColumnType("integer"); b.Property("TenantId") .HasColumnType("uuid"); b.Property("UpdatedAt") .HasColumnType("timestamp with time zone"); b.Property("UpdatedBy") .HasColumnType("uuid"); b.Property("UserId") .HasColumnType("uuid"); b.HasKey("Id"); b.HasIndex("TenantId", "UserId", "StoreId", "RequestedAt"); b.ToTable("navigation_requests", (string)null); }); modelBuilder.Entity("TakeoutSaaS.Domain.Ordering.Entities.CartItem", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("uuid"); b.Property("AttributesJson") .HasColumnType("text"); b.Property("CreatedAt") .HasColumnType("timestamp with time zone"); b.Property("CreatedBy") .HasColumnType("uuid"); b.Property("DeletedAt") .HasColumnType("timestamp with time zone"); b.Property("DeletedBy") .HasColumnType("uuid"); b.Property("ProductId") .HasColumnType("uuid"); b.Property("ProductName") .IsRequired() .HasMaxLength(128) .HasColumnType("character varying(128)"); b.Property("ProductSkuId") .HasColumnType("uuid"); b.Property("Quantity") .HasColumnType("integer"); b.Property("Remark") .HasMaxLength(256) .HasColumnType("character varying(256)"); b.Property("ShoppingCartId") .HasColumnType("uuid"); b.Property("Status") .HasColumnType("integer"); b.Property("TenantId") .HasColumnType("uuid"); b.Property("UnitPrice") .HasPrecision(18, 2) .HasColumnType("numeric(18,2)"); b.Property("UpdatedAt") .HasColumnType("timestamp with time zone"); b.Property("UpdatedBy") .HasColumnType("uuid"); b.HasKey("Id"); b.HasIndex("TenantId", "ShoppingCartId"); b.ToTable("cart_items", (string)null); }); modelBuilder.Entity("TakeoutSaaS.Domain.Ordering.Entities.CartItemAddon", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("uuid"); b.Property("CartItemId") .HasColumnType("uuid"); b.Property("CreatedAt") .HasColumnType("timestamp with time zone"); b.Property("CreatedBy") .HasColumnType("uuid"); b.Property("DeletedAt") .HasColumnType("timestamp with time zone"); b.Property("DeletedBy") .HasColumnType("uuid"); b.Property("ExtraPrice") .HasPrecision(18, 2) .HasColumnType("numeric(18,2)"); b.Property("Name") .IsRequired() .HasMaxLength(64) .HasColumnType("character varying(64)"); b.Property("OptionId") .HasColumnType("uuid"); b.Property("TenantId") .HasColumnType("uuid"); b.Property("UpdatedAt") .HasColumnType("timestamp with time zone"); b.Property("UpdatedBy") .HasColumnType("uuid"); b.HasKey("Id"); b.ToTable("cart_item_addons", (string)null); }); modelBuilder.Entity("TakeoutSaaS.Domain.Ordering.Entities.CheckoutSession", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("uuid"); b.Property("CreatedAt") .HasColumnType("timestamp with time zone"); b.Property("CreatedBy") .HasColumnType("uuid"); b.Property("DeletedAt") .HasColumnType("timestamp with time zone"); b.Property("DeletedBy") .HasColumnType("uuid"); b.Property("ExpiresAt") .HasColumnType("timestamp with time zone"); b.Property("SessionToken") .IsRequired() .HasMaxLength(64) .HasColumnType("character varying(64)"); b.Property("Status") .HasColumnType("integer"); b.Property("StoreId") .HasColumnType("uuid"); b.Property("TenantId") .HasColumnType("uuid"); b.Property("UpdatedAt") .HasColumnType("timestamp with time zone"); b.Property("UpdatedBy") .HasColumnType("uuid"); b.Property("UserId") .HasColumnType("uuid"); b.Property("ValidationResultJson") .IsRequired() .HasColumnType("text"); b.HasKey("Id"); b.HasIndex("TenantId", "SessionToken") .IsUnique(); b.ToTable("checkout_sessions", (string)null); }); modelBuilder.Entity("TakeoutSaaS.Domain.Ordering.Entities.ShoppingCart", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("uuid"); b.Property("CreatedAt") .HasColumnType("timestamp with time zone"); b.Property("CreatedBy") .HasColumnType("uuid"); b.Property("DeletedAt") .HasColumnType("timestamp with time zone"); b.Property("DeletedBy") .HasColumnType("uuid"); b.Property("DeliveryPreference") .HasMaxLength(32) .HasColumnType("character varying(32)"); b.Property("LastModifiedAt") .HasColumnType("timestamp with time zone"); b.Property("Status") .HasColumnType("integer"); b.Property("StoreId") .HasColumnType("uuid"); b.Property("TableContext") .HasMaxLength(64) .HasColumnType("character varying(64)"); b.Property("TenantId") .HasColumnType("uuid"); b.Property("UpdatedAt") .HasColumnType("timestamp with time zone"); b.Property("UpdatedBy") .HasColumnType("uuid"); b.Property("UserId") .HasColumnType("uuid"); b.HasKey("Id"); b.HasIndex("TenantId", "UserId", "StoreId") .IsUnique(); b.ToTable("shopping_carts", (string)null); }); modelBuilder.Entity("TakeoutSaaS.Domain.Orders.Entities.Order", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("uuid"); b.Property("CancelReason") .HasMaxLength(256) .HasColumnType("character varying(256)"); b.Property("CancelledAt") .HasColumnType("timestamp with time zone"); b.Property("Channel") .HasColumnType("integer"); b.Property("CreatedAt") .HasColumnType("timestamp with time zone"); b.Property("CreatedBy") .HasColumnType("uuid"); b.Property("CustomerName") .HasMaxLength(64) .HasColumnType("character varying(64)"); b.Property("CustomerPhone") .HasMaxLength(32) .HasColumnType("character varying(32)"); b.Property("DeletedAt") .HasColumnType("timestamp with time zone"); b.Property("DeletedBy") .HasColumnType("uuid"); b.Property("DeliveryType") .HasColumnType("integer"); b.Property("DiscountAmount") .HasPrecision(18, 2) .HasColumnType("numeric(18,2)"); b.Property("FinishedAt") .HasColumnType("timestamp with time zone"); b.Property("ItemsAmount") .HasPrecision(18, 2) .HasColumnType("numeric(18,2)"); b.Property("OrderNo") .IsRequired() .HasMaxLength(32) .HasColumnType("character varying(32)"); b.Property("PaidAmount") .HasPrecision(18, 2) .HasColumnType("numeric(18,2)"); b.Property("PaidAt") .HasColumnType("timestamp with time zone"); b.Property("PayableAmount") .HasPrecision(18, 2) .HasColumnType("numeric(18,2)"); b.Property("PaymentStatus") .HasColumnType("integer"); b.Property("QueueNumber") .HasMaxLength(32) .HasColumnType("character varying(32)"); b.Property("Remark") .HasMaxLength(512) .HasColumnType("character varying(512)"); b.Property("ReservationId") .HasColumnType("uuid"); b.Property("Status") .HasColumnType("integer"); b.Property("StoreId") .HasColumnType("uuid"); b.Property("TableNo") .HasMaxLength(32) .HasColumnType("character varying(32)"); b.Property("TenantId") .HasColumnType("uuid"); b.Property("UpdatedAt") .HasColumnType("timestamp with time zone"); b.Property("UpdatedBy") .HasColumnType("uuid"); b.HasKey("Id"); b.HasIndex("TenantId", "OrderNo") .IsUnique(); b.HasIndex("TenantId", "StoreId", "Status"); b.ToTable("orders", (string)null); }); modelBuilder.Entity("TakeoutSaaS.Domain.Orders.Entities.OrderItem", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("uuid"); b.Property("AttributesJson") .HasColumnType("text"); b.Property("CreatedAt") .HasColumnType("timestamp with time zone"); b.Property("CreatedBy") .HasColumnType("uuid"); b.Property("DeletedAt") .HasColumnType("timestamp with time zone"); b.Property("DeletedBy") .HasColumnType("uuid"); b.Property("DiscountAmount") .HasPrecision(18, 2) .HasColumnType("numeric(18,2)"); b.Property("OrderId") .HasColumnType("uuid"); b.Property("ProductId") .HasColumnType("uuid"); b.Property("ProductName") .IsRequired() .HasMaxLength(128) .HasColumnType("character varying(128)"); b.Property("Quantity") .HasColumnType("integer"); b.Property("SkuName") .HasMaxLength(128) .HasColumnType("character varying(128)"); b.Property("SubTotal") .HasPrecision(18, 2) .HasColumnType("numeric(18,2)"); b.Property("TenantId") .HasColumnType("uuid"); b.Property("Unit") .HasMaxLength(16) .HasColumnType("character varying(16)"); b.Property("UnitPrice") .HasPrecision(18, 2) .HasColumnType("numeric(18,2)"); b.Property("UpdatedAt") .HasColumnType("timestamp with time zone"); b.Property("UpdatedBy") .HasColumnType("uuid"); b.HasKey("Id"); b.HasIndex("OrderId"); b.HasIndex("TenantId", "OrderId"); b.ToTable("order_items", (string)null); }); modelBuilder.Entity("TakeoutSaaS.Domain.Orders.Entities.OrderStatusHistory", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("uuid"); b.Property("CreatedAt") .HasColumnType("timestamp with time zone"); b.Property("CreatedBy") .HasColumnType("uuid"); b.Property("DeletedAt") .HasColumnType("timestamp with time zone"); b.Property("DeletedBy") .HasColumnType("uuid"); b.Property("Notes") .HasMaxLength(256) .HasColumnType("character varying(256)"); b.Property("OccurredAt") .HasColumnType("timestamp with time zone"); b.Property("OperatorId") .HasColumnType("uuid"); b.Property("OrderId") .HasColumnType("uuid"); b.Property("Status") .HasColumnType("integer"); b.Property("TenantId") .HasColumnType("uuid"); b.Property("UpdatedAt") .HasColumnType("timestamp with time zone"); b.Property("UpdatedBy") .HasColumnType("uuid"); b.HasKey("Id"); b.HasIndex("TenantId", "OrderId", "OccurredAt"); b.ToTable("order_status_histories", (string)null); }); modelBuilder.Entity("TakeoutSaaS.Domain.Orders.Entities.RefundRequest", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("uuid"); b.Property("Amount") .HasPrecision(18, 2) .HasColumnType("numeric(18,2)"); b.Property("CreatedAt") .HasColumnType("timestamp with time zone"); b.Property("CreatedBy") .HasColumnType("uuid"); b.Property("DeletedAt") .HasColumnType("timestamp with time zone"); b.Property("DeletedBy") .HasColumnType("uuid"); b.Property("OrderId") .HasColumnType("uuid"); b.Property("ProcessedAt") .HasColumnType("timestamp with time zone"); b.Property("Reason") .IsRequired() .HasMaxLength(256) .HasColumnType("character varying(256)"); b.Property("RefundNo") .IsRequired() .HasMaxLength(32) .HasColumnType("character varying(32)"); b.Property("RequestedAt") .HasColumnType("timestamp with time zone"); b.Property("ReviewNotes") .HasMaxLength(256) .HasColumnType("character varying(256)"); b.Property("Status") .HasColumnType("integer"); b.Property("TenantId") .HasColumnType("uuid"); b.Property("UpdatedAt") .HasColumnType("timestamp with time zone"); b.Property("UpdatedBy") .HasColumnType("uuid"); b.HasKey("Id"); b.HasIndex("TenantId", "RefundNo") .IsUnique(); b.ToTable("refund_requests", (string)null); }); modelBuilder.Entity("TakeoutSaaS.Domain.Payments.Entities.PaymentRecord", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("uuid"); b.Property("Amount") .HasPrecision(18, 2) .HasColumnType("numeric(18,2)"); b.Property("ChannelTransactionId") .HasMaxLength(64) .HasColumnType("character varying(64)"); b.Property("CreatedAt") .HasColumnType("timestamp with time zone"); b.Property("CreatedBy") .HasColumnType("uuid"); b.Property("DeletedAt") .HasColumnType("timestamp with time zone"); b.Property("DeletedBy") .HasColumnType("uuid"); b.Property("Method") .HasColumnType("integer"); b.Property("OrderId") .HasColumnType("uuid"); b.Property("PaidAt") .HasColumnType("timestamp with time zone"); b.Property("Payload") .HasColumnType("text"); b.Property("Remark") .HasMaxLength(256) .HasColumnType("character varying(256)"); b.Property("Status") .HasColumnType("integer"); b.Property("TenantId") .HasColumnType("uuid"); b.Property("TradeNo") .HasMaxLength(64) .HasColumnType("character varying(64)"); b.Property("UpdatedAt") .HasColumnType("timestamp with time zone"); b.Property("UpdatedBy") .HasColumnType("uuid"); b.HasKey("Id"); b.HasIndex("TenantId", "OrderId"); b.ToTable("payment_records", (string)null); }); modelBuilder.Entity("TakeoutSaaS.Domain.Payments.Entities.PaymentRefundRecord", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("uuid"); b.Property("Amount") .HasPrecision(18, 2) .HasColumnType("numeric(18,2)"); b.Property("ChannelRefundId") .HasMaxLength(64) .HasColumnType("character varying(64)"); b.Property("CompletedAt") .HasColumnType("timestamp with time zone"); b.Property("CreatedAt") .HasColumnType("timestamp with time zone"); b.Property("CreatedBy") .HasColumnType("uuid"); b.Property("DeletedAt") .HasColumnType("timestamp with time zone"); b.Property("DeletedBy") .HasColumnType("uuid"); b.Property("OrderId") .HasColumnType("uuid"); b.Property("Payload") .HasColumnType("text"); b.Property("PaymentRecordId") .HasColumnType("uuid"); b.Property("RequestedAt") .HasColumnType("timestamp with time zone"); b.Property("Status") .HasColumnType("integer"); b.Property("TenantId") .HasColumnType("uuid"); b.Property("UpdatedAt") .HasColumnType("timestamp with time zone"); b.Property("UpdatedBy") .HasColumnType("uuid"); b.HasKey("Id"); b.HasIndex("TenantId", "PaymentRecordId"); b.ToTable("payment_refund_records", (string)null); }); modelBuilder.Entity("TakeoutSaaS.Domain.Products.Entities.Product", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("uuid"); b.Property("CategoryId") .HasColumnType("uuid"); b.Property("CoverImage") .HasMaxLength(256) .HasColumnType("character varying(256)"); b.Property("CreatedAt") .HasColumnType("timestamp with time zone"); b.Property("CreatedBy") .HasColumnType("uuid"); b.Property("DeletedAt") .HasColumnType("timestamp with time zone"); b.Property("DeletedBy") .HasColumnType("uuid"); b.Property("Description") .HasColumnType("text"); b.Property("EnableDelivery") .HasColumnType("boolean"); b.Property("EnableDineIn") .HasColumnType("boolean"); b.Property("EnablePickup") .HasColumnType("boolean"); b.Property("GalleryImages") .HasMaxLength(1024) .HasColumnType("character varying(1024)"); b.Property("IsFeatured") .HasColumnType("boolean"); b.Property("MaxQuantityPerOrder") .HasColumnType("integer"); b.Property("Name") .IsRequired() .HasMaxLength(128) .HasColumnType("character varying(128)"); b.Property("OriginalPrice") .HasPrecision(18, 2) .HasColumnType("numeric(18,2)"); b.Property("Price") .HasPrecision(18, 2) .HasColumnType("numeric(18,2)"); b.Property("SpuCode") .IsRequired() .HasMaxLength(32) .HasColumnType("character varying(32)"); b.Property("Status") .HasColumnType("integer"); b.Property("StockQuantity") .HasColumnType("integer"); b.Property("StoreId") .HasColumnType("uuid"); b.Property("Subtitle") .HasMaxLength(256) .HasColumnType("character varying(256)"); b.Property("TenantId") .HasColumnType("uuid"); b.Property("Unit") .HasMaxLength(16) .HasColumnType("character varying(16)"); b.Property("UpdatedAt") .HasColumnType("timestamp with time zone"); b.Property("UpdatedBy") .HasColumnType("uuid"); b.HasKey("Id"); b.HasIndex("TenantId", "SpuCode") .IsUnique(); b.HasIndex("TenantId", "StoreId"); b.ToTable("products", (string)null); }); modelBuilder.Entity("TakeoutSaaS.Domain.Products.Entities.ProductAddonGroup", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("uuid"); b.Property("CreatedAt") .HasColumnType("timestamp with time zone"); b.Property("CreatedBy") .HasColumnType("uuid"); b.Property("DeletedAt") .HasColumnType("timestamp with time zone"); b.Property("DeletedBy") .HasColumnType("uuid"); b.Property("IsRequired") .HasColumnType("boolean"); b.Property("MaxSelect") .HasColumnType("integer"); b.Property("MinSelect") .HasColumnType("integer"); b.Property("Name") .IsRequired() .HasMaxLength(64) .HasColumnType("character varying(64)"); b.Property("ProductId") .HasColumnType("uuid"); b.Property("SelectionType") .HasColumnType("integer"); b.Property("SortOrder") .HasColumnType("integer"); b.Property("TenantId") .HasColumnType("uuid"); b.Property("UpdatedAt") .HasColumnType("timestamp with time zone"); b.Property("UpdatedBy") .HasColumnType("uuid"); b.HasKey("Id"); b.HasIndex("TenantId", "ProductId", "Name"); b.ToTable("product_addon_groups", (string)null); }); modelBuilder.Entity("TakeoutSaaS.Domain.Products.Entities.ProductAddonOption", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("uuid"); b.Property("AddonGroupId") .HasColumnType("uuid"); b.Property("CreatedAt") .HasColumnType("timestamp with time zone"); b.Property("CreatedBy") .HasColumnType("uuid"); b.Property("DeletedAt") .HasColumnType("timestamp with time zone"); b.Property("DeletedBy") .HasColumnType("uuid"); b.Property("ExtraPrice") .HasPrecision(18, 2) .HasColumnType("numeric(18,2)"); b.Property("IsDefault") .HasColumnType("boolean"); b.Property("Name") .IsRequired() .HasMaxLength(64) .HasColumnType("character varying(64)"); b.Property("SortOrder") .HasColumnType("integer"); b.Property("TenantId") .HasColumnType("uuid"); b.Property("UpdatedAt") .HasColumnType("timestamp with time zone"); b.Property("UpdatedBy") .HasColumnType("uuid"); b.HasKey("Id"); b.ToTable("product_addon_options", (string)null); }); modelBuilder.Entity("TakeoutSaaS.Domain.Products.Entities.ProductAttributeGroup", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("uuid"); b.Property("CreatedAt") .HasColumnType("timestamp with time zone"); b.Property("CreatedBy") .HasColumnType("uuid"); b.Property("DeletedAt") .HasColumnType("timestamp with time zone"); b.Property("DeletedBy") .HasColumnType("uuid"); b.Property("IsRequired") .HasColumnType("boolean"); b.Property("Name") .IsRequired() .HasMaxLength(64) .HasColumnType("character varying(64)"); b.Property("SelectionType") .HasColumnType("integer"); b.Property("SortOrder") .HasColumnType("integer"); b.Property("StoreId") .HasColumnType("uuid"); b.Property("TenantId") .HasColumnType("uuid"); b.Property("UpdatedAt") .HasColumnType("timestamp with time zone"); b.Property("UpdatedBy") .HasColumnType("uuid"); b.HasKey("Id"); b.HasIndex("TenantId", "StoreId", "Name"); b.ToTable("product_attribute_groups", (string)null); }); modelBuilder.Entity("TakeoutSaaS.Domain.Products.Entities.ProductAttributeOption", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("uuid"); b.Property("AttributeGroupId") .HasColumnType("uuid"); b.Property("CreatedAt") .HasColumnType("timestamp with time zone"); b.Property("CreatedBy") .HasColumnType("uuid"); b.Property("DeletedAt") .HasColumnType("timestamp with time zone"); b.Property("DeletedBy") .HasColumnType("uuid"); b.Property("ExtraPrice") .HasPrecision(18, 2) .HasColumnType("numeric(18,2)"); b.Property("IsDefault") .HasColumnType("boolean"); b.Property("Name") .IsRequired() .HasMaxLength(64) .HasColumnType("character varying(64)"); b.Property("SortOrder") .HasColumnType("integer"); b.Property("TenantId") .HasColumnType("uuid"); b.Property("UpdatedAt") .HasColumnType("timestamp with time zone"); b.Property("UpdatedBy") .HasColumnType("uuid"); b.HasKey("Id"); b.HasIndex("TenantId", "AttributeGroupId", "Name") .IsUnique(); b.ToTable("product_attribute_options", (string)null); }); modelBuilder.Entity("TakeoutSaaS.Domain.Products.Entities.ProductCategory", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("uuid"); b.Property("CreatedAt") .HasColumnType("timestamp with time zone"); b.Property("CreatedBy") .HasColumnType("uuid"); b.Property("DeletedAt") .HasColumnType("timestamp with time zone"); b.Property("DeletedBy") .HasColumnType("uuid"); b.Property("Description") .HasMaxLength(256) .HasColumnType("character varying(256)"); b.Property("IsEnabled") .HasColumnType("boolean"); b.Property("Name") .IsRequired() .HasMaxLength(64) .HasColumnType("character varying(64)"); b.Property("SortOrder") .HasColumnType("integer"); b.Property("StoreId") .HasColumnType("uuid"); b.Property("TenantId") .HasColumnType("uuid"); b.Property("UpdatedAt") .HasColumnType("timestamp with time zone"); b.Property("UpdatedBy") .HasColumnType("uuid"); b.HasKey("Id"); b.HasIndex("TenantId", "StoreId"); b.ToTable("product_categories", (string)null); }); modelBuilder.Entity("TakeoutSaaS.Domain.Products.Entities.ProductMediaAsset", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("uuid"); b.Property("Caption") .HasMaxLength(256) .HasColumnType("character varying(256)"); b.Property("CreatedAt") .HasColumnType("timestamp with time zone"); b.Property("CreatedBy") .HasColumnType("uuid"); b.Property("DeletedAt") .HasColumnType("timestamp with time zone"); b.Property("DeletedBy") .HasColumnType("uuid"); b.Property("MediaType") .HasColumnType("integer"); b.Property("ProductId") .HasColumnType("uuid"); b.Property("SortOrder") .HasColumnType("integer"); b.Property("TenantId") .HasColumnType("uuid"); b.Property("UpdatedAt") .HasColumnType("timestamp with time zone"); b.Property("UpdatedBy") .HasColumnType("uuid"); b.Property("Url") .IsRequired() .HasMaxLength(512) .HasColumnType("character varying(512)"); b.HasKey("Id"); b.ToTable("product_media_assets", (string)null); }); modelBuilder.Entity("TakeoutSaaS.Domain.Products.Entities.ProductPricingRule", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("uuid"); b.Property("ConditionsJson") .IsRequired() .HasColumnType("text"); b.Property("CreatedAt") .HasColumnType("timestamp with time zone"); b.Property("CreatedBy") .HasColumnType("uuid"); b.Property("DeletedAt") .HasColumnType("timestamp with time zone"); b.Property("DeletedBy") .HasColumnType("uuid"); b.Property("EndTime") .HasColumnType("timestamp with time zone"); b.Property("Price") .HasPrecision(18, 2) .HasColumnType("numeric(18,2)"); b.Property("ProductId") .HasColumnType("uuid"); b.Property("RuleType") .HasColumnType("integer"); b.Property("StartTime") .HasColumnType("timestamp with time zone"); b.Property("TenantId") .HasColumnType("uuid"); b.Property("UpdatedAt") .HasColumnType("timestamp with time zone"); b.Property("UpdatedBy") .HasColumnType("uuid"); b.Property("WeekdaysJson") .HasColumnType("text"); b.HasKey("Id"); b.HasIndex("TenantId", "ProductId", "RuleType"); b.ToTable("product_pricing_rules", (string)null); }); modelBuilder.Entity("TakeoutSaaS.Domain.Products.Entities.ProductSku", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("uuid"); b.Property("AttributesJson") .IsRequired() .HasColumnType("text"); b.Property("Barcode") .HasMaxLength(64) .HasColumnType("character varying(64)"); b.Property("CreatedAt") .HasColumnType("timestamp with time zone"); b.Property("CreatedBy") .HasColumnType("uuid"); b.Property("DeletedAt") .HasColumnType("timestamp with time zone"); b.Property("DeletedBy") .HasColumnType("uuid"); b.Property("OriginalPrice") .HasPrecision(18, 2) .HasColumnType("numeric(18,2)"); b.Property("Price") .HasPrecision(18, 2) .HasColumnType("numeric(18,2)"); b.Property("ProductId") .HasColumnType("uuid"); b.Property("SkuCode") .IsRequired() .HasMaxLength(32) .HasColumnType("character varying(32)"); b.Property("StockQuantity") .HasColumnType("integer"); b.Property("TenantId") .HasColumnType("uuid"); b.Property("UpdatedAt") .HasColumnType("timestamp with time zone"); b.Property("UpdatedBy") .HasColumnType("uuid"); b.Property("Weight") .HasPrecision(10, 3) .HasColumnType("numeric(10,3)"); b.HasKey("Id"); b.HasIndex("TenantId", "SkuCode") .IsUnique(); b.ToTable("product_skus", (string)null); }); modelBuilder.Entity("TakeoutSaaS.Domain.Queues.Entities.QueueTicket", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("uuid"); b.Property("CalledAt") .HasColumnType("timestamp with time zone"); b.Property("CancelledAt") .HasColumnType("timestamp with time zone"); b.Property("CreatedAt") .HasColumnType("timestamp with time zone"); b.Property("CreatedBy") .HasColumnType("uuid"); b.Property("DeletedAt") .HasColumnType("timestamp with time zone"); b.Property("DeletedBy") .HasColumnType("uuid"); b.Property("EstimatedWaitMinutes") .HasColumnType("integer"); b.Property("ExpiredAt") .HasColumnType("timestamp with time zone"); b.Property("PartySize") .HasColumnType("integer"); b.Property("Remark") .HasMaxLength(256) .HasColumnType("character varying(256)"); b.Property("Status") .HasColumnType("integer"); b.Property("StoreId") .HasColumnType("uuid"); b.Property("TenantId") .HasColumnType("uuid"); b.Property("TicketNumber") .IsRequired() .HasMaxLength(32) .HasColumnType("character varying(32)"); b.Property("UpdatedAt") .HasColumnType("timestamp with time zone"); b.Property("UpdatedBy") .HasColumnType("uuid"); b.HasKey("Id"); b.HasIndex("TenantId", "StoreId"); b.HasIndex("TenantId", "StoreId", "TicketNumber") .IsUnique(); b.ToTable("queue_tickets", (string)null); }); modelBuilder.Entity("TakeoutSaaS.Domain.Reservations.Entities.Reservation", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("uuid"); b.Property("CancelledAt") .HasColumnType("timestamp with time zone"); b.Property("CheckInCode") .HasMaxLength(32) .HasColumnType("character varying(32)"); b.Property("CheckedInAt") .HasColumnType("timestamp with time zone"); b.Property("CreatedAt") .HasColumnType("timestamp with time zone"); b.Property("CreatedBy") .HasColumnType("uuid"); b.Property("CustomerName") .IsRequired() .HasMaxLength(64) .HasColumnType("character varying(64)"); b.Property("CustomerPhone") .IsRequired() .HasMaxLength(32) .HasColumnType("character varying(32)"); b.Property("DeletedAt") .HasColumnType("timestamp with time zone"); b.Property("DeletedBy") .HasColumnType("uuid"); b.Property("PeopleCount") .HasColumnType("integer"); b.Property("Remark") .HasMaxLength(512) .HasColumnType("character varying(512)"); b.Property("ReservationNo") .IsRequired() .HasMaxLength(32) .HasColumnType("character varying(32)"); b.Property("ReservationTime") .HasColumnType("timestamp with time zone"); b.Property("Status") .HasColumnType("integer"); b.Property("StoreId") .HasColumnType("uuid"); b.Property("TablePreference") .HasMaxLength(64) .HasColumnType("character varying(64)"); b.Property("TenantId") .HasColumnType("uuid"); b.Property("UpdatedAt") .HasColumnType("timestamp with time zone"); b.Property("UpdatedBy") .HasColumnType("uuid"); b.HasKey("Id"); b.HasIndex("TenantId", "ReservationNo") .IsUnique(); b.HasIndex("TenantId", "StoreId"); b.ToTable("reservations", (string)null); }); modelBuilder.Entity("TakeoutSaaS.Domain.Stores.Entities.Store", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("uuid"); b.Property("Address") .HasMaxLength(256) .HasColumnType("character varying(256)"); b.Property("Announcement") .HasMaxLength(512) .HasColumnType("character varying(512)"); b.Property("BusinessHours") .HasMaxLength(256) .HasColumnType("character varying(256)"); b.Property("City") .HasMaxLength(64) .HasColumnType("character varying(64)"); b.Property("Code") .IsRequired() .HasMaxLength(32) .HasColumnType("character varying(32)"); b.Property("Country") .HasColumnType("text"); b.Property("CoverImageUrl") .HasColumnType("text"); b.Property("CreatedAt") .HasColumnType("timestamp with time zone"); b.Property("CreatedBy") .HasColumnType("uuid"); b.Property("DeletedAt") .HasColumnType("timestamp with time zone"); b.Property("DeletedBy") .HasColumnType("uuid"); b.Property("DeliveryRadiusKm") .HasPrecision(6, 2) .HasColumnType("numeric(6,2)"); b.Property("Description") .HasColumnType("text"); b.Property("District") .HasMaxLength(64) .HasColumnType("character varying(64)"); b.Property("Latitude") .HasColumnType("double precision"); b.Property("Longitude") .HasColumnType("double precision"); b.Property("ManagerName") .HasMaxLength(64) .HasColumnType("character varying(64)"); b.Property("MerchantId") .HasColumnType("uuid"); b.Property("Name") .IsRequired() .HasMaxLength(128) .HasColumnType("character varying(128)"); b.Property("Phone") .HasMaxLength(32) .HasColumnType("character varying(32)"); b.Property("Province") .HasMaxLength(64) .HasColumnType("character varying(64)"); b.Property("Status") .HasColumnType("integer"); b.Property("SupportsDelivery") .HasColumnType("boolean"); b.Property("SupportsDineIn") .HasColumnType("boolean"); b.Property("SupportsPickup") .HasColumnType("boolean"); b.Property("SupportsQueueing") .HasColumnType("boolean"); b.Property("SupportsReservation") .HasColumnType("boolean"); b.Property("Tags") .HasColumnType("text"); b.Property("TenantId") .HasColumnType("uuid"); b.Property("UpdatedAt") .HasColumnType("timestamp with time zone"); b.Property("UpdatedBy") .HasColumnType("uuid"); b.HasKey("Id"); b.HasIndex("TenantId", "Code") .IsUnique(); b.HasIndex("TenantId", "MerchantId"); b.ToTable("stores", (string)null); }); modelBuilder.Entity("TakeoutSaaS.Domain.Stores.Entities.StoreBusinessHour", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("uuid"); b.Property("CapacityLimit") .HasColumnType("integer"); b.Property("CreatedAt") .HasColumnType("timestamp with time zone"); b.Property("CreatedBy") .HasColumnType("uuid"); b.Property("DayOfWeek") .HasColumnType("integer"); b.Property("DeletedAt") .HasColumnType("timestamp with time zone"); b.Property("DeletedBy") .HasColumnType("uuid"); b.Property("EndTime") .HasColumnType("interval"); b.Property("HourType") .HasColumnType("integer"); b.Property("Notes") .HasMaxLength(256) .HasColumnType("character varying(256)"); b.Property("StartTime") .HasColumnType("interval"); b.Property("StoreId") .HasColumnType("uuid"); b.Property("TenantId") .HasColumnType("uuid"); b.Property("UpdatedAt") .HasColumnType("timestamp with time zone"); b.Property("UpdatedBy") .HasColumnType("uuid"); b.HasKey("Id"); b.HasIndex("TenantId", "StoreId", "DayOfWeek"); b.ToTable("store_business_hours", (string)null); }); modelBuilder.Entity("TakeoutSaaS.Domain.Stores.Entities.StoreDeliveryZone", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("uuid"); b.Property("CreatedAt") .HasColumnType("timestamp with time zone"); b.Property("CreatedBy") .HasColumnType("uuid"); b.Property("DeletedAt") .HasColumnType("timestamp with time zone"); b.Property("DeletedBy") .HasColumnType("uuid"); b.Property("DeliveryFee") .HasPrecision(18, 2) .HasColumnType("numeric(18,2)"); b.Property("EstimatedMinutes") .HasColumnType("integer"); b.Property("MinimumOrderAmount") .HasPrecision(18, 2) .HasColumnType("numeric(18,2)"); b.Property("PolygonGeoJson") .IsRequired() .HasColumnType("text"); b.Property("StoreId") .HasColumnType("uuid"); b.Property("TenantId") .HasColumnType("uuid"); b.Property("UpdatedAt") .HasColumnType("timestamp with time zone"); b.Property("UpdatedBy") .HasColumnType("uuid"); b.Property("ZoneName") .IsRequired() .HasMaxLength(64) .HasColumnType("character varying(64)"); b.HasKey("Id"); b.HasIndex("TenantId", "StoreId", "ZoneName"); b.ToTable("store_delivery_zones", (string)null); }); modelBuilder.Entity("TakeoutSaaS.Domain.Stores.Entities.StoreEmployeeShift", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("uuid"); b.Property("CreatedAt") .HasColumnType("timestamp with time zone"); b.Property("CreatedBy") .HasColumnType("uuid"); b.Property("DeletedAt") .HasColumnType("timestamp with time zone"); b.Property("DeletedBy") .HasColumnType("uuid"); b.Property("EndTime") .HasColumnType("interval"); b.Property("Notes") .HasMaxLength(256) .HasColumnType("character varying(256)"); b.Property("RoleType") .HasColumnType("integer"); b.Property("ShiftDate") .HasColumnType("timestamp with time zone"); b.Property("StaffId") .HasColumnType("uuid"); b.Property("StartTime") .HasColumnType("interval"); b.Property("StoreId") .HasColumnType("uuid"); b.Property("TenantId") .HasColumnType("uuid"); b.Property("UpdatedAt") .HasColumnType("timestamp with time zone"); b.Property("UpdatedBy") .HasColumnType("uuid"); b.HasKey("Id"); b.HasIndex("TenantId", "StoreId", "ShiftDate", "StaffId") .IsUnique(); b.ToTable("store_employee_shifts", (string)null); }); modelBuilder.Entity("TakeoutSaaS.Domain.Stores.Entities.StoreHoliday", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("uuid"); b.Property("CreatedAt") .HasColumnType("timestamp with time zone"); b.Property("CreatedBy") .HasColumnType("uuid"); b.Property("Date") .HasColumnType("timestamp with time zone"); b.Property("DeletedAt") .HasColumnType("timestamp with time zone"); b.Property("DeletedBy") .HasColumnType("uuid"); b.Property("IsClosed") .HasColumnType("boolean"); b.Property("Reason") .HasMaxLength(256) .HasColumnType("character varying(256)"); b.Property("StoreId") .HasColumnType("uuid"); b.Property("TenantId") .HasColumnType("uuid"); b.Property("UpdatedAt") .HasColumnType("timestamp with time zone"); b.Property("UpdatedBy") .HasColumnType("uuid"); b.HasKey("Id"); b.HasIndex("TenantId", "StoreId", "Date") .IsUnique(); b.ToTable("store_holidays", (string)null); }); modelBuilder.Entity("TakeoutSaaS.Domain.Stores.Entities.StoreTable", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("uuid"); b.Property("AreaId") .HasColumnType("uuid"); b.Property("Capacity") .HasColumnType("integer"); b.Property("CreatedAt") .HasColumnType("timestamp with time zone"); b.Property("CreatedBy") .HasColumnType("uuid"); b.Property("DeletedAt") .HasColumnType("timestamp with time zone"); b.Property("DeletedBy") .HasColumnType("uuid"); b.Property("QrCodeUrl") .HasMaxLength(512) .HasColumnType("character varying(512)"); b.Property("Status") .HasColumnType("integer"); b.Property("StoreId") .HasColumnType("uuid"); b.Property("TableCode") .IsRequired() .HasMaxLength(32) .HasColumnType("character varying(32)"); b.Property("Tags") .HasMaxLength(128) .HasColumnType("character varying(128)"); b.Property("TenantId") .HasColumnType("uuid"); b.Property("UpdatedAt") .HasColumnType("timestamp with time zone"); b.Property("UpdatedBy") .HasColumnType("uuid"); b.HasKey("Id"); b.HasIndex("TenantId", "StoreId", "TableCode") .IsUnique(); b.ToTable("store_tables", (string)null); }); modelBuilder.Entity("TakeoutSaaS.Domain.Stores.Entities.StoreTableArea", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("uuid"); b.Property("CreatedAt") .HasColumnType("timestamp with time zone"); b.Property("CreatedBy") .HasColumnType("uuid"); b.Property("DeletedAt") .HasColumnType("timestamp with time zone"); b.Property("DeletedBy") .HasColumnType("uuid"); b.Property("Description") .HasMaxLength(256) .HasColumnType("character varying(256)"); b.Property("Name") .IsRequired() .HasMaxLength(64) .HasColumnType("character varying(64)"); b.Property("StoreId") .HasColumnType("uuid"); b.Property("TenantId") .HasColumnType("uuid"); b.Property("UpdatedAt") .HasColumnType("timestamp with time zone"); b.Property("UpdatedBy") .HasColumnType("uuid"); b.HasKey("Id"); b.HasIndex("TenantId", "StoreId", "Name") .IsUnique(); b.ToTable("store_table_areas", (string)null); }); modelBuilder.Entity("TakeoutSaaS.Domain.Tenants.Entities.Tenant", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("uuid"); b.Property("Address") .HasColumnType("text"); b.Property("City") .HasColumnType("text"); b.Property("Code") .IsRequired() .HasMaxLength(64) .HasColumnType("character varying(64)"); b.Property("ContactEmail") .HasMaxLength(128) .HasColumnType("character varying(128)"); b.Property("ContactName") .HasMaxLength(64) .HasColumnType("character varying(64)"); b.Property("ContactPhone") .HasMaxLength(32) .HasColumnType("character varying(32)"); b.Property("Country") .HasColumnType("text"); b.Property("CoverImageUrl") .HasColumnType("text"); b.Property("CreatedAt") .HasColumnType("timestamp with time zone"); b.Property("CreatedBy") .HasColumnType("uuid"); b.Property("DeletedAt") .HasColumnType("timestamp with time zone"); b.Property("DeletedBy") .HasColumnType("uuid"); b.Property("EffectiveFrom") .HasColumnType("timestamp with time zone"); b.Property("EffectiveTo") .HasColumnType("timestamp with time zone"); b.Property("Industry") .HasMaxLength(64) .HasColumnType("character varying(64)"); b.Property("LegalEntityName") .HasColumnType("text"); b.Property("LogoUrl") .HasMaxLength(256) .HasColumnType("character varying(256)"); b.Property("Name") .IsRequired() .HasMaxLength(128) .HasColumnType("character varying(128)"); b.Property("PrimaryOwnerUserId") .HasColumnType("uuid"); b.Property("Province") .HasColumnType("text"); b.Property("Remarks") .HasMaxLength(512) .HasColumnType("character varying(512)"); b.Property("ShortName") .HasMaxLength(64) .HasColumnType("character varying(64)"); b.Property("Status") .HasColumnType("integer"); b.Property("SuspendedAt") .HasColumnType("timestamp with time zone"); b.Property("SuspensionReason") .HasColumnType("text"); b.Property("Tags") .HasColumnType("text"); b.Property("UpdatedAt") .HasColumnType("timestamp with time zone"); b.Property("UpdatedBy") .HasColumnType("uuid"); b.Property("Website") .HasColumnType("text"); b.HasKey("Id"); b.HasIndex("Code") .IsUnique(); b.ToTable("tenants", (string)null); }); modelBuilder.Entity("TakeoutSaaS.Domain.Tenants.Entities.TenantBillingStatement", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("uuid"); b.Property("AmountDue") .HasPrecision(18, 2) .HasColumnType("numeric(18,2)"); b.Property("AmountPaid") .HasPrecision(18, 2) .HasColumnType("numeric(18,2)"); b.Property("CreatedAt") .HasColumnType("timestamp with time zone"); b.Property("CreatedBy") .HasColumnType("uuid"); b.Property("DeletedAt") .HasColumnType("timestamp with time zone"); b.Property("DeletedBy") .HasColumnType("uuid"); b.Property("DueDate") .HasColumnType("timestamp with time zone"); b.Property("LineItemsJson") .HasColumnType("text"); b.Property("PeriodEnd") .HasColumnType("timestamp with time zone"); b.Property("PeriodStart") .HasColumnType("timestamp with time zone"); b.Property("StatementNo") .IsRequired() .HasMaxLength(64) .HasColumnType("character varying(64)"); b.Property("Status") .HasColumnType("integer"); b.Property("TenantId") .HasColumnType("uuid"); b.Property("UpdatedAt") .HasColumnType("timestamp with time zone"); b.Property("UpdatedBy") .HasColumnType("uuid"); b.HasKey("Id"); b.HasIndex("TenantId", "StatementNo") .IsUnique(); b.ToTable("tenant_billing_statements", (string)null); }); modelBuilder.Entity("TakeoutSaaS.Domain.Tenants.Entities.TenantNotification", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("uuid"); b.Property("Channel") .HasColumnType("integer"); b.Property("CreatedAt") .HasColumnType("timestamp with time zone"); b.Property("CreatedBy") .HasColumnType("uuid"); b.Property("DeletedAt") .HasColumnType("timestamp with time zone"); b.Property("DeletedBy") .HasColumnType("uuid"); b.Property("Message") .IsRequired() .HasMaxLength(1024) .HasColumnType("character varying(1024)"); b.Property("MetadataJson") .HasColumnType("text"); b.Property("ReadAt") .HasColumnType("timestamp with time zone"); b.Property("SentAt") .HasColumnType("timestamp with time zone"); b.Property("Severity") .HasColumnType("integer"); b.Property("TenantId") .HasColumnType("uuid"); b.Property("Title") .IsRequired() .HasMaxLength(128) .HasColumnType("character varying(128)"); b.Property("UpdatedAt") .HasColumnType("timestamp with time zone"); b.Property("UpdatedBy") .HasColumnType("uuid"); b.HasKey("Id"); b.HasIndex("TenantId", "Channel", "SentAt"); b.ToTable("tenant_notifications", (string)null); }); modelBuilder.Entity("TakeoutSaaS.Domain.Tenants.Entities.TenantPackage", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("uuid"); b.Property("CreatedAt") .HasColumnType("timestamp with time zone"); b.Property("CreatedBy") .HasColumnType("uuid"); b.Property("DeletedAt") .HasColumnType("timestamp with time zone"); b.Property("DeletedBy") .HasColumnType("uuid"); b.Property("Description") .HasMaxLength(512) .HasColumnType("character varying(512)"); b.Property("FeaturePoliciesJson") .HasColumnType("text"); b.Property("IsActive") .HasColumnType("boolean"); b.Property("MaxAccountCount") .HasColumnType("integer"); b.Property("MaxDeliveryOrders") .HasColumnType("integer"); b.Property("MaxSmsCredits") .HasColumnType("integer"); b.Property("MaxStorageGb") .HasColumnType("integer"); b.Property("MaxStoreCount") .HasColumnType("integer"); b.Property("MonthlyPrice") .HasColumnType("numeric"); b.Property("Name") .IsRequired() .HasMaxLength(128) .HasColumnType("character varying(128)"); b.Property("PackageType") .HasColumnType("integer"); b.Property("UpdatedAt") .HasColumnType("timestamp with time zone"); b.Property("UpdatedBy") .HasColumnType("uuid"); b.Property("YearlyPrice") .HasColumnType("numeric"); b.HasKey("Id"); b.ToTable("tenant_packages", (string)null); }); modelBuilder.Entity("TakeoutSaaS.Domain.Tenants.Entities.TenantQuotaUsage", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("uuid"); b.Property("CreatedAt") .HasColumnType("timestamp with time zone"); b.Property("CreatedBy") .HasColumnType("uuid"); b.Property("DeletedAt") .HasColumnType("timestamp with time zone"); b.Property("DeletedBy") .HasColumnType("uuid"); b.Property("LastResetAt") .HasColumnType("timestamp with time zone"); b.Property("LimitValue") .HasColumnType("numeric"); b.Property("QuotaType") .HasColumnType("integer"); b.Property("ResetCycle") .HasColumnType("text"); b.Property("TenantId") .HasColumnType("uuid"); b.Property("UpdatedAt") .HasColumnType("timestamp with time zone"); b.Property("UpdatedBy") .HasColumnType("uuid"); b.Property("UsedValue") .HasColumnType("numeric"); b.HasKey("Id"); b.HasIndex("TenantId", "QuotaType") .IsUnique(); b.ToTable("tenant_quota_usages", (string)null); }); modelBuilder.Entity("TakeoutSaaS.Domain.Tenants.Entities.TenantSubscription", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("uuid"); b.Property("AutoRenew") .HasColumnType("boolean"); b.Property("CreatedAt") .HasColumnType("timestamp with time zone"); b.Property("CreatedBy") .HasColumnType("uuid"); b.Property("DeletedAt") .HasColumnType("timestamp with time zone"); b.Property("DeletedBy") .HasColumnType("uuid"); b.Property("EffectiveFrom") .HasColumnType("timestamp with time zone"); b.Property("EffectiveTo") .HasColumnType("timestamp with time zone"); b.Property("NextBillingDate") .HasColumnType("timestamp with time zone"); b.Property("Notes") .HasColumnType("text"); b.Property("ScheduledPackageId") .HasColumnType("uuid"); b.Property("Status") .HasColumnType("integer"); b.Property("TenantId") .HasColumnType("uuid"); b.Property("TenantPackageId") .HasColumnType("uuid"); b.Property("UpdatedAt") .HasColumnType("timestamp with time zone"); b.Property("UpdatedBy") .HasColumnType("uuid"); b.HasKey("Id"); b.HasIndex("TenantId", "TenantPackageId"); b.ToTable("tenant_subscriptions", (string)null); }); modelBuilder.Entity("TakeoutSaaS.Domain.Orders.Entities.OrderItem", b => { b.HasOne("TakeoutSaaS.Domain.Orders.Entities.Order", null) .WithMany() .HasForeignKey("OrderId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); #pragma warning restore 612, 618 } } }