mirror of
https://github.com/Sea-Haven-Industries/shoc-backend.git
synced 2026-09-30 04:53:11 +00:00
- DispatchSignoff model (DispatchId, SignoffType, Name, Signature base64, SignatureMethod, SignedAt) - AddDispatchSignoff endpoint — one per type per dispatch, validates no duplicate - GetDispatchById includes signoffs in response - Migration for DispatchSignoffs table
58 lines
2.6 KiB
C#
58 lines
2.6 KiB
C#
using System;
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
namespace Data.SeaHavenIndustries.Migrations
|
|
{
|
|
/// <inheritdoc />
|
|
public partial class AddDispatchSignoffs : Migration
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.CreateTable(
|
|
name: "DispatchSignoffs",
|
|
columns: table => new
|
|
{
|
|
Id = table.Column<int>(type: "int", nullable: false)
|
|
.Annotation("SqlServer:Identity", "1, 1"),
|
|
DispatchId = table.Column<int>(type: "int", nullable: false),
|
|
SignoffType = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
|
Name = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
|
Signature = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
|
SignatureMethod = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
|
SignedAt = table.Column<DateTime>(type: "datetime2", nullable: true),
|
|
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_DispatchSignoffs", x => x.Id);
|
|
table.ForeignKey(
|
|
name: "FK_DispatchSignoffs_Dispatches_DispatchId",
|
|
column: x => x.DispatchId,
|
|
principalTable: "Dispatches",
|
|
principalColumn: "Id",
|
|
onDelete: ReferentialAction.Restrict);
|
|
});
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_DispatchSignoffs_DispatchId",
|
|
table: "DispatchSignoffs",
|
|
column: "DispatchId");
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropTable(
|
|
name: "DispatchSignoffs");
|
|
}
|
|
}
|
|
}
|