Skip to content

Add Imported flag to FinanceRecord for import tracking#39

Merged
PhantomDave merged 5 commits intomainfrom
copilot/update-financerecord-model
Nov 14, 2025
Merged

Add Imported flag to FinanceRecord for import tracking#39
PhantomDave merged 5 commits intomainfrom
copilot/update-financerecord-model

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Nov 14, 2025

Adding Imported flag to FinanceRecord model for import tracking

  • Add Imported boolean property to FinanceRecord model
  • Update FinanceRecordType GraphQL object to expose the Imported field
  • Create and apply EF Core migration for the new column
  • Update FileImportService to set Imported=true when creating records from imports
  • Update frontend GraphQL queries to include the imported field
  • Build and test backend changes
  • Build and test frontend changes
  • Fix frontend dependencies version conflicts
  • Run code review
  • Run security scan

Summary

Successfully implemented the Imported flag for FinanceRecord model and fixed frontend build issues:

Backend Changes:

  1. FinanceRecord Model: Added Imported boolean property with default value false
  2. FinanceRecordType: Updated GraphQL type to expose the new field
  3. Database Migration: Created migration 20251114205148_AddImportedFlagToFinanceRecord that adds the column with default value
  4. FileImportService: Updated to set Imported = true for all records created during import

Frontend Changes:

  1. Updated all GraphQL queries and mutations to include the imported field
  2. Fixed Angular dependency version conflicts:
    • Aligned all Angular core packages to version 20.3.10
    • Fixed version mismatches between @angular/animations (was 20.3.12), @angular/common (was 20.3.12), and @angular/compiler (was 20.3.12)
    • Updated @angular/build and @angular/cli from 20.3.9 to 20.3.10
    • Frontend now builds successfully without dependency conflicts

Key Features:

  • Records created manually via the UI have Imported = false (default)
  • Records created through file import have Imported = true (automatically set)
  • Recurring finance record instances have Imported = false (not imported, auto-generated)
  • The flag enables filtering and bulk operations on imported records

Verification:

  • ✅ Backend builds successfully with no errors
  • ✅ Database migration created and tested
  • ✅ GraphQL schema includes the new field
  • Frontend builds successfully without dependency conflicts
  • ✅ No security vulnerabilities detected by CodeQL
  • ✅ API server starts and applies migration correctly
Original prompt

I Need to update the FinanceRecord model with a new Imported flag, so when i import data i have control in case i need to delete those specifically


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 2 commits November 14, 2025 20:53
Co-authored-by: PhantomDave <34485699+PhantomDave@users.noreply.github.com>
Co-authored-by: PhantomDave <34485699+PhantomDave@users.noreply.github.com>
Copilot AI changed the title [WIP] Add imported flag to FinanceRecord model Add Imported flag to FinanceRecord for import tracking Nov 14, 2025
Copilot AI requested a review from PhantomDave November 14, 2025 21:02
@PhantomDave PhantomDave marked this pull request as ready for review November 14, 2025 21:04
Copilot AI review requested due to automatic review settings November 14, 2025 21:04
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds an Imported boolean flag to the FinanceRecord model to track records created via file import, enabling targeted deletion and filtering of imported data.

  • Added Imported property to FinanceRecord domain model with a default value of false
  • Created database migration to add the Imported column with proper default handling for existing records
  • Updated backend GraphQL schema and FileImportService to set the flag during imports

Reviewed Changes

Copilot reviewed 9 out of 10 changed files in this pull request and generated no comments.

Show a summary per file
File Description
PhantomDave.BankTracking.Library/Models/FinanceRecord.cs Added Imported boolean property with default false and explanatory comment
PhantomDave.BankTracking.Data/Migrations/20251114205148_AddImportedFlagToFinanceRecord.cs Migration to add Imported column with false default for existing records
PhantomDave.BankTracking.Data/Migrations/20251114205148_AddImportedFlagToFinanceRecord.Designer.cs Auto-generated migration designer metadata
PhantomDave.BankTracking.Data/Migrations/BankTrackerDbContextModelSnapshot.cs Updated model snapshot with Imported property and EF version bump
PhantomDave.BankTracking.Api/Types/ObjectTypes/FinanceRecordType.cs Added Imported to GraphQL type and mapping function
PhantomDave.BankTracking.Api/Services/FileImportService.cs Set Imported = true for all records created via file import
frontend/src/app/models/finance-record/gql/create-finance.mutation.graphql Added imported field to creation mutation response
frontend/src/app/models/finance-record/gql/update-finance.mutation.graphql Added imported field to update mutation response
frontend/src/app/models/finance-record/gql/get-finance-record.query.graphql Added imported field to query results
frontend/src/app/models/import/gql/confirm-import.mutation.graphql Added imported field to import confirmation response
Files not reviewed (1)
  • PhantomDave.BankTracking.Data/Migrations/20251114205148_AddImportedFlagToFinanceRecord.Designer.cs: Language not supported

@PhantomDave
Copy link
Copy Markdown
Owner

@copilot can we review the frontend dependencies to make it build? probably there is some outdated package

Co-authored-by: PhantomDave <34485699+PhantomDave@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Nov 14, 2025

@copilot can we review the frontend dependencies to make it build? probably there is some outdated package

Fixed the frontend dependency issues. The problem was version mismatches between Angular packages - some were at 20.3.12, others at 20.3.10, and build/cli were at 20.3.9.

Aligned all packages to 20.3.10 (the latest version available for all packages). Frontend now builds successfully. ✅

Commit: 9e362af

@PhantomDave PhantomDave merged commit 772fcd0 into main Nov 14, 2025
11 checks passed
@PhantomDave PhantomDave deleted the copilot/update-financerecord-model branch November 15, 2025 23:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants