Skip to content

Commit 772fcd0

Browse files
CopilotPhantomDave
andauthored
Add Imported flag to FinanceRecord for import tracking (#39)
* Initial plan * Add Imported flag to FinanceRecord model with migration Co-authored-by: PhantomDave <34485699+PhantomDave@users.noreply.github.com> * Update frontend GraphQL mutations to include imported field Co-authored-by: PhantomDave <34485699+PhantomDave@users.noreply.github.com> * Fix frontend dependencies - align all Angular packages to 20.3.10 Co-authored-by: PhantomDave <34485699+PhantomDave@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: PhantomDave <34485699+PhantomDave@users.noreply.github.com>
1 parent d4ee393 commit 772fcd0

File tree

12 files changed

+1134
-813
lines changed

12 files changed

+1134
-813
lines changed

PhantomDave.BankTracking.Api/Services/FileImportService.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,7 @@ public IEnumerable<FinanceRecord> FromParsedData(int accountId, ParsedFileData p
279279
}
280280

281281
record.AccountId = accountId;
282+
record.Imported = true;
282283

283284
records.Add(record);
284285
}

PhantomDave.BankTracking.Api/Types/ObjectTypes/FinanceRecordType.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ public record FinanceRecordType
1616
public DateTime? LastProcessedDate { get; init; }
1717
public int? ParentRecurringRecordId { get; init; }
1818
public bool IsRecurringInstance { get; init; }
19+
public bool Imported { get; init; }
1920

2021
public static FinanceRecordType FromFinanceRecord(FinanceRecord record) =>
2122
new()
@@ -31,6 +32,7 @@ public static FinanceRecordType FromFinanceRecord(FinanceRecord record) =>
3132
RecurrenceEndDate = record.RecurrenceEndDate,
3233
LastProcessedDate = record.LastProcessedDate,
3334
ParentRecurringRecordId = record.ParentRecurringRecordId,
34-
IsRecurringInstance = record.IsRecurringInstance
35+
IsRecurringInstance = record.IsRecurringInstance,
36+
Imported = record.Imported
3537
};
3638
}

PhantomDave.BankTracking.Data/Migrations/20251114205148_AddImportedFlagToFinanceRecord.Designer.cs

Lines changed: 189 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
using Microsoft.EntityFrameworkCore.Migrations;
2+
3+
#nullable disable
4+
5+
namespace PhantomDave.BankTracking.Data.Migrations
6+
{
7+
/// <inheritdoc />
8+
public partial class AddImportedFlagToFinanceRecord : Migration
9+
{
10+
/// <inheritdoc />
11+
protected override void Up(MigrationBuilder migrationBuilder)
12+
{
13+
migrationBuilder.AddColumn<bool>(
14+
name: "Imported",
15+
table: "FinanceRecords",
16+
type: "boolean",
17+
nullable: false,
18+
defaultValue: false);
19+
}
20+
21+
/// <inheritdoc />
22+
protected override void Down(MigrationBuilder migrationBuilder)
23+
{
24+
migrationBuilder.DropColumn(
25+
name: "Imported",
26+
table: "FinanceRecords");
27+
}
28+
}
29+
}

PhantomDave.BankTracking.Data/Migrations/BankTrackerDbContextModelSnapshot.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ protected override void BuildModel(ModelBuilder modelBuilder)
1717
{
1818
#pragma warning disable 612, 618
1919
modelBuilder
20-
.HasAnnotation("ProductVersion", "9.0.10")
20+
.HasAnnotation("ProductVersion", "9.0.11")
2121
.HasAnnotation("Relational:MaxIdentifierLength", 63);
2222

2323
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
@@ -132,6 +132,9 @@ protected override void BuildModel(ModelBuilder modelBuilder)
132132
.HasMaxLength(500)
133133
.HasColumnType("character varying(500)");
134134

135+
b.Property<bool>("Imported")
136+
.HasColumnType("boolean");
137+
135138
b.Property<bool>("IsRecurring")
136139
.HasColumnType("boolean");
137140

PhantomDave.BankTracking.Library/Models/FinanceRecord.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,5 @@ public class FinanceRecord
1717
public DateTime? LastProcessedDate { get; set; }
1818
public int? ParentRecurringRecordId { get; set; } // Links to the original recurring record
1919
public bool IsRecurringInstance { get; set; } = false; // True if this was auto-generated from a recurring record
20+
public bool Imported { get; set; } = false; // True if this record was imported from a file
2021
}

0 commit comments

Comments
 (0)