using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace PowderCoating.Infrastructure.Migrations
{
    /// <inheritdoc />
    public partial class UpdateOperatingCostsRushCharge : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropColumn(
                name: "AdminOverheadPercentage",
                table: "CompanyOperatingCosts");

            migrationBuilder.DropColumn(
                name: "ElectricityRatePerKwh",
                table: "CompanyOperatingCosts");

            migrationBuilder.DropColumn(
                name: "FacilityCostPercentage",
                table: "CompanyOperatingCosts");

            migrationBuilder.DropColumn(
                name: "GasRatePerUnit",
                table: "CompanyOperatingCosts");

            migrationBuilder.DropColumn(
                name: "OvertimeLaborRate",
                table: "CompanyOperatingCosts");

            migrationBuilder.DropColumn(
                name: "SpecializedLaborRate",
                table: "CompanyOperatingCosts");

            migrationBuilder.RenameColumn(
                name: "WaterRatePerUnit",
                table: "CompanyOperatingCosts",
                newName: "RushChargeFixedAmount");

            migrationBuilder.AddColumn<string>(
                name: "RushChargeType",
                table: "CompanyOperatingCosts",
                type: "nvarchar(20)",
                maxLength: 20,
                nullable: false,
                defaultValue: "Percentage");

            migrationBuilder.UpdateData(
                table: "PricingTiers",
                keyColumn: "Id",
                keyValue: 1,
                column: "CreatedAt",
                value: new DateTime(2026, 2, 11, 19, 55, 20, 89, DateTimeKind.Utc).AddTicks(7507));

            migrationBuilder.UpdateData(
                table: "PricingTiers",
                keyColumn: "Id",
                keyValue: 2,
                column: "CreatedAt",
                value: new DateTime(2026, 2, 11, 19, 55, 20, 89, DateTimeKind.Utc).AddTicks(7511));

            migrationBuilder.UpdateData(
                table: "PricingTiers",
                keyColumn: "Id",
                keyValue: 3,
                column: "CreatedAt",
                value: new DateTime(2026, 2, 11, 19, 55, 20, 89, DateTimeKind.Utc).AddTicks(7513));
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropColumn(
                name: "RushChargeType",
                table: "CompanyOperatingCosts");

            migrationBuilder.RenameColumn(
                name: "RushChargeFixedAmount",
                table: "CompanyOperatingCosts",
                newName: "WaterRatePerUnit");

            migrationBuilder.AddColumn<decimal>(
                name: "AdminOverheadPercentage",
                table: "CompanyOperatingCosts",
                type: "decimal(18,2)",
                nullable: false,
                defaultValue: 0m);

            migrationBuilder.AddColumn<decimal>(
                name: "ElectricityRatePerKwh",
                table: "CompanyOperatingCosts",
                type: "decimal(18,2)",
                nullable: false,
                defaultValue: 0m);

            migrationBuilder.AddColumn<decimal>(
                name: "FacilityCostPercentage",
                table: "CompanyOperatingCosts",
                type: "decimal(18,2)",
                nullable: false,
                defaultValue: 0m);

            migrationBuilder.AddColumn<decimal>(
                name: "GasRatePerUnit",
                table: "CompanyOperatingCosts",
                type: "decimal(18,2)",
                nullable: false,
                defaultValue: 0m);

            migrationBuilder.AddColumn<decimal>(
                name: "OvertimeLaborRate",
                table: "CompanyOperatingCosts",
                type: "decimal(18,2)",
                nullable: false,
                defaultValue: 0m);

            migrationBuilder.AddColumn<decimal>(
                name: "SpecializedLaborRate",
                table: "CompanyOperatingCosts",
                type: "decimal(18,2)",
                nullable: false,
                defaultValue: 0m);

            migrationBuilder.UpdateData(
                table: "PricingTiers",
                keyColumn: "Id",
                keyValue: 1,
                column: "CreatedAt",
                value: new DateTime(2026, 2, 11, 4, 38, 17, 166, DateTimeKind.Utc).AddTicks(2142));

            migrationBuilder.UpdateData(
                table: "PricingTiers",
                keyColumn: "Id",
                keyValue: 2,
                column: "CreatedAt",
                value: new DateTime(2026, 2, 11, 4, 38, 17, 166, DateTimeKind.Utc).AddTicks(2149));

            migrationBuilder.UpdateData(
                table: "PricingTiers",
                keyColumn: "Id",
                keyValue: 3,
                column: "CreatedAt",
                value: new DateTime(2026, 2, 11, 4, 38, 17, 166, DateTimeKind.Utc).AddTicks(2151));
        }
    }
}
