Add payment cheque fields and seed invoice payments
This commit is contained in:
+4005
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,69 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Distribution.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class AddPaymentChequeAndEntryMode : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<DateTime>(
|
||||
name: "ChequeDate",
|
||||
table: "Payments",
|
||||
type: "datetime(6)",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "ChequeNumber",
|
||||
table: "Payments",
|
||||
type: "longtext",
|
||||
nullable: true)
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "EntryMode",
|
||||
table: "Payments",
|
||||
type: "int",
|
||||
nullable: false,
|
||||
defaultValue: 0);
|
||||
|
||||
migrationBuilder.AddColumn<Guid>(
|
||||
name: "RecordedBy",
|
||||
table: "Payments",
|
||||
type: "char(36)",
|
||||
nullable: true,
|
||||
collation: "ascii_general_ci");
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "Payments",
|
||||
keyColumn: "Id",
|
||||
keyValue: new Guid("47000000-0000-0000-0000-000000000001"),
|
||||
columns: new[] { "ChequeDate", "ChequeNumber", "EntryMode", "RecordedBy" },
|
||||
values: new object[] { null, null, 0, null });
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "ChequeDate",
|
||||
table: "Payments");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "ChequeNumber",
|
||||
table: "Payments");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "EntryMode",
|
||||
table: "Payments");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "RecordedBy",
|
||||
table: "Payments");
|
||||
}
|
||||
}
|
||||
}
|
||||
+4082
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,76 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
#pragma warning disable CA1814 // Prefer jagged arrays over multidimensional
|
||||
|
||||
namespace Distribution.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class SeedInvoice2AndMorePayments : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.InsertData(
|
||||
table: "ShopPOs",
|
||||
columns: new[] { "Id", "ConfirmedAt", "ConfirmedBy", "CreatedAt", "FK_StoreId", "FulfilledAt", "InvoiceId", "IsActive", "RaisedById", "Status", "TotalAmount" },
|
||||
values: new object[] { new Guid("33000000-0000-0000-0000-000000000003"), new DateTime(2026, 8, 31, 8, 30, 0, 0, DateTimeKind.Unspecified), new Guid("29000000-0000-0000-0000-000000000001"), new DateTime(2026, 8, 31, 9, 0, 0, 0, DateTimeKind.Unspecified), new Guid("26000000-0000-0000-0000-000000000005"), new DateTime(2026, 8, 31, 13, 0, 0, 0, DateTimeKind.Unspecified), new Guid("34500000-0000-0000-0000-000000000002"), true, new Guid("29000000-0000-0000-0000-000000000003"), 2, 2400m });
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "Invoices",
|
||||
columns: new[] { "Id", "CreatedAt", "CreatedBy", "FK_ShopPOId", "FinalizedAt", "FinalizedBy", "IsActive", "PaymentStatus", "PrintedAt", "PrintedBy", "Status", "TotalAmount" },
|
||||
values: new object[] { new Guid("34500000-0000-0000-0000-000000000002"), new DateTime(2026, 8, 31, 9, 0, 0, 0, DateTimeKind.Unspecified), new Guid("29000000-0000-0000-0000-000000000003"), new Guid("33000000-0000-0000-0000-000000000003"), null, null, true, 1, new DateTime(2026, 8, 31, 9, 15, 0, 0, DateTimeKind.Unspecified), new Guid("29000000-0000-0000-0000-000000000003"), 1, 2400m });
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "ShopPOItems",
|
||||
columns: new[] { "Id", "CreatedAt", "FK_ItemId", "FK_ShopPOId", "IsActive", "Quantity", "QuantityFulfilled", "UnitPrice" },
|
||||
values: new object[] { new Guid("34000000-0000-0000-0000-000000000004"), new DateTime(2026, 8, 31, 9, 0, 0, 0, DateTimeKind.Unspecified), new Guid("23000000-0000-0000-0000-000000000002"), new Guid("33000000-0000-0000-0000-000000000003"), true, 20, 20, 120m });
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "Payments",
|
||||
columns: new[] { "Id", "Amount", "ChequeDate", "ChequeNumber", "CollectedAt", "CollectedBy", "CreatedAt", "EntryMode", "FK_InvoiceId", "IsActive", "Method", "RecordedBy" },
|
||||
values: new object[,]
|
||||
{
|
||||
{ new Guid("47000000-0000-0000-0000-000000000002"), 1000m, null, null, new DateTime(2026, 8, 31, 9, 20, 0, 0, DateTimeKind.Unspecified), new Guid("29000000-0000-0000-0000-000000000003"), new DateTime(2026, 8, 31, 9, 20, 0, 0, DateTimeKind.Unspecified), 0, new Guid("34500000-0000-0000-0000-000000000002"), true, 0, null },
|
||||
{ new Guid("47000000-0000-0000-0000-000000000003"), 800m, new DateTime(2026, 8, 31, 0, 0, 0, 0, DateTimeKind.Unspecified), "000456", new DateTime(2026, 8, 31, 11, 0, 0, 0, DateTimeKind.Unspecified), new Guid("29000000-0000-0000-0000-000000000003"), new DateTime(2026, 8, 31, 18, 0, 0, 0, DateTimeKind.Unspecified), 1, new Guid("34500000-0000-0000-0000-000000000002"), true, 1, new Guid("29000000-0000-0000-0000-000000000001") },
|
||||
{ new Guid("47000000-0000-0000-0000-000000000004"), 300m, null, null, new DateTime(2026, 8, 31, 11, 5, 0, 0, DateTimeKind.Unspecified), new Guid("29000000-0000-0000-0000-000000000003"), new DateTime(2026, 8, 31, 11, 5, 0, 0, DateTimeKind.Unspecified), 0, new Guid("34500000-0000-0000-0000-000000000002"), true, 2, null }
|
||||
});
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DeleteData(
|
||||
table: "Payments",
|
||||
keyColumn: "Id",
|
||||
keyValue: new Guid("47000000-0000-0000-0000-000000000002"));
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "Payments",
|
||||
keyColumn: "Id",
|
||||
keyValue: new Guid("47000000-0000-0000-0000-000000000003"));
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "Payments",
|
||||
keyColumn: "Id",
|
||||
keyValue: new Guid("47000000-0000-0000-0000-000000000004"));
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "ShopPOItems",
|
||||
keyColumn: "Id",
|
||||
keyValue: new Guid("34000000-0000-0000-0000-000000000004"));
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "Invoices",
|
||||
keyColumn: "Id",
|
||||
keyValue: new Guid("34500000-0000-0000-0000-000000000002"));
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "ShopPOs",
|
||||
keyColumn: "Id",
|
||||
keyValue: new Guid("33000000-0000-0000-0000-000000000003"));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -572,6 +572,19 @@ namespace Distribution.Migrations
|
||||
PrintedBy = new Guid("29000000-0000-0000-0000-000000000002"),
|
||||
Status = 2,
|
||||
TotalAmount = 3000m
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = new Guid("34500000-0000-0000-0000-000000000002"),
|
||||
CreatedAt = new DateTime(2026, 8, 31, 9, 0, 0, 0, DateTimeKind.Unspecified),
|
||||
CreatedBy = new Guid("29000000-0000-0000-0000-000000000003"),
|
||||
FK_ShopPOId = new Guid("33000000-0000-0000-0000-000000000003"),
|
||||
IsActive = true,
|
||||
PaymentStatus = 1,
|
||||
PrintedAt = new DateTime(2026, 8, 31, 9, 15, 0, 0, DateTimeKind.Unspecified),
|
||||
PrintedBy = new Guid("29000000-0000-0000-0000-000000000003"),
|
||||
Status = 1,
|
||||
TotalAmount = 2400m
|
||||
});
|
||||
});
|
||||
|
||||
@@ -833,6 +846,12 @@ namespace Distribution.Migrations
|
||||
b.Property<decimal>("Amount")
|
||||
.HasColumnType("decimal(65,30)");
|
||||
|
||||
b.Property<DateTime?>("ChequeDate")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<string>("ChequeNumber")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<DateTime>("CollectedAt")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
@@ -842,6 +861,9 @@ namespace Distribution.Migrations
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<int>("EntryMode")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<Guid>("FK_InvoiceId")
|
||||
.HasColumnType("char(36)");
|
||||
|
||||
@@ -851,6 +873,9 @@ namespace Distribution.Migrations
|
||||
b.Property<int>("Method")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<Guid?>("RecordedBy")
|
||||
.HasColumnType("char(36)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("FK_InvoiceId");
|
||||
@@ -865,9 +890,49 @@ namespace Distribution.Migrations
|
||||
CollectedAt = new DateTime(2026, 8, 25, 9, 30, 0, 0, DateTimeKind.Unspecified),
|
||||
CollectedBy = new Guid("29000000-0000-0000-0000-000000000002"),
|
||||
CreatedAt = new DateTime(2026, 8, 25, 9, 30, 0, 0, DateTimeKind.Unspecified),
|
||||
EntryMode = 0,
|
||||
FK_InvoiceId = new Guid("34500000-0000-0000-0000-000000000001"),
|
||||
IsActive = true,
|
||||
Method = 0
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = new Guid("47000000-0000-0000-0000-000000000002"),
|
||||
Amount = 1000m,
|
||||
CollectedAt = new DateTime(2026, 8, 31, 9, 20, 0, 0, DateTimeKind.Unspecified),
|
||||
CollectedBy = new Guid("29000000-0000-0000-0000-000000000003"),
|
||||
CreatedAt = new DateTime(2026, 8, 31, 9, 20, 0, 0, DateTimeKind.Unspecified),
|
||||
EntryMode = 0,
|
||||
FK_InvoiceId = new Guid("34500000-0000-0000-0000-000000000002"),
|
||||
IsActive = true,
|
||||
Method = 0
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = new Guid("47000000-0000-0000-0000-000000000003"),
|
||||
Amount = 800m,
|
||||
ChequeDate = new DateTime(2026, 8, 31, 0, 0, 0, 0, DateTimeKind.Unspecified),
|
||||
ChequeNumber = "000456",
|
||||
CollectedAt = new DateTime(2026, 8, 31, 11, 0, 0, 0, DateTimeKind.Unspecified),
|
||||
CollectedBy = new Guid("29000000-0000-0000-0000-000000000003"),
|
||||
CreatedAt = new DateTime(2026, 8, 31, 18, 0, 0, 0, DateTimeKind.Unspecified),
|
||||
EntryMode = 1,
|
||||
FK_InvoiceId = new Guid("34500000-0000-0000-0000-000000000002"),
|
||||
IsActive = true,
|
||||
Method = 1,
|
||||
RecordedBy = new Guid("29000000-0000-0000-0000-000000000001")
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = new Guid("47000000-0000-0000-0000-000000000004"),
|
||||
Amount = 300m,
|
||||
CollectedAt = new DateTime(2026, 8, 31, 11, 5, 0, 0, DateTimeKind.Unspecified),
|
||||
CollectedBy = new Guid("29000000-0000-0000-0000-000000000003"),
|
||||
CreatedAt = new DateTime(2026, 8, 31, 11, 5, 0, 0, DateTimeKind.Unspecified),
|
||||
EntryMode = 0,
|
||||
FK_InvoiceId = new Guid("34500000-0000-0000-0000-000000000002"),
|
||||
IsActive = true,
|
||||
Method = 2
|
||||
});
|
||||
});
|
||||
|
||||
@@ -2052,6 +2117,20 @@ namespace Distribution.Migrations
|
||||
RaisedById = new Guid("29000000-0000-0000-0000-000000000003"),
|
||||
Status = 0,
|
||||
TotalAmount = 1200m
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = new Guid("33000000-0000-0000-0000-000000000003"),
|
||||
ConfirmedAt = new DateTime(2026, 8, 31, 8, 30, 0, 0, DateTimeKind.Unspecified),
|
||||
ConfirmedBy = new Guid("29000000-0000-0000-0000-000000000001"),
|
||||
CreatedAt = new DateTime(2026, 8, 31, 9, 0, 0, 0, DateTimeKind.Unspecified),
|
||||
FK_StoreId = new Guid("26000000-0000-0000-0000-000000000005"),
|
||||
FulfilledAt = new DateTime(2026, 8, 31, 13, 0, 0, 0, DateTimeKind.Unspecified),
|
||||
InvoiceId = new Guid("34500000-0000-0000-0000-000000000002"),
|
||||
IsActive = true,
|
||||
RaisedById = new Guid("29000000-0000-0000-0000-000000000003"),
|
||||
Status = 2,
|
||||
TotalAmount = 2400m
|
||||
});
|
||||
});
|
||||
|
||||
@@ -2123,6 +2202,17 @@ namespace Distribution.Migrations
|
||||
Quantity = 10,
|
||||
QuantityFulfilled = 0,
|
||||
UnitPrice = 120m
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = new Guid("34000000-0000-0000-0000-000000000004"),
|
||||
CreatedAt = new DateTime(2026, 8, 31, 9, 0, 0, 0, DateTimeKind.Unspecified),
|
||||
FK_ItemId = new Guid("23000000-0000-0000-0000-000000000002"),
|
||||
FK_ShopPOId = new Guid("33000000-0000-0000-0000-000000000003"),
|
||||
IsActive = true,
|
||||
Quantity = 20,
|
||||
QuantityFulfilled = 20,
|
||||
UnitPrice = 120m
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user