Add vendor scheduled date to dispatch workflow

- Add ScheduledDate field to Dispatch model and DTO
- Save scheduled date when dispatching to vendor
- Include ScheduledDate in dispatch response projections
This commit is contained in:
Adam Moussa 2026-04-17 11:47:00 -04:00
parent d24c4643f5
commit ee69a1863a
6 changed files with 2517 additions and 0 deletions

View file

@ -648,6 +648,7 @@ namespace Api.SeaHavenIndustries.Controllers
d.NTEAmount,
d.Description,
d.Status,
d.ScheduledDate,
d.DispatchedAt,
d.EmailSent,
vendorName = d.Vendor != null ? d.Vendor.CompanyName : "",
@ -1034,6 +1035,7 @@ namespace Api.SeaHavenIndustries.Controllers
NTEAmount = model.NTEAmount,
Description = model.Description,
Status = "Sent",
ScheduledDate = model.ScheduledDate,
DispatchedAt = DateTime.UtcNow,
ReplyToAddress = replyTo
};

View file

@ -5,6 +5,7 @@ namespace Api.SeaHavenIndustries.DTOs
public int WorkOrderId { get; set; }
public List<int> VendorIds { get; set; } = new();
public decimal? NTEAmount { get; set; }
public DateTime? ScheduledDate { get; set; }
public string? Description { get; set; }
}
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,29 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Data.SeaHavenIndustries.Migrations
{
/// <inheritdoc />
public partial class AddDispatchScheduledDate : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<DateTime>(
name: "ScheduledDate",
table: "Dispatches",
type: "datetime2",
nullable: true);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "ScheduledDate",
table: "Dispatches");
}
}
}

View file

@ -671,6 +671,9 @@ namespace Data.SeaHavenIndustries.Migrations
b.Property<string>("ReplyToAddress")
.HasColumnType("nvarchar(max)");
b.Property<DateTime?>("ScheduledDate")
.HasColumnType("datetime2");
b.Property<string>("Status")
.HasColumnType("nvarchar(max)");

View file

@ -16,6 +16,7 @@ namespace Data.SeaHavenIndustries
public decimal? NTEAmount { get; set; }
public string? Description { get; set; }
public string? Status { get; set; }
public DateTime? ScheduledDate { get; set; }
public DateTime? DispatchedAt { get; set; }
public bool EmailSent { get; set; }
public string? ReplyToAddress { get; set; }