mirror of
https://github.com/Sea-Haven-Industries/shoc-backend.git
synced 2026-09-30 21:13:12 +00:00
- DispatchChecklistItem model (DispatchId, WorkOrderId, ItemText, IsCompleted, CompletedBy, CompletedAt) - DispatchToVendor copies template items when TaskListTemplateId provided - Supports custom checklist items alongside template items - UpdateChecklistItem endpoint to toggle completion with user name - AddChecklistItem endpoint for ad-hoc items - GetDispatchById includes checklist items in response - Migration for DispatchChecklistItems table
70 lines
3.2 KiB
C#
70 lines
3.2 KiB
C#
using System;
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
namespace Data.SeaHavenIndustries.Migrations
|
|
{
|
|
/// <inheritdoc />
|
|
public partial class AddDispatchChecklist : Migration
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.CreateTable(
|
|
name: "DispatchChecklistItems",
|
|
columns: table => new
|
|
{
|
|
Id = table.Column<int>(type: "int", nullable: false)
|
|
.Annotation("SqlServer:Identity", "1, 1"),
|
|
DispatchId = table.Column<int>(type: "int", nullable: false),
|
|
WorkOrderId = table.Column<int>(type: "int", nullable: true),
|
|
ItemText = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
|
IsCompleted = table.Column<bool>(type: "bit", nullable: false),
|
|
CompletedBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
|
CompletedAt = table.Column<DateTime>(type: "datetime2", nullable: true),
|
|
SortOrder = table.Column<int>(type: "int", nullable: false),
|
|
IsDeleted = table.Column<bool>(type: "bit", nullable: true),
|
|
createdby = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
|
DeleterUserId = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
|
DeletionTime = table.Column<DateTime>(type: "datetime2", nullable: true),
|
|
CreatedDate = table.Column<DateTime>(type: "datetime2", nullable: true),
|
|
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
|
|
LastModifierUserId = table.Column<int>(type: "int", nullable: true)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_DispatchChecklistItems", x => x.Id);
|
|
table.ForeignKey(
|
|
name: "FK_DispatchChecklistItems_Dispatches_DispatchId",
|
|
column: x => x.DispatchId,
|
|
principalTable: "Dispatches",
|
|
principalColumn: "Id",
|
|
onDelete: ReferentialAction.Restrict);
|
|
table.ForeignKey(
|
|
name: "FK_DispatchChecklistItems_workOrders_WorkOrderId",
|
|
column: x => x.WorkOrderId,
|
|
principalTable: "workOrders",
|
|
principalColumn: "Id",
|
|
onDelete: ReferentialAction.Restrict);
|
|
});
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_DispatchChecklistItems_DispatchId",
|
|
table: "DispatchChecklistItems",
|
|
column: "DispatchId");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_DispatchChecklistItems_WorkOrderId",
|
|
table: "DispatchChecklistItems",
|
|
column: "WorkOrderId");
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropTable(
|
|
name: "DispatchChecklistItems");
|
|
}
|
|
}
|
|
}
|