Skip to content
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
1 change: 1 addition & 0 deletions PhantomDave.BankTracking.Api/Services/FileImportService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,7 @@ public IEnumerable<FinanceRecord> FromParsedData(int accountId, ParsedFileData p
}

record.AccountId = accountId;
record.Imported = true;

records.Add(record);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ public record FinanceRecordType
public DateTime? LastProcessedDate { get; init; }
public int? ParentRecurringRecordId { get; init; }
public bool IsRecurringInstance { get; init; }
public bool Imported { get; init; }

public static FinanceRecordType FromFinanceRecord(FinanceRecord record) =>
new()
Expand All @@ -31,6 +32,7 @@ public static FinanceRecordType FromFinanceRecord(FinanceRecord record) =>
RecurrenceEndDate = record.RecurrenceEndDate,
LastProcessedDate = record.LastProcessedDate,
ParentRecurringRecordId = record.ParentRecurringRecordId,
IsRecurringInstance = record.IsRecurringInstance
IsRecurringInstance = record.IsRecurringInstance,
Imported = record.Imported
};
}

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,29 @@
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace PhantomDave.BankTracking.Data.Migrations
{
/// <inheritdoc />
public partial class AddImportedFlagToFinanceRecord : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<bool>(
name: "Imported",
table: "FinanceRecords",
type: "boolean",
nullable: false,
defaultValue: false);
}

/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "Imported",
table: "FinanceRecords");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "9.0.10")
.HasAnnotation("ProductVersion", "9.0.11")
.HasAnnotation("Relational:MaxIdentifierLength", 63);

NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
Expand Down Expand Up @@ -132,6 +132,9 @@ protected override void BuildModel(ModelBuilder modelBuilder)
.HasMaxLength(500)
.HasColumnType("character varying(500)");

b.Property<bool>("Imported")
.HasColumnType("boolean");

b.Property<bool>("IsRecurring")
.HasColumnType("boolean");

Expand Down
1 change: 1 addition & 0 deletions PhantomDave.BankTracking.Library/Models/FinanceRecord.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@ public class FinanceRecord
public DateTime? LastProcessedDate { get; set; }
public int? ParentRecurringRecordId { get; set; } // Links to the original recurring record
public bool IsRecurringInstance { get; set; } = false; // True if this was auto-generated from a recurring record
public bool Imported { get; set; } = false; // True if this record was imported from a file
}
Loading
Loading