Fix some naming

This commit is contained in:
2026-07-31 09:35:44 +02:00
parent 2abe392890
commit 5e5fc0a034
11 changed files with 200 additions and 42 deletions
@@ -15,8 +15,8 @@ public class AccountDbContext(DbContextOptions<AccountDbContext> options) : DbCo
modelBuilder.Entity<Account>()
.HasData(
new Account(1, 10000000.00m, AccountType.Credit),
new Account(2, 50000000.00m, AccountType.Liability),
new Account(1, 10000000.00m, AccountType.Borrow),
new Account(2, 50000000.00m, AccountType.Spend),
new Account(99999, 0.00m, AccountType.Revenue)
);
@@ -0,0 +1,114 @@
// <auto-generated />
using System;
using FinancialApi.Infrastructure;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
#nullable disable
namespace FinancialApi.Infrastructure.Migrations
{
[DbContext(typeof(AccountDbContext))]
[Migration("20260731073046_UpdateAccountTypes")]
partial class UpdateAccountTypes
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder.HasAnnotation("ProductVersion", "10.0.9");
modelBuilder.Entity("FinancialApi.Domain.Entities.Account", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<decimal>("Balance")
.HasColumnType("TEXT");
b.Property<int>("Type")
.HasColumnType("INTEGER");
b.HasKey("Id");
b.ToTable("Accounts");
b.HasData(
new
{
Id = 1,
Balance = 10000000.00m,
Type = 1
},
new
{
Id = 2,
Balance = 50000000.00m,
Type = 0
},
new
{
Id = 99999,
Balance = 0.00m,
Type = 2
});
});
modelBuilder.Entity("FinancialApi.Domain.Entities.BalancedJournalEntry", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<DateTimeOffset>("CreatedAt")
.HasColumnType("TEXT");
b.Property<string>("Description")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("Id");
b.ToTable("JournalEntries");
});
modelBuilder.Entity("FinancialApi.Domain.Entities.BalancedJournalEntry", b =>
{
b.OwnsMany("FinancialApi.Domain.Entities.JournalLine", "Lines", b1 =>
{
b1.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b1.Property<int>("AccountId")
.HasColumnType("INTEGER");
b1.Property<decimal>("Amount")
.HasColumnType("TEXT");
b1.Property<Guid>("JournalEntryId")
.HasColumnType("TEXT");
b1.Property<string>("Type")
.IsRequired()
.HasColumnType("TEXT");
b1.HasKey("Id");
b1.HasIndex("JournalEntryId");
b1.ToTable("JournalLine");
b1.WithOwner()
.HasForeignKey("JournalEntryId");
});
b.Navigation("Lines");
});
#pragma warning restore 612, 618
}
}
}
@@ -0,0 +1,46 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace FinancialApi.Infrastructure.Migrations
{
/// <inheritdoc />
public partial class UpdateAccountTypes : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.UpdateData(
table: "Accounts",
keyColumn: "Id",
keyValue: 1,
column: "Type",
value: 1);
migrationBuilder.UpdateData(
table: "Accounts",
keyColumn: "Id",
keyValue: 99999,
column: "Type",
value: 2);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.UpdateData(
table: "Accounts",
keyColumn: "Id",
keyValue: 1,
column: "Type",
value: 2);
migrationBuilder.UpdateData(
table: "Accounts",
keyColumn: "Id",
keyValue: 99999,
column: "Type",
value: 3);
}
}
}
@@ -38,7 +38,7 @@ namespace FinancialApi.Infrastructure.Migrations
{
Id = 1,
Balance = 10000000.00m,
Type = 2
Type = 1
},
new
{
@@ -50,11 +50,11 @@ namespace FinancialApi.Infrastructure.Migrations
{
Id = 99999,
Balance = 0.00m,
Type = 3
Type = 2
});
});
modelBuilder.Entity("FinancialApi.Domain.Entities.JournalEntry", b =>
modelBuilder.Entity("FinancialApi.Domain.Entities.BalancedJournalEntry", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
@@ -72,7 +72,7 @@ namespace FinancialApi.Infrastructure.Migrations
b.ToTable("JournalEntries");
});
modelBuilder.Entity("FinancialApi.Domain.Entities.JournalEntry", b =>
modelBuilder.Entity("FinancialApi.Domain.Entities.BalancedJournalEntry", b =>
{
b.OwnsMany("FinancialApi.Domain.Entities.JournalLine", "Lines", b1 =>
{