//
using System;
using Gateway.POS;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
namespace Gateway.POS.Migrations
{
[DbContext(typeof(PosAppDbContext))]
[Migration("20210416075141_AddOperatorToTransaction")]
partial class AddOperatorToTransaction
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "5.0.5");
modelBuilder.Entity("Gateway.POS.Models.AppliedDiscount", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property("DiscountId")
.HasColumnType("INTEGER");
b.Property("DiscountedAmount")
.HasColumnType("TEXT");
b.Property("TransactionId")
.HasColumnType("INTEGER");
b.HasKey("Id");
b.HasIndex("DiscountId");
b.HasIndex("TransactionId");
b.ToTable("AppliedDiscount");
});
modelBuilder.Entity("Gateway.POS.Models.Discount", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property("Command")
.HasColumnType("TEXT");
b.Property("CreatedTime")
.HasColumnType("TEXT");
b.Property("Description")
.HasColumnType("TEXT");
b.Property("DiscountType")
.HasColumnType("INTEGER");
b.Property("EndTime")
.HasColumnType("TEXT");
b.Property("IsMarkedAsDeletion")
.HasColumnType("INTEGER");
b.Property("ModifiedTime")
.HasColumnType("TEXT");
b.Property("Name")
.HasColumnType("TEXT");
b.Property("StartTime")
.HasColumnType("TEXT");
b.Property("TargetFuelProductCode")
.HasColumnType("TEXT");
b.HasKey("Id");
b.ToTable("Discounts");
});
modelBuilder.Entity("Gateway.POS.Models.FuelItem", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property("Amount")
.HasColumnType("TEXT");
b.Property("FuelProductCode")
.HasColumnType("TEXT");
b.Property("FuelProductName")
.HasColumnType("TEXT");
b.Property("FuelTrxSequenceNumber")
.HasColumnType("TEXT");
b.Property("FuelingEndTime")
.HasColumnType("TEXT");
b.Property("FuelingStartTime")
.HasColumnType("TEXT");
b.Property("NozzleLogicalId")
.HasColumnType("INTEGER");
b.Property("Price")
.HasColumnType("TEXT");
b.Property("PumpId")
.HasColumnType("INTEGER");
b.Property("Qualtity")
.HasColumnType("TEXT");
b.Property("SiteLevelNozzleId")
.HasColumnType("INTEGER");
b.Property("TotalVolume")
.HasColumnType("TEXT");
b.Property("TransactionId")
.HasColumnType("INTEGER");
b.HasKey("Id");
b.HasIndex("Amount");
b.HasIndex("FuelProductCode");
b.HasIndex("SiteLevelNozzleId");
b.HasIndex("TransactionId");
b.HasIndex("PumpId", "NozzleLogicalId");
b.ToTable("FuelItems");
});
modelBuilder.Entity("Gateway.POS.Models.Operator", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property("CreatedTimestamp")
.HasColumnType("TEXT");
b.Property("Description")
.HasColumnType("TEXT");
b.Property("Name")
.HasColumnType("TEXT");
b.Property("Password")
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("Name")
.IsUnique();
b.ToTable("Operators");
});
modelBuilder.Entity("Gateway.POS.Models.Payment", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property("AuthCode")
.HasColumnType("TEXT");
b.Property("BillNumber")
.HasColumnType("TEXT");
b.Property("Comment")
.HasColumnType("TEXT");
b.Property("ExpectAmount")
.HasColumnType("TEXT");
b.Property("Method")
.HasColumnType("INTEGER");
b.Property("PaidAmount")
.HasColumnType("TEXT");
b.Property("TradeStatus")
.HasColumnType("INTEGER");
b.Property("TransactionId")
.HasColumnType("INTEGER");
b.HasKey("Id");
b.HasIndex("TransactionId");
b.ToTable("Payment");
});
modelBuilder.Entity("Gateway.POS.Models.Transaction", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property("ClientSideTimestamp")
.HasColumnType("TEXT");
b.Property("Comment")
.HasColumnType("TEXT");
b.Property("NetAmount")
.HasColumnType("TEXT");
b.Property("OperatorId")
.HasColumnType("INTEGER");
b.Property("ReceiptId")
.HasColumnType("TEXT");
b.Property("ServerSideTimestamp")
.HasColumnType("TEXT");
b.Property("ShiftId")
.HasColumnType("TEXT");
b.Property("SiteId")
.HasColumnType("TEXT");
b.Property("TerminalId")
.HasColumnType("TEXT");
b.Property("TotalAmount")
.HasColumnType("TEXT");
b.Property("TransactionType")
.HasColumnType("INTEGER");
b.HasKey("Id");
b.HasIndex("Id")
.IsUnique();
b.HasIndex("NetAmount");
b.HasIndex("OperatorId");
b.HasIndex("ReceiptId")
.IsUnique();
b.HasIndex("ServerSideTimestamp");
b.HasIndex("ShiftId");
b.HasIndex("TotalAmount");
b.ToTable("Transactions");
});
modelBuilder.Entity("Gateway.POS.Models.AppliedDiscount", b =>
{
b.HasOne("Gateway.POS.Models.Discount", "Discount")
.WithMany()
.HasForeignKey("DiscountId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Gateway.POS.Models.Transaction", null)
.WithMany("AppliedDiscounts")
.HasForeignKey("TransactionId");
b.Navigation("Discount");
});
modelBuilder.Entity("Gateway.POS.Models.FuelItem", b =>
{
b.HasOne("Gateway.POS.Models.Transaction", null)
.WithMany("FuelItems")
.HasForeignKey("TransactionId");
});
modelBuilder.Entity("Gateway.POS.Models.Payment", b =>
{
b.HasOne("Gateway.POS.Models.Transaction", null)
.WithMany("Payments")
.HasForeignKey("TransactionId");
});
modelBuilder.Entity("Gateway.POS.Models.Transaction", b =>
{
b.HasOne("Gateway.POS.Models.Operator", "Operator")
.WithMany()
.HasForeignKey("OperatorId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Operator");
});
modelBuilder.Entity("Gateway.POS.Models.Transaction", b =>
{
b.Navigation("AppliedDiscounts");
b.Navigation("FuelItems");
b.Navigation("Payments");
});
#pragma warning restore 612, 618
}
}
}