1731 lines
59 KiB
C#
1731 lines
59 KiB
C#
// <auto-generated />
|
|
using System;
|
|
using LittleShop.Data;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
|
|
|
#nullable disable
|
|
|
|
namespace LittleShop.Migrations
|
|
{
|
|
[DbContext(typeof(LittleShopContext))]
|
|
partial class LittleShopContextModelSnapshot : ModelSnapshot
|
|
{
|
|
protected override void BuildModel(ModelBuilder modelBuilder)
|
|
{
|
|
#pragma warning disable 612, 618
|
|
modelBuilder.HasAnnotation("ProductVersion", "9.0.9");
|
|
|
|
modelBuilder.Entity("LittleShop.Models.Bot", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<string>("BotKey")
|
|
.IsRequired()
|
|
.HasMaxLength(256)
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<string>("Description")
|
|
.IsRequired()
|
|
.HasMaxLength(500)
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<string>("IpAddress")
|
|
.IsRequired()
|
|
.HasMaxLength(50)
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<bool>("IsActive")
|
|
.HasColumnType("INTEGER");
|
|
|
|
b.Property<DateTime?>("LastConfigSyncAt")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<DateTime?>("LastSeenAt")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<string>("Name")
|
|
.IsRequired()
|
|
.HasMaxLength(100)
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<string>("PersonalityName")
|
|
.IsRequired()
|
|
.HasMaxLength(50)
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<string>("PlatformDisplayName")
|
|
.IsRequired()
|
|
.HasMaxLength(200)
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<string>("PlatformId")
|
|
.IsRequired()
|
|
.HasMaxLength(100)
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<string>("PlatformUsername")
|
|
.IsRequired()
|
|
.HasMaxLength(100)
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<string>("Settings")
|
|
.IsRequired()
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<int>("Status")
|
|
.HasColumnType("INTEGER");
|
|
|
|
b.Property<int>("Type")
|
|
.HasColumnType("INTEGER");
|
|
|
|
b.Property<string>("Version")
|
|
.IsRequired()
|
|
.HasMaxLength(50)
|
|
.HasColumnType("TEXT");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("BotKey")
|
|
.IsUnique();
|
|
|
|
b.HasIndex("Name");
|
|
|
|
b.HasIndex("Status");
|
|
|
|
b.ToTable("Bots");
|
|
});
|
|
|
|
modelBuilder.Entity("LittleShop.Models.BotActivity", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<string>("ActivityDescription")
|
|
.IsRequired()
|
|
.HasMaxLength(500)
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<string>("ActivityType")
|
|
.IsRequired()
|
|
.HasMaxLength(50)
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<Guid>("BotId")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<string>("CategoryName")
|
|
.IsRequired()
|
|
.HasMaxLength(100)
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<string>("DeviceType")
|
|
.IsRequired()
|
|
.HasMaxLength(50)
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<string>("Location")
|
|
.IsRequired()
|
|
.HasMaxLength(100)
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<string>("Metadata")
|
|
.IsRequired()
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<Guid?>("OrderId")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<string>("Platform")
|
|
.IsRequired()
|
|
.HasMaxLength(100)
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<Guid?>("ProductId")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<string>("ProductName")
|
|
.IsRequired()
|
|
.HasMaxLength(200)
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<int?>("Quantity")
|
|
.HasColumnType("INTEGER");
|
|
|
|
b.Property<string>("SessionIdentifier")
|
|
.IsRequired()
|
|
.HasMaxLength(256)
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<DateTime>("Timestamp")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<string>("UserDisplayName")
|
|
.IsRequired()
|
|
.HasMaxLength(100)
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<decimal?>("Value")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("ActivityType");
|
|
|
|
b.HasIndex("OrderId");
|
|
|
|
b.HasIndex("ProductId");
|
|
|
|
b.HasIndex("SessionIdentifier");
|
|
|
|
b.HasIndex("Timestamp");
|
|
|
|
b.HasIndex("BotId", "Timestamp");
|
|
|
|
b.ToTable("BotActivities");
|
|
});
|
|
|
|
modelBuilder.Entity("LittleShop.Models.BotContact", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<Guid>("BotId")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<Guid?>("CustomerId")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<string>("DisplayName")
|
|
.IsRequired()
|
|
.HasMaxLength(200)
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<string>("EncryptedContactData")
|
|
.HasMaxLength(500)
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<DateTime>("FirstContactDate")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<string>("FirstName")
|
|
.IsRequired()
|
|
.HasMaxLength(50)
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<bool>("IsActive")
|
|
.HasColumnType("INTEGER");
|
|
|
|
b.Property<bool>("IsRecovered")
|
|
.HasColumnType("INTEGER");
|
|
|
|
b.Property<DateTime>("LastContactDate")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<string>("LastKnownLanguage")
|
|
.IsRequired()
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<string>("LastName")
|
|
.IsRequired()
|
|
.HasMaxLength(50)
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<string>("Notes")
|
|
.HasMaxLength(1000)
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<string>("Preferences")
|
|
.HasMaxLength(500)
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<DateTime?>("RecoveredAt")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<Guid?>("RecoveredFromBotId")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<int>("Status")
|
|
.HasColumnType("INTEGER");
|
|
|
|
b.Property<string>("StatusReason")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<long>("TelegramUserId")
|
|
.HasColumnType("INTEGER");
|
|
|
|
b.Property<string>("TelegramUsername")
|
|
.IsRequired()
|
|
.HasMaxLength(100)
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<int>("TotalInteractions")
|
|
.HasColumnType("INTEGER");
|
|
|
|
b.Property<DateTime>("UpdatedAt")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("BotId");
|
|
|
|
b.HasIndex("CustomerId");
|
|
|
|
b.ToTable("BotContacts");
|
|
});
|
|
|
|
modelBuilder.Entity("LittleShop.Models.BotMetric", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<Guid>("BotId")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<string>("Category")
|
|
.IsRequired()
|
|
.HasMaxLength(100)
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<string>("Description")
|
|
.IsRequired()
|
|
.HasMaxLength(500)
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<string>("Metadata")
|
|
.IsRequired()
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<int>("MetricType")
|
|
.HasColumnType("INTEGER");
|
|
|
|
b.Property<DateTime>("RecordedAt")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<decimal>("Value")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("MetricType");
|
|
|
|
b.HasIndex("BotId", "RecordedAt");
|
|
|
|
b.ToTable("BotMetrics");
|
|
});
|
|
|
|
modelBuilder.Entity("LittleShop.Models.BotSession", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<Guid>("BotId")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<string>("Country")
|
|
.IsRequired()
|
|
.HasMaxLength(100)
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<DateTime?>("EndedAt")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<bool>("IsAnonymous")
|
|
.HasColumnType("INTEGER");
|
|
|
|
b.Property<string>("Language")
|
|
.IsRequired()
|
|
.HasMaxLength(50)
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<DateTime>("LastActivityAt")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<int>("MessageCount")
|
|
.HasColumnType("INTEGER");
|
|
|
|
b.Property<string>("Metadata")
|
|
.IsRequired()
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<int>("OrderCount")
|
|
.HasColumnType("INTEGER");
|
|
|
|
b.Property<string>("Platform")
|
|
.IsRequired()
|
|
.HasMaxLength(100)
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<string>("SessionIdentifier")
|
|
.IsRequired()
|
|
.HasMaxLength(256)
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<DateTime>("StartedAt")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<decimal>("TotalSpent")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("LastActivityAt");
|
|
|
|
b.HasIndex("StartedAt");
|
|
|
|
b.HasIndex("BotId", "SessionIdentifier");
|
|
|
|
b.ToTable("BotSessions");
|
|
});
|
|
|
|
modelBuilder.Entity("LittleShop.Models.Category", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<string>("Description")
|
|
.HasMaxLength(500)
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<bool>("IsActive")
|
|
.HasColumnType("INTEGER");
|
|
|
|
b.Property<string>("Name")
|
|
.IsRequired()
|
|
.HasMaxLength(100)
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<DateTime>("UpdatedAt")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.ToTable("Categories");
|
|
});
|
|
|
|
modelBuilder.Entity("LittleShop.Models.CryptoPayment", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<string>("BTCPayInvoiceId")
|
|
.HasMaxLength(200)
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<int>("Currency")
|
|
.HasColumnType("INTEGER");
|
|
|
|
b.Property<DateTime>("ExpiresAt")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<Guid>("OrderId")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<decimal>("PaidAmount")
|
|
.HasColumnType("decimal(18,8)");
|
|
|
|
b.Property<DateTime?>("PaidAt")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<decimal>("RequiredAmount")
|
|
.HasColumnType("decimal(18,8)");
|
|
|
|
b.Property<string>("SilverPayOrderId")
|
|
.HasMaxLength(200)
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<int>("Status")
|
|
.HasColumnType("INTEGER");
|
|
|
|
b.Property<string>("TransactionHash")
|
|
.HasMaxLength(200)
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<string>("WalletAddress")
|
|
.IsRequired()
|
|
.HasMaxLength(500)
|
|
.HasColumnType("TEXT");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("BTCPayInvoiceId");
|
|
|
|
b.HasIndex("OrderId");
|
|
|
|
b.HasIndex("WalletAddress");
|
|
|
|
b.ToTable("CryptoPayments");
|
|
});
|
|
|
|
modelBuilder.Entity("LittleShop.Models.Customer", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<bool>("AllowMarketing")
|
|
.HasColumnType("INTEGER");
|
|
|
|
b.Property<bool>("AllowOrderUpdates")
|
|
.HasColumnType("INTEGER");
|
|
|
|
b.Property<decimal>("AverageOrderValue")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<string>("BlockReason")
|
|
.HasMaxLength(500)
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<int>("CancelledOrders")
|
|
.HasColumnType("INTEGER");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<string>("CustomerNotes")
|
|
.HasMaxLength(2000)
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<DateTime?>("DataRetentionDate")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<int>("DisputedOrders")
|
|
.HasColumnType("INTEGER");
|
|
|
|
b.Property<string>("Email")
|
|
.HasMaxLength(100)
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<DateTime>("FirstOrderDate")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<bool>("IsActive")
|
|
.HasColumnType("INTEGER");
|
|
|
|
b.Property<bool>("IsBlocked")
|
|
.HasColumnType("INTEGER");
|
|
|
|
b.Property<string>("Language")
|
|
.IsRequired()
|
|
.HasMaxLength(10)
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<DateTime>("LastActiveAt")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<DateTime>("LastOrderDate")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<string>("PhoneNumber")
|
|
.HasMaxLength(20)
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<int>("RiskScore")
|
|
.HasColumnType("INTEGER");
|
|
|
|
b.Property<int>("SuccessfulOrders")
|
|
.HasColumnType("INTEGER");
|
|
|
|
b.Property<string>("TelegramDisplayName")
|
|
.IsRequired()
|
|
.HasMaxLength(200)
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<string>("TelegramFirstName")
|
|
.IsRequired()
|
|
.HasMaxLength(50)
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<string>("TelegramLastName")
|
|
.IsRequired()
|
|
.HasMaxLength(50)
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<long>("TelegramUserId")
|
|
.HasColumnType("INTEGER");
|
|
|
|
b.Property<string>("TelegramUsername")
|
|
.IsRequired()
|
|
.HasMaxLength(100)
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<string>("Timezone")
|
|
.IsRequired()
|
|
.HasMaxLength(10)
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<int>("TotalOrders")
|
|
.HasColumnType("INTEGER");
|
|
|
|
b.Property<decimal>("TotalSpent")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<DateTime>("UpdatedAt")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("CreatedAt");
|
|
|
|
b.HasIndex("DataRetentionDate");
|
|
|
|
b.HasIndex("Email");
|
|
|
|
b.HasIndex("LastActiveAt");
|
|
|
|
b.HasIndex("TelegramUserId")
|
|
.IsUnique();
|
|
|
|
b.HasIndex("TelegramUsername");
|
|
|
|
b.ToTable("Customers");
|
|
});
|
|
|
|
modelBuilder.Entity("LittleShop.Models.CustomerMessage", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<Guid?>("AdminUserId")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<DateTime?>("ArchivedAt")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<string>("AutoGenerationTrigger")
|
|
.HasMaxLength(100)
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<string>("Content")
|
|
.IsRequired()
|
|
.HasMaxLength(4000)
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<Guid>("CustomerId")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<DateTime?>("DeliveredAt")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<int>("Direction")
|
|
.HasColumnType("INTEGER");
|
|
|
|
b.Property<DateTime?>("ExpiresAt")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<DateTime?>("FailedAt")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<string>("FailureReason")
|
|
.HasMaxLength(500)
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<bool>("IsArchived")
|
|
.HasColumnType("INTEGER");
|
|
|
|
b.Property<bool>("IsAutoGenerated")
|
|
.HasColumnType("INTEGER");
|
|
|
|
b.Property<bool>("IsMarketing")
|
|
.HasColumnType("INTEGER");
|
|
|
|
b.Property<bool>("IsUrgent")
|
|
.HasColumnType("INTEGER");
|
|
|
|
b.Property<DateTime?>("NextRetryAt")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<Guid?>("OrderId")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<Guid?>("ParentMessageId")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<string>("Platform")
|
|
.IsRequired()
|
|
.HasMaxLength(100)
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<string>("PlatformMessageId")
|
|
.HasMaxLength(200)
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<int>("Priority")
|
|
.HasColumnType("INTEGER");
|
|
|
|
b.Property<DateTime?>("ReadAt")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<bool>("RequiresResponse")
|
|
.HasColumnType("INTEGER");
|
|
|
|
b.Property<int>("RetryCount")
|
|
.HasColumnType("INTEGER");
|
|
|
|
b.Property<DateTime?>("ScheduledFor")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<DateTime?>("SentAt")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<int>("Status")
|
|
.HasColumnType("INTEGER");
|
|
|
|
b.Property<string>("Subject")
|
|
.IsRequired()
|
|
.HasMaxLength(100)
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<Guid?>("ThreadId")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<int>("Type")
|
|
.HasColumnType("INTEGER");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("AdminUserId");
|
|
|
|
b.HasIndex("Direction");
|
|
|
|
b.HasIndex("OrderId");
|
|
|
|
b.HasIndex("ParentMessageId");
|
|
|
|
b.HasIndex("ScheduledFor");
|
|
|
|
b.HasIndex("Status");
|
|
|
|
b.HasIndex("ThreadId");
|
|
|
|
b.HasIndex("Type");
|
|
|
|
b.HasIndex("CustomerId", "CreatedAt");
|
|
|
|
b.ToTable("CustomerMessages");
|
|
});
|
|
|
|
modelBuilder.Entity("LittleShop.Models.Order", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<DateTime?>("AcceptedAt")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<string>("AcceptedByUser")
|
|
.HasMaxLength(100)
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<DateTime?>("ActualDeliveryDate")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<string>("Currency")
|
|
.IsRequired()
|
|
.HasMaxLength(10)
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<Guid?>("CustomerId")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<DateTime?>("DispatchedAt")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<string>("DispatchedByUser")
|
|
.HasMaxLength(100)
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<DateTime?>("ExpectedDeliveryDate")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<string>("IdentityReference")
|
|
.HasMaxLength(100)
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<string>("Notes")
|
|
.HasMaxLength(500)
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<DateTime?>("OnHoldAt")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<string>("OnHoldReason")
|
|
.HasMaxLength(500)
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<string>("PackedByUser")
|
|
.HasMaxLength(100)
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<DateTime?>("PackingStartedAt")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<DateTime?>("PaidAt")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<DateTime?>("ShippedAt")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<string>("ShippingAddress")
|
|
.IsRequired()
|
|
.HasMaxLength(500)
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<string>("ShippingCity")
|
|
.IsRequired()
|
|
.HasMaxLength(100)
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<string>("ShippingCountry")
|
|
.IsRequired()
|
|
.HasMaxLength(100)
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<string>("ShippingName")
|
|
.IsRequired()
|
|
.HasMaxLength(200)
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<string>("ShippingPostCode")
|
|
.IsRequired()
|
|
.HasMaxLength(20)
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<int>("Status")
|
|
.HasColumnType("INTEGER");
|
|
|
|
b.Property<decimal>("TotalAmount")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<string>("TrackingNumber")
|
|
.HasMaxLength(100)
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<DateTime>("UpdatedAt")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("CreatedAt");
|
|
|
|
b.HasIndex("CustomerId");
|
|
|
|
b.HasIndex("IdentityReference");
|
|
|
|
b.ToTable("Orders");
|
|
});
|
|
|
|
modelBuilder.Entity("LittleShop.Models.OrderItem", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<Guid>("OrderId")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<Guid>("ProductId")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<Guid?>("ProductMultiBuyId")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<Guid?>("ProductVariantId")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<int>("Quantity")
|
|
.HasColumnType("INTEGER");
|
|
|
|
b.Property<string>("SelectedVariants")
|
|
.HasMaxLength(500)
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<decimal>("TotalPrice")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<decimal>("UnitPrice")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("OrderId");
|
|
|
|
b.HasIndex("ProductId");
|
|
|
|
b.HasIndex("ProductMultiBuyId");
|
|
|
|
b.HasIndex("ProductVariantId");
|
|
|
|
b.ToTable("OrderItems");
|
|
});
|
|
|
|
modelBuilder.Entity("LittleShop.Models.Product", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<Guid>("CategoryId")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<string>("Description")
|
|
.IsRequired()
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<bool>("IsActive")
|
|
.HasColumnType("INTEGER");
|
|
|
|
b.Property<string>("Name")
|
|
.IsRequired()
|
|
.HasMaxLength(200)
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<decimal>("Price")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<int>("StockQuantity")
|
|
.HasColumnType("INTEGER");
|
|
|
|
b.Property<DateTime>("UpdatedAt")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<Guid?>("VariantCollectionId")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<string>("VariantsJson")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<decimal>("Weight")
|
|
.HasColumnType("decimal(18,4)");
|
|
|
|
b.Property<int>("WeightUnit")
|
|
.HasColumnType("INTEGER");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("CategoryId");
|
|
|
|
b.HasIndex("VariantCollectionId");
|
|
|
|
b.ToTable("Products");
|
|
});
|
|
|
|
modelBuilder.Entity("LittleShop.Models.ProductMultiBuy", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<string>("Description")
|
|
.IsRequired()
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<bool>("IsActive")
|
|
.HasColumnType("INTEGER");
|
|
|
|
b.Property<string>("Name")
|
|
.IsRequired()
|
|
.HasMaxLength(100)
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<decimal>("Price")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<decimal>("PricePerUnit")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<Guid>("ProductId")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<int>("Quantity")
|
|
.HasColumnType("INTEGER");
|
|
|
|
b.Property<int>("SortOrder")
|
|
.HasColumnType("INTEGER");
|
|
|
|
b.Property<DateTime>("UpdatedAt")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("IsActive");
|
|
|
|
b.HasIndex("ProductId", "Quantity")
|
|
.IsUnique();
|
|
|
|
b.HasIndex("ProductId", "SortOrder");
|
|
|
|
b.ToTable("ProductMultiBuys");
|
|
});
|
|
|
|
modelBuilder.Entity("LittleShop.Models.ProductPhoto", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<string>("AltText")
|
|
.HasMaxLength(100)
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<string>("FileName")
|
|
.IsRequired()
|
|
.HasMaxLength(500)
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<string>("FilePath")
|
|
.IsRequired()
|
|
.HasMaxLength(1000)
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<Guid>("ProductId")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<int>("SortOrder")
|
|
.HasColumnType("INTEGER");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("ProductId");
|
|
|
|
b.ToTable("ProductPhotos");
|
|
});
|
|
|
|
modelBuilder.Entity("LittleShop.Models.ProductVariant", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<bool>("IsActive")
|
|
.HasColumnType("INTEGER");
|
|
|
|
b.Property<string>("Name")
|
|
.IsRequired()
|
|
.HasMaxLength(100)
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<decimal?>("Price")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<Guid>("ProductId")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<int>("SortOrder")
|
|
.HasColumnType("INTEGER");
|
|
|
|
b.Property<int>("StockLevel")
|
|
.HasColumnType("INTEGER");
|
|
|
|
b.Property<DateTime>("UpdatedAt")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<string>("VariantType")
|
|
.IsRequired()
|
|
.HasMaxLength(50)
|
|
.HasColumnType("TEXT");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("IsActive");
|
|
|
|
b.HasIndex("ProductId", "Name")
|
|
.IsUnique();
|
|
|
|
b.HasIndex("ProductId", "SortOrder");
|
|
|
|
b.ToTable("ProductVariants");
|
|
});
|
|
|
|
modelBuilder.Entity("LittleShop.Models.PushSubscription", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("INTEGER");
|
|
|
|
b.Property<string>("Auth")
|
|
.IsRequired()
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<Guid?>("CustomerId")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<string>("Endpoint")
|
|
.IsRequired()
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<string>("IpAddress")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<bool>("IsActive")
|
|
.HasColumnType("INTEGER");
|
|
|
|
b.Property<DateTime?>("LastUsedAt")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<string>("P256DH")
|
|
.IsRequired()
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<DateTime>("SubscribedAt")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<string>("UserAgent")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<Guid?>("UserId")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("CustomerId");
|
|
|
|
b.HasIndex("Endpoint")
|
|
.IsUnique();
|
|
|
|
b.HasIndex("IsActive");
|
|
|
|
b.HasIndex("SubscribedAt");
|
|
|
|
b.HasIndex("UserId");
|
|
|
|
b.ToTable("PushSubscriptions");
|
|
});
|
|
|
|
modelBuilder.Entity("LittleShop.Models.Review", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<DateTime?>("ApprovedAt")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<Guid?>("ApprovedByUserId")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<string>("Comment")
|
|
.HasMaxLength(2000)
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<Guid>("CustomerId")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<bool>("IsActive")
|
|
.HasColumnType("INTEGER");
|
|
|
|
b.Property<bool>("IsApproved")
|
|
.HasColumnType("INTEGER");
|
|
|
|
b.Property<bool>("IsVerifiedPurchase")
|
|
.HasColumnType("INTEGER");
|
|
|
|
b.Property<Guid>("OrderId")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<Guid>("ProductId")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<int>("Rating")
|
|
.HasColumnType("INTEGER");
|
|
|
|
b.Property<string>("Title")
|
|
.HasMaxLength(100)
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<DateTime>("UpdatedAt")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("ApprovedByUserId");
|
|
|
|
b.HasIndex("CreatedAt");
|
|
|
|
b.HasIndex("CustomerId");
|
|
|
|
b.HasIndex("IsActive");
|
|
|
|
b.HasIndex("IsApproved");
|
|
|
|
b.HasIndex("OrderId");
|
|
|
|
b.HasIndex("ProductId");
|
|
|
|
b.HasIndex("Rating");
|
|
|
|
b.HasIndex("CustomerId", "ProductId")
|
|
.IsUnique();
|
|
|
|
b.HasIndex("ProductId", "IsApproved", "IsActive");
|
|
|
|
b.ToTable("Reviews");
|
|
});
|
|
|
|
modelBuilder.Entity("LittleShop.Models.SalesLedger", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<string>("Cryptocurrency")
|
|
.HasMaxLength(50)
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<string>("FiatCurrency")
|
|
.IsRequired()
|
|
.HasMaxLength(3)
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<Guid>("OrderId")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<Guid>("ProductId")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<string>("ProductName")
|
|
.IsRequired()
|
|
.HasMaxLength(200)
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<int>("Quantity")
|
|
.HasColumnType("INTEGER");
|
|
|
|
b.Property<decimal?>("SalePriceBTC")
|
|
.HasColumnType("decimal(18,8)");
|
|
|
|
b.Property<decimal>("SalePriceFiat")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<DateTime>("SoldAt")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("OrderId");
|
|
|
|
b.HasIndex("ProductId");
|
|
|
|
b.HasIndex("SoldAt");
|
|
|
|
b.HasIndex("ProductId", "SoldAt");
|
|
|
|
b.ToTable("SalesLedgers");
|
|
});
|
|
|
|
modelBuilder.Entity("LittleShop.Models.ShippingRate", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<string>("Country")
|
|
.IsRequired()
|
|
.HasMaxLength(100)
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<string>("Description")
|
|
.HasMaxLength(500)
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<bool>("IsActive")
|
|
.HasColumnType("INTEGER");
|
|
|
|
b.Property<int>("MaxDeliveryDays")
|
|
.HasColumnType("INTEGER");
|
|
|
|
b.Property<decimal>("MaxWeight")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<int>("MinDeliveryDays")
|
|
.HasColumnType("INTEGER");
|
|
|
|
b.Property<decimal>("MinWeight")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<string>("Name")
|
|
.IsRequired()
|
|
.HasMaxLength(100)
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<decimal>("Price")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<DateTime>("UpdatedAt")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.ToTable("ShippingRates");
|
|
});
|
|
|
|
modelBuilder.Entity("LittleShop.Models.SystemSetting", b =>
|
|
{
|
|
b.Property<string>("Key")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<string>("Description")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<DateTime>("UpdatedAt")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<string>("Value")
|
|
.IsRequired()
|
|
.HasColumnType("TEXT");
|
|
|
|
b.HasKey("Key");
|
|
|
|
b.HasIndex("Key")
|
|
.IsUnique();
|
|
|
|
b.ToTable("SystemSettings");
|
|
});
|
|
|
|
modelBuilder.Entity("LittleShop.Models.User", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<string>("Email")
|
|
.HasMaxLength(100)
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<bool>("IsActive")
|
|
.HasColumnType("INTEGER");
|
|
|
|
b.Property<string>("PasswordHash")
|
|
.IsRequired()
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<string>("Role")
|
|
.IsRequired()
|
|
.HasMaxLength(50)
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<string>("Username")
|
|
.IsRequired()
|
|
.HasMaxLength(50)
|
|
.HasColumnType("TEXT");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("Username")
|
|
.IsUnique();
|
|
|
|
b.ToTable("Users");
|
|
});
|
|
|
|
modelBuilder.Entity("LittleShop.Models.VariantCollection", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<bool>("IsActive")
|
|
.HasColumnType("INTEGER");
|
|
|
|
b.Property<string>("Name")
|
|
.IsRequired()
|
|
.HasMaxLength(100)
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<string>("PropertiesJson")
|
|
.IsRequired()
|
|
.HasColumnType("TEXT");
|
|
|
|
b.Property<DateTime>("UpdatedAt")
|
|
.HasColumnType("TEXT");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("IsActive");
|
|
|
|
b.HasIndex("Name");
|
|
|
|
b.ToTable("VariantCollections");
|
|
});
|
|
|
|
modelBuilder.Entity("LittleShop.Models.BotActivity", b =>
|
|
{
|
|
b.HasOne("LittleShop.Models.Bot", "Bot")
|
|
.WithMany()
|
|
.HasForeignKey("BotId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.HasOne("LittleShop.Models.Order", "Order")
|
|
.WithMany()
|
|
.HasForeignKey("OrderId")
|
|
.OnDelete(DeleteBehavior.SetNull);
|
|
|
|
b.HasOne("LittleShop.Models.Product", "Product")
|
|
.WithMany("Activities")
|
|
.HasForeignKey("ProductId")
|
|
.OnDelete(DeleteBehavior.SetNull);
|
|
|
|
b.Navigation("Bot");
|
|
|
|
b.Navigation("Order");
|
|
|
|
b.Navigation("Product");
|
|
});
|
|
|
|
modelBuilder.Entity("LittleShop.Models.BotContact", b =>
|
|
{
|
|
b.HasOne("LittleShop.Models.Bot", "Bot")
|
|
.WithMany()
|
|
.HasForeignKey("BotId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.HasOne("LittleShop.Models.Customer", "Customer")
|
|
.WithMany()
|
|
.HasForeignKey("CustomerId");
|
|
|
|
b.Navigation("Bot");
|
|
|
|
b.Navigation("Customer");
|
|
});
|
|
|
|
modelBuilder.Entity("LittleShop.Models.BotMetric", b =>
|
|
{
|
|
b.HasOne("LittleShop.Models.Bot", "Bot")
|
|
.WithMany("Metrics")
|
|
.HasForeignKey("BotId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Bot");
|
|
});
|
|
|
|
modelBuilder.Entity("LittleShop.Models.BotSession", b =>
|
|
{
|
|
b.HasOne("LittleShop.Models.Bot", "Bot")
|
|
.WithMany("Sessions")
|
|
.HasForeignKey("BotId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Bot");
|
|
});
|
|
|
|
modelBuilder.Entity("LittleShop.Models.CryptoPayment", b =>
|
|
{
|
|
b.HasOne("LittleShop.Models.Order", "Order")
|
|
.WithMany("Payments")
|
|
.HasForeignKey("OrderId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Order");
|
|
});
|
|
|
|
modelBuilder.Entity("LittleShop.Models.CustomerMessage", b =>
|
|
{
|
|
b.HasOne("LittleShop.Models.User", "AdminUser")
|
|
.WithMany()
|
|
.HasForeignKey("AdminUserId")
|
|
.OnDelete(DeleteBehavior.SetNull);
|
|
|
|
b.HasOne("LittleShop.Models.Customer", "Customer")
|
|
.WithMany("Messages")
|
|
.HasForeignKey("CustomerId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.HasOne("LittleShop.Models.Order", "Order")
|
|
.WithMany()
|
|
.HasForeignKey("OrderId")
|
|
.OnDelete(DeleteBehavior.SetNull);
|
|
|
|
b.HasOne("LittleShop.Models.CustomerMessage", "ParentMessage")
|
|
.WithMany("Replies")
|
|
.HasForeignKey("ParentMessageId")
|
|
.OnDelete(DeleteBehavior.Restrict);
|
|
|
|
b.Navigation("AdminUser");
|
|
|
|
b.Navigation("Customer");
|
|
|
|
b.Navigation("Order");
|
|
|
|
b.Navigation("ParentMessage");
|
|
});
|
|
|
|
modelBuilder.Entity("LittleShop.Models.Order", b =>
|
|
{
|
|
b.HasOne("LittleShop.Models.Customer", "Customer")
|
|
.WithMany("Orders")
|
|
.HasForeignKey("CustomerId")
|
|
.OnDelete(DeleteBehavior.Restrict);
|
|
|
|
b.Navigation("Customer");
|
|
});
|
|
|
|
modelBuilder.Entity("LittleShop.Models.OrderItem", b =>
|
|
{
|
|
b.HasOne("LittleShop.Models.Order", "Order")
|
|
.WithMany("Items")
|
|
.HasForeignKey("OrderId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.HasOne("LittleShop.Models.Product", "Product")
|
|
.WithMany("OrderItems")
|
|
.HasForeignKey("ProductId")
|
|
.OnDelete(DeleteBehavior.Restrict)
|
|
.IsRequired();
|
|
|
|
b.HasOne("LittleShop.Models.ProductMultiBuy", "ProductMultiBuy")
|
|
.WithMany("OrderItems")
|
|
.HasForeignKey("ProductMultiBuyId")
|
|
.OnDelete(DeleteBehavior.Restrict);
|
|
|
|
b.HasOne("LittleShop.Models.ProductVariant", "ProductVariant")
|
|
.WithMany()
|
|
.HasForeignKey("ProductVariantId");
|
|
|
|
b.Navigation("Order");
|
|
|
|
b.Navigation("Product");
|
|
|
|
b.Navigation("ProductMultiBuy");
|
|
|
|
b.Navigation("ProductVariant");
|
|
});
|
|
|
|
modelBuilder.Entity("LittleShop.Models.Product", b =>
|
|
{
|
|
b.HasOne("LittleShop.Models.Category", "Category")
|
|
.WithMany("Products")
|
|
.HasForeignKey("CategoryId")
|
|
.OnDelete(DeleteBehavior.Restrict)
|
|
.IsRequired();
|
|
|
|
b.HasOne("LittleShop.Models.VariantCollection", "VariantCollection")
|
|
.WithMany()
|
|
.HasForeignKey("VariantCollectionId");
|
|
|
|
b.Navigation("Category");
|
|
|
|
b.Navigation("VariantCollection");
|
|
});
|
|
|
|
modelBuilder.Entity("LittleShop.Models.ProductMultiBuy", b =>
|
|
{
|
|
b.HasOne("LittleShop.Models.Product", "Product")
|
|
.WithMany("MultiBuys")
|
|
.HasForeignKey("ProductId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Product");
|
|
});
|
|
|
|
modelBuilder.Entity("LittleShop.Models.ProductPhoto", b =>
|
|
{
|
|
b.HasOne("LittleShop.Models.Product", "Product")
|
|
.WithMany("Photos")
|
|
.HasForeignKey("ProductId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Product");
|
|
});
|
|
|
|
modelBuilder.Entity("LittleShop.Models.ProductVariant", b =>
|
|
{
|
|
b.HasOne("LittleShop.Models.Product", "Product")
|
|
.WithMany("Variants")
|
|
.HasForeignKey("ProductId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Product");
|
|
});
|
|
|
|
modelBuilder.Entity("LittleShop.Models.PushSubscription", b =>
|
|
{
|
|
b.HasOne("LittleShop.Models.Customer", "Customer")
|
|
.WithMany()
|
|
.HasForeignKey("CustomerId")
|
|
.OnDelete(DeleteBehavior.Cascade);
|
|
|
|
b.HasOne("LittleShop.Models.User", "User")
|
|
.WithMany()
|
|
.HasForeignKey("UserId")
|
|
.OnDelete(DeleteBehavior.Cascade);
|
|
|
|
b.Navigation("Customer");
|
|
|
|
b.Navigation("User");
|
|
});
|
|
|
|
modelBuilder.Entity("LittleShop.Models.Review", b =>
|
|
{
|
|
b.HasOne("LittleShop.Models.User", "ApprovedByUser")
|
|
.WithMany()
|
|
.HasForeignKey("ApprovedByUserId")
|
|
.OnDelete(DeleteBehavior.SetNull);
|
|
|
|
b.HasOne("LittleShop.Models.Customer", "Customer")
|
|
.WithMany()
|
|
.HasForeignKey("CustomerId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.HasOne("LittleShop.Models.Order", "Order")
|
|
.WithMany()
|
|
.HasForeignKey("OrderId")
|
|
.OnDelete(DeleteBehavior.Restrict)
|
|
.IsRequired();
|
|
|
|
b.HasOne("LittleShop.Models.Product", "Product")
|
|
.WithMany("Reviews")
|
|
.HasForeignKey("ProductId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("ApprovedByUser");
|
|
|
|
b.Navigation("Customer");
|
|
|
|
b.Navigation("Order");
|
|
|
|
b.Navigation("Product");
|
|
});
|
|
|
|
modelBuilder.Entity("LittleShop.Models.SalesLedger", b =>
|
|
{
|
|
b.HasOne("LittleShop.Models.Order", "Order")
|
|
.WithMany()
|
|
.HasForeignKey("OrderId")
|
|
.OnDelete(DeleteBehavior.Restrict)
|
|
.IsRequired();
|
|
|
|
b.HasOne("LittleShop.Models.Product", "Product")
|
|
.WithMany("SalesLedgers")
|
|
.HasForeignKey("ProductId")
|
|
.OnDelete(DeleteBehavior.Restrict)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Order");
|
|
|
|
b.Navigation("Product");
|
|
});
|
|
|
|
modelBuilder.Entity("LittleShop.Models.Bot", b =>
|
|
{
|
|
b.Navigation("Metrics");
|
|
|
|
b.Navigation("Sessions");
|
|
});
|
|
|
|
modelBuilder.Entity("LittleShop.Models.Category", b =>
|
|
{
|
|
b.Navigation("Products");
|
|
});
|
|
|
|
modelBuilder.Entity("LittleShop.Models.Customer", b =>
|
|
{
|
|
b.Navigation("Messages");
|
|
|
|
b.Navigation("Orders");
|
|
});
|
|
|
|
modelBuilder.Entity("LittleShop.Models.CustomerMessage", b =>
|
|
{
|
|
b.Navigation("Replies");
|
|
});
|
|
|
|
modelBuilder.Entity("LittleShop.Models.Order", b =>
|
|
{
|
|
b.Navigation("Items");
|
|
|
|
b.Navigation("Payments");
|
|
});
|
|
|
|
modelBuilder.Entity("LittleShop.Models.Product", b =>
|
|
{
|
|
b.Navigation("Activities");
|
|
|
|
b.Navigation("MultiBuys");
|
|
|
|
b.Navigation("OrderItems");
|
|
|
|
b.Navigation("Photos");
|
|
|
|
b.Navigation("Reviews");
|
|
|
|
b.Navigation("SalesLedgers");
|
|
|
|
b.Navigation("Variants");
|
|
});
|
|
|
|
modelBuilder.Entity("LittleShop.Models.ProductMultiBuy", b =>
|
|
{
|
|
b.Navigation("OrderItems");
|
|
});
|
|
#pragma warning restore 612, 618
|
|
}
|
|
}
|
|
}
|