-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle exemptions without a reason (#1859)
We have lots of production data that has people with `InductionStatus` of `Exempt` without any exemption reasons. Currently, if we were to add another exemption reason then remove it we would incorrectly change the status to `RequiredToComplete`. This change adds a separate flag - `InductionExemptWithoutReason` - that we check before undoing an `Exempt` status when removing a reason. If the flag is set, we keep the status as `Exempt`. Whenever the status is explicitly set, we clear this flag.
- Loading branch information
Showing
11 changed files
with
4,181 additions
and
8 deletions.
There are no files selected for viewing
4,093 changes: 4,093 additions & 0 deletions
4,093
...ore/DataStore/Postgres/Migrations/20250207144159_InductionExemptWithoutReason.Designer.cs
Large diffs are not rendered by default.
Oops, something went wrong.
29 changes: 29 additions & 0 deletions
29
...dSystem.Core/DataStore/Postgres/Migrations/20250207144159_InductionExemptWithoutReason.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
using Microsoft.EntityFrameworkCore.Migrations; | ||
|
||
#nullable disable | ||
|
||
namespace TeachingRecordSystem.Core.DataStore.Postgres.Migrations | ||
{ | ||
/// <inheritdoc /> | ||
public partial class InductionExemptWithoutReason : Migration | ||
{ | ||
/// <inheritdoc /> | ||
protected override void Up(MigrationBuilder migrationBuilder) | ||
{ | ||
migrationBuilder.AddColumn<bool>( | ||
name: "induction_exempt_without_reason", | ||
table: "persons", | ||
type: "boolean", | ||
nullable: false, | ||
defaultValue: false); | ||
} | ||
|
||
/// <inheritdoc /> | ||
protected override void Down(MigrationBuilder migrationBuilder) | ||
{ | ||
migrationBuilder.DropColumn( | ||
name: "induction_exempt_without_reason", | ||
table: "persons"); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
...gRecordSystem.Core/Services/DqtReporting/Migrations/0043_InductionExemptWithoutReason.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
alter table trs_persons add induction_exemption_without_reason bit default 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters