new updates
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,87 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace ERPCore.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class AddNotificationFeed : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "notifications",
|
||||
columns: table => new
|
||||
{
|
||||
NotificationId = table.Column<int>(type: "integer", nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
ModuleKey = table.Column<string>(type: "character varying(100)", maxLength: 100, nullable: false),
|
||||
Title = table.Column<string>(type: "character varying(200)", maxLength: 200, nullable: false),
|
||||
Message = table.Column<string>(type: "character varying(1000)", maxLength: 1000, nullable: false),
|
||||
RelatedEntityType = table.Column<string>(type: "character varying(100)", maxLength: 100, nullable: true),
|
||||
RelatedEntityId = table.Column<int>(type: "integer", nullable: true),
|
||||
CreatedAt = table.Column<DateTime>(type: "timestamp with time zone", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_notifications", x => x.NotificationId);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "notification_recipients",
|
||||
columns: table => new
|
||||
{
|
||||
NotificationRecipientId = table.Column<int>(type: "integer", nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
NotificationId = table.Column<int>(type: "integer", nullable: false),
|
||||
UserId = table.Column<int>(type: "integer", nullable: false),
|
||||
IsRead = table.Column<bool>(type: "boolean", nullable: false),
|
||||
ReadAt = table.Column<DateTime>(type: "timestamp with time zone", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_notification_recipients", x => x.NotificationRecipientId);
|
||||
table.ForeignKey(
|
||||
name: "FK_notification_recipients_notifications_NotificationId",
|
||||
column: x => x.NotificationId,
|
||||
principalTable: "notifications",
|
||||
principalColumn: "NotificationId",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_notification_recipients_users_UserId",
|
||||
column: x => x.UserId,
|
||||
principalTable: "users",
|
||||
principalColumn: "UserId",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_notification_recipients_NotificationId",
|
||||
table: "notification_recipients",
|
||||
column: "NotificationId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_notification_recipients_UserId_IsRead_NotificationId",
|
||||
table: "notification_recipients",
|
||||
columns: new[] { "UserId", "IsRead", "NotificationId" });
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_notifications_CreatedAt",
|
||||
table: "notifications",
|
||||
column: "CreatedAt");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "notification_recipients");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "notifications");
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,81 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace ERPCore.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class AddSupportTickets : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "support_tickets",
|
||||
columns: table => new
|
||||
{
|
||||
TicketId = table.Column<int>(type: "integer", nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
Subject = table.Column<string>(type: "character varying(200)", maxLength: 200, nullable: false),
|
||||
Status = table.Column<string>(type: "character varying(20)", maxLength: 20, nullable: false),
|
||||
CreatedByUserId = table.Column<int>(type: "integer", nullable: false),
|
||||
CreatedAt = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
|
||||
UpdatedAt = table.Column<DateTime>(type: "timestamp with time zone", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_support_tickets", x => x.TicketId);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "support_ticket_messages",
|
||||
columns: table => new
|
||||
{
|
||||
MessageId = table.Column<int>(type: "integer", nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
TicketId = table.Column<int>(type: "integer", nullable: false),
|
||||
SenderUserId = table.Column<int>(type: "integer", nullable: false),
|
||||
IsFromAdmin = table.Column<bool>(type: "boolean", nullable: false),
|
||||
Message = table.Column<string>(type: "character varying(2000)", maxLength: 2000, nullable: false),
|
||||
CreatedAt = table.Column<DateTime>(type: "timestamp with time zone", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_support_ticket_messages", x => x.MessageId);
|
||||
table.ForeignKey(
|
||||
name: "FK_support_ticket_messages_support_tickets_TicketId",
|
||||
column: x => x.TicketId,
|
||||
principalTable: "support_tickets",
|
||||
principalColumn: "TicketId",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_support_ticket_messages_TicketId_CreatedAt",
|
||||
table: "support_ticket_messages",
|
||||
columns: new[] { "TicketId", "CreatedAt" });
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_support_tickets_CreatedByUserId",
|
||||
table: "support_tickets",
|
||||
column: "CreatedByUserId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_support_tickets_Status",
|
||||
table: "support_tickets",
|
||||
column: "Status");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "support_ticket_messages");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "support_tickets");
|
||||
}
|
||||
}
|
||||
}
|
||||
+8417
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,79 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace ERPCore.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class RestyleSupportTicketLikeEmployee : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.RenameColumn(
|
||||
name: "CreatedByUserId",
|
||||
table: "support_tickets",
|
||||
newName: "CreatedBy");
|
||||
|
||||
migrationBuilder.RenameIndex(
|
||||
name: "IX_support_tickets_CreatedByUserId",
|
||||
table: "support_tickets",
|
||||
newName: "IX_support_tickets_CreatedBy");
|
||||
|
||||
migrationBuilder.AlterColumn<DateTime>(
|
||||
name: "UpdatedAt",
|
||||
table: "support_tickets",
|
||||
type: "timestamp with time zone",
|
||||
nullable: true,
|
||||
oldClrType: typeof(DateTime),
|
||||
oldType: "timestamp with time zone");
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "UpdatedBy",
|
||||
table: "support_tickets",
|
||||
type: "integer",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<uint>(
|
||||
name: "xmin",
|
||||
table: "support_tickets",
|
||||
type: "xid",
|
||||
rowVersion: true,
|
||||
nullable: false,
|
||||
defaultValue: 0u);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "UpdatedBy",
|
||||
table: "support_tickets");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "xmin",
|
||||
table: "support_tickets");
|
||||
|
||||
migrationBuilder.RenameColumn(
|
||||
name: "CreatedBy",
|
||||
table: "support_tickets",
|
||||
newName: "CreatedByUserId");
|
||||
|
||||
migrationBuilder.RenameIndex(
|
||||
name: "IX_support_tickets_CreatedBy",
|
||||
table: "support_tickets",
|
||||
newName: "IX_support_tickets_CreatedByUserId");
|
||||
|
||||
migrationBuilder.AlterColumn<DateTime>(
|
||||
name: "UpdatedAt",
|
||||
table: "support_tickets",
|
||||
type: "timestamp with time zone",
|
||||
nullable: false,
|
||||
defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
|
||||
oldClrType: typeof(DateTime),
|
||||
oldType: "timestamp with time zone",
|
||||
oldNullable: true);
|
||||
}
|
||||
}
|
||||
}
|
||||
+8423
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,38 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace ERPCore.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class AddWarehouseAddressPhone : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "Address",
|
||||
table: "warehouses",
|
||||
type: "text",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "Phone",
|
||||
table: "warehouses",
|
||||
type: "text",
|
||||
nullable: true);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Address",
|
||||
table: "warehouses");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Phone",
|
||||
table: "warehouses");
|
||||
}
|
||||
}
|
||||
}
|
||||
+8426
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,29 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace ERPCore.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class AddWarehouseBranchingToggle : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "WarehouseBranchingEnabled",
|
||||
table: "branch_config",
|
||||
type: "boolean",
|
||||
nullable: false,
|
||||
defaultValue: true);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "WarehouseBranchingEnabled",
|
||||
table: "branch_config");
|
||||
}
|
||||
}
|
||||
}
|
||||
+8443
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,69 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace ERPCore.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class AddPurchaseOrderApprovalAudit : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<DateTime>(
|
||||
name: "ApprovedAt",
|
||||
table: "purchase_orders",
|
||||
type: "timestamp with time zone",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "ApprovedBy",
|
||||
table: "purchase_orders",
|
||||
type: "integer",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "ApproverUserId",
|
||||
table: "purchase_orders",
|
||||
type: "integer",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_purchase_orders_ApproverUserId",
|
||||
table: "purchase_orders",
|
||||
column: "ApproverUserId");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_purchase_orders_users_ApproverUserId",
|
||||
table: "purchase_orders",
|
||||
column: "ApproverUserId",
|
||||
principalTable: "users",
|
||||
principalColumn: "UserId");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_purchase_orders_users_ApproverUserId",
|
||||
table: "purchase_orders");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_purchase_orders_ApproverUserId",
|
||||
table: "purchase_orders");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "ApprovedAt",
|
||||
table: "purchase_orders");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "ApprovedBy",
|
||||
table: "purchase_orders");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "ApproverUserId",
|
||||
table: "purchase_orders");
|
||||
}
|
||||
}
|
||||
}
|
||||
+8448
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,29 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace ERPCore.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class AddRolePermissionActions : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "Actions",
|
||||
table: "role_permissions",
|
||||
type: "integer",
|
||||
nullable: false,
|
||||
defaultValue: 31);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Actions",
|
||||
table: "role_permissions");
|
||||
}
|
||||
}
|
||||
}
|
||||
+8456
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,44 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace ERPCore.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class AddSalesDayEndPaidBalance : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<decimal>(
|
||||
name: "BalanceTotal",
|
||||
table: "sales_day_ends",
|
||||
type: "numeric(18,4)",
|
||||
precision: 18,
|
||||
scale: 4,
|
||||
nullable: false,
|
||||
defaultValue: 0m);
|
||||
|
||||
migrationBuilder.AddColumn<decimal>(
|
||||
name: "PaidTotal",
|
||||
table: "sales_day_ends",
|
||||
type: "numeric(18,4)",
|
||||
precision: 18,
|
||||
scale: 4,
|
||||
nullable: false,
|
||||
defaultValue: 0m);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "BalanceTotal",
|
||||
table: "sales_day_ends");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "PaidTotal",
|
||||
table: "sales_day_ends");
|
||||
}
|
||||
}
|
||||
}
|
||||
+8547
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,107 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||
|
||||
#nullable disable
|
||||
|
||||
#pragma warning disable CA1814 // Prefer jagged arrays over multidimensional
|
||||
|
||||
namespace ERPCore.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class AddTaxRatesAndItemTaxRate : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "TaxClass",
|
||||
table: "items");
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "TaxRateId",
|
||||
table: "items",
|
||||
type: "integer",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "tax_rates",
|
||||
columns: table => new
|
||||
{
|
||||
TaxRateId = table.Column<int>(type: "integer", nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
Code = table.Column<string>(type: "character varying(20)", maxLength: 20, nullable: false),
|
||||
Name = table.Column<string>(type: "character varying(100)", maxLength: 100, nullable: false),
|
||||
Percentage = table.Column<decimal>(type: "numeric(5,2)", precision: 5, scale: 2, nullable: false),
|
||||
Status = table.Column<string>(type: "character varying(20)", maxLength: 20, nullable: false, defaultValue: "Active"),
|
||||
CreatedAt = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
|
||||
UpdatedAt = table.Column<DateTime>(type: "timestamp with time zone", nullable: true),
|
||||
xmin = table.Column<uint>(type: "xid", rowVersion: true, nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_tax_rates", x => x.TaxRateId);
|
||||
});
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "tax_rates",
|
||||
columns: new[] { "TaxRateId", "Code", "CreatedAt", "Name", "Percentage", "UpdatedAt" },
|
||||
values: new object[,]
|
||||
{
|
||||
{ 1, "STANDARD", new DateTime(2026, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc), "Standard", 15m, null },
|
||||
{ 2, "ZERO", new DateTime(2026, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc), "Zero-Rated", 0m, null },
|
||||
{ 3, "EXEMPT", new DateTime(2026, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc), "Exempt", 0m, null }
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_items_TaxRateId",
|
||||
table: "items",
|
||||
column: "TaxRateId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_tax_rates_Code",
|
||||
table: "tax_rates",
|
||||
column: "Code",
|
||||
unique: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_tax_rates_Status",
|
||||
table: "tax_rates",
|
||||
column: "Status");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_items_tax_rates_TaxRateId",
|
||||
table: "items",
|
||||
column: "TaxRateId",
|
||||
principalTable: "tax_rates",
|
||||
principalColumn: "TaxRateId",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_items_tax_rates_TaxRateId",
|
||||
table: "items");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "tax_rates");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_items_TaxRateId",
|
||||
table: "items");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "TaxRateId",
|
||||
table: "items");
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "TaxClass",
|
||||
table: "items",
|
||||
type: "character varying(20)",
|
||||
maxLength: 20,
|
||||
nullable: true);
|
||||
}
|
||||
}
|
||||
}
|
||||
+8661
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,302 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace ERPCore.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class BranchIsolationPhase1 : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_number_sequences_doc_type_year",
|
||||
table: "number_sequences");
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "BranchId",
|
||||
table: "vendors",
|
||||
type: "integer",
|
||||
nullable: false,
|
||||
defaultValue: 0);
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "BranchId",
|
||||
table: "rfqs",
|
||||
type: "integer",
|
||||
nullable: false,
|
||||
defaultValue: 0);
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "BranchId",
|
||||
table: "requisitions",
|
||||
type: "integer",
|
||||
nullable: false,
|
||||
defaultValue: 0);
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "BranchId",
|
||||
table: "purchase_orders",
|
||||
type: "integer",
|
||||
nullable: false,
|
||||
defaultValue: 0);
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "BranchId",
|
||||
table: "purchase_invoices",
|
||||
type: "integer",
|
||||
nullable: false,
|
||||
defaultValue: 0);
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "branch_id",
|
||||
table: "number_sequences",
|
||||
type: "integer",
|
||||
nullable: false,
|
||||
defaultValue: 0);
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "BranchId",
|
||||
table: "customers",
|
||||
type: "integer",
|
||||
nullable: false,
|
||||
defaultValue: 0);
|
||||
|
||||
// Backfill: every column just added defaulted existing rows to BranchId/branch_id = 0,
|
||||
// which satisfies no FK. Point them at the deployment's single default branch
|
||||
// ("BR-000"/"Main Branch" — same convention BranchConfigService.ResolveDefaultBranchIdAsync
|
||||
// uses at runtime), creating it here if it doesn't exist yet so this migration is
|
||||
// self-contained regardless of whether that runtime path has already run.
|
||||
migrationBuilder.Sql("""
|
||||
INSERT INTO hr_branches ("Code", "Name", "Status", "CreatedAt")
|
||||
SELECT 'BR-000', 'Main Branch', 'Active', now()
|
||||
WHERE NOT EXISTS (SELECT 1 FROM hr_branches WHERE "Code" = 'BR-000');
|
||||
""");
|
||||
migrationBuilder.Sql("""
|
||||
UPDATE vendors SET "BranchId" = (SELECT "BranchId" FROM hr_branches WHERE "Code" = 'BR-000') WHERE "BranchId" = 0;
|
||||
UPDATE customers SET "BranchId" = (SELECT "BranchId" FROM hr_branches WHERE "Code" = 'BR-000') WHERE "BranchId" = 0;
|
||||
UPDATE requisitions SET "BranchId" = (SELECT "BranchId" FROM hr_branches WHERE "Code" = 'BR-000') WHERE "BranchId" = 0;
|
||||
UPDATE rfqs SET "BranchId" = (SELECT "BranchId" FROM hr_branches WHERE "Code" = 'BR-000') WHERE "BranchId" = 0;
|
||||
UPDATE purchase_orders SET "BranchId" = (SELECT "BranchId" FROM hr_branches WHERE "Code" = 'BR-000') WHERE "BranchId" = 0;
|
||||
UPDATE purchase_invoices SET "BranchId" = (SELECT "BranchId" FROM hr_branches WHERE "Code" = 'BR-000') WHERE "BranchId" = 0;
|
||||
UPDATE number_sequences SET branch_id = (SELECT "BranchId" FROM hr_branches WHERE "Code" = 'BR-000') WHERE branch_id = 0;
|
||||
""");
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "sub_nav_items",
|
||||
columns: new[] { "SubNavItemId", "Code", "Href", "Icon", "Label", "NavItemId", "SortOrder" },
|
||||
values: new object[] { 43, "products.tax-rates", "/dashboard/products/tax-rates", null, "Tax Rates", 2, 7 });
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "permissions",
|
||||
columns: new[] { "PermissionId", "Code", "NavItemId", "SubNavItemId" },
|
||||
values: new object[] { 53, "NAV:products.tax-rates", null, 43 });
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_vendors_BranchId",
|
||||
table: "vendors",
|
||||
column: "BranchId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_rfqs_BranchId",
|
||||
table: "rfqs",
|
||||
column: "BranchId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_requisitions_BranchId",
|
||||
table: "requisitions",
|
||||
column: "BranchId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_purchase_orders_BranchId",
|
||||
table: "purchase_orders",
|
||||
column: "BranchId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_purchase_invoices_BranchId",
|
||||
table: "purchase_invoices",
|
||||
column: "BranchId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_number_sequences_branch_id",
|
||||
table: "number_sequences",
|
||||
column: "branch_id");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_number_sequences_doc_type_branch_id_year",
|
||||
table: "number_sequences",
|
||||
columns: new[] { "doc_type", "branch_id", "year" },
|
||||
unique: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_customers_BranchId",
|
||||
table: "customers",
|
||||
column: "BranchId");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_customers_hr_branches_BranchId",
|
||||
table: "customers",
|
||||
column: "BranchId",
|
||||
principalTable: "hr_branches",
|
||||
principalColumn: "BranchId",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_number_sequences_hr_branches_branch_id",
|
||||
table: "number_sequences",
|
||||
column: "branch_id",
|
||||
principalTable: "hr_branches",
|
||||
principalColumn: "BranchId",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_purchase_invoices_hr_branches_BranchId",
|
||||
table: "purchase_invoices",
|
||||
column: "BranchId",
|
||||
principalTable: "hr_branches",
|
||||
principalColumn: "BranchId",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_purchase_orders_hr_branches_BranchId",
|
||||
table: "purchase_orders",
|
||||
column: "BranchId",
|
||||
principalTable: "hr_branches",
|
||||
principalColumn: "BranchId",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_requisitions_hr_branches_BranchId",
|
||||
table: "requisitions",
|
||||
column: "BranchId",
|
||||
principalTable: "hr_branches",
|
||||
principalColumn: "BranchId",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_rfqs_hr_branches_BranchId",
|
||||
table: "rfqs",
|
||||
column: "BranchId",
|
||||
principalTable: "hr_branches",
|
||||
principalColumn: "BranchId",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_vendors_hr_branches_BranchId",
|
||||
table: "vendors",
|
||||
column: "BranchId",
|
||||
principalTable: "hr_branches",
|
||||
principalColumn: "BranchId",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_customers_hr_branches_BranchId",
|
||||
table: "customers");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_number_sequences_hr_branches_branch_id",
|
||||
table: "number_sequences");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_purchase_invoices_hr_branches_BranchId",
|
||||
table: "purchase_invoices");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_purchase_orders_hr_branches_BranchId",
|
||||
table: "purchase_orders");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_requisitions_hr_branches_BranchId",
|
||||
table: "requisitions");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_rfqs_hr_branches_BranchId",
|
||||
table: "rfqs");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_vendors_hr_branches_BranchId",
|
||||
table: "vendors");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_vendors_BranchId",
|
||||
table: "vendors");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_rfqs_BranchId",
|
||||
table: "rfqs");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_requisitions_BranchId",
|
||||
table: "requisitions");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_purchase_orders_BranchId",
|
||||
table: "purchase_orders");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_purchase_invoices_BranchId",
|
||||
table: "purchase_invoices");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_number_sequences_branch_id",
|
||||
table: "number_sequences");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_number_sequences_doc_type_branch_id_year",
|
||||
table: "number_sequences");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_customers_BranchId",
|
||||
table: "customers");
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "permissions",
|
||||
keyColumn: "PermissionId",
|
||||
keyValue: 53);
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "sub_nav_items",
|
||||
keyColumn: "SubNavItemId",
|
||||
keyValue: 43);
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "BranchId",
|
||||
table: "vendors");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "BranchId",
|
||||
table: "rfqs");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "BranchId",
|
||||
table: "requisitions");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "BranchId",
|
||||
table: "purchase_orders");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "BranchId",
|
||||
table: "purchase_invoices");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "branch_id",
|
||||
table: "number_sequences");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "BranchId",
|
||||
table: "customers");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_number_sequences_doc_type_year",
|
||||
table: "number_sequences",
|
||||
columns: new[] { "doc_type", "year" },
|
||||
unique: true);
|
||||
}
|
||||
}
|
||||
}
|
||||
+8730
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,205 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace ERPCore.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class AddBarcodeLotScanning : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "BatchId",
|
||||
table: "stock_count_lines",
|
||||
type: "integer",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "SerialId",
|
||||
table: "stock_count_lines",
|
||||
type: "integer",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "Barcode",
|
||||
table: "serials",
|
||||
type: "character varying(100)",
|
||||
maxLength: 100,
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "BatchId",
|
||||
table: "sales_slip_lines",
|
||||
type: "integer",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "SerialId",
|
||||
table: "sales_slip_lines",
|
||||
type: "integer",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "Barcode",
|
||||
table: "items",
|
||||
type: "character varying(100)",
|
||||
maxLength: 100,
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "Barcode",
|
||||
table: "batches",
|
||||
type: "character varying(100)",
|
||||
maxLength: 100,
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_stock_count_lines_BatchId",
|
||||
table: "stock_count_lines",
|
||||
column: "BatchId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_stock_count_lines_SerialId",
|
||||
table: "stock_count_lines",
|
||||
column: "SerialId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_serials_Barcode",
|
||||
table: "serials",
|
||||
column: "Barcode",
|
||||
unique: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_sales_slip_lines_BatchId",
|
||||
table: "sales_slip_lines",
|
||||
column: "BatchId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_sales_slip_lines_SerialId",
|
||||
table: "sales_slip_lines",
|
||||
column: "SerialId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_items_Barcode",
|
||||
table: "items",
|
||||
column: "Barcode",
|
||||
unique: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_batches_Barcode",
|
||||
table: "batches",
|
||||
column: "Barcode",
|
||||
unique: true);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_sales_slip_lines_batches_BatchId",
|
||||
table: "sales_slip_lines",
|
||||
column: "BatchId",
|
||||
principalTable: "batches",
|
||||
principalColumn: "BatchId",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_sales_slip_lines_serials_SerialId",
|
||||
table: "sales_slip_lines",
|
||||
column: "SerialId",
|
||||
principalTable: "serials",
|
||||
principalColumn: "SerialId",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_stock_count_lines_batches_BatchId",
|
||||
table: "stock_count_lines",
|
||||
column: "BatchId",
|
||||
principalTable: "batches",
|
||||
principalColumn: "BatchId",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_stock_count_lines_serials_SerialId",
|
||||
table: "stock_count_lines",
|
||||
column: "SerialId",
|
||||
principalTable: "serials",
|
||||
principalColumn: "SerialId",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_sales_slip_lines_batches_BatchId",
|
||||
table: "sales_slip_lines");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_sales_slip_lines_serials_SerialId",
|
||||
table: "sales_slip_lines");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_stock_count_lines_batches_BatchId",
|
||||
table: "stock_count_lines");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_stock_count_lines_serials_SerialId",
|
||||
table: "stock_count_lines");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_stock_count_lines_BatchId",
|
||||
table: "stock_count_lines");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_stock_count_lines_SerialId",
|
||||
table: "stock_count_lines");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_serials_Barcode",
|
||||
table: "serials");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_sales_slip_lines_BatchId",
|
||||
table: "sales_slip_lines");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_sales_slip_lines_SerialId",
|
||||
table: "sales_slip_lines");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_items_Barcode",
|
||||
table: "items");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_batches_Barcode",
|
||||
table: "batches");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "BatchId",
|
||||
table: "stock_count_lines");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "SerialId",
|
||||
table: "stock_count_lines");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Barcode",
|
||||
table: "serials");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "BatchId",
|
||||
table: "sales_slip_lines");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "SerialId",
|
||||
table: "sales_slip_lines");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Barcode",
|
||||
table: "items");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Barcode",
|
||||
table: "batches");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -225,6 +225,10 @@ namespace ERPCore.Migrations
|
||||
|
||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("BatchId"));
|
||||
|
||||
b.Property<string>("Barcode")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("character varying(100)");
|
||||
|
||||
b.Property<string>("BatchNo")
|
||||
.IsRequired()
|
||||
.HasMaxLength(50)
|
||||
@@ -238,6 +242,9 @@ namespace ERPCore.Migrations
|
||||
|
||||
b.HasKey("BatchId");
|
||||
|
||||
b.HasIndex("Barcode")
|
||||
.IsUnique();
|
||||
|
||||
b.HasIndex("ItemId", "BatchNo")
|
||||
.IsUnique();
|
||||
|
||||
@@ -349,6 +356,9 @@ namespace ERPCore.Migrations
|
||||
b.Property<int?>("UpdatedBy")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<bool>("WarehouseBranchingEnabled")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.HasKey("ConfigId");
|
||||
|
||||
b.HasIndex("UpdatedBy");
|
||||
@@ -717,6 +727,9 @@ namespace ERPCore.Migrations
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("character varying(250)");
|
||||
|
||||
b.Property<int>("BranchId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("City")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("character varying(100)");
|
||||
@@ -789,6 +802,8 @@ namespace ERPCore.Migrations
|
||||
|
||||
b.HasKey("CustomerId");
|
||||
|
||||
b.HasIndex("BranchId");
|
||||
|
||||
b.HasIndex("CustomerCode")
|
||||
.IsUnique();
|
||||
|
||||
@@ -1688,6 +1703,10 @@ namespace ERPCore.Migrations
|
||||
|
||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("ItemId"));
|
||||
|
||||
b.Property<string>("Barcode")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("character varying(100)");
|
||||
|
||||
b.Property<int>("BaseUomId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
@@ -1766,9 +1785,8 @@ namespace ERPCore.Migrations
|
||||
b.Property<int?>("SubCategoryId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("TaxClass")
|
||||
.HasMaxLength(20)
|
||||
.HasColumnType("character varying(20)");
|
||||
b.Property<int?>("TaxRateId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("TrackingMode")
|
||||
.IsRequired()
|
||||
@@ -1790,6 +1808,9 @@ namespace ERPCore.Migrations
|
||||
|
||||
b.HasKey("ItemId");
|
||||
|
||||
b.HasIndex("Barcode")
|
||||
.IsUnique();
|
||||
|
||||
b.HasIndex("BaseUomId");
|
||||
|
||||
b.HasIndex("BrandId");
|
||||
@@ -1805,6 +1826,8 @@ namespace ERPCore.Migrations
|
||||
|
||||
b.HasIndex("SubCategoryId");
|
||||
|
||||
b.HasIndex("TaxRateId");
|
||||
|
||||
b.ToTable("items", (string)null);
|
||||
});
|
||||
|
||||
@@ -2367,6 +2390,46 @@ namespace ERPCore.Migrations
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ERPCore.Domain.Entities.Notification", b =>
|
||||
{
|
||||
b.Property<int>("NotificationId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer");
|
||||
|
||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("NotificationId"));
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<string>("Message")
|
||||
.IsRequired()
|
||||
.HasMaxLength(1000)
|
||||
.HasColumnType("character varying(1000)");
|
||||
|
||||
b.Property<string>("ModuleKey")
|
||||
.IsRequired()
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("character varying(100)");
|
||||
|
||||
b.Property<int?>("RelatedEntityId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("RelatedEntityType")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("character varying(100)");
|
||||
|
||||
b.Property<string>("Title")
|
||||
.IsRequired()
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("character varying(200)");
|
||||
|
||||
b.HasKey("NotificationId");
|
||||
|
||||
b.HasIndex("CreatedAt");
|
||||
|
||||
b.ToTable("notifications", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ERPCore.Domain.Entities.NotificationConfig", b =>
|
||||
{
|
||||
b.Property<int>("NotificationConfigId")
|
||||
@@ -2435,6 +2498,35 @@ namespace ERPCore.Migrations
|
||||
b.ToTable("notification_config_modules", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ERPCore.Domain.Entities.NotificationRecipient", b =>
|
||||
{
|
||||
b.Property<int>("NotificationRecipientId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer");
|
||||
|
||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("NotificationRecipientId"));
|
||||
|
||||
b.Property<bool>("IsRead")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<int>("NotificationId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<DateTime?>("ReadAt")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<int>("UserId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.HasKey("NotificationRecipientId");
|
||||
|
||||
b.HasIndex("NotificationId");
|
||||
|
||||
b.HasIndex("UserId", "IsRead", "NotificationId");
|
||||
|
||||
b.ToTable("notification_recipients", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ERPCore.Domain.Entities.NumberSequence", b =>
|
||||
{
|
||||
b.Property<int>("SequenceId")
|
||||
@@ -2443,6 +2535,10 @@ namespace ERPCore.Migrations
|
||||
|
||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("SequenceId"));
|
||||
|
||||
b.Property<int>("BranchId")
|
||||
.HasColumnType("integer")
|
||||
.HasColumnName("branch_id");
|
||||
|
||||
b.Property<string>("DocType")
|
||||
.IsRequired()
|
||||
.HasMaxLength(10)
|
||||
@@ -2459,7 +2555,9 @@ namespace ERPCore.Migrations
|
||||
|
||||
b.HasKey("SequenceId");
|
||||
|
||||
b.HasIndex("DocType", "Year")
|
||||
b.HasIndex("BranchId");
|
||||
|
||||
b.HasIndex("DocType", "BranchId", "Year")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("number_sequences", (string)null);
|
||||
@@ -3086,6 +3184,12 @@ namespace ERPCore.Migrations
|
||||
PermissionId = 52,
|
||||
Code = "NAV:sales.day-end",
|
||||
SubNavItemId = 42
|
||||
},
|
||||
new
|
||||
{
|
||||
PermissionId = 53,
|
||||
Code = "NAV:products.tax-rates",
|
||||
SubNavItemId = 43
|
||||
});
|
||||
});
|
||||
|
||||
@@ -3337,6 +3441,9 @@ namespace ERPCore.Migrations
|
||||
.HasPrecision(18, 4)
|
||||
.HasColumnType("numeric(18,4)");
|
||||
|
||||
b.Property<int>("BranchId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
@@ -3409,6 +3516,8 @@ namespace ERPCore.Migrations
|
||||
|
||||
b.HasKey("PurchaseInvoiceId");
|
||||
|
||||
b.HasIndex("BranchId");
|
||||
|
||||
b.HasIndex("CreatedBy");
|
||||
|
||||
b.HasIndex("DocNo")
|
||||
@@ -3519,6 +3628,18 @@ namespace ERPCore.Migrations
|
||||
b.Property<bool>("ApprovalRequired")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<DateTime?>("ApprovedAt")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<int?>("ApprovedBy")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<int?>("ApproverUserId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<int>("BranchId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
@@ -3552,6 +3673,10 @@ namespace ERPCore.Migrations
|
||||
|
||||
b.HasKey("PoId");
|
||||
|
||||
b.HasIndex("ApproverUserId");
|
||||
|
||||
b.HasIndex("BranchId");
|
||||
|
||||
b.HasIndex("CreatedBy");
|
||||
|
||||
b.HasIndex("DocNo")
|
||||
@@ -3693,6 +3818,9 @@ namespace ERPCore.Migrations
|
||||
|
||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("RequisitionId"));
|
||||
|
||||
b.Property<int>("BranchId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
@@ -3711,6 +3839,8 @@ namespace ERPCore.Migrations
|
||||
|
||||
b.HasKey("RequisitionId");
|
||||
|
||||
b.HasIndex("BranchId");
|
||||
|
||||
b.HasIndex("DocNo")
|
||||
.IsUnique();
|
||||
|
||||
@@ -3759,6 +3889,9 @@ namespace ERPCore.Migrations
|
||||
|
||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("RfqId"));
|
||||
|
||||
b.Property<int>("BranchId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
@@ -3777,6 +3910,8 @@ namespace ERPCore.Migrations
|
||||
|
||||
b.HasKey("RfqId");
|
||||
|
||||
b.HasIndex("BranchId");
|
||||
|
||||
b.HasIndex("DocNo")
|
||||
.IsUnique();
|
||||
|
||||
@@ -3877,6 +4012,11 @@ namespace ERPCore.Migrations
|
||||
b.Property<int>("PermissionId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<int>("Actions")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer")
|
||||
.HasDefaultValue(31);
|
||||
|
||||
b.HasKey("RoleId", "PermissionId");
|
||||
|
||||
b.HasIndex("PermissionId");
|
||||
@@ -4205,6 +4345,10 @@ namespace ERPCore.Migrations
|
||||
|
||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("SalesDayEndId"));
|
||||
|
||||
b.Property<decimal>("BalanceTotal")
|
||||
.HasPrecision(18, 4)
|
||||
.HasColumnType("numeric(18,4)");
|
||||
|
||||
b.Property<int>("BundleCount")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer")
|
||||
@@ -4246,6 +4390,10 @@ namespace ERPCore.Migrations
|
||||
.HasPrecision(18, 4)
|
||||
.HasColumnType("numeric(18,4)");
|
||||
|
||||
b.Property<decimal>("PaidTotal")
|
||||
.HasPrecision(18, 4)
|
||||
.HasColumnType("numeric(18,4)");
|
||||
|
||||
b.Property<uint>("RowVersion")
|
||||
.IsConcurrencyToken()
|
||||
.ValueGeneratedOnAddOrUpdate()
|
||||
@@ -4739,6 +4887,9 @@ namespace ERPCore.Migrations
|
||||
.HasPrecision(18, 4)
|
||||
.HasColumnType("numeric(18,4)");
|
||||
|
||||
b.Property<int?>("BatchId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.IsRequired()
|
||||
.HasMaxLength(200)
|
||||
@@ -4794,6 +4945,9 @@ namespace ERPCore.Migrations
|
||||
b.Property<int>("SalesSlipId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<int?>("SerialId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<decimal>("TaxAmount")
|
||||
.HasPrecision(18, 4)
|
||||
.HasColumnType("numeric(18,4)");
|
||||
@@ -4811,10 +4965,14 @@ namespace ERPCore.Migrations
|
||||
|
||||
b.HasKey("SalesSlipLineId");
|
||||
|
||||
b.HasIndex("BatchId");
|
||||
|
||||
b.HasIndex("ItemId");
|
||||
|
||||
b.HasIndex("SalesSlipId");
|
||||
|
||||
b.HasIndex("SerialId");
|
||||
|
||||
b.HasIndex("WarehouseId");
|
||||
|
||||
b.ToTable("sales_slip_lines", (string)null);
|
||||
@@ -4828,6 +4986,10 @@ namespace ERPCore.Migrations
|
||||
|
||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("SerialId"));
|
||||
|
||||
b.Property<string>("Barcode")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("character varying(100)");
|
||||
|
||||
b.Property<int>("ItemId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
@@ -4843,6 +5005,9 @@ namespace ERPCore.Migrations
|
||||
|
||||
b.HasKey("SerialId");
|
||||
|
||||
b.HasIndex("Barcode")
|
||||
.IsUnique();
|
||||
|
||||
b.HasIndex("ItemId", "SerialNo")
|
||||
.IsUnique();
|
||||
|
||||
@@ -5126,6 +5291,9 @@ namespace ERPCore.Migrations
|
||||
|
||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("CountLineId"));
|
||||
|
||||
b.Property<int?>("BatchId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<int?>("BinId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
@@ -5139,6 +5307,9 @@ namespace ERPCore.Migrations
|
||||
b.Property<int>("ItemId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<int?>("SerialId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<decimal>("SystemQty")
|
||||
.HasPrecision(18, 4)
|
||||
.HasColumnType("numeric(18,4)");
|
||||
@@ -5149,12 +5320,16 @@ namespace ERPCore.Migrations
|
||||
|
||||
b.HasKey("CountLineId");
|
||||
|
||||
b.HasIndex("BatchId");
|
||||
|
||||
b.HasIndex("BinId");
|
||||
|
||||
b.HasIndex("CountId");
|
||||
|
||||
b.HasIndex("ItemId");
|
||||
|
||||
b.HasIndex("SerialId");
|
||||
|
||||
b.ToTable("stock_count_lines", (string)null);
|
||||
});
|
||||
|
||||
@@ -5557,6 +5732,16 @@ namespace ERPCore.Migrations
|
||||
Status = "Active"
|
||||
},
|
||||
new
|
||||
{
|
||||
SubNavItemId = 43,
|
||||
Code = "products.tax-rates",
|
||||
Href = "/dashboard/products/tax-rates",
|
||||
Label = "Tax Rates",
|
||||
NavItemId = 2,
|
||||
SortOrder = 7,
|
||||
Status = "Active"
|
||||
},
|
||||
new
|
||||
{
|
||||
SubNavItemId = 29,
|
||||
Code = "settings.branches",
|
||||
@@ -5908,6 +6093,166 @@ namespace ERPCore.Migrations
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ERPCore.Domain.Entities.SupportTicket", b =>
|
||||
{
|
||||
b.Property<int>("TicketId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer");
|
||||
|
||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("TicketId"));
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<int>("CreatedBy")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<uint>("RowVersion")
|
||||
.IsConcurrencyToken()
|
||||
.ValueGeneratedOnAddOrUpdate()
|
||||
.HasColumnType("xid")
|
||||
.HasColumnName("xmin");
|
||||
|
||||
b.Property<string>("Status")
|
||||
.IsRequired()
|
||||
.HasMaxLength(20)
|
||||
.HasColumnType("character varying(20)");
|
||||
|
||||
b.Property<string>("Subject")
|
||||
.IsRequired()
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("character varying(200)");
|
||||
|
||||
b.Property<DateTime?>("UpdatedAt")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<int?>("UpdatedBy")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.HasKey("TicketId");
|
||||
|
||||
b.HasIndex("CreatedBy");
|
||||
|
||||
b.HasIndex("Status");
|
||||
|
||||
b.ToTable("support_tickets", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ERPCore.Domain.Entities.SupportTicketMessage", b =>
|
||||
{
|
||||
b.Property<int>("MessageId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer");
|
||||
|
||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("MessageId"));
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<bool>("IsFromAdmin")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<string>("Message")
|
||||
.IsRequired()
|
||||
.HasMaxLength(2000)
|
||||
.HasColumnType("character varying(2000)");
|
||||
|
||||
b.Property<int>("SenderUserId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<int>("TicketId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.HasKey("MessageId");
|
||||
|
||||
b.HasIndex("TicketId", "CreatedAt");
|
||||
|
||||
b.ToTable("support_ticket_messages", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ERPCore.Domain.Entities.TaxRate", b =>
|
||||
{
|
||||
b.Property<int>("TaxRateId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer");
|
||||
|
||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("TaxRateId"));
|
||||
|
||||
b.Property<string>("Code")
|
||||
.IsRequired()
|
||||
.HasMaxLength(20)
|
||||
.HasColumnType("character varying(20)");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("character varying(100)");
|
||||
|
||||
b.Property<decimal>("Percentage")
|
||||
.HasPrecision(5, 2)
|
||||
.HasColumnType("numeric(5,2)");
|
||||
|
||||
b.Property<uint>("RowVersion")
|
||||
.IsConcurrencyToken()
|
||||
.ValueGeneratedOnAddOrUpdate()
|
||||
.HasColumnType("xid")
|
||||
.HasColumnName("xmin");
|
||||
|
||||
b.Property<string>("Status")
|
||||
.IsRequired()
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasMaxLength(20)
|
||||
.HasColumnType("character varying(20)")
|
||||
.HasDefaultValue("Active");
|
||||
|
||||
b.Property<DateTime?>("UpdatedAt")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.HasKey("TaxRateId");
|
||||
|
||||
b.HasIndex("Code")
|
||||
.IsUnique();
|
||||
|
||||
b.HasIndex("Status");
|
||||
|
||||
b.ToTable("tax_rates", (string)null);
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
TaxRateId = 1,
|
||||
Code = "STANDARD",
|
||||
CreatedAt = new DateTime(2026, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc),
|
||||
Name = "Standard",
|
||||
Percentage = 15m,
|
||||
RowVersion = 0u,
|
||||
Status = "Active"
|
||||
},
|
||||
new
|
||||
{
|
||||
TaxRateId = 2,
|
||||
Code = "ZERO",
|
||||
CreatedAt = new DateTime(2026, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc),
|
||||
Name = "Zero-Rated",
|
||||
Percentage = 0m,
|
||||
RowVersion = 0u,
|
||||
Status = "Active"
|
||||
},
|
||||
new
|
||||
{
|
||||
TaxRateId = 3,
|
||||
Code = "EXEMPT",
|
||||
CreatedAt = new DateTime(2026, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc),
|
||||
Name = "Exempt",
|
||||
Percentage = 0m,
|
||||
RowVersion = 0u,
|
||||
Status = "Active"
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ERPCore.Domain.Entities.TaxSlab", b =>
|
||||
{
|
||||
b.Property<int>("TaxSlabId")
|
||||
@@ -6095,6 +6440,9 @@ namespace ERPCore.Migrations
|
||||
|
||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("VendorId"));
|
||||
|
||||
b.Property<int>("BranchId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("Code")
|
||||
.IsRequired()
|
||||
.HasMaxLength(50)
|
||||
@@ -6141,6 +6489,8 @@ namespace ERPCore.Migrations
|
||||
|
||||
b.HasKey("VendorId");
|
||||
|
||||
b.HasIndex("BranchId");
|
||||
|
||||
b.HasIndex("Code")
|
||||
.IsUnique();
|
||||
|
||||
@@ -6214,6 +6564,9 @@ namespace ERPCore.Migrations
|
||||
|
||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("WarehouseId"));
|
||||
|
||||
b.Property<string>("Address")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<int>("BranchId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
@@ -6227,6 +6580,9 @@ namespace ERPCore.Migrations
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("character varying(200)");
|
||||
|
||||
b.Property<string>("Phone")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.HasKey("WarehouseId");
|
||||
|
||||
b.HasIndex("BranchId");
|
||||
@@ -6474,11 +6830,19 @@ namespace ERPCore.Migrations
|
||||
|
||||
modelBuilder.Entity("ERPCore.Domain.Entities.Customer", b =>
|
||||
{
|
||||
b.HasOne("ERPCore.Domain.Entities.Branch", "Branch")
|
||||
.WithMany()
|
||||
.HasForeignKey("BranchId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("ERPCore.Domain.Entities.Warehouse", "DefaultWarehouse")
|
||||
.WithMany()
|
||||
.HasForeignKey("DefaultWarehouseId")
|
||||
.OnDelete(DeleteBehavior.SetNull);
|
||||
|
||||
b.Navigation("Branch");
|
||||
|
||||
b.Navigation("DefaultWarehouse");
|
||||
});
|
||||
|
||||
@@ -6763,6 +7127,11 @@ namespace ERPCore.Migrations
|
||||
.HasForeignKey("SubCategoryId")
|
||||
.OnDelete(DeleteBehavior.Restrict);
|
||||
|
||||
b.HasOne("ERPCore.Domain.Entities.TaxRate", "TaxRate")
|
||||
.WithMany()
|
||||
.HasForeignKey("TaxRateId")
|
||||
.OnDelete(DeleteBehavior.Restrict);
|
||||
|
||||
b.Navigation("BaseUom");
|
||||
|
||||
b.Navigation("Brand");
|
||||
@@ -6772,6 +7141,8 @@ namespace ERPCore.Migrations
|
||||
b.Navigation("DefaultVendor");
|
||||
|
||||
b.Navigation("SubCategory");
|
||||
|
||||
b.Navigation("TaxRate");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ERPCore.Domain.Entities.ItemReorder", b =>
|
||||
@@ -6881,6 +7252,36 @@ namespace ERPCore.Migrations
|
||||
b.Navigation("NotificationConfig");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ERPCore.Domain.Entities.NotificationRecipient", b =>
|
||||
{
|
||||
b.HasOne("ERPCore.Domain.Entities.Notification", "Notification")
|
||||
.WithMany("Recipients")
|
||||
.HasForeignKey("NotificationId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("ERPCore.Domain.Entities.User", "User")
|
||||
.WithMany()
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Notification");
|
||||
|
||||
b.Navigation("User");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ERPCore.Domain.Entities.NumberSequence", b =>
|
||||
{
|
||||
b.HasOne("ERPCore.Domain.Entities.Branch", "Branch")
|
||||
.WithMany()
|
||||
.HasForeignKey("BranchId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Branch");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ERPCore.Domain.Entities.PayrollLine", b =>
|
||||
{
|
||||
b.HasOne("ERPCore.Domain.Entities.Employee", "Employee")
|
||||
@@ -7047,6 +7448,12 @@ namespace ERPCore.Migrations
|
||||
|
||||
modelBuilder.Entity("ERPCore.Domain.Entities.PurchaseInvoice", b =>
|
||||
{
|
||||
b.HasOne("ERPCore.Domain.Entities.Branch", "Branch")
|
||||
.WithMany()
|
||||
.HasForeignKey("BranchId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("ERPCore.Domain.Entities.User", "Creator")
|
||||
.WithMany()
|
||||
.HasForeignKey("CreatedBy")
|
||||
@@ -7059,6 +7466,8 @@ namespace ERPCore.Migrations
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Branch");
|
||||
|
||||
b.Navigation("Creator");
|
||||
|
||||
b.Navigation("Vendor");
|
||||
@@ -7104,6 +7513,16 @@ namespace ERPCore.Migrations
|
||||
|
||||
modelBuilder.Entity("ERPCore.Domain.Entities.PurchaseOrder", b =>
|
||||
{
|
||||
b.HasOne("ERPCore.Domain.Entities.User", "Approver")
|
||||
.WithMany()
|
||||
.HasForeignKey("ApproverUserId");
|
||||
|
||||
b.HasOne("ERPCore.Domain.Entities.Branch", "Branch")
|
||||
.WithMany()
|
||||
.HasForeignKey("BranchId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("ERPCore.Domain.Entities.User", "Creator")
|
||||
.WithMany()
|
||||
.HasForeignKey("CreatedBy")
|
||||
@@ -7121,6 +7540,10 @@ namespace ERPCore.Migrations
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Approver");
|
||||
|
||||
b.Navigation("Branch");
|
||||
|
||||
b.Navigation("Creator");
|
||||
|
||||
b.Navigation("Requisition");
|
||||
@@ -7191,12 +7614,20 @@ namespace ERPCore.Migrations
|
||||
|
||||
modelBuilder.Entity("ERPCore.Domain.Entities.Requisition", b =>
|
||||
{
|
||||
b.HasOne("ERPCore.Domain.Entities.Branch", "Branch")
|
||||
.WithMany()
|
||||
.HasForeignKey("BranchId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("ERPCore.Domain.Entities.User", "Requester")
|
||||
.WithMany()
|
||||
.HasForeignKey("RequestedBy")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Branch");
|
||||
|
||||
b.Navigation("Requester");
|
||||
});
|
||||
|
||||
@@ -7221,12 +7652,20 @@ namespace ERPCore.Migrations
|
||||
|
||||
modelBuilder.Entity("ERPCore.Domain.Entities.Rfq", b =>
|
||||
{
|
||||
b.HasOne("ERPCore.Domain.Entities.Branch", "Branch")
|
||||
.WithMany()
|
||||
.HasForeignKey("BranchId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("ERPCore.Domain.Entities.Requisition", "Requisition")
|
||||
.WithMany()
|
||||
.HasForeignKey("RequisitionId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Branch");
|
||||
|
||||
b.Navigation("Requisition");
|
||||
});
|
||||
|
||||
@@ -7591,6 +8030,11 @@ namespace ERPCore.Migrations
|
||||
|
||||
modelBuilder.Entity("ERPCore.Domain.Entities.SalesSlipLine", b =>
|
||||
{
|
||||
b.HasOne("ERPCore.Domain.Entities.Batch", "Batch")
|
||||
.WithMany()
|
||||
.HasForeignKey("BatchId")
|
||||
.OnDelete(DeleteBehavior.Restrict);
|
||||
|
||||
b.HasOne("ERPCore.Domain.Entities.Item", "Item")
|
||||
.WithMany()
|
||||
.HasForeignKey("ItemId")
|
||||
@@ -7603,16 +8047,25 @@ namespace ERPCore.Migrations
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("ERPCore.Domain.Entities.Serial", "Serial")
|
||||
.WithMany()
|
||||
.HasForeignKey("SerialId")
|
||||
.OnDelete(DeleteBehavior.Restrict);
|
||||
|
||||
b.HasOne("ERPCore.Domain.Entities.Warehouse", "Warehouse")
|
||||
.WithMany()
|
||||
.HasForeignKey("WarehouseId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Batch");
|
||||
|
||||
b.Navigation("Item");
|
||||
|
||||
b.Navigation("SalesSlip");
|
||||
|
||||
b.Navigation("Serial");
|
||||
|
||||
b.Navigation("Warehouse");
|
||||
});
|
||||
|
||||
@@ -7802,6 +8255,11 @@ namespace ERPCore.Migrations
|
||||
|
||||
modelBuilder.Entity("ERPCore.Domain.Entities.StockCountLine", b =>
|
||||
{
|
||||
b.HasOne("ERPCore.Domain.Entities.Batch", "Batch")
|
||||
.WithMany()
|
||||
.HasForeignKey("BatchId")
|
||||
.OnDelete(DeleteBehavior.Restrict);
|
||||
|
||||
b.HasOne("ERPCore.Domain.Entities.Bin", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("BinId")
|
||||
@@ -7819,9 +8277,18 @@ namespace ERPCore.Migrations
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("ERPCore.Domain.Entities.Serial", "Serial")
|
||||
.WithMany()
|
||||
.HasForeignKey("SerialId")
|
||||
.OnDelete(DeleteBehavior.Restrict);
|
||||
|
||||
b.Navigation("Batch");
|
||||
|
||||
b.Navigation("Count");
|
||||
|
||||
b.Navigation("Item");
|
||||
|
||||
b.Navigation("Serial");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ERPCore.Domain.Entities.StockLayer", b =>
|
||||
@@ -7996,6 +8463,17 @@ namespace ERPCore.Migrations
|
||||
b.Navigation("NavItem");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ERPCore.Domain.Entities.SupportTicketMessage", b =>
|
||||
{
|
||||
b.HasOne("ERPCore.Domain.Entities.SupportTicket", "Ticket")
|
||||
.WithMany("Messages")
|
||||
.HasForeignKey("TicketId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Ticket");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ERPCore.Domain.Entities.TemplateStage", b =>
|
||||
{
|
||||
b.HasOne("ERPCore.Domain.Entities.ProductionTemplate", "Template")
|
||||
@@ -8017,6 +8495,17 @@ namespace ERPCore.Migrations
|
||||
b.Navigation("Role");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ERPCore.Domain.Entities.Vendor", b =>
|
||||
{
|
||||
b.HasOne("ERPCore.Domain.Entities.Branch", "Branch")
|
||||
.WithMany()
|
||||
.HasForeignKey("BranchId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Branch");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ERPCore.Domain.Entities.VendorQuotation", b =>
|
||||
{
|
||||
b.HasOne("ERPCore.Domain.Entities.Rfq", "Rfq")
|
||||
@@ -8111,6 +8600,11 @@ namespace ERPCore.Migrations
|
||||
b.Navigation("Children");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ERPCore.Domain.Entities.Notification", b =>
|
||||
{
|
||||
b.Navigation("Recipients");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ERPCore.Domain.Entities.NotificationConfig", b =>
|
||||
{
|
||||
b.Navigation("Modules");
|
||||
@@ -8221,6 +8715,11 @@ namespace ERPCore.Migrations
|
||||
b.Navigation("Lines");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ERPCore.Domain.Entities.SupportTicket", b =>
|
||||
{
|
||||
b.Navigation("Messages");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ERPCore.Domain.Entities.TemplateStage", b =>
|
||||
{
|
||||
b.Navigation("Inputs");
|
||||
|
||||
Reference in New Issue
Block a user