Skip to content
This repository was archived by the owner on Jul 28, 2025. It is now read-only.

Commit 5da9446

Browse files
authored
fix: rename column (#50)
1 parent ed4d9b8 commit 5da9446

File tree

6 files changed

+260
-7
lines changed

6 files changed

+260
-7
lines changed

src/ServiceLayer.Mesh/FileTypes/NbssAppointmentEvents/StagingPersister.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ private static List<NbssAppointmentEvent> MapFileDataRecordsToNbssAppointmentEve
2828
HoldingClinic = NullIfWhiteSpace(record.Fields["Holding Clinic"]),
2929
Status = record.Fields["Status"],
3030
AttendedNotScreened = NullIfWhiteSpace(record.Fields["Attended Not Scr"]),
31-
AppointmenId = record.Fields["Appointment ID"],
31+
AppointmentId = record.Fields["Appointment ID"],
3232
NhsNumber = record.Fields["NHS Num"],
3333
EpisodeType = record.Fields["Episode Type"],
3434
EpisodeStart = DateOnly.ParseExact(record.Fields["Episode Start"], "yyyyMMdd", CultureInfo.InvariantCulture),

src/ServiceLayer.Shared/Data/Migrations/20250612124923_RenameProperty.Designer.cs

Lines changed: 225 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
using Microsoft.EntityFrameworkCore.Migrations;
2+
3+
#nullable disable
4+
5+
namespace ServiceLayer.Mesh.Migrations
6+
{
7+
/// <inheritdoc />
8+
public partial class RenameProperty : Migration
9+
{
10+
/// <inheritdoc />
11+
protected override void Up(MigrationBuilder migrationBuilder)
12+
{
13+
migrationBuilder.RenameColumn(
14+
name: "AppointmenId",
15+
table: "NbssAppointmentEvents",
16+
newName: "AppointmentId");
17+
}
18+
19+
/// <inheritdoc />
20+
protected override void Down(MigrationBuilder migrationBuilder)
21+
{
22+
migrationBuilder.RenameColumn(
23+
name: "AppointmentId",
24+
table: "NbssAppointmentEvents",
25+
newName: "AppointmenId");
26+
}
27+
}
28+
}

src/ServiceLayer.Shared/Data/Migrations/ServiceLayerDbContextModelSnapshot.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,14 +75,14 @@ protected override void BuildModel(ModelBuilder modelBuilder)
7575
b.Property<DateTime>("ActionTimestamp")
7676
.HasColumnType("datetime2(0)");
7777

78-
b.Property<string>("AppointmenId")
78+
b.Property<DateTime>("AppointmentDateTime")
79+
.HasColumnType("datetime2(0)");
80+
81+
b.Property<string>("AppointmentId")
7982
.IsRequired()
8083
.HasMaxLength(27)
8184
.HasColumnType("varchar(27)");
8285

83-
b.Property<DateTime>("AppointmentDateTime")
84-
.HasColumnType("datetime2(0)");
85-
8686
b.Property<string>("AppointmentType")
8787
.IsRequired()
8888
.HasMaxLength(1)

src/ServiceLayer.Shared/Data/Models/NbssAppointmentEvent.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public class NbssAppointmentEvent
3434
public string? AttendedNotScreened { get; set; }
3535
[StringLength(27)]
3636
[Column(TypeName = "varchar(27)")]
37-
public required string AppointmenId { get; set; }
37+
public required string AppointmentId { get; set; }
3838
[StringLength(10, MinimumLength = 10)]
3939
[Column(TypeName = "char(10)")]
4040
public required string NhsNumber { get; set; }

tests/ServiceLayer.Mesh.Tests/FileTypes/NbssAppointmentEvents/StagingPersisterTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public async Task WriteStagedData_WhenFileValid_MapsFieldsAndSavesToDb()
5454
Assert.Equal(firstRecord["Holding Clinic"], nbssAppointmentEvent.HoldingClinic);
5555
Assert.Equal(firstRecord["Status"], nbssAppointmentEvent.Status);
5656
Assert.Equal(firstRecord["Attended Not Scr"], nbssAppointmentEvent.AttendedNotScreened);
57-
Assert.Equal(firstRecord["Appointment ID"], nbssAppointmentEvent.AppointmenId);
57+
Assert.Equal(firstRecord["Appointment ID"], nbssAppointmentEvent.AppointmentId);
5858
Assert.Equal(firstRecord["NHS Num"], nbssAppointmentEvent.NhsNumber);
5959
Assert.Equal(firstRecord["Episode Type"], nbssAppointmentEvent.EpisodeType);
6060
Assert.Equal(DateOnly.ParseExact(firstRecord.Fields["Episode Start"], "yyyyMMdd"), nbssAppointmentEvent.EpisodeStart);

0 commit comments

Comments
 (0)