Skip to content
This repository was archived by the owner on Jul 28, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ private static List<NbssAppointmentEvent> MapFileDataRecordsToNbssAppointmentEve
HoldingClinic = NullIfWhiteSpace(record.Fields["Holding Clinic"]),
Status = record.Fields["Status"],
AttendedNotScreened = NullIfWhiteSpace(record.Fields["Attended Not Scr"]),
AppointmenId = record.Fields["Appointment ID"],
AppointmentId = record.Fields["Appointment ID"],
NhsNumber = record.Fields["NHS Num"],
EpisodeType = record.Fields["Episode Type"],
EpisodeStart = DateOnly.ParseExact(record.Fields["Episode Start"], "yyyyMMdd", CultureInfo.InvariantCulture),
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace ServiceLayer.Mesh.Migrations
{
/// <inheritdoc />
public partial class RenameProperty : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.RenameColumn(
name: "AppointmenId",
table: "NbssAppointmentEvents",
newName: "AppointmentId");
}

/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.RenameColumn(
name: "AppointmentId",
table: "NbssAppointmentEvents",
newName: "AppointmenId");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,14 @@ protected override void BuildModel(ModelBuilder modelBuilder)
b.Property<DateTime>("ActionTimestamp")
.HasColumnType("datetime2(0)");

b.Property<string>("AppointmenId")
b.Property<DateTime>("AppointmentDateTime")
.HasColumnType("datetime2(0)");

b.Property<string>("AppointmentId")
.IsRequired()
.HasMaxLength(27)
.HasColumnType("varchar(27)");

b.Property<DateTime>("AppointmentDateTime")
.HasColumnType("datetime2(0)");

b.Property<string>("AppointmentType")
.IsRequired()
.HasMaxLength(1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public class NbssAppointmentEvent
public string? AttendedNotScreened { get; set; }
[StringLength(27)]
[Column(TypeName = "varchar(27)")]
public required string AppointmenId { get; set; }
public required string AppointmentId { get; set; }
[StringLength(10, MinimumLength = 10)]
[Column(TypeName = "char(10)")]
public required string NhsNumber { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public async Task WriteStagedData_WhenFileValid_MapsFieldsAndSavesToDb()
Assert.Equal(firstRecord["Holding Clinic"], nbssAppointmentEvent.HoldingClinic);
Assert.Equal(firstRecord["Status"], nbssAppointmentEvent.Status);
Assert.Equal(firstRecord["Attended Not Scr"], nbssAppointmentEvent.AttendedNotScreened);
Assert.Equal(firstRecord["Appointment ID"], nbssAppointmentEvent.AppointmenId);
Assert.Equal(firstRecord["Appointment ID"], nbssAppointmentEvent.AppointmentId);
Assert.Equal(firstRecord["NHS Num"], nbssAppointmentEvent.NhsNumber);
Assert.Equal(firstRecord["Episode Type"], nbssAppointmentEvent.EpisodeType);
Assert.Equal(DateOnly.ParseExact(firstRecord.Fields["Episode Start"], "yyyyMMdd"), nbssAppointmentEvent.EpisodeStart);
Expand Down
Loading