shoc-backend/Data.SeaHavenIndustries/Migrations/20260417171152_AddDispatchNumberAndCommentDispatchId.cs
Adam Moussa 63f76e9b2c Add dispatch detail modal backend + vendor reply sync
- Add DispatchNumber and CompletedDate to Dispatch model
- Add DispatchId to Comments for per-dispatch vendor threads
- GetDispatchById endpoint with vendor communication thread
- UpdateDispatch endpoint for status, NTE, dates, description
- AddDispatchComment endpoint — saves comment + sends email to vendor with sender name
- BackfillDispatchNumbers endpoint for existing dispatches
- SyncVendorReplies endpoint — pulls from DynamoDB VendorReplies table
- Fix reply-to address to include dispatch number
- Include sender name in dispatch and comment emails
2026-04-17 14:01:03 -04:00

70 lines
2.1 KiB
C#

using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Data.SeaHavenIndustries.Migrations
{
/// <inheritdoc />
public partial class AddDispatchNumberAndCommentDispatchId : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<DateTime>(
name: "CompletedDate",
table: "Dispatches",
type: "datetime2",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "DispatchNumber",
table: "Dispatches",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<int>(
name: "DispatchId",
table: "Comments",
type: "int",
nullable: true);
migrationBuilder.CreateIndex(
name: "IX_Comments_DispatchId",
table: "Comments",
column: "DispatchId");
migrationBuilder.AddForeignKey(
name: "FK_Comments_Dispatches_DispatchId",
table: "Comments",
column: "DispatchId",
principalTable: "Dispatches",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_Comments_Dispatches_DispatchId",
table: "Comments");
migrationBuilder.DropIndex(
name: "IX_Comments_DispatchId",
table: "Comments");
migrationBuilder.DropColumn(
name: "CompletedDate",
table: "Dispatches");
migrationBuilder.DropColumn(
name: "DispatchNumber",
table: "Dispatches");
migrationBuilder.DropColumn(
name: "DispatchId",
table: "Comments");
}
}
}