From 949faab7ec33e843870f8b83f957a6b796a3dc6d Mon Sep 17 00:00:00 2001 From: fdonnet Date: Wed, 30 Oct 2024 17:18:13 +0100 Subject: [PATCH 01/94] First version of entry and transaction db entity design. --- .../Data/AccountingDbContext.cs | 10 +++ .../Data/Config/EntryConfiguration.cs | 71 ++++++++++++++++ .../Data/Config/TransactionConfiguration.cs | 36 ++++++++ src/Ubik.Accounting.Api/Models/Entry.cs | 84 ++++++++----------- src/Ubik.Accounting.Api/Models/Transaction.cs | 20 +++++ 5 files changed, 174 insertions(+), 47 deletions(-) create mode 100644 src/Ubik.Accounting.Api/Data/Config/EntryConfiguration.cs create mode 100644 src/Ubik.Accounting.Api/Data/Config/TransactionConfiguration.cs create mode 100644 src/Ubik.Accounting.Api/Models/Transaction.cs diff --git a/src/Ubik.Accounting.Api/Data/AccountingDbContext.cs b/src/Ubik.Accounting.Api/Data/AccountingDbContext.cs index 8731a1b5..492b94c1 100644 --- a/src/Ubik.Accounting.Api/Data/AccountingDbContext.cs +++ b/src/Ubik.Accounting.Api/Data/AccountingDbContext.cs @@ -19,6 +19,8 @@ public class AccountingDbContext(DbContextOptions options public DbSet AccountsAccountGroups { get; set; } public DbSet Classifications { get; set; } public DbSet Currencies { get; set; } + public DbSet Transactions { get; set; } + public DbSet Entries { get; set; } protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) @@ -72,6 +74,8 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) new AccountGroupConfiguration().Configure(modelBuilder.Entity()); new AccountConfiguration().Configure(modelBuilder.Entity()); new AccountAccountGroupConfiguration().Configure(modelBuilder.Entity()); + new TransactionConfiguration().Configure(modelBuilder.Entity()); + new EntryConfiguration().Configure(modelBuilder.Entity()); base.OnModelCreating(modelBuilder); } @@ -92,6 +96,12 @@ private void SetTenantId(ModelBuilder modelBuilder) modelBuilder.Entity() .HasQueryFilter(mt => mt.TenantId == _currentUser.TenantId); + + modelBuilder.Entity() + .HasQueryFilter(mt => mt.TenantId == _currentUser.TenantId); + + modelBuilder.Entity() + .HasQueryFilter(mt => mt.TenantId == _currentUser.TenantId); } } } diff --git a/src/Ubik.Accounting.Api/Data/Config/EntryConfiguration.cs b/src/Ubik.Accounting.Api/Data/Config/EntryConfiguration.cs new file mode 100644 index 00000000..1ce628c7 --- /dev/null +++ b/src/Ubik.Accounting.Api/Data/Config/EntryConfiguration.cs @@ -0,0 +1,71 @@ +using Microsoft.EntityFrameworkCore.Metadata.Builders; +using Microsoft.EntityFrameworkCore; +using Ubik.Accounting.Api.Models; + +namespace Ubik.Accounting.Api.Data.Config +{ + public class EntryConfiguration : IEntityTypeConfiguration + { + public void Configure(EntityTypeBuilder builder) + { + builder.ToTable("entries"); + + builder.Property(a => a.Type) + .IsRequired() + .HasConversion(); + + builder.Property(a => a.Sign) + .IsRequired() + .HasConversion(); + + builder.Property(a => a.Label) + .IsRequired() + .HasMaxLength(100); + + builder.Property(a => a.Description) + .HasMaxLength(700); + + builder.Property(a => a.Amount) + .IsRequired() + .HasPrecision(18, 4); + + builder.Property(a => a.OriginalAmount) + .HasPrecision(18, 4); + + builder.Property(a => a.ExchangeRate) + .HasPrecision(18, 10); + + builder.Property(a => a.Version) + .IsConcurrencyToken(); + + builder.Property(a => a.TenantId) + .IsRequired(); + + builder.Property(a => a.CreatedAt) + .IsRequired(); + + builder.Property(a => a.CreatedBy) + .IsRequired(); + + builder.HasIndex(a => a.TenantId); + + builder + .HasOne(s => s.Transaction) + .WithMany() + .HasForeignKey(e => e.TransactionId) + .IsRequired(true); + + builder + .HasOne(s => s.Account) + .WithMany() + .HasForeignKey(e => e.AccountId) + .IsRequired(true); + + builder + .HasOne(s => s.OriginalCurrency) + .WithMany() + .HasForeignKey(e => e.OriginalCurrencyId) + .IsRequired(true); + } + } +} diff --git a/src/Ubik.Accounting.Api/Data/Config/TransactionConfiguration.cs b/src/Ubik.Accounting.Api/Data/Config/TransactionConfiguration.cs new file mode 100644 index 00000000..e73567d9 --- /dev/null +++ b/src/Ubik.Accounting.Api/Data/Config/TransactionConfiguration.cs @@ -0,0 +1,36 @@ +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Metadata.Builders; +using Ubik.Accounting.Api.Models; + +namespace Ubik.Accounting.Api.Data.Config +{ + public class TransactionConfiguration : IEntityTypeConfiguration + { + public void Configure(EntityTypeBuilder builder) + { + builder.Property(a => a.Label) + .IsRequired() + .HasMaxLength(100); + + builder.Property(a => a.Amount) + .IsRequired() + .HasPrecision(18, 4); + + builder.Property(a => a.Version) + .IsConcurrencyToken(); + + builder.Property(a => a.TenantId) + .IsRequired(); + + builder.Property(a => a.CreatedAt) + .IsRequired(); + + builder.Property(a => a.CreatedBy) + .IsRequired(); + + builder.HasIndex(a => a.TenantId); + + builder.HasIndex(a => a.ValueDate); + } + } +} diff --git a/src/Ubik.Accounting.Api/Models/Entry.cs b/src/Ubik.Accounting.Api/Models/Entry.cs index 9d0b0cca..33ab62a4 100644 --- a/src/Ubik.Accounting.Api/Models/Entry.cs +++ b/src/Ubik.Accounting.Api/Models/Entry.cs @@ -1,50 +1,40 @@ -namespace Ubik.Accounting.Api.Models +using Ubik.DB.Common; + +namespace Ubik.Accounting.Api.Models { - //Keep for next microservice that will manage the entries - //public enum DebitCredit - //{ - // Debit, - // Credit - //} + public enum DebitCredit + { + Debit, + Credit + } - //public enum EntryType - //{ - // Main, - // Counterparty, - //} + public enum EntryType + { + Main, + Counterparty, + } - //[Index(nameof(TenantId), IsUnique = false)] - //[Table("Entries")] - //public class Entry : ITenantEntity, IConcurrencyCheckEntity, IAuditEntity - //{ - // public Guid Id { get; set; } - // public required EntryType Type { get; set; } - // public required DebitCredit Sign { get; set;} - // public required DateTime ValueDate { get; set; } - // [StringLength(300)] - // public string? Description { get; set; } - // [StringLength(500)] - // public string? Comment { get; set; } - // public Guid? TaxRateId { get; set; } - // public TaxRate? TaxRate { get; set; } - // [Precision(18, 2)] - // public required decimal Amount { get; set; } - // [Precision(18, 2)] - // public decimal? OriginalAmount { get; set; } - // public Guid? OriginalCurrencyId { get; set; } - // public Currency? OriginalCurrency { get; set; } - // [Precision(18, 8)] - // public decimal? ExchangeRate { get; set; } - // public Guid? MainEntryId { get; set; } - // public Entry? MainEntry { get; set; } - // public ICollection? CounterpartyEntries { get; set; } - // public Guid Version { get; set; } - // public Guid TenantId { get; set; } - // public required DateTime CreatedAt { get; set; } - // public required Guid CreatedBy { get; set; } - // public User CreatedByUser { get; set; } = default!; - // public DateTime? ModifiedAt { get; set; } - // public Guid? ModifiedBy { get; set; } - // public User? ModifiedByUser { get; set; } - //} -} \ No newline at end of file + public class Entry : ITenantEntity, IConcurrencyCheckEntity, IAuditEntity + { + public Guid Id { get; set; } + public required EntryType Type { get; set; } + public required DebitCredit Sign { get; set; } + public required Guid TransactionId { get; set; } + public Transaction? Transaction { get; set; } + public required Guid AccountId { get; set; } + public Account? Account { get; set; } + public string? Label { get; set; } + public string? Description { get; set; } + public required decimal Amount { get; set; } + public decimal? OriginalAmount { get; set; } + public Guid? OriginalCurrencyId { get; set; } + public Currency? OriginalCurrency { get; set; } + public decimal? ExchangeRate { get; set; } + public Guid Version { get; set; } + public Guid TenantId { get; set; } + public required DateTime CreatedAt { get; set; } + public required Guid CreatedBy { get; set; } + public DateTime? ModifiedAt { get; set; } + public Guid? ModifiedBy { get; set; } + } +} diff --git a/src/Ubik.Accounting.Api/Models/Transaction.cs b/src/Ubik.Accounting.Api/Models/Transaction.cs new file mode 100644 index 00000000..bcea4414 --- /dev/null +++ b/src/Ubik.Accounting.Api/Models/Transaction.cs @@ -0,0 +1,20 @@ +using Ubik.DB.Common; + +namespace Ubik.Accounting.Api.Models +{ + + //Containes the entries packet + public class Transaction : ITenantEntity, IConcurrencyCheckEntity, IAuditEntity + { + public Guid Id { get; set; } + public required DateTime ValueDate { get; set; } + public required string Label { get; set; } + public decimal Amount { get; set; } + public Guid Version { get; set; } + public Guid TenantId { get; set; } + public required DateTime CreatedAt { get; set; } + public required Guid CreatedBy { get; set; } + public DateTime? ModifiedAt { get; set; } + public Guid? ModifiedBy { get; set; } + } +} From 01f71090ee1cf1621d1e3aec116f42879a636a60 Mon Sep 17 00:00:00 2001 From: fdonnet Date: Thu, 31 Oct 2024 10:38:05 +0100 Subject: [PATCH 02/94] Begin to design to VAT configration (for Switzerland) don't know if it can be applied arround the world. --- .../Data/AccountingDbContext.cs | 10 ++++ .../Config/AccountVatConfigConfiguration.cs | 47 +++++++++++++++++++ .../Data/Config/EntryConfiguration.cs | 9 ++++ .../Data/Config/VatRateConfiguration.cs | 43 +++++++++++++++++ .../Models/AccountVatConfig.cs | 21 +++++++++ src/Ubik.Accounting.Api/Models/Entry.cs | 5 ++ src/Ubik.Accounting.Api/Models/TaxRate.cs | 26 ---------- src/Ubik.Accounting.Api/Models/VatRate.cs | 20 ++++++++ 8 files changed, 155 insertions(+), 26 deletions(-) create mode 100644 src/Ubik.Accounting.Api/Data/Config/AccountVatConfigConfiguration.cs create mode 100644 src/Ubik.Accounting.Api/Data/Config/VatRateConfiguration.cs create mode 100644 src/Ubik.Accounting.Api/Models/AccountVatConfig.cs delete mode 100644 src/Ubik.Accounting.Api/Models/TaxRate.cs create mode 100644 src/Ubik.Accounting.Api/Models/VatRate.cs diff --git a/src/Ubik.Accounting.Api/Data/AccountingDbContext.cs b/src/Ubik.Accounting.Api/Data/AccountingDbContext.cs index 492b94c1..62c8077f 100644 --- a/src/Ubik.Accounting.Api/Data/AccountingDbContext.cs +++ b/src/Ubik.Accounting.Api/Data/AccountingDbContext.cs @@ -21,6 +21,8 @@ public class AccountingDbContext(DbContextOptions options public DbSet Currencies { get; set; } public DbSet Transactions { get; set; } public DbSet Entries { get; set; } + public DbSet VatRates { get; set; } + public DbSet AccountVatConfigs { get; set; } protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) @@ -76,6 +78,8 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) new AccountAccountGroupConfiguration().Configure(modelBuilder.Entity()); new TransactionConfiguration().Configure(modelBuilder.Entity()); new EntryConfiguration().Configure(modelBuilder.Entity()); + new VatRateConfiguration().Configure(modelBuilder.Entity()); + new AccountVatConfigConfiguration().Configure(modelBuilder.Entity()); base.OnModelCreating(modelBuilder); } @@ -102,6 +106,12 @@ private void SetTenantId(ModelBuilder modelBuilder) modelBuilder.Entity() .HasQueryFilter(mt => mt.TenantId == _currentUser.TenantId); + + modelBuilder.Entity() + .HasQueryFilter(mt => mt.TenantId == _currentUser.TenantId); + + modelBuilder.Entity() + .HasQueryFilter(mt => mt.TenantId == _currentUser.TenantId); } } } diff --git a/src/Ubik.Accounting.Api/Data/Config/AccountVatConfigConfiguration.cs b/src/Ubik.Accounting.Api/Data/Config/AccountVatConfigConfiguration.cs new file mode 100644 index 00000000..5d0dd8da --- /dev/null +++ b/src/Ubik.Accounting.Api/Data/Config/AccountVatConfigConfiguration.cs @@ -0,0 +1,47 @@ +using Microsoft.EntityFrameworkCore.Metadata.Builders; +using Microsoft.EntityFrameworkCore; +using Ubik.Accounting.Api.Models; + +namespace Ubik.Accounting.Api.Data.Config +{ + public class AccountVatConfigConfiguration : IEntityTypeConfiguration + { + public void Configure(EntityTypeBuilder builder) + { + builder.Property(a => a.Version) + .IsConcurrencyToken(); + + builder.Property(a => a.TenantId) + .IsRequired(); + + builder.Property(a => a.CreatedAt) + .IsRequired(); + + builder.Property(a => a.CreatedBy) + .IsRequired(); + + builder.HasIndex(a => new { a.AccountId, a.VatRateId }) + .IsUnique(); + + builder.HasIndex(a => a.TenantId); + + builder + .HasOne(s => s.Account) + .WithMany() + .HasForeignKey(e => e.AccountId) + .IsRequired(true); + + builder + .HasOne(s => s.VatRate) + .WithMany() + .HasForeignKey(e => e.VatRateId) + .IsRequired(true); + + builder + .HasOne(s => s.VatAccount) + .WithMany() + .HasForeignKey(e => e.VatAccountId) + .IsRequired(true); + } + } +} diff --git a/src/Ubik.Accounting.Api/Data/Config/EntryConfiguration.cs b/src/Ubik.Accounting.Api/Data/Config/EntryConfiguration.cs index 1ce628c7..c5eee9a2 100644 --- a/src/Ubik.Accounting.Api/Data/Config/EntryConfiguration.cs +++ b/src/Ubik.Accounting.Api/Data/Config/EntryConfiguration.cs @@ -35,6 +35,9 @@ public void Configure(EntityTypeBuilder builder) builder.Property(a => a.ExchangeRate) .HasPrecision(18, 10); + builder.Property(a => a.VATAppliedRate) + .HasPrecision(8, 5); + builder.Property(a => a.Version) .IsConcurrencyToken(); @@ -66,6 +69,12 @@ public void Configure(EntityTypeBuilder builder) .WithMany() .HasForeignKey(e => e.OriginalCurrencyId) .IsRequired(true); + + builder + .HasOne(e=> e.VatRate) + .WithMany() + .HasForeignKey(e => e.VatRateId) + .IsRequired(false); } } } diff --git a/src/Ubik.Accounting.Api/Data/Config/VatRateConfiguration.cs b/src/Ubik.Accounting.Api/Data/Config/VatRateConfiguration.cs new file mode 100644 index 00000000..1b6beb9a --- /dev/null +++ b/src/Ubik.Accounting.Api/Data/Config/VatRateConfiguration.cs @@ -0,0 +1,43 @@ +using Microsoft.EntityFrameworkCore.Metadata.Builders; +using Microsoft.EntityFrameworkCore; +using Ubik.Accounting.Api.Models; + +namespace Ubik.Accounting.Api.Data.Config +{ + public class VatRateConfiguration : IEntityTypeConfiguration + { + public void Configure(EntityTypeBuilder builder) + { + builder.Property(a => a.Code) + .HasMaxLength(20) + .IsRequired(); + + builder.Property(a => a.Description) + .HasMaxLength(200) + .IsRequired(); + + builder.Property(a => a.Rate) + .HasPrecision(8, 5); + + builder.Property(a => a.Version) + .IsConcurrencyToken(); + + builder.Property(a => a.TenantId) + .IsRequired(); + + builder.Property(a => a.CreatedAt) + .IsRequired(); + + builder.Property(a => a.CreatedBy) + .IsRequired(); + + builder.HasIndex(a => new { a.Code, a.TenantId }) + .IsUnique(); + + builder.HasIndex(a => a.TenantId); + + builder.HasIndex(a => a.ValidFrom); + builder.HasIndex(a => a.ValidTo); + } + } +} diff --git a/src/Ubik.Accounting.Api/Models/AccountVatConfig.cs b/src/Ubik.Accounting.Api/Models/AccountVatConfig.cs new file mode 100644 index 00000000..55f06a5e --- /dev/null +++ b/src/Ubik.Accounting.Api/Models/AccountVatConfig.cs @@ -0,0 +1,21 @@ +using Ubik.DB.Common; + +namespace Ubik.Accounting.Api.Models +{ + public class AccountVatConfig : ITenantEntity, IConcurrencyCheckEntity, IAuditEntity + { + public Guid Id { get; set; } + public Guid AccountId { get; set; } + public Account? Account { get; set; } + public Guid VatRateId { get; set; } + public VatRate? VatRate { get; set; } + public Guid VatAccountId { get; set; } + public Account? VatAccount { get; set; } + public Guid Version { get; set; } + public Guid TenantId { get; set; } + public required DateTime CreatedAt { get; set; } + public required Guid CreatedBy { get; set; } + public DateTime? ModifiedAt { get; set; } + public Guid? ModifiedBy { get; set; } + } +} diff --git a/src/Ubik.Accounting.Api/Models/Entry.cs b/src/Ubik.Accounting.Api/Models/Entry.cs index 33ab62a4..5ac7ab13 100644 --- a/src/Ubik.Accounting.Api/Models/Entry.cs +++ b/src/Ubik.Accounting.Api/Models/Entry.cs @@ -23,8 +23,13 @@ public class Entry : ITenantEntity, IConcurrencyCheckEntity, IAuditEntity public Transaction? Transaction { get; set; } public required Guid AccountId { get; set; } public Account? Account { get; set; } + //Used to keep a trace of the VAT rate applied to the entry (at a time) + public decimal VATAppliedRate { get; set; } + public Guid? VatRateId { get; set; } + public VatRate? VatRate { get; set; } public string? Label { get; set; } public string? Description { get; set; } + //See if we want the amount with or without VAT public required decimal Amount { get; set; } public decimal? OriginalAmount { get; set; } public Guid? OriginalCurrencyId { get; set; } diff --git a/src/Ubik.Accounting.Api/Models/TaxRate.cs b/src/Ubik.Accounting.Api/Models/TaxRate.cs deleted file mode 100644 index 9b20e162..00000000 --- a/src/Ubik.Accounting.Api/Models/TaxRate.cs +++ /dev/null @@ -1,26 +0,0 @@ -namespace Ubik.Accounting.Api.Models -{ - //[Index(nameof(TenantId), IsUnique = false)] - //[Table("TaxRates")] - //public class TaxRate : ITenantEntity, IConcurrencyCheckEntity, IAuditEntity - //{ - // public Guid Id { get; set; } - // public DateTime ValidFrom { get; set; } - // public DateTime? ValidTo { get; set; } - // [StringLength(50)] - // public required string Name { get; set; } - // [StringLength(300)] - // public string? Description { get; set; } - // [Precision(10, 7)] - // public decimal Rate { get; set; } - // [ConcurrencyCheck] - // public Guid Version { get; set; } - // public Guid TenantId { get; set; } - // public required DateTime CreatedAt { get; set; } - // public required Guid CreatedBy { get; set; } - // public User CreatedByUser { get; set; } = default!; - // public DateTime? ModifiedAt { get; set; } - // public Guid? ModifiedBy { get; set; } - // public User? ModifiedByUser { get; set; } - //} -} diff --git a/src/Ubik.Accounting.Api/Models/VatRate.cs b/src/Ubik.Accounting.Api/Models/VatRate.cs new file mode 100644 index 00000000..85330c47 --- /dev/null +++ b/src/Ubik.Accounting.Api/Models/VatRate.cs @@ -0,0 +1,20 @@ +using Ubik.DB.Common; + +namespace Ubik.Accounting.Api.Models +{ + public class VatRate : ITenantEntity, IConcurrencyCheckEntity, IAuditEntity + { + public Guid Id { get; set; } + public DateTime ValidFrom { get; set; } + public DateTime? ValidTo { get; set; } + public required string Code { get; set; } + public string? Description { get; set; } + public decimal Rate { get; set; } + public Guid Version { get; set; } + public Guid TenantId { get; set; } + public required DateTime CreatedAt { get; set; } + public required Guid CreatedBy { get; set; } + public DateTime? ModifiedAt { get; set; } + public Guid? ModifiedBy { get; set; } + } +} From 31e4275dd67d9513c81091e43c49deca1d1a5f2d Mon Sep 17 00:00:00 2001 From: fdonnet Date: Thu, 31 Oct 2024 13:20:33 +0100 Subject: [PATCH 03/94] Vat rate contarcts and mappers --- .../Data/Config/VatRateConfiguration.cs | 3 +- .../Mappers/VatRateMappers.cs | 105 ++++++++++++++++++ src/Ubik.Accounting.Api/Models/Entry.cs | 3 +- src/Ubik.Accounting.Api/Models/User.cs | 16 --- src/Ubik.Accounting.Api/Models/VatRate.cs | 4 +- .../VatRate/Commands/AddVatRateCommand.cs | 23 ++++ .../VatRate/Commands/UpdateVatRateCommand.cs | 27 +++++ .../VatRate/Events/VatRateAdded.cs | 19 ++++ .../VatRate/Events/VatRateDeleted.cs | 13 +++ .../VatRate/Events/VatRateUpdated.cs | 19 ++++ .../VatRate/Results/VatRateStandardResult.cs | 19 ++++ src/Ubik.CodeGenerator/ContractsGenerator.cs | 13 ++- src/Ubik.CodeGenerator/MappersGenerator.cs | 3 +- src/Ubik.CodeGenerator/Program.cs | 9 +- .../Ubik.CodeGenerator.csproj | 1 + 15 files changed, 251 insertions(+), 26 deletions(-) create mode 100644 src/Ubik.Accounting.Api/Mappers/VatRateMappers.cs delete mode 100644 src/Ubik.Accounting.Api/Models/User.cs create mode 100644 src/Ubik.Accounting.Contracts/VatRate/Commands/AddVatRateCommand.cs create mode 100644 src/Ubik.Accounting.Contracts/VatRate/Commands/UpdateVatRateCommand.cs create mode 100644 src/Ubik.Accounting.Contracts/VatRate/Events/VatRateAdded.cs create mode 100644 src/Ubik.Accounting.Contracts/VatRate/Events/VatRateDeleted.cs create mode 100644 src/Ubik.Accounting.Contracts/VatRate/Events/VatRateUpdated.cs create mode 100644 src/Ubik.Accounting.Contracts/VatRate/Results/VatRateStandardResult.cs diff --git a/src/Ubik.Accounting.Api/Data/Config/VatRateConfiguration.cs b/src/Ubik.Accounting.Api/Data/Config/VatRateConfiguration.cs index 1b6beb9a..1d7a52a2 100644 --- a/src/Ubik.Accounting.Api/Data/Config/VatRateConfiguration.cs +++ b/src/Ubik.Accounting.Api/Data/Config/VatRateConfiguration.cs @@ -13,8 +13,7 @@ public void Configure(EntityTypeBuilder builder) .IsRequired(); builder.Property(a => a.Description) - .HasMaxLength(200) - .IsRequired(); + .HasMaxLength(200); builder.Property(a => a.Rate) .HasPrecision(8, 5); diff --git a/src/Ubik.Accounting.Api/Mappers/VatRateMappers.cs b/src/Ubik.Accounting.Api/Mappers/VatRateMappers.cs new file mode 100644 index 00000000..a9c9d717 --- /dev/null +++ b/src/Ubik.Accounting.Api/Mappers/VatRateMappers.cs @@ -0,0 +1,105 @@ +using Ubik.Accounting.Api.Models; +using Ubik.Accounting.Contracts.VatRate.Commands; +using Ubik.Accounting.Contracts.VatRate.Events; +using Ubik.Accounting.Contracts.VatRate.Results; + +namespace Ubik.Accounting.Api.Mappers +{ + public static class VatRateMappers + { + public static IEnumerable ToVatRateStandardResults(this IEnumerable current) + { + return current.Select(x => new VatRateStandardResult() + { + Id = x.Id, + ValidFrom = x.ValidFrom, + ValidTo = x.ValidTo, + Code = x.Code, + Description = x.Description, + Rate = x.Rate, + Version = x.Version, + }); + } + + public static VatRate ToVatRate(this AddVatRateCommand current) + { + return new VatRate + { + ValidFrom = current.ValidFrom, + ValidTo = current.ValidTo, + Code = current.Code, + Description = current.Description, + Rate = current.Rate, + }; + } + + public static VatRate ToVatRate(this UpdateVatRateCommand current) + { + return new VatRate + { + Id = current.Id, + ValidFrom = current.ValidFrom, + ValidTo = current.ValidTo, + Code = current.Code, + Description = current.Description, + Rate = current.Rate, + Version = current.Version, + }; + } + + public static VatRateAdded ToVatRateAdded(this VatRate current) + { + return new VatRateAdded() + { + Id = current.Id, + ValidFrom = current.ValidFrom, + ValidTo = current.ValidTo, + Code = current.Code, + Description = current.Description, + Rate = current.Rate, + Version = current.Version, + }; + } + + public static VatRateUpdated ToVatRateUpdated(this VatRate current) + { + return new VatRateUpdated() + { + Id = current.Id, + ValidFrom = current.ValidFrom, + ValidTo = current.ValidTo, + Code = current.Code, + Description = current.Description, + Rate = current.Rate, + Version = current.Version, + }; + } + + public static VatRate ToVatRate(this VatRate forUpd, VatRate model) + { + model.Id = forUpd.Id; + model.ValidFrom = forUpd.ValidFrom; + model.ValidTo = forUpd.ValidTo; + model.Code = forUpd.Code; + model.Description = forUpd.Description; + model.Rate = forUpd.Rate; + model.Version = forUpd.Version; + + return model; + } + + public static VatRateStandardResult ToVatRateStandardResult(this VatRate current) + { + return new VatRateStandardResult() + { + Id = current.Id, + ValidFrom = current.ValidFrom, + ValidTo = current.ValidTo, + Code = current.Code, + Description = current.Description, + Rate = current.Rate, + Version = current.Version, + }; + } + } +} diff --git a/src/Ubik.Accounting.Api/Models/Entry.cs b/src/Ubik.Accounting.Api/Models/Entry.cs index 5ac7ab13..b473fb3c 100644 --- a/src/Ubik.Accounting.Api/Models/Entry.cs +++ b/src/Ubik.Accounting.Api/Models/Entry.cs @@ -1,4 +1,5 @@ -using Ubik.DB.Common; +using Microsoft.EntityFrameworkCore; +using Ubik.DB.Common; namespace Ubik.Accounting.Api.Models { diff --git a/src/Ubik.Accounting.Api/Models/User.cs b/src/Ubik.Accounting.Api/Models/User.cs deleted file mode 100644 index b6f68135..00000000 --- a/src/Ubik.Accounting.Api/Models/User.cs +++ /dev/null @@ -1,16 +0,0 @@ -namespace Ubik.Accounting.Api.Models -{ - //Will be read only, all data will be updated by message broker - //Will see if we really need a specific user table for this microservices - //The claims seem to be sufficient. - //[Index(nameof(TenantId), IsUnique = false)] - //public class User : ITenantEntity - //{ - // public Guid Id { get; set; } - // [StringLength(100)] - // public required string Name { get; set; } - // [StringLength(200)] - // public required string Email { get; set; } - // public Guid TenantId { get; set; } - //} -} diff --git a/src/Ubik.Accounting.Api/Models/VatRate.cs b/src/Ubik.Accounting.Api/Models/VatRate.cs index 85330c47..8e9ba15f 100644 --- a/src/Ubik.Accounting.Api/Models/VatRate.cs +++ b/src/Ubik.Accounting.Api/Models/VatRate.cs @@ -12,8 +12,8 @@ public class VatRate : ITenantEntity, IConcurrencyCheckEntity, IAuditEntity public decimal Rate { get; set; } public Guid Version { get; set; } public Guid TenantId { get; set; } - public required DateTime CreatedAt { get; set; } - public required Guid CreatedBy { get; set; } + public DateTime CreatedAt { get; set; } + public Guid CreatedBy { get; set; } public DateTime? ModifiedAt { get; set; } public Guid? ModifiedBy { get; set; } } diff --git a/src/Ubik.Accounting.Contracts/VatRate/Commands/AddVatRateCommand.cs b/src/Ubik.Accounting.Contracts/VatRate/Commands/AddVatRateCommand.cs new file mode 100644 index 00000000..5523d585 --- /dev/null +++ b/src/Ubik.Accounting.Contracts/VatRate/Commands/AddVatRateCommand.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Ubik.Accounting.Contracts.VatRate.Commands +{ + public record AddVatRateCommand + { + [Required] + public DateTime ValidFrom { get; init; } + public DateTime? ValidTo { get; init; } + [Required] + [MaxLength(20)] + public required string Code { get; init; } + [MaxLength(200)] + public string? Description { get; init; } + [Required] + public Decimal Rate { get; init; } + } +} diff --git a/src/Ubik.Accounting.Contracts/VatRate/Commands/UpdateVatRateCommand.cs b/src/Ubik.Accounting.Contracts/VatRate/Commands/UpdateVatRateCommand.cs new file mode 100644 index 00000000..73e77f85 --- /dev/null +++ b/src/Ubik.Accounting.Contracts/VatRate/Commands/UpdateVatRateCommand.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Ubik.Accounting.Contracts.VatRate.Commands +{ + public record UpdateVatRateCommand + { + [Required] + public Guid Id { get; init; } + [Required] + public DateTime ValidFrom { get; init; } + public DateTime? ValidTo { get; init; } + [Required] + [MaxLength(20)] + public required string Code { get; init; } + [MaxLength(200)] + public string? Description { get; init; } + [Required] + public Decimal Rate { get; init; } + [Required] + public Guid Version { get; init; } + } +} diff --git a/src/Ubik.Accounting.Contracts/VatRate/Events/VatRateAdded.cs b/src/Ubik.Accounting.Contracts/VatRate/Events/VatRateAdded.cs new file mode 100644 index 00000000..6dab8741 --- /dev/null +++ b/src/Ubik.Accounting.Contracts/VatRate/Events/VatRateAdded.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Ubik.Accounting.Contracts.VatRate.Events +{ + public record VatRateAdded + { + public Guid Id { get; init; } + public DateTime ValidFrom { get; init; } + public DateTime? ValidTo { get; init; } + public required string Code { get; init; } + public string? Description { get; init; } + public Decimal Rate { get; init; } + public Guid Version { get; init; } + } +} diff --git a/src/Ubik.Accounting.Contracts/VatRate/Events/VatRateDeleted.cs b/src/Ubik.Accounting.Contracts/VatRate/Events/VatRateDeleted.cs new file mode 100644 index 00000000..5ca633c1 --- /dev/null +++ b/src/Ubik.Accounting.Contracts/VatRate/Events/VatRateDeleted.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Ubik.Accounting.Contracts.VatRate.Events +{ + public record VatRateDeleted + { + public Guid Id { get; init; } + } +} diff --git a/src/Ubik.Accounting.Contracts/VatRate/Events/VatRateUpdated.cs b/src/Ubik.Accounting.Contracts/VatRate/Events/VatRateUpdated.cs new file mode 100644 index 00000000..91073985 --- /dev/null +++ b/src/Ubik.Accounting.Contracts/VatRate/Events/VatRateUpdated.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Ubik.Accounting.Contracts.VatRate.Events +{ + public record VatRateUpdated + { + public Guid Id { get; init; } + public DateTime ValidFrom { get; init; } + public DateTime? ValidTo { get; init; } + public required string Code { get; init; } + public string? Description { get; init; } + public Decimal Rate { get; init; } + public Guid Version { get; init; } + } +} diff --git a/src/Ubik.Accounting.Contracts/VatRate/Results/VatRateStandardResult.cs b/src/Ubik.Accounting.Contracts/VatRate/Results/VatRateStandardResult.cs new file mode 100644 index 00000000..b6ffb8ed --- /dev/null +++ b/src/Ubik.Accounting.Contracts/VatRate/Results/VatRateStandardResult.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Ubik.Accounting.Contracts.VatRate.Results +{ + public record VatRateStandardResult + { + public Guid Id { get; init; } + public DateTime ValidFrom { get; init; } + public DateTime? ValidTo { get; init; } + public required string Code { get; init; } + public string? Description { get; init; } + public Decimal Rate { get; init; } + public Guid Version { get; init; } + } +} diff --git a/src/Ubik.CodeGenerator/ContractsGenerator.cs b/src/Ubik.CodeGenerator/ContractsGenerator.cs index 58a73c0d..09b1369a 100644 --- a/src/Ubik.CodeGenerator/ContractsGenerator.cs +++ b/src/Ubik.CodeGenerator/ContractsGenerator.cs @@ -1,10 +1,11 @@ using Microsoft.EntityFrameworkCore.Metadata; using System.Text; +using Ubik.Accounting.Api.Data; using Ubik.Security.Api.Data; namespace Ubik.CodeGenerator { - internal class ContractsGenerator(SecurityDbContext dbContext) + internal class ContractsGenerator(AccountingDbContext dbContext) { public void GenerateAllContracts(bool writeFiles, string? folderPath, string? type = null) { @@ -340,6 +341,16 @@ private static string GenerateAnnotations(IProperty property, bool firstLine) sb.AppendLine($"[MaxLength({maxLength.Value})]"); } + //var precision = property.GetPrecision(); + //var scale = property.GetScale(); + //if (precision != null && scale !=null) + //{ + // if (!firstLine || alreadyFoundOneAnnotation) + // sb.Append($" "); + + // sb.AppendLine($"[Precision({precision},{scale})]"); + //} + // Add other annotations as needed return sb.ToString(); diff --git a/src/Ubik.CodeGenerator/MappersGenerator.cs b/src/Ubik.CodeGenerator/MappersGenerator.cs index d37ffd2e..d7cb214f 100644 --- a/src/Ubik.CodeGenerator/MappersGenerator.cs +++ b/src/Ubik.CodeGenerator/MappersGenerator.cs @@ -1,10 +1,11 @@ using Microsoft.EntityFrameworkCore.Metadata; using System.Text; +using Ubik.Accounting.Api.Data; using Ubik.Security.Api.Data; namespace Ubik.CodeGenerator { - internal class MappersGenerator(SecurityDbContext dbContext) + internal class MappersGenerator(AccountingDbContext dbContext) { public void GenerateMappers(string? type = null) { diff --git a/src/Ubik.CodeGenerator/Program.cs b/src/Ubik.CodeGenerator/Program.cs index 00967716..4a5088cc 100644 --- a/src/Ubik.CodeGenerator/Program.cs +++ b/src/Ubik.CodeGenerator/Program.cs @@ -1,6 +1,7 @@ // See https://aka.ms/new-console-template for more information using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.DependencyInjection; +using Ubik.Accounting.Api.Data; using Ubik.ApiService.Common.Services; using Ubik.CodeGenerator; using Ubik.Security.Api.Data; @@ -10,6 +11,8 @@ .AddSingleton() .AddDbContextFactory( options => options.UseNpgsql("x")) + .AddDbContextFactory( + options => options.UseNpgsql("x")) .AddSingleton() .AddSingleton() .AddSingleton() @@ -22,10 +25,10 @@ var myServicesGenerator = serviceProvider.GetRequiredService(); var myControllerGenerator = serviceProvider.GetRequiredService(); -//myContractsGenerator.GenerateAllContracts(false, string.Empty, "Tenant"); -//myMappersGenerator.GenerateMappers("Tenant"); +myContractsGenerator.GenerateAllContracts(false, string.Empty, "VatRate"); +//myMappersGenerator.GenerateMappers("VatRate"); //myServicesGenerator.GenerateAllServicesAndInterfaces("Tenant"); -myControllerGenerator.GenerateController("Tenant"); +//myControllerGenerator.GenerateController("Tenant"); //FAKER to use the DBcontext internal class FakeUserService : ICurrentUser diff --git a/src/Ubik.CodeGenerator/Ubik.CodeGenerator.csproj b/src/Ubik.CodeGenerator/Ubik.CodeGenerator.csproj index 0747c1e9..35ea200c 100644 --- a/src/Ubik.CodeGenerator/Ubik.CodeGenerator.csproj +++ b/src/Ubik.CodeGenerator/Ubik.CodeGenerator.csproj @@ -12,6 +12,7 @@ + From b3626bab9a450befbe695ec19581d78d4e1a3c4e Mon Sep 17 00:00:00 2001 From: fdonnet Date: Thu, 31 Oct 2024 14:20:30 +0100 Subject: [PATCH 04/94] Vat rate, minimal base service. Change account to add the Active param. --- .../Controller/v1/AccountsController.cs | 1 - .../AccountLinkedToExistingEntriesError.cs | 21 ++ .../Services/AccountCommandService.cs | 10 + .../Services/IVatRateCommandService.cs | 14 ++ .../VatRates/Services/IVatRateQueryService.cs | 12 ++ .../Services/VatRateCommandService.cs | 132 +++++++++++++ .../VatRates/Services/VatRateQueryService.cs | 27 +++ .../Mappers/AccountMappers.cs | 11 +- src/Ubik.Accounting.Api/Models/Account.cs | 1 + .../Accounts/Commands/AddAccountCommand.cs | 2 + .../Accounts/Commands/UpdateAccountCommand.cs | 1 + .../Accounts/Events/AccountAdded.cs | 1 + .../Accounts/Events/AccountUpdated.cs | 1 + .../AccountGroupWithClassificationResult.cs | 2 +- .../Accounts/Results/AccountStandardResult.cs | 1 + src/Ubik.CodeGenerator/Program.cs | 4 +- src/Ubik.CodeGenerator/ServicesGenerator.cs | 180 +++++++++--------- .../Accounts/AccountsController_Test.cs | 2 +- 18 files changed, 322 insertions(+), 101 deletions(-) create mode 100644 src/Ubik.Accounting.Api/Features/Accounts/Errors/AccountLinkedToExistingEntriesError.cs create mode 100644 src/Ubik.Accounting.Api/Features/VatRates/Services/IVatRateCommandService.cs create mode 100644 src/Ubik.Accounting.Api/Features/VatRates/Services/IVatRateQueryService.cs create mode 100644 src/Ubik.Accounting.Api/Features/VatRates/Services/VatRateCommandService.cs create mode 100644 src/Ubik.Accounting.Api/Features/VatRates/Services/VatRateQueryService.cs diff --git a/src/Ubik.Accounting.Api/Features/Accounts/Controller/v1/AccountsController.cs b/src/Ubik.Accounting.Api/Features/Accounts/Controller/v1/AccountsController.cs index 7650b057..a3c9ece5 100644 --- a/src/Ubik.Accounting.Api/Features/Accounts/Controller/v1/AccountsController.cs +++ b/src/Ubik.Accounting.Api/Features/Accounts/Controller/v1/AccountsController.cs @@ -1,6 +1,5 @@ using Asp.Versioning; using MassTransit; -using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Ubik.Accounting.Api.Features.Accounts.Services; using Ubik.Accounting.Api.Mappers; diff --git a/src/Ubik.Accounting.Api/Features/Accounts/Errors/AccountLinkedToExistingEntriesError.cs b/src/Ubik.Accounting.Api/Features/Accounts/Errors/AccountLinkedToExistingEntriesError.cs new file mode 100644 index 00000000..2d4bd240 --- /dev/null +++ b/src/Ubik.Accounting.Api/Features/Accounts/Errors/AccountLinkedToExistingEntriesError.cs @@ -0,0 +1,21 @@ +using Ubik.ApiService.Common.Errors; + +namespace Ubik.Accounting.Api.Features.Accounts.Errors +{ + public class AccountLinkedToExistingEntriesError : IServiceAndFeatureError + { + public ServiceAndFeatureErrorType ErrorType { get; init; } + public List CustomErrors { get; init; } + + public AccountLinkedToExistingEntriesError(Guid id) + { + ErrorType = ServiceAndFeatureErrorType.Conflict; + CustomErrors = new List() { new() + { + ErrorCode = "CANNOT_DELETE_ACCOUNT_LINKED_TO_EXISTING_ENTRIES", + ErrorFriendlyMessage = "This account is linked to existing accounting entries. You can desactivate the account to be excluded in the future but cannot delete it.", + ErrorValueDetails = $"Field:Id / Value:{id}", + }}; + } + } +} diff --git a/src/Ubik.Accounting.Api/Features/Accounts/Services/AccountCommandService.cs b/src/Ubik.Accounting.Api/Features/Accounts/Services/AccountCommandService.cs index 4ecb62d5..900c8b18 100644 --- a/src/Ubik.Accounting.Api/Features/Accounts/Services/AccountCommandService.cs +++ b/src/Ubik.Accounting.Api/Features/Accounts/Services/AccountCommandService.cs @@ -40,6 +40,7 @@ public async Task> UpdateAsync(UpdateAc public async Task> DeleteAsync(Guid id) { return await GetAsync(id) + .BindAsync(ValidateIfNotLinkedToExistingEntryAsync) .BindAsync(DeleteInDbContextAsync) .BindAsync(DeletedSaveAndPublishAsync); } @@ -196,6 +197,15 @@ private async Task> ValidateIfNotAlread : account; } + private async Task> ValidateIfNotLinkedToExistingEntryAsync(Account current) + { + var exists = await ctx.Entries.AnyAsync(e => e.AccountId == current.Id); + + return exists + ? new AccountLinkedToExistingEntriesError(current.Id) + : current; + } + private static async Task> MapInDbContextAsync (Account current, Account forUpdate) { diff --git a/src/Ubik.Accounting.Api/Features/VatRates/Services/IVatRateCommandService.cs b/src/Ubik.Accounting.Api/Features/VatRates/Services/IVatRateCommandService.cs new file mode 100644 index 00000000..0f4e9552 --- /dev/null +++ b/src/Ubik.Accounting.Api/Features/VatRates/Services/IVatRateCommandService.cs @@ -0,0 +1,14 @@ +using LanguageExt; +using Ubik.Accounting.Api.Models; +using Ubik.Accounting.Contracts.VatRate.Commands; +using Ubik.ApiService.Common.Errors; + +namespace Ubik.Accounting.Api.Features.VatRates.Services +{ + public interface IVatRateCommandService + { + public Task> AddAsync(AddVatRateCommand command); + public Task> UpdateAsync(UpdateVatRateCommand command); + public Task> DeleteAsync(Guid id); + } +} diff --git a/src/Ubik.Accounting.Api/Features/VatRates/Services/IVatRateQueryService.cs b/src/Ubik.Accounting.Api/Features/VatRates/Services/IVatRateQueryService.cs new file mode 100644 index 00000000..d1692602 --- /dev/null +++ b/src/Ubik.Accounting.Api/Features/VatRates/Services/IVatRateQueryService.cs @@ -0,0 +1,12 @@ +using LanguageExt; +using Ubik.Accounting.Api.Models; +using Ubik.ApiService.Common.Errors; + +namespace Ubik.Accounting.Api.Features.VatRates.Services +{ + public interface IVatRateQueryService + { + Task> GetAsync(Guid id); + Task> GetAllAsync(); + } +} diff --git a/src/Ubik.Accounting.Api/Features/VatRates/Services/VatRateCommandService.cs b/src/Ubik.Accounting.Api/Features/VatRates/Services/VatRateCommandService.cs new file mode 100644 index 00000000..766ac07e --- /dev/null +++ b/src/Ubik.Accounting.Api/Features/VatRates/Services/VatRateCommandService.cs @@ -0,0 +1,132 @@ +using LanguageExt; +using MassTransit.Transports; +using MassTransit; +using Microsoft.EntityFrameworkCore; +using Ubik.Accounting.Api.Data; +using Ubik.Accounting.Api.Models; +using Ubik.Accounting.Contracts.VatRate.Commands; +using Ubik.Accounting.Contracts.VatRate.Events; +using Ubik.ApiService.Common.Errors; +using Ubik.ApiService.Common.Exceptions; +using Ubik.Accounting.Api.Mappers; + +namespace Ubik.Accounting.Api.Features.VatRates.Services +{ + public class VatRateCommandService(AccountingDbContext ctx, IPublishEndpoint publishEndpoint) : IVatRateCommandService + { + public async Task> AddAsync(AddVatRateCommand command) + { + return await ValidateIfNotAlreadyExistsAsync(command.ToVatRate()) + .BindAsync(AddInDbContextAsync) + .BindAsync(AddSaveAndPublishAsync); + } + + public async Task> UpdateAsync(UpdateVatRateCommand command) + { + var model = command.ToVatRate(); + + return await GetAsync(model.Id) + .BindAsync(x => MapInDbContextAsync(x, model)) + .BindAsync(ValidateIfNotAlreadyExistsWithOtherIdAsync) + .BindAsync(UpdateInDbContextAsync) + .BindAsync(UpdateSaveAndPublishAsync); + } + + //TODO: need to implement check if used in transactions and soft delete + public async Task> DeleteAsync(Guid id) + { + return await GetAsync(id) + .BindAsync(DeleteInDbContextAsync) + .BindAsync(DeletedSaveAndPublishAsync); + } + + private async Task> DeletedSaveAndPublishAsync(VatRate current) + { + await publishEndpoint.Publish(new VatRateDeleted { Id = current.Id }, CancellationToken.None); + await ctx.SaveChangesAsync(); + + return true; + } + + private async Task> DeleteInDbContextAsync(VatRate current) + { + ctx.Entry(current).State = EntityState.Deleted; + + await Task.CompletedTask; + return current; + } + + private async Task> UpdateSaveAndPublishAsync(VatRate current) + { + try + { + await publishEndpoint.Publish(current.ToVatRateUpdated(), CancellationToken.None); + await ctx.SaveChangesAsync(); + + return current; + } + catch (UpdateDbConcurrencyException) + { + return new ResourceUpdateConcurrencyError("VatRate", current.Version.ToString()); + } + } + + private async Task> GetAsync(Guid id) + { + var result = await ctx.VatRates.FindAsync(id); + + return result == null + ? new ResourceNotFoundError("VatRate", "Id", id.ToString()) + : result; + } + + private async Task> UpdateInDbContextAsync(VatRate current) + { + ctx.Entry(current).State = EntityState.Modified; + ctx.SetAuditAndSpecialFields(); + + await Task.CompletedTask; + return current; + } + + private async Task> ValidateIfNotAlreadyExistsWithOtherIdAsync(VatRate current) + { + var exists = await ctx.VatRates.AnyAsync(a => a.Code == current.Code && a.Id != current.Id); + + return exists + ? new ResourceAlreadyExistsError("VatRate", "Code", current.Code) + : current; + } + + private static async Task> MapInDbContextAsync + (VatRate current, VatRate forUpdate) + { + current = forUpdate.ToVatRate(current); + await Task.CompletedTask; + return current; + } + + private async Task> AddSaveAndPublishAsync(VatRate current) + { + await publishEndpoint.Publish(current.ToVatRateAdded(), CancellationToken.None); + await ctx.SaveChangesAsync(); + return current; + } + + private async Task> AddInDbContextAsync(VatRate current) + { + current.Id = NewId.NextGuid(); + await ctx.VatRates.AddAsync(current); + ctx.SetAuditAndSpecialFields(); + return current; + } + + private async Task> ValidateIfNotAlreadyExistsAsync(VatRate current) + { + var exists = await ctx.VatRates.AnyAsync(a => a.Code == current.Code); + return exists + ? new ResourceAlreadyExistsError("VatRate", "Code", current.Code) + : current; + } + } +} diff --git a/src/Ubik.Accounting.Api/Features/VatRates/Services/VatRateQueryService.cs b/src/Ubik.Accounting.Api/Features/VatRates/Services/VatRateQueryService.cs new file mode 100644 index 00000000..a3b78dac --- /dev/null +++ b/src/Ubik.Accounting.Api/Features/VatRates/Services/VatRateQueryService.cs @@ -0,0 +1,27 @@ +using LanguageExt; +using Microsoft.EntityFrameworkCore; +using Ubik.Accounting.Api.Data; +using Ubik.Accounting.Api.Models; +using Ubik.ApiService.Common.Errors; + +namespace Ubik.Accounting.Api.Features.VatRates.Services +{ + public class VatRateQueryService(AccountingDbContext ctx) : IVatRateQueryService + { + public async Task> GetAllAsync() + { + var result = await ctx.VatRates.ToListAsync(); + + return result; + } + + public async Task> GetAsync(Guid id) + { + var result = await ctx.VatRates.FindAsync(id); + + return result == null + ? new ResourceNotFoundError("VatRate", "Id", id.ToString()) + : result; + } + } +} diff --git a/src/Ubik.Accounting.Api/Mappers/AccountMappers.cs b/src/Ubik.Accounting.Api/Mappers/AccountMappers.cs index 1ec99202..8f10f90a 100644 --- a/src/Ubik.Accounting.Api/Mappers/AccountMappers.cs +++ b/src/Ubik.Accounting.Api/Mappers/AccountMappers.cs @@ -18,6 +18,7 @@ public static IEnumerable ToAccountStandardResults(this I Label = x.Label, Category = x.Category, Domain = x.Domain, + Active = x.Active, Description = x.Description, Version = x.Version, CurrencyId = x.CurrencyId @@ -33,6 +34,7 @@ public static AccountStandardResult ToAccountStandardResult(this Account account Label = account.Label, Category = account.Category, Domain = account.Domain, + Active = account.Active, Description = account.Description, CurrencyId = account.CurrencyId, Version = account.Version @@ -83,6 +85,7 @@ public static AccountAdded ToAccountAdded(this Account account) Category = account.Category, Domain = account.Domain, Description = account.Description, + Active = account.Active, Version = account.Version, Id = account.Id, TenantId = account.TenantId, @@ -100,7 +103,8 @@ public static Account ToAccount(this AddAccountCommand addAccountCommand) Category = addAccountCommand.Category, Domain = addAccountCommand.Domain, Description = addAccountCommand.Description, - CurrencyId = addAccountCommand.CurrencyId + CurrencyId = addAccountCommand.CurrencyId, + Active = addAccountCommand.Active, }; } @@ -114,6 +118,7 @@ public static Account ToAccount(this Account accountForUpd, Account account) account.Description = accountForUpd.Description; account.Version = accountForUpd.Version; account.CurrencyId = accountForUpd.CurrencyId; + account.Active = accountForUpd.Active; return account; } @@ -129,7 +134,8 @@ public static AccountUpdated ToAccountUpdated(this Account account) Version = account.Version, Id = account.Id, TenantId = account.TenantId, - CurrencyId = account.CurrencyId + CurrencyId = account.CurrencyId, + Active = account.Active }; } @@ -158,6 +164,7 @@ public static Account ToAccount(this UpdateAccountCommand updateAccountCommand) Description = updateAccountCommand.Description, Version = updateAccountCommand.Version, CurrencyId = updateAccountCommand.CurrencyId, + Active = updateAccountCommand.Active }; } diff --git a/src/Ubik.Accounting.Api/Models/Account.cs b/src/Ubik.Accounting.Api/Models/Account.cs index 29dfbd11..ad31f71c 100644 --- a/src/Ubik.Accounting.Api/Models/Account.cs +++ b/src/Ubik.Accounting.Api/Models/Account.cs @@ -13,6 +13,7 @@ public class Account : ITenantEntity, IConcurrencyCheckEntity, IAuditEntity public string? Description { get; set; } public AccountCategory Category { get; set; } public AccountDomain Domain { get; set; } + public bool Active { get; set; } = true; public Guid Version { get; set; } public Guid TenantId { get; set; } public DateTime CreatedAt { get; set; } diff --git a/src/Ubik.Accounting.Contracts/Accounts/Commands/AddAccountCommand.cs b/src/Ubik.Accounting.Contracts/Accounts/Commands/AddAccountCommand.cs index 9a1c031a..913c83ec 100644 --- a/src/Ubik.Accounting.Contracts/Accounts/Commands/AddAccountCommand.cs +++ b/src/Ubik.Accounting.Contracts/Accounts/Commands/AddAccountCommand.cs @@ -22,5 +22,7 @@ public record AddAccountCommand public AccountDomain Domain { get; init; } [Required] public Guid CurrencyId { get; init; } + [Required] + public bool Active { get; init; } = true; } } diff --git a/src/Ubik.Accounting.Contracts/Accounts/Commands/UpdateAccountCommand.cs b/src/Ubik.Accounting.Contracts/Accounts/Commands/UpdateAccountCommand.cs index 4c93632a..64d3246e 100644 --- a/src/Ubik.Accounting.Contracts/Accounts/Commands/UpdateAccountCommand.cs +++ b/src/Ubik.Accounting.Contracts/Accounts/Commands/UpdateAccountCommand.cs @@ -22,6 +22,7 @@ public record UpdateAccountCommand public AccountDomain Domain { get; init; } [MaxLength(700)] public string? Description { get; init; } + public bool Active { get; init; } = true; [Required] public Guid Version { get; init; } [Required] diff --git a/src/Ubik.Accounting.Contracts/Accounts/Events/AccountAdded.cs b/src/Ubik.Accounting.Contracts/Accounts/Events/AccountAdded.cs index 82df5238..1f271317 100644 --- a/src/Ubik.Accounting.Contracts/Accounts/Events/AccountAdded.cs +++ b/src/Ubik.Accounting.Contracts/Accounts/Events/AccountAdded.cs @@ -10,6 +10,7 @@ public record AccountAdded public AccountCategory Category { get; init; } public AccountDomain Domain { get; init; } public string? Description { get; init; } + public bool Active { get; init; } = true; public Guid CurrencyId { get; init; } public Guid Version { get; init; } public Guid TenantId { get; init; } diff --git a/src/Ubik.Accounting.Contracts/Accounts/Events/AccountUpdated.cs b/src/Ubik.Accounting.Contracts/Accounts/Events/AccountUpdated.cs index 3c151c69..4ccd97bf 100644 --- a/src/Ubik.Accounting.Contracts/Accounts/Events/AccountUpdated.cs +++ b/src/Ubik.Accounting.Contracts/Accounts/Events/AccountUpdated.cs @@ -9,6 +9,7 @@ public record AccountUpdated public required string Label { get; init; } public AccountCategory Category { get; init; } public AccountDomain Domain { get; init; } + public bool Active { get; init; } = true; public string? Description { get; init; } public Guid CurrencyId { get; init; } public Guid Version { get; init; } diff --git a/src/Ubik.Accounting.Contracts/Accounts/Results/AccountGroupWithClassificationResult.cs b/src/Ubik.Accounting.Contracts/Accounts/Results/AccountGroupWithClassificationResult.cs index 107f140e..faa4c281 100644 --- a/src/Ubik.Accounting.Contracts/Accounts/Results/AccountGroupWithClassificationResult.cs +++ b/src/Ubik.Accounting.Contracts/Accounts/Results/AccountGroupWithClassificationResult.cs @@ -1,6 +1,6 @@ namespace Ubik.Accounting.Contracts.Accounts.Results { - public record AccountGroupWithClassificationResult + public record AccountGroupWithClassificationResult { public Guid Id { get; init; } public string Code { get; init; } = default!; diff --git a/src/Ubik.Accounting.Contracts/Accounts/Results/AccountStandardResult.cs b/src/Ubik.Accounting.Contracts/Accounts/Results/AccountStandardResult.cs index b225da6b..4b0c02ec 100644 --- a/src/Ubik.Accounting.Contracts/Accounts/Results/AccountStandardResult.cs +++ b/src/Ubik.Accounting.Contracts/Accounts/Results/AccountStandardResult.cs @@ -15,6 +15,7 @@ public record AccountStandardResult public AccountCategory Category { get; init; } public AccountDomain Domain { get; init; } public string? Description { get; init; } + public bool Active { get; init; } = true; public Guid CurrencyId { get; init; } public Guid Version { get; init; } } diff --git a/src/Ubik.CodeGenerator/Program.cs b/src/Ubik.CodeGenerator/Program.cs index 4a5088cc..48a6daa3 100644 --- a/src/Ubik.CodeGenerator/Program.cs +++ b/src/Ubik.CodeGenerator/Program.cs @@ -25,9 +25,9 @@ var myServicesGenerator = serviceProvider.GetRequiredService(); var myControllerGenerator = serviceProvider.GetRequiredService(); -myContractsGenerator.GenerateAllContracts(false, string.Empty, "VatRate"); +//myContractsGenerator.GenerateAllContracts(false, string.Empty, "VatRate"); //myMappersGenerator.GenerateMappers("VatRate"); -//myServicesGenerator.GenerateAllServicesAndInterfaces("Tenant"); +myServicesGenerator.GenerateAllServicesAndInterfaces("VatRate"); //myControllerGenerator.GenerateController("Tenant"); //FAKER to use the DBcontext diff --git a/src/Ubik.CodeGenerator/ServicesGenerator.cs b/src/Ubik.CodeGenerator/ServicesGenerator.cs index b90864d3..882c7254 100644 --- a/src/Ubik.CodeGenerator/ServicesGenerator.cs +++ b/src/Ubik.CodeGenerator/ServicesGenerator.cs @@ -1,8 +1,9 @@ -using Ubik.Security.Api.Data; +using Ubik.Accounting.Api.Data; +using Ubik.Security.Api.Data; namespace Ubik.CodeGenerator { - internal class ServicesGenerator(SecurityDbContext dbContext) + internal class ServicesGenerator(AccountingDbContext dbContext) { public void GenerateAllServicesAndInterfaces(string? type = null) { @@ -95,7 +96,7 @@ private static string GetTemplateForServiceQueryInterface() { return """ - public interface I{ClassName}sQueriesService + public interface I{ClassName}QueryService { Task> GetAsync(Guid id); Task> GetAllAsync(); @@ -107,7 +108,7 @@ private static string GetTemplateForServiceQueryClass() { return """ - public class {ClassName}sQueriesService(SecurityDbContext ctx) : I{ClassName}sQueriesService + public class {ClassName}QueryService(SecurityDbContext ctx) : I{ClassName}QueryService { public async Task> GetAllAsync() { @@ -132,11 +133,11 @@ private static string GetTemplateForServiceCommandInterface() { return """ - public interface I{ClassName}sCommandsService + public interface I{ClassName}CommandService { public Task> AddAsync(Add{ClassName}Command command); public Task> UpdateAsync(Update{ClassName}Command command); - public Task> ExecuteDeleteAsync(Guid id); + public Task> DeleteAsync(Guid id); } """; } @@ -144,66 +145,61 @@ public interface I{ClassName}sCommandsService private static string GetTemplateForServiceCommandClass() { return - """ - public class {ClassName}sCommandsService(SecurityDbContext ctx, IPublishEndpoint publishEndpoint) : I{ClassName}sCommandsService - { + """" public async Task> AddAsync(Add{ClassName}Command command) { - var result = await Add{ClassName}Async(command.To{ClassName}()); - - return await result.MatchAsync>( - RightAsync: async r => - { - await publishEndpoint.Publish(r.To{ClassName}Added(), CancellationToken.None); - await ctx.SaveChangesAsync(); - return r; - }, - Left: err => - { - return Prelude.Left(err); - }); + return await ValidateIfNotAlreadyExistsAsync(command.To{ClassName}()) + .BindAsync(AddInDbContextAsync) + .BindAsync(AddSaveAndPublishAsync); } public async Task> UpdateAsync(Update{ClassName}Command command) { - var result = await Update{ClassName}Async(command.To{ClassName}()); - - return await result.MatchAsync>( - RightAsync: async r => - { - try - { - //Store and publish AccountGroupAdded event - await publishEndpoint.Publish(r.To{ClassName}Updated(), CancellationToken.None); - await ctx.SaveChangesAsync(); - return r; - } - catch (UpdateDbConcurrencyException) - { - return new ResourceUpdateConcurrencyError("{ClassName}", r.Version.ToString()); - } - }, - Left: err => - { - return Prelude.Left(err); - }); + var model = command.To{ClassName}(); + + return await GetAsync(model.Id) + .BindAsync(x => MapInDbContextAsync(x, model)) + .BindAsync(ValidateIfNotAlreadyExistsWithOtherIdAsync) + .BindAsync(UpdateInDbContextAsync) + .BindAsync(UpdateSaveAndPublishAsync); + } + + public async Task> DeleteAsync(Guid id) + { + return await GetAsync(id) + .BindAsync(DeleteInDbContextAsync) + .BindAsync(DeletedSaveAndPublishAsync); } - public async Task> ExecuteDeleteAsync(Guid id) + private async Task> DeletedSaveAndPublishAsync({ClassName} current) { - var res = await ExecuteDelete{ClassName}Async(id); - - return await res.MatchAsync>( - RightAsync: async r => - { - await publishEndpoint.Publish(new {ClassName}Deleted { Id = id }, CancellationToken.None); - await ctx.SaveChangesAsync(); - return true; - }, - Left: err => - { - return Prelude.Left(err); - }); + await publishEndpoint.Publish(new {ClassName}Deleted { Id = current.Id }, CancellationToken.None); + await ctx.SaveChangesAsync(); + + return true; + } + + private async Task> DeleteInDbContextAsync({ClassName} current) + { + ctx.Entry(current).State = EntityState.Deleted; + + await Task.CompletedTask; + return current; + } + + private async Task> UpdateSaveAndPublishAsync({ClassName} current) + { + try + { + await publishEndpoint.Publish(current.To{ClassName}Updated(), CancellationToken.None); + await ctx.SaveChangesAsync(); + + return current; + } + catch (UpdateDbConcurrencyException) + { + return new ResourceUpdateConcurrencyError("{ClassName}", current.Version.ToString()); + } } private async Task> GetAsync(Guid id) @@ -215,59 +211,55 @@ public async Task> ExecuteDeleteAsync(Guid : result; } - private async Task> Update{ClassName}Async({ClassName} current) + private async Task> UpdateInDbContextAsync({ClassName} current) { - return await GetAsync(current.Id).ToAsync() - .Map(c => c = current.To{ClassName}(c)) - .Bind(c => ValidateIfNotAlreadyExistsWithOtherIdAsync(c).ToAsync()) - .Map(c => - { - ctx.Entry(c).State = EntityState.Modified; - ctx.SetAuditAndSpecialFields(); - return c; - }); - } + ctx.Entry(current).State = EntityState.Modified; + ctx.SetAuditAndSpecialFields(); - private async Task> Add{ClassName}Async({ClassName} current) - { - return await ValidateIfNotAlreadyExistsAsync(current).ToAsync() - .MapAsync(async ac => - { - ac.Id = NewId.NextGuid(); - await ctx.{ClassName}s.AddAsync(ac); - ctx.SetAuditAndSpecialFields(); - return ac; - }); + await Task.CompletedTask; + return current; } - private async Task> ValidateIfNotAlreadyExistsAsync({ClassName} current) + private async Task> ValidateIfNotAlreadyExistsWithOtherIdAsync({ClassName} current) { - var exists = await ctx.{ClassName}s.AnyAsync(a => a.Code == current.Code); + var exists = await ctx.{ClassName}s.AnyAsync(a => a.Code == current.Code && a.Id != current.Id); + return exists ? new ResourceAlreadyExistsError("{ClassName}", "Code", current.Code) : current; } - private async Task> ValidateIfNotAlreadyExistsWithOtherIdAsync({ClassName} current) + private static async Task> MapInDbContextAsync + ({ClassName} current, {ClassName} forUpdate) { - var exists = await ctx.{ClassName}s.AnyAsync(a => a.Code == current.Code && a.Id != current.Id); + current = forUpdate.To{ClassName}(current); + await Task.CompletedTask; + return current; + } - return exists - ? new ResourceAlreadyExistsError("{ClassName}", "Code", current.Code) - : current; + private async Task> AddSaveAndPublishAsync({ClassName} current) + { + await publishEndpoint.Publish(current.To{ClassName}Added(), CancellationToken.None); + await ctx.SaveChangesAsync(); + return current; } - private async Task> ExecuteDelete{ClassName}Async(Guid id) + private async Task> AddInDbContextAsync({ClassName} current) { - return await GetAsync(id).ToAsync() - .MapAsync(async ac => - { - await ctx.{ClassName}s.Where(x => x.Id == id).ExecuteDeleteAsync(); - return true; - }); + current.Id = NewId.NextGuid(); + await ctx.{ClassName}s.AddAsync(current); + ctx.SetAuditAndSpecialFields(); + return current; } - } - """; + + private async Task> ValidateIfNotAlreadyExistsAsync({ClassName} current) + { + var exists = await ctx.{ClassName}s.AnyAsync(a => a.Code == current.Code); + return exists + ? new ResourceAlreadyExistsError("{ClassName}", "Code", current.Code) + : current; + } + """"; } } } diff --git a/tests/Ubik.Api.Tests.Integration/Features/Accounting/Accounts/AccountsController_Test.cs b/tests/Ubik.Api.Tests.Integration/Features/Accounting/Accounts/AccountsController_Test.cs index a77cafd6..efd46a36 100644 --- a/tests/Ubik.Api.Tests.Integration/Features/Accounting/Accounts/AccountsController_Test.cs +++ b/tests/Ubik.Api.Tests.Integration/Features/Accounting/Accounts/AccountsController_Test.cs @@ -7,7 +7,6 @@ using System.Net; using System.Text; using System.Threading.Tasks; -using Ubik.Accounting.Contracts.AccountGroups.Results; using Ubik.Accounting.Contracts.Accounts.Results; using Ubik.ApiService.Common.Exceptions; using Ubik.Accounting.Contracts.Accounts.Commands; @@ -16,6 +15,7 @@ namespace Ubik.Api.Tests.Integration.Features.Accounting.Accounts { + //TODO: write a test case when account is linked to existing accounting entries public class AccountsController_Test : BaseIntegrationTestAccounting { private readonly string _baseUrlForV1; From 1462427835272bb77754f389aef07bcd0dcdcc13 Mon Sep 17 00:00:00 2001 From: fdonnet Date: Thu, 31 Oct 2024 14:33:16 +0100 Subject: [PATCH 05/94] New account field --- .../Data/Config/AccountConfiguration.cs | 5 + .../Data/Init/AccountsData.sql | 537 +++++++++--------- 2 files changed, 274 insertions(+), 268 deletions(-) diff --git a/src/Ubik.Accounting.Api/Data/Config/AccountConfiguration.cs b/src/Ubik.Accounting.Api/Data/Config/AccountConfiguration.cs index 421bada9..1e845140 100644 --- a/src/Ubik.Accounting.Api/Data/Config/AccountConfiguration.cs +++ b/src/Ubik.Accounting.Api/Data/Config/AccountConfiguration.cs @@ -31,6 +31,11 @@ public void Configure(EntityTypeBuilder builder) builder.Property(a => a.CreatedBy) .IsRequired(); + builder.Property(a=>a.Active) + .IsRequired() + .HasDefaultValue(true); + + builder.HasIndex(a => new { a.Code, a.TenantId }) .IsUnique(); diff --git a/src/Ubik.Accounting.Api/Data/Init/AccountsData.sql b/src/Ubik.Accounting.Api/Data/Init/AccountsData.sql index 2a8ed741..71d2a650 100644 --- a/src/Ubik.Accounting.Api/Data/Init/AccountsData.sql +++ b/src/Ubik.Accounting.Api/Data/Init/AccountsData.sql @@ -1,269 +1,270 @@ -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('248e0000-5dd4-0015-e321-08dcd98b1434', '1020', 'Bank', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, '248e0000-5dd4-0015-f549-08dcd98b1434', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-20 15:44:14.246399+00', '248e0000-5dd4-0015-82b6-08dcd98b1434', '2024-09-20 15:44:14.246399+00', '248e0000-5dd4-0015-82b6-08dcd98b1434', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('248e0000-5dd4-0015-f110-08dcd98b20af', '1060', 'Securities', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, '248e0000-5dd4-0015-f77f-08dcd98b20af', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-20 15:44:35.185238+00', '248e0000-5dd4-0015-96cf-08dcd98b20af', '2024-09-20 15:44:35.185238+00', '248e0000-5dd4-0015-96cf-08dcd98b20af', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('248e0000-5dd4-0015-aa2d-08dcd98b2ad0', '1100', 'Trade accounts receivable', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, '248e0000-5dd4-0015-b397-08dcd98b2ad0', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-20 15:44:52.176984+00', '248e0000-5dd4-0015-6a71-08dcd98b2ad0', '2024-09-20 15:44:52.176984+00', '248e0000-5dd4-0015-6a71-08dcd98b2ad0', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('248e0000-5dd4-0015-12f9-08dcd98b3350', '1101', 'Credit card receivables', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, '248e0000-5dd4-0015-1822-08dcd98b3350', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-20 15:45:06.433634+00', '248e0000-5dd4-0015-c5b4-08dcd98b334f', '2024-09-20 15:45:06.433634+00', '248e0000-5dd4-0015-c5b4-08dcd98b334f', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('248e0000-5dd4-0015-8db2-08dcd98b3c4c', '1109', 'Provision for credit losses (Ducroire)', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, '248e0000-5dd4-0015-928a-08dcd98b3c4c', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-20 15:45:21.51005+00', '248e0000-5dd4-0015-4fa9-08dcd98b3c4c', '2024-09-20 15:45:21.51005+00', '248e0000-5dd4-0015-4fa9-08dcd98b3c4c', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('248e0000-5dd4-0015-48fb-08dcd98b4a28', '1140', 'Advances and loans granted', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, '248e0000-5dd4-0015-4df0-08dcd98b4a28', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-20 15:45:44.760468+00', '248e0000-5dd4-0015-0819-08dcd98b4a28', '2024-09-20 15:45:44.760468+00', '248e0000-5dd4-0015-0819-08dcd98b4a28', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('248e0000-5dd4-0015-13fe-08dcd98b6d70', '1176', 'Withholding tax recoverable', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, '248e0000-5dd4-0015-19ed-08dcd98b6d70', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-20 15:46:43.951252+00', '248e0000-5dd4-0015-d6be-08dcd98b6d6f', '2024-09-20 15:46:43.951252+00', '248e0000-5dd4-0015-d6be-08dcd98b6d6f', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('248e0000-5dd4-0015-fff6-08dcd98b746a', '1190', 'Other short-term receivables', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, '248e0000-5dd4-0015-04ac-08dcd98b746b', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-20 15:46:55.66199+00', '248e0000-5dd4-0015-b7ad-08dcd98b746a', '2024-09-20 15:46:55.66199+00', '248e0000-5dd4-0015-b7ad-08dcd98b746a', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('248e0000-5dd4-0015-ebad-08dcd98b0949', '1000', 'Case', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, '248e0000-5dd4-0015-a737-08dcd98bcb2b', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-20 15:43:55.975757+00', '248e0000-5dd4-0015-6140-08dcd98b0948', '2024-09-20 15:49:21.2085+00', '248e0000-5dd4-0015-9b0a-08dcd98bcb2a', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('78920000-5dd4-0015-3c01-08dcd9a7702b', '1400', 'Long-term securities', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, '78920000-5dd4-0015-18d4-08dcd9a7702e', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-20 19:07:14.460177+00', '78920000-5dd4-0015-4355-08dcd9a7702a', '2024-09-20 19:07:14.460177+00', '78920000-5dd4-0015-4355-08dcd9a7702a', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('78920000-5dd4-0015-eaeb-08dcd9a778d2', '1440', 'Long-term loans', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, '78920000-5dd4-0015-f445-08dcd9a778d2', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-20 19:07:28.962431+00', '78920000-5dd4-0015-9b32-08dcd9a778d2', '2024-09-20 19:07:28.962431+00', '78920000-5dd4-0015-9b32-08dcd9a778d2', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('78920000-5dd4-0015-6f96-08dcd9a78046', '1441', 'Mortgage loans', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, '78920000-5dd4-0015-7a90-08dcd9a78046', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-20 19:07:41.463613+00', '78920000-5dd4-0015-07eb-08dcd9a78046', '2024-09-20 19:07:41.463613+00', '78920000-5dd4-0015-07eb-08dcd9a78046', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('248e0000-5dd4-0015-443b-08dcd98b545d', '1170', 'VAT input tax (materials, services)', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, '78920000-5dd4-0015-983d-08dcd9a9beab', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-20 15:46:01.884919+00', '248e0000-5dd4-0015-fd7b-08dcd98b545c', '2024-09-20 19:23:45.138485+00', '78920000-5dd4-0015-b5e7-08dcd9a9beaa', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('248e0000-5dd4-0015-133a-08dcd98b5d1d', '1171', 'VAT input tax (investments and other charges)', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, '78920000-5dd4-0015-c8f5-08dcd9a9c7da', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-20 15:46:16.563738+00', '248e0000-5dd4-0015-d52d-08dcd98b5d1c', '2024-09-20 19:24:00.547247+00', '78920000-5dd4-0015-5fc5-08dcd9a9c7da', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('248e0000-5dd4-0015-c1ce-08dcd98b7c74', '1200', 'Inventory A', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, '78920000-5dd4-0015-f39f-08dcd9a9f93e', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-20 15:47:09.147723+00', '248e0000-5dd4-0015-8552-08dcd98b7c74', '2024-09-20 19:25:23.412058+00', '78920000-5dd4-0015-8587-08dcd9a9f93e', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('248e0000-5dd4-0015-2c01-08dcd98b8441', '1201', 'Inventory B', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, '78920000-5dd4-0015-2de6-08dcd9aa042a', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-20 15:47:22.2314+00', '248e0000-5dd4-0015-eccf-08dcd98b8440', '2024-09-20 19:25:41.730861+00', '78920000-5dd4-0015-cf23-08dcd9aa0429', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('248e0000-5dd4-0015-9008-08dcd98b8c12', '1209', 'Inventory valuation adjustments', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, '78920000-5dd4-0015-3a44-08dcd9aa0fb7', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-20 15:47:35.347754+00', '248e0000-5dd4-0015-51cb-08dcd98b8c12', '2024-09-20 19:26:01.110173+00', '78920000-5dd4-0015-e306-08dcd9aa0fb6', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('248e0000-5dd4-0015-7165-08dcd98bbffa', '1300', 'Prepaid expenses', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, '78920000-5dd4-0015-392d-08dcd9aa2c96', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-20 15:49:02.431183+00', '248e0000-5dd4-0015-3458-08dcd98bbffa', '2024-09-20 19:26:49.547803+00', '78920000-5dd4-0015-e398-08dcd9aa2c95', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('78920000-5dd4-0015-23e7-08dcd9aa3ba7', '1301', 'Receivables for products and services', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, '78920000-5dd4-0015-2a3d-08dcd9aa3ba7', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-20 19:27:14.824656+00', '78920000-5dd4-0015-e8fa-08dcd9aa3ba6', '2024-09-20 19:27:14.824656+00', '78920000-5dd4-0015-e8fa-08dcd9aa3ba6', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-3815-08dcda1dad9e', '1522', 'Communication systems', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, 'ec860000-5dd4-0015-3d50-08dcda1dad9e', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 09:13:38.150329+00', 'ec860000-5dd4-0015-f890-08dcda1dad9d', '2024-09-21 09:13:38.150329+00', 'ec860000-5dd4-0015-f890-08dcda1dad9d', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('78920000-5dd4-0015-0644-08dcd9aaf581', '1409', 'Valuation adjustments on long-term invest', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, '78920000-5dd4-0015-c298-08dcd9aaffac', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-20 19:32:26.631035+00', '78920000-5dd4-0015-cfd2-08dcd9aaf580', '2024-09-20 19:32:43.694758+00', '78920000-5dd4-0015-7106-08dcd9aaffac', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('78920000-5dd4-0015-a5ff-08dcd9a7ab43', '1449', 'Valuation adjustments on long-term loans', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, '78920000-5dd4-0015-c376-08dcd9ab07a8', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-20 19:08:53.587235+00', '78920000-5dd4-0015-6ce0-08dcd9a7ab43', '2024-09-20 19:32:57.090339+00', '78920000-5dd4-0015-7322-08dcd9ab07a8', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-1c93-08dcda1d182f', '1500', 'Machinery and equipment', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, 'ec860000-5dd4-0015-ba47-08dcda1d1831', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 09:09:27.458513+00', 'ec860000-5dd4-0015-22f0-08dcda1d182e', '2024-09-21 09:09:27.458513+00', 'ec860000-5dd4-0015-22f0-08dcda1d182e', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-b48d-08dcda1d22ef', '1510', 'Operating furniture', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, 'ec860000-5dd4-0015-bc9f-08dcda1d22ef', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 09:09:45.481106+00', 'ec860000-5dd4-0015-6f4b-08dcda1d22ef', '2024-09-21 09:09:45.481106+00', 'ec860000-5dd4-0015-6f4b-08dcda1d22ef', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-061c-08dcda1d2bc2', '1511', 'Workshop installations', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, 'ec860000-5dd4-0015-0fca-08dcda1d2bc2', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 09:10:00.281281+00', 'ec860000-5dd4-0015-abdc-08dcda1d2bc1', '2024-09-21 09:10:00.281281+00', 'ec860000-5dd4-0015-abdc-08dcda1d2bc1', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-ddf3-08dcda1d3498', '1512', 'Warehouse installations', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, 'ec860000-5dd4-0015-e2f2-08dcda1d3498', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 09:10:15.110931+00', 'ec860000-5dd4-0015-9216-08dcda1d3498', '2024-09-21 09:10:15.110931+00', 'ec860000-5dd4-0015-9216-08dcda1d3498', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-bc68-08dcda1d47f5', '1513', 'Office furniture', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, 'ec860000-5dd4-0015-c79e-08dcda1d47f5', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 09:10:47.596415+00', 'ec860000-5dd4-0015-7155-08dcda1d47f5', '2024-09-21 09:10:47.596415+00', 'ec860000-5dd4-0015-7155-08dcda1d47f5', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-a24f-08dcda1d9931', '1520', 'Office machines', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, 'ec860000-5dd4-0015-a781-08dcda1d9931', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 09:13:03.884272+00', 'ec860000-5dd4-0015-64bb-08dcda1d9931', '2024-09-21 09:13:03.884272+00', 'ec860000-5dd4-0015-64bb-08dcda1d9931', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-9192-08dcda1da58d', '1521', 'IT infrastructure', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, 'ec860000-5dd4-0015-99c4-08dcda1da58d', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 09:13:24.619511+00', 'ec860000-5dd4-0015-5284-08dcda1da58d', '2024-09-21 09:13:24.619511+00', 'ec860000-5dd4-0015-5284-08dcda1da58d', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-0173-08dcda1db8d7', '1530', 'Cars', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, 'ec860000-5dd4-0015-07a9-08dcda1db8d7', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 09:13:56.977448+00', 'ec860000-5dd4-0015-c4b2-08dcda1db8d6', '2024-09-21 09:13:56.977448+00', 'ec860000-5dd4-0015-c4b2-08dcda1db8d6', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-d472-08dcda1dc37c', '1540', 'Tools and equipment', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, 'ec860000-5dd4-0015-da04-08dcda1dc37c', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 09:14:14.841393+00', 'ec860000-5dd4-0015-8fa4-08dcda1dc37c', '2024-09-21 09:14:14.841393+00', 'ec860000-5dd4-0015-8fa4-08dcda1dc37c', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-66d1-08dcda1dd26b', '1550', 'Storage facilities', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, 'ec860000-5dd4-0015-6c02-08dcda1dd26b', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 09:14:39.892989+00', 'ec860000-5dd4-0015-2c65-08dcda1dd26b', '2024-09-21 09:14:39.892989+00', 'ec860000-5dd4-0015-2c65-08dcda1dd26b', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-11c5-08dcda1de501', '1590', 'Work clothing and uniforms', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, 'ec860000-5dd4-0015-1701-08dcda1de501', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 09:15:11.072842+00', 'ec860000-5dd4-0015-c7c0-08dcda1de500', '2024-09-21 09:15:11.072842+00', 'ec860000-5dd4-0015-c7c0-08dcda1de500', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-3436-08dcda1eb6ce', '1600', 'Operating buildings', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, 'ec860000-5dd4-0015-3c3a-08dcda1eb6ce', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 09:21:03.061097+00', 'ec860000-5dd4-0015-f17e-08dcda1eb6cd', '2024-09-21 09:21:03.061097+00', 'ec860000-5dd4-0015-f17e-08dcda1eb6cd', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-f0cf-08dcda1ebfe4', '1601', 'Maintenance, repair, or replacement', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, 'ec860000-5dd4-0015-f4d3-08dcda1ebfe4', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 09:21:18.309497+00', 'ec860000-5dd4-0015-b24f-08dcda1ebfe4', '2024-09-21 09:21:18.309497+00', 'ec860000-5dd4-0015-b24f-08dcda1ebfe4', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-12a2-08dcda1ed305', '1800', 'Incorporation costs', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, 'ec860000-5dd4-0015-16a9-08dcda1ed305', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 09:21:50.396788+00', 'ec860000-5dd4-0015-dc9f-08dcda1ed304', '2024-09-21 09:21:50.396788+00', 'ec860000-5dd4-0015-dc9f-08dcda1ed304', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-69c4-08dcda1edb78', '1801', 'Capital increase costs', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, 'ec860000-5dd4-0015-0c65-08dcda1ef2e0', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 09:22:04.57447+00', 'ec860000-5dd4-0015-2fad-08dcda1edb78', '2024-09-21 09:22:43.841132+00', 'ec860000-5dd4-0015-ce10-08dcda1ef2dc', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-7012-08dcda1ef826', '1802', 'Organizational costs', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, 'ec860000-5dd4-0015-74d8-08dcda1ef826', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 09:22:52.691167+00', 'ec860000-5dd4-0015-328c-08dcda1ef826', '2024-09-21 09:22:52.691167+00', 'ec860000-5dd4-0015-328c-08dcda1ef826', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-ef03-08dcda1f0104', '1850', 'Unissued share capital', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, 'ec860000-5dd4-0015-f553-08dcda1f0104', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 09:23:07.571128+00', 'ec860000-5dd4-0015-b6d7-08dcda1f0104', '2024-09-21 09:23:07.571128+00', 'ec860000-5dd4-0015-b6d7-08dcda1f0104', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-c9fe-08dcda1f08eb', '1859', 'Valuation adjustments on unissued share capital', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, 'ec860000-5dd4-0015-d01a-08dcda1f08eb', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 09:23:20.828106+00', 'ec860000-5dd4-0015-8f49-08dcda1f08eb', '2024-09-21 09:23:20.828106+00', 'ec860000-5dd4-0015-8f49-08dcda1f08eb', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-5955-08dcda1eca12', '1609', 'Accumulated depreciation on operating buildings', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, 'ec860000-5dd4-0015-df72-08dcda1f3dbc', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 09:21:35.384328+00', 'ec860000-5dd4-0015-1779-08dcda1eca12', '2024-09-21 09:24:49.439727+00', 'ec860000-5dd4-0015-7f88-08dcda1f3dbc', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-1cc9-08dcda20a76e', '2000', 'Liabilities for purchases of materials and goods', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, 'ec860000-5dd4-0015-234c-08dcda20a76e', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 09:34:56.258948+00', 'ec860000-5dd4-0015-d485-08dcda20a76d', '2024-09-21 09:34:56.258948+00', 'ec860000-5dd4-0015-d485-08dcda20a76d', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-98ee-08dcda20b16e', '2001', 'Liabilities for services to third parties', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, 'ec860000-5dd4-0015-9c96-08dcda20b16e', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 09:35:13.03927+00', 'ec860000-5dd4-0015-54b2-08dcda20b16e', '2024-09-21 09:35:13.03927+00', 'ec860000-5dd4-0015-54b2-08dcda20b16e', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-1ecb-08dcda20bb14', '2002', 'Liabilities for personnel expenses', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, 'ec860000-5dd4-0015-22db-08dcda20bb14', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 09:35:29.223545+00', 'ec860000-5dd4-0015-e775-08dcda20bb13', '2024-09-21 09:35:29.223545+00', 'ec860000-5dd4-0015-e775-08dcda20bb13', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-54dd-08dcda20c7a0', '2003', 'Liabilities for social security contributions', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, 'ec860000-5dd4-0015-5874-08dcda20c7a0', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 09:35:50.27508+00', 'ec860000-5dd4-0015-1355-08dcda20c7a0', '2024-09-21 09:35:50.27508+00', 'ec860000-5dd4-0015-1355-08dcda20c7a0', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-e6b0-08dcda20d5dd', '2005', 'Liabilities for lease transactions', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, 'ec860000-5dd4-0015-eac7-08dcda20d5dd', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 09:36:14.166698+00', 'ec860000-5dd4-0015-aa83-08dcda20d5dd', '2024-09-21 09:36:14.166698+00', 'ec860000-5dd4-0015-aa83-08dcda20d5dd', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-a0ad-08dcda20cecb', '2004', 'Liabilities for other operating expenses', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, 'ec860000-5dd4-0015-6c4d-08dcda210823', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 09:36:02.302981+00', 'ec860000-5dd4-0015-5611-08dcda20cecb', '2024-09-21 09:37:38.508292+00', 'ec860000-5dd4-0015-06fc-08dcda210823', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-aa11-08dcda2fe630', '2030', 'Customer advances', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, 'ec860000-5dd4-0015-aee3-08dcda2fe630', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 11:24:04.003603+00', 'ec860000-5dd4-0015-65c2-08dcda2fe630', '2024-09-21 11:24:04.003603+00', 'ec860000-5dd4-0015-65c2-08dcda2fe630', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-4e95-08dcda2ff13b', '2100', 'Short-term bank liabilities', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, 'ec860000-5dd4-0015-5350-08dcda2ff13b', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 11:24:22.528287+00', 'ec860000-5dd4-0015-16de-08dcda2ff13b', '2024-09-21 11:24:22.528287+00', 'ec860000-5dd4-0015-16de-08dcda2ff13b', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-2d5c-08dcda306250', '2110', 'Liabilities to post offices', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, 'ec860000-5dd4-0015-3149-08dcda306250', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 11:27:32.247582+00', 'ec860000-5dd4-0015-e704-08dcda30624f', '2024-09-21 11:27:32.247582+00', 'ec860000-5dd4-0015-e704-08dcda30624f', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-ce96-08dcda306be5', '2111', 'Liabilities to transfer companies', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, 'ec860000-5dd4-0015-d394-08dcda306be5', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 11:27:48.327714+00', 'ec860000-5dd4-0015-9a17-08dcda306be5', '2024-09-21 11:27:48.327714+00', 'ec860000-5dd4-0015-9a17-08dcda306be5', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-0733-08dcda307df9', '2160', 'Short-term financial liabilities to shareholder X', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, 'ec860000-5dd4-0015-0a00-08dcda307df9', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 11:28:18.652618+00', 'ec860000-5dd4-0015-cc3c-08dcda307df8', '2024-09-21 11:28:18.652618+00', 'ec860000-5dd4-0015-cc3c-08dcda307df8', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-5593-08dcda308633', '2170', 'Short-term financial liabilities to pension funds', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, 'ec860000-5dd4-0015-584c-08dcda308633', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 11:28:32.456504+00', 'ec860000-5dd4-0015-22f5-08dcda308633', '2024-09-21 11:28:32.456504+00', 'ec860000-5dd4-0015-22f5-08dcda308633', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-e456-08dcda308e53', '2180', 'Mortgage repayments', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, 'ec860000-5dd4-0015-e818-08dcda308e53', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 11:28:46.091673+00', 'ec860000-5dd4-0015-a822-08dcda308e53', '2024-09-21 11:28:46.091673+00', 'ec860000-5dd4-0015-a822-08dcda308e53', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-a892-08dcda3094b8', '2181', 'Loan repayments', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, 'ec860000-5dd4-0015-ad23-08dcda3094b8', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 11:28:56.818407+00', 'ec860000-5dd4-0015-6730-08dcda3094b8', '2024-09-21 11:28:56.818407+00', 'ec860000-5dd4-0015-6730-08dcda3094b8', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-2309-08dcda309b7b', '2200', 'VAT payable', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, 'ec860000-5dd4-0015-25fe-08dcda309b7b', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 11:29:08.159225+00', 'ec860000-5dd4-0015-e51f-08dcda309b7a', '2024-09-21 11:29:08.159225+00', 'ec860000-5dd4-0015-e51f-08dcda309b7a', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-e12c-08dcda30a42e', '2205', 'AFC - VAT', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, 'ec860000-5dd4-0015-e3a2-08dcda30a42e', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 11:29:22.758951+00', 'ec860000-5dd4-0015-a414-08dcda30a42e', '2024-09-21 11:29:22.758951+00', 'ec860000-5dd4-0015-a414-08dcda30a42e', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-e7f6-08dcda30aa7d', '2206', 'Due withholding tax', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, 'ec860000-5dd4-0015-ecc0-08dcda30aa7d', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 11:29:33.343248+00', 'ec860000-5dd4-0015-ac71-08dcda30aa7d', '2024-09-21 11:29:33.343248+00', 'ec860000-5dd4-0015-ac71-08dcda30aa7d', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-2192-08dcda30b1de', '2207', 'Due stamp duties', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, 'ec860000-5dd4-0015-2506-08dcda30b1de', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 11:29:45.717886+00', 'ec860000-5dd4-0015-e8d4-08dcda30b1dd', '2024-09-21 11:29:45.717886+00', 'ec860000-5dd4-0015-e8d4-08dcda30b1dd', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-0ce3-08dcda30bd7f', '2208', 'Due direct taxes', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, 'ec860000-5dd4-0015-0f91-08dcda30bd7f', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 11:30:05.227404+00', 'ec860000-5dd4-0015-d700-08dcda30bd7e', '2024-09-21 11:30:05.227404+00', 'ec860000-5dd4-0015-d700-08dcda30bd7e', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-8e25-08dcda30c7bb', '2230', 'Unclaimed dividends for the year', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', ' ', 0, 1, 'ec860000-5dd4-0015-9ad3-08dcda30c7bb', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 11:30:22.4014+00', 'ec860000-5dd4-0015-3ab6-08dcda30c7bb', '2024-09-21 11:30:22.4014+00', 'ec860000-5dd4-0015-3ab6-08dcda30c7bb', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-3043-08dcda30ce50', '2231', 'Unclaimed dividends from previous years', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, 'ec860000-5dd4-0015-3371-08dcda30ce50', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 11:30:33.44157+00', 'ec860000-5dd4-0015-f2a8-08dcda30ce4f', '2024-09-21 11:30:33.44157+00', 'ec860000-5dd4-0015-f2a8-08dcda30ce4f', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-8e4f-08dcda30d697', '2232', 'Unclaimed bond coupons', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, 'ec860000-5dd4-0015-90fc-08dcda30d697', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 11:30:47.331043+00', 'ec860000-5dd4-0015-57e3-08dcda30d697', '2024-09-21 11:30:47.331043+00', 'ec860000-5dd4-0015-57e3-08dcda30d697', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-e4a1-08dcda3073d0', '2140', 'Other short-term financial liabilities to third parties', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, 'ec860000-5dd4-0015-5fe2-08dcda316bc3', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 11:28:01.612408+00', 'ec860000-5dd4-0015-acc9-08dcda3073d0', '2024-09-21 11:34:57.598663+00', 'ec860000-5dd4-0015-0e84-08dcda316bc3', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-f91d-08dcda52f00f', '2300', 'Accrued expenses', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, 'ec860000-5dd4-0015-fcae-08dcda52f00f', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:34:52.952078+00', 'ec860000-5dd4-0015-bb3e-08dcda52f00f', '2024-09-21 15:34:52.952078+00', 'ec860000-5dd4-0015-bb3e-08dcda52f00f', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-b39d-08dcda530d2c', '2301', 'Prepaid income', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, 'ec860000-5dd4-0015-b78d-08dcda530d2c', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:35:41.794289+00', 'ec860000-5dd4-0015-6e60-08dcda530d2c', '2024-09-21 15:35:41.794289+00', 'ec860000-5dd4-0015-6e60-08dcda530d2c', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-01b3-08dcda531ef9', '2340', 'Provisions for direct taxes', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, 'ec860000-5dd4-0015-04a4-08dcda531ef9', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:36:11.654464+00', 'ec860000-5dd4-0015-b543-08dcda531ef8', '2024-09-21 15:36:11.654464+00', 'ec860000-5dd4-0015-b543-08dcda531ef8', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-b414-08dcda532935', '2341', 'Provisions for indirect taxes', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, 'ec860000-5dd4-0015-b722-08dcda532935', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:36:28.829466+00', 'ec860000-5dd4-0015-7e9c-08dcda532935', '2024-09-21 15:36:28.829466+00', 'ec860000-5dd4-0015-7e9c-08dcda532935', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('dc610000-5dd4-0015-07cd-08dcda5647e1', '2400', 'Long-term bank liabilities', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, 'dc610000-5dd4-0015-1264-08dcda5647e8', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:58:48.819721+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', '2024-09-21 15:58:48.819721+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('dc610000-5dd4-0015-3646-08dcda5647ed', '2420', 'Liabilities from lease transactions', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, 'dc610000-5dd4-0015-7f38-08dcda5647ed', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:58:48.855676+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', '2024-09-21 15:58:48.855676+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('dc610000-5dd4-0015-15f0-08dcda5647ee', '2440', 'Mortgages on operating buildings', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, 'dc610000-5dd4-0015-1a65-08dcda5647ee', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:58:48.859705+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', '2024-09-21 15:58:48.859705+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('dc610000-5dd4-0015-c1ff-08dcda5647ee', '2500', 'Long-term loans from third parties', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, 'dc610000-5dd4-0015-c778-08dcda5647ee', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:58:48.864136+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', '2024-09-21 15:58:48.864136+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('dc610000-5dd4-0015-41c7-08dcda5647ef', '2560', 'Long-term loans to shareholders', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, 'dc610000-5dd4-0015-4659-08dcda5647ef', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:58:48.867383+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', '2024-09-21 15:58:48.867383+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('dc610000-5dd4-0015-c36a-08dcda5647ef', '2570', 'Long-term loans to pension funds', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, 'dc610000-5dd4-0015-ca17-08dcda5647ef', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:58:48.870751+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', '2024-09-21 15:58:48.870751+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('dc610000-5dd4-0015-46c8-08dcda5647f0', '2600', 'Provision for repairs', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, 'dc610000-5dd4-0015-4c69-08dcda5647f0', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:58:48.87409+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', '2024-09-21 15:58:48.87409+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('dc610000-5dd4-0015-ee99-08dcda5647f0', '2601', 'Provision for renovations', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, 'dc610000-5dd4-0015-f646-08dcda5647f0', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:58:48.878441+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', '2024-09-21 15:58:48.878441+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('dc610000-5dd4-0015-724d-08dcda5647f1', '2602', 'Provision for refurbishments', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, 'dc610000-5dd4-0015-7965-08dcda5647f1', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:58:48.881798+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', '2024-09-21 15:58:48.881798+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('dc610000-5dd4-0015-0363-08dcda5647f2', '2630', 'Provisions for warranty work', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, 'dc610000-5dd4-0015-0adf-08dcda5647f2', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:58:48.885515+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', '2024-09-21 15:58:48.885515+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('dc610000-5dd4-0015-83b1-08dcda5647f2', '2800', 'Equity', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, 'dc610000-5dd4-0015-8a8d-08dcda5647f2', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:58:48.888787+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', '2024-09-21 15:58:48.888787+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('dc610000-5dd4-0015-39bb-08dcda5647f3', '2801', 'Spouse''s equity', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, 'dc610000-5dd4-0015-430c-08dcda5647f3', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:58:48.893469+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', '2024-09-21 15:58:48.893469+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('dc610000-5dd4-0015-bbae-08dcda5647f3', '2810', 'Partner A''s capital account', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, 'dc610000-5dd4-0015-d5a8-08dcda5647f3', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:58:48.897265+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', '2024-09-21 15:58:48.897265+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('dc610000-5dd4-0015-5509-08dcda5647f4', '2811', 'Partner B''s capital account', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, 'dc610000-5dd4-0015-5da7-08dcda5647f4', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:58:48.900745+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', '2024-09-21 15:58:48.900745+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('dc610000-5dd4-0015-dac6-08dcda5647f4', '2812', 'Commandite partner C''s capital account', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, 'dc610000-5dd4-0015-e3fa-08dcda5647f4', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:58:48.904186+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', '2024-09-21 15:58:48.904186+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('dc610000-5dd4-0015-8943-08dcda5647f5', '2820', 'Share capital of the LLC', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, 'dc610000-5dd4-0015-921d-08dcda5647f5', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:58:48.908642+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', '2024-09-21 15:58:48.908642+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('dc610000-5dd4-0015-0ffd-08dcda5647f6', '2840', 'Share capital', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, 'dc610000-5dd4-0015-19d0-08dcda5647f6', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:58:48.912116+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', '2024-09-21 15:58:48.912116+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('dc610000-5dd4-0015-95c3-08dcda5647f6', '2841', 'Participation capital', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, 'dc610000-5dd4-0015-9fba-08dcda5647f6', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:58:48.915542+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', '2024-09-21 15:58:48.915542+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('dc610000-5dd4-0015-1c3a-08dcda5647f7', '2850', 'Private cash withdrawals', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, 'dc610000-5dd4-0015-2641-08dcda5647f7', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:58:48.91899+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', '2024-09-21 15:58:48.91899+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('dc610000-5dd4-0015-c85d-08dcda5647f7', '2851', 'Private in-kind withdrawals', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, 'dc610000-5dd4-0015-d2f0-08dcda5647f7', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:58:48.92341+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', '2024-09-21 15:58:48.92341+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('dc610000-5dd4-0015-573b-08dcda5647f8', '2852', 'Private contributions to operating expenses', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, 'dc610000-5dd4-0015-62ae-08dcda5647f8', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:58:48.92709+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', '2024-09-21 15:58:48.92709+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('dc610000-5dd4-0015-da37-08dcda5647f8', '2853', 'Rental value of private apartment', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, 'dc610000-5dd4-0015-e55d-08dcda5647f8', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:58:48.930435+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', '2024-09-21 15:58:48.930435+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('dc610000-5dd4-0015-65d5-08dcda5647f9', '2854', 'Private insurance premiums', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, 'dc610000-5dd4-0015-71a2-08dcda5647f9', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:58:48.934025+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', '2024-09-21 15:58:48.934025+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('dc610000-5dd4-0015-1dfa-08dcda5647fa', '2855', 'Private pension contributions', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, 'dc610000-5dd4-0015-2a34-08dcda5647fa', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:58:48.938751+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', '2024-09-21 15:58:48.938751+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('dc610000-5dd4-0015-a720-08dcda5647fa', '2856', 'Private taxes', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, 'dc610000-5dd4-0015-b33d-08dcda5647fa', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:58:48.942259+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', '2024-09-21 15:58:48.942259+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('dc610000-5dd4-0015-3f48-08dcda5647fb', '2880', 'Private property A', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, 'dc610000-5dd4-0015-51a4-08dcda5647fb', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:58:48.94631+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', '2024-09-21 15:58:48.94631+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('dc610000-5dd4-0015-cdb5-08dcda5647fb', '2900', 'General reserve', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, 'dc610000-5dd4-0015-db04-08dcda5647fb', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:58:48.949826+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', '2024-09-21 15:58:48.949826+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('dc610000-5dd4-0015-7a6c-08dcda5647fc', '2901', 'Reserve for treasury shares', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, 'dc610000-5dd4-0015-87e2-08dcda5647fc', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:58:48.954256+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', '2024-09-21 15:58:48.954256+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('dc610000-5dd4-0015-0677-08dcda5647fd', '2903', 'Revaluation reserve', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, 'dc610000-5dd4-0015-145f-08dcda5647fd', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:58:48.957853+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', '2024-09-21 15:58:48.957853+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('dc610000-5dd4-0015-905e-08dcda5647fd', '2910', 'Statutory reserves', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, 'dc610000-5dd4-0015-9eff-08dcda5647fd', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:58:48.961399+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', '2024-09-21 15:58:48.961399+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('dc610000-5dd4-0015-1791-08dcda5647fe', '2990', 'Brought-forward profit / Brought-forward loss', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, 'dc610000-5dd4-0015-25fe-08dcda5647fe', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:58:48.964857+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', '2024-09-21 15:58:48.964857+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('dc610000-5dd4-0015-fd1c-08dcda5647fe', '2991', 'Current-year profit / Current-year loss', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, 'dc610000-5dd4-0015-0e56-08dcda5647ff', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:58:48.970802+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', '2024-09-21 15:58:48.970802+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('4c6f0000-5dd4-0015-5b3c-08dcda56e416', '3211', 'Gross credit retail sales', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, '4c6f0000-5dd4-0015-81a7-08dcda56e41d', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:03:10.894504+00', '4c6f0000-5dd4-0015-fa99-08dcda56e411', '2024-09-21 16:03:10.894504+00', '4c6f0000-5dd4-0015-fa99-08dcda56e411', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('4c6f0000-5dd4-0015-7cad-08dcda56e423', '3212', 'Gross credit wholesale sales', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, '4c6f0000-5dd4-0015-bf07-08dcda56e423', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:03:10.935793+00', '4c6f0000-5dd4-0015-fa99-08dcda56e411', '2024-09-21 16:03:10.935793+00', '4c6f0000-5dd4-0015-fa99-08dcda56e411', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('4c6f0000-5dd4-0015-5a60-08dcda56e424', '3220', 'Gross sales at standard VAT rate (8.00% net VAT)', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, '4c6f0000-5dd4-0015-5ee0-08dcda56e424', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:03:10.939922+00', '4c6f0000-5dd4-0015-fa99-08dcda56e411', '2024-09-21 16:03:10.939922+00', '4c6f0000-5dd4-0015-fa99-08dcda56e411', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('4c6f0000-5dd4-0015-db2b-08dcda56e424', '3221', 'Gross sales at reduced VAT rate (2.50% net VAT)', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, '4c6f0000-5dd4-0015-dfcf-08dcda56e424', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:03:10.943223+00', '4c6f0000-5dd4-0015-fa99-08dcda56e411', '2024-09-21 16:03:10.943223+00', '4c6f0000-5dd4-0015-fa99-08dcda56e411', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('4c6f0000-5dd4-0015-ad5b-08dcda56e425', '3222', 'Gross sales at zero VAT rate (0.00% net VAT)', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, '4c6f0000-5dd4-0015-b1bd-08dcda56e425', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:03:10.948597+00', '4c6f0000-5dd4-0015-fa99-08dcda56e411', '2024-09-21 16:03:10.948597+00', '4c6f0000-5dd4-0015-fa99-08dcda56e411', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('4c6f0000-5dd4-0015-5998-08dcda56e426', '3300', 'Other directly incorporable materials', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, '4c6f0000-5dd4-0015-614e-08dcda56e426', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:03:10.953087+00', '4c6f0000-5dd4-0015-fa99-08dcda56e411', '2024-09-21 16:03:10.953087+00', '4c6f0000-5dd4-0015-fa99-08dcda56e411', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('4c6f0000-5dd4-0015-e459-08dcda56e426', '3720', 'Internal consumption', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, '4c6f0000-5dd4-0015-e998-08dcda56e426', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:03:10.956581+00', '4c6f0000-5dd4-0015-fa99-08dcda56e411', '2024-09-21 16:03:10.956581+00', '4c6f0000-5dd4-0015-fa99-08dcda56e411', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('4c6f0000-5dd4-0015-63be-08dcda56e427', '3900', 'Discounts', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, '4c6f0000-5dd4-0015-6abe-08dcda56e427', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:03:10.959882+00', '4c6f0000-5dd4-0015-fa99-08dcda56e411', '2024-09-21 16:03:10.959882+00', '4c6f0000-5dd4-0015-fa99-08dcda56e411', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('4c6f0000-5dd4-0015-0dad-08dcda56e428', '3901', 'Price rebates', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, '4c6f0000-5dd4-0015-148f-08dcda56e428', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:03:10.964228+00', '4c6f0000-5dd4-0015-fa99-08dcda56e411', '2024-09-21 16:03:10.964228+00', '4c6f0000-5dd4-0015-fa99-08dcda56e411', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-4a86-08dcda58ab6a', '4292', 'Refunds', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, 'b0650000-5dd4-0015-e575-08dcda6a7f80', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.761651+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 18:23:32.031006+00', 'b0650000-5dd4-0015-7887-08dcda6a7f80', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('4c6f0000-5dd4-0015-7bf9-08dcda56e429', '3903', 'Third-party commissions', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, '4c6f0000-5dd4-0015-8393-08dcda56e429', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:03:10.973629+00', '4c6f0000-5dd4-0015-fa99-08dcda56e411', '2024-09-21 16:03:10.973629+00', '4c6f0000-5dd4-0015-fa99-08dcda56e411', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('4c6f0000-5dd4-0015-0683-08dcda56e42a', '3904', 'Collection fees', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, '4c6f0000-5dd4-0015-0e72-08dcda56e42a', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:03:10.977178+00', '4c6f0000-5dd4-0015-fa99-08dcda56e411', '2024-09-21 16:03:10.977178+00', '4c6f0000-5dd4-0015-fa99-08dcda56e411', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('4c6f0000-5dd4-0015-ac69-08dcda56e42a', '3905', 'Customer losses', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, '4c6f0000-5dd4-0015-b4e7-08dcda56e42a', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:03:10.981442+00', '4c6f0000-5dd4-0015-fa99-08dcda56e411', '2024-09-21 16:03:10.981442+00', '4c6f0000-5dd4-0015-fa99-08dcda56e411', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('4c6f0000-5dd4-0015-3498-08dcda56e42b', '3906', 'Foreign exchange differences', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, '4c6f0000-5dd4-0015-3cf3-08dcda56e42b', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:03:10.984928+00', '4c6f0000-5dd4-0015-fa99-08dcda56e411', '2024-09-21 16:03:10.984928+00', '4c6f0000-5dd4-0015-fa99-08dcda56e411', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('4c6f0000-5dd4-0015-f5b3-08dcda56e42b', '3907', 'Freight and carriage', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, '4c6f0000-5dd4-0015-fec1-08dcda56e42b', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:03:10.989887+00', '4c6f0000-5dd4-0015-fa99-08dcda56e411', '2024-09-21 16:03:10.989887+00', '4c6f0000-5dd4-0015-fa99-08dcda56e411', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('4c6f0000-5dd4-0015-b18f-08dcda56e42c', '3210', 'Gross cash sales', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, '4c6f0000-5dd4-0015-bac3-08dcda56e42c', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:03:10.994702+00', '4c6f0000-5dd4-0015-fa99-08dcda56e411', '2024-09-21 16:03:10.994702+00', '4c6f0000-5dd4-0015-fa99-08dcda56e411', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-ab3e-08dcda58ab55', '4208', 'Inventory adjustments', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, '60520000-5dd4-0015-64c7-08dcda58ab5d', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.676511+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.676511+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-6395-08dcda58ab63', '4209', 'Deductions obtained on purchases', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, '60520000-5dd4-0015-a651-08dcda58ab63', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.717924+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.717924+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-5c21-08dcda58ab64', '4210', 'Purchases of goods at standard VAT rate (8.00% net VAT)', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, '60520000-5dd4-0015-60fe-08dcda58ab64', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.722735+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.722735+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-e55a-08dcda58ab64', '4211', 'Purchases of goods at reduced VAT rate (2.50% net VAT)', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, '60520000-5dd4-0015-e987-08dcda58ab64', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.726231+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.726231+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-988a-08dcda58ab65', '4212', 'Purchases of goods at zero VAT rate (0.00% net VAT)', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, '60520000-5dd4-0015-9d88-08dcda58ab65', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.730838+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.730838+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-3197-08dcda58ab66', '4215', 'Purchase of packaging materials', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, '60520000-5dd4-0015-3a85-08dcda58ab66', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.734856+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.734856+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-700a-08dcda58ab67', '4270', 'Purchase freight', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, '60520000-5dd4-0015-763f-08dcda58ab67', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.742938+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.742938+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-f70d-08dcda58ab67', '4271', 'Import customs duties', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, '60520000-5dd4-0015-fd6a-08dcda58ab67', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.7464+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.7464+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-8547-08dcda58ab68', '4272', 'Purchase transportation costs', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, '60520000-5dd4-0015-8b6e-08dcda58ab68', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.750035+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.750035+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-0b7c-08dcda58ab69', '4290', 'Discounts', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, '60520000-5dd4-0015-1190-08dcda58ab69', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.753469+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.753469+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-c1b6-08dcda58ab69', '4291', 'Price rebates', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, '60520000-5dd4-0015-c8b6-08dcda58ab69', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.758155+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.758155+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-e6d2-08dcda58ab6a', '4293', 'Rebates obtained on purchases', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, '60520000-5dd4-0015-ede7-08dcda58ab6a', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.765661+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.765661+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-7563-08dcda58ab6b', '4296', 'Foreign exchange differences', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, '60520000-5dd4-0015-7d56-08dcda58ab6b', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.769335+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.769335+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-2576-08dcda58ab6c', '5200', 'Salaries', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, '60520000-5dd4-0015-2c86-08dcda58ab6c', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.77382+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.77382+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-b332-08dcda58ab6c', '5205', 'Social security benefits', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, '60520000-5dd4-0015-bb48-08dcda58ab6c', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.777472+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.777472+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-374c-08dcda58ab6d', '5270', 'Old-age and survivors'' insurance, disability insurance, income replacement', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, '60520000-5dd4-0015-3f61-08dcda58ab6d', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.780856+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.780856+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-c742-08dcda58ab6d', '5271', 'Family allowance fund', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, '60520000-5dd4-0015-d07e-08dcda58ab6d', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.784569+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.784569+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-7504-08dcda58ab6e', '5272', 'Occupational pension plan', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, '60520000-5dd4-0015-7e69-08dcda58ab6e', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.789023+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.789023+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-fb87-08dcda58ab6e', '5273', 'Accident insurance', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, '60520000-5dd4-0015-04f4-08dcda58ab6f', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.792468+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.792468+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-81b9-08dcda58ab6f', '5274', 'Sickness benefits insurance', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, '60520000-5dd4-0015-8b2c-08dcda58ab6f', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.795904+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.795904+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-1b0b-08dcda58ab70', '5279', 'Withholding taxes', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, '60520000-5dd4-0015-25a2-08dcda58ab70', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.799857+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.799857+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-cc5b-08dcda58ab70', '5280', 'Personnel recruitment', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, '60520000-5dd4-0015-d72a-08dcda58ab70', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.804399+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.804399+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-5921-08dcda58ab71', '5281', 'Training and continuing education', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, '60520000-5dd4-0015-63ad-08dcda58ab71', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.807999+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.807999+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-e852-08dcda58ab71', '5282', 'Actual expense reimbursements', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, '60520000-5dd4-0015-f392-08dcda58ab71', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.811683+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.811683+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-7d83-08dcda58ab72', '5283', 'Flat-rate expense allowances', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, '60520000-5dd4-0015-898e-08dcda58ab72', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.815522+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.815522+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-2e91-08dcda58ab73', '5289', 'Other personnel expenses', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, '60520000-5dd4-0015-3c7d-08dcda58ab73', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.820056+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.820056+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-bd6a-08dcda58ab73', '5290', 'Temporary employees', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, '60520000-5dd4-0015-c8cf-08dcda58ab73', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.823695+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.823695+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-555c-08dcda58ab74', '6000', 'Rent', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, '60520000-5dd4-0015-6281-08dcda58ab74', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.827627+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.827627+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-ea28-08dcda58ab74', '6030', 'Accessory charges', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, '60520000-5dd4-0015-f797-08dcda58ab74', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.831444+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.831444+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-a2d7-08dcda58ab75', '6040', 'Cleaning', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, '60520000-5dd4-0015-afc8-08dcda58ab75', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.836161+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.836161+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-3667-08dcda58ab76', '6050', 'Maintenance', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, '60520000-5dd4-0015-4398-08dcda58ab76', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.839945+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.839945+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-c6a2-08dcda58ab76', '6090', 'Premises charges as private withdrawals', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, '60520000-5dd4-0015-d8af-08dcda58ab76', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.84376+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.84376+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-627b-08dcda58ab77', '6100', 'Maintenance, repair, or replacement of machinery', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, '60520000-5dd4-0015-7037-08dcda58ab77', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.847639+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.847639+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-1874-08dcda58ab78', '6102', 'Maintenance, repair, or replacement of tools and equipment', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, '60520000-5dd4-0015-27de-08dcda58ab78', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.852342+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.852342+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-b07e-08dcda58ab78', '6130', 'Maintenance, repair, or replacement of office furniture', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, '60520000-5dd4-0015-bdeb-08dcda58ab78', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.856184+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.856184+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-4078-08dcda58ab79', '6131', 'Maintenance, repair, or replacement of office machines', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, '60520000-5dd4-0015-4e76-08dcda58ab79', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.859884+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.859884+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-cdcd-08dcda58ab79', '6200', 'Repair, service, and cleaning', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, '60520000-5dd4-0015-dc1c-08dcda58ab79', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.86351+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.86351+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-7f75-08dcda58ab7a', '6210', 'Fuel', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, '60520000-5dd4-0015-8de1-08dcda58ab7a', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.868059+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.868059+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-1137-08dcda58ab7b', '6220', 'Insurance and taxes', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, '60520000-5dd4-0015-1f7c-08dcda58ab7b', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.871787+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.871787+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-a49f-08dcda58ab7b', '6260', 'Lease charges for vehicles', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, '60520000-5dd4-0015-96c3-08dcda58ab7c', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.88139+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.88139+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-260f-08dcda58ab7d', '6270', 'Vehicle charges as private withdrawals', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, '60520000-5dd4-0015-3458-08dcda58ab7d', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.885429+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.885429+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-d524-08dcda58ab7d', '6300', 'Property damage insurance', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, '60520000-5dd4-0015-e322-08dcda58ab7d', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.889902+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.889902+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-61c0-08dcda58ab7e', '6310', 'Liability insurance', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, '60520000-5dd4-0015-74df-08dcda58ab7e', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.893625+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.893625+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-ff88-08dcda58ab7e', '6330', 'Life insurance premiums', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, '60520000-5dd4-0015-0ee0-08dcda58ab7f', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.897573+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.897573+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-979f-08dcda58ab7f', '6331', 'Surety bond premiums', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, '60520000-5dd4-0015-a81e-08dcda58ab7f', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.901497+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.901497+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-4d51-08dcda58ab80', '6360', 'Duties', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, '60520000-5dd4-0015-5d61-08dcda58ab80', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.906138+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.906138+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-e36e-08dcda58ab80', '6361', 'Taxes', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, '60520000-5dd4-0015-f3c4-08dcda58ab80', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.909987+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.909987+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-7221-08dcda58ab81', '6370', 'Permits', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, '60520000-5dd4-0015-8272-08dcda58ab81', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.913642+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.913642+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-0165-08dcda58ab82', '6371', 'Licenses', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, '60520000-5dd4-0015-1251-08dcda58ab82', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.917322+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.917322+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-b139-08dcda58ab82', '6400', 'Power', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, '60520000-5dd4-0015-c4bf-08dcda58ab82', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.921892+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.921892+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-5258-08dcda58ab83', '6420', 'Fuel oil', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, '60520000-5dd4-0015-62a0-08dcda58ab83', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.925934+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.925934+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-dbbf-08dcda58ab83', '6430', 'Water', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, '60520000-5dd4-0015-ee2d-08dcda58ab83', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.929505+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.929505+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-6bc2-08dcda58ab84', '6460', 'Waste disposal', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, '60520000-5dd4-0015-7d8d-08dcda58ab84', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.933175+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.933175+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-2f77-08dcda58ab85', '6462', 'Wastewater', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, '60520000-5dd4-0015-4245-08dcda58ab85', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.938208+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.938208+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-c3ce-08dcda58ab85', '6500', 'Office supplies', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, '60520000-5dd4-0015-d563-08dcda58ab85', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.941978+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.941978+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-5394-08dcda58ab86', '6501', 'Printed materials', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, '60520000-5dd4-0015-6602-08dcda58ab86', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.94568+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.94568+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-dccc-08dcda58ab86', '6502', 'Photocopies', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, '60520000-5dd4-0015-f0fa-08dcda58ab86', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.949234+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.949234+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-a4c4-08dcda58ab87', '6503', 'Technical literature', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, '60520000-5dd4-0015-b723-08dcda58ab87', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.954308+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.954308+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-41ee-08dcda58ab88', '6510', 'Telephone', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, '60520000-5dd4-0015-55a7-08dcda58ab88', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.958366+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.958366+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-cdf4-08dcda58ab88', '6511', 'Fax', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, '60520000-5dd4-0015-e0ed-08dcda58ab88', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.961933+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.961933+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-5f4c-08dcda58ab89', '6512', 'Internet', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, '60520000-5dd4-0015-7205-08dcda58ab89', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.965645+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.965645+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-2459-08dcda58ab8a', '6513', 'Postage charges', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, '60520000-5dd4-0015-424e-08dcda58ab8a', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.970971+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.970971+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-c4e8-08dcda58ab8a', '6520', 'Contributions', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, '60520000-5dd4-0015-d8c2-08dcda58ab8a', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.974829+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.974829+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-58c1-08dcda58ab8b', '6521', 'Donations and gifts', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, '60520000-5dd4-0015-6ca3-08dcda58ab8b', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.978617+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.978617+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-ea58-08dcda58ab8b', '6522', 'Tips', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, '60520000-5dd4-0015-fe3d-08dcda58ab8b', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.982344+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.982344+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-aab8-08dcda58ab8c', '6530', 'Fiduciary fees', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, '60520000-5dd4-0015-bf8f-08dcda58ab8c', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.987293+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.987293+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-3ce8-08dcda58ab8d', '6531', 'Consulting fees', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, '60520000-5dd4-0015-5677-08dcda58ab8d', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.991156+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.991156+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-de62-08dcda58ab8d', '6532', 'Legal consulting fees', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, '60520000-5dd4-0015-f256-08dcda58ab8d', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.995144+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.995144+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-6d70-08dcda58ab8e', '6540', 'Board of directors fees', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, '60520000-5dd4-0015-8e09-08dcda58ab8e', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.999132+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.999132+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-3e66-08dcda58ab8f', '6541', 'General assembly fees', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, '60520000-5dd4-0015-5722-08dcda58ab8f', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.004281+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.004281+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-dd01-08dcda58ab8f', '6542', 'Auditing fees', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, '60520000-5dd4-0015-f232-08dcda58ab8f', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.008249+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.008249+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-6f55-08dcda58ab90', '6550', 'Administrative charges as private withdrawals', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, '60520000-5dd4-0015-87d2-08dcda58ab90', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.012079+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.012079+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-fdc8-08dcda58ab90', '6560', 'Lease of equipment', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, '60520000-5dd4-0015-128f-08dcda58ab91', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.015632+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.015632+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-b7ee-08dcda58ab91', '6561', 'Lease of software', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, '60520000-5dd4-0015-cdce-08dcda58ab91', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.020424+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.020424+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-4a73-08dcda58ab92', '6562', 'Lease of equipment', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, '60520000-5dd4-0015-60d8-08dcda58ab92', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.024191+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.024191+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-de50-08dcda58ab92', '6570', 'License/update charges', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, '60520000-5dd4-0015-f421-08dcda58ab92', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.02796+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.02796+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-26d9-08dcda58ab94', '6575', 'Network charges', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, '60520000-5dd4-0015-3e53-08dcda58ab94', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.036414+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.036414+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-b938-08dcda58ab94', '6600', 'Newspaper advertising', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, '60520000-5dd4-0015-d269-08dcda58ab94', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.040205+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.040205+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-52a3-08dcda58ab95', '6610', 'Advertising materials, advertising equipment', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, '60520000-5dd4-0015-6975-08dcda58ab95', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.044072+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.044072+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-f145-08dcda58ab95', '6611', 'Advertising items, samples', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, '60520000-5dd4-0015-0d48-08dcda58ab96', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.048259+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.048259+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-b380-08dcda58ab96', '6620', 'Window displays, decorations', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, '60520000-5dd4-0015-cb0a-08dcda58ab96', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.053117+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.053117+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-4c9e-08dcda58ab97', '6621', 'Fairs, exhibitions', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, '60520000-5dd4-0015-63fe-08dcda58ab97', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.057037+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.057037+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-dde2-08dcda58ab97', '6640', 'Travel expenses', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, '60520000-5dd4-0015-f9a5-08dcda58ab97', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.060867+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.060867+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-808f-08dcda58ab98', '6641', 'Customer advisory services', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, '60520000-5dd4-0015-9a60-08dcda58ab98', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.064982+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.064982+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-43cc-08dcda58ab99', '6642', 'Customer gifts', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, '60520000-5dd4-0015-5bbe-08dcda58ab99', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.069933+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.069933+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-d8d2-08dcda58ab99', '6700', 'Economic information', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, '60520000-5dd4-0015-f157-08dcda58ab99', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.073762+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.073762+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-7006-08dcda58ab9a', '6701', 'Legal proceedings', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, '60520000-5dd4-0015-89b7-08dcda58ab9a', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.077663+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.077663+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-0725-08dcda58ab9b', '6710', 'Security', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, '60520000-5dd4-0015-33ee-08dcda58ab9b', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.081962+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.081962+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-dcea-08dcda58ab9b', '6711', 'Surveillance', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, '60520000-5dd4-0015-f7b6-08dcda58ab9b', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.087032+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.087032+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-7a0f-08dcda58ab9c', '6800', 'Bank loan interest', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, '60520000-5dd4-0015-95e0-08dcda58ab9c', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.09108+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.09108+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-0ffa-08dcda58ab9d', '6801', 'Loan interest', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, '60520000-5dd4-0015-2a2f-08dcda58ab9d', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.094878+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.094878+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-b01e-08dcda58ab9d', '6802', 'Mortgage loan interest', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, '60520000-5dd4-0015-cb3c-08dcda58ab9d', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.098994+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.098994+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-8132-08dcda58ab9e', '6803', 'Default interest', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, '60520000-5dd4-0015-9bd2-08dcda58ab9e', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.104339+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.104339+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-1bb1-08dcda58ab9f', '6804', 'Financial charges for customer advances', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, '60520000-5dd4-0015-3854-08dcda58ab9f', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.108345+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.108345+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-beae-08dcda58ab9f', '6820', 'Financial charges for shareholder A''s current account', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, '60520000-5dd4-0015-d9e7-08dcda58ab9f', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.112485+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.112485+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-5b4f-08dcda58aba0', '6830', 'Financial charges for pension fund financing', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, '60520000-5dd4-0015-7ab1-08dcda58aba0', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.116597+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.116597+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-22c9-08dcda58aba1', '6840', 'Bank and postal charges', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, '60520000-5dd4-0015-3df0-08dcda58aba1', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.121597+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.121597+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-c552-08dcda58aba1', '6841', 'Deposit charges', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, '60520000-5dd4-0015-e0d6-08dcda58aba1', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.125769+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.125769+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-61dd-08dcda58aba2', '6842', 'Exchange losses on cash and securities', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, '60520000-5dd4-0015-8538-08dcda58aba2', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.129972+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.129972+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-44aa-08dcda58aba7', '6920', 'Depreciation on machinery and tools', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, '60520000-5dd4-0015-6181-08dcda58aba7', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.161831+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.161831+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-ea38-08dcda58aba7', '6921', 'Depreciation on furniture and installations', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, '60520000-5dd4-0015-07ee-08dcda58aba8', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.16609+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.16609+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-0c8d-08dcda58aba3', '6850', 'Financial income from postal and bank assets', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, '34980000-5dd4-0015-760f-08dcdaf3f47f', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.134164+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-22 10:47:29.366946+00', '34980000-5dd4-0015-0e4b-08dcdaf3f479', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-d9f9-08dcda58aba3', '6851', 'Financial income from short-term assets', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, '34980000-5dd4-0015-2f7f-08dcdaf3f740', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.139456+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-22 10:47:33.985468+00', '34980000-5dd4-0015-bf6f-08dcdaf3f73f', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-7b17-08dcda58aba4', '6880', 'Financial income from shareholder X''s current account', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, '34980000-5dd4-0015-3102-08dcdaf3fc7a', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.143993+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-22 10:47:42.754224+00', '34980000-5dd4-0015-c67f-08dcdaf3fc79', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-2ddf-08dcda58aba5', '6890', 'Financial income from default interest, discounts', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, '34980000-5dd4-0015-2e2e-08dcdaf402da', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.148128+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-22 10:47:53.449627+00', '34980000-5dd4-0015-ce34-08dcdaf402d9', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-d5a4-08dcda58aba5', '6891', 'Financial income from advances received', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, '34980000-5dd4-0015-6b59-08dcdaf40601', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.152489+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-22 10:47:58.739948+00', '34980000-5dd4-0015-0b81-08dcdaf40601', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-9a10-08dcda58aba6', '6892', 'Foreign exchange gains on cash and securities', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, '34980000-5dd4-0015-5e06-08dcdaf408c8', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.157455+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-22 10:48:03.399216+00', '34980000-5dd4-0015-06dd-08dcdaf408c8', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-8cf0-08dcda58aba8', '6922', 'Depreciation on office, IT equipment', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, '60520000-5dd4-0015-ab8b-08dcda58aba8', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.170279+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.170279+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-63f6-08dcda58aba9', '6923', 'Depreciation on vehicles', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, '60520000-5dd4-0015-8281-08dcda58aba9', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.175781+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.175781+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-073b-08dcda58abaa', '6930', 'Depreciation on operating buildings', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, '60520000-5dd4-0015-2580-08dcda58abaa', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.179954+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.179954+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-ae47-08dcda58abaa', '6950', 'Depreciation on incorporation costs', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, '60520000-5dd4-0015-cca4-08dcda58abaa', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.184233+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.184233+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-5961-08dcda58abab', '4200', 'Purchases of goods', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, '60520000-5dd4-0015-7863-08dcda58abab', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.188628+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.188628+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-6d55-08dcda592ca8', '7910', 'Gains on sale of operating equipment', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, '60520000-5dd4-0015-7eb0-08dcda592ca8', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:19:31.595227+00', '60520000-5dd4-0015-d3a0-08dcda592c9f', '2024-09-21 16:19:31.595227+00', '60520000-5dd4-0015-d3a0-08dcda592c9f', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('c4170000-5dd4-0015-c93b-08dcda5963b6', '8002', 'Accounting revaluations', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, 'c4170000-5dd4-0015-1b5b-08dcda5963be', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:21:04.011097+00', 'c4170000-5dd4-0015-4cd0-08dcda5963b2', '2024-09-21 16:21:04.011097+00', 'c4170000-5dd4-0015-4cd0-08dcda5963b2', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('c4170000-5dd4-0015-f081-08dcda5963c3', '8004', 'Exceptional gains on disposal of fixed assets', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, 'c4170000-5dd4-0015-3937-08dcda5963c4', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:21:04.051604+00', 'c4170000-5dd4-0015-4cd0-08dcda5963b2', '2024-09-21 16:21:04.051604+00', 'c4170000-5dd4-0015-4cd0-08dcda5963b2', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('c4170000-5dd4-0015-e540-08dcda5963c4', '8005', 'Grants received', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, 'c4170000-5dd4-0015-e9d3-08dcda5963c4', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:21:04.056157+00', 'c4170000-5dd4-0015-4cd0-08dcda5963b2', '2024-09-21 16:21:04.056157+00', 'c4170000-5dd4-0015-4cd0-08dcda5963b2', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('c4170000-5dd4-0015-7b3c-08dcda5963c5', '8006', 'Income from compensation for damages', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, 'c4170000-5dd4-0015-80d4-08dcda5963c5', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:21:04.060017+00', 'c4170000-5dd4-0015-4cd0-08dcda5963b2', '2024-09-21 16:21:04.060017+00', 'c4170000-5dd4-0015-4cd0-08dcda5963b2', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('c4170000-5dd4-0015-3c95-08dcda5963c6', '8500', 'Rental income from premises', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, 'c4170000-5dd4-0015-43a9-08dcda5963c6', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:21:04.06501+00', 'c4170000-5dd4-0015-4cd0-08dcda5963b2', '2024-09-21 16:21:04.06501+00', 'c4170000-5dd4-0015-4cd0-08dcda5963b2', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('c4170000-5dd4-0015-ce36-08dcda5963c6', '8501', 'Rental income from apartments', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, 'c4170000-5dd4-0015-d659-08dcda5963c6', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:21:04.068765+00', 'c4170000-5dd4-0015-4cd0-08dcda5963b2', '2024-09-21 16:21:04.068765+00', 'c4170000-5dd4-0015-4cd0-08dcda5963b2', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('c4170000-5dd4-0015-5b6f-08dcda5963c7', '8502', 'Rental income from garages', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, 'c4170000-5dd4-0015-612f-08dcda5963c7', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:21:04.07232+00', 'c4170000-5dd4-0015-4cd0-08dcda5963b2', '2024-09-21 16:21:04.07232+00', 'c4170000-5dd4-0015-4cd0-08dcda5963b2', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('c4170000-5dd4-0015-e270-08dcda5963c7', '8503', 'Internal rental income', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, 'c4170000-5dd4-0015-eaa4-08dcda5963c7', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:21:04.075832+00', 'c4170000-5dd4-0015-4cd0-08dcda5963b2', '2024-09-21 16:21:04.075832+00', 'c4170000-5dd4-0015-4cd0-08dcda5963b2', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('c4170000-5dd4-0015-a031-08dcda5963c8', '8700', 'Fees for expert opinions, conferences', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, 'c4170000-5dd4-0015-a87a-08dcda5963c8', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:21:04.080695+00', 'c4170000-5dd4-0015-4cd0-08dcda5963b2', '2024-09-21 16:21:04.080695+00', 'c4170000-5dd4-0015-4cd0-08dcda5963b2', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('c4170000-5dd4-0015-2ef5-08dcda5963c9', '8701', 'Attendance fees', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, 'c4170000-5dd4-0015-3ad1-08dcda5963c9', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:21:04.084443+00', 'c4170000-5dd4-0015-4cd0-08dcda5963b2', '2024-09-21 16:21:04.084443+00', 'c4170000-5dd4-0015-4cd0-08dcda5963b2', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('c4170000-5dd4-0015-c838-08dcda5963c9', '7920', 'Gains on sale of buildings', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, 'c4170000-5dd4-0015-d027-08dcda5963c9', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:21:04.088263+00', 'c4170000-5dd4-0015-4cd0-08dcda5963b2', '2024-09-21 16:21:04.088263+00', 'c4170000-5dd4-0015-4cd0-08dcda5963b2', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('a05e0000-5dd4-0015-19fc-08dcda59fa1b', '8012', 'Exceptional depreciation', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, 'a05e0000-5dd4-0015-389b-08dcda59fa22', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:25:16.325479+00', 'a05e0000-5dd4-0015-cfa3-08dcda59fa16', '2024-09-21 16:25:16.325479+00', 'a05e0000-5dd4-0015-cfa3-08dcda59fa16', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('a05e0000-5dd4-0015-f4ef-08dcda59fa27', '8014', 'Exceptional losses on disposal of fixed assets', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, 'a05e0000-5dd4-0015-3a9c-08dcda59fa28', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:25:16.365234+00', 'a05e0000-5dd4-0015-cfa3-08dcda59fa16', '2024-09-21 16:25:16.365234+00', 'a05e0000-5dd4-0015-cfa3-08dcda59fa16', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('a05e0000-5dd4-0015-da5d-08dcda59fa28', '8015', 'Exceptional losses on receivables', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, 'a05e0000-5dd4-0015-deda-08dcda59fa28', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:25:16.369476+00', 'a05e0000-5dd4-0015-cfa3-08dcda59fa16', '2024-09-21 16:25:16.369476+00', 'a05e0000-5dd4-0015-cfa3-08dcda59fa16', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('a05e0000-5dd4-0015-5cb3-08dcda59fa29', '8016', 'Expenses for compensation for damages', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, 'a05e0000-5dd4-0015-6165-08dcda59fa29', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:25:16.372819+00', 'a05e0000-5dd4-0015-cfa3-08dcda59fa16', '2024-09-21 16:25:16.372819+00', 'a05e0000-5dd4-0015-cfa3-08dcda59fa16', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('a05e0000-5dd4-0015-febe-08dcda59fa29', '8510', 'Mortgage interest', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, 'a05e0000-5dd4-0015-0397-08dcda59fa2a', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:25:16.37697+00', 'a05e0000-5dd4-0015-cfa3-08dcda59fa16', '2024-09-21 16:25:16.37697+00', 'a05e0000-5dd4-0015-cfa3-08dcda59fa16', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('a05e0000-5dd4-0015-8315-08dcda59fa2a', '8511', 'Building maintenance', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, 'a05e0000-5dd4-0015-8940-08dcda59fa2a', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:25:16.380393+00', 'a05e0000-5dd4-0015-cfa3-08dcda59fa16', '2024-09-21 16:25:16.380393+00', 'a05e0000-5dd4-0015-cfa3-08dcda59fa16', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('a05e0000-5dd4-0015-0e41-08dcda59fa2b', '8512', 'Property rights, taxes, land taxes', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, 'a05e0000-5dd4-0015-13ce-08dcda59fa2b', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:25:16.383935+00', 'a05e0000-5dd4-0015-cfa3-08dcda59fa16', '2024-09-21 16:25:16.383935+00', 'a05e0000-5dd4-0015-cfa3-08dcda59fa16', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('a05e0000-5dd4-0015-923c-08dcda59fa2b', '8513', 'Insurance premiums', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, 'a05e0000-5dd4-0015-9902-08dcda59fa2b', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:25:16.387349+00', 'a05e0000-5dd4-0015-cfa3-08dcda59fa16', '2024-09-21 16:25:16.387349+00', 'a05e0000-5dd4-0015-cfa3-08dcda59fa16', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('a05e0000-5dd4-0015-3db9-08dcda59fa2c', '8514', 'Water, wastewater', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, 'a05e0000-5dd4-0015-448c-08dcda59fa2c', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:25:16.39174+00', 'a05e0000-5dd4-0015-cfa3-08dcda59fa16', '2024-09-21 16:25:16.39174+00', 'a05e0000-5dd4-0015-cfa3-08dcda59fa16', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('a05e0000-5dd4-0015-c462-08dcda59fa2c', '8515', 'Waste disposal', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, 'a05e0000-5dd4-0015-cbf4-08dcda59fa2c', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:25:16.395207+00', 'a05e0000-5dd4-0015-cfa3-08dcda59fa16', '2024-09-21 16:25:16.395207+00', 'a05e0000-5dd4-0015-cfa3-08dcda59fa16', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('a05e0000-5dd4-0015-4669-08dcda59fa2d', '8516', 'Administrative charges', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, 'a05e0000-5dd4-0015-4e9d-08dcda59fa2d', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:25:16.39855+00', 'a05e0000-5dd4-0015-cfa3-08dcda59fa16', '2024-09-21 16:25:16.39855+00', 'a05e0000-5dd4-0015-cfa3-08dcda59fa16', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('a05e0000-5dd4-0015-d67a-08dcda59fa2d', '8710', 'Expenses for non-operating activities', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, 'a05e0000-5dd4-0015-de33-08dcda59fa2d', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:25:16.402226+00', 'a05e0000-5dd4-0015-cfa3-08dcda59fa16', '2024-09-21 16:25:16.402226+00', 'a05e0000-5dd4-0015-cfa3-08dcda59fa16', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('a05e0000-5dd4-0015-87a2-08dcda59fa2e', '8900', 'Corporate income tax', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, 'a05e0000-5dd4-0015-8fcc-08dcda59fa2e', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:25:16.406774+00', 'a05e0000-5dd4-0015-cfa3-08dcda59fa16', '2024-09-21 16:25:16.406774+00', 'a05e0000-5dd4-0015-cfa3-08dcda59fa16', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('a05e0000-5dd4-0015-09cd-08dcda59fa2f', '8901', 'Capital tax', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, 'a05e0000-5dd4-0015-11fe-08dcda59fa2f', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:25:16.410104+00', 'a05e0000-5dd4-0015-cfa3-08dcda59fa16', '2024-09-21 16:25:16.410104+00', 'a05e0000-5dd4-0015-cfa3-08dcda59fa16', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('a05e0000-5dd4-0015-8e15-08dcda59fa2f', '8902', 'Back taxes', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, 'a05e0000-5dd4-0015-9681-08dcda59fa2f', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:25:16.413499+00', 'a05e0000-5dd4-0015-cfa3-08dcda59fa16', '2024-09-21 16:25:16.413499+00', 'a05e0000-5dd4-0015-cfa3-08dcda59fa16', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('a05e0000-5dd4-0015-1f87-08dcda59fa30', '8011', 'Exceptional provisions', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, 'a05e0000-5dd4-0015-2921-08dcda59fa30', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:25:16.417246+00', 'a05e0000-5dd4-0015-cfa3-08dcda59fa16', '2024-09-21 16:25:16.417246+00', 'a05e0000-5dd4-0015-cfa3-08dcda59fa16', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('b0650000-5dd4-0015-41aa-08dcda5af51e', '9100', 'Opening balance sheet', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 4, 'b0650000-5dd4-0015-785d-08dcda5af525', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:32:17.45486+00', 'b0650000-5dd4-0015-d93b-08dcda5af519', '2024-09-21 16:32:17.45486+00', 'b0650000-5dd4-0015-d93b-08dcda5af519', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('b0650000-5dd4-0015-188e-08dcda5af52b', '9101', 'Closing balance sheet', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 4, 'b0650000-5dd4-0015-5935-08dcda5af52b', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:32:17.493803+00', 'b0650000-5dd4-0015-d93b-08dcda5af519', '2024-09-21 16:32:17.493803+00', 'b0650000-5dd4-0015-d93b-08dcda5af519', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('b0650000-5dd4-0015-fc14-08dcda5af52b', '9200', 'Share of profit for partner X', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 4, 'b0650000-5dd4-0015-007d-08dcda5af52c', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:32:17.49812+00', 'b0650000-5dd4-0015-d93b-08dcda5af519', '2024-09-21 16:32:17.49812+00', 'b0650000-5dd4-0015-d93b-08dcda5af519', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('b0650000-5dd4-0015-8079-08dcda5af52c', '9201', 'Share of profit for partner Y', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 4, 'b0650000-5dd4-0015-84ff-08dcda5af52c', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:32:17.501513+00', 'b0650000-5dd4-0015-d93b-08dcda5af519', '2024-09-21 16:32:17.501513+00', 'b0650000-5dd4-0015-d93b-08dcda5af519', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('b0650000-5dd4-0015-2435-08dcda5af52d', '9900', 'Grouping entries for debtors', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 4, 'b0650000-5dd4-0015-28c0-08dcda5af52d', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:32:17.505704+00', 'b0650000-5dd4-0015-d93b-08dcda5af519', '2024-09-21 16:32:17.505704+00', 'b0650000-5dd4-0015-d93b-08dcda5af519', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('b0650000-5dd4-0015-a67e-08dcda5af52d', '9901', 'Grouping entries for creditors', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 4, 'b0650000-5dd4-0015-ac60-08dcda5af52d', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:32:17.509074+00', 'b0650000-5dd4-0015-d93b-08dcda5af519', '2024-09-21 16:32:17.509074+00', 'b0650000-5dd4-0015-d93b-08dcda5af519', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('b0650000-5dd4-0015-6c05-08dcda5af52e', '9910', 'Correction entry', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 4, 'b0650000-5dd4-0015-716d-08dcda5af52e', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:32:17.514119+00', 'b0650000-5dd4-0015-d93b-08dcda5af519', '2024-09-21 16:32:17.514119+00', 'b0650000-5dd4-0015-d93b-08dcda5af519', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('b0650000-5dd4-0015-233a-08dcda5af52f', '9000', 'Income statement', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 4, 'b0650000-5dd4-0015-2aac-08dcda5af52f', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:32:17.518858+00', 'b0650000-5dd4-0015-d93b-08dcda5af519', '2024-09-21 16:32:17.518858+00', 'b0650000-5dd4-0015-d93b-08dcda5af519', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('4c6f0000-5dd4-0015-cbc6-08dcda56e428', '3902', 'Refunds', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, 'b0650000-5dd4-0015-575d-08dcda67d032', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:03:10.969133+00', '4c6f0000-5dd4-0015-fa99-08dcda56e411', '2024-09-21 18:04:18.92145+00', 'b0650000-5dd4-0015-868b-08dcda67d031', NULL); - +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('248e0000-5dd4-0015-e321-08dcd98b1434', '1020', 'Bank', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, true, '248e0000-5dd4-0015-f549-08dcd98b1434', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-20 15:44:14.246399+00', '248e0000-5dd4-0015-82b6-08dcd98b1434', '2024-09-20 15:44:14.246399+00', '248e0000-5dd4-0015-82b6-08dcd98b1434', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('248e0000-5dd4-0015-f110-08dcd98b20af', '1060', 'Securities', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, true, '248e0000-5dd4-0015-f77f-08dcd98b20af', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-20 15:44:35.185238+00', '248e0000-5dd4-0015-96cf-08dcd98b20af', '2024-09-20 15:44:35.185238+00', '248e0000-5dd4-0015-96cf-08dcd98b20af', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('248e0000-5dd4-0015-aa2d-08dcd98b2ad0', '1100', 'Trade accounts receivable', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, true, '248e0000-5dd4-0015-b397-08dcd98b2ad0', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-20 15:44:52.176984+00', '248e0000-5dd4-0015-6a71-08dcd98b2ad0', '2024-09-20 15:44:52.176984+00', '248e0000-5dd4-0015-6a71-08dcd98b2ad0', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('248e0000-5dd4-0015-12f9-08dcd98b3350', '1101', 'Credit card receivables', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, true, '248e0000-5dd4-0015-1822-08dcd98b3350', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-20 15:45:06.433634+00', '248e0000-5dd4-0015-c5b4-08dcd98b334f', '2024-09-20 15:45:06.433634+00', '248e0000-5dd4-0015-c5b4-08dcd98b334f', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('248e0000-5dd4-0015-8db2-08dcd98b3c4c', '1109', 'Provision for credit losses (Ducroire)', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, true, '248e0000-5dd4-0015-928a-08dcd98b3c4c', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-20 15:45:21.51005+00', '248e0000-5dd4-0015-4fa9-08dcd98b3c4c', '2024-09-20 15:45:21.51005+00', '248e0000-5dd4-0015-4fa9-08dcd98b3c4c', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('248e0000-5dd4-0015-48fb-08dcd98b4a28', '1140', 'Advances and loans granted', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, true, '248e0000-5dd4-0015-4df0-08dcd98b4a28', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-20 15:45:44.760468+00', '248e0000-5dd4-0015-0819-08dcd98b4a28', '2024-09-20 15:45:44.760468+00', '248e0000-5dd4-0015-0819-08dcd98b4a28', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('248e0000-5dd4-0015-13fe-08dcd98b6d70', '1176', 'Withholding tax recoverable', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, true, '248e0000-5dd4-0015-19ed-08dcd98b6d70', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-20 15:46:43.951252+00', '248e0000-5dd4-0015-d6be-08dcd98b6d6f', '2024-09-20 15:46:43.951252+00', '248e0000-5dd4-0015-d6be-08dcd98b6d6f', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('248e0000-5dd4-0015-fff6-08dcd98b746a', '1190', 'Other short-term receivables', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, true, '248e0000-5dd4-0015-04ac-08dcd98b746b', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-20 15:46:55.66199+00', '248e0000-5dd4-0015-b7ad-08dcd98b746a', '2024-09-20 15:46:55.66199+00', '248e0000-5dd4-0015-b7ad-08dcd98b746a', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('248e0000-5dd4-0015-ebad-08dcd98b0949', '1000', 'Case', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, true, '248e0000-5dd4-0015-a737-08dcd98bcb2b', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-20 15:43:55.975757+00', '248e0000-5dd4-0015-6140-08dcd98b0948', '2024-09-20 15:49:21.2085+00', '248e0000-5dd4-0015-9b0a-08dcd98bcb2a', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('78920000-5dd4-0015-3c01-08dcd9a7702b', '1400', 'Long-term securities', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, true, '78920000-5dd4-0015-18d4-08dcd9a7702e', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-20 19:07:14.460177+00', '78920000-5dd4-0015-4355-08dcd9a7702a', '2024-09-20 19:07:14.460177+00', '78920000-5dd4-0015-4355-08dcd9a7702a', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('78920000-5dd4-0015-eaeb-08dcd9a778d2', '1440', 'Long-term loans', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, true, '78920000-5dd4-0015-f445-08dcd9a778d2', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-20 19:07:28.962431+00', '78920000-5dd4-0015-9b32-08dcd9a778d2', '2024-09-20 19:07:28.962431+00', '78920000-5dd4-0015-9b32-08dcd9a778d2', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('78920000-5dd4-0015-6f96-08dcd9a78046', '1441', 'Mortgage loans', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, true, '78920000-5dd4-0015-7a90-08dcd9a78046', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-20 19:07:41.463613+00', '78920000-5dd4-0015-07eb-08dcd9a78046', '2024-09-20 19:07:41.463613+00', '78920000-5dd4-0015-07eb-08dcd9a78046', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('248e0000-5dd4-0015-443b-08dcd98b545d', '1170', 'VAT input tax (materials, services)', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, true, '78920000-5dd4-0015-983d-08dcd9a9beab', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-20 15:46:01.884919+00', '248e0000-5dd4-0015-fd7b-08dcd98b545c', '2024-09-20 19:23:45.138485+00', '78920000-5dd4-0015-b5e7-08dcd9a9beaa', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('248e0000-5dd4-0015-133a-08dcd98b5d1d', '1171', 'VAT input tax (investments and other charges)', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, true, '78920000-5dd4-0015-c8f5-08dcd9a9c7da', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-20 15:46:16.563738+00', '248e0000-5dd4-0015-d52d-08dcd98b5d1c', '2024-09-20 19:24:00.547247+00', '78920000-5dd4-0015-5fc5-08dcd9a9c7da', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('248e0000-5dd4-0015-c1ce-08dcd98b7c74', '1200', 'Inventory A', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, true, '78920000-5dd4-0015-f39f-08dcd9a9f93e', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-20 15:47:09.147723+00', '248e0000-5dd4-0015-8552-08dcd98b7c74', '2024-09-20 19:25:23.412058+00', '78920000-5dd4-0015-8587-08dcd9a9f93e', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('248e0000-5dd4-0015-2c01-08dcd98b8441', '1201', 'Inventory B', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, true, '78920000-5dd4-0015-2de6-08dcd9aa042a', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-20 15:47:22.2314+00', '248e0000-5dd4-0015-eccf-08dcd98b8440', '2024-09-20 19:25:41.730861+00', '78920000-5dd4-0015-cf23-08dcd9aa0429', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('248e0000-5dd4-0015-9008-08dcd98b8c12', '1209', 'Inventory valuation adjustments', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, true, '78920000-5dd4-0015-3a44-08dcd9aa0fb7', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-20 15:47:35.347754+00', '248e0000-5dd4-0015-51cb-08dcd98b8c12', '2024-09-20 19:26:01.110173+00', '78920000-5dd4-0015-e306-08dcd9aa0fb6', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('248e0000-5dd4-0015-7165-08dcd98bbffa', '1300', 'Prepaid expenses', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, true, '78920000-5dd4-0015-392d-08dcd9aa2c96', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-20 15:49:02.431183+00', '248e0000-5dd4-0015-3458-08dcd98bbffa', '2024-09-20 19:26:49.547803+00', '78920000-5dd4-0015-e398-08dcd9aa2c95', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('78920000-5dd4-0015-23e7-08dcd9aa3ba7', '1301', 'Receivables for products and services', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, true, '78920000-5dd4-0015-2a3d-08dcd9aa3ba7', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-20 19:27:14.824656+00', '78920000-5dd4-0015-e8fa-08dcd9aa3ba6', '2024-09-20 19:27:14.824656+00', '78920000-5dd4-0015-e8fa-08dcd9aa3ba6', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-3815-08dcda1dad9e', '1522', 'Communication systems', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, true, 'ec860000-5dd4-0015-3d50-08dcda1dad9e', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 09:13:38.150329+00', 'ec860000-5dd4-0015-f890-08dcda1dad9d', '2024-09-21 09:13:38.150329+00', 'ec860000-5dd4-0015-f890-08dcda1dad9d', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('78920000-5dd4-0015-0644-08dcd9aaf581', '1409', 'Valuation adjustments on long-term invest', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, true, '78920000-5dd4-0015-c298-08dcd9aaffac', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-20 19:32:26.631035+00', '78920000-5dd4-0015-cfd2-08dcd9aaf580', '2024-09-20 19:32:43.694758+00', '78920000-5dd4-0015-7106-08dcd9aaffac', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('78920000-5dd4-0015-a5ff-08dcd9a7ab43', '1449', 'Valuation adjustments on long-term loans', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, true, '78920000-5dd4-0015-c376-08dcd9ab07a8', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-20 19:08:53.587235+00', '78920000-5dd4-0015-6ce0-08dcd9a7ab43', '2024-09-20 19:32:57.090339+00', '78920000-5dd4-0015-7322-08dcd9ab07a8', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-1c93-08dcda1d182f', '1500', 'Machinery and equipment', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, true, 'ec860000-5dd4-0015-ba47-08dcda1d1831', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 09:09:27.458513+00', 'ec860000-5dd4-0015-22f0-08dcda1d182e', '2024-09-21 09:09:27.458513+00', 'ec860000-5dd4-0015-22f0-08dcda1d182e', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-b48d-08dcda1d22ef', '1510', 'Operating furniture', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, true, 'ec860000-5dd4-0015-bc9f-08dcda1d22ef', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 09:09:45.481106+00', 'ec860000-5dd4-0015-6f4b-08dcda1d22ef', '2024-09-21 09:09:45.481106+00', 'ec860000-5dd4-0015-6f4b-08dcda1d22ef', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-061c-08dcda1d2bc2', '1511', 'Workshop installations', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, true, 'ec860000-5dd4-0015-0fca-08dcda1d2bc2', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 09:10:00.281281+00', 'ec860000-5dd4-0015-abdc-08dcda1d2bc1', '2024-09-21 09:10:00.281281+00', 'ec860000-5dd4-0015-abdc-08dcda1d2bc1', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-ddf3-08dcda1d3498', '1512', 'Warehouse installations', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, true, 'ec860000-5dd4-0015-e2f2-08dcda1d3498', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 09:10:15.110931+00', 'ec860000-5dd4-0015-9216-08dcda1d3498', '2024-09-21 09:10:15.110931+00', 'ec860000-5dd4-0015-9216-08dcda1d3498', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-bc68-08dcda1d47f5', '1513', 'Office furniture', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, true, 'ec860000-5dd4-0015-c79e-08dcda1d47f5', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 09:10:47.596415+00', 'ec860000-5dd4-0015-7155-08dcda1d47f5', '2024-09-21 09:10:47.596415+00', 'ec860000-5dd4-0015-7155-08dcda1d47f5', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-a24f-08dcda1d9931', '1520', 'Office machines', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, true, 'ec860000-5dd4-0015-a781-08dcda1d9931', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 09:13:03.884272+00', 'ec860000-5dd4-0015-64bb-08dcda1d9931', '2024-09-21 09:13:03.884272+00', 'ec860000-5dd4-0015-64bb-08dcda1d9931', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-9192-08dcda1da58d', '1521', 'IT infrastructure', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, true, 'ec860000-5dd4-0015-99c4-08dcda1da58d', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 09:13:24.619511+00', 'ec860000-5dd4-0015-5284-08dcda1da58d', '2024-09-21 09:13:24.619511+00', 'ec860000-5dd4-0015-5284-08dcda1da58d', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-0173-08dcda1db8d7', '1530', 'Cars', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, true, 'ec860000-5dd4-0015-07a9-08dcda1db8d7', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 09:13:56.977448+00', 'ec860000-5dd4-0015-c4b2-08dcda1db8d6', '2024-09-21 09:13:56.977448+00', 'ec860000-5dd4-0015-c4b2-08dcda1db8d6', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-d472-08dcda1dc37c', '1540', 'Tools and equipment', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, true, 'ec860000-5dd4-0015-da04-08dcda1dc37c', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 09:14:14.841393+00', 'ec860000-5dd4-0015-8fa4-08dcda1dc37c', '2024-09-21 09:14:14.841393+00', 'ec860000-5dd4-0015-8fa4-08dcda1dc37c', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-66d1-08dcda1dd26b', '1550', 'Storage facilities', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, true, 'ec860000-5dd4-0015-6c02-08dcda1dd26b', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 09:14:39.892989+00', 'ec860000-5dd4-0015-2c65-08dcda1dd26b', '2024-09-21 09:14:39.892989+00', 'ec860000-5dd4-0015-2c65-08dcda1dd26b', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-11c5-08dcda1de501', '1590', 'Work clothing and uniforms', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, true, 'ec860000-5dd4-0015-1701-08dcda1de501', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 09:15:11.072842+00', 'ec860000-5dd4-0015-c7c0-08dcda1de500', '2024-09-21 09:15:11.072842+00', 'ec860000-5dd4-0015-c7c0-08dcda1de500', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-3436-08dcda1eb6ce', '1600', 'Operating buildings', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, true, 'ec860000-5dd4-0015-3c3a-08dcda1eb6ce', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 09:21:03.061097+00', 'ec860000-5dd4-0015-f17e-08dcda1eb6cd', '2024-09-21 09:21:03.061097+00', 'ec860000-5dd4-0015-f17e-08dcda1eb6cd', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-f0cf-08dcda1ebfe4', '1601', 'Maintenance, repair, or replacement', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, true, 'ec860000-5dd4-0015-f4d3-08dcda1ebfe4', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 09:21:18.309497+00', 'ec860000-5dd4-0015-b24f-08dcda1ebfe4', '2024-09-21 09:21:18.309497+00', 'ec860000-5dd4-0015-b24f-08dcda1ebfe4', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-12a2-08dcda1ed305', '1800', 'Incorporation costs', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, true, 'ec860000-5dd4-0015-16a9-08dcda1ed305', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 09:21:50.396788+00', 'ec860000-5dd4-0015-dc9f-08dcda1ed304', '2024-09-21 09:21:50.396788+00', 'ec860000-5dd4-0015-dc9f-08dcda1ed304', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-69c4-08dcda1edb78', '1801', 'Capital increase costs', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, true, 'ec860000-5dd4-0015-0c65-08dcda1ef2e0', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 09:22:04.57447+00', 'ec860000-5dd4-0015-2fad-08dcda1edb78', '2024-09-21 09:22:43.841132+00', 'ec860000-5dd4-0015-ce10-08dcda1ef2dc', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-7012-08dcda1ef826', '1802', 'Organizational costs', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, true, 'ec860000-5dd4-0015-74d8-08dcda1ef826', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 09:22:52.691167+00', 'ec860000-5dd4-0015-328c-08dcda1ef826', '2024-09-21 09:22:52.691167+00', 'ec860000-5dd4-0015-328c-08dcda1ef826', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-ef03-08dcda1f0104', '1850', 'Unissued share capital', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, true, 'ec860000-5dd4-0015-f553-08dcda1f0104', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 09:23:07.571128+00', 'ec860000-5dd4-0015-b6d7-08dcda1f0104', '2024-09-21 09:23:07.571128+00', 'ec860000-5dd4-0015-b6d7-08dcda1f0104', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-c9fe-08dcda1f08eb', '1859', 'Valuation adjustments on unissued share capital', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, true, 'ec860000-5dd4-0015-d01a-08dcda1f08eb', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 09:23:20.828106+00', 'ec860000-5dd4-0015-8f49-08dcda1f08eb', '2024-09-21 09:23:20.828106+00', 'ec860000-5dd4-0015-8f49-08dcda1f08eb', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-5955-08dcda1eca12', '1609', 'Accumulated depreciation on operating buildings', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, true, 'ec860000-5dd4-0015-df72-08dcda1f3dbc', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 09:21:35.384328+00', 'ec860000-5dd4-0015-1779-08dcda1eca12', '2024-09-21 09:24:49.439727+00', 'ec860000-5dd4-0015-7f88-08dcda1f3dbc', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-1cc9-08dcda20a76e', '2000', 'Liabilities for purchases of materials and goods', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'ec860000-5dd4-0015-234c-08dcda20a76e', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 09:34:56.258948+00', 'ec860000-5dd4-0015-d485-08dcda20a76d', '2024-09-21 09:34:56.258948+00', 'ec860000-5dd4-0015-d485-08dcda20a76d', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-98ee-08dcda20b16e', '2001', 'Liabilities for services to third parties', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'ec860000-5dd4-0015-9c96-08dcda20b16e', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 09:35:13.03927+00', 'ec860000-5dd4-0015-54b2-08dcda20b16e', '2024-09-21 09:35:13.03927+00', 'ec860000-5dd4-0015-54b2-08dcda20b16e', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-1ecb-08dcda20bb14', '2002', 'Liabilities for personnel expenses', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'ec860000-5dd4-0015-22db-08dcda20bb14', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 09:35:29.223545+00', 'ec860000-5dd4-0015-e775-08dcda20bb13', '2024-09-21 09:35:29.223545+00', 'ec860000-5dd4-0015-e775-08dcda20bb13', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-54dd-08dcda20c7a0', '2003', 'Liabilities for social security contributions', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'ec860000-5dd4-0015-5874-08dcda20c7a0', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 09:35:50.27508+00', 'ec860000-5dd4-0015-1355-08dcda20c7a0', '2024-09-21 09:35:50.27508+00', 'ec860000-5dd4-0015-1355-08dcda20c7a0', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-e6b0-08dcda20d5dd', '2005', 'Liabilities for lease transactions', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'ec860000-5dd4-0015-eac7-08dcda20d5dd', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 09:36:14.166698+00', 'ec860000-5dd4-0015-aa83-08dcda20d5dd', '2024-09-21 09:36:14.166698+00', 'ec860000-5dd4-0015-aa83-08dcda20d5dd', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-a0ad-08dcda20cecb', '2004', 'Liabilities for other operating expenses', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'ec860000-5dd4-0015-6c4d-08dcda210823', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 09:36:02.302981+00', 'ec860000-5dd4-0015-5611-08dcda20cecb', '2024-09-21 09:37:38.508292+00', 'ec860000-5dd4-0015-06fc-08dcda210823', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-aa11-08dcda2fe630', '2030', 'Customer advances', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'ec860000-5dd4-0015-aee3-08dcda2fe630', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 11:24:04.003603+00', 'ec860000-5dd4-0015-65c2-08dcda2fe630', '2024-09-21 11:24:04.003603+00', 'ec860000-5dd4-0015-65c2-08dcda2fe630', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-4e95-08dcda2ff13b', '2100', 'Short-term bank liabilities', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'ec860000-5dd4-0015-5350-08dcda2ff13b', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 11:24:22.528287+00', 'ec860000-5dd4-0015-16de-08dcda2ff13b', '2024-09-21 11:24:22.528287+00', 'ec860000-5dd4-0015-16de-08dcda2ff13b', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-2d5c-08dcda306250', '2110', 'Liabilities to post offices', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'ec860000-5dd4-0015-3149-08dcda306250', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 11:27:32.247582+00', 'ec860000-5dd4-0015-e704-08dcda30624f', '2024-09-21 11:27:32.247582+00', 'ec860000-5dd4-0015-e704-08dcda30624f', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-ce96-08dcda306be5', '2111', 'Liabilities to transfer companies', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'ec860000-5dd4-0015-d394-08dcda306be5', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 11:27:48.327714+00', 'ec860000-5dd4-0015-9a17-08dcda306be5', '2024-09-21 11:27:48.327714+00', 'ec860000-5dd4-0015-9a17-08dcda306be5', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-0733-08dcda307df9', '2160', 'Short-term financial liabilities to shareholder X', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'ec860000-5dd4-0015-0a00-08dcda307df9', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 11:28:18.652618+00', 'ec860000-5dd4-0015-cc3c-08dcda307df8', '2024-09-21 11:28:18.652618+00', 'ec860000-5dd4-0015-cc3c-08dcda307df8', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-5593-08dcda308633', '2170', 'Short-term financial liabilities to pension funds', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'ec860000-5dd4-0015-584c-08dcda308633', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 11:28:32.456504+00', 'ec860000-5dd4-0015-22f5-08dcda308633', '2024-09-21 11:28:32.456504+00', 'ec860000-5dd4-0015-22f5-08dcda308633', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-e456-08dcda308e53', '2180', 'Mortgage repayments', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'ec860000-5dd4-0015-e818-08dcda308e53', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 11:28:46.091673+00', 'ec860000-5dd4-0015-a822-08dcda308e53', '2024-09-21 11:28:46.091673+00', 'ec860000-5dd4-0015-a822-08dcda308e53', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-a892-08dcda3094b8', '2181', 'Loan repayments', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'ec860000-5dd4-0015-ad23-08dcda3094b8', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 11:28:56.818407+00', 'ec860000-5dd4-0015-6730-08dcda3094b8', '2024-09-21 11:28:56.818407+00', 'ec860000-5dd4-0015-6730-08dcda3094b8', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-2309-08dcda309b7b', '2200', 'VAT payable', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'ec860000-5dd4-0015-25fe-08dcda309b7b', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 11:29:08.159225+00', 'ec860000-5dd4-0015-e51f-08dcda309b7a', '2024-09-21 11:29:08.159225+00', 'ec860000-5dd4-0015-e51f-08dcda309b7a', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-e12c-08dcda30a42e', '2205', 'AFC - VAT', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'ec860000-5dd4-0015-e3a2-08dcda30a42e', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 11:29:22.758951+00', 'ec860000-5dd4-0015-a414-08dcda30a42e', '2024-09-21 11:29:22.758951+00', 'ec860000-5dd4-0015-a414-08dcda30a42e', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-e7f6-08dcda30aa7d', '2206', 'Due withholding tax', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'ec860000-5dd4-0015-ecc0-08dcda30aa7d', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 11:29:33.343248+00', 'ec860000-5dd4-0015-ac71-08dcda30aa7d', '2024-09-21 11:29:33.343248+00', 'ec860000-5dd4-0015-ac71-08dcda30aa7d', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-2192-08dcda30b1de', '2207', 'Due stamp duties', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'ec860000-5dd4-0015-2506-08dcda30b1de', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 11:29:45.717886+00', 'ec860000-5dd4-0015-e8d4-08dcda30b1dd', '2024-09-21 11:29:45.717886+00', 'ec860000-5dd4-0015-e8d4-08dcda30b1dd', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-0ce3-08dcda30bd7f', '2208', 'Due direct taxes', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'ec860000-5dd4-0015-0f91-08dcda30bd7f', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 11:30:05.227404+00', 'ec860000-5dd4-0015-d700-08dcda30bd7e', '2024-09-21 11:30:05.227404+00', 'ec860000-5dd4-0015-d700-08dcda30bd7e', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-8e25-08dcda30c7bb', '2230', 'Unclaimed dividends for the year', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', ' ', 0, 1, true, 'ec860000-5dd4-0015-9ad3-08dcda30c7bb', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 11:30:22.4014+00', 'ec860000-5dd4-0015-3ab6-08dcda30c7bb', '2024-09-21 11:30:22.4014+00', 'ec860000-5dd4-0015-3ab6-08dcda30c7bb', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-3043-08dcda30ce50', '2231', 'Unclaimed dividends from previous years', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'ec860000-5dd4-0015-3371-08dcda30ce50', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 11:30:33.44157+00', 'ec860000-5dd4-0015-f2a8-08dcda30ce4f', '2024-09-21 11:30:33.44157+00', 'ec860000-5dd4-0015-f2a8-08dcda30ce4f', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-8e4f-08dcda30d697', '2232', 'Unclaimed bond coupons', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'ec860000-5dd4-0015-90fc-08dcda30d697', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 11:30:47.331043+00', 'ec860000-5dd4-0015-57e3-08dcda30d697', '2024-09-21 11:30:47.331043+00', 'ec860000-5dd4-0015-57e3-08dcda30d697', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-e4a1-08dcda3073d0', '2140', 'Other short-term financial liabilities to third parties', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'ec860000-5dd4-0015-5fe2-08dcda316bc3', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 11:28:01.612408+00', 'ec860000-5dd4-0015-acc9-08dcda3073d0', '2024-09-21 11:34:57.598663+00', 'ec860000-5dd4-0015-0e84-08dcda316bc3', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-f91d-08dcda52f00f', '2300', 'Accrued expenses', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'ec860000-5dd4-0015-fcae-08dcda52f00f', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:34:52.952078+00', 'ec860000-5dd4-0015-bb3e-08dcda52f00f', '2024-09-21 15:34:52.952078+00', 'ec860000-5dd4-0015-bb3e-08dcda52f00f', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-b39d-08dcda530d2c', '2301', 'Prepaid income', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'ec860000-5dd4-0015-b78d-08dcda530d2c', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:35:41.794289+00', 'ec860000-5dd4-0015-6e60-08dcda530d2c', '2024-09-21 15:35:41.794289+00', 'ec860000-5dd4-0015-6e60-08dcda530d2c', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-01b3-08dcda531ef9', '2340', 'Provisions for direct taxes', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'ec860000-5dd4-0015-04a4-08dcda531ef9', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:36:11.654464+00', 'ec860000-5dd4-0015-b543-08dcda531ef8', '2024-09-21 15:36:11.654464+00', 'ec860000-5dd4-0015-b543-08dcda531ef8', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-b414-08dcda532935', '2341', 'Provisions for indirect taxes', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'ec860000-5dd4-0015-b722-08dcda532935', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:36:28.829466+00', 'ec860000-5dd4-0015-7e9c-08dcda532935', '2024-09-21 15:36:28.829466+00', 'ec860000-5dd4-0015-7e9c-08dcda532935', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('dc610000-5dd4-0015-07cd-08dcda5647e1', '2400', 'Long-term bank liabilities', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'dc610000-5dd4-0015-1264-08dcda5647e8', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:58:48.819721+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', '2024-09-21 15:58:48.819721+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('dc610000-5dd4-0015-3646-08dcda5647ed', '2420', 'Liabilities from lease transactions', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'dc610000-5dd4-0015-7f38-08dcda5647ed', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:58:48.855676+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', '2024-09-21 15:58:48.855676+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('dc610000-5dd4-0015-15f0-08dcda5647ee', '2440', 'Mortgages on operating buildings', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'dc610000-5dd4-0015-1a65-08dcda5647ee', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:58:48.859705+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', '2024-09-21 15:58:48.859705+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('dc610000-5dd4-0015-c1ff-08dcda5647ee', '2500', 'Long-term loans from third parties', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'dc610000-5dd4-0015-c778-08dcda5647ee', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:58:48.864136+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', '2024-09-21 15:58:48.864136+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('dc610000-5dd4-0015-41c7-08dcda5647ef', '2560', 'Long-term loans to shareholders', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'dc610000-5dd4-0015-4659-08dcda5647ef', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:58:48.867383+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', '2024-09-21 15:58:48.867383+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('dc610000-5dd4-0015-c36a-08dcda5647ef', '2570', 'Long-term loans to pension funds', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'dc610000-5dd4-0015-ca17-08dcda5647ef', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:58:48.870751+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', '2024-09-21 15:58:48.870751+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('dc610000-5dd4-0015-46c8-08dcda5647f0', '2600', 'Provision for repairs', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'dc610000-5dd4-0015-4c69-08dcda5647f0', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:58:48.87409+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', '2024-09-21 15:58:48.87409+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('dc610000-5dd4-0015-ee99-08dcda5647f0', '2601', 'Provision for renovations', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'dc610000-5dd4-0015-f646-08dcda5647f0', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:58:48.878441+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', '2024-09-21 15:58:48.878441+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('dc610000-5dd4-0015-724d-08dcda5647f1', '2602', 'Provision for refurbishments', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'dc610000-5dd4-0015-7965-08dcda5647f1', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:58:48.881798+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', '2024-09-21 15:58:48.881798+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('dc610000-5dd4-0015-0363-08dcda5647f2', '2630', 'Provisions for warranty work', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'dc610000-5dd4-0015-0adf-08dcda5647f2', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:58:48.885515+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', '2024-09-21 15:58:48.885515+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('dc610000-5dd4-0015-83b1-08dcda5647f2', '2800', 'Equity', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'dc610000-5dd4-0015-8a8d-08dcda5647f2', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:58:48.888787+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', '2024-09-21 15:58:48.888787+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('dc610000-5dd4-0015-39bb-08dcda5647f3', '2801', 'Spouse''s equity', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'dc610000-5dd4-0015-430c-08dcda5647f3', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:58:48.893469+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', '2024-09-21 15:58:48.893469+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('dc610000-5dd4-0015-bbae-08dcda5647f3', '2810', 'Partner A''s capital account', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'dc610000-5dd4-0015-d5a8-08dcda5647f3', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:58:48.897265+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', '2024-09-21 15:58:48.897265+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('dc610000-5dd4-0015-5509-08dcda5647f4', '2811', 'Partner B''s capital account', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'dc610000-5dd4-0015-5da7-08dcda5647f4', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:58:48.900745+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', '2024-09-21 15:58:48.900745+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('dc610000-5dd4-0015-dac6-08dcda5647f4', '2812', 'Commandite partner C''s capital account', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'dc610000-5dd4-0015-e3fa-08dcda5647f4', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:58:48.904186+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', '2024-09-21 15:58:48.904186+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('dc610000-5dd4-0015-8943-08dcda5647f5', '2820', 'Share capital of the LLC', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'dc610000-5dd4-0015-921d-08dcda5647f5', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:58:48.908642+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', '2024-09-21 15:58:48.908642+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('dc610000-5dd4-0015-0ffd-08dcda5647f6', '2840', 'Share capital', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'dc610000-5dd4-0015-19d0-08dcda5647f6', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:58:48.912116+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', '2024-09-21 15:58:48.912116+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('dc610000-5dd4-0015-95c3-08dcda5647f6', '2841', 'Participation capital', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'dc610000-5dd4-0015-9fba-08dcda5647f6', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:58:48.915542+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', '2024-09-21 15:58:48.915542+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('dc610000-5dd4-0015-1c3a-08dcda5647f7', '2850', 'Private cash withdrawals', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'dc610000-5dd4-0015-2641-08dcda5647f7', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:58:48.91899+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', '2024-09-21 15:58:48.91899+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('dc610000-5dd4-0015-c85d-08dcda5647f7', '2851', 'Private in-kind withdrawals', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'dc610000-5dd4-0015-d2f0-08dcda5647f7', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:58:48.92341+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', '2024-09-21 15:58:48.92341+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('dc610000-5dd4-0015-573b-08dcda5647f8', '2852', 'Private contributions to operating expenses', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'dc610000-5dd4-0015-62ae-08dcda5647f8', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:58:48.92709+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', '2024-09-21 15:58:48.92709+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('dc610000-5dd4-0015-da37-08dcda5647f8', '2853', 'Rental value of private apartment', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'dc610000-5dd4-0015-e55d-08dcda5647f8', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:58:48.930435+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', '2024-09-21 15:58:48.930435+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('dc610000-5dd4-0015-65d5-08dcda5647f9', '2854', 'Private insurance premiums', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'dc610000-5dd4-0015-71a2-08dcda5647f9', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:58:48.934025+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', '2024-09-21 15:58:48.934025+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('dc610000-5dd4-0015-1dfa-08dcda5647fa', '2855', 'Private pension contributions', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'dc610000-5dd4-0015-2a34-08dcda5647fa', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:58:48.938751+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', '2024-09-21 15:58:48.938751+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('dc610000-5dd4-0015-a720-08dcda5647fa', '2856', 'Private taxes', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'dc610000-5dd4-0015-b33d-08dcda5647fa', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:58:48.942259+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', '2024-09-21 15:58:48.942259+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('dc610000-5dd4-0015-3f48-08dcda5647fb', '2880', 'Private property A', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'dc610000-5dd4-0015-51a4-08dcda5647fb', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:58:48.94631+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', '2024-09-21 15:58:48.94631+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('dc610000-5dd4-0015-cdb5-08dcda5647fb', '2900', 'General reserve', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'dc610000-5dd4-0015-db04-08dcda5647fb', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:58:48.949826+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', '2024-09-21 15:58:48.949826+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('dc610000-5dd4-0015-7a6c-08dcda5647fc', '2901', 'Reserve for treasury shares', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'dc610000-5dd4-0015-87e2-08dcda5647fc', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:58:48.954256+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', '2024-09-21 15:58:48.954256+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('dc610000-5dd4-0015-0677-08dcda5647fd', '2903', 'Revaluation reserve', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'dc610000-5dd4-0015-145f-08dcda5647fd', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:58:48.957853+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', '2024-09-21 15:58:48.957853+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('dc610000-5dd4-0015-905e-08dcda5647fd', '2910', 'Statutory reserves', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'dc610000-5dd4-0015-9eff-08dcda5647fd', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:58:48.961399+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', '2024-09-21 15:58:48.961399+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('dc610000-5dd4-0015-1791-08dcda5647fe', '2990', 'Brought-forward profit / Brought-forward loss', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'dc610000-5dd4-0015-25fe-08dcda5647fe', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:58:48.964857+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', '2024-09-21 15:58:48.964857+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('dc610000-5dd4-0015-fd1c-08dcda5647fe', '2991', 'Current-year profit / Current-year loss', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'dc610000-5dd4-0015-0e56-08dcda5647ff', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:58:48.970802+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', '2024-09-21 15:58:48.970802+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('4c6f0000-5dd4-0015-5b3c-08dcda56e416', '3211', 'Gross credit retail sales', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, true, '4c6f0000-5dd4-0015-81a7-08dcda56e41d', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:03:10.894504+00', '4c6f0000-5dd4-0015-fa99-08dcda56e411', '2024-09-21 16:03:10.894504+00', '4c6f0000-5dd4-0015-fa99-08dcda56e411', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('4c6f0000-5dd4-0015-7cad-08dcda56e423', '3212', 'Gross credit wholesale sales', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, true, '4c6f0000-5dd4-0015-bf07-08dcda56e423', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:03:10.935793+00', '4c6f0000-5dd4-0015-fa99-08dcda56e411', '2024-09-21 16:03:10.935793+00', '4c6f0000-5dd4-0015-fa99-08dcda56e411', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('4c6f0000-5dd4-0015-5a60-08dcda56e424', '3220', 'Gross sales at standard VAT rate (8.00% net VAT)', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, true, '4c6f0000-5dd4-0015-5ee0-08dcda56e424', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:03:10.939922+00', '4c6f0000-5dd4-0015-fa99-08dcda56e411', '2024-09-21 16:03:10.939922+00', '4c6f0000-5dd4-0015-fa99-08dcda56e411', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('4c6f0000-5dd4-0015-db2b-08dcda56e424', '3221', 'Gross sales at reduced VAT rate (2.50% net VAT)', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, true, '4c6f0000-5dd4-0015-dfcf-08dcda56e424', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:03:10.943223+00', '4c6f0000-5dd4-0015-fa99-08dcda56e411', '2024-09-21 16:03:10.943223+00', '4c6f0000-5dd4-0015-fa99-08dcda56e411', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('4c6f0000-5dd4-0015-ad5b-08dcda56e425', '3222', 'Gross sales at zero VAT rate (0.00% net VAT)', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, true, '4c6f0000-5dd4-0015-b1bd-08dcda56e425', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:03:10.948597+00', '4c6f0000-5dd4-0015-fa99-08dcda56e411', '2024-09-21 16:03:10.948597+00', '4c6f0000-5dd4-0015-fa99-08dcda56e411', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('4c6f0000-5dd4-0015-5998-08dcda56e426', '3300', 'Other directly incorporable materials', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, true, '4c6f0000-5dd4-0015-614e-08dcda56e426', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:03:10.953087+00', '4c6f0000-5dd4-0015-fa99-08dcda56e411', '2024-09-21 16:03:10.953087+00', '4c6f0000-5dd4-0015-fa99-08dcda56e411', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('4c6f0000-5dd4-0015-e459-08dcda56e426', '3720', 'Internal consumption', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, true, '4c6f0000-5dd4-0015-e998-08dcda56e426', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:03:10.956581+00', '4c6f0000-5dd4-0015-fa99-08dcda56e411', '2024-09-21 16:03:10.956581+00', '4c6f0000-5dd4-0015-fa99-08dcda56e411', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('4c6f0000-5dd4-0015-63be-08dcda56e427', '3900', 'Discounts', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, true, '4c6f0000-5dd4-0015-6abe-08dcda56e427', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:03:10.959882+00', '4c6f0000-5dd4-0015-fa99-08dcda56e411', '2024-09-21 16:03:10.959882+00', '4c6f0000-5dd4-0015-fa99-08dcda56e411', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('4c6f0000-5dd4-0015-0dad-08dcda56e428', '3901', 'Price rebates', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, true, '4c6f0000-5dd4-0015-148f-08dcda56e428', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:03:10.964228+00', '4c6f0000-5dd4-0015-fa99-08dcda56e411', '2024-09-21 16:03:10.964228+00', '4c6f0000-5dd4-0015-fa99-08dcda56e411', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-4a86-08dcda58ab6a', '4292', 'Refunds', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, 'b0650000-5dd4-0015-e575-08dcda6a7f80', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.761651+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 18:23:32.031006+00', 'b0650000-5dd4-0015-7887-08dcda6a7f80', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('4c6f0000-5dd4-0015-7bf9-08dcda56e429', '3903', 'Third-party commissions', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, true, '4c6f0000-5dd4-0015-8393-08dcda56e429', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:03:10.973629+00', '4c6f0000-5dd4-0015-fa99-08dcda56e411', '2024-09-21 16:03:10.973629+00', '4c6f0000-5dd4-0015-fa99-08dcda56e411', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('4c6f0000-5dd4-0015-0683-08dcda56e42a', '3904', 'Collection fees', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, true, '4c6f0000-5dd4-0015-0e72-08dcda56e42a', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:03:10.977178+00', '4c6f0000-5dd4-0015-fa99-08dcda56e411', '2024-09-21 16:03:10.977178+00', '4c6f0000-5dd4-0015-fa99-08dcda56e411', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('4c6f0000-5dd4-0015-ac69-08dcda56e42a', '3905', 'Customer losses', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, true, '4c6f0000-5dd4-0015-b4e7-08dcda56e42a', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:03:10.981442+00', '4c6f0000-5dd4-0015-fa99-08dcda56e411', '2024-09-21 16:03:10.981442+00', '4c6f0000-5dd4-0015-fa99-08dcda56e411', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('4c6f0000-5dd4-0015-3498-08dcda56e42b', '3906', 'Foreign exchange differences', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, true, '4c6f0000-5dd4-0015-3cf3-08dcda56e42b', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:03:10.984928+00', '4c6f0000-5dd4-0015-fa99-08dcda56e411', '2024-09-21 16:03:10.984928+00', '4c6f0000-5dd4-0015-fa99-08dcda56e411', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('4c6f0000-5dd4-0015-f5b3-08dcda56e42b', '3907', 'Freight and carriage', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, true, '4c6f0000-5dd4-0015-fec1-08dcda56e42b', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:03:10.989887+00', '4c6f0000-5dd4-0015-fa99-08dcda56e411', '2024-09-21 16:03:10.989887+00', '4c6f0000-5dd4-0015-fa99-08dcda56e411', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('4c6f0000-5dd4-0015-b18f-08dcda56e42c', '3210', 'Gross cash sales', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, true, '4c6f0000-5dd4-0015-bac3-08dcda56e42c', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:03:10.994702+00', '4c6f0000-5dd4-0015-fa99-08dcda56e411', '2024-09-21 16:03:10.994702+00', '4c6f0000-5dd4-0015-fa99-08dcda56e411', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-ab3e-08dcda58ab55', '4208', 'Inventory adjustments', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-64c7-08dcda58ab5d', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.676511+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.676511+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-6395-08dcda58ab63', '4209', 'Deductions obtained on purchases', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-a651-08dcda58ab63', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.717924+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.717924+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-5c21-08dcda58ab64', '4210', 'Purchases of goods at standard VAT rate (8.00% net VAT)', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-60fe-08dcda58ab64', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.722735+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.722735+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-e55a-08dcda58ab64', '4211', 'Purchases of goods at reduced VAT rate (2.50% net VAT)', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-e987-08dcda58ab64', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.726231+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.726231+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-988a-08dcda58ab65', '4212', 'Purchases of goods at zero VAT rate (0.00% net VAT)', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-9d88-08dcda58ab65', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.730838+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.730838+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-3197-08dcda58ab66', '4215', 'Purchase of packaging materials', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-3a85-08dcda58ab66', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.734856+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.734856+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-700a-08dcda58ab67', '4270', 'Purchase freight', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-763f-08dcda58ab67', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.742938+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.742938+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-f70d-08dcda58ab67', '4271', 'Import customs duties', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-fd6a-08dcda58ab67', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.7464+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.7464+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-8547-08dcda58ab68', '4272', 'Purchase transportation costs', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-8b6e-08dcda58ab68', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.750035+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.750035+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-0b7c-08dcda58ab69', '4290', 'Discounts', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-1190-08dcda58ab69', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.753469+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.753469+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-c1b6-08dcda58ab69', '4291', 'Price rebates', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-c8b6-08dcda58ab69', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.758155+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.758155+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-e6d2-08dcda58ab6a', '4293', 'Rebates obtained on purchases', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-ede7-08dcda58ab6a', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.765661+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.765661+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-7563-08dcda58ab6b', '4296', 'Foreign exchange differences', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-7d56-08dcda58ab6b', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.769335+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.769335+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-2576-08dcda58ab6c', '5200', 'Salaries', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-2c86-08dcda58ab6c', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.77382+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.77382+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-b332-08dcda58ab6c', '5205', 'Social security benefits', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-bb48-08dcda58ab6c', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.777472+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.777472+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-374c-08dcda58ab6d', '5270', 'Old-age and survivors'' insurance, disability insurance, income replacement', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-3f61-08dcda58ab6d', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.780856+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.780856+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-c742-08dcda58ab6d', '5271', 'Family allowance fund', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-d07e-08dcda58ab6d', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.784569+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.784569+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-7504-08dcda58ab6e', '5272', 'Occupational pension plan', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-7e69-08dcda58ab6e', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.789023+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.789023+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-fb87-08dcda58ab6e', '5273', 'Accident insurance', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-04f4-08dcda58ab6f', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.792468+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.792468+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-81b9-08dcda58ab6f', '5274', 'Sickness benefits insurance', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-8b2c-08dcda58ab6f', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.795904+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.795904+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-1b0b-08dcda58ab70', '5279', 'Withholding taxes', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-25a2-08dcda58ab70', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.799857+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.799857+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-cc5b-08dcda58ab70', '5280', 'Personnel recruitment', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-d72a-08dcda58ab70', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.804399+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.804399+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-5921-08dcda58ab71', '5281', 'Training and continuing education', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-63ad-08dcda58ab71', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.807999+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.807999+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-e852-08dcda58ab71', '5282', 'Actual expense reimbursements', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-f392-08dcda58ab71', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.811683+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.811683+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-7d83-08dcda58ab72', '5283', 'Flat-rate expense allowances', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-898e-08dcda58ab72', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.815522+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.815522+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-2e91-08dcda58ab73', '5289', 'Other personnel expenses', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-3c7d-08dcda58ab73', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.820056+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.820056+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-bd6a-08dcda58ab73', '5290', 'Temporary employees', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-c8cf-08dcda58ab73', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.823695+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.823695+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-555c-08dcda58ab74', '6000', 'Rent', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-6281-08dcda58ab74', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.827627+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.827627+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-ea28-08dcda58ab74', '6030', 'Accessory charges', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-f797-08dcda58ab74', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.831444+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.831444+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-a2d7-08dcda58ab75', '6040', 'Cleaning', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-afc8-08dcda58ab75', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.836161+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.836161+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-3667-08dcda58ab76', '6050', 'Maintenance', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-4398-08dcda58ab76', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.839945+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.839945+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-c6a2-08dcda58ab76', '6090', 'Premises charges as private withdrawals', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-d8af-08dcda58ab76', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.84376+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.84376+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-627b-08dcda58ab77', '6100', 'Maintenance, repair, or replacement of machinery', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-7037-08dcda58ab77', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.847639+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.847639+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-1874-08dcda58ab78', '6102', 'Maintenance, repair, or replacement of tools and equipment', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-27de-08dcda58ab78', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.852342+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.852342+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-b07e-08dcda58ab78', '6130', 'Maintenance, repair, or replacement of office furniture', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-bdeb-08dcda58ab78', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.856184+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.856184+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-4078-08dcda58ab79', '6131', 'Maintenance, repair, or replacement of office machines', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-4e76-08dcda58ab79', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.859884+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.859884+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-cdcd-08dcda58ab79', '6200', 'Repair, service, and cleaning', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-dc1c-08dcda58ab79', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.86351+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.86351+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-7f75-08dcda58ab7a', '6210', 'Fuel', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-8de1-08dcda58ab7a', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.868059+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.868059+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-1137-08dcda58ab7b', '6220', 'Insurance and taxes', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-1f7c-08dcda58ab7b', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.871787+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.871787+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-a49f-08dcda58ab7b', '6260', 'Lease charges for vehicles', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-96c3-08dcda58ab7c', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.88139+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.88139+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-260f-08dcda58ab7d', '6270', 'Vehicle charges as private withdrawals', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-3458-08dcda58ab7d', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.885429+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.885429+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-d524-08dcda58ab7d', '6300', 'Property damage insurance', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-e322-08dcda58ab7d', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.889902+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.889902+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-61c0-08dcda58ab7e', '6310', 'Liability insurance', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-74df-08dcda58ab7e', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.893625+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.893625+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-ff88-08dcda58ab7e', '6330', 'Life insurance premiums', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-0ee0-08dcda58ab7f', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.897573+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.897573+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-979f-08dcda58ab7f', '6331', 'Surety bond premiums', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-a81e-08dcda58ab7f', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.901497+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.901497+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-4d51-08dcda58ab80', '6360', 'Duties', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-5d61-08dcda58ab80', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.906138+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.906138+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-e36e-08dcda58ab80', '6361', 'Taxes', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-f3c4-08dcda58ab80', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.909987+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.909987+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-7221-08dcda58ab81', '6370', 'Permits', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-8272-08dcda58ab81', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.913642+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.913642+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-0165-08dcda58ab82', '6371', 'Licenses', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-1251-08dcda58ab82', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.917322+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.917322+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-b139-08dcda58ab82', '6400', 'Power', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-c4bf-08dcda58ab82', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.921892+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.921892+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-5258-08dcda58ab83', '6420', 'Fuel oil', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-62a0-08dcda58ab83', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.925934+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.925934+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-dbbf-08dcda58ab83', '6430', 'Water', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-ee2d-08dcda58ab83', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.929505+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.929505+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-6bc2-08dcda58ab84', '6460', 'Waste disposal', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-7d8d-08dcda58ab84', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.933175+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.933175+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-2f77-08dcda58ab85', '6462', 'Wastewater', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-4245-08dcda58ab85', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.938208+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.938208+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-c3ce-08dcda58ab85', '6500', 'Office supplies', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-d563-08dcda58ab85', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.941978+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.941978+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-5394-08dcda58ab86', '6501', 'Printed materials', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-6602-08dcda58ab86', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.94568+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.94568+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-dccc-08dcda58ab86', '6502', 'Photocopies', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-f0fa-08dcda58ab86', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.949234+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.949234+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-a4c4-08dcda58ab87', '6503', 'Technical literature', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-b723-08dcda58ab87', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.954308+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.954308+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-41ee-08dcda58ab88', '6510', 'Telephone', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-55a7-08dcda58ab88', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.958366+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.958366+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-cdf4-08dcda58ab88', '6511', 'Fax', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-e0ed-08dcda58ab88', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.961933+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.961933+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-5f4c-08dcda58ab89', '6512', 'Internet', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-7205-08dcda58ab89', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.965645+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.965645+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-2459-08dcda58ab8a', '6513', 'Postage charges', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-424e-08dcda58ab8a', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.970971+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.970971+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-c4e8-08dcda58ab8a', '6520', 'Contributions', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-d8c2-08dcda58ab8a', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.974829+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.974829+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-58c1-08dcda58ab8b', '6521', 'Donations and gifts', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-6ca3-08dcda58ab8b', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.978617+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.978617+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-ea58-08dcda58ab8b', '6522', 'Tips', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-fe3d-08dcda58ab8b', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.982344+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.982344+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-aab8-08dcda58ab8c', '6530', 'Fiduciary fees', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-bf8f-08dcda58ab8c', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.987293+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.987293+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-3ce8-08dcda58ab8d', '6531', 'Consulting fees', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-5677-08dcda58ab8d', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.991156+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.991156+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-de62-08dcda58ab8d', '6532', 'Legal consulting fees', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-f256-08dcda58ab8d', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.995144+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.995144+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-6d70-08dcda58ab8e', '6540', 'Board of directors fees', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-8e09-08dcda58ab8e', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.999132+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.999132+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-3e66-08dcda58ab8f', '6541', 'General assembly fees', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-5722-08dcda58ab8f', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.004281+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.004281+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-dd01-08dcda58ab8f', '6542', 'Auditing fees', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-f232-08dcda58ab8f', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.008249+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.008249+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-6f55-08dcda58ab90', '6550', 'Administrative charges as private withdrawals', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-87d2-08dcda58ab90', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.012079+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.012079+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-fdc8-08dcda58ab90', '6560', 'Lease of equipment', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-128f-08dcda58ab91', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.015632+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.015632+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-b7ee-08dcda58ab91', '6561', 'Lease of software', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-cdce-08dcda58ab91', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.020424+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.020424+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-4a73-08dcda58ab92', '6562', 'Lease of equipment', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-60d8-08dcda58ab92', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.024191+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.024191+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-de50-08dcda58ab92', '6570', 'License/update charges', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-f421-08dcda58ab92', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.02796+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.02796+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-26d9-08dcda58ab94', '6575', 'Network charges', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-3e53-08dcda58ab94', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.036414+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.036414+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-b938-08dcda58ab94', '6600', 'Newspaper advertising', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-d269-08dcda58ab94', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.040205+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.040205+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-52a3-08dcda58ab95', '6610', 'Advertising materials, advertising equipment', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-6975-08dcda58ab95', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.044072+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.044072+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-f145-08dcda58ab95', '6611', 'Advertising items, samples', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-0d48-08dcda58ab96', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.048259+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.048259+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-b380-08dcda58ab96', '6620', 'Window displays, decorations', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-cb0a-08dcda58ab96', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.053117+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.053117+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-4c9e-08dcda58ab97', '6621', 'Fairs, exhibitions', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-63fe-08dcda58ab97', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.057037+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.057037+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-dde2-08dcda58ab97', '6640', 'Travel expenses', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-f9a5-08dcda58ab97', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.060867+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.060867+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-808f-08dcda58ab98', '6641', 'Customer advisory services', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-9a60-08dcda58ab98', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.064982+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.064982+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-43cc-08dcda58ab99', '6642', 'Customer gifts', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-5bbe-08dcda58ab99', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.069933+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.069933+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-d8d2-08dcda58ab99', '6700', 'Economic information', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-f157-08dcda58ab99', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.073762+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.073762+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-7006-08dcda58ab9a', '6701', 'Legal proceedings', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-89b7-08dcda58ab9a', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.077663+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.077663+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-0725-08dcda58ab9b', '6710', 'Security', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-33ee-08dcda58ab9b', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.081962+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.081962+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-dcea-08dcda58ab9b', '6711', 'Surveillance', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-f7b6-08dcda58ab9b', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.087032+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.087032+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-7a0f-08dcda58ab9c', '6800', 'Bank loan interest', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-95e0-08dcda58ab9c', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.09108+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.09108+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-0ffa-08dcda58ab9d', '6801', 'Loan interest', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-2a2f-08dcda58ab9d', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.094878+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.094878+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-b01e-08dcda58ab9d', '6802', 'Mortgage loan interest', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-cb3c-08dcda58ab9d', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.098994+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.098994+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-8132-08dcda58ab9e', '6803', 'Default interest', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-9bd2-08dcda58ab9e', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.104339+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.104339+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-1bb1-08dcda58ab9f', '6804', 'Financial charges for customer advances', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-3854-08dcda58ab9f', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.108345+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.108345+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-beae-08dcda58ab9f', '6820', 'Financial charges for shareholder A''s current account', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-d9e7-08dcda58ab9f', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.112485+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.112485+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-5b4f-08dcda58aba0', '6830', 'Financial charges for pension fund financing', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-7ab1-08dcda58aba0', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.116597+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.116597+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-22c9-08dcda58aba1', '6840', 'Bank and postal charges', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-3df0-08dcda58aba1', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.121597+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.121597+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-c552-08dcda58aba1', '6841', 'Deposit charges', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-e0d6-08dcda58aba1', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.125769+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.125769+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-61dd-08dcda58aba2', '6842', 'Exchange losses on cash and securities', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-8538-08dcda58aba2', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.129972+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.129972+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-44aa-08dcda58aba7', '6920', 'Depreciation on machinery and tools', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-6181-08dcda58aba7', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.161831+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.161831+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-ea38-08dcda58aba7', '6921', 'Depreciation on furniture and installations', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-07ee-08dcda58aba8', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.16609+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.16609+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-0c8d-08dcda58aba3', '6850', 'Financial income from postal and bank assets', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, true, '34980000-5dd4-0015-760f-08dcdaf3f47f', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.134164+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-22 10:47:29.366946+00', '34980000-5dd4-0015-0e4b-08dcdaf3f479', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-d9f9-08dcda58aba3', '6851', 'Financial income from short-term assets', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, true, '34980000-5dd4-0015-2f7f-08dcdaf3f740', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.139456+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-22 10:47:33.985468+00', '34980000-5dd4-0015-bf6f-08dcdaf3f73f', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-7b17-08dcda58aba4', '6880', 'Financial income from shareholder X''s current account', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, true, '34980000-5dd4-0015-3102-08dcdaf3fc7a', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.143993+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-22 10:47:42.754224+00', '34980000-5dd4-0015-c67f-08dcdaf3fc79', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-2ddf-08dcda58aba5', '6890', 'Financial income from default interest, discounts', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, true, '34980000-5dd4-0015-2e2e-08dcdaf402da', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.148128+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-22 10:47:53.449627+00', '34980000-5dd4-0015-ce34-08dcdaf402d9', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-d5a4-08dcda58aba5', '6891', 'Financial income from advances received', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, true, '34980000-5dd4-0015-6b59-08dcdaf40601', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.152489+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-22 10:47:58.739948+00', '34980000-5dd4-0015-0b81-08dcdaf40601', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-9a10-08dcda58aba6', '6892', 'Foreign exchange gains on cash and securities', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, true, '34980000-5dd4-0015-5e06-08dcdaf408c8', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.157455+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-22 10:48:03.399216+00', '34980000-5dd4-0015-06dd-08dcdaf408c8', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-8cf0-08dcda58aba8', '6922', 'Depreciation on office, IT equipment', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-ab8b-08dcda58aba8', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.170279+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.170279+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-63f6-08dcda58aba9', '6923', 'Depreciation on vehicles', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-8281-08dcda58aba9', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.175781+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.175781+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-073b-08dcda58abaa', '6930', 'Depreciation on operating buildings', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-2580-08dcda58abaa', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.179954+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.179954+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-ae47-08dcda58abaa', '6950', 'Depreciation on incorporation costs', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-cca4-08dcda58abaa', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.184233+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.184233+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-5961-08dcda58abab', '4200', 'Purchases of goods', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-7863-08dcda58abab', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.188628+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.188628+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-6d55-08dcda592ca8', '7910', 'Gains on sale of operating equipment', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, true, '60520000-5dd4-0015-7eb0-08dcda592ca8', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:19:31.595227+00', '60520000-5dd4-0015-d3a0-08dcda592c9f', '2024-09-21 16:19:31.595227+00', '60520000-5dd4-0015-d3a0-08dcda592c9f', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('c4170000-5dd4-0015-c93b-08dcda5963b6', '8002', 'Accounting revaluations', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, true, 'c4170000-5dd4-0015-1b5b-08dcda5963be', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:21:04.011097+00', 'c4170000-5dd4-0015-4cd0-08dcda5963b2', '2024-09-21 16:21:04.011097+00', 'c4170000-5dd4-0015-4cd0-08dcda5963b2', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('c4170000-5dd4-0015-f081-08dcda5963c3', '8004', 'Exceptional gains on disposal of fixed assets', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, true, 'c4170000-5dd4-0015-3937-08dcda5963c4', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:21:04.051604+00', 'c4170000-5dd4-0015-4cd0-08dcda5963b2', '2024-09-21 16:21:04.051604+00', 'c4170000-5dd4-0015-4cd0-08dcda5963b2', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('c4170000-5dd4-0015-e540-08dcda5963c4', '8005', 'Grants received', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, true, 'c4170000-5dd4-0015-e9d3-08dcda5963c4', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:21:04.056157+00', 'c4170000-5dd4-0015-4cd0-08dcda5963b2', '2024-09-21 16:21:04.056157+00', 'c4170000-5dd4-0015-4cd0-08dcda5963b2', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('c4170000-5dd4-0015-7b3c-08dcda5963c5', '8006', 'Income from compensation for damages', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, true, 'c4170000-5dd4-0015-80d4-08dcda5963c5', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:21:04.060017+00', 'c4170000-5dd4-0015-4cd0-08dcda5963b2', '2024-09-21 16:21:04.060017+00', 'c4170000-5dd4-0015-4cd0-08dcda5963b2', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('c4170000-5dd4-0015-3c95-08dcda5963c6', '8500', 'Rental income from premises', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, true, 'c4170000-5dd4-0015-43a9-08dcda5963c6', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:21:04.06501+00', 'c4170000-5dd4-0015-4cd0-08dcda5963b2', '2024-09-21 16:21:04.06501+00', 'c4170000-5dd4-0015-4cd0-08dcda5963b2', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('c4170000-5dd4-0015-ce36-08dcda5963c6', '8501', 'Rental income from apartments', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, true, 'c4170000-5dd4-0015-d659-08dcda5963c6', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:21:04.068765+00', 'c4170000-5dd4-0015-4cd0-08dcda5963b2', '2024-09-21 16:21:04.068765+00', 'c4170000-5dd4-0015-4cd0-08dcda5963b2', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('c4170000-5dd4-0015-5b6f-08dcda5963c7', '8502', 'Rental income from garages', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, true, 'c4170000-5dd4-0015-612f-08dcda5963c7', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:21:04.07232+00', 'c4170000-5dd4-0015-4cd0-08dcda5963b2', '2024-09-21 16:21:04.07232+00', 'c4170000-5dd4-0015-4cd0-08dcda5963b2', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('c4170000-5dd4-0015-e270-08dcda5963c7', '8503', 'Internal rental income', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, true, 'c4170000-5dd4-0015-eaa4-08dcda5963c7', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:21:04.075832+00', 'c4170000-5dd4-0015-4cd0-08dcda5963b2', '2024-09-21 16:21:04.075832+00', 'c4170000-5dd4-0015-4cd0-08dcda5963b2', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('c4170000-5dd4-0015-a031-08dcda5963c8', '8700', 'Fees for expert opinions, conferences', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, true, 'c4170000-5dd4-0015-a87a-08dcda5963c8', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:21:04.080695+00', 'c4170000-5dd4-0015-4cd0-08dcda5963b2', '2024-09-21 16:21:04.080695+00', 'c4170000-5dd4-0015-4cd0-08dcda5963b2', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('c4170000-5dd4-0015-2ef5-08dcda5963c9', '8701', 'Attendance fees', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, true, 'c4170000-5dd4-0015-3ad1-08dcda5963c9', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:21:04.084443+00', 'c4170000-5dd4-0015-4cd0-08dcda5963b2', '2024-09-21 16:21:04.084443+00', 'c4170000-5dd4-0015-4cd0-08dcda5963b2', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('c4170000-5dd4-0015-c838-08dcda5963c9', '7920', 'Gains on sale of buildings', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, true, 'c4170000-5dd4-0015-d027-08dcda5963c9', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:21:04.088263+00', 'c4170000-5dd4-0015-4cd0-08dcda5963b2', '2024-09-21 16:21:04.088263+00', 'c4170000-5dd4-0015-4cd0-08dcda5963b2', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('a05e0000-5dd4-0015-19fc-08dcda59fa1b', '8012', 'Exceptional depreciation', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, 'a05e0000-5dd4-0015-389b-08dcda59fa22', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:25:16.325479+00', 'a05e0000-5dd4-0015-cfa3-08dcda59fa16', '2024-09-21 16:25:16.325479+00', 'a05e0000-5dd4-0015-cfa3-08dcda59fa16', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('a05e0000-5dd4-0015-f4ef-08dcda59fa27', '8014', 'Exceptional losses on disposal of fixed assets', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, 'a05e0000-5dd4-0015-3a9c-08dcda59fa28', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:25:16.365234+00', 'a05e0000-5dd4-0015-cfa3-08dcda59fa16', '2024-09-21 16:25:16.365234+00', 'a05e0000-5dd4-0015-cfa3-08dcda59fa16', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('a05e0000-5dd4-0015-da5d-08dcda59fa28', '8015', 'Exceptional losses on receivables', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, 'a05e0000-5dd4-0015-deda-08dcda59fa28', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:25:16.369476+00', 'a05e0000-5dd4-0015-cfa3-08dcda59fa16', '2024-09-21 16:25:16.369476+00', 'a05e0000-5dd4-0015-cfa3-08dcda59fa16', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('a05e0000-5dd4-0015-5cb3-08dcda59fa29', '8016', 'Expenses for compensation for damages', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, 'a05e0000-5dd4-0015-6165-08dcda59fa29', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:25:16.372819+00', 'a05e0000-5dd4-0015-cfa3-08dcda59fa16', '2024-09-21 16:25:16.372819+00', 'a05e0000-5dd4-0015-cfa3-08dcda59fa16', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('a05e0000-5dd4-0015-febe-08dcda59fa29', '8510', 'Mortgage interest', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, 'a05e0000-5dd4-0015-0397-08dcda59fa2a', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:25:16.37697+00', 'a05e0000-5dd4-0015-cfa3-08dcda59fa16', '2024-09-21 16:25:16.37697+00', 'a05e0000-5dd4-0015-cfa3-08dcda59fa16', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('a05e0000-5dd4-0015-8315-08dcda59fa2a', '8511', 'Building maintenance', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, 'a05e0000-5dd4-0015-8940-08dcda59fa2a', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:25:16.380393+00', 'a05e0000-5dd4-0015-cfa3-08dcda59fa16', '2024-09-21 16:25:16.380393+00', 'a05e0000-5dd4-0015-cfa3-08dcda59fa16', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('a05e0000-5dd4-0015-0e41-08dcda59fa2b', '8512', 'Property rights, taxes, land taxes', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, 'a05e0000-5dd4-0015-13ce-08dcda59fa2b', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:25:16.383935+00', 'a05e0000-5dd4-0015-cfa3-08dcda59fa16', '2024-09-21 16:25:16.383935+00', 'a05e0000-5dd4-0015-cfa3-08dcda59fa16', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('a05e0000-5dd4-0015-923c-08dcda59fa2b', '8513', 'Insurance premiums', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, 'a05e0000-5dd4-0015-9902-08dcda59fa2b', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:25:16.387349+00', 'a05e0000-5dd4-0015-cfa3-08dcda59fa16', '2024-09-21 16:25:16.387349+00', 'a05e0000-5dd4-0015-cfa3-08dcda59fa16', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('a05e0000-5dd4-0015-3db9-08dcda59fa2c', '8514', 'Water, wastewater', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, 'a05e0000-5dd4-0015-448c-08dcda59fa2c', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:25:16.39174+00', 'a05e0000-5dd4-0015-cfa3-08dcda59fa16', '2024-09-21 16:25:16.39174+00', 'a05e0000-5dd4-0015-cfa3-08dcda59fa16', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('a05e0000-5dd4-0015-c462-08dcda59fa2c', '8515', 'Waste disposal', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, 'a05e0000-5dd4-0015-cbf4-08dcda59fa2c', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:25:16.395207+00', 'a05e0000-5dd4-0015-cfa3-08dcda59fa16', '2024-09-21 16:25:16.395207+00', 'a05e0000-5dd4-0015-cfa3-08dcda59fa16', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('a05e0000-5dd4-0015-4669-08dcda59fa2d', '8516', 'Administrative charges', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, 'a05e0000-5dd4-0015-4e9d-08dcda59fa2d', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:25:16.39855+00', 'a05e0000-5dd4-0015-cfa3-08dcda59fa16', '2024-09-21 16:25:16.39855+00', 'a05e0000-5dd4-0015-cfa3-08dcda59fa16', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('a05e0000-5dd4-0015-d67a-08dcda59fa2d', '8710', 'Expenses for non-operating activities', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, 'a05e0000-5dd4-0015-de33-08dcda59fa2d', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:25:16.402226+00', 'a05e0000-5dd4-0015-cfa3-08dcda59fa16', '2024-09-21 16:25:16.402226+00', 'a05e0000-5dd4-0015-cfa3-08dcda59fa16', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('a05e0000-5dd4-0015-87a2-08dcda59fa2e', '8900', 'Corporate income tax', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, 'a05e0000-5dd4-0015-8fcc-08dcda59fa2e', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:25:16.406774+00', 'a05e0000-5dd4-0015-cfa3-08dcda59fa16', '2024-09-21 16:25:16.406774+00', 'a05e0000-5dd4-0015-cfa3-08dcda59fa16', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('a05e0000-5dd4-0015-09cd-08dcda59fa2f', '8901', 'Capital tax', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, 'a05e0000-5dd4-0015-11fe-08dcda59fa2f', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:25:16.410104+00', 'a05e0000-5dd4-0015-cfa3-08dcda59fa16', '2024-09-21 16:25:16.410104+00', 'a05e0000-5dd4-0015-cfa3-08dcda59fa16', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('a05e0000-5dd4-0015-8e15-08dcda59fa2f', '8902', 'Back taxes', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, 'a05e0000-5dd4-0015-9681-08dcda59fa2f', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:25:16.413499+00', 'a05e0000-5dd4-0015-cfa3-08dcda59fa16', '2024-09-21 16:25:16.413499+00', 'a05e0000-5dd4-0015-cfa3-08dcda59fa16', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('a05e0000-5dd4-0015-1f87-08dcda59fa30', '8011', 'Exceptional provisions', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, 'a05e0000-5dd4-0015-2921-08dcda59fa30', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:25:16.417246+00', 'a05e0000-5dd4-0015-cfa3-08dcda59fa16', '2024-09-21 16:25:16.417246+00', 'a05e0000-5dd4-0015-cfa3-08dcda59fa16', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('b0650000-5dd4-0015-41aa-08dcda5af51e', '9100', 'Opening balance sheet', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 4, true, 'b0650000-5dd4-0015-785d-08dcda5af525', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:32:17.45486+00', 'b0650000-5dd4-0015-d93b-08dcda5af519', '2024-09-21 16:32:17.45486+00', 'b0650000-5dd4-0015-d93b-08dcda5af519', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('b0650000-5dd4-0015-188e-08dcda5af52b', '9101', 'Closing balance sheet', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 4, true, 'b0650000-5dd4-0015-5935-08dcda5af52b', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:32:17.493803+00', 'b0650000-5dd4-0015-d93b-08dcda5af519', '2024-09-21 16:32:17.493803+00', 'b0650000-5dd4-0015-d93b-08dcda5af519', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('b0650000-5dd4-0015-fc14-08dcda5af52b', '9200', 'Share of profit for partner X', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 4, true, 'b0650000-5dd4-0015-007d-08dcda5af52c', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:32:17.49812+00', 'b0650000-5dd4-0015-d93b-08dcda5af519', '2024-09-21 16:32:17.49812+00', 'b0650000-5dd4-0015-d93b-08dcda5af519', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('b0650000-5dd4-0015-8079-08dcda5af52c', '9201', 'Share of profit for partner Y', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 4, true, 'b0650000-5dd4-0015-84ff-08dcda5af52c', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:32:17.501513+00', 'b0650000-5dd4-0015-d93b-08dcda5af519', '2024-09-21 16:32:17.501513+00', 'b0650000-5dd4-0015-d93b-08dcda5af519', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('b0650000-5dd4-0015-2435-08dcda5af52d', '9900', 'Grouping entries for debtors', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 4, true, 'b0650000-5dd4-0015-28c0-08dcda5af52d', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:32:17.505704+00', 'b0650000-5dd4-0015-d93b-08dcda5af519', '2024-09-21 16:32:17.505704+00', 'b0650000-5dd4-0015-d93b-08dcda5af519', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('b0650000-5dd4-0015-a67e-08dcda5af52d', '9901', 'Grouping entries for creditors', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 4, true, 'b0650000-5dd4-0015-ac60-08dcda5af52d', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:32:17.509074+00', 'b0650000-5dd4-0015-d93b-08dcda5af519', '2024-09-21 16:32:17.509074+00', 'b0650000-5dd4-0015-d93b-08dcda5af519', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('b0650000-5dd4-0015-6c05-08dcda5af52e', '9910', 'Correction entry', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 4, true, 'b0650000-5dd4-0015-716d-08dcda5af52e', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:32:17.514119+00', 'b0650000-5dd4-0015-d93b-08dcda5af519', '2024-09-21 16:32:17.514119+00', 'b0650000-5dd4-0015-d93b-08dcda5af519', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('b0650000-5dd4-0015-233a-08dcda5af52f', '9000', 'Income statement', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 4, true, 'b0650000-5dd4-0015-2aac-08dcda5af52f', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:32:17.518858+00', 'b0650000-5dd4-0015-d93b-08dcda5af519', '2024-09-21 16:32:17.518858+00', 'b0650000-5dd4-0015-d93b-08dcda5af519', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('4c6f0000-5dd4-0015-cbc6-08dcda56e428', '3902', 'Refunds', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, true, 'b0650000-5dd4-0015-575d-08dcda67d032', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:03:10.969133+00', '4c6f0000-5dd4-0015-fa99-08dcda56e411', '2024-09-21 18:04:18.92145+00', 'b0650000-5dd4-0015-868b-08dcda67d031', NULL); /*TEST VALUES*/ -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('14320000-5dd4-0015-8c30-08dcdb1c487d', 'ZZZ', 'Account for TEST attach', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 4, '14320000-5dd4-0015-a80c-08dcdb1c4884', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-22 15:36:10.198397+00', '14320000-5dd4-0015-c26d-08dcdb1c4876', '2024-09-22 15:36:10.198397+00', '14320000-5dd4-0015-c26d-08dcdb1c4876', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('14320000-5dd4-0015-e9ab-08dcdb1cd8fc', 'ZZZ2', 'Account for TEST attach 2', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 4, '14320000-5dd4-0015-0078-08dcdb1cd8fd', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-22 15:40:12.579411+00', '14320000-5dd4-0015-8003-08dcdb1cd8fc', '2024-09-22 15:40:12.579411+00', '14320000-5dd4-0015-8003-08dcdb1cd8fc', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('14320000-5dd4-0015-8c30-08dcdb1c487d', 'ZZZ', 'Account for TEST attach', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 4, true, '14320000-5dd4-0015-a80c-08dcdb1c4884', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-22 15:36:10.198397+00', '14320000-5dd4-0015-c26d-08dcdb1c4876', '2024-09-22 15:36:10.198397+00', '14320000-5dd4-0015-c26d-08dcdb1c4876', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('14320000-5dd4-0015-e9ab-08dcdb1cd8fc', 'ZZZ2', 'Account for TEST attach 2', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 4, true, '14320000-5dd4-0015-0078-08dcdb1cd8fd', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-22 15:40:12.579411+00', '14320000-5dd4-0015-8003-08dcdb1cd8fc', '2024-09-22 15:40:12.579411+00', '14320000-5dd4-0015-8003-08dcdb1cd8fc', NULL); + + From 28eb57fdb1c5df1c88ad50ed61f53aed01cbd4ea Mon Sep 17 00:00:00 2001 From: fdonnet Date: Thu, 31 Oct 2024 14:39:01 +0100 Subject: [PATCH 06/94] git ignore to always ignore my local cert --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 8a30d258..170efa19 100644 --- a/.gitignore +++ b/.gitignore @@ -396,3 +396,4 @@ FodyWeavers.xsd # JetBrains Rider *.sln.iml +/src/mycert.cer From 3918edae3fd9ae13b599dadc921fda980ee93bf5 Mon Sep 17 00:00:00 2001 From: fdonnet Date: Thu, 31 Oct 2024 16:33:21 +0100 Subject: [PATCH 07/94] Active/Inactive account + add a filter in the BlazorView --- .../Components/Accounts/AccountFilters.razor | 15 ++- .../Accounts/AccountFiltersModel.cs | 1 + .../Components/Accounts/AccountModel.cs | 6 +- .../Components/Accounts/Accounts.razor | 4 + .../Common/Forms/UbikInputToggle.razor | 26 ++++ .../Styles/app.output.css | 115 +++++++++++++++++ .../appsettings.Minikube.json | 29 +++++ .../wwwroot/css/app.css | 119 +++++++++++++++++- 8 files changed, 310 insertions(+), 5 deletions(-) create mode 100644 src/Ubik.Accounting.WebApp.Client/Components/Common/Forms/UbikInputToggle.razor create mode 100644 src/Ubik.Accounting.WebApp/appsettings.Minikube.json diff --git a/src/Ubik.Accounting.WebApp.Client/Components/Accounts/AccountFilters.razor b/src/Ubik.Accounting.WebApp.Client/Components/Accounts/AccountFilters.razor index 1f101d6e..52e09724 100644 --- a/src/Ubik.Accounting.WebApp.Client/Components/Accounts/AccountFilters.razor +++ b/src/Ubik.Accounting.WebApp.Client/Components/Accounts/AccountFilters.razor @@ -22,10 +22,19 @@
+
+ + +
@@ -53,13 +62,15 @@ Filters.DomainFilter = null; Filters.CategoryFilter = null; Filters.CurrencyFilter = null; + Filters.ShowInactive = false; } public async Task ApplyFiltersAsync() { if (Filters.CurrencyFilter == null && Filters.DomainFilter == null - && Filters.CategoryFilter == null) + && Filters.CategoryFilter == null + && !Filters.ShowInactive) Filters.IsFiltersApplied = false; else Filters.IsFiltersApplied = true; diff --git a/src/Ubik.Accounting.WebApp.Client/Components/Accounts/AccountFiltersModel.cs b/src/Ubik.Accounting.WebApp.Client/Components/Accounts/AccountFiltersModel.cs index e68df3e8..b00f048b 100644 --- a/src/Ubik.Accounting.WebApp.Client/Components/Accounts/AccountFiltersModel.cs +++ b/src/Ubik.Accounting.WebApp.Client/Components/Accounts/AccountFiltersModel.cs @@ -8,6 +8,7 @@ public class AccountFiltersModel public Guid? CurrencyFilter { get; set; } = null; public AccountDomain? DomainFilter { get; set; } = null; public AccountCategory? CategoryFilter { get; set; } = null; + public bool ShowInactive { get; set; } = false; } } diff --git a/src/Ubik.Accounting.WebApp.Client/Components/Accounts/AccountModel.cs b/src/Ubik.Accounting.WebApp.Client/Components/Accounts/AccountModel.cs index 65495190..bd2b0603 100644 --- a/src/Ubik.Accounting.WebApp.Client/Components/Accounts/AccountModel.cs +++ b/src/Ubik.Accounting.WebApp.Client/Components/Accounts/AccountModel.cs @@ -22,6 +22,7 @@ public class AccountModel [EnumDataType(typeof(AccountDomain))] [Required] public AccountDomain? Domain { get; set; } = null; + public bool Active { get; set; } = true; [Required] public Guid? CurrencyId { get; set; } public Guid Version { get; init; } @@ -40,6 +41,7 @@ public static IEnumerable ToAccountModel(this IEnumerable a.Active == true); + if (_accountFilters.CurrencyFilter != null) result = result.Where(a => a.CurrencyId == _accountFilters.CurrencyFilter); @@ -165,6 +168,7 @@ Description = currentAccount.Description, Domain = currentAccount.Domain, Label = currentAccount.Label, + Active = currentAccount.Active, Version = currentAccount.Version }; _dialogTitle = $"Edit account ({currentAccount.Code})"; diff --git a/src/Ubik.Accounting.WebApp.Client/Components/Common/Forms/UbikInputToggle.razor b/src/Ubik.Accounting.WebApp.Client/Components/Common/Forms/UbikInputToggle.razor new file mode 100644 index 00000000..09546055 --- /dev/null +++ b/src/Ubik.Accounting.WebApp.Client/Components/Common/Forms/UbikInputToggle.razor @@ -0,0 +1,26 @@ +@inherits InputCheckbox +
+
+ @Label +
+
+ +
+
+ +@code { + [Parameter] + public string Id { get; set; } = "toggle"; + [Parameter] + public string Label { get; set; } = "Toggle me"; +} diff --git a/src/Ubik.Accounting.WebApp/Styles/app.output.css b/src/Ubik.Accounting.WebApp/Styles/app.output.css index 9909a161..922f8052 100644 --- a/src/Ubik.Accounting.WebApp/Styles/app.output.css +++ b/src/Ubik.Accounting.WebApp/Styles/app.output.css @@ -1080,6 +1080,10 @@ p:is(.dark *) { width: 2.5rem; } +.w-11 { + width: 2.75rem; +} + .w-12 { width: 3rem; } @@ -1194,6 +1198,10 @@ p:is(.dark *) { animation: spin 1s linear infinite; } +.cursor-default { + cursor: default; +} + .cursor-not-allowed { cursor: not-allowed; } @@ -1286,6 +1294,10 @@ p:is(.dark *) { border-radius: 0.25rem; } +.rounded-full { + border-radius: 9999px; +} + .rounded-lg { border-radius: 0.5rem; } @@ -1736,6 +1748,65 @@ p:is(.dark *) { box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow); } +.after\:absolute::after { + content: var(--tw-content); + position: absolute; +} + +.after\:start-\[2px\]::after { + content: var(--tw-content); + inset-inline-start: 2px; +} + +.after\:top-\[2px\]::after { + content: var(--tw-content); + top: 2px; +} + +.after\:h-5::after { + content: var(--tw-content); + height: 1.25rem; +} + +.after\:w-5::after { + content: var(--tw-content); + width: 1.25rem; +} + +.after\:rounded-full::after { + content: var(--tw-content); + border-radius: 9999px; +} + +.after\:border::after { + content: var(--tw-content); + border-width: 1px; +} + +.after\:border-gray-300::after { + content: var(--tw-content); + --tw-border-opacity: 1; + border-color: rgb(209 213 219 / var(--tw-border-opacity)); +} + +.after\:bg-white::after { + content: var(--tw-content); + --tw-bg-opacity: 1; + background-color: rgb(255 255 255 / var(--tw-bg-opacity)); +} + +.after\:transition-all::after { + content: var(--tw-content); + transition-property: all; + transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); + transition-duration: 150ms; +} + +.after\:content-\[\'\'\]::after { + --tw-content: ''; + content: var(--tw-content); +} + .hover\:bg-blue-800:hover { --tw-bg-opacity: 1; background-color: rgb(30 64 175 / var(--tw-bg-opacity)); @@ -1876,6 +1947,39 @@ p:is(.dark *) { color: rgb(209 213 219 / var(--tw-text-opacity)); } +.peer:checked ~ .peer-checked\:bg-blue-600 { + --tw-bg-opacity: 1; + background-color: rgb(37 99 235 / var(--tw-bg-opacity)); +} + +.peer:checked ~ .peer-checked\:after\:translate-x-full::after { + content: var(--tw-content); + --tw-translate-x: 100%; + transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); +} + +.peer:checked ~ .peer-checked\:after\:border-white::after { + content: var(--tw-content); + --tw-border-opacity: 1; + border-color: rgb(255 255 255 / var(--tw-border-opacity)); +} + +.peer:focus ~ .peer-focus\:outline-none { + outline: 2px solid transparent; + outline-offset: 2px; +} + +.peer:focus ~ .peer-focus\:ring-4 { + --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color); + --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color); + box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000); +} + +.peer:focus ~ .peer-focus\:ring-blue-300 { + --tw-ring-opacity: 1; + --tw-ring-color: rgb(147 197 253 / var(--tw-ring-opacity)); +} + .dark\:border:is(.dark *) { border-width: 1px; } @@ -2153,6 +2257,11 @@ p:is(.dark *) { color: rgb(55 65 81 / var(--tw-text-opacity)); } +.peer:focus ~ .dark\:peer-focus\:ring-blue-800:is(.dark *) { + --tw-ring-opacity: 1; + --tw-ring-color: rgb(30 64 175 / var(--tw-ring-opacity)); +} + @media (min-width: 640px) { .sm\:col-span-1 { grid-column: span 1 / span 1; @@ -2339,4 +2448,10 @@ p:is(.dark *) { text-align: right; } +.peer:checked ~ .rtl\:peer-checked\:after\:-translate-x-full:where([dir="rtl"], [dir="rtl"] *)::after { + content: var(--tw-content); + --tw-translate-x: -100%; + transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); +} + diff --git a/src/Ubik.Accounting.WebApp/appsettings.Minikube.json b/src/Ubik.Accounting.WebApp/appsettings.Minikube.json new file mode 100644 index 00000000..ff2dac08 --- /dev/null +++ b/src/Ubik.Accounting.WebApp/appsettings.Minikube.json @@ -0,0 +1,29 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + }, + "AuthServer": { + "MetadataAddress": "https://keycloak-local/realms/ubik/.well-known/openid-configuration", + "Authority": "https://keycloak-local/realms/ubik", + "Audience": "account", + "RequireHttpsMetadata": false, + "AuthorizationUrl": "https://keycloak-local/realms/ubik/protocol/openid-connect/auth", + "TokenUrl": "https://keycloak-local/realms/ubik/protocol/openid-connect/token", + "ClientId": "ubik_app", + "ClientSecret": "Ye6Y36ocA4SaGqYzd0HgmqMhVaM2jlkE", + "CookieRefreshTimeInMinutes": 1440, + "RefreshTokenExpTimeInMinutes": 15, + "AuthorizeBadCert": true //TODO never set that to TRUE in PROD + }, + "Apis": { + "AccountingUrl": "http://ubik-proxy/accounting/api/v1/", + "SecurityUrl": "http://ubik-proxy/usrmgt/api/v1/" + }, + "RedisCache": { + "ConnectionString": "localhost" + }, + "AllowedHosts": "*" +} diff --git a/src/Ubik.Accounting.WebApp/wwwroot/css/app.css b/src/Ubik.Accounting.WebApp/wwwroot/css/app.css index 535bce50..922f8052 100644 --- a/src/Ubik.Accounting.WebApp/wwwroot/css/app.css +++ b/src/Ubik.Accounting.WebApp/wwwroot/css/app.css @@ -107,7 +107,7 @@ } /* -! tailwindcss v3.4.12 | MIT License | https://tailwindcss.com +! tailwindcss v3.4.14 | MIT License | https://tailwindcss.com */ /* @@ -550,7 +550,7 @@ video { /* Make elements with the HTML hidden attribute stay hidden by default */ -[hidden] { +[hidden]:where(:not([hidden="until-found"])) { display: none; } @@ -1080,6 +1080,10 @@ p:is(.dark *) { width: 2.5rem; } +.w-11 { + width: 2.75rem; +} + .w-12 { width: 3rem; } @@ -1194,6 +1198,10 @@ p:is(.dark *) { animation: spin 1s linear infinite; } +.cursor-default { + cursor: default; +} + .cursor-not-allowed { cursor: not-allowed; } @@ -1286,6 +1294,10 @@ p:is(.dark *) { border-radius: 0.25rem; } +.rounded-full { + border-radius: 9999px; +} + .rounded-lg { border-radius: 0.5rem; } @@ -1736,6 +1748,65 @@ p:is(.dark *) { box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow); } +.after\:absolute::after { + content: var(--tw-content); + position: absolute; +} + +.after\:start-\[2px\]::after { + content: var(--tw-content); + inset-inline-start: 2px; +} + +.after\:top-\[2px\]::after { + content: var(--tw-content); + top: 2px; +} + +.after\:h-5::after { + content: var(--tw-content); + height: 1.25rem; +} + +.after\:w-5::after { + content: var(--tw-content); + width: 1.25rem; +} + +.after\:rounded-full::after { + content: var(--tw-content); + border-radius: 9999px; +} + +.after\:border::after { + content: var(--tw-content); + border-width: 1px; +} + +.after\:border-gray-300::after { + content: var(--tw-content); + --tw-border-opacity: 1; + border-color: rgb(209 213 219 / var(--tw-border-opacity)); +} + +.after\:bg-white::after { + content: var(--tw-content); + --tw-bg-opacity: 1; + background-color: rgb(255 255 255 / var(--tw-bg-opacity)); +} + +.after\:transition-all::after { + content: var(--tw-content); + transition-property: all; + transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); + transition-duration: 150ms; +} + +.after\:content-\[\'\'\]::after { + --tw-content: ''; + content: var(--tw-content); +} + .hover\:bg-blue-800:hover { --tw-bg-opacity: 1; background-color: rgb(30 64 175 / var(--tw-bg-opacity)); @@ -1876,6 +1947,39 @@ p:is(.dark *) { color: rgb(209 213 219 / var(--tw-text-opacity)); } +.peer:checked ~ .peer-checked\:bg-blue-600 { + --tw-bg-opacity: 1; + background-color: rgb(37 99 235 / var(--tw-bg-opacity)); +} + +.peer:checked ~ .peer-checked\:after\:translate-x-full::after { + content: var(--tw-content); + --tw-translate-x: 100%; + transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); +} + +.peer:checked ~ .peer-checked\:after\:border-white::after { + content: var(--tw-content); + --tw-border-opacity: 1; + border-color: rgb(255 255 255 / var(--tw-border-opacity)); +} + +.peer:focus ~ .peer-focus\:outline-none { + outline: 2px solid transparent; + outline-offset: 2px; +} + +.peer:focus ~ .peer-focus\:ring-4 { + --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color); + --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color); + box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000); +} + +.peer:focus ~ .peer-focus\:ring-blue-300 { + --tw-ring-opacity: 1; + --tw-ring-color: rgb(147 197 253 / var(--tw-ring-opacity)); +} + .dark\:border:is(.dark *) { border-width: 1px; } @@ -2153,6 +2257,11 @@ p:is(.dark *) { color: rgb(55 65 81 / var(--tw-text-opacity)); } +.peer:focus ~ .dark\:peer-focus\:ring-blue-800:is(.dark *) { + --tw-ring-opacity: 1; + --tw-ring-color: rgb(30 64 175 / var(--tw-ring-opacity)); +} + @media (min-width: 640px) { .sm\:col-span-1 { grid-column: span 1 / span 1; @@ -2339,4 +2448,10 @@ p:is(.dark *) { text-align: right; } +.peer:checked ~ .rtl\:peer-checked\:after\:-translate-x-full:where([dir="rtl"], [dir="rtl"] *)::after { + content: var(--tw-content); + --tw-translate-x: -100%; + transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); +} + From af3c77a20a07aa58482ade55ecf11bfcf7bae047 Mon Sep 17 00:00:00 2001 From: fdonnet Date: Thu, 31 Oct 2024 16:57:15 +0100 Subject: [PATCH 08/94] IsActive account in Blazor --- .../Components/Accounts/AccountForm.razor | 3 ++ .../Components/Accounts/Accounts.razor | 31 ++++++++++--------- 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/src/Ubik.Accounting.WebApp.Client/Components/Accounts/AccountForm.razor b/src/Ubik.Accounting.WebApp.Client/Components/Accounts/AccountForm.razor index aff2e60b..a3926573 100644 --- a/src/Ubik.Accounting.WebApp.Client/Components/Accounts/AccountForm.razor +++ b/src/Ubik.Accounting.WebApp.Client/Components/Accounts/AccountForm.razor @@ -9,6 +9,9 @@
+
+ +
a.Active == true); var result = _accounts; - if(!_accountFilters.ShowInactive) + if (!_accountFilters.ShowInactive) result = result.Where(a => a.Active == true); if (_accountFilters.CurrencyFilter != null) @@ -160,17 +163,17 @@ { _editMode = true; _accountCurrent = new() - { - Category = currentAccount.Category, - Code = currentAccount.Code, - CurrencyId = currentAccount.CurrencyId, - Id = currentAccount.Id, - Description = currentAccount.Description, - Domain = currentAccount.Domain, - Label = currentAccount.Label, - Active = currentAccount.Active, - Version = currentAccount.Version - }; + { + Category = currentAccount.Category, + Code = currentAccount.Code, + CurrencyId = currentAccount.CurrencyId, + Id = currentAccount.Id, + Description = currentAccount.Description, + Domain = currentAccount.Domain, + Label = currentAccount.Label, + Active = currentAccount.Active, + Version = currentAccount.Version + }; _dialogTitle = $"Edit account ({currentAccount.Code})"; await _dialog.ShowDialogAsync(); } From 4529983af63bac84fecec418eccc3f8770abb7fd Mon Sep 17 00:00:00 2001 From: fdonnet Date: Thu, 31 Oct 2024 17:53:16 +0100 Subject: [PATCH 09/94] Correction of bug in unique index for security api. --- src/Ubik.Security.Api/Data/SecurityDbContext.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Ubik.Security.Api/Data/SecurityDbContext.cs b/src/Ubik.Security.Api/Data/SecurityDbContext.cs index d1e7a015..0b7133fa 100644 --- a/src/Ubik.Security.Api/Data/SecurityDbContext.cs +++ b/src/Ubik.Security.Api/Data/SecurityDbContext.cs @@ -76,6 +76,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) new RoleConfiguration().Configure(modelBuilder.Entity()); new AuthorizationConfiguration().Configure(modelBuilder.Entity()); new RoleAuthorizationConfiguration().Configure(modelBuilder.Entity()); + new UserRoleByTenantConfiguration().Configure(modelBuilder.Entity()); base.OnModelCreating(modelBuilder); } From 3c71f96489cc6cc5edbd301c795d3978b9f07d45 Mon Sep 17 00:00:00 2001 From: ubik Date: Thu, 31 Oct 2024 20:59:02 +0100 Subject: [PATCH 10/94] Big commit: rename accounting api to accounting-structure.api --- .../accounting-structure-api-deploy.yaml} | 16 ++++++++-------- deploy/deploy-local-readme.md | 8 ++++---- deploy/ubik-proxy/proxy-api-deploy.yaml | 2 +- docker-integration-tests.yml | 4 ++-- .../.dockerignore | 0 .../Data/AccountingDbContext.cs | 6 +++--- .../Config/AccountAccountGroupConfiguration.cs | 4 ++-- .../Data/Config/AccountConfiguration.cs | 4 ++-- .../Data/Config/AccountGroupConfiguration.cs | 4 ++-- .../Data/Config/AccountVatConfigConfiguration.cs | 4 ++-- .../Data/Config/ClassificationConfiguration.cs | 4 ++-- .../Data/Config/CurrencyConfiguration.cs | 4 ++-- .../Data/Config/EntryConfiguration.cs | 4 ++-- .../Data/Config/TransactionConfiguration.cs | 4 ++-- .../Data/Config/VatRateConfiguration.cs | 4 ++-- .../Data/Init/AccountGroupsData.cs | 2 +- .../Data/Init/AccountGroupsData.sql | 0 .../Data/Init/AccountsAccountGroupsData.cs | 2 +- .../Data/Init/AccountsAccountGroupsData.sql | 0 .../Data/Init/AccountsData.cs | 2 +- .../Data/Init/AccountsData.sql | 0 .../Data/Init/BaseValues.cs | 2 +- .../Data/Init/ClassificationsData.cs | 4 ++-- .../Data/Init/CurrenciesData.cs | 4 ++-- .../Data/Init/DbInitializer.cs | 2 +- .../Data/Init/UsersData.cs | 2 +- .../Dockerfile | 12 ++++++------ .../Controller/v1/AccountGroupsController.cs | 6 +++--- .../Errors/AccountGroupParentNotFoundError.cs | 2 +- .../Services/AccountGroupCommandService.cs | 10 +++++----- .../Services/AccountGroupQueryService.cs | 6 +++--- .../Services/IAccountGroupCommandService.cs | 4 ++-- .../Services/IAccountGroupQueryService.cs | 4 ++-- .../Accounts/Controller/v1/AccountsController.cs | 6 +++--- .../CustomPoco/AccountGroupClassification.cs | 2 +- .../AccountAlreadyExistsInClassificationError.cs | 2 +- .../AccountLinkedToExistingEntriesError.cs | 2 +- .../AccountNotExistsInAccountGroupError.cs | 2 +- .../Accounts/Services/AccountCommandService.cs | 10 +++++----- .../Accounts/Services/AccountQueryService.cs | 8 ++++---- .../Accounts/Services/IAccountCommandService.cs | 4 ++-- .../Accounts/Services/IAccountQueryService.cs | 6 +++--- .../Controllers/v1/ApplicationController.cs | 4 ++-- .../Services/ApplicationCommandService.cs | 6 +++--- .../Services/IApplicationCommandService.cs | 2 +- .../Controller/v1/ClassificationsController.cs | 6 +++--- .../CustomPoco/ClassificationStatus.cs | 4 ++-- .../Services/ClassificationCommandService.cs | 8 ++++---- .../Services/ClassificationQueryService.cs | 8 ++++---- .../Services/IClassificationCommandService.cs | 4 ++-- .../Services/IClassificationQueryService.cs | 6 +++--- .../Controller/v1/CurrenciesController.cs | 6 +++--- .../Currencies/Services/CurrencyQueryService.cs | 6 +++--- .../Currencies/Services/ICurrencyQueryService.cs | 4 ++-- .../VatRates/Services/IVatRateCommandService.cs | 4 ++-- .../VatRates/Services/IVatRateQueryService.cs | 4 ++-- .../VatRates/Services/VatRateCommandService.cs | 8 ++++---- .../VatRates/Services/VatRateQueryService.cs | 6 +++--- .../Mappers/AccountGroupMappers.cs | 4 ++-- .../Mappers/AccountMappers.cs | 6 +++--- .../Mappers/ClassificationMappers.cs | 6 +++--- .../Mappers/CurrencyMappers.cs | 4 ++-- .../Mappers/VatRateMappers.cs | 4 ++-- .../Metrics/prometheus.yml | 0 .../Metrics/startdocker.txt | 0 .../Models/Account.cs | 2 +- .../Models/AccountAccountGroup.cs | 2 +- .../Models/AccountGroup.cs | 2 +- .../Models/AccountVatConfig.cs | 2 +- .../Models/Classification.cs | 2 +- .../Models/Currency.cs | 2 +- .../Models/Entry.cs | 2 +- .../Models/Transaction.cs | 2 +- .../Models/VatRate.cs | 2 +- .../Program.cs | 16 ++++++++-------- .../Properties/launchSettings.json | 0 .../Ubik.Accounting.Structure.Api.csproj} | 0 .../appsettings.Development.json | 0 .../appsettings.json | 0 .../tailwind.extension.json | 0 src/Ubik.CodeGenerator/ContractsGenerator.cs | 2 +- src/Ubik.CodeGenerator/MappersGenerator.cs | 2 +- src/Ubik.CodeGenerator/Program.cs | 2 +- src/Ubik.CodeGenerator/ServicesGenerator.cs | 2 +- src/Ubik.CodeGenerator/Ubik.CodeGenerator.csproj | 3 ++- src/Ubik.sln | 2 +- .../Ubik.Accounting.Api.Tests.UnitTests.csproj | 2 +- .../ClassificationsController_Test.cs | 2 +- .../Ubik.Api.Tests.Integration.csproj | 3 ++- 89 files changed, 172 insertions(+), 170 deletions(-) rename deploy/{accounting-api/accounting-api-deploy.yaml => accounting-structure-api/accounting-structure-api-deploy.yaml} (80%) rename src/{Ubik.Accounting.Api => Ubik.Accounting.Structure.Api}/.dockerignore (100%) rename src/{Ubik.Accounting.Api => Ubik.Accounting.Structure.Api}/Data/AccountingDbContext.cs (97%) rename src/{Ubik.Accounting.Api => Ubik.Accounting.Structure.Api}/Data/Config/AccountAccountGroupConfiguration.cs (91%) rename src/{Ubik.Accounting.Api => Ubik.Accounting.Structure.Api}/Data/Config/AccountConfiguration.cs (94%) rename src/{Ubik.Accounting.Api => Ubik.Accounting.Structure.Api}/Data/Config/AccountGroupConfiguration.cs (94%) rename src/{Ubik.Accounting.Api => Ubik.Accounting.Structure.Api}/Data/Config/AccountVatConfigConfiguration.cs (92%) rename src/{Ubik.Accounting.Api => Ubik.Accounting.Structure.Api}/Data/Config/ClassificationConfiguration.cs (91%) rename src/{Ubik.Accounting.Api => Ubik.Accounting.Structure.Api}/Data/Config/CurrencyConfiguration.cs (88%) rename src/{Ubik.Accounting.Api => Ubik.Accounting.Structure.Api}/Data/Config/EntryConfiguration.cs (95%) rename src/{Ubik.Accounting.Api => Ubik.Accounting.Structure.Api}/Data/Config/TransactionConfiguration.cs (90%) rename src/{Ubik.Accounting.Api => Ubik.Accounting.Structure.Api}/Data/Config/VatRateConfiguration.cs (91%) rename src/{Ubik.Accounting.Api => Ubik.Accounting.Structure.Api}/Data/Init/AccountGroupsData.cs (91%) rename src/{Ubik.Accounting.Api => Ubik.Accounting.Structure.Api}/Data/Init/AccountGroupsData.sql (100%) rename src/{Ubik.Accounting.Api => Ubik.Accounting.Structure.Api}/Data/Init/AccountsAccountGroupsData.cs (91%) rename src/{Ubik.Accounting.Api => Ubik.Accounting.Structure.Api}/Data/Init/AccountsAccountGroupsData.sql (100%) rename src/{Ubik.Accounting.Api => Ubik.Accounting.Structure.Api}/Data/Init/AccountsData.cs (90%) rename src/{Ubik.Accounting.Api => Ubik.Accounting.Structure.Api}/Data/Init/AccountsData.sql (100%) rename src/{Ubik.Accounting.Api => Ubik.Accounting.Structure.Api}/Data/Init/BaseValues.cs (98%) rename src/{Ubik.Accounting.Api => Ubik.Accounting.Structure.Api}/Data/Init/ClassificationsData.cs (97%) rename src/{Ubik.Accounting.Api => Ubik.Accounting.Structure.Api}/Data/Init/CurrenciesData.cs (92%) rename src/{Ubik.Accounting.Api => Ubik.Accounting.Structure.Api}/Data/Init/DbInitializer.cs (88%) rename src/{Ubik.Accounting.Api => Ubik.Accounting.Structure.Api}/Data/Init/UsersData.cs (96%) rename src/{Ubik.Accounting.Api => Ubik.Accounting.Structure.Api}/Dockerfile (72%) rename src/{Ubik.Accounting.Api => Ubik.Accounting.Structure.Api}/Features/AccountGroups/Controller/v1/AccountGroupsController.cs (96%) rename src/{Ubik.Accounting.Api => Ubik.Accounting.Structure.Api}/Features/AccountGroups/Errors/AccountGroupParentNotFoundError.cs (91%) rename src/{Ubik.Accounting.Api => Ubik.Accounting.Structure.Api}/Features/AccountGroups/Services/AccountGroupCommandService.cs (96%) rename src/{Ubik.Accounting.Api => Ubik.Accounting.Structure.Api}/Features/AccountGroups/Services/AccountGroupQueryService.cs (91%) rename src/{Ubik.Accounting.Api => Ubik.Accounting.Structure.Api}/Features/AccountGroups/Services/IAccountGroupCommandService.cs (81%) rename src/{Ubik.Accounting.Api => Ubik.Accounting.Structure.Api}/Features/AccountGroups/Services/IAccountGroupQueryService.cs (75%) rename src/{Ubik.Accounting.Api => Ubik.Accounting.Structure.Api}/Features/Accounts/Controller/v1/AccountsController.cs (97%) rename src/{Ubik.Accounting.Api => Ubik.Accounting.Structure.Api}/Features/Accounts/CustomPoco/AccountGroupClassification.cs (84%) rename src/{Ubik.Accounting.Api => Ubik.Accounting.Structure.Api}/Features/Accounts/Errors/AccountAlreadyExistsInClassificationError.cs (92%) rename src/{Ubik.Accounting.Api => Ubik.Accounting.Structure.Api}/Features/Accounts/Errors/AccountLinkedToExistingEntriesError.cs (92%) rename src/{Ubik.Accounting.Api => Ubik.Accounting.Structure.Api}/Features/Accounts/Errors/AccountNotExistsInAccountGroupError.cs (92%) rename src/{Ubik.Accounting.Api => Ubik.Accounting.Structure.Api}/Features/Accounts/Services/AccountCommandService.cs (97%) rename src/{Ubik.Accounting.Api => Ubik.Accounting.Structure.Api}/Features/Accounts/Services/AccountQueryService.cs (91%) rename src/{Ubik.Accounting.Api => Ubik.Accounting.Structure.Api}/Features/Accounts/Services/IAccountCommandService.cs (86%) rename src/{Ubik.Accounting.Api => Ubik.Accounting.Structure.Api}/Features/Accounts/Services/IAccountQueryService.cs (73%) rename src/{Ubik.Accounting.Api => Ubik.Accounting.Structure.Api}/Features/Application/Controllers/v1/ApplicationController.cs (84%) rename src/{Ubik.Accounting.Api => Ubik.Accounting.Structure.Api}/Features/Application/Services/ApplicationCommandService.cs (80%) rename src/{Ubik.Accounting.Api => Ubik.Accounting.Structure.Api}/Features/Application/Services/IApplicationCommandService.cs (61%) rename src/{Ubik.Accounting.Api => Ubik.Accounting.Structure.Api}/Features/Classifications/Controller/v1/ClassificationsController.cs (97%) rename src/{Ubik.Accounting.Api => Ubik.Accounting.Structure.Api}/Features/Classifications/CustomPoco/ClassificationStatus.cs (63%) rename src/{Ubik.Accounting.Api => Ubik.Accounting.Structure.Api}/Features/Classifications/Services/ClassificationCommandService.cs (97%) rename src/{Ubik.Accounting.Api => Ubik.Accounting.Structure.Api}/Features/Classifications/Services/ClassificationQueryService.cs (94%) rename src/{Ubik.Accounting.Api => Ubik.Accounting.Structure.Api}/Features/Classifications/Services/IClassificationCommandService.cs (81%) rename src/{Ubik.Accounting.Api => Ubik.Accounting.Structure.Api}/Features/Classifications/Services/IClassificationQueryService.cs (76%) rename src/{Ubik.Accounting.Api => Ubik.Accounting.Structure.Api}/Features/Currencies/Controller/v1/CurrenciesController.cs (79%) rename src/{Ubik.Accounting.Api => Ubik.Accounting.Structure.Api}/Features/Currencies/Services/CurrencyQueryService.cs (64%) rename src/{Ubik.Accounting.Api => Ubik.Accounting.Structure.Api}/Features/Currencies/Services/ICurrencyQueryService.cs (50%) rename src/{Ubik.Accounting.Api => Ubik.Accounting.Structure.Api}/Features/VatRates/Services/IVatRateCommandService.cs (80%) rename src/{Ubik.Accounting.Api => Ubik.Accounting.Structure.Api}/Features/VatRates/Services/IVatRateQueryService.cs (68%) rename src/{Ubik.Accounting.Api => Ubik.Accounting.Structure.Api}/Features/VatRates/Services/VatRateCommandService.cs (96%) rename src/{Ubik.Accounting.Api => Ubik.Accounting.Structure.Api}/Features/VatRates/Services/VatRateQueryService.cs (81%) rename src/{Ubik.Accounting.Api => Ubik.Accounting.Structure.Api}/Mappers/AccountGroupMappers.cs (98%) rename src/{Ubik.Accounting.Api => Ubik.Accounting.Structure.Api}/Mappers/AccountMappers.cs (97%) rename src/{Ubik.Accounting.Api => Ubik.Accounting.Structure.Api}/Mappers/ClassificationMappers.cs (96%) rename src/{Ubik.Accounting.Api => Ubik.Accounting.Structure.Api}/Mappers/CurrencyMappers.cs (82%) rename src/{Ubik.Accounting.Api => Ubik.Accounting.Structure.Api}/Mappers/VatRateMappers.cs (97%) rename src/{Ubik.Accounting.Api => Ubik.Accounting.Structure.Api}/Metrics/prometheus.yml (100%) rename src/{Ubik.Accounting.Api => Ubik.Accounting.Structure.Api}/Metrics/startdocker.txt (100%) rename src/{Ubik.Accounting.Api => Ubik.Accounting.Structure.Api}/Models/Account.cs (94%) rename src/{Ubik.Accounting.Api => Ubik.Accounting.Structure.Api}/Models/AccountAccountGroup.cs (93%) rename src/{Ubik.Accounting.Api => Ubik.Accounting.Structure.Api}/Models/AccountGroup.cs (95%) rename src/{Ubik.Accounting.Api => Ubik.Accounting.Structure.Api}/Models/AccountVatConfig.cs (93%) rename src/{Ubik.Accounting.Api => Ubik.Accounting.Structure.Api}/Models/Classification.cs (93%) rename src/{Ubik.Accounting.Api => Ubik.Accounting.Structure.Api}/Models/Currency.cs (89%) rename src/{Ubik.Accounting.Api => Ubik.Accounting.Structure.Api}/Models/Entry.cs (97%) rename src/{Ubik.Accounting.Api => Ubik.Accounting.Structure.Api}/Models/Transaction.cs (93%) rename src/{Ubik.Accounting.Api => Ubik.Accounting.Structure.Api}/Models/VatRate.cs (93%) rename src/{Ubik.Accounting.Api => Ubik.Accounting.Structure.Api}/Program.cs (94%) rename src/{Ubik.Accounting.Api => Ubik.Accounting.Structure.Api}/Properties/launchSettings.json (100%) rename src/{Ubik.Accounting.Api/Ubik.Accounting.Api.csproj => Ubik.Accounting.Structure.Api/Ubik.Accounting.Structure.Api.csproj} (100%) rename src/{Ubik.Accounting.Api => Ubik.Accounting.Structure.Api}/appsettings.Development.json (100%) rename src/{Ubik.Accounting.Api => Ubik.Accounting.Structure.Api}/appsettings.json (100%) rename src/{Ubik.Accounting.Api => Ubik.Accounting.Structure.Api}/tailwind.extension.json (100%) diff --git a/deploy/accounting-api/accounting-api-deploy.yaml b/deploy/accounting-structure-api/accounting-structure-api-deploy.yaml similarity index 80% rename from deploy/accounting-api/accounting-api-deploy.yaml rename to deploy/accounting-structure-api/accounting-structure-api-deploy.yaml index 0db8d0da..919d1dd9 100644 --- a/deploy/accounting-api/accounting-api-deploy.yaml +++ b/deploy/accounting-structure-api/accounting-structure-api-deploy.yaml @@ -1,22 +1,22 @@ apiVersion: apps/v1 kind: Deployment metadata: - name: accounting-api + name: accounting-structure-api labels: - app: accounting-api + app: accounting-structure-api spec: replicas: 1 selector: matchLabels: - app: accounting-api + app: accounting-structure-api template: metadata: labels: - app: accounting-api + app: accounting-structure-api spec: containers: - - name: accounting-api - image: ubik-accounting-api-test:latest + - name: accounting-structure-api + image: ubik-accounting-structure-api-test:latest imagePullPolicy: Never env: - name: ConnectionStrings__AccountingContext @@ -41,10 +41,10 @@ spec: apiVersion: v1 kind: Service metadata: - name: accounting-api + name: accounting-structure-api spec: selector: - app: accounting-api + app: accounting-structure-api ports: - protocol: TCP port: 80 diff --git a/deploy/deploy-local-readme.md b/deploy/deploy-local-readme.md index 9c3808f8..54c1e4ce 100644 --- a/deploy/deploy-local-readme.md +++ b/deploy/deploy-local-readme.md @@ -73,19 +73,19 @@ To remember the commands only: `helm install ubik-cache bitnami/redis -f ./redis/values-dev.yaml` -## Accounting Api +## Accounting Structure Api Build image -`docker build -t ubik-accounting-api-test:latest -f ../src/Ubik.Accounting.Api/Dockerfile ../` +`docker build -t ubik-accounting-structure-api-test:latest -f ../src/Ubik.Accounting.Structure.Api/Dockerfile ../` Load image in minikube -`minikube image load ubik-accounting-api-test:latest` +`minikube image load ubik-accounting-structure-api-test:latest` Apply deployement -`kubectl apply -f ./accounting-api/accounting-api-deploy.yaml` +`kubectl apply -f ./accounting-structure-api/accounting-structure-api-deploy.yaml` ## Security api diff --git a/deploy/ubik-proxy/proxy-api-deploy.yaml b/deploy/ubik-proxy/proxy-api-deploy.yaml index 596ecf0f..99314fdf 100644 --- a/deploy/ubik-proxy/proxy-api-deploy.yaml +++ b/deploy/ubik-proxy/proxy-api-deploy.yaml @@ -36,7 +36,7 @@ spec: - name: ReverseProxy__Clusters__ubik_users_admin__Destinations__destination1__Address value: http://security-api/ - name: ReverseProxy__Clusters__ubik_accounting__Destinations__destination1__Address - value: http://accounting-api/ + value: http://accounting-structure-api/ - name: RedisCache__ConnectionString value: ubik-cache-redis-master:6379 ports: diff --git a/docker-integration-tests.yml b/docker-integration-tests.yml index 4e9bfbf8..878911cd 100644 --- a/docker-integration-tests.yml +++ b/docker-integration-tests.yml @@ -30,8 +30,8 @@ services: accounting-api-test: build: context: ./ - dockerfile: src/Ubik.Accounting.Api/Dockerfile - container_name: "ubik-accounting-api-test" + dockerfile: src/Ubik.Accounting.Structure.Api/Dockerfile + container_name: "ubik-accounting-structure-api-test" environment: - "ASPNETCORE_ENVIRONMENT=Development" - "AuthServer__MetadataAddress=http://keycloak:8080/realms/ubik/.well-known/openid-configuration" diff --git a/src/Ubik.Accounting.Api/.dockerignore b/src/Ubik.Accounting.Structure.Api/.dockerignore similarity index 100% rename from src/Ubik.Accounting.Api/.dockerignore rename to src/Ubik.Accounting.Structure.Api/.dockerignore diff --git a/src/Ubik.Accounting.Api/Data/AccountingDbContext.cs b/src/Ubik.Accounting.Structure.Api/Data/AccountingDbContext.cs similarity index 97% rename from src/Ubik.Accounting.Api/Data/AccountingDbContext.cs rename to src/Ubik.Accounting.Structure.Api/Data/AccountingDbContext.cs index 62c8077f..5341816b 100644 --- a/src/Ubik.Accounting.Api/Data/AccountingDbContext.cs +++ b/src/Ubik.Accounting.Structure.Api/Data/AccountingDbContext.cs @@ -1,13 +1,13 @@ using MassTransit; using Microsoft.EntityFrameworkCore; -using Ubik.Accounting.Api.Data.Config; -using Ubik.Accounting.Api.Models; +using Ubik.Accounting.Structure.Api.Data.Config; +using Ubik.Accounting.Structure.Api.Models; using Ubik.ApiService.Common.Errors; using Ubik.ApiService.Common.Exceptions; using Ubik.ApiService.Common.Services; using Ubik.DB.Common.Extensions; -namespace Ubik.Accounting.Api.Data +namespace Ubik.Accounting.Structure.Api.Data { public class AccountingDbContext(DbContextOptions options , ICurrentUser userService) : DbContext(options) diff --git a/src/Ubik.Accounting.Api/Data/Config/AccountAccountGroupConfiguration.cs b/src/Ubik.Accounting.Structure.Api/Data/Config/AccountAccountGroupConfiguration.cs similarity index 91% rename from src/Ubik.Accounting.Api/Data/Config/AccountAccountGroupConfiguration.cs rename to src/Ubik.Accounting.Structure.Api/Data/Config/AccountAccountGroupConfiguration.cs index c84ed69a..8784541f 100644 --- a/src/Ubik.Accounting.Api/Data/Config/AccountAccountGroupConfiguration.cs +++ b/src/Ubik.Accounting.Structure.Api/Data/Config/AccountAccountGroupConfiguration.cs @@ -1,8 +1,8 @@ using Microsoft.EntityFrameworkCore.Metadata.Builders; using Microsoft.EntityFrameworkCore; -using Ubik.Accounting.Api.Models; +using Ubik.Accounting.Structure.Api.Models; -namespace Ubik.Accounting.Api.Data.Config +namespace Ubik.Accounting.Structure.Api.Data.Config { //TODO: manage the selected tenant and implement mandantor too for all the configs public class AccountAccountGroupConfiguration : IEntityTypeConfiguration diff --git a/src/Ubik.Accounting.Api/Data/Config/AccountConfiguration.cs b/src/Ubik.Accounting.Structure.Api/Data/Config/AccountConfiguration.cs similarity index 94% rename from src/Ubik.Accounting.Api/Data/Config/AccountConfiguration.cs rename to src/Ubik.Accounting.Structure.Api/Data/Config/AccountConfiguration.cs index 1e845140..07c9afde 100644 --- a/src/Ubik.Accounting.Api/Data/Config/AccountConfiguration.cs +++ b/src/Ubik.Accounting.Structure.Api/Data/Config/AccountConfiguration.cs @@ -1,8 +1,8 @@ using Microsoft.EntityFrameworkCore.Metadata.Builders; using Microsoft.EntityFrameworkCore; -using Ubik.Accounting.Api.Models; +using Ubik.Accounting.Structure.Api.Models; -namespace Ubik.Accounting.Api.Data.Config +namespace Ubik.Accounting.Structure.Api.Data.Config { public class AccountConfiguration : IEntityTypeConfiguration { diff --git a/src/Ubik.Accounting.Api/Data/Config/AccountGroupConfiguration.cs b/src/Ubik.Accounting.Structure.Api/Data/Config/AccountGroupConfiguration.cs similarity index 94% rename from src/Ubik.Accounting.Api/Data/Config/AccountGroupConfiguration.cs rename to src/Ubik.Accounting.Structure.Api/Data/Config/AccountGroupConfiguration.cs index fd1be530..6b06e9ed 100644 --- a/src/Ubik.Accounting.Api/Data/Config/AccountGroupConfiguration.cs +++ b/src/Ubik.Accounting.Structure.Api/Data/Config/AccountGroupConfiguration.cs @@ -1,8 +1,8 @@ using Microsoft.EntityFrameworkCore.Metadata.Builders; using Microsoft.EntityFrameworkCore; -using Ubik.Accounting.Api.Models; +using Ubik.Accounting.Structure.Api.Models; -namespace Ubik.Accounting.Api.Data.Config +namespace Ubik.Accounting.Structure.Api.Data.Config { public class AccountGroupConfiguration : IEntityTypeConfiguration { diff --git a/src/Ubik.Accounting.Api/Data/Config/AccountVatConfigConfiguration.cs b/src/Ubik.Accounting.Structure.Api/Data/Config/AccountVatConfigConfiguration.cs similarity index 92% rename from src/Ubik.Accounting.Api/Data/Config/AccountVatConfigConfiguration.cs rename to src/Ubik.Accounting.Structure.Api/Data/Config/AccountVatConfigConfiguration.cs index 5d0dd8da..1c3bfc08 100644 --- a/src/Ubik.Accounting.Api/Data/Config/AccountVatConfigConfiguration.cs +++ b/src/Ubik.Accounting.Structure.Api/Data/Config/AccountVatConfigConfiguration.cs @@ -1,8 +1,8 @@ using Microsoft.EntityFrameworkCore.Metadata.Builders; using Microsoft.EntityFrameworkCore; -using Ubik.Accounting.Api.Models; +using Ubik.Accounting.Structure.Api.Models; -namespace Ubik.Accounting.Api.Data.Config +namespace Ubik.Accounting.Structure.Api.Data.Config { public class AccountVatConfigConfiguration : IEntityTypeConfiguration { diff --git a/src/Ubik.Accounting.Api/Data/Config/ClassificationConfiguration.cs b/src/Ubik.Accounting.Structure.Api/Data/Config/ClassificationConfiguration.cs similarity index 91% rename from src/Ubik.Accounting.Api/Data/Config/ClassificationConfiguration.cs rename to src/Ubik.Accounting.Structure.Api/Data/Config/ClassificationConfiguration.cs index 9152c43d..e60b9b58 100644 --- a/src/Ubik.Accounting.Api/Data/Config/ClassificationConfiguration.cs +++ b/src/Ubik.Accounting.Structure.Api/Data/Config/ClassificationConfiguration.cs @@ -1,8 +1,8 @@ using Microsoft.EntityFrameworkCore.Metadata.Builders; using Microsoft.EntityFrameworkCore; -using Ubik.Accounting.Api.Models; +using Ubik.Accounting.Structure.Api.Models; -namespace Ubik.Accounting.Api.Data.Config +namespace Ubik.Accounting.Structure.Api.Data.Config { public class ClassificationConfiguration : IEntityTypeConfiguration { diff --git a/src/Ubik.Accounting.Api/Data/Config/CurrencyConfiguration.cs b/src/Ubik.Accounting.Structure.Api/Data/Config/CurrencyConfiguration.cs similarity index 88% rename from src/Ubik.Accounting.Api/Data/Config/CurrencyConfiguration.cs rename to src/Ubik.Accounting.Structure.Api/Data/Config/CurrencyConfiguration.cs index 3b6424e4..59a3f788 100644 --- a/src/Ubik.Accounting.Api/Data/Config/CurrencyConfiguration.cs +++ b/src/Ubik.Accounting.Structure.Api/Data/Config/CurrencyConfiguration.cs @@ -1,8 +1,8 @@ using Microsoft.EntityFrameworkCore.Metadata.Builders; using Microsoft.EntityFrameworkCore; -using Ubik.Accounting.Api.Models; +using Ubik.Accounting.Structure.Api.Models; -namespace Ubik.Accounting.Api.Data.Config +namespace Ubik.Accounting.Structure.Api.Data.Config { public class CurrencyConfiguration : IEntityTypeConfiguration { diff --git a/src/Ubik.Accounting.Api/Data/Config/EntryConfiguration.cs b/src/Ubik.Accounting.Structure.Api/Data/Config/EntryConfiguration.cs similarity index 95% rename from src/Ubik.Accounting.Api/Data/Config/EntryConfiguration.cs rename to src/Ubik.Accounting.Structure.Api/Data/Config/EntryConfiguration.cs index c5eee9a2..691f8775 100644 --- a/src/Ubik.Accounting.Api/Data/Config/EntryConfiguration.cs +++ b/src/Ubik.Accounting.Structure.Api/Data/Config/EntryConfiguration.cs @@ -1,8 +1,8 @@ using Microsoft.EntityFrameworkCore.Metadata.Builders; using Microsoft.EntityFrameworkCore; -using Ubik.Accounting.Api.Models; +using Ubik.Accounting.Structure.Api.Models; -namespace Ubik.Accounting.Api.Data.Config +namespace Ubik.Accounting.Structure.Api.Data.Config { public class EntryConfiguration : IEntityTypeConfiguration { diff --git a/src/Ubik.Accounting.Api/Data/Config/TransactionConfiguration.cs b/src/Ubik.Accounting.Structure.Api/Data/Config/TransactionConfiguration.cs similarity index 90% rename from src/Ubik.Accounting.Api/Data/Config/TransactionConfiguration.cs rename to src/Ubik.Accounting.Structure.Api/Data/Config/TransactionConfiguration.cs index e73567d9..845e7260 100644 --- a/src/Ubik.Accounting.Api/Data/Config/TransactionConfiguration.cs +++ b/src/Ubik.Accounting.Structure.Api/Data/Config/TransactionConfiguration.cs @@ -1,8 +1,8 @@ using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Ubik.Accounting.Api.Models; +using Ubik.Accounting.Structure.Api.Models; -namespace Ubik.Accounting.Api.Data.Config +namespace Ubik.Accounting.Structure.Api.Data.Config { public class TransactionConfiguration : IEntityTypeConfiguration { diff --git a/src/Ubik.Accounting.Api/Data/Config/VatRateConfiguration.cs b/src/Ubik.Accounting.Structure.Api/Data/Config/VatRateConfiguration.cs similarity index 91% rename from src/Ubik.Accounting.Api/Data/Config/VatRateConfiguration.cs rename to src/Ubik.Accounting.Structure.Api/Data/Config/VatRateConfiguration.cs index 1d7a52a2..cf0b9e32 100644 --- a/src/Ubik.Accounting.Api/Data/Config/VatRateConfiguration.cs +++ b/src/Ubik.Accounting.Structure.Api/Data/Config/VatRateConfiguration.cs @@ -1,8 +1,8 @@ using Microsoft.EntityFrameworkCore.Metadata.Builders; using Microsoft.EntityFrameworkCore; -using Ubik.Accounting.Api.Models; +using Ubik.Accounting.Structure.Api.Models; -namespace Ubik.Accounting.Api.Data.Config +namespace Ubik.Accounting.Structure.Api.Data.Config { public class VatRateConfiguration : IEntityTypeConfiguration { diff --git a/src/Ubik.Accounting.Api/Data/Init/AccountGroupsData.cs b/src/Ubik.Accounting.Structure.Api/Data/Init/AccountGroupsData.cs similarity index 91% rename from src/Ubik.Accounting.Api/Data/Init/AccountGroupsData.cs rename to src/Ubik.Accounting.Structure.Api/Data/Init/AccountGroupsData.cs index 520a8d3e..ae456733 100644 --- a/src/Ubik.Accounting.Api/Data/Init/AccountGroupsData.cs +++ b/src/Ubik.Accounting.Structure.Api/Data/Init/AccountGroupsData.cs @@ -1,7 +1,7 @@ using Microsoft.EntityFrameworkCore; using System.Runtime.CompilerServices; -namespace Ubik.Accounting.Api.Data.Init +namespace Ubik.Accounting.Structure.Api.Data.Init { internal static class AccountGroupsData { diff --git a/src/Ubik.Accounting.Api/Data/Init/AccountGroupsData.sql b/src/Ubik.Accounting.Structure.Api/Data/Init/AccountGroupsData.sql similarity index 100% rename from src/Ubik.Accounting.Api/Data/Init/AccountGroupsData.sql rename to src/Ubik.Accounting.Structure.Api/Data/Init/AccountGroupsData.sql diff --git a/src/Ubik.Accounting.Api/Data/Init/AccountsAccountGroupsData.cs b/src/Ubik.Accounting.Structure.Api/Data/Init/AccountsAccountGroupsData.cs similarity index 91% rename from src/Ubik.Accounting.Api/Data/Init/AccountsAccountGroupsData.cs rename to src/Ubik.Accounting.Structure.Api/Data/Init/AccountsAccountGroupsData.cs index eb37ca54..7151ce7b 100644 --- a/src/Ubik.Accounting.Api/Data/Init/AccountsAccountGroupsData.cs +++ b/src/Ubik.Accounting.Structure.Api/Data/Init/AccountsAccountGroupsData.cs @@ -1,7 +1,7 @@ using Microsoft.EntityFrameworkCore; using System.Runtime.CompilerServices; -namespace Ubik.Accounting.Api.Data.Init +namespace Ubik.Accounting.Structure.Api.Data.Init { internal class AccountsAccountGroupsData { diff --git a/src/Ubik.Accounting.Api/Data/Init/AccountsAccountGroupsData.sql b/src/Ubik.Accounting.Structure.Api/Data/Init/AccountsAccountGroupsData.sql similarity index 100% rename from src/Ubik.Accounting.Api/Data/Init/AccountsAccountGroupsData.sql rename to src/Ubik.Accounting.Structure.Api/Data/Init/AccountsAccountGroupsData.sql diff --git a/src/Ubik.Accounting.Api/Data/Init/AccountsData.cs b/src/Ubik.Accounting.Structure.Api/Data/Init/AccountsData.cs similarity index 90% rename from src/Ubik.Accounting.Api/Data/Init/AccountsData.cs rename to src/Ubik.Accounting.Structure.Api/Data/Init/AccountsData.cs index 5191745d..7b635709 100644 --- a/src/Ubik.Accounting.Api/Data/Init/AccountsData.cs +++ b/src/Ubik.Accounting.Structure.Api/Data/Init/AccountsData.cs @@ -1,7 +1,7 @@ using Microsoft.EntityFrameworkCore; using System.Runtime.CompilerServices; -namespace Ubik.Accounting.Api.Data.Init +namespace Ubik.Accounting.Structure.Api.Data.Init { internal static class AccountsData { diff --git a/src/Ubik.Accounting.Api/Data/Init/AccountsData.sql b/src/Ubik.Accounting.Structure.Api/Data/Init/AccountsData.sql similarity index 100% rename from src/Ubik.Accounting.Api/Data/Init/AccountsData.sql rename to src/Ubik.Accounting.Structure.Api/Data/Init/AccountsData.sql diff --git a/src/Ubik.Accounting.Api/Data/Init/BaseValues.cs b/src/Ubik.Accounting.Structure.Api/Data/Init/BaseValues.cs similarity index 98% rename from src/Ubik.Accounting.Api/Data/Init/BaseValues.cs rename to src/Ubik.Accounting.Structure.Api/Data/Init/BaseValues.cs index f0766b8c..a4fb4d2b 100644 --- a/src/Ubik.Accounting.Api/Data/Init/BaseValues.cs +++ b/src/Ubik.Accounting.Structure.Api/Data/Init/BaseValues.cs @@ -1,4 +1,4 @@ -namespace Ubik.Accounting.Api.Data.Init +namespace Ubik.Accounting.Structure.Api.Data.Init { public record BaseValuesForAccounts { diff --git a/src/Ubik.Accounting.Api/Data/Init/ClassificationsData.cs b/src/Ubik.Accounting.Structure.Api/Data/Init/ClassificationsData.cs similarity index 97% rename from src/Ubik.Accounting.Api/Data/Init/ClassificationsData.cs rename to src/Ubik.Accounting.Structure.Api/Data/Init/ClassificationsData.cs index e2d1e447..620977ae 100644 --- a/src/Ubik.Accounting.Api/Data/Init/ClassificationsData.cs +++ b/src/Ubik.Accounting.Structure.Api/Data/Init/ClassificationsData.cs @@ -1,7 +1,7 @@ using MassTransit; -using Ubik.Accounting.Api.Models; +using Ubik.Accounting.Structure.Api.Models; -namespace Ubik.Accounting.Api.Data.Init +namespace Ubik.Accounting.Structure.Api.Data.Init { internal static class ClassificationsData { diff --git a/src/Ubik.Accounting.Api/Data/Init/CurrenciesData.cs b/src/Ubik.Accounting.Structure.Api/Data/Init/CurrenciesData.cs similarity index 92% rename from src/Ubik.Accounting.Api/Data/Init/CurrenciesData.cs rename to src/Ubik.Accounting.Structure.Api/Data/Init/CurrenciesData.cs index f53ccc3e..b5ef4cd9 100644 --- a/src/Ubik.Accounting.Api/Data/Init/CurrenciesData.cs +++ b/src/Ubik.Accounting.Structure.Api/Data/Init/CurrenciesData.cs @@ -1,7 +1,7 @@ using MassTransit; -using Ubik.Accounting.Api.Models; +using Ubik.Accounting.Structure.Api.Models; -namespace Ubik.Accounting.Api.Data.Init +namespace Ubik.Accounting.Structure.Api.Data.Init { internal static class CurrenciesData { diff --git a/src/Ubik.Accounting.Api/Data/Init/DbInitializer.cs b/src/Ubik.Accounting.Structure.Api/Data/Init/DbInitializer.cs similarity index 88% rename from src/Ubik.Accounting.Api/Data/Init/DbInitializer.cs rename to src/Ubik.Accounting.Structure.Api/Data/Init/DbInitializer.cs index 09a53a3f..ef323f61 100644 --- a/src/Ubik.Accounting.Api/Data/Init/DbInitializer.cs +++ b/src/Ubik.Accounting.Structure.Api/Data/Init/DbInitializer.cs @@ -1,4 +1,4 @@ -namespace Ubik.Accounting.Api.Data.Init +namespace Ubik.Accounting.Structure.Api.Data.Init { static internal class DbInitializer { diff --git a/src/Ubik.Accounting.Api/Data/Init/UsersData.cs b/src/Ubik.Accounting.Structure.Api/Data/Init/UsersData.cs similarity index 96% rename from src/Ubik.Accounting.Api/Data/Init/UsersData.cs rename to src/Ubik.Accounting.Structure.Api/Data/Init/UsersData.cs index 5b47680b..b5780019 100644 --- a/src/Ubik.Accounting.Api/Data/Init/UsersData.cs +++ b/src/Ubik.Accounting.Structure.Api/Data/Init/UsersData.cs @@ -1,4 +1,4 @@ -namespace Ubik.Accounting.Api.Data.Init +namespace Ubik.Accounting.Structure.Api.Data.Init { //internal static class UsersData //{ diff --git a/src/Ubik.Accounting.Api/Dockerfile b/src/Ubik.Accounting.Structure.Api/Dockerfile similarity index 72% rename from src/Ubik.Accounting.Api/Dockerfile rename to src/Ubik.Accounting.Structure.Api/Dockerfile index f34411c3..ecea3d9b 100644 --- a/src/Ubik.Accounting.Api/Dockerfile +++ b/src/Ubik.Accounting.Structure.Api/Dockerfile @@ -12,7 +12,7 @@ EXPOSE 8081 FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build ARG BUILD_CONFIGURATION=Release WORKDIR / -COPY ["src/Ubik.Accounting.Api/Ubik.Accounting.Api.csproj", "src/Ubik.Accounting.Api/"] +COPY ["src/Ubik.Accounting.Structure.Api/Ubik.Accounting.Structure.Api.csproj", "src/Ubik.Accounting.Structure.Api/"] COPY ["src/Ubik.Accounting.Contracts/Ubik.Accounting.Contracts.csproj", "src/Ubik.Accounting.Contracts/"] COPY ["src/Ubik.Db.Common/Ubik.DB.Common/Ubik.DB.Common.csproj", "src/Ubik.Db.Common/Ubik.DB.Common/"] COPY ["src/Ubik.ApiService.Common/Ubik.ApiService.Common.csproj", "src/Ubik.ApiService.Common/"] @@ -20,18 +20,18 @@ COPY ["src/Ubik.ApiService.Common/Ubik.ApiService.Common.csproj", "src/Ubik.ApiS #ADD ./src/mycert.cer /usr/local/share/ca-certificates/mycert.cer #ADD ./src/mycert.cer /etc/ssl/certs/mycert.cer #RUN chmod 644 /usr/local/share/ca-certificates/mycert.cer && update-ca-certificates -RUN dotnet restore "./src/Ubik.Accounting.Api/Ubik.Accounting.Api.csproj" +RUN dotnet restore "./src/Ubik.Accounting.Structure.Api/Ubik.Accounting.Structure.Api.csproj" COPY . . -WORKDIR "/src/Ubik.Accounting.Api" -RUN dotnet build "./Ubik.Accounting.Api.csproj" -c $BUILD_CONFIGURATION -o /app/build +WORKDIR "/src/Ubik.Accounting.Structure.Api" +RUN dotnet build "./Ubik.Accounting.Structure.Api.csproj" -c $BUILD_CONFIGURATION -o /app/build # This stage is used to publish the service project to be copied to the final stage FROM build AS publish ARG BUILD_CONFIGURATION=Release -RUN dotnet publish "./Ubik.Accounting.Api.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false +RUN dotnet publish "./Ubik.Accounting.Structure.Api.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false # This stage is used in production or when running from VS in regular mode (Default when not using the Debug configuration) FROM base AS final WORKDIR /app COPY --from=publish /app/publish . -ENTRYPOINT ["dotnet", "Ubik.Accounting.Api.dll"] +ENTRYPOINT ["dotnet", "Ubik.Accounting.Structure.Api.dll"] diff --git a/src/Ubik.Accounting.Api/Features/AccountGroups/Controller/v1/AccountGroupsController.cs b/src/Ubik.Accounting.Structure.Api/Features/AccountGroups/Controller/v1/AccountGroupsController.cs similarity index 96% rename from src/Ubik.Accounting.Api/Features/AccountGroups/Controller/v1/AccountGroupsController.cs rename to src/Ubik.Accounting.Structure.Api/Features/AccountGroups/Controller/v1/AccountGroupsController.cs index 112feb17..c29b98b4 100644 --- a/src/Ubik.Accounting.Api/Features/AccountGroups/Controller/v1/AccountGroupsController.cs +++ b/src/Ubik.Accounting.Structure.Api/Features/AccountGroups/Controller/v1/AccountGroupsController.cs @@ -4,11 +4,11 @@ using Ubik.Accounting.Contracts.AccountGroups.Results; using Ubik.Accounting.Contracts.AccountGroups.Commands; using Ubik.ApiService.Common.Errors; -using Ubik.Accounting.Api.Features.AccountGroups.Services; +using Ubik.Accounting.Structure.Api.Features.AccountGroups.Services; using Ubik.Accounting.Contracts.Accounts.Results; -using Ubik.Accounting.Api.Mappers; +using Ubik.Accounting.Structure.Api.Mappers; -namespace Ubik.Accounting.Api.Features.AccountGroups.Controller.v1 +namespace Ubik.Accounting.Structure.Api.Features.AccountGroups.Controller.v1 { [ApiController] [ApiVersion("1.0")] diff --git a/src/Ubik.Accounting.Api/Features/AccountGroups/Errors/AccountGroupParentNotFoundError.cs b/src/Ubik.Accounting.Structure.Api/Features/AccountGroups/Errors/AccountGroupParentNotFoundError.cs similarity index 91% rename from src/Ubik.Accounting.Api/Features/AccountGroups/Errors/AccountGroupParentNotFoundError.cs rename to src/Ubik.Accounting.Structure.Api/Features/AccountGroups/Errors/AccountGroupParentNotFoundError.cs index ddbe8016..755eb6de 100644 --- a/src/Ubik.Accounting.Api/Features/AccountGroups/Errors/AccountGroupParentNotFoundError.cs +++ b/src/Ubik.Accounting.Structure.Api/Features/AccountGroups/Errors/AccountGroupParentNotFoundError.cs @@ -1,6 +1,6 @@ using Ubik.ApiService.Common.Errors; -namespace Ubik.Accounting.Api.Features.AccountGroups.Errors +namespace Ubik.Accounting.Structure.Api.Features.AccountGroups.Errors { public record AccountGroupParentNotFoundError : IServiceAndFeatureError { diff --git a/src/Ubik.Accounting.Api/Features/AccountGroups/Services/AccountGroupCommandService.cs b/src/Ubik.Accounting.Structure.Api/Features/AccountGroups/Services/AccountGroupCommandService.cs similarity index 96% rename from src/Ubik.Accounting.Api/Features/AccountGroups/Services/AccountGroupCommandService.cs rename to src/Ubik.Accounting.Structure.Api/Features/AccountGroups/Services/AccountGroupCommandService.cs index 9478dba8..9c49fef6 100644 --- a/src/Ubik.Accounting.Api/Features/AccountGroups/Services/AccountGroupCommandService.cs +++ b/src/Ubik.Accounting.Structure.Api/Features/AccountGroups/Services/AccountGroupCommandService.cs @@ -3,16 +3,16 @@ using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Storage; using System.Data.Common; -using Ubik.Accounting.Api.Data; -using Ubik.Accounting.Api.Features.AccountGroups.Errors; -using Ubik.Accounting.Api.Mappers; -using Ubik.Accounting.Api.Models; +using Ubik.Accounting.Structure.Api.Data; +using Ubik.Accounting.Structure.Api.Features.AccountGroups.Errors; +using Ubik.Accounting.Structure.Api.Mappers; +using Ubik.Accounting.Structure.Api.Models; using Ubik.Accounting.Contracts.AccountGroups.Commands; using Ubik.Accounting.Contracts.AccountGroups.Events; using Ubik.ApiService.Common.Errors; using Ubik.ApiService.Common.Exceptions; -namespace Ubik.Accounting.Api.Features.AccountGroups.Services +namespace Ubik.Accounting.Structure.Api.Features.AccountGroups.Services { public class AccountGroupCommandService(AccountingDbContext ctx, IPublishEndpoint publishEndpoint) : IAccountGroupCommandService { diff --git a/src/Ubik.Accounting.Api/Features/AccountGroups/Services/AccountGroupQueryService.cs b/src/Ubik.Accounting.Structure.Api/Features/AccountGroups/Services/AccountGroupQueryService.cs similarity index 91% rename from src/Ubik.Accounting.Api/Features/AccountGroups/Services/AccountGroupQueryService.cs rename to src/Ubik.Accounting.Structure.Api/Features/AccountGroups/Services/AccountGroupQueryService.cs index 799ad6f6..6cc33a0b 100644 --- a/src/Ubik.Accounting.Api/Features/AccountGroups/Services/AccountGroupQueryService.cs +++ b/src/Ubik.Accounting.Structure.Api/Features/AccountGroups/Services/AccountGroupQueryService.cs @@ -1,12 +1,12 @@ using Dapper; using LanguageExt; using Microsoft.EntityFrameworkCore; -using Ubik.Accounting.Api.Data; -using Ubik.Accounting.Api.Models; +using Ubik.Accounting.Structure.Api.Data; +using Ubik.Accounting.Structure.Api.Models; using Ubik.ApiService.Common.Errors; using Ubik.ApiService.Common.Services; -namespace Ubik.Accounting.Api.Features.AccountGroups.Services +namespace Ubik.Accounting.Structure.Api.Features.AccountGroups.Services { public class AccountGroupQueryService(AccountingDbContext ctx, ICurrentUser currentUser) : IAccountGroupQueryService { diff --git a/src/Ubik.Accounting.Api/Features/AccountGroups/Services/IAccountGroupCommandService.cs b/src/Ubik.Accounting.Structure.Api/Features/AccountGroups/Services/IAccountGroupCommandService.cs similarity index 81% rename from src/Ubik.Accounting.Api/Features/AccountGroups/Services/IAccountGroupCommandService.cs rename to src/Ubik.Accounting.Structure.Api/Features/AccountGroups/Services/IAccountGroupCommandService.cs index 9c26b1f4..0d5709ee 100644 --- a/src/Ubik.Accounting.Api/Features/AccountGroups/Services/IAccountGroupCommandService.cs +++ b/src/Ubik.Accounting.Structure.Api/Features/AccountGroups/Services/IAccountGroupCommandService.cs @@ -1,9 +1,9 @@ using LanguageExt; -using Ubik.Accounting.Api.Models; +using Ubik.Accounting.Structure.Api.Models; using Ubik.Accounting.Contracts.AccountGroups.Commands; using Ubik.ApiService.Common.Errors; -namespace Ubik.Accounting.Api.Features.AccountGroups.Services +namespace Ubik.Accounting.Structure.Api.Features.AccountGroups.Services { public interface IAccountGroupCommandService { diff --git a/src/Ubik.Accounting.Api/Features/AccountGroups/Services/IAccountGroupQueryService.cs b/src/Ubik.Accounting.Structure.Api/Features/AccountGroups/Services/IAccountGroupQueryService.cs similarity index 75% rename from src/Ubik.Accounting.Api/Features/AccountGroups/Services/IAccountGroupQueryService.cs rename to src/Ubik.Accounting.Structure.Api/Features/AccountGroups/Services/IAccountGroupQueryService.cs index f2da3684..43d0b7c7 100644 --- a/src/Ubik.Accounting.Api/Features/AccountGroups/Services/IAccountGroupQueryService.cs +++ b/src/Ubik.Accounting.Structure.Api/Features/AccountGroups/Services/IAccountGroupQueryService.cs @@ -1,8 +1,8 @@ using LanguageExt; -using Ubik.Accounting.Api.Models; +using Ubik.Accounting.Structure.Api.Models; using Ubik.ApiService.Common.Errors; -namespace Ubik.Accounting.Api.Features.AccountGroups.Services +namespace Ubik.Accounting.Structure.Api.Features.AccountGroups.Services { public interface IAccountGroupQueryService { diff --git a/src/Ubik.Accounting.Api/Features/Accounts/Controller/v1/AccountsController.cs b/src/Ubik.Accounting.Structure.Api/Features/Accounts/Controller/v1/AccountsController.cs similarity index 97% rename from src/Ubik.Accounting.Api/Features/Accounts/Controller/v1/AccountsController.cs rename to src/Ubik.Accounting.Structure.Api/Features/Accounts/Controller/v1/AccountsController.cs index a3c9ece5..017b8570 100644 --- a/src/Ubik.Accounting.Api/Features/Accounts/Controller/v1/AccountsController.cs +++ b/src/Ubik.Accounting.Structure.Api/Features/Accounts/Controller/v1/AccountsController.cs @@ -1,14 +1,14 @@ using Asp.Versioning; using MassTransit; using Microsoft.AspNetCore.Mvc; -using Ubik.Accounting.Api.Features.Accounts.Services; -using Ubik.Accounting.Api.Mappers; +using Ubik.Accounting.Structure.Api.Features.Accounts.Services; +using Ubik.Accounting.Structure.Api.Mappers; using Ubik.Accounting.Contracts.Accounts.Commands; using Ubik.Accounting.Contracts.Accounts.Results; using Ubik.ApiService.Common.Errors; using Ubik.ApiService.Common.Exceptions; -namespace Ubik.Accounting.Api.Features.Accounts.Controller.v1 +namespace Ubik.Accounting.Structure.Api.Features.Accounts.Controller.v1 { [ApiController] [ApiVersion("1.0")] diff --git a/src/Ubik.Accounting.Api/Features/Accounts/CustomPoco/AccountGroupClassification.cs b/src/Ubik.Accounting.Structure.Api/Features/Accounts/CustomPoco/AccountGroupClassification.cs similarity index 84% rename from src/Ubik.Accounting.Api/Features/Accounts/CustomPoco/AccountGroupClassification.cs rename to src/Ubik.Accounting.Structure.Api/Features/Accounts/CustomPoco/AccountGroupClassification.cs index 5fa84045..e65ba436 100644 --- a/src/Ubik.Accounting.Api/Features/Accounts/CustomPoco/AccountGroupClassification.cs +++ b/src/Ubik.Accounting.Structure.Api/Features/Accounts/CustomPoco/AccountGroupClassification.cs @@ -1,4 +1,4 @@ -namespace Ubik.Accounting.Api.Features.Accounts.CustomPoco +namespace Ubik.Accounting.Structure.Api.Features.Accounts.CustomPoco { public record AccountGroupClassification { diff --git a/src/Ubik.Accounting.Api/Features/Accounts/Errors/AccountAlreadyExistsInClassificationError.cs b/src/Ubik.Accounting.Structure.Api/Features/Accounts/Errors/AccountAlreadyExistsInClassificationError.cs similarity index 92% rename from src/Ubik.Accounting.Api/Features/Accounts/Errors/AccountAlreadyExistsInClassificationError.cs rename to src/Ubik.Accounting.Structure.Api/Features/Accounts/Errors/AccountAlreadyExistsInClassificationError.cs index 18d028ee..356fa57f 100644 --- a/src/Ubik.Accounting.Api/Features/Accounts/Errors/AccountAlreadyExistsInClassificationError.cs +++ b/src/Ubik.Accounting.Structure.Api/Features/Accounts/Errors/AccountAlreadyExistsInClassificationError.cs @@ -1,6 +1,6 @@ using Ubik.ApiService.Common.Errors; -namespace Ubik.Accounting.Api.Features.Accounts.Errors +namespace Ubik.Accounting.Structure.Api.Features.Accounts.Errors { public class AccountAlreadyExistsInClassificationError : IServiceAndFeatureError { diff --git a/src/Ubik.Accounting.Api/Features/Accounts/Errors/AccountLinkedToExistingEntriesError.cs b/src/Ubik.Accounting.Structure.Api/Features/Accounts/Errors/AccountLinkedToExistingEntriesError.cs similarity index 92% rename from src/Ubik.Accounting.Api/Features/Accounts/Errors/AccountLinkedToExistingEntriesError.cs rename to src/Ubik.Accounting.Structure.Api/Features/Accounts/Errors/AccountLinkedToExistingEntriesError.cs index 2d4bd240..e4c2dc80 100644 --- a/src/Ubik.Accounting.Api/Features/Accounts/Errors/AccountLinkedToExistingEntriesError.cs +++ b/src/Ubik.Accounting.Structure.Api/Features/Accounts/Errors/AccountLinkedToExistingEntriesError.cs @@ -1,6 +1,6 @@ using Ubik.ApiService.Common.Errors; -namespace Ubik.Accounting.Api.Features.Accounts.Errors +namespace Ubik.Accounting.Structure.Api.Features.Accounts.Errors { public class AccountLinkedToExistingEntriesError : IServiceAndFeatureError { diff --git a/src/Ubik.Accounting.Api/Features/Accounts/Errors/AccountNotExistsInAccountGroupError.cs b/src/Ubik.Accounting.Structure.Api/Features/Accounts/Errors/AccountNotExistsInAccountGroupError.cs similarity index 92% rename from src/Ubik.Accounting.Api/Features/Accounts/Errors/AccountNotExistsInAccountGroupError.cs rename to src/Ubik.Accounting.Structure.Api/Features/Accounts/Errors/AccountNotExistsInAccountGroupError.cs index d83e9adb..f9d119ef 100644 --- a/src/Ubik.Accounting.Api/Features/Accounts/Errors/AccountNotExistsInAccountGroupError.cs +++ b/src/Ubik.Accounting.Structure.Api/Features/Accounts/Errors/AccountNotExistsInAccountGroupError.cs @@ -1,6 +1,6 @@ using Ubik.ApiService.Common.Errors; -namespace Ubik.Accounting.Api.Features.Accounts.Errors +namespace Ubik.Accounting.Structure.Api.Features.Accounts.Errors { public class AccountNotExistsInAccountGroupError : IServiceAndFeatureError { diff --git a/src/Ubik.Accounting.Api/Features/Accounts/Services/AccountCommandService.cs b/src/Ubik.Accounting.Structure.Api/Features/Accounts/Services/AccountCommandService.cs similarity index 97% rename from src/Ubik.Accounting.Api/Features/Accounts/Services/AccountCommandService.cs rename to src/Ubik.Accounting.Structure.Api/Features/Accounts/Services/AccountCommandService.cs index 900c8b18..b1436a2d 100644 --- a/src/Ubik.Accounting.Api/Features/Accounts/Services/AccountCommandService.cs +++ b/src/Ubik.Accounting.Structure.Api/Features/Accounts/Services/AccountCommandService.cs @@ -3,17 +3,17 @@ using MassTransit; using MassTransit.Transports; using Microsoft.EntityFrameworkCore; -using Ubik.Accounting.Api.Data; -using Ubik.Accounting.Api.Features.Accounts.Errors; -using Ubik.Accounting.Api.Mappers; -using Ubik.Accounting.Api.Models; +using Ubik.Accounting.Structure.Api.Data; +using Ubik.Accounting.Structure.Api.Features.Accounts.Errors; +using Ubik.Accounting.Structure.Api.Mappers; +using Ubik.Accounting.Structure.Api.Models; using Ubik.Accounting.Contracts.Accounts.Commands; using Ubik.Accounting.Contracts.Accounts.Events; using Ubik.ApiService.Common.Errors; using Ubik.ApiService.Common.Exceptions; using Ubik.ApiService.Common.Services; -namespace Ubik.Accounting.Api.Features.Accounts.Services +namespace Ubik.Accounting.Structure.Api.Features.Accounts.Services { public class AccountCommandService(AccountingDbContext ctx, ICurrentUser currentUser, IPublishEndpoint publishEndpoint) : IAccountCommandService { diff --git a/src/Ubik.Accounting.Api/Features/Accounts/Services/AccountQueryService.cs b/src/Ubik.Accounting.Structure.Api/Features/Accounts/Services/AccountQueryService.cs similarity index 91% rename from src/Ubik.Accounting.Api/Features/Accounts/Services/AccountQueryService.cs rename to src/Ubik.Accounting.Structure.Api/Features/Accounts/Services/AccountQueryService.cs index 259cc56b..a1bea4da 100644 --- a/src/Ubik.Accounting.Api/Features/Accounts/Services/AccountQueryService.cs +++ b/src/Ubik.Accounting.Structure.Api/Features/Accounts/Services/AccountQueryService.cs @@ -1,13 +1,13 @@ using Dapper; using LanguageExt; using Microsoft.EntityFrameworkCore; -using Ubik.Accounting.Api.Data; -using Ubik.Accounting.Api.Features.Accounts.CustomPoco; -using Ubik.Accounting.Api.Models; +using Ubik.Accounting.Structure.Api.Data; +using Ubik.Accounting.Structure.Api.Features.Accounts.CustomPoco; +using Ubik.Accounting.Structure.Api.Models; using Ubik.ApiService.Common.Errors; using Ubik.ApiService.Common.Services; -namespace Ubik.Accounting.Api.Features.Accounts.Services +namespace Ubik.Accounting.Structure.Api.Features.Accounts.Services { public class AccountQueryService(AccountingDbContext ctx, ICurrentUser currentUser) : IAccountQueryService { diff --git a/src/Ubik.Accounting.Api/Features/Accounts/Services/IAccountCommandService.cs b/src/Ubik.Accounting.Structure.Api/Features/Accounts/Services/IAccountCommandService.cs similarity index 86% rename from src/Ubik.Accounting.Api/Features/Accounts/Services/IAccountCommandService.cs rename to src/Ubik.Accounting.Structure.Api/Features/Accounts/Services/IAccountCommandService.cs index 6596b7eb..dd8e56ca 100644 --- a/src/Ubik.Accounting.Api/Features/Accounts/Services/IAccountCommandService.cs +++ b/src/Ubik.Accounting.Structure.Api/Features/Accounts/Services/IAccountCommandService.cs @@ -1,9 +1,9 @@ using LanguageExt; -using Ubik.Accounting.Api.Models; +using Ubik.Accounting.Structure.Api.Models; using Ubik.Accounting.Contracts.Accounts.Commands; using Ubik.ApiService.Common.Errors; -namespace Ubik.Accounting.Api.Features.Accounts.Services +namespace Ubik.Accounting.Structure.Api.Features.Accounts.Services { public interface IAccountCommandService { diff --git a/src/Ubik.Accounting.Api/Features/Accounts/Services/IAccountQueryService.cs b/src/Ubik.Accounting.Structure.Api/Features/Accounts/Services/IAccountQueryService.cs similarity index 73% rename from src/Ubik.Accounting.Api/Features/Accounts/Services/IAccountQueryService.cs rename to src/Ubik.Accounting.Structure.Api/Features/Accounts/Services/IAccountQueryService.cs index 36d41498..f67de432 100644 --- a/src/Ubik.Accounting.Api/Features/Accounts/Services/IAccountQueryService.cs +++ b/src/Ubik.Accounting.Structure.Api/Features/Accounts/Services/IAccountQueryService.cs @@ -1,9 +1,9 @@ using LanguageExt; -using Ubik.Accounting.Api.Features.Accounts.CustomPoco; -using Ubik.Accounting.Api.Models; +using Ubik.Accounting.Structure.Api.Features.Accounts.CustomPoco; +using Ubik.Accounting.Structure.Api.Models; using Ubik.ApiService.Common.Errors; -namespace Ubik.Accounting.Api.Features.Accounts.Services +namespace Ubik.Accounting.Structure.Api.Features.Accounts.Services { public interface IAccountQueryService { diff --git a/src/Ubik.Accounting.Api/Features/Application/Controllers/v1/ApplicationController.cs b/src/Ubik.Accounting.Structure.Api/Features/Application/Controllers/v1/ApplicationController.cs similarity index 84% rename from src/Ubik.Accounting.Api/Features/Application/Controllers/v1/ApplicationController.cs rename to src/Ubik.Accounting.Structure.Api/Features/Application/Controllers/v1/ApplicationController.cs index a4c24f18..bab4151d 100644 --- a/src/Ubik.Accounting.Api/Features/Application/Controllers/v1/ApplicationController.cs +++ b/src/Ubik.Accounting.Structure.Api/Features/Application/Controllers/v1/ApplicationController.cs @@ -1,9 +1,9 @@ using Asp.Versioning; using Microsoft.AspNetCore.Mvc; -using Ubik.Accounting.Api.Features.Application.Services; +using Ubik.Accounting.Structure.Api.Features.Application.Services; using Ubik.ApiService.Common.Exceptions; -namespace Ubik.Accounting.Api.Features.Application.Controllers.v1 +namespace Ubik.Accounting.Structure.Api.Features.Application.Controllers.v1 { [ApiController] [ApiVersion("1.0")] diff --git a/src/Ubik.Accounting.Api/Features/Application/Services/ApplicationCommandService.cs b/src/Ubik.Accounting.Structure.Api/Features/Application/Services/ApplicationCommandService.cs similarity index 80% rename from src/Ubik.Accounting.Api/Features/Application/Services/ApplicationCommandService.cs rename to src/Ubik.Accounting.Structure.Api/Features/Application/Services/ApplicationCommandService.cs index 84dbf3b9..603a19ca 100644 --- a/src/Ubik.Accounting.Api/Features/Application/Services/ApplicationCommandService.cs +++ b/src/Ubik.Accounting.Structure.Api/Features/Application/Services/ApplicationCommandService.cs @@ -1,7 +1,7 @@ -using Ubik.Accounting.Api.Data; -using Ubik.Accounting.Api.Data.Init; +using Ubik.Accounting.Structure.Api.Data; +using Ubik.Accounting.Structure.Api.Data.Init; -namespace Ubik.Accounting.Api.Features.Application.Services +namespace Ubik.Accounting.Structure.Api.Features.Application.Services { public class ApplicationCommandService(AccountingDbContext ctx, IWebHostEnvironment env) : IApplicationCommandService { diff --git a/src/Ubik.Accounting.Api/Features/Application/Services/IApplicationCommandService.cs b/src/Ubik.Accounting.Structure.Api/Features/Application/Services/IApplicationCommandService.cs similarity index 61% rename from src/Ubik.Accounting.Api/Features/Application/Services/IApplicationCommandService.cs rename to src/Ubik.Accounting.Structure.Api/Features/Application/Services/IApplicationCommandService.cs index 01acca82..4e62eb8e 100644 --- a/src/Ubik.Accounting.Api/Features/Application/Services/IApplicationCommandService.cs +++ b/src/Ubik.Accounting.Structure.Api/Features/Application/Services/IApplicationCommandService.cs @@ -1,4 +1,4 @@ -namespace Ubik.Accounting.Api.Features.Application.Services +namespace Ubik.Accounting.Structure.Api.Features.Application.Services { public interface IApplicationCommandService { diff --git a/src/Ubik.Accounting.Api/Features/Classifications/Controller/v1/ClassificationsController.cs b/src/Ubik.Accounting.Structure.Api/Features/Classifications/Controller/v1/ClassificationsController.cs similarity index 97% rename from src/Ubik.Accounting.Api/Features/Classifications/Controller/v1/ClassificationsController.cs rename to src/Ubik.Accounting.Structure.Api/Features/Classifications/Controller/v1/ClassificationsController.cs index 92a4c38a..2cba0988 100644 --- a/src/Ubik.Accounting.Api/Features/Classifications/Controller/v1/ClassificationsController.cs +++ b/src/Ubik.Accounting.Structure.Api/Features/Classifications/Controller/v1/ClassificationsController.cs @@ -1,15 +1,15 @@ using Asp.Versioning; using MassTransit; using Microsoft.AspNetCore.Mvc; -using Ubik.Accounting.Api.Features.Classifications.Services; -using Ubik.Accounting.Api.Mappers; +using Ubik.Accounting.Structure.Api.Features.Classifications.Services; +using Ubik.Accounting.Structure.Api.Mappers; using Ubik.Accounting.Contracts.Accounts.Results; using Ubik.Accounting.Contracts.Classifications.Commands; using Ubik.Accounting.Contracts.Classifications.Results; using Ubik.ApiService.Common.Errors; using Ubik.ApiService.Common.Exceptions; -namespace Ubik.Accounting.Api.Features.Classifications.Controller.v1 +namespace Ubik.Accounting.Structure.Api.Features.Classifications.Controller.v1 { [ApiController] [ApiVersion("1.0")] diff --git a/src/Ubik.Accounting.Api/Features/Classifications/CustomPoco/ClassificationStatus.cs b/src/Ubik.Accounting.Structure.Api/Features/Classifications/CustomPoco/ClassificationStatus.cs similarity index 63% rename from src/Ubik.Accounting.Api/Features/Classifications/CustomPoco/ClassificationStatus.cs rename to src/Ubik.Accounting.Structure.Api/Features/Classifications/CustomPoco/ClassificationStatus.cs index cfe48684..3c857f13 100644 --- a/src/Ubik.Accounting.Api/Features/Classifications/CustomPoco/ClassificationStatus.cs +++ b/src/Ubik.Accounting.Structure.Api/Features/Classifications/CustomPoco/ClassificationStatus.cs @@ -1,6 +1,6 @@ -using Ubik.Accounting.Api.Models; +using Ubik.Accounting.Structure.Api.Models; -namespace Ubik.Accounting.Api.Features.Classifications.CustomPoco +namespace Ubik.Accounting.Structure.Api.Features.Classifications.CustomPoco { public record ClassificationStatus { diff --git a/src/Ubik.Accounting.Api/Features/Classifications/Services/ClassificationCommandService.cs b/src/Ubik.Accounting.Structure.Api/Features/Classifications/Services/ClassificationCommandService.cs similarity index 97% rename from src/Ubik.Accounting.Api/Features/Classifications/Services/ClassificationCommandService.cs rename to src/Ubik.Accounting.Structure.Api/Features/Classifications/Services/ClassificationCommandService.cs index 121a6129..8b76a2e5 100644 --- a/src/Ubik.Accounting.Api/Features/Classifications/Services/ClassificationCommandService.cs +++ b/src/Ubik.Accounting.Structure.Api/Features/Classifications/Services/ClassificationCommandService.cs @@ -4,15 +4,15 @@ using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Storage; using System.Data; -using Ubik.Accounting.Api.Data; -using Ubik.Accounting.Api.Mappers; -using Ubik.Accounting.Api.Models; +using Ubik.Accounting.Structure.Api.Data; +using Ubik.Accounting.Structure.Api.Mappers; +using Ubik.Accounting.Structure.Api.Models; using Ubik.Accounting.Contracts.Classifications.Commands; using Ubik.Accounting.Contracts.Classifications.Events; using Ubik.ApiService.Common.Errors; using Ubik.ApiService.Common.Exceptions; -namespace Ubik.Accounting.Api.Features.Classifications.Services +namespace Ubik.Accounting.Structure.Api.Features.Classifications.Services { public class ClassificationCommandService(AccountingDbContext ctx, IPublishEndpoint publishEndpoint) : IClassificationCommandService { diff --git a/src/Ubik.Accounting.Api/Features/Classifications/Services/ClassificationQueryService.cs b/src/Ubik.Accounting.Structure.Api/Features/Classifications/Services/ClassificationQueryService.cs similarity index 94% rename from src/Ubik.Accounting.Api/Features/Classifications/Services/ClassificationQueryService.cs rename to src/Ubik.Accounting.Structure.Api/Features/Classifications/Services/ClassificationQueryService.cs index 52662f51..f0baef6b 100644 --- a/src/Ubik.Accounting.Api/Features/Classifications/Services/ClassificationQueryService.cs +++ b/src/Ubik.Accounting.Structure.Api/Features/Classifications/Services/ClassificationQueryService.cs @@ -1,13 +1,13 @@ using Dapper; using LanguageExt; using Microsoft.EntityFrameworkCore; -using Ubik.Accounting.Api.Data; -using Ubik.Accounting.Api.Features.Classifications.CustomPoco; -using Ubik.Accounting.Api.Models; +using Ubik.Accounting.Structure.Api.Data; +using Ubik.Accounting.Structure.Api.Features.Classifications.CustomPoco; +using Ubik.Accounting.Structure.Api.Models; using Ubik.ApiService.Common.Errors; using Ubik.ApiService.Common.Services; -namespace Ubik.Accounting.Api.Features.Classifications.Services +namespace Ubik.Accounting.Structure.Api.Features.Classifications.Services { public class ClassificationQueryService(AccountingDbContext ctx, ICurrentUser currentUser) : IClassificationQueryService { diff --git a/src/Ubik.Accounting.Api/Features/Classifications/Services/IClassificationCommandService.cs b/src/Ubik.Accounting.Structure.Api/Features/Classifications/Services/IClassificationCommandService.cs similarity index 81% rename from src/Ubik.Accounting.Api/Features/Classifications/Services/IClassificationCommandService.cs rename to src/Ubik.Accounting.Structure.Api/Features/Classifications/Services/IClassificationCommandService.cs index 1ef306fa..397f7386 100644 --- a/src/Ubik.Accounting.Api/Features/Classifications/Services/IClassificationCommandService.cs +++ b/src/Ubik.Accounting.Structure.Api/Features/Classifications/Services/IClassificationCommandService.cs @@ -1,9 +1,9 @@ using LanguageExt; -using Ubik.Accounting.Api.Models; +using Ubik.Accounting.Structure.Api.Models; using Ubik.Accounting.Contracts.Classifications.Commands; using Ubik.ApiService.Common.Errors; -namespace Ubik.Accounting.Api.Features.Classifications.Services +namespace Ubik.Accounting.Structure.Api.Features.Classifications.Services { public interface IClassificationCommandService { diff --git a/src/Ubik.Accounting.Api/Features/Classifications/Services/IClassificationQueryService.cs b/src/Ubik.Accounting.Structure.Api/Features/Classifications/Services/IClassificationQueryService.cs similarity index 76% rename from src/Ubik.Accounting.Api/Features/Classifications/Services/IClassificationQueryService.cs rename to src/Ubik.Accounting.Structure.Api/Features/Classifications/Services/IClassificationQueryService.cs index f0e7a6c1..895774d3 100644 --- a/src/Ubik.Accounting.Api/Features/Classifications/Services/IClassificationQueryService.cs +++ b/src/Ubik.Accounting.Structure.Api/Features/Classifications/Services/IClassificationQueryService.cs @@ -1,9 +1,9 @@ using LanguageExt; -using Ubik.Accounting.Api.Features.Classifications.CustomPoco; -using Ubik.Accounting.Api.Models; +using Ubik.Accounting.Structure.Api.Features.Classifications.CustomPoco; +using Ubik.Accounting.Structure.Api.Models; using Ubik.ApiService.Common.Errors; -namespace Ubik.Accounting.Api.Features.Classifications.Services +namespace Ubik.Accounting.Structure.Api.Features.Classifications.Services { public interface IClassificationQueryService { diff --git a/src/Ubik.Accounting.Api/Features/Currencies/Controller/v1/CurrenciesController.cs b/src/Ubik.Accounting.Structure.Api/Features/Currencies/Controller/v1/CurrenciesController.cs similarity index 79% rename from src/Ubik.Accounting.Api/Features/Currencies/Controller/v1/CurrenciesController.cs rename to src/Ubik.Accounting.Structure.Api/Features/Currencies/Controller/v1/CurrenciesController.cs index d520fefc..ec26211b 100644 --- a/src/Ubik.Accounting.Api/Features/Currencies/Controller/v1/CurrenciesController.cs +++ b/src/Ubik.Accounting.Structure.Api/Features/Currencies/Controller/v1/CurrenciesController.cs @@ -1,11 +1,11 @@ using Asp.Versioning; using Microsoft.AspNetCore.Mvc; -using Ubik.Accounting.Api.Features.Currencies.Services; -using Ubik.Accounting.Api.Mappers; +using Ubik.Accounting.Structure.Api.Features.Currencies.Services; +using Ubik.Accounting.Structure.Api.Mappers; using Ubik.Accounting.Contracts.Currencies.Results; using Ubik.ApiService.Common.Exceptions; -namespace Ubik.Accounting.Api.Features.Currencies.Controller.v1 +namespace Ubik.Accounting.Structure.Api.Features.Currencies.Controller.v1 { [ApiController] [ApiVersion("1.0")] diff --git a/src/Ubik.Accounting.Api/Features/Currencies/Services/CurrencyQueryService.cs b/src/Ubik.Accounting.Structure.Api/Features/Currencies/Services/CurrencyQueryService.cs similarity index 64% rename from src/Ubik.Accounting.Api/Features/Currencies/Services/CurrencyQueryService.cs rename to src/Ubik.Accounting.Structure.Api/Features/Currencies/Services/CurrencyQueryService.cs index 9650a08d..69c13590 100644 --- a/src/Ubik.Accounting.Api/Features/Currencies/Services/CurrencyQueryService.cs +++ b/src/Ubik.Accounting.Structure.Api/Features/Currencies/Services/CurrencyQueryService.cs @@ -1,8 +1,8 @@ using Microsoft.EntityFrameworkCore; -using Ubik.Accounting.Api.Data; -using Ubik.Accounting.Api.Models; +using Ubik.Accounting.Structure.Api.Data; +using Ubik.Accounting.Structure.Api.Models; -namespace Ubik.Accounting.Api.Features.Currencies.Services +namespace Ubik.Accounting.Structure.Api.Features.Currencies.Services { public class CurrencyQueryService(AccountingDbContext ctx) : ICurrencyQueryService { diff --git a/src/Ubik.Accounting.Api/Features/Currencies/Services/ICurrencyQueryService.cs b/src/Ubik.Accounting.Structure.Api/Features/Currencies/Services/ICurrencyQueryService.cs similarity index 50% rename from src/Ubik.Accounting.Api/Features/Currencies/Services/ICurrencyQueryService.cs rename to src/Ubik.Accounting.Structure.Api/Features/Currencies/Services/ICurrencyQueryService.cs index cc635e79..8a03fb18 100644 --- a/src/Ubik.Accounting.Api/Features/Currencies/Services/ICurrencyQueryService.cs +++ b/src/Ubik.Accounting.Structure.Api/Features/Currencies/Services/ICurrencyQueryService.cs @@ -1,6 +1,6 @@ -using Ubik.Accounting.Api.Models; +using Ubik.Accounting.Structure.Api.Models; -namespace Ubik.Accounting.Api.Features.Currencies.Services +namespace Ubik.Accounting.Structure.Api.Features.Currencies.Services { public interface ICurrencyQueryService { diff --git a/src/Ubik.Accounting.Api/Features/VatRates/Services/IVatRateCommandService.cs b/src/Ubik.Accounting.Structure.Api/Features/VatRates/Services/IVatRateCommandService.cs similarity index 80% rename from src/Ubik.Accounting.Api/Features/VatRates/Services/IVatRateCommandService.cs rename to src/Ubik.Accounting.Structure.Api/Features/VatRates/Services/IVatRateCommandService.cs index 0f4e9552..04bdea78 100644 --- a/src/Ubik.Accounting.Api/Features/VatRates/Services/IVatRateCommandService.cs +++ b/src/Ubik.Accounting.Structure.Api/Features/VatRates/Services/IVatRateCommandService.cs @@ -1,9 +1,9 @@ using LanguageExt; -using Ubik.Accounting.Api.Models; +using Ubik.Accounting.Structure.Api.Models; using Ubik.Accounting.Contracts.VatRate.Commands; using Ubik.ApiService.Common.Errors; -namespace Ubik.Accounting.Api.Features.VatRates.Services +namespace Ubik.Accounting.Structure.Api.Features.VatRates.Services { public interface IVatRateCommandService { diff --git a/src/Ubik.Accounting.Api/Features/VatRates/Services/IVatRateQueryService.cs b/src/Ubik.Accounting.Structure.Api/Features/VatRates/Services/IVatRateQueryService.cs similarity index 68% rename from src/Ubik.Accounting.Api/Features/VatRates/Services/IVatRateQueryService.cs rename to src/Ubik.Accounting.Structure.Api/Features/VatRates/Services/IVatRateQueryService.cs index d1692602..985b8d55 100644 --- a/src/Ubik.Accounting.Api/Features/VatRates/Services/IVatRateQueryService.cs +++ b/src/Ubik.Accounting.Structure.Api/Features/VatRates/Services/IVatRateQueryService.cs @@ -1,8 +1,8 @@ using LanguageExt; -using Ubik.Accounting.Api.Models; +using Ubik.Accounting.Structure.Api.Models; using Ubik.ApiService.Common.Errors; -namespace Ubik.Accounting.Api.Features.VatRates.Services +namespace Ubik.Accounting.Structure.Api.Features.VatRates.Services { public interface IVatRateQueryService { diff --git a/src/Ubik.Accounting.Api/Features/VatRates/Services/VatRateCommandService.cs b/src/Ubik.Accounting.Structure.Api/Features/VatRates/Services/VatRateCommandService.cs similarity index 96% rename from src/Ubik.Accounting.Api/Features/VatRates/Services/VatRateCommandService.cs rename to src/Ubik.Accounting.Structure.Api/Features/VatRates/Services/VatRateCommandService.cs index 766ac07e..0628c4fc 100644 --- a/src/Ubik.Accounting.Api/Features/VatRates/Services/VatRateCommandService.cs +++ b/src/Ubik.Accounting.Structure.Api/Features/VatRates/Services/VatRateCommandService.cs @@ -2,15 +2,15 @@ using MassTransit.Transports; using MassTransit; using Microsoft.EntityFrameworkCore; -using Ubik.Accounting.Api.Data; -using Ubik.Accounting.Api.Models; +using Ubik.Accounting.Structure.Api.Data; +using Ubik.Accounting.Structure.Api.Models; using Ubik.Accounting.Contracts.VatRate.Commands; using Ubik.Accounting.Contracts.VatRate.Events; using Ubik.ApiService.Common.Errors; using Ubik.ApiService.Common.Exceptions; -using Ubik.Accounting.Api.Mappers; +using Ubik.Accounting.Structure.Api.Mappers; -namespace Ubik.Accounting.Api.Features.VatRates.Services +namespace Ubik.Accounting.Structure.Api.Features.VatRates.Services { public class VatRateCommandService(AccountingDbContext ctx, IPublishEndpoint publishEndpoint) : IVatRateCommandService { diff --git a/src/Ubik.Accounting.Api/Features/VatRates/Services/VatRateQueryService.cs b/src/Ubik.Accounting.Structure.Api/Features/VatRates/Services/VatRateQueryService.cs similarity index 81% rename from src/Ubik.Accounting.Api/Features/VatRates/Services/VatRateQueryService.cs rename to src/Ubik.Accounting.Structure.Api/Features/VatRates/Services/VatRateQueryService.cs index a3b78dac..b32b5047 100644 --- a/src/Ubik.Accounting.Api/Features/VatRates/Services/VatRateQueryService.cs +++ b/src/Ubik.Accounting.Structure.Api/Features/VatRates/Services/VatRateQueryService.cs @@ -1,10 +1,10 @@ using LanguageExt; using Microsoft.EntityFrameworkCore; -using Ubik.Accounting.Api.Data; -using Ubik.Accounting.Api.Models; +using Ubik.Accounting.Structure.Api.Data; +using Ubik.Accounting.Structure.Api.Models; using Ubik.ApiService.Common.Errors; -namespace Ubik.Accounting.Api.Features.VatRates.Services +namespace Ubik.Accounting.Structure.Api.Features.VatRates.Services { public class VatRateQueryService(AccountingDbContext ctx) : IVatRateQueryService { diff --git a/src/Ubik.Accounting.Api/Mappers/AccountGroupMappers.cs b/src/Ubik.Accounting.Structure.Api/Mappers/AccountGroupMappers.cs similarity index 98% rename from src/Ubik.Accounting.Api/Mappers/AccountGroupMappers.cs rename to src/Ubik.Accounting.Structure.Api/Mappers/AccountGroupMappers.cs index 76faf1ec..30b5f8b7 100644 --- a/src/Ubik.Accounting.Api/Mappers/AccountGroupMappers.cs +++ b/src/Ubik.Accounting.Structure.Api/Mappers/AccountGroupMappers.cs @@ -1,11 +1,11 @@ using MassTransit; -using Ubik.Accounting.Api.Models; +using Ubik.Accounting.Structure.Api.Models; using Ubik.Accounting.Contracts.AccountGroups.Commands; using Ubik.Accounting.Contracts.AccountGroups.Events; using Ubik.Accounting.Contracts.AccountGroups.Results; using Ubik.Accounting.Contracts.Accounts.Events; -namespace Ubik.Accounting.Api.Mappers +namespace Ubik.Accounting.Structure.Api.Mappers { public static class AccountGroupMappers { diff --git a/src/Ubik.Accounting.Api/Mappers/AccountMappers.cs b/src/Ubik.Accounting.Structure.Api/Mappers/AccountMappers.cs similarity index 97% rename from src/Ubik.Accounting.Api/Mappers/AccountMappers.cs rename to src/Ubik.Accounting.Structure.Api/Mappers/AccountMappers.cs index 8f10f90a..f2b724e7 100644 --- a/src/Ubik.Accounting.Api/Mappers/AccountMappers.cs +++ b/src/Ubik.Accounting.Structure.Api/Mappers/AccountMappers.cs @@ -1,11 +1,11 @@ using MassTransit; -using Ubik.Accounting.Api.Features.Accounts.CustomPoco; -using Ubik.Accounting.Api.Models; +using Ubik.Accounting.Structure.Api.Features.Accounts.CustomPoco; +using Ubik.Accounting.Structure.Api.Models; using Ubik.Accounting.Contracts.Accounts.Commands; using Ubik.Accounting.Contracts.Accounts.Events; using Ubik.Accounting.Contracts.Accounts.Results; -namespace Ubik.Accounting.Api.Mappers +namespace Ubik.Accounting.Structure.Api.Mappers { public static class AccountMappers { diff --git a/src/Ubik.Accounting.Api/Mappers/ClassificationMappers.cs b/src/Ubik.Accounting.Structure.Api/Mappers/ClassificationMappers.cs similarity index 96% rename from src/Ubik.Accounting.Api/Mappers/ClassificationMappers.cs rename to src/Ubik.Accounting.Structure.Api/Mappers/ClassificationMappers.cs index d02f36c9..118670cb 100644 --- a/src/Ubik.Accounting.Api/Mappers/ClassificationMappers.cs +++ b/src/Ubik.Accounting.Structure.Api/Mappers/ClassificationMappers.cs @@ -1,13 +1,13 @@ using MassTransit; -using Ubik.Accounting.Api.Features.Classifications.CustomPoco; -using Ubik.Accounting.Api.Models; +using Ubik.Accounting.Structure.Api.Features.Classifications.CustomPoco; +using Ubik.Accounting.Structure.Api.Models; using Ubik.Accounting.Contracts.AccountGroups.Events; using Ubik.Accounting.Contracts.AccountGroups.Results; using Ubik.Accounting.Contracts.Classifications.Commands; using Ubik.Accounting.Contracts.Classifications.Events; using Ubik.Accounting.Contracts.Classifications.Results; -namespace Ubik.Accounting.Api.Mappers +namespace Ubik.Accounting.Structure.Api.Mappers { public static class ClassificationMappers { diff --git a/src/Ubik.Accounting.Api/Mappers/CurrencyMappers.cs b/src/Ubik.Accounting.Structure.Api/Mappers/CurrencyMappers.cs similarity index 82% rename from src/Ubik.Accounting.Api/Mappers/CurrencyMappers.cs rename to src/Ubik.Accounting.Structure.Api/Mappers/CurrencyMappers.cs index 3bfb39e7..32cead51 100644 --- a/src/Ubik.Accounting.Api/Mappers/CurrencyMappers.cs +++ b/src/Ubik.Accounting.Structure.Api/Mappers/CurrencyMappers.cs @@ -1,7 +1,7 @@ -using Ubik.Accounting.Api.Models; +using Ubik.Accounting.Structure.Api.Models; using Ubik.Accounting.Contracts.Currencies.Results; -namespace Ubik.Accounting.Api.Mappers +namespace Ubik.Accounting.Structure.Api.Mappers { public static class CurrencyMappers { diff --git a/src/Ubik.Accounting.Api/Mappers/VatRateMappers.cs b/src/Ubik.Accounting.Structure.Api/Mappers/VatRateMappers.cs similarity index 97% rename from src/Ubik.Accounting.Api/Mappers/VatRateMappers.cs rename to src/Ubik.Accounting.Structure.Api/Mappers/VatRateMappers.cs index a9c9d717..2b51d9f6 100644 --- a/src/Ubik.Accounting.Api/Mappers/VatRateMappers.cs +++ b/src/Ubik.Accounting.Structure.Api/Mappers/VatRateMappers.cs @@ -1,9 +1,9 @@ -using Ubik.Accounting.Api.Models; +using Ubik.Accounting.Structure.Api.Models; using Ubik.Accounting.Contracts.VatRate.Commands; using Ubik.Accounting.Contracts.VatRate.Events; using Ubik.Accounting.Contracts.VatRate.Results; -namespace Ubik.Accounting.Api.Mappers +namespace Ubik.Accounting.Structure.Api.Mappers { public static class VatRateMappers { diff --git a/src/Ubik.Accounting.Api/Metrics/prometheus.yml b/src/Ubik.Accounting.Structure.Api/Metrics/prometheus.yml similarity index 100% rename from src/Ubik.Accounting.Api/Metrics/prometheus.yml rename to src/Ubik.Accounting.Structure.Api/Metrics/prometheus.yml diff --git a/src/Ubik.Accounting.Api/Metrics/startdocker.txt b/src/Ubik.Accounting.Structure.Api/Metrics/startdocker.txt similarity index 100% rename from src/Ubik.Accounting.Api/Metrics/startdocker.txt rename to src/Ubik.Accounting.Structure.Api/Metrics/startdocker.txt diff --git a/src/Ubik.Accounting.Api/Models/Account.cs b/src/Ubik.Accounting.Structure.Api/Models/Account.cs similarity index 94% rename from src/Ubik.Accounting.Api/Models/Account.cs rename to src/Ubik.Accounting.Structure.Api/Models/Account.cs index ad31f71c..4adadb5b 100644 --- a/src/Ubik.Accounting.Api/Models/Account.cs +++ b/src/Ubik.Accounting.Structure.Api/Models/Account.cs @@ -1,7 +1,7 @@ using Ubik.Accounting.Contracts.Accounts.Enums; using Ubik.DB.Common; -namespace Ubik.Accounting.Api.Models +namespace Ubik.Accounting.Structure.Api.Models { public class Account : ITenantEntity, IConcurrencyCheckEntity, IAuditEntity { diff --git a/src/Ubik.Accounting.Api/Models/AccountAccountGroup.cs b/src/Ubik.Accounting.Structure.Api/Models/AccountAccountGroup.cs similarity index 93% rename from src/Ubik.Accounting.Api/Models/AccountAccountGroup.cs rename to src/Ubik.Accounting.Structure.Api/Models/AccountAccountGroup.cs index e70be54d..8bd122f7 100644 --- a/src/Ubik.Accounting.Api/Models/AccountAccountGroup.cs +++ b/src/Ubik.Accounting.Structure.Api/Models/AccountAccountGroup.cs @@ -1,6 +1,6 @@ using Ubik.DB.Common; -namespace Ubik.Accounting.Api.Models +namespace Ubik.Accounting.Structure.Api.Models { public class AccountAccountGroup : ITenantEntity, IConcurrencyCheckEntity, IAuditEntity { diff --git a/src/Ubik.Accounting.Api/Models/AccountGroup.cs b/src/Ubik.Accounting.Structure.Api/Models/AccountGroup.cs similarity index 95% rename from src/Ubik.Accounting.Api/Models/AccountGroup.cs rename to src/Ubik.Accounting.Structure.Api/Models/AccountGroup.cs index 5296a757..1aef7fd9 100644 --- a/src/Ubik.Accounting.Api/Models/AccountGroup.cs +++ b/src/Ubik.Accounting.Structure.Api/Models/AccountGroup.cs @@ -1,7 +1,7 @@ using System.ComponentModel.DataAnnotations; using Ubik.DB.Common; -namespace Ubik.Accounting.Api.Models +namespace Ubik.Accounting.Structure.Api.Models { public class AccountGroup : ITenantEntity, IConcurrencyCheckEntity, IAuditEntity { diff --git a/src/Ubik.Accounting.Api/Models/AccountVatConfig.cs b/src/Ubik.Accounting.Structure.Api/Models/AccountVatConfig.cs similarity index 93% rename from src/Ubik.Accounting.Api/Models/AccountVatConfig.cs rename to src/Ubik.Accounting.Structure.Api/Models/AccountVatConfig.cs index 55f06a5e..318aeb50 100644 --- a/src/Ubik.Accounting.Api/Models/AccountVatConfig.cs +++ b/src/Ubik.Accounting.Structure.Api/Models/AccountVatConfig.cs @@ -1,6 +1,6 @@ using Ubik.DB.Common; -namespace Ubik.Accounting.Api.Models +namespace Ubik.Accounting.Structure.Api.Models { public class AccountVatConfig : ITenantEntity, IConcurrencyCheckEntity, IAuditEntity { diff --git a/src/Ubik.Accounting.Api/Models/Classification.cs b/src/Ubik.Accounting.Structure.Api/Models/Classification.cs similarity index 93% rename from src/Ubik.Accounting.Api/Models/Classification.cs rename to src/Ubik.Accounting.Structure.Api/Models/Classification.cs index 5942fa6d..4a638e82 100644 --- a/src/Ubik.Accounting.Api/Models/Classification.cs +++ b/src/Ubik.Accounting.Structure.Api/Models/Classification.cs @@ -1,7 +1,7 @@ using System.ComponentModel.DataAnnotations; using Ubik.DB.Common; -namespace Ubik.Accounting.Api.Models +namespace Ubik.Accounting.Structure.Api.Models { public class Classification : ITenantEntity, IConcurrencyCheckEntity, IAuditEntity { diff --git a/src/Ubik.Accounting.Api/Models/Currency.cs b/src/Ubik.Accounting.Structure.Api/Models/Currency.cs similarity index 89% rename from src/Ubik.Accounting.Api/Models/Currency.cs rename to src/Ubik.Accounting.Structure.Api/Models/Currency.cs index a5d06439..6a08bd81 100644 --- a/src/Ubik.Accounting.Api/Models/Currency.cs +++ b/src/Ubik.Accounting.Structure.Api/Models/Currency.cs @@ -1,7 +1,7 @@ using System.ComponentModel.DataAnnotations; using Ubik.DB.Common; -namespace Ubik.Accounting.Api.Models +namespace Ubik.Accounting.Structure.Api.Models { //TODO: will be updated by another service public class Currency : ITenantEntity, IConcurrencyCheckEntity diff --git a/src/Ubik.Accounting.Api/Models/Entry.cs b/src/Ubik.Accounting.Structure.Api/Models/Entry.cs similarity index 97% rename from src/Ubik.Accounting.Api/Models/Entry.cs rename to src/Ubik.Accounting.Structure.Api/Models/Entry.cs index b473fb3c..438d809f 100644 --- a/src/Ubik.Accounting.Api/Models/Entry.cs +++ b/src/Ubik.Accounting.Structure.Api/Models/Entry.cs @@ -1,7 +1,7 @@ using Microsoft.EntityFrameworkCore; using Ubik.DB.Common; -namespace Ubik.Accounting.Api.Models +namespace Ubik.Accounting.Structure.Api.Models { public enum DebitCredit { diff --git a/src/Ubik.Accounting.Api/Models/Transaction.cs b/src/Ubik.Accounting.Structure.Api/Models/Transaction.cs similarity index 93% rename from src/Ubik.Accounting.Api/Models/Transaction.cs rename to src/Ubik.Accounting.Structure.Api/Models/Transaction.cs index bcea4414..e0e4ba09 100644 --- a/src/Ubik.Accounting.Api/Models/Transaction.cs +++ b/src/Ubik.Accounting.Structure.Api/Models/Transaction.cs @@ -1,6 +1,6 @@ using Ubik.DB.Common; -namespace Ubik.Accounting.Api.Models +namespace Ubik.Accounting.Structure.Api.Models { //Containes the entries packet diff --git a/src/Ubik.Accounting.Api/Models/VatRate.cs b/src/Ubik.Accounting.Structure.Api/Models/VatRate.cs similarity index 93% rename from src/Ubik.Accounting.Api/Models/VatRate.cs rename to src/Ubik.Accounting.Structure.Api/Models/VatRate.cs index 8e9ba15f..f926b3a8 100644 --- a/src/Ubik.Accounting.Api/Models/VatRate.cs +++ b/src/Ubik.Accounting.Structure.Api/Models/VatRate.cs @@ -1,6 +1,6 @@ using Ubik.DB.Common; -namespace Ubik.Accounting.Api.Models +namespace Ubik.Accounting.Structure.Api.Models { public class VatRate : ITenantEntity, IConcurrencyCheckEntity, IAuditEntity { diff --git a/src/Ubik.Accounting.Api/Program.cs b/src/Ubik.Accounting.Structure.Api/Program.cs similarity index 94% rename from src/Ubik.Accounting.Api/Program.cs rename to src/Ubik.Accounting.Structure.Api/Program.cs index 443db280..501bbb8a 100644 --- a/src/Ubik.Accounting.Api/Program.cs +++ b/src/Ubik.Accounting.Structure.Api/Program.cs @@ -1,11 +1,11 @@ -using Ubik.Accounting.Api.Data; +using Ubik.Accounting.Structure.Api.Data; using Microsoft.EntityFrameworkCore; using Ubik.ApiService.Common.Services; using Ubik.ApiService.Common.Exceptions; -using Ubik.Accounting.Api.Features; +using Ubik.Accounting.Structure.Api.Features; using System.Reflection; -using Ubik.Accounting.Api.Data.Init; +using Ubik.Accounting.Structure.Api.Data.Init; using Microsoft.AspNetCore.Mvc; using MassTransit; using Ubik.ApiService.Common.Configure; @@ -17,11 +17,11 @@ using Ubik.Accounting.Contracts.AccountGroups.Commands; using Ubik.Accounting.Contracts.Classifications.Commands; using Ubik.ApiService.Common.Middlewares; -using Ubik.Accounting.Api.Features.Application.Services; -using Ubik.Accounting.Api.Features.AccountGroups.Services; -using Ubik.Accounting.Api.Features.Accounts.Services; -using Ubik.Accounting.Api.Features.Classifications.Services; -using Ubik.Accounting.Api.Features.Currencies.Services; +using Ubik.Accounting.Structure.Api.Features.Application.Services; +using Ubik.Accounting.Structure.Api.Features.AccountGroups.Services; +using Ubik.Accounting.Structure.Api.Features.Accounts.Services; +using Ubik.Accounting.Structure.Api.Features.Classifications.Services; +using Ubik.Accounting.Structure.Api.Features.Currencies.Services; namespace Ubik.Accounting.Api { diff --git a/src/Ubik.Accounting.Api/Properties/launchSettings.json b/src/Ubik.Accounting.Structure.Api/Properties/launchSettings.json similarity index 100% rename from src/Ubik.Accounting.Api/Properties/launchSettings.json rename to src/Ubik.Accounting.Structure.Api/Properties/launchSettings.json diff --git a/src/Ubik.Accounting.Api/Ubik.Accounting.Api.csproj b/src/Ubik.Accounting.Structure.Api/Ubik.Accounting.Structure.Api.csproj similarity index 100% rename from src/Ubik.Accounting.Api/Ubik.Accounting.Api.csproj rename to src/Ubik.Accounting.Structure.Api/Ubik.Accounting.Structure.Api.csproj diff --git a/src/Ubik.Accounting.Api/appsettings.Development.json b/src/Ubik.Accounting.Structure.Api/appsettings.Development.json similarity index 100% rename from src/Ubik.Accounting.Api/appsettings.Development.json rename to src/Ubik.Accounting.Structure.Api/appsettings.Development.json diff --git a/src/Ubik.Accounting.Api/appsettings.json b/src/Ubik.Accounting.Structure.Api/appsettings.json similarity index 100% rename from src/Ubik.Accounting.Api/appsettings.json rename to src/Ubik.Accounting.Structure.Api/appsettings.json diff --git a/src/Ubik.Accounting.Api/tailwind.extension.json b/src/Ubik.Accounting.Structure.Api/tailwind.extension.json similarity index 100% rename from src/Ubik.Accounting.Api/tailwind.extension.json rename to src/Ubik.Accounting.Structure.Api/tailwind.extension.json diff --git a/src/Ubik.CodeGenerator/ContractsGenerator.cs b/src/Ubik.CodeGenerator/ContractsGenerator.cs index 09b1369a..5ec2a1c9 100644 --- a/src/Ubik.CodeGenerator/ContractsGenerator.cs +++ b/src/Ubik.CodeGenerator/ContractsGenerator.cs @@ -1,6 +1,6 @@ using Microsoft.EntityFrameworkCore.Metadata; using System.Text; -using Ubik.Accounting.Api.Data; +using Ubik.Accounting.Structure.Api.Data; using Ubik.Security.Api.Data; namespace Ubik.CodeGenerator diff --git a/src/Ubik.CodeGenerator/MappersGenerator.cs b/src/Ubik.CodeGenerator/MappersGenerator.cs index d7cb214f..fd79fac0 100644 --- a/src/Ubik.CodeGenerator/MappersGenerator.cs +++ b/src/Ubik.CodeGenerator/MappersGenerator.cs @@ -1,6 +1,6 @@ using Microsoft.EntityFrameworkCore.Metadata; using System.Text; -using Ubik.Accounting.Api.Data; +using Ubik.Accounting.Structure.Api.Data; using Ubik.Security.Api.Data; namespace Ubik.CodeGenerator diff --git a/src/Ubik.CodeGenerator/Program.cs b/src/Ubik.CodeGenerator/Program.cs index 48a6daa3..71a7fd9c 100644 --- a/src/Ubik.CodeGenerator/Program.cs +++ b/src/Ubik.CodeGenerator/Program.cs @@ -1,7 +1,7 @@ // See https://aka.ms/new-console-template for more information using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.DependencyInjection; -using Ubik.Accounting.Api.Data; +using Ubik.Accounting.Structure.Api.Data; using Ubik.ApiService.Common.Services; using Ubik.CodeGenerator; using Ubik.Security.Api.Data; diff --git a/src/Ubik.CodeGenerator/ServicesGenerator.cs b/src/Ubik.CodeGenerator/ServicesGenerator.cs index 882c7254..055c3827 100644 --- a/src/Ubik.CodeGenerator/ServicesGenerator.cs +++ b/src/Ubik.CodeGenerator/ServicesGenerator.cs @@ -1,4 +1,4 @@ -using Ubik.Accounting.Api.Data; +using Ubik.Accounting.Structure.Api.Data; using Ubik.Security.Api.Data; namespace Ubik.CodeGenerator diff --git a/src/Ubik.CodeGenerator/Ubik.CodeGenerator.csproj b/src/Ubik.CodeGenerator/Ubik.CodeGenerator.csproj index 35ea200c..6a93d686 100644 --- a/src/Ubik.CodeGenerator/Ubik.CodeGenerator.csproj +++ b/src/Ubik.CodeGenerator/Ubik.CodeGenerator.csproj @@ -12,7 +12,8 @@ - + + diff --git a/src/Ubik.sln b/src/Ubik.sln index 42dff7d6..2d4b3cd3 100644 --- a/src/Ubik.sln +++ b/src/Ubik.sln @@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 VisualStudioVersion = 17.7.34009.444 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ubik.Accounting.Api", "Ubik.Accounting.Api\Ubik.Accounting.Api.csproj", "{F28CD602-E518-42F1-9CAC-C73C410557A9}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ubik.Accounting.Structure.Api", "Ubik.Accounting.Structure.Api\Ubik.Accounting.Structure.Api.csproj", "{F28CD602-E518-42F1-9CAC-C73C410557A9}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ubik.DB.Common", "Ubik.Db.Common\Ubik.DB.Common\Ubik.DB.Common.csproj", "{9C4F6F38-A0EF-483C-8274-C020E4769136}" EndProject diff --git a/tests/Ubik.Accounting.Api.Tests.UnitTests/Ubik.Accounting.Api.Tests.UnitTests.csproj b/tests/Ubik.Accounting.Api.Tests.UnitTests/Ubik.Accounting.Api.Tests.UnitTests.csproj index ea65072d..2aa1575a 100644 --- a/tests/Ubik.Accounting.Api.Tests.UnitTests/Ubik.Accounting.Api.Tests.UnitTests.csproj +++ b/tests/Ubik.Accounting.Api.Tests.UnitTests/Ubik.Accounting.Api.Tests.UnitTests.csproj @@ -26,7 +26,7 @@ - + diff --git a/tests/Ubik.Api.Tests.Integration/Features/Accounting/Classifications/ClassificationsController_Test.cs b/tests/Ubik.Api.Tests.Integration/Features/Accounting/Classifications/ClassificationsController_Test.cs index 4aa500c7..91b1e36f 100644 --- a/tests/Ubik.Api.Tests.Integration/Features/Accounting/Classifications/ClassificationsController_Test.cs +++ b/tests/Ubik.Api.Tests.Integration/Features/Accounting/Classifications/ClassificationsController_Test.cs @@ -12,7 +12,7 @@ using Ubik.ApiService.Common.Exceptions; using Ubik.Accounting.Contracts.Classifications.Commands; using MassTransit; -using Ubik.Accounting.Api.Models; +using Ubik.Accounting.Structure.Api.Models; namespace Ubik.Api.Tests.Integration.Features.Accounting.Classifications { diff --git a/tests/Ubik.Api.Tests.Integration/Ubik.Api.Tests.Integration.csproj b/tests/Ubik.Api.Tests.Integration/Ubik.Api.Tests.Integration.csproj index 60ae74cb..8b61e05b 100644 --- a/tests/Ubik.Api.Tests.Integration/Ubik.Api.Tests.Integration.csproj +++ b/tests/Ubik.Api.Tests.Integration/Ubik.Api.Tests.Integration.csproj @@ -37,7 +37,8 @@ - + + From 08e8154fc5f7b8506b7f3c0bdcb889a571233506 Mon Sep 17 00:00:00 2001 From: ubik Date: Thu, 31 Oct 2024 21:27:21 +0100 Subject: [PATCH 11/94] Rename accounting contracts prj + namespace --- .../Events/ClassificationDeleted.cs | 11 ------ src/Ubik.Accounting.Structure.Api/Dockerfile | 2 +- .../Controller/v1/AccountGroupsController.cs | 6 ++-- .../Services/AccountGroupCommandService.cs | 4 +-- .../Services/IAccountGroupCommandService.cs | 2 +- .../Controller/v1/AccountsController.cs | 4 +-- .../Services/AccountCommandService.cs | 4 +-- .../Services/IAccountCommandService.cs | 2 +- .../v1/ClassificationsController.cs | 6 ++-- .../Services/ClassificationCommandService.cs | 4 +-- .../Services/IClassificationCommandService.cs | 2 +- .../Controller/v1/CurrenciesController.cs | 2 +- .../Services/IVatRateCommandService.cs | 2 +- .../Services/VatRateCommandService.cs | 4 +-- .../Mappers/AccountGroupMappers.cs | 8 ++--- .../Mappers/AccountMappers.cs | 6 ++-- .../Mappers/ClassificationMappers.cs | 10 +++--- .../Mappers/CurrencyMappers.cs | 2 +- .../Mappers/VatRateMappers.cs | 6 ++-- .../Models/Account.cs | 2 +- .../Models/Currency.cs | 2 +- src/Ubik.Accounting.Structure.Api/Program.cs | 8 ++--- .../Ubik.Accounting.Structure.Api.csproj | 2 +- .../Commands/AddAccountGroupCommand.cs | 2 +- .../Commands/DeleteAccountGroupCommand.cs | 2 +- .../Commands/UpdateAccountGroupCommand.cs | 2 +- .../AccountGroups/Events/AccountGroupAdded.cs | 2 +- .../Events/AccountGroupDeleted.cs | 2 +- .../Events/AccountGroupUpdated.cs | 2 +- .../Events/AccountGroupsDeleted.cs | 2 +- .../Results/AccountGroupStandardResult.cs | 2 +- .../Accounts/Commands/AddAccountCommand.cs | 4 +-- .../AddAccountInAccountGroupCommand.cs | 2 +- .../DeleteAccountInAccountGroupCommand.cs | 2 +- .../Accounts/Commands/UpdateAccountCommand.cs | 4 +-- .../Accounts/Enums/AccountCategory.cs | 2 +- .../Accounts/Enums/AccountDomain.cs | 2 +- .../Accounts/Events/AccountAdded.cs | 4 +-- .../Events/AccountAddedInAccountGroup.cs | 2 +- .../Accounts/Events/AccountDeleted.cs | 2 +- .../Events/AccountDeletedInAccountGroup.cs | 2 +- .../Accounts/Events/AccountUpdated.cs | 4 +-- .../Results/AccountGroupLinkResult.cs | 2 +- .../AccountGroupWithClassificationResult.cs | 2 +- .../Results/AccountInAccountGroupResult.cs | 2 +- .../Accounts/Results/AccountStandardResult.cs | 4 +-- .../Commands/AddClassificationCommand.cs | 2 +- .../Commands/DeleteClassificationCommand.cs | 2 +- .../Commands/UpdateClassificationCommand.cs | 2 +- .../Events/ClassificationAdded.cs | 2 +- .../Events/ClassificationDeleted.cs | 11 ++++++ .../Events/ClassificationUpdated.cs | 2 +- .../Results/ClassificationDeleteResult.cs | 4 +-- .../Results/ClassificationStandardResult.cs | 2 +- .../Results/ClassificationStatusResult.cs | 4 +-- .../Results/CurrencyStandardResult.cs | 2 +- ...bik.Accounting.Structure.Contracts.csproj} | 0 .../VatRate/Commands/AddVatRateCommand.cs | 2 +- .../VatRate/Commands/UpdateVatRateCommand.cs | 2 +- .../VatRate/Events/VatRateAdded.cs | 2 +- .../VatRate/Events/VatRateDeleted.cs | 2 +- .../VatRate/Events/VatRateUpdated.cs | 2 +- .../VatRate/Results/VatRateStandardResult.cs | 2 +- .../Components/Accounts/AccountFilters.razor | 4 +-- .../Accounts/AccountFiltersModel.cs | 2 +- .../Components/Accounts/AccountForm.razor | 4 +-- .../Components/Accounts/AccountModel.cs | 6 ++-- .../Components/Accounts/Accounts.razor | 6 ++-- .../AccountGroupAccountAttach.razor | 4 +-- .../AccountGroupAccountDetach.razor | 4 +-- .../AccountGroupConfirmDelete.razor | 2 +- .../Classifications/AccountGroupForm.razor | 2 +- .../Classifications/AccountGroupNode.razor | 2 +- .../Classifications/ClassificationForm.razor | 2 +- .../Classifications/ClassificationModel.cs | 4 +-- .../Classifications/Classifications.razor | 6 ++-- .../Facades/HttpApiAccountingFacade.cs | 6 ++-- .../ApiClients/AccountingApiClient.cs | 6 ++-- .../Controllers/ReverseProxyWasm.cs | 6 ++-- src/Ubik.Accounting.WebApp/Dockerfile | 2 +- .../Ubik.Accounting.WebApp.csproj | 1 + .../Facades/IAccountingApiClient.cs | 6 ++-- .../Models/AccountGroupLinkModel.cs | 4 +-- .../Models/AccountGroupModel.cs | 6 ++-- .../Classifications/Models/AccountModel.cs | 6 ++-- .../Ubik.Accounting.Webapp.Shared.csproj | 2 +- .../Ubik.CodeGenerator.csproj | 1 - src/Ubik.sln | 8 +---- .../GlobalUsings.cs | 1 - ...Ubik.Accounting.Api.Tests.UnitTests.csproj | 36 ------------------- .../AccountGroupsController_Test.cs | 6 ++-- .../Accounts/AccountsController_Test.cs | 6 ++-- .../ClassificationsController_Test.cs | 6 ++-- .../Currencies/CurrenciesController_Test.cs | 4 +-- .../Ubik.Api.Tests.Integration.csproj | 2 +- 95 files changed, 161 insertions(+), 204 deletions(-) delete mode 100644 src/Ubik.Accounting.Contracts/Classifications/Events/ClassificationDeleted.cs rename src/{Ubik.Accounting.Contracts => Ubik.Accounting.Structure.Contracts}/AccountGroups/Commands/AddAccountGroupCommand.cs (88%) rename src/{Ubik.Accounting.Contracts => Ubik.Accounting.Structure.Contracts}/AccountGroups/Commands/DeleteAccountGroupCommand.cs (70%) rename src/{Ubik.Accounting.Contracts => Ubik.Accounting.Structure.Contracts}/AccountGroups/Commands/UpdateAccountGroupCommand.cs (90%) rename src/{Ubik.Accounting.Contracts => Ubik.Accounting.Structure.Contracts}/AccountGroups/Events/AccountGroupAdded.cs (85%) rename src/{Ubik.Accounting.Contracts => Ubik.Accounting.Structure.Contracts}/AccountGroups/Events/AccountGroupDeleted.cs (78%) rename src/{Ubik.Accounting.Contracts => Ubik.Accounting.Structure.Contracts}/AccountGroups/Events/AccountGroupUpdated.cs (85%) rename src/{Ubik.Accounting.Contracts => Ubik.Accounting.Structure.Contracts}/AccountGroups/Events/AccountGroupsDeleted.cs (67%) rename src/{Ubik.Accounting.Contracts => Ubik.Accounting.Structure.Contracts}/AccountGroups/Results/AccountGroupStandardResult.cs (88%) rename src/{Ubik.Accounting.Contracts => Ubik.Accounting.Structure.Contracts}/Accounts/Commands/AddAccountCommand.cs (86%) rename src/{Ubik.Accounting.Contracts => Ubik.Accounting.Structure.Contracts}/Accounts/Commands/AddAccountInAccountGroupCommand.cs (79%) rename src/{Ubik.Accounting.Contracts => Ubik.Accounting.Structure.Contracts}/Accounts/Commands/DeleteAccountInAccountGroupCommand.cs (79%) rename src/{Ubik.Accounting.Contracts => Ubik.Accounting.Structure.Contracts}/Accounts/Commands/UpdateAccountCommand.cs (87%) rename src/{Ubik.Accounting.Contracts => Ubik.Accounting.Structure.Contracts}/Accounts/Enums/AccountCategory.cs (76%) rename src/{Ubik.Accounting.Contracts => Ubik.Accounting.Structure.Contracts}/Accounts/Enums/AccountDomain.cs (78%) rename src/{Ubik.Accounting.Contracts => Ubik.Accounting.Structure.Contracts}/Accounts/Events/AccountAdded.cs (81%) rename src/{Ubik.Accounting.Contracts => Ubik.Accounting.Structure.Contracts}/Accounts/Events/AccountAddedInAccountGroup.cs (70%) rename src/{Ubik.Accounting.Contracts => Ubik.Accounting.Structure.Contracts}/Accounts/Events/AccountDeleted.cs (57%) rename src/{Ubik.Accounting.Contracts => Ubik.Accounting.Structure.Contracts}/Accounts/Events/AccountDeletedInAccountGroup.cs (70%) rename src/{Ubik.Accounting.Contracts => Ubik.Accounting.Structure.Contracts}/Accounts/Events/AccountUpdated.cs (81%) rename src/{Ubik.Accounting.Contracts => Ubik.Accounting.Structure.Contracts}/Accounts/Results/AccountGroupLinkResult.cs (84%) rename src/{Ubik.Accounting.Contracts => Ubik.Accounting.Structure.Contracts}/Accounts/Results/AccountGroupWithClassificationResult.cs (86%) rename src/{Ubik.Accounting.Contracts => Ubik.Accounting.Structure.Contracts}/Accounts/Results/AccountInAccountGroupResult.cs (78%) rename src/{Ubik.Accounting.Contracts => Ubik.Accounting.Structure.Contracts}/Accounts/Results/AccountStandardResult.cs (83%) rename src/{Ubik.Accounting.Contracts => Ubik.Accounting.Structure.Contracts}/Classifications/Commands/AddClassificationCommand.cs (84%) rename src/{Ubik.Accounting.Contracts => Ubik.Accounting.Structure.Contracts}/Classifications/Commands/DeleteClassificationCommand.cs (70%) rename src/{Ubik.Accounting.Contracts => Ubik.Accounting.Structure.Contracts}/Classifications/Commands/UpdateClassificationCommand.cs (87%) rename src/{Ubik.Accounting.Contracts => Ubik.Accounting.Structure.Contracts}/Classifications/Events/ClassificationAdded.cs (80%) create mode 100644 src/Ubik.Accounting.Structure.Contracts/Classifications/Events/ClassificationDeleted.cs rename src/{Ubik.Accounting.Contracts => Ubik.Accounting.Structure.Contracts}/Classifications/Events/ClassificationUpdated.cs (80%) rename src/{Ubik.Accounting.Contracts => Ubik.Accounting.Structure.Contracts}/Classifications/Results/ClassificationDeleteResult.cs (58%) rename src/{Ubik.Accounting.Contracts => Ubik.Accounting.Structure.Contracts}/Classifications/Results/ClassificationStandardResult.cs (80%) rename src/{Ubik.Accounting.Contracts => Ubik.Accounting.Structure.Contracts}/Classifications/Results/ClassificationStatusResult.cs (63%) rename src/{Ubik.Accounting.Contracts => Ubik.Accounting.Structure.Contracts}/Currencies/Results/CurrencyStandardResult.cs (73%) rename src/{Ubik.Accounting.Contracts/Ubik.Accounting.Contracts.csproj => Ubik.Accounting.Structure.Contracts/Ubik.Accounting.Structure.Contracts.csproj} (100%) rename src/{Ubik.Accounting.Contracts => Ubik.Accounting.Structure.Contracts}/VatRate/Commands/AddVatRateCommand.cs (89%) rename src/{Ubik.Accounting.Contracts => Ubik.Accounting.Structure.Contracts}/VatRate/Commands/UpdateVatRateCommand.cs (91%) rename src/{Ubik.Accounting.Contracts => Ubik.Accounting.Structure.Contracts}/VatRate/Events/VatRateAdded.cs (88%) rename src/{Ubik.Accounting.Contracts => Ubik.Accounting.Structure.Contracts}/VatRate/Events/VatRateDeleted.cs (77%) rename src/{Ubik.Accounting.Contracts => Ubik.Accounting.Structure.Contracts}/VatRate/Events/VatRateUpdated.cs (88%) rename src/{Ubik.Accounting.Contracts => Ubik.Accounting.Structure.Contracts}/VatRate/Results/VatRateStandardResult.cs (88%) delete mode 100644 tests/Ubik.Accounting.Api.Tests.UnitTests/GlobalUsings.cs delete mode 100644 tests/Ubik.Accounting.Api.Tests.UnitTests/Ubik.Accounting.Api.Tests.UnitTests.csproj diff --git a/src/Ubik.Accounting.Contracts/Classifications/Events/ClassificationDeleted.cs b/src/Ubik.Accounting.Contracts/Classifications/Events/ClassificationDeleted.cs deleted file mode 100644 index 15776c33..00000000 --- a/src/Ubik.Accounting.Contracts/Classifications/Events/ClassificationDeleted.cs +++ /dev/null @@ -1,11 +0,0 @@ -using Ubik.Accounting.Contracts.AccountGroups.Events; -using Ubik.Accounting.Contracts.AccountGroups.Results; - -namespace Ubik.Accounting.Contracts.Classifications.Events -{ - public record ClassificationDeleted - { - public Guid Id { get; init; } - public IEnumerable AccountGroupsDeleted { get; init; } = []; - } -} diff --git a/src/Ubik.Accounting.Structure.Api/Dockerfile b/src/Ubik.Accounting.Structure.Api/Dockerfile index ecea3d9b..7a465b0c 100644 --- a/src/Ubik.Accounting.Structure.Api/Dockerfile +++ b/src/Ubik.Accounting.Structure.Api/Dockerfile @@ -13,7 +13,7 @@ FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build ARG BUILD_CONFIGURATION=Release WORKDIR / COPY ["src/Ubik.Accounting.Structure.Api/Ubik.Accounting.Structure.Api.csproj", "src/Ubik.Accounting.Structure.Api/"] -COPY ["src/Ubik.Accounting.Contracts/Ubik.Accounting.Contracts.csproj", "src/Ubik.Accounting.Contracts/"] +COPY ["src/Ubik.Accounting.Structure.Contracts/Ubik.Accounting.Structure.Contracts.csproj", "src/Ubik.Accounting.Structure.Contracts/"] COPY ["src/Ubik.Db.Common/Ubik.DB.Common/Ubik.DB.Common.csproj", "src/Ubik.Db.Common/Ubik.DB.Common/"] COPY ["src/Ubik.ApiService.Common/Ubik.ApiService.Common.csproj", "src/Ubik.ApiService.Common/"] #COPY ["src/mycert.cer", "src/"] diff --git a/src/Ubik.Accounting.Structure.Api/Features/AccountGroups/Controller/v1/AccountGroupsController.cs b/src/Ubik.Accounting.Structure.Api/Features/AccountGroups/Controller/v1/AccountGroupsController.cs index c29b98b4..ae989177 100644 --- a/src/Ubik.Accounting.Structure.Api/Features/AccountGroups/Controller/v1/AccountGroupsController.cs +++ b/src/Ubik.Accounting.Structure.Api/Features/AccountGroups/Controller/v1/AccountGroupsController.cs @@ -1,11 +1,11 @@ using Microsoft.AspNetCore.Mvc; using Ubik.ApiService.Common.Exceptions; using Asp.Versioning; -using Ubik.Accounting.Contracts.AccountGroups.Results; -using Ubik.Accounting.Contracts.AccountGroups.Commands; +using Ubik.Accounting.Structure.Contracts.AccountGroups.Results; +using Ubik.Accounting.Structure.Contracts.AccountGroups.Commands; using Ubik.ApiService.Common.Errors; using Ubik.Accounting.Structure.Api.Features.AccountGroups.Services; -using Ubik.Accounting.Contracts.Accounts.Results; +using Ubik.Accounting.Structure.Contracts.Accounts.Results; using Ubik.Accounting.Structure.Api.Mappers; namespace Ubik.Accounting.Structure.Api.Features.AccountGroups.Controller.v1 diff --git a/src/Ubik.Accounting.Structure.Api/Features/AccountGroups/Services/AccountGroupCommandService.cs b/src/Ubik.Accounting.Structure.Api/Features/AccountGroups/Services/AccountGroupCommandService.cs index 9c49fef6..e4be3630 100644 --- a/src/Ubik.Accounting.Structure.Api/Features/AccountGroups/Services/AccountGroupCommandService.cs +++ b/src/Ubik.Accounting.Structure.Api/Features/AccountGroups/Services/AccountGroupCommandService.cs @@ -7,8 +7,8 @@ using Ubik.Accounting.Structure.Api.Features.AccountGroups.Errors; using Ubik.Accounting.Structure.Api.Mappers; using Ubik.Accounting.Structure.Api.Models; -using Ubik.Accounting.Contracts.AccountGroups.Commands; -using Ubik.Accounting.Contracts.AccountGroups.Events; +using Ubik.Accounting.Structure.Contracts.AccountGroups.Commands; +using Ubik.Accounting.Structure.Contracts.AccountGroups.Events; using Ubik.ApiService.Common.Errors; using Ubik.ApiService.Common.Exceptions; diff --git a/src/Ubik.Accounting.Structure.Api/Features/AccountGroups/Services/IAccountGroupCommandService.cs b/src/Ubik.Accounting.Structure.Api/Features/AccountGroups/Services/IAccountGroupCommandService.cs index 0d5709ee..29eddb7b 100644 --- a/src/Ubik.Accounting.Structure.Api/Features/AccountGroups/Services/IAccountGroupCommandService.cs +++ b/src/Ubik.Accounting.Structure.Api/Features/AccountGroups/Services/IAccountGroupCommandService.cs @@ -1,6 +1,6 @@ using LanguageExt; using Ubik.Accounting.Structure.Api.Models; -using Ubik.Accounting.Contracts.AccountGroups.Commands; +using Ubik.Accounting.Structure.Contracts.AccountGroups.Commands; using Ubik.ApiService.Common.Errors; namespace Ubik.Accounting.Structure.Api.Features.AccountGroups.Services diff --git a/src/Ubik.Accounting.Structure.Api/Features/Accounts/Controller/v1/AccountsController.cs b/src/Ubik.Accounting.Structure.Api/Features/Accounts/Controller/v1/AccountsController.cs index 017b8570..ffe6fc95 100644 --- a/src/Ubik.Accounting.Structure.Api/Features/Accounts/Controller/v1/AccountsController.cs +++ b/src/Ubik.Accounting.Structure.Api/Features/Accounts/Controller/v1/AccountsController.cs @@ -3,8 +3,8 @@ using Microsoft.AspNetCore.Mvc; using Ubik.Accounting.Structure.Api.Features.Accounts.Services; using Ubik.Accounting.Structure.Api.Mappers; -using Ubik.Accounting.Contracts.Accounts.Commands; -using Ubik.Accounting.Contracts.Accounts.Results; +using Ubik.Accounting.Structure.Contracts.Accounts.Commands; +using Ubik.Accounting.Structure.Contracts.Accounts.Results; using Ubik.ApiService.Common.Errors; using Ubik.ApiService.Common.Exceptions; diff --git a/src/Ubik.Accounting.Structure.Api/Features/Accounts/Services/AccountCommandService.cs b/src/Ubik.Accounting.Structure.Api/Features/Accounts/Services/AccountCommandService.cs index b1436a2d..cd6822a2 100644 --- a/src/Ubik.Accounting.Structure.Api/Features/Accounts/Services/AccountCommandService.cs +++ b/src/Ubik.Accounting.Structure.Api/Features/Accounts/Services/AccountCommandService.cs @@ -7,8 +7,8 @@ using Ubik.Accounting.Structure.Api.Features.Accounts.Errors; using Ubik.Accounting.Structure.Api.Mappers; using Ubik.Accounting.Structure.Api.Models; -using Ubik.Accounting.Contracts.Accounts.Commands; -using Ubik.Accounting.Contracts.Accounts.Events; +using Ubik.Accounting.Structure.Contracts.Accounts.Commands; +using Ubik.Accounting.Structure.Contracts.Accounts.Events; using Ubik.ApiService.Common.Errors; using Ubik.ApiService.Common.Exceptions; using Ubik.ApiService.Common.Services; diff --git a/src/Ubik.Accounting.Structure.Api/Features/Accounts/Services/IAccountCommandService.cs b/src/Ubik.Accounting.Structure.Api/Features/Accounts/Services/IAccountCommandService.cs index dd8e56ca..79777a69 100644 --- a/src/Ubik.Accounting.Structure.Api/Features/Accounts/Services/IAccountCommandService.cs +++ b/src/Ubik.Accounting.Structure.Api/Features/Accounts/Services/IAccountCommandService.cs @@ -1,6 +1,6 @@ using LanguageExt; using Ubik.Accounting.Structure.Api.Models; -using Ubik.Accounting.Contracts.Accounts.Commands; +using Ubik.Accounting.Structure.Contracts.Accounts.Commands; using Ubik.ApiService.Common.Errors; namespace Ubik.Accounting.Structure.Api.Features.Accounts.Services diff --git a/src/Ubik.Accounting.Structure.Api/Features/Classifications/Controller/v1/ClassificationsController.cs b/src/Ubik.Accounting.Structure.Api/Features/Classifications/Controller/v1/ClassificationsController.cs index 2cba0988..653a6d18 100644 --- a/src/Ubik.Accounting.Structure.Api/Features/Classifications/Controller/v1/ClassificationsController.cs +++ b/src/Ubik.Accounting.Structure.Api/Features/Classifications/Controller/v1/ClassificationsController.cs @@ -3,9 +3,9 @@ using Microsoft.AspNetCore.Mvc; using Ubik.Accounting.Structure.Api.Features.Classifications.Services; using Ubik.Accounting.Structure.Api.Mappers; -using Ubik.Accounting.Contracts.Accounts.Results; -using Ubik.Accounting.Contracts.Classifications.Commands; -using Ubik.Accounting.Contracts.Classifications.Results; +using Ubik.Accounting.Structure.Contracts.Accounts.Results; +using Ubik.Accounting.Structure.Contracts.Classifications.Commands; +using Ubik.Accounting.Structure.Contracts.Classifications.Results; using Ubik.ApiService.Common.Errors; using Ubik.ApiService.Common.Exceptions; diff --git a/src/Ubik.Accounting.Structure.Api/Features/Classifications/Services/ClassificationCommandService.cs b/src/Ubik.Accounting.Structure.Api/Features/Classifications/Services/ClassificationCommandService.cs index 8b76a2e5..f92b418f 100644 --- a/src/Ubik.Accounting.Structure.Api/Features/Classifications/Services/ClassificationCommandService.cs +++ b/src/Ubik.Accounting.Structure.Api/Features/Classifications/Services/ClassificationCommandService.cs @@ -7,8 +7,8 @@ using Ubik.Accounting.Structure.Api.Data; using Ubik.Accounting.Structure.Api.Mappers; using Ubik.Accounting.Structure.Api.Models; -using Ubik.Accounting.Contracts.Classifications.Commands; -using Ubik.Accounting.Contracts.Classifications.Events; +using Ubik.Accounting.Structure.Contracts.Classifications.Commands; +using Ubik.Accounting.Structure.Contracts.Classifications.Events; using Ubik.ApiService.Common.Errors; using Ubik.ApiService.Common.Exceptions; diff --git a/src/Ubik.Accounting.Structure.Api/Features/Classifications/Services/IClassificationCommandService.cs b/src/Ubik.Accounting.Structure.Api/Features/Classifications/Services/IClassificationCommandService.cs index 397f7386..2b303778 100644 --- a/src/Ubik.Accounting.Structure.Api/Features/Classifications/Services/IClassificationCommandService.cs +++ b/src/Ubik.Accounting.Structure.Api/Features/Classifications/Services/IClassificationCommandService.cs @@ -1,6 +1,6 @@ using LanguageExt; using Ubik.Accounting.Structure.Api.Models; -using Ubik.Accounting.Contracts.Classifications.Commands; +using Ubik.Accounting.Structure.Contracts.Classifications.Commands; using Ubik.ApiService.Common.Errors; namespace Ubik.Accounting.Structure.Api.Features.Classifications.Services diff --git a/src/Ubik.Accounting.Structure.Api/Features/Currencies/Controller/v1/CurrenciesController.cs b/src/Ubik.Accounting.Structure.Api/Features/Currencies/Controller/v1/CurrenciesController.cs index ec26211b..9ca2d798 100644 --- a/src/Ubik.Accounting.Structure.Api/Features/Currencies/Controller/v1/CurrenciesController.cs +++ b/src/Ubik.Accounting.Structure.Api/Features/Currencies/Controller/v1/CurrenciesController.cs @@ -2,7 +2,7 @@ using Microsoft.AspNetCore.Mvc; using Ubik.Accounting.Structure.Api.Features.Currencies.Services; using Ubik.Accounting.Structure.Api.Mappers; -using Ubik.Accounting.Contracts.Currencies.Results; +using Ubik.Accounting.Structure.Contracts.Currencies.Results; using Ubik.ApiService.Common.Exceptions; namespace Ubik.Accounting.Structure.Api.Features.Currencies.Controller.v1 diff --git a/src/Ubik.Accounting.Structure.Api/Features/VatRates/Services/IVatRateCommandService.cs b/src/Ubik.Accounting.Structure.Api/Features/VatRates/Services/IVatRateCommandService.cs index 04bdea78..3d690ce7 100644 --- a/src/Ubik.Accounting.Structure.Api/Features/VatRates/Services/IVatRateCommandService.cs +++ b/src/Ubik.Accounting.Structure.Api/Features/VatRates/Services/IVatRateCommandService.cs @@ -1,6 +1,6 @@ using LanguageExt; using Ubik.Accounting.Structure.Api.Models; -using Ubik.Accounting.Contracts.VatRate.Commands; +using Ubik.Accounting.Structure.Contracts.VatRate.Commands; using Ubik.ApiService.Common.Errors; namespace Ubik.Accounting.Structure.Api.Features.VatRates.Services diff --git a/src/Ubik.Accounting.Structure.Api/Features/VatRates/Services/VatRateCommandService.cs b/src/Ubik.Accounting.Structure.Api/Features/VatRates/Services/VatRateCommandService.cs index 0628c4fc..e3690c49 100644 --- a/src/Ubik.Accounting.Structure.Api/Features/VatRates/Services/VatRateCommandService.cs +++ b/src/Ubik.Accounting.Structure.Api/Features/VatRates/Services/VatRateCommandService.cs @@ -4,8 +4,8 @@ using Microsoft.EntityFrameworkCore; using Ubik.Accounting.Structure.Api.Data; using Ubik.Accounting.Structure.Api.Models; -using Ubik.Accounting.Contracts.VatRate.Commands; -using Ubik.Accounting.Contracts.VatRate.Events; +using Ubik.Accounting.Structure.Contracts.VatRate.Commands; +using Ubik.Accounting.Structure.Contracts.VatRate.Events; using Ubik.ApiService.Common.Errors; using Ubik.ApiService.Common.Exceptions; using Ubik.Accounting.Structure.Api.Mappers; diff --git a/src/Ubik.Accounting.Structure.Api/Mappers/AccountGroupMappers.cs b/src/Ubik.Accounting.Structure.Api/Mappers/AccountGroupMappers.cs index 30b5f8b7..e6bbb1e6 100644 --- a/src/Ubik.Accounting.Structure.Api/Mappers/AccountGroupMappers.cs +++ b/src/Ubik.Accounting.Structure.Api/Mappers/AccountGroupMappers.cs @@ -1,9 +1,9 @@ using MassTransit; using Ubik.Accounting.Structure.Api.Models; -using Ubik.Accounting.Contracts.AccountGroups.Commands; -using Ubik.Accounting.Contracts.AccountGroups.Events; -using Ubik.Accounting.Contracts.AccountGroups.Results; -using Ubik.Accounting.Contracts.Accounts.Events; +using Ubik.Accounting.Structure.Contracts.AccountGroups.Commands; +using Ubik.Accounting.Structure.Contracts.AccountGroups.Events; +using Ubik.Accounting.Structure.Contracts.AccountGroups.Results; +using Ubik.Accounting.Structure.Contracts.Accounts.Events; namespace Ubik.Accounting.Structure.Api.Mappers { diff --git a/src/Ubik.Accounting.Structure.Api/Mappers/AccountMappers.cs b/src/Ubik.Accounting.Structure.Api/Mappers/AccountMappers.cs index f2b724e7..ebe8d636 100644 --- a/src/Ubik.Accounting.Structure.Api/Mappers/AccountMappers.cs +++ b/src/Ubik.Accounting.Structure.Api/Mappers/AccountMappers.cs @@ -1,9 +1,9 @@ using MassTransit; using Ubik.Accounting.Structure.Api.Features.Accounts.CustomPoco; using Ubik.Accounting.Structure.Api.Models; -using Ubik.Accounting.Contracts.Accounts.Commands; -using Ubik.Accounting.Contracts.Accounts.Events; -using Ubik.Accounting.Contracts.Accounts.Results; +using Ubik.Accounting.Structure.Contracts.Accounts.Commands; +using Ubik.Accounting.Structure.Contracts.Accounts.Events; +using Ubik.Accounting.Structure.Contracts.Accounts.Results; namespace Ubik.Accounting.Structure.Api.Mappers { diff --git a/src/Ubik.Accounting.Structure.Api/Mappers/ClassificationMappers.cs b/src/Ubik.Accounting.Structure.Api/Mappers/ClassificationMappers.cs index 118670cb..4e76c1e7 100644 --- a/src/Ubik.Accounting.Structure.Api/Mappers/ClassificationMappers.cs +++ b/src/Ubik.Accounting.Structure.Api/Mappers/ClassificationMappers.cs @@ -1,11 +1,11 @@ using MassTransit; using Ubik.Accounting.Structure.Api.Features.Classifications.CustomPoco; using Ubik.Accounting.Structure.Api.Models; -using Ubik.Accounting.Contracts.AccountGroups.Events; -using Ubik.Accounting.Contracts.AccountGroups.Results; -using Ubik.Accounting.Contracts.Classifications.Commands; -using Ubik.Accounting.Contracts.Classifications.Events; -using Ubik.Accounting.Contracts.Classifications.Results; +using Ubik.Accounting.Structure.Contracts.AccountGroups.Events; +using Ubik.Accounting.Structure.Contracts.AccountGroups.Results; +using Ubik.Accounting.Structure.Contracts.Classifications.Commands; +using Ubik.Accounting.Structure.Contracts.Classifications.Events; +using Ubik.Accounting.Structure.Contracts.Classifications.Results; namespace Ubik.Accounting.Structure.Api.Mappers { diff --git a/src/Ubik.Accounting.Structure.Api/Mappers/CurrencyMappers.cs b/src/Ubik.Accounting.Structure.Api/Mappers/CurrencyMappers.cs index 32cead51..2d5322b4 100644 --- a/src/Ubik.Accounting.Structure.Api/Mappers/CurrencyMappers.cs +++ b/src/Ubik.Accounting.Structure.Api/Mappers/CurrencyMappers.cs @@ -1,5 +1,5 @@ using Ubik.Accounting.Structure.Api.Models; -using Ubik.Accounting.Contracts.Currencies.Results; +using Ubik.Accounting.Structure.Contracts.Currencies.Results; namespace Ubik.Accounting.Structure.Api.Mappers { diff --git a/src/Ubik.Accounting.Structure.Api/Mappers/VatRateMappers.cs b/src/Ubik.Accounting.Structure.Api/Mappers/VatRateMappers.cs index 2b51d9f6..84e595a7 100644 --- a/src/Ubik.Accounting.Structure.Api/Mappers/VatRateMappers.cs +++ b/src/Ubik.Accounting.Structure.Api/Mappers/VatRateMappers.cs @@ -1,7 +1,7 @@ using Ubik.Accounting.Structure.Api.Models; -using Ubik.Accounting.Contracts.VatRate.Commands; -using Ubik.Accounting.Contracts.VatRate.Events; -using Ubik.Accounting.Contracts.VatRate.Results; +using Ubik.Accounting.Structure.Contracts.VatRate.Commands; +using Ubik.Accounting.Structure.Contracts.VatRate.Events; +using Ubik.Accounting.Structure.Contracts.VatRate.Results; namespace Ubik.Accounting.Structure.Api.Mappers { diff --git a/src/Ubik.Accounting.Structure.Api/Models/Account.cs b/src/Ubik.Accounting.Structure.Api/Models/Account.cs index 4adadb5b..ff844d3f 100644 --- a/src/Ubik.Accounting.Structure.Api/Models/Account.cs +++ b/src/Ubik.Accounting.Structure.Api/Models/Account.cs @@ -1,4 +1,4 @@ -using Ubik.Accounting.Contracts.Accounts.Enums; +using Ubik.Accounting.Structure.Contracts.Accounts.Enums; using Ubik.DB.Common; namespace Ubik.Accounting.Structure.Api.Models diff --git a/src/Ubik.Accounting.Structure.Api/Models/Currency.cs b/src/Ubik.Accounting.Structure.Api/Models/Currency.cs index 6a08bd81..d2da5801 100644 --- a/src/Ubik.Accounting.Structure.Api/Models/Currency.cs +++ b/src/Ubik.Accounting.Structure.Api/Models/Currency.cs @@ -4,7 +4,7 @@ namespace Ubik.Accounting.Structure.Api.Models { //TODO: will be updated by another service - public class Currency : ITenantEntity, IConcurrencyCheckEntity + public class Currency : ITenantEntity { public Guid Id { get; set; } [StringLength(3)] diff --git a/src/Ubik.Accounting.Structure.Api/Program.cs b/src/Ubik.Accounting.Structure.Api/Program.cs index 501bbb8a..a215abfa 100644 --- a/src/Ubik.Accounting.Structure.Api/Program.cs +++ b/src/Ubik.Accounting.Structure.Api/Program.cs @@ -12,10 +12,10 @@ using Ubik.ApiService.Common.Configure.Options; using System.Text.Json.Serialization; using Microsoft.AspNetCore.Mvc.Infrastructure; -using Ubik.Accounting.Contracts.Accounts.Commands; +using Ubik.Accounting.Structure.Contracts.Accounts.Commands; using Ubik.ApiService.Common.Filters; -using Ubik.Accounting.Contracts.AccountGroups.Commands; -using Ubik.Accounting.Contracts.Classifications.Commands; +using Ubik.Accounting.Structure.Contracts.AccountGroups.Commands; +using Ubik.Accounting.Structure.Contracts.Classifications.Commands; using Ubik.ApiService.Common.Middlewares; using Ubik.Accounting.Structure.Api.Features.Application.Services; using Ubik.Accounting.Structure.Api.Features.AccountGroups.Services; @@ -23,7 +23,7 @@ using Ubik.Accounting.Structure.Api.Features.Classifications.Services; using Ubik.Accounting.Structure.Api.Features.Currencies.Services; -namespace Ubik.Accounting.Api +namespace Ubik.Accounting.Structure.Api { public class Program { diff --git a/src/Ubik.Accounting.Structure.Api/Ubik.Accounting.Structure.Api.csproj b/src/Ubik.Accounting.Structure.Api/Ubik.Accounting.Structure.Api.csproj index 8e70095f..ef8ebdf0 100644 --- a/src/Ubik.Accounting.Structure.Api/Ubik.Accounting.Structure.Api.csproj +++ b/src/Ubik.Accounting.Structure.Api/Ubik.Accounting.Structure.Api.csproj @@ -44,7 +44,7 @@ - + diff --git a/src/Ubik.Accounting.Contracts/AccountGroups/Commands/AddAccountGroupCommand.cs b/src/Ubik.Accounting.Structure.Contracts/AccountGroups/Commands/AddAccountGroupCommand.cs similarity index 88% rename from src/Ubik.Accounting.Contracts/AccountGroups/Commands/AddAccountGroupCommand.cs rename to src/Ubik.Accounting.Structure.Contracts/AccountGroups/Commands/AddAccountGroupCommand.cs index 8e2af39f..f7cca4b0 100644 --- a/src/Ubik.Accounting.Contracts/AccountGroups/Commands/AddAccountGroupCommand.cs +++ b/src/Ubik.Accounting.Structure.Contracts/AccountGroups/Commands/AddAccountGroupCommand.cs @@ -1,6 +1,6 @@ using System.ComponentModel.DataAnnotations; -namespace Ubik.Accounting.Contracts.AccountGroups.Commands +namespace Ubik.Accounting.Structure.Contracts.AccountGroups.Commands { public record AddAccountGroupCommand { diff --git a/src/Ubik.Accounting.Contracts/AccountGroups/Commands/DeleteAccountGroupCommand.cs b/src/Ubik.Accounting.Structure.Contracts/AccountGroups/Commands/DeleteAccountGroupCommand.cs similarity index 70% rename from src/Ubik.Accounting.Contracts/AccountGroups/Commands/DeleteAccountGroupCommand.cs rename to src/Ubik.Accounting.Structure.Contracts/AccountGroups/Commands/DeleteAccountGroupCommand.cs index b53c5e57..e0227194 100644 --- a/src/Ubik.Accounting.Contracts/AccountGroups/Commands/DeleteAccountGroupCommand.cs +++ b/src/Ubik.Accounting.Structure.Contracts/AccountGroups/Commands/DeleteAccountGroupCommand.cs @@ -1,6 +1,6 @@ using System.ComponentModel.DataAnnotations; -namespace Ubik.Accounting.Contracts.AccountGroups.Commands +namespace Ubik.Accounting.Structure.Contracts.AccountGroups.Commands { public record DeleteAccountGroupCommand { diff --git a/src/Ubik.Accounting.Contracts/AccountGroups/Commands/UpdateAccountGroupCommand.cs b/src/Ubik.Accounting.Structure.Contracts/AccountGroups/Commands/UpdateAccountGroupCommand.cs similarity index 90% rename from src/Ubik.Accounting.Contracts/AccountGroups/Commands/UpdateAccountGroupCommand.cs rename to src/Ubik.Accounting.Structure.Contracts/AccountGroups/Commands/UpdateAccountGroupCommand.cs index d6948de9..102ad467 100644 --- a/src/Ubik.Accounting.Contracts/AccountGroups/Commands/UpdateAccountGroupCommand.cs +++ b/src/Ubik.Accounting.Structure.Contracts/AccountGroups/Commands/UpdateAccountGroupCommand.cs @@ -1,6 +1,6 @@ using System.ComponentModel.DataAnnotations; -namespace Ubik.Accounting.Contracts.AccountGroups.Commands +namespace Ubik.Accounting.Structure.Contracts.AccountGroups.Commands { public record UpdateAccountGroupCommand { diff --git a/src/Ubik.Accounting.Contracts/AccountGroups/Events/AccountGroupAdded.cs b/src/Ubik.Accounting.Structure.Contracts/AccountGroups/Events/AccountGroupAdded.cs similarity index 85% rename from src/Ubik.Accounting.Contracts/AccountGroups/Events/AccountGroupAdded.cs rename to src/Ubik.Accounting.Structure.Contracts/AccountGroups/Events/AccountGroupAdded.cs index 85958033..ff37dcb1 100644 --- a/src/Ubik.Accounting.Contracts/AccountGroups/Events/AccountGroupAdded.cs +++ b/src/Ubik.Accounting.Structure.Contracts/AccountGroups/Events/AccountGroupAdded.cs @@ -1,4 +1,4 @@ -namespace Ubik.Accounting.Contracts.AccountGroups.Events +namespace Ubik.Accounting.Structure.Contracts.AccountGroups.Events { public record AccountGroupAdded { diff --git a/src/Ubik.Accounting.Contracts/AccountGroups/Events/AccountGroupDeleted.cs b/src/Ubik.Accounting.Structure.Contracts/AccountGroups/Events/AccountGroupDeleted.cs similarity index 78% rename from src/Ubik.Accounting.Contracts/AccountGroups/Events/AccountGroupDeleted.cs rename to src/Ubik.Accounting.Structure.Contracts/AccountGroups/Events/AccountGroupDeleted.cs index 711a99fd..2e709d8b 100644 --- a/src/Ubik.Accounting.Contracts/AccountGroups/Events/AccountGroupDeleted.cs +++ b/src/Ubik.Accounting.Structure.Contracts/AccountGroups/Events/AccountGroupDeleted.cs @@ -1,4 +1,4 @@ -namespace Ubik.Accounting.Contracts.AccountGroups.Events +namespace Ubik.Accounting.Structure.Contracts.AccountGroups.Events { public record AccountGroupDeleted { diff --git a/src/Ubik.Accounting.Contracts/AccountGroups/Events/AccountGroupUpdated.cs b/src/Ubik.Accounting.Structure.Contracts/AccountGroups/Events/AccountGroupUpdated.cs similarity index 85% rename from src/Ubik.Accounting.Contracts/AccountGroups/Events/AccountGroupUpdated.cs rename to src/Ubik.Accounting.Structure.Contracts/AccountGroups/Events/AccountGroupUpdated.cs index 567eacb4..0e6ddf5f 100644 --- a/src/Ubik.Accounting.Contracts/AccountGroups/Events/AccountGroupUpdated.cs +++ b/src/Ubik.Accounting.Structure.Contracts/AccountGroups/Events/AccountGroupUpdated.cs @@ -1,4 +1,4 @@ -namespace Ubik.Accounting.Contracts.AccountGroups.Events +namespace Ubik.Accounting.Structure.Contracts.AccountGroups.Events { public record AccountGroupUpdated { diff --git a/src/Ubik.Accounting.Contracts/AccountGroups/Events/AccountGroupsDeleted.cs b/src/Ubik.Accounting.Structure.Contracts/AccountGroups/Events/AccountGroupsDeleted.cs similarity index 67% rename from src/Ubik.Accounting.Contracts/AccountGroups/Events/AccountGroupsDeleted.cs rename to src/Ubik.Accounting.Structure.Contracts/AccountGroups/Events/AccountGroupsDeleted.cs index 61dfb17b..6e9e7573 100644 --- a/src/Ubik.Accounting.Contracts/AccountGroups/Events/AccountGroupsDeleted.cs +++ b/src/Ubik.Accounting.Structure.Contracts/AccountGroups/Events/AccountGroupsDeleted.cs @@ -1,4 +1,4 @@ -namespace Ubik.Accounting.Contracts.AccountGroups.Events +namespace Ubik.Accounting.Structure.Contracts.AccountGroups.Events { public record AccountGroupsDeleted { diff --git a/src/Ubik.Accounting.Contracts/AccountGroups/Results/AccountGroupStandardResult.cs b/src/Ubik.Accounting.Structure.Contracts/AccountGroups/Results/AccountGroupStandardResult.cs similarity index 88% rename from src/Ubik.Accounting.Contracts/AccountGroups/Results/AccountGroupStandardResult.cs rename to src/Ubik.Accounting.Structure.Contracts/AccountGroups/Results/AccountGroupStandardResult.cs index 35ffa3ca..fef5c7db 100644 --- a/src/Ubik.Accounting.Contracts/AccountGroups/Results/AccountGroupStandardResult.cs +++ b/src/Ubik.Accounting.Structure.Contracts/AccountGroups/Results/AccountGroupStandardResult.cs @@ -4,7 +4,7 @@ using System.Text; using System.Threading.Tasks; -namespace Ubik.Accounting.Contracts.AccountGroups.Results +namespace Ubik.Accounting.Structure.Contracts.AccountGroups.Results { public record AccountGroupStandardResult { diff --git a/src/Ubik.Accounting.Contracts/Accounts/Commands/AddAccountCommand.cs b/src/Ubik.Accounting.Structure.Contracts/Accounts/Commands/AddAccountCommand.cs similarity index 86% rename from src/Ubik.Accounting.Contracts/Accounts/Commands/AddAccountCommand.cs rename to src/Ubik.Accounting.Structure.Contracts/Accounts/Commands/AddAccountCommand.cs index 913c83ec..0c913092 100644 --- a/src/Ubik.Accounting.Contracts/Accounts/Commands/AddAccountCommand.cs +++ b/src/Ubik.Accounting.Structure.Contracts/Accounts/Commands/AddAccountCommand.cs @@ -1,8 +1,8 @@ using System.ComponentModel.DataAnnotations; using System.Text.Json.Serialization; -using Ubik.Accounting.Contracts.Accounts.Enums; +using Ubik.Accounting.Structure.Contracts.Accounts.Enums; -namespace Ubik.Accounting.Contracts.Accounts.Commands +namespace Ubik.Accounting.Structure.Contracts.Accounts.Commands { public record AddAccountCommand { diff --git a/src/Ubik.Accounting.Contracts/Accounts/Commands/AddAccountInAccountGroupCommand.cs b/src/Ubik.Accounting.Structure.Contracts/Accounts/Commands/AddAccountInAccountGroupCommand.cs similarity index 79% rename from src/Ubik.Accounting.Contracts/Accounts/Commands/AddAccountInAccountGroupCommand.cs rename to src/Ubik.Accounting.Structure.Contracts/Accounts/Commands/AddAccountInAccountGroupCommand.cs index c4896354..5807e26e 100644 --- a/src/Ubik.Accounting.Contracts/Accounts/Commands/AddAccountInAccountGroupCommand.cs +++ b/src/Ubik.Accounting.Structure.Contracts/Accounts/Commands/AddAccountInAccountGroupCommand.cs @@ -1,6 +1,6 @@ using System.ComponentModel.DataAnnotations; -namespace Ubik.Accounting.Contracts.Accounts.Commands +namespace Ubik.Accounting.Structure.Contracts.Accounts.Commands { public record AddAccountInAccountGroupCommand { diff --git a/src/Ubik.Accounting.Contracts/Accounts/Commands/DeleteAccountInAccountGroupCommand.cs b/src/Ubik.Accounting.Structure.Contracts/Accounts/Commands/DeleteAccountInAccountGroupCommand.cs similarity index 79% rename from src/Ubik.Accounting.Contracts/Accounts/Commands/DeleteAccountInAccountGroupCommand.cs rename to src/Ubik.Accounting.Structure.Contracts/Accounts/Commands/DeleteAccountInAccountGroupCommand.cs index 504794aa..66535487 100644 --- a/src/Ubik.Accounting.Contracts/Accounts/Commands/DeleteAccountInAccountGroupCommand.cs +++ b/src/Ubik.Accounting.Structure.Contracts/Accounts/Commands/DeleteAccountInAccountGroupCommand.cs @@ -1,6 +1,6 @@ using System.ComponentModel.DataAnnotations; -namespace Ubik.Accounting.Contracts.Accounts.Commands +namespace Ubik.Accounting.Structure.Contracts.Accounts.Commands { public record DeleteAccountInAccountGroupCommand { diff --git a/src/Ubik.Accounting.Contracts/Accounts/Commands/UpdateAccountCommand.cs b/src/Ubik.Accounting.Structure.Contracts/Accounts/Commands/UpdateAccountCommand.cs similarity index 87% rename from src/Ubik.Accounting.Contracts/Accounts/Commands/UpdateAccountCommand.cs rename to src/Ubik.Accounting.Structure.Contracts/Accounts/Commands/UpdateAccountCommand.cs index 64d3246e..236220b6 100644 --- a/src/Ubik.Accounting.Contracts/Accounts/Commands/UpdateAccountCommand.cs +++ b/src/Ubik.Accounting.Structure.Contracts/Accounts/Commands/UpdateAccountCommand.cs @@ -1,8 +1,8 @@ using System.ComponentModel.DataAnnotations; using System.Text.Json.Serialization; -using Ubik.Accounting.Contracts.Accounts.Enums; +using Ubik.Accounting.Structure.Contracts.Accounts.Enums; -namespace Ubik.Accounting.Contracts.Accounts.Commands +namespace Ubik.Accounting.Structure.Contracts.Accounts.Commands { public record UpdateAccountCommand { diff --git a/src/Ubik.Accounting.Contracts/Accounts/Enums/AccountCategory.cs b/src/Ubik.Accounting.Structure.Contracts/Accounts/Enums/AccountCategory.cs similarity index 76% rename from src/Ubik.Accounting.Contracts/Accounts/Enums/AccountCategory.cs rename to src/Ubik.Accounting.Structure.Contracts/Accounts/Enums/AccountCategory.cs index 304c36f5..f895b21d 100644 --- a/src/Ubik.Accounting.Contracts/Accounts/Enums/AccountCategory.cs +++ b/src/Ubik.Accounting.Structure.Contracts/Accounts/Enums/AccountCategory.cs @@ -1,6 +1,6 @@ using System.Text.Json.Serialization; -namespace Ubik.Accounting.Contracts.Accounts.Enums +namespace Ubik.Accounting.Structure.Contracts.Accounts.Enums { [JsonConverter(typeof(JsonStringEnumConverter))] public enum AccountCategory diff --git a/src/Ubik.Accounting.Contracts/Accounts/Enums/AccountDomain.cs b/src/Ubik.Accounting.Structure.Contracts/Accounts/Enums/AccountDomain.cs similarity index 78% rename from src/Ubik.Accounting.Contracts/Accounts/Enums/AccountDomain.cs rename to src/Ubik.Accounting.Structure.Contracts/Accounts/Enums/AccountDomain.cs index 069fc28f..f4603773 100644 --- a/src/Ubik.Accounting.Contracts/Accounts/Enums/AccountDomain.cs +++ b/src/Ubik.Accounting.Structure.Contracts/Accounts/Enums/AccountDomain.cs @@ -1,6 +1,6 @@ using System.Text.Json.Serialization; -namespace Ubik.Accounting.Contracts.Accounts.Enums +namespace Ubik.Accounting.Structure.Contracts.Accounts.Enums { [JsonConverter(typeof(JsonStringEnumConverter))] public enum AccountDomain diff --git a/src/Ubik.Accounting.Contracts/Accounts/Events/AccountAdded.cs b/src/Ubik.Accounting.Structure.Contracts/Accounts/Events/AccountAdded.cs similarity index 81% rename from src/Ubik.Accounting.Contracts/Accounts/Events/AccountAdded.cs rename to src/Ubik.Accounting.Structure.Contracts/Accounts/Events/AccountAdded.cs index 1f271317..58fff556 100644 --- a/src/Ubik.Accounting.Contracts/Accounts/Events/AccountAdded.cs +++ b/src/Ubik.Accounting.Structure.Contracts/Accounts/Events/AccountAdded.cs @@ -1,6 +1,6 @@ -using Ubik.Accounting.Contracts.Accounts.Enums; +using Ubik.Accounting.Structure.Contracts.Accounts.Enums; -namespace Ubik.Accounting.Contracts.Accounts.Events +namespace Ubik.Accounting.Structure.Contracts.Accounts.Events { public record AccountAdded { diff --git a/src/Ubik.Accounting.Contracts/Accounts/Events/AccountAddedInAccountGroup.cs b/src/Ubik.Accounting.Structure.Contracts/Accounts/Events/AccountAddedInAccountGroup.cs similarity index 70% rename from src/Ubik.Accounting.Contracts/Accounts/Events/AccountAddedInAccountGroup.cs rename to src/Ubik.Accounting.Structure.Contracts/Accounts/Events/AccountAddedInAccountGroup.cs index 74149c46..213b9e13 100644 --- a/src/Ubik.Accounting.Contracts/Accounts/Events/AccountAddedInAccountGroup.cs +++ b/src/Ubik.Accounting.Structure.Contracts/Accounts/Events/AccountAddedInAccountGroup.cs @@ -1,4 +1,4 @@ -namespace Ubik.Accounting.Contracts.Accounts.Events +namespace Ubik.Accounting.Structure.Contracts.Accounts.Events { public record AccountAddedInAccountGroup { diff --git a/src/Ubik.Accounting.Contracts/Accounts/Events/AccountDeleted.cs b/src/Ubik.Accounting.Structure.Contracts/Accounts/Events/AccountDeleted.cs similarity index 57% rename from src/Ubik.Accounting.Contracts/Accounts/Events/AccountDeleted.cs rename to src/Ubik.Accounting.Structure.Contracts/Accounts/Events/AccountDeleted.cs index 0f06f228..b71d0a20 100644 --- a/src/Ubik.Accounting.Contracts/Accounts/Events/AccountDeleted.cs +++ b/src/Ubik.Accounting.Structure.Contracts/Accounts/Events/AccountDeleted.cs @@ -1,4 +1,4 @@ -namespace Ubik.Accounting.Contracts.Accounts.Events +namespace Ubik.Accounting.Structure.Contracts.Accounts.Events { public record AccountDeleted { diff --git a/src/Ubik.Accounting.Contracts/Accounts/Events/AccountDeletedInAccountGroup.cs b/src/Ubik.Accounting.Structure.Contracts/Accounts/Events/AccountDeletedInAccountGroup.cs similarity index 70% rename from src/Ubik.Accounting.Contracts/Accounts/Events/AccountDeletedInAccountGroup.cs rename to src/Ubik.Accounting.Structure.Contracts/Accounts/Events/AccountDeletedInAccountGroup.cs index f573c310..d2bcf21a 100644 --- a/src/Ubik.Accounting.Contracts/Accounts/Events/AccountDeletedInAccountGroup.cs +++ b/src/Ubik.Accounting.Structure.Contracts/Accounts/Events/AccountDeletedInAccountGroup.cs @@ -1,4 +1,4 @@ -namespace Ubik.Accounting.Contracts.Accounts.Events +namespace Ubik.Accounting.Structure.Contracts.Accounts.Events { public record AccountDeletedInAccountGroup { diff --git a/src/Ubik.Accounting.Contracts/Accounts/Events/AccountUpdated.cs b/src/Ubik.Accounting.Structure.Contracts/Accounts/Events/AccountUpdated.cs similarity index 81% rename from src/Ubik.Accounting.Contracts/Accounts/Events/AccountUpdated.cs rename to src/Ubik.Accounting.Structure.Contracts/Accounts/Events/AccountUpdated.cs index 4ccd97bf..ebc1361c 100644 --- a/src/Ubik.Accounting.Contracts/Accounts/Events/AccountUpdated.cs +++ b/src/Ubik.Accounting.Structure.Contracts/Accounts/Events/AccountUpdated.cs @@ -1,6 +1,6 @@ -using Ubik.Accounting.Contracts.Accounts.Enums; +using Ubik.Accounting.Structure.Contracts.Accounts.Enums; -namespace Ubik.Accounting.Contracts.Accounts.Events +namespace Ubik.Accounting.Structure.Contracts.Accounts.Events { public record AccountUpdated { diff --git a/src/Ubik.Accounting.Contracts/Accounts/Results/AccountGroupLinkResult.cs b/src/Ubik.Accounting.Structure.Contracts/Accounts/Results/AccountGroupLinkResult.cs similarity index 84% rename from src/Ubik.Accounting.Contracts/Accounts/Results/AccountGroupLinkResult.cs rename to src/Ubik.Accounting.Structure.Contracts/Accounts/Results/AccountGroupLinkResult.cs index b86f3bb8..e474547a 100644 --- a/src/Ubik.Accounting.Contracts/Accounts/Results/AccountGroupLinkResult.cs +++ b/src/Ubik.Accounting.Structure.Contracts/Accounts/Results/AccountGroupLinkResult.cs @@ -4,7 +4,7 @@ using System.Text; using System.Threading.Tasks; -namespace Ubik.Accounting.Contracts.Accounts.Results +namespace Ubik.Accounting.Structure.Contracts.Accounts.Results { public record AccountGroupLinkResult { diff --git a/src/Ubik.Accounting.Contracts/Accounts/Results/AccountGroupWithClassificationResult.cs b/src/Ubik.Accounting.Structure.Contracts/Accounts/Results/AccountGroupWithClassificationResult.cs similarity index 86% rename from src/Ubik.Accounting.Contracts/Accounts/Results/AccountGroupWithClassificationResult.cs rename to src/Ubik.Accounting.Structure.Contracts/Accounts/Results/AccountGroupWithClassificationResult.cs index faa4c281..7bd7969f 100644 --- a/src/Ubik.Accounting.Contracts/Accounts/Results/AccountGroupWithClassificationResult.cs +++ b/src/Ubik.Accounting.Structure.Contracts/Accounts/Results/AccountGroupWithClassificationResult.cs @@ -1,4 +1,4 @@ -namespace Ubik.Accounting.Contracts.Accounts.Results +namespace Ubik.Accounting.Structure.Contracts.Accounts.Results { public record AccountGroupWithClassificationResult { diff --git a/src/Ubik.Accounting.Contracts/Accounts/Results/AccountInAccountGroupResult.cs b/src/Ubik.Accounting.Structure.Contracts/Accounts/Results/AccountInAccountGroupResult.cs similarity index 78% rename from src/Ubik.Accounting.Contracts/Accounts/Results/AccountInAccountGroupResult.cs rename to src/Ubik.Accounting.Structure.Contracts/Accounts/Results/AccountInAccountGroupResult.cs index a71d0f07..636fee35 100644 --- a/src/Ubik.Accounting.Contracts/Accounts/Results/AccountInAccountGroupResult.cs +++ b/src/Ubik.Accounting.Structure.Contracts/Accounts/Results/AccountInAccountGroupResult.cs @@ -1,4 +1,4 @@ -namespace Ubik.Accounting.Contracts.Accounts.Results +namespace Ubik.Accounting.Structure.Contracts.Accounts.Results { public class AccountInAccountGroupResult { diff --git a/src/Ubik.Accounting.Contracts/Accounts/Results/AccountStandardResult.cs b/src/Ubik.Accounting.Structure.Contracts/Accounts/Results/AccountStandardResult.cs similarity index 83% rename from src/Ubik.Accounting.Contracts/Accounts/Results/AccountStandardResult.cs rename to src/Ubik.Accounting.Structure.Contracts/Accounts/Results/AccountStandardResult.cs index 4b0c02ec..128a6d61 100644 --- a/src/Ubik.Accounting.Contracts/Accounts/Results/AccountStandardResult.cs +++ b/src/Ubik.Accounting.Structure.Contracts/Accounts/Results/AccountStandardResult.cs @@ -3,9 +3,9 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -using Ubik.Accounting.Contracts.Accounts.Enums; +using Ubik.Accounting.Structure.Contracts.Accounts.Enums; -namespace Ubik.Accounting.Contracts.Accounts.Results +namespace Ubik.Accounting.Structure.Contracts.Accounts.Results { public record AccountStandardResult { diff --git a/src/Ubik.Accounting.Contracts/Classifications/Commands/AddClassificationCommand.cs b/src/Ubik.Accounting.Structure.Contracts/Classifications/Commands/AddClassificationCommand.cs similarity index 84% rename from src/Ubik.Accounting.Contracts/Classifications/Commands/AddClassificationCommand.cs rename to src/Ubik.Accounting.Structure.Contracts/Classifications/Commands/AddClassificationCommand.cs index a09d4026..744e660d 100644 --- a/src/Ubik.Accounting.Contracts/Classifications/Commands/AddClassificationCommand.cs +++ b/src/Ubik.Accounting.Structure.Contracts/Classifications/Commands/AddClassificationCommand.cs @@ -1,6 +1,6 @@ using System.ComponentModel.DataAnnotations; -namespace Ubik.Accounting.Contracts.Classifications.Commands +namespace Ubik.Accounting.Structure.Contracts.Classifications.Commands { public record AddClassificationCommand { diff --git a/src/Ubik.Accounting.Contracts/Classifications/Commands/DeleteClassificationCommand.cs b/src/Ubik.Accounting.Structure.Contracts/Classifications/Commands/DeleteClassificationCommand.cs similarity index 70% rename from src/Ubik.Accounting.Contracts/Classifications/Commands/DeleteClassificationCommand.cs rename to src/Ubik.Accounting.Structure.Contracts/Classifications/Commands/DeleteClassificationCommand.cs index 36edb8e0..8acc5c15 100644 --- a/src/Ubik.Accounting.Contracts/Classifications/Commands/DeleteClassificationCommand.cs +++ b/src/Ubik.Accounting.Structure.Contracts/Classifications/Commands/DeleteClassificationCommand.cs @@ -1,6 +1,6 @@ using System.ComponentModel.DataAnnotations; -namespace Ubik.Accounting.Contracts.Classifications.Commands +namespace Ubik.Accounting.Structure.Contracts.Classifications.Commands { public record DeleteClassificationCommand { diff --git a/src/Ubik.Accounting.Contracts/Classifications/Commands/UpdateClassificationCommand.cs b/src/Ubik.Accounting.Structure.Contracts/Classifications/Commands/UpdateClassificationCommand.cs similarity index 87% rename from src/Ubik.Accounting.Contracts/Classifications/Commands/UpdateClassificationCommand.cs rename to src/Ubik.Accounting.Structure.Contracts/Classifications/Commands/UpdateClassificationCommand.cs index 6331926f..73d90619 100644 --- a/src/Ubik.Accounting.Contracts/Classifications/Commands/UpdateClassificationCommand.cs +++ b/src/Ubik.Accounting.Structure.Contracts/Classifications/Commands/UpdateClassificationCommand.cs @@ -1,6 +1,6 @@ using System.ComponentModel.DataAnnotations; -namespace Ubik.Accounting.Contracts.Classifications.Commands +namespace Ubik.Accounting.Structure.Contracts.Classifications.Commands { public record UpdateClassificationCommand { diff --git a/src/Ubik.Accounting.Contracts/Classifications/Events/ClassificationAdded.cs b/src/Ubik.Accounting.Structure.Contracts/Classifications/Events/ClassificationAdded.cs similarity index 80% rename from src/Ubik.Accounting.Contracts/Classifications/Events/ClassificationAdded.cs rename to src/Ubik.Accounting.Structure.Contracts/Classifications/Events/ClassificationAdded.cs index 67d0b425..b56bfce4 100644 --- a/src/Ubik.Accounting.Contracts/Classifications/Events/ClassificationAdded.cs +++ b/src/Ubik.Accounting.Structure.Contracts/Classifications/Events/ClassificationAdded.cs @@ -1,4 +1,4 @@ -namespace Ubik.Accounting.Contracts.Classifications.Events +namespace Ubik.Accounting.Structure.Contracts.Classifications.Events { public record ClassificationAdded { diff --git a/src/Ubik.Accounting.Structure.Contracts/Classifications/Events/ClassificationDeleted.cs b/src/Ubik.Accounting.Structure.Contracts/Classifications/Events/ClassificationDeleted.cs new file mode 100644 index 00000000..480ddcf7 --- /dev/null +++ b/src/Ubik.Accounting.Structure.Contracts/Classifications/Events/ClassificationDeleted.cs @@ -0,0 +1,11 @@ +using Ubik.Accounting.Structure.Contracts.AccountGroups.Events; +using Ubik.Accounting.Structure.Contracts.AccountGroups.Results; + +namespace Ubik.Accounting.Structure.Contracts.Classifications.Events +{ + public record ClassificationDeleted + { + public Guid Id { get; init; } + public IEnumerable AccountGroupsDeleted { get; init; } = []; + } +} diff --git a/src/Ubik.Accounting.Contracts/Classifications/Events/ClassificationUpdated.cs b/src/Ubik.Accounting.Structure.Contracts/Classifications/Events/ClassificationUpdated.cs similarity index 80% rename from src/Ubik.Accounting.Contracts/Classifications/Events/ClassificationUpdated.cs rename to src/Ubik.Accounting.Structure.Contracts/Classifications/Events/ClassificationUpdated.cs index 11a4f245..b508fabe 100644 --- a/src/Ubik.Accounting.Contracts/Classifications/Events/ClassificationUpdated.cs +++ b/src/Ubik.Accounting.Structure.Contracts/Classifications/Events/ClassificationUpdated.cs @@ -1,4 +1,4 @@ -namespace Ubik.Accounting.Contracts.Classifications.Events +namespace Ubik.Accounting.Structure.Contracts.Classifications.Events { public class ClassificationUpdated { diff --git a/src/Ubik.Accounting.Contracts/Classifications/Results/ClassificationDeleteResult.cs b/src/Ubik.Accounting.Structure.Contracts/Classifications/Results/ClassificationDeleteResult.cs similarity index 58% rename from src/Ubik.Accounting.Contracts/Classifications/Results/ClassificationDeleteResult.cs rename to src/Ubik.Accounting.Structure.Contracts/Classifications/Results/ClassificationDeleteResult.cs index 2277f75f..19c697c9 100644 --- a/src/Ubik.Accounting.Contracts/Classifications/Results/ClassificationDeleteResult.cs +++ b/src/Ubik.Accounting.Structure.Contracts/Classifications/Results/ClassificationDeleteResult.cs @@ -1,6 +1,6 @@ -using Ubik.Accounting.Contracts.AccountGroups.Results; +using Ubik.Accounting.Structure.Contracts.AccountGroups.Results; -namespace Ubik.Accounting.Contracts.Classifications.Results +namespace Ubik.Accounting.Structure.Contracts.Classifications.Results { public record ClassificationDeleteResult { diff --git a/src/Ubik.Accounting.Contracts/Classifications/Results/ClassificationStandardResult.cs b/src/Ubik.Accounting.Structure.Contracts/Classifications/Results/ClassificationStandardResult.cs similarity index 80% rename from src/Ubik.Accounting.Contracts/Classifications/Results/ClassificationStandardResult.cs rename to src/Ubik.Accounting.Structure.Contracts/Classifications/Results/ClassificationStandardResult.cs index e51b3784..93daf667 100644 --- a/src/Ubik.Accounting.Contracts/Classifications/Results/ClassificationStandardResult.cs +++ b/src/Ubik.Accounting.Structure.Contracts/Classifications/Results/ClassificationStandardResult.cs @@ -1,4 +1,4 @@ -namespace Ubik.Accounting.Contracts.Classifications.Results +namespace Ubik.Accounting.Structure.Contracts.Classifications.Results { public record ClassificationStandardResult { diff --git a/src/Ubik.Accounting.Contracts/Classifications/Results/ClassificationStatusResult.cs b/src/Ubik.Accounting.Structure.Contracts/Classifications/Results/ClassificationStatusResult.cs similarity index 63% rename from src/Ubik.Accounting.Contracts/Classifications/Results/ClassificationStatusResult.cs rename to src/Ubik.Accounting.Structure.Contracts/Classifications/Results/ClassificationStatusResult.cs index 96335c70..5b6af91c 100644 --- a/src/Ubik.Accounting.Contracts/Classifications/Results/ClassificationStatusResult.cs +++ b/src/Ubik.Accounting.Structure.Contracts/Classifications/Results/ClassificationStatusResult.cs @@ -1,6 +1,6 @@ -using Ubik.Accounting.Contracts.Accounts.Results; +using Ubik.Accounting.Structure.Contracts.Accounts.Results; -namespace Ubik.Accounting.Contracts.Classifications.Results +namespace Ubik.Accounting.Structure.Contracts.Classifications.Results { public class ClassificationStatusResult { diff --git a/src/Ubik.Accounting.Contracts/Currencies/Results/CurrencyStandardResult.cs b/src/Ubik.Accounting.Structure.Contracts/Currencies/Results/CurrencyStandardResult.cs similarity index 73% rename from src/Ubik.Accounting.Contracts/Currencies/Results/CurrencyStandardResult.cs rename to src/Ubik.Accounting.Structure.Contracts/Currencies/Results/CurrencyStandardResult.cs index 4f624142..cbed1159 100644 --- a/src/Ubik.Accounting.Contracts/Currencies/Results/CurrencyStandardResult.cs +++ b/src/Ubik.Accounting.Structure.Contracts/Currencies/Results/CurrencyStandardResult.cs @@ -1,4 +1,4 @@ -namespace Ubik.Accounting.Contracts.Currencies.Results +namespace Ubik.Accounting.Structure.Contracts.Currencies.Results { public record CurrencyStandardResult { diff --git a/src/Ubik.Accounting.Contracts/Ubik.Accounting.Contracts.csproj b/src/Ubik.Accounting.Structure.Contracts/Ubik.Accounting.Structure.Contracts.csproj similarity index 100% rename from src/Ubik.Accounting.Contracts/Ubik.Accounting.Contracts.csproj rename to src/Ubik.Accounting.Structure.Contracts/Ubik.Accounting.Structure.Contracts.csproj diff --git a/src/Ubik.Accounting.Contracts/VatRate/Commands/AddVatRateCommand.cs b/src/Ubik.Accounting.Structure.Contracts/VatRate/Commands/AddVatRateCommand.cs similarity index 89% rename from src/Ubik.Accounting.Contracts/VatRate/Commands/AddVatRateCommand.cs rename to src/Ubik.Accounting.Structure.Contracts/VatRate/Commands/AddVatRateCommand.cs index 5523d585..06306395 100644 --- a/src/Ubik.Accounting.Contracts/VatRate/Commands/AddVatRateCommand.cs +++ b/src/Ubik.Accounting.Structure.Contracts/VatRate/Commands/AddVatRateCommand.cs @@ -5,7 +5,7 @@ using System.Text; using System.Threading.Tasks; -namespace Ubik.Accounting.Contracts.VatRate.Commands +namespace Ubik.Accounting.Structure.Contracts.VatRate.Commands { public record AddVatRateCommand { diff --git a/src/Ubik.Accounting.Contracts/VatRate/Commands/UpdateVatRateCommand.cs b/src/Ubik.Accounting.Structure.Contracts/VatRate/Commands/UpdateVatRateCommand.cs similarity index 91% rename from src/Ubik.Accounting.Contracts/VatRate/Commands/UpdateVatRateCommand.cs rename to src/Ubik.Accounting.Structure.Contracts/VatRate/Commands/UpdateVatRateCommand.cs index 73e77f85..24b6c212 100644 --- a/src/Ubik.Accounting.Contracts/VatRate/Commands/UpdateVatRateCommand.cs +++ b/src/Ubik.Accounting.Structure.Contracts/VatRate/Commands/UpdateVatRateCommand.cs @@ -5,7 +5,7 @@ using System.Text; using System.Threading.Tasks; -namespace Ubik.Accounting.Contracts.VatRate.Commands +namespace Ubik.Accounting.Structure.Contracts.VatRate.Commands { public record UpdateVatRateCommand { diff --git a/src/Ubik.Accounting.Contracts/VatRate/Events/VatRateAdded.cs b/src/Ubik.Accounting.Structure.Contracts/VatRate/Events/VatRateAdded.cs similarity index 88% rename from src/Ubik.Accounting.Contracts/VatRate/Events/VatRateAdded.cs rename to src/Ubik.Accounting.Structure.Contracts/VatRate/Events/VatRateAdded.cs index 6dab8741..8127ab14 100644 --- a/src/Ubik.Accounting.Contracts/VatRate/Events/VatRateAdded.cs +++ b/src/Ubik.Accounting.Structure.Contracts/VatRate/Events/VatRateAdded.cs @@ -4,7 +4,7 @@ using System.Text; using System.Threading.Tasks; -namespace Ubik.Accounting.Contracts.VatRate.Events +namespace Ubik.Accounting.Structure.Contracts.VatRate.Events { public record VatRateAdded { diff --git a/src/Ubik.Accounting.Contracts/VatRate/Events/VatRateDeleted.cs b/src/Ubik.Accounting.Structure.Contracts/VatRate/Events/VatRateDeleted.cs similarity index 77% rename from src/Ubik.Accounting.Contracts/VatRate/Events/VatRateDeleted.cs rename to src/Ubik.Accounting.Structure.Contracts/VatRate/Events/VatRateDeleted.cs index 5ca633c1..8c988b07 100644 --- a/src/Ubik.Accounting.Contracts/VatRate/Events/VatRateDeleted.cs +++ b/src/Ubik.Accounting.Structure.Contracts/VatRate/Events/VatRateDeleted.cs @@ -4,7 +4,7 @@ using System.Text; using System.Threading.Tasks; -namespace Ubik.Accounting.Contracts.VatRate.Events +namespace Ubik.Accounting.Structure.Contracts.VatRate.Events { public record VatRateDeleted { diff --git a/src/Ubik.Accounting.Contracts/VatRate/Events/VatRateUpdated.cs b/src/Ubik.Accounting.Structure.Contracts/VatRate/Events/VatRateUpdated.cs similarity index 88% rename from src/Ubik.Accounting.Contracts/VatRate/Events/VatRateUpdated.cs rename to src/Ubik.Accounting.Structure.Contracts/VatRate/Events/VatRateUpdated.cs index 91073985..ec5a66f3 100644 --- a/src/Ubik.Accounting.Contracts/VatRate/Events/VatRateUpdated.cs +++ b/src/Ubik.Accounting.Structure.Contracts/VatRate/Events/VatRateUpdated.cs @@ -4,7 +4,7 @@ using System.Text; using System.Threading.Tasks; -namespace Ubik.Accounting.Contracts.VatRate.Events +namespace Ubik.Accounting.Structure.Contracts.VatRate.Events { public record VatRateUpdated { diff --git a/src/Ubik.Accounting.Contracts/VatRate/Results/VatRateStandardResult.cs b/src/Ubik.Accounting.Structure.Contracts/VatRate/Results/VatRateStandardResult.cs similarity index 88% rename from src/Ubik.Accounting.Contracts/VatRate/Results/VatRateStandardResult.cs rename to src/Ubik.Accounting.Structure.Contracts/VatRate/Results/VatRateStandardResult.cs index b6ffb8ed..6b226bec 100644 --- a/src/Ubik.Accounting.Contracts/VatRate/Results/VatRateStandardResult.cs +++ b/src/Ubik.Accounting.Structure.Contracts/VatRate/Results/VatRateStandardResult.cs @@ -4,7 +4,7 @@ using System.Text; using System.Threading.Tasks; -namespace Ubik.Accounting.Contracts.VatRate.Results +namespace Ubik.Accounting.Structure.Contracts.VatRate.Results { public record VatRateStandardResult { diff --git a/src/Ubik.Accounting.WebApp.Client/Components/Accounts/AccountFilters.razor b/src/Ubik.Accounting.WebApp.Client/Components/Accounts/AccountFilters.razor index 52e09724..b7dc40d0 100644 --- a/src/Ubik.Accounting.WebApp.Client/Components/Accounts/AccountFilters.razor +++ b/src/Ubik.Accounting.WebApp.Client/Components/Accounts/AccountFilters.razor @@ -1,6 +1,6 @@ @using Ubik.Accounting.WebApp.Client.Components.Common.Buttons -@using Ubik.Accounting.Contracts.Accounts.Enums -@using Ubik.Accounting.Contracts.Currencies.Results +@using Ubik.Accounting.Structure.Contracts.Accounts.Enums +@using Ubik.Accounting.Structure.Contracts.Currencies.Results @inject IJSRuntime JS diff --git a/src/Ubik.Accounting.WebApp.Client/Components/Accounts/AccountFiltersModel.cs b/src/Ubik.Accounting.WebApp.Client/Components/Accounts/AccountFiltersModel.cs index b00f048b..41266d74 100644 --- a/src/Ubik.Accounting.WebApp.Client/Components/Accounts/AccountFiltersModel.cs +++ b/src/Ubik.Accounting.WebApp.Client/Components/Accounts/AccountFiltersModel.cs @@ -1,4 +1,4 @@ -using Ubik.Accounting.Contracts.Accounts.Enums; +using Ubik.Accounting.Structure.Contracts.Accounts.Enums; namespace Ubik.Accounting.WebApp.Client.Components.Accounts { diff --git a/src/Ubik.Accounting.WebApp.Client/Components/Accounts/AccountForm.razor b/src/Ubik.Accounting.WebApp.Client/Components/Accounts/AccountForm.razor index a3926573..a9842184 100644 --- a/src/Ubik.Accounting.WebApp.Client/Components/Accounts/AccountForm.razor +++ b/src/Ubik.Accounting.WebApp.Client/Components/Accounts/AccountForm.razor @@ -1,5 +1,5 @@ -@using Ubik.Accounting.Contracts.Accounts.Enums -@using Ubik.Accounting.Contracts.Currencies.Results +@using Ubik.Accounting.Structure.Contracts.Accounts.Enums +@using Ubik.Accounting.Structure.Contracts.Currencies.Results @using Ubik.Accounting.WebApp.Client.Components.Common.Buttons @using Ubik.Accounting.WebApp.Client.Components.Common.Alerts; @using Ubik.Accounting.Webapp.Shared.Facades diff --git a/src/Ubik.Accounting.WebApp.Client/Components/Accounts/AccountModel.cs b/src/Ubik.Accounting.WebApp.Client/Components/Accounts/AccountModel.cs index bd2b0603..4f22f15d 100644 --- a/src/Ubik.Accounting.WebApp.Client/Components/Accounts/AccountModel.cs +++ b/src/Ubik.Accounting.WebApp.Client/Components/Accounts/AccountModel.cs @@ -1,7 +1,7 @@ using System.ComponentModel.DataAnnotations; -using Ubik.Accounting.Contracts.Accounts.Commands; -using Ubik.Accounting.Contracts.Accounts.Enums; -using Ubik.Accounting.Contracts.Accounts.Results; +using Ubik.Accounting.Structure.Contracts.Accounts.Commands; +using Ubik.Accounting.Structure.Contracts.Accounts.Enums; +using Ubik.Accounting.Structure.Contracts.Accounts.Results; namespace Ubik.Accounting.WebApp.Client.Components.Accounts { diff --git a/src/Ubik.Accounting.WebApp.Client/Components/Accounts/Accounts.razor b/src/Ubik.Accounting.WebApp.Client/Components/Accounts/Accounts.razor index 01f87b8c..41d2fb7a 100644 --- a/src/Ubik.Accounting.WebApp.Client/Components/Accounts/Accounts.razor +++ b/src/Ubik.Accounting.WebApp.Client/Components/Accounts/Accounts.razor @@ -1,5 +1,5 @@ -@using Ubik.Accounting.Contracts.Accounts.Results -@using Ubik.Accounting.Contracts.Currencies.Results +@using Ubik.Accounting.Structure.Contracts.Accounts.Results +@using Ubik.Accounting.Structure.Contracts.Currencies.Results @using Ubik.Common.Contracts.Error @using Ubik.Accounting.Webapp.Shared.Facades @using Ubik.Accounting.WebApp.Client.Components.Common.Modal @@ -8,7 +8,7 @@ @using Ubik.Accounting.WebApp.Client.Components.Common.Grid.Columns @using Ubik.Accounting.WebApp.Client.Components.Common.Grid.Pagination @using Ubik.Accounting.WebApp.Client.Components.Common.Alerts -@using Ubik.Accounting.Contracts.Accounts.Enums +@using Ubik.Accounting.Structure.Contracts.Accounts.Enums @using Ubik.Accounting.WebApp.Client.Components.Common.Search @inject IAccountingApiClient Client diff --git a/src/Ubik.Accounting.WebApp.Client/Components/Classifications/AccountGroupAccountAttach.razor b/src/Ubik.Accounting.WebApp.Client/Components/Classifications/AccountGroupAccountAttach.razor index bcebbad3..5722a0c0 100644 --- a/src/Ubik.Accounting.WebApp.Client/Components/Classifications/AccountGroupAccountAttach.razor +++ b/src/Ubik.Accounting.WebApp.Client/Components/Classifications/AccountGroupAccountAttach.razor @@ -7,8 +7,8 @@ @using Ubik.Accounting.Webapp.Shared.Features.Classifications.Services @using Ubik.Accounting.WebApp.Client.Components.Common.Grid.Pagination @using Ubik.Accounting.Webapp.Shared.Facades -@using Ubik.Accounting.Contracts.Accounts.Results -@using Ubik.Accounting.Contracts.Accounts.Commands +@using Ubik.Accounting.Structure.Contracts.Accounts.Results +@using Ubik.Accounting.Structure.Contracts.Accounts.Commands @inject ClassificationStateService CurrentState @inject IRenderContext RenderContext diff --git a/src/Ubik.Accounting.WebApp.Client/Components/Classifications/AccountGroupAccountDetach.razor b/src/Ubik.Accounting.WebApp.Client/Components/Classifications/AccountGroupAccountDetach.razor index b311bb22..97665604 100644 --- a/src/Ubik.Accounting.WebApp.Client/Components/Classifications/AccountGroupAccountDetach.razor +++ b/src/Ubik.Accounting.WebApp.Client/Components/Classifications/AccountGroupAccountDetach.razor @@ -3,8 +3,8 @@ @using Ubik.Accounting.Webapp.Shared.Facades @using Ubik.Accounting.Webapp.Shared.Features.Classifications.Models @using Ubik.Accounting.Webapp.Shared.Features.Classifications.Services -@using Ubik.Accounting.Contracts.Accounts.Results -@using Ubik.Accounting.Contracts.Accounts.Commands +@using Ubik.Accounting.Structure.Contracts.Accounts.Results +@using Ubik.Accounting.Structure.Contracts.Accounts.Commands @inject IAccountingApiClient Client @inject ClassificationStateService CurrentState diff --git a/src/Ubik.Accounting.WebApp.Client/Components/Classifications/AccountGroupConfirmDelete.razor b/src/Ubik.Accounting.WebApp.Client/Components/Classifications/AccountGroupConfirmDelete.razor index c1811d88..a07dec68 100644 --- a/src/Ubik.Accounting.WebApp.Client/Components/Classifications/AccountGroupConfirmDelete.razor +++ b/src/Ubik.Accounting.WebApp.Client/Components/Classifications/AccountGroupConfirmDelete.razor @@ -1,7 +1,7 @@ @using Ubik.Accounting.WebApp.Client.Components.Common.Alerts; @using Ubik.Accounting.WebApp.Client.Components.Common.Buttons; @using Ubik.Accounting.Webapp.Shared.Facades -@using Ubik.Accounting.Contracts.AccountGroups.Results +@using Ubik.Accounting.Structure.Contracts.AccountGroups.Results @using Ubik.Accounting.Webapp.Shared.Features.Classifications.Models @using Ubik.Accounting.Webapp.Shared.Features.Classifications.Services diff --git a/src/Ubik.Accounting.WebApp.Client/Components/Classifications/AccountGroupForm.razor b/src/Ubik.Accounting.WebApp.Client/Components/Classifications/AccountGroupForm.razor index cbda9d0a..485dcb9e 100644 --- a/src/Ubik.Accounting.WebApp.Client/Components/Classifications/AccountGroupForm.razor +++ b/src/Ubik.Accounting.WebApp.Client/Components/Classifications/AccountGroupForm.razor @@ -1,4 +1,4 @@ -@using Ubik.Accounting.Contracts.AccountGroups.Results +@using Ubik.Accounting.Structure.Contracts.AccountGroups.Results @using Ubik.Accounting.WebApp.Client.Components.Common.Buttons @using Ubik.Accounting.Webapp.Shared.Facades @using Ubik.Accounting.WebApp.Client.Components.Common.Alerts; diff --git a/src/Ubik.Accounting.WebApp.Client/Components/Classifications/AccountGroupNode.razor b/src/Ubik.Accounting.WebApp.Client/Components/Classifications/AccountGroupNode.razor index a7d68473..10dbaf49 100644 --- a/src/Ubik.Accounting.WebApp.Client/Components/Classifications/AccountGroupNode.razor +++ b/src/Ubik.Accounting.WebApp.Client/Components/Classifications/AccountGroupNode.razor @@ -1,4 +1,4 @@ -@using Ubik.Accounting.Contracts.Accounts.Results +@using Ubik.Accounting.Structure.Contracts.Accounts.Results @using Ubik.Accounting.Webapp.Shared.Facades @using Ubik.Accounting.WebApp.Client.Components.Common.Modal @using Ubik.Accounting.Webapp.Shared.Features.Classifications.Services diff --git a/src/Ubik.Accounting.WebApp.Client/Components/Classifications/ClassificationForm.razor b/src/Ubik.Accounting.WebApp.Client/Components/Classifications/ClassificationForm.razor index 75be3edc..7539aa69 100644 --- a/src/Ubik.Accounting.WebApp.Client/Components/Classifications/ClassificationForm.razor +++ b/src/Ubik.Accounting.WebApp.Client/Components/Classifications/ClassificationForm.razor @@ -1,4 +1,4 @@ -@using Ubik.Accounting.Contracts.Classifications.Results +@using Ubik.Accounting.Structure.Contracts.Classifications.Results @using Ubik.Accounting.WebApp.Client.Components.Common.Buttons @using Ubik.Accounting.WebApp.Client.Components.Common.Alerts; @using Ubik.Accounting.Webapp.Shared.Facades diff --git a/src/Ubik.Accounting.WebApp.Client/Components/Classifications/ClassificationModel.cs b/src/Ubik.Accounting.WebApp.Client/Components/Classifications/ClassificationModel.cs index cb8fdae4..d720bca8 100644 --- a/src/Ubik.Accounting.WebApp.Client/Components/Classifications/ClassificationModel.cs +++ b/src/Ubik.Accounting.WebApp.Client/Components/Classifications/ClassificationModel.cs @@ -1,6 +1,6 @@ using System.ComponentModel.DataAnnotations; -using Ubik.Accounting.Contracts.Classifications.Commands; -using Ubik.Accounting.Contracts.Classifications.Results; +using Ubik.Accounting.Structure.Contracts.Classifications.Commands; +using Ubik.Accounting.Structure.Contracts.Classifications.Results; namespace Ubik.Accounting.WebApp.Client.Components.Classifications { diff --git a/src/Ubik.Accounting.WebApp.Client/Components/Classifications/Classifications.razor b/src/Ubik.Accounting.WebApp.Client/Components/Classifications/Classifications.razor index b36d1ebd..2f850a5f 100644 --- a/src/Ubik.Accounting.WebApp.Client/Components/Classifications/Classifications.razor +++ b/src/Ubik.Accounting.WebApp.Client/Components/Classifications/Classifications.razor @@ -1,11 +1,11 @@ -@using Ubik.Accounting.Contracts.Accounts.Results +@using Ubik.Accounting.Structure.Contracts.Accounts.Results @using Ubik.Accounting.WebApp.Client.Components.Common.Alerts @using Ubik.Accounting.Webapp.Shared.Facades @using Ubik.Accounting.Webapp.Shared.Features.Classifications.Services @using Ubik.Accounting.Webapp.Shared.Features.Classifications.Models @using Ubik.Accounting.WebApp.Client.Components.Common.Forms -@using Ubik.Accounting.Contracts.Classifications.Results -@using Ubik.Accounting.Contracts.AccountGroups.Results +@using Ubik.Accounting.Structure.Contracts.Classifications.Results +@using Ubik.Accounting.Structure.Contracts.AccountGroups.Results @using Ubik.Accounting.WebApp.Client.Components.Common.Buttons @using Ubik.Accounting.WebApp.Client.Components.Common.Modal @using Ubik.Accounting.WebApp.Client.Components.Common.Spinners diff --git a/src/Ubik.Accounting.WebApp.Client/Facades/HttpApiAccountingFacade.cs b/src/Ubik.Accounting.WebApp.Client/Facades/HttpApiAccountingFacade.cs index 5e8edce2..5b5ba347 100644 --- a/src/Ubik.Accounting.WebApp.Client/Facades/HttpApiAccountingFacade.cs +++ b/src/Ubik.Accounting.WebApp.Client/Facades/HttpApiAccountingFacade.cs @@ -1,8 +1,8 @@ using System.Text; using System.Text.Json; -using Ubik.Accounting.Contracts.AccountGroups.Commands; -using Ubik.Accounting.Contracts.Accounts.Commands; -using Ubik.Accounting.Contracts.Classifications.Commands; +using Ubik.Accounting.Structure.Contracts.AccountGroups.Commands; +using Ubik.Accounting.Structure.Contracts.Accounts.Commands; +using Ubik.Accounting.Structure.Contracts.Classifications.Commands; using Ubik.Accounting.Webapp.Shared.Facades; namespace Ubik.Accounting.WebApp.Client.Facades diff --git a/src/Ubik.Accounting.WebApp/ApiClients/AccountingApiClient.cs b/src/Ubik.Accounting.WebApp/ApiClients/AccountingApiClient.cs index 0b84efea..4810bca7 100644 --- a/src/Ubik.Accounting.WebApp/ApiClients/AccountingApiClient.cs +++ b/src/Ubik.Accounting.WebApp/ApiClients/AccountingApiClient.cs @@ -2,9 +2,9 @@ using Microsoft.Extensions.Options; using System.Text; using System.Text.Json; -using Ubik.Accounting.Contracts.AccountGroups.Commands; -using Ubik.Accounting.Contracts.Accounts.Commands; -using Ubik.Accounting.Contracts.Classifications.Commands; +using Ubik.Accounting.Structure.Contracts.AccountGroups.Commands; +using Ubik.Accounting.Structure.Contracts.Accounts.Commands; +using Ubik.Accounting.Structure.Contracts.Classifications.Commands; using Ubik.Accounting.Webapp.Shared.Facades; using Ubik.Accounting.WebApp.Config; using Ubik.Accounting.WebApp.Security; diff --git a/src/Ubik.Accounting.WebApp/Controllers/ReverseProxyWasm.cs b/src/Ubik.Accounting.WebApp/Controllers/ReverseProxyWasm.cs index f6339f0a..41546ad0 100644 --- a/src/Ubik.Accounting.WebApp/Controllers/ReverseProxyWasm.cs +++ b/src/Ubik.Accounting.WebApp/Controllers/ReverseProxyWasm.cs @@ -1,9 +1,9 @@ using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Authorization; using Ubik.Accounting.Webapp.Shared.Facades; -using Ubik.Accounting.Contracts.Accounts.Commands; -using Ubik.Accounting.Contracts.Classifications.Commands; -using Ubik.Accounting.Contracts.AccountGroups.Commands; +using Ubik.Accounting.Structure.Contracts.Accounts.Commands; +using Ubik.Accounting.Structure.Contracts.Classifications.Commands; +using Ubik.Accounting.Structure.Contracts.AccountGroups.Commands; namespace Ubik.Accounting.WebApp.Controllers diff --git a/src/Ubik.Accounting.WebApp/Dockerfile b/src/Ubik.Accounting.WebApp/Dockerfile index 11993ff1..2a4f4cbd 100644 --- a/src/Ubik.Accounting.WebApp/Dockerfile +++ b/src/Ubik.Accounting.WebApp/Dockerfile @@ -15,7 +15,7 @@ WORKDIR / COPY ["src/Ubik.Accounting.WebApp/Ubik.Accounting.WebApp.csproj", "src/Ubik.Accounting.WebApp/"] COPY ["src/Ubik.Accounting.WebApp.Client/Ubik.Accounting.WebApp.Client.csproj", "src/Ubik.Accounting.WebApp.Client/"] COPY ["src/Ubik.Accounting.Webapp.Shared/Ubik.Accounting.Webapp.Shared.csproj", "src/Ubik.Accounting.Webapp.Shared/"] -COPY ["src/Ubik.Accounting.Contracts/Ubik.Accounting.Contracts.csproj", "src/Ubik.Accounting.Contracts/"] +COPY ["src/Ubik.Accounting.Structure.Contracts/Ubik.Accounting.Structure.Contracts.csproj", "src/Ubik.Accounting.Structure.Contracts/"] COPY ["src/Ubik.Contracts.Common/Ubik.Contracts.Common.csproj", "src/Ubik.Contracts.Common/"] COPY ["src/Ubik.ApiService.Common/Ubik.ApiService.Common.csproj", "src/Ubik.ApiService.Common/"] COPY ["src/Ubik.Security.Contracts/Ubik.Security.Contracts.csproj", "src/Ubik.Security.Contracts/"] diff --git a/src/Ubik.Accounting.WebApp/Ubik.Accounting.WebApp.csproj b/src/Ubik.Accounting.WebApp/Ubik.Accounting.WebApp.csproj index c7eb59f6..d6583d52 100644 --- a/src/Ubik.Accounting.WebApp/Ubik.Accounting.WebApp.csproj +++ b/src/Ubik.Accounting.WebApp/Ubik.Accounting.WebApp.csproj @@ -35,6 +35,7 @@ + diff --git a/src/Ubik.Accounting.Webapp.Shared/Facades/IAccountingApiClient.cs b/src/Ubik.Accounting.Webapp.Shared/Facades/IAccountingApiClient.cs index 231cd095..9ef8e46a 100644 --- a/src/Ubik.Accounting.Webapp.Shared/Facades/IAccountingApiClient.cs +++ b/src/Ubik.Accounting.Webapp.Shared/Facades/IAccountingApiClient.cs @@ -1,6 +1,6 @@ -using Ubik.Accounting.Contracts.AccountGroups.Commands; -using Ubik.Accounting.Contracts.Accounts.Commands; -using Ubik.Accounting.Contracts.Classifications.Commands; +using Ubik.Accounting.Structure.Contracts.AccountGroups.Commands; +using Ubik.Accounting.Structure.Contracts.Accounts.Commands; +using Ubik.Accounting.Structure.Contracts.Classifications.Commands; namespace Ubik.Accounting.Webapp.Shared.Facades { diff --git a/src/Ubik.Accounting.Webapp.Shared/Features/Classifications/Models/AccountGroupLinkModel.cs b/src/Ubik.Accounting.Webapp.Shared/Features/Classifications/Models/AccountGroupLinkModel.cs index 8cef6ea4..09ea85a0 100644 --- a/src/Ubik.Accounting.Webapp.Shared/Features/Classifications/Models/AccountGroupLinkModel.cs +++ b/src/Ubik.Accounting.Webapp.Shared/Features/Classifications/Models/AccountGroupLinkModel.cs @@ -1,5 +1,5 @@ -using Ubik.Accounting.Contracts.Accounts.Commands; -using Ubik.Accounting.Contracts.Accounts.Results; +using Ubik.Accounting.Structure.Contracts.Accounts.Commands; +using Ubik.Accounting.Structure.Contracts.Accounts.Results; namespace Ubik.Accounting.Webapp.Shared.Features.Classifications.Models { diff --git a/src/Ubik.Accounting.Webapp.Shared/Features/Classifications/Models/AccountGroupModel.cs b/src/Ubik.Accounting.Webapp.Shared/Features/Classifications/Models/AccountGroupModel.cs index 5db0274d..6c2351c8 100644 --- a/src/Ubik.Accounting.Webapp.Shared/Features/Classifications/Models/AccountGroupModel.cs +++ b/src/Ubik.Accounting.Webapp.Shared/Features/Classifications/Models/AccountGroupModel.cs @@ -1,7 +1,7 @@ using System.ComponentModel.DataAnnotations; -using Ubik.Accounting.Contracts.AccountGroups.Commands; -using Ubik.Accounting.Contracts.AccountGroups.Results; -using Ubik.Accounting.Contracts.Accounts.Results; +using Ubik.Accounting.Structure.Contracts.AccountGroups.Commands; +using Ubik.Accounting.Structure.Contracts.AccountGroups.Results; +using Ubik.Accounting.Structure.Contracts.Accounts.Results; namespace Ubik.Accounting.Webapp.Shared.Features.Classifications.Models { diff --git a/src/Ubik.Accounting.Webapp.Shared/Features/Classifications/Models/AccountModel.cs b/src/Ubik.Accounting.Webapp.Shared/Features/Classifications/Models/AccountModel.cs index b0faf7bb..771a061f 100644 --- a/src/Ubik.Accounting.Webapp.Shared/Features/Classifications/Models/AccountModel.cs +++ b/src/Ubik.Accounting.Webapp.Shared/Features/Classifications/Models/AccountModel.cs @@ -1,7 +1,7 @@ using System.ComponentModel.DataAnnotations; -using Ubik.Accounting.Contracts.Accounts.Enums; -using Ubik.Accounting.Contracts.Accounts.Results; -using Ubik.Accounting.Contracts.Classifications.Results; +using Ubik.Accounting.Structure.Contracts.Accounts.Enums; +using Ubik.Accounting.Structure.Contracts.Accounts.Results; +using Ubik.Accounting.Structure.Contracts.Classifications.Results; namespace Ubik.Accounting.Webapp.Shared.Features.Classifications.Models { diff --git a/src/Ubik.Accounting.Webapp.Shared/Ubik.Accounting.Webapp.Shared.csproj b/src/Ubik.Accounting.Webapp.Shared/Ubik.Accounting.Webapp.Shared.csproj index ab25ac6c..4dc0ed48 100644 --- a/src/Ubik.Accounting.Webapp.Shared/Ubik.Accounting.Webapp.Shared.csproj +++ b/src/Ubik.Accounting.Webapp.Shared/Ubik.Accounting.Webapp.Shared.csproj @@ -11,7 +11,7 @@ - + diff --git a/src/Ubik.CodeGenerator/Ubik.CodeGenerator.csproj b/src/Ubik.CodeGenerator/Ubik.CodeGenerator.csproj index 6a93d686..c393c33e 100644 --- a/src/Ubik.CodeGenerator/Ubik.CodeGenerator.csproj +++ b/src/Ubik.CodeGenerator/Ubik.CodeGenerator.csproj @@ -12,7 +12,6 @@ - diff --git a/src/Ubik.sln b/src/Ubik.sln index 2d4b3cd3..af104007 100644 --- a/src/Ubik.sln +++ b/src/Ubik.sln @@ -11,9 +11,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ubik.ApiService.Common", "U EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ubik.Api.Tests.Integration", "..\tests\Ubik.Api.Tests.Integration\Ubik.Api.Tests.Integration.csproj", "{40D9982F-BB82-4922-B2DE-E2F6B02C6CBC}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ubik.Accounting.Api.Tests.UnitTests", "..\tests\Ubik.Accounting.Api.Tests.UnitTests\Ubik.Accounting.Api.Tests.UnitTests.csproj", "{28D8CCFA-1FA3-436E-AE22-0B46EEAAABC6}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ubik.Accounting.Contracts", "Ubik.Accounting.Contracts\Ubik.Accounting.Contracts.csproj", "{E7DE036A-E2E6-4A65-A1A9-40CF9EA5E449}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ubik.Accounting.Structure.Contracts", "Ubik.Accounting.Structure.Contracts\Ubik.Accounting.Structure.Contracts.csproj", "{E7DE036A-E2E6-4A65-A1A9-40CF9EA5E449}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ubik.Accounting.WebApp", "Ubik.Accounting.WebApp\Ubik.Accounting.WebApp.csproj", "{49287A03-F87B-4CD9-B967-B1E205743B64}" EndProject @@ -53,10 +51,6 @@ Global {40D9982F-BB82-4922-B2DE-E2F6B02C6CBC}.Debug|Any CPU.Build.0 = Debug|Any CPU {40D9982F-BB82-4922-B2DE-E2F6B02C6CBC}.Release|Any CPU.ActiveCfg = Release|Any CPU {40D9982F-BB82-4922-B2DE-E2F6B02C6CBC}.Release|Any CPU.Build.0 = Release|Any CPU - {28D8CCFA-1FA3-436E-AE22-0B46EEAAABC6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {28D8CCFA-1FA3-436E-AE22-0B46EEAAABC6}.Debug|Any CPU.Build.0 = Debug|Any CPU - {28D8CCFA-1FA3-436E-AE22-0B46EEAAABC6}.Release|Any CPU.ActiveCfg = Release|Any CPU - {28D8CCFA-1FA3-436E-AE22-0B46EEAAABC6}.Release|Any CPU.Build.0 = Release|Any CPU {E7DE036A-E2E6-4A65-A1A9-40CF9EA5E449}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {E7DE036A-E2E6-4A65-A1A9-40CF9EA5E449}.Debug|Any CPU.Build.0 = Debug|Any CPU {E7DE036A-E2E6-4A65-A1A9-40CF9EA5E449}.Release|Any CPU.ActiveCfg = Release|Any CPU diff --git a/tests/Ubik.Accounting.Api.Tests.UnitTests/GlobalUsings.cs b/tests/Ubik.Accounting.Api.Tests.UnitTests/GlobalUsings.cs deleted file mode 100644 index 8c927eb7..00000000 --- a/tests/Ubik.Accounting.Api.Tests.UnitTests/GlobalUsings.cs +++ /dev/null @@ -1 +0,0 @@ -global using Xunit; \ No newline at end of file diff --git a/tests/Ubik.Accounting.Api.Tests.UnitTests/Ubik.Accounting.Api.Tests.UnitTests.csproj b/tests/Ubik.Accounting.Api.Tests.UnitTests/Ubik.Accounting.Api.Tests.UnitTests.csproj deleted file mode 100644 index 2aa1575a..00000000 --- a/tests/Ubik.Accounting.Api.Tests.UnitTests/Ubik.Accounting.Api.Tests.UnitTests.csproj +++ /dev/null @@ -1,36 +0,0 @@ - - - - net8.0 - enable - enable - - false - true - - - - - - - - - - runtime; build; native; contentfiles; analyzers; buildtransitive - all - - - runtime; build; native; contentfiles; analyzers; buildtransitive - all - - - - - - - - - - - - diff --git a/tests/Ubik.Api.Tests.Integration/Features/Accounting/AccountGroups/AccountGroupsController_Test.cs b/tests/Ubik.Api.Tests.Integration/Features/Accounting/AccountGroups/AccountGroupsController_Test.cs index 12e2a92f..de158727 100644 --- a/tests/Ubik.Api.Tests.Integration/Features/Accounting/AccountGroups/AccountGroupsController_Test.cs +++ b/tests/Ubik.Api.Tests.Integration/Features/Accounting/AccountGroups/AccountGroupsController_Test.cs @@ -8,11 +8,11 @@ using System.Text; using System.Threading.Tasks; using Ubik.Security.Contracts.Roles.Results; -using Ubik.Accounting.Contracts.AccountGroups.Results; +using Ubik.Accounting.Structure.Contracts.AccountGroups.Results; using Ubik.ApiService.Common.Exceptions; using RabbitMQ.Client; -using Ubik.Accounting.Contracts.Accounts.Results; -using Ubik.Accounting.Contracts.AccountGroups.Commands; +using Ubik.Accounting.Structure.Contracts.Accounts.Results; +using Ubik.Accounting.Structure.Contracts.AccountGroups.Commands; using MassTransit; namespace Ubik.Api.Tests.Integration.Features.Accounting.AccountGroups diff --git a/tests/Ubik.Api.Tests.Integration/Features/Accounting/Accounts/AccountsController_Test.cs b/tests/Ubik.Api.Tests.Integration/Features/Accounting/Accounts/AccountsController_Test.cs index efd46a36..1d1f6669 100644 --- a/tests/Ubik.Api.Tests.Integration/Features/Accounting/Accounts/AccountsController_Test.cs +++ b/tests/Ubik.Api.Tests.Integration/Features/Accounting/Accounts/AccountsController_Test.cs @@ -7,10 +7,10 @@ using System.Net; using System.Text; using System.Threading.Tasks; -using Ubik.Accounting.Contracts.Accounts.Results; +using Ubik.Accounting.Structure.Contracts.Accounts.Results; using Ubik.ApiService.Common.Exceptions; -using Ubik.Accounting.Contracts.Accounts.Commands; -using Ubik.Accounting.Contracts.Accounts.Enums; +using Ubik.Accounting.Structure.Contracts.Accounts.Commands; +using Ubik.Accounting.Structure.Contracts.Accounts.Enums; using MassTransit; namespace Ubik.Api.Tests.Integration.Features.Accounting.Accounts diff --git a/tests/Ubik.Api.Tests.Integration/Features/Accounting/Classifications/ClassificationsController_Test.cs b/tests/Ubik.Api.Tests.Integration/Features/Accounting/Classifications/ClassificationsController_Test.cs index 91b1e36f..111ab06b 100644 --- a/tests/Ubik.Api.Tests.Integration/Features/Accounting/Classifications/ClassificationsController_Test.cs +++ b/tests/Ubik.Api.Tests.Integration/Features/Accounting/Classifications/ClassificationsController_Test.cs @@ -7,10 +7,10 @@ using System.Net; using System.Text; using System.Threading.Tasks; -using Ubik.Accounting.Contracts.Accounts.Results; -using Ubik.Accounting.Contracts.Classifications.Results; +using Ubik.Accounting.Structure.Contracts.Accounts.Results; +using Ubik.Accounting.Structure.Contracts.Classifications.Results; using Ubik.ApiService.Common.Exceptions; -using Ubik.Accounting.Contracts.Classifications.Commands; +using Ubik.Accounting.Structure.Contracts.Classifications.Commands; using MassTransit; using Ubik.Accounting.Structure.Api.Models; diff --git a/tests/Ubik.Api.Tests.Integration/Features/Accounting/Currencies/CurrenciesController_Test.cs b/tests/Ubik.Api.Tests.Integration/Features/Accounting/Currencies/CurrenciesController_Test.cs index b2624178..66422e01 100644 --- a/tests/Ubik.Api.Tests.Integration/Features/Accounting/Currencies/CurrenciesController_Test.cs +++ b/tests/Ubik.Api.Tests.Integration/Features/Accounting/Currencies/CurrenciesController_Test.cs @@ -7,8 +7,8 @@ using System.Net; using System.Text; using System.Threading.Tasks; -using Ubik.Accounting.Contracts.Classifications.Results; -using Ubik.Accounting.Contracts.Currencies.Results; +using Ubik.Accounting.Structure.Contracts.Classifications.Results; +using Ubik.Accounting.Structure.Contracts.Currencies.Results; namespace Ubik.Api.Tests.Integration.Features.Accounting.Currencies { diff --git a/tests/Ubik.Api.Tests.Integration/Ubik.Api.Tests.Integration.csproj b/tests/Ubik.Api.Tests.Integration/Ubik.Api.Tests.Integration.csproj index 8b61e05b..1ae15b02 100644 --- a/tests/Ubik.Api.Tests.Integration/Ubik.Api.Tests.Integration.csproj +++ b/tests/Ubik.Api.Tests.Integration/Ubik.Api.Tests.Integration.csproj @@ -37,8 +37,8 @@ - + From 8addb53afa8ebd5e29d09233d0e4bc54998fd4f0 Mon Sep 17 00:00:00 2001 From: ubik Date: Fri, 1 Nov 2024 08:24:11 +0100 Subject: [PATCH 12/94] New backend prj to manage VAT or Sales tax --- .../Dockerfile | 30 +++++++++++ .../Program.cs | 25 +++++++++ .../Properties/launchSettings.json | 52 +++++++++++++++++++ .../Ubik.Accounting.SalesOrVatTax.Api.csproj | 16 ++++++ .../Ubik.Accounting.SalesOrVatTax.Api.http | 6 +++ .../appsettings.Development.json | 8 +++ .../appsettings.json | 9 ++++ src/Ubik.sln | 6 +++ 8 files changed, 152 insertions(+) create mode 100644 src/Ubik.Accounting.SalesOrVatTax.Api/Dockerfile create mode 100644 src/Ubik.Accounting.SalesOrVatTax.Api/Program.cs create mode 100644 src/Ubik.Accounting.SalesOrVatTax.Api/Properties/launchSettings.json create mode 100644 src/Ubik.Accounting.SalesOrVatTax.Api/Ubik.Accounting.SalesOrVatTax.Api.csproj create mode 100644 src/Ubik.Accounting.SalesOrVatTax.Api/Ubik.Accounting.SalesOrVatTax.Api.http create mode 100644 src/Ubik.Accounting.SalesOrVatTax.Api/appsettings.Development.json create mode 100644 src/Ubik.Accounting.SalesOrVatTax.Api/appsettings.json diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Dockerfile b/src/Ubik.Accounting.SalesOrVatTax.Api/Dockerfile new file mode 100644 index 00000000..ac31905a --- /dev/null +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Dockerfile @@ -0,0 +1,30 @@ +# See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging. + +# This stage is used when running from VS in fast mode (Default for Debug configuration) +FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base +USER app +WORKDIR /app +EXPOSE 8080 +EXPOSE 8081 + + +# This stage is used to build the service project +FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build +ARG BUILD_CONFIGURATION=Release +WORKDIR /src +COPY ["Ubik.Accounting.SalesOrVatTax.Api/Ubik.Accounting.SalesOrVatTax.Api.csproj", "Ubik.Accounting.SalesOrVatTax.Api/"] +RUN dotnet restore "./Ubik.Accounting.SalesOrVatTax.Api/Ubik.Accounting.SalesOrVatTax.Api.csproj" +COPY . . +WORKDIR "/src/Ubik.Accounting.SalesOrVatTax.Api" +RUN dotnet build "./Ubik.Accounting.SalesOrVatTax.Api.csproj" -c $BUILD_CONFIGURATION -o /app/build + +# This stage is used to publish the service project to be copied to the final stage +FROM build AS publish +ARG BUILD_CONFIGURATION=Release +RUN dotnet publish "./Ubik.Accounting.SalesOrVatTax.Api.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false + +# This stage is used in production or when running from VS in regular mode (Default when not using the Debug configuration) +FROM base AS final +WORKDIR /app +COPY --from=publish /app/publish . +ENTRYPOINT ["dotnet", "Ubik.Accounting.SalesOrVatTax.Api.dll"] \ No newline at end of file diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Program.cs b/src/Ubik.Accounting.SalesOrVatTax.Api/Program.cs new file mode 100644 index 00000000..48863a6d --- /dev/null +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Program.cs @@ -0,0 +1,25 @@ +var builder = WebApplication.CreateBuilder(args); + +// Add services to the container. + +builder.Services.AddControllers(); +// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle +builder.Services.AddEndpointsApiExplorer(); +builder.Services.AddSwaggerGen(); + +var app = builder.Build(); + +// Configure the HTTP request pipeline. +if (app.Environment.IsDevelopment()) +{ + app.UseSwagger(); + app.UseSwaggerUI(); +} + +app.UseHttpsRedirection(); + +app.UseAuthorization(); + +app.MapControllers(); + +app.Run(); diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Properties/launchSettings.json b/src/Ubik.Accounting.SalesOrVatTax.Api/Properties/launchSettings.json new file mode 100644 index 00000000..dc9f0b13 --- /dev/null +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Properties/launchSettings.json @@ -0,0 +1,52 @@ +{ + "profiles": { + "http": { + "commandName": "Project", + "launchBrowser": true, + "launchUrl": "swagger", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + }, + "dotnetRunMessages": true, + "applicationUrl": "http://localhost:5284" + }, + "https": { + "commandName": "Project", + "launchBrowser": true, + "launchUrl": "swagger", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + }, + "dotnetRunMessages": true, + "applicationUrl": "https://localhost:7210;http://localhost:5284" + }, + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "launchUrl": "swagger", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "Container (Dockerfile)": { + "commandName": "Docker", + "launchBrowser": true, + "launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}/swagger", + "environmentVariables": { + "ASPNETCORE_HTTPS_PORTS": "8081", + "ASPNETCORE_HTTP_PORTS": "8080" + }, + "publishAllPorts": true, + "useSSL": true + } + }, + "$schema": "http://json.schemastore.org/launchsettings.json", + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:45994", + "sslPort": 44316 + } + } +} \ No newline at end of file diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Ubik.Accounting.SalesOrVatTax.Api.csproj b/src/Ubik.Accounting.SalesOrVatTax.Api/Ubik.Accounting.SalesOrVatTax.Api.csproj new file mode 100644 index 00000000..d65b61b6 --- /dev/null +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Ubik.Accounting.SalesOrVatTax.Api.csproj @@ -0,0 +1,16 @@ + + + + net8.0 + enable + enable + 8625d6d4-5e9c-427f-9bc4-2bf30f59e372 + Linux + + + + + + + + diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Ubik.Accounting.SalesOrVatTax.Api.http b/src/Ubik.Accounting.SalesOrVatTax.Api/Ubik.Accounting.SalesOrVatTax.Api.http new file mode 100644 index 00000000..480bda55 --- /dev/null +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Ubik.Accounting.SalesOrVatTax.Api.http @@ -0,0 +1,6 @@ +@Ubik.Accounting.SalesOrVatTax.Api_HostAddress = http://localhost:5284 + +GET {{Ubik.Accounting.SalesOrVatTax.Api_HostAddress}}/weatherforecast/ +Accept: application/json + +### diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/appsettings.Development.json b/src/Ubik.Accounting.SalesOrVatTax.Api/appsettings.Development.json new file mode 100644 index 00000000..0c208ae9 --- /dev/null +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/appsettings.Development.json @@ -0,0 +1,8 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + } +} diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/appsettings.json b/src/Ubik.Accounting.SalesOrVatTax.Api/appsettings.json new file mode 100644 index 00000000..10f68b8c --- /dev/null +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/appsettings.json @@ -0,0 +1,9 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + }, + "AllowedHosts": "*" +} diff --git a/src/Ubik.sln b/src/Ubik.sln index af104007..4c051994 100644 --- a/src/Ubik.sln +++ b/src/Ubik.sln @@ -29,6 +29,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ubik.CodeGenerator", "Ubik. EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ubik.YarpProxy", "Ubik.YarpProxy\Ubik.YarpProxy.csproj", "{E64DD625-FF02-4B02-802F-AF2C0D5DA710}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Ubik.Accounting.SalesOrVatTax.Api", "Ubik.Accounting.SalesOrVatTax.Api\Ubik.Accounting.SalesOrVatTax.Api.csproj", "{88A5C638-DFC5-4723-8736-FBBEE524CF72}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -87,6 +89,10 @@ Global {E64DD625-FF02-4B02-802F-AF2C0D5DA710}.Debug|Any CPU.Build.0 = Debug|Any CPU {E64DD625-FF02-4B02-802F-AF2C0D5DA710}.Release|Any CPU.ActiveCfg = Release|Any CPU {E64DD625-FF02-4B02-802F-AF2C0D5DA710}.Release|Any CPU.Build.0 = Release|Any CPU + {88A5C638-DFC5-4723-8736-FBBEE524CF72}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {88A5C638-DFC5-4723-8736-FBBEE524CF72}.Debug|Any CPU.Build.0 = Debug|Any CPU + {88A5C638-DFC5-4723-8736-FBBEE524CF72}.Release|Any CPU.ActiveCfg = Release|Any CPU + {88A5C638-DFC5-4723-8736-FBBEE524CF72}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE From 2cc14380c153e432497ae8ff88a4617b41e27471 Mon Sep 17 00:00:00 2001 From: ubik Date: Fri, 1 Nov 2024 08:45:17 +0100 Subject: [PATCH 13/94] Correct db name for accounting_struct_api and security api for table users_roles_by_tenant --- .../accounting-structure-api-deploy.yaml | 2 +- docker-integration-tests.yml | 2 +- src/Ubik.Accounting.Structure.Api/appsettings.json | 2 +- .../Data/Init/UserRoleByTenantData.sql | 12 ++++++------ .../Features/Users/Services/UsersQueriesService.cs | 6 +++--- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/deploy/accounting-structure-api/accounting-structure-api-deploy.yaml b/deploy/accounting-structure-api/accounting-structure-api-deploy.yaml index 919d1dd9..fbdd9285 100644 --- a/deploy/accounting-structure-api/accounting-structure-api-deploy.yaml +++ b/deploy/accounting-structure-api/accounting-structure-api-deploy.yaml @@ -20,7 +20,7 @@ spec: imagePullPolicy: Never env: - name: ConnectionStrings__AccountingContext - value: 'Host=ubik-postgres-postgresql;Port=5432;Database=ubik_accounting;Username=postgres;Password=test01' + value: 'Host=ubik-postgres-postgresql;Port=5432;Database=ubik_accounting_struct;Username=postgres;Password=test01' - name: ASPNETCORE_ENVIRONMENT value: Development - name: MessageBroker__Host diff --git a/docker-integration-tests.yml b/docker-integration-tests.yml index 878911cd..a60441ac 100644 --- a/docker-integration-tests.yml +++ b/docker-integration-tests.yml @@ -38,7 +38,7 @@ services: - "AuthServer__Authority=http://keycloak:8080/realms/ubik" - "AuthServer__AuthorizationUrl=http://keycloak:8080/realms/ubik/protocol/openid-connect/auth" - "AuthServer__TokenUrl=http://keycloak:8080/realms/ubik/protocol/openid-connect/token" - - "ConnectionStrings__AccountingContext=Host=db-test;Port=5432;Database=ubik_accounting;Username=postgres;Password=test01" + - "ConnectionStrings__AccountingContext=Host=db-test;Port=5432;Database=ubik_accounting_struct;Username=postgres;Password=test01" - "AuthManagerKeyCloakClient__RootUrl=http://keycloak:8080/" - "MessageBroker__Host=amqp://rabbit:5672" depends_on: diff --git a/src/Ubik.Accounting.Structure.Api/appsettings.json b/src/Ubik.Accounting.Structure.Api/appsettings.json index c3ee5f71..04f34f13 100644 --- a/src/Ubik.Accounting.Structure.Api/appsettings.json +++ b/src/Ubik.Accounting.Structure.Api/appsettings.json @@ -20,7 +20,7 @@ "Password": "guest" }, "ConnectionStrings": { - "AccountingContext": "Host=localhost;Port=5435;Database=ubik_accounting;Username=postgres;Password=test01" + "AccountingContext": "Host=localhost;Port=5435;Database=ubik_accounting_struct;Username=postgres;Password=test01" }, "SwaggerUI": { "ClientId": "ubik_accounting_api", diff --git a/src/Ubik.Security.Api/Data/Init/UserRoleByTenantData.sql b/src/Ubik.Security.Api/Data/Init/UserRoleByTenantData.sql index 43e9d35f..051468ea 100644 --- a/src/Ubik.Security.Api/Data/Init/UserRoleByTenantData.sql +++ b/src/Ubik.Security.Api/Data/Init/UserRoleByTenantData.sql @@ -1,6 +1,6 @@ -INSERT INTO public.user_roles_by_tenants (id, user_tenant_id, role_id, version, created_at, created_by, modified_at, modified_by) VALUES ('14080000-5dd4-0015-fd97-08dce9cbfb4f', '94aa0000-088f-d0ad-2841-08dce944fbb7', '141a0000-3c36-7456-b223-08dce6346ddc', '14080000-5dd4-0015-fd97-08dce9cbfb4f', '2024-10-11 08:09:08.383338+00', 'c8660000-3c36-7456-580a-08dce562105f', '2024-10-11 08:09:08.383338+00', 'c8660000-3c36-7456-580a-08dce562105f'); -INSERT INTO public.user_roles_by_tenants (id, user_tenant_id, role_id, version, created_at, created_by, modified_at, modified_by) VALUES ('ec200000-088f-d0ad-1bc6-08dced1a7285', '543a0000-088f-d0ad-8702-08dced197e45', 'f47b0000-088f-d0ad-c1b9-08dced163f7e', 'ec200000-088f-d0ad-1bc6-08dced1a7285', '2024-10-11 08:09:08.383338+00', 'c8660000-3c36-7456-580a-08dce562105f', '2024-10-11 08:09:08.383338+00', 'c8660000-3c36-7456-580a-08dce562105f'); -INSERT INTO public.user_roles_by_tenants (id, user_tenant_id, role_id, version, created_at, created_by, modified_at, modified_by) VALUES ('08f1cf69-3eff-47b6-a874-fa0b68561ec0', '94aa0000-088f-d0ad-2841-08dce944fbb7', '181a0000-088f-d0ad-5f22-08dcee8ac275', '204c0000-3c36-7456-5416-08dcef3fa1c3', '2024-10-18 06:39:35.567303+00', 'c8660000-3c36-7456-580a-08dce562105f', '2024-10-18 06:39:35.567303+00', 'c8660000-3c36-7456-580a-08dce562105f'); -INSERT INTO public.user_roles_by_tenants (id, user_tenant_id, role_id, version, created_at, created_by, modified_at, modified_by) VALUES ('c4a2deae-2b21-4c6b-aad7-dc41db333fcb', '543a0000-088f-d0ad-8702-08dced197e45', '181a0000-088f-d0ad-c555-08dcee8ac9fd', '204c0000-3c36-7456-b188-08dcef3fb593', '2024-10-18 06:40:08.810075+00', 'c8660000-3c36-7456-580a-08dce562105f', '2024-10-18 06:40:08.810075+00', 'c8660000-3c36-7456-580a-08dce562105f'); -INSERT INTO public.user_roles_by_tenants (id, user_tenant_id, role_id, version, created_at, created_by, modified_at, modified_by) VALUES ('ac8f0000-3c36-7456-5345-08dcef7d5646', 'ac8f0000-3c36-7456-983e-08dcef7d4bae', '141a0000-3c36-7456-b223-08dce6346ddc', 'ac8f0000-3c36-7456-5345-08dcef7d5646', '2024-10-18 06:40:08.810075+00', 'c8660000-3c36-7456-580a-08dce562105f', '2024-10-18 06:40:08.810075+00', 'c8660000-3c36-7456-580a-08dce562105f'); -INSERT INTO public.user_roles_by_tenants (id, user_tenant_id, role_id, version, created_at, created_by, modified_at, modified_by) VALUES ('ac8f0000-3c36-7456-a8d6-08dcef7d62ac', 'ac8f0000-3c36-7456-983e-08dcef7d4bae', '181a0000-088f-d0ad-5f22-08dcee8ac275', 'ac8f0000-3c36-7456-a8d6-08dcef7d62ac', '2024-10-18 06:40:08.810075+00', 'c8660000-3c36-7456-580a-08dce562105f', '2024-10-18 06:40:08.810075+00', 'c8660000-3c36-7456-580a-08dce562105f'); +INSERT INTO public.users_roles_by_tenant (id, user_tenant_id, role_id, version, created_at, created_by, modified_at, modified_by) VALUES ('14080000-5dd4-0015-fd97-08dce9cbfb4f', '94aa0000-088f-d0ad-2841-08dce944fbb7', '141a0000-3c36-7456-b223-08dce6346ddc', '14080000-5dd4-0015-fd97-08dce9cbfb4f', '2024-10-11 08:09:08.383338+00', 'c8660000-3c36-7456-580a-08dce562105f', '2024-10-11 08:09:08.383338+00', 'c8660000-3c36-7456-580a-08dce562105f'); +INSERT INTO public.users_roles_by_tenant (id, user_tenant_id, role_id, version, created_at, created_by, modified_at, modified_by) VALUES ('ec200000-088f-d0ad-1bc6-08dced1a7285', '543a0000-088f-d0ad-8702-08dced197e45', 'f47b0000-088f-d0ad-c1b9-08dced163f7e', 'ec200000-088f-d0ad-1bc6-08dced1a7285', '2024-10-11 08:09:08.383338+00', 'c8660000-3c36-7456-580a-08dce562105f', '2024-10-11 08:09:08.383338+00', 'c8660000-3c36-7456-580a-08dce562105f'); +INSERT INTO public.users_roles_by_tenant (id, user_tenant_id, role_id, version, created_at, created_by, modified_at, modified_by) VALUES ('08f1cf69-3eff-47b6-a874-fa0b68561ec0', '94aa0000-088f-d0ad-2841-08dce944fbb7', '181a0000-088f-d0ad-5f22-08dcee8ac275', '204c0000-3c36-7456-5416-08dcef3fa1c3', '2024-10-18 06:39:35.567303+00', 'c8660000-3c36-7456-580a-08dce562105f', '2024-10-18 06:39:35.567303+00', 'c8660000-3c36-7456-580a-08dce562105f'); +INSERT INTO public.users_roles_by_tenant (id, user_tenant_id, role_id, version, created_at, created_by, modified_at, modified_by) VALUES ('c4a2deae-2b21-4c6b-aad7-dc41db333fcb', '543a0000-088f-d0ad-8702-08dced197e45', '181a0000-088f-d0ad-c555-08dcee8ac9fd', '204c0000-3c36-7456-b188-08dcef3fb593', '2024-10-18 06:40:08.810075+00', 'c8660000-3c36-7456-580a-08dce562105f', '2024-10-18 06:40:08.810075+00', 'c8660000-3c36-7456-580a-08dce562105f'); +INSERT INTO public.users_roles_by_tenant (id, user_tenant_id, role_id, version, created_at, created_by, modified_at, modified_by) VALUES ('ac8f0000-3c36-7456-5345-08dcef7d5646', 'ac8f0000-3c36-7456-983e-08dcef7d4bae', '141a0000-3c36-7456-b223-08dce6346ddc', 'ac8f0000-3c36-7456-5345-08dcef7d5646', '2024-10-18 06:40:08.810075+00', 'c8660000-3c36-7456-580a-08dce562105f', '2024-10-18 06:40:08.810075+00', 'c8660000-3c36-7456-580a-08dce562105f'); +INSERT INTO public.users_roles_by_tenant (id, user_tenant_id, role_id, version, created_at, created_by, modified_at, modified_by) VALUES ('ac8f0000-3c36-7456-a8d6-08dcef7d62ac', 'ac8f0000-3c36-7456-983e-08dcef7d4bae', '181a0000-088f-d0ad-5f22-08dcee8ac275', 'ac8f0000-3c36-7456-a8d6-08dcef7d62ac', '2024-10-18 06:40:08.810075+00', 'c8660000-3c36-7456-580a-08dce562105f', '2024-10-18 06:40:08.810075+00', 'c8660000-3c36-7456-580a-08dce562105f'); diff --git a/src/Ubik.Security.Api/Features/Users/Services/UsersQueriesService.cs b/src/Ubik.Security.Api/Features/Users/Services/UsersQueriesService.cs index 0fedfb34..8af94602 100644 --- a/src/Ubik.Security.Api/Features/Users/Services/UsersQueriesService.cs +++ b/src/Ubik.Security.Api/Features/Users/Services/UsersQueriesService.cs @@ -92,7 +92,7 @@ public async Task>> GetUserRol """ SELECT r.* FROM roles r - INNER JOIN user_roles_by_tenants urt ON urt.role_id = r.id + INNER JOIN users_roles_by_tenant urt ON urt.role_id = r.id INNER JOIN users_tenants ut ON ut.id = urt.user_tenant_id WHERE ut.user_id = @user_id AND ut.tenant_id = @tenant_id @@ -120,7 +120,7 @@ private async Task> GetRoleForUserAsync(Gu """ SELECT r.* FROM roles r - INNER JOIN user_roles_by_tenants urt ON urt.role_id = r.id + INNER JOIN users_roles_by_tenant urt ON urt.role_id = r.id INNER JOIN users_tenants ut ON ut.id = urt.user_tenant_id WHERE ut.user_id = @user_id AND ut.tenant_id = @tenant_id @@ -146,7 +146,7 @@ private async Task>> GetAllAu SELECT DISTINCT ut.tenant_id, a.* FROM users u INNER JOIN users_tenants ut ON ut.user_id = u.id - INNER JOIN user_roles_by_tenants urt ON urt.user_tenant_id = ut.id + INNER JOIN users_roles_by_tenant urt ON urt.user_tenant_id = ut.id INNER JOIN roles_authorizations ra ON ra.role_id = urt.role_id INNER JOIN authorizations a ON a.id = ra.authorization_id WHERE u.id = @userid From cedd489add44f13ad7e6c156c523545199aec06c Mon Sep 17 00:00:00 2001 From: ubik Date: Fri, 1 Nov 2024 10:33:00 +0100 Subject: [PATCH 14/94] Put in place vatsales tax api --- .../Data/AccountingSalesTaxDbContext.cs | 73 +++++++++ .../Config/SalesOrVatRateConfiguration.cs} | 8 +- .../Services/ITaxRateCommandService.cs | 14 ++ .../TaxRates/Services/ITaxRateQueryService.cs | 12 ++ .../Services/TaxRateCommandService.cs} | 61 ++++---- .../TaxRates/Services/TaxRateQueryService.cs | 27 ++++ .../Mappers/TaxRateMappers.cs} | 38 ++--- .../Models/TaxRate.cs} | 4 +- .../Program.cs | 141 ++++++++++++++++- .../Ubik.Accounting.SalesOrVatTax.Api.csproj | 28 +++- .../appsettings.json | 20 +++ .../Commands/AddSalesOrVatTaxRateCommand.cs} | 4 +- .../UpdateSalesOrVatTaxRateCommand.cs} | 4 +- .../Events/SalesOrVatTaxRateAdded.cs} | 4 +- .../Events/SalesOrVatTaxRateDeleted.cs} | 4 +- .../Events/SalesOrVatTaxRateUpdated.cs} | 4 +- .../SalesOrVatTaxRateStandardResult.cs} | 4 +- ....Accounting.SalesOrVatTax.Contracts.csproj | 9 ++ .../Data/AccountingDbContext.cs | 21 +-- .../Config/AccountVatConfigConfiguration.cs | 80 +++++----- .../Data/Config/EntryConfiguration.cs | 146 +++++++++--------- .../Services/AccountCommandService.cs | 15 +- .../Services/IVatRateCommandService.cs | 14 -- .../VatRates/Services/IVatRateQueryService.cs | 12 -- .../VatRates/Services/VatRateQueryService.cs | 27 ---- .../Models/AccountVatConfig.cs | 32 ++-- .../Models/Entry.cs | 76 ++++----- src/Ubik.Accounting.Structure.Api/Program.cs | 2 +- src/Ubik.CodeGenerator/MappersGenerator.cs | 3 +- src/Ubik.CodeGenerator/Program.cs | 7 +- .../Ubik.CodeGenerator.csproj | 1 + src/Ubik.Security.Api/Program.cs | 6 +- src/Ubik.sln | 6 + .../Ubik.Api.Tests.Integration.csproj | 2 +- 34 files changed, 586 insertions(+), 323 deletions(-) create mode 100644 src/Ubik.Accounting.SalesOrVatTax.Api/Data/AccountingSalesTaxDbContext.cs rename src/{Ubik.Accounting.Structure.Api/Data/Config/VatRateConfiguration.cs => Ubik.Accounting.SalesOrVatTax.Api/Data/Config/SalesOrVatRateConfiguration.cs} (79%) create mode 100644 src/Ubik.Accounting.SalesOrVatTax.Api/Features/TaxRates/Services/ITaxRateCommandService.cs create mode 100644 src/Ubik.Accounting.SalesOrVatTax.Api/Features/TaxRates/Services/ITaxRateQueryService.cs rename src/{Ubik.Accounting.Structure.Api/Features/VatRates/Services/VatRateCommandService.cs => Ubik.Accounting.SalesOrVatTax.Api/Features/TaxRates/Services/TaxRateCommandService.cs} (51%) create mode 100644 src/Ubik.Accounting.SalesOrVatTax.Api/Features/TaxRates/Services/TaxRateQueryService.cs rename src/{Ubik.Accounting.Structure.Api/Mappers/VatRateMappers.cs => Ubik.Accounting.SalesOrVatTax.Api/Mappers/TaxRateMappers.cs} (63%) rename src/{Ubik.Accounting.Structure.Api/Models/VatRate.cs => Ubik.Accounting.SalesOrVatTax.Api/Models/TaxRate.cs} (84%) rename src/{Ubik.Accounting.Structure.Contracts/VatRate/Commands/AddVatRateCommand.cs => Ubik.Accounting.SalesOrVatTax.Contracts/SalesOrVatTaxRate/Commands/AddSalesOrVatTaxRateCommand.cs} (82%) rename src/{Ubik.Accounting.Structure.Contracts/VatRate/Commands/UpdateVatRateCommand.cs => Ubik.Accounting.SalesOrVatTax.Contracts/SalesOrVatTaxRate/Commands/UpdateSalesOrVatTaxRateCommand.cs} (84%) rename src/{Ubik.Accounting.Structure.Contracts/VatRate/Results/VatRateStandardResult.cs => Ubik.Accounting.SalesOrVatTax.Contracts/SalesOrVatTaxRate/Events/SalesOrVatTaxRateAdded.cs} (81%) rename src/{Ubik.Accounting.Structure.Contracts/VatRate/Events/VatRateDeleted.cs => Ubik.Accounting.SalesOrVatTax.Contracts/SalesOrVatTaxRate/Events/SalesOrVatTaxRateDeleted.cs} (61%) rename src/{Ubik.Accounting.Structure.Contracts/VatRate/Events/VatRateAdded.cs => Ubik.Accounting.SalesOrVatTax.Contracts/SalesOrVatTaxRate/Events/SalesOrVatTaxRateUpdated.cs} (80%) rename src/{Ubik.Accounting.Structure.Contracts/VatRate/Events/VatRateUpdated.cs => Ubik.Accounting.SalesOrVatTax.Contracts/SalesOrVatTaxRate/Results/SalesOrVatTaxRateStandardResult.cs} (79%) create mode 100644 src/Ubik.Accounting.SalesOrVatTax.Contracts/Ubik.Accounting.SalesOrVatTax.Contracts.csproj delete mode 100644 src/Ubik.Accounting.Structure.Api/Features/VatRates/Services/IVatRateCommandService.cs delete mode 100644 src/Ubik.Accounting.Structure.Api/Features/VatRates/Services/IVatRateQueryService.cs delete mode 100644 src/Ubik.Accounting.Structure.Api/Features/VatRates/Services/VatRateQueryService.cs diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Data/AccountingSalesTaxDbContext.cs b/src/Ubik.Accounting.SalesOrVatTax.Api/Data/AccountingSalesTaxDbContext.cs new file mode 100644 index 00000000..e5a1dd43 --- /dev/null +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Data/AccountingSalesTaxDbContext.cs @@ -0,0 +1,73 @@ +using MassTransit; +using Microsoft.EntityFrameworkCore; +using Ubik.Accounting.SalesOrVatTax.Api.Data.Config; +using Ubik.Accounting.SalesOrVatTax.Api.Models; +using Ubik.ApiService.Common.Errors; +using Ubik.ApiService.Common.Exceptions; +using Ubik.ApiService.Common.Services; +using Ubik.DB.Common.Extensions; + +namespace Ubik.Accounting.SalesOrVatTax.Api.Data +{ + public class AccountingSalesTaxDbContext(DbContextOptions options + , ICurrentUser currentUser) : DbContext(options) + { + public DbSet SalesOrVatTaxRates { get; set; } + + protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) + { + optionsBuilder + .UseQueryTrackingBehavior(QueryTrackingBehavior.NoTracking) + .UseSnakeCaseNamingConvention(); + } + public override async Task SaveChangesAsync(CancellationToken cancellationToken = default) + { + try + { + return await base.SaveChangesAsync(cancellationToken); + } + catch (DbUpdateConcurrencyException) + { + var err = new CustomError() + { + ErrorCode = "DB_CONCURRENCY_CONFLICT", + ErrorFriendlyMessage = "You don't have the last version or the ressource, refresh your data before updating.", + ErrorValueDetails = "Version", + }; + var conflict = new UpdateDbConcurrencyException() + { + CustomErrors = [err] + }; + + throw conflict; + } + } + + public void SetAuditAndSpecialFields() + { + ChangeTracker.SetSpecialFields(currentUser); + } + protected override void OnModelCreating(ModelBuilder modelBuilder) + { + //Build for Masstransit inbox/outbox + modelBuilder.AddInboxStateEntity(); + modelBuilder.AddOutboxMessageEntity(); + modelBuilder.AddOutboxStateEntity(); + + //TenantId + SetTenantId(modelBuilder); + + //Configure + new TaxRateConfiguration().Configure(modelBuilder.Entity()); + + + base.OnModelCreating(modelBuilder); + } + + private void SetTenantId(ModelBuilder modelBuilder) + { + modelBuilder.Entity() + .HasQueryFilter(mt => mt.TenantId == currentUser.TenantId); + } + } +} diff --git a/src/Ubik.Accounting.Structure.Api/Data/Config/VatRateConfiguration.cs b/src/Ubik.Accounting.SalesOrVatTax.Api/Data/Config/SalesOrVatRateConfiguration.cs similarity index 79% rename from src/Ubik.Accounting.Structure.Api/Data/Config/VatRateConfiguration.cs rename to src/Ubik.Accounting.SalesOrVatTax.Api/Data/Config/SalesOrVatRateConfiguration.cs index cf0b9e32..9cd64390 100644 --- a/src/Ubik.Accounting.Structure.Api/Data/Config/VatRateConfiguration.cs +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Data/Config/SalesOrVatRateConfiguration.cs @@ -1,12 +1,12 @@ using Microsoft.EntityFrameworkCore.Metadata.Builders; using Microsoft.EntityFrameworkCore; -using Ubik.Accounting.Structure.Api.Models; +using Ubik.Accounting.SalesOrVatTax.Api.Models; -namespace Ubik.Accounting.Structure.Api.Data.Config +namespace Ubik.Accounting.SalesOrVatTax.Api.Data.Config { - public class VatRateConfiguration : IEntityTypeConfiguration + public class TaxRateConfiguration : IEntityTypeConfiguration { - public void Configure(EntityTypeBuilder builder) + public void Configure(EntityTypeBuilder builder) { builder.Property(a => a.Code) .HasMaxLength(20) diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Features/TaxRates/Services/ITaxRateCommandService.cs b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/TaxRates/Services/ITaxRateCommandService.cs new file mode 100644 index 00000000..fcc4c0af --- /dev/null +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/TaxRates/Services/ITaxRateCommandService.cs @@ -0,0 +1,14 @@ +using LanguageExt; +using Ubik.Accounting.SalesOrVatTax.Api.Models; +using Ubik.Accounting.SalesOrVatTax.Contracts.VatRate.Commands; +using Ubik.ApiService.Common.Errors; + +namespace Ubik.Accounting.SalesOrVatTax.Api.Features.TaxRates.Services +{ + public interface ITaxRateCommandService + { + public Task> AddAsync(AddSalesOrVatTaxRateCommand command); + public Task> UpdateAsync(UpdateSalesOrVatTaxRateCommand command); + public Task> DeleteAsync(Guid id); + } +} diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Features/TaxRates/Services/ITaxRateQueryService.cs b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/TaxRates/Services/ITaxRateQueryService.cs new file mode 100644 index 00000000..449ceb21 --- /dev/null +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/TaxRates/Services/ITaxRateQueryService.cs @@ -0,0 +1,12 @@ +using LanguageExt; +using Ubik.Accounting.SalesOrVatTax.Api.Models; +using Ubik.ApiService.Common.Errors; + +namespace Ubik.Accounting.SalesOrVatTax.Api.Features.TaxRates.Services +{ + public interface ITaxRateQueryService + { + Task> GetAsync(Guid id); + Task> GetAllAsync(); + } +} diff --git a/src/Ubik.Accounting.Structure.Api/Features/VatRates/Services/VatRateCommandService.cs b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/TaxRates/Services/TaxRateCommandService.cs similarity index 51% rename from src/Ubik.Accounting.Structure.Api/Features/VatRates/Services/VatRateCommandService.cs rename to src/Ubik.Accounting.SalesOrVatTax.Api/Features/TaxRates/Services/TaxRateCommandService.cs index e3690c49..683736c4 100644 --- a/src/Ubik.Accounting.Structure.Api/Features/VatRates/Services/VatRateCommandService.cs +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/TaxRates/Services/TaxRateCommandService.cs @@ -1,29 +1,28 @@ using LanguageExt; -using MassTransit.Transports; using MassTransit; using Microsoft.EntityFrameworkCore; -using Ubik.Accounting.Structure.Api.Data; -using Ubik.Accounting.Structure.Api.Models; -using Ubik.Accounting.Structure.Contracts.VatRate.Commands; -using Ubik.Accounting.Structure.Contracts.VatRate.Events; using Ubik.ApiService.Common.Errors; using Ubik.ApiService.Common.Exceptions; -using Ubik.Accounting.Structure.Api.Mappers; +using Ubik.Accounting.SalesOrVatTax.Api.Data; +using Ubik.Accounting.SalesOrVatTax.Api.Models; +using Ubik.Accounting.SalesOrVatTax.Contracts.VatRate.Events; +using Ubik.Accounting.SalesOrVatTax.Contracts.VatRate.Commands; +using Ubik.Accounting.SalesOrVatTax.Api.Mappers; -namespace Ubik.Accounting.Structure.Api.Features.VatRates.Services +namespace Ubik.Accounting.SalesOrVatTax.Api.Features.TaxRates.Services { - public class VatRateCommandService(AccountingDbContext ctx, IPublishEndpoint publishEndpoint) : IVatRateCommandService + public class TaxRateCommandService(AccountingSalesTaxDbContext ctx, IPublishEndpoint publishEndpoint) : ITaxRateCommandService { - public async Task> AddAsync(AddVatRateCommand command) + public async Task> AddAsync(AddSalesOrVatTaxRateCommand command) { - return await ValidateIfNotAlreadyExistsAsync(command.ToVatRate()) + return await ValidateIfNotAlreadyExistsAsync(command.ToSalesOrVatTaxRate()) .BindAsync(AddInDbContextAsync) .BindAsync(AddSaveAndPublishAsync); } - public async Task> UpdateAsync(UpdateVatRateCommand command) + public async Task> UpdateAsync(UpdateSalesOrVatTaxRateCommand command) { - var model = command.ToVatRate(); + var model = command.ToSalesOrVatTaxRate(); return await GetAsync(model.Id) .BindAsync(x => MapInDbContextAsync(x, model)) @@ -40,15 +39,15 @@ public async Task> DeleteAsync(Guid id) .BindAsync(DeletedSaveAndPublishAsync); } - private async Task> DeletedSaveAndPublishAsync(VatRate current) + private async Task> DeletedSaveAndPublishAsync(TaxRate current) { - await publishEndpoint.Publish(new VatRateDeleted { Id = current.Id }, CancellationToken.None); + await publishEndpoint.Publish(new SalesOrVatTaxRateDeleted { Id = current.Id }, CancellationToken.None); await ctx.SaveChangesAsync(); return true; } - private async Task> DeleteInDbContextAsync(VatRate current) + private async Task> DeleteInDbContextAsync(TaxRate current) { ctx.Entry(current).State = EntityState.Deleted; @@ -56,11 +55,11 @@ private async Task> DeleteInDbContextAs return current; } - private async Task> UpdateSaveAndPublishAsync(VatRate current) + private async Task> UpdateSaveAndPublishAsync(TaxRate current) { try { - await publishEndpoint.Publish(current.ToVatRateUpdated(), CancellationToken.None); + await publishEndpoint.Publish(current.ToSalesOrVatTaxRateUpdated(), CancellationToken.None); await ctx.SaveChangesAsync(); return current; @@ -71,16 +70,16 @@ private async Task> UpdateSaveAndPublis } } - private async Task> GetAsync(Guid id) + private async Task> GetAsync(Guid id) { - var result = await ctx.VatRates.FindAsync(id); + var result = await ctx.SalesOrVatTaxRates.FindAsync(id); return result == null ? new ResourceNotFoundError("VatRate", "Id", id.ToString()) : result; } - private async Task> UpdateInDbContextAsync(VatRate current) + private async Task> UpdateInDbContextAsync(TaxRate current) { ctx.Entry(current).State = EntityState.Modified; ctx.SetAuditAndSpecialFields(); @@ -89,41 +88,41 @@ private async Task> UpdateInDbContextAs return current; } - private async Task> ValidateIfNotAlreadyExistsWithOtherIdAsync(VatRate current) + private async Task> ValidateIfNotAlreadyExistsWithOtherIdAsync(TaxRate current) { - var exists = await ctx.VatRates.AnyAsync(a => a.Code == current.Code && a.Id != current.Id); + var exists = await ctx.SalesOrVatTaxRates.AnyAsync(a => a.Code == current.Code && a.Id != current.Id); return exists ? new ResourceAlreadyExistsError("VatRate", "Code", current.Code) : current; } - private static async Task> MapInDbContextAsync - (VatRate current, VatRate forUpdate) + private static async Task> MapInDbContextAsync + (TaxRate current, TaxRate forUpdate) { - current = forUpdate.ToVatRate(current); + current = forUpdate.ToSalesOrVatTaxRate(current); await Task.CompletedTask; return current; } - private async Task> AddSaveAndPublishAsync(VatRate current) + private async Task> AddSaveAndPublishAsync(TaxRate current) { - await publishEndpoint.Publish(current.ToVatRateAdded(), CancellationToken.None); + await publishEndpoint.Publish(current.ToSalesOrVatTaxRateAdded(), CancellationToken.None); await ctx.SaveChangesAsync(); return current; } - private async Task> AddInDbContextAsync(VatRate current) + private async Task> AddInDbContextAsync(TaxRate current) { current.Id = NewId.NextGuid(); - await ctx.VatRates.AddAsync(current); + await ctx.SalesOrVatTaxRates.AddAsync(current); ctx.SetAuditAndSpecialFields(); return current; } - private async Task> ValidateIfNotAlreadyExistsAsync(VatRate current) + private async Task> ValidateIfNotAlreadyExistsAsync(TaxRate current) { - var exists = await ctx.VatRates.AnyAsync(a => a.Code == current.Code); + var exists = await ctx.SalesOrVatTaxRates.AnyAsync(a => a.Code == current.Code); return exists ? new ResourceAlreadyExistsError("VatRate", "Code", current.Code) : current; diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Features/TaxRates/Services/TaxRateQueryService.cs b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/TaxRates/Services/TaxRateQueryService.cs new file mode 100644 index 00000000..8b375aeb --- /dev/null +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/TaxRates/Services/TaxRateQueryService.cs @@ -0,0 +1,27 @@ +using LanguageExt; +using Microsoft.EntityFrameworkCore; +using Ubik.Accounting.SalesOrVatTax.Api.Data; +using Ubik.Accounting.SalesOrVatTax.Api.Models; +using Ubik.ApiService.Common.Errors; + +namespace Ubik.Accounting.SalesOrVatTax.Api.Features.TaxRates.Services +{ + public class TaxRateQueryService(AccountingSalesTaxDbContext ctx) : ITaxRateQueryService + { + public async Task> GetAllAsync() + { + var result = await ctx.SalesOrVatTaxRates.ToListAsync(); + + return result; + } + + public async Task> GetAsync(Guid id) + { + var result = await ctx.SalesOrVatTaxRates.FindAsync(id); + + return result == null + ? new ResourceNotFoundError("VatRate", "Id", id.ToString()) + : result; + } + } +} diff --git a/src/Ubik.Accounting.Structure.Api/Mappers/VatRateMappers.cs b/src/Ubik.Accounting.SalesOrVatTax.Api/Mappers/TaxRateMappers.cs similarity index 63% rename from src/Ubik.Accounting.Structure.Api/Mappers/VatRateMappers.cs rename to src/Ubik.Accounting.SalesOrVatTax.Api/Mappers/TaxRateMappers.cs index 84e595a7..c22373db 100644 --- a/src/Ubik.Accounting.Structure.Api/Mappers/VatRateMappers.cs +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Mappers/TaxRateMappers.cs @@ -1,15 +1,15 @@ -using Ubik.Accounting.Structure.Api.Models; -using Ubik.Accounting.Structure.Contracts.VatRate.Commands; -using Ubik.Accounting.Structure.Contracts.VatRate.Events; -using Ubik.Accounting.Structure.Contracts.VatRate.Results; +using Ubik.Accounting.SalesOrVatTax.Api.Models; +using Ubik.Accounting.SalesOrVatTax.Contracts.VatRate.Commands; +using Ubik.Accounting.SalesOrVatTax.Contracts.VatRate.Events; +using Ubik.Accounting.SalesOrVatTax.Contracts.VatRate.Results; -namespace Ubik.Accounting.Structure.Api.Mappers +namespace Ubik.Accounting.SalesOrVatTax.Api.Mappers { - public static class VatRateMappers + public static class TaxRateMappers { - public static IEnumerable ToVatRateStandardResults(this IEnumerable current) + public static IEnumerable ToSalesOrVatTaxRateStandardResults(this IEnumerable current) { - return current.Select(x => new VatRateStandardResult() + return current.Select(x => new SalesOrVatTaxRateStandardResult() { Id = x.Id, ValidFrom = x.ValidFrom, @@ -21,9 +21,9 @@ public static IEnumerable ToVatRateStandardResults(this I }); } - public static VatRate ToVatRate(this AddVatRateCommand current) + public static TaxRate ToSalesOrVatTaxRate(this AddSalesOrVatTaxRateCommand current) { - return new VatRate + return new TaxRate { ValidFrom = current.ValidFrom, ValidTo = current.ValidTo, @@ -33,9 +33,9 @@ public static VatRate ToVatRate(this AddVatRateCommand current) }; } - public static VatRate ToVatRate(this UpdateVatRateCommand current) + public static TaxRate ToSalesOrVatTaxRate(this UpdateSalesOrVatTaxRateCommand current) { - return new VatRate + return new TaxRate { Id = current.Id, ValidFrom = current.ValidFrom, @@ -47,9 +47,9 @@ public static VatRate ToVatRate(this UpdateVatRateCommand current) }; } - public static VatRateAdded ToVatRateAdded(this VatRate current) + public static SalesOrVatTaxRateAdded ToSalesOrVatTaxRateAdded(this TaxRate current) { - return new VatRateAdded() + return new SalesOrVatTaxRateAdded() { Id = current.Id, ValidFrom = current.ValidFrom, @@ -61,9 +61,9 @@ public static VatRateAdded ToVatRateAdded(this VatRate current) }; } - public static VatRateUpdated ToVatRateUpdated(this VatRate current) + public static SalesOrVatTaxRateUpdated ToSalesOrVatTaxRateUpdated(this TaxRate current) { - return new VatRateUpdated() + return new SalesOrVatTaxRateUpdated() { Id = current.Id, ValidFrom = current.ValidFrom, @@ -75,7 +75,7 @@ public static VatRateUpdated ToVatRateUpdated(this VatRate current) }; } - public static VatRate ToVatRate(this VatRate forUpd, VatRate model) + public static TaxRate ToSalesOrVatTaxRate(this TaxRate forUpd, TaxRate model) { model.Id = forUpd.Id; model.ValidFrom = forUpd.ValidFrom; @@ -88,9 +88,9 @@ public static VatRate ToVatRate(this VatRate forUpd, VatRate model) return model; } - public static VatRateStandardResult ToVatRateStandardResult(this VatRate current) + public static SalesOrVatTaxRateStandardResult ToSalesOrVatTaxRateStandardResult(this TaxRate current) { - return new VatRateStandardResult() + return new SalesOrVatTaxRateStandardResult() { Id = current.Id, ValidFrom = current.ValidFrom, diff --git a/src/Ubik.Accounting.Structure.Api/Models/VatRate.cs b/src/Ubik.Accounting.SalesOrVatTax.Api/Models/TaxRate.cs similarity index 84% rename from src/Ubik.Accounting.Structure.Api/Models/VatRate.cs rename to src/Ubik.Accounting.SalesOrVatTax.Api/Models/TaxRate.cs index f926b3a8..72591962 100644 --- a/src/Ubik.Accounting.Structure.Api/Models/VatRate.cs +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Models/TaxRate.cs @@ -1,8 +1,8 @@ using Ubik.DB.Common; -namespace Ubik.Accounting.Structure.Api.Models +namespace Ubik.Accounting.SalesOrVatTax.Api.Models { - public class VatRate : ITenantEntity, IConcurrencyCheckEntity, IAuditEntity + public class TaxRate : ITenantEntity, IConcurrencyCheckEntity, IAuditEntity { public Guid Id { get; set; } public DateTime ValidFrom { get; set; } diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Program.cs b/src/Ubik.Accounting.SalesOrVatTax.Api/Program.cs index 48863a6d..f354283b 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Api/Program.cs +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Program.cs @@ -1,6 +1,115 @@ +using MassTransit; +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc.Infrastructure; +using Microsoft.EntityFrameworkCore; +using System.Reflection; +using System.Text.Json.Serialization; +using Ubik.Accounting.SalesOrVatTax.Api.Data; +using Ubik.ApiService.Common.Configure; +using Ubik.ApiService.Common.Configure.Options; +using Ubik.ApiService.Common.Exceptions; +using Ubik.ApiService.Common.Filters; +using Ubik.ApiService.Common.Middlewares; +using Ubik.ApiService.Common.Services; + var builder = WebApplication.CreateBuilder(args); -// Add services to the container. +//Options +var authOptions = new AuthServerOptions(); +builder.Configuration.GetSection(AuthServerOptions.Position).Bind(authOptions); +var msgBrokerOptions = new MessageBrokerOptions(); +builder.Configuration.GetSection(MessageBrokerOptions.Position).Bind(msgBrokerOptions); +var swaggerUIOptions = new SwaggerUIOptions(); +builder.Configuration.GetSection(SwaggerUIOptions.Position).Bind(swaggerUIOptions); + +//Default httpclient +builder.Services.ConfigureHttpClientDefaults(http => +{ + http.AddStandardResilienceHandler(); +}); + +builder.Services.AddDbContextFactory( + options => options.UseNpgsql(builder.Configuration.GetConnectionString("AccountingSalesTaxDbContext")), ServiceLifetime.Scoped); + +Dapper.DefaultTypeMap.MatchNamesWithUnderscores = true; + +//TODO: remove useless parts (only pub/sub) +//MessageBroker with masstransit + outbox +builder.Services.AddMassTransit(config => +{ + config.SetEndpointNameFormatter(new KebabCaseEndpointNameFormatter(prefix: "AccountingSalesOrVatTaxApi", includeNamespace: false)); + config.UsingRabbitMq((context, configurator) => + { + configurator.Host(new Uri(msgBrokerOptions.Host), h => + { + h.Username(msgBrokerOptions.User); + h.Password(msgBrokerOptions.Password); + }); + + configurator.ConfigureEndpoints(context); + + //TODO:review that + //Use to pass tenantid when message broker is used to contact the api (async) + //configurator.UseSendFilter(typeof(TenantIdSendFilter<>), context); + configurator.UsePublishFilter(typeof(TenantIdPublishFilter<>), context); + //configurator.UseConsumeFilter(typeof(TenantIdConsumeFilter<>), context); + }); + + config.AddEntityFrameworkOutbox(o => + { + o.UsePostgres(); + o.UseBusOutbox(); + }); + + //Add all consumers + //config.AddConsumers(Assembly.GetExecutingAssembly()); + + //Add commands clients + +}); + +//Api versioning +builder.Services.AddApiVersionAndExplorer(); + +//TODO: Cors +builder.Services.AddCustomCors(); + +//Tracing and metrics +builder.Logging.AddOpenTelemetry(logging => +{ + logging.IncludeFormattedMessage = true; + logging.IncludeScopes = true; +}); + +builder.Services.AddTracingAndMetrics(); + +//Swagger config +var xmlPath = Path.Combine(AppContext.BaseDirectory, + $"{Assembly.GetExecutingAssembly().GetName().Name}.xml"); + +builder.Services.AddSwaggerGenWithAuth(authOptions, xmlPath); + +//Services +builder.Services.AddScoped(); +builder.Services.AddTransient(); + + +//Strandard API things +builder.Services.AddControllers(o => +{ + o.Filters.Add(new ProducesAttribute("application/json")); +}).AddJsonOptions(options => + options.JsonSerializerOptions.Converters.Add(new JsonStringEnumConverter())); + +builder.Services.AddHttpContextAccessor(); +builder.Services.AddEndpointsApiExplorer(); + +//Route config +builder.Services.Configure(options => +{ + options.LowercaseUrls = true; +}); builder.Services.AddControllers(); // Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle @@ -9,16 +118,40 @@ var app = builder.Build(); +app.UseExceptionHandler(app.Logger, app.Environment); + // Configure the HTTP request pipeline. if (app.Environment.IsDevelopment()) { app.UseSwagger(); - app.UseSwaggerUI(); + app.UseSwaggerUIWithAuth(swaggerUIOptions); + + //DB Init on DEV + using var scope = app.Services.CreateScope(); + var services = scope.ServiceProvider; + + var context = services.GetRequiredService(); + context.Database.EnsureDeleted(); + context.Database.EnsureCreated(); + + //await DbInitializer.InitializeAsync(context); } -app.UseHttpsRedirection(); +app.UseWhen( + httpContext => httpContext.Request.Path.StartsWithSegments("/admin"), + subApp => subApp.UseMiddleware() +); + +app.UseWhen( + httpContext => !httpContext.Request.Path.StartsWithSegments("/admin") + && !httpContext.Request.Path.StartsWithSegments("/swagger"), + + subApp => subApp.UseMiddleware() +); + +//app.UseHttpsRedirection(); -app.UseAuthorization(); +//app.UseAuthorization(); app.MapControllers(); diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Ubik.Accounting.SalesOrVatTax.Api.csproj b/src/Ubik.Accounting.SalesOrVatTax.Api/Ubik.Accounting.SalesOrVatTax.Api.csproj index d65b61b6..846f17e3 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Api/Ubik.Accounting.SalesOrVatTax.Api.csproj +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Ubik.Accounting.SalesOrVatTax.Api.csproj @@ -1,4 +1,4 @@ - + net8.0 @@ -8,9 +8,33 @@ Linux + + true + $(NoWarn);1591 + + + + + + + + - + + + + + + + + + + + + + + diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/appsettings.json b/src/Ubik.Accounting.SalesOrVatTax.Api/appsettings.json index 10f68b8c..5a408418 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Api/appsettings.json +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/appsettings.json @@ -5,5 +5,25 @@ "Microsoft.AspNetCore": "Warning" } }, + "AuthServer": { + "MetadataAddress": "http://localhost:8080/realms/ubik/.well-known/openid-configuration", + "Authority": "http://localhost:8080/realms/ubik", + "Audience": "account", + "RequireHttpsMetadata": false, + "AuthorizationUrl": "http://localhost:8080/realms/ubik/protocol/openid-connect/auth", + "TokenUrl": "http://localhost:8080/realms/ubik/protocol/openid-connect/token" + }, + "MessageBroker": { + "Host": "amqp://localhost:5672", + "User": "guest", + "Password": "guest" + }, + "ConnectionStrings": { + "AccountingSalesTaxDbContext": "Host=localhost;Port=5435;Database=ubik_accounting_salestax;Username=postgres;Password=test01" + }, + "SwaggerUI": { + "ClientId": "ubik_accounting_api", + "ClientSecret": "GQEyHjeBUThKta1eItucb5LFGj5Hduwd" + }, "AllowedHosts": "*" } diff --git a/src/Ubik.Accounting.Structure.Contracts/VatRate/Commands/AddVatRateCommand.cs b/src/Ubik.Accounting.SalesOrVatTax.Contracts/SalesOrVatTaxRate/Commands/AddSalesOrVatTaxRateCommand.cs similarity index 82% rename from src/Ubik.Accounting.Structure.Contracts/VatRate/Commands/AddVatRateCommand.cs rename to src/Ubik.Accounting.SalesOrVatTax.Contracts/SalesOrVatTaxRate/Commands/AddSalesOrVatTaxRateCommand.cs index 06306395..5bad46d4 100644 --- a/src/Ubik.Accounting.Structure.Contracts/VatRate/Commands/AddVatRateCommand.cs +++ b/src/Ubik.Accounting.SalesOrVatTax.Contracts/SalesOrVatTaxRate/Commands/AddSalesOrVatTaxRateCommand.cs @@ -5,9 +5,9 @@ using System.Text; using System.Threading.Tasks; -namespace Ubik.Accounting.Structure.Contracts.VatRate.Commands +namespace Ubik.Accounting.SalesOrVatTax.Contracts.VatRate.Commands { - public record AddVatRateCommand + public record AddSalesOrVatTaxRateCommand { [Required] public DateTime ValidFrom { get; init; } diff --git a/src/Ubik.Accounting.Structure.Contracts/VatRate/Commands/UpdateVatRateCommand.cs b/src/Ubik.Accounting.SalesOrVatTax.Contracts/SalesOrVatTaxRate/Commands/UpdateSalesOrVatTaxRateCommand.cs similarity index 84% rename from src/Ubik.Accounting.Structure.Contracts/VatRate/Commands/UpdateVatRateCommand.cs rename to src/Ubik.Accounting.SalesOrVatTax.Contracts/SalesOrVatTaxRate/Commands/UpdateSalesOrVatTaxRateCommand.cs index 24b6c212..841cd89b 100644 --- a/src/Ubik.Accounting.Structure.Contracts/VatRate/Commands/UpdateVatRateCommand.cs +++ b/src/Ubik.Accounting.SalesOrVatTax.Contracts/SalesOrVatTaxRate/Commands/UpdateSalesOrVatTaxRateCommand.cs @@ -5,9 +5,9 @@ using System.Text; using System.Threading.Tasks; -namespace Ubik.Accounting.Structure.Contracts.VatRate.Commands +namespace Ubik.Accounting.SalesOrVatTax.Contracts.VatRate.Commands { - public record UpdateVatRateCommand + public record UpdateSalesOrVatTaxRateCommand { [Required] public Guid Id { get; init; } diff --git a/src/Ubik.Accounting.Structure.Contracts/VatRate/Results/VatRateStandardResult.cs b/src/Ubik.Accounting.SalesOrVatTax.Contracts/SalesOrVatTaxRate/Events/SalesOrVatTaxRateAdded.cs similarity index 81% rename from src/Ubik.Accounting.Structure.Contracts/VatRate/Results/VatRateStandardResult.cs rename to src/Ubik.Accounting.SalesOrVatTax.Contracts/SalesOrVatTaxRate/Events/SalesOrVatTaxRateAdded.cs index 6b226bec..3778bb55 100644 --- a/src/Ubik.Accounting.Structure.Contracts/VatRate/Results/VatRateStandardResult.cs +++ b/src/Ubik.Accounting.SalesOrVatTax.Contracts/SalesOrVatTaxRate/Events/SalesOrVatTaxRateAdded.cs @@ -4,9 +4,9 @@ using System.Text; using System.Threading.Tasks; -namespace Ubik.Accounting.Structure.Contracts.VatRate.Results +namespace Ubik.Accounting.SalesOrVatTax.Contracts.VatRate.Events { - public record VatRateStandardResult + public record SalesOrVatTaxRateAdded { public Guid Id { get; init; } public DateTime ValidFrom { get; init; } diff --git a/src/Ubik.Accounting.Structure.Contracts/VatRate/Events/VatRateDeleted.cs b/src/Ubik.Accounting.SalesOrVatTax.Contracts/SalesOrVatTaxRate/Events/SalesOrVatTaxRateDeleted.cs similarity index 61% rename from src/Ubik.Accounting.Structure.Contracts/VatRate/Events/VatRateDeleted.cs rename to src/Ubik.Accounting.SalesOrVatTax.Contracts/SalesOrVatTaxRate/Events/SalesOrVatTaxRateDeleted.cs index 8c988b07..18eeca23 100644 --- a/src/Ubik.Accounting.Structure.Contracts/VatRate/Events/VatRateDeleted.cs +++ b/src/Ubik.Accounting.SalesOrVatTax.Contracts/SalesOrVatTaxRate/Events/SalesOrVatTaxRateDeleted.cs @@ -4,9 +4,9 @@ using System.Text; using System.Threading.Tasks; -namespace Ubik.Accounting.Structure.Contracts.VatRate.Events +namespace Ubik.Accounting.SalesOrVatTax.Contracts.VatRate.Events { - public record VatRateDeleted + public record SalesOrVatTaxRateDeleted { public Guid Id { get; init; } } diff --git a/src/Ubik.Accounting.Structure.Contracts/VatRate/Events/VatRateAdded.cs b/src/Ubik.Accounting.SalesOrVatTax.Contracts/SalesOrVatTaxRate/Events/SalesOrVatTaxRateUpdated.cs similarity index 80% rename from src/Ubik.Accounting.Structure.Contracts/VatRate/Events/VatRateAdded.cs rename to src/Ubik.Accounting.SalesOrVatTax.Contracts/SalesOrVatTaxRate/Events/SalesOrVatTaxRateUpdated.cs index 8127ab14..106dfd2c 100644 --- a/src/Ubik.Accounting.Structure.Contracts/VatRate/Events/VatRateAdded.cs +++ b/src/Ubik.Accounting.SalesOrVatTax.Contracts/SalesOrVatTaxRate/Events/SalesOrVatTaxRateUpdated.cs @@ -4,9 +4,9 @@ using System.Text; using System.Threading.Tasks; -namespace Ubik.Accounting.Structure.Contracts.VatRate.Events +namespace Ubik.Accounting.SalesOrVatTax.Contracts.VatRate.Events { - public record VatRateAdded + public record SalesOrVatTaxRateUpdated { public Guid Id { get; init; } public DateTime ValidFrom { get; init; } diff --git a/src/Ubik.Accounting.Structure.Contracts/VatRate/Events/VatRateUpdated.cs b/src/Ubik.Accounting.SalesOrVatTax.Contracts/SalesOrVatTaxRate/Results/SalesOrVatTaxRateStandardResult.cs similarity index 79% rename from src/Ubik.Accounting.Structure.Contracts/VatRate/Events/VatRateUpdated.cs rename to src/Ubik.Accounting.SalesOrVatTax.Contracts/SalesOrVatTaxRate/Results/SalesOrVatTaxRateStandardResult.cs index ec5a66f3..9a68c54a 100644 --- a/src/Ubik.Accounting.Structure.Contracts/VatRate/Events/VatRateUpdated.cs +++ b/src/Ubik.Accounting.SalesOrVatTax.Contracts/SalesOrVatTaxRate/Results/SalesOrVatTaxRateStandardResult.cs @@ -4,9 +4,9 @@ using System.Text; using System.Threading.Tasks; -namespace Ubik.Accounting.Structure.Contracts.VatRate.Events +namespace Ubik.Accounting.SalesOrVatTax.Contracts.VatRate.Results { - public record VatRateUpdated + public record SalesOrVatTaxRateStandardResult { public Guid Id { get; init; } public DateTime ValidFrom { get; init; } diff --git a/src/Ubik.Accounting.SalesOrVatTax.Contracts/Ubik.Accounting.SalesOrVatTax.Contracts.csproj b/src/Ubik.Accounting.SalesOrVatTax.Contracts/Ubik.Accounting.SalesOrVatTax.Contracts.csproj new file mode 100644 index 00000000..fa71b7ae --- /dev/null +++ b/src/Ubik.Accounting.SalesOrVatTax.Contracts/Ubik.Accounting.SalesOrVatTax.Contracts.csproj @@ -0,0 +1,9 @@ + + + + net8.0 + enable + enable + + + diff --git a/src/Ubik.Accounting.Structure.Api/Data/AccountingDbContext.cs b/src/Ubik.Accounting.Structure.Api/Data/AccountingDbContext.cs index 5341816b..b3530a62 100644 --- a/src/Ubik.Accounting.Structure.Api/Data/AccountingDbContext.cs +++ b/src/Ubik.Accounting.Structure.Api/Data/AccountingDbContext.cs @@ -20,9 +20,8 @@ public class AccountingDbContext(DbContextOptions options public DbSet Classifications { get; set; } public DbSet Currencies { get; set; } public DbSet Transactions { get; set; } - public DbSet Entries { get; set; } - public DbSet VatRates { get; set; } - public DbSet AccountVatConfigs { get; set; } + //public DbSet Entries { get; set; } + //public DbSet AccountVatConfigs { get; set; } protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) @@ -77,9 +76,8 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) new AccountConfiguration().Configure(modelBuilder.Entity()); new AccountAccountGroupConfiguration().Configure(modelBuilder.Entity()); new TransactionConfiguration().Configure(modelBuilder.Entity()); - new EntryConfiguration().Configure(modelBuilder.Entity()); - new VatRateConfiguration().Configure(modelBuilder.Entity()); - new AccountVatConfigConfiguration().Configure(modelBuilder.Entity()); + //new EntryConfiguration().Configure(modelBuilder.Entity()); + //new AccountVatConfigConfiguration().Configure(modelBuilder.Entity()); base.OnModelCreating(modelBuilder); } @@ -104,14 +102,11 @@ private void SetTenantId(ModelBuilder modelBuilder) modelBuilder.Entity() .HasQueryFilter(mt => mt.TenantId == _currentUser.TenantId); - modelBuilder.Entity() - .HasQueryFilter(mt => mt.TenantId == _currentUser.TenantId); - - modelBuilder.Entity() - .HasQueryFilter(mt => mt.TenantId == _currentUser.TenantId); + //modelBuilder.Entity() + // .HasQueryFilter(mt => mt.TenantId == _currentUser.TenantId); - modelBuilder.Entity() - .HasQueryFilter(mt => mt.TenantId == _currentUser.TenantId); + //modelBuilder.Entity() + // .HasQueryFilter(mt => mt.TenantId == _currentUser.TenantId); } } } diff --git a/src/Ubik.Accounting.Structure.Api/Data/Config/AccountVatConfigConfiguration.cs b/src/Ubik.Accounting.Structure.Api/Data/Config/AccountVatConfigConfiguration.cs index 1c3bfc08..e6ad0101 100644 --- a/src/Ubik.Accounting.Structure.Api/Data/Config/AccountVatConfigConfiguration.cs +++ b/src/Ubik.Accounting.Structure.Api/Data/Config/AccountVatConfigConfiguration.cs @@ -4,44 +4,44 @@ namespace Ubik.Accounting.Structure.Api.Data.Config { - public class AccountVatConfigConfiguration : IEntityTypeConfiguration - { - public void Configure(EntityTypeBuilder builder) - { - builder.Property(a => a.Version) - .IsConcurrencyToken(); - - builder.Property(a => a.TenantId) - .IsRequired(); - - builder.Property(a => a.CreatedAt) - .IsRequired(); - - builder.Property(a => a.CreatedBy) - .IsRequired(); - - builder.HasIndex(a => new { a.AccountId, a.VatRateId }) - .IsUnique(); - - builder.HasIndex(a => a.TenantId); - - builder - .HasOne(s => s.Account) - .WithMany() - .HasForeignKey(e => e.AccountId) - .IsRequired(true); - - builder - .HasOne(s => s.VatRate) - .WithMany() - .HasForeignKey(e => e.VatRateId) - .IsRequired(true); - - builder - .HasOne(s => s.VatAccount) - .WithMany() - .HasForeignKey(e => e.VatAccountId) - .IsRequired(true); - } - } + //public class AccountVatConfigConfiguration : IEntityTypeConfiguration + //{ + // public void Configure(EntityTypeBuilder builder) + // { + // builder.Property(a => a.Version) + // .IsConcurrencyToken(); + + // builder.Property(a => a.TenantId) + // .IsRequired(); + + // builder.Property(a => a.CreatedAt) + // .IsRequired(); + + // builder.Property(a => a.CreatedBy) + // .IsRequired(); + + // builder.HasIndex(a => new { a.AccountId, a.VatRateId }) + // .IsUnique(); + + // builder.HasIndex(a => a.TenantId); + + // builder + // .HasOne(s => s.Account) + // .WithMany() + // .HasForeignKey(e => e.AccountId) + // .IsRequired(true); + + // builder + // .HasOne(s => s.VatRate) + // .WithMany() + // .HasForeignKey(e => e.VatRateId) + // .IsRequired(true); + + // builder + // .HasOne(s => s.VatAccount) + // .WithMany() + // .HasForeignKey(e => e.VatAccountId) + // .IsRequired(true); + // } + //} } diff --git a/src/Ubik.Accounting.Structure.Api/Data/Config/EntryConfiguration.cs b/src/Ubik.Accounting.Structure.Api/Data/Config/EntryConfiguration.cs index 691f8775..ee1370bf 100644 --- a/src/Ubik.Accounting.Structure.Api/Data/Config/EntryConfiguration.cs +++ b/src/Ubik.Accounting.Structure.Api/Data/Config/EntryConfiguration.cs @@ -4,77 +4,77 @@ namespace Ubik.Accounting.Structure.Api.Data.Config { - public class EntryConfiguration : IEntityTypeConfiguration - { - public void Configure(EntityTypeBuilder builder) - { - builder.ToTable("entries"); - - builder.Property(a => a.Type) - .IsRequired() - .HasConversion(); - - builder.Property(a => a.Sign) - .IsRequired() - .HasConversion(); - - builder.Property(a => a.Label) - .IsRequired() - .HasMaxLength(100); - - builder.Property(a => a.Description) - .HasMaxLength(700); - - builder.Property(a => a.Amount) - .IsRequired() - .HasPrecision(18, 4); - - builder.Property(a => a.OriginalAmount) - .HasPrecision(18, 4); - - builder.Property(a => a.ExchangeRate) - .HasPrecision(18, 10); - - builder.Property(a => a.VATAppliedRate) - .HasPrecision(8, 5); - - builder.Property(a => a.Version) - .IsConcurrencyToken(); - - builder.Property(a => a.TenantId) - .IsRequired(); - - builder.Property(a => a.CreatedAt) - .IsRequired(); - - builder.Property(a => a.CreatedBy) - .IsRequired(); - - builder.HasIndex(a => a.TenantId); - - builder - .HasOne(s => s.Transaction) - .WithMany() - .HasForeignKey(e => e.TransactionId) - .IsRequired(true); - - builder - .HasOne(s => s.Account) - .WithMany() - .HasForeignKey(e => e.AccountId) - .IsRequired(true); - - builder - .HasOne(s => s.OriginalCurrency) - .WithMany() - .HasForeignKey(e => e.OriginalCurrencyId) - .IsRequired(true); - - builder - .HasOne(e=> e.VatRate) - .WithMany() - .HasForeignKey(e => e.VatRateId) - .IsRequired(false); - } - } + //public class EntryConfiguration : IEntityTypeConfiguration + //{ + // public void Configure(EntityTypeBuilder builder) + // { + // builder.ToTable("entries"); + + // builder.Property(a => a.Type) + // .IsRequired() + // .HasConversion(); + + // builder.Property(a => a.Sign) + // .IsRequired() + // .HasConversion(); + + // builder.Property(a => a.Label) + // .IsRequired() + // .HasMaxLength(100); + + // builder.Property(a => a.Description) + // .HasMaxLength(700); + + // builder.Property(a => a.Amount) + // .IsRequired() + // .HasPrecision(18, 4); + + // builder.Property(a => a.OriginalAmount) + // .HasPrecision(18, 4); + + // builder.Property(a => a.ExchangeRate) + // .HasPrecision(18, 10); + + // builder.Property(a => a.VATAppliedRate) + // .HasPrecision(8, 5); + + // builder.Property(a => a.Version) + // .IsConcurrencyToken(); + + // builder.Property(a => a.TenantId) + // .IsRequired(); + + // builder.Property(a => a.CreatedAt) + // .IsRequired(); + + // builder.Property(a => a.CreatedBy) + // .IsRequired(); + + // builder.HasIndex(a => a.TenantId); + + // builder + // .HasOne(s => s.Transaction) + // .WithMany() + // .HasForeignKey(e => e.TransactionId) + // .IsRequired(true); + + // builder + // .HasOne(s => s.Account) + // .WithMany() + // .HasForeignKey(e => e.AccountId) + // .IsRequired(true); + + // builder + // .HasOne(s => s.OriginalCurrency) + // .WithMany() + // .HasForeignKey(e => e.OriginalCurrencyId) + // .IsRequired(true); + + // builder + // .HasOne(e=> e.VatRate) + // .WithMany() + // .HasForeignKey(e => e.VatRateId) + // .IsRequired(false); + // } + //} } diff --git a/src/Ubik.Accounting.Structure.Api/Features/Accounts/Services/AccountCommandService.cs b/src/Ubik.Accounting.Structure.Api/Features/Accounts/Services/AccountCommandService.cs index cd6822a2..9ba13a6b 100644 --- a/src/Ubik.Accounting.Structure.Api/Features/Accounts/Services/AccountCommandService.cs +++ b/src/Ubik.Accounting.Structure.Api/Features/Accounts/Services/AccountCommandService.cs @@ -40,7 +40,6 @@ public async Task> UpdateAsync(UpdateAc public async Task> DeleteAsync(Guid id) { return await GetAsync(id) - .BindAsync(ValidateIfNotLinkedToExistingEntryAsync) .BindAsync(DeleteInDbContextAsync) .BindAsync(DeletedSaveAndPublishAsync); } @@ -197,14 +196,14 @@ private async Task> ValidateIfNotAlread : account; } - private async Task> ValidateIfNotLinkedToExistingEntryAsync(Account current) - { - var exists = await ctx.Entries.AnyAsync(e => e.AccountId == current.Id); + //private async Task> ValidateIfNotLinkedToExistingEntryAsync(Account current) + //{ + // var exists = await ctx.Entries.AnyAsync(e => e.AccountId == current.Id); - return exists - ? new AccountLinkedToExistingEntriesError(current.Id) - : current; - } + // return exists + // ? new AccountLinkedToExistingEntriesError(current.Id) + // : current; + //} private static async Task> MapInDbContextAsync (Account current, Account forUpdate) diff --git a/src/Ubik.Accounting.Structure.Api/Features/VatRates/Services/IVatRateCommandService.cs b/src/Ubik.Accounting.Structure.Api/Features/VatRates/Services/IVatRateCommandService.cs deleted file mode 100644 index 3d690ce7..00000000 --- a/src/Ubik.Accounting.Structure.Api/Features/VatRates/Services/IVatRateCommandService.cs +++ /dev/null @@ -1,14 +0,0 @@ -using LanguageExt; -using Ubik.Accounting.Structure.Api.Models; -using Ubik.Accounting.Structure.Contracts.VatRate.Commands; -using Ubik.ApiService.Common.Errors; - -namespace Ubik.Accounting.Structure.Api.Features.VatRates.Services -{ - public interface IVatRateCommandService - { - public Task> AddAsync(AddVatRateCommand command); - public Task> UpdateAsync(UpdateVatRateCommand command); - public Task> DeleteAsync(Guid id); - } -} diff --git a/src/Ubik.Accounting.Structure.Api/Features/VatRates/Services/IVatRateQueryService.cs b/src/Ubik.Accounting.Structure.Api/Features/VatRates/Services/IVatRateQueryService.cs deleted file mode 100644 index 985b8d55..00000000 --- a/src/Ubik.Accounting.Structure.Api/Features/VatRates/Services/IVatRateQueryService.cs +++ /dev/null @@ -1,12 +0,0 @@ -using LanguageExt; -using Ubik.Accounting.Structure.Api.Models; -using Ubik.ApiService.Common.Errors; - -namespace Ubik.Accounting.Structure.Api.Features.VatRates.Services -{ - public interface IVatRateQueryService - { - Task> GetAsync(Guid id); - Task> GetAllAsync(); - } -} diff --git a/src/Ubik.Accounting.Structure.Api/Features/VatRates/Services/VatRateQueryService.cs b/src/Ubik.Accounting.Structure.Api/Features/VatRates/Services/VatRateQueryService.cs deleted file mode 100644 index b32b5047..00000000 --- a/src/Ubik.Accounting.Structure.Api/Features/VatRates/Services/VatRateQueryService.cs +++ /dev/null @@ -1,27 +0,0 @@ -using LanguageExt; -using Microsoft.EntityFrameworkCore; -using Ubik.Accounting.Structure.Api.Data; -using Ubik.Accounting.Structure.Api.Models; -using Ubik.ApiService.Common.Errors; - -namespace Ubik.Accounting.Structure.Api.Features.VatRates.Services -{ - public class VatRateQueryService(AccountingDbContext ctx) : IVatRateQueryService - { - public async Task> GetAllAsync() - { - var result = await ctx.VatRates.ToListAsync(); - - return result; - } - - public async Task> GetAsync(Guid id) - { - var result = await ctx.VatRates.FindAsync(id); - - return result == null - ? new ResourceNotFoundError("VatRate", "Id", id.ToString()) - : result; - } - } -} diff --git a/src/Ubik.Accounting.Structure.Api/Models/AccountVatConfig.cs b/src/Ubik.Accounting.Structure.Api/Models/AccountVatConfig.cs index 318aeb50..22ef5aa7 100644 --- a/src/Ubik.Accounting.Structure.Api/Models/AccountVatConfig.cs +++ b/src/Ubik.Accounting.Structure.Api/Models/AccountVatConfig.cs @@ -2,20 +2,20 @@ namespace Ubik.Accounting.Structure.Api.Models { - public class AccountVatConfig : ITenantEntity, IConcurrencyCheckEntity, IAuditEntity - { - public Guid Id { get; set; } - public Guid AccountId { get; set; } - public Account? Account { get; set; } - public Guid VatRateId { get; set; } - public VatRate? VatRate { get; set; } - public Guid VatAccountId { get; set; } - public Account? VatAccount { get; set; } - public Guid Version { get; set; } - public Guid TenantId { get; set; } - public required DateTime CreatedAt { get; set; } - public required Guid CreatedBy { get; set; } - public DateTime? ModifiedAt { get; set; } - public Guid? ModifiedBy { get; set; } - } + //public class AccountVatConfig : ITenantEntity, IConcurrencyCheckEntity, IAuditEntity + //{ + // public Guid Id { get; set; } + // public Guid AccountId { get; set; } + // public Account? Account { get; set; } + // public Guid VatRateId { get; set; } + // public VatRate? VatRate { get; set; } + // public Guid VatAccountId { get; set; } + // public Account? VatAccount { get; set; } + // public Guid Version { get; set; } + // public Guid TenantId { get; set; } + // public required DateTime CreatedAt { get; set; } + // public required Guid CreatedBy { get; set; } + // public DateTime? ModifiedAt { get; set; } + // public Guid? ModifiedBy { get; set; } + //} } diff --git a/src/Ubik.Accounting.Structure.Api/Models/Entry.cs b/src/Ubik.Accounting.Structure.Api/Models/Entry.cs index 438d809f..fe5bb008 100644 --- a/src/Ubik.Accounting.Structure.Api/Models/Entry.cs +++ b/src/Ubik.Accounting.Structure.Api/Models/Entry.cs @@ -3,44 +3,44 @@ namespace Ubik.Accounting.Structure.Api.Models { - public enum DebitCredit - { - Debit, - Credit - } + //public enum DebitCredit + //{ + // Debit, + // Credit + //} - public enum EntryType - { - Main, - Counterparty, - } + //public enum EntryType + //{ + // Main, + // Counterparty, + //} - public class Entry : ITenantEntity, IConcurrencyCheckEntity, IAuditEntity - { - public Guid Id { get; set; } - public required EntryType Type { get; set; } - public required DebitCredit Sign { get; set; } - public required Guid TransactionId { get; set; } - public Transaction? Transaction { get; set; } - public required Guid AccountId { get; set; } - public Account? Account { get; set; } - //Used to keep a trace of the VAT rate applied to the entry (at a time) - public decimal VATAppliedRate { get; set; } - public Guid? VatRateId { get; set; } - public VatRate? VatRate { get; set; } - public string? Label { get; set; } - public string? Description { get; set; } - //See if we want the amount with or without VAT - public required decimal Amount { get; set; } - public decimal? OriginalAmount { get; set; } - public Guid? OriginalCurrencyId { get; set; } - public Currency? OriginalCurrency { get; set; } - public decimal? ExchangeRate { get; set; } - public Guid Version { get; set; } - public Guid TenantId { get; set; } - public required DateTime CreatedAt { get; set; } - public required Guid CreatedBy { get; set; } - public DateTime? ModifiedAt { get; set; } - public Guid? ModifiedBy { get; set; } - } + //public class Entry : ITenantEntity, IConcurrencyCheckEntity, IAuditEntity + //{ + // public Guid Id { get; set; } + // public required EntryType Type { get; set; } + // public required DebitCredit Sign { get; set; } + // public required Guid TransactionId { get; set; } + // public Transaction? Transaction { get; set; } + // public required Guid AccountId { get; set; } + // public Account? Account { get; set; } + // //Used to keep a trace of the VAT rate applied to the entry (at a time) + // public decimal VATAppliedRate { get; set; } + // public Guid? VatRateId { get; set; } + // public VatRate? VatRate { get; set; } + // public string? Label { get; set; } + // public string? Description { get; set; } + // //See if we want the amount with or without VAT + // public required decimal Amount { get; set; } + // public decimal? OriginalAmount { get; set; } + // public Guid? OriginalCurrencyId { get; set; } + // public Currency? OriginalCurrency { get; set; } + // public decimal? ExchangeRate { get; set; } + // public Guid Version { get; set; } + // public Guid TenantId { get; set; } + // public required DateTime CreatedAt { get; set; } + // public required Guid CreatedBy { get; set; } + // public DateTime? ModifiedAt { get; set; } + // public Guid? ModifiedBy { get; set; } + //} } diff --git a/src/Ubik.Accounting.Structure.Api/Program.cs b/src/Ubik.Accounting.Structure.Api/Program.cs index a215abfa..c4db7df6 100644 --- a/src/Ubik.Accounting.Structure.Api/Program.cs +++ b/src/Ubik.Accounting.Structure.Api/Program.cs @@ -62,7 +62,7 @@ public static async Task Main(string[] args) //MessageBroker with masstransit + outbox builder.Services.AddMassTransit(config => { - config.SetEndpointNameFormatter(new KebabCaseEndpointNameFormatter(prefix: "AccountingApi", includeNamespace: false)); + config.SetEndpointNameFormatter(new KebabCaseEndpointNameFormatter(prefix: "AccountingStructApi", includeNamespace: false)); config.UsingRabbitMq((context, configurator) => { configurator.Host(new Uri(msgBrokerOptions.Host), h => diff --git a/src/Ubik.CodeGenerator/MappersGenerator.cs b/src/Ubik.CodeGenerator/MappersGenerator.cs index fd79fac0..ccc0cbb7 100644 --- a/src/Ubik.CodeGenerator/MappersGenerator.cs +++ b/src/Ubik.CodeGenerator/MappersGenerator.cs @@ -1,11 +1,12 @@ using Microsoft.EntityFrameworkCore.Metadata; using System.Text; +using Ubik.Accounting.SalesOrVatTax.Api.Data; using Ubik.Accounting.Structure.Api.Data; using Ubik.Security.Api.Data; namespace Ubik.CodeGenerator { - internal class MappersGenerator(AccountingDbContext dbContext) + internal class MappersGenerator(AccountingSalesTaxDbContext dbContext) { public void GenerateMappers(string? type = null) { diff --git a/src/Ubik.CodeGenerator/Program.cs b/src/Ubik.CodeGenerator/Program.cs index 71a7fd9c..703e7500 100644 --- a/src/Ubik.CodeGenerator/Program.cs +++ b/src/Ubik.CodeGenerator/Program.cs @@ -1,6 +1,7 @@ // See https://aka.ms/new-console-template for more information using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.DependencyInjection; +using Ubik.Accounting.SalesOrVatTax.Api.Data; using Ubik.Accounting.Structure.Api.Data; using Ubik.ApiService.Common.Services; using Ubik.CodeGenerator; @@ -13,6 +14,8 @@ options => options.UseNpgsql("x")) .AddDbContextFactory( options => options.UseNpgsql("x")) + .AddDbContextFactory( + options => options.UseNpgsql("x")) .AddSingleton() .AddSingleton() .AddSingleton() @@ -26,8 +29,8 @@ var myControllerGenerator = serviceProvider.GetRequiredService(); //myContractsGenerator.GenerateAllContracts(false, string.Empty, "VatRate"); -//myMappersGenerator.GenerateMappers("VatRate"); -myServicesGenerator.GenerateAllServicesAndInterfaces("VatRate"); +myMappersGenerator.GenerateMappers("SalesOrVatTaxRate"); +//myServicesGenerator.GenerateAllServicesAndInterfaces("VatRate"); //myControllerGenerator.GenerateController("Tenant"); //FAKER to use the DBcontext diff --git a/src/Ubik.CodeGenerator/Ubik.CodeGenerator.csproj b/src/Ubik.CodeGenerator/Ubik.CodeGenerator.csproj index c393c33e..f323c189 100644 --- a/src/Ubik.CodeGenerator/Ubik.CodeGenerator.csproj +++ b/src/Ubik.CodeGenerator/Ubik.CodeGenerator.csproj @@ -12,6 +12,7 @@ + diff --git a/src/Ubik.Security.Api/Program.cs b/src/Ubik.Security.Api/Program.cs index 04e9623e..9ca721d4 100644 --- a/src/Ubik.Security.Api/Program.cs +++ b/src/Ubik.Security.Api/Program.cs @@ -86,9 +86,9 @@ //Add all consumers config.AddConsumers(Assembly.GetExecutingAssembly()); - //Add commands clients - config.AddRequestClient(); - config.AddRequestClient(); + ////Add commands clients + //config.AddRequestClient(); + //config.AddRequestClient(); }); //Api versioning diff --git a/src/Ubik.sln b/src/Ubik.sln index 4c051994..a14432a5 100644 --- a/src/Ubik.sln +++ b/src/Ubik.sln @@ -31,6 +31,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ubik.YarpProxy", "Ubik.Yarp EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Ubik.Accounting.SalesOrVatTax.Api", "Ubik.Accounting.SalesOrVatTax.Api\Ubik.Accounting.SalesOrVatTax.Api.csproj", "{88A5C638-DFC5-4723-8736-FBBEE524CF72}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Ubik.Accounting.SalesOrVatTax.Contracts", "Ubik.Accounting.SalesOrVatTax.Contracts\Ubik.Accounting.SalesOrVatTax.Contracts.csproj", "{EE4F7875-98E7-47FD-9921-CD306448A8E4}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -93,6 +95,10 @@ Global {88A5C638-DFC5-4723-8736-FBBEE524CF72}.Debug|Any CPU.Build.0 = Debug|Any CPU {88A5C638-DFC5-4723-8736-FBBEE524CF72}.Release|Any CPU.ActiveCfg = Release|Any CPU {88A5C638-DFC5-4723-8736-FBBEE524CF72}.Release|Any CPU.Build.0 = Release|Any CPU + {EE4F7875-98E7-47FD-9921-CD306448A8E4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {EE4F7875-98E7-47FD-9921-CD306448A8E4}.Debug|Any CPU.Build.0 = Debug|Any CPU + {EE4F7875-98E7-47FD-9921-CD306448A8E4}.Release|Any CPU.ActiveCfg = Release|Any CPU + {EE4F7875-98E7-47FD-9921-CD306448A8E4}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/tests/Ubik.Api.Tests.Integration/Ubik.Api.Tests.Integration.csproj b/tests/Ubik.Api.Tests.Integration/Ubik.Api.Tests.Integration.csproj index 1ae15b02..7d5a1172 100644 --- a/tests/Ubik.Api.Tests.Integration/Ubik.Api.Tests.Integration.csproj +++ b/tests/Ubik.Api.Tests.Integration/Ubik.Api.Tests.Integration.csproj @@ -23,7 +23,7 @@ - + From 1acb732cd55bcc023f1ad04a6f928ee47943d42f Mon Sep 17 00:00:00 2001 From: ubik Date: Fri, 1 Nov 2024 11:46:47 +0100 Subject: [PATCH 15/94] Sales tax vat first endpoint --- .../Data/AccountingSalesTaxDbContext.cs | 2 +- ...nfiguration.cs => TaxRateConfiguration.cs} | 0 .../Controllers/v1/TaxRatesController.cs | 87 +++++++++++++++++++ .../Services/TaxRateCommandService.cs | 16 ++-- .../TaxRates/Services/TaxRateQueryService.cs | 6 +- .../Program.cs | 3 + .../Properties/launchSettings.json | 4 +- .../appsettings.json | 4 +- .../appsettings.json | 4 +- src/Ubik.CodeGenerator/ControllerGenerator.cs | 9 +- src/Ubik.CodeGenerator/Program.cs | 4 +- .../Data/Init/AuthorizationsData.sql | 2 + .../Data/Init/RolesAuthorizationsData.sql | 3 + src/Ubik.YarpProxy/Program.cs | 6 +- src/Ubik.YarpProxy/appsettings.json | 78 +++++++++++------ 15 files changed, 176 insertions(+), 52 deletions(-) rename src/Ubik.Accounting.SalesOrVatTax.Api/Data/Config/{SalesOrVatRateConfiguration.cs => TaxRateConfiguration.cs} (100%) create mode 100644 src/Ubik.Accounting.SalesOrVatTax.Api/Features/TaxRates/Controllers/v1/TaxRatesController.cs diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Data/AccountingSalesTaxDbContext.cs b/src/Ubik.Accounting.SalesOrVatTax.Api/Data/AccountingSalesTaxDbContext.cs index e5a1dd43..a15c5264 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Api/Data/AccountingSalesTaxDbContext.cs +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Data/AccountingSalesTaxDbContext.cs @@ -12,7 +12,7 @@ namespace Ubik.Accounting.SalesOrVatTax.Api.Data public class AccountingSalesTaxDbContext(DbContextOptions options , ICurrentUser currentUser) : DbContext(options) { - public DbSet SalesOrVatTaxRates { get; set; } + public DbSet TaxRates { get; set; } protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) { diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Data/Config/SalesOrVatRateConfiguration.cs b/src/Ubik.Accounting.SalesOrVatTax.Api/Data/Config/TaxRateConfiguration.cs similarity index 100% rename from src/Ubik.Accounting.SalesOrVatTax.Api/Data/Config/SalesOrVatRateConfiguration.cs rename to src/Ubik.Accounting.SalesOrVatTax.Api/Data/Config/TaxRateConfiguration.cs diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Features/TaxRates/Controllers/v1/TaxRatesController.cs b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/TaxRates/Controllers/v1/TaxRatesController.cs new file mode 100644 index 00000000..137d859d --- /dev/null +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/TaxRates/Controllers/v1/TaxRatesController.cs @@ -0,0 +1,87 @@ +using Asp.Versioning; +using Microsoft.AspNetCore.Mvc; +using Ubik.Accounting.SalesOrVatTax.Api.Features.TaxRates.Services; +using Ubik.Accounting.SalesOrVatTax.Api.Mappers; +using Ubik.Accounting.SalesOrVatTax.Contracts.VatRate.Commands; +using Ubik.Accounting.SalesOrVatTax.Contracts.VatRate.Results; +using Ubik.ApiService.Common.Errors; +using Ubik.ApiService.Common.Exceptions; + +namespace Ubik.Accounting.SalesOrVatTax.Api.Features.TaxRates.Controllers.v1 +{ + [ApiController] + [ApiVersion("1.0")] + [Route("api/v{version:apiVersion}/sales-vat-tax/[controller]")] + public class TaxRatesController(ITaxRateCommandService commandService, ITaxRateQueryService queryService) : ControllerBase + { + [HttpGet] + [ProducesResponseType(200)] + [ProducesResponseType(typeof(CustomProblemDetails), 400)] + [ProducesResponseType(typeof(CustomProblemDetails), 500)] + public async Task>> GetAll() + { + var results = (await queryService.GetAllAsync()).ToSalesOrVatTaxRateStandardResults(); + return Ok(results); + } + + [HttpGet("{id}")] + [ProducesResponseType(200)] + [ProducesResponseType(typeof(CustomProblemDetails), 400)] + [ProducesResponseType(typeof(CustomProblemDetails), 404)] + [ProducesResponseType(typeof(CustomProblemDetails), 500)] + public async Task> Get(Guid id) + { + var result = await queryService.GetAsync(id); + return result.Match( + Right: ok => Ok(ok.ToSalesOrVatTaxRateStandardResult()), + Left: err => new ObjectResult(err.ToValidationProblemDetails(HttpContext))); + } + + [HttpPost] + [ProducesResponseType(201)] + [ProducesResponseType(typeof(CustomProblemDetails), 400)] + [ProducesResponseType(typeof(CustomProblemDetails), 409)] + [ProducesResponseType(typeof(CustomProblemDetails), 500)] + public async Task> AddAsync(AddSalesOrVatTaxRateCommand command) + { + var result = await commandService.AddAsync(command); + + return result.Match( + Right: ok => CreatedAtAction(nameof(Get), new { id = ok.Id }, ok.ToSalesOrVatTaxRateStandardResult()), + Left: err => new ObjectResult(err.ToValidationProblemDetails(HttpContext))); + } + + [HttpPut("{id}")] + [ProducesResponseType(200)] + [ProducesResponseType(typeof(CustomProblemDetails), 400)] + [ProducesResponseType(typeof(CustomProblemDetails), 404)] + [ProducesResponseType(typeof(CustomProblemDetails), 409)] + [ProducesResponseType(typeof(CustomProblemDetails), 500)] + public async Task> Update(Guid id, UpdateSalesOrVatTaxRateCommand command) + { + if (command.Id != id) + return new ObjectResult(new ResourceIdNotMatchForUpdateError("TaxRate", id, command.Id) + .ToValidationProblemDetails(HttpContext)); + + var result = await commandService.UpdateAsync(command); + + return result.Match( + Right: ok => Ok(ok.ToSalesOrVatTaxRateStandardResult()), + Left: err => new ObjectResult(err.ToValidationProblemDetails(HttpContext))); + } + + [HttpDelete("{id}")] + [ProducesResponseType(204)] + [ProducesResponseType(typeof(CustomProblemDetails), 400)] + [ProducesResponseType(typeof(CustomProblemDetails), 404)] + [ProducesResponseType(typeof(CustomProblemDetails), 500)] + public async Task Delete(Guid id) + { + var result = await commandService.DeleteAsync(id); + + return result.Match( + Right: ok => NoContent(), + Left: err => new ObjectResult(err.ToValidationProblemDetails(HttpContext))); + } + } +} diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Features/TaxRates/Services/TaxRateCommandService.cs b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/TaxRates/Services/TaxRateCommandService.cs index 683736c4..53904224 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Api/Features/TaxRates/Services/TaxRateCommandService.cs +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/TaxRates/Services/TaxRateCommandService.cs @@ -66,16 +66,16 @@ private async Task> UpdateSaveAndPublis } catch (UpdateDbConcurrencyException) { - return new ResourceUpdateConcurrencyError("VatRate", current.Version.ToString()); + return new ResourceUpdateConcurrencyError("TaxRate", current.Version.ToString()); } } private async Task> GetAsync(Guid id) { - var result = await ctx.SalesOrVatTaxRates.FindAsync(id); + var result = await ctx.TaxRates.FindAsync(id); return result == null - ? new ResourceNotFoundError("VatRate", "Id", id.ToString()) + ? new ResourceNotFoundError("TaxRate", "Id", id.ToString()) : result; } @@ -90,10 +90,10 @@ private async Task> UpdateInDbContextAs private async Task> ValidateIfNotAlreadyExistsWithOtherIdAsync(TaxRate current) { - var exists = await ctx.SalesOrVatTaxRates.AnyAsync(a => a.Code == current.Code && a.Id != current.Id); + var exists = await ctx.TaxRates.AnyAsync(a => a.Code == current.Code && a.Id != current.Id); return exists - ? new ResourceAlreadyExistsError("VatRate", "Code", current.Code) + ? new ResourceAlreadyExistsError("TaxRate", "Code", current.Code) : current; } @@ -115,16 +115,16 @@ private async Task> AddSaveAndPublishAs private async Task> AddInDbContextAsync(TaxRate current) { current.Id = NewId.NextGuid(); - await ctx.SalesOrVatTaxRates.AddAsync(current); + await ctx.TaxRates.AddAsync(current); ctx.SetAuditAndSpecialFields(); return current; } private async Task> ValidateIfNotAlreadyExistsAsync(TaxRate current) { - var exists = await ctx.SalesOrVatTaxRates.AnyAsync(a => a.Code == current.Code); + var exists = await ctx.TaxRates.AnyAsync(a => a.Code == current.Code); return exists - ? new ResourceAlreadyExistsError("VatRate", "Code", current.Code) + ? new ResourceAlreadyExistsError("TaxRate", "Code", current.Code) : current; } } diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Features/TaxRates/Services/TaxRateQueryService.cs b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/TaxRates/Services/TaxRateQueryService.cs index 8b375aeb..4afe4689 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Api/Features/TaxRates/Services/TaxRateQueryService.cs +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/TaxRates/Services/TaxRateQueryService.cs @@ -10,17 +10,17 @@ public class TaxRateQueryService(AccountingSalesTaxDbContext ctx) : ITaxRateQuer { public async Task> GetAllAsync() { - var result = await ctx.SalesOrVatTaxRates.ToListAsync(); + var result = await ctx.TaxRates.ToListAsync(); return result; } public async Task> GetAsync(Guid id) { - var result = await ctx.SalesOrVatTaxRates.FindAsync(id); + var result = await ctx.TaxRates.FindAsync(id); return result == null - ? new ResourceNotFoundError("VatRate", "Id", id.ToString()) + ? new ResourceNotFoundError("TaxRate", "Id", id.ToString()) : result; } } diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Program.cs b/src/Ubik.Accounting.SalesOrVatTax.Api/Program.cs index f354283b..f692699d 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Api/Program.cs +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Program.cs @@ -6,6 +6,7 @@ using System.Reflection; using System.Text.Json.Serialization; using Ubik.Accounting.SalesOrVatTax.Api.Data; +using Ubik.Accounting.SalesOrVatTax.Api.Features.TaxRates.Services; using Ubik.ApiService.Common.Configure; using Ubik.ApiService.Common.Configure.Options; using Ubik.ApiService.Common.Exceptions; @@ -92,6 +93,8 @@ //Services builder.Services.AddScoped(); +builder.Services.AddScoped(); +builder.Services.AddScoped(); builder.Services.AddTransient(); diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Properties/launchSettings.json b/src/Ubik.Accounting.SalesOrVatTax.Api/Properties/launchSettings.json index dc9f0b13..fabad2ed 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Api/Properties/launchSettings.json +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Properties/launchSettings.json @@ -12,7 +12,7 @@ }, "https": { "commandName": "Project", - "launchBrowser": true, + "launchBrowser": false, "launchUrl": "swagger", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" @@ -49,4 +49,4 @@ "sslPort": 44316 } } -} \ No newline at end of file +} diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/appsettings.json b/src/Ubik.Accounting.SalesOrVatTax.Api/appsettings.json index 5a408418..5501b8f6 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Api/appsettings.json +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/appsettings.json @@ -22,8 +22,8 @@ "AccountingSalesTaxDbContext": "Host=localhost;Port=5435;Database=ubik_accounting_salestax;Username=postgres;Password=test01" }, "SwaggerUI": { - "ClientId": "ubik_accounting_api", - "ClientSecret": "GQEyHjeBUThKta1eItucb5LFGj5Hduwd" + "ClientId": "ubik_app", + "ClientSecret": "Ye6Y36ocA4SaGqYzd0HgmqMhVaM2jlkE" }, "AllowedHosts": "*" } diff --git a/src/Ubik.Accounting.Structure.Api/appsettings.json b/src/Ubik.Accounting.Structure.Api/appsettings.json index 04f34f13..e7b141f3 100644 --- a/src/Ubik.Accounting.Structure.Api/appsettings.json +++ b/src/Ubik.Accounting.Structure.Api/appsettings.json @@ -23,8 +23,8 @@ "AccountingContext": "Host=localhost;Port=5435;Database=ubik_accounting_struct;Username=postgres;Password=test01" }, "SwaggerUI": { - "ClientId": "ubik_accounting_api", - "ClientSecret": "GQEyHjeBUThKta1eItucb5LFGj5Hduwd" + "ClientId": "ubik_app", + "ClientSecret": "Ye6Y36ocA4SaGqYzd0HgmqMhVaM2jlkE" }, "AllowedHosts": "*", "Serilog": { diff --git a/src/Ubik.CodeGenerator/ControllerGenerator.cs b/src/Ubik.CodeGenerator/ControllerGenerator.cs index bc55e0c0..180fc272 100644 --- a/src/Ubik.CodeGenerator/ControllerGenerator.cs +++ b/src/Ubik.CodeGenerator/ControllerGenerator.cs @@ -1,8 +1,9 @@ -using Ubik.Security.Api.Data; +using Ubik.Accounting.SalesOrVatTax.Api.Data; +using Ubik.Security.Api.Data; namespace Ubik.CodeGenerator { - internal class ControllerGenerator(SecurityDbContext dbContext) + internal class ControllerGenerator(AccountingSalesTaxDbContext dbContext) { public void GenerateController(string? type = null) { @@ -27,7 +28,7 @@ private static string GetTemplateForController() [ApiController] [ApiVersion("1.0")] [Route("api/v{version:apiVersion}/[controller]")] - public class {ClassName}sController(I{ClassName}sCommandsService commandService, I{ClassName}sQueriesService queryService) : ControllerBase + public class {ClassName}sController(I{ClassName}CommandService commandService, I{ClassName}QueryService queryService) : ControllerBase { [HttpGet] [ProducesResponseType(200)] @@ -92,7 +93,7 @@ public class {ClassName}sController(I{ClassName}sCommandsService commandService, [ProducesResponseType(typeof(CustomProblemDetails), 500)] public async Task Delete(Guid id) { - var result = await commandService.ExecuteDeleteAsync(id); + var result = await commandService.DeleteAsync(id); return result.Match( Right: ok => NoContent(), diff --git a/src/Ubik.CodeGenerator/Program.cs b/src/Ubik.CodeGenerator/Program.cs index 703e7500..e4ed8ad3 100644 --- a/src/Ubik.CodeGenerator/Program.cs +++ b/src/Ubik.CodeGenerator/Program.cs @@ -29,9 +29,9 @@ var myControllerGenerator = serviceProvider.GetRequiredService(); //myContractsGenerator.GenerateAllContracts(false, string.Empty, "VatRate"); -myMappersGenerator.GenerateMappers("SalesOrVatTaxRate"); +//myMappersGenerator.GenerateMappers("SalesOrVatTaxRate"); //myServicesGenerator.GenerateAllServicesAndInterfaces("VatRate"); -//myControllerGenerator.GenerateController("Tenant"); +myControllerGenerator.GenerateController("TaxRate"); //FAKER to use the DBcontext internal class FakeUserService : ICurrentUser diff --git a/src/Ubik.Security.Api/Data/Init/AuthorizationsData.sql b/src/Ubik.Security.Api/Data/Init/AuthorizationsData.sql index 62f90e08..c91959a3 100644 --- a/src/Ubik.Security.Api/Data/Init/AuthorizationsData.sql +++ b/src/Ubik.Security.Api/Data/Init/AuthorizationsData.sql @@ -12,4 +12,6 @@ INSERT INTO public.authorizations (id, code, label, description, version, create INSERT INTO public.authorizations (id, code, label, description, version, created_at, created_by, modified_at, modified_by) VALUES ('b45e0000-3c36-7456-96ba-08dcf11e8a59', 'accounting_classification_read', 'classification read', NULL, 'b45e0000-3c36-7456-b2bb-08dcf11e8a59', '2024-10-20 15:47:45.221426+00', '5c5e0000-3c36-7456-b9da-08dcdf9832e2', '2024-10-20 15:47:45.221426+00', '5c5e0000-3c36-7456-b9da-08dcdf9832e2'); INSERT INTO public.authorizations (id, code, label, description, version, created_at, created_by, modified_at, modified_by) VALUES ('9c630000-3c36-7456-d664-08dcf134ccaf', 'accounting_account_write', 'account write', NULL, '9c630000-3c36-7456-fdfe-08dcf134ccb5', '2024-10-20 18:27:05.483516+00', '5c5e0000-3c36-7456-b9da-08dcdf9832e2', '2024-10-20 18:27:05.483516+00', '5c5e0000-3c36-7456-b9da-08dcdf9832e2'); INSERT INTO public.authorizations (id, code, label, description, version, created_at, created_by, modified_at, modified_by) VALUES ('a83b0000-3c36-7456-2f3f-08dcf2677eca', 'accounting_currency_read', 'currency read', NULL, 'a83b0000-3c36-7456-dea7-08dcf2677ed2', '2024-10-22 07:02:30.306454+00', '5c5e0000-3c36-7456-b9da-08dcdf9832e2', '2024-10-22 07:02:30.306454+00', '5c5e0000-3c36-7456-b9da-08dcdf9832e2'); +INSERT INTO public.authorizations (id, code, label, description, version, created_at, created_by, modified_at, modified_by) VALUES ('b4740000-3c36-7456-c9d0-08dcfa601a89', 'accounting_salesvattaxrate_read', 'salesvattaxrate read', NULL, 'b4740000-3c36-7456-32af-08dcfa601a90', '2024-11-01 10:29:44.922482+00', '5c5e0000-3c36-7456-b9da-08dcdf9832e2', '2024-11-01 10:29:44.922482+00', '5c5e0000-3c36-7456-b9da-08dcdf9832e2'); +INSERT INTO public.authorizations (id, code, label, description, version, created_at, created_by, modified_at, modified_by) VALUES ('b4740000-3c36-7456-f16f-08dcfa6028e6', 'accounting_salesvattaxrate_write', 'salesvattaxrate write', NULL, 'b4740000-3c36-7456-179b-08dcfa6028e7', '2024-11-01 10:30:08.980406+00', '5c5e0000-3c36-7456-b9da-08dcdf9832e2', '2024-11-01 10:30:08.980406+00', '5c5e0000-3c36-7456-b9da-08dcdf9832e2'); diff --git a/src/Ubik.Security.Api/Data/Init/RolesAuthorizationsData.sql b/src/Ubik.Security.Api/Data/Init/RolesAuthorizationsData.sql index 747fc6a3..f9f845be 100644 --- a/src/Ubik.Security.Api/Data/Init/RolesAuthorizationsData.sql +++ b/src/Ubik.Security.Api/Data/Init/RolesAuthorizationsData.sql @@ -20,3 +20,6 @@ INSERT INTO public.roles_authorizations (id, role_id, authorization_id, version, INSERT INTO public.roles_authorizations (id, role_id, authorization_id, version, created_at, created_by, modified_at, modified_by) VALUES ('9c630000-3c36-7456-3338-08dcf134ed77', '181a0000-088f-d0ad-5f22-08dcee8ac275', '9c630000-3c36-7456-d664-08dcf134ccaf', '9c630000-3c36-7456-79be-08dcf134ed78', '2024-10-20 18:28:00.445544+00', '5c5e0000-3c36-7456-b9da-08dcdf9832e2', '2024-10-20 18:28:00.445544+00', '5c5e0000-3c36-7456-b9da-08dcdf9832e2'); INSERT INTO public.roles_authorizations (id, role_id, authorization_id, version, created_at, created_by, modified_at, modified_by) VALUES ('a83b0000-3c36-7456-0637-08dcf267a814', '181a0000-088f-d0ad-5f22-08dcee8ac275', 'a83b0000-3c36-7456-2f3f-08dcf2677eca', 'a83b0000-3c36-7456-58fd-08dcf267a815', '2024-10-22 07:03:39.529089+00', '5c5e0000-3c36-7456-b9da-08dcdf9832e2', '2024-10-22 07:03:39.529089+00', '5c5e0000-3c36-7456-b9da-08dcdf9832e2'); INSERT INTO public.roles_authorizations (id, role_id, authorization_id, version, created_at, created_by, modified_at, modified_by) VALUES ('a83b0000-3c36-7456-04d7-08dcf267b50e', '181a0000-088f-d0ad-c555-08dcee8ac9fd', 'a83b0000-3c36-7456-2f3f-08dcf2677eca', 'a83b0000-3c36-7456-0c86-08dcf267b50e', '2024-10-22 07:04:01.291768+00', '5c5e0000-3c36-7456-b9da-08dcdf9832e2', '2024-10-22 07:04:01.291768+00', '5c5e0000-3c36-7456-b9da-08dcdf9832e2'); +INSERT INTO public.roles_authorizations (id, role_id, authorization_id, version, created_at, created_by, modified_at, modified_by) VALUES ('b4740000-3c36-7456-07cb-08dcfa60831d', '181a0000-088f-d0ad-5f22-08dcee8ac275', 'b4740000-3c36-7456-c9d0-08dcfa601a89', 'b4740000-3c36-7456-6437-08dcfa60831e', '2024-11-01 10:32:40.337786+00', '5c5e0000-3c36-7456-b9da-08dcdf9832e2', '2024-11-01 10:32:40.337786+00', '5c5e0000-3c36-7456-b9da-08dcdf9832e2'); +INSERT INTO public.roles_authorizations (id, role_id, authorization_id, version, created_at, created_by, modified_at, modified_by) VALUES ('b4740000-3c36-7456-bd61-08dcfa60930d', '181a0000-088f-d0ad-5f22-08dcee8ac275', 'b4740000-3c36-7456-f16f-08dcfa6028e6', 'b4740000-3c36-7456-c46c-08dcfa60930d', '2024-11-01 10:33:07.072503+00', '5c5e0000-3c36-7456-b9da-08dcdf9832e2', '2024-11-01 10:33:07.072503+00', '5c5e0000-3c36-7456-b9da-08dcdf9832e2'); +INSERT INTO public.roles_authorizations (id, role_id, authorization_id, version, created_at, created_by, modified_at, modified_by) VALUES ('b4740000-3c36-7456-6163-08dcfa609876', '181a0000-088f-d0ad-c555-08dcee8ac9fd', 'b4740000-3c36-7456-c9d0-08dcfa601a89', 'b4740000-3c36-7456-6681-08dcfa609876', '2024-11-01 10:33:16.14685+00', '5c5e0000-3c36-7456-b9da-08dcdf9832e2', '2024-11-01 10:33:16.14685+00', '5c5e0000-3c36-7456-b9da-08dcdf9832e2'); diff --git a/src/Ubik.YarpProxy/Program.cs b/src/Ubik.YarpProxy/Program.cs index 776f350a..64652bfd 100644 --- a/src/Ubik.YarpProxy/Program.cs +++ b/src/Ubik.YarpProxy/Program.cs @@ -102,7 +102,11 @@ .AddPolicy("CanClassificationsAndAccountGroupsWrite", policy => policy.Requirements.Add(new UserWithAuthorizationsRequirement(["accounting_classification_write", "accounting_accountgroup_write"]))) .AddPolicy("CanCurrenciesRead", policy => - policy.Requirements.Add(new UserWithAuthorizationsRequirement(["accounting_currency_read"]))); + policy.Requirements.Add(new UserWithAuthorizationsRequirement(["accounting_currency_read"]))) + .AddPolicy("CanSalesOrVatTaxRatesRead", policy => + policy.Requirements.Add(new UserWithAuthorizationsRequirement(["accounting_salesvattaxrate_read"]))) + .AddPolicy("CanSalesOrVatTaxRatesWrite", policy => + policy.Requirements.Add(new UserWithAuthorizationsRequirement(["accounting_salesvattaxrate_write"]))); //Proxy var configProxy = builder.Configuration.GetSection("ReverseProxy"); diff --git a/src/Ubik.YarpProxy/appsettings.json b/src/Ubik.YarpProxy/appsettings.json index 7ea56bb8..1babed48 100644 --- a/src/Ubik.YarpProxy/appsettings.json +++ b/src/Ubik.YarpProxy/appsettings.json @@ -25,8 +25,8 @@ "AllowedHosts": "*", "ReverseProxy": { "Swagger": { - "IsCommonDocument": false, - "CommonDocumentName": "user_admin" + "IsCommonDocument": true, + "CommonDocumentName": "ubik_app" }, "Routes": { "route_security_admin_users_get_byemail": { @@ -97,7 +97,7 @@ "Transforms": [ { "PathPattern": "/api/{apiversion}/users/{id:guid}/roles/{roleid}" } ] }, "route_accounting_admin": { - "ClusterId": "ubik_accounting", + "ClusterId": "ubik_accounting_struct", "AuthorizationPolicy": "IsMegaAdmin", "Match": { "Path": "/accounting/admin/api/{apiversion}/{**catch-all}" @@ -105,7 +105,7 @@ "Transforms": [ { "PathPattern": "/admin/api/{apiversion}/{**catch-all}" } ] }, "route_accounting_accountgroup_get": { - "ClusterId": "ubik_accounting", + "ClusterId": "ubik_accounting_struct", "AuthorizationPolicy": "CanAccountGroupsRead", "Match": { "Path": "/accounting/api/{apiversion}/accountgroups", @@ -114,7 +114,7 @@ "Transforms": [ { "PathPattern": "/api/{apiversion}/accountgroups" } ] }, "route_accounting_accountgroup_get_by_id": { - "ClusterId": "ubik_accounting", + "ClusterId": "ubik_accounting_struct", "AuthorizationPolicy": "CanAccountGroupsRead", "Match": { "Path": "/accounting/api/{apiversion}/accountgroups/{id:guid}", @@ -123,7 +123,7 @@ "Transforms": [ { "PathPattern": "/api/{apiversion}/accountgroups/{id:guid}" } ] }, "route_accounting_accountgroup_get_child_accounts": { - "ClusterId": "ubik_accounting", + "ClusterId": "ubik_accounting_struct", "AuthorizationPolicy": "CanAccountGroupsAndAccountsRead", "Match": { "Path": "/accounting/api/{apiversion}/accountgroups/{id:guid}/accounts", @@ -132,7 +132,7 @@ "Transforms": [ { "PathPattern": "/api/{apiversion}/accountgroups/{id:guid}/accounts" } ] }, "route_accounting_accountgroup_add": { - "ClusterId": "ubik_accounting", + "ClusterId": "ubik_accounting_struct", "AuthorizationPolicy": "CanAccountGroupsWrite", "Match": { "Path": "/accounting/api/{apiversion}/accountgroups", @@ -141,7 +141,7 @@ "Transforms": [ { "PathPattern": "/api/{apiversion}/accountgroups" } ] }, "route_accounting_accountgroup_update_delete": { - "ClusterId": "ubik_accounting", + "ClusterId": "ubik_accounting_struct", "AuthorizationPolicy": "CanAccountGroupsWrite", "Match": { "Path": "/accounting/api/{apiversion}/accountgroups/{id:guid}", @@ -150,7 +150,7 @@ "Transforms": [ { "PathPattern": "/api/{apiversion}/accountgroups/{id:guid}" } ] }, "route_accounting_accounts_get_all": { - "ClusterId": "ubik_accounting", + "ClusterId": "ubik_accounting_struct", "AuthorizationPolicy": "CanAccountsRead", "Match": { "Path": "/accounting/api/{apiversion}/accounts", @@ -159,7 +159,7 @@ "Transforms": [ { "PathPattern": "/api/{apiversion}/accounts" } ] }, "route_accounting_account_get": { - "ClusterId": "ubik_accounting", + "ClusterId": "ubik_accounting_struct", "AuthorizationPolicy": "CanAccountsRead", "Match": { "Path": "/accounting/api/{apiversion}/accounts/{id:guid}", @@ -168,7 +168,7 @@ "Transforms": [ { "PathPattern": "/api/{apiversion}/accounts/{id:guid}" } ] }, "route_accounting_account_get_accountgrouplinks": { - "ClusterId": "ubik_accounting", + "ClusterId": "ubik_accounting_struct", "AuthorizationPolicy": "CanAccountGroupsAndAccountsRead", "Match": { "Path": "/accounting/api/{apiversion}/accounts/accountgrouplinks", @@ -177,7 +177,7 @@ "Transforms": [ { "PathPattern": "/api/{apiversion}/accounts/accountgrouplinks" } ] }, "route_accounting_account_get_accountgroups_withclassification": { - "ClusterId": "ubik_accounting", + "ClusterId": "ubik_accounting_struct", "AuthorizationPolicy": "CanAccountGroupsAndAccountsAndClassificationsRead", "Match": { "Path": "/accounting/api/{apiversion}/accounts/{id:guid}/accountgroups", @@ -186,7 +186,7 @@ "Transforms": [ { "PathPattern": "/api/{apiversion}/accounts/{id:guid}/accountgroups" } ] }, "route_accounting_account_add": { - "ClusterId": "ubik_accounting", + "ClusterId": "ubik_accounting_struct", "AuthorizationPolicy": "CanAccountsWrite", "Match": { "Path": "/accounting/api/{apiversion}/accounts", @@ -195,7 +195,7 @@ "Transforms": [ { "PathPattern": "/api/{apiversion}/accounts" } ] }, "route_accounting_account_update": { - "ClusterId": "ubik_accounting", + "ClusterId": "ubik_accounting_struct", "AuthorizationPolicy": "CanAccountsWrite", "Match": { "Path": "/accounting/api/{apiversion}/accounts/{id:guid}", @@ -204,7 +204,7 @@ "Transforms": [ { "PathPattern": "/api/{apiversion}/accounts/{id:guid}" } ] }, "route_accounting_account_delete": { - "ClusterId": "ubik_accounting", + "ClusterId": "ubik_accounting_struct", "AuthorizationPolicy": "CanAccountsWrite", "Match": { "Path": "/accounting/api/{apiversion}/accounts/{id:guid}", @@ -213,7 +213,7 @@ "Transforms": [ { "PathPattern": "/api/{apiversion}/accounts/{id:guid}" } ] }, "route_accounting_account_attach_accountgroup": { - "ClusterId": "ubik_accounting", + "ClusterId": "ubik_accounting_struct", "AuthorizationPolicy": "CanAccountGroupsAndAccountsWrite", "Match": { "Path": "/accounting/api/{apiversion}/accounts/{id:guid}/accountgroups/{accountGroupId:guid}", @@ -222,7 +222,7 @@ "Transforms": [ { "PathPattern": "/api/{apiversion}/accounts/{id:guid}/accountgroups/{accountGroupId:guid}" } ] }, "route_accounting_account_detach_accountgroup": { - "ClusterId": "ubik_accounting", + "ClusterId": "ubik_accounting_struct", "AuthorizationPolicy": "CanAccountGroupsAndAccountsWrite", "Match": { "Path": "/accounting/api/{apiversion}/accounts/{id:guid}/accountgroups/{accountGroupId:guid}", @@ -231,7 +231,7 @@ "Transforms": [ { "PathPattern": "/api/{apiversion}/accounts/{id:guid}/accountgroups/{accountGroupId:guid}" } ] }, "route_accounting_classification_get_all": { - "ClusterId": "ubik_accounting", + "ClusterId": "ubik_accounting_struct", "AuthorizationPolicy": "CanClassificationsRead", "Match": { "Path": "/accounting/api/{apiversion}/classifications", @@ -240,7 +240,7 @@ "Transforms": [ { "PathPattern": "/api/{apiversion}/classifications" } ] }, "route_accounting_classification_get_by_id": { - "ClusterId": "ubik_accounting", + "ClusterId": "ubik_accounting_struct", "AuthorizationPolicy": "CanClassificationsRead", "Match": { "Path": "/accounting/api/{apiversion}/classifications/{id:guid}", @@ -249,7 +249,7 @@ "Transforms": [ { "PathPattern": "/api/{apiversion}/classifications/{id:guid}" } ] }, "route_accounting_classification_get_attached_accounts": { - "ClusterId": "ubik_accounting", + "ClusterId": "ubik_accounting_struct", "AuthorizationPolicy": "CanClassificationsAndAccountsRead", "Match": { "Path": "/accounting/api/{apiversion}/classifications/{id:guid}/accounts", @@ -258,7 +258,7 @@ "Transforms": [ { "PathPattern": "/api/{apiversion}/classifications/{id:guid}/accounts" } ] }, "route_accounting_classification_get_missing_accounts": { - "ClusterId": "ubik_accounting", + "ClusterId": "ubik_accounting_struct", "AuthorizationPolicy": "CanClassificationsAndAccountsRead", "Match": { "Path": "/accounting/api/{apiversion}/classifications/{id:guid}/missingaccounts", @@ -267,7 +267,7 @@ "Transforms": [ { "PathPattern": "/api/{apiversion}/classifications/{id:guid}/missingaccounts" } ] }, "route_accounting_classification_get_status": { - "ClusterId": "ubik_accounting", + "ClusterId": "ubik_accounting_struct", "AuthorizationPolicy": "CanClassificationsAndAccountsRead", "Match": { "Path": "/accounting/api/{apiversion}/classifications/{id:guid}/status", @@ -276,7 +276,7 @@ "Transforms": [ { "PathPattern": "/api/{apiversion}/classifications/{id:guid}/status" } ] }, "route_accounting_classification_add": { - "ClusterId": "ubik_accounting", + "ClusterId": "ubik_accounting_struct", "AuthorizationPolicy": "CanClassificationsWrite", "Match": { "Path": "/accounting/api/{apiversion}/classifications", @@ -285,7 +285,7 @@ "Transforms": [ { "PathPattern": "/api/{apiversion}/classifications" } ] }, "route_accounting_classification_update": { - "ClusterId": "ubik_accounting", + "ClusterId": "ubik_accounting_struct", "AuthorizationPolicy": "CanClassificationsWrite", "Match": { "Path": "/accounting/api/{apiversion}/classifications/{id:guid}", @@ -294,7 +294,7 @@ "Transforms": [ { "PathPattern": "/api/{apiversion}/classifications/{id:guid}" } ] }, "route_accounting_classification_delete": { - "ClusterId": "ubik_accounting", + "ClusterId": "ubik_accounting_struct", "AuthorizationPolicy": "CanClassificationsAndAccountGroupsWrite", "Match": { "Path": "/accounting/api/{apiversion}/classifications/{id:guid}", @@ -303,13 +303,22 @@ "Transforms": [ { "PathPattern": "/api/{apiversion}/classifications/{id:guid}" } ] }, "route_accounting_currency_get_all": { - "ClusterId": "ubik_accounting", + "ClusterId": "ubik_accounting_struct", "AuthorizationPolicy": "CanCurrenciesRead", "Match": { "Path": "/accounting/api/{apiversion}/currencies", "Methods": [ "GET" ] }, "Transforms": [ { "PathPattern": "/api/{apiversion}/currencies" } ] + }, + "route_accounting_sales_vat_tax_get_all": { + "ClusterId": "ubik_accounting_sales_vat_tax", + "AuthorizationPolicy": "CanSalesOrVatTaxRatesRead", + "Match": { + "Path": "/accounting/api/{apiversion}/sales-vat-tax/taxrates", + "Methods": [ "GET" ] + }, + "Transforms": [ { "PathPattern": "/api/{apiversion}/sales-vat-tax/taxrates" } ] } }, "Clusters": { @@ -328,7 +337,7 @@ } } }, - "ubik_accounting": { + "ubik_accounting_struct": { "Destinations": { "destination1": { "Address": "https://localhost:7289/", @@ -342,6 +351,21 @@ ] } } + }, + "ubik_accounting_sales_vat_tax": { + "Destinations": { + "destination1": { + "Address": "https://localhost:7210/", + "Swaggers": [ + { + "PrefixPath": "/accounting", + "Paths": [ + "swagger/v1/swagger.json" + ] + } + ] + } + } } } } From 0a205647b3b4fb1f8e2cdcc41f672e0e09c0f0ae Mon Sep 17 00:00:00 2001 From: ubik Date: Fri, 1 Nov 2024 13:44:45 +0100 Subject: [PATCH 16/94] Some progress on SalesOrVatTax --- .../Data/AccountingSalesTaxDbContext.cs | 10 ++++ .../Data/Config/AccountConfiguration.cs | 32 +++++++++++++ .../AccountTaxRateConfigConfiguration.cs | 48 +++++++++++++++++++ .../Models/Account.cs | 15 ++++++ .../Models/AccountTaxRateConfig.cs | 19 ++++++++ .../Data/AccountingDbContext.cs | 14 ++---- .../Config/AccountVatConfigConfiguration.cs | 47 ------------------ .../Data/Config/CurrencyConfiguration.cs | 3 -- .../Data/Config/EntryConfiguration.cs | 1 + .../Data/Config/TransactionConfiguration.cs | 45 ++++++++--------- .../Models/AccountVatConfig.cs | 21 -------- .../Models/Entry.cs | 1 + .../Models/Transaction.cs | 28 +++++------ src/Ubik.Accounting.WebApp/Program.cs | 1 - src/Ubik.YarpProxy/Program.cs | 6 ++- 15 files changed, 171 insertions(+), 120 deletions(-) create mode 100644 src/Ubik.Accounting.SalesOrVatTax.Api/Data/Config/AccountConfiguration.cs create mode 100644 src/Ubik.Accounting.SalesOrVatTax.Api/Data/Config/AccountTaxRateConfigConfiguration.cs create mode 100644 src/Ubik.Accounting.SalesOrVatTax.Api/Models/Account.cs create mode 100644 src/Ubik.Accounting.SalesOrVatTax.Api/Models/AccountTaxRateConfig.cs delete mode 100644 src/Ubik.Accounting.Structure.Api/Data/Config/AccountVatConfigConfiguration.cs delete mode 100644 src/Ubik.Accounting.Structure.Api/Models/AccountVatConfig.cs diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Data/AccountingSalesTaxDbContext.cs b/src/Ubik.Accounting.SalesOrVatTax.Api/Data/AccountingSalesTaxDbContext.cs index a15c5264..3af688c6 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Api/Data/AccountingSalesTaxDbContext.cs +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Data/AccountingSalesTaxDbContext.cs @@ -13,6 +13,8 @@ public class AccountingSalesTaxDbContext(DbContextOptions TaxRates { get; set; } + public DbSet Accounts { get; set; } + public DbSet AccountTaxRateConfigs { get; set; } protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) { @@ -59,6 +61,8 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) //Configure new TaxRateConfiguration().Configure(modelBuilder.Entity()); + new AccountConfiguration().Configure(modelBuilder.Entity()); + new AccountTaxRateConfigConfiguration().Configure(modelBuilder.Entity()); base.OnModelCreating(modelBuilder); @@ -68,6 +72,12 @@ private void SetTenantId(ModelBuilder modelBuilder) { modelBuilder.Entity() .HasQueryFilter(mt => mt.TenantId == currentUser.TenantId); + + modelBuilder.Entity() + .HasQueryFilter(mt => mt.TenantId == currentUser.TenantId); + + modelBuilder.Entity() + .HasQueryFilter(mt => mt.TenantId == currentUser.TenantId); } } } diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Data/Config/AccountConfiguration.cs b/src/Ubik.Accounting.SalesOrVatTax.Api/Data/Config/AccountConfiguration.cs new file mode 100644 index 00000000..97916540 --- /dev/null +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Data/Config/AccountConfiguration.cs @@ -0,0 +1,32 @@ +using Microsoft.EntityFrameworkCore.Metadata.Builders; +using Microsoft.EntityFrameworkCore; +using Ubik.Accounting.SalesOrVatTax.Api.Models; + +namespace Ubik.Accounting.SalesOrVatTax.Api.Data.Config +{ + public class AccountConfiguration : IEntityTypeConfiguration + { + public void Configure(EntityTypeBuilder builder) + { + builder.Property(a => a.Code) + .IsRequired() + .HasMaxLength(20); + + builder.Property(a => a.Label) + .IsRequired() + .HasMaxLength(100); + + builder.Property(a => a.TenantId) + .IsRequired(); + + builder.Property(a => a.Active) + .IsRequired() + .HasDefaultValue(true); + + builder.HasIndex(a => new { a.Code, a.TenantId }) + .IsUnique(); + + builder.HasIndex(a => a.TenantId); + } + } +} diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Data/Config/AccountTaxRateConfigConfiguration.cs b/src/Ubik.Accounting.SalesOrVatTax.Api/Data/Config/AccountTaxRateConfigConfiguration.cs new file mode 100644 index 00000000..11ddc1ae --- /dev/null +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Data/Config/AccountTaxRateConfigConfiguration.cs @@ -0,0 +1,48 @@ +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Metadata.Builders; +using Ubik.Accounting.SalesOrVatTax.Api.Models; + +namespace Ubik.Accounting.SalesOrVatTax.Api.Data.Config +{ + public class AccountTaxRateConfigConfiguration : IEntityTypeConfiguration + { + public void Configure(EntityTypeBuilder builder) + { + builder.Property(a => a.Version) + .IsConcurrencyToken(); + + builder.Property(a => a.TenantId) + .IsRequired(); + + builder.Property(a => a.CreatedAt) + .IsRequired(); + + builder.Property(a => a.CreatedBy) + .IsRequired(); + + builder.HasIndex(a => new { a.AccountId, a.TaxRateId }) + .IsUnique(); + + builder.HasIndex(a => a.TenantId); + + builder + .HasOne(s => s.Account) + .WithMany() + .HasForeignKey(e => e.AccountId) + .IsRequired(true); + + builder + .HasOne(s => s.TaxRate) + .WithMany() + .HasForeignKey(e => e.TaxRateId) + .IsRequired(true); + + builder + .HasOne(s => s.TaxAccount) + .WithMany() + .HasForeignKey(e => e.TaxAccountId) + .IsRequired(true); + + } + } +} diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Models/Account.cs b/src/Ubik.Accounting.SalesOrVatTax.Api/Models/Account.cs new file mode 100644 index 00000000..77c30d89 --- /dev/null +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Models/Account.cs @@ -0,0 +1,15 @@ +using Ubik.DB.Common; + +namespace Ubik.Accounting.SalesOrVatTax.Api.Models +{ + // Source of truth => Accounting.Structure.Api + public class Account : ITenantEntity + { + public Guid Id { get; set; } + public required string Code { get; set; } + public required string Label { get; set; } + public bool Active { get; set; } = true; + public Guid Version { get; set; } + public Guid TenantId { get; set; } + } +} diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Models/AccountTaxRateConfig.cs b/src/Ubik.Accounting.SalesOrVatTax.Api/Models/AccountTaxRateConfig.cs new file mode 100644 index 00000000..5db0b129 --- /dev/null +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Models/AccountTaxRateConfig.cs @@ -0,0 +1,19 @@ +namespace Ubik.Accounting.SalesOrVatTax.Api.Models +{ + public class AccountTaxRateConfig + { + public Guid Id { get; set; } + public Guid AccountId { get; set; } + public Account? Account { get; set; } + public Guid TaxRateId { get; set; } + public TaxRate? TaxRate { get; set; } + public Guid TaxAccountId { get; set; } + public Account? TaxAccount { get; set; } + public Guid Version { get; set; } + public Guid TenantId { get; set; } + public required DateTime CreatedAt { get; set; } + public required Guid CreatedBy { get; set; } + public DateTime? ModifiedAt { get; set; } + public Guid? ModifiedBy { get; set; } + } +} diff --git a/src/Ubik.Accounting.Structure.Api/Data/AccountingDbContext.cs b/src/Ubik.Accounting.Structure.Api/Data/AccountingDbContext.cs index b3530a62..bf56c11d 100644 --- a/src/Ubik.Accounting.Structure.Api/Data/AccountingDbContext.cs +++ b/src/Ubik.Accounting.Structure.Api/Data/AccountingDbContext.cs @@ -19,10 +19,8 @@ public class AccountingDbContext(DbContextOptions options public DbSet AccountsAccountGroups { get; set; } public DbSet Classifications { get; set; } public DbSet Currencies { get; set; } - public DbSet Transactions { get; set; } + //public DbSet Transactions { get; set; } //public DbSet Entries { get; set; } - //public DbSet AccountVatConfigs { get; set; } - protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) { @@ -75,9 +73,8 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) new AccountGroupConfiguration().Configure(modelBuilder.Entity()); new AccountConfiguration().Configure(modelBuilder.Entity()); new AccountAccountGroupConfiguration().Configure(modelBuilder.Entity()); - new TransactionConfiguration().Configure(modelBuilder.Entity()); + //new TransactionConfiguration().Configure(modelBuilder.Entity()); //new EntryConfiguration().Configure(modelBuilder.Entity()); - //new AccountVatConfigConfiguration().Configure(modelBuilder.Entity()); base.OnModelCreating(modelBuilder); } @@ -99,14 +96,11 @@ private void SetTenantId(ModelBuilder modelBuilder) modelBuilder.Entity() .HasQueryFilter(mt => mt.TenantId == _currentUser.TenantId); - modelBuilder.Entity() - .HasQueryFilter(mt => mt.TenantId == _currentUser.TenantId); + //modelBuilder.Entity() + // .HasQueryFilter(mt => mt.TenantId == _currentUser.TenantId); //modelBuilder.Entity() // .HasQueryFilter(mt => mt.TenantId == _currentUser.TenantId); - - //modelBuilder.Entity() - // .HasQueryFilter(mt => mt.TenantId == _currentUser.TenantId); } } } diff --git a/src/Ubik.Accounting.Structure.Api/Data/Config/AccountVatConfigConfiguration.cs b/src/Ubik.Accounting.Structure.Api/Data/Config/AccountVatConfigConfiguration.cs deleted file mode 100644 index e6ad0101..00000000 --- a/src/Ubik.Accounting.Structure.Api/Data/Config/AccountVatConfigConfiguration.cs +++ /dev/null @@ -1,47 +0,0 @@ -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Microsoft.EntityFrameworkCore; -using Ubik.Accounting.Structure.Api.Models; - -namespace Ubik.Accounting.Structure.Api.Data.Config -{ - //public class AccountVatConfigConfiguration : IEntityTypeConfiguration - //{ - // public void Configure(EntityTypeBuilder builder) - // { - // builder.Property(a => a.Version) - // .IsConcurrencyToken(); - - // builder.Property(a => a.TenantId) - // .IsRequired(); - - // builder.Property(a => a.CreatedAt) - // .IsRequired(); - - // builder.Property(a => a.CreatedBy) - // .IsRequired(); - - // builder.HasIndex(a => new { a.AccountId, a.VatRateId }) - // .IsUnique(); - - // builder.HasIndex(a => a.TenantId); - - // builder - // .HasOne(s => s.Account) - // .WithMany() - // .HasForeignKey(e => e.AccountId) - // .IsRequired(true); - - // builder - // .HasOne(s => s.VatRate) - // .WithMany() - // .HasForeignKey(e => e.VatRateId) - // .IsRequired(true); - - // builder - // .HasOne(s => s.VatAccount) - // .WithMany() - // .HasForeignKey(e => e.VatAccountId) - // .IsRequired(true); - // } - //} -} diff --git a/src/Ubik.Accounting.Structure.Api/Data/Config/CurrencyConfiguration.cs b/src/Ubik.Accounting.Structure.Api/Data/Config/CurrencyConfiguration.cs index 59a3f788..bb8a5a66 100644 --- a/src/Ubik.Accounting.Structure.Api/Data/Config/CurrencyConfiguration.cs +++ b/src/Ubik.Accounting.Structure.Api/Data/Config/CurrencyConfiguration.cs @@ -14,9 +14,6 @@ public void Configure(EntityTypeBuilder builder) .IsRequired() .HasMaxLength(3); - builder.Property(a => a.Version) - .IsConcurrencyToken(); - builder.Property(a => a.TenantId) .IsRequired(); diff --git a/src/Ubik.Accounting.Structure.Api/Data/Config/EntryConfiguration.cs b/src/Ubik.Accounting.Structure.Api/Data/Config/EntryConfiguration.cs index ee1370bf..2b8131a2 100644 --- a/src/Ubik.Accounting.Structure.Api/Data/Config/EntryConfiguration.cs +++ b/src/Ubik.Accounting.Structure.Api/Data/Config/EntryConfiguration.cs @@ -2,6 +2,7 @@ using Microsoft.EntityFrameworkCore; using Ubik.Accounting.Structure.Api.Models; +//Will be put in a dedicated service namespace Ubik.Accounting.Structure.Api.Data.Config { //public class EntryConfiguration : IEntityTypeConfiguration diff --git a/src/Ubik.Accounting.Structure.Api/Data/Config/TransactionConfiguration.cs b/src/Ubik.Accounting.Structure.Api/Data/Config/TransactionConfiguration.cs index 845e7260..46049cc8 100644 --- a/src/Ubik.Accounting.Structure.Api/Data/Config/TransactionConfiguration.cs +++ b/src/Ubik.Accounting.Structure.Api/Data/Config/TransactionConfiguration.cs @@ -2,35 +2,36 @@ using Microsoft.EntityFrameworkCore.Metadata.Builders; using Ubik.Accounting.Structure.Api.Models; +//Will be put in a dedicated service namespace Ubik.Accounting.Structure.Api.Data.Config { - public class TransactionConfiguration : IEntityTypeConfiguration - { - public void Configure(EntityTypeBuilder builder) - { - builder.Property(a => a.Label) - .IsRequired() - .HasMaxLength(100); + //public class TransactionConfiguration : IEntityTypeConfiguration + //{ + // public void Configure(EntityTypeBuilder builder) + // { + // builder.Property(a => a.Label) + // .IsRequired() + // .HasMaxLength(100); - builder.Property(a => a.Amount) - .IsRequired() - .HasPrecision(18, 4); + // builder.Property(a => a.Amount) + // .IsRequired() + // .HasPrecision(18, 4); - builder.Property(a => a.Version) - .IsConcurrencyToken(); + // builder.Property(a => a.Version) + // .IsConcurrencyToken(); - builder.Property(a => a.TenantId) - .IsRequired(); + // builder.Property(a => a.TenantId) + // .IsRequired(); - builder.Property(a => a.CreatedAt) - .IsRequired(); + // builder.Property(a => a.CreatedAt) + // .IsRequired(); - builder.Property(a => a.CreatedBy) - .IsRequired(); + // builder.Property(a => a.CreatedBy) + // .IsRequired(); - builder.HasIndex(a => a.TenantId); + // builder.HasIndex(a => a.TenantId); - builder.HasIndex(a => a.ValueDate); - } - } + // builder.HasIndex(a => a.ValueDate); + // } + //} } diff --git a/src/Ubik.Accounting.Structure.Api/Models/AccountVatConfig.cs b/src/Ubik.Accounting.Structure.Api/Models/AccountVatConfig.cs deleted file mode 100644 index 22ef5aa7..00000000 --- a/src/Ubik.Accounting.Structure.Api/Models/AccountVatConfig.cs +++ /dev/null @@ -1,21 +0,0 @@ -using Ubik.DB.Common; - -namespace Ubik.Accounting.Structure.Api.Models -{ - //public class AccountVatConfig : ITenantEntity, IConcurrencyCheckEntity, IAuditEntity - //{ - // public Guid Id { get; set; } - // public Guid AccountId { get; set; } - // public Account? Account { get; set; } - // public Guid VatRateId { get; set; } - // public VatRate? VatRate { get; set; } - // public Guid VatAccountId { get; set; } - // public Account? VatAccount { get; set; } - // public Guid Version { get; set; } - // public Guid TenantId { get; set; } - // public required DateTime CreatedAt { get; set; } - // public required Guid CreatedBy { get; set; } - // public DateTime? ModifiedAt { get; set; } - // public Guid? ModifiedBy { get; set; } - //} -} diff --git a/src/Ubik.Accounting.Structure.Api/Models/Entry.cs b/src/Ubik.Accounting.Structure.Api/Models/Entry.cs index fe5bb008..7c3f741f 100644 --- a/src/Ubik.Accounting.Structure.Api/Models/Entry.cs +++ b/src/Ubik.Accounting.Structure.Api/Models/Entry.cs @@ -1,6 +1,7 @@ using Microsoft.EntityFrameworkCore; using Ubik.DB.Common; +//Will be put in a dedicated service namespace Ubik.Accounting.Structure.Api.Models { //public enum DebitCredit diff --git a/src/Ubik.Accounting.Structure.Api/Models/Transaction.cs b/src/Ubik.Accounting.Structure.Api/Models/Transaction.cs index e0e4ba09..155c9f01 100644 --- a/src/Ubik.Accounting.Structure.Api/Models/Transaction.cs +++ b/src/Ubik.Accounting.Structure.Api/Models/Transaction.cs @@ -2,19 +2,19 @@ namespace Ubik.Accounting.Structure.Api.Models { - + //Will be put in a dedicated service //Containes the entries packet - public class Transaction : ITenantEntity, IConcurrencyCheckEntity, IAuditEntity - { - public Guid Id { get; set; } - public required DateTime ValueDate { get; set; } - public required string Label { get; set; } - public decimal Amount { get; set; } - public Guid Version { get; set; } - public Guid TenantId { get; set; } - public required DateTime CreatedAt { get; set; } - public required Guid CreatedBy { get; set; } - public DateTime? ModifiedAt { get; set; } - public Guid? ModifiedBy { get; set; } - } + //public class Transaction : ITenantEntity, IConcurrencyCheckEntity, IAuditEntity + //{ + // public Guid Id { get; set; } + // public required DateTime ValueDate { get; set; } + // public required string Label { get; set; } + // public decimal Amount { get; set; } + // public Guid Version { get; set; } + // public Guid TenantId { get; set; } + // public required DateTime CreatedAt { get; set; } + // public required Guid CreatedBy { get; set; } + // public DateTime? ModifiedAt { get; set; } + // public Guid? ModifiedBy { get; set; } + //} } diff --git a/src/Ubik.Accounting.WebApp/Program.cs b/src/Ubik.Accounting.WebApp/Program.cs index 55f2fb42..c56ee4ac 100644 --- a/src/Ubik.Accounting.WebApp/Program.cs +++ b/src/Ubik.Accounting.WebApp/Program.cs @@ -43,7 +43,6 @@ //TODO: put that in a lib project Auth //TODO: this is very dependant to distributed cache (if no cache => no site, see if it's bad) -//TODO: do better and use UserId in cache var authOptions = new AuthServerOptions(); builder.Configuration.GetSection(AuthServerOptions.Position).Bind(authOptions); diff --git a/src/Ubik.YarpProxy/Program.cs b/src/Ubik.YarpProxy/Program.cs index 64652bfd..64044e91 100644 --- a/src/Ubik.YarpProxy/Program.cs +++ b/src/Ubik.YarpProxy/Program.cs @@ -30,8 +30,10 @@ if (authOptions.AuthorizeBadCert) { //TODO; remove that shit on prod... only for DEV keycloak Minikube - HttpClientHandler handler = new HttpClientHandler(); - handler.ServerCertificateCustomValidationCallback = HttpClientHandler.DangerousAcceptAnyServerCertificateValidator; + HttpClientHandler handler = new() + { + ServerCertificateCustomValidationCallback = HttpClientHandler.DangerousAcceptAnyServerCertificateValidator + }; o.BackchannelHttpHandler = handler; } }); From 9ddc02c262da5646a6032c02ef510c069271debc Mon Sep 17 00:00:00 2001 From: ubik Date: Fri, 1 Nov 2024 14:17:27 +0100 Subject: [PATCH 17/94] typo --- src/Ubik.Accounting.WebApp/Security/TokenCacheService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Ubik.Accounting.WebApp/Security/TokenCacheService.cs b/src/Ubik.Accounting.WebApp/Security/TokenCacheService.cs index 373a8f12..b915487d 100644 --- a/src/Ubik.Accounting.WebApp/Security/TokenCacheService.cs +++ b/src/Ubik.Accounting.WebApp/Security/TokenCacheService.cs @@ -50,7 +50,7 @@ await _cache.SetAsync($"webapp_{token.UserId}", toCache, { if (cachedResult.ExpiresRefreshUtc < DateTimeOffset.UtcNow.AddSeconds(10)) { - await RemoveUserTokenAsync($"webapp_{userId}"); + await RemoveUserTokenAsync(userId); return null; } } From 2a420e31d109a3f0a621e222aed96678cd32ba20 Mon Sep 17 00:00:00 2001 From: ubik Date: Fri, 1 Nov 2024 16:12:00 +0100 Subject: [PATCH 18/94] typo --- tests/Ubik.Api.Tests.Integration/BaseIntegrationTest.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Ubik.Api.Tests.Integration/BaseIntegrationTest.cs b/tests/Ubik.Api.Tests.Integration/BaseIntegrationTest.cs index 6bc52084..da89391e 100644 --- a/tests/Ubik.Api.Tests.Integration/BaseIntegrationTest.cs +++ b/tests/Ubik.Api.Tests.Integration/BaseIntegrationTest.cs @@ -56,7 +56,7 @@ internal async Task GetAccessTokenAsync(TokenType tokenType) break; } - HttpResponseMessage response = _authHttpClient.PostAsync($"protocol/openid-connect/token", new FormUrlEncodedContent(dict)).Result; + HttpResponseMessage response = await _authHttpClient.PostAsync($"protocol/openid-connect/token", new FormUrlEncodedContent(dict)); if (response.IsSuccessStatusCode) { var token = await response.Content.ReadFromJsonAsync(); From 49e933421286a1e5807d2c8d243418d806c43008 Mon Sep 17 00:00:00 2001 From: ubik Date: Fri, 1 Nov 2024 16:39:25 +0100 Subject: [PATCH 19/94] Again a new better way to manage token at each call... not only when openId cookie check. I think it will work better --- src/Ubik.Accounting.WebApp/Program.cs | 38 ++--------- .../Security/TokenCacheService.cs | 67 ++++++++++++++++--- 2 files changed, 66 insertions(+), 39 deletions(-) diff --git a/src/Ubik.Accounting.WebApp/Program.cs b/src/Ubik.Accounting.WebApp/Program.cs index c56ee4ac..a8bd033f 100644 --- a/src/Ubik.Accounting.WebApp/Program.cs +++ b/src/Ubik.Accounting.WebApp/Program.cs @@ -45,7 +45,8 @@ //TODO: this is very dependant to distributed cache (if no cache => no site, see if it's bad) var authOptions = new AuthServerOptions(); builder.Configuration.GetSection(AuthServerOptions.Position).Bind(authOptions); - +builder.Services.Configure( + builder.Configuration.GetSection(AuthServerOptions.Position)); builder.Services.AddAuthentication(options => @@ -76,36 +77,6 @@ x.RejectPrincipal(); return; } - - //If token expired - if (actualToken.ExpiresUtc < DateTimeOffset.UtcNow.AddSeconds(10) && actualToken.ExpiresRefreshUtc > DateTimeOffset.UtcNow.AddSeconds(10)) - { - var response = await new HttpClient().RequestRefreshTokenAsync(new RefreshTokenRequest - { - Address = authOptions.TokenUrl, - ClientId = authOptions.ClientId, - ClientSecret = authOptions.ClientSecret, - RefreshToken = actualToken.RefreshToken, - GrantType = "refresh_token", - }); - - if (!response.IsError) - { - await cache.SetUserTokenAsync(new TokenCacheEntry - { - UserId = userId, - RefreshToken = response.RefreshToken!, - AccessToken = response.AccessToken!, - ExpiresUtc = new JwtSecurityToken(response.AccessToken).ValidTo, - ExpiresRefreshUtc = DateTimeOffset.UtcNow.AddMinutes(authOptions.RefreshTokenExpTimeInMinutes) - }); - } - else - { - x.RejectPrincipal(); - return; - } - } } }; }) @@ -189,6 +160,11 @@ await cache.SetUserTokenAsync(new TokenCacheEntry options.BaseAddress = new Uri(userServiceClientOpt.SecurityUrl); }); +builder.Services.AddHttpClient("TokenClient", options => +{ + options.BaseAddress = new Uri(authOptions.TokenUrl); +}); + builder.Services.AddScoped(); builder.Services.Configure(options => diff --git a/src/Ubik.Accounting.WebApp/Security/TokenCacheService.cs b/src/Ubik.Accounting.WebApp/Security/TokenCacheService.cs index b915487d..e14361fb 100644 --- a/src/Ubik.Accounting.WebApp/Security/TokenCacheService.cs +++ b/src/Ubik.Accounting.WebApp/Security/TokenCacheService.cs @@ -1,6 +1,8 @@ -using Microsoft.EntityFrameworkCore.Metadata.Internal; +using IdentityModel.Client; +using Microsoft.EntityFrameworkCore.Metadata.Internal; using Microsoft.Extensions.Caching.Distributed; using Microsoft.Extensions.Options; +using System.IdentityModel.Tokens.Jwt; using System.Text.Json; using System.Text.Json.Serialization; using Ubik.Accounting.WebApp.Shared.Security; @@ -9,10 +11,12 @@ namespace Ubik.Accounting.WebApp.Security { - public class TokenCacheService(IDistributedCache cache, IOptions authOptions) + public class TokenCacheService(IDistributedCache cache, IOptions authOptions, IHttpClientFactory factory) { private readonly IDistributedCache _cache = cache; private readonly AuthServerOptions _authOptions = authOptions.Value; + private readonly HttpClient _httpClient = factory.CreateClient("TokenClient"); + private static readonly JsonSerializerOptions _serializerOptions = new() { PropertyNamingPolicy = null, @@ -46,18 +50,65 @@ await _cache.SetAsync($"webapp_{token.UserId}", toCache, if (cachedResult == null) return null; - if (cachedResult.ExpiresUtc < DateTimeOffset.UtcNow.AddSeconds(10)) + cachedResult = await RefreshTokenAsync(cachedResult, userId); + + return cachedResult; + } + + private async Task RefreshTokenAsync(TokenCacheEntry actualToken, string userId) + { + + if (actualToken.ExpiresUtc > DateTimeOffset.UtcNow.AddSeconds(10)) { - if (cachedResult.ExpiresRefreshUtc < DateTimeOffset.UtcNow.AddSeconds(10)) + //No need to refresh + return actualToken; + } + else + { + if (actualToken.ExpiresRefreshUtc > DateTimeOffset.UtcNow.AddSeconds(10)) { - await RemoveUserTokenAsync(userId); - return null; + //Can try a refresh + var dict = ValuesForRefresh(actualToken.RefreshToken); + HttpResponseMessage response = await _httpClient.PostAsync("", new FormUrlEncodedContent(dict)); + + if (response.IsSuccessStatusCode) + { + var token = await ProtocolResponse.FromHttpResponseAsync(response); + + if (token != null) + { + var newToken = new TokenCacheEntry + { + UserId = userId, + RefreshToken = token.RefreshToken!, + AccessToken = token.AccessToken!, + ExpiresUtc = new JwtSecurityToken(token.AccessToken).ValidTo, + ExpiresRefreshUtc = DateTimeOffset.UtcNow.AddMinutes(_authOptions.RefreshTokenExpTimeInMinutes) + }; + + //Refresh successful + await SetUserTokenAsync(newToken); + return newToken; + } + } } + //Too old to refresh or refresh not successful + await RemoveUserTokenAsync(userId); + return null; } - - return cachedResult; } + private Dictionary ValuesForRefresh(string token) + { + return new Dictionary + { + { "Content-Type", "application/x-www-form-urlencoded" }, + { "client_id", _authOptions.ClientId }, + { "client_secret", _authOptions.ClientSecret }, + { "refresh_token", token }, + { "grant_type", "refresh_token" }, + }; + } public async Task SetUserInfoAsync(UserAdminOrMeResult userInfo) { var toCache = JsonSerializer.SerializeToUtf8Bytes(userInfo, options: _serializerOptions); From 5809d3878fcd540a7f67ee9fec04f57a8aaa6f76 Mon Sep 17 00:00:00 2001 From: ubik Date: Fri, 1 Nov 2024 18:51:55 +0100 Subject: [PATCH 20/94] Ok, token management is working better and in minikube too. Only session management is missing. --- deploy/keycloack/ingress-for-keycloack.yaml | 2 +- src/Ubik.Accounting.WebApp/Program.cs | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/deploy/keycloack/ingress-for-keycloack.yaml b/deploy/keycloack/ingress-for-keycloack.yaml index 6e42c011..02bf4af8 100644 --- a/deploy/keycloack/ingress-for-keycloack.yaml +++ b/deploy/keycloack/ingress-for-keycloack.yaml @@ -14,7 +14,7 @@ metadata: annotations: nginx.ingress.kubernetes.io/rewrite-target: / nginx.ingress.kubernetes.io/enable-cors: "true" - nginx.ingress.kubernetes.io/cors-allow-origin: "http://ubik-proxy, http://ubik-webapp, https://ubik-webapp" + nginx.ingress.kubernetes.io/cors-allow-origin: "*" nginx.ingress.kubernetes.io/cors-allow-methods: "PUT, GET, POST, OPTIONS, DELETE" nginx.ingress.kubernetes.io/cors-allow-headers: "DNT,X-CustomHeader,X-LANG,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,X-Api-Key,X-Device-Id,Access-Control-Allow-Origin" nginx.ingress.kubernetes.io/configuration-snippet: | diff --git a/src/Ubik.Accounting.WebApp/Program.cs b/src/Ubik.Accounting.WebApp/Program.cs index a8bd033f..767e8f09 100644 --- a/src/Ubik.Accounting.WebApp/Program.cs +++ b/src/Ubik.Accounting.WebApp/Program.cs @@ -163,6 +163,15 @@ builder.Services.AddHttpClient("TokenClient", options => { options.BaseAddress = new Uri(authOptions.TokenUrl); +}).ConfigurePrimaryHttpMessageHandler(() => { + + var httpClientHandler = new HttpClientHandler(); + + if(authOptions.AuthorizeBadCert) + { + httpClientHandler.ServerCertificateCustomValidationCallback = HttpClientHandler.DangerousAcceptAnyServerCertificateValidator; + } + return httpClientHandler; }); builder.Services.AddScoped(); From 40f9248f32078f9a884879f5612e6ab083317cb6 Mon Sep 17 00:00:00 2001 From: ubik Date: Fri, 1 Nov 2024 19:46:49 +0100 Subject: [PATCH 21/94] comment --- src/Ubik.Accounting.WebApp/Program.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Ubik.Accounting.WebApp/Program.cs b/src/Ubik.Accounting.WebApp/Program.cs index 767e8f09..9c508afd 100644 --- a/src/Ubik.Accounting.WebApp/Program.cs +++ b/src/Ubik.Accounting.WebApp/Program.cs @@ -165,6 +165,7 @@ options.BaseAddress = new Uri(authOptions.TokenUrl); }).ConfigurePrimaryHttpMessageHandler(() => { + //TODO; remove that shit on prod... only for DEV keycloak Minikube var httpClientHandler = new HttpClientHandler(); if(authOptions.AuthorizeBadCert) From b4a7584629ed425cff10c3b4f14a00282f9606ac Mon Sep 17 00:00:00 2001 From: ubik Date: Fri, 1 Nov 2024 21:24:23 +0100 Subject: [PATCH 22/94] prob certifi, i don't know why it works now --- .../Properties/launchSettings.json | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Properties/launchSettings.json b/src/Ubik.Accounting.SalesOrVatTax.Api/Properties/launchSettings.json index fabad2ed..0fb4ed2e 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Api/Properties/launchSettings.json +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Properties/launchSettings.json @@ -12,7 +12,6 @@ }, "https": { "commandName": "Project", - "launchBrowser": false, "launchUrl": "swagger", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" @@ -38,6 +37,15 @@ }, "publishAllPorts": true, "useSSL": true + }, + "WSL": { + "commandName": "WSL2", + "launchUrl": "https://localhost:7210/swagger", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development", + "ASPNETCORE_URLS": "https://localhost:7210;http://localhost:5284" + }, + "distributionName": "" } }, "$schema": "http://json.schemastore.org/launchsettings.json", @@ -49,4 +57,4 @@ "sslPort": 44316 } } -} +} \ No newline at end of file From 5ba1466fd8ca882e0def046e6e9dc6f4104db602 Mon Sep 17 00:00:00 2001 From: ubik Date: Sat, 2 Nov 2024 15:29:30 +0100 Subject: [PATCH 23/94] Prepare for tax rates endpoints --- .../Data/Init/DbInitializer.cs | 10 ++++++ .../Data/Init/TaxRatesData.cs | 17 +++++++++ .../Data/Init/TaxRatesData.sql | 5 +++ .../Program.cs | 3 +- .../Ubik.Accounting.SalesOrVatTax.Api.csproj | 4 --- src/Ubik.YarpProxy/appsettings.json | 36 +++++++++++++++++++ ...aseIntegrationTestAccountingSalesVatTax.cs | 30 ++++++++++++++++ ...=> BaseIntegrationTestAccountingStruct.cs} | 4 +-- .../AccountGroupsController_Test.cs | 2 +- .../Accounts/AccountsController_Test.cs | 2 +- .../ClassificationsController_Test.cs | 2 +- .../Currencies/CurrenciesController_Test.cs | 2 +- 12 files changed, 106 insertions(+), 11 deletions(-) create mode 100644 src/Ubik.Accounting.SalesOrVatTax.Api/Data/Init/DbInitializer.cs create mode 100644 src/Ubik.Accounting.SalesOrVatTax.Api/Data/Init/TaxRatesData.cs create mode 100644 src/Ubik.Accounting.SalesOrVatTax.Api/Data/Init/TaxRatesData.sql create mode 100644 tests/Ubik.Api.Tests.Integration/BaseIntegrationTestAccountingSalesVatTax.cs rename tests/Ubik.Api.Tests.Integration/{BaseIntegrationTestAccounting.cs => BaseIntegrationTestAccountingStruct.cs} (81%) diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Data/Init/DbInitializer.cs b/src/Ubik.Accounting.SalesOrVatTax.Api/Data/Init/DbInitializer.cs new file mode 100644 index 00000000..655cd35c --- /dev/null +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Data/Init/DbInitializer.cs @@ -0,0 +1,10 @@ +namespace Ubik.Accounting.SalesOrVatTax.Api.Data.Init +{ + static internal class DbInitializer + { + static internal async Task InitializeAsync(AccountingSalesTaxDbContext context) + { + await TaxRatesData.LoadAsync(context); + } + } +} diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Data/Init/TaxRatesData.cs b/src/Ubik.Accounting.SalesOrVatTax.Api/Data/Init/TaxRatesData.cs new file mode 100644 index 00000000..4eead37b --- /dev/null +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Data/Init/TaxRatesData.cs @@ -0,0 +1,17 @@ +using Microsoft.EntityFrameworkCore; +using System.Runtime.CompilerServices; + +namespace Ubik.Accounting.SalesOrVatTax.Api.Data.Init +{ + internal static class TaxRatesData + { + internal static async Task LoadAsync(AccountingSalesTaxDbContext context) + { + if (!context.TaxRates.Any()) + { + var query = await File.ReadAllTextAsync(@"Data/Init/TaxRatesData.sql"); + await context.Database.ExecuteSqlAsync(FormattableStringFactory.Create(query)); + } + } + } +} diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Data/Init/TaxRatesData.sql b/src/Ubik.Accounting.SalesOrVatTax.Api/Data/Init/TaxRatesData.sql new file mode 100644 index 00000000..d14daf39 --- /dev/null +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Data/Init/TaxRatesData.sql @@ -0,0 +1,5 @@ +INSERT INTO public.tax_rates (id, valid_from, valid_to, code, description, rate, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('08740000-3c36-7456-6f96-08dcfb48b915', '2024-11-02 14:14:15.468+00', NULL, 'v81', 'Normal VAT for CH', 8.10000, '08740000-3c36-7456-e579-08dcfb48b921', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-11-02 14:14:54.197961+00', 'c8660000-3c36-7456-580a-08dce562105f', '2024-11-02 14:14:54.197961+00', 'c8660000-3c36-7456-580a-08dce562105f'); +INSERT INTO public.tax_rates (id, valid_from, valid_to, code, description, rate, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('08740000-3c36-7456-dc84-08dcfb48d62d', '2024-11-02 14:14:15.468+00', NULL, 'v38', 'Reduced VAT for CH', 3.80000, '08740000-3c36-7456-e8f3-08dcfb48d62d', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-11-02 14:15:42.931737+00', 'c8660000-3c36-7456-580a-08dce562105f', '2024-11-02 14:15:42.931737+00', 'c8660000-3c36-7456-580a-08dce562105f'); +INSERT INTO public.tax_rates (id, valid_from, valid_to, code, description, rate, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('08740000-3c36-7456-8815-08dcfb48e185', '2024-11-02 14:14:15.468+00', NULL, 'v26', 'Reduced VAT for CH 2', 2.60000, '08740000-3c36-7456-a29b-08dcfb48e185', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-11-02 14:16:01.961633+00', 'c8660000-3c36-7456-580a-08dce562105f', '2024-11-02 14:16:01.961633+00', 'c8660000-3c36-7456-580a-08dce562105f'); +INSERT INTO public.tax_rates (id, valid_from, valid_to, code, description, rate, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('e4220000-3c36-7456-212b-08dcfb4a3d2b', '2024-11-02T14:25:19.738Z', NULL, 'v26', 'test-to-del', 2.60000, 'e4220000-3c36-7456-6f15-08dcfb4a3d37', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-11-02 14:16:01.961633+00', 'c8660000-3c36-7456-580a-08dce562105f', '2024-11-02 14:16:01.961633+00', 'c8660000-3c36-7456-580a-08dce562105f'); +INSERT INTO public.tax_rates (id, valid_from, valid_to, code, description, rate, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('e4220000-3c36-7456-d3e1-08dcfb4a4b65', '2024-11-02T14:25:19.738Z', NULL, 'v26', 'test-to-upd', 2.60000, 'e4220000-3c36-7456-088c-08dcfb4a4b66', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-11-02 14:16:01.961633+00', 'c8660000-3c36-7456-580a-08dce562105f', '2024-11-02 14:16:01.961633+00', 'c8660000-3c36-7456-580a-08dce562105f'); diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Program.cs b/src/Ubik.Accounting.SalesOrVatTax.Api/Program.cs index f692699d..3d298421 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Api/Program.cs +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Program.cs @@ -6,6 +6,7 @@ using System.Reflection; using System.Text.Json.Serialization; using Ubik.Accounting.SalesOrVatTax.Api.Data; +using Ubik.Accounting.SalesOrVatTax.Api.Data.Init; using Ubik.Accounting.SalesOrVatTax.Api.Features.TaxRates.Services; using Ubik.ApiService.Common.Configure; using Ubik.ApiService.Common.Configure.Options; @@ -137,7 +138,7 @@ context.Database.EnsureDeleted(); context.Database.EnsureCreated(); - //await DbInitializer.InitializeAsync(context); + await DbInitializer.InitializeAsync(context); } app.UseWhen( diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Ubik.Accounting.SalesOrVatTax.Api.csproj b/src/Ubik.Accounting.SalesOrVatTax.Api/Ubik.Accounting.SalesOrVatTax.Api.csproj index 846f17e3..74527e56 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Api/Ubik.Accounting.SalesOrVatTax.Api.csproj +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Ubik.Accounting.SalesOrVatTax.Api.csproj @@ -33,8 +33,4 @@ - - - - diff --git a/src/Ubik.YarpProxy/appsettings.json b/src/Ubik.YarpProxy/appsettings.json index 1babed48..3872b8ac 100644 --- a/src/Ubik.YarpProxy/appsettings.json +++ b/src/Ubik.YarpProxy/appsettings.json @@ -319,6 +319,42 @@ "Methods": [ "GET" ] }, "Transforms": [ { "PathPattern": "/api/{apiversion}/sales-vat-tax/taxrates" } ] + }, + "route_accounting_sales_vat_tax_get_by_id": { + "ClusterId": "ubik_accounting_sales_vat_tax", + "AuthorizationPolicy": "CanSalesOrVatTaxRatesRead", + "Match": { + "Path": "/accounting/api/{apiversion}/sales-vat-tax/taxrates/{id:guid}", + "Methods": [ "GET" ] + }, + "Transforms": [ { "PathPattern": "/api/{apiversion}/sales-vat-tax/taxrates/{id:guid}" } ] + }, + "route_accounting_sales_vat_tax_add": { + "ClusterId": "ubik_accounting_sales_vat_tax", + "AuthorizationPolicy": "CanSalesOrVatTaxRatesWrite", + "Match": { + "Path": "/accounting/api/{apiversion}/sales-vat-tax/taxrates", + "Methods": [ "POST" ] + }, + "Transforms": [ { "PathPattern": "/api/{apiversion}/sales-vat-tax/taxrates" } ] + }, + "route_accounting_sales_vat_tax_update": { + "ClusterId": "ubik_accounting_sales_vat_tax", + "AuthorizationPolicy": "CanSalesOrVatTaxRatesWrite", + "Match": { + "Path": "/accounting/api/{apiversion}/sales-vat-tax/taxrates/{id:guid}", + "Methods": [ "PUT" ] + }, + "Transforms": [ { "PathPattern": "/api/{apiversion}/sales-vat-tax/taxrates/{id:guid}" } ] + }, + "route_accounting_sales_vat_tax_delete": { + "ClusterId": "ubik_accounting_sales_vat_tax", + "AuthorizationPolicy": "CanSalesOrVatTaxRatesWrite", + "Match": { + "Path": "/accounting/api/{apiversion}/sales-vat-tax/taxrates/{id:guid}", + "Methods": [ "DELETE" ] + }, + "Transforms": [ { "PathPattern": "/api/{apiversion}/sales-vat-tax/taxrates/{id:guid}" } ] } }, "Clusters": { diff --git a/tests/Ubik.Api.Tests.Integration/BaseIntegrationTestAccountingSalesVatTax.cs b/tests/Ubik.Api.Tests.Integration/BaseIntegrationTestAccountingSalesVatTax.cs new file mode 100644 index 00000000..efb3a155 --- /dev/null +++ b/tests/Ubik.Api.Tests.Integration/BaseIntegrationTestAccountingSalesVatTax.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Net.Http.Headers; +using System.Text; +using System.Threading.Tasks; + +namespace Ubik.Api.Tests.Integration +{ + internal class BaseIntegrationTestAccountingSalesVatTax : BaseIntegrationTest + { + internal BaseIntegrationTestAccountingSalesVatTax(IntegrationTestProxyFactory factory) : base(factory) + { + } + + protected override async Task CleanupDb() + { + if (!Factory.IsDbCleanedAccounting) + { + using var client = Factory.CreateClient(); + var token = await GetAccessTokenAsync(TokenType.MegaAdmin); + client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); + + var response = await client.DeleteAsync($"/accounting/admin/api/v1/application/cleanupdb"); + response.EnsureSuccessStatusCode(); + Factory.IsDbCleanedAccounting = true; + } + } + } +} diff --git a/tests/Ubik.Api.Tests.Integration/BaseIntegrationTestAccounting.cs b/tests/Ubik.Api.Tests.Integration/BaseIntegrationTestAccountingStruct.cs similarity index 81% rename from tests/Ubik.Api.Tests.Integration/BaseIntegrationTestAccounting.cs rename to tests/Ubik.Api.Tests.Integration/BaseIntegrationTestAccountingStruct.cs index dad11833..d2583097 100644 --- a/tests/Ubik.Api.Tests.Integration/BaseIntegrationTestAccounting.cs +++ b/tests/Ubik.Api.Tests.Integration/BaseIntegrationTestAccountingStruct.cs @@ -7,9 +7,9 @@ namespace Ubik.Api.Tests.Integration { - public abstract class BaseIntegrationTestAccounting : BaseIntegrationTest + public abstract class BaseIntegrationTestAccountingStruct : BaseIntegrationTest { - internal BaseIntegrationTestAccounting(IntegrationTestProxyFactory factory) : base(factory) + internal BaseIntegrationTestAccountingStruct(IntegrationTestProxyFactory factory) : base(factory) { } diff --git a/tests/Ubik.Api.Tests.Integration/Features/Accounting/AccountGroups/AccountGroupsController_Test.cs b/tests/Ubik.Api.Tests.Integration/Features/Accounting/AccountGroups/AccountGroupsController_Test.cs index de158727..0cf12b8f 100644 --- a/tests/Ubik.Api.Tests.Integration/Features/Accounting/AccountGroups/AccountGroupsController_Test.cs +++ b/tests/Ubik.Api.Tests.Integration/Features/Accounting/AccountGroups/AccountGroupsController_Test.cs @@ -17,7 +17,7 @@ namespace Ubik.Api.Tests.Integration.Features.Accounting.AccountGroups { - public class AccountGroupsController_Test : BaseIntegrationTestAccounting + public class AccountGroupsController_Test : BaseIntegrationTestAccountingStruct { private readonly string _baseUrlForV1; private readonly HttpClient _client; diff --git a/tests/Ubik.Api.Tests.Integration/Features/Accounting/Accounts/AccountsController_Test.cs b/tests/Ubik.Api.Tests.Integration/Features/Accounting/Accounts/AccountsController_Test.cs index 1d1f6669..08aedd2e 100644 --- a/tests/Ubik.Api.Tests.Integration/Features/Accounting/Accounts/AccountsController_Test.cs +++ b/tests/Ubik.Api.Tests.Integration/Features/Accounting/Accounts/AccountsController_Test.cs @@ -16,7 +16,7 @@ namespace Ubik.Api.Tests.Integration.Features.Accounting.Accounts { //TODO: write a test case when account is linked to existing accounting entries - public class AccountsController_Test : BaseIntegrationTestAccounting + public class AccountsController_Test : BaseIntegrationTestAccountingStruct { private readonly string _baseUrlForV1; private readonly HttpClient _client; diff --git a/tests/Ubik.Api.Tests.Integration/Features/Accounting/Classifications/ClassificationsController_Test.cs b/tests/Ubik.Api.Tests.Integration/Features/Accounting/Classifications/ClassificationsController_Test.cs index 111ab06b..f62804f0 100644 --- a/tests/Ubik.Api.Tests.Integration/Features/Accounting/Classifications/ClassificationsController_Test.cs +++ b/tests/Ubik.Api.Tests.Integration/Features/Accounting/Classifications/ClassificationsController_Test.cs @@ -16,7 +16,7 @@ namespace Ubik.Api.Tests.Integration.Features.Accounting.Classifications { - public class ClassificationsController_Test : BaseIntegrationTestAccounting + public class ClassificationsController_Test : BaseIntegrationTestAccountingStruct { private readonly string _baseUrlForV1; private readonly HttpClient _client; diff --git a/tests/Ubik.Api.Tests.Integration/Features/Accounting/Currencies/CurrenciesController_Test.cs b/tests/Ubik.Api.Tests.Integration/Features/Accounting/Currencies/CurrenciesController_Test.cs index 66422e01..c8eeb6d9 100644 --- a/tests/Ubik.Api.Tests.Integration/Features/Accounting/Currencies/CurrenciesController_Test.cs +++ b/tests/Ubik.Api.Tests.Integration/Features/Accounting/Currencies/CurrenciesController_Test.cs @@ -12,7 +12,7 @@ namespace Ubik.Api.Tests.Integration.Features.Accounting.Currencies { - public class CurrenciesController_Test : BaseIntegrationTestAccounting + public class CurrenciesController_Test : BaseIntegrationTestAccountingStruct { private readonly string _baseUrlForV1; private readonly HttpClient _client; From 1f3669dffea8dc1aff921ccbacacdf5644c9eed6 Mon Sep 17 00:00:00 2001 From: ubik Date: Sat, 2 Nov 2024 15:41:09 +0100 Subject: [PATCH 24/94] Cleanup endpoint for integration tests --- .../Data/Init/TaxRatesData.sql | 4 +-- .../Controllers/v1/ApplicationController.cs | 24 ++++++++++++++++ .../Services/ApplicationCommandService.cs | 28 +++++++++++++++++++ .../Services/IApplicationCommandService.cs | 7 +++++ .../Program.cs | 2 ++ src/Ubik.YarpProxy/appsettings.json | 8 ++++++ 6 files changed, 71 insertions(+), 2 deletions(-) create mode 100644 src/Ubik.Accounting.SalesOrVatTax.Api/Features/Application/Controllers/v1/ApplicationController.cs create mode 100644 src/Ubik.Accounting.SalesOrVatTax.Api/Features/Application/Services/ApplicationCommandService.cs create mode 100644 src/Ubik.Accounting.SalesOrVatTax.Api/Features/Application/Services/IApplicationCommandService.cs diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Data/Init/TaxRatesData.sql b/src/Ubik.Accounting.SalesOrVatTax.Api/Data/Init/TaxRatesData.sql index d14daf39..a89b1c72 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Api/Data/Init/TaxRatesData.sql +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Data/Init/TaxRatesData.sql @@ -1,5 +1,5 @@ INSERT INTO public.tax_rates (id, valid_from, valid_to, code, description, rate, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('08740000-3c36-7456-6f96-08dcfb48b915', '2024-11-02 14:14:15.468+00', NULL, 'v81', 'Normal VAT for CH', 8.10000, '08740000-3c36-7456-e579-08dcfb48b921', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-11-02 14:14:54.197961+00', 'c8660000-3c36-7456-580a-08dce562105f', '2024-11-02 14:14:54.197961+00', 'c8660000-3c36-7456-580a-08dce562105f'); INSERT INTO public.tax_rates (id, valid_from, valid_to, code, description, rate, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('08740000-3c36-7456-dc84-08dcfb48d62d', '2024-11-02 14:14:15.468+00', NULL, 'v38', 'Reduced VAT for CH', 3.80000, '08740000-3c36-7456-e8f3-08dcfb48d62d', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-11-02 14:15:42.931737+00', 'c8660000-3c36-7456-580a-08dce562105f', '2024-11-02 14:15:42.931737+00', 'c8660000-3c36-7456-580a-08dce562105f'); INSERT INTO public.tax_rates (id, valid_from, valid_to, code, description, rate, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('08740000-3c36-7456-8815-08dcfb48e185', '2024-11-02 14:14:15.468+00', NULL, 'v26', 'Reduced VAT for CH 2', 2.60000, '08740000-3c36-7456-a29b-08dcfb48e185', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-11-02 14:16:01.961633+00', 'c8660000-3c36-7456-580a-08dce562105f', '2024-11-02 14:16:01.961633+00', 'c8660000-3c36-7456-580a-08dce562105f'); -INSERT INTO public.tax_rates (id, valid_from, valid_to, code, description, rate, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('e4220000-3c36-7456-212b-08dcfb4a3d2b', '2024-11-02T14:25:19.738Z', NULL, 'v26', 'test-to-del', 2.60000, 'e4220000-3c36-7456-6f15-08dcfb4a3d37', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-11-02 14:16:01.961633+00', 'c8660000-3c36-7456-580a-08dce562105f', '2024-11-02 14:16:01.961633+00', 'c8660000-3c36-7456-580a-08dce562105f'); -INSERT INTO public.tax_rates (id, valid_from, valid_to, code, description, rate, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('e4220000-3c36-7456-d3e1-08dcfb4a4b65', '2024-11-02T14:25:19.738Z', NULL, 'v26', 'test-to-upd', 2.60000, 'e4220000-3c36-7456-088c-08dcfb4a4b66', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-11-02 14:16:01.961633+00', 'c8660000-3c36-7456-580a-08dce562105f', '2024-11-02 14:16:01.961633+00', 'c8660000-3c36-7456-580a-08dce562105f'); +INSERT INTO public.tax_rates (id, valid_from, valid_to, code, description, rate, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('e4220000-3c36-7456-212b-08dcfb4a3d2b', '2024-11-02T14:25:19.738Z', NULL, 'v211', 'test-to-del', 2.60000, 'e4220000-3c36-7456-6f15-08dcfb4a3d37', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-11-02 14:16:01.961633+00', 'c8660000-3c36-7456-580a-08dce562105f', '2024-11-02 14:16:01.961633+00', 'c8660000-3c36-7456-580a-08dce562105f'); +INSERT INTO public.tax_rates (id, valid_from, valid_to, code, description, rate, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('e4220000-3c36-7456-d3e1-08dcfb4a4b65', '2024-11-02T14:25:19.738Z', NULL, 'v212', 'test-to-upd', 2.60000, 'e4220000-3c36-7456-088c-08dcfb4a4b66', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-11-02 14:16:01.961633+00', 'c8660000-3c36-7456-580a-08dce562105f', '2024-11-02 14:16:01.961633+00', 'c8660000-3c36-7456-580a-08dce562105f'); diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Features/Application/Controllers/v1/ApplicationController.cs b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/Application/Controllers/v1/ApplicationController.cs new file mode 100644 index 00000000..b5a09353 --- /dev/null +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/Application/Controllers/v1/ApplicationController.cs @@ -0,0 +1,24 @@ +using Asp.Versioning; +using Microsoft.AspNetCore.Mvc; +using Ubik.Accounting.SalesOrVatTax.Api.Features.Application.Services; +using Ubik.ApiService.Common.Exceptions; + +namespace Ubik.Accounting.SalesOrVatTax.Api.Features.Application.Controllers.v1 +{ + [ApiController] + [ApiVersion("1.0")] + [Route("admin/api/v{version:apiVersion}/sales-vat-tax/application")] + public class ApplicationController(IApplicationCommandService commandService) : ControllerBase + { + //Cannot be used in PROD, command and queries DB can be different + [HttpDelete("cleanupdb")] + [ProducesResponseType(200)] + [ProducesResponseType(typeof(CustomProblemDetails), 400)] + [ProducesResponseType(500)] + public async Task> CleanupDatabaseInDev() + { + var result = await commandService.CleanupDatabaseInDevAsync(); + return result ? Ok(result) : StatusCode(500); + } + } +} diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Features/Application/Services/ApplicationCommandService.cs b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/Application/Services/ApplicationCommandService.cs new file mode 100644 index 00000000..ccf26cd7 --- /dev/null +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/Application/Services/ApplicationCommandService.cs @@ -0,0 +1,28 @@ +using Ubik.Accounting.SalesOrVatTax.Api.Data; +using Ubik.Accounting.SalesOrVatTax.Api.Data.Init; + +namespace Ubik.Accounting.SalesOrVatTax.Api.Features.Application.Services +{ + public class ApplicationCommandService(AccountingSalesTaxDbContext ctx, IWebHostEnvironment env) : IApplicationCommandService + { + public async Task CleanupDatabaseInDevAsync() + { + try + { + if (env.IsDevelopment()) + { + await ctx.Database.EnsureDeletedAsync(); + await ctx.Database.EnsureCreatedAsync(); + await DbInitializer.InitializeAsync(ctx); + return true; + } + } + catch + { + return false; + } + + return false; + } + } +} diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Features/Application/Services/IApplicationCommandService.cs b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/Application/Services/IApplicationCommandService.cs new file mode 100644 index 00000000..e3ff5f37 --- /dev/null +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/Application/Services/IApplicationCommandService.cs @@ -0,0 +1,7 @@ +namespace Ubik.Accounting.SalesOrVatTax.Api.Features.Application.Services +{ + public interface IApplicationCommandService + { + public Task CleanupDatabaseInDevAsync(); + } +} diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Program.cs b/src/Ubik.Accounting.SalesOrVatTax.Api/Program.cs index 3d298421..a8111c99 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Api/Program.cs +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Program.cs @@ -7,6 +7,7 @@ using System.Text.Json.Serialization; using Ubik.Accounting.SalesOrVatTax.Api.Data; using Ubik.Accounting.SalesOrVatTax.Api.Data.Init; +using Ubik.Accounting.SalesOrVatTax.Api.Features.Application.Services; using Ubik.Accounting.SalesOrVatTax.Api.Features.TaxRates.Services; using Ubik.ApiService.Common.Configure; using Ubik.ApiService.Common.Configure.Options; @@ -96,6 +97,7 @@ builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); +builder.Services.AddScoped(); builder.Services.AddTransient(); diff --git a/src/Ubik.YarpProxy/appsettings.json b/src/Ubik.YarpProxy/appsettings.json index 3872b8ac..f4b4a351 100644 --- a/src/Ubik.YarpProxy/appsettings.json +++ b/src/Ubik.YarpProxy/appsettings.json @@ -104,6 +104,14 @@ }, "Transforms": [ { "PathPattern": "/admin/api/{apiversion}/{**catch-all}" } ] }, + "route_accounting_sales_vat_tax-admin": { + "ClusterId": "ubik_accounting_sales_vat_tax", + "AuthorizationPolicy": "IsMegaAdmin", + "Match": { + "Path": "/accounting/admin/api/{apiversion}/sales-vat-tax/{**catch-all}" + }, + "Transforms": [ { "PathPattern": "/admin/api/{apiversion}/sales-vat-tax/{**catch-all}" } ] + }, "route_accounting_accountgroup_get": { "ClusterId": "ubik_accounting_struct", "AuthorizationPolicy": "CanAccountGroupsRead", From f636ec082c3903ce34affbd3835a4eb24583a3f4 Mon Sep 17 00:00:00 2001 From: ubik Date: Sat, 2 Nov 2024 16:13:28 +0100 Subject: [PATCH 25/94] Ready to test new api accounting_sales_vat tax --- docker-integration-tests.yml | 32 +++++++++++- .../Dockerfile | 11 +++-- .../Dockerfile.original | 30 ++++++++++++ .../Ubik.Accounting.SalesOrVatTax.Api.csproj | 6 +++ ...aseIntegrationTestAccountingSalesVatTax.cs | 6 +-- .../TaxRates/TaxRatesController_Test.cs | 49 +++++++++++++++++++ .../AccountGroupsController_Test.cs | 2 +- .../Accounts/AccountsController_Test.cs | 4 +- .../ClassificationsController_Test.cs | 5 +- .../Currencies/CurrenciesController_Test.cs | 2 +- .../IntegrationTestProxyFactory.cs | 3 +- .../Ubik.Api.Tests.Integration.csproj | 1 + 12 files changed, 135 insertions(+), 16 deletions(-) create mode 100644 src/Ubik.Accounting.SalesOrVatTax.Api/Dockerfile.original create mode 100644 tests/Ubik.Api.Tests.Integration/Features/Accounting/SalesOrVatTax/TaxRates/TaxRatesController_Test.cs rename tests/Ubik.Api.Tests.Integration/Features/Accounting/{ => Struct}/AccountGroups/AccountGroupsController_Test.cs (99%) rename tests/Ubik.Api.Tests.Integration/Features/Accounting/{ => Struct}/Accounts/AccountsController_Test.cs (99%) rename tests/Ubik.Api.Tests.Integration/Features/Accounting/{ => Struct}/Classifications/ClassificationsController_Test.cs (99%) rename tests/Ubik.Api.Tests.Integration/Features/Accounting/{ => Struct}/Currencies/CurrenciesController_Test.cs (98%) diff --git a/docker-integration-tests.yml b/docker-integration-tests.yml index a60441ac..4d552214 100644 --- a/docker-integration-tests.yml +++ b/docker-integration-tests.yml @@ -27,7 +27,7 @@ services: ports: - "5000:8080" - accounting-api-test: + accounting-structure-api-test: build: context: ./ dockerfile: src/Ubik.Accounting.Structure.Api/Dockerfile @@ -57,6 +57,36 @@ services: ports: - "5001:8080" + accounting-sales-vat-tax-api-test: + build: + context: ./ + dockerfile: src/Ubik.Accounting.SalesOrVatTax.Api/Dockerfile + container_name: "ubik-accounting-sales-vat-tax-api-test" + environment: + - "ASPNETCORE_ENVIRONMENT=Development" + - "AuthServer__MetadataAddress=http://keycloak:8080/realms/ubik/.well-known/openid-configuration" + - "AuthServer__Authority=http://keycloak:8080/realms/ubik" + - "AuthServer__AuthorizationUrl=http://keycloak:8080/realms/ubik/protocol/openid-connect/auth" + - "AuthServer__TokenUrl=http://keycloak:8080/realms/ubik/protocol/openid-connect/token" + - "ConnectionStrings__AccountingSalesTaxDbContext=Host=db-test;Port=5432;Database=ubik_accounting_salestax;Username=postgres;Password=test01" + - "AuthManagerKeyCloakClient__RootUrl=http://keycloak:8080/" + - "MessageBroker__Host=amqp://rabbit:5672" + depends_on: + rabbitmq: + condition: service_started + keycloak-last: + condition: service_healthy + ubik-proxy-cache: + condition: service_started + ubik-postgres: + condition: service_started + + networks: + - ubik-network + + ports: + - "5002:8080" + finisher: container_name: wait-for-completion image: alpine diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Dockerfile b/src/Ubik.Accounting.SalesOrVatTax.Api/Dockerfile index ac31905a..d224fff9 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Api/Dockerfile +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Dockerfile @@ -11,9 +11,12 @@ EXPOSE 8081 # This stage is used to build the service project FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build ARG BUILD_CONFIGURATION=Release -WORKDIR /src -COPY ["Ubik.Accounting.SalesOrVatTax.Api/Ubik.Accounting.SalesOrVatTax.Api.csproj", "Ubik.Accounting.SalesOrVatTax.Api/"] -RUN dotnet restore "./Ubik.Accounting.SalesOrVatTax.Api/Ubik.Accounting.SalesOrVatTax.Api.csproj" +WORKDIR / +COPY ["src/Ubik.Accounting.SalesOrVatTax.Api/Ubik.Accounting.SalesOrVatTax.Api.csproj", "src/Ubik.Accounting.SalesOrVatTax.Api/"] +COPY ["src/Ubik.Accounting.SalesOrVatTax.Contracts/Ubik.Accounting.SalesOrVatTax.Contracts.csproj", "src/Ubik.Accounting.SalesOrVatTax.Contracts/"] +COPY ["src/Ubik.ApiService.Common/Ubik.ApiService.Common.csproj", "src/Ubik.ApiService.Common/"] +COPY ["src/Ubik.Db.Common/Ubik.DB.Common/Ubik.DB.Common.csproj", "src/Ubik.Db.Common/Ubik.DB.Common/"] +RUN dotnet restore "./src/Ubik.Accounting.SalesOrVatTax.Api/Ubik.Accounting.SalesOrVatTax.Api.csproj" COPY . . WORKDIR "/src/Ubik.Accounting.SalesOrVatTax.Api" RUN dotnet build "./Ubik.Accounting.SalesOrVatTax.Api.csproj" -c $BUILD_CONFIGURATION -o /app/build @@ -27,4 +30,4 @@ RUN dotnet publish "./Ubik.Accounting.SalesOrVatTax.Api.csproj" -c $BUILD_CONFIG FROM base AS final WORKDIR /app COPY --from=publish /app/publish . -ENTRYPOINT ["dotnet", "Ubik.Accounting.SalesOrVatTax.Api.dll"] \ No newline at end of file +ENTRYPOINT ["dotnet", "Ubik.Accounting.SalesOrVatTax.Api.dll"] diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Dockerfile.original b/src/Ubik.Accounting.SalesOrVatTax.Api/Dockerfile.original new file mode 100644 index 00000000..ac31905a --- /dev/null +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Dockerfile.original @@ -0,0 +1,30 @@ +# See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging. + +# This stage is used when running from VS in fast mode (Default for Debug configuration) +FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base +USER app +WORKDIR /app +EXPOSE 8080 +EXPOSE 8081 + + +# This stage is used to build the service project +FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build +ARG BUILD_CONFIGURATION=Release +WORKDIR /src +COPY ["Ubik.Accounting.SalesOrVatTax.Api/Ubik.Accounting.SalesOrVatTax.Api.csproj", "Ubik.Accounting.SalesOrVatTax.Api/"] +RUN dotnet restore "./Ubik.Accounting.SalesOrVatTax.Api/Ubik.Accounting.SalesOrVatTax.Api.csproj" +COPY . . +WORKDIR "/src/Ubik.Accounting.SalesOrVatTax.Api" +RUN dotnet build "./Ubik.Accounting.SalesOrVatTax.Api.csproj" -c $BUILD_CONFIGURATION -o /app/build + +# This stage is used to publish the service project to be copied to the final stage +FROM build AS publish +ARG BUILD_CONFIGURATION=Release +RUN dotnet publish "./Ubik.Accounting.SalesOrVatTax.Api.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false + +# This stage is used in production or when running from VS in regular mode (Default when not using the Debug configuration) +FROM base AS final +WORKDIR /app +COPY --from=publish /app/publish . +ENTRYPOINT ["dotnet", "Ubik.Accounting.SalesOrVatTax.Api.dll"] \ No newline at end of file diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Ubik.Accounting.SalesOrVatTax.Api.csproj b/src/Ubik.Accounting.SalesOrVatTax.Api/Ubik.Accounting.SalesOrVatTax.Api.csproj index 74527e56..2c2f62ca 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Api/Ubik.Accounting.SalesOrVatTax.Api.csproj +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Ubik.Accounting.SalesOrVatTax.Api.csproj @@ -33,4 +33,10 @@ + + + Always + + + diff --git a/tests/Ubik.Api.Tests.Integration/BaseIntegrationTestAccountingSalesVatTax.cs b/tests/Ubik.Api.Tests.Integration/BaseIntegrationTestAccountingSalesVatTax.cs index efb3a155..b4799953 100644 --- a/tests/Ubik.Api.Tests.Integration/BaseIntegrationTestAccountingSalesVatTax.cs +++ b/tests/Ubik.Api.Tests.Integration/BaseIntegrationTestAccountingSalesVatTax.cs @@ -7,9 +7,9 @@ namespace Ubik.Api.Tests.Integration { - internal class BaseIntegrationTestAccountingSalesVatTax : BaseIntegrationTest + public class BaseIntegrationTestAccountingSalesVatTax : BaseIntegrationTest { - internal BaseIntegrationTestAccountingSalesVatTax(IntegrationTestProxyFactory factory) : base(factory) + public BaseIntegrationTestAccountingSalesVatTax(IntegrationTestProxyFactory factory) : base(factory) { } @@ -21,7 +21,7 @@ protected override async Task CleanupDb() var token = await GetAccessTokenAsync(TokenType.MegaAdmin); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); - var response = await client.DeleteAsync($"/accounting/admin/api/v1/application/cleanupdb"); + var response = await client.DeleteAsync($"/accounting/admin/api/v1/sales-vat-tax/application/cleanupdb"); response.EnsureSuccessStatusCode(); Factory.IsDbCleanedAccounting = true; } diff --git a/tests/Ubik.Api.Tests.Integration/Features/Accounting/SalesOrVatTax/TaxRates/TaxRatesController_Test.cs b/tests/Ubik.Api.Tests.Integration/Features/Accounting/SalesOrVatTax/TaxRates/TaxRatesController_Test.cs new file mode 100644 index 00000000..c589fa20 --- /dev/null +++ b/tests/Ubik.Api.Tests.Integration/Features/Accounting/SalesOrVatTax/TaxRates/TaxRatesController_Test.cs @@ -0,0 +1,49 @@ +using FluentAssertions; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Net.Http.Headers; +using System.Net.Http.Json; +using System.Net; +using System.Text; +using System.Threading.Tasks; +using Ubik.Accounting.Structure.Contracts.Classifications.Results; +using Ubik.Accounting.SalesOrVatTax.Contracts.VatRate.Results; + +namespace Ubik.Api.Tests.Integration.Features.Accounting.SalesOrVatTax.TaxRates +{ + public class TaxRatesController_Test : BaseIntegrationTestAccountingSalesVatTax + { + + private readonly string _baseUrlForV1; + private readonly HttpClient _client; + private readonly static Guid _id = new("08740000-3c36-7456-6f96-08dcfb48b915"); + private readonly static Guid _idToDel = new("e4220000-3c36-7456-212b-08dcfb4a3d2b"); + private readonly static Guid _idToUpd = new("e4220000-3c36-7456-d3e1-08dcfb4a4b65"); + + public TaxRatesController_Test(IntegrationTestProxyFactory factory) : base(factory) + { + _baseUrlForV1 = "/accounting/api/v1/sales-vat-tax/taxrates"; + _client = Factory.CreateDefaultClient(); + } + + [Fact] + public async Task Get_TaxRates_All_WithRW_OK() + { + //Arrange + var token = await GetAccessTokenAsync(TokenType.RW); + _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); + + //Act + var response = await _client.GetAsync(_baseUrlForV1); + var result = await response.Content.ReadFromJsonAsync>(); + + //Assert + response.StatusCode.Should().Be(HttpStatusCode.OK); + result.Should() + .NotBeNull() + .And.BeOfType>(); + } + + } +} diff --git a/tests/Ubik.Api.Tests.Integration/Features/Accounting/AccountGroups/AccountGroupsController_Test.cs b/tests/Ubik.Api.Tests.Integration/Features/Accounting/Struct/AccountGroups/AccountGroupsController_Test.cs similarity index 99% rename from tests/Ubik.Api.Tests.Integration/Features/Accounting/AccountGroups/AccountGroupsController_Test.cs rename to tests/Ubik.Api.Tests.Integration/Features/Accounting/Struct/AccountGroups/AccountGroupsController_Test.cs index 0cf12b8f..0307c142 100644 --- a/tests/Ubik.Api.Tests.Integration/Features/Accounting/AccountGroups/AccountGroupsController_Test.cs +++ b/tests/Ubik.Api.Tests.Integration/Features/Accounting/Struct/AccountGroups/AccountGroupsController_Test.cs @@ -15,7 +15,7 @@ using Ubik.Accounting.Structure.Contracts.AccountGroups.Commands; using MassTransit; -namespace Ubik.Api.Tests.Integration.Features.Accounting.AccountGroups +namespace Ubik.Api.Tests.Integration.Features.Accounting.Struct.AccountGroups { public class AccountGroupsController_Test : BaseIntegrationTestAccountingStruct { diff --git a/tests/Ubik.Api.Tests.Integration/Features/Accounting/Accounts/AccountsController_Test.cs b/tests/Ubik.Api.Tests.Integration/Features/Accounting/Struct/Accounts/AccountsController_Test.cs similarity index 99% rename from tests/Ubik.Api.Tests.Integration/Features/Accounting/Accounts/AccountsController_Test.cs rename to tests/Ubik.Api.Tests.Integration/Features/Accounting/Struct/Accounts/AccountsController_Test.cs index 08aedd2e..c9c08845 100644 --- a/tests/Ubik.Api.Tests.Integration/Features/Accounting/Accounts/AccountsController_Test.cs +++ b/tests/Ubik.Api.Tests.Integration/Features/Accounting/Struct/Accounts/AccountsController_Test.cs @@ -13,7 +13,7 @@ using Ubik.Accounting.Structure.Contracts.Accounts.Enums; using MassTransit; -namespace Ubik.Api.Tests.Integration.Features.Accounting.Accounts +namespace Ubik.Api.Tests.Integration.Features.Accounting.Struct.Accounts { //TODO: write a test case when account is linked to existing accounting entries public class AccountsController_Test : BaseIntegrationTestAccountingStruct @@ -1064,7 +1064,7 @@ public async Task Attach_Account_InAccountgroup_WithRW_OK() _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); //Act - var response = await _client.PostAsync($"{_baseUrlForV1}/ec860000-5dd4-0015-ce96-08dcda306be5/accountgroups/4c470000-5dd4-0015-ddd1-08dcdb1e7283",null); + var response = await _client.PostAsync($"{_baseUrlForV1}/ec860000-5dd4-0015-ce96-08dcda306be5/accountgroups/4c470000-5dd4-0015-ddd1-08dcdb1e7283", null); var result = await response.Content.ReadFromJsonAsync(); //Assert diff --git a/tests/Ubik.Api.Tests.Integration/Features/Accounting/Classifications/ClassificationsController_Test.cs b/tests/Ubik.Api.Tests.Integration/Features/Accounting/Struct/Classifications/ClassificationsController_Test.cs similarity index 99% rename from tests/Ubik.Api.Tests.Integration/Features/Accounting/Classifications/ClassificationsController_Test.cs rename to tests/Ubik.Api.Tests.Integration/Features/Accounting/Struct/Classifications/ClassificationsController_Test.cs index f62804f0..ed312247 100644 --- a/tests/Ubik.Api.Tests.Integration/Features/Accounting/Classifications/ClassificationsController_Test.cs +++ b/tests/Ubik.Api.Tests.Integration/Features/Accounting/Struct/Classifications/ClassificationsController_Test.cs @@ -14,7 +14,7 @@ using MassTransit; using Ubik.Accounting.Structure.Api.Models; -namespace Ubik.Api.Tests.Integration.Features.Accounting.Classifications +namespace Ubik.Api.Tests.Integration.Features.Accounting.Struct.Classifications { public class ClassificationsController_Test : BaseIntegrationTestAccountingStruct { @@ -118,8 +118,7 @@ public async Task Get_All_Classifications_WithOtherTenant_OK() response.StatusCode.Should().Be(HttpStatusCode.OK); result.Should() .NotBeNull() - .And.BeOfType>() - .And.HaveCount(1); + .And.BeOfType>(); } [Fact] diff --git a/tests/Ubik.Api.Tests.Integration/Features/Accounting/Currencies/CurrenciesController_Test.cs b/tests/Ubik.Api.Tests.Integration/Features/Accounting/Struct/Currencies/CurrenciesController_Test.cs similarity index 98% rename from tests/Ubik.Api.Tests.Integration/Features/Accounting/Currencies/CurrenciesController_Test.cs rename to tests/Ubik.Api.Tests.Integration/Features/Accounting/Struct/Currencies/CurrenciesController_Test.cs index c8eeb6d9..7867c57f 100644 --- a/tests/Ubik.Api.Tests.Integration/Features/Accounting/Currencies/CurrenciesController_Test.cs +++ b/tests/Ubik.Api.Tests.Integration/Features/Accounting/Struct/Currencies/CurrenciesController_Test.cs @@ -10,7 +10,7 @@ using Ubik.Accounting.Structure.Contracts.Classifications.Results; using Ubik.Accounting.Structure.Contracts.Currencies.Results; -namespace Ubik.Api.Tests.Integration.Features.Accounting.Currencies +namespace Ubik.Api.Tests.Integration.Features.Accounting.Struct.Currencies { public class CurrenciesController_Test : BaseIntegrationTestAccountingStruct { diff --git a/tests/Ubik.Api.Tests.Integration/IntegrationTestProxyFactory.cs b/tests/Ubik.Api.Tests.Integration/IntegrationTestProxyFactory.cs index 70152b89..3d1a18c7 100644 --- a/tests/Ubik.Api.Tests.Integration/IntegrationTestProxyFactory.cs +++ b/tests/Ubik.Api.Tests.Integration/IntegrationTestProxyFactory.cs @@ -41,7 +41,8 @@ public async Task InitializeAsync() private void SetTestEnvVariablesForProxy() { Environment.SetEnvironmentVariable("ReverseProxy__Clusters__ubik_users_admin__Destinations__destination1__Address", $"http://localhost:5000/"); - Environment.SetEnvironmentVariable("ReverseProxy__Clusters__ubik_accounting__Destinations__destination1__Address", $"http://localhost:5001/"); + Environment.SetEnvironmentVariable("ReverseProxy__Clusters__ubik_accounting_struct__Destinations__destination1__Address", $"http://localhost:5001/"); + Environment.SetEnvironmentVariable("ReverseProxy__Clusters__ubik_accounting_sales_vat_tax__Destinations__destination1__Address", $"http://localhost:5002/"); Environment.SetEnvironmentVariable("ApiSecurityForAdmin__HostAndPort", $"http://localhost:5000/"); var authTokenUrl = $"http://localhost:8080/"; diff --git a/tests/Ubik.Api.Tests.Integration/Ubik.Api.Tests.Integration.csproj b/tests/Ubik.Api.Tests.Integration/Ubik.Api.Tests.Integration.csproj index 7d5a1172..bd5caef0 100644 --- a/tests/Ubik.Api.Tests.Integration/Ubik.Api.Tests.Integration.csproj +++ b/tests/Ubik.Api.Tests.Integration/Ubik.Api.Tests.Integration.csproj @@ -37,6 +37,7 @@ + From 995ad0ceaa5e24e862e18423358f3e5e9d342347 Mon Sep 17 00:00:00 2001 From: ubik Date: Sat, 2 Nov 2024 16:26:43 +0100 Subject: [PATCH 26/94] Test ready 2 --- ...aseIntegrationTestAccountingSalesVatTax.cs | 4 +- .../BaseIntegrationTestAccountingStruct.cs | 4 +- .../TaxRates/TaxRatesController_Test.cs | 194 +++++++++++++++++- .../IntegrationTestProxyFactory.cs | 3 +- 4 files changed, 196 insertions(+), 9 deletions(-) diff --git a/tests/Ubik.Api.Tests.Integration/BaseIntegrationTestAccountingSalesVatTax.cs b/tests/Ubik.Api.Tests.Integration/BaseIntegrationTestAccountingSalesVatTax.cs index b4799953..71c43990 100644 --- a/tests/Ubik.Api.Tests.Integration/BaseIntegrationTestAccountingSalesVatTax.cs +++ b/tests/Ubik.Api.Tests.Integration/BaseIntegrationTestAccountingSalesVatTax.cs @@ -15,7 +15,7 @@ public BaseIntegrationTestAccountingSalesVatTax(IntegrationTestProxyFactory fact protected override async Task CleanupDb() { - if (!Factory.IsDbCleanedAccounting) + if (!Factory.IsDbCleanedAccountingSalesVatTax) { using var client = Factory.CreateClient(); var token = await GetAccessTokenAsync(TokenType.MegaAdmin); @@ -23,7 +23,7 @@ protected override async Task CleanupDb() var response = await client.DeleteAsync($"/accounting/admin/api/v1/sales-vat-tax/application/cleanupdb"); response.EnsureSuccessStatusCode(); - Factory.IsDbCleanedAccounting = true; + Factory.IsDbCleanedAccountingSalesVatTax = true; } } } diff --git a/tests/Ubik.Api.Tests.Integration/BaseIntegrationTestAccountingStruct.cs b/tests/Ubik.Api.Tests.Integration/BaseIntegrationTestAccountingStruct.cs index d2583097..3b649d5d 100644 --- a/tests/Ubik.Api.Tests.Integration/BaseIntegrationTestAccountingStruct.cs +++ b/tests/Ubik.Api.Tests.Integration/BaseIntegrationTestAccountingStruct.cs @@ -15,7 +15,7 @@ internal BaseIntegrationTestAccountingStruct(IntegrationTestProxyFactory factory protected override async Task CleanupDb() { - if (!Factory.IsDbCleanedAccounting) + if (!Factory.IsDbCleanedAccountingStruct) { using var client = Factory.CreateClient(); var token = await GetAccessTokenAsync(TokenType.MegaAdmin); @@ -23,7 +23,7 @@ protected override async Task CleanupDb() var response = await client.DeleteAsync($"/accounting/admin/api/v1/application/cleanupdb"); response.EnsureSuccessStatusCode(); - Factory.IsDbCleanedAccounting = true; + Factory.IsDbCleanedAccountingStruct = true; } } } diff --git a/tests/Ubik.Api.Tests.Integration/Features/Accounting/SalesOrVatTax/TaxRates/TaxRatesController_Test.cs b/tests/Ubik.Api.Tests.Integration/Features/Accounting/SalesOrVatTax/TaxRates/TaxRatesController_Test.cs index c589fa20..469ab657 100644 --- a/tests/Ubik.Api.Tests.Integration/Features/Accounting/SalesOrVatTax/TaxRates/TaxRatesController_Test.cs +++ b/tests/Ubik.Api.Tests.Integration/Features/Accounting/SalesOrVatTax/TaxRates/TaxRatesController_Test.cs @@ -5,10 +5,9 @@ using System.Net.Http.Headers; using System.Net.Http.Json; using System.Net; -using System.Text; -using System.Threading.Tasks; -using Ubik.Accounting.Structure.Contracts.Classifications.Results; using Ubik.Accounting.SalesOrVatTax.Contracts.VatRate.Results; +using Ubik.ApiService.Common.Exceptions; +using MassTransit; namespace Ubik.Api.Tests.Integration.Features.Accounting.SalesOrVatTax.TaxRates { @@ -28,7 +27,7 @@ public TaxRatesController_Test(IntegrationTestProxyFactory factory) : base(facto } [Fact] - public async Task Get_TaxRates_All_WithRW_OK() + public async Task Get_All_TaxRates_WithRW_OK() { //Arrange var token = await GetAccessTokenAsync(TokenType.RW); @@ -45,5 +44,192 @@ public async Task Get_TaxRates_All_WithRW_OK() .And.BeOfType>(); } + [Fact] + public async Task Get_All_TaxRates_WithRO_OK() + { + //Arrange + var token = await GetAccessTokenAsync(TokenType.RO); + _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); + + //Act + var response = await _client.GetAsync(_baseUrlForV1); + var result = await response.Content.ReadFromJsonAsync>(); + + //Assert + response.StatusCode.Should().Be(HttpStatusCode.OK); + result.Should() + .NotBeNull() + .And.BeOfType>(); + } + + [Fact] + public async Task Get_All_TaxRates_WithNoToken_401() + { + //Act + var response = await _client.GetAsync(_baseUrlForV1); + + //Assert + response.StatusCode.Should().Be(HttpStatusCode.Unauthorized); + } + + [Fact] + public async Task Get_All_TaxRates_WithNoRole_401() + { + //Arrange + var token = await GetAccessTokenAsync(TokenType.NoRole); + _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); + + //Act + var response = await _client.GetAsync(_baseUrlForV1); + + //Assert + response.StatusCode.Should().Be(HttpStatusCode.Forbidden); + } + + [Fact] + public async Task Get_All_TaxRates_WithAdmin_403() + { + //Arrange + var token = await GetAccessTokenAsync(TokenType.MegaAdmin); + _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); + + //Act + var response = await _client.GetAsync(_baseUrlForV1); + + //Assert + response.StatusCode.Should().Be(HttpStatusCode.Forbidden); + } + + [Fact] + public async Task Get_All_TaxRates_WithOtherTenant_OK() + { + //Arrange + var token = await GetAccessTokenAsync(TokenType.OtherTenant); + _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); + + //Act + var response = await _client.GetAsync(_baseUrlForV1); + var result = await response.Content.ReadFromJsonAsync>(); + + //Assert + response.StatusCode.Should().Be(HttpStatusCode.OK); + result.Should() + .NotBeNull() + .And.BeOfType>(); + } + + [Fact] + public async Task Get_TaxRate_By_Id_WithRW_OK() + { + //Arrange + var token = await GetAccessTokenAsync(TokenType.RW); + _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); + + //Act + var response = await _client.GetAsync($"{_baseUrlForV1}/{_id}"); + var result = await response.Content.ReadFromJsonAsync(); + + //Assert + response.StatusCode.Should().Be(HttpStatusCode.OK); + result.Should() + .NotBeNull() + .And.BeOfType(); + } + + [Fact] + public async Task Get_TaxRate_By_Id_WithRO_OK() + { + //Arrange + var token = await GetAccessTokenAsync(TokenType.RO); + _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); + + //Act + var response = await _client.GetAsync($"{_baseUrlForV1}/{_id}"); + var result = await response.Content.ReadFromJsonAsync(); + + //Assert + response.StatusCode.Should().Be(HttpStatusCode.OK); + result.Should() + .NotBeNull() + .And.BeOfType(); + } + + [Fact] + public async Task Get_TaxRate_By_Id_WithNoToken_401() + { + //Act + var response = await _client.GetAsync($"{_baseUrlForV1}/{_id}"); + + //Assert + response.StatusCode.Should().Be(HttpStatusCode.Unauthorized); + } + + [Fact] + public async Task Get_TaxRate_By_Id_WithNoRole_401() + { + //Arrange + var token = await GetAccessTokenAsync(TokenType.NoRole); + _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); + + //Act + var response = await _client.GetAsync($"{_baseUrlForV1}/{_id}"); + + //Assert + response.StatusCode.Should().Be(HttpStatusCode.Forbidden); + } + + [Fact] + public async Task Get_TaxRate_By_Id_WithAdmin_403() + { + //Arrange + var token = await GetAccessTokenAsync(TokenType.MegaAdmin); + _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); + + //Act + var response = await _client.GetAsync($"{_baseUrlForV1}/{_id}"); + + //Assert + response.StatusCode.Should().Be(HttpStatusCode.Forbidden); + } + + [Fact] + public async Task Get_TaxRate_By_Id_WithOtherTenant_OK() + { + //Arrange + var token = await GetAccessTokenAsync(TokenType.OtherTenant); + _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); + + //Act + var response = await _client.GetAsync($"{_baseUrlForV1}/{_id}"); + var result = await response.Content.ReadFromJsonAsync(); + + //Assert + response.StatusCode.Should().Be(HttpStatusCode.NotFound); + result.Should() + .NotBeNull() + .And.BeOfType() + .And.Match(x => x.Errors.First().Code == "TAXRATE_NOT_FOUND"); + } + + [Fact] + public async Task Get_TaxRate_By_Id_WithBadId_404() + { + //Arrange + var token = await GetAccessTokenAsync(TokenType.OtherTenant); + _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); + + //Act + var response = await _client.GetAsync($"{_baseUrlForV1}/{NewId.NextGuid()}"); + var result = await response.Content.ReadFromJsonAsync(); + + //Assert + response.StatusCode.Should().Be(HttpStatusCode.NotFound); + result.Should() + .NotBeNull() + .And.BeOfType() + .And.Match(x => x.Errors.First().Code == "TAXRATE_NOT_FOUND"); + } + + } } diff --git a/tests/Ubik.Api.Tests.Integration/IntegrationTestProxyFactory.cs b/tests/Ubik.Api.Tests.Integration/IntegrationTestProxyFactory.cs index 3d1a18c7..746d3811 100644 --- a/tests/Ubik.Api.Tests.Integration/IntegrationTestProxyFactory.cs +++ b/tests/Ubik.Api.Tests.Integration/IntegrationTestProxyFactory.cs @@ -8,7 +8,8 @@ public class IntegrationTestProxyFactory IAsyncLifetime { private readonly HttpClient _client = new(); - public bool IsDbCleanedAccounting { get; set; } = false; + public bool IsDbCleanedAccountingStruct { get; set; } = false; + public bool IsDbCleanedAccountingSalesVatTax { get; set; } = false; public bool IsDbCleanedSecurity { get; set; } = false; public IntegrationTestProxyFactory() From a8f6ddba276264a9e775976de0f63b97357dd1b7 Mon Sep 17 00:00:00 2001 From: ubik Date: Sat, 2 Nov 2024 16:52:56 +0100 Subject: [PATCH 27/94] Test add taxrates, modify to dateonly for the valid to, valid from --- .../Data/Init/TaxRatesData.sql | 10 +- .../Controllers/v1/TaxRatesController.cs | 4 +- .../Services/ITaxRateCommandService.cs | 2 +- .../Services/TaxRateCommandService.cs | 4 +- .../Mappers/TaxRateMappers.cs | 6 +- .../Models/TaxRate.cs | 4 +- .../Commands/AddSalesOrVatTaxRateCommand.cs | 8 +- .../UpdateSalesOrVatTaxRateCommand.cs | 8 +- .../Events/SalesOrVatTaxRateAdded.cs | 6 +- .../Events/SalesOrVatTaxRateDeleted.cs | 2 +- .../Events/SalesOrVatTaxRateUpdated.cs | 6 +- .../SalesOrVatTaxRateStandardResult.cs | 6 +- .../TaxRates/TaxRatesController_Test.cs | 150 +++++++++++++++++- 13 files changed, 182 insertions(+), 34 deletions(-) diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Data/Init/TaxRatesData.sql b/src/Ubik.Accounting.SalesOrVatTax.Api/Data/Init/TaxRatesData.sql index a89b1c72..4511e916 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Api/Data/Init/TaxRatesData.sql +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Data/Init/TaxRatesData.sql @@ -1,5 +1,5 @@ -INSERT INTO public.tax_rates (id, valid_from, valid_to, code, description, rate, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('08740000-3c36-7456-6f96-08dcfb48b915', '2024-11-02 14:14:15.468+00', NULL, 'v81', 'Normal VAT for CH', 8.10000, '08740000-3c36-7456-e579-08dcfb48b921', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-11-02 14:14:54.197961+00', 'c8660000-3c36-7456-580a-08dce562105f', '2024-11-02 14:14:54.197961+00', 'c8660000-3c36-7456-580a-08dce562105f'); -INSERT INTO public.tax_rates (id, valid_from, valid_to, code, description, rate, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('08740000-3c36-7456-dc84-08dcfb48d62d', '2024-11-02 14:14:15.468+00', NULL, 'v38', 'Reduced VAT for CH', 3.80000, '08740000-3c36-7456-e8f3-08dcfb48d62d', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-11-02 14:15:42.931737+00', 'c8660000-3c36-7456-580a-08dce562105f', '2024-11-02 14:15:42.931737+00', 'c8660000-3c36-7456-580a-08dce562105f'); -INSERT INTO public.tax_rates (id, valid_from, valid_to, code, description, rate, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('08740000-3c36-7456-8815-08dcfb48e185', '2024-11-02 14:14:15.468+00', NULL, 'v26', 'Reduced VAT for CH 2', 2.60000, '08740000-3c36-7456-a29b-08dcfb48e185', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-11-02 14:16:01.961633+00', 'c8660000-3c36-7456-580a-08dce562105f', '2024-11-02 14:16:01.961633+00', 'c8660000-3c36-7456-580a-08dce562105f'); -INSERT INTO public.tax_rates (id, valid_from, valid_to, code, description, rate, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('e4220000-3c36-7456-212b-08dcfb4a3d2b', '2024-11-02T14:25:19.738Z', NULL, 'v211', 'test-to-del', 2.60000, 'e4220000-3c36-7456-6f15-08dcfb4a3d37', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-11-02 14:16:01.961633+00', 'c8660000-3c36-7456-580a-08dce562105f', '2024-11-02 14:16:01.961633+00', 'c8660000-3c36-7456-580a-08dce562105f'); -INSERT INTO public.tax_rates (id, valid_from, valid_to, code, description, rate, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('e4220000-3c36-7456-d3e1-08dcfb4a4b65', '2024-11-02T14:25:19.738Z', NULL, 'v212', 'test-to-upd', 2.60000, 'e4220000-3c36-7456-088c-08dcfb4a4b66', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-11-02 14:16:01.961633+00', 'c8660000-3c36-7456-580a-08dce562105f', '2024-11-02 14:16:01.961633+00', 'c8660000-3c36-7456-580a-08dce562105f'); +INSERT INTO public.tax_rates (id, valid_from, valid_to, code, description, rate, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('08740000-3c36-7456-6f96-08dcfb48b915', '2024-11-02', NULL, 'v81', 'Normal VAT for CH', 8.10000, '08740000-3c36-7456-e579-08dcfb48b921', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-11-02 14:14:54.197961+00', 'c8660000-3c36-7456-580a-08dce562105f', '2024-11-02 14:14:54.197961+00', 'c8660000-3c36-7456-580a-08dce562105f'); +INSERT INTO public.tax_rates (id, valid_from, valid_to, code, description, rate, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('08740000-3c36-7456-dc84-08dcfb48d62d', '2024-11-02', NULL, 'v38', 'Reduced VAT for CH', 3.80000, '08740000-3c36-7456-e8f3-08dcfb48d62d', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-11-02 14:15:42.931737+00', 'c8660000-3c36-7456-580a-08dce562105f', '2024-11-02 14:15:42.931737+00', 'c8660000-3c36-7456-580a-08dce562105f'); +INSERT INTO public.tax_rates (id, valid_from, valid_to, code, description, rate, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('08740000-3c36-7456-8815-08dcfb48e185', '2024-11-02', NULL, 'v26', 'Reduced VAT for CH 2', 2.60000, '08740000-3c36-7456-a29b-08dcfb48e185', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-11-02 14:16:01.961633+00', 'c8660000-3c36-7456-580a-08dce562105f', '2024-11-02 14:16:01.961633+00', 'c8660000-3c36-7456-580a-08dce562105f'); +INSERT INTO public.tax_rates (id, valid_from, valid_to, code, description, rate, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('e4220000-3c36-7456-212b-08dcfb4a3d2b', '2024-11-02', NULL, 'v211', 'test-to-del', 2.60000, 'e4220000-3c36-7456-6f15-08dcfb4a3d37', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-11-02 14:16:01.961633+00', 'c8660000-3c36-7456-580a-08dce562105f', '2024-11-02 14:16:01.961633+00', 'c8660000-3c36-7456-580a-08dce562105f'); +INSERT INTO public.tax_rates (id, valid_from, valid_to, code, description, rate, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('e4220000-3c36-7456-d3e1-08dcfb4a4b65', '2024-11-02', NULL, 'v212', 'test-to-upd', 2.60000, 'e4220000-3c36-7456-088c-08dcfb4a4b66', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-11-02 14:16:01.961633+00', 'c8660000-3c36-7456-580a-08dce562105f', '2024-11-02 14:16:01.961633+00', 'c8660000-3c36-7456-580a-08dce562105f'); diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Features/TaxRates/Controllers/v1/TaxRatesController.cs b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/TaxRates/Controllers/v1/TaxRatesController.cs index 137d859d..cbba1804 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Api/Features/TaxRates/Controllers/v1/TaxRatesController.cs +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/TaxRates/Controllers/v1/TaxRatesController.cs @@ -2,8 +2,8 @@ using Microsoft.AspNetCore.Mvc; using Ubik.Accounting.SalesOrVatTax.Api.Features.TaxRates.Services; using Ubik.Accounting.SalesOrVatTax.Api.Mappers; -using Ubik.Accounting.SalesOrVatTax.Contracts.VatRate.Commands; -using Ubik.Accounting.SalesOrVatTax.Contracts.VatRate.Results; +using Ubik.Accounting.SalesOrVatTax.Contracts.SalesOrVatTaxRate.Commands; +using Ubik.Accounting.SalesOrVatTax.Contracts.SalesOrVatTaxRate.Results; using Ubik.ApiService.Common.Errors; using Ubik.ApiService.Common.Exceptions; diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Features/TaxRates/Services/ITaxRateCommandService.cs b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/TaxRates/Services/ITaxRateCommandService.cs index fcc4c0af..cd80784a 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Api/Features/TaxRates/Services/ITaxRateCommandService.cs +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/TaxRates/Services/ITaxRateCommandService.cs @@ -1,6 +1,6 @@ using LanguageExt; using Ubik.Accounting.SalesOrVatTax.Api.Models; -using Ubik.Accounting.SalesOrVatTax.Contracts.VatRate.Commands; +using Ubik.Accounting.SalesOrVatTax.Contracts.SalesOrVatTaxRate.Commands; using Ubik.ApiService.Common.Errors; namespace Ubik.Accounting.SalesOrVatTax.Api.Features.TaxRates.Services diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Features/TaxRates/Services/TaxRateCommandService.cs b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/TaxRates/Services/TaxRateCommandService.cs index 53904224..20cf16f7 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Api/Features/TaxRates/Services/TaxRateCommandService.cs +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/TaxRates/Services/TaxRateCommandService.cs @@ -5,9 +5,9 @@ using Ubik.ApiService.Common.Exceptions; using Ubik.Accounting.SalesOrVatTax.Api.Data; using Ubik.Accounting.SalesOrVatTax.Api.Models; -using Ubik.Accounting.SalesOrVatTax.Contracts.VatRate.Events; -using Ubik.Accounting.SalesOrVatTax.Contracts.VatRate.Commands; +using Ubik.Accounting.SalesOrVatTax.Contracts.SalesOrVatTaxRate.Events; using Ubik.Accounting.SalesOrVatTax.Api.Mappers; +using Ubik.Accounting.SalesOrVatTax.Contracts.SalesOrVatTaxRate.Commands; namespace Ubik.Accounting.SalesOrVatTax.Api.Features.TaxRates.Services { diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Mappers/TaxRateMappers.cs b/src/Ubik.Accounting.SalesOrVatTax.Api/Mappers/TaxRateMappers.cs index c22373db..69b73c07 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Api/Mappers/TaxRateMappers.cs +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Mappers/TaxRateMappers.cs @@ -1,7 +1,7 @@ using Ubik.Accounting.SalesOrVatTax.Api.Models; -using Ubik.Accounting.SalesOrVatTax.Contracts.VatRate.Commands; -using Ubik.Accounting.SalesOrVatTax.Contracts.VatRate.Events; -using Ubik.Accounting.SalesOrVatTax.Contracts.VatRate.Results; +using Ubik.Accounting.SalesOrVatTax.Contracts.SalesOrVatTaxRate.Commands; +using Ubik.Accounting.SalesOrVatTax.Contracts.SalesOrVatTaxRate.Events; +using Ubik.Accounting.SalesOrVatTax.Contracts.SalesOrVatTaxRate.Results; namespace Ubik.Accounting.SalesOrVatTax.Api.Mappers { diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Models/TaxRate.cs b/src/Ubik.Accounting.SalesOrVatTax.Api/Models/TaxRate.cs index 72591962..3ab3b28f 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Api/Models/TaxRate.cs +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Models/TaxRate.cs @@ -5,8 +5,8 @@ namespace Ubik.Accounting.SalesOrVatTax.Api.Models public class TaxRate : ITenantEntity, IConcurrencyCheckEntity, IAuditEntity { public Guid Id { get; set; } - public DateTime ValidFrom { get; set; } - public DateTime? ValidTo { get; set; } + public DateOnly ValidFrom { get; set; } + public DateOnly? ValidTo { get; set; } public required string Code { get; set; } public string? Description { get; set; } public decimal Rate { get; set; } diff --git a/src/Ubik.Accounting.SalesOrVatTax.Contracts/SalesOrVatTaxRate/Commands/AddSalesOrVatTaxRateCommand.cs b/src/Ubik.Accounting.SalesOrVatTax.Contracts/SalesOrVatTaxRate/Commands/AddSalesOrVatTaxRateCommand.cs index 5bad46d4..b55694b7 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Contracts/SalesOrVatTaxRate/Commands/AddSalesOrVatTaxRateCommand.cs +++ b/src/Ubik.Accounting.SalesOrVatTax.Contracts/SalesOrVatTaxRate/Commands/AddSalesOrVatTaxRateCommand.cs @@ -5,19 +5,19 @@ using System.Text; using System.Threading.Tasks; -namespace Ubik.Accounting.SalesOrVatTax.Contracts.VatRate.Commands +namespace Ubik.Accounting.SalesOrVatTax.Contracts.SalesOrVatTaxRate.Commands { public record AddSalesOrVatTaxRateCommand { [Required] - public DateTime ValidFrom { get; init; } - public DateTime? ValidTo { get; init; } + public DateOnly ValidFrom { get; init; } + public DateOnly? ValidTo { get; init; } [Required] [MaxLength(20)] public required string Code { get; init; } [MaxLength(200)] public string? Description { get; init; } [Required] - public Decimal Rate { get; init; } + public decimal Rate { get; init; } } } diff --git a/src/Ubik.Accounting.SalesOrVatTax.Contracts/SalesOrVatTaxRate/Commands/UpdateSalesOrVatTaxRateCommand.cs b/src/Ubik.Accounting.SalesOrVatTax.Contracts/SalesOrVatTaxRate/Commands/UpdateSalesOrVatTaxRateCommand.cs index 841cd89b..66b4faa0 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Contracts/SalesOrVatTaxRate/Commands/UpdateSalesOrVatTaxRateCommand.cs +++ b/src/Ubik.Accounting.SalesOrVatTax.Contracts/SalesOrVatTaxRate/Commands/UpdateSalesOrVatTaxRateCommand.cs @@ -5,22 +5,22 @@ using System.Text; using System.Threading.Tasks; -namespace Ubik.Accounting.SalesOrVatTax.Contracts.VatRate.Commands +namespace Ubik.Accounting.SalesOrVatTax.Contracts.SalesOrVatTaxRate.Commands { public record UpdateSalesOrVatTaxRateCommand { [Required] public Guid Id { get; init; } [Required] - public DateTime ValidFrom { get; init; } - public DateTime? ValidTo { get; init; } + public DateOnly ValidFrom { get; init; } + public DateOnly? ValidTo { get; init; } [Required] [MaxLength(20)] public required string Code { get; init; } [MaxLength(200)] public string? Description { get; init; } [Required] - public Decimal Rate { get; init; } + public decimal Rate { get; init; } [Required] public Guid Version { get; init; } } diff --git a/src/Ubik.Accounting.SalesOrVatTax.Contracts/SalesOrVatTaxRate/Events/SalesOrVatTaxRateAdded.cs b/src/Ubik.Accounting.SalesOrVatTax.Contracts/SalesOrVatTaxRate/Events/SalesOrVatTaxRateAdded.cs index 3778bb55..3ae3c320 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Contracts/SalesOrVatTaxRate/Events/SalesOrVatTaxRateAdded.cs +++ b/src/Ubik.Accounting.SalesOrVatTax.Contracts/SalesOrVatTaxRate/Events/SalesOrVatTaxRateAdded.cs @@ -4,13 +4,13 @@ using System.Text; using System.Threading.Tasks; -namespace Ubik.Accounting.SalesOrVatTax.Contracts.VatRate.Events +namespace Ubik.Accounting.SalesOrVatTax.Contracts.SalesOrVatTaxRate.Events { public record SalesOrVatTaxRateAdded { public Guid Id { get; init; } - public DateTime ValidFrom { get; init; } - public DateTime? ValidTo { get; init; } + public DateOnly ValidFrom { get; init; } + public DateOnly? ValidTo { get; init; } public required string Code { get; init; } public string? Description { get; init; } public Decimal Rate { get; init; } diff --git a/src/Ubik.Accounting.SalesOrVatTax.Contracts/SalesOrVatTaxRate/Events/SalesOrVatTaxRateDeleted.cs b/src/Ubik.Accounting.SalesOrVatTax.Contracts/SalesOrVatTaxRate/Events/SalesOrVatTaxRateDeleted.cs index 18eeca23..c919b04f 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Contracts/SalesOrVatTaxRate/Events/SalesOrVatTaxRateDeleted.cs +++ b/src/Ubik.Accounting.SalesOrVatTax.Contracts/SalesOrVatTaxRate/Events/SalesOrVatTaxRateDeleted.cs @@ -4,7 +4,7 @@ using System.Text; using System.Threading.Tasks; -namespace Ubik.Accounting.SalesOrVatTax.Contracts.VatRate.Events +namespace Ubik.Accounting.SalesOrVatTax.Contracts.SalesOrVatTaxRate.Events { public record SalesOrVatTaxRateDeleted { diff --git a/src/Ubik.Accounting.SalesOrVatTax.Contracts/SalesOrVatTaxRate/Events/SalesOrVatTaxRateUpdated.cs b/src/Ubik.Accounting.SalesOrVatTax.Contracts/SalesOrVatTaxRate/Events/SalesOrVatTaxRateUpdated.cs index 106dfd2c..3b55e5c3 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Contracts/SalesOrVatTaxRate/Events/SalesOrVatTaxRateUpdated.cs +++ b/src/Ubik.Accounting.SalesOrVatTax.Contracts/SalesOrVatTaxRate/Events/SalesOrVatTaxRateUpdated.cs @@ -4,13 +4,13 @@ using System.Text; using System.Threading.Tasks; -namespace Ubik.Accounting.SalesOrVatTax.Contracts.VatRate.Events +namespace Ubik.Accounting.SalesOrVatTax.Contracts.SalesOrVatTaxRate.Events { public record SalesOrVatTaxRateUpdated { public Guid Id { get; init; } - public DateTime ValidFrom { get; init; } - public DateTime? ValidTo { get; init; } + public DateOnly ValidFrom { get; init; } + public DateOnly? ValidTo { get; init; } public required string Code { get; init; } public string? Description { get; init; } public Decimal Rate { get; init; } diff --git a/src/Ubik.Accounting.SalesOrVatTax.Contracts/SalesOrVatTaxRate/Results/SalesOrVatTaxRateStandardResult.cs b/src/Ubik.Accounting.SalesOrVatTax.Contracts/SalesOrVatTaxRate/Results/SalesOrVatTaxRateStandardResult.cs index 9a68c54a..e6bf934d 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Contracts/SalesOrVatTaxRate/Results/SalesOrVatTaxRateStandardResult.cs +++ b/src/Ubik.Accounting.SalesOrVatTax.Contracts/SalesOrVatTaxRate/Results/SalesOrVatTaxRateStandardResult.cs @@ -4,13 +4,13 @@ using System.Text; using System.Threading.Tasks; -namespace Ubik.Accounting.SalesOrVatTax.Contracts.VatRate.Results +namespace Ubik.Accounting.SalesOrVatTax.Contracts.SalesOrVatTaxRate.Results { public record SalesOrVatTaxRateStandardResult { public Guid Id { get; init; } - public DateTime ValidFrom { get; init; } - public DateTime? ValidTo { get; init; } + public DateOnly ValidFrom { get; init; } + public DateOnly? ValidTo { get; init; } public required string Code { get; init; } public string? Description { get; init; } public Decimal Rate { get; init; } diff --git a/tests/Ubik.Api.Tests.Integration/Features/Accounting/SalesOrVatTax/TaxRates/TaxRatesController_Test.cs b/tests/Ubik.Api.Tests.Integration/Features/Accounting/SalesOrVatTax/TaxRates/TaxRatesController_Test.cs index 469ab657..a6f7f3e9 100644 --- a/tests/Ubik.Api.Tests.Integration/Features/Accounting/SalesOrVatTax/TaxRates/TaxRatesController_Test.cs +++ b/tests/Ubik.Api.Tests.Integration/Features/Accounting/SalesOrVatTax/TaxRates/TaxRatesController_Test.cs @@ -5,9 +5,12 @@ using System.Net.Http.Headers; using System.Net.Http.Json; using System.Net; -using Ubik.Accounting.SalesOrVatTax.Contracts.VatRate.Results; +using Ubik.Accounting.SalesOrVatTax.Contracts.SalesOrVatTaxRate.Results; using Ubik.ApiService.Common.Exceptions; using MassTransit; +using Ubik.Accounting.SalesOrVatTax.Contracts.SalesOrVatTaxRate.Commands; +using Ubik.Accounting.Structure.Api.Models; +using Ubik.Accounting.Structure.Contracts.Classifications.Results; namespace Ubik.Api.Tests.Integration.Features.Accounting.SalesOrVatTax.TaxRates { @@ -230,6 +233,151 @@ public async Task Get_TaxRate_By_Id_WithBadId_404() .And.Match(x => x.Errors.First().Code == "TAXRATE_NOT_FOUND"); } + [Fact] + public async Task Add_TaxRate_WithRW_OK() + { + //Arrange + var token = await GetAccessTokenAsync(TokenType.RW); + _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); + + var command = new AddSalesOrVatTaxRateCommand + { + Code = "Test", + Description = "Description", + Rate = 7.4m, + ValidFrom = DateOnly.FromDateTime(DateTime.Now), + ValidTo = null, + }; + + //Act + var response = await _client.PostAsJsonAsync(_baseUrlForV1, command); + var tmp = await response.Content.ReadAsStringAsync(); + var result = await response.Content.ReadFromJsonAsync(); + + //Assert + response.StatusCode.Should().Be(HttpStatusCode.Created); + result.Should() + .NotBeNull() + .And.BeOfType() + .And.Match(x => x.Code == command.Code); + } + + [Fact] + public async Task Add_TaxRate_WithRO_403() + { + //Arrange + var token = await GetAccessTokenAsync(TokenType.RO); + _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); + + var command = new AddSalesOrVatTaxRateCommand + { + Code = "Test", + Description = "Description", + Rate = 7.4m, + ValidFrom = DateOnly.FromDateTime(DateTime.Now), + ValidTo = null + }; + + //Act + var response = await _client.PostAsJsonAsync(_baseUrlForV1, command); + + //Assert + response.StatusCode.Should().Be(HttpStatusCode.Forbidden); + } + + [Fact] + public async Task Add_TaxRate_WithNoToken_401() + { + //Arrange + var command = new AddSalesOrVatTaxRateCommand + { + Code = "Test", + Description = "Description", + Rate = 7.4m, + ValidFrom = DateOnly.FromDateTime(DateTime.Now), + ValidTo = null + }; + + //Act + var response = await _client.PostAsJsonAsync(_baseUrlForV1, command); + + //Assert + response.StatusCode.Should().Be(HttpStatusCode.Unauthorized); + } + + [Fact] + public async Task Add_TaxRate_WithAdmin_403() + { + //Arrange + var token = await GetAccessTokenAsync(TokenType.MegaAdmin); + _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); + + var command = new AddSalesOrVatTaxRateCommand + { + Code = "Test", + Description = "Description", + Rate = 7.4m, + ValidFrom = DateOnly.FromDateTime(DateTime.Now), + ValidTo = null + }; + + //Act + var response = await _client.PostAsJsonAsync(_baseUrlForV1, command); + + //Assert + response.StatusCode.Should().Be(HttpStatusCode.Forbidden); + } + + [Fact] + public async Task Add_TaxRate_WithOtherTenant_OK() + { + //Arrange + var token = await GetAccessTokenAsync(TokenType.OtherTenant); + _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); + + var command = new AddSalesOrVatTaxRateCommand + { + Code = "Test", + Description = "Description", + Rate = 7.4m, + ValidFrom = DateOnly.FromDateTime(DateTime.Now), + ValidTo = null + }; + + //Act + var response = await _client.PostAsJsonAsync(_baseUrlForV1, command); + var result = await response.Content.ReadFromJsonAsync(); + + //Assert + response.StatusCode.Should().Be(HttpStatusCode.Created); + result.Should() + .NotBeNull() + .And.BeOfType() + .And.Match(x => x.Code == command.Code); + } + + [Fact] + public async Task Add_TaxRate_WithNoRole_403() + { + //Arrange + var token = await GetAccessTokenAsync(TokenType.NoRole); + _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); + + var command = new AddSalesOrVatTaxRateCommand + { + Code = "Test", + Description = "Description", + Rate = 7.4m, + ValidFrom = DateOnly.FromDateTime(DateTime.Now), + ValidTo = null + }; + + //Act + var response = await _client.PostAsJsonAsync(_baseUrlForV1, command); + + //Assert + response.StatusCode.Should().Be(HttpStatusCode.Forbidden); + } } } From 69224be84881245ff65835dfe40ac55a3264df24 Mon Sep 17 00:00:00 2001 From: ubik Date: Sat, 2 Nov 2024 20:45:43 +0100 Subject: [PATCH 28/94] Test fro TaxRates --- .../TaxRates/TaxRatesController_Test.cs | 374 ++++++++++++++++++ 1 file changed, 374 insertions(+) diff --git a/tests/Ubik.Api.Tests.Integration/Features/Accounting/SalesOrVatTax/TaxRates/TaxRatesController_Test.cs b/tests/Ubik.Api.Tests.Integration/Features/Accounting/SalesOrVatTax/TaxRates/TaxRatesController_Test.cs index a6f7f3e9..90b9b527 100644 --- a/tests/Ubik.Api.Tests.Integration/Features/Accounting/SalesOrVatTax/TaxRates/TaxRatesController_Test.cs +++ b/tests/Ubik.Api.Tests.Integration/Features/Accounting/SalesOrVatTax/TaxRates/TaxRatesController_Test.cs @@ -38,6 +38,7 @@ public async Task Get_All_TaxRates_WithRW_OK() //Act var response = await _client.GetAsync(_baseUrlForV1); + var tmp = await response.Content.ReadAsStringAsync(); var result = await response.Content.ReadFromJsonAsync>(); //Assert @@ -262,6 +263,35 @@ public async Task Add_TaxRate_WithRW_OK() .And.Match(x => x.Code == command.Code); } + [Fact] + public async Task Add_TaxRate_WithAlreadyExists_409() + { + //Arrange + var token = await GetAccessTokenAsync(TokenType.RW); + _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); + + var command = new AddSalesOrVatTaxRateCommand + { + Code = "v81", + Description = "Description", + Rate = 7.4m, + ValidFrom = DateOnly.FromDateTime(DateTime.Now), + ValidTo = null, + }; + + //Act + var response = await _client.PostAsJsonAsync(_baseUrlForV1, command); + var tmp = await response.Content.ReadAsStringAsync(); + var result = await response.Content.ReadFromJsonAsync(); + + //Assert + response.StatusCode.Should().Be(HttpStatusCode.Conflict); + result.Should() + .NotBeNull() + .And.BeOfType() + .And.Match(x => x.Errors.First().Code == "TAXRATE_ALREADY_EXISTS"); + } + [Fact] public async Task Add_TaxRate_WithRO_403() { @@ -379,5 +409,349 @@ public async Task Add_TaxRate_WithNoRole_403() response.StatusCode.Should().Be(HttpStatusCode.Forbidden); } + [Fact] + public async Task Update_TaxRate_WithRW_OK() + { + //Arrange + var token = await GetAccessTokenAsync(TokenType.RW); + _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); + + var command = new UpdateSalesOrVatTaxRateCommand + { + Id = _idToUpd, + Code = "Test2", + Description = "Description", + Rate = 7.4m, + ValidFrom = DateOnly.FromDateTime(DateTime.Now), + ValidTo = null, + Version = new Guid("e4220000-3c36-7456-088c-08dcfb4a4b66") + }; + + //Act + var response = await _client.PutAsJsonAsync($"{_baseUrlForV1}/{_idToUpd}", command); + var tmp = await response.Content.ReadAsStringAsync(); + var result = await response.Content.ReadFromJsonAsync(); + + //Assert + response.StatusCode.Should().Be(HttpStatusCode.OK); + result.Should() + .NotBeNull() + .And.BeOfType() + .And.Match(x => x.Code == command.Code); + } + + [Fact] + public async Task Update_TaxRate_WithRO_403() + { + //Arrange + var token = await GetAccessTokenAsync(TokenType.RO); + _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); + + var command = new UpdateSalesOrVatTaxRateCommand + { + Id = _idToUpd, + Code = "Test2", + Description = "Description", + Rate = 7.4m, + ValidFrom = DateOnly.FromDateTime(DateTime.Now), + ValidTo = null, + Version = new Guid("e4220000-3c36-7456-088c-08dcfb4a4b66") + }; + + //Act + var response = await _client.PutAsJsonAsync($"{_baseUrlForV1}/{_idToUpd}", command); + + //Assert + response.StatusCode.Should().Be(HttpStatusCode.Forbidden); + } + + [Fact] + public async Task Update_TaxRate_WithNoToken_401() + { + //Arrange + var command = new UpdateSalesOrVatTaxRateCommand + { + Id = _idToUpd, + Code = "Test2", + Description = "Description", + Rate = 7.4m, + ValidFrom = DateOnly.FromDateTime(DateTime.Now), + ValidTo = null, + Version = new Guid("e4220000-3c36-7456-088c-08dcfb4a4b66") + }; + + //Act + var response = await _client.PutAsJsonAsync($"{_baseUrlForV1}/{_idToUpd}", command); + + //Assert + response.StatusCode.Should().Be(HttpStatusCode.Unauthorized); + } + + [Fact] + public async Task Update_TaxRate_WithAdmin_403() + { + //Arrange + var token = await GetAccessTokenAsync(TokenType.MegaAdmin); + _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); + + var command = new UpdateSalesOrVatTaxRateCommand + { + Id = _idToUpd, + Code = "Test2", + Description = "Description", + Rate = 7.4m, + ValidFrom = DateOnly.FromDateTime(DateTime.Now), + ValidTo = null, + Version = new Guid("e4220000-3c36-7456-088c-08dcfb4a4b66") + }; + + //Act + var response = await _client.PutAsJsonAsync($"{_baseUrlForV1}/{_idToUpd}", command); + + //Assert + response.StatusCode.Should().Be(HttpStatusCode.Forbidden); + } + + [Fact] + public async Task Update_TaxRate_WithOtherTenant_404() + { + //Arrange + var token = await GetAccessTokenAsync(TokenType.OtherTenant); + _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); + + var command = new UpdateSalesOrVatTaxRateCommand + { + Id = _idToUpd, + Code = "Test2", + Description = "Description", + Rate = 7.4m, + ValidFrom = DateOnly.FromDateTime(DateTime.Now), + ValidTo = null, + Version = new Guid("e4220000-3c36-7456-088c-08dcfb4a4b66") + }; + + //Act + var response = await _client.PutAsJsonAsync($"{_baseUrlForV1}/{_idToUpd}", command); + var result = await response.Content.ReadFromJsonAsync(); + + //Assert + response.StatusCode.Should().Be(HttpStatusCode.NotFound); + result.Should() + .NotBeNull() + .And.BeOfType() + .And.Match(x => x.Errors.First().Code == "TAXRATE_NOT_FOUND"); + } + + [Fact] + public async Task Update_TaxRate_WithNoRole_403() + { + //Arrange + var token = await GetAccessTokenAsync(TokenType.NoRole); + _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); + + var command = new UpdateSalesOrVatTaxRateCommand + { + Id = _idToUpd, + Code = "Test2", + Description = "Description", + Rate = 7.4m, + ValidFrom = DateOnly.FromDateTime(DateTime.Now), + ValidTo = null, + Version = new Guid("e4220000-3c36-7456-088c-08dcfb4a4b66") + }; + + //Act + var response = await _client.PutAsJsonAsync($"{_baseUrlForV1}/{_idToUpd}", command); + + //Assert + response.StatusCode.Should().Be(HttpStatusCode.Forbidden); + } + + + + [Fact] + public async Task Update_TaxRate_WithNotMatchId_400() + { + //Arrange + var token = await GetAccessTokenAsync(TokenType.RW); + _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); + + var command = new UpdateSalesOrVatTaxRateCommand + { + Id = NewId.NextGuid(), + Code = "Test3", + Description = "Description", + Rate = 7.4m, + ValidFrom = DateOnly.FromDateTime(DateTime.Now), + ValidTo = null, + Version = new Guid("e4220000-3c36-7456-088c-08dcfb4a4b66") + }; + + //Act + var response = await _client.PutAsJsonAsync($"{_baseUrlForV1}/{_idToUpd}", command); + var result = await response.Content.ReadFromJsonAsync(); + + //Assert + response.StatusCode.Should().Be(HttpStatusCode.BadRequest); + result.Should() + .NotBeNull() + .And.BeOfType() + .And.Match(x => x.Errors.First().Code == "TAXRATE_UPDATE_IDS_NOT_MATCH"); + } + + [Fact] + public async Task Update_TaxRate_WithAlreadyExists_409() + { + //Arrange + var token = await GetAccessTokenAsync(TokenType.RW); + _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); + + var command = new UpdateSalesOrVatTaxRateCommand + { + Id = _idToUpd, + Code = "v81", + Description = "Description", + Rate = 7.4m, + ValidFrom = DateOnly.FromDateTime(DateTime.Now), + ValidTo = null, + Version = new Guid("e4220000-3c36-7456-088c-08dcfb4a4b66") + }; + + //Act + var response = await _client.PutAsJsonAsync($"{_baseUrlForV1}/{_idToUpd}", command); + var result = await response.Content.ReadFromJsonAsync(); + + //Assert + response.StatusCode.Should().Be(HttpStatusCode.Conflict); + result.Should() + .NotBeNull() + .And.BeOfType() + .And.Match(x => x.Errors.First().Code == "TAXRATE_ALREADY_EXISTS"); + } + + [Fact] + public async Task Update_TaxRate_WithBadId_404() + { + //Arrange + var token = await GetAccessTokenAsync(TokenType.RW); + _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); + + var id = NewId.NextGuid(); + var command = new UpdateSalesOrVatTaxRateCommand + { + Id = id, + Code = "v81", + Description = "Description", + Rate = 7.4m, + ValidFrom = DateOnly.FromDateTime(DateTime.Now), + ValidTo = null, + Version = new Guid("e4220000-3c36-7456-088c-08dcfb4a4b66") + }; + + //Act + var response = await _client.PutAsJsonAsync($"{_baseUrlForV1}/{id}", command); + var result = await response.Content.ReadFromJsonAsync(); + + //Assert + response.StatusCode.Should().Be(HttpStatusCode.NotFound); + result.Should() + .NotBeNull() + .And.BeOfType() + .And.Match(x => x.Errors.First().Code == "TAXRATE_NOT_FOUND"); + } + + [Fact] + public async Task Delete_TaxRate_WithRW_OK() + { + //Arrange + var token = await GetAccessTokenAsync(TokenType.RW); + _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); + + //Act + var response = await _client.DeleteAsync($"{_baseUrlForV1}/{_idToDel}"); + + //Assert + response.StatusCode.Should().Be(HttpStatusCode.NoContent); + } + + [Fact] + public async Task Delete_TaxRate_WithRO_403() + { + //Arrange + var token = await GetAccessTokenAsync(TokenType.RO); + _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); + + //Act + var response = await _client.DeleteAsync($"{_baseUrlForV1}/{_idToDel}"); + + //Assert + response.StatusCode.Should().Be(HttpStatusCode.Forbidden); + } + + [Fact] + public async Task Delete_TaxRate_WithNoToken_401() + { + //Act + var response = await _client.DeleteAsync($"{_baseUrlForV1}/{_idToDel}"); + + //Assert + response.StatusCode.Should().Be(HttpStatusCode.Unauthorized); + } + + [Fact] + public async Task Delete_TaxRate_WithAdmin_403() + { + //Arrange + var token = await GetAccessTokenAsync(TokenType.MegaAdmin); + _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); + + //Act + var response = await _client.DeleteAsync($"{_baseUrlForV1}/{_idToDel}"); + + //Assert + response.StatusCode.Should().Be(HttpStatusCode.Forbidden); + } + + [Fact] + public async Task Delete_TaxRate_WithOtherTenant_404() + { + //Arrange + var token = await GetAccessTokenAsync(TokenType.OtherTenant); + _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); + + //Act + var response = await _client.DeleteAsync($"{_baseUrlForV1}/{_idToDel}"); + + //Assert + response.StatusCode.Should().Be(HttpStatusCode.NotFound); + } + + [Fact] + public async Task Delete_TaxRate_WithNoRole_403() + { + //Arrange + var token = await GetAccessTokenAsync(TokenType.NoRole); + _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); + + //Act + var response = await _client.DeleteAsync($"{_baseUrlForV1}/{_idToDel}"); + + //Assert + response.StatusCode.Should().Be(HttpStatusCode.Forbidden); + } + + [Fact] + public async Task Delete_TaxRate_WithBadId_404() + { + //Arrange + var token = await GetAccessTokenAsync(TokenType.RW); + _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); + + //Act + var response = await _client.DeleteAsync($"{_baseUrlForV1}/{NewId.NextGuid()}"); + + //Assert + response.StatusCode.Should().Be(HttpStatusCode.NotFound); + } } } From a5e8e7303ce968e2cd45c31df96c3946cd251673 Mon Sep 17 00:00:00 2001 From: ubik Date: Sun, 3 Nov 2024 10:22:04 +0100 Subject: [PATCH 29/94] Very minimal health endpoint for accounting struct api --- .../Data/AccountingDbContext.cs | 10 +++++++++ .../Data/Config/ApplicationConfiguration.cs | 21 +++++++++++++++++++ .../Data/Init/ApplicationData.cs | 19 +++++++++++++++++ .../Data/Init/DbInitializer.cs | 9 +++++++- .../Controllers/v1/ApplicationController.cs | 9 ++++++++ .../Services/ApplicationCommandService.cs | 6 ++++++ .../Services/IApplicationCommandService.cs | 1 + .../Models/Application.cs | 8 +++++++ 8 files changed, 82 insertions(+), 1 deletion(-) create mode 100644 src/Ubik.Accounting.Structure.Api/Data/Config/ApplicationConfiguration.cs create mode 100644 src/Ubik.Accounting.Structure.Api/Data/Init/ApplicationData.cs create mode 100644 src/Ubik.Accounting.Structure.Api/Models/Application.cs diff --git a/src/Ubik.Accounting.Structure.Api/Data/AccountingDbContext.cs b/src/Ubik.Accounting.Structure.Api/Data/AccountingDbContext.cs index bf56c11d..907cadba 100644 --- a/src/Ubik.Accounting.Structure.Api/Data/AccountingDbContext.cs +++ b/src/Ubik.Accounting.Structure.Api/Data/AccountingDbContext.cs @@ -19,6 +19,7 @@ public class AccountingDbContext(DbContextOptions options public DbSet AccountsAccountGroups { get; set; } public DbSet Classifications { get; set; } public DbSet Currencies { get; set; } + public DbSet Applications { get; set; } //public DbSet Transactions { get; set; } //public DbSet Entries { get; set; } @@ -29,6 +30,14 @@ protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) .UseSnakeCaseNamingConvention(); } + public Application Application + { + get + { + return Applications.SingleOrDefault()!; + } + } + public override async Task SaveChangesAsync(CancellationToken cancellationToken = default) { try @@ -73,6 +82,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) new AccountGroupConfiguration().Configure(modelBuilder.Entity()); new AccountConfiguration().Configure(modelBuilder.Entity()); new AccountAccountGroupConfiguration().Configure(modelBuilder.Entity()); + new ApplicationConfiguration().Configure(modelBuilder.Entity()); //new TransactionConfiguration().Configure(modelBuilder.Entity()); //new EntryConfiguration().Configure(modelBuilder.Entity()); diff --git a/src/Ubik.Accounting.Structure.Api/Data/Config/ApplicationConfiguration.cs b/src/Ubik.Accounting.Structure.Api/Data/Config/ApplicationConfiguration.cs new file mode 100644 index 00000000..e35903c8 --- /dev/null +++ b/src/Ubik.Accounting.Structure.Api/Data/Config/ApplicationConfiguration.cs @@ -0,0 +1,21 @@ +using Microsoft.EntityFrameworkCore.Metadata.Builders; +using Microsoft.EntityFrameworkCore; +using Ubik.Accounting.Structure.Api.Models; + +namespace Ubik.Accounting.Structure.Api.Data.Config +{ + public class ApplicationConfiguration : IEntityTypeConfiguration + { + public void Configure(EntityTypeBuilder builder) + { + builder.ToTable("application", t => + { + t.HasCheckConstraint("ck_application_is_ready", "id = 1"); + }); + + builder.Property(a => a.IsReady) + .IsRequired() + .HasDefaultValue(false); + } + } +} diff --git a/src/Ubik.Accounting.Structure.Api/Data/Init/ApplicationData.cs b/src/Ubik.Accounting.Structure.Api/Data/Init/ApplicationData.cs new file mode 100644 index 00000000..f9a592c6 --- /dev/null +++ b/src/Ubik.Accounting.Structure.Api/Data/Init/ApplicationData.cs @@ -0,0 +1,19 @@ +using Microsoft.EntityFrameworkCore; +using System.Runtime.CompilerServices; +using Ubik.Accounting.Structure.Api.Models; + +namespace Ubik.Accounting.Structure.Api.Data.Init +{ + internal static class ApplicationData + { + internal static async Task LoadAsync(AccountingDbContext context) + { + if (!context.Applications.Any()) + { + var app = new Application() { IsReady= false }; + await context.Applications.AddAsync(app); + await context.SaveChangesAsync(); + } + } + } +} diff --git a/src/Ubik.Accounting.Structure.Api/Data/Init/DbInitializer.cs b/src/Ubik.Accounting.Structure.Api/Data/Init/DbInitializer.cs index ef323f61..fc66199d 100644 --- a/src/Ubik.Accounting.Structure.Api/Data/Init/DbInitializer.cs +++ b/src/Ubik.Accounting.Structure.Api/Data/Init/DbInitializer.cs @@ -1,14 +1,21 @@ -namespace Ubik.Accounting.Structure.Api.Data.Init +using Microsoft.EntityFrameworkCore; + +namespace Ubik.Accounting.Structure.Api.Data.Init { static internal class DbInitializer { static internal async Task InitializeAsync(AccountingDbContext context) { + await ApplicationData.LoadAsync(context); CurrenciesData.Load(context); ClassificationsData.Load(context); await AccountGroupsData.LoadAsync(context); await AccountsData.LoadAsync(context); await AccountsAccountGroupsData.LoadAsync(context); + + //TODO: need to evolve to other health check for PROD + //Set the application as ready + await context.Database.ExecuteSqlRawAsync("UPDATE application SET is_ready = true"); } } } diff --git a/src/Ubik.Accounting.Structure.Api/Features/Application/Controllers/v1/ApplicationController.cs b/src/Ubik.Accounting.Structure.Api/Features/Application/Controllers/v1/ApplicationController.cs index bab4151d..cabbd970 100644 --- a/src/Ubik.Accounting.Structure.Api/Features/Application/Controllers/v1/ApplicationController.cs +++ b/src/Ubik.Accounting.Structure.Api/Features/Application/Controllers/v1/ApplicationController.cs @@ -20,5 +20,14 @@ public async Task> CleanupDatabaseInDev() var result = await commandService.CleanupDatabaseInDevAsync(); return result ? Ok(result) : StatusCode(500); } + + [HttpGet("health")] + [ProducesResponseType(200)] + [ProducesResponseType(500)] + public async Task> IsReady() + { + var result = await commandService.IsReady(); + return Ok(result); + } } } diff --git a/src/Ubik.Accounting.Structure.Api/Features/Application/Services/ApplicationCommandService.cs b/src/Ubik.Accounting.Structure.Api/Features/Application/Services/ApplicationCommandService.cs index 603a19ca..ac78ab20 100644 --- a/src/Ubik.Accounting.Structure.Api/Features/Application/Services/ApplicationCommandService.cs +++ b/src/Ubik.Accounting.Structure.Api/Features/Application/Services/ApplicationCommandService.cs @@ -24,5 +24,11 @@ public async Task CleanupDatabaseInDevAsync() return false; } + + public async Task IsReady() + { + await Task.CompletedTask; + return ctx.Application.IsReady; + } } } diff --git a/src/Ubik.Accounting.Structure.Api/Features/Application/Services/IApplicationCommandService.cs b/src/Ubik.Accounting.Structure.Api/Features/Application/Services/IApplicationCommandService.cs index 4e62eb8e..ceae62eb 100644 --- a/src/Ubik.Accounting.Structure.Api/Features/Application/Services/IApplicationCommandService.cs +++ b/src/Ubik.Accounting.Structure.Api/Features/Application/Services/IApplicationCommandService.cs @@ -3,5 +3,6 @@ public interface IApplicationCommandService { public Task CleanupDatabaseInDevAsync(); + public Task IsReady(); } } diff --git a/src/Ubik.Accounting.Structure.Api/Models/Application.cs b/src/Ubik.Accounting.Structure.Api/Models/Application.cs new file mode 100644 index 00000000..5d38dd4a --- /dev/null +++ b/src/Ubik.Accounting.Structure.Api/Models/Application.cs @@ -0,0 +1,8 @@ +namespace Ubik.Accounting.Structure.Api.Models +{ + public class Application + { + public int Id { get; set; } + public bool IsReady { get; set; } = false; + } +} From 7f3b49889cb5493dd1e89038888a228100b8cea3 Mon Sep 17 00:00:00 2001 From: ubik Date: Sun, 3 Nov 2024 10:26:43 +0100 Subject: [PATCH 30/94] Change applications routes --- .../Application/Controllers/v1/ApplicationController.cs | 2 +- .../Application/Controllers/v1/ApplicationController.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Features/Application/Controllers/v1/ApplicationController.cs b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/Application/Controllers/v1/ApplicationController.cs index b5a09353..b0aeb462 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Api/Features/Application/Controllers/v1/ApplicationController.cs +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/Application/Controllers/v1/ApplicationController.cs @@ -7,7 +7,7 @@ namespace Ubik.Accounting.SalesOrVatTax.Api.Features.Application.Controllers.v1 { [ApiController] [ApiVersion("1.0")] - [Route("admin/api/v{version:apiVersion}/sales-vat-tax/application")] + [Route("admin/api/v{version:apiVersion}/sales-vat-tax-app")] public class ApplicationController(IApplicationCommandService commandService) : ControllerBase { //Cannot be used in PROD, command and queries DB can be different diff --git a/src/Ubik.Accounting.Structure.Api/Features/Application/Controllers/v1/ApplicationController.cs b/src/Ubik.Accounting.Structure.Api/Features/Application/Controllers/v1/ApplicationController.cs index cabbd970..772053ee 100644 --- a/src/Ubik.Accounting.Structure.Api/Features/Application/Controllers/v1/ApplicationController.cs +++ b/src/Ubik.Accounting.Structure.Api/Features/Application/Controllers/v1/ApplicationController.cs @@ -7,7 +7,7 @@ namespace Ubik.Accounting.Structure.Api.Features.Application.Controllers.v1 { [ApiController] [ApiVersion("1.0")] - [Route("admin/api/v{version:apiVersion}/application")] + [Route("admin/api/v{version:apiVersion}/struct-app")] public class ApplicationController(IApplicationCommandService commandService) : ControllerBase { //Cannot be used in PROD, command and queries DB can be different From c64ad34802facbc8e621a590e787538b26bd2d7d Mon Sep 17 00:00:00 2001 From: ubik Date: Sun, 3 Nov 2024 10:30:19 +0100 Subject: [PATCH 31/94] Only use health check for DEV, return true if in PROD --- .../Application/Services/ApplicationCommandService.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/Ubik.Accounting.Structure.Api/Features/Application/Services/ApplicationCommandService.cs b/src/Ubik.Accounting.Structure.Api/Features/Application/Services/ApplicationCommandService.cs index ac78ab20..710e160e 100644 --- a/src/Ubik.Accounting.Structure.Api/Features/Application/Services/ApplicationCommandService.cs +++ b/src/Ubik.Accounting.Structure.Api/Features/Application/Services/ApplicationCommandService.cs @@ -25,10 +25,17 @@ public async Task CleanupDatabaseInDevAsync() return false; } + //Not really a command... public async Task IsReady() { - await Task.CompletedTask; - return ctx.Application.IsReady; + if (env.IsDevelopment()) + { + await Task.CompletedTask; + return ctx.Application.IsReady; + } + + //TODO: implement health check for Live Env. (maybe to check different queries and commands in the controller) + return true; } } } From 2e98abaca595779b5774978132a723bfbfa0bb99 Mon Sep 17 00:00:00 2001 From: ubik Date: Sun, 3 Nov 2024 10:36:02 +0100 Subject: [PATCH 32/94] Chnage data seed for application in struct api --- .../Data/Config/ApplicationConfiguration.cs | 6 ++++++ .../Data/Init/ApplicationData.cs | 19 ------------------- .../Data/Init/DbInitializer.cs | 1 - 3 files changed, 6 insertions(+), 20 deletions(-) delete mode 100644 src/Ubik.Accounting.Structure.Api/Data/Init/ApplicationData.cs diff --git a/src/Ubik.Accounting.Structure.Api/Data/Config/ApplicationConfiguration.cs b/src/Ubik.Accounting.Structure.Api/Data/Config/ApplicationConfiguration.cs index e35903c8..e3217724 100644 --- a/src/Ubik.Accounting.Structure.Api/Data/Config/ApplicationConfiguration.cs +++ b/src/Ubik.Accounting.Structure.Api/Data/Config/ApplicationConfiguration.cs @@ -16,6 +16,12 @@ public void Configure(EntityTypeBuilder builder) builder.Property(a => a.IsReady) .IsRequired() .HasDefaultValue(false); + + builder.HasData(new Application + { + Id = 1, + IsReady = false + }); } } } diff --git a/src/Ubik.Accounting.Structure.Api/Data/Init/ApplicationData.cs b/src/Ubik.Accounting.Structure.Api/Data/Init/ApplicationData.cs deleted file mode 100644 index f9a592c6..00000000 --- a/src/Ubik.Accounting.Structure.Api/Data/Init/ApplicationData.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using System.Runtime.CompilerServices; -using Ubik.Accounting.Structure.Api.Models; - -namespace Ubik.Accounting.Structure.Api.Data.Init -{ - internal static class ApplicationData - { - internal static async Task LoadAsync(AccountingDbContext context) - { - if (!context.Applications.Any()) - { - var app = new Application() { IsReady= false }; - await context.Applications.AddAsync(app); - await context.SaveChangesAsync(); - } - } - } -} diff --git a/src/Ubik.Accounting.Structure.Api/Data/Init/DbInitializer.cs b/src/Ubik.Accounting.Structure.Api/Data/Init/DbInitializer.cs index fc66199d..95302495 100644 --- a/src/Ubik.Accounting.Structure.Api/Data/Init/DbInitializer.cs +++ b/src/Ubik.Accounting.Structure.Api/Data/Init/DbInitializer.cs @@ -6,7 +6,6 @@ static internal class DbInitializer { static internal async Task InitializeAsync(AccountingDbContext context) { - await ApplicationData.LoadAsync(context); CurrenciesData.Load(context); ClassificationsData.Load(context); await AccountGroupsData.LoadAsync(context); From 13c255154165f3633cc1a721c7d43f222bc96e5a Mon Sep 17 00:00:00 2001 From: ubik Date: Mon, 4 Nov 2024 08:18:27 +0100 Subject: [PATCH 33/94] Account data in sales-vat tax module. --- .../Data/Init/AccountsData.sql | 266 ++++++++++++++++++ .../Ubik.Accounting.SalesOrVatTax.Api.csproj | 3 + 2 files changed, 269 insertions(+) create mode 100644 src/Ubik.Accounting.SalesOrVatTax.Api/Data/Init/AccountsData.sql diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Data/Init/AccountsData.sql b/src/Ubik.Accounting.SalesOrVatTax.Api/Data/Init/AccountsData.sql new file mode 100644 index 00000000..dfc941cb --- /dev/null +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Data/Init/AccountsData.sql @@ -0,0 +1,266 @@ +/*Copy from Structure api accounts data*/ +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('248e0000-5dd4-0015-e321-08dcd98b1434', '1020', 'Bank', true, '248e0000-5dd4-0015-f549-08dcd98b1434', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('248e0000-5dd4-0015-f110-08dcd98b20af', '1060', 'Securities', true, '248e0000-5dd4-0015-f77f-08dcd98b20af', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('248e0000-5dd4-0015-aa2d-08dcd98b2ad0', '1100', 'Trade accounts receivable', true, '248e0000-5dd4-0015-b397-08dcd98b2ad0', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('248e0000-5dd4-0015-12f9-08dcd98b3350', '1101', 'Credit card receivables', true, '248e0000-5dd4-0015-1822-08dcd98b3350', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('248e0000-5dd4-0015-8db2-08dcd98b3c4c', '1109', 'Provision for credit losses (Ducroire)', true, '248e0000-5dd4-0015-928a-08dcd98b3c4c', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('248e0000-5dd4-0015-48fb-08dcd98b4a28', '1140', 'Advances and loans granted', true, '248e0000-5dd4-0015-4df0-08dcd98b4a28', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('248e0000-5dd4-0015-13fe-08dcd98b6d70', '1176', 'Withholding tax recoverable', true, '248e0000-5dd4-0015-19ed-08dcd98b6d70', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('248e0000-5dd4-0015-fff6-08dcd98b746a', '1190', 'Other short-term receivables', true, '248e0000-5dd4-0015-04ac-08dcd98b746b', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('248e0000-5dd4-0015-ebad-08dcd98b0949', '1000', 'Case', true, '248e0000-5dd4-0015-a737-08dcd98bcb2b', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('78920000-5dd4-0015-3c01-08dcd9a7702b', '1400', 'Long-term securities', true, '78920000-5dd4-0015-18d4-08dcd9a7702e', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('78920000-5dd4-0015-eaeb-08dcd9a778d2', '1440', 'Long-term loans', true, '78920000-5dd4-0015-f445-08dcd9a778d2', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('78920000-5dd4-0015-6f96-08dcd9a78046', '1441', 'Mortgage loans', true, '78920000-5dd4-0015-7a90-08dcd9a78046', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('248e0000-5dd4-0015-443b-08dcd98b545d', '1170', 'VAT input tax (materials, services)', true, '78920000-5dd4-0015-983d-08dcd9a9beab', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('248e0000-5dd4-0015-133a-08dcd98b5d1d', '1171', 'VAT input tax (investments and other charges)', true, '78920000-5dd4-0015-c8f5-08dcd9a9c7da', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('248e0000-5dd4-0015-c1ce-08dcd98b7c74', '1200', 'Inventory A', true, '78920000-5dd4-0015-f39f-08dcd9a9f93e', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('248e0000-5dd4-0015-2c01-08dcd98b8441', '1201', 'Inventory B', true, '78920000-5dd4-0015-2de6-08dcd9aa042a', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('248e0000-5dd4-0015-9008-08dcd98b8c12', '1209', 'Inventory valuation adjustments', true, '78920000-5dd4-0015-3a44-08dcd9aa0fb7', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('248e0000-5dd4-0015-7165-08dcd98bbffa', '1300', 'Prepaid expenses', true, '78920000-5dd4-0015-392d-08dcd9aa2c96', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('78920000-5dd4-0015-23e7-08dcd9aa3ba7', '1301', 'Receivables for products and services', true, '78920000-5dd4-0015-2a3d-08dcd9aa3ba7', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('ec860000-5dd4-0015-3815-08dcda1dad9e', '1522', 'Communication systems', true, 'ec860000-5dd4-0015-3d50-08dcda1dad9e', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('78920000-5dd4-0015-0644-08dcd9aaf581', '1409', 'Valuation adjustments on long-term invest', true, '78920000-5dd4-0015-c298-08dcd9aaffac', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('78920000-5dd4-0015-a5ff-08dcd9a7ab43', '1449', 'Valuation adjustments on long-term loans', true, '78920000-5dd4-0015-c376-08dcd9ab07a8', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('ec860000-5dd4-0015-1c93-08dcda1d182f', '1500', 'Machinery and equipment', true, 'ec860000-5dd4-0015-ba47-08dcda1d1831', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('ec860000-5dd4-0015-b48d-08dcda1d22ef', '1510', 'Operating furniture', true, 'ec860000-5dd4-0015-bc9f-08dcda1d22ef', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('ec860000-5dd4-0015-061c-08dcda1d2bc2', '1511', 'Workshop installations', true, 'ec860000-5dd4-0015-0fca-08dcda1d2bc2', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('ec860000-5dd4-0015-ddf3-08dcda1d3498', '1512', 'Warehouse installations', true, 'ec860000-5dd4-0015-e2f2-08dcda1d3498', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('ec860000-5dd4-0015-bc68-08dcda1d47f5', '1513', 'Office furniture', true, 'ec860000-5dd4-0015-c79e-08dcda1d47f5', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('ec860000-5dd4-0015-a24f-08dcda1d9931', '1520', 'Office machines', true, 'ec860000-5dd4-0015-a781-08dcda1d9931', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('ec860000-5dd4-0015-9192-08dcda1da58d', '1521', 'IT infrastructure', true, 'ec860000-5dd4-0015-99c4-08dcda1da58d', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('ec860000-5dd4-0015-0173-08dcda1db8d7', '1530', 'Cars', true, 'ec860000-5dd4-0015-07a9-08dcda1db8d7', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('ec860000-5dd4-0015-d472-08dcda1dc37c', '1540', 'Tools and equipment', true, 'ec860000-5dd4-0015-da04-08dcda1dc37c', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('ec860000-5dd4-0015-66d1-08dcda1dd26b', '1550', 'Storage facilities', true, 'ec860000-5dd4-0015-6c02-08dcda1dd26b', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('ec860000-5dd4-0015-11c5-08dcda1de501', '1590', 'Work clothing and uniforms', true, 'ec860000-5dd4-0015-1701-08dcda1de501', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('ec860000-5dd4-0015-3436-08dcda1eb6ce', '1600', 'Operating buildings', true, 'ec860000-5dd4-0015-3c3a-08dcda1eb6ce', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('ec860000-5dd4-0015-f0cf-08dcda1ebfe4', '1601', 'Maintenance, repair, or replacement', true, 'ec860000-5dd4-0015-f4d3-08dcda1ebfe4', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('ec860000-5dd4-0015-12a2-08dcda1ed305', '1800', 'Incorporation costs', true, 'ec860000-5dd4-0015-16a9-08dcda1ed305', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('ec860000-5dd4-0015-69c4-08dcda1edb78', '1801', 'Capital increase costs', true, 'ec860000-5dd4-0015-0c65-08dcda1ef2e0', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('ec860000-5dd4-0015-7012-08dcda1ef826', '1802', 'Organizational costs', true, 'ec860000-5dd4-0015-74d8-08dcda1ef826', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('ec860000-5dd4-0015-ef03-08dcda1f0104', '1850', 'Unissued share capital', true, 'ec860000-5dd4-0015-f553-08dcda1f0104', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('ec860000-5dd4-0015-c9fe-08dcda1f08eb', '1859', 'Valuation adjustments on unissued share capital', true, 'ec860000-5dd4-0015-d01a-08dcda1f08eb', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('ec860000-5dd4-0015-5955-08dcda1eca12', '1609', 'Accumulated depreciation on operating buildings', true, 'ec860000-5dd4-0015-df72-08dcda1f3dbc', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('ec860000-5dd4-0015-1cc9-08dcda20a76e', '2000', 'Liabilities for purchases of materials and goods', true, 'ec860000-5dd4-0015-234c-08dcda20a76e', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('ec860000-5dd4-0015-98ee-08dcda20b16e', '2001', 'Liabilities for services to third parties', true, 'ec860000-5dd4-0015-9c96-08dcda20b16e', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('ec860000-5dd4-0015-1ecb-08dcda20bb14', '2002', 'Liabilities for personnel expenses', true, 'ec860000-5dd4-0015-22db-08dcda20bb14', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('ec860000-5dd4-0015-54dd-08dcda20c7a0', '2003', 'Liabilities for social security contributions', true, 'ec860000-5dd4-0015-5874-08dcda20c7a0', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('ec860000-5dd4-0015-e6b0-08dcda20d5dd', '2005', 'Liabilities for lease transactions', true, 'ec860000-5dd4-0015-eac7-08dcda20d5dd', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('ec860000-5dd4-0015-a0ad-08dcda20cecb', '2004', 'Liabilities for other operating expenses', true, 'ec860000-5dd4-0015-6c4d-08dcda210823', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('ec860000-5dd4-0015-aa11-08dcda2fe630', '2030', 'Customer advances', true, 'ec860000-5dd4-0015-aee3-08dcda2fe630', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('ec860000-5dd4-0015-4e95-08dcda2ff13b', '2100', 'Short-term bank liabilities', true, 'ec860000-5dd4-0015-5350-08dcda2ff13b', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('ec860000-5dd4-0015-2d5c-08dcda306250', '2110', 'Liabilities to post offices', true, 'ec860000-5dd4-0015-3149-08dcda306250', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('ec860000-5dd4-0015-ce96-08dcda306be5', '2111', 'Liabilities to transfer companies', true, 'ec860000-5dd4-0015-d394-08dcda306be5', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('ec860000-5dd4-0015-0733-08dcda307df9', '2160', 'Short-term financial liabilities to shareholder X', true, 'ec860000-5dd4-0015-0a00-08dcda307df9', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('ec860000-5dd4-0015-5593-08dcda308633', '2170', 'Short-term financial liabilities to pension funds', true, 'ec860000-5dd4-0015-584c-08dcda308633', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('ec860000-5dd4-0015-e456-08dcda308e53', '2180', 'Mortgage repayments', true, 'ec860000-5dd4-0015-e818-08dcda308e53', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('ec860000-5dd4-0015-a892-08dcda3094b8', '2181', 'Loan repayments', true, 'ec860000-5dd4-0015-ad23-08dcda3094b8', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('ec860000-5dd4-0015-2309-08dcda309b7b', '2200', 'VAT payable', true, 'ec860000-5dd4-0015-25fe-08dcda309b7b', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('ec860000-5dd4-0015-e12c-08dcda30a42e', '2205', 'AFC - VAT', true, 'ec860000-5dd4-0015-e3a2-08dcda30a42e', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('ec860000-5dd4-0015-e7f6-08dcda30aa7d', '2206', 'Due withholding tax', true, 'ec860000-5dd4-0015-ecc0-08dcda30aa7d', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('ec860000-5dd4-0015-2192-08dcda30b1de', '2207', 'Due stamp duties', true, 'ec860000-5dd4-0015-2506-08dcda30b1de', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('ec860000-5dd4-0015-0ce3-08dcda30bd7f', '2208', 'Due direct taxes', true, 'ec860000-5dd4-0015-0f91-08dcda30bd7f', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('ec860000-5dd4-0015-8e25-08dcda30c7bb', '2230', 'Unclaimed dividends for the year', true, 'ec860000-5dd4-0015-9ad3-08dcda30c7bb', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('ec860000-5dd4-0015-3043-08dcda30ce50', '2231', 'Unclaimed dividends from previous years', true, 'ec860000-5dd4-0015-3371-08dcda30ce50', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('ec860000-5dd4-0015-8e4f-08dcda30d697', '2232', 'Unclaimed bond coupons', true, 'ec860000-5dd4-0015-90fc-08dcda30d697', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('ec860000-5dd4-0015-e4a1-08dcda3073d0', '2140', 'Other short-term financial liabilities to third parties', true, 'ec860000-5dd4-0015-5fe2-08dcda316bc3', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('ec860000-5dd4-0015-f91d-08dcda52f00f', '2300', 'Accrued expenses', true, 'ec860000-5dd4-0015-fcae-08dcda52f00f', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('ec860000-5dd4-0015-b39d-08dcda530d2c', '2301', 'Prepaid income', true, 'ec860000-5dd4-0015-b78d-08dcda530d2c', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('ec860000-5dd4-0015-01b3-08dcda531ef9', '2340', 'Provisions for direct taxes', true, 'ec860000-5dd4-0015-04a4-08dcda531ef9', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('ec860000-5dd4-0015-b414-08dcda532935', '2341', 'Provisions for indirect taxes', true, 'ec860000-5dd4-0015-b722-08dcda532935', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('dc610000-5dd4-0015-07cd-08dcda5647e1', '2400', 'Long-term bank liabilities', true, 'dc610000-5dd4-0015-1264-08dcda5647e8', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('dc610000-5dd4-0015-3646-08dcda5647ed', '2420', 'Liabilities from lease transactions', true, 'dc610000-5dd4-0015-7f38-08dcda5647ed', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('dc610000-5dd4-0015-15f0-08dcda5647ee', '2440', 'Mortgages on operating buildings', true, 'dc610000-5dd4-0015-1a65-08dcda5647ee', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('dc610000-5dd4-0015-c1ff-08dcda5647ee', '2500', 'Long-term loans from third parties', true, 'dc610000-5dd4-0015-c778-08dcda5647ee', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('dc610000-5dd4-0015-41c7-08dcda5647ef', '2560', 'Long-term loans to shareholders', true, 'dc610000-5dd4-0015-4659-08dcda5647ef', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('dc610000-5dd4-0015-c36a-08dcda5647ef', '2570', 'Long-term loans to pension funds', true, 'dc610000-5dd4-0015-ca17-08dcda5647ef', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('dc610000-5dd4-0015-46c8-08dcda5647f0', '2600', 'Provision for repairs', true, 'dc610000-5dd4-0015-4c69-08dcda5647f0', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('dc610000-5dd4-0015-ee99-08dcda5647f0', '2601', 'Provision for renovations', true, 'dc610000-5dd4-0015-f646-08dcda5647f0', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('dc610000-5dd4-0015-724d-08dcda5647f1', '2602', 'Provision for refurbishments', true, 'dc610000-5dd4-0015-7965-08dcda5647f1', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('dc610000-5dd4-0015-0363-08dcda5647f2', '2630', 'Provisions for warranty work', true, 'dc610000-5dd4-0015-0adf-08dcda5647f2', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('dc610000-5dd4-0015-83b1-08dcda5647f2', '2800', 'Equity', true, 'dc610000-5dd4-0015-8a8d-08dcda5647f2', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('dc610000-5dd4-0015-39bb-08dcda5647f3', '2801', 'Spouse''s equity', true, 'dc610000-5dd4-0015-430c-08dcda5647f3', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('dc610000-5dd4-0015-bbae-08dcda5647f3', '2810', 'Partner A''s capital account', true, 'dc610000-5dd4-0015-d5a8-08dcda5647f3', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('dc610000-5dd4-0015-5509-08dcda5647f4', '2811', 'Partner B''s capital account', true, 'dc610000-5dd4-0015-5da7-08dcda5647f4', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('dc610000-5dd4-0015-dac6-08dcda5647f4', '2812', 'Commandite partner C''s capital account', true, 'dc610000-5dd4-0015-e3fa-08dcda5647f4', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('dc610000-5dd4-0015-8943-08dcda5647f5', '2820', 'Share capital of the LLC', true, 'dc610000-5dd4-0015-921d-08dcda5647f5', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('dc610000-5dd4-0015-0ffd-08dcda5647f6', '2840', 'Share capital', true, 'dc610000-5dd4-0015-19d0-08dcda5647f6', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('dc610000-5dd4-0015-95c3-08dcda5647f6', '2841', 'Participation capital', true, 'dc610000-5dd4-0015-9fba-08dcda5647f6', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('dc610000-5dd4-0015-1c3a-08dcda5647f7', '2850', 'Private cash withdrawals', true, 'dc610000-5dd4-0015-2641-08dcda5647f7', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('dc610000-5dd4-0015-c85d-08dcda5647f7', '2851', 'Private in-kind withdrawals', true, 'dc610000-5dd4-0015-d2f0-08dcda5647f7', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('dc610000-5dd4-0015-573b-08dcda5647f8', '2852', 'Private contributions to operating expenses', true, 'dc610000-5dd4-0015-62ae-08dcda5647f8', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('dc610000-5dd4-0015-da37-08dcda5647f8', '2853', 'Rental value of private apartment', true, 'dc610000-5dd4-0015-e55d-08dcda5647f8', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('dc610000-5dd4-0015-65d5-08dcda5647f9', '2854', 'Private insurance premiums', true, 'dc610000-5dd4-0015-71a2-08dcda5647f9', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('dc610000-5dd4-0015-1dfa-08dcda5647fa', '2855', 'Private pension contributions', true, 'dc610000-5dd4-0015-2a34-08dcda5647fa', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('dc610000-5dd4-0015-a720-08dcda5647fa', '2856', 'Private taxes', true, 'dc610000-5dd4-0015-b33d-08dcda5647fa', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('dc610000-5dd4-0015-3f48-08dcda5647fb', '2880', 'Private property A', true, 'dc610000-5dd4-0015-51a4-08dcda5647fb', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('dc610000-5dd4-0015-cdb5-08dcda5647fb', '2900', 'General reserve', true, 'dc610000-5dd4-0015-db04-08dcda5647fb', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('dc610000-5dd4-0015-7a6c-08dcda5647fc', '2901', 'Reserve for treasury shares', true, 'dc610000-5dd4-0015-87e2-08dcda5647fc', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('dc610000-5dd4-0015-0677-08dcda5647fd', '2903', 'Revaluation reserve', true, 'dc610000-5dd4-0015-145f-08dcda5647fd', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('dc610000-5dd4-0015-905e-08dcda5647fd', '2910', 'Statutory reserves', true, 'dc610000-5dd4-0015-9eff-08dcda5647fd', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('dc610000-5dd4-0015-1791-08dcda5647fe', '2990', 'Brought-forward profit / Brought-forward loss', true, 'dc610000-5dd4-0015-25fe-08dcda5647fe', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('dc610000-5dd4-0015-fd1c-08dcda5647fe', '2991', 'Current-year profit / Current-year loss', true, 'dc610000-5dd4-0015-0e56-08dcda5647ff', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('4c6f0000-5dd4-0015-5b3c-08dcda56e416', '3211', 'Gross credit retail sales', true, '4c6f0000-5dd4-0015-81a7-08dcda56e41d', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('4c6f0000-5dd4-0015-7cad-08dcda56e423', '3212', 'Gross credit wholesale sales', true, '4c6f0000-5dd4-0015-bf07-08dcda56e423', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('4c6f0000-5dd4-0015-5a60-08dcda56e424', '3220', 'Gross sales at standard VAT rate (8.00% net VAT)', true, '4c6f0000-5dd4-0015-5ee0-08dcda56e424', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('4c6f0000-5dd4-0015-db2b-08dcda56e424', '3221', 'Gross sales at reduced VAT rate (2.50% net VAT)', true, '4c6f0000-5dd4-0015-dfcf-08dcda56e424', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('4c6f0000-5dd4-0015-ad5b-08dcda56e425', '3222', 'Gross sales at zero VAT rate (0.00% net VAT)', true, '4c6f0000-5dd4-0015-b1bd-08dcda56e425', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('4c6f0000-5dd4-0015-5998-08dcda56e426', '3300', 'Other directly incorporable materials', true, '4c6f0000-5dd4-0015-614e-08dcda56e426', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('4c6f0000-5dd4-0015-e459-08dcda56e426', '3720', 'Internal consumption', true, '4c6f0000-5dd4-0015-e998-08dcda56e426', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('4c6f0000-5dd4-0015-63be-08dcda56e427', '3900', 'Discounts', true, '4c6f0000-5dd4-0015-6abe-08dcda56e427', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('4c6f0000-5dd4-0015-0dad-08dcda56e428', '3901', 'Price rebates', true, '4c6f0000-5dd4-0015-148f-08dcda56e428', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-4a86-08dcda58ab6a', '4292', 'Refunds', true, 'b0650000-5dd4-0015-e575-08dcda6a7f80', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('4c6f0000-5dd4-0015-7bf9-08dcda56e429', '3903', 'Third-party commissions', true, '4c6f0000-5dd4-0015-8393-08dcda56e429', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('4c6f0000-5dd4-0015-0683-08dcda56e42a', '3904', 'Collection fees', true, '4c6f0000-5dd4-0015-0e72-08dcda56e42a', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('4c6f0000-5dd4-0015-ac69-08dcda56e42a', '3905', 'Customer losses', true, '4c6f0000-5dd4-0015-b4e7-08dcda56e42a', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('4c6f0000-5dd4-0015-3498-08dcda56e42b', '3906', 'Foreign exchange differences', true, '4c6f0000-5dd4-0015-3cf3-08dcda56e42b', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('4c6f0000-5dd4-0015-f5b3-08dcda56e42b', '3907', 'Freight and carriage', true, '4c6f0000-5dd4-0015-fec1-08dcda56e42b', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('4c6f0000-5dd4-0015-b18f-08dcda56e42c', '3210', 'Gross cash sales', true, '4c6f0000-5dd4-0015-bac3-08dcda56e42c', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-ab3e-08dcda58ab55', '4208', 'Inventory adjustments', true, '60520000-5dd4-0015-64c7-08dcda58ab5d', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-6395-08dcda58ab63', '4209', 'Deductions obtained on purchases', true, '60520000-5dd4-0015-a651-08dcda58ab63', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-5c21-08dcda58ab64', '4210', 'Purchases of goods at standard VAT rate (8.00% net VAT)', true, '60520000-5dd4-0015-60fe-08dcda58ab64', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-e55a-08dcda58ab64', '4211', 'Purchases of goods at reduced VAT rate (2.50% net VAT)', true, '60520000-5dd4-0015-e987-08dcda58ab64', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-988a-08dcda58ab65', '4212', 'Purchases of goods at zero VAT rate (0.00% net VAT)', true, '60520000-5dd4-0015-9d88-08dcda58ab65', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-3197-08dcda58ab66', '4215', 'Purchase of packaging materials', true, '60520000-5dd4-0015-3a85-08dcda58ab66', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-700a-08dcda58ab67', '4270', 'Purchase freight', true, '60520000-5dd4-0015-763f-08dcda58ab67', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-f70d-08dcda58ab67', '4271', 'Import customs duties', true, '60520000-5dd4-0015-fd6a-08dcda58ab67', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-8547-08dcda58ab68', '4272', 'Purchase transportation costs', true, '60520000-5dd4-0015-8b6e-08dcda58ab68', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-0b7c-08dcda58ab69', '4290', 'Discounts', true, '60520000-5dd4-0015-1190-08dcda58ab69', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-c1b6-08dcda58ab69', '4291', 'Price rebates', true, '60520000-5dd4-0015-c8b6-08dcda58ab69', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-e6d2-08dcda58ab6a', '4293', 'Rebates obtained on purchases', true, '60520000-5dd4-0015-ede7-08dcda58ab6a', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-7563-08dcda58ab6b', '4296', 'Foreign exchange differences', true, '60520000-5dd4-0015-7d56-08dcda58ab6b', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-2576-08dcda58ab6c', '5200', 'Salaries', true, '60520000-5dd4-0015-2c86-08dcda58ab6c', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-b332-08dcda58ab6c', '5205', 'Social security benefits', true, '60520000-5dd4-0015-bb48-08dcda58ab6c', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-374c-08dcda58ab6d', '5270', 'Old-age and survivors'' insurance, disability insurance, income replacement', true, '60520000-5dd4-0015-3f61-08dcda58ab6d', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-c742-08dcda58ab6d', '5271', 'Family allowance fund', true, '60520000-5dd4-0015-d07e-08dcda58ab6d', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-7504-08dcda58ab6e', '5272', 'Occupational pension plan', true, '60520000-5dd4-0015-7e69-08dcda58ab6e', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-fb87-08dcda58ab6e', '5273', 'Accident insurance', true, '60520000-5dd4-0015-04f4-08dcda58ab6f', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-81b9-08dcda58ab6f', '5274', 'Sickness benefits insurance', true, '60520000-5dd4-0015-8b2c-08dcda58ab6f', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-1b0b-08dcda58ab70', '5279', 'Withholding taxes', true, '60520000-5dd4-0015-25a2-08dcda58ab70', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-cc5b-08dcda58ab70', '5280', 'Personnel recruitment', true, '60520000-5dd4-0015-d72a-08dcda58ab70', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-5921-08dcda58ab71', '5281', 'Training and continuing education', true, '60520000-5dd4-0015-63ad-08dcda58ab71', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-e852-08dcda58ab71', '5282', 'Actual expense reimbursements', true, '60520000-5dd4-0015-f392-08dcda58ab71', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-7d83-08dcda58ab72', '5283', 'Flat-rate expense allowances', true, '60520000-5dd4-0015-898e-08dcda58ab72', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-2e91-08dcda58ab73', '5289', 'Other personnel expenses', true, '60520000-5dd4-0015-3c7d-08dcda58ab73', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-bd6a-08dcda58ab73', '5290', 'Temporary employees', true, '60520000-5dd4-0015-c8cf-08dcda58ab73', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-555c-08dcda58ab74', '6000', 'Rent', true, '60520000-5dd4-0015-6281-08dcda58ab74', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-ea28-08dcda58ab74', '6030', 'Accessory charges', true, '60520000-5dd4-0015-f797-08dcda58ab74', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-a2d7-08dcda58ab75', '6040', 'Cleaning', true, '60520000-5dd4-0015-afc8-08dcda58ab75', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-3667-08dcda58ab76', '6050', 'Maintenance', true, '60520000-5dd4-0015-4398-08dcda58ab76', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-c6a2-08dcda58ab76', '6090', 'Premises charges as private withdrawals', true, '60520000-5dd4-0015-d8af-08dcda58ab76', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-627b-08dcda58ab77', '6100', 'Maintenance, repair, or replacement of machinery', true, '60520000-5dd4-0015-7037-08dcda58ab77', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-1874-08dcda58ab78', '6102', 'Maintenance, repair, or replacement of tools and equipment', true, '60520000-5dd4-0015-27de-08dcda58ab78', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-b07e-08dcda58ab78', '6130', 'Maintenance, repair, or replacement of office furniture', true, '60520000-5dd4-0015-bdeb-08dcda58ab78', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-4078-08dcda58ab79', '6131', 'Maintenance, repair, or replacement of office machines', true, '60520000-5dd4-0015-4e76-08dcda58ab79', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-cdcd-08dcda58ab79', '6200', 'Repair, service, and cleaning', true, '60520000-5dd4-0015-dc1c-08dcda58ab79', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-7f75-08dcda58ab7a', '6210', 'Fuel', true, '60520000-5dd4-0015-8de1-08dcda58ab7a', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-1137-08dcda58ab7b', '6220', 'Insurance and taxes', true, '60520000-5dd4-0015-1f7c-08dcda58ab7b', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-a49f-08dcda58ab7b', '6260', 'Lease charges for vehicles', true, '60520000-5dd4-0015-96c3-08dcda58ab7c', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-260f-08dcda58ab7d', '6270', 'Vehicle charges as private withdrawals', true, '60520000-5dd4-0015-3458-08dcda58ab7d', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-d524-08dcda58ab7d', '6300', 'Property damage insurance', true, '60520000-5dd4-0015-e322-08dcda58ab7d', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-61c0-08dcda58ab7e', '6310', 'Liability insurance', true, '60520000-5dd4-0015-74df-08dcda58ab7e', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-ff88-08dcda58ab7e', '6330', 'Life insurance premiums', true, '60520000-5dd4-0015-0ee0-08dcda58ab7f', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-979f-08dcda58ab7f', '6331', 'Surety bond premiums', true, '60520000-5dd4-0015-a81e-08dcda58ab7f', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-4d51-08dcda58ab80', '6360', 'Duties', true, '60520000-5dd4-0015-5d61-08dcda58ab80', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-e36e-08dcda58ab80', '6361', 'Taxes', true, '60520000-5dd4-0015-f3c4-08dcda58ab80', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-7221-08dcda58ab81', '6370', 'Permits', true, '60520000-5dd4-0015-8272-08dcda58ab81', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-0165-08dcda58ab82', '6371', 'Licenses', true, '60520000-5dd4-0015-1251-08dcda58ab82', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-b139-08dcda58ab82', '6400', 'Power', true, '60520000-5dd4-0015-c4bf-08dcda58ab82', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-5258-08dcda58ab83', '6420', 'Fuel oil', true, '60520000-5dd4-0015-62a0-08dcda58ab83', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-dbbf-08dcda58ab83', '6430', 'Water', true, '60520000-5dd4-0015-ee2d-08dcda58ab83', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-6bc2-08dcda58ab84', '6460', 'Waste disposal', true, '60520000-5dd4-0015-7d8d-08dcda58ab84', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-2f77-08dcda58ab85', '6462', 'Wastewater', true, '60520000-5dd4-0015-4245-08dcda58ab85', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-c3ce-08dcda58ab85', '6500', 'Office supplies', true, '60520000-5dd4-0015-d563-08dcda58ab85', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-5394-08dcda58ab86', '6501', 'Printed materials', true, '60520000-5dd4-0015-6602-08dcda58ab86', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-dccc-08dcda58ab86', '6502', 'Photocopies', true, '60520000-5dd4-0015-f0fa-08dcda58ab86', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-a4c4-08dcda58ab87', '6503', 'Technical literature', true, '60520000-5dd4-0015-b723-08dcda58ab87', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-41ee-08dcda58ab88', '6510', 'Telephone', true, '60520000-5dd4-0015-55a7-08dcda58ab88', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-cdf4-08dcda58ab88', '6511', 'Fax', true, '60520000-5dd4-0015-e0ed-08dcda58ab88', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-5f4c-08dcda58ab89', '6512', 'Internet', true, '60520000-5dd4-0015-7205-08dcda58ab89', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-2459-08dcda58ab8a', '6513', 'Postage charges', true, '60520000-5dd4-0015-424e-08dcda58ab8a', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-c4e8-08dcda58ab8a', '6520', 'Contributions', true, '60520000-5dd4-0015-d8c2-08dcda58ab8a', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-58c1-08dcda58ab8b', '6521', 'Donations and gifts', true, '60520000-5dd4-0015-6ca3-08dcda58ab8b', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-ea58-08dcda58ab8b', '6522', 'Tips', true, '60520000-5dd4-0015-fe3d-08dcda58ab8b', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-aab8-08dcda58ab8c', '6530', 'Fiduciary fees', true, '60520000-5dd4-0015-bf8f-08dcda58ab8c', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-3ce8-08dcda58ab8d', '6531', 'Consulting fees', true, '60520000-5dd4-0015-5677-08dcda58ab8d', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-de62-08dcda58ab8d', '6532', 'Legal consulting fees', true, '60520000-5dd4-0015-f256-08dcda58ab8d', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-6d70-08dcda58ab8e', '6540', 'Board of directors fees', true, '60520000-5dd4-0015-8e09-08dcda58ab8e', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-3e66-08dcda58ab8f', '6541', 'General assembly fees', true, '60520000-5dd4-0015-5722-08dcda58ab8f', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-dd01-08dcda58ab8f', '6542', 'Auditing fees', true, '60520000-5dd4-0015-f232-08dcda58ab8f', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-6f55-08dcda58ab90', '6550', 'Administrative charges as private withdrawals', true, '60520000-5dd4-0015-87d2-08dcda58ab90', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-fdc8-08dcda58ab90', '6560', 'Lease of equipment', true, '60520000-5dd4-0015-128f-08dcda58ab91', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-b7ee-08dcda58ab91', '6561', 'Lease of software', true, '60520000-5dd4-0015-cdce-08dcda58ab91', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-4a73-08dcda58ab92', '6562', 'Lease of equipment', true, '60520000-5dd4-0015-60d8-08dcda58ab92', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-de50-08dcda58ab92', '6570', 'License/update charges', true, '60520000-5dd4-0015-f421-08dcda58ab92', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-26d9-08dcda58ab94', '6575', 'Network charges', true, '60520000-5dd4-0015-3e53-08dcda58ab94', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-b938-08dcda58ab94', '6600', 'Newspaper advertising', true, '60520000-5dd4-0015-d269-08dcda58ab94', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-52a3-08dcda58ab95', '6610', 'Advertising materials, advertising equipment', true, '60520000-5dd4-0015-6975-08dcda58ab95', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-f145-08dcda58ab95', '6611', 'Advertising items, samples', true, '60520000-5dd4-0015-0d48-08dcda58ab96', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-b380-08dcda58ab96', '6620', 'Window displays, decorations', true, '60520000-5dd4-0015-cb0a-08dcda58ab96', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-4c9e-08dcda58ab97', '6621', 'Fairs, exhibitions', true, '60520000-5dd4-0015-63fe-08dcda58ab97', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-dde2-08dcda58ab97', '6640', 'Travel expenses', true, '60520000-5dd4-0015-f9a5-08dcda58ab97', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-808f-08dcda58ab98', '6641', 'Customer advisory services', true, '60520000-5dd4-0015-9a60-08dcda58ab98', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-43cc-08dcda58ab99', '6642', 'Customer gifts', true, '60520000-5dd4-0015-5bbe-08dcda58ab99', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-d8d2-08dcda58ab99', '6700', 'Economic information', true, '60520000-5dd4-0015-f157-08dcda58ab99', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-7006-08dcda58ab9a', '6701', 'Legal proceedings', true, '60520000-5dd4-0015-89b7-08dcda58ab9a', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-0725-08dcda58ab9b', '6710', 'Security', true, '60520000-5dd4-0015-33ee-08dcda58ab9b', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-dcea-08dcda58ab9b', '6711', 'Surveillance', true, '60520000-5dd4-0015-f7b6-08dcda58ab9b', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-7a0f-08dcda58ab9c', '6800', 'Bank loan interest', true, '60520000-5dd4-0015-95e0-08dcda58ab9c', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-0ffa-08dcda58ab9d', '6801', 'Loan interest', true, '60520000-5dd4-0015-2a2f-08dcda58ab9d', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-b01e-08dcda58ab9d', '6802', 'Mortgage loan interest', true, '60520000-5dd4-0015-cb3c-08dcda58ab9d', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-8132-08dcda58ab9e', '6803', 'Default interest', true, '60520000-5dd4-0015-9bd2-08dcda58ab9e', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-1bb1-08dcda58ab9f', '6804', 'Financial charges for customer advances', true, '60520000-5dd4-0015-3854-08dcda58ab9f', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-beae-08dcda58ab9f', '6820', 'Financial charges for shareholder A''s current account', true, '60520000-5dd4-0015-d9e7-08dcda58ab9f', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-5b4f-08dcda58aba0', '6830', 'Financial charges for pension fund financing', true, '60520000-5dd4-0015-7ab1-08dcda58aba0', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-22c9-08dcda58aba1', '6840', 'Bank and postal charges', true, '60520000-5dd4-0015-3df0-08dcda58aba1', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-c552-08dcda58aba1', '6841', 'Deposit charges', true, '60520000-5dd4-0015-e0d6-08dcda58aba1', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-61dd-08dcda58aba2', '6842', 'Exchange losses on cash and securities', true, '60520000-5dd4-0015-8538-08dcda58aba2', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-44aa-08dcda58aba7', '6920', 'Depreciation on machinery and tools', true, '60520000-5dd4-0015-6181-08dcda58aba7', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-ea38-08dcda58aba7', '6921', 'Depreciation on furniture and installations', true, '60520000-5dd4-0015-07ee-08dcda58aba8', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-0c8d-08dcda58aba3', '6850', 'Financial income from postal and bank assets', true, '34980000-5dd4-0015-760f-08dcdaf3f47f', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-d9f9-08dcda58aba3', '6851', 'Financial income from short-term assets', true, '34980000-5dd4-0015-2f7f-08dcdaf3f740', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-7b17-08dcda58aba4', '6880', 'Financial income from shareholder X''s current account', true, '34980000-5dd4-0015-3102-08dcdaf3fc7a', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-2ddf-08dcda58aba5', '6890', 'Financial income from default interest, discounts', true, '34980000-5dd4-0015-2e2e-08dcdaf402da', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-d5a4-08dcda58aba5', '6891', 'Financial income from advances received', true, '34980000-5dd4-0015-6b59-08dcdaf40601', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-9a10-08dcda58aba6', '6892', 'Foreign exchange gains on cash and securities', true, '34980000-5dd4-0015-5e06-08dcdaf408c8', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-8cf0-08dcda58aba8', '6922', 'Depreciation on office, IT equipment', true, '60520000-5dd4-0015-ab8b-08dcda58aba8', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-63f6-08dcda58aba9', '6923', 'Depreciation on vehicles', true, '60520000-5dd4-0015-8281-08dcda58aba9', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-073b-08dcda58abaa', '6930', 'Depreciation on operating buildings', true, '60520000-5dd4-0015-2580-08dcda58abaa', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-ae47-08dcda58abaa', '6950', 'Depreciation on incorporation costs', true, '60520000-5dd4-0015-cca4-08dcda58abaa', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-5961-08dcda58abab', '4200', 'Purchases of goods', true, '60520000-5dd4-0015-7863-08dcda58abab', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-6d55-08dcda592ca8', '7910', 'Gains on sale of operating equipment', true, '60520000-5dd4-0015-7eb0-08dcda592ca8', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('c4170000-5dd4-0015-c93b-08dcda5963b6', '8002', 'Accounting revaluations', true, 'c4170000-5dd4-0015-1b5b-08dcda5963be', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('c4170000-5dd4-0015-f081-08dcda5963c3', '8004', 'Exceptional gains on disposal of fixed assets', true, 'c4170000-5dd4-0015-3937-08dcda5963c4', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('c4170000-5dd4-0015-e540-08dcda5963c4', '8005', 'Grants received', true, 'c4170000-5dd4-0015-e9d3-08dcda5963c4', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('c4170000-5dd4-0015-7b3c-08dcda5963c5', '8006', 'Income from compensation for damages', true, 'c4170000-5dd4-0015-80d4-08dcda5963c5', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('c4170000-5dd4-0015-3c95-08dcda5963c6', '8500', 'Rental income from premises', true, 'c4170000-5dd4-0015-43a9-08dcda5963c6', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('c4170000-5dd4-0015-ce36-08dcda5963c6', '8501', 'Rental income from apartments', true, 'c4170000-5dd4-0015-d659-08dcda5963c6', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('c4170000-5dd4-0015-5b6f-08dcda5963c7', '8502', 'Rental income from garages', true, 'c4170000-5dd4-0015-612f-08dcda5963c7', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('c4170000-5dd4-0015-e270-08dcda5963c7', '8503', 'Internal rental income', true, 'c4170000-5dd4-0015-eaa4-08dcda5963c7', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('c4170000-5dd4-0015-a031-08dcda5963c8', '8700', 'Fees for expert opinions, conferences', true, 'c4170000-5dd4-0015-a87a-08dcda5963c8', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('c4170000-5dd4-0015-2ef5-08dcda5963c9', '8701', 'Attendance fees', true, 'c4170000-5dd4-0015-3ad1-08dcda5963c9', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('c4170000-5dd4-0015-c838-08dcda5963c9', '7920', 'Gains on sale of buildings', true, 'c4170000-5dd4-0015-d027-08dcda5963c9', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('a05e0000-5dd4-0015-19fc-08dcda59fa1b', '8012', 'Exceptional depreciation', true, 'a05e0000-5dd4-0015-389b-08dcda59fa22', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('a05e0000-5dd4-0015-f4ef-08dcda59fa27', '8014', 'Exceptional losses on disposal of fixed assets', true, 'a05e0000-5dd4-0015-3a9c-08dcda59fa28', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('a05e0000-5dd4-0015-da5d-08dcda59fa28', '8015', 'Exceptional losses on receivables', true, 'a05e0000-5dd4-0015-deda-08dcda59fa28', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('a05e0000-5dd4-0015-5cb3-08dcda59fa29', '8016', 'Expenses for compensation for damages', true, 'a05e0000-5dd4-0015-6165-08dcda59fa29', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('a05e0000-5dd4-0015-febe-08dcda59fa29', '8510', 'Mortgage interest', true, 'a05e0000-5dd4-0015-0397-08dcda59fa2a', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('a05e0000-5dd4-0015-8315-08dcda59fa2a', '8511', 'Building maintenance', true, 'a05e0000-5dd4-0015-8940-08dcda59fa2a', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('a05e0000-5dd4-0015-0e41-08dcda59fa2b', '8512', 'Property rights, taxes, land taxes', true, 'a05e0000-5dd4-0015-13ce-08dcda59fa2b', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('a05e0000-5dd4-0015-923c-08dcda59fa2b', '8513', 'Insurance premiums', true, 'a05e0000-5dd4-0015-9902-08dcda59fa2b', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('a05e0000-5dd4-0015-3db9-08dcda59fa2c', '8514', 'Water, wastewater', true, 'a05e0000-5dd4-0015-448c-08dcda59fa2c', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('a05e0000-5dd4-0015-c462-08dcda59fa2c', '8515', 'Waste disposal', true, 'a05e0000-5dd4-0015-cbf4-08dcda59fa2c', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('a05e0000-5dd4-0015-4669-08dcda59fa2d', '8516', 'Administrative charges', true, 'a05e0000-5dd4-0015-4e9d-08dcda59fa2d', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('a05e0000-5dd4-0015-d67a-08dcda59fa2d', '8710', 'Expenses for non-operating activities', true, 'a05e0000-5dd4-0015-de33-08dcda59fa2d', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('a05e0000-5dd4-0015-87a2-08dcda59fa2e', '8900', 'Corporate income tax', true, 'a05e0000-5dd4-0015-8fcc-08dcda59fa2e', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('a05e0000-5dd4-0015-09cd-08dcda59fa2f', '8901', 'Capital tax', true, 'a05e0000-5dd4-0015-11fe-08dcda59fa2f', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('a05e0000-5dd4-0015-8e15-08dcda59fa2f', '8902', 'Back taxes', true, 'a05e0000-5dd4-0015-9681-08dcda59fa2f', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('a05e0000-5dd4-0015-1f87-08dcda59fa30', '8011', 'Exceptional provisions', true, 'a05e0000-5dd4-0015-2921-08dcda59fa30', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('b0650000-5dd4-0015-41aa-08dcda5af51e', '9100', 'Opening balance sheet', true, 'b0650000-5dd4-0015-785d-08dcda5af525', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('b0650000-5dd4-0015-188e-08dcda5af52b', '9101', 'Closing balance sheet', true, 'b0650000-5dd4-0015-5935-08dcda5af52b', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('b0650000-5dd4-0015-fc14-08dcda5af52b', '9200', 'Share of profit for partner X', true, 'b0650000-5dd4-0015-007d-08dcda5af52c', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('b0650000-5dd4-0015-8079-08dcda5af52c', '9201', 'Share of profit for partner Y', true, 'b0650000-5dd4-0015-84ff-08dcda5af52c', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('b0650000-5dd4-0015-2435-08dcda5af52d', '9900', 'Grouping entries for debtors', true, 'b0650000-5dd4-0015-28c0-08dcda5af52d', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('b0650000-5dd4-0015-a67e-08dcda5af52d', '9901', 'Grouping entries for creditors', true, 'b0650000-5dd4-0015-ac60-08dcda5af52d', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('b0650000-5dd4-0015-6c05-08dcda5af52e', '9910', 'Correction entry', true, 'b0650000-5dd4-0015-716d-08dcda5af52e', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('b0650000-5dd4-0015-233a-08dcda5af52f', '9000', 'Income statement', true, 'b0650000-5dd4-0015-2aac-08dcda5af52f', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('4c6f0000-5dd4-0015-cbc6-08dcda56e428', '3902', 'Refunds', true, 'b0650000-5dd4-0015-575d-08dcda67d032', '74a20000-088f-d0ad-7a4e-08dce86b0459'); diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Ubik.Accounting.SalesOrVatTax.Api.csproj b/src/Ubik.Accounting.SalesOrVatTax.Api/Ubik.Accounting.SalesOrVatTax.Api.csproj index 2c2f62ca..11fba37b 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Api/Ubik.Accounting.SalesOrVatTax.Api.csproj +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Ubik.Accounting.SalesOrVatTax.Api.csproj @@ -34,6 +34,9 @@ + + Always + Always From 557c1d20b1c49c5f05fe8964d9a4a3227fcdf0c0 Mon Sep 17 00:00:00 2001 From: ubik Date: Mon, 4 Nov 2024 13:45:52 +0100 Subject: [PATCH 34/94] Some progress on attaching tax rates to account with a target tax rates account if needed. (for additionnal accounting entries) --- .../Data/Init/AccountsData.cs | 17 ++++ .../Data/Init/DbInitializer.cs | 1 + .../v1/AccountLinkedTaxRatesController.cs | 60 +++++++++++++ .../Errors/LinkedTaxRateAlreadyExist.cs | 22 +++++ .../Errors/LinkedTaxRateNotFoundError.cs | 23 +++++ .../AccountLinkedTaxRatesCommandService.cs | 87 +++++++++++++++++++ .../AccountLinkedTaxRatesQueryService.cs | 52 +++++++++++ .../IAccountLinkedTaxRatesCommandService.cs | 13 +++ .../IAccountLinkedTaxRatesQueryService.cs | 12 +++ .../Controllers/v1/TaxRatesController.cs | 2 +- .../Mappers/AccountTaxRateConfigMappers.cs | 57 ++++++++++++ .../Models/AccountTaxRateConfig.cs | 10 ++- .../Program.cs | 3 + .../Commands/AddTaxRateToAccountCommand.cs | 15 ++++ .../Commands/RemoveTaxRateToAccountCommand.cs | 14 +++ .../Events/AccountTaxRateConfigAdded.cs | 17 ++++ .../AccountTaxRateConfigStandardResult.cs | 17 ++++ .../Controller/v1/AccountGroupsController.cs | 2 +- .../Controller/v1/AccountsController.cs | 2 +- .../v1/ClassificationsController.cs | 2 +- ... => ResourceIdNotMatchWithCommandError.cs} | 6 +- .../v1/AuthorizationsAdminController.cs | 2 +- .../Controllers/v1/RolesAdminController.cs | 2 +- .../Controllers/v1/TenantsAdminController.cs | 2 +- src/Ubik.YarpProxy/Program.cs | 6 +- src/Ubik.YarpProxy/appsettings.json | 22 ++++- ...aseIntegrationTestAccountingSalesVatTax.cs | 2 +- .../BaseIntegrationTestAccountingStruct.cs | 2 +- .../TaxRates/TaxRatesController_Test.cs | 3 +- .../AccountGroupsController_Test.cs | 2 +- .../Accounts/AccountsController_Test.cs | 2 +- .../ClassificationsController_Test.cs | 2 +- .../AuthorizationsAdminController_Test.cs | 2 +- .../Roles/RolesAdminController_Test.cs | 2 +- .../Tenants/TenantAdminController_Test.cs | 2 +- 35 files changed, 460 insertions(+), 27 deletions(-) create mode 100644 src/Ubik.Accounting.SalesOrVatTax.Api/Data/Init/AccountsData.cs create mode 100644 src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountLinkedTaxRates/Controllers/v1/AccountLinkedTaxRatesController.cs create mode 100644 src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountLinkedTaxRates/Errors/LinkedTaxRateAlreadyExist.cs create mode 100644 src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountLinkedTaxRates/Errors/LinkedTaxRateNotFoundError.cs create mode 100644 src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountLinkedTaxRates/Services/AccountLinkedTaxRatesCommandService.cs create mode 100644 src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountLinkedTaxRates/Services/AccountLinkedTaxRatesQueryService.cs create mode 100644 src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountLinkedTaxRates/Services/IAccountLinkedTaxRatesCommandService.cs create mode 100644 src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountLinkedTaxRates/Services/IAccountLinkedTaxRatesQueryService.cs create mode 100644 src/Ubik.Accounting.SalesOrVatTax.Api/Mappers/AccountTaxRateConfigMappers.cs create mode 100644 src/Ubik.Accounting.SalesOrVatTax.Contracts/AccountLinkedTaxRates/Commands/AddTaxRateToAccountCommand.cs create mode 100644 src/Ubik.Accounting.SalesOrVatTax.Contracts/AccountLinkedTaxRates/Commands/RemoveTaxRateToAccountCommand.cs create mode 100644 src/Ubik.Accounting.SalesOrVatTax.Contracts/AccountLinkedTaxRates/Events/AccountTaxRateConfigAdded.cs create mode 100644 src/Ubik.Accounting.SalesOrVatTax.Contracts/AccountLinkedTaxRates/Results/AccountTaxRateConfigStandardResult.cs rename src/Ubik.ApiService.Common/Errors/{ResourceIdNotMatchForUpdateError.cs => ResourceIdNotMatchWithCommandError.cs} (67%) diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Data/Init/AccountsData.cs b/src/Ubik.Accounting.SalesOrVatTax.Api/Data/Init/AccountsData.cs new file mode 100644 index 00000000..1cd1358b --- /dev/null +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Data/Init/AccountsData.cs @@ -0,0 +1,17 @@ +using Microsoft.EntityFrameworkCore; +using System.Runtime.CompilerServices; + +namespace Ubik.Accounting.SalesOrVatTax.Api.Data.Init +{ + internal static class AccountsData + { + internal static async Task LoadAsync(AccountingSalesTaxDbContext context) + { + if (!context.Accounts.Any()) + { + var query = await File.ReadAllTextAsync(@"Data/Init/AccountsData.sql"); + await context.Database.ExecuteSqlAsync(FormattableStringFactory.Create(query)); + } + } + } +} diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Data/Init/DbInitializer.cs b/src/Ubik.Accounting.SalesOrVatTax.Api/Data/Init/DbInitializer.cs index 655cd35c..837d3f95 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Api/Data/Init/DbInitializer.cs +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Data/Init/DbInitializer.cs @@ -5,6 +5,7 @@ static internal class DbInitializer static internal async Task InitializeAsync(AccountingSalesTaxDbContext context) { await TaxRatesData.LoadAsync(context); + await AccountsData.LoadAsync(context); } } } diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountLinkedTaxRates/Controllers/v1/AccountLinkedTaxRatesController.cs b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountLinkedTaxRates/Controllers/v1/AccountLinkedTaxRatesController.cs new file mode 100644 index 00000000..094f27a9 --- /dev/null +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountLinkedTaxRates/Controllers/v1/AccountLinkedTaxRatesController.cs @@ -0,0 +1,60 @@ +using Asp.Versioning; +using Microsoft.AspNetCore.Mvc; +using Ubik.Accounting.SalesOrVatTax.Api.Features.AccountLinkedTaxRates.Services; +using Ubik.Accounting.SalesOrVatTax.Api.Mappers; +using Ubik.Accounting.SalesOrVatTax.Contracts.AccountLinkedTaxRates.Commands; +using Ubik.Accounting.SalesOrVatTax.Contracts.AccountLinkedTaxRates.Events; +using Ubik.Accounting.SalesOrVatTax.Contracts.AccountLinkedTaxRates.Results; +using Ubik.Accounting.SalesOrVatTax.Contracts.SalesOrVatTaxRate.Results; +using Ubik.ApiService.Common.Errors; +using Ubik.ApiService.Common.Exceptions; +using static Microsoft.EntityFrameworkCore.DbLoggerCategory.Database; + +namespace Ubik.Accounting.SalesOrVatTax.Api.Features.AccountLinkedTaxRates.Controllers.v1 +{ + + [ApiController] + [ApiVersion("1.0")] + [Route("api/v{version:apiVersion}/accounts")] + public class AccountLinkedTaxRatesController(IAccountLinkedTaxRatesQueryService queryService, + IAccountLinkedTaxRatesCommandService commandService) : ControllerBase + { + [HttpGet("{id}/taxrates")] + [ProducesResponseType(200)] + [ProducesResponseType(typeof(CustomProblemDetails), 400)] + [ProducesResponseType(typeof(CustomProblemDetails), 404)] + [ProducesResponseType(typeof(CustomProblemDetails), 500)] + public async Task>> GetAll(Guid id) + { + var results = await queryService.GetAllAsync(id); + + return results.Match( + Right: ok => Ok(ok.ToAccountTaxRateConfigStandardResults()), + Left: err => new ObjectResult(err.ToValidationProblemDetails(HttpContext))); + } + + [HttpPost("{id}/taxrates/{taxRateId}")] + [ProducesResponseType(200)] + [ProducesResponseType(typeof(CustomProblemDetails), 400)] + [ProducesResponseType(typeof(CustomProblemDetails), 404)] + [ProducesResponseType(typeof(CustomProblemDetails), 409)] + [ProducesResponseType(typeof(CustomProblemDetails), 500)] + public async Task> AddTaxRateToAccount + (Guid id, Guid taxRateId, AddTaxRateToAccountCommand command) + { + if (command.AccountId != id) + return new ObjectResult(new ResourceIdNotMatchWithCommandError("Account", id, command.AccountId) + .ToValidationProblemDetails(HttpContext)); + + if (command.TaxRateId != taxRateId) + return new ObjectResult(new ResourceIdNotMatchWithCommandError("TaxRate", id, command.TaxRateId) + .ToValidationProblemDetails(HttpContext)); + + var result = await commandService.AttachAsync(command); + + return result.Match( + Right: r => Ok(r.ToAccountTaxRateConfigStandardResult()), + Left: err => new ObjectResult(err.ToValidationProblemDetails(HttpContext))); + } + } +} diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountLinkedTaxRates/Errors/LinkedTaxRateAlreadyExist.cs b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountLinkedTaxRates/Errors/LinkedTaxRateAlreadyExist.cs new file mode 100644 index 00000000..331fb788 --- /dev/null +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountLinkedTaxRates/Errors/LinkedTaxRateAlreadyExist.cs @@ -0,0 +1,22 @@ +using Ubik.ApiService.Common.Errors; + +namespace Ubik.Accounting.SalesOrVatTax.Api.Features.AccountLinkedTaxRates.Errors +{ + public record LinkedTaxRateAlreadyExist : IServiceAndFeatureError + { + public ServiceAndFeatureErrorType ErrorType { get; init; } + public List CustomErrors { get; init; } + + public LinkedTaxRateAlreadyExist(Guid accountId, Guid taxRateId) + { + + ErrorType = ServiceAndFeatureErrorType.BadParams; + CustomErrors = new List() { new CustomError() + { + ErrorCode = "LINKED_TAX_RATE_ALREADY_EXIST", + ErrorFriendlyMessage = "The tax rate for this account is already attached", + ErrorValueDetails = $"Field:AccountId / Value:{accountId} - Field:TaxRateId / Value:{taxRateId}" + }}; + } + } +} diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountLinkedTaxRates/Errors/LinkedTaxRateNotFoundError.cs b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountLinkedTaxRates/Errors/LinkedTaxRateNotFoundError.cs new file mode 100644 index 00000000..8a22c073 --- /dev/null +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountLinkedTaxRates/Errors/LinkedTaxRateNotFoundError.cs @@ -0,0 +1,23 @@ +using Ubik.ApiService.Common.Errors; + +namespace Ubik.Accounting.SalesOrVatTax.Api.Features.AccountLinkedTaxRates.Errors +{ + public record LinkedTaxRateNotFoundError : IServiceAndFeatureError + { + public ServiceAndFeatureErrorType ErrorType { get; init; } + public List CustomErrors { get; init; } + + public LinkedTaxRateNotFoundError(Guid accountId, Guid taxRateId) + { + + ErrorType = ServiceAndFeatureErrorType.NotFound; + CustomErrors = new List() { new CustomError() + { + ErrorCode = "LINKED_TAX_RATE_NOT_FOUND", + ErrorFriendlyMessage = "The tax rate for this account is not found", + ErrorValueDetails = $"Field:AccountId / Value:{accountId} - Field:TaxRateId / Value:{taxRateId}" + }}; + } + + } +} diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountLinkedTaxRates/Services/AccountLinkedTaxRatesCommandService.cs b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountLinkedTaxRates/Services/AccountLinkedTaxRatesCommandService.cs new file mode 100644 index 00000000..0e0ebc40 --- /dev/null +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountLinkedTaxRates/Services/AccountLinkedTaxRatesCommandService.cs @@ -0,0 +1,87 @@ +using LanguageExt; +using MassTransit; +using MassTransit.Transports; +using Microsoft.EntityFrameworkCore; +using Ubik.Accounting.SalesOrVatTax.Api.Data; +using Ubik.Accounting.SalesOrVatTax.Api.Features.AccountLinkedTaxRates.Errors; +using Ubik.Accounting.SalesOrVatTax.Api.Mappers; +using Ubik.Accounting.SalesOrVatTax.Api.Models; +using Ubik.Accounting.SalesOrVatTax.Contracts.AccountLinkedTaxRates.Commands; +using Ubik.ApiService.Common.Errors; + +namespace Ubik.Accounting.SalesOrVatTax.Api.Features.AccountLinkedTaxRates.Services +{ + public class AccountLinkedTaxRatesCommandService(AccountingSalesTaxDbContext ctx, IPublishEndpoint publishEndpoint) : IAccountLinkedTaxRatesCommandService + { + public async Task> AttachAsync(AddTaxRateToAccountCommand command) + { + return await GetAsync(command.TaxRateId) + .BindAsync(t => GetAccountAsync(command.AccountId)) + .BindAsync(t => GetTaxAccountAsync(command.TaxAccountId)) + .BindAsync(t => ValidateIfLinkNotAlreadyExistsAsync(command.AccountId, command.TaxRateId) + .BindAsync(l => AddTaxRateLinkInDbContextAsync(l, command)) + .BindAsync(AddTaxRateLinkSaveAndPublishAsync)); + } + + //public async Task> DetachAsync(AddTaxRateToAccountCommand command) + //{ + + //} + + private async Task> AddTaxRateLinkSaveAndPublishAsync(AccountTaxRateConfig current) + { + await publishEndpoint.Publish(current.ToAccountTaxRateConfigAdded(), CancellationToken.None); + await ctx.SaveChangesAsync(); + + return current; + } + + private async Task> AddTaxRateLinkInDbContextAsync(AccountTaxRateConfig current + , AddTaxRateToAccountCommand command) + { + current.TaxAccountId = command.TaxAccountId; + + await ctx.AccountTaxRateConfigs.AddAsync(current); + ctx.SetAuditAndSpecialFields(); + + return current; + } + + private async Task> ValidateIfLinkNotAlreadyExistsAsync(Guid accountId, Guid taxRateId) + { + var result = await ctx.AccountTaxRateConfigs.AnyAsync(x => x.AccountId == accountId + && x.TaxRateId == taxRateId ); + + return result + ? new LinkedTaxRateAlreadyExist(accountId,taxRateId) + : new AccountTaxRateConfig() { AccountId= accountId, TaxRateId=taxRateId}; + } + + private async Task> GetAccountAsync(Guid accountId) + { + var result = await ctx.Accounts.FindAsync(accountId); + + return result == null + ? new ResourceNotFoundError("Account", "Id", accountId.ToString()) + : result; + } + + private async Task> GetTaxAccountAsync(Guid taxAccountId) + { + var result = await ctx.Accounts.FindAsync(taxAccountId); + + return result == null + ? new BadParamExternalResourceNotFound("AccountTaxConfig","TaxAccount", "TaxAccountId", taxAccountId.ToString()) + : result; + } + + private async Task> GetAsync(Guid taxRateId) + { + var result = await ctx.TaxRates.FindAsync(taxRateId); + + return result == null + ? new ResourceNotFoundError("TaxRate", "Id", taxRateId.ToString()) + : result; + } + } +} diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountLinkedTaxRates/Services/AccountLinkedTaxRatesQueryService.cs b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountLinkedTaxRates/Services/AccountLinkedTaxRatesQueryService.cs new file mode 100644 index 00000000..e07f9ebc --- /dev/null +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountLinkedTaxRates/Services/AccountLinkedTaxRatesQueryService.cs @@ -0,0 +1,52 @@ +using Dapper; +using LanguageExt; +using Microsoft.EntityFrameworkCore; +using Ubik.Accounting.SalesOrVatTax.Api.Data; +using Ubik.Accounting.SalesOrVatTax.Api.Features.AccountLinkedTaxRates.Errors; +using Ubik.Accounting.SalesOrVatTax.Api.Models; +using Ubik.ApiService.Common.Errors; +using Ubik.ApiService.Common.Services; + +namespace Ubik.Accounting.SalesOrVatTax.Api.Features.AccountLinkedTaxRates.Services +{ + public class AccountLinkedTaxRatesQueryService(AccountingSalesTaxDbContext ctx) + : IAccountLinkedTaxRatesQueryService + { + public async Task>> GetAllAsync(Guid accountId) + { + return await GetAccountAsync(accountId) + .MapAsync(a => GetAccountTaxConfigs(a.Id)); + } + + public async Task> GetAsync(Guid accountId, Guid taxRateId) + { + return await GetAccountAsync(accountId) + .BindAsync(a => GetAccountTaxConfig(a.Id, taxRateId)); + } + + private async Task> GetAccountTaxConfigs(Guid accountId) + { + return await ctx.AccountTaxRateConfigs.Where(c => c.AccountId == accountId).ToListAsync(); + } + + private async Task> GetAccountTaxConfig(Guid accountId, Guid taxRateId) + { + var result = await ctx.AccountTaxRateConfigs.Where(c => c.AccountId == accountId && c.TaxRateId == taxRateId).FirstOrDefaultAsync(); + + return result == null + ? new LinkedTaxRateNotFoundError(accountId, taxRateId) + : result; + } + + private async Task> GetAccountAsync(Guid accountId) + { + var result = await ctx.Accounts.FindAsync(accountId); + + return result == null + ? new ResourceNotFoundError("Account", "Id", accountId.ToString()) + : result; + } + } + + +} diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountLinkedTaxRates/Services/IAccountLinkedTaxRatesCommandService.cs b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountLinkedTaxRates/Services/IAccountLinkedTaxRatesCommandService.cs new file mode 100644 index 00000000..9158a71d --- /dev/null +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountLinkedTaxRates/Services/IAccountLinkedTaxRatesCommandService.cs @@ -0,0 +1,13 @@ +using LanguageExt; +using Ubik.Accounting.SalesOrVatTax.Api.Models; +using Ubik.Accounting.SalesOrVatTax.Contracts.AccountLinkedTaxRates.Commands; +using Ubik.ApiService.Common.Errors; + +namespace Ubik.Accounting.SalesOrVatTax.Api.Features.AccountLinkedTaxRates.Services +{ + public interface IAccountLinkedTaxRatesCommandService + { + Task> AttachAsync(AddTaxRateToAccountCommand command); + //Task> DetachAsync(AddTaxRateToAccountCommand command); + } +} diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountLinkedTaxRates/Services/IAccountLinkedTaxRatesQueryService.cs b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountLinkedTaxRates/Services/IAccountLinkedTaxRatesQueryService.cs new file mode 100644 index 00000000..8f530998 --- /dev/null +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountLinkedTaxRates/Services/IAccountLinkedTaxRatesQueryService.cs @@ -0,0 +1,12 @@ +using LanguageExt; +using Ubik.Accounting.SalesOrVatTax.Api.Models; +using Ubik.ApiService.Common.Errors; + +namespace Ubik.Accounting.SalesOrVatTax.Api.Features.AccountLinkedTaxRates.Services +{ + public interface IAccountLinkedTaxRatesQueryService + { + Task>> GetAllAsync(Guid accountId); + Task> GetAsync(Guid accountId, Guid taxRateId); + } +} diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Features/TaxRates/Controllers/v1/TaxRatesController.cs b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/TaxRates/Controllers/v1/TaxRatesController.cs index cbba1804..be841b90 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Api/Features/TaxRates/Controllers/v1/TaxRatesController.cs +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/TaxRates/Controllers/v1/TaxRatesController.cs @@ -60,7 +60,7 @@ public async Task> AddAsync(AddSal public async Task> Update(Guid id, UpdateSalesOrVatTaxRateCommand command) { if (command.Id != id) - return new ObjectResult(new ResourceIdNotMatchForUpdateError("TaxRate", id, command.Id) + return new ObjectResult(new ResourceIdNotMatchWithCommandError("TaxRate", id, command.Id) .ToValidationProblemDetails(HttpContext)); var result = await commandService.UpdateAsync(command); diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Mappers/AccountTaxRateConfigMappers.cs b/src/Ubik.Accounting.SalesOrVatTax.Api/Mappers/AccountTaxRateConfigMappers.cs new file mode 100644 index 00000000..dccd1606 --- /dev/null +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Mappers/AccountTaxRateConfigMappers.cs @@ -0,0 +1,57 @@ +using Ubik.Accounting.SalesOrVatTax.Api.Models; +using Ubik.Accounting.SalesOrVatTax.Contracts.AccountLinkedTaxRates.Commands; +using Ubik.Accounting.SalesOrVatTax.Contracts.AccountLinkedTaxRates.Events; +using Ubik.Accounting.SalesOrVatTax.Contracts.AccountLinkedTaxRates.Results; +using Ubik.Accounting.SalesOrVatTax.Contracts.SalesOrVatTaxRate.Commands; + +namespace Ubik.Accounting.SalesOrVatTax.Api.Mappers +{ + public static class AccountTaxRateConfigMappers + { + public static IEnumerable ToAccountTaxRateConfigStandardResults(this IEnumerable current) + { + return current.Select(x => new AccountTaxRateConfigStandardResult() + { + Id = x.Id, + AccountId = x.AccountId, + TaxRateId = x.TaxRateId, + TaxAccountId = x.TaxAccountId, + Version = x.Version, + }); + } + + public static AccountTaxRateConfig ToAccountTaxRateConfig(this AddTaxRateToAccountCommand current) + { + return new AccountTaxRateConfig + { + AccountId = current.AccountId, + TaxRateId = current.TaxRateId, + TaxAccountId = current.TaxAccountId, + }; + } + + public static AccountTaxRateConfigAdded ToAccountTaxRateConfigAdded(this AccountTaxRateConfig current) + { + return new AccountTaxRateConfigAdded + { + Id = current.Id, + AccountId = current.AccountId, + TaxRateId = current.TaxRateId, + TaxAccountId = current.TaxAccountId, + Version = current.Version, + }; + } + + public static AccountTaxRateConfigStandardResult ToAccountTaxRateConfigStandardResult(this AccountTaxRateConfig current) + { + return new AccountTaxRateConfigStandardResult + { + Id = current.Id, + AccountId = current.AccountId, + TaxRateId = current.TaxRateId, + TaxAccountId = current.TaxAccountId, + Version = current.Version, + }; + } + } +} diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Models/AccountTaxRateConfig.cs b/src/Ubik.Accounting.SalesOrVatTax.Api/Models/AccountTaxRateConfig.cs index 5db0b129..2dd9aa56 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Api/Models/AccountTaxRateConfig.cs +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Models/AccountTaxRateConfig.cs @@ -1,6 +1,8 @@ -namespace Ubik.Accounting.SalesOrVatTax.Api.Models +using Ubik.DB.Common; + +namespace Ubik.Accounting.SalesOrVatTax.Api.Models { - public class AccountTaxRateConfig + public class AccountTaxRateConfig : ITenantEntity, IConcurrencyCheckEntity, IAuditEntity { public Guid Id { get; set; } public Guid AccountId { get; set; } @@ -11,8 +13,8 @@ public class AccountTaxRateConfig public Account? TaxAccount { get; set; } public Guid Version { get; set; } public Guid TenantId { get; set; } - public required DateTime CreatedAt { get; set; } - public required Guid CreatedBy { get; set; } + public DateTime CreatedAt { get; set; } + public Guid CreatedBy { get; set; } public DateTime? ModifiedAt { get; set; } public Guid? ModifiedBy { get; set; } } diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Program.cs b/src/Ubik.Accounting.SalesOrVatTax.Api/Program.cs index a8111c99..7ef52910 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Api/Program.cs +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Program.cs @@ -7,6 +7,7 @@ using System.Text.Json.Serialization; using Ubik.Accounting.SalesOrVatTax.Api.Data; using Ubik.Accounting.SalesOrVatTax.Api.Data.Init; +using Ubik.Accounting.SalesOrVatTax.Api.Features.AccountLinkedTaxRates.Services; using Ubik.Accounting.SalesOrVatTax.Api.Features.Application.Services; using Ubik.Accounting.SalesOrVatTax.Api.Features.TaxRates.Services; using Ubik.ApiService.Common.Configure; @@ -97,6 +98,8 @@ builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); +builder.Services.AddScoped(); +builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddTransient(); diff --git a/src/Ubik.Accounting.SalesOrVatTax.Contracts/AccountLinkedTaxRates/Commands/AddTaxRateToAccountCommand.cs b/src/Ubik.Accounting.SalesOrVatTax.Contracts/AccountLinkedTaxRates/Commands/AddTaxRateToAccountCommand.cs new file mode 100644 index 00000000..c531bc5d --- /dev/null +++ b/src/Ubik.Accounting.SalesOrVatTax.Contracts/AccountLinkedTaxRates/Commands/AddTaxRateToAccountCommand.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Ubik.Accounting.SalesOrVatTax.Contracts.AccountLinkedTaxRates.Commands +{ + public record AddTaxRateToAccountCommand + { + public Guid AccountId { get; init; } + public Guid TaxRateId { get; init; } + public Guid TaxAccountId { get; init; } + } +} diff --git a/src/Ubik.Accounting.SalesOrVatTax.Contracts/AccountLinkedTaxRates/Commands/RemoveTaxRateToAccountCommand.cs b/src/Ubik.Accounting.SalesOrVatTax.Contracts/AccountLinkedTaxRates/Commands/RemoveTaxRateToAccountCommand.cs new file mode 100644 index 00000000..991e605f --- /dev/null +++ b/src/Ubik.Accounting.SalesOrVatTax.Contracts/AccountLinkedTaxRates/Commands/RemoveTaxRateToAccountCommand.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Ubik.Accounting.SalesOrVatTax.Contracts.AccountLinkedTaxRates.Commands +{ + public record RemoveTaxRateToAccountCommand + { + public Guid AccountId { get; init; } + public Guid TaxRateId { get; init; } + } +} diff --git a/src/Ubik.Accounting.SalesOrVatTax.Contracts/AccountLinkedTaxRates/Events/AccountTaxRateConfigAdded.cs b/src/Ubik.Accounting.SalesOrVatTax.Contracts/AccountLinkedTaxRates/Events/AccountTaxRateConfigAdded.cs new file mode 100644 index 00000000..29a1a628 --- /dev/null +++ b/src/Ubik.Accounting.SalesOrVatTax.Contracts/AccountLinkedTaxRates/Events/AccountTaxRateConfigAdded.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Ubik.Accounting.SalesOrVatTax.Contracts.AccountLinkedTaxRates.Events +{ + public record AccountTaxRateConfigAdded + { + public Guid Id { get; init; } + public Guid AccountId { get; init; } + public Guid TaxRateId { get; init; } + public Guid TaxAccountId { get; init; } + public Guid Version { get; init; } + } +} diff --git a/src/Ubik.Accounting.SalesOrVatTax.Contracts/AccountLinkedTaxRates/Results/AccountTaxRateConfigStandardResult.cs b/src/Ubik.Accounting.SalesOrVatTax.Contracts/AccountLinkedTaxRates/Results/AccountTaxRateConfigStandardResult.cs new file mode 100644 index 00000000..19267238 --- /dev/null +++ b/src/Ubik.Accounting.SalesOrVatTax.Contracts/AccountLinkedTaxRates/Results/AccountTaxRateConfigStandardResult.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Ubik.Accounting.SalesOrVatTax.Contracts.AccountLinkedTaxRates.Results +{ + public record AccountTaxRateConfigStandardResult + { + public Guid Id { get; init; } + public Guid AccountId { get; init; } + public Guid TaxRateId { get; init; } + public Guid TaxAccountId { get; init; } + public Guid Version { get; init; } + } +} diff --git a/src/Ubik.Accounting.Structure.Api/Features/AccountGroups/Controller/v1/AccountGroupsController.cs b/src/Ubik.Accounting.Structure.Api/Features/AccountGroups/Controller/v1/AccountGroupsController.cs index ae989177..c0fc57eb 100644 --- a/src/Ubik.Accounting.Structure.Api/Features/AccountGroups/Controller/v1/AccountGroupsController.cs +++ b/src/Ubik.Accounting.Structure.Api/Features/AccountGroups/Controller/v1/AccountGroupsController.cs @@ -79,7 +79,7 @@ public async Task> Update(Guid id, UpdateAccountGroupCommand command) { if (command.Id != id) - return new ObjectResult(new ResourceIdNotMatchForUpdateError("AccountGroup", id, command.Id) + return new ObjectResult(new ResourceIdNotMatchWithCommandError("AccountGroup", id, command.Id) .ToValidationProblemDetails(HttpContext)); var result = await commandService.UpdateAsync(command); diff --git a/src/Ubik.Accounting.Structure.Api/Features/Accounts/Controller/v1/AccountsController.cs b/src/Ubik.Accounting.Structure.Api/Features/Accounts/Controller/v1/AccountsController.cs index ffe6fc95..3d18855d 100644 --- a/src/Ubik.Accounting.Structure.Api/Features/Accounts/Controller/v1/AccountsController.cs +++ b/src/Ubik.Accounting.Structure.Api/Features/Accounts/Controller/v1/AccountsController.cs @@ -89,7 +89,7 @@ public async Task> Add(AddAccountCommand com public async Task> Update(Guid id, UpdateAccountCommand command) { if (command.Id != id) - return new ObjectResult(new ResourceIdNotMatchForUpdateError("Account",id, command.Id) + return new ObjectResult(new ResourceIdNotMatchWithCommandError("Account",id, command.Id) .ToValidationProblemDetails(HttpContext)); var result = await commandService.UpdateAsync(command); diff --git a/src/Ubik.Accounting.Structure.Api/Features/Classifications/Controller/v1/ClassificationsController.cs b/src/Ubik.Accounting.Structure.Api/Features/Classifications/Controller/v1/ClassificationsController.cs index 653a6d18..c5d8a642 100644 --- a/src/Ubik.Accounting.Structure.Api/Features/Classifications/Controller/v1/ClassificationsController.cs +++ b/src/Ubik.Accounting.Structure.Api/Features/Classifications/Controller/v1/ClassificationsController.cs @@ -119,7 +119,7 @@ public async Task> Add(AddClassificat public async Task> Update(Guid id, UpdateClassificationCommand command) { if (command.Id != id) - return new ObjectResult(new ResourceIdNotMatchForUpdateError("Classification",id, command.Id) + return new ObjectResult(new ResourceIdNotMatchWithCommandError("Classification",id, command.Id) .ToValidationProblemDetails(HttpContext)); var result = await commandService.UpdateAsync(command); diff --git a/src/Ubik.ApiService.Common/Errors/ResourceIdNotMatchForUpdateError.cs b/src/Ubik.ApiService.Common/Errors/ResourceIdNotMatchWithCommandError.cs similarity index 67% rename from src/Ubik.ApiService.Common/Errors/ResourceIdNotMatchForUpdateError.cs rename to src/Ubik.ApiService.Common/Errors/ResourceIdNotMatchWithCommandError.cs index 4ef78357..fd054b01 100644 --- a/src/Ubik.ApiService.Common/Errors/ResourceIdNotMatchForUpdateError.cs +++ b/src/Ubik.ApiService.Common/Errors/ResourceIdNotMatchWithCommandError.cs @@ -1,17 +1,17 @@ namespace Ubik.ApiService.Common.Errors { - public record ResourceIdNotMatchForUpdateError : IServiceAndFeatureError + public record ResourceIdNotMatchWithCommandError : IServiceAndFeatureError { public ServiceAndFeatureErrorType ErrorType { get; init; } public List CustomErrors { get; init; } - public ResourceIdNotMatchForUpdateError(string resourceName, Guid idFromQuery, Guid idFromCommand) + public ResourceIdNotMatchWithCommandError(string resourceName, Guid idFromQuery, Guid idFromCommand) { ErrorType = ServiceAndFeatureErrorType.BadParams; CustomErrors = [ new() { - ErrorCode = $"{resourceName.ToUpper()}_UPDATE_IDS_NOT_MATCH", + ErrorCode = $"{resourceName.ToUpper()}_COMMAND_IDS_NOT_MATCH", ErrorFriendlyMessage = "The provided id in the query string and in the command don't match.", ErrorValueDetails = $"Field:IdQuery|IdCommand / Value:{idFromQuery}|{idFromCommand}" }]; diff --git a/src/Ubik.Security.Api/Features/Authorizations/Controllers/v1/AuthorizationsAdminController.cs b/src/Ubik.Security.Api/Features/Authorizations/Controllers/v1/AuthorizationsAdminController.cs index a3dbddbb..992436d4 100644 --- a/src/Ubik.Security.Api/Features/Authorizations/Controllers/v1/AuthorizationsAdminController.cs +++ b/src/Ubik.Security.Api/Features/Authorizations/Controllers/v1/AuthorizationsAdminController.cs @@ -60,7 +60,7 @@ public async Task> AddAsync(AddAuthori public async Task> Update(Guid id, UpdateAuthorizationCommand command) { if (command.Id != id) - return new ObjectResult(new ResourceIdNotMatchForUpdateError("Authorization", id, command.Id) + return new ObjectResult(new ResourceIdNotMatchWithCommandError("Authorization", id, command.Id) .ToValidationProblemDetails(HttpContext)); var result = await commandService.UpdateAsync(command); diff --git a/src/Ubik.Security.Api/Features/Roles/Controllers/v1/RolesAdminController.cs b/src/Ubik.Security.Api/Features/Roles/Controllers/v1/RolesAdminController.cs index 4a60135c..6373bd67 100644 --- a/src/Ubik.Security.Api/Features/Roles/Controllers/v1/RolesAdminController.cs +++ b/src/Ubik.Security.Api/Features/Roles/Controllers/v1/RolesAdminController.cs @@ -60,7 +60,7 @@ public async Task> AddAsync(AddRoleCommand comm public async Task> Update(Guid id, UpdateRoleCommand command) { if (command.Id != id) - return new ObjectResult(new ResourceIdNotMatchForUpdateError("Role", id, command.Id) + return new ObjectResult(new ResourceIdNotMatchWithCommandError("Role", id, command.Id) .ToValidationProblemDetails(HttpContext)); var result = await commandService.UpdateAsync(command); diff --git a/src/Ubik.Security.Api/Features/Tenants/Controllers/v1/TenantsAdminController.cs b/src/Ubik.Security.Api/Features/Tenants/Controllers/v1/TenantsAdminController.cs index 9601de0c..d011f16f 100644 --- a/src/Ubik.Security.Api/Features/Tenants/Controllers/v1/TenantsAdminController.cs +++ b/src/Ubik.Security.Api/Features/Tenants/Controllers/v1/TenantsAdminController.cs @@ -60,7 +60,7 @@ public async Task> AddAsync(AddTenantCommand public async Task> Update(Guid id, UpdateTenantCommand command) { if (command.Id != id) - return new ObjectResult(new ResourceIdNotMatchForUpdateError("Tenant", id, command.Id) + return new ObjectResult(new ResourceIdNotMatchWithCommandError("Tenant", id, command.Id) .ToValidationProblemDetails(HttpContext)); var result = await commandService.UpdateAsync(command); diff --git a/src/Ubik.YarpProxy/Program.cs b/src/Ubik.YarpProxy/Program.cs index 64044e91..1c3833c9 100644 --- a/src/Ubik.YarpProxy/Program.cs +++ b/src/Ubik.YarpProxy/Program.cs @@ -108,7 +108,11 @@ .AddPolicy("CanSalesOrVatTaxRatesRead", policy => policy.Requirements.Add(new UserWithAuthorizationsRequirement(["accounting_salesvattaxrate_read"]))) .AddPolicy("CanSalesOrVatTaxRatesWrite", policy => - policy.Requirements.Add(new UserWithAuthorizationsRequirement(["accounting_salesvattaxrate_write"]))); + policy.Requirements.Add(new UserWithAuthorizationsRequirement(["accounting_salesvattaxrate_write"]))) + .AddPolicy("CanSalesOrVatTaxRatesAndAccountsRead", policy => + policy.Requirements.Add(new UserWithAuthorizationsRequirement(["accounting_salesvattaxrate_read", "accounting_account_read"]))) + .AddPolicy("CanSalesOrVatTaxRatesAndAccountsWrite", policy => + policy.Requirements.Add(new UserWithAuthorizationsRequirement(["accounting_salesvattaxrate_write", "accounting_account_write"]))); //Proxy var configProxy = builder.Configuration.GetSection("ReverseProxy"); diff --git a/src/Ubik.YarpProxy/appsettings.json b/src/Ubik.YarpProxy/appsettings.json index f4b4a351..8bffbaa9 100644 --- a/src/Ubik.YarpProxy/appsettings.json +++ b/src/Ubik.YarpProxy/appsettings.json @@ -108,9 +108,9 @@ "ClusterId": "ubik_accounting_sales_vat_tax", "AuthorizationPolicy": "IsMegaAdmin", "Match": { - "Path": "/accounting/admin/api/{apiversion}/sales-vat-tax/{**catch-all}" + "Path": "/accounting/admin/api/{apiversion}/sales-vat-tax-app/{**catch-all}" }, - "Transforms": [ { "PathPattern": "/admin/api/{apiversion}/sales-vat-tax/{**catch-all}" } ] + "Transforms": [ { "PathPattern": "/admin/api/{apiversion}/sales-vat-tax-app/{**catch-all}" } ] }, "route_accounting_accountgroup_get": { "ClusterId": "ubik_accounting_struct", @@ -363,6 +363,24 @@ "Methods": [ "DELETE" ] }, "Transforms": [ { "PathPattern": "/api/{apiversion}/sales-vat-tax/taxrates/{id:guid}" } ] + }, + "route_accounting_account_tax_rates_get_all": { + "ClusterId": "ubik_accounting_sales_vat_tax", + "AuthorizationPolicy": "CanSalesOrVatTaxRatesAndAccountsRead", + "Match": { + "Path": "/accounting/api/{apiversion}/accounts/{id:Guid}/taxrates", + "Methods": [ "GET" ] + }, + "Transforms": [ { "PathPattern": "/api/{apiversion}/accounts/{id:Guid}/taxrates" } ] + }, + "route_accounting_account_tax_rates_add": { + "ClusterId": "ubik_accounting_sales_vat_tax", + "AuthorizationPolicy": "CanSalesOrVatTaxRatesAndAccountsWrite", + "Match": { + "Path": "/accounting/api/{apiversion}/accounts/{id:Guid}/taxrates/{tax_rate_id:Guid}", + "Methods": [ "POST" ] + }, + "Transforms": [ { "PathPattern": "/api/{apiversion}/accounts/{id:Guid}/taxrates/{tax_rate_id:Guid}" } ] } }, "Clusters": { diff --git a/tests/Ubik.Api.Tests.Integration/BaseIntegrationTestAccountingSalesVatTax.cs b/tests/Ubik.Api.Tests.Integration/BaseIntegrationTestAccountingSalesVatTax.cs index 71c43990..5a9b3860 100644 --- a/tests/Ubik.Api.Tests.Integration/BaseIntegrationTestAccountingSalesVatTax.cs +++ b/tests/Ubik.Api.Tests.Integration/BaseIntegrationTestAccountingSalesVatTax.cs @@ -21,7 +21,7 @@ protected override async Task CleanupDb() var token = await GetAccessTokenAsync(TokenType.MegaAdmin); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); - var response = await client.DeleteAsync($"/accounting/admin/api/v1/sales-vat-tax/application/cleanupdb"); + var response = await client.DeleteAsync($"/accounting/admin/api/v1/sales-vat-tax-app/cleanupdb"); response.EnsureSuccessStatusCode(); Factory.IsDbCleanedAccountingSalesVatTax = true; } diff --git a/tests/Ubik.Api.Tests.Integration/BaseIntegrationTestAccountingStruct.cs b/tests/Ubik.Api.Tests.Integration/BaseIntegrationTestAccountingStruct.cs index 3b649d5d..9ca8e17c 100644 --- a/tests/Ubik.Api.Tests.Integration/BaseIntegrationTestAccountingStruct.cs +++ b/tests/Ubik.Api.Tests.Integration/BaseIntegrationTestAccountingStruct.cs @@ -21,7 +21,7 @@ protected override async Task CleanupDb() var token = await GetAccessTokenAsync(TokenType.MegaAdmin); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); - var response = await client.DeleteAsync($"/accounting/admin/api/v1/application/cleanupdb"); + var response = await client.DeleteAsync($"/accounting/admin/api/v1/struct-app/cleanupdb"); response.EnsureSuccessStatusCode(); Factory.IsDbCleanedAccountingStruct = true; } diff --git a/tests/Ubik.Api.Tests.Integration/Features/Accounting/SalesOrVatTax/TaxRates/TaxRatesController_Test.cs b/tests/Ubik.Api.Tests.Integration/Features/Accounting/SalesOrVatTax/TaxRates/TaxRatesController_Test.cs index 90b9b527..723da132 100644 --- a/tests/Ubik.Api.Tests.Integration/Features/Accounting/SalesOrVatTax/TaxRates/TaxRatesController_Test.cs +++ b/tests/Ubik.Api.Tests.Integration/Features/Accounting/SalesOrVatTax/TaxRates/TaxRatesController_Test.cs @@ -429,7 +429,6 @@ public async Task Update_TaxRate_WithRW_OK() //Act var response = await _client.PutAsJsonAsync($"{_baseUrlForV1}/{_idToUpd}", command); - var tmp = await response.Content.ReadAsStringAsync(); var result = await response.Content.ReadFromJsonAsync(); //Assert @@ -596,7 +595,7 @@ public async Task Update_TaxRate_WithNotMatchId_400() result.Should() .NotBeNull() .And.BeOfType() - .And.Match(x => x.Errors.First().Code == "TAXRATE_UPDATE_IDS_NOT_MATCH"); + .And.Match(x => x.Errors.First().Code == "TAXRATE_COMMAND_IDS_NOT_MATCH"); } [Fact] diff --git a/tests/Ubik.Api.Tests.Integration/Features/Accounting/Struct/AccountGroups/AccountGroupsController_Test.cs b/tests/Ubik.Api.Tests.Integration/Features/Accounting/Struct/AccountGroups/AccountGroupsController_Test.cs index 0307c142..0803a10c 100644 --- a/tests/Ubik.Api.Tests.Integration/Features/Accounting/Struct/AccountGroups/AccountGroupsController_Test.cs +++ b/tests/Ubik.Api.Tests.Integration/Features/Accounting/Struct/AccountGroups/AccountGroupsController_Test.cs @@ -735,7 +735,7 @@ public async Task Update_AccountGroup_WithNotMatchId_400() result.Should() .NotBeNull() .And.BeOfType() - .And.Match(x => x.Errors.First().Code == "ACCOUNTGROUP_UPDATE_IDS_NOT_MATCH"); + .And.Match(x => x.Errors.First().Code == "ACCOUNTGROUP_COMMAND_IDS_NOT_MATCH"); } [Fact] diff --git a/tests/Ubik.Api.Tests.Integration/Features/Accounting/Struct/Accounts/AccountsController_Test.cs b/tests/Ubik.Api.Tests.Integration/Features/Accounting/Struct/Accounts/AccountsController_Test.cs index c9c08845..8585d6a4 100644 --- a/tests/Ubik.Api.Tests.Integration/Features/Accounting/Struct/Accounts/AccountsController_Test.cs +++ b/tests/Ubik.Api.Tests.Integration/Features/Accounting/Struct/Accounts/AccountsController_Test.cs @@ -856,7 +856,7 @@ public async Task Update_Account_WithIDNotMatch_400() result.Should() .NotBeNull() .And.BeOfType() - .And.Match(x => x.Errors.First().Code == "ACCOUNT_UPDATE_IDS_NOT_MATCH"); + .And.Match(x => x.Errors.First().Code == "ACCOUNT_COMMAND_IDS_NOT_MATCH"); } [Fact] diff --git a/tests/Ubik.Api.Tests.Integration/Features/Accounting/Struct/Classifications/ClassificationsController_Test.cs b/tests/Ubik.Api.Tests.Integration/Features/Accounting/Struct/Classifications/ClassificationsController_Test.cs index ed312247..f8878594 100644 --- a/tests/Ubik.Api.Tests.Integration/Features/Accounting/Struct/Classifications/ClassificationsController_Test.cs +++ b/tests/Ubik.Api.Tests.Integration/Features/Accounting/Struct/Classifications/ClassificationsController_Test.cs @@ -920,7 +920,7 @@ public async Task Update_Classification_WithNotMatchId_400() result.Should() .NotBeNull() .And.BeOfType() - .And.Match(x => x.Errors.First().Code == "CLASSIFICATION_UPDATE_IDS_NOT_MATCH"); + .And.Match(x => x.Errors.First().Code == "CLASSIFICATION_COMMAND_IDS_NOT_MATCH"); } [Fact] diff --git a/tests/Ubik.Api.Tests.Integration/Features/Security/Authorizations/AuthorizationsAdminController_Test.cs b/tests/Ubik.Api.Tests.Integration/Features/Security/Authorizations/AuthorizationsAdminController_Test.cs index eb086aee..bfc80b59 100644 --- a/tests/Ubik.Api.Tests.Integration/Features/Security/Authorizations/AuthorizationsAdminController_Test.cs +++ b/tests/Ubik.Api.Tests.Integration/Features/Security/Authorizations/AuthorizationsAdminController_Test.cs @@ -339,7 +339,7 @@ public async Task Update_Authorization_NotMatchId_400() result.Should() .NotBeNull() .And.BeOfType() - .And.Match(x => x.Errors.First().Code == "AUTHORIZATION_UPDATE_IDS_NOT_MATCH"); + .And.Match(x => x.Errors.First().Code == "AUTHORIZATION_COMMAND_IDS_NOT_MATCH"); } [Fact] diff --git a/tests/Ubik.Api.Tests.Integration/Features/Security/Roles/RolesAdminController_Test.cs b/tests/Ubik.Api.Tests.Integration/Features/Security/Roles/RolesAdminController_Test.cs index a9fb697b..1cff2a0f 100644 --- a/tests/Ubik.Api.Tests.Integration/Features/Security/Roles/RolesAdminController_Test.cs +++ b/tests/Ubik.Api.Tests.Integration/Features/Security/Roles/RolesAdminController_Test.cs @@ -417,7 +417,7 @@ public async Task Update_Role_WithNotMatchId_400() result.Should() .NotBeNull() .And.BeOfType() - .And.Match(x => x.Errors.First().Code == "ROLE_UPDATE_IDS_NOT_MATCH"); + .And.Match(x => x.Errors.First().Code == "ROLE_COMMAND_IDS_NOT_MATCH"); } [Fact] diff --git a/tests/Ubik.Api.Tests.Integration/Features/Security/Tenants/TenantAdminController_Test.cs b/tests/Ubik.Api.Tests.Integration/Features/Security/Tenants/TenantAdminController_Test.cs index f7bfa5ca..12a5f368 100644 --- a/tests/Ubik.Api.Tests.Integration/Features/Security/Tenants/TenantAdminController_Test.cs +++ b/tests/Ubik.Api.Tests.Integration/Features/Security/Tenants/TenantAdminController_Test.cs @@ -343,7 +343,7 @@ public async Task Update_Tenant_NotMatchId_400() result.Should() .NotBeNull() .And.BeOfType() - .And.Match(x => x.Errors.First().Code == "TENANT_UPDATE_IDS_NOT_MATCH"); + .And.Match(x => x.Errors.First().Code == "TENANT_COMMAND_IDS_NOT_MATCH"); } [Fact] From 674dfb37835751f082bea23871a22aa2f452fabb Mon Sep 17 00:00:00 2001 From: ubik Date: Mon, 4 Nov 2024 15:30:31 +0100 Subject: [PATCH 35/94] Add account tax rates config and init base data --- .../Data/Init/AccountLinkedTaxRatesData.cs | 17 +++++++++++++++++ .../Data/Init/AccountLinkedTaxRatesData.sql | 3 +++ .../Data/Init/DbInitializer.cs | 1 + .../AccountLinkedTaxRatesCommandService.cs | 16 +++++++--------- .../Mappers/AccountTaxRateConfigMappers.cs | 5 ++++- .../Ubik.Accounting.SalesOrVatTax.Api.csproj | 3 +++ 6 files changed, 35 insertions(+), 10 deletions(-) create mode 100644 src/Ubik.Accounting.SalesOrVatTax.Api/Data/Init/AccountLinkedTaxRatesData.cs create mode 100644 src/Ubik.Accounting.SalesOrVatTax.Api/Data/Init/AccountLinkedTaxRatesData.sql diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Data/Init/AccountLinkedTaxRatesData.cs b/src/Ubik.Accounting.SalesOrVatTax.Api/Data/Init/AccountLinkedTaxRatesData.cs new file mode 100644 index 00000000..165349c5 --- /dev/null +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Data/Init/AccountLinkedTaxRatesData.cs @@ -0,0 +1,17 @@ +using Microsoft.EntityFrameworkCore; +using System.Runtime.CompilerServices; + +namespace Ubik.Accounting.SalesOrVatTax.Api.Data.Init +{ + internal static class AccountLinkedTaxRatesData + { + internal static async Task LoadAsync(AccountingSalesTaxDbContext context) + { + if (!context.AccountTaxRateConfigs.Any()) + { + var query = await File.ReadAllTextAsync(@"Data/Init/AccountLinkedTaxRatesData.sql"); + await context.Database.ExecuteSqlAsync(FormattableStringFactory.Create(query)); + } + } + } +} diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Data/Init/AccountLinkedTaxRatesData.sql b/src/Ubik.Accounting.SalesOrVatTax.Api/Data/Init/AccountLinkedTaxRatesData.sql new file mode 100644 index 00000000..bb445d30 --- /dev/null +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Data/Init/AccountLinkedTaxRatesData.sql @@ -0,0 +1,3 @@ +INSERT INTO public.account_tax_rate_configs (id, account_id, tax_rate_id, tax_account_id, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('2c6e0000-3c36-7456-5c02-08dcfcdc0bbc', '4c6f0000-5dd4-0015-7cad-08dcda56e423', '08740000-3c36-7456-6f96-08dcfb48b915', 'ec860000-5dd4-0015-2309-08dcda309b7b', '30890000-3c36-7456-698f-08dcfccdcf56', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-11-04 12:40:05.679909+00', 'c8660000-3c36-7456-580a-08dce562105f', '2024-11-04 12:40:05.679909+00', 'c8660000-3c36-7456-580a-08dce562105f'); +INSERT INTO public.account_tax_rate_configs (id, account_id, tax_rate_id, tax_account_id, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('7c440000-3c36-7456-19cc-08dcfcdcf62c', '4c6f0000-5dd4-0015-5a60-08dcda56e424', '08740000-3c36-7456-6f96-08dcfb48b915', 'ec860000-5dd4-0015-2309-08dcda309b7b', '7c440000-3c36-7456-ffe5-08dcfcdcf636', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-11-04 14:28:33.356164+00', 'c8660000-3c36-7456-580a-08dce562105f', '2024-11-04 14:28:33.356164+00', 'c8660000-3c36-7456-580a-08dce562105f'); +INSERT INTO public.account_tax_rate_configs (id, account_id, tax_rate_id, tax_account_id, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('7c440000-3c36-7456-6dbc-08dcfcdd09c5', '4c6f0000-5dd4-0015-db2b-08dcda56e424', '08740000-3c36-7456-dc84-08dcfb48d62d', 'ec860000-5dd4-0015-2309-08dcda309b7b', '7c440000-3c36-7456-8f37-08dcfcdd09c5', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-11-04 14:29:06.168107+00', 'c8660000-3c36-7456-580a-08dce562105f', '2024-11-04 14:29:06.168107+00', 'c8660000-3c36-7456-580a-08dce562105f'); diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Data/Init/DbInitializer.cs b/src/Ubik.Accounting.SalesOrVatTax.Api/Data/Init/DbInitializer.cs index 837d3f95..9f353fb9 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Api/Data/Init/DbInitializer.cs +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Data/Init/DbInitializer.cs @@ -6,6 +6,7 @@ static internal async Task InitializeAsync(AccountingSalesTaxDbContext context) { await TaxRatesData.LoadAsync(context); await AccountsData.LoadAsync(context); + await AccountLinkedTaxRatesData.LoadAsync(context); } } } diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountLinkedTaxRates/Services/AccountLinkedTaxRatesCommandService.cs b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountLinkedTaxRates/Services/AccountLinkedTaxRatesCommandService.cs index 0e0ebc40..4c084f50 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountLinkedTaxRates/Services/AccountLinkedTaxRatesCommandService.cs +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountLinkedTaxRates/Services/AccountLinkedTaxRatesCommandService.cs @@ -19,7 +19,7 @@ public async Task> AttachA .BindAsync(t => GetAccountAsync(command.AccountId)) .BindAsync(t => GetTaxAccountAsync(command.TaxAccountId)) .BindAsync(t => ValidateIfLinkNotAlreadyExistsAsync(command.AccountId, command.TaxRateId) - .BindAsync(l => AddTaxRateLinkInDbContextAsync(l, command)) + .BindAsync(l => AddTaxRateLinkInDbContextAsync(command)) .BindAsync(AddTaxRateLinkSaveAndPublishAsync)); } @@ -36,25 +36,23 @@ private async Task> AddTax return current; } - private async Task> AddTaxRateLinkInDbContextAsync(AccountTaxRateConfig current - , AddTaxRateToAccountCommand command) + private async Task> AddTaxRateLinkInDbContextAsync(AddTaxRateToAccountCommand command) { - current.TaxAccountId = command.TaxAccountId; - - await ctx.AccountTaxRateConfigs.AddAsync(current); + var accountTaxRateConfig = command.ToAccountTaxRateConfig(); + var result = await ctx.AccountTaxRateConfigs.AddAsync(command.ToAccountTaxRateConfig()); ctx.SetAuditAndSpecialFields(); - return current; + return accountTaxRateConfig; } - private async Task> ValidateIfLinkNotAlreadyExistsAsync(Guid accountId, Guid taxRateId) + private async Task> ValidateIfLinkNotAlreadyExistsAsync(Guid accountId, Guid taxRateId) { var result = await ctx.AccountTaxRateConfigs.AnyAsync(x => x.AccountId == accountId && x.TaxRateId == taxRateId ); return result ? new LinkedTaxRateAlreadyExist(accountId,taxRateId) - : new AccountTaxRateConfig() { AccountId= accountId, TaxRateId=taxRateId}; + : true; } private async Task> GetAccountAsync(Guid accountId) diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Mappers/AccountTaxRateConfigMappers.cs b/src/Ubik.Accounting.SalesOrVatTax.Api/Mappers/AccountTaxRateConfigMappers.cs index dccd1606..399330bc 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Api/Mappers/AccountTaxRateConfigMappers.cs +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Mappers/AccountTaxRateConfigMappers.cs @@ -1,4 +1,5 @@ -using Ubik.Accounting.SalesOrVatTax.Api.Models; +using MassTransit; +using Ubik.Accounting.SalesOrVatTax.Api.Models; using Ubik.Accounting.SalesOrVatTax.Contracts.AccountLinkedTaxRates.Commands; using Ubik.Accounting.SalesOrVatTax.Contracts.AccountLinkedTaxRates.Events; using Ubik.Accounting.SalesOrVatTax.Contracts.AccountLinkedTaxRates.Results; @@ -24,9 +25,11 @@ public static AccountTaxRateConfig ToAccountTaxRateConfig(this AddTaxRateToAccou { return new AccountTaxRateConfig { + Id = NewId.NextGuid(), AccountId = current.AccountId, TaxRateId = current.TaxRateId, TaxAccountId = current.TaxAccountId, + Version = NewId.NextGuid() }; } diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Ubik.Accounting.SalesOrVatTax.Api.csproj b/src/Ubik.Accounting.SalesOrVatTax.Api/Ubik.Accounting.SalesOrVatTax.Api.csproj index 11fba37b..07e25169 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Api/Ubik.Accounting.SalesOrVatTax.Api.csproj +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Ubik.Accounting.SalesOrVatTax.Api.csproj @@ -34,6 +34,9 @@ + + Always + Always From 8fdaee41d2625affe018cbfa5160a6c25d0f7c3e Mon Sep 17 00:00:00 2001 From: ubik Date: Mon, 4 Nov 2024 17:48:27 +0100 Subject: [PATCH 36/94] Add accountTaxratecongfigs tests --- ...AccountingLinkedTaxRatesController_Test.cs | 416 ++++++++++++++++++ .../TaxRates/TaxRatesController_Test.cs | 1 - 2 files changed, 416 insertions(+), 1 deletion(-) create mode 100644 tests/Ubik.Api.Tests.Integration/Features/Accounting/SalesOrVatTax/AccountLinkedTaxRates/AccountingLinkedTaxRatesController_Test.cs diff --git a/tests/Ubik.Api.Tests.Integration/Features/Accounting/SalesOrVatTax/AccountLinkedTaxRates/AccountingLinkedTaxRatesController_Test.cs b/tests/Ubik.Api.Tests.Integration/Features/Accounting/SalesOrVatTax/AccountLinkedTaxRates/AccountingLinkedTaxRatesController_Test.cs new file mode 100644 index 00000000..5da6cc25 --- /dev/null +++ b/tests/Ubik.Api.Tests.Integration/Features/Accounting/SalesOrVatTax/AccountLinkedTaxRates/AccountingLinkedTaxRatesController_Test.cs @@ -0,0 +1,416 @@ +using FluentAssertions; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Net.Http.Headers; +using System.Net.Http.Json; +using System.Net; +using System.Text; +using System.Threading.Tasks; +using Ubik.Accounting.SalesOrVatTax.Contracts.SalesOrVatTaxRate.Results; +using Ubik.Accounting.SalesOrVatTax.Contracts.AccountLinkedTaxRates.Results; +using Ubik.ApiService.Common.Exceptions; +using MassTransit; +using Ubik.Accounting.SalesOrVatTax.Contracts.SalesOrVatTaxRate.Commands; +using Ubik.Accounting.SalesOrVatTax.Contracts.AccountLinkedTaxRates.Commands; + +namespace Ubik.Api.Tests.Integration.Features.Accounting.SalesOrVatTax.AccountLinkedTaxRates +{ + public class AccountingLinkedTaxRatesController_Test : BaseIntegrationTestAccountingSalesVatTax + { + + private readonly string _baseUrlForV1; + private readonly HttpClient _client; + + public AccountingLinkedTaxRatesController_Test(IntegrationTestProxyFactory factory) : base(factory) + { + _baseUrlForV1 = "/accounting/api/v1"; + _client = Factory.CreateDefaultClient(); + } + + [Fact] + public async Task Get_All_AccountLinkedTaxRates_WithRW_OK() + { + //Arrange + var token = await GetAccessTokenAsync(TokenType.RW); + _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); + + //Act + var response = await _client.GetAsync($"{_baseUrlForV1}/accounts/4c6f0000-5dd4-0015-7cad-08dcda56e423/taxrates"); + var result = await response.Content.ReadFromJsonAsync>(); + + //Assert + response.StatusCode.Should().Be(HttpStatusCode.OK); + result.Should() + .NotBeNull() + .And.BeOfType>() + .And.HaveCount(1); + } + + [Fact] + public async Task Get_All_AccountLinkedTaxRates_WithRO_OK() + { + //Arrange + var token = await GetAccessTokenAsync(TokenType.RO); + _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); + + //Act + var response = await _client.GetAsync($"{_baseUrlForV1}/accounts/4c6f0000-5dd4-0015-7cad-08dcda56e423/taxrates"); + var result = await response.Content.ReadFromJsonAsync>(); + + //Assert + response.StatusCode.Should().Be(HttpStatusCode.OK); + result.Should() + .NotBeNull() + .And.BeOfType>() + .And.HaveCount(1); + } + + [Fact] + public async Task Get_All_AccountLinkedTaxRates_WithNoToken_Unauthorized() + { + //Act + var response = await _client.GetAsync($"{_baseUrlForV1}/accounts/4c6f0000-5dd4-0015-7cad-08dcda56e423/taxrates"); + + //Assert + response.StatusCode.Should().Be(HttpStatusCode.Unauthorized); + } + + [Fact] + public async Task Get_All_AccountLinkedTaxRates_WithAdmin_403() + { + //Arrange + var token = await GetAccessTokenAsync(TokenType.MegaAdmin); + _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); + + //Act + var response = await _client.GetAsync($"{_baseUrlForV1}/accounts/4c6f0000-5dd4-0015-7cad-08dcda56e423/taxrates"); + + //Assert + response.StatusCode.Should().Be(HttpStatusCode.Forbidden); + } + + [Fact] + public async Task Get_All_AccountLinkedTaxRates_WithOtherTenant_404() + { + //Arrange + var token = await GetAccessTokenAsync(TokenType.OtherTenant); + _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); + + //Act + var response = await _client.GetAsync($"{_baseUrlForV1}/accounts/4c6f0000-5dd4-0015-7cad-08dcda56e423/taxrates"); + var result = await response.Content.ReadFromJsonAsync(); + + //Assert + response.StatusCode.Should().Be(HttpStatusCode.NotFound); + result.Should() + .NotBeNull() + .And.BeOfType () + .And.Match(x => x.Errors.First().Code == "ACCOUNT_NOT_FOUND"); + } + + [Fact] + public async Task Get_All_AccountLinkedTaxRates_WithNoRole_403() + { + var token = await GetAccessTokenAsync(TokenType.NoRole); + _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); + + //Act + var response = await _client.GetAsync($"{_baseUrlForV1}/accounts/4c6f0000-5dd4-0015-7cad-08dcda56e423/taxrates"); + + //Assert + response.StatusCode.Should().Be(HttpStatusCode.Forbidden); + } + + [Fact] + public async Task Get_All_AccountLinkedTaxRates_WithBadId_404() + { + //Arrange + var token = await GetAccessTokenAsync(TokenType.RW); + _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); + + //Act + var response = await _client.GetAsync($"{_baseUrlForV1}/accounts/{NewId.NextGuid()}/taxrates"); + var result = await response.Content.ReadFromJsonAsync(); + + //Assert + response.StatusCode.Should().Be(HttpStatusCode.NotFound); + result.Should() + .NotBeNull() + .And.BeOfType() + .And.Match(x => x.Errors.First().Code == "ACCOUNT_NOT_FOUND"); + } + + [Fact] + public async Task Add_AccountLinkedTaxRates_WithRW_OK() + { + var token = await GetAccessTokenAsync(TokenType.RW); + _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); + + var command = new AddTaxRateToAccountCommand() + { + AccountId = new Guid("60520000-5dd4-0015-5c21-08dcda58ab64"), + TaxRateId = new Guid("08740000-3c36-7456-6f96-08dcfb48b915"), + TaxAccountId = new Guid("248e0000-5dd4-0015-443b-08dcd98b545d") + }; + + //Act + var response = await _client.PostAsJsonAsync($"{_baseUrlForV1}/accounts/{command.AccountId}/taxrates/{command.TaxRateId}", command); + var result = await response.Content.ReadFromJsonAsync(); + + //Assert + response.StatusCode.Should().Be(HttpStatusCode.OK); + result.Should() + .NotBeNull() + .And.BeOfType() + .And.Match(x => x.AccountId == command.AccountId); + } + + [Fact] + public async Task Add_AccountLinkedTaxRates_WithRO_403() + { + var token = await GetAccessTokenAsync(TokenType.RO); + _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); + + var command = new AddTaxRateToAccountCommand() + { + AccountId = new Guid("60520000-5dd4-0015-5c21-08dcda58ab64"), + TaxRateId = new Guid("08740000-3c36-7456-6f96-08dcfb48b915"), + TaxAccountId = new Guid("248e0000-5dd4-0015-443b-08dcd98b545d") + }; + + //Act + var response = await _client.PostAsJsonAsync($"{_baseUrlForV1}/accounts/{command.AccountId}/taxrates/{command.TaxRateId}", command); + + //Assert + response.StatusCode.Should().Be(HttpStatusCode.Forbidden); + } + + [Fact] + public async Task Add_AccountLinkedTaxRates_WithNoToken_401() + { + var command = new AddTaxRateToAccountCommand() + { + AccountId = new Guid("60520000-5dd4-0015-5c21-08dcda58ab64"), + TaxRateId = new Guid("08740000-3c36-7456-6f96-08dcfb48b915"), + TaxAccountId = new Guid("248e0000-5dd4-0015-443b-08dcd98b545d") + }; + + //Act + var response = await _client.PostAsJsonAsync($"{_baseUrlForV1}/accounts/{command.AccountId}/taxrates/{command.TaxRateId}", command); + + //Assert + response.StatusCode.Should().Be(HttpStatusCode.Unauthorized); + } + + [Fact] + public async Task Add_AccountLinkedTaxRates_WithAdmin_403() + { + var token = await GetAccessTokenAsync(TokenType.MegaAdmin); + _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); + + var command = new AddTaxRateToAccountCommand() + { + AccountId = new Guid("60520000-5dd4-0015-5c21-08dcda58ab64"), + TaxRateId = new Guid("08740000-3c36-7456-6f96-08dcfb48b915"), + TaxAccountId = new Guid("248e0000-5dd4-0015-443b-08dcd98b545d") + }; + + //Act + var response = await _client.PostAsJsonAsync($"{_baseUrlForV1}/accounts/{command.AccountId}/taxrates/{command.TaxRateId}", command); + + //Assert + response.StatusCode.Should().Be(HttpStatusCode.Forbidden); + } + + [Fact] + public async Task Add_AccountLinkedTaxRates_WithOtherTenant_404() + { + var token = await GetAccessTokenAsync(TokenType.OtherTenant); + _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); + + var command = new AddTaxRateToAccountCommand() + { + AccountId = new Guid("60520000-5dd4-0015-5c21-08dcda58ab64"), + TaxRateId = new Guid("08740000-3c36-7456-6f96-08dcfb48b915"), + TaxAccountId = new Guid("248e0000-5dd4-0015-443b-08dcd98b545d") + }; + + //Act + var response = await _client.PostAsJsonAsync($"{_baseUrlForV1}/accounts/{command.AccountId}/taxrates/{command.TaxRateId}", command); + + //Assert + response.StatusCode.Should().Be(HttpStatusCode.NotFound); + } + + [Fact] + public async Task Add_AccountLinkedTaxRates_WithNoRole_403() + { + var token = await GetAccessTokenAsync(TokenType.NoRole); + _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); + + var command = new AddTaxRateToAccountCommand() + { + AccountId = new Guid("60520000-5dd4-0015-5c21-08dcda58ab64"), + TaxRateId = new Guid("08740000-3c36-7456-6f96-08dcfb48b915"), + TaxAccountId = new Guid("248e0000-5dd4-0015-443b-08dcd98b545d") + }; + + //Act + var response = await _client.PostAsJsonAsync($"{_baseUrlForV1}/accounts/{command.AccountId}/taxrates/{command.TaxRateId}", command); + + //Assert + response.StatusCode.Should().Be(HttpStatusCode.Forbidden); + } + + [Fact] + public async Task Add_AccountLinkedTaxRates_WithNotMatchIdAccount_400() + { + var token = await GetAccessTokenAsync(TokenType.RW); + _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); + + var command = new AddTaxRateToAccountCommand() + { + AccountId = new Guid("78920000-5dd4-0015-6f96-08dcd9a78046"), + TaxRateId = new Guid("08740000-3c36-7456-6f96-08dcfb48b915"), + TaxAccountId = new Guid("248e0000-5dd4-0015-443b-08dcd98b545d") + }; + + //Act + var response = await _client.PostAsJsonAsync($"{_baseUrlForV1}/accounts/248e0000-5dd4-0015-443b-08dcd98b545d/taxrates/{command.TaxRateId}", command); + var result = await response.Content.ReadFromJsonAsync(); + + //Assert + response.StatusCode.Should().Be(HttpStatusCode.BadRequest); + result.Should() + .NotBeNull() + .And.BeOfType() + .And.Match(x => x.Errors.First().Code == "ACCOUNT_COMMAND_IDS_NOT_MATCH"); + } + + [Fact] + public async Task Add_AccountLinkedTaxRates_WithNotMatchIdTaxRate_400() + { + var token = await GetAccessTokenAsync(TokenType.RW); + _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); + + var command = new AddTaxRateToAccountCommand() + { + AccountId = new Guid("248e0000-5dd4-0015-443b-08dcd98b545d"), + TaxRateId = new Guid("08740000-3c36-7456-6f96-08dcfb48b915"), + TaxAccountId = new Guid("248e0000-5dd4-0015-443b-08dcd98b545d") + }; + + //Act + var response = await _client.PostAsJsonAsync($"{_baseUrlForV1}/accounts/{command.AccountId}/taxrates/08740000-3c36-7456-dc84-08dcfb48d62d", command); + var result = await response.Content.ReadFromJsonAsync(); + + //Assert + response.StatusCode.Should().Be(HttpStatusCode.BadRequest); + result.Should() + .NotBeNull() + .And.BeOfType() + .And.Match(x => x.Errors.First().Code == "TAXRATE_COMMAND_IDS_NOT_MATCH"); + } + + [Fact] + public async Task Add_AccountLinkedTaxRates_WithBadAccountId_404() + { + var token = await GetAccessTokenAsync(TokenType.RW); + _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); + + var command = new AddTaxRateToAccountCommand() + { + AccountId = new Guid("60520000-5dd4-0015-5c21-08dcda58ab61"), + TaxRateId = new Guid("08740000-3c36-7456-6f96-08dcfb48b915"), + TaxAccountId = new Guid("248e0000-5dd4-0015-443b-08dcd98b545d") + }; + + //Act + var response = await _client.PostAsJsonAsync($"{_baseUrlForV1}/accounts/{command.AccountId}/taxrates/{command.TaxRateId}", command); + var result = await response.Content.ReadFromJsonAsync(); + + //Assert + response.StatusCode.Should().Be(HttpStatusCode.NotFound); + result.Should() + .NotBeNull() + .And.BeOfType() + .And.Match(x => x.Errors.First().Code == "ACCOUNT_NOT_FOUND"); + } + + [Fact] + public async Task Add_AccountLinkedTaxRates_WithBadTaxRateId_404() + { + var token = await GetAccessTokenAsync(TokenType.RW); + _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); + + var command = new AddTaxRateToAccountCommand() + { + AccountId = new Guid("ec860000-5dd4-0015-d472-08dcda1dc37c"), + TaxRateId = new Guid("08740000-3c36-7456-6f96-08dcfb48b914"), + TaxAccountId = new Guid("248e0000-5dd4-0015-443b-08dcd98b545d") + }; + + //Act + var response = await _client.PostAsJsonAsync($"{_baseUrlForV1}/accounts/{command.AccountId}/taxrates/{command.TaxRateId}", command); + var result = await response.Content.ReadFromJsonAsync(); + + //Assert + response.StatusCode.Should().Be(HttpStatusCode.NotFound); + result.Should() + .NotBeNull() + .And.BeOfType() + .And.Match(x => x.Errors.First().Code == "TAXRATE_NOT_FOUND"); + } + + [Fact] + public async Task Add_AccountLinkedTaxRates_WithBadTaxAccountId_404() + { + var token = await GetAccessTokenAsync(TokenType.RW); + _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); + + var command = new AddTaxRateToAccountCommand() + { + AccountId = new Guid("60520000-5dd4-0015-5c21-08dcda58ab64"), + TaxRateId = new Guid("08740000-3c36-7456-6f96-08dcfb48b915"), + TaxAccountId = new Guid("248e0000-5dd4-0015-443b-08dcd98b5451") + }; + + //Act + var response = await _client.PostAsJsonAsync($"{_baseUrlForV1}/accounts/{command.AccountId}/taxrates/{command.TaxRateId}", command); + var result = await response.Content.ReadFromJsonAsync(); + + //Assert + response.StatusCode.Should().Be(HttpStatusCode.BadRequest); + result.Should() + .NotBeNull() + .And.BeOfType() + .And.Match(x => x.Errors.First().Code == "ACCOUNTTAXCONFIG_TAXACCOUNT_NOT_FOUND"); + } + + [Fact] + public async Task Add_AccountLinkedTaxRates_WithAlreadyExisting_400() + { + var token = await GetAccessTokenAsync(TokenType.RW); + _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); + + var command = new AddTaxRateToAccountCommand() + { + AccountId = new Guid("4c6f0000-5dd4-0015-7cad-08dcda56e423"), + TaxRateId = new Guid("08740000-3c36-7456-6f96-08dcfb48b915"), + TaxAccountId = new Guid("248e0000-5dd4-0015-443b-08dcd98b545d") + }; + + //Act + var response = await _client.PostAsJsonAsync($"{_baseUrlForV1}/accounts/{command.AccountId}/taxrates/{command.TaxRateId}", command); + var result = await response.Content.ReadFromJsonAsync(); + + //Assert + response.StatusCode.Should().Be(HttpStatusCode.BadRequest); + result.Should() + .NotBeNull() + .And.BeOfType() + .And.Match(x => x.Errors.First().Code == "LINKED_TAX_RATE_ALREADY_EXIST"); + } + } +} diff --git a/tests/Ubik.Api.Tests.Integration/Features/Accounting/SalesOrVatTax/TaxRates/TaxRatesController_Test.cs b/tests/Ubik.Api.Tests.Integration/Features/Accounting/SalesOrVatTax/TaxRates/TaxRatesController_Test.cs index 723da132..785ccdd4 100644 --- a/tests/Ubik.Api.Tests.Integration/Features/Accounting/SalesOrVatTax/TaxRates/TaxRatesController_Test.cs +++ b/tests/Ubik.Api.Tests.Integration/Features/Accounting/SalesOrVatTax/TaxRates/TaxRatesController_Test.cs @@ -38,7 +38,6 @@ public async Task Get_All_TaxRates_WithRW_OK() //Act var response = await _client.GetAsync(_baseUrlForV1); - var tmp = await response.Content.ReadAsStringAsync(); var result = await response.Content.ReadFromJsonAsync>(); //Assert From 58c6927f126ac224d88ad262f4ce4eb33fe0f51f Mon Sep 17 00:00:00 2001 From: ubik Date: Mon, 4 Nov 2024 20:14:24 +0100 Subject: [PATCH 37/94] Delete account taxrate config --- .../v1/AccountLinkedTaxRatesController.cs | 2 +- .../AccountLinkedTaxRatesCommandService.cs | 48 +++++++++++++++---- .../IAccountLinkedTaxRatesCommandService.cs | 4 +- .../Mappers/AccountTaxRateConfigMappers.cs | 2 +- ...d.cs => AddAccountTaxRateConfigCommand.cs} | 2 +- ...s => DeleteAccountTaxRateConfigCommand.cs} | 2 +- .../Events/AccountTaxRateConfigDeleted.cs | 13 +++++ ...AccountingLinkedTaxRatesController_Test.cs | 24 +++++----- 8 files changed, 70 insertions(+), 27 deletions(-) rename src/Ubik.Accounting.SalesOrVatTax.Contracts/AccountLinkedTaxRates/Commands/{AddTaxRateToAccountCommand.cs => AddAccountTaxRateConfigCommand.cs} (87%) rename src/Ubik.Accounting.SalesOrVatTax.Contracts/AccountLinkedTaxRates/Commands/{RemoveTaxRateToAccountCommand.cs => DeleteAccountTaxRateConfigCommand.cs} (85%) create mode 100644 src/Ubik.Accounting.SalesOrVatTax.Contracts/AccountLinkedTaxRates/Events/AccountTaxRateConfigDeleted.cs diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountLinkedTaxRates/Controllers/v1/AccountLinkedTaxRatesController.cs b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountLinkedTaxRates/Controllers/v1/AccountLinkedTaxRatesController.cs index 094f27a9..8072d909 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountLinkedTaxRates/Controllers/v1/AccountLinkedTaxRatesController.cs +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountLinkedTaxRates/Controllers/v1/AccountLinkedTaxRatesController.cs @@ -40,7 +40,7 @@ public async Task>> [ProducesResponseType(typeof(CustomProblemDetails), 409)] [ProducesResponseType(typeof(CustomProblemDetails), 500)] public async Task> AddTaxRateToAccount - (Guid id, Guid taxRateId, AddTaxRateToAccountCommand command) + (Guid id, Guid taxRateId, AddAccountTaxRateConfigCommand command) { if (command.AccountId != id) return new ObjectResult(new ResourceIdNotMatchWithCommandError("Account", id, command.AccountId) diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountLinkedTaxRates/Services/AccountLinkedTaxRatesCommandService.cs b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountLinkedTaxRates/Services/AccountLinkedTaxRatesCommandService.cs index 4c084f50..f36bd5d0 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountLinkedTaxRates/Services/AccountLinkedTaxRatesCommandService.cs +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountLinkedTaxRates/Services/AccountLinkedTaxRatesCommandService.cs @@ -7,13 +7,15 @@ using Ubik.Accounting.SalesOrVatTax.Api.Mappers; using Ubik.Accounting.SalesOrVatTax.Api.Models; using Ubik.Accounting.SalesOrVatTax.Contracts.AccountLinkedTaxRates.Commands; +using Ubik.Accounting.SalesOrVatTax.Contracts.AccountLinkedTaxRates.Events; +using Ubik.Accounting.SalesOrVatTax.Contracts.SalesOrVatTaxRate.Events; using Ubik.ApiService.Common.Errors; namespace Ubik.Accounting.SalesOrVatTax.Api.Features.AccountLinkedTaxRates.Services { public class AccountLinkedTaxRatesCommandService(AccountingSalesTaxDbContext ctx, IPublishEndpoint publishEndpoint) : IAccountLinkedTaxRatesCommandService { - public async Task> AttachAsync(AddTaxRateToAccountCommand command) + public async Task> AttachAsync(AddAccountTaxRateConfigCommand command) { return await GetAsync(command.TaxRateId) .BindAsync(t => GetAccountAsync(command.AccountId)) @@ -23,10 +25,38 @@ public async Task> AttachA .BindAsync(AddTaxRateLinkSaveAndPublishAsync)); } - //public async Task> DetachAsync(AddTaxRateToAccountCommand command) - //{ - - //} + + public async Task> DetachAsync(DeleteAccountTaxRateConfigCommand command) + { + return await GetAccountTaxRateConfigAsync(command.AccountId, command.TaxRateId) + .BindAsync(DeleteInDbContextAsync) + .BindAsync(DeletedSaveAndPublishAsync); + } + + private async Task> DeleteInDbContextAsync(AccountTaxRateConfig current) + { + ctx.Entry(current).State = EntityState.Deleted; + + await Task.CompletedTask; + return current; + } + + private async Task> DeletedSaveAndPublishAsync(AccountTaxRateConfig current) + { + await publishEndpoint.Publish(new AccountTaxRateConfigDeleted { Id = current.Id }, CancellationToken.None); + await ctx.SaveChangesAsync(); + + return true; + } + + private async Task> GetAccountTaxRateConfigAsync(Guid accountId, Guid taxRateId) + { + var result = await ctx.AccountTaxRateConfigs.FirstOrDefaultAsync(x => x.AccountId == accountId && x.TaxRateId == taxRateId); + + return result == null + ? new ResourceNotFoundError("AccountTaxRateConfig", "AccountId/TaxRateId", $"{accountId.ToString()}/{taxRateId.ToString()}") + : result; + } private async Task> AddTaxRateLinkSaveAndPublishAsync(AccountTaxRateConfig current) { @@ -36,7 +66,7 @@ private async Task> AddTax return current; } - private async Task> AddTaxRateLinkInDbContextAsync(AddTaxRateToAccountCommand command) + private async Task> AddTaxRateLinkInDbContextAsync(AddAccountTaxRateConfigCommand command) { var accountTaxRateConfig = command.ToAccountTaxRateConfig(); var result = await ctx.AccountTaxRateConfigs.AddAsync(command.ToAccountTaxRateConfig()); @@ -48,10 +78,10 @@ private async Task> AddTax private async Task> ValidateIfLinkNotAlreadyExistsAsync(Guid accountId, Guid taxRateId) { var result = await ctx.AccountTaxRateConfigs.AnyAsync(x => x.AccountId == accountId - && x.TaxRateId == taxRateId ); + && x.TaxRateId == taxRateId); return result - ? new LinkedTaxRateAlreadyExist(accountId,taxRateId) + ? new LinkedTaxRateAlreadyExist(accountId, taxRateId) : true; } @@ -69,7 +99,7 @@ private async Task> GetTaxAccountAsync( var result = await ctx.Accounts.FindAsync(taxAccountId); return result == null - ? new BadParamExternalResourceNotFound("AccountTaxConfig","TaxAccount", "TaxAccountId", taxAccountId.ToString()) + ? new BadParamExternalResourceNotFound("AccountTaxConfig", "TaxAccount", "TaxAccountId", taxAccountId.ToString()) : result; } diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountLinkedTaxRates/Services/IAccountLinkedTaxRatesCommandService.cs b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountLinkedTaxRates/Services/IAccountLinkedTaxRatesCommandService.cs index 9158a71d..e6d54345 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountLinkedTaxRates/Services/IAccountLinkedTaxRatesCommandService.cs +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountLinkedTaxRates/Services/IAccountLinkedTaxRatesCommandService.cs @@ -7,7 +7,7 @@ namespace Ubik.Accounting.SalesOrVatTax.Api.Features.AccountLinkedTaxRates.Servi { public interface IAccountLinkedTaxRatesCommandService { - Task> AttachAsync(AddTaxRateToAccountCommand command); - //Task> DetachAsync(AddTaxRateToAccountCommand command); + Task> AttachAsync(AddAccountTaxRateConfigCommand command); + Task> DetachAsync(DeleteAccountTaxRateConfigCommand command); } } diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Mappers/AccountTaxRateConfigMappers.cs b/src/Ubik.Accounting.SalesOrVatTax.Api/Mappers/AccountTaxRateConfigMappers.cs index 399330bc..4118f3a9 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Api/Mappers/AccountTaxRateConfigMappers.cs +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Mappers/AccountTaxRateConfigMappers.cs @@ -21,7 +21,7 @@ public static IEnumerable ToAccountTaxRateCo }); } - public static AccountTaxRateConfig ToAccountTaxRateConfig(this AddTaxRateToAccountCommand current) + public static AccountTaxRateConfig ToAccountTaxRateConfig(this AddAccountTaxRateConfigCommand current) { return new AccountTaxRateConfig { diff --git a/src/Ubik.Accounting.SalesOrVatTax.Contracts/AccountLinkedTaxRates/Commands/AddTaxRateToAccountCommand.cs b/src/Ubik.Accounting.SalesOrVatTax.Contracts/AccountLinkedTaxRates/Commands/AddAccountTaxRateConfigCommand.cs similarity index 87% rename from src/Ubik.Accounting.SalesOrVatTax.Contracts/AccountLinkedTaxRates/Commands/AddTaxRateToAccountCommand.cs rename to src/Ubik.Accounting.SalesOrVatTax.Contracts/AccountLinkedTaxRates/Commands/AddAccountTaxRateConfigCommand.cs index c531bc5d..69014543 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Contracts/AccountLinkedTaxRates/Commands/AddTaxRateToAccountCommand.cs +++ b/src/Ubik.Accounting.SalesOrVatTax.Contracts/AccountLinkedTaxRates/Commands/AddAccountTaxRateConfigCommand.cs @@ -6,7 +6,7 @@ namespace Ubik.Accounting.SalesOrVatTax.Contracts.AccountLinkedTaxRates.Commands { - public record AddTaxRateToAccountCommand + public record AddAccountTaxRateConfigCommand { public Guid AccountId { get; init; } public Guid TaxRateId { get; init; } diff --git a/src/Ubik.Accounting.SalesOrVatTax.Contracts/AccountLinkedTaxRates/Commands/RemoveTaxRateToAccountCommand.cs b/src/Ubik.Accounting.SalesOrVatTax.Contracts/AccountLinkedTaxRates/Commands/DeleteAccountTaxRateConfigCommand.cs similarity index 85% rename from src/Ubik.Accounting.SalesOrVatTax.Contracts/AccountLinkedTaxRates/Commands/RemoveTaxRateToAccountCommand.cs rename to src/Ubik.Accounting.SalesOrVatTax.Contracts/AccountLinkedTaxRates/Commands/DeleteAccountTaxRateConfigCommand.cs index 991e605f..71120688 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Contracts/AccountLinkedTaxRates/Commands/RemoveTaxRateToAccountCommand.cs +++ b/src/Ubik.Accounting.SalesOrVatTax.Contracts/AccountLinkedTaxRates/Commands/DeleteAccountTaxRateConfigCommand.cs @@ -6,7 +6,7 @@ namespace Ubik.Accounting.SalesOrVatTax.Contracts.AccountLinkedTaxRates.Commands { - public record RemoveTaxRateToAccountCommand + public record DeleteAccountTaxRateConfigCommand { public Guid AccountId { get; init; } public Guid TaxRateId { get; init; } diff --git a/src/Ubik.Accounting.SalesOrVatTax.Contracts/AccountLinkedTaxRates/Events/AccountTaxRateConfigDeleted.cs b/src/Ubik.Accounting.SalesOrVatTax.Contracts/AccountLinkedTaxRates/Events/AccountTaxRateConfigDeleted.cs new file mode 100644 index 00000000..f60c8145 --- /dev/null +++ b/src/Ubik.Accounting.SalesOrVatTax.Contracts/AccountLinkedTaxRates/Events/AccountTaxRateConfigDeleted.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Ubik.Accounting.SalesOrVatTax.Contracts.AccountLinkedTaxRates.Events +{ + public record AccountTaxRateConfigDeleted + { + public Guid Id { get; init; } + } +} diff --git a/tests/Ubik.Api.Tests.Integration/Features/Accounting/SalesOrVatTax/AccountLinkedTaxRates/AccountingLinkedTaxRatesController_Test.cs b/tests/Ubik.Api.Tests.Integration/Features/Accounting/SalesOrVatTax/AccountLinkedTaxRates/AccountingLinkedTaxRatesController_Test.cs index 5da6cc25..83fd83a8 100644 --- a/tests/Ubik.Api.Tests.Integration/Features/Accounting/SalesOrVatTax/AccountLinkedTaxRates/AccountingLinkedTaxRatesController_Test.cs +++ b/tests/Ubik.Api.Tests.Integration/Features/Accounting/SalesOrVatTax/AccountLinkedTaxRates/AccountingLinkedTaxRatesController_Test.cs @@ -147,7 +147,7 @@ public async Task Add_AccountLinkedTaxRates_WithRW_OK() var token = await GetAccessTokenAsync(TokenType.RW); _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); - var command = new AddTaxRateToAccountCommand() + var command = new AddAccountTaxRateConfigCommand() { AccountId = new Guid("60520000-5dd4-0015-5c21-08dcda58ab64"), TaxRateId = new Guid("08740000-3c36-7456-6f96-08dcfb48b915"), @@ -172,7 +172,7 @@ public async Task Add_AccountLinkedTaxRates_WithRO_403() var token = await GetAccessTokenAsync(TokenType.RO); _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); - var command = new AddTaxRateToAccountCommand() + var command = new AddAccountTaxRateConfigCommand() { AccountId = new Guid("60520000-5dd4-0015-5c21-08dcda58ab64"), TaxRateId = new Guid("08740000-3c36-7456-6f96-08dcfb48b915"), @@ -189,7 +189,7 @@ public async Task Add_AccountLinkedTaxRates_WithRO_403() [Fact] public async Task Add_AccountLinkedTaxRates_WithNoToken_401() { - var command = new AddTaxRateToAccountCommand() + var command = new AddAccountTaxRateConfigCommand() { AccountId = new Guid("60520000-5dd4-0015-5c21-08dcda58ab64"), TaxRateId = new Guid("08740000-3c36-7456-6f96-08dcfb48b915"), @@ -209,7 +209,7 @@ public async Task Add_AccountLinkedTaxRates_WithAdmin_403() var token = await GetAccessTokenAsync(TokenType.MegaAdmin); _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); - var command = new AddTaxRateToAccountCommand() + var command = new AddAccountTaxRateConfigCommand() { AccountId = new Guid("60520000-5dd4-0015-5c21-08dcda58ab64"), TaxRateId = new Guid("08740000-3c36-7456-6f96-08dcfb48b915"), @@ -229,7 +229,7 @@ public async Task Add_AccountLinkedTaxRates_WithOtherTenant_404() var token = await GetAccessTokenAsync(TokenType.OtherTenant); _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); - var command = new AddTaxRateToAccountCommand() + var command = new AddAccountTaxRateConfigCommand() { AccountId = new Guid("60520000-5dd4-0015-5c21-08dcda58ab64"), TaxRateId = new Guid("08740000-3c36-7456-6f96-08dcfb48b915"), @@ -249,7 +249,7 @@ public async Task Add_AccountLinkedTaxRates_WithNoRole_403() var token = await GetAccessTokenAsync(TokenType.NoRole); _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); - var command = new AddTaxRateToAccountCommand() + var command = new AddAccountTaxRateConfigCommand() { AccountId = new Guid("60520000-5dd4-0015-5c21-08dcda58ab64"), TaxRateId = new Guid("08740000-3c36-7456-6f96-08dcfb48b915"), @@ -269,7 +269,7 @@ public async Task Add_AccountLinkedTaxRates_WithNotMatchIdAccount_400() var token = await GetAccessTokenAsync(TokenType.RW); _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); - var command = new AddTaxRateToAccountCommand() + var command = new AddAccountTaxRateConfigCommand() { AccountId = new Guid("78920000-5dd4-0015-6f96-08dcd9a78046"), TaxRateId = new Guid("08740000-3c36-7456-6f96-08dcfb48b915"), @@ -294,7 +294,7 @@ public async Task Add_AccountLinkedTaxRates_WithNotMatchIdTaxRate_400() var token = await GetAccessTokenAsync(TokenType.RW); _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); - var command = new AddTaxRateToAccountCommand() + var command = new AddAccountTaxRateConfigCommand() { AccountId = new Guid("248e0000-5dd4-0015-443b-08dcd98b545d"), TaxRateId = new Guid("08740000-3c36-7456-6f96-08dcfb48b915"), @@ -319,7 +319,7 @@ public async Task Add_AccountLinkedTaxRates_WithBadAccountId_404() var token = await GetAccessTokenAsync(TokenType.RW); _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); - var command = new AddTaxRateToAccountCommand() + var command = new AddAccountTaxRateConfigCommand() { AccountId = new Guid("60520000-5dd4-0015-5c21-08dcda58ab61"), TaxRateId = new Guid("08740000-3c36-7456-6f96-08dcfb48b915"), @@ -344,7 +344,7 @@ public async Task Add_AccountLinkedTaxRates_WithBadTaxRateId_404() var token = await GetAccessTokenAsync(TokenType.RW); _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); - var command = new AddTaxRateToAccountCommand() + var command = new AddAccountTaxRateConfigCommand() { AccountId = new Guid("ec860000-5dd4-0015-d472-08dcda1dc37c"), TaxRateId = new Guid("08740000-3c36-7456-6f96-08dcfb48b914"), @@ -369,7 +369,7 @@ public async Task Add_AccountLinkedTaxRates_WithBadTaxAccountId_404() var token = await GetAccessTokenAsync(TokenType.RW); _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); - var command = new AddTaxRateToAccountCommand() + var command = new AddAccountTaxRateConfigCommand() { AccountId = new Guid("60520000-5dd4-0015-5c21-08dcda58ab64"), TaxRateId = new Guid("08740000-3c36-7456-6f96-08dcfb48b915"), @@ -394,7 +394,7 @@ public async Task Add_AccountLinkedTaxRates_WithAlreadyExisting_400() var token = await GetAccessTokenAsync(TokenType.RW); _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); - var command = new AddTaxRateToAccountCommand() + var command = new AddAccountTaxRateConfigCommand() { AccountId = new Guid("4c6f0000-5dd4-0015-7cad-08dcda56e423"), TaxRateId = new Guid("08740000-3c36-7456-6f96-08dcfb48b915"), From 3cdc6e9500e6979e3f7bd3429208d90cfbb84650 Mon Sep 17 00:00:00 2001 From: ubik Date: Mon, 4 Nov 2024 20:26:30 +0100 Subject: [PATCH 38/94] Rename and account tax rate config delete operation. --- ...esData.cs => AccountTaxRateConfigsData.cs} | 4 +-- ...Data.sql => AccountTaxRateConfigsData.sql} | 0 .../Data/Init/DbInitializer.cs | 2 +- .../v1/AccountTaxRateConfigsController.cs} | 33 ++++++++++++++----- .../Errors/LinkedTaxRateAlreadyExist.cs | 2 +- .../Errors/LinkedTaxRateNotFoundError.cs | 2 +- .../AccountTaxRateConfigsCommandService.cs} | 11 +++---- .../AccountTaxRateConfigsQueryService.cs} | 8 ++--- .../IAccountTaxRateConfigsCommandService.cs} | 6 ++-- .../IAccountTaxRateConfigsQueryService.cs} | 4 +-- .../Mappers/AccountTaxRateConfigMappers.cs | 6 ++-- .../Program.cs | 6 ++-- .../Ubik.Accounting.SalesOrVatTax.Api.csproj | 2 +- .../AddAccountTaxRateConfigCommand.cs | 2 +- .../DeleteAccountTaxRateConfigCommand.cs | 2 +- .../Events/AccountTaxRateConfigAdded.cs | 2 +- .../Events/AccountTaxRateConfigDeleted.cs | 2 +- .../AccountTaxRateConfigStandardResult.cs | 2 +- 18 files changed, 55 insertions(+), 41 deletions(-) rename src/Ubik.Accounting.SalesOrVatTax.Api/Data/Init/{AccountLinkedTaxRatesData.cs => AccountTaxRateConfigsData.cs} (84%) rename src/Ubik.Accounting.SalesOrVatTax.Api/Data/Init/{AccountLinkedTaxRatesData.sql => AccountTaxRateConfigsData.sql} (100%) rename src/Ubik.Accounting.SalesOrVatTax.Api/Features/{AccountLinkedTaxRates/Controllers/v1/AccountLinkedTaxRatesController.cs => AccountTaxRateConfigs/Controllers/v1/AccountTaxRateConfigsController.cs} (64%) rename src/Ubik.Accounting.SalesOrVatTax.Api/Features/{AccountLinkedTaxRates => AccountTaxRateConfigs}/Errors/LinkedTaxRateAlreadyExist.cs (90%) rename src/Ubik.Accounting.SalesOrVatTax.Api/Features/{AccountLinkedTaxRates => AccountTaxRateConfigs}/Errors/LinkedTaxRateNotFoundError.cs (90%) rename src/Ubik.Accounting.SalesOrVatTax.Api/Features/{AccountLinkedTaxRates/Services/AccountLinkedTaxRatesCommandService.cs => AccountTaxRateConfigs/Services/AccountTaxRateConfigsCommandService.cs} (90%) rename src/Ubik.Accounting.SalesOrVatTax.Api/Features/{AccountLinkedTaxRates/Services/AccountLinkedTaxRatesQueryService.cs => AccountTaxRateConfigs/Services/AccountTaxRateConfigsQueryService.cs} (86%) rename src/Ubik.Accounting.SalesOrVatTax.Api/Features/{AccountLinkedTaxRates/Services/IAccountLinkedTaxRatesCommandService.cs => AccountTaxRateConfigs/Services/IAccountTaxRateConfigsCommandService.cs} (61%) rename src/Ubik.Accounting.SalesOrVatTax.Api/Features/{AccountLinkedTaxRates/Services/IAccountLinkedTaxRatesQueryService.cs => AccountTaxRateConfigs/Services/IAccountTaxRateConfigsQueryService.cs} (71%) rename src/Ubik.Accounting.SalesOrVatTax.Contracts/{AccountLinkedTaxRates => AccountTaxRateConfigs}/Commands/AddAccountTaxRateConfigCommand.cs (79%) rename src/Ubik.Accounting.SalesOrVatTax.Contracts/{AccountLinkedTaxRates => AccountTaxRateConfigs}/Commands/DeleteAccountTaxRateConfigCommand.cs (77%) rename src/Ubik.Accounting.SalesOrVatTax.Contracts/{AccountLinkedTaxRates => AccountTaxRateConfigs}/Events/AccountTaxRateConfigAdded.cs (83%) rename src/Ubik.Accounting.SalesOrVatTax.Contracts/{AccountLinkedTaxRates => AccountTaxRateConfigs}/Events/AccountTaxRateConfigDeleted.cs (73%) rename src/Ubik.Accounting.SalesOrVatTax.Contracts/{AccountLinkedTaxRates => AccountTaxRateConfigs}/Results/AccountTaxRateConfigStandardResult.cs (83%) diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Data/Init/AccountLinkedTaxRatesData.cs b/src/Ubik.Accounting.SalesOrVatTax.Api/Data/Init/AccountTaxRateConfigsData.cs similarity index 84% rename from src/Ubik.Accounting.SalesOrVatTax.Api/Data/Init/AccountLinkedTaxRatesData.cs rename to src/Ubik.Accounting.SalesOrVatTax.Api/Data/Init/AccountTaxRateConfigsData.cs index 165349c5..5db66478 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Api/Data/Init/AccountLinkedTaxRatesData.cs +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Data/Init/AccountTaxRateConfigsData.cs @@ -3,13 +3,13 @@ namespace Ubik.Accounting.SalesOrVatTax.Api.Data.Init { - internal static class AccountLinkedTaxRatesData + internal static class AccountTaxRateConfigsData { internal static async Task LoadAsync(AccountingSalesTaxDbContext context) { if (!context.AccountTaxRateConfigs.Any()) { - var query = await File.ReadAllTextAsync(@"Data/Init/AccountLinkedTaxRatesData.sql"); + var query = await File.ReadAllTextAsync(@"Data/Init/AccountTaxRateConfigsData.sql"); await context.Database.ExecuteSqlAsync(FormattableStringFactory.Create(query)); } } diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Data/Init/AccountLinkedTaxRatesData.sql b/src/Ubik.Accounting.SalesOrVatTax.Api/Data/Init/AccountTaxRateConfigsData.sql similarity index 100% rename from src/Ubik.Accounting.SalesOrVatTax.Api/Data/Init/AccountLinkedTaxRatesData.sql rename to src/Ubik.Accounting.SalesOrVatTax.Api/Data/Init/AccountTaxRateConfigsData.sql diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Data/Init/DbInitializer.cs b/src/Ubik.Accounting.SalesOrVatTax.Api/Data/Init/DbInitializer.cs index 9f353fb9..8288dd25 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Api/Data/Init/DbInitializer.cs +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Data/Init/DbInitializer.cs @@ -6,7 +6,7 @@ static internal async Task InitializeAsync(AccountingSalesTaxDbContext context) { await TaxRatesData.LoadAsync(context); await AccountsData.LoadAsync(context); - await AccountLinkedTaxRatesData.LoadAsync(context); + await AccountTaxRateConfigsData.LoadAsync(context); } } } diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountLinkedTaxRates/Controllers/v1/AccountLinkedTaxRatesController.cs b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountTaxRateConfigs/Controllers/v1/AccountTaxRateConfigsController.cs similarity index 64% rename from src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountLinkedTaxRates/Controllers/v1/AccountLinkedTaxRatesController.cs rename to src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountTaxRateConfigs/Controllers/v1/AccountTaxRateConfigsController.cs index 8072d909..0c96b25a 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountLinkedTaxRates/Controllers/v1/AccountLinkedTaxRatesController.cs +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountTaxRateConfigs/Controllers/v1/AccountTaxRateConfigsController.cs @@ -1,14 +1,11 @@ using Asp.Versioning; using Microsoft.AspNetCore.Mvc; -using Ubik.Accounting.SalesOrVatTax.Api.Features.AccountLinkedTaxRates.Services; +using Ubik.Accounting.SalesOrVatTax.Api.Features.AccountTaxRateConfigs.Services; using Ubik.Accounting.SalesOrVatTax.Api.Mappers; -using Ubik.Accounting.SalesOrVatTax.Contracts.AccountLinkedTaxRates.Commands; -using Ubik.Accounting.SalesOrVatTax.Contracts.AccountLinkedTaxRates.Events; -using Ubik.Accounting.SalesOrVatTax.Contracts.AccountLinkedTaxRates.Results; -using Ubik.Accounting.SalesOrVatTax.Contracts.SalesOrVatTaxRate.Results; +using Ubik.Accounting.SalesOrVatTax.Contracts.AccountTaxRateConfigs.Commands; +using Ubik.Accounting.SalesOrVatTax.Contracts.AccountTaxRateConfigs.Results; using Ubik.ApiService.Common.Errors; using Ubik.ApiService.Common.Exceptions; -using static Microsoft.EntityFrameworkCore.DbLoggerCategory.Database; namespace Ubik.Accounting.SalesOrVatTax.Api.Features.AccountLinkedTaxRates.Controllers.v1 { @@ -16,8 +13,8 @@ namespace Ubik.Accounting.SalesOrVatTax.Api.Features.AccountLinkedTaxRates.Contr [ApiController] [ApiVersion("1.0")] [Route("api/v{version:apiVersion}/accounts")] - public class AccountLinkedTaxRatesController(IAccountLinkedTaxRatesQueryService queryService, - IAccountLinkedTaxRatesCommandService commandService) : ControllerBase + public class AccountTaxRateConfigsController(IAccountTaxRateConfigsQueryService queryService, + IAccountTaxRateConfigsCommandService commandService) : ControllerBase { [HttpGet("{id}/taxrates")] [ProducesResponseType(200)] @@ -39,7 +36,7 @@ public async Task>> [ProducesResponseType(typeof(CustomProblemDetails), 404)] [ProducesResponseType(typeof(CustomProblemDetails), 409)] [ProducesResponseType(typeof(CustomProblemDetails), 500)] - public async Task> AddTaxRateToAccount + public async Task> AddAccountTaxRateConfig (Guid id, Guid taxRateId, AddAccountTaxRateConfigCommand command) { if (command.AccountId != id) @@ -56,5 +53,23 @@ public async Task> AddTaxRateTo Right: r => Ok(r.ToAccountTaxRateConfigStandardResult()), Left: err => new ObjectResult(err.ToValidationProblemDetails(HttpContext))); } + + [HttpDelete("{id}/taxrates/{taxRateId}")] + [ProducesResponseType(200)] + [ProducesResponseType(typeof(CustomProblemDetails), 400)] + [ProducesResponseType(typeof(CustomProblemDetails), 404)] + [ProducesResponseType(typeof(CustomProblemDetails), 500)] + public async Task> DeleteAccountTaxRateConfig(Guid id, Guid taxRateId) + { + var result = await commandService.DetachAsync(new DeleteAccountTaxRateConfigCommand() + { + AccountId = id, + TaxRateId = taxRateId + }); + + return result.Match( + Right: r => NoContent(), + Left: err => new ObjectResult(err.ToValidationProblemDetails(HttpContext))); + } } } diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountLinkedTaxRates/Errors/LinkedTaxRateAlreadyExist.cs b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountTaxRateConfigs/Errors/LinkedTaxRateAlreadyExist.cs similarity index 90% rename from src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountLinkedTaxRates/Errors/LinkedTaxRateAlreadyExist.cs rename to src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountTaxRateConfigs/Errors/LinkedTaxRateAlreadyExist.cs index 331fb788..c019e375 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountLinkedTaxRates/Errors/LinkedTaxRateAlreadyExist.cs +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountTaxRateConfigs/Errors/LinkedTaxRateAlreadyExist.cs @@ -1,6 +1,6 @@ using Ubik.ApiService.Common.Errors; -namespace Ubik.Accounting.SalesOrVatTax.Api.Features.AccountLinkedTaxRates.Errors +namespace Ubik.Accounting.SalesOrVatTax.Api.Features.AccountTaxRateConfigs.Errors { public record LinkedTaxRateAlreadyExist : IServiceAndFeatureError { diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountLinkedTaxRates/Errors/LinkedTaxRateNotFoundError.cs b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountTaxRateConfigs/Errors/LinkedTaxRateNotFoundError.cs similarity index 90% rename from src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountLinkedTaxRates/Errors/LinkedTaxRateNotFoundError.cs rename to src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountTaxRateConfigs/Errors/LinkedTaxRateNotFoundError.cs index 8a22c073..332998f3 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountLinkedTaxRates/Errors/LinkedTaxRateNotFoundError.cs +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountTaxRateConfigs/Errors/LinkedTaxRateNotFoundError.cs @@ -1,6 +1,6 @@ using Ubik.ApiService.Common.Errors; -namespace Ubik.Accounting.SalesOrVatTax.Api.Features.AccountLinkedTaxRates.Errors +namespace Ubik.Accounting.SalesOrVatTax.Api.Features.AccountTaxRateConfigs.Errors { public record LinkedTaxRateNotFoundError : IServiceAndFeatureError { diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountLinkedTaxRates/Services/AccountLinkedTaxRatesCommandService.cs b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountTaxRateConfigs/Services/AccountTaxRateConfigsCommandService.cs similarity index 90% rename from src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountLinkedTaxRates/Services/AccountLinkedTaxRatesCommandService.cs rename to src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountTaxRateConfigs/Services/AccountTaxRateConfigsCommandService.cs index f36bd5d0..333c6703 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountLinkedTaxRates/Services/AccountLinkedTaxRatesCommandService.cs +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountTaxRateConfigs/Services/AccountTaxRateConfigsCommandService.cs @@ -3,17 +3,16 @@ using MassTransit.Transports; using Microsoft.EntityFrameworkCore; using Ubik.Accounting.SalesOrVatTax.Api.Data; -using Ubik.Accounting.SalesOrVatTax.Api.Features.AccountLinkedTaxRates.Errors; +using Ubik.Accounting.SalesOrVatTax.Api.Features.AccountTaxRateConfigs.Errors; using Ubik.Accounting.SalesOrVatTax.Api.Mappers; using Ubik.Accounting.SalesOrVatTax.Api.Models; -using Ubik.Accounting.SalesOrVatTax.Contracts.AccountLinkedTaxRates.Commands; -using Ubik.Accounting.SalesOrVatTax.Contracts.AccountLinkedTaxRates.Events; -using Ubik.Accounting.SalesOrVatTax.Contracts.SalesOrVatTaxRate.Events; +using Ubik.Accounting.SalesOrVatTax.Contracts.AccountTaxRateConfigs.Commands; +using Ubik.Accounting.SalesOrVatTax.Contracts.AccountTaxRateConfigs.Events; using Ubik.ApiService.Common.Errors; -namespace Ubik.Accounting.SalesOrVatTax.Api.Features.AccountLinkedTaxRates.Services +namespace Ubik.Accounting.SalesOrVatTax.Api.Features.AccountTaxRateConfigs.Services { - public class AccountLinkedTaxRatesCommandService(AccountingSalesTaxDbContext ctx, IPublishEndpoint publishEndpoint) : IAccountLinkedTaxRatesCommandService + public class AccountTaxRateConfigsCommandService(AccountingSalesTaxDbContext ctx, IPublishEndpoint publishEndpoint) : IAccountTaxRateConfigsCommandService { public async Task> AttachAsync(AddAccountTaxRateConfigCommand command) { diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountLinkedTaxRates/Services/AccountLinkedTaxRatesQueryService.cs b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountTaxRateConfigs/Services/AccountTaxRateConfigsQueryService.cs similarity index 86% rename from src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountLinkedTaxRates/Services/AccountLinkedTaxRatesQueryService.cs rename to src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountTaxRateConfigs/Services/AccountTaxRateConfigsQueryService.cs index e07f9ebc..cba93ffd 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountLinkedTaxRates/Services/AccountLinkedTaxRatesQueryService.cs +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountTaxRateConfigs/Services/AccountTaxRateConfigsQueryService.cs @@ -2,15 +2,15 @@ using LanguageExt; using Microsoft.EntityFrameworkCore; using Ubik.Accounting.SalesOrVatTax.Api.Data; -using Ubik.Accounting.SalesOrVatTax.Api.Features.AccountLinkedTaxRates.Errors; +using Ubik.Accounting.SalesOrVatTax.Api.Features.AccountTaxRateConfigs.Errors; using Ubik.Accounting.SalesOrVatTax.Api.Models; using Ubik.ApiService.Common.Errors; using Ubik.ApiService.Common.Services; -namespace Ubik.Accounting.SalesOrVatTax.Api.Features.AccountLinkedTaxRates.Services +namespace Ubik.Accounting.SalesOrVatTax.Api.Features.AccountTaxRateConfigs.Services { - public class AccountLinkedTaxRatesQueryService(AccountingSalesTaxDbContext ctx) - : IAccountLinkedTaxRatesQueryService + public class AccountTaxRateConfigsQueryService(AccountingSalesTaxDbContext ctx) + : IAccountTaxRateConfigsQueryService { public async Task>> GetAllAsync(Guid accountId) { diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountLinkedTaxRates/Services/IAccountLinkedTaxRatesCommandService.cs b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountTaxRateConfigs/Services/IAccountTaxRateConfigsCommandService.cs similarity index 61% rename from src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountLinkedTaxRates/Services/IAccountLinkedTaxRatesCommandService.cs rename to src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountTaxRateConfigs/Services/IAccountTaxRateConfigsCommandService.cs index e6d54345..d7e53356 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountLinkedTaxRates/Services/IAccountLinkedTaxRatesCommandService.cs +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountTaxRateConfigs/Services/IAccountTaxRateConfigsCommandService.cs @@ -1,11 +1,11 @@ using LanguageExt; using Ubik.Accounting.SalesOrVatTax.Api.Models; -using Ubik.Accounting.SalesOrVatTax.Contracts.AccountLinkedTaxRates.Commands; +using Ubik.Accounting.SalesOrVatTax.Contracts.AccountTaxRateConfigs.Commands; using Ubik.ApiService.Common.Errors; -namespace Ubik.Accounting.SalesOrVatTax.Api.Features.AccountLinkedTaxRates.Services +namespace Ubik.Accounting.SalesOrVatTax.Api.Features.AccountTaxRateConfigs.Services { - public interface IAccountLinkedTaxRatesCommandService + public interface IAccountTaxRateConfigsCommandService { Task> AttachAsync(AddAccountTaxRateConfigCommand command); Task> DetachAsync(DeleteAccountTaxRateConfigCommand command); diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountLinkedTaxRates/Services/IAccountLinkedTaxRatesQueryService.cs b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountTaxRateConfigs/Services/IAccountTaxRateConfigsQueryService.cs similarity index 71% rename from src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountLinkedTaxRates/Services/IAccountLinkedTaxRatesQueryService.cs rename to src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountTaxRateConfigs/Services/IAccountTaxRateConfigsQueryService.cs index 8f530998..5052329c 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountLinkedTaxRates/Services/IAccountLinkedTaxRatesQueryService.cs +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountTaxRateConfigs/Services/IAccountTaxRateConfigsQueryService.cs @@ -2,9 +2,9 @@ using Ubik.Accounting.SalesOrVatTax.Api.Models; using Ubik.ApiService.Common.Errors; -namespace Ubik.Accounting.SalesOrVatTax.Api.Features.AccountLinkedTaxRates.Services +namespace Ubik.Accounting.SalesOrVatTax.Api.Features.AccountTaxRateConfigs.Services { - public interface IAccountLinkedTaxRatesQueryService + public interface IAccountTaxRateConfigsQueryService { Task>> GetAllAsync(Guid accountId); Task> GetAsync(Guid accountId, Guid taxRateId); diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Mappers/AccountTaxRateConfigMappers.cs b/src/Ubik.Accounting.SalesOrVatTax.Api/Mappers/AccountTaxRateConfigMappers.cs index 4118f3a9..81871e12 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Api/Mappers/AccountTaxRateConfigMappers.cs +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Mappers/AccountTaxRateConfigMappers.cs @@ -1,8 +1,8 @@ using MassTransit; using Ubik.Accounting.SalesOrVatTax.Api.Models; -using Ubik.Accounting.SalesOrVatTax.Contracts.AccountLinkedTaxRates.Commands; -using Ubik.Accounting.SalesOrVatTax.Contracts.AccountLinkedTaxRates.Events; -using Ubik.Accounting.SalesOrVatTax.Contracts.AccountLinkedTaxRates.Results; +using Ubik.Accounting.SalesOrVatTax.Contracts.AccountTaxRateConfigs.Commands; +using Ubik.Accounting.SalesOrVatTax.Contracts.AccountTaxRateConfigs.Events; +using Ubik.Accounting.SalesOrVatTax.Contracts.AccountTaxRateConfigs.Results; using Ubik.Accounting.SalesOrVatTax.Contracts.SalesOrVatTaxRate.Commands; namespace Ubik.Accounting.SalesOrVatTax.Api.Mappers diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Program.cs b/src/Ubik.Accounting.SalesOrVatTax.Api/Program.cs index 7ef52910..be3bee05 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Api/Program.cs +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Program.cs @@ -7,7 +7,7 @@ using System.Text.Json.Serialization; using Ubik.Accounting.SalesOrVatTax.Api.Data; using Ubik.Accounting.SalesOrVatTax.Api.Data.Init; -using Ubik.Accounting.SalesOrVatTax.Api.Features.AccountLinkedTaxRates.Services; +using Ubik.Accounting.SalesOrVatTax.Api.Features.AccountTaxRateConfigs.Services; using Ubik.Accounting.SalesOrVatTax.Api.Features.Application.Services; using Ubik.Accounting.SalesOrVatTax.Api.Features.TaxRates.Services; using Ubik.ApiService.Common.Configure; @@ -98,8 +98,8 @@ builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); -builder.Services.AddScoped(); -builder.Services.AddScoped(); +builder.Services.AddScoped(); +builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddTransient(); diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Ubik.Accounting.SalesOrVatTax.Api.csproj b/src/Ubik.Accounting.SalesOrVatTax.Api/Ubik.Accounting.SalesOrVatTax.Api.csproj index 07e25169..caf0dbf6 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Api/Ubik.Accounting.SalesOrVatTax.Api.csproj +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Ubik.Accounting.SalesOrVatTax.Api.csproj @@ -34,7 +34,7 @@ - + Always diff --git a/src/Ubik.Accounting.SalesOrVatTax.Contracts/AccountLinkedTaxRates/Commands/AddAccountTaxRateConfigCommand.cs b/src/Ubik.Accounting.SalesOrVatTax.Contracts/AccountTaxRateConfigs/Commands/AddAccountTaxRateConfigCommand.cs similarity index 79% rename from src/Ubik.Accounting.SalesOrVatTax.Contracts/AccountLinkedTaxRates/Commands/AddAccountTaxRateConfigCommand.cs rename to src/Ubik.Accounting.SalesOrVatTax.Contracts/AccountTaxRateConfigs/Commands/AddAccountTaxRateConfigCommand.cs index 69014543..e40f586d 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Contracts/AccountLinkedTaxRates/Commands/AddAccountTaxRateConfigCommand.cs +++ b/src/Ubik.Accounting.SalesOrVatTax.Contracts/AccountTaxRateConfigs/Commands/AddAccountTaxRateConfigCommand.cs @@ -4,7 +4,7 @@ using System.Text; using System.Threading.Tasks; -namespace Ubik.Accounting.SalesOrVatTax.Contracts.AccountLinkedTaxRates.Commands +namespace Ubik.Accounting.SalesOrVatTax.Contracts.AccountTaxRateConfigs.Commands { public record AddAccountTaxRateConfigCommand { diff --git a/src/Ubik.Accounting.SalesOrVatTax.Contracts/AccountLinkedTaxRates/Commands/DeleteAccountTaxRateConfigCommand.cs b/src/Ubik.Accounting.SalesOrVatTax.Contracts/AccountTaxRateConfigs/Commands/DeleteAccountTaxRateConfigCommand.cs similarity index 77% rename from src/Ubik.Accounting.SalesOrVatTax.Contracts/AccountLinkedTaxRates/Commands/DeleteAccountTaxRateConfigCommand.cs rename to src/Ubik.Accounting.SalesOrVatTax.Contracts/AccountTaxRateConfigs/Commands/DeleteAccountTaxRateConfigCommand.cs index 71120688..0f114516 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Contracts/AccountLinkedTaxRates/Commands/DeleteAccountTaxRateConfigCommand.cs +++ b/src/Ubik.Accounting.SalesOrVatTax.Contracts/AccountTaxRateConfigs/Commands/DeleteAccountTaxRateConfigCommand.cs @@ -4,7 +4,7 @@ using System.Text; using System.Threading.Tasks; -namespace Ubik.Accounting.SalesOrVatTax.Contracts.AccountLinkedTaxRates.Commands +namespace Ubik.Accounting.SalesOrVatTax.Contracts.AccountTaxRateConfigs.Commands { public record DeleteAccountTaxRateConfigCommand { diff --git a/src/Ubik.Accounting.SalesOrVatTax.Contracts/AccountLinkedTaxRates/Events/AccountTaxRateConfigAdded.cs b/src/Ubik.Accounting.SalesOrVatTax.Contracts/AccountTaxRateConfigs/Events/AccountTaxRateConfigAdded.cs similarity index 83% rename from src/Ubik.Accounting.SalesOrVatTax.Contracts/AccountLinkedTaxRates/Events/AccountTaxRateConfigAdded.cs rename to src/Ubik.Accounting.SalesOrVatTax.Contracts/AccountTaxRateConfigs/Events/AccountTaxRateConfigAdded.cs index 29a1a628..1676c1d8 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Contracts/AccountLinkedTaxRates/Events/AccountTaxRateConfigAdded.cs +++ b/src/Ubik.Accounting.SalesOrVatTax.Contracts/AccountTaxRateConfigs/Events/AccountTaxRateConfigAdded.cs @@ -4,7 +4,7 @@ using System.Text; using System.Threading.Tasks; -namespace Ubik.Accounting.SalesOrVatTax.Contracts.AccountLinkedTaxRates.Events +namespace Ubik.Accounting.SalesOrVatTax.Contracts.AccountTaxRateConfigs.Events { public record AccountTaxRateConfigAdded { diff --git a/src/Ubik.Accounting.SalesOrVatTax.Contracts/AccountLinkedTaxRates/Events/AccountTaxRateConfigDeleted.cs b/src/Ubik.Accounting.SalesOrVatTax.Contracts/AccountTaxRateConfigs/Events/AccountTaxRateConfigDeleted.cs similarity index 73% rename from src/Ubik.Accounting.SalesOrVatTax.Contracts/AccountLinkedTaxRates/Events/AccountTaxRateConfigDeleted.cs rename to src/Ubik.Accounting.SalesOrVatTax.Contracts/AccountTaxRateConfigs/Events/AccountTaxRateConfigDeleted.cs index f60c8145..7451d8d9 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Contracts/AccountLinkedTaxRates/Events/AccountTaxRateConfigDeleted.cs +++ b/src/Ubik.Accounting.SalesOrVatTax.Contracts/AccountTaxRateConfigs/Events/AccountTaxRateConfigDeleted.cs @@ -4,7 +4,7 @@ using System.Text; using System.Threading.Tasks; -namespace Ubik.Accounting.SalesOrVatTax.Contracts.AccountLinkedTaxRates.Events +namespace Ubik.Accounting.SalesOrVatTax.Contracts.AccountTaxRateConfigs.Events { public record AccountTaxRateConfigDeleted { diff --git a/src/Ubik.Accounting.SalesOrVatTax.Contracts/AccountLinkedTaxRates/Results/AccountTaxRateConfigStandardResult.cs b/src/Ubik.Accounting.SalesOrVatTax.Contracts/AccountTaxRateConfigs/Results/AccountTaxRateConfigStandardResult.cs similarity index 83% rename from src/Ubik.Accounting.SalesOrVatTax.Contracts/AccountLinkedTaxRates/Results/AccountTaxRateConfigStandardResult.cs rename to src/Ubik.Accounting.SalesOrVatTax.Contracts/AccountTaxRateConfigs/Results/AccountTaxRateConfigStandardResult.cs index 19267238..48da5b05 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Contracts/AccountLinkedTaxRates/Results/AccountTaxRateConfigStandardResult.cs +++ b/src/Ubik.Accounting.SalesOrVatTax.Contracts/AccountTaxRateConfigs/Results/AccountTaxRateConfigStandardResult.cs @@ -4,7 +4,7 @@ using System.Text; using System.Threading.Tasks; -namespace Ubik.Accounting.SalesOrVatTax.Contracts.AccountLinkedTaxRates.Results +namespace Ubik.Accounting.SalesOrVatTax.Contracts.AccountTaxRateConfigs.Results { public record AccountTaxRateConfigStandardResult { From 0b17697ca60d176d0a2f155c6a4dadadfd769e2b Mon Sep 17 00:00:00 2001 From: ubik Date: Mon, 4 Nov 2024 20:28:01 +0100 Subject: [PATCH 39/94] Renaming --- ...teAlreadyExist.cs => AccountTaxRateConfigAlreadyExists.cs} | 4 ++-- ...eNotFoundError.cs => AccountTaxRateConfigNotFoundError.cs} | 4 ++-- .../Services/AccountTaxRateConfigsCommandService.cs | 2 +- .../Services/AccountTaxRateConfigsQueryService.cs | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) rename src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountTaxRateConfigs/Errors/{LinkedTaxRateAlreadyExist.cs => AccountTaxRateConfigAlreadyExists.cs} (81%) rename src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountTaxRateConfigs/Errors/{LinkedTaxRateNotFoundError.cs => AccountTaxRateConfigNotFoundError.cs} (81%) diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountTaxRateConfigs/Errors/LinkedTaxRateAlreadyExist.cs b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountTaxRateConfigs/Errors/AccountTaxRateConfigAlreadyExists.cs similarity index 81% rename from src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountTaxRateConfigs/Errors/LinkedTaxRateAlreadyExist.cs rename to src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountTaxRateConfigs/Errors/AccountTaxRateConfigAlreadyExists.cs index c019e375..766ab8de 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountTaxRateConfigs/Errors/LinkedTaxRateAlreadyExist.cs +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountTaxRateConfigs/Errors/AccountTaxRateConfigAlreadyExists.cs @@ -2,12 +2,12 @@ namespace Ubik.Accounting.SalesOrVatTax.Api.Features.AccountTaxRateConfigs.Errors { - public record LinkedTaxRateAlreadyExist : IServiceAndFeatureError + public record AccountTaxRateConfigAlreadyExists : IServiceAndFeatureError { public ServiceAndFeatureErrorType ErrorType { get; init; } public List CustomErrors { get; init; } - public LinkedTaxRateAlreadyExist(Guid accountId, Guid taxRateId) + public AccountTaxRateConfigAlreadyExists(Guid accountId, Guid taxRateId) { ErrorType = ServiceAndFeatureErrorType.BadParams; diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountTaxRateConfigs/Errors/LinkedTaxRateNotFoundError.cs b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountTaxRateConfigs/Errors/AccountTaxRateConfigNotFoundError.cs similarity index 81% rename from src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountTaxRateConfigs/Errors/LinkedTaxRateNotFoundError.cs rename to src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountTaxRateConfigs/Errors/AccountTaxRateConfigNotFoundError.cs index 332998f3..cdccce59 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountTaxRateConfigs/Errors/LinkedTaxRateNotFoundError.cs +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountTaxRateConfigs/Errors/AccountTaxRateConfigNotFoundError.cs @@ -2,12 +2,12 @@ namespace Ubik.Accounting.SalesOrVatTax.Api.Features.AccountTaxRateConfigs.Errors { - public record LinkedTaxRateNotFoundError : IServiceAndFeatureError + public record AccountTaxRateConfigNotFoundError : IServiceAndFeatureError { public ServiceAndFeatureErrorType ErrorType { get; init; } public List CustomErrors { get; init; } - public LinkedTaxRateNotFoundError(Guid accountId, Guid taxRateId) + public AccountTaxRateConfigNotFoundError(Guid accountId, Guid taxRateId) { ErrorType = ServiceAndFeatureErrorType.NotFound; diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountTaxRateConfigs/Services/AccountTaxRateConfigsCommandService.cs b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountTaxRateConfigs/Services/AccountTaxRateConfigsCommandService.cs index 333c6703..75ab19a8 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountTaxRateConfigs/Services/AccountTaxRateConfigsCommandService.cs +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountTaxRateConfigs/Services/AccountTaxRateConfigsCommandService.cs @@ -80,7 +80,7 @@ private async Task> ValidateIfLinkNotAlrea && x.TaxRateId == taxRateId); return result - ? new LinkedTaxRateAlreadyExist(accountId, taxRateId) + ? new AccountTaxRateConfigAlreadyExists(accountId, taxRateId) : true; } diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountTaxRateConfigs/Services/AccountTaxRateConfigsQueryService.cs b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountTaxRateConfigs/Services/AccountTaxRateConfigsQueryService.cs index cba93ffd..8eb8bf5b 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountTaxRateConfigs/Services/AccountTaxRateConfigsQueryService.cs +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountTaxRateConfigs/Services/AccountTaxRateConfigsQueryService.cs @@ -34,7 +34,7 @@ private async Task> GetAcc var result = await ctx.AccountTaxRateConfigs.Where(c => c.AccountId == accountId && c.TaxRateId == taxRateId).FirstOrDefaultAsync(); return result == null - ? new LinkedTaxRateNotFoundError(accountId, taxRateId) + ? new AccountTaxRateConfigNotFoundError(accountId, taxRateId) : result; } From f1bf809a933543397cc88ca7cf785f9c21a9d4a3 Mon Sep 17 00:00:00 2001 From: ubik Date: Mon, 4 Nov 2024 20:31:42 +0100 Subject: [PATCH 40/94] comment --- .../Components/Accounts/AccountConfirmDelete.razor | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Ubik.Accounting.WebApp.Client/Components/Accounts/AccountConfirmDelete.razor b/src/Ubik.Accounting.WebApp.Client/Components/Accounts/AccountConfirmDelete.razor index 0f08ca2b..0aeb449e 100644 --- a/src/Ubik.Accounting.WebApp.Client/Components/Accounts/AccountConfirmDelete.razor +++ b/src/Ubik.Accounting.WebApp.Client/Components/Accounts/AccountConfirmDelete.razor @@ -29,7 +29,9 @@ //Strange, need to be call befor showing the window. Because it seems that when it is not a form with a submit action. //The component keep other children compo status in mem... => it's a bit strange - //TODO: study that to do it better, maybe I don't undestand something in the render pipepline + //TODO: (SetParametersAync, will maybe do the trick) + //study that to do it better, maybe I don't undestand something in the render pipepline + public async Task SetInitialStatus() { await _successMsg.HideSuccessAsync(); From 562b725b6959758d062be94b72a472f95591fedc Mon Sep 17 00:00:00 2001 From: ubik Date: Tue, 5 Nov 2024 08:09:34 +0100 Subject: [PATCH 41/94] Remove not used using --- .../Services/AccountTaxRateConfigsCommandService.cs | 1 - .../Services/AccountTaxRateConfigsQueryService.cs | 4 +--- .../Mappers/AccountTaxRateConfigMappers.cs | 1 - src/Ubik.Accounting.SalesOrVatTax.Api/Program.cs | 1 - .../Commands/AddAccountTaxRateConfigCommand.cs | 8 +------- .../Commands/DeleteAccountTaxRateConfigCommand.cs | 8 +------- .../Events/AccountTaxRateConfigAdded.cs | 8 +------- .../Events/AccountTaxRateConfigDeleted.cs | 8 +------- .../Results/AccountTaxRateConfigStandardResult.cs | 8 +------- .../Commands/AddSalesOrVatTaxRateCommand.cs | 7 +------ .../Commands/UpdateSalesOrVatTaxRateCommand.cs | 7 +------ .../Events/SalesOrVatTaxRateAdded.cs | 8 +------- .../Events/SalesOrVatTaxRateDeleted.cs | 8 +------- .../Events/SalesOrVatTaxRateUpdated.cs | 8 +------- .../Results/SalesOrVatTaxRateStandardResult.cs | 8 +------- .../Data/Config/EntryConfiguration.cs | 6 +----- .../Data/Config/TransactionConfiguration.cs | 6 +----- .../Services/AccountGroupCommandService.cs | 1 - .../Accounts/Controller/v1/AccountsController.cs | 1 - .../Accounts/Services/AccountCommandService.cs | 1 - .../Controller/v1/ClassificationsController.cs | 1 - .../Services/ClassificationCommandService.cs | 1 - .../Mappers/ClassificationMappers.cs | 1 - src/Ubik.Accounting.Structure.Api/Models/Entry.cs | 5 +---- .../Models/Transaction.cs | 4 +--- src/Ubik.Accounting.Structure.Api/Program.cs | 4 ---- .../Results/AccountGroupStandardResult.cs | 8 +------- .../Accounts/Results/AccountGroupLinkResult.cs | 8 +------- .../Accounts/Results/AccountStandardResult.cs | 7 +------ .../Classifications/Events/ClassificationDeleted.cs | 3 +-- .../ApiClients/AccountingApiClient.cs | 3 +-- src/Ubik.Accounting.WebApp/Program.cs | 1 - .../Security/TokenCacheService.cs | 2 -- src/Ubik.Accounting.WebApp/Security/UserService.cs | 11 +---------- .../Classifications/Models/AccountGroupModel.cs | 1 - .../Features/Classifications/Models/AccountModel.cs | 1 - src/Ubik.CodeGenerator/ContractsGenerator.cs | 1 - src/Ubik.CodeGenerator/ControllerGenerator.cs | 1 - src/Ubik.CodeGenerator/MappersGenerator.cs | 2 -- src/Ubik.CodeGenerator/ServicesGenerator.cs | 1 - .../Services/RolesAuthorizationsCommandsService.cs | 1 - .../Tenants/Services/TenantsCommandsService.cs | 1 - .../Features/Users/Services/UsersCommandsService.cs | 3 --- src/Ubik.Security.Api/Program.cs | 2 -- .../Users/Events/UserRoleAddedToTenant.cs | 8 +------- .../Ubik.Api.Tests.Integration/BaseIntegrationTest.cs | 1 - .../BaseIntegrationTestAccountingSalesVatTax.cs | 7 +------ .../BaseIntegrationTestAccountingStruct.cs | 7 +------ .../BaseIntegrationTestSecurity.cs | 7 +------ .../AccountingLinkedTaxRatesController_Test.cs | 11 ++--------- .../SalesOrVatTax/TaxRates/TaxRatesController_Test.cs | 5 ----- .../AccountGroups/AccountGroupsController_Test.cs | 7 ------- .../Struct/Accounts/AccountsController_Test.cs | 5 ----- .../Classifications/ClassificationsController_Test.cs | 6 ------ .../Struct/Currencies/CurrenciesController_Test.cs | 6 ------ .../Security/Tenants/TenantAdminController_Test.cs | 5 ----- 56 files changed, 28 insertions(+), 228 deletions(-) diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountTaxRateConfigs/Services/AccountTaxRateConfigsCommandService.cs b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountTaxRateConfigs/Services/AccountTaxRateConfigsCommandService.cs index 75ab19a8..55bd8820 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountTaxRateConfigs/Services/AccountTaxRateConfigsCommandService.cs +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountTaxRateConfigs/Services/AccountTaxRateConfigsCommandService.cs @@ -1,6 +1,5 @@ using LanguageExt; using MassTransit; -using MassTransit.Transports; using Microsoft.EntityFrameworkCore; using Ubik.Accounting.SalesOrVatTax.Api.Data; using Ubik.Accounting.SalesOrVatTax.Api.Features.AccountTaxRateConfigs.Errors; diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountTaxRateConfigs/Services/AccountTaxRateConfigsQueryService.cs b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountTaxRateConfigs/Services/AccountTaxRateConfigsQueryService.cs index 8eb8bf5b..849689b3 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountTaxRateConfigs/Services/AccountTaxRateConfigsQueryService.cs +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountTaxRateConfigs/Services/AccountTaxRateConfigsQueryService.cs @@ -1,11 +1,9 @@ -using Dapper; -using LanguageExt; +using LanguageExt; using Microsoft.EntityFrameworkCore; using Ubik.Accounting.SalesOrVatTax.Api.Data; using Ubik.Accounting.SalesOrVatTax.Api.Features.AccountTaxRateConfigs.Errors; using Ubik.Accounting.SalesOrVatTax.Api.Models; using Ubik.ApiService.Common.Errors; -using Ubik.ApiService.Common.Services; namespace Ubik.Accounting.SalesOrVatTax.Api.Features.AccountTaxRateConfigs.Services { diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Mappers/AccountTaxRateConfigMappers.cs b/src/Ubik.Accounting.SalesOrVatTax.Api/Mappers/AccountTaxRateConfigMappers.cs index 81871e12..540eeccf 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Api/Mappers/AccountTaxRateConfigMappers.cs +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Mappers/AccountTaxRateConfigMappers.cs @@ -3,7 +3,6 @@ using Ubik.Accounting.SalesOrVatTax.Contracts.AccountTaxRateConfigs.Commands; using Ubik.Accounting.SalesOrVatTax.Contracts.AccountTaxRateConfigs.Events; using Ubik.Accounting.SalesOrVatTax.Contracts.AccountTaxRateConfigs.Results; -using Ubik.Accounting.SalesOrVatTax.Contracts.SalesOrVatTaxRate.Commands; namespace Ubik.Accounting.SalesOrVatTax.Api.Mappers { diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Program.cs b/src/Ubik.Accounting.SalesOrVatTax.Api/Program.cs index be3bee05..889d8563 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Api/Program.cs +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Program.cs @@ -1,5 +1,4 @@ using MassTransit; -using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.Infrastructure; using Microsoft.EntityFrameworkCore; diff --git a/src/Ubik.Accounting.SalesOrVatTax.Contracts/AccountTaxRateConfigs/Commands/AddAccountTaxRateConfigCommand.cs b/src/Ubik.Accounting.SalesOrVatTax.Contracts/AccountTaxRateConfigs/Commands/AddAccountTaxRateConfigCommand.cs index e40f586d..c197a4da 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Contracts/AccountTaxRateConfigs/Commands/AddAccountTaxRateConfigCommand.cs +++ b/src/Ubik.Accounting.SalesOrVatTax.Contracts/AccountTaxRateConfigs/Commands/AddAccountTaxRateConfigCommand.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Ubik.Accounting.SalesOrVatTax.Contracts.AccountTaxRateConfigs.Commands +namespace Ubik.Accounting.SalesOrVatTax.Contracts.AccountTaxRateConfigs.Commands { public record AddAccountTaxRateConfigCommand { diff --git a/src/Ubik.Accounting.SalesOrVatTax.Contracts/AccountTaxRateConfigs/Commands/DeleteAccountTaxRateConfigCommand.cs b/src/Ubik.Accounting.SalesOrVatTax.Contracts/AccountTaxRateConfigs/Commands/DeleteAccountTaxRateConfigCommand.cs index 0f114516..00bb000c 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Contracts/AccountTaxRateConfigs/Commands/DeleteAccountTaxRateConfigCommand.cs +++ b/src/Ubik.Accounting.SalesOrVatTax.Contracts/AccountTaxRateConfigs/Commands/DeleteAccountTaxRateConfigCommand.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Ubik.Accounting.SalesOrVatTax.Contracts.AccountTaxRateConfigs.Commands +namespace Ubik.Accounting.SalesOrVatTax.Contracts.AccountTaxRateConfigs.Commands { public record DeleteAccountTaxRateConfigCommand { diff --git a/src/Ubik.Accounting.SalesOrVatTax.Contracts/AccountTaxRateConfigs/Events/AccountTaxRateConfigAdded.cs b/src/Ubik.Accounting.SalesOrVatTax.Contracts/AccountTaxRateConfigs/Events/AccountTaxRateConfigAdded.cs index 1676c1d8..1c73ef43 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Contracts/AccountTaxRateConfigs/Events/AccountTaxRateConfigAdded.cs +++ b/src/Ubik.Accounting.SalesOrVatTax.Contracts/AccountTaxRateConfigs/Events/AccountTaxRateConfigAdded.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Ubik.Accounting.SalesOrVatTax.Contracts.AccountTaxRateConfigs.Events +namespace Ubik.Accounting.SalesOrVatTax.Contracts.AccountTaxRateConfigs.Events { public record AccountTaxRateConfigAdded { diff --git a/src/Ubik.Accounting.SalesOrVatTax.Contracts/AccountTaxRateConfigs/Events/AccountTaxRateConfigDeleted.cs b/src/Ubik.Accounting.SalesOrVatTax.Contracts/AccountTaxRateConfigs/Events/AccountTaxRateConfigDeleted.cs index 7451d8d9..87cdc2ca 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Contracts/AccountTaxRateConfigs/Events/AccountTaxRateConfigDeleted.cs +++ b/src/Ubik.Accounting.SalesOrVatTax.Contracts/AccountTaxRateConfigs/Events/AccountTaxRateConfigDeleted.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Ubik.Accounting.SalesOrVatTax.Contracts.AccountTaxRateConfigs.Events +namespace Ubik.Accounting.SalesOrVatTax.Contracts.AccountTaxRateConfigs.Events { public record AccountTaxRateConfigDeleted { diff --git a/src/Ubik.Accounting.SalesOrVatTax.Contracts/AccountTaxRateConfigs/Results/AccountTaxRateConfigStandardResult.cs b/src/Ubik.Accounting.SalesOrVatTax.Contracts/AccountTaxRateConfigs/Results/AccountTaxRateConfigStandardResult.cs index 48da5b05..5033de9a 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Contracts/AccountTaxRateConfigs/Results/AccountTaxRateConfigStandardResult.cs +++ b/src/Ubik.Accounting.SalesOrVatTax.Contracts/AccountTaxRateConfigs/Results/AccountTaxRateConfigStandardResult.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Ubik.Accounting.SalesOrVatTax.Contracts.AccountTaxRateConfigs.Results +namespace Ubik.Accounting.SalesOrVatTax.Contracts.AccountTaxRateConfigs.Results { public record AccountTaxRateConfigStandardResult { diff --git a/src/Ubik.Accounting.SalesOrVatTax.Contracts/SalesOrVatTaxRate/Commands/AddSalesOrVatTaxRateCommand.cs b/src/Ubik.Accounting.SalesOrVatTax.Contracts/SalesOrVatTaxRate/Commands/AddSalesOrVatTaxRateCommand.cs index b55694b7..b1080254 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Contracts/SalesOrVatTaxRate/Commands/AddSalesOrVatTaxRateCommand.cs +++ b/src/Ubik.Accounting.SalesOrVatTax.Contracts/SalesOrVatTaxRate/Commands/AddSalesOrVatTaxRateCommand.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System.ComponentModel.DataAnnotations; namespace Ubik.Accounting.SalesOrVatTax.Contracts.SalesOrVatTaxRate.Commands { diff --git a/src/Ubik.Accounting.SalesOrVatTax.Contracts/SalesOrVatTaxRate/Commands/UpdateSalesOrVatTaxRateCommand.cs b/src/Ubik.Accounting.SalesOrVatTax.Contracts/SalesOrVatTaxRate/Commands/UpdateSalesOrVatTaxRateCommand.cs index 66b4faa0..627905e6 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Contracts/SalesOrVatTaxRate/Commands/UpdateSalesOrVatTaxRateCommand.cs +++ b/src/Ubik.Accounting.SalesOrVatTax.Contracts/SalesOrVatTaxRate/Commands/UpdateSalesOrVatTaxRateCommand.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System.ComponentModel.DataAnnotations; namespace Ubik.Accounting.SalesOrVatTax.Contracts.SalesOrVatTaxRate.Commands { diff --git a/src/Ubik.Accounting.SalesOrVatTax.Contracts/SalesOrVatTaxRate/Events/SalesOrVatTaxRateAdded.cs b/src/Ubik.Accounting.SalesOrVatTax.Contracts/SalesOrVatTaxRate/Events/SalesOrVatTaxRateAdded.cs index 3ae3c320..2a34abcf 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Contracts/SalesOrVatTaxRate/Events/SalesOrVatTaxRateAdded.cs +++ b/src/Ubik.Accounting.SalesOrVatTax.Contracts/SalesOrVatTaxRate/Events/SalesOrVatTaxRateAdded.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Ubik.Accounting.SalesOrVatTax.Contracts.SalesOrVatTaxRate.Events +namespace Ubik.Accounting.SalesOrVatTax.Contracts.SalesOrVatTaxRate.Events { public record SalesOrVatTaxRateAdded { diff --git a/src/Ubik.Accounting.SalesOrVatTax.Contracts/SalesOrVatTaxRate/Events/SalesOrVatTaxRateDeleted.cs b/src/Ubik.Accounting.SalesOrVatTax.Contracts/SalesOrVatTaxRate/Events/SalesOrVatTaxRateDeleted.cs index c919b04f..568d28e8 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Contracts/SalesOrVatTaxRate/Events/SalesOrVatTaxRateDeleted.cs +++ b/src/Ubik.Accounting.SalesOrVatTax.Contracts/SalesOrVatTaxRate/Events/SalesOrVatTaxRateDeleted.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Ubik.Accounting.SalesOrVatTax.Contracts.SalesOrVatTaxRate.Events +namespace Ubik.Accounting.SalesOrVatTax.Contracts.SalesOrVatTaxRate.Events { public record SalesOrVatTaxRateDeleted { diff --git a/src/Ubik.Accounting.SalesOrVatTax.Contracts/SalesOrVatTaxRate/Events/SalesOrVatTaxRateUpdated.cs b/src/Ubik.Accounting.SalesOrVatTax.Contracts/SalesOrVatTaxRate/Events/SalesOrVatTaxRateUpdated.cs index 3b55e5c3..11ca1f34 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Contracts/SalesOrVatTaxRate/Events/SalesOrVatTaxRateUpdated.cs +++ b/src/Ubik.Accounting.SalesOrVatTax.Contracts/SalesOrVatTaxRate/Events/SalesOrVatTaxRateUpdated.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Ubik.Accounting.SalesOrVatTax.Contracts.SalesOrVatTaxRate.Events +namespace Ubik.Accounting.SalesOrVatTax.Contracts.SalesOrVatTaxRate.Events { public record SalesOrVatTaxRateUpdated { diff --git a/src/Ubik.Accounting.SalesOrVatTax.Contracts/SalesOrVatTaxRate/Results/SalesOrVatTaxRateStandardResult.cs b/src/Ubik.Accounting.SalesOrVatTax.Contracts/SalesOrVatTaxRate/Results/SalesOrVatTaxRateStandardResult.cs index e6bf934d..d6c5c078 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Contracts/SalesOrVatTaxRate/Results/SalesOrVatTaxRateStandardResult.cs +++ b/src/Ubik.Accounting.SalesOrVatTax.Contracts/SalesOrVatTaxRate/Results/SalesOrVatTaxRateStandardResult.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Ubik.Accounting.SalesOrVatTax.Contracts.SalesOrVatTaxRate.Results +namespace Ubik.Accounting.SalesOrVatTax.Contracts.SalesOrVatTaxRate.Results { public record SalesOrVatTaxRateStandardResult { diff --git a/src/Ubik.Accounting.Structure.Api/Data/Config/EntryConfiguration.cs b/src/Ubik.Accounting.Structure.Api/Data/Config/EntryConfiguration.cs index 2b8131a2..c13d18f1 100644 --- a/src/Ubik.Accounting.Structure.Api/Data/Config/EntryConfiguration.cs +++ b/src/Ubik.Accounting.Structure.Api/Data/Config/EntryConfiguration.cs @@ -1,8 +1,4 @@ -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Microsoft.EntityFrameworkCore; -using Ubik.Accounting.Structure.Api.Models; - -//Will be put in a dedicated service +//Will be put in a dedicated service namespace Ubik.Accounting.Structure.Api.Data.Config { //public class EntryConfiguration : IEntityTypeConfiguration diff --git a/src/Ubik.Accounting.Structure.Api/Data/Config/TransactionConfiguration.cs b/src/Ubik.Accounting.Structure.Api/Data/Config/TransactionConfiguration.cs index 46049cc8..f43e0451 100644 --- a/src/Ubik.Accounting.Structure.Api/Data/Config/TransactionConfiguration.cs +++ b/src/Ubik.Accounting.Structure.Api/Data/Config/TransactionConfiguration.cs @@ -1,8 +1,4 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Ubik.Accounting.Structure.Api.Models; - -//Will be put in a dedicated service +//Will be put in a dedicated service namespace Ubik.Accounting.Structure.Api.Data.Config { //public class TransactionConfiguration : IEntityTypeConfiguration diff --git a/src/Ubik.Accounting.Structure.Api/Features/AccountGroups/Services/AccountGroupCommandService.cs b/src/Ubik.Accounting.Structure.Api/Features/AccountGroups/Services/AccountGroupCommandService.cs index e4be3630..2ca94281 100644 --- a/src/Ubik.Accounting.Structure.Api/Features/AccountGroups/Services/AccountGroupCommandService.cs +++ b/src/Ubik.Accounting.Structure.Api/Features/AccountGroups/Services/AccountGroupCommandService.cs @@ -2,7 +2,6 @@ using MassTransit; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Storage; -using System.Data.Common; using Ubik.Accounting.Structure.Api.Data; using Ubik.Accounting.Structure.Api.Features.AccountGroups.Errors; using Ubik.Accounting.Structure.Api.Mappers; diff --git a/src/Ubik.Accounting.Structure.Api/Features/Accounts/Controller/v1/AccountsController.cs b/src/Ubik.Accounting.Structure.Api/Features/Accounts/Controller/v1/AccountsController.cs index 3d18855d..f59d1b62 100644 --- a/src/Ubik.Accounting.Structure.Api/Features/Accounts/Controller/v1/AccountsController.cs +++ b/src/Ubik.Accounting.Structure.Api/Features/Accounts/Controller/v1/AccountsController.cs @@ -1,5 +1,4 @@ using Asp.Versioning; -using MassTransit; using Microsoft.AspNetCore.Mvc; using Ubik.Accounting.Structure.Api.Features.Accounts.Services; using Ubik.Accounting.Structure.Api.Mappers; diff --git a/src/Ubik.Accounting.Structure.Api/Features/Accounts/Services/AccountCommandService.cs b/src/Ubik.Accounting.Structure.Api/Features/Accounts/Services/AccountCommandService.cs index 9ba13a6b..6aa92ec2 100644 --- a/src/Ubik.Accounting.Structure.Api/Features/Accounts/Services/AccountCommandService.cs +++ b/src/Ubik.Accounting.Structure.Api/Features/Accounts/Services/AccountCommandService.cs @@ -1,7 +1,6 @@ using Dapper; using LanguageExt; using MassTransit; -using MassTransit.Transports; using Microsoft.EntityFrameworkCore; using Ubik.Accounting.Structure.Api.Data; using Ubik.Accounting.Structure.Api.Features.Accounts.Errors; diff --git a/src/Ubik.Accounting.Structure.Api/Features/Classifications/Controller/v1/ClassificationsController.cs b/src/Ubik.Accounting.Structure.Api/Features/Classifications/Controller/v1/ClassificationsController.cs index c5d8a642..ed0e7436 100644 --- a/src/Ubik.Accounting.Structure.Api/Features/Classifications/Controller/v1/ClassificationsController.cs +++ b/src/Ubik.Accounting.Structure.Api/Features/Classifications/Controller/v1/ClassificationsController.cs @@ -1,5 +1,4 @@ using Asp.Versioning; -using MassTransit; using Microsoft.AspNetCore.Mvc; using Ubik.Accounting.Structure.Api.Features.Classifications.Services; using Ubik.Accounting.Structure.Api.Mappers; diff --git a/src/Ubik.Accounting.Structure.Api/Features/Classifications/Services/ClassificationCommandService.cs b/src/Ubik.Accounting.Structure.Api/Features/Classifications/Services/ClassificationCommandService.cs index f92b418f..c09ba462 100644 --- a/src/Ubik.Accounting.Structure.Api/Features/Classifications/Services/ClassificationCommandService.cs +++ b/src/Ubik.Accounting.Structure.Api/Features/Classifications/Services/ClassificationCommandService.cs @@ -1,6 +1,5 @@ using LanguageExt; using MassTransit; -using MassTransit.Transports; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Storage; using System.Data; diff --git a/src/Ubik.Accounting.Structure.Api/Mappers/ClassificationMappers.cs b/src/Ubik.Accounting.Structure.Api/Mappers/ClassificationMappers.cs index 4e76c1e7..8a2f95d1 100644 --- a/src/Ubik.Accounting.Structure.Api/Mappers/ClassificationMappers.cs +++ b/src/Ubik.Accounting.Structure.Api/Mappers/ClassificationMappers.cs @@ -1,7 +1,6 @@ using MassTransit; using Ubik.Accounting.Structure.Api.Features.Classifications.CustomPoco; using Ubik.Accounting.Structure.Api.Models; -using Ubik.Accounting.Structure.Contracts.AccountGroups.Events; using Ubik.Accounting.Structure.Contracts.AccountGroups.Results; using Ubik.Accounting.Structure.Contracts.Classifications.Commands; using Ubik.Accounting.Structure.Contracts.Classifications.Events; diff --git a/src/Ubik.Accounting.Structure.Api/Models/Entry.cs b/src/Ubik.Accounting.Structure.Api/Models/Entry.cs index 7c3f741f..d507f84b 100644 --- a/src/Ubik.Accounting.Structure.Api/Models/Entry.cs +++ b/src/Ubik.Accounting.Structure.Api/Models/Entry.cs @@ -1,7 +1,4 @@ -using Microsoft.EntityFrameworkCore; -using Ubik.DB.Common; - -//Will be put in a dedicated service +//Will be put in a dedicated service namespace Ubik.Accounting.Structure.Api.Models { //public enum DebitCredit diff --git a/src/Ubik.Accounting.Structure.Api/Models/Transaction.cs b/src/Ubik.Accounting.Structure.Api/Models/Transaction.cs index 155c9f01..115f402b 100644 --- a/src/Ubik.Accounting.Structure.Api/Models/Transaction.cs +++ b/src/Ubik.Accounting.Structure.Api/Models/Transaction.cs @@ -1,6 +1,4 @@ -using Ubik.DB.Common; - -namespace Ubik.Accounting.Structure.Api.Models +namespace Ubik.Accounting.Structure.Api.Models { //Will be put in a dedicated service //Containes the entries packet diff --git a/src/Ubik.Accounting.Structure.Api/Program.cs b/src/Ubik.Accounting.Structure.Api/Program.cs index c4db7df6..677965b6 100644 --- a/src/Ubik.Accounting.Structure.Api/Program.cs +++ b/src/Ubik.Accounting.Structure.Api/Program.cs @@ -3,7 +3,6 @@ using Microsoft.EntityFrameworkCore; using Ubik.ApiService.Common.Services; using Ubik.ApiService.Common.Exceptions; -using Ubik.Accounting.Structure.Api.Features; using System.Reflection; using Ubik.Accounting.Structure.Api.Data.Init; using Microsoft.AspNetCore.Mvc; @@ -12,10 +11,7 @@ using Ubik.ApiService.Common.Configure.Options; using System.Text.Json.Serialization; using Microsoft.AspNetCore.Mvc.Infrastructure; -using Ubik.Accounting.Structure.Contracts.Accounts.Commands; using Ubik.ApiService.Common.Filters; -using Ubik.Accounting.Structure.Contracts.AccountGroups.Commands; -using Ubik.Accounting.Structure.Contracts.Classifications.Commands; using Ubik.ApiService.Common.Middlewares; using Ubik.Accounting.Structure.Api.Features.Application.Services; using Ubik.Accounting.Structure.Api.Features.AccountGroups.Services; diff --git a/src/Ubik.Accounting.Structure.Contracts/AccountGroups/Results/AccountGroupStandardResult.cs b/src/Ubik.Accounting.Structure.Contracts/AccountGroups/Results/AccountGroupStandardResult.cs index fef5c7db..d01970d5 100644 --- a/src/Ubik.Accounting.Structure.Contracts/AccountGroups/Results/AccountGroupStandardResult.cs +++ b/src/Ubik.Accounting.Structure.Contracts/AccountGroups/Results/AccountGroupStandardResult.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Ubik.Accounting.Structure.Contracts.AccountGroups.Results +namespace Ubik.Accounting.Structure.Contracts.AccountGroups.Results { public record AccountGroupStandardResult { diff --git a/src/Ubik.Accounting.Structure.Contracts/Accounts/Results/AccountGroupLinkResult.cs b/src/Ubik.Accounting.Structure.Contracts/Accounts/Results/AccountGroupLinkResult.cs index e474547a..4d7c4f0b 100644 --- a/src/Ubik.Accounting.Structure.Contracts/Accounts/Results/AccountGroupLinkResult.cs +++ b/src/Ubik.Accounting.Structure.Contracts/Accounts/Results/AccountGroupLinkResult.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Ubik.Accounting.Structure.Contracts.Accounts.Results +namespace Ubik.Accounting.Structure.Contracts.Accounts.Results { public record AccountGroupLinkResult { diff --git a/src/Ubik.Accounting.Structure.Contracts/Accounts/Results/AccountStandardResult.cs b/src/Ubik.Accounting.Structure.Contracts/Accounts/Results/AccountStandardResult.cs index 128a6d61..0e1eb497 100644 --- a/src/Ubik.Accounting.Structure.Contracts/Accounts/Results/AccountStandardResult.cs +++ b/src/Ubik.Accounting.Structure.Contracts/Accounts/Results/AccountStandardResult.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Ubik.Accounting.Structure.Contracts.Accounts.Enums; +using Ubik.Accounting.Structure.Contracts.Accounts.Enums; namespace Ubik.Accounting.Structure.Contracts.Accounts.Results { diff --git a/src/Ubik.Accounting.Structure.Contracts/Classifications/Events/ClassificationDeleted.cs b/src/Ubik.Accounting.Structure.Contracts/Classifications/Events/ClassificationDeleted.cs index 480ddcf7..edf3b8c6 100644 --- a/src/Ubik.Accounting.Structure.Contracts/Classifications/Events/ClassificationDeleted.cs +++ b/src/Ubik.Accounting.Structure.Contracts/Classifications/Events/ClassificationDeleted.cs @@ -1,5 +1,4 @@ -using Ubik.Accounting.Structure.Contracts.AccountGroups.Events; -using Ubik.Accounting.Structure.Contracts.AccountGroups.Results; +using Ubik.Accounting.Structure.Contracts.AccountGroups.Results; namespace Ubik.Accounting.Structure.Contracts.Classifications.Events { diff --git a/src/Ubik.Accounting.WebApp/ApiClients/AccountingApiClient.cs b/src/Ubik.Accounting.WebApp/ApiClients/AccountingApiClient.cs index 4810bca7..118576a2 100644 --- a/src/Ubik.Accounting.WebApp/ApiClients/AccountingApiClient.cs +++ b/src/Ubik.Accounting.WebApp/ApiClients/AccountingApiClient.cs @@ -1,5 +1,4 @@ -using MassTransit.Configuration; -using Microsoft.Extensions.Options; +using Microsoft.Extensions.Options; using System.Text; using System.Text.Json; using Ubik.Accounting.Structure.Contracts.AccountGroups.Commands; diff --git a/src/Ubik.Accounting.WebApp/Program.cs b/src/Ubik.Accounting.WebApp/Program.cs index 9c508afd..7302d89f 100644 --- a/src/Ubik.Accounting.WebApp/Program.cs +++ b/src/Ubik.Accounting.WebApp/Program.cs @@ -18,7 +18,6 @@ using Microsoft.AspNetCore.Authentication; using Ubik.Accounting.WebApp.Config; using Microsoft.AspNetCore.HttpOverrides; -using IdentityModel.Client; var builder = WebApplication.CreateBuilder(args); diff --git a/src/Ubik.Accounting.WebApp/Security/TokenCacheService.cs b/src/Ubik.Accounting.WebApp/Security/TokenCacheService.cs index e14361fb..cf4b9be9 100644 --- a/src/Ubik.Accounting.WebApp/Security/TokenCacheService.cs +++ b/src/Ubik.Accounting.WebApp/Security/TokenCacheService.cs @@ -1,11 +1,9 @@ using IdentityModel.Client; -using Microsoft.EntityFrameworkCore.Metadata.Internal; using Microsoft.Extensions.Caching.Distributed; using Microsoft.Extensions.Options; using System.IdentityModel.Tokens.Jwt; using System.Text.Json; using System.Text.Json.Serialization; -using Ubik.Accounting.WebApp.Shared.Security; using Ubik.ApiService.Common.Configure.Options; using Ubik.Security.Contracts.Users.Results; diff --git a/src/Ubik.Accounting.WebApp/Security/UserService.cs b/src/Ubik.Accounting.WebApp/Security/UserService.cs index 8db64ec6..47e3d8bd 100644 --- a/src/Ubik.Accounting.WebApp/Security/UserService.cs +++ b/src/Ubik.Accounting.WebApp/Security/UserService.cs @@ -1,16 +1,7 @@ -using IdentityModel.Client; -using MassTransit.Configuration; -using Microsoft.AspNetCore.Authentication.Cookies; -using Microsoft.AspNetCore.Authentication.OpenIdConnect; -using Microsoft.AspNetCore.Authentication; -using Microsoft.AspNetCore.Components.Authorization; +using Microsoft.AspNetCore.Components.Authorization; using Microsoft.AspNetCore.Components.Server.Circuits; -using Microsoft.Extensions.Options; -using System.IdentityModel.Tokens.Jwt; using System.Security.Claims; -using Ubik.ApiService.Common.Configure.Options; using Ubik.Security.Contracts.Users.Results; -using Microsoft.AspNetCore.Components; namespace Ubik.Accounting.WebApp.Security { diff --git a/src/Ubik.Accounting.Webapp.Shared/Features/Classifications/Models/AccountGroupModel.cs b/src/Ubik.Accounting.Webapp.Shared/Features/Classifications/Models/AccountGroupModel.cs index 6c2351c8..25ddf33a 100644 --- a/src/Ubik.Accounting.Webapp.Shared/Features/Classifications/Models/AccountGroupModel.cs +++ b/src/Ubik.Accounting.Webapp.Shared/Features/Classifications/Models/AccountGroupModel.cs @@ -1,7 +1,6 @@ using System.ComponentModel.DataAnnotations; using Ubik.Accounting.Structure.Contracts.AccountGroups.Commands; using Ubik.Accounting.Structure.Contracts.AccountGroups.Results; -using Ubik.Accounting.Structure.Contracts.Accounts.Results; namespace Ubik.Accounting.Webapp.Shared.Features.Classifications.Models { diff --git a/src/Ubik.Accounting.Webapp.Shared/Features/Classifications/Models/AccountModel.cs b/src/Ubik.Accounting.Webapp.Shared/Features/Classifications/Models/AccountModel.cs index 771a061f..7cb97249 100644 --- a/src/Ubik.Accounting.Webapp.Shared/Features/Classifications/Models/AccountModel.cs +++ b/src/Ubik.Accounting.Webapp.Shared/Features/Classifications/Models/AccountModel.cs @@ -1,7 +1,6 @@ using System.ComponentModel.DataAnnotations; using Ubik.Accounting.Structure.Contracts.Accounts.Enums; using Ubik.Accounting.Structure.Contracts.Accounts.Results; -using Ubik.Accounting.Structure.Contracts.Classifications.Results; namespace Ubik.Accounting.Webapp.Shared.Features.Classifications.Models { diff --git a/src/Ubik.CodeGenerator/ContractsGenerator.cs b/src/Ubik.CodeGenerator/ContractsGenerator.cs index 5ec2a1c9..4f8577ea 100644 --- a/src/Ubik.CodeGenerator/ContractsGenerator.cs +++ b/src/Ubik.CodeGenerator/ContractsGenerator.cs @@ -1,7 +1,6 @@ using Microsoft.EntityFrameworkCore.Metadata; using System.Text; using Ubik.Accounting.Structure.Api.Data; -using Ubik.Security.Api.Data; namespace Ubik.CodeGenerator { diff --git a/src/Ubik.CodeGenerator/ControllerGenerator.cs b/src/Ubik.CodeGenerator/ControllerGenerator.cs index 180fc272..bfcd5e85 100644 --- a/src/Ubik.CodeGenerator/ControllerGenerator.cs +++ b/src/Ubik.CodeGenerator/ControllerGenerator.cs @@ -1,5 +1,4 @@ using Ubik.Accounting.SalesOrVatTax.Api.Data; -using Ubik.Security.Api.Data; namespace Ubik.CodeGenerator { diff --git a/src/Ubik.CodeGenerator/MappersGenerator.cs b/src/Ubik.CodeGenerator/MappersGenerator.cs index ccc0cbb7..15e2a3cd 100644 --- a/src/Ubik.CodeGenerator/MappersGenerator.cs +++ b/src/Ubik.CodeGenerator/MappersGenerator.cs @@ -1,8 +1,6 @@ using Microsoft.EntityFrameworkCore.Metadata; using System.Text; using Ubik.Accounting.SalesOrVatTax.Api.Data; -using Ubik.Accounting.Structure.Api.Data; -using Ubik.Security.Api.Data; namespace Ubik.CodeGenerator { diff --git a/src/Ubik.CodeGenerator/ServicesGenerator.cs b/src/Ubik.CodeGenerator/ServicesGenerator.cs index 055c3827..482567de 100644 --- a/src/Ubik.CodeGenerator/ServicesGenerator.cs +++ b/src/Ubik.CodeGenerator/ServicesGenerator.cs @@ -1,5 +1,4 @@ using Ubik.Accounting.Structure.Api.Data; -using Ubik.Security.Api.Data; namespace Ubik.CodeGenerator { diff --git a/src/Ubik.Security.Api/Features/RolesAuthorizations/Services/RolesAuthorizationsCommandsService.cs b/src/Ubik.Security.Api/Features/RolesAuthorizations/Services/RolesAuthorizationsCommandsService.cs index 5471f72a..6e955042 100644 --- a/src/Ubik.Security.Api/Features/RolesAuthorizations/Services/RolesAuthorizationsCommandsService.cs +++ b/src/Ubik.Security.Api/Features/RolesAuthorizations/Services/RolesAuthorizationsCommandsService.cs @@ -8,7 +8,6 @@ using Ubik.Security.Api.Models; using Ubik.Security.Contracts.RoleAuthorizations.Commands; using Ubik.Security.Contracts.RoleAuthorizations.Events; -using Ubik.Security.Contracts.Roles.Events; namespace Ubik.Security.Api.Features.RolesAuthorizations.Services { diff --git a/src/Ubik.Security.Api/Features/Tenants/Services/TenantsCommandsService.cs b/src/Ubik.Security.Api/Features/Tenants/Services/TenantsCommandsService.cs index 16f022ac..d3ab2a18 100644 --- a/src/Ubik.Security.Api/Features/Tenants/Services/TenantsCommandsService.cs +++ b/src/Ubik.Security.Api/Features/Tenants/Services/TenantsCommandsService.cs @@ -7,7 +7,6 @@ using Ubik.Security.Api.Models; using Ubik.Security.Contracts.Tenants.Commands; using Ubik.Security.Contracts.Tenants.Events; -using Ubik.Security.Contracts.Roles.Events; using Ubik.Security.Api.Mappers; namespace Ubik.Security.Api.Features.Tenants.Services diff --git a/src/Ubik.Security.Api/Features/Users/Services/UsersCommandsService.cs b/src/Ubik.Security.Api/Features/Users/Services/UsersCommandsService.cs index 154a8db3..0dc2a7d3 100644 --- a/src/Ubik.Security.Api/Features/Users/Services/UsersCommandsService.cs +++ b/src/Ubik.Security.Api/Features/Users/Services/UsersCommandsService.cs @@ -1,8 +1,6 @@ using Dapper; using LanguageExt; -using LanguageExt.Pipes; using MassTransit; -using Microsoft.AspNetCore.Http.HttpResults; using Microsoft.EntityFrameworkCore; using Ubik.ApiService.Common.Errors; using Ubik.ApiService.Common.Services; @@ -11,7 +9,6 @@ using Ubik.Security.Api.Mappers; using Ubik.Security.Api.Models; using Ubik.Security.Contracts.Tenants.Commands; -using Ubik.Security.Contracts.Tenants.Events; using Ubik.Security.Contracts.Users.Commands; using Ubik.Security.Contracts.Users.Events; diff --git a/src/Ubik.Security.Api/Program.cs b/src/Ubik.Security.Api/Program.cs index 9ca721d4..6351c0bd 100644 --- a/src/Ubik.Security.Api/Program.cs +++ b/src/Ubik.Security.Api/Program.cs @@ -9,8 +9,6 @@ using Ubik.ApiService.Common.Services; using Microsoft.AspNetCore.Mvc; using System.Text.Json.Serialization; -using Ubik.Security.Contracts.Users.Commands; -using Ubik.Security.Contracts.Authorizations.Commands; using Ubik.Security.Api.Data.Init; using Ubik.Security.Api.Features.Users.Services; using Ubik.ApiService.Common.Middlewares; diff --git a/src/Ubik.Security.Contracts/Users/Events/UserRoleAddedToTenant.cs b/src/Ubik.Security.Contracts/Users/Events/UserRoleAddedToTenant.cs index 510b9627..d50c498a 100644 --- a/src/Ubik.Security.Contracts/Users/Events/UserRoleAddedToTenant.cs +++ b/src/Ubik.Security.Contracts/Users/Events/UserRoleAddedToTenant.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Ubik.Security.Contracts.Users.Events +namespace Ubik.Security.Contracts.Users.Events { public record UserRoleAddedToTenant { diff --git a/tests/Ubik.Api.Tests.Integration/BaseIntegrationTest.cs b/tests/Ubik.Api.Tests.Integration/BaseIntegrationTest.cs index da89391e..fa98d05f 100644 --- a/tests/Ubik.Api.Tests.Integration/BaseIntegrationTest.cs +++ b/tests/Ubik.Api.Tests.Integration/BaseIntegrationTest.cs @@ -1,5 +1,4 @@ using Microsoft.Extensions.DependencyInjection; -using System.Net.Http.Headers; using System.Net.Http.Json; using System.Text.Json.Serialization; diff --git a/tests/Ubik.Api.Tests.Integration/BaseIntegrationTestAccountingSalesVatTax.cs b/tests/Ubik.Api.Tests.Integration/BaseIntegrationTestAccountingSalesVatTax.cs index 5a9b3860..b018b3ad 100644 --- a/tests/Ubik.Api.Tests.Integration/BaseIntegrationTestAccountingSalesVatTax.cs +++ b/tests/Ubik.Api.Tests.Integration/BaseIntegrationTestAccountingSalesVatTax.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Net.Http.Headers; -using System.Text; -using System.Threading.Tasks; +using System.Net.Http.Headers; namespace Ubik.Api.Tests.Integration { diff --git a/tests/Ubik.Api.Tests.Integration/BaseIntegrationTestAccountingStruct.cs b/tests/Ubik.Api.Tests.Integration/BaseIntegrationTestAccountingStruct.cs index 9ca8e17c..f27fc36b 100644 --- a/tests/Ubik.Api.Tests.Integration/BaseIntegrationTestAccountingStruct.cs +++ b/tests/Ubik.Api.Tests.Integration/BaseIntegrationTestAccountingStruct.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Net.Http.Headers; -using System.Text; -using System.Threading.Tasks; +using System.Net.Http.Headers; namespace Ubik.Api.Tests.Integration { diff --git a/tests/Ubik.Api.Tests.Integration/BaseIntegrationTestSecurity.cs b/tests/Ubik.Api.Tests.Integration/BaseIntegrationTestSecurity.cs index 52737f1f..f1457357 100644 --- a/tests/Ubik.Api.Tests.Integration/BaseIntegrationTestSecurity.cs +++ b/tests/Ubik.Api.Tests.Integration/BaseIntegrationTestSecurity.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Net.Http.Headers; -using System.Text; -using System.Threading.Tasks; +using System.Net.Http.Headers; namespace Ubik.Api.Tests.Integration { diff --git a/tests/Ubik.Api.Tests.Integration/Features/Accounting/SalesOrVatTax/AccountLinkedTaxRates/AccountingLinkedTaxRatesController_Test.cs b/tests/Ubik.Api.Tests.Integration/Features/Accounting/SalesOrVatTax/AccountLinkedTaxRates/AccountingLinkedTaxRatesController_Test.cs index 83fd83a8..7f71d191 100644 --- a/tests/Ubik.Api.Tests.Integration/Features/Accounting/SalesOrVatTax/AccountLinkedTaxRates/AccountingLinkedTaxRatesController_Test.cs +++ b/tests/Ubik.Api.Tests.Integration/Features/Accounting/SalesOrVatTax/AccountLinkedTaxRates/AccountingLinkedTaxRatesController_Test.cs @@ -1,18 +1,11 @@ using FluentAssertions; -using System; -using System.Collections.Generic; -using System.Linq; using System.Net.Http.Headers; using System.Net.Http.Json; using System.Net; -using System.Text; -using System.Threading.Tasks; -using Ubik.Accounting.SalesOrVatTax.Contracts.SalesOrVatTaxRate.Results; -using Ubik.Accounting.SalesOrVatTax.Contracts.AccountLinkedTaxRates.Results; +using Ubik.Accounting.SalesOrVatTax.Contracts.AccountTaxRateConfigs.Results; using Ubik.ApiService.Common.Exceptions; using MassTransit; -using Ubik.Accounting.SalesOrVatTax.Contracts.SalesOrVatTaxRate.Commands; -using Ubik.Accounting.SalesOrVatTax.Contracts.AccountLinkedTaxRates.Commands; +using Ubik.Accounting.SalesOrVatTax.Contracts.AccountTaxRateConfigs.Commands; namespace Ubik.Api.Tests.Integration.Features.Accounting.SalesOrVatTax.AccountLinkedTaxRates { diff --git a/tests/Ubik.Api.Tests.Integration/Features/Accounting/SalesOrVatTax/TaxRates/TaxRatesController_Test.cs b/tests/Ubik.Api.Tests.Integration/Features/Accounting/SalesOrVatTax/TaxRates/TaxRatesController_Test.cs index 785ccdd4..820bc023 100644 --- a/tests/Ubik.Api.Tests.Integration/Features/Accounting/SalesOrVatTax/TaxRates/TaxRatesController_Test.cs +++ b/tests/Ubik.Api.Tests.Integration/Features/Accounting/SalesOrVatTax/TaxRates/TaxRatesController_Test.cs @@ -1,7 +1,4 @@ using FluentAssertions; -using System; -using System.Collections.Generic; -using System.Linq; using System.Net.Http.Headers; using System.Net.Http.Json; using System.Net; @@ -9,8 +6,6 @@ using Ubik.ApiService.Common.Exceptions; using MassTransit; using Ubik.Accounting.SalesOrVatTax.Contracts.SalesOrVatTaxRate.Commands; -using Ubik.Accounting.Structure.Api.Models; -using Ubik.Accounting.Structure.Contracts.Classifications.Results; namespace Ubik.Api.Tests.Integration.Features.Accounting.SalesOrVatTax.TaxRates { diff --git a/tests/Ubik.Api.Tests.Integration/Features/Accounting/Struct/AccountGroups/AccountGroupsController_Test.cs b/tests/Ubik.Api.Tests.Integration/Features/Accounting/Struct/AccountGroups/AccountGroupsController_Test.cs index 0803a10c..44fd7bde 100644 --- a/tests/Ubik.Api.Tests.Integration/Features/Accounting/Struct/AccountGroups/AccountGroupsController_Test.cs +++ b/tests/Ubik.Api.Tests.Integration/Features/Accounting/Struct/AccountGroups/AccountGroupsController_Test.cs @@ -1,16 +1,9 @@ using FluentAssertions; -using System; -using System.Collections.Generic; -using System.Linq; using System.Net.Http.Headers; using System.Net.Http.Json; using System.Net; -using System.Text; -using System.Threading.Tasks; -using Ubik.Security.Contracts.Roles.Results; using Ubik.Accounting.Structure.Contracts.AccountGroups.Results; using Ubik.ApiService.Common.Exceptions; -using RabbitMQ.Client; using Ubik.Accounting.Structure.Contracts.Accounts.Results; using Ubik.Accounting.Structure.Contracts.AccountGroups.Commands; using MassTransit; diff --git a/tests/Ubik.Api.Tests.Integration/Features/Accounting/Struct/Accounts/AccountsController_Test.cs b/tests/Ubik.Api.Tests.Integration/Features/Accounting/Struct/Accounts/AccountsController_Test.cs index 8585d6a4..28ac3bed 100644 --- a/tests/Ubik.Api.Tests.Integration/Features/Accounting/Struct/Accounts/AccountsController_Test.cs +++ b/tests/Ubik.Api.Tests.Integration/Features/Accounting/Struct/Accounts/AccountsController_Test.cs @@ -1,12 +1,7 @@ using FluentAssertions; -using System; -using System.Collections.Generic; -using System.Linq; using System.Net.Http.Headers; using System.Net.Http.Json; using System.Net; -using System.Text; -using System.Threading.Tasks; using Ubik.Accounting.Structure.Contracts.Accounts.Results; using Ubik.ApiService.Common.Exceptions; using Ubik.Accounting.Structure.Contracts.Accounts.Commands; diff --git a/tests/Ubik.Api.Tests.Integration/Features/Accounting/Struct/Classifications/ClassificationsController_Test.cs b/tests/Ubik.Api.Tests.Integration/Features/Accounting/Struct/Classifications/ClassificationsController_Test.cs index f8878594..031d2f92 100644 --- a/tests/Ubik.Api.Tests.Integration/Features/Accounting/Struct/Classifications/ClassificationsController_Test.cs +++ b/tests/Ubik.Api.Tests.Integration/Features/Accounting/Struct/Classifications/ClassificationsController_Test.cs @@ -1,18 +1,12 @@ using FluentAssertions; -using System; -using System.Collections.Generic; -using System.Linq; using System.Net.Http.Headers; using System.Net.Http.Json; using System.Net; -using System.Text; -using System.Threading.Tasks; using Ubik.Accounting.Structure.Contracts.Accounts.Results; using Ubik.Accounting.Structure.Contracts.Classifications.Results; using Ubik.ApiService.Common.Exceptions; using Ubik.Accounting.Structure.Contracts.Classifications.Commands; using MassTransit; -using Ubik.Accounting.Structure.Api.Models; namespace Ubik.Api.Tests.Integration.Features.Accounting.Struct.Classifications { diff --git a/tests/Ubik.Api.Tests.Integration/Features/Accounting/Struct/Currencies/CurrenciesController_Test.cs b/tests/Ubik.Api.Tests.Integration/Features/Accounting/Struct/Currencies/CurrenciesController_Test.cs index 7867c57f..0f0db901 100644 --- a/tests/Ubik.Api.Tests.Integration/Features/Accounting/Struct/Currencies/CurrenciesController_Test.cs +++ b/tests/Ubik.Api.Tests.Integration/Features/Accounting/Struct/Currencies/CurrenciesController_Test.cs @@ -1,13 +1,7 @@ using FluentAssertions; -using System; -using System.Collections.Generic; -using System.Linq; using System.Net.Http.Headers; using System.Net.Http.Json; using System.Net; -using System.Text; -using System.Threading.Tasks; -using Ubik.Accounting.Structure.Contracts.Classifications.Results; using Ubik.Accounting.Structure.Contracts.Currencies.Results; namespace Ubik.Api.Tests.Integration.Features.Accounting.Struct.Currencies diff --git a/tests/Ubik.Api.Tests.Integration/Features/Security/Tenants/TenantAdminController_Test.cs b/tests/Ubik.Api.Tests.Integration/Features/Security/Tenants/TenantAdminController_Test.cs index 12a5f368..5d850e88 100644 --- a/tests/Ubik.Api.Tests.Integration/Features/Security/Tenants/TenantAdminController_Test.cs +++ b/tests/Ubik.Api.Tests.Integration/Features/Security/Tenants/TenantAdminController_Test.cs @@ -1,12 +1,7 @@ using FluentAssertions; -using System; -using System.Collections.Generic; -using System.Linq; using System.Net.Http.Headers; using System.Net.Http.Json; using System.Net; -using System.Text; -using System.Threading.Tasks; using Ubik.Security.Contracts.Authorizations.Results; using Ubik.Security.Contracts.Tenants.Results; using Ubik.ApiService.Common.Exceptions; From 31006cc4ea2ba20ea3edbdc094736a14d6cb9420 Mon Sep 17 00:00:00 2001 From: ubik Date: Tue, 5 Nov 2024 08:20:36 +0100 Subject: [PATCH 42/94] Test delete account rate config. --- src/Ubik.YarpProxy/appsettings.json | 10 ++ ...AccountingLinkedTaxRatesController_Test.cs | 93 +++++++++++++++++++ 2 files changed, 103 insertions(+) diff --git a/src/Ubik.YarpProxy/appsettings.json b/src/Ubik.YarpProxy/appsettings.json index 8bffbaa9..b9a8ff6e 100644 --- a/src/Ubik.YarpProxy/appsettings.json +++ b/src/Ubik.YarpProxy/appsettings.json @@ -381,7 +381,17 @@ "Methods": [ "POST" ] }, "Transforms": [ { "PathPattern": "/api/{apiversion}/accounts/{id:Guid}/taxrates/{tax_rate_id:Guid}" } ] + }, + "route_accounting_account_tax_rates_delete": { + "ClusterId": "ubik_accounting_sales_vat_tax", + "AuthorizationPolicy": "CanSalesOrVatTaxRatesAndAccountsWrite", + "Match": { + "Path": "/accounting/api/{apiversion}/accounts/{id:Guid}/taxrates/{tax_rate_id:Guid}", + "Methods": [ "DELETE" ] + }, + "Transforms": [ { "PathPattern": "/api/{apiversion}/accounts/{id:Guid}/taxrates/{tax_rate_id:Guid}" } ] } + }, "Clusters": { "ubik_users_admin": { diff --git a/tests/Ubik.Api.Tests.Integration/Features/Accounting/SalesOrVatTax/AccountLinkedTaxRates/AccountingLinkedTaxRatesController_Test.cs b/tests/Ubik.Api.Tests.Integration/Features/Accounting/SalesOrVatTax/AccountLinkedTaxRates/AccountingLinkedTaxRatesController_Test.cs index 7f71d191..0b1fb678 100644 --- a/tests/Ubik.Api.Tests.Integration/Features/Accounting/SalesOrVatTax/AccountLinkedTaxRates/AccountingLinkedTaxRatesController_Test.cs +++ b/tests/Ubik.Api.Tests.Integration/Features/Accounting/SalesOrVatTax/AccountLinkedTaxRates/AccountingLinkedTaxRatesController_Test.cs @@ -405,5 +405,98 @@ public async Task Add_AccountLinkedTaxRates_WithAlreadyExisting_400() .And.BeOfType() .And.Match(x => x.Errors.First().Code == "LINKED_TAX_RATE_ALREADY_EXIST"); } + + [Fact] + public async Task Delete_AccountLinkedTaxRates_WithRW_OK() + { + var token = await GetAccessTokenAsync(TokenType.RW); + _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); + + //Act + var response = await _client.DeleteAsync($"{_baseUrlForV1}/accounts/4c6f0000-5dd4-0015-db2b-08dcda56e424/taxrates/08740000-3c36-7456-dc84-08dcfb48d62d"); + + //Assert + response.StatusCode.Should().Be(HttpStatusCode.NoContent); + } + + [Fact] + public async Task Delete_AccountLinkedTaxRates_WithRO_403() + { + var token = await GetAccessTokenAsync(TokenType.RO); + _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); + + //Act + var response = await _client.DeleteAsync($"{_baseUrlForV1}/accounts/4c6f0000-5dd4-0015-db2b-08dcda56e424/taxrates/08740000-3c36-7456-dc84-08dcfb48d62d"); + + //Assert + response.StatusCode.Should().Be(HttpStatusCode.Forbidden); + } + + [Fact] + public async Task Delete_AccountLinkedTaxRates_WithNoToken_401() + { + //Act + var response = await _client.DeleteAsync($"{_baseUrlForV1}/accounts/4c6f0000-5dd4-0015-db2b-08dcda56e424/taxrates/08740000-3c36-7456-dc84-08dcfb48d62d"); + + //Assert + response.StatusCode.Should().Be(HttpStatusCode.Unauthorized); + } + + [Fact] + public async Task Delete_AccountLinkedTaxRates_WithAdmin_403() + { + var token = await GetAccessTokenAsync(TokenType.MegaAdmin); + _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); + + //Act + var response = await _client.DeleteAsync($"{_baseUrlForV1}/accounts/4c6f0000-5dd4-0015-db2b-08dcda56e424/taxrates/08740000-3c36-7456-dc84-08dcfb48d62d"); + + //Assert + response.StatusCode.Should().Be(HttpStatusCode.Forbidden); + } + + [Fact] + public async Task Delete_AccountLinkedTaxRates_WithOtherTenant_404() + { + var token = await GetAccessTokenAsync(TokenType.OtherTenant); + _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); + + //Act + var response = await _client.DeleteAsync($"{_baseUrlForV1}/accounts/4c6f0000-5dd4-0015-db2b-08dcda56e424/taxrates/08740000-3c36-7456-dc84-08dcfb48d62d"); + + //Assert + response.StatusCode.Should().Be(HttpStatusCode.NotFound); + } + + [Fact] + public async Task Delete_AccountLinkedTaxRates_WithNoRole_403() + { + var token = await GetAccessTokenAsync(TokenType.NoRole); + _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); + + //Act + var response = await _client.DeleteAsync($"{_baseUrlForV1}/accounts/4c6f0000-5dd4-0015-db2b-08dcda56e424/taxrates/08740000-3c36-7456-dc84-08dcfb48d62d"); + + //Assert + response.StatusCode.Should().Be(HttpStatusCode.Forbidden); + } + + [Fact] + public async Task Delete_AccountLinkedTaxRates_WithBadId_404() + { + var token = await GetAccessTokenAsync(TokenType.RW); + _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); + + //Act + var response = await _client.DeleteAsync($"{_baseUrlForV1}/accounts/4c6f0000-5dd4-0015-db2b-08dcda56e421/taxrates/08740000-3c36-7456-dc84-08dcfb48d62d"); + var result = await response.Content.ReadFromJsonAsync(); + + //Assert + response.StatusCode.Should().Be(HttpStatusCode.NotFound); + result.Should() + .NotBeNull() + .And.BeOfType() + .And.Match(x => x.Errors.First().Code == "ACCOUNTTAXRATECONFIG_NOT_FOUND"); + } } } From 5ebde6a3a3d784da81f2b241365a6b633818cd36 Mon Sep 17 00:00:00 2001 From: ubik Date: Tue, 5 Nov 2024 08:53:42 +0100 Subject: [PATCH 43/94] Consumers account in VAT Tax Api --- .../Data/Config/AccountConfiguration.cs | 3 +++ .../Consumers/AccountAddedConsumer.cs | 24 +++++++++++++++++++ .../Services/AccountCommandService.cs | 15 ++++++++++++ .../Services/IAccountCommandService.cs | 9 +++++++ .../Mappers/AccountMappers.cs | 22 +++++++++++++++++ .../Program.cs | 4 +++- .../Ubik.Accounting.SalesOrVatTax.Api.csproj | 1 + 7 files changed, 77 insertions(+), 1 deletion(-) create mode 100644 src/Ubik.Accounting.SalesOrVatTax.Api/Features/Accounts/Consumers/AccountAddedConsumer.cs create mode 100644 src/Ubik.Accounting.SalesOrVatTax.Api/Features/Accounts/Services/AccountCommandService.cs create mode 100644 src/Ubik.Accounting.SalesOrVatTax.Api/Features/Accounts/Services/IAccountCommandService.cs create mode 100644 src/Ubik.Accounting.SalesOrVatTax.Api/Mappers/AccountMappers.cs diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Data/Config/AccountConfiguration.cs b/src/Ubik.Accounting.SalesOrVatTax.Api/Data/Config/AccountConfiguration.cs index 97916540..fbc5f769 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Api/Data/Config/AccountConfiguration.cs +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Data/Config/AccountConfiguration.cs @@ -23,6 +23,9 @@ public void Configure(EntityTypeBuilder builder) .IsRequired() .HasDefaultValue(true); + builder.Property(a => a.Version) + .IsConcurrencyToken(); + builder.HasIndex(a => new { a.Code, a.TenantId }) .IsUnique(); diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Features/Accounts/Consumers/AccountAddedConsumer.cs b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/Accounts/Consumers/AccountAddedConsumer.cs new file mode 100644 index 00000000..1f01c2fc --- /dev/null +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/Accounts/Consumers/AccountAddedConsumer.cs @@ -0,0 +1,24 @@ +using MassTransit; +using Ubik.Accounting.SalesOrVatTax.Api.Data; +using Ubik.Accounting.SalesOrVatTax.Api.Features.Accounts.Services; +using Ubik.Accounting.Structure.Contracts.Accounts.Events; + +namespace Ubik.Accounting.SalesOrVatTax.Api.Features.Accounts.Consumers +{ + public class AccountAddedConsumer(IAccountCommandService commandService) : IConsumer + { + public async Task Consume(ConsumeContext context) + { + await commandService.AddAsync(context.Message); + } + } + + public class AccountAddedFaultConsumer : + IConsumer> + { + public async Task Consume(ConsumeContext> context) + { + //TODO: put in place a thing to manage msg faults + } + } +} diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Features/Accounts/Services/AccountCommandService.cs b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/Accounts/Services/AccountCommandService.cs new file mode 100644 index 00000000..6435b986 --- /dev/null +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/Accounts/Services/AccountCommandService.cs @@ -0,0 +1,15 @@ +using Ubik.Accounting.SalesOrVatTax.Api.Data; +using Ubik.Accounting.SalesOrVatTax.Api.Mappers; +using Ubik.Accounting.Structure.Contracts.Accounts.Events; + +namespace Ubik.Accounting.SalesOrVatTax.Api.Features.Accounts.Services +{ + public class AccountCommandService(AccountingSalesTaxDbContext ctx) : IAccountCommandService + { + public async Task AddAsync(AccountAdded account) + { + await ctx.Accounts.AddAsync(account.ToAccount()); + await ctx.SaveChangesAsync(); + } + } +} diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Features/Accounts/Services/IAccountCommandService.cs b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/Accounts/Services/IAccountCommandService.cs new file mode 100644 index 00000000..6106e713 --- /dev/null +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/Accounts/Services/IAccountCommandService.cs @@ -0,0 +1,9 @@ +using Ubik.Accounting.Structure.Contracts.Accounts.Events; + +namespace Ubik.Accounting.SalesOrVatTax.Api.Features.Accounts.Services +{ + public interface IAccountCommandService + { + public Task AddAsync(AccountAdded account); + } +} diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Mappers/AccountMappers.cs b/src/Ubik.Accounting.SalesOrVatTax.Api/Mappers/AccountMappers.cs new file mode 100644 index 00000000..efd94482 --- /dev/null +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Mappers/AccountMappers.cs @@ -0,0 +1,22 @@ +using Ubik.Accounting.SalesOrVatTax.Api.Models; +using Ubik.Accounting.SalesOrVatTax.Contracts.SalesOrVatTaxRate.Commands; +using Ubik.Accounting.Structure.Contracts.Accounts.Events; + +namespace Ubik.Accounting.SalesOrVatTax.Api.Mappers +{ + public static class AccountMappers + { + public static Account ToAccount(this AccountAdded current) + { + return new Account + { + Active = current.Active, + Code = current.Code, + Id = current.Id, + Label = current.Label, + TenantId = current.TenantId, + Version = current.Version + }; + } + } +} diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Program.cs b/src/Ubik.Accounting.SalesOrVatTax.Api/Program.cs index 889d8563..b56ae604 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Api/Program.cs +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Program.cs @@ -6,6 +6,7 @@ using System.Text.Json.Serialization; using Ubik.Accounting.SalesOrVatTax.Api.Data; using Ubik.Accounting.SalesOrVatTax.Api.Data.Init; +using Ubik.Accounting.SalesOrVatTax.Api.Features.Accounts.Services; using Ubik.Accounting.SalesOrVatTax.Api.Features.AccountTaxRateConfigs.Services; using Ubik.Accounting.SalesOrVatTax.Api.Features.Application.Services; using Ubik.Accounting.SalesOrVatTax.Api.Features.TaxRates.Services; @@ -66,7 +67,7 @@ }); //Add all consumers - //config.AddConsumers(Assembly.GetExecutingAssembly()); + config.AddConsumers(Assembly.GetExecutingAssembly()); //Add commands clients @@ -97,6 +98,7 @@ builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); +builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Ubik.Accounting.SalesOrVatTax.Api.csproj b/src/Ubik.Accounting.SalesOrVatTax.Api/Ubik.Accounting.SalesOrVatTax.Api.csproj index caf0dbf6..7a79b5b6 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Api/Ubik.Accounting.SalesOrVatTax.Api.csproj +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Ubik.Accounting.SalesOrVatTax.Api.csproj @@ -29,6 +29,7 @@ + From a9fb76b715e9c9583e24fcefe13a2b016dce7737 Mon Sep 17 00:00:00 2001 From: ubik Date: Tue, 5 Nov 2024 10:56:53 +0100 Subject: [PATCH 44/94] Account consumers in tax api. Seems to work. --- .../Data/Config/AccountConfiguration.cs | 3 --- .../Consumers/AccountAddedConsumer.cs | 17 ++++++++------- .../Consumers/AccountDeletedConsumer.cs | 14 +++++++++++++ .../Consumers/AccountUpdatedConsumer.cs | 14 +++++++++++++ .../Services/AccountCommandService.cs | 21 ++++++++++++++++--- .../Services/IAccountCommandService.cs | 4 +++- 6 files changed, 58 insertions(+), 15 deletions(-) create mode 100644 src/Ubik.Accounting.SalesOrVatTax.Api/Features/Accounts/Consumers/AccountDeletedConsumer.cs create mode 100644 src/Ubik.Accounting.SalesOrVatTax.Api/Features/Accounts/Consumers/AccountUpdatedConsumer.cs diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Data/Config/AccountConfiguration.cs b/src/Ubik.Accounting.SalesOrVatTax.Api/Data/Config/AccountConfiguration.cs index fbc5f769..97916540 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Api/Data/Config/AccountConfiguration.cs +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Data/Config/AccountConfiguration.cs @@ -23,9 +23,6 @@ public void Configure(EntityTypeBuilder builder) .IsRequired() .HasDefaultValue(true); - builder.Property(a => a.Version) - .IsConcurrencyToken(); - builder.HasIndex(a => new { a.Code, a.TenantId }) .IsUnique(); diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Features/Accounts/Consumers/AccountAddedConsumer.cs b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/Accounts/Consumers/AccountAddedConsumer.cs index 1f01c2fc..5b57bfae 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Api/Features/Accounts/Consumers/AccountAddedConsumer.cs +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/Accounts/Consumers/AccountAddedConsumer.cs @@ -13,12 +13,13 @@ public async Task Consume(ConsumeContext context) } } - public class AccountAddedFaultConsumer : - IConsumer> - { - public async Task Consume(ConsumeContext> context) - { - //TODO: put in place a thing to manage msg faults - } - } + //TODO: put in place a thing to manage msg faults or manage that with error queues ?? + //public class AccountAddedFaultConsumer : + // IConsumer> + //{ + // public async Task Consume(ConsumeContext> context) + // { + + // } + //} } diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Features/Accounts/Consumers/AccountDeletedConsumer.cs b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/Accounts/Consumers/AccountDeletedConsumer.cs new file mode 100644 index 00000000..010de659 --- /dev/null +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/Accounts/Consumers/AccountDeletedConsumer.cs @@ -0,0 +1,14 @@ +using MassTransit; +using Ubik.Accounting.SalesOrVatTax.Api.Features.Accounts.Services; +using Ubik.Accounting.Structure.Contracts.Accounts.Events; + +namespace Ubik.Accounting.SalesOrVatTax.Api.Features.Accounts.Consumers +{ + public class AccountDeletedConsumer(IAccountCommandService commandService) : IConsumer + { + public async Task Consume(ConsumeContext context) + { + await commandService.DeleteAsync(context.Message.Id); + } + } +} diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Features/Accounts/Consumers/AccountUpdatedConsumer.cs b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/Accounts/Consumers/AccountUpdatedConsumer.cs new file mode 100644 index 00000000..071effdd --- /dev/null +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/Accounts/Consumers/AccountUpdatedConsumer.cs @@ -0,0 +1,14 @@ +using MassTransit; +using Ubik.Accounting.SalesOrVatTax.Api.Features.Accounts.Services; +using Ubik.Accounting.Structure.Contracts.Accounts.Events; + +namespace Ubik.Accounting.SalesOrVatTax.Api.Features.Accounts.Consumers +{ + public class AccountUpdatedConsumer(IAccountCommandService commandService) : IConsumer + { + public async Task Consume(ConsumeContext context) + { + await commandService.UpdateAsync(context.Message); + } + } +} diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Features/Accounts/Services/AccountCommandService.cs b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/Accounts/Services/AccountCommandService.cs index 6435b986..3951739b 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Api/Features/Accounts/Services/AccountCommandService.cs +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/Accounts/Services/AccountCommandService.cs @@ -1,4 +1,5 @@ -using Ubik.Accounting.SalesOrVatTax.Api.Data; +using Microsoft.EntityFrameworkCore; +using Ubik.Accounting.SalesOrVatTax.Api.Data; using Ubik.Accounting.SalesOrVatTax.Api.Mappers; using Ubik.Accounting.Structure.Contracts.Accounts.Events; @@ -6,10 +7,24 @@ namespace Ubik.Accounting.SalesOrVatTax.Api.Features.Accounts.Services { public class AccountCommandService(AccountingSalesTaxDbContext ctx) : IAccountCommandService { - public async Task AddAsync(AccountAdded account) + public async Task AddAsync(AccountAdded accountAdded) { - await ctx.Accounts.AddAsync(account.ToAccount()); + await ctx.Accounts.AddAsync(accountAdded.ToAccount()); await ctx.SaveChangesAsync(); } + + public async Task DeleteAsync(Guid accountId) + { + await ctx.Accounts.Where(a => a.Id == accountId).ExecuteDeleteAsync(); + } + + public async Task UpdateAsync(AccountUpdated accountUpdated) + { + await ctx.Accounts.Where(a => a.Id == accountUpdated.Id).ExecuteUpdateAsync(setters => setters + .SetProperty(b => b.Active, accountUpdated.Active) + .SetProperty(b => b.Version, accountUpdated.Version) + .SetProperty(b => b.Code, accountUpdated.Code) + .SetProperty(b => b.Label, accountUpdated.Label)); + } } } diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Features/Accounts/Services/IAccountCommandService.cs b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/Accounts/Services/IAccountCommandService.cs index 6106e713..d2cbd47e 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Api/Features/Accounts/Services/IAccountCommandService.cs +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/Accounts/Services/IAccountCommandService.cs @@ -4,6 +4,8 @@ namespace Ubik.Accounting.SalesOrVatTax.Api.Features.Accounts.Services { public interface IAccountCommandService { - public Task AddAsync(AccountAdded account); + public Task AddAsync(AccountAdded accountAdded); + public Task UpdateAsync(AccountUpdated accountUpdated); + public Task DeleteAsync(Guid accountId); } } From ea0f0eebb8be51062041fd5bac62a6bc2132c3fd Mon Sep 17 00:00:00 2001 From: ubik Date: Tue, 5 Nov 2024 15:17:46 +0100 Subject: [PATCH 45/94] renaming --- src/Ubik.Accounting.SalesOrVatTax.Api/Program.cs | 2 +- .../AccountTaxRateConfigsController_Test.cs} | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) rename tests/Ubik.Api.Tests.Integration/Features/Accounting/SalesOrVatTax/{AccountLinkedTaxRates/AccountingLinkedTaxRatesController_Test.cs => AccountTaxRateConfigs/AccountTaxRateConfigsController_Test.cs} (98%) diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Program.cs b/src/Ubik.Accounting.SalesOrVatTax.Api/Program.cs index b56ae604..53d02b7d 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Api/Program.cs +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Program.cs @@ -53,7 +53,7 @@ configurator.ConfigureEndpoints(context); - //TODO:review that + //TODO:review that Maybe not needed.... it was before I have the Yarp proxy... //Use to pass tenantid when message broker is used to contact the api (async) //configurator.UseSendFilter(typeof(TenantIdSendFilter<>), context); configurator.UsePublishFilter(typeof(TenantIdPublishFilter<>), context); diff --git a/tests/Ubik.Api.Tests.Integration/Features/Accounting/SalesOrVatTax/AccountLinkedTaxRates/AccountingLinkedTaxRatesController_Test.cs b/tests/Ubik.Api.Tests.Integration/Features/Accounting/SalesOrVatTax/AccountTaxRateConfigs/AccountTaxRateConfigsController_Test.cs similarity index 98% rename from tests/Ubik.Api.Tests.Integration/Features/Accounting/SalesOrVatTax/AccountLinkedTaxRates/AccountingLinkedTaxRatesController_Test.cs rename to tests/Ubik.Api.Tests.Integration/Features/Accounting/SalesOrVatTax/AccountTaxRateConfigs/AccountTaxRateConfigsController_Test.cs index 0b1fb678..30002995 100644 --- a/tests/Ubik.Api.Tests.Integration/Features/Accounting/SalesOrVatTax/AccountLinkedTaxRates/AccountingLinkedTaxRatesController_Test.cs +++ b/tests/Ubik.Api.Tests.Integration/Features/Accounting/SalesOrVatTax/AccountTaxRateConfigs/AccountTaxRateConfigsController_Test.cs @@ -7,15 +7,15 @@ using MassTransit; using Ubik.Accounting.SalesOrVatTax.Contracts.AccountTaxRateConfigs.Commands; -namespace Ubik.Api.Tests.Integration.Features.Accounting.SalesOrVatTax.AccountLinkedTaxRates +namespace Ubik.Api.Tests.Integration.Features.Accounting.SalesOrVatTax.AccountTaxRateConfigs { - public class AccountingLinkedTaxRatesController_Test : BaseIntegrationTestAccountingSalesVatTax + public class AccountTaxRateConfigsController_Test : BaseIntegrationTestAccountingSalesVatTax { private readonly string _baseUrlForV1; private readonly HttpClient _client; - public AccountingLinkedTaxRatesController_Test(IntegrationTestProxyFactory factory) : base(factory) + public AccountTaxRateConfigsController_Test(IntegrationTestProxyFactory factory) : base(factory) { _baseUrlForV1 = "/accounting/api/v1"; _client = Factory.CreateDefaultClient(); From 7c1ab14caf289801f3d4bbf4a49ee87569cb5713 Mon Sep 17 00:00:00 2001 From: ubik Date: Tue, 5 Nov 2024 15:56:55 +0100 Subject: [PATCH 46/94] Remove useless navigation property I don't use. --- .../AccountAccountGroupConfiguration.cs | 4 +- .../Data/Config/AccountConfiguration.cs | 5 +- .../Data/Config/AccountGroupConfiguration.cs | 8 +- .../Data/Init/AccountsData.sql | 534 +++++++++--------- .../Models/Account.cs | 1 - .../Models/AccountAccountGroup.cs | 2 - .../Models/AccountGroup.cs | 4 - .../Models/Classification.cs | 2 - .../Models/Entry.cs | 6 + .../Program.cs | 144 +++++ .../Properties/launchSettings.json | 41 ++ .../Ubik.Accounting.Transaction.Api.csproj | 20 + .../Ubik.Accounting.Transaction.Api.http | 6 + .../appsettings.Development.json | 8 + .../appsettings.json | 29 + src/Ubik.sln | 10 +- 16 files changed, 537 insertions(+), 287 deletions(-) create mode 100644 src/Ubik.Accounting.Transaction.Api/Models/Entry.cs create mode 100644 src/Ubik.Accounting.Transaction.Api/Program.cs create mode 100644 src/Ubik.Accounting.Transaction.Api/Properties/launchSettings.json create mode 100644 src/Ubik.Accounting.Transaction.Api/Ubik.Accounting.Transaction.Api.csproj create mode 100644 src/Ubik.Accounting.Transaction.Api/Ubik.Accounting.Transaction.Api.http create mode 100644 src/Ubik.Accounting.Transaction.Api/appsettings.Development.json create mode 100644 src/Ubik.Accounting.Transaction.Api/appsettings.json diff --git a/src/Ubik.Accounting.Structure.Api/Data/Config/AccountAccountGroupConfiguration.cs b/src/Ubik.Accounting.Structure.Api/Data/Config/AccountAccountGroupConfiguration.cs index 8784541f..4c41ec2f 100644 --- a/src/Ubik.Accounting.Structure.Api/Data/Config/AccountAccountGroupConfiguration.cs +++ b/src/Ubik.Accounting.Structure.Api/Data/Config/AccountAccountGroupConfiguration.cs @@ -23,12 +23,12 @@ public void Configure(EntityTypeBuilder builder) builder.HasIndex(a => a.TenantId); builder - .HasOne(e => e.Account) + .HasOne() .WithMany() .HasForeignKey(e => e.AccountId).OnDelete(DeleteBehavior.Cascade); builder - .HasOne(e => e.AccountGroup) + .HasOne() .WithMany() .HasForeignKey(e => e.AccountGroupId).OnDelete(DeleteBehavior.Cascade); } diff --git a/src/Ubik.Accounting.Structure.Api/Data/Config/AccountConfiguration.cs b/src/Ubik.Accounting.Structure.Api/Data/Config/AccountConfiguration.cs index 07c9afde..f50264a9 100644 --- a/src/Ubik.Accounting.Structure.Api/Data/Config/AccountConfiguration.cs +++ b/src/Ubik.Accounting.Structure.Api/Data/Config/AccountConfiguration.cs @@ -49,10 +49,9 @@ public void Configure(EntityTypeBuilder builder) .IsRequired() .HasConversion(); - builder - .HasOne(s => s.Currency) + builder.HasOne() .WithMany() - .HasForeignKey(e => e.CurrencyId) + .HasForeignKey(a => a.CurrencyId).OnDelete(DeleteBehavior.Restrict) .IsRequired(true); } } diff --git a/src/Ubik.Accounting.Structure.Api/Data/Config/AccountGroupConfiguration.cs b/src/Ubik.Accounting.Structure.Api/Data/Config/AccountGroupConfiguration.cs index 6b06e9ed..ff7b5999 100644 --- a/src/Ubik.Accounting.Structure.Api/Data/Config/AccountGroupConfiguration.cs +++ b/src/Ubik.Accounting.Structure.Api/Data/Config/AccountGroupConfiguration.cs @@ -39,14 +39,14 @@ public void Configure(EntityTypeBuilder builder) builder.HasIndex(a => a.TenantId); builder - .HasOne(s => s.ParentAccountGroup) - .WithMany(m => m.ChildrenAccountGroups) + .HasOne() + .WithMany() .HasForeignKey(e => e.ParentAccountGroupId).OnDelete(DeleteBehavior.Cascade) .IsRequired(false); builder - .HasOne(a => a.Classification) - .WithMany(g => g.OwnedAccountGroups) + .HasOne() + .WithMany() .HasForeignKey(b => b.ClassificationId).OnDelete(DeleteBehavior.Cascade) .IsRequired(true); } diff --git a/src/Ubik.Accounting.Structure.Api/Data/Init/AccountsData.sql b/src/Ubik.Accounting.Structure.Api/Data/Init/AccountsData.sql index 71d2a650..e02ceaad 100644 --- a/src/Ubik.Accounting.Structure.Api/Data/Init/AccountsData.sql +++ b/src/Ubik.Accounting.Structure.Api/Data/Init/AccountsData.sql @@ -1,270 +1,270 @@ -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('248e0000-5dd4-0015-e321-08dcd98b1434', '1020', 'Bank', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, true, '248e0000-5dd4-0015-f549-08dcd98b1434', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-20 15:44:14.246399+00', '248e0000-5dd4-0015-82b6-08dcd98b1434', '2024-09-20 15:44:14.246399+00', '248e0000-5dd4-0015-82b6-08dcd98b1434', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('248e0000-5dd4-0015-f110-08dcd98b20af', '1060', 'Securities', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, true, '248e0000-5dd4-0015-f77f-08dcd98b20af', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-20 15:44:35.185238+00', '248e0000-5dd4-0015-96cf-08dcd98b20af', '2024-09-20 15:44:35.185238+00', '248e0000-5dd4-0015-96cf-08dcd98b20af', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('248e0000-5dd4-0015-aa2d-08dcd98b2ad0', '1100', 'Trade accounts receivable', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, true, '248e0000-5dd4-0015-b397-08dcd98b2ad0', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-20 15:44:52.176984+00', '248e0000-5dd4-0015-6a71-08dcd98b2ad0', '2024-09-20 15:44:52.176984+00', '248e0000-5dd4-0015-6a71-08dcd98b2ad0', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('248e0000-5dd4-0015-12f9-08dcd98b3350', '1101', 'Credit card receivables', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, true, '248e0000-5dd4-0015-1822-08dcd98b3350', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-20 15:45:06.433634+00', '248e0000-5dd4-0015-c5b4-08dcd98b334f', '2024-09-20 15:45:06.433634+00', '248e0000-5dd4-0015-c5b4-08dcd98b334f', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('248e0000-5dd4-0015-8db2-08dcd98b3c4c', '1109', 'Provision for credit losses (Ducroire)', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, true, '248e0000-5dd4-0015-928a-08dcd98b3c4c', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-20 15:45:21.51005+00', '248e0000-5dd4-0015-4fa9-08dcd98b3c4c', '2024-09-20 15:45:21.51005+00', '248e0000-5dd4-0015-4fa9-08dcd98b3c4c', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('248e0000-5dd4-0015-48fb-08dcd98b4a28', '1140', 'Advances and loans granted', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, true, '248e0000-5dd4-0015-4df0-08dcd98b4a28', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-20 15:45:44.760468+00', '248e0000-5dd4-0015-0819-08dcd98b4a28', '2024-09-20 15:45:44.760468+00', '248e0000-5dd4-0015-0819-08dcd98b4a28', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('248e0000-5dd4-0015-13fe-08dcd98b6d70', '1176', 'Withholding tax recoverable', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, true, '248e0000-5dd4-0015-19ed-08dcd98b6d70', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-20 15:46:43.951252+00', '248e0000-5dd4-0015-d6be-08dcd98b6d6f', '2024-09-20 15:46:43.951252+00', '248e0000-5dd4-0015-d6be-08dcd98b6d6f', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('248e0000-5dd4-0015-fff6-08dcd98b746a', '1190', 'Other short-term receivables', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, true, '248e0000-5dd4-0015-04ac-08dcd98b746b', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-20 15:46:55.66199+00', '248e0000-5dd4-0015-b7ad-08dcd98b746a', '2024-09-20 15:46:55.66199+00', '248e0000-5dd4-0015-b7ad-08dcd98b746a', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('248e0000-5dd4-0015-ebad-08dcd98b0949', '1000', 'Case', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, true, '248e0000-5dd4-0015-a737-08dcd98bcb2b', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-20 15:43:55.975757+00', '248e0000-5dd4-0015-6140-08dcd98b0948', '2024-09-20 15:49:21.2085+00', '248e0000-5dd4-0015-9b0a-08dcd98bcb2a', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('78920000-5dd4-0015-3c01-08dcd9a7702b', '1400', 'Long-term securities', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, true, '78920000-5dd4-0015-18d4-08dcd9a7702e', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-20 19:07:14.460177+00', '78920000-5dd4-0015-4355-08dcd9a7702a', '2024-09-20 19:07:14.460177+00', '78920000-5dd4-0015-4355-08dcd9a7702a', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('78920000-5dd4-0015-eaeb-08dcd9a778d2', '1440', 'Long-term loans', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, true, '78920000-5dd4-0015-f445-08dcd9a778d2', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-20 19:07:28.962431+00', '78920000-5dd4-0015-9b32-08dcd9a778d2', '2024-09-20 19:07:28.962431+00', '78920000-5dd4-0015-9b32-08dcd9a778d2', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('78920000-5dd4-0015-6f96-08dcd9a78046', '1441', 'Mortgage loans', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, true, '78920000-5dd4-0015-7a90-08dcd9a78046', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-20 19:07:41.463613+00', '78920000-5dd4-0015-07eb-08dcd9a78046', '2024-09-20 19:07:41.463613+00', '78920000-5dd4-0015-07eb-08dcd9a78046', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('248e0000-5dd4-0015-443b-08dcd98b545d', '1170', 'VAT input tax (materials, services)', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, true, '78920000-5dd4-0015-983d-08dcd9a9beab', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-20 15:46:01.884919+00', '248e0000-5dd4-0015-fd7b-08dcd98b545c', '2024-09-20 19:23:45.138485+00', '78920000-5dd4-0015-b5e7-08dcd9a9beaa', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('248e0000-5dd4-0015-133a-08dcd98b5d1d', '1171', 'VAT input tax (investments and other charges)', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, true, '78920000-5dd4-0015-c8f5-08dcd9a9c7da', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-20 15:46:16.563738+00', '248e0000-5dd4-0015-d52d-08dcd98b5d1c', '2024-09-20 19:24:00.547247+00', '78920000-5dd4-0015-5fc5-08dcd9a9c7da', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('248e0000-5dd4-0015-c1ce-08dcd98b7c74', '1200', 'Inventory A', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, true, '78920000-5dd4-0015-f39f-08dcd9a9f93e', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-20 15:47:09.147723+00', '248e0000-5dd4-0015-8552-08dcd98b7c74', '2024-09-20 19:25:23.412058+00', '78920000-5dd4-0015-8587-08dcd9a9f93e', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('248e0000-5dd4-0015-2c01-08dcd98b8441', '1201', 'Inventory B', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, true, '78920000-5dd4-0015-2de6-08dcd9aa042a', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-20 15:47:22.2314+00', '248e0000-5dd4-0015-eccf-08dcd98b8440', '2024-09-20 19:25:41.730861+00', '78920000-5dd4-0015-cf23-08dcd9aa0429', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('248e0000-5dd4-0015-9008-08dcd98b8c12', '1209', 'Inventory valuation adjustments', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, true, '78920000-5dd4-0015-3a44-08dcd9aa0fb7', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-20 15:47:35.347754+00', '248e0000-5dd4-0015-51cb-08dcd98b8c12', '2024-09-20 19:26:01.110173+00', '78920000-5dd4-0015-e306-08dcd9aa0fb6', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('248e0000-5dd4-0015-7165-08dcd98bbffa', '1300', 'Prepaid expenses', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, true, '78920000-5dd4-0015-392d-08dcd9aa2c96', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-20 15:49:02.431183+00', '248e0000-5dd4-0015-3458-08dcd98bbffa', '2024-09-20 19:26:49.547803+00', '78920000-5dd4-0015-e398-08dcd9aa2c95', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('78920000-5dd4-0015-23e7-08dcd9aa3ba7', '1301', 'Receivables for products and services', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, true, '78920000-5dd4-0015-2a3d-08dcd9aa3ba7', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-20 19:27:14.824656+00', '78920000-5dd4-0015-e8fa-08dcd9aa3ba6', '2024-09-20 19:27:14.824656+00', '78920000-5dd4-0015-e8fa-08dcd9aa3ba6', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-3815-08dcda1dad9e', '1522', 'Communication systems', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, true, 'ec860000-5dd4-0015-3d50-08dcda1dad9e', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 09:13:38.150329+00', 'ec860000-5dd4-0015-f890-08dcda1dad9d', '2024-09-21 09:13:38.150329+00', 'ec860000-5dd4-0015-f890-08dcda1dad9d', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('78920000-5dd4-0015-0644-08dcd9aaf581', '1409', 'Valuation adjustments on long-term invest', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, true, '78920000-5dd4-0015-c298-08dcd9aaffac', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-20 19:32:26.631035+00', '78920000-5dd4-0015-cfd2-08dcd9aaf580', '2024-09-20 19:32:43.694758+00', '78920000-5dd4-0015-7106-08dcd9aaffac', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('78920000-5dd4-0015-a5ff-08dcd9a7ab43', '1449', 'Valuation adjustments on long-term loans', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, true, '78920000-5dd4-0015-c376-08dcd9ab07a8', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-20 19:08:53.587235+00', '78920000-5dd4-0015-6ce0-08dcd9a7ab43', '2024-09-20 19:32:57.090339+00', '78920000-5dd4-0015-7322-08dcd9ab07a8', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-1c93-08dcda1d182f', '1500', 'Machinery and equipment', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, true, 'ec860000-5dd4-0015-ba47-08dcda1d1831', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 09:09:27.458513+00', 'ec860000-5dd4-0015-22f0-08dcda1d182e', '2024-09-21 09:09:27.458513+00', 'ec860000-5dd4-0015-22f0-08dcda1d182e', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-b48d-08dcda1d22ef', '1510', 'Operating furniture', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, true, 'ec860000-5dd4-0015-bc9f-08dcda1d22ef', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 09:09:45.481106+00', 'ec860000-5dd4-0015-6f4b-08dcda1d22ef', '2024-09-21 09:09:45.481106+00', 'ec860000-5dd4-0015-6f4b-08dcda1d22ef', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-061c-08dcda1d2bc2', '1511', 'Workshop installations', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, true, 'ec860000-5dd4-0015-0fca-08dcda1d2bc2', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 09:10:00.281281+00', 'ec860000-5dd4-0015-abdc-08dcda1d2bc1', '2024-09-21 09:10:00.281281+00', 'ec860000-5dd4-0015-abdc-08dcda1d2bc1', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-ddf3-08dcda1d3498', '1512', 'Warehouse installations', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, true, 'ec860000-5dd4-0015-e2f2-08dcda1d3498', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 09:10:15.110931+00', 'ec860000-5dd4-0015-9216-08dcda1d3498', '2024-09-21 09:10:15.110931+00', 'ec860000-5dd4-0015-9216-08dcda1d3498', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-bc68-08dcda1d47f5', '1513', 'Office furniture', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, true, 'ec860000-5dd4-0015-c79e-08dcda1d47f5', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 09:10:47.596415+00', 'ec860000-5dd4-0015-7155-08dcda1d47f5', '2024-09-21 09:10:47.596415+00', 'ec860000-5dd4-0015-7155-08dcda1d47f5', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-a24f-08dcda1d9931', '1520', 'Office machines', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, true, 'ec860000-5dd4-0015-a781-08dcda1d9931', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 09:13:03.884272+00', 'ec860000-5dd4-0015-64bb-08dcda1d9931', '2024-09-21 09:13:03.884272+00', 'ec860000-5dd4-0015-64bb-08dcda1d9931', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-9192-08dcda1da58d', '1521', 'IT infrastructure', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, true, 'ec860000-5dd4-0015-99c4-08dcda1da58d', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 09:13:24.619511+00', 'ec860000-5dd4-0015-5284-08dcda1da58d', '2024-09-21 09:13:24.619511+00', 'ec860000-5dd4-0015-5284-08dcda1da58d', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-0173-08dcda1db8d7', '1530', 'Cars', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, true, 'ec860000-5dd4-0015-07a9-08dcda1db8d7', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 09:13:56.977448+00', 'ec860000-5dd4-0015-c4b2-08dcda1db8d6', '2024-09-21 09:13:56.977448+00', 'ec860000-5dd4-0015-c4b2-08dcda1db8d6', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-d472-08dcda1dc37c', '1540', 'Tools and equipment', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, true, 'ec860000-5dd4-0015-da04-08dcda1dc37c', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 09:14:14.841393+00', 'ec860000-5dd4-0015-8fa4-08dcda1dc37c', '2024-09-21 09:14:14.841393+00', 'ec860000-5dd4-0015-8fa4-08dcda1dc37c', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-66d1-08dcda1dd26b', '1550', 'Storage facilities', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, true, 'ec860000-5dd4-0015-6c02-08dcda1dd26b', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 09:14:39.892989+00', 'ec860000-5dd4-0015-2c65-08dcda1dd26b', '2024-09-21 09:14:39.892989+00', 'ec860000-5dd4-0015-2c65-08dcda1dd26b', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-11c5-08dcda1de501', '1590', 'Work clothing and uniforms', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, true, 'ec860000-5dd4-0015-1701-08dcda1de501', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 09:15:11.072842+00', 'ec860000-5dd4-0015-c7c0-08dcda1de500', '2024-09-21 09:15:11.072842+00', 'ec860000-5dd4-0015-c7c0-08dcda1de500', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-3436-08dcda1eb6ce', '1600', 'Operating buildings', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, true, 'ec860000-5dd4-0015-3c3a-08dcda1eb6ce', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 09:21:03.061097+00', 'ec860000-5dd4-0015-f17e-08dcda1eb6cd', '2024-09-21 09:21:03.061097+00', 'ec860000-5dd4-0015-f17e-08dcda1eb6cd', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-f0cf-08dcda1ebfe4', '1601', 'Maintenance, repair, or replacement', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, true, 'ec860000-5dd4-0015-f4d3-08dcda1ebfe4', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 09:21:18.309497+00', 'ec860000-5dd4-0015-b24f-08dcda1ebfe4', '2024-09-21 09:21:18.309497+00', 'ec860000-5dd4-0015-b24f-08dcda1ebfe4', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-12a2-08dcda1ed305', '1800', 'Incorporation costs', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, true, 'ec860000-5dd4-0015-16a9-08dcda1ed305', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 09:21:50.396788+00', 'ec860000-5dd4-0015-dc9f-08dcda1ed304', '2024-09-21 09:21:50.396788+00', 'ec860000-5dd4-0015-dc9f-08dcda1ed304', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-69c4-08dcda1edb78', '1801', 'Capital increase costs', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, true, 'ec860000-5dd4-0015-0c65-08dcda1ef2e0', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 09:22:04.57447+00', 'ec860000-5dd4-0015-2fad-08dcda1edb78', '2024-09-21 09:22:43.841132+00', 'ec860000-5dd4-0015-ce10-08dcda1ef2dc', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-7012-08dcda1ef826', '1802', 'Organizational costs', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, true, 'ec860000-5dd4-0015-74d8-08dcda1ef826', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 09:22:52.691167+00', 'ec860000-5dd4-0015-328c-08dcda1ef826', '2024-09-21 09:22:52.691167+00', 'ec860000-5dd4-0015-328c-08dcda1ef826', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-ef03-08dcda1f0104', '1850', 'Unissued share capital', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, true, 'ec860000-5dd4-0015-f553-08dcda1f0104', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 09:23:07.571128+00', 'ec860000-5dd4-0015-b6d7-08dcda1f0104', '2024-09-21 09:23:07.571128+00', 'ec860000-5dd4-0015-b6d7-08dcda1f0104', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-c9fe-08dcda1f08eb', '1859', 'Valuation adjustments on unissued share capital', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, true, 'ec860000-5dd4-0015-d01a-08dcda1f08eb', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 09:23:20.828106+00', 'ec860000-5dd4-0015-8f49-08dcda1f08eb', '2024-09-21 09:23:20.828106+00', 'ec860000-5dd4-0015-8f49-08dcda1f08eb', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-5955-08dcda1eca12', '1609', 'Accumulated depreciation on operating buildings', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, true, 'ec860000-5dd4-0015-df72-08dcda1f3dbc', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 09:21:35.384328+00', 'ec860000-5dd4-0015-1779-08dcda1eca12', '2024-09-21 09:24:49.439727+00', 'ec860000-5dd4-0015-7f88-08dcda1f3dbc', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-1cc9-08dcda20a76e', '2000', 'Liabilities for purchases of materials and goods', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'ec860000-5dd4-0015-234c-08dcda20a76e', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 09:34:56.258948+00', 'ec860000-5dd4-0015-d485-08dcda20a76d', '2024-09-21 09:34:56.258948+00', 'ec860000-5dd4-0015-d485-08dcda20a76d', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-98ee-08dcda20b16e', '2001', 'Liabilities for services to third parties', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'ec860000-5dd4-0015-9c96-08dcda20b16e', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 09:35:13.03927+00', 'ec860000-5dd4-0015-54b2-08dcda20b16e', '2024-09-21 09:35:13.03927+00', 'ec860000-5dd4-0015-54b2-08dcda20b16e', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-1ecb-08dcda20bb14', '2002', 'Liabilities for personnel expenses', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'ec860000-5dd4-0015-22db-08dcda20bb14', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 09:35:29.223545+00', 'ec860000-5dd4-0015-e775-08dcda20bb13', '2024-09-21 09:35:29.223545+00', 'ec860000-5dd4-0015-e775-08dcda20bb13', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-54dd-08dcda20c7a0', '2003', 'Liabilities for social security contributions', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'ec860000-5dd4-0015-5874-08dcda20c7a0', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 09:35:50.27508+00', 'ec860000-5dd4-0015-1355-08dcda20c7a0', '2024-09-21 09:35:50.27508+00', 'ec860000-5dd4-0015-1355-08dcda20c7a0', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-e6b0-08dcda20d5dd', '2005', 'Liabilities for lease transactions', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'ec860000-5dd4-0015-eac7-08dcda20d5dd', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 09:36:14.166698+00', 'ec860000-5dd4-0015-aa83-08dcda20d5dd', '2024-09-21 09:36:14.166698+00', 'ec860000-5dd4-0015-aa83-08dcda20d5dd', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-a0ad-08dcda20cecb', '2004', 'Liabilities for other operating expenses', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'ec860000-5dd4-0015-6c4d-08dcda210823', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 09:36:02.302981+00', 'ec860000-5dd4-0015-5611-08dcda20cecb', '2024-09-21 09:37:38.508292+00', 'ec860000-5dd4-0015-06fc-08dcda210823', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-aa11-08dcda2fe630', '2030', 'Customer advances', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'ec860000-5dd4-0015-aee3-08dcda2fe630', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 11:24:04.003603+00', 'ec860000-5dd4-0015-65c2-08dcda2fe630', '2024-09-21 11:24:04.003603+00', 'ec860000-5dd4-0015-65c2-08dcda2fe630', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-4e95-08dcda2ff13b', '2100', 'Short-term bank liabilities', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'ec860000-5dd4-0015-5350-08dcda2ff13b', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 11:24:22.528287+00', 'ec860000-5dd4-0015-16de-08dcda2ff13b', '2024-09-21 11:24:22.528287+00', 'ec860000-5dd4-0015-16de-08dcda2ff13b', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-2d5c-08dcda306250', '2110', 'Liabilities to post offices', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'ec860000-5dd4-0015-3149-08dcda306250', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 11:27:32.247582+00', 'ec860000-5dd4-0015-e704-08dcda30624f', '2024-09-21 11:27:32.247582+00', 'ec860000-5dd4-0015-e704-08dcda30624f', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-ce96-08dcda306be5', '2111', 'Liabilities to transfer companies', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'ec860000-5dd4-0015-d394-08dcda306be5', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 11:27:48.327714+00', 'ec860000-5dd4-0015-9a17-08dcda306be5', '2024-09-21 11:27:48.327714+00', 'ec860000-5dd4-0015-9a17-08dcda306be5', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-0733-08dcda307df9', '2160', 'Short-term financial liabilities to shareholder X', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'ec860000-5dd4-0015-0a00-08dcda307df9', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 11:28:18.652618+00', 'ec860000-5dd4-0015-cc3c-08dcda307df8', '2024-09-21 11:28:18.652618+00', 'ec860000-5dd4-0015-cc3c-08dcda307df8', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-5593-08dcda308633', '2170', 'Short-term financial liabilities to pension funds', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'ec860000-5dd4-0015-584c-08dcda308633', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 11:28:32.456504+00', 'ec860000-5dd4-0015-22f5-08dcda308633', '2024-09-21 11:28:32.456504+00', 'ec860000-5dd4-0015-22f5-08dcda308633', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-e456-08dcda308e53', '2180', 'Mortgage repayments', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'ec860000-5dd4-0015-e818-08dcda308e53', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 11:28:46.091673+00', 'ec860000-5dd4-0015-a822-08dcda308e53', '2024-09-21 11:28:46.091673+00', 'ec860000-5dd4-0015-a822-08dcda308e53', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-a892-08dcda3094b8', '2181', 'Loan repayments', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'ec860000-5dd4-0015-ad23-08dcda3094b8', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 11:28:56.818407+00', 'ec860000-5dd4-0015-6730-08dcda3094b8', '2024-09-21 11:28:56.818407+00', 'ec860000-5dd4-0015-6730-08dcda3094b8', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-2309-08dcda309b7b', '2200', 'VAT payable', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'ec860000-5dd4-0015-25fe-08dcda309b7b', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 11:29:08.159225+00', 'ec860000-5dd4-0015-e51f-08dcda309b7a', '2024-09-21 11:29:08.159225+00', 'ec860000-5dd4-0015-e51f-08dcda309b7a', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-e12c-08dcda30a42e', '2205', 'AFC - VAT', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'ec860000-5dd4-0015-e3a2-08dcda30a42e', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 11:29:22.758951+00', 'ec860000-5dd4-0015-a414-08dcda30a42e', '2024-09-21 11:29:22.758951+00', 'ec860000-5dd4-0015-a414-08dcda30a42e', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-e7f6-08dcda30aa7d', '2206', 'Due withholding tax', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'ec860000-5dd4-0015-ecc0-08dcda30aa7d', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 11:29:33.343248+00', 'ec860000-5dd4-0015-ac71-08dcda30aa7d', '2024-09-21 11:29:33.343248+00', 'ec860000-5dd4-0015-ac71-08dcda30aa7d', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-2192-08dcda30b1de', '2207', 'Due stamp duties', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'ec860000-5dd4-0015-2506-08dcda30b1de', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 11:29:45.717886+00', 'ec860000-5dd4-0015-e8d4-08dcda30b1dd', '2024-09-21 11:29:45.717886+00', 'ec860000-5dd4-0015-e8d4-08dcda30b1dd', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-0ce3-08dcda30bd7f', '2208', 'Due direct taxes', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'ec860000-5dd4-0015-0f91-08dcda30bd7f', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 11:30:05.227404+00', 'ec860000-5dd4-0015-d700-08dcda30bd7e', '2024-09-21 11:30:05.227404+00', 'ec860000-5dd4-0015-d700-08dcda30bd7e', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-8e25-08dcda30c7bb', '2230', 'Unclaimed dividends for the year', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', ' ', 0, 1, true, 'ec860000-5dd4-0015-9ad3-08dcda30c7bb', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 11:30:22.4014+00', 'ec860000-5dd4-0015-3ab6-08dcda30c7bb', '2024-09-21 11:30:22.4014+00', 'ec860000-5dd4-0015-3ab6-08dcda30c7bb', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-3043-08dcda30ce50', '2231', 'Unclaimed dividends from previous years', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'ec860000-5dd4-0015-3371-08dcda30ce50', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 11:30:33.44157+00', 'ec860000-5dd4-0015-f2a8-08dcda30ce4f', '2024-09-21 11:30:33.44157+00', 'ec860000-5dd4-0015-f2a8-08dcda30ce4f', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-8e4f-08dcda30d697', '2232', 'Unclaimed bond coupons', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'ec860000-5dd4-0015-90fc-08dcda30d697', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 11:30:47.331043+00', 'ec860000-5dd4-0015-57e3-08dcda30d697', '2024-09-21 11:30:47.331043+00', 'ec860000-5dd4-0015-57e3-08dcda30d697', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-e4a1-08dcda3073d0', '2140', 'Other short-term financial liabilities to third parties', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'ec860000-5dd4-0015-5fe2-08dcda316bc3', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 11:28:01.612408+00', 'ec860000-5dd4-0015-acc9-08dcda3073d0', '2024-09-21 11:34:57.598663+00', 'ec860000-5dd4-0015-0e84-08dcda316bc3', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-f91d-08dcda52f00f', '2300', 'Accrued expenses', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'ec860000-5dd4-0015-fcae-08dcda52f00f', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:34:52.952078+00', 'ec860000-5dd4-0015-bb3e-08dcda52f00f', '2024-09-21 15:34:52.952078+00', 'ec860000-5dd4-0015-bb3e-08dcda52f00f', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-b39d-08dcda530d2c', '2301', 'Prepaid income', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'ec860000-5dd4-0015-b78d-08dcda530d2c', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:35:41.794289+00', 'ec860000-5dd4-0015-6e60-08dcda530d2c', '2024-09-21 15:35:41.794289+00', 'ec860000-5dd4-0015-6e60-08dcda530d2c', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-01b3-08dcda531ef9', '2340', 'Provisions for direct taxes', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'ec860000-5dd4-0015-04a4-08dcda531ef9', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:36:11.654464+00', 'ec860000-5dd4-0015-b543-08dcda531ef8', '2024-09-21 15:36:11.654464+00', 'ec860000-5dd4-0015-b543-08dcda531ef8', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('ec860000-5dd4-0015-b414-08dcda532935', '2341', 'Provisions for indirect taxes', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'ec860000-5dd4-0015-b722-08dcda532935', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:36:28.829466+00', 'ec860000-5dd4-0015-7e9c-08dcda532935', '2024-09-21 15:36:28.829466+00', 'ec860000-5dd4-0015-7e9c-08dcda532935', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('dc610000-5dd4-0015-07cd-08dcda5647e1', '2400', 'Long-term bank liabilities', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'dc610000-5dd4-0015-1264-08dcda5647e8', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:58:48.819721+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', '2024-09-21 15:58:48.819721+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('dc610000-5dd4-0015-3646-08dcda5647ed', '2420', 'Liabilities from lease transactions', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'dc610000-5dd4-0015-7f38-08dcda5647ed', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:58:48.855676+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', '2024-09-21 15:58:48.855676+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('dc610000-5dd4-0015-15f0-08dcda5647ee', '2440', 'Mortgages on operating buildings', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'dc610000-5dd4-0015-1a65-08dcda5647ee', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:58:48.859705+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', '2024-09-21 15:58:48.859705+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('dc610000-5dd4-0015-c1ff-08dcda5647ee', '2500', 'Long-term loans from third parties', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'dc610000-5dd4-0015-c778-08dcda5647ee', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:58:48.864136+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', '2024-09-21 15:58:48.864136+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('dc610000-5dd4-0015-41c7-08dcda5647ef', '2560', 'Long-term loans to shareholders', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'dc610000-5dd4-0015-4659-08dcda5647ef', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:58:48.867383+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', '2024-09-21 15:58:48.867383+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('dc610000-5dd4-0015-c36a-08dcda5647ef', '2570', 'Long-term loans to pension funds', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'dc610000-5dd4-0015-ca17-08dcda5647ef', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:58:48.870751+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', '2024-09-21 15:58:48.870751+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('dc610000-5dd4-0015-46c8-08dcda5647f0', '2600', 'Provision for repairs', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'dc610000-5dd4-0015-4c69-08dcda5647f0', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:58:48.87409+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', '2024-09-21 15:58:48.87409+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('dc610000-5dd4-0015-ee99-08dcda5647f0', '2601', 'Provision for renovations', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'dc610000-5dd4-0015-f646-08dcda5647f0', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:58:48.878441+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', '2024-09-21 15:58:48.878441+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('dc610000-5dd4-0015-724d-08dcda5647f1', '2602', 'Provision for refurbishments', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'dc610000-5dd4-0015-7965-08dcda5647f1', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:58:48.881798+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', '2024-09-21 15:58:48.881798+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('dc610000-5dd4-0015-0363-08dcda5647f2', '2630', 'Provisions for warranty work', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'dc610000-5dd4-0015-0adf-08dcda5647f2', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:58:48.885515+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', '2024-09-21 15:58:48.885515+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('dc610000-5dd4-0015-83b1-08dcda5647f2', '2800', 'Equity', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'dc610000-5dd4-0015-8a8d-08dcda5647f2', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:58:48.888787+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', '2024-09-21 15:58:48.888787+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('dc610000-5dd4-0015-39bb-08dcda5647f3', '2801', 'Spouse''s equity', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'dc610000-5dd4-0015-430c-08dcda5647f3', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:58:48.893469+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', '2024-09-21 15:58:48.893469+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('dc610000-5dd4-0015-bbae-08dcda5647f3', '2810', 'Partner A''s capital account', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'dc610000-5dd4-0015-d5a8-08dcda5647f3', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:58:48.897265+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', '2024-09-21 15:58:48.897265+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('dc610000-5dd4-0015-5509-08dcda5647f4', '2811', 'Partner B''s capital account', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'dc610000-5dd4-0015-5da7-08dcda5647f4', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:58:48.900745+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', '2024-09-21 15:58:48.900745+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('dc610000-5dd4-0015-dac6-08dcda5647f4', '2812', 'Commandite partner C''s capital account', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'dc610000-5dd4-0015-e3fa-08dcda5647f4', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:58:48.904186+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', '2024-09-21 15:58:48.904186+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('dc610000-5dd4-0015-8943-08dcda5647f5', '2820', 'Share capital of the LLC', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'dc610000-5dd4-0015-921d-08dcda5647f5', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:58:48.908642+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', '2024-09-21 15:58:48.908642+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('dc610000-5dd4-0015-0ffd-08dcda5647f6', '2840', 'Share capital', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'dc610000-5dd4-0015-19d0-08dcda5647f6', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:58:48.912116+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', '2024-09-21 15:58:48.912116+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('dc610000-5dd4-0015-95c3-08dcda5647f6', '2841', 'Participation capital', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'dc610000-5dd4-0015-9fba-08dcda5647f6', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:58:48.915542+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', '2024-09-21 15:58:48.915542+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('dc610000-5dd4-0015-1c3a-08dcda5647f7', '2850', 'Private cash withdrawals', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'dc610000-5dd4-0015-2641-08dcda5647f7', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:58:48.91899+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', '2024-09-21 15:58:48.91899+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('dc610000-5dd4-0015-c85d-08dcda5647f7', '2851', 'Private in-kind withdrawals', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'dc610000-5dd4-0015-d2f0-08dcda5647f7', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:58:48.92341+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', '2024-09-21 15:58:48.92341+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('dc610000-5dd4-0015-573b-08dcda5647f8', '2852', 'Private contributions to operating expenses', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'dc610000-5dd4-0015-62ae-08dcda5647f8', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:58:48.92709+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', '2024-09-21 15:58:48.92709+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('dc610000-5dd4-0015-da37-08dcda5647f8', '2853', 'Rental value of private apartment', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'dc610000-5dd4-0015-e55d-08dcda5647f8', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:58:48.930435+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', '2024-09-21 15:58:48.930435+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('dc610000-5dd4-0015-65d5-08dcda5647f9', '2854', 'Private insurance premiums', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'dc610000-5dd4-0015-71a2-08dcda5647f9', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:58:48.934025+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', '2024-09-21 15:58:48.934025+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('dc610000-5dd4-0015-1dfa-08dcda5647fa', '2855', 'Private pension contributions', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'dc610000-5dd4-0015-2a34-08dcda5647fa', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:58:48.938751+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', '2024-09-21 15:58:48.938751+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('dc610000-5dd4-0015-a720-08dcda5647fa', '2856', 'Private taxes', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'dc610000-5dd4-0015-b33d-08dcda5647fa', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:58:48.942259+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', '2024-09-21 15:58:48.942259+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('dc610000-5dd4-0015-3f48-08dcda5647fb', '2880', 'Private property A', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'dc610000-5dd4-0015-51a4-08dcda5647fb', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:58:48.94631+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', '2024-09-21 15:58:48.94631+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('dc610000-5dd4-0015-cdb5-08dcda5647fb', '2900', 'General reserve', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'dc610000-5dd4-0015-db04-08dcda5647fb', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:58:48.949826+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', '2024-09-21 15:58:48.949826+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('dc610000-5dd4-0015-7a6c-08dcda5647fc', '2901', 'Reserve for treasury shares', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'dc610000-5dd4-0015-87e2-08dcda5647fc', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:58:48.954256+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', '2024-09-21 15:58:48.954256+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('dc610000-5dd4-0015-0677-08dcda5647fd', '2903', 'Revaluation reserve', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'dc610000-5dd4-0015-145f-08dcda5647fd', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:58:48.957853+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', '2024-09-21 15:58:48.957853+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('dc610000-5dd4-0015-905e-08dcda5647fd', '2910', 'Statutory reserves', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'dc610000-5dd4-0015-9eff-08dcda5647fd', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:58:48.961399+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', '2024-09-21 15:58:48.961399+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('dc610000-5dd4-0015-1791-08dcda5647fe', '2990', 'Brought-forward profit / Brought-forward loss', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'dc610000-5dd4-0015-25fe-08dcda5647fe', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:58:48.964857+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', '2024-09-21 15:58:48.964857+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('dc610000-5dd4-0015-fd1c-08dcda5647fe', '2991', 'Current-year profit / Current-year loss', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'dc610000-5dd4-0015-0e56-08dcda5647ff', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:58:48.970802+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', '2024-09-21 15:58:48.970802+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('4c6f0000-5dd4-0015-5b3c-08dcda56e416', '3211', 'Gross credit retail sales', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, true, '4c6f0000-5dd4-0015-81a7-08dcda56e41d', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:03:10.894504+00', '4c6f0000-5dd4-0015-fa99-08dcda56e411', '2024-09-21 16:03:10.894504+00', '4c6f0000-5dd4-0015-fa99-08dcda56e411', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('4c6f0000-5dd4-0015-7cad-08dcda56e423', '3212', 'Gross credit wholesale sales', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, true, '4c6f0000-5dd4-0015-bf07-08dcda56e423', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:03:10.935793+00', '4c6f0000-5dd4-0015-fa99-08dcda56e411', '2024-09-21 16:03:10.935793+00', '4c6f0000-5dd4-0015-fa99-08dcda56e411', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('4c6f0000-5dd4-0015-5a60-08dcda56e424', '3220', 'Gross sales at standard VAT rate (8.00% net VAT)', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, true, '4c6f0000-5dd4-0015-5ee0-08dcda56e424', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:03:10.939922+00', '4c6f0000-5dd4-0015-fa99-08dcda56e411', '2024-09-21 16:03:10.939922+00', '4c6f0000-5dd4-0015-fa99-08dcda56e411', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('4c6f0000-5dd4-0015-db2b-08dcda56e424', '3221', 'Gross sales at reduced VAT rate (2.50% net VAT)', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, true, '4c6f0000-5dd4-0015-dfcf-08dcda56e424', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:03:10.943223+00', '4c6f0000-5dd4-0015-fa99-08dcda56e411', '2024-09-21 16:03:10.943223+00', '4c6f0000-5dd4-0015-fa99-08dcda56e411', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('4c6f0000-5dd4-0015-ad5b-08dcda56e425', '3222', 'Gross sales at zero VAT rate (0.00% net VAT)', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, true, '4c6f0000-5dd4-0015-b1bd-08dcda56e425', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:03:10.948597+00', '4c6f0000-5dd4-0015-fa99-08dcda56e411', '2024-09-21 16:03:10.948597+00', '4c6f0000-5dd4-0015-fa99-08dcda56e411', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('4c6f0000-5dd4-0015-5998-08dcda56e426', '3300', 'Other directly incorporable materials', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, true, '4c6f0000-5dd4-0015-614e-08dcda56e426', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:03:10.953087+00', '4c6f0000-5dd4-0015-fa99-08dcda56e411', '2024-09-21 16:03:10.953087+00', '4c6f0000-5dd4-0015-fa99-08dcda56e411', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('4c6f0000-5dd4-0015-e459-08dcda56e426', '3720', 'Internal consumption', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, true, '4c6f0000-5dd4-0015-e998-08dcda56e426', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:03:10.956581+00', '4c6f0000-5dd4-0015-fa99-08dcda56e411', '2024-09-21 16:03:10.956581+00', '4c6f0000-5dd4-0015-fa99-08dcda56e411', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('4c6f0000-5dd4-0015-63be-08dcda56e427', '3900', 'Discounts', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, true, '4c6f0000-5dd4-0015-6abe-08dcda56e427', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:03:10.959882+00', '4c6f0000-5dd4-0015-fa99-08dcda56e411', '2024-09-21 16:03:10.959882+00', '4c6f0000-5dd4-0015-fa99-08dcda56e411', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('4c6f0000-5dd4-0015-0dad-08dcda56e428', '3901', 'Price rebates', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, true, '4c6f0000-5dd4-0015-148f-08dcda56e428', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:03:10.964228+00', '4c6f0000-5dd4-0015-fa99-08dcda56e411', '2024-09-21 16:03:10.964228+00', '4c6f0000-5dd4-0015-fa99-08dcda56e411', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-4a86-08dcda58ab6a', '4292', 'Refunds', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, 'b0650000-5dd4-0015-e575-08dcda6a7f80', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.761651+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 18:23:32.031006+00', 'b0650000-5dd4-0015-7887-08dcda6a7f80', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('4c6f0000-5dd4-0015-7bf9-08dcda56e429', '3903', 'Third-party commissions', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, true, '4c6f0000-5dd4-0015-8393-08dcda56e429', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:03:10.973629+00', '4c6f0000-5dd4-0015-fa99-08dcda56e411', '2024-09-21 16:03:10.973629+00', '4c6f0000-5dd4-0015-fa99-08dcda56e411', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('4c6f0000-5dd4-0015-0683-08dcda56e42a', '3904', 'Collection fees', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, true, '4c6f0000-5dd4-0015-0e72-08dcda56e42a', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:03:10.977178+00', '4c6f0000-5dd4-0015-fa99-08dcda56e411', '2024-09-21 16:03:10.977178+00', '4c6f0000-5dd4-0015-fa99-08dcda56e411', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('4c6f0000-5dd4-0015-ac69-08dcda56e42a', '3905', 'Customer losses', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, true, '4c6f0000-5dd4-0015-b4e7-08dcda56e42a', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:03:10.981442+00', '4c6f0000-5dd4-0015-fa99-08dcda56e411', '2024-09-21 16:03:10.981442+00', '4c6f0000-5dd4-0015-fa99-08dcda56e411', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('4c6f0000-5dd4-0015-3498-08dcda56e42b', '3906', 'Foreign exchange differences', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, true, '4c6f0000-5dd4-0015-3cf3-08dcda56e42b', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:03:10.984928+00', '4c6f0000-5dd4-0015-fa99-08dcda56e411', '2024-09-21 16:03:10.984928+00', '4c6f0000-5dd4-0015-fa99-08dcda56e411', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('4c6f0000-5dd4-0015-f5b3-08dcda56e42b', '3907', 'Freight and carriage', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, true, '4c6f0000-5dd4-0015-fec1-08dcda56e42b', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:03:10.989887+00', '4c6f0000-5dd4-0015-fa99-08dcda56e411', '2024-09-21 16:03:10.989887+00', '4c6f0000-5dd4-0015-fa99-08dcda56e411', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('4c6f0000-5dd4-0015-b18f-08dcda56e42c', '3210', 'Gross cash sales', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, true, '4c6f0000-5dd4-0015-bac3-08dcda56e42c', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:03:10.994702+00', '4c6f0000-5dd4-0015-fa99-08dcda56e411', '2024-09-21 16:03:10.994702+00', '4c6f0000-5dd4-0015-fa99-08dcda56e411', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-ab3e-08dcda58ab55', '4208', 'Inventory adjustments', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-64c7-08dcda58ab5d', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.676511+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.676511+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-6395-08dcda58ab63', '4209', 'Deductions obtained on purchases', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-a651-08dcda58ab63', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.717924+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.717924+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-5c21-08dcda58ab64', '4210', 'Purchases of goods at standard VAT rate (8.00% net VAT)', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-60fe-08dcda58ab64', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.722735+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.722735+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-e55a-08dcda58ab64', '4211', 'Purchases of goods at reduced VAT rate (2.50% net VAT)', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-e987-08dcda58ab64', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.726231+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.726231+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-988a-08dcda58ab65', '4212', 'Purchases of goods at zero VAT rate (0.00% net VAT)', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-9d88-08dcda58ab65', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.730838+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.730838+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-3197-08dcda58ab66', '4215', 'Purchase of packaging materials', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-3a85-08dcda58ab66', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.734856+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.734856+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-700a-08dcda58ab67', '4270', 'Purchase freight', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-763f-08dcda58ab67', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.742938+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.742938+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-f70d-08dcda58ab67', '4271', 'Import customs duties', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-fd6a-08dcda58ab67', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.7464+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.7464+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-8547-08dcda58ab68', '4272', 'Purchase transportation costs', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-8b6e-08dcda58ab68', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.750035+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.750035+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-0b7c-08dcda58ab69', '4290', 'Discounts', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-1190-08dcda58ab69', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.753469+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.753469+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-c1b6-08dcda58ab69', '4291', 'Price rebates', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-c8b6-08dcda58ab69', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.758155+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.758155+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-e6d2-08dcda58ab6a', '4293', 'Rebates obtained on purchases', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-ede7-08dcda58ab6a', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.765661+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.765661+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-7563-08dcda58ab6b', '4296', 'Foreign exchange differences', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-7d56-08dcda58ab6b', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.769335+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.769335+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-2576-08dcda58ab6c', '5200', 'Salaries', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-2c86-08dcda58ab6c', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.77382+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.77382+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-b332-08dcda58ab6c', '5205', 'Social security benefits', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-bb48-08dcda58ab6c', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.777472+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.777472+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-374c-08dcda58ab6d', '5270', 'Old-age and survivors'' insurance, disability insurance, income replacement', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-3f61-08dcda58ab6d', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.780856+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.780856+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-c742-08dcda58ab6d', '5271', 'Family allowance fund', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-d07e-08dcda58ab6d', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.784569+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.784569+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-7504-08dcda58ab6e', '5272', 'Occupational pension plan', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-7e69-08dcda58ab6e', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.789023+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.789023+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-fb87-08dcda58ab6e', '5273', 'Accident insurance', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-04f4-08dcda58ab6f', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.792468+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.792468+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-81b9-08dcda58ab6f', '5274', 'Sickness benefits insurance', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-8b2c-08dcda58ab6f', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.795904+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.795904+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-1b0b-08dcda58ab70', '5279', 'Withholding taxes', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-25a2-08dcda58ab70', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.799857+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.799857+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-cc5b-08dcda58ab70', '5280', 'Personnel recruitment', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-d72a-08dcda58ab70', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.804399+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.804399+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-5921-08dcda58ab71', '5281', 'Training and continuing education', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-63ad-08dcda58ab71', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.807999+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.807999+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-e852-08dcda58ab71', '5282', 'Actual expense reimbursements', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-f392-08dcda58ab71', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.811683+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.811683+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-7d83-08dcda58ab72', '5283', 'Flat-rate expense allowances', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-898e-08dcda58ab72', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.815522+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.815522+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-2e91-08dcda58ab73', '5289', 'Other personnel expenses', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-3c7d-08dcda58ab73', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.820056+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.820056+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-bd6a-08dcda58ab73', '5290', 'Temporary employees', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-c8cf-08dcda58ab73', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.823695+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.823695+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-555c-08dcda58ab74', '6000', 'Rent', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-6281-08dcda58ab74', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.827627+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.827627+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-ea28-08dcda58ab74', '6030', 'Accessory charges', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-f797-08dcda58ab74', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.831444+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.831444+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-a2d7-08dcda58ab75', '6040', 'Cleaning', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-afc8-08dcda58ab75', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.836161+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.836161+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-3667-08dcda58ab76', '6050', 'Maintenance', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-4398-08dcda58ab76', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.839945+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.839945+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-c6a2-08dcda58ab76', '6090', 'Premises charges as private withdrawals', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-d8af-08dcda58ab76', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.84376+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.84376+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-627b-08dcda58ab77', '6100', 'Maintenance, repair, or replacement of machinery', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-7037-08dcda58ab77', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.847639+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.847639+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-1874-08dcda58ab78', '6102', 'Maintenance, repair, or replacement of tools and equipment', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-27de-08dcda58ab78', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.852342+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.852342+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-b07e-08dcda58ab78', '6130', 'Maintenance, repair, or replacement of office furniture', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-bdeb-08dcda58ab78', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.856184+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.856184+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-4078-08dcda58ab79', '6131', 'Maintenance, repair, or replacement of office machines', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-4e76-08dcda58ab79', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.859884+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.859884+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-cdcd-08dcda58ab79', '6200', 'Repair, service, and cleaning', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-dc1c-08dcda58ab79', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.86351+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.86351+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-7f75-08dcda58ab7a', '6210', 'Fuel', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-8de1-08dcda58ab7a', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.868059+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.868059+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-1137-08dcda58ab7b', '6220', 'Insurance and taxes', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-1f7c-08dcda58ab7b', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.871787+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.871787+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-a49f-08dcda58ab7b', '6260', 'Lease charges for vehicles', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-96c3-08dcda58ab7c', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.88139+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.88139+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-260f-08dcda58ab7d', '6270', 'Vehicle charges as private withdrawals', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-3458-08dcda58ab7d', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.885429+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.885429+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-d524-08dcda58ab7d', '6300', 'Property damage insurance', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-e322-08dcda58ab7d', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.889902+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.889902+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-61c0-08dcda58ab7e', '6310', 'Liability insurance', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-74df-08dcda58ab7e', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.893625+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.893625+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-ff88-08dcda58ab7e', '6330', 'Life insurance premiums', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-0ee0-08dcda58ab7f', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.897573+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.897573+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-979f-08dcda58ab7f', '6331', 'Surety bond premiums', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-a81e-08dcda58ab7f', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.901497+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.901497+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-4d51-08dcda58ab80', '6360', 'Duties', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-5d61-08dcda58ab80', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.906138+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.906138+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-e36e-08dcda58ab80', '6361', 'Taxes', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-f3c4-08dcda58ab80', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.909987+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.909987+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-7221-08dcda58ab81', '6370', 'Permits', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-8272-08dcda58ab81', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.913642+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.913642+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-0165-08dcda58ab82', '6371', 'Licenses', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-1251-08dcda58ab82', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.917322+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.917322+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-b139-08dcda58ab82', '6400', 'Power', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-c4bf-08dcda58ab82', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.921892+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.921892+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-5258-08dcda58ab83', '6420', 'Fuel oil', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-62a0-08dcda58ab83', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.925934+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.925934+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-dbbf-08dcda58ab83', '6430', 'Water', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-ee2d-08dcda58ab83', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.929505+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.929505+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-6bc2-08dcda58ab84', '6460', 'Waste disposal', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-7d8d-08dcda58ab84', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.933175+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.933175+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-2f77-08dcda58ab85', '6462', 'Wastewater', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-4245-08dcda58ab85', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.938208+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.938208+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-c3ce-08dcda58ab85', '6500', 'Office supplies', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-d563-08dcda58ab85', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.941978+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.941978+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-5394-08dcda58ab86', '6501', 'Printed materials', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-6602-08dcda58ab86', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.94568+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.94568+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-dccc-08dcda58ab86', '6502', 'Photocopies', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-f0fa-08dcda58ab86', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.949234+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.949234+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-a4c4-08dcda58ab87', '6503', 'Technical literature', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-b723-08dcda58ab87', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.954308+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.954308+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-41ee-08dcda58ab88', '6510', 'Telephone', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-55a7-08dcda58ab88', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.958366+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.958366+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-cdf4-08dcda58ab88', '6511', 'Fax', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-e0ed-08dcda58ab88', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.961933+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.961933+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-5f4c-08dcda58ab89', '6512', 'Internet', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-7205-08dcda58ab89', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.965645+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.965645+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-2459-08dcda58ab8a', '6513', 'Postage charges', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-424e-08dcda58ab8a', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.970971+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.970971+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-c4e8-08dcda58ab8a', '6520', 'Contributions', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-d8c2-08dcda58ab8a', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.974829+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.974829+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-58c1-08dcda58ab8b', '6521', 'Donations and gifts', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-6ca3-08dcda58ab8b', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.978617+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.978617+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-ea58-08dcda58ab8b', '6522', 'Tips', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-fe3d-08dcda58ab8b', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.982344+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.982344+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-aab8-08dcda58ab8c', '6530', 'Fiduciary fees', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-bf8f-08dcda58ab8c', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.987293+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.987293+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-3ce8-08dcda58ab8d', '6531', 'Consulting fees', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-5677-08dcda58ab8d', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.991156+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.991156+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-de62-08dcda58ab8d', '6532', 'Legal consulting fees', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-f256-08dcda58ab8d', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.995144+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.995144+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-6d70-08dcda58ab8e', '6540', 'Board of directors fees', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-8e09-08dcda58ab8e', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.999132+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.999132+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-3e66-08dcda58ab8f', '6541', 'General assembly fees', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-5722-08dcda58ab8f', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.004281+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.004281+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-dd01-08dcda58ab8f', '6542', 'Auditing fees', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-f232-08dcda58ab8f', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.008249+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.008249+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-6f55-08dcda58ab90', '6550', 'Administrative charges as private withdrawals', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-87d2-08dcda58ab90', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.012079+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.012079+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-fdc8-08dcda58ab90', '6560', 'Lease of equipment', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-128f-08dcda58ab91', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.015632+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.015632+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-b7ee-08dcda58ab91', '6561', 'Lease of software', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-cdce-08dcda58ab91', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.020424+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.020424+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-4a73-08dcda58ab92', '6562', 'Lease of equipment', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-60d8-08dcda58ab92', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.024191+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.024191+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-de50-08dcda58ab92', '6570', 'License/update charges', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-f421-08dcda58ab92', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.02796+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.02796+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-26d9-08dcda58ab94', '6575', 'Network charges', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-3e53-08dcda58ab94', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.036414+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.036414+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-b938-08dcda58ab94', '6600', 'Newspaper advertising', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-d269-08dcda58ab94', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.040205+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.040205+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-52a3-08dcda58ab95', '6610', 'Advertising materials, advertising equipment', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-6975-08dcda58ab95', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.044072+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.044072+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-f145-08dcda58ab95', '6611', 'Advertising items, samples', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-0d48-08dcda58ab96', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.048259+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.048259+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-b380-08dcda58ab96', '6620', 'Window displays, decorations', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-cb0a-08dcda58ab96', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.053117+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.053117+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-4c9e-08dcda58ab97', '6621', 'Fairs, exhibitions', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-63fe-08dcda58ab97', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.057037+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.057037+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-dde2-08dcda58ab97', '6640', 'Travel expenses', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-f9a5-08dcda58ab97', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.060867+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.060867+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-808f-08dcda58ab98', '6641', 'Customer advisory services', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-9a60-08dcda58ab98', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.064982+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.064982+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-43cc-08dcda58ab99', '6642', 'Customer gifts', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-5bbe-08dcda58ab99', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.069933+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.069933+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-d8d2-08dcda58ab99', '6700', 'Economic information', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-f157-08dcda58ab99', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.073762+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.073762+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-7006-08dcda58ab9a', '6701', 'Legal proceedings', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-89b7-08dcda58ab9a', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.077663+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.077663+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-0725-08dcda58ab9b', '6710', 'Security', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-33ee-08dcda58ab9b', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.081962+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.081962+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-dcea-08dcda58ab9b', '6711', 'Surveillance', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-f7b6-08dcda58ab9b', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.087032+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.087032+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-7a0f-08dcda58ab9c', '6800', 'Bank loan interest', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-95e0-08dcda58ab9c', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.09108+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.09108+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-0ffa-08dcda58ab9d', '6801', 'Loan interest', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-2a2f-08dcda58ab9d', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.094878+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.094878+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-b01e-08dcda58ab9d', '6802', 'Mortgage loan interest', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-cb3c-08dcda58ab9d', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.098994+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.098994+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-8132-08dcda58ab9e', '6803', 'Default interest', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-9bd2-08dcda58ab9e', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.104339+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.104339+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-1bb1-08dcda58ab9f', '6804', 'Financial charges for customer advances', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-3854-08dcda58ab9f', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.108345+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.108345+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-beae-08dcda58ab9f', '6820', 'Financial charges for shareholder A''s current account', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-d9e7-08dcda58ab9f', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.112485+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.112485+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-5b4f-08dcda58aba0', '6830', 'Financial charges for pension fund financing', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-7ab1-08dcda58aba0', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.116597+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.116597+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-22c9-08dcda58aba1', '6840', 'Bank and postal charges', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-3df0-08dcda58aba1', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.121597+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.121597+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-c552-08dcda58aba1', '6841', 'Deposit charges', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-e0d6-08dcda58aba1', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.125769+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.125769+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-61dd-08dcda58aba2', '6842', 'Exchange losses on cash and securities', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-8538-08dcda58aba2', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.129972+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.129972+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-44aa-08dcda58aba7', '6920', 'Depreciation on machinery and tools', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-6181-08dcda58aba7', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.161831+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.161831+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-ea38-08dcda58aba7', '6921', 'Depreciation on furniture and installations', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-07ee-08dcda58aba8', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.16609+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.16609+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-0c8d-08dcda58aba3', '6850', 'Financial income from postal and bank assets', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, true, '34980000-5dd4-0015-760f-08dcdaf3f47f', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.134164+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-22 10:47:29.366946+00', '34980000-5dd4-0015-0e4b-08dcdaf3f479', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-d9f9-08dcda58aba3', '6851', 'Financial income from short-term assets', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, true, '34980000-5dd4-0015-2f7f-08dcdaf3f740', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.139456+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-22 10:47:33.985468+00', '34980000-5dd4-0015-bf6f-08dcdaf3f73f', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-7b17-08dcda58aba4', '6880', 'Financial income from shareholder X''s current account', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, true, '34980000-5dd4-0015-3102-08dcdaf3fc7a', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.143993+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-22 10:47:42.754224+00', '34980000-5dd4-0015-c67f-08dcdaf3fc79', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-2ddf-08dcda58aba5', '6890', 'Financial income from default interest, discounts', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, true, '34980000-5dd4-0015-2e2e-08dcdaf402da', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.148128+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-22 10:47:53.449627+00', '34980000-5dd4-0015-ce34-08dcdaf402d9', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-d5a4-08dcda58aba5', '6891', 'Financial income from advances received', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, true, '34980000-5dd4-0015-6b59-08dcdaf40601', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.152489+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-22 10:47:58.739948+00', '34980000-5dd4-0015-0b81-08dcdaf40601', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-9a10-08dcda58aba6', '6892', 'Foreign exchange gains on cash and securities', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, true, '34980000-5dd4-0015-5e06-08dcdaf408c8', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.157455+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-22 10:48:03.399216+00', '34980000-5dd4-0015-06dd-08dcdaf408c8', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-8cf0-08dcda58aba8', '6922', 'Depreciation on office, IT equipment', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-ab8b-08dcda58aba8', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.170279+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.170279+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-63f6-08dcda58aba9', '6923', 'Depreciation on vehicles', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-8281-08dcda58aba9', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.175781+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.175781+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-073b-08dcda58abaa', '6930', 'Depreciation on operating buildings', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-2580-08dcda58abaa', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.179954+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.179954+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-ae47-08dcda58abaa', '6950', 'Depreciation on incorporation costs', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-cca4-08dcda58abaa', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.184233+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.184233+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-5961-08dcda58abab', '4200', 'Purchases of goods', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-7863-08dcda58abab', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.188628+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.188628+00', '60520000-5dd4-0015-8ead-08dcda58ab50', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('60520000-5dd4-0015-6d55-08dcda592ca8', '7910', 'Gains on sale of operating equipment', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, true, '60520000-5dd4-0015-7eb0-08dcda592ca8', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:19:31.595227+00', '60520000-5dd4-0015-d3a0-08dcda592c9f', '2024-09-21 16:19:31.595227+00', '60520000-5dd4-0015-d3a0-08dcda592c9f', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('c4170000-5dd4-0015-c93b-08dcda5963b6', '8002', 'Accounting revaluations', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, true, 'c4170000-5dd4-0015-1b5b-08dcda5963be', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:21:04.011097+00', 'c4170000-5dd4-0015-4cd0-08dcda5963b2', '2024-09-21 16:21:04.011097+00', 'c4170000-5dd4-0015-4cd0-08dcda5963b2', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('c4170000-5dd4-0015-f081-08dcda5963c3', '8004', 'Exceptional gains on disposal of fixed assets', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, true, 'c4170000-5dd4-0015-3937-08dcda5963c4', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:21:04.051604+00', 'c4170000-5dd4-0015-4cd0-08dcda5963b2', '2024-09-21 16:21:04.051604+00', 'c4170000-5dd4-0015-4cd0-08dcda5963b2', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('c4170000-5dd4-0015-e540-08dcda5963c4', '8005', 'Grants received', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, true, 'c4170000-5dd4-0015-e9d3-08dcda5963c4', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:21:04.056157+00', 'c4170000-5dd4-0015-4cd0-08dcda5963b2', '2024-09-21 16:21:04.056157+00', 'c4170000-5dd4-0015-4cd0-08dcda5963b2', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('c4170000-5dd4-0015-7b3c-08dcda5963c5', '8006', 'Income from compensation for damages', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, true, 'c4170000-5dd4-0015-80d4-08dcda5963c5', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:21:04.060017+00', 'c4170000-5dd4-0015-4cd0-08dcda5963b2', '2024-09-21 16:21:04.060017+00', 'c4170000-5dd4-0015-4cd0-08dcda5963b2', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('c4170000-5dd4-0015-3c95-08dcda5963c6', '8500', 'Rental income from premises', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, true, 'c4170000-5dd4-0015-43a9-08dcda5963c6', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:21:04.06501+00', 'c4170000-5dd4-0015-4cd0-08dcda5963b2', '2024-09-21 16:21:04.06501+00', 'c4170000-5dd4-0015-4cd0-08dcda5963b2', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('c4170000-5dd4-0015-ce36-08dcda5963c6', '8501', 'Rental income from apartments', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, true, 'c4170000-5dd4-0015-d659-08dcda5963c6', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:21:04.068765+00', 'c4170000-5dd4-0015-4cd0-08dcda5963b2', '2024-09-21 16:21:04.068765+00', 'c4170000-5dd4-0015-4cd0-08dcda5963b2', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('c4170000-5dd4-0015-5b6f-08dcda5963c7', '8502', 'Rental income from garages', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, true, 'c4170000-5dd4-0015-612f-08dcda5963c7', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:21:04.07232+00', 'c4170000-5dd4-0015-4cd0-08dcda5963b2', '2024-09-21 16:21:04.07232+00', 'c4170000-5dd4-0015-4cd0-08dcda5963b2', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('c4170000-5dd4-0015-e270-08dcda5963c7', '8503', 'Internal rental income', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, true, 'c4170000-5dd4-0015-eaa4-08dcda5963c7', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:21:04.075832+00', 'c4170000-5dd4-0015-4cd0-08dcda5963b2', '2024-09-21 16:21:04.075832+00', 'c4170000-5dd4-0015-4cd0-08dcda5963b2', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('c4170000-5dd4-0015-a031-08dcda5963c8', '8700', 'Fees for expert opinions, conferences', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, true, 'c4170000-5dd4-0015-a87a-08dcda5963c8', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:21:04.080695+00', 'c4170000-5dd4-0015-4cd0-08dcda5963b2', '2024-09-21 16:21:04.080695+00', 'c4170000-5dd4-0015-4cd0-08dcda5963b2', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('c4170000-5dd4-0015-2ef5-08dcda5963c9', '8701', 'Attendance fees', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, true, 'c4170000-5dd4-0015-3ad1-08dcda5963c9', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:21:04.084443+00', 'c4170000-5dd4-0015-4cd0-08dcda5963b2', '2024-09-21 16:21:04.084443+00', 'c4170000-5dd4-0015-4cd0-08dcda5963b2', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('c4170000-5dd4-0015-c838-08dcda5963c9', '7920', 'Gains on sale of buildings', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, true, 'c4170000-5dd4-0015-d027-08dcda5963c9', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:21:04.088263+00', 'c4170000-5dd4-0015-4cd0-08dcda5963b2', '2024-09-21 16:21:04.088263+00', 'c4170000-5dd4-0015-4cd0-08dcda5963b2', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('a05e0000-5dd4-0015-19fc-08dcda59fa1b', '8012', 'Exceptional depreciation', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, 'a05e0000-5dd4-0015-389b-08dcda59fa22', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:25:16.325479+00', 'a05e0000-5dd4-0015-cfa3-08dcda59fa16', '2024-09-21 16:25:16.325479+00', 'a05e0000-5dd4-0015-cfa3-08dcda59fa16', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('a05e0000-5dd4-0015-f4ef-08dcda59fa27', '8014', 'Exceptional losses on disposal of fixed assets', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, 'a05e0000-5dd4-0015-3a9c-08dcda59fa28', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:25:16.365234+00', 'a05e0000-5dd4-0015-cfa3-08dcda59fa16', '2024-09-21 16:25:16.365234+00', 'a05e0000-5dd4-0015-cfa3-08dcda59fa16', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('a05e0000-5dd4-0015-da5d-08dcda59fa28', '8015', 'Exceptional losses on receivables', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, 'a05e0000-5dd4-0015-deda-08dcda59fa28', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:25:16.369476+00', 'a05e0000-5dd4-0015-cfa3-08dcda59fa16', '2024-09-21 16:25:16.369476+00', 'a05e0000-5dd4-0015-cfa3-08dcda59fa16', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('a05e0000-5dd4-0015-5cb3-08dcda59fa29', '8016', 'Expenses for compensation for damages', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, 'a05e0000-5dd4-0015-6165-08dcda59fa29', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:25:16.372819+00', 'a05e0000-5dd4-0015-cfa3-08dcda59fa16', '2024-09-21 16:25:16.372819+00', 'a05e0000-5dd4-0015-cfa3-08dcda59fa16', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('a05e0000-5dd4-0015-febe-08dcda59fa29', '8510', 'Mortgage interest', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, 'a05e0000-5dd4-0015-0397-08dcda59fa2a', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:25:16.37697+00', 'a05e0000-5dd4-0015-cfa3-08dcda59fa16', '2024-09-21 16:25:16.37697+00', 'a05e0000-5dd4-0015-cfa3-08dcda59fa16', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('a05e0000-5dd4-0015-8315-08dcda59fa2a', '8511', 'Building maintenance', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, 'a05e0000-5dd4-0015-8940-08dcda59fa2a', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:25:16.380393+00', 'a05e0000-5dd4-0015-cfa3-08dcda59fa16', '2024-09-21 16:25:16.380393+00', 'a05e0000-5dd4-0015-cfa3-08dcda59fa16', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('a05e0000-5dd4-0015-0e41-08dcda59fa2b', '8512', 'Property rights, taxes, land taxes', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, 'a05e0000-5dd4-0015-13ce-08dcda59fa2b', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:25:16.383935+00', 'a05e0000-5dd4-0015-cfa3-08dcda59fa16', '2024-09-21 16:25:16.383935+00', 'a05e0000-5dd4-0015-cfa3-08dcda59fa16', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('a05e0000-5dd4-0015-923c-08dcda59fa2b', '8513', 'Insurance premiums', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, 'a05e0000-5dd4-0015-9902-08dcda59fa2b', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:25:16.387349+00', 'a05e0000-5dd4-0015-cfa3-08dcda59fa16', '2024-09-21 16:25:16.387349+00', 'a05e0000-5dd4-0015-cfa3-08dcda59fa16', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('a05e0000-5dd4-0015-3db9-08dcda59fa2c', '8514', 'Water, wastewater', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, 'a05e0000-5dd4-0015-448c-08dcda59fa2c', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:25:16.39174+00', 'a05e0000-5dd4-0015-cfa3-08dcda59fa16', '2024-09-21 16:25:16.39174+00', 'a05e0000-5dd4-0015-cfa3-08dcda59fa16', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('a05e0000-5dd4-0015-c462-08dcda59fa2c', '8515', 'Waste disposal', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, 'a05e0000-5dd4-0015-cbf4-08dcda59fa2c', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:25:16.395207+00', 'a05e0000-5dd4-0015-cfa3-08dcda59fa16', '2024-09-21 16:25:16.395207+00', 'a05e0000-5dd4-0015-cfa3-08dcda59fa16', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('a05e0000-5dd4-0015-4669-08dcda59fa2d', '8516', 'Administrative charges', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, 'a05e0000-5dd4-0015-4e9d-08dcda59fa2d', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:25:16.39855+00', 'a05e0000-5dd4-0015-cfa3-08dcda59fa16', '2024-09-21 16:25:16.39855+00', 'a05e0000-5dd4-0015-cfa3-08dcda59fa16', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('a05e0000-5dd4-0015-d67a-08dcda59fa2d', '8710', 'Expenses for non-operating activities', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, 'a05e0000-5dd4-0015-de33-08dcda59fa2d', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:25:16.402226+00', 'a05e0000-5dd4-0015-cfa3-08dcda59fa16', '2024-09-21 16:25:16.402226+00', 'a05e0000-5dd4-0015-cfa3-08dcda59fa16', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('a05e0000-5dd4-0015-87a2-08dcda59fa2e', '8900', 'Corporate income tax', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, 'a05e0000-5dd4-0015-8fcc-08dcda59fa2e', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:25:16.406774+00', 'a05e0000-5dd4-0015-cfa3-08dcda59fa16', '2024-09-21 16:25:16.406774+00', 'a05e0000-5dd4-0015-cfa3-08dcda59fa16', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('a05e0000-5dd4-0015-09cd-08dcda59fa2f', '8901', 'Capital tax', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, 'a05e0000-5dd4-0015-11fe-08dcda59fa2f', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:25:16.410104+00', 'a05e0000-5dd4-0015-cfa3-08dcda59fa16', '2024-09-21 16:25:16.410104+00', 'a05e0000-5dd4-0015-cfa3-08dcda59fa16', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('a05e0000-5dd4-0015-8e15-08dcda59fa2f', '8902', 'Back taxes', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, 'a05e0000-5dd4-0015-9681-08dcda59fa2f', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:25:16.413499+00', 'a05e0000-5dd4-0015-cfa3-08dcda59fa16', '2024-09-21 16:25:16.413499+00', 'a05e0000-5dd4-0015-cfa3-08dcda59fa16', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('a05e0000-5dd4-0015-1f87-08dcda59fa30', '8011', 'Exceptional provisions', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, 'a05e0000-5dd4-0015-2921-08dcda59fa30', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:25:16.417246+00', 'a05e0000-5dd4-0015-cfa3-08dcda59fa16', '2024-09-21 16:25:16.417246+00', 'a05e0000-5dd4-0015-cfa3-08dcda59fa16', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('b0650000-5dd4-0015-41aa-08dcda5af51e', '9100', 'Opening balance sheet', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 4, true, 'b0650000-5dd4-0015-785d-08dcda5af525', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:32:17.45486+00', 'b0650000-5dd4-0015-d93b-08dcda5af519', '2024-09-21 16:32:17.45486+00', 'b0650000-5dd4-0015-d93b-08dcda5af519', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('b0650000-5dd4-0015-188e-08dcda5af52b', '9101', 'Closing balance sheet', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 4, true, 'b0650000-5dd4-0015-5935-08dcda5af52b', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:32:17.493803+00', 'b0650000-5dd4-0015-d93b-08dcda5af519', '2024-09-21 16:32:17.493803+00', 'b0650000-5dd4-0015-d93b-08dcda5af519', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('b0650000-5dd4-0015-fc14-08dcda5af52b', '9200', 'Share of profit for partner X', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 4, true, 'b0650000-5dd4-0015-007d-08dcda5af52c', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:32:17.49812+00', 'b0650000-5dd4-0015-d93b-08dcda5af519', '2024-09-21 16:32:17.49812+00', 'b0650000-5dd4-0015-d93b-08dcda5af519', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('b0650000-5dd4-0015-8079-08dcda5af52c', '9201', 'Share of profit for partner Y', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 4, true, 'b0650000-5dd4-0015-84ff-08dcda5af52c', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:32:17.501513+00', 'b0650000-5dd4-0015-d93b-08dcda5af519', '2024-09-21 16:32:17.501513+00', 'b0650000-5dd4-0015-d93b-08dcda5af519', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('b0650000-5dd4-0015-2435-08dcda5af52d', '9900', 'Grouping entries for debtors', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 4, true, 'b0650000-5dd4-0015-28c0-08dcda5af52d', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:32:17.505704+00', 'b0650000-5dd4-0015-d93b-08dcda5af519', '2024-09-21 16:32:17.505704+00', 'b0650000-5dd4-0015-d93b-08dcda5af519', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('b0650000-5dd4-0015-a67e-08dcda5af52d', '9901', 'Grouping entries for creditors', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 4, true, 'b0650000-5dd4-0015-ac60-08dcda5af52d', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:32:17.509074+00', 'b0650000-5dd4-0015-d93b-08dcda5af519', '2024-09-21 16:32:17.509074+00', 'b0650000-5dd4-0015-d93b-08dcda5af519', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('b0650000-5dd4-0015-6c05-08dcda5af52e', '9910', 'Correction entry', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 4, true, 'b0650000-5dd4-0015-716d-08dcda5af52e', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:32:17.514119+00', 'b0650000-5dd4-0015-d93b-08dcda5af519', '2024-09-21 16:32:17.514119+00', 'b0650000-5dd4-0015-d93b-08dcda5af519', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('b0650000-5dd4-0015-233a-08dcda5af52f', '9000', 'Income statement', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 4, true, 'b0650000-5dd4-0015-2aac-08dcda5af52f', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:32:17.518858+00', 'b0650000-5dd4-0015-d93b-08dcda5af519', '2024-09-21 16:32:17.518858+00', 'b0650000-5dd4-0015-d93b-08dcda5af519', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('4c6f0000-5dd4-0015-cbc6-08dcda56e428', '3902', 'Refunds', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, true, 'b0650000-5dd4-0015-575d-08dcda67d032', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:03:10.969133+00', '4c6f0000-5dd4-0015-fa99-08dcda56e411', '2024-09-21 18:04:18.92145+00', 'b0650000-5dd4-0015-868b-08dcda67d031', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('248e0000-5dd4-0015-e321-08dcd98b1434', '1020', 'Bank', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, true, '248e0000-5dd4-0015-f549-08dcd98b1434', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-20 15:44:14.246399+00', '248e0000-5dd4-0015-82b6-08dcd98b1434', '2024-09-20 15:44:14.246399+00', '248e0000-5dd4-0015-82b6-08dcd98b1434'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('248e0000-5dd4-0015-f110-08dcd98b20af', '1060', 'Securities', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, true, '248e0000-5dd4-0015-f77f-08dcd98b20af', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-20 15:44:35.185238+00', '248e0000-5dd4-0015-96cf-08dcd98b20af', '2024-09-20 15:44:35.185238+00', '248e0000-5dd4-0015-96cf-08dcd98b20af'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('248e0000-5dd4-0015-aa2d-08dcd98b2ad0', '1100', 'Trade accounts receivable', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, true, '248e0000-5dd4-0015-b397-08dcd98b2ad0', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-20 15:44:52.176984+00', '248e0000-5dd4-0015-6a71-08dcd98b2ad0', '2024-09-20 15:44:52.176984+00', '248e0000-5dd4-0015-6a71-08dcd98b2ad0'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('248e0000-5dd4-0015-12f9-08dcd98b3350', '1101', 'Credit card receivables', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, true, '248e0000-5dd4-0015-1822-08dcd98b3350', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-20 15:45:06.433634+00', '248e0000-5dd4-0015-c5b4-08dcd98b334f', '2024-09-20 15:45:06.433634+00', '248e0000-5dd4-0015-c5b4-08dcd98b334f'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('248e0000-5dd4-0015-8db2-08dcd98b3c4c', '1109', 'Provision for credit losses (Ducroire)', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, true, '248e0000-5dd4-0015-928a-08dcd98b3c4c', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-20 15:45:21.51005+00', '248e0000-5dd4-0015-4fa9-08dcd98b3c4c', '2024-09-20 15:45:21.51005+00', '248e0000-5dd4-0015-4fa9-08dcd98b3c4c'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('248e0000-5dd4-0015-48fb-08dcd98b4a28', '1140', 'Advances and loans granted', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, true, '248e0000-5dd4-0015-4df0-08dcd98b4a28', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-20 15:45:44.760468+00', '248e0000-5dd4-0015-0819-08dcd98b4a28', '2024-09-20 15:45:44.760468+00', '248e0000-5dd4-0015-0819-08dcd98b4a28'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('248e0000-5dd4-0015-13fe-08dcd98b6d70', '1176', 'Withholding tax recoverable', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, true, '248e0000-5dd4-0015-19ed-08dcd98b6d70', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-20 15:46:43.951252+00', '248e0000-5dd4-0015-d6be-08dcd98b6d6f', '2024-09-20 15:46:43.951252+00', '248e0000-5dd4-0015-d6be-08dcd98b6d6f'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('248e0000-5dd4-0015-fff6-08dcd98b746a', '1190', 'Other short-term receivables', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, true, '248e0000-5dd4-0015-04ac-08dcd98b746b', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-20 15:46:55.66199+00', '248e0000-5dd4-0015-b7ad-08dcd98b746a', '2024-09-20 15:46:55.66199+00', '248e0000-5dd4-0015-b7ad-08dcd98b746a'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('248e0000-5dd4-0015-ebad-08dcd98b0949', '1000', 'Case', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, true, '248e0000-5dd4-0015-a737-08dcd98bcb2b', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-20 15:43:55.975757+00', '248e0000-5dd4-0015-6140-08dcd98b0948', '2024-09-20 15:49:21.2085+00', '248e0000-5dd4-0015-9b0a-08dcd98bcb2a'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('78920000-5dd4-0015-3c01-08dcd9a7702b', '1400', 'Long-term securities', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, true, '78920000-5dd4-0015-18d4-08dcd9a7702e', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-20 19:07:14.460177+00', '78920000-5dd4-0015-4355-08dcd9a7702a', '2024-09-20 19:07:14.460177+00', '78920000-5dd4-0015-4355-08dcd9a7702a'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('78920000-5dd4-0015-eaeb-08dcd9a778d2', '1440', 'Long-term loans', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, true, '78920000-5dd4-0015-f445-08dcd9a778d2', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-20 19:07:28.962431+00', '78920000-5dd4-0015-9b32-08dcd9a778d2', '2024-09-20 19:07:28.962431+00', '78920000-5dd4-0015-9b32-08dcd9a778d2'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('78920000-5dd4-0015-6f96-08dcd9a78046', '1441', 'Mortgage loans', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, true, '78920000-5dd4-0015-7a90-08dcd9a78046', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-20 19:07:41.463613+00', '78920000-5dd4-0015-07eb-08dcd9a78046', '2024-09-20 19:07:41.463613+00', '78920000-5dd4-0015-07eb-08dcd9a78046'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('248e0000-5dd4-0015-443b-08dcd98b545d', '1170', 'VAT input tax (materials, services)', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, true, '78920000-5dd4-0015-983d-08dcd9a9beab', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-20 15:46:01.884919+00', '248e0000-5dd4-0015-fd7b-08dcd98b545c', '2024-09-20 19:23:45.138485+00', '78920000-5dd4-0015-b5e7-08dcd9a9beaa'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('248e0000-5dd4-0015-133a-08dcd98b5d1d', '1171', 'VAT input tax (investments and other charges)', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, true, '78920000-5dd4-0015-c8f5-08dcd9a9c7da', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-20 15:46:16.563738+00', '248e0000-5dd4-0015-d52d-08dcd98b5d1c', '2024-09-20 19:24:00.547247+00', '78920000-5dd4-0015-5fc5-08dcd9a9c7da'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('248e0000-5dd4-0015-c1ce-08dcd98b7c74', '1200', 'Inventory A', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, true, '78920000-5dd4-0015-f39f-08dcd9a9f93e', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-20 15:47:09.147723+00', '248e0000-5dd4-0015-8552-08dcd98b7c74', '2024-09-20 19:25:23.412058+00', '78920000-5dd4-0015-8587-08dcd9a9f93e'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('248e0000-5dd4-0015-2c01-08dcd98b8441', '1201', 'Inventory B', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, true, '78920000-5dd4-0015-2de6-08dcd9aa042a', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-20 15:47:22.2314+00', '248e0000-5dd4-0015-eccf-08dcd98b8440', '2024-09-20 19:25:41.730861+00', '78920000-5dd4-0015-cf23-08dcd9aa0429'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('248e0000-5dd4-0015-9008-08dcd98b8c12', '1209', 'Inventory valuation adjustments', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, true, '78920000-5dd4-0015-3a44-08dcd9aa0fb7', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-20 15:47:35.347754+00', '248e0000-5dd4-0015-51cb-08dcd98b8c12', '2024-09-20 19:26:01.110173+00', '78920000-5dd4-0015-e306-08dcd9aa0fb6'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('248e0000-5dd4-0015-7165-08dcd98bbffa', '1300', 'Prepaid expenses', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, true, '78920000-5dd4-0015-392d-08dcd9aa2c96', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-20 15:49:02.431183+00', '248e0000-5dd4-0015-3458-08dcd98bbffa', '2024-09-20 19:26:49.547803+00', '78920000-5dd4-0015-e398-08dcd9aa2c95'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('78920000-5dd4-0015-23e7-08dcd9aa3ba7', '1301', 'Receivables for products and services', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, true, '78920000-5dd4-0015-2a3d-08dcd9aa3ba7', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-20 19:27:14.824656+00', '78920000-5dd4-0015-e8fa-08dcd9aa3ba6', '2024-09-20 19:27:14.824656+00', '78920000-5dd4-0015-e8fa-08dcd9aa3ba6'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('ec860000-5dd4-0015-3815-08dcda1dad9e', '1522', 'Communication systems', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, true, 'ec860000-5dd4-0015-3d50-08dcda1dad9e', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 09:13:38.150329+00', 'ec860000-5dd4-0015-f890-08dcda1dad9d', '2024-09-21 09:13:38.150329+00', 'ec860000-5dd4-0015-f890-08dcda1dad9d'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('78920000-5dd4-0015-0644-08dcd9aaf581', '1409', 'Valuation adjustments on long-term invest', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, true, '78920000-5dd4-0015-c298-08dcd9aaffac', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-20 19:32:26.631035+00', '78920000-5dd4-0015-cfd2-08dcd9aaf580', '2024-09-20 19:32:43.694758+00', '78920000-5dd4-0015-7106-08dcd9aaffac'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('78920000-5dd4-0015-a5ff-08dcd9a7ab43', '1449', 'Valuation adjustments on long-term loans', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, true, '78920000-5dd4-0015-c376-08dcd9ab07a8', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-20 19:08:53.587235+00', '78920000-5dd4-0015-6ce0-08dcd9a7ab43', '2024-09-20 19:32:57.090339+00', '78920000-5dd4-0015-7322-08dcd9ab07a8'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('ec860000-5dd4-0015-1c93-08dcda1d182f', '1500', 'Machinery and equipment', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, true, 'ec860000-5dd4-0015-ba47-08dcda1d1831', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 09:09:27.458513+00', 'ec860000-5dd4-0015-22f0-08dcda1d182e', '2024-09-21 09:09:27.458513+00', 'ec860000-5dd4-0015-22f0-08dcda1d182e'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('ec860000-5dd4-0015-b48d-08dcda1d22ef', '1510', 'Operating furniture', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, true, 'ec860000-5dd4-0015-bc9f-08dcda1d22ef', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 09:09:45.481106+00', 'ec860000-5dd4-0015-6f4b-08dcda1d22ef', '2024-09-21 09:09:45.481106+00', 'ec860000-5dd4-0015-6f4b-08dcda1d22ef'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('ec860000-5dd4-0015-061c-08dcda1d2bc2', '1511', 'Workshop installations', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, true, 'ec860000-5dd4-0015-0fca-08dcda1d2bc2', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 09:10:00.281281+00', 'ec860000-5dd4-0015-abdc-08dcda1d2bc1', '2024-09-21 09:10:00.281281+00', 'ec860000-5dd4-0015-abdc-08dcda1d2bc1'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('ec860000-5dd4-0015-ddf3-08dcda1d3498', '1512', 'Warehouse installations', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, true, 'ec860000-5dd4-0015-e2f2-08dcda1d3498', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 09:10:15.110931+00', 'ec860000-5dd4-0015-9216-08dcda1d3498', '2024-09-21 09:10:15.110931+00', 'ec860000-5dd4-0015-9216-08dcda1d3498'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('ec860000-5dd4-0015-bc68-08dcda1d47f5', '1513', 'Office furniture', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, true, 'ec860000-5dd4-0015-c79e-08dcda1d47f5', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 09:10:47.596415+00', 'ec860000-5dd4-0015-7155-08dcda1d47f5', '2024-09-21 09:10:47.596415+00', 'ec860000-5dd4-0015-7155-08dcda1d47f5'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('ec860000-5dd4-0015-a24f-08dcda1d9931', '1520', 'Office machines', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, true, 'ec860000-5dd4-0015-a781-08dcda1d9931', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 09:13:03.884272+00', 'ec860000-5dd4-0015-64bb-08dcda1d9931', '2024-09-21 09:13:03.884272+00', 'ec860000-5dd4-0015-64bb-08dcda1d9931'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('ec860000-5dd4-0015-9192-08dcda1da58d', '1521', 'IT infrastructure', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, true, 'ec860000-5dd4-0015-99c4-08dcda1da58d', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 09:13:24.619511+00', 'ec860000-5dd4-0015-5284-08dcda1da58d', '2024-09-21 09:13:24.619511+00', 'ec860000-5dd4-0015-5284-08dcda1da58d'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('ec860000-5dd4-0015-0173-08dcda1db8d7', '1530', 'Cars', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, true, 'ec860000-5dd4-0015-07a9-08dcda1db8d7', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 09:13:56.977448+00', 'ec860000-5dd4-0015-c4b2-08dcda1db8d6', '2024-09-21 09:13:56.977448+00', 'ec860000-5dd4-0015-c4b2-08dcda1db8d6'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('ec860000-5dd4-0015-d472-08dcda1dc37c', '1540', 'Tools and equipment', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, true, 'ec860000-5dd4-0015-da04-08dcda1dc37c', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 09:14:14.841393+00', 'ec860000-5dd4-0015-8fa4-08dcda1dc37c', '2024-09-21 09:14:14.841393+00', 'ec860000-5dd4-0015-8fa4-08dcda1dc37c'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('ec860000-5dd4-0015-66d1-08dcda1dd26b', '1550', 'Storage facilities', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, true, 'ec860000-5dd4-0015-6c02-08dcda1dd26b', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 09:14:39.892989+00', 'ec860000-5dd4-0015-2c65-08dcda1dd26b', '2024-09-21 09:14:39.892989+00', 'ec860000-5dd4-0015-2c65-08dcda1dd26b'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('ec860000-5dd4-0015-11c5-08dcda1de501', '1590', 'Work clothing and uniforms', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, true, 'ec860000-5dd4-0015-1701-08dcda1de501', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 09:15:11.072842+00', 'ec860000-5dd4-0015-c7c0-08dcda1de500', '2024-09-21 09:15:11.072842+00', 'ec860000-5dd4-0015-c7c0-08dcda1de500'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('ec860000-5dd4-0015-3436-08dcda1eb6ce', '1600', 'Operating buildings', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, true, 'ec860000-5dd4-0015-3c3a-08dcda1eb6ce', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 09:21:03.061097+00', 'ec860000-5dd4-0015-f17e-08dcda1eb6cd', '2024-09-21 09:21:03.061097+00', 'ec860000-5dd4-0015-f17e-08dcda1eb6cd'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('ec860000-5dd4-0015-f0cf-08dcda1ebfe4', '1601', 'Maintenance, repair, or replacement', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, true, 'ec860000-5dd4-0015-f4d3-08dcda1ebfe4', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 09:21:18.309497+00', 'ec860000-5dd4-0015-b24f-08dcda1ebfe4', '2024-09-21 09:21:18.309497+00', 'ec860000-5dd4-0015-b24f-08dcda1ebfe4'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('ec860000-5dd4-0015-12a2-08dcda1ed305', '1800', 'Incorporation costs', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, true, 'ec860000-5dd4-0015-16a9-08dcda1ed305', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 09:21:50.396788+00', 'ec860000-5dd4-0015-dc9f-08dcda1ed304', '2024-09-21 09:21:50.396788+00', 'ec860000-5dd4-0015-dc9f-08dcda1ed304'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('ec860000-5dd4-0015-69c4-08dcda1edb78', '1801', 'Capital increase costs', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, true, 'ec860000-5dd4-0015-0c65-08dcda1ef2e0', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 09:22:04.57447+00', 'ec860000-5dd4-0015-2fad-08dcda1edb78', '2024-09-21 09:22:43.841132+00', 'ec860000-5dd4-0015-ce10-08dcda1ef2dc'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('ec860000-5dd4-0015-7012-08dcda1ef826', '1802', 'Organizational costs', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, true, 'ec860000-5dd4-0015-74d8-08dcda1ef826', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 09:22:52.691167+00', 'ec860000-5dd4-0015-328c-08dcda1ef826', '2024-09-21 09:22:52.691167+00', 'ec860000-5dd4-0015-328c-08dcda1ef826'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('ec860000-5dd4-0015-ef03-08dcda1f0104', '1850', 'Unissued share capital', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, true, 'ec860000-5dd4-0015-f553-08dcda1f0104', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 09:23:07.571128+00', 'ec860000-5dd4-0015-b6d7-08dcda1f0104', '2024-09-21 09:23:07.571128+00', 'ec860000-5dd4-0015-b6d7-08dcda1f0104'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('ec860000-5dd4-0015-c9fe-08dcda1f08eb', '1859', 'Valuation adjustments on unissued share capital', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, true, 'ec860000-5dd4-0015-d01a-08dcda1f08eb', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 09:23:20.828106+00', 'ec860000-5dd4-0015-8f49-08dcda1f08eb', '2024-09-21 09:23:20.828106+00', 'ec860000-5dd4-0015-8f49-08dcda1f08eb'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('ec860000-5dd4-0015-5955-08dcda1eca12', '1609', 'Accumulated depreciation on operating buildings', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 0, true, 'ec860000-5dd4-0015-df72-08dcda1f3dbc', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 09:21:35.384328+00', 'ec860000-5dd4-0015-1779-08dcda1eca12', '2024-09-21 09:24:49.439727+00', 'ec860000-5dd4-0015-7f88-08dcda1f3dbc'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('ec860000-5dd4-0015-1cc9-08dcda20a76e', '2000', 'Liabilities for purchases of materials and goods', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'ec860000-5dd4-0015-234c-08dcda20a76e', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 09:34:56.258948+00', 'ec860000-5dd4-0015-d485-08dcda20a76d', '2024-09-21 09:34:56.258948+00', 'ec860000-5dd4-0015-d485-08dcda20a76d'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('ec860000-5dd4-0015-98ee-08dcda20b16e', '2001', 'Liabilities for services to third parties', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'ec860000-5dd4-0015-9c96-08dcda20b16e', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 09:35:13.03927+00', 'ec860000-5dd4-0015-54b2-08dcda20b16e', '2024-09-21 09:35:13.03927+00', 'ec860000-5dd4-0015-54b2-08dcda20b16e'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('ec860000-5dd4-0015-1ecb-08dcda20bb14', '2002', 'Liabilities for personnel expenses', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'ec860000-5dd4-0015-22db-08dcda20bb14', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 09:35:29.223545+00', 'ec860000-5dd4-0015-e775-08dcda20bb13', '2024-09-21 09:35:29.223545+00', 'ec860000-5dd4-0015-e775-08dcda20bb13'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('ec860000-5dd4-0015-54dd-08dcda20c7a0', '2003', 'Liabilities for social security contributions', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'ec860000-5dd4-0015-5874-08dcda20c7a0', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 09:35:50.27508+00', 'ec860000-5dd4-0015-1355-08dcda20c7a0', '2024-09-21 09:35:50.27508+00', 'ec860000-5dd4-0015-1355-08dcda20c7a0'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('ec860000-5dd4-0015-e6b0-08dcda20d5dd', '2005', 'Liabilities for lease transactions', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'ec860000-5dd4-0015-eac7-08dcda20d5dd', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 09:36:14.166698+00', 'ec860000-5dd4-0015-aa83-08dcda20d5dd', '2024-09-21 09:36:14.166698+00', 'ec860000-5dd4-0015-aa83-08dcda20d5dd'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('ec860000-5dd4-0015-a0ad-08dcda20cecb', '2004', 'Liabilities for other operating expenses', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'ec860000-5dd4-0015-6c4d-08dcda210823', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 09:36:02.302981+00', 'ec860000-5dd4-0015-5611-08dcda20cecb', '2024-09-21 09:37:38.508292+00', 'ec860000-5dd4-0015-06fc-08dcda210823'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('ec860000-5dd4-0015-aa11-08dcda2fe630', '2030', 'Customer advances', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'ec860000-5dd4-0015-aee3-08dcda2fe630', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 11:24:04.003603+00', 'ec860000-5dd4-0015-65c2-08dcda2fe630', '2024-09-21 11:24:04.003603+00', 'ec860000-5dd4-0015-65c2-08dcda2fe630'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('ec860000-5dd4-0015-4e95-08dcda2ff13b', '2100', 'Short-term bank liabilities', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'ec860000-5dd4-0015-5350-08dcda2ff13b', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 11:24:22.528287+00', 'ec860000-5dd4-0015-16de-08dcda2ff13b', '2024-09-21 11:24:22.528287+00', 'ec860000-5dd4-0015-16de-08dcda2ff13b'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('ec860000-5dd4-0015-2d5c-08dcda306250', '2110', 'Liabilities to post offices', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'ec860000-5dd4-0015-3149-08dcda306250', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 11:27:32.247582+00', 'ec860000-5dd4-0015-e704-08dcda30624f', '2024-09-21 11:27:32.247582+00', 'ec860000-5dd4-0015-e704-08dcda30624f'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('ec860000-5dd4-0015-ce96-08dcda306be5', '2111', 'Liabilities to transfer companies', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'ec860000-5dd4-0015-d394-08dcda306be5', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 11:27:48.327714+00', 'ec860000-5dd4-0015-9a17-08dcda306be5', '2024-09-21 11:27:48.327714+00', 'ec860000-5dd4-0015-9a17-08dcda306be5'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('ec860000-5dd4-0015-0733-08dcda307df9', '2160', 'Short-term financial liabilities to shareholder X', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'ec860000-5dd4-0015-0a00-08dcda307df9', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 11:28:18.652618+00', 'ec860000-5dd4-0015-cc3c-08dcda307df8', '2024-09-21 11:28:18.652618+00', 'ec860000-5dd4-0015-cc3c-08dcda307df8'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('ec860000-5dd4-0015-5593-08dcda308633', '2170', 'Short-term financial liabilities to pension funds', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'ec860000-5dd4-0015-584c-08dcda308633', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 11:28:32.456504+00', 'ec860000-5dd4-0015-22f5-08dcda308633', '2024-09-21 11:28:32.456504+00', 'ec860000-5dd4-0015-22f5-08dcda308633'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('ec860000-5dd4-0015-e456-08dcda308e53', '2180', 'Mortgage repayments', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'ec860000-5dd4-0015-e818-08dcda308e53', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 11:28:46.091673+00', 'ec860000-5dd4-0015-a822-08dcda308e53', '2024-09-21 11:28:46.091673+00', 'ec860000-5dd4-0015-a822-08dcda308e53'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('ec860000-5dd4-0015-a892-08dcda3094b8', '2181', 'Loan repayments', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'ec860000-5dd4-0015-ad23-08dcda3094b8', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 11:28:56.818407+00', 'ec860000-5dd4-0015-6730-08dcda3094b8', '2024-09-21 11:28:56.818407+00', 'ec860000-5dd4-0015-6730-08dcda3094b8'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('ec860000-5dd4-0015-2309-08dcda309b7b', '2200', 'VAT payable', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'ec860000-5dd4-0015-25fe-08dcda309b7b', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 11:29:08.159225+00', 'ec860000-5dd4-0015-e51f-08dcda309b7a', '2024-09-21 11:29:08.159225+00', 'ec860000-5dd4-0015-e51f-08dcda309b7a'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('ec860000-5dd4-0015-e12c-08dcda30a42e', '2205', 'AFC - VAT', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'ec860000-5dd4-0015-e3a2-08dcda30a42e', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 11:29:22.758951+00', 'ec860000-5dd4-0015-a414-08dcda30a42e', '2024-09-21 11:29:22.758951+00', 'ec860000-5dd4-0015-a414-08dcda30a42e'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('ec860000-5dd4-0015-e7f6-08dcda30aa7d', '2206', 'Due withholding tax', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'ec860000-5dd4-0015-ecc0-08dcda30aa7d', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 11:29:33.343248+00', 'ec860000-5dd4-0015-ac71-08dcda30aa7d', '2024-09-21 11:29:33.343248+00', 'ec860000-5dd4-0015-ac71-08dcda30aa7d'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('ec860000-5dd4-0015-2192-08dcda30b1de', '2207', 'Due stamp duties', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'ec860000-5dd4-0015-2506-08dcda30b1de', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 11:29:45.717886+00', 'ec860000-5dd4-0015-e8d4-08dcda30b1dd', '2024-09-21 11:29:45.717886+00', 'ec860000-5dd4-0015-e8d4-08dcda30b1dd'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('ec860000-5dd4-0015-0ce3-08dcda30bd7f', '2208', 'Due direct taxes', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'ec860000-5dd4-0015-0f91-08dcda30bd7f', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 11:30:05.227404+00', 'ec860000-5dd4-0015-d700-08dcda30bd7e', '2024-09-21 11:30:05.227404+00', 'ec860000-5dd4-0015-d700-08dcda30bd7e'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('ec860000-5dd4-0015-8e25-08dcda30c7bb', '2230', 'Unclaimed dividends for the year', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', ' ', 0, 1, true, 'ec860000-5dd4-0015-9ad3-08dcda30c7bb', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 11:30:22.4014+00', 'ec860000-5dd4-0015-3ab6-08dcda30c7bb', '2024-09-21 11:30:22.4014+00', 'ec860000-5dd4-0015-3ab6-08dcda30c7bb'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('ec860000-5dd4-0015-3043-08dcda30ce50', '2231', 'Unclaimed dividends from previous years', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'ec860000-5dd4-0015-3371-08dcda30ce50', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 11:30:33.44157+00', 'ec860000-5dd4-0015-f2a8-08dcda30ce4f', '2024-09-21 11:30:33.44157+00', 'ec860000-5dd4-0015-f2a8-08dcda30ce4f'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('ec860000-5dd4-0015-8e4f-08dcda30d697', '2232', 'Unclaimed bond coupons', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'ec860000-5dd4-0015-90fc-08dcda30d697', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 11:30:47.331043+00', 'ec860000-5dd4-0015-57e3-08dcda30d697', '2024-09-21 11:30:47.331043+00', 'ec860000-5dd4-0015-57e3-08dcda30d697'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('ec860000-5dd4-0015-e4a1-08dcda3073d0', '2140', 'Other short-term financial liabilities to third parties', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'ec860000-5dd4-0015-5fe2-08dcda316bc3', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 11:28:01.612408+00', 'ec860000-5dd4-0015-acc9-08dcda3073d0', '2024-09-21 11:34:57.598663+00', 'ec860000-5dd4-0015-0e84-08dcda316bc3'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('ec860000-5dd4-0015-f91d-08dcda52f00f', '2300', 'Accrued expenses', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'ec860000-5dd4-0015-fcae-08dcda52f00f', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:34:52.952078+00', 'ec860000-5dd4-0015-bb3e-08dcda52f00f', '2024-09-21 15:34:52.952078+00', 'ec860000-5dd4-0015-bb3e-08dcda52f00f'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('ec860000-5dd4-0015-b39d-08dcda530d2c', '2301', 'Prepaid income', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'ec860000-5dd4-0015-b78d-08dcda530d2c', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:35:41.794289+00', 'ec860000-5dd4-0015-6e60-08dcda530d2c', '2024-09-21 15:35:41.794289+00', 'ec860000-5dd4-0015-6e60-08dcda530d2c'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('ec860000-5dd4-0015-01b3-08dcda531ef9', '2340', 'Provisions for direct taxes', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'ec860000-5dd4-0015-04a4-08dcda531ef9', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:36:11.654464+00', 'ec860000-5dd4-0015-b543-08dcda531ef8', '2024-09-21 15:36:11.654464+00', 'ec860000-5dd4-0015-b543-08dcda531ef8'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('ec860000-5dd4-0015-b414-08dcda532935', '2341', 'Provisions for indirect taxes', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'ec860000-5dd4-0015-b722-08dcda532935', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:36:28.829466+00', 'ec860000-5dd4-0015-7e9c-08dcda532935', '2024-09-21 15:36:28.829466+00', 'ec860000-5dd4-0015-7e9c-08dcda532935'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('dc610000-5dd4-0015-07cd-08dcda5647e1', '2400', 'Long-term bank liabilities', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'dc610000-5dd4-0015-1264-08dcda5647e8', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:58:48.819721+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', '2024-09-21 15:58:48.819721+00', 'dc610000-5dd4-0015-3a58-08dcda5647db'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('dc610000-5dd4-0015-3646-08dcda5647ed', '2420', 'Liabilities from lease transactions', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'dc610000-5dd4-0015-7f38-08dcda5647ed', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:58:48.855676+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', '2024-09-21 15:58:48.855676+00', 'dc610000-5dd4-0015-3a58-08dcda5647db'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('dc610000-5dd4-0015-15f0-08dcda5647ee', '2440', 'Mortgages on operating buildings', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'dc610000-5dd4-0015-1a65-08dcda5647ee', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:58:48.859705+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', '2024-09-21 15:58:48.859705+00', 'dc610000-5dd4-0015-3a58-08dcda5647db'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('dc610000-5dd4-0015-c1ff-08dcda5647ee', '2500', 'Long-term loans from third parties', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'dc610000-5dd4-0015-c778-08dcda5647ee', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:58:48.864136+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', '2024-09-21 15:58:48.864136+00', 'dc610000-5dd4-0015-3a58-08dcda5647db'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('dc610000-5dd4-0015-41c7-08dcda5647ef', '2560', 'Long-term loans to shareholders', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'dc610000-5dd4-0015-4659-08dcda5647ef', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:58:48.867383+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', '2024-09-21 15:58:48.867383+00', 'dc610000-5dd4-0015-3a58-08dcda5647db'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('dc610000-5dd4-0015-c36a-08dcda5647ef', '2570', 'Long-term loans to pension funds', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'dc610000-5dd4-0015-ca17-08dcda5647ef', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:58:48.870751+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', '2024-09-21 15:58:48.870751+00', 'dc610000-5dd4-0015-3a58-08dcda5647db'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('dc610000-5dd4-0015-46c8-08dcda5647f0', '2600', 'Provision for repairs', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'dc610000-5dd4-0015-4c69-08dcda5647f0', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:58:48.87409+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', '2024-09-21 15:58:48.87409+00', 'dc610000-5dd4-0015-3a58-08dcda5647db'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('dc610000-5dd4-0015-ee99-08dcda5647f0', '2601', 'Provision for renovations', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'dc610000-5dd4-0015-f646-08dcda5647f0', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:58:48.878441+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', '2024-09-21 15:58:48.878441+00', 'dc610000-5dd4-0015-3a58-08dcda5647db'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('dc610000-5dd4-0015-724d-08dcda5647f1', '2602', 'Provision for refurbishments', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'dc610000-5dd4-0015-7965-08dcda5647f1', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:58:48.881798+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', '2024-09-21 15:58:48.881798+00', 'dc610000-5dd4-0015-3a58-08dcda5647db'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('dc610000-5dd4-0015-0363-08dcda5647f2', '2630', 'Provisions for warranty work', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'dc610000-5dd4-0015-0adf-08dcda5647f2', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:58:48.885515+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', '2024-09-21 15:58:48.885515+00', 'dc610000-5dd4-0015-3a58-08dcda5647db'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('dc610000-5dd4-0015-83b1-08dcda5647f2', '2800', 'Equity', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'dc610000-5dd4-0015-8a8d-08dcda5647f2', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:58:48.888787+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', '2024-09-21 15:58:48.888787+00', 'dc610000-5dd4-0015-3a58-08dcda5647db'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('dc610000-5dd4-0015-39bb-08dcda5647f3', '2801', 'Spouse''s equity', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'dc610000-5dd4-0015-430c-08dcda5647f3', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:58:48.893469+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', '2024-09-21 15:58:48.893469+00', 'dc610000-5dd4-0015-3a58-08dcda5647db'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('dc610000-5dd4-0015-bbae-08dcda5647f3', '2810', 'Partner A''s capital account', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'dc610000-5dd4-0015-d5a8-08dcda5647f3', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:58:48.897265+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', '2024-09-21 15:58:48.897265+00', 'dc610000-5dd4-0015-3a58-08dcda5647db'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('dc610000-5dd4-0015-5509-08dcda5647f4', '2811', 'Partner B''s capital account', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'dc610000-5dd4-0015-5da7-08dcda5647f4', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:58:48.900745+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', '2024-09-21 15:58:48.900745+00', 'dc610000-5dd4-0015-3a58-08dcda5647db'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('dc610000-5dd4-0015-dac6-08dcda5647f4', '2812', 'Commandite partner C''s capital account', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'dc610000-5dd4-0015-e3fa-08dcda5647f4', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:58:48.904186+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', '2024-09-21 15:58:48.904186+00', 'dc610000-5dd4-0015-3a58-08dcda5647db'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('dc610000-5dd4-0015-8943-08dcda5647f5', '2820', 'Share capital of the LLC', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'dc610000-5dd4-0015-921d-08dcda5647f5', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:58:48.908642+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', '2024-09-21 15:58:48.908642+00', 'dc610000-5dd4-0015-3a58-08dcda5647db'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('dc610000-5dd4-0015-0ffd-08dcda5647f6', '2840', 'Share capital', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'dc610000-5dd4-0015-19d0-08dcda5647f6', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:58:48.912116+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', '2024-09-21 15:58:48.912116+00', 'dc610000-5dd4-0015-3a58-08dcda5647db'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('dc610000-5dd4-0015-95c3-08dcda5647f6', '2841', 'Participation capital', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'dc610000-5dd4-0015-9fba-08dcda5647f6', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:58:48.915542+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', '2024-09-21 15:58:48.915542+00', 'dc610000-5dd4-0015-3a58-08dcda5647db'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('dc610000-5dd4-0015-1c3a-08dcda5647f7', '2850', 'Private cash withdrawals', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'dc610000-5dd4-0015-2641-08dcda5647f7', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:58:48.91899+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', '2024-09-21 15:58:48.91899+00', 'dc610000-5dd4-0015-3a58-08dcda5647db'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('dc610000-5dd4-0015-c85d-08dcda5647f7', '2851', 'Private in-kind withdrawals', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'dc610000-5dd4-0015-d2f0-08dcda5647f7', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:58:48.92341+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', '2024-09-21 15:58:48.92341+00', 'dc610000-5dd4-0015-3a58-08dcda5647db'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('dc610000-5dd4-0015-573b-08dcda5647f8', '2852', 'Private contributions to operating expenses', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'dc610000-5dd4-0015-62ae-08dcda5647f8', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:58:48.92709+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', '2024-09-21 15:58:48.92709+00', 'dc610000-5dd4-0015-3a58-08dcda5647db'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('dc610000-5dd4-0015-da37-08dcda5647f8', '2853', 'Rental value of private apartment', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'dc610000-5dd4-0015-e55d-08dcda5647f8', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:58:48.930435+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', '2024-09-21 15:58:48.930435+00', 'dc610000-5dd4-0015-3a58-08dcda5647db'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('dc610000-5dd4-0015-65d5-08dcda5647f9', '2854', 'Private insurance premiums', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'dc610000-5dd4-0015-71a2-08dcda5647f9', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:58:48.934025+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', '2024-09-21 15:58:48.934025+00', 'dc610000-5dd4-0015-3a58-08dcda5647db'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('dc610000-5dd4-0015-1dfa-08dcda5647fa', '2855', 'Private pension contributions', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'dc610000-5dd4-0015-2a34-08dcda5647fa', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:58:48.938751+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', '2024-09-21 15:58:48.938751+00', 'dc610000-5dd4-0015-3a58-08dcda5647db'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('dc610000-5dd4-0015-a720-08dcda5647fa', '2856', 'Private taxes', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'dc610000-5dd4-0015-b33d-08dcda5647fa', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:58:48.942259+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', '2024-09-21 15:58:48.942259+00', 'dc610000-5dd4-0015-3a58-08dcda5647db'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('dc610000-5dd4-0015-3f48-08dcda5647fb', '2880', 'Private property A', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'dc610000-5dd4-0015-51a4-08dcda5647fb', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:58:48.94631+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', '2024-09-21 15:58:48.94631+00', 'dc610000-5dd4-0015-3a58-08dcda5647db'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('dc610000-5dd4-0015-cdb5-08dcda5647fb', '2900', 'General reserve', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'dc610000-5dd4-0015-db04-08dcda5647fb', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:58:48.949826+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', '2024-09-21 15:58:48.949826+00', 'dc610000-5dd4-0015-3a58-08dcda5647db'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('dc610000-5dd4-0015-7a6c-08dcda5647fc', '2901', 'Reserve for treasury shares', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'dc610000-5dd4-0015-87e2-08dcda5647fc', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:58:48.954256+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', '2024-09-21 15:58:48.954256+00', 'dc610000-5dd4-0015-3a58-08dcda5647db'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('dc610000-5dd4-0015-0677-08dcda5647fd', '2903', 'Revaluation reserve', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'dc610000-5dd4-0015-145f-08dcda5647fd', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:58:48.957853+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', '2024-09-21 15:58:48.957853+00', 'dc610000-5dd4-0015-3a58-08dcda5647db'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('dc610000-5dd4-0015-905e-08dcda5647fd', '2910', 'Statutory reserves', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'dc610000-5dd4-0015-9eff-08dcda5647fd', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:58:48.961399+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', '2024-09-21 15:58:48.961399+00', 'dc610000-5dd4-0015-3a58-08dcda5647db'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('dc610000-5dd4-0015-1791-08dcda5647fe', '2990', 'Brought-forward profit / Brought-forward loss', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'dc610000-5dd4-0015-25fe-08dcda5647fe', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:58:48.964857+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', '2024-09-21 15:58:48.964857+00', 'dc610000-5dd4-0015-3a58-08dcda5647db'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('dc610000-5dd4-0015-fd1c-08dcda5647fe', '2991', 'Current-year profit / Current-year loss', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 1, true, 'dc610000-5dd4-0015-0e56-08dcda5647ff', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 15:58:48.970802+00', 'dc610000-5dd4-0015-3a58-08dcda5647db', '2024-09-21 15:58:48.970802+00', 'dc610000-5dd4-0015-3a58-08dcda5647db'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('4c6f0000-5dd4-0015-5b3c-08dcda56e416', '3211', 'Gross credit retail sales', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, true, '4c6f0000-5dd4-0015-81a7-08dcda56e41d', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:03:10.894504+00', '4c6f0000-5dd4-0015-fa99-08dcda56e411', '2024-09-21 16:03:10.894504+00', '4c6f0000-5dd4-0015-fa99-08dcda56e411'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('4c6f0000-5dd4-0015-7cad-08dcda56e423', '3212', 'Gross credit wholesale sales', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, true, '4c6f0000-5dd4-0015-bf07-08dcda56e423', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:03:10.935793+00', '4c6f0000-5dd4-0015-fa99-08dcda56e411', '2024-09-21 16:03:10.935793+00', '4c6f0000-5dd4-0015-fa99-08dcda56e411'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('4c6f0000-5dd4-0015-5a60-08dcda56e424', '3220', 'Gross sales at standard VAT rate (8.00% net VAT)', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, true, '4c6f0000-5dd4-0015-5ee0-08dcda56e424', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:03:10.939922+00', '4c6f0000-5dd4-0015-fa99-08dcda56e411', '2024-09-21 16:03:10.939922+00', '4c6f0000-5dd4-0015-fa99-08dcda56e411'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('4c6f0000-5dd4-0015-db2b-08dcda56e424', '3221', 'Gross sales at reduced VAT rate (2.50% net VAT)', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, true, '4c6f0000-5dd4-0015-dfcf-08dcda56e424', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:03:10.943223+00', '4c6f0000-5dd4-0015-fa99-08dcda56e411', '2024-09-21 16:03:10.943223+00', '4c6f0000-5dd4-0015-fa99-08dcda56e411'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('4c6f0000-5dd4-0015-ad5b-08dcda56e425', '3222', 'Gross sales at zero VAT rate (0.00% net VAT)', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, true, '4c6f0000-5dd4-0015-b1bd-08dcda56e425', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:03:10.948597+00', '4c6f0000-5dd4-0015-fa99-08dcda56e411', '2024-09-21 16:03:10.948597+00', '4c6f0000-5dd4-0015-fa99-08dcda56e411'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('4c6f0000-5dd4-0015-5998-08dcda56e426', '3300', 'Other directly incorporable materials', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, true, '4c6f0000-5dd4-0015-614e-08dcda56e426', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:03:10.953087+00', '4c6f0000-5dd4-0015-fa99-08dcda56e411', '2024-09-21 16:03:10.953087+00', '4c6f0000-5dd4-0015-fa99-08dcda56e411'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('4c6f0000-5dd4-0015-e459-08dcda56e426', '3720', 'Internal consumption', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, true, '4c6f0000-5dd4-0015-e998-08dcda56e426', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:03:10.956581+00', '4c6f0000-5dd4-0015-fa99-08dcda56e411', '2024-09-21 16:03:10.956581+00', '4c6f0000-5dd4-0015-fa99-08dcda56e411'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('4c6f0000-5dd4-0015-63be-08dcda56e427', '3900', 'Discounts', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, true, '4c6f0000-5dd4-0015-6abe-08dcda56e427', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:03:10.959882+00', '4c6f0000-5dd4-0015-fa99-08dcda56e411', '2024-09-21 16:03:10.959882+00', '4c6f0000-5dd4-0015-fa99-08dcda56e411'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('4c6f0000-5dd4-0015-0dad-08dcda56e428', '3901', 'Price rebates', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, true, '4c6f0000-5dd4-0015-148f-08dcda56e428', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:03:10.964228+00', '4c6f0000-5dd4-0015-fa99-08dcda56e411', '2024-09-21 16:03:10.964228+00', '4c6f0000-5dd4-0015-fa99-08dcda56e411'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('60520000-5dd4-0015-4a86-08dcda58ab6a', '4292', 'Refunds', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, 'b0650000-5dd4-0015-e575-08dcda6a7f80', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.761651+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 18:23:32.031006+00', 'b0650000-5dd4-0015-7887-08dcda6a7f80'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('4c6f0000-5dd4-0015-7bf9-08dcda56e429', '3903', 'Third-party commissions', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, true, '4c6f0000-5dd4-0015-8393-08dcda56e429', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:03:10.973629+00', '4c6f0000-5dd4-0015-fa99-08dcda56e411', '2024-09-21 16:03:10.973629+00', '4c6f0000-5dd4-0015-fa99-08dcda56e411'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('4c6f0000-5dd4-0015-0683-08dcda56e42a', '3904', 'Collection fees', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, true, '4c6f0000-5dd4-0015-0e72-08dcda56e42a', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:03:10.977178+00', '4c6f0000-5dd4-0015-fa99-08dcda56e411', '2024-09-21 16:03:10.977178+00', '4c6f0000-5dd4-0015-fa99-08dcda56e411'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('4c6f0000-5dd4-0015-ac69-08dcda56e42a', '3905', 'Customer losses', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, true, '4c6f0000-5dd4-0015-b4e7-08dcda56e42a', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:03:10.981442+00', '4c6f0000-5dd4-0015-fa99-08dcda56e411', '2024-09-21 16:03:10.981442+00', '4c6f0000-5dd4-0015-fa99-08dcda56e411'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('4c6f0000-5dd4-0015-3498-08dcda56e42b', '3906', 'Foreign exchange differences', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, true, '4c6f0000-5dd4-0015-3cf3-08dcda56e42b', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:03:10.984928+00', '4c6f0000-5dd4-0015-fa99-08dcda56e411', '2024-09-21 16:03:10.984928+00', '4c6f0000-5dd4-0015-fa99-08dcda56e411'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('4c6f0000-5dd4-0015-f5b3-08dcda56e42b', '3907', 'Freight and carriage', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, true, '4c6f0000-5dd4-0015-fec1-08dcda56e42b', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:03:10.989887+00', '4c6f0000-5dd4-0015-fa99-08dcda56e411', '2024-09-21 16:03:10.989887+00', '4c6f0000-5dd4-0015-fa99-08dcda56e411'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('4c6f0000-5dd4-0015-b18f-08dcda56e42c', '3210', 'Gross cash sales', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, true, '4c6f0000-5dd4-0015-bac3-08dcda56e42c', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:03:10.994702+00', '4c6f0000-5dd4-0015-fa99-08dcda56e411', '2024-09-21 16:03:10.994702+00', '4c6f0000-5dd4-0015-fa99-08dcda56e411'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('60520000-5dd4-0015-ab3e-08dcda58ab55', '4208', 'Inventory adjustments', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-64c7-08dcda58ab5d', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.676511+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.676511+00', '60520000-5dd4-0015-8ead-08dcda58ab50'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('60520000-5dd4-0015-6395-08dcda58ab63', '4209', 'Deductions obtained on purchases', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-a651-08dcda58ab63', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.717924+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.717924+00', '60520000-5dd4-0015-8ead-08dcda58ab50'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('60520000-5dd4-0015-5c21-08dcda58ab64', '4210', 'Purchases of goods at standard VAT rate (8.00% net VAT)', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-60fe-08dcda58ab64', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.722735+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.722735+00', '60520000-5dd4-0015-8ead-08dcda58ab50'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('60520000-5dd4-0015-e55a-08dcda58ab64', '4211', 'Purchases of goods at reduced VAT rate (2.50% net VAT)', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-e987-08dcda58ab64', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.726231+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.726231+00', '60520000-5dd4-0015-8ead-08dcda58ab50'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('60520000-5dd4-0015-988a-08dcda58ab65', '4212', 'Purchases of goods at zero VAT rate (0.00% net VAT)', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-9d88-08dcda58ab65', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.730838+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.730838+00', '60520000-5dd4-0015-8ead-08dcda58ab50'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('60520000-5dd4-0015-3197-08dcda58ab66', '4215', 'Purchase of packaging materials', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-3a85-08dcda58ab66', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.734856+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.734856+00', '60520000-5dd4-0015-8ead-08dcda58ab50'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('60520000-5dd4-0015-700a-08dcda58ab67', '4270', 'Purchase freight', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-763f-08dcda58ab67', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.742938+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.742938+00', '60520000-5dd4-0015-8ead-08dcda58ab50'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('60520000-5dd4-0015-f70d-08dcda58ab67', '4271', 'Import customs duties', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-fd6a-08dcda58ab67', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.7464+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.7464+00', '60520000-5dd4-0015-8ead-08dcda58ab50'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('60520000-5dd4-0015-8547-08dcda58ab68', '4272', 'Purchase transportation costs', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-8b6e-08dcda58ab68', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.750035+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.750035+00', '60520000-5dd4-0015-8ead-08dcda58ab50'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('60520000-5dd4-0015-0b7c-08dcda58ab69', '4290', 'Discounts', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-1190-08dcda58ab69', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.753469+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.753469+00', '60520000-5dd4-0015-8ead-08dcda58ab50'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('60520000-5dd4-0015-c1b6-08dcda58ab69', '4291', 'Price rebates', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-c8b6-08dcda58ab69', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.758155+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.758155+00', '60520000-5dd4-0015-8ead-08dcda58ab50'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('60520000-5dd4-0015-e6d2-08dcda58ab6a', '4293', 'Rebates obtained on purchases', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-ede7-08dcda58ab6a', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.765661+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.765661+00', '60520000-5dd4-0015-8ead-08dcda58ab50'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('60520000-5dd4-0015-7563-08dcda58ab6b', '4296', 'Foreign exchange differences', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-7d56-08dcda58ab6b', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.769335+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.769335+00', '60520000-5dd4-0015-8ead-08dcda58ab50'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('60520000-5dd4-0015-2576-08dcda58ab6c', '5200', 'Salaries', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-2c86-08dcda58ab6c', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.77382+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.77382+00', '60520000-5dd4-0015-8ead-08dcda58ab50'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('60520000-5dd4-0015-b332-08dcda58ab6c', '5205', 'Social security benefits', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-bb48-08dcda58ab6c', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.777472+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.777472+00', '60520000-5dd4-0015-8ead-08dcda58ab50'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('60520000-5dd4-0015-374c-08dcda58ab6d', '5270', 'Old-age and survivors'' insurance, disability insurance, income replacement', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-3f61-08dcda58ab6d', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.780856+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.780856+00', '60520000-5dd4-0015-8ead-08dcda58ab50'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('60520000-5dd4-0015-c742-08dcda58ab6d', '5271', 'Family allowance fund', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-d07e-08dcda58ab6d', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.784569+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.784569+00', '60520000-5dd4-0015-8ead-08dcda58ab50'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('60520000-5dd4-0015-7504-08dcda58ab6e', '5272', 'Occupational pension plan', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-7e69-08dcda58ab6e', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.789023+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.789023+00', '60520000-5dd4-0015-8ead-08dcda58ab50'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('60520000-5dd4-0015-fb87-08dcda58ab6e', '5273', 'Accident insurance', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-04f4-08dcda58ab6f', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.792468+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.792468+00', '60520000-5dd4-0015-8ead-08dcda58ab50'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('60520000-5dd4-0015-81b9-08dcda58ab6f', '5274', 'Sickness benefits insurance', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-8b2c-08dcda58ab6f', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.795904+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.795904+00', '60520000-5dd4-0015-8ead-08dcda58ab50'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('60520000-5dd4-0015-1b0b-08dcda58ab70', '5279', 'Withholding taxes', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-25a2-08dcda58ab70', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.799857+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.799857+00', '60520000-5dd4-0015-8ead-08dcda58ab50'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('60520000-5dd4-0015-cc5b-08dcda58ab70', '5280', 'Personnel recruitment', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-d72a-08dcda58ab70', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.804399+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.804399+00', '60520000-5dd4-0015-8ead-08dcda58ab50'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('60520000-5dd4-0015-5921-08dcda58ab71', '5281', 'Training and continuing education', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-63ad-08dcda58ab71', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.807999+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.807999+00', '60520000-5dd4-0015-8ead-08dcda58ab50'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('60520000-5dd4-0015-e852-08dcda58ab71', '5282', 'Actual expense reimbursements', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-f392-08dcda58ab71', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.811683+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.811683+00', '60520000-5dd4-0015-8ead-08dcda58ab50'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('60520000-5dd4-0015-7d83-08dcda58ab72', '5283', 'Flat-rate expense allowances', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-898e-08dcda58ab72', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.815522+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.815522+00', '60520000-5dd4-0015-8ead-08dcda58ab50'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('60520000-5dd4-0015-2e91-08dcda58ab73', '5289', 'Other personnel expenses', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-3c7d-08dcda58ab73', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.820056+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.820056+00', '60520000-5dd4-0015-8ead-08dcda58ab50'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('60520000-5dd4-0015-bd6a-08dcda58ab73', '5290', 'Temporary employees', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-c8cf-08dcda58ab73', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.823695+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.823695+00', '60520000-5dd4-0015-8ead-08dcda58ab50'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('60520000-5dd4-0015-555c-08dcda58ab74', '6000', 'Rent', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-6281-08dcda58ab74', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.827627+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.827627+00', '60520000-5dd4-0015-8ead-08dcda58ab50'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('60520000-5dd4-0015-ea28-08dcda58ab74', '6030', 'Accessory charges', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-f797-08dcda58ab74', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.831444+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.831444+00', '60520000-5dd4-0015-8ead-08dcda58ab50'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('60520000-5dd4-0015-a2d7-08dcda58ab75', '6040', 'Cleaning', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-afc8-08dcda58ab75', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.836161+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.836161+00', '60520000-5dd4-0015-8ead-08dcda58ab50'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('60520000-5dd4-0015-3667-08dcda58ab76', '6050', 'Maintenance', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-4398-08dcda58ab76', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.839945+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.839945+00', '60520000-5dd4-0015-8ead-08dcda58ab50'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('60520000-5dd4-0015-c6a2-08dcda58ab76', '6090', 'Premises charges as private withdrawals', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-d8af-08dcda58ab76', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.84376+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.84376+00', '60520000-5dd4-0015-8ead-08dcda58ab50'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('60520000-5dd4-0015-627b-08dcda58ab77', '6100', 'Maintenance, repair, or replacement of machinery', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-7037-08dcda58ab77', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.847639+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.847639+00', '60520000-5dd4-0015-8ead-08dcda58ab50'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('60520000-5dd4-0015-1874-08dcda58ab78', '6102', 'Maintenance, repair, or replacement of tools and equipment', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-27de-08dcda58ab78', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.852342+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.852342+00', '60520000-5dd4-0015-8ead-08dcda58ab50'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('60520000-5dd4-0015-b07e-08dcda58ab78', '6130', 'Maintenance, repair, or replacement of office furniture', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-bdeb-08dcda58ab78', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.856184+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.856184+00', '60520000-5dd4-0015-8ead-08dcda58ab50'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('60520000-5dd4-0015-4078-08dcda58ab79', '6131', 'Maintenance, repair, or replacement of office machines', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-4e76-08dcda58ab79', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.859884+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.859884+00', '60520000-5dd4-0015-8ead-08dcda58ab50'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('60520000-5dd4-0015-cdcd-08dcda58ab79', '6200', 'Repair, service, and cleaning', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-dc1c-08dcda58ab79', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.86351+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.86351+00', '60520000-5dd4-0015-8ead-08dcda58ab50'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('60520000-5dd4-0015-7f75-08dcda58ab7a', '6210', 'Fuel', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-8de1-08dcda58ab7a', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.868059+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.868059+00', '60520000-5dd4-0015-8ead-08dcda58ab50'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('60520000-5dd4-0015-1137-08dcda58ab7b', '6220', 'Insurance and taxes', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-1f7c-08dcda58ab7b', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.871787+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.871787+00', '60520000-5dd4-0015-8ead-08dcda58ab50'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('60520000-5dd4-0015-a49f-08dcda58ab7b', '6260', 'Lease charges for vehicles', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-96c3-08dcda58ab7c', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.88139+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.88139+00', '60520000-5dd4-0015-8ead-08dcda58ab50'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('60520000-5dd4-0015-260f-08dcda58ab7d', '6270', 'Vehicle charges as private withdrawals', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-3458-08dcda58ab7d', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.885429+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.885429+00', '60520000-5dd4-0015-8ead-08dcda58ab50'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('60520000-5dd4-0015-d524-08dcda58ab7d', '6300', 'Property damage insurance', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-e322-08dcda58ab7d', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.889902+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.889902+00', '60520000-5dd4-0015-8ead-08dcda58ab50'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('60520000-5dd4-0015-61c0-08dcda58ab7e', '6310', 'Liability insurance', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-74df-08dcda58ab7e', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.893625+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.893625+00', '60520000-5dd4-0015-8ead-08dcda58ab50'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('60520000-5dd4-0015-ff88-08dcda58ab7e', '6330', 'Life insurance premiums', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-0ee0-08dcda58ab7f', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.897573+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.897573+00', '60520000-5dd4-0015-8ead-08dcda58ab50'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('60520000-5dd4-0015-979f-08dcda58ab7f', '6331', 'Surety bond premiums', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-a81e-08dcda58ab7f', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.901497+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.901497+00', '60520000-5dd4-0015-8ead-08dcda58ab50'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('60520000-5dd4-0015-4d51-08dcda58ab80', '6360', 'Duties', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-5d61-08dcda58ab80', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.906138+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.906138+00', '60520000-5dd4-0015-8ead-08dcda58ab50'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('60520000-5dd4-0015-e36e-08dcda58ab80', '6361', 'Taxes', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-f3c4-08dcda58ab80', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.909987+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.909987+00', '60520000-5dd4-0015-8ead-08dcda58ab50'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('60520000-5dd4-0015-7221-08dcda58ab81', '6370', 'Permits', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-8272-08dcda58ab81', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.913642+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.913642+00', '60520000-5dd4-0015-8ead-08dcda58ab50'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('60520000-5dd4-0015-0165-08dcda58ab82', '6371', 'Licenses', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-1251-08dcda58ab82', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.917322+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.917322+00', '60520000-5dd4-0015-8ead-08dcda58ab50'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('60520000-5dd4-0015-b139-08dcda58ab82', '6400', 'Power', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-c4bf-08dcda58ab82', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.921892+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.921892+00', '60520000-5dd4-0015-8ead-08dcda58ab50'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('60520000-5dd4-0015-5258-08dcda58ab83', '6420', 'Fuel oil', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-62a0-08dcda58ab83', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.925934+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.925934+00', '60520000-5dd4-0015-8ead-08dcda58ab50'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('60520000-5dd4-0015-dbbf-08dcda58ab83', '6430', 'Water', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-ee2d-08dcda58ab83', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.929505+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.929505+00', '60520000-5dd4-0015-8ead-08dcda58ab50'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('60520000-5dd4-0015-6bc2-08dcda58ab84', '6460', 'Waste disposal', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-7d8d-08dcda58ab84', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.933175+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.933175+00', '60520000-5dd4-0015-8ead-08dcda58ab50'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('60520000-5dd4-0015-2f77-08dcda58ab85', '6462', 'Wastewater', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-4245-08dcda58ab85', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.938208+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.938208+00', '60520000-5dd4-0015-8ead-08dcda58ab50'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('60520000-5dd4-0015-c3ce-08dcda58ab85', '6500', 'Office supplies', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-d563-08dcda58ab85', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.941978+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.941978+00', '60520000-5dd4-0015-8ead-08dcda58ab50'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('60520000-5dd4-0015-5394-08dcda58ab86', '6501', 'Printed materials', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-6602-08dcda58ab86', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.94568+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.94568+00', '60520000-5dd4-0015-8ead-08dcda58ab50'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('60520000-5dd4-0015-dccc-08dcda58ab86', '6502', 'Photocopies', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-f0fa-08dcda58ab86', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.949234+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.949234+00', '60520000-5dd4-0015-8ead-08dcda58ab50'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('60520000-5dd4-0015-a4c4-08dcda58ab87', '6503', 'Technical literature', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-b723-08dcda58ab87', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.954308+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.954308+00', '60520000-5dd4-0015-8ead-08dcda58ab50'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('60520000-5dd4-0015-41ee-08dcda58ab88', '6510', 'Telephone', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-55a7-08dcda58ab88', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.958366+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.958366+00', '60520000-5dd4-0015-8ead-08dcda58ab50'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('60520000-5dd4-0015-cdf4-08dcda58ab88', '6511', 'Fax', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-e0ed-08dcda58ab88', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.961933+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.961933+00', '60520000-5dd4-0015-8ead-08dcda58ab50'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('60520000-5dd4-0015-5f4c-08dcda58ab89', '6512', 'Internet', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-7205-08dcda58ab89', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.965645+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.965645+00', '60520000-5dd4-0015-8ead-08dcda58ab50'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('60520000-5dd4-0015-2459-08dcda58ab8a', '6513', 'Postage charges', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-424e-08dcda58ab8a', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.970971+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.970971+00', '60520000-5dd4-0015-8ead-08dcda58ab50'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('60520000-5dd4-0015-c4e8-08dcda58ab8a', '6520', 'Contributions', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-d8c2-08dcda58ab8a', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.974829+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.974829+00', '60520000-5dd4-0015-8ead-08dcda58ab50'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('60520000-5dd4-0015-58c1-08dcda58ab8b', '6521', 'Donations and gifts', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-6ca3-08dcda58ab8b', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.978617+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.978617+00', '60520000-5dd4-0015-8ead-08dcda58ab50'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('60520000-5dd4-0015-ea58-08dcda58ab8b', '6522', 'Tips', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-fe3d-08dcda58ab8b', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.982344+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.982344+00', '60520000-5dd4-0015-8ead-08dcda58ab50'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('60520000-5dd4-0015-aab8-08dcda58ab8c', '6530', 'Fiduciary fees', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-bf8f-08dcda58ab8c', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.987293+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.987293+00', '60520000-5dd4-0015-8ead-08dcda58ab50'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('60520000-5dd4-0015-3ce8-08dcda58ab8d', '6531', 'Consulting fees', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-5677-08dcda58ab8d', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.991156+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.991156+00', '60520000-5dd4-0015-8ead-08dcda58ab50'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('60520000-5dd4-0015-de62-08dcda58ab8d', '6532', 'Legal consulting fees', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-f256-08dcda58ab8d', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.995144+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.995144+00', '60520000-5dd4-0015-8ead-08dcda58ab50'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('60520000-5dd4-0015-6d70-08dcda58ab8e', '6540', 'Board of directors fees', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-8e09-08dcda58ab8e', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:54.999132+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:54.999132+00', '60520000-5dd4-0015-8ead-08dcda58ab50'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('60520000-5dd4-0015-3e66-08dcda58ab8f', '6541', 'General assembly fees', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-5722-08dcda58ab8f', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.004281+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.004281+00', '60520000-5dd4-0015-8ead-08dcda58ab50'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('60520000-5dd4-0015-dd01-08dcda58ab8f', '6542', 'Auditing fees', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-f232-08dcda58ab8f', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.008249+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.008249+00', '60520000-5dd4-0015-8ead-08dcda58ab50'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('60520000-5dd4-0015-6f55-08dcda58ab90', '6550', 'Administrative charges as private withdrawals', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-87d2-08dcda58ab90', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.012079+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.012079+00', '60520000-5dd4-0015-8ead-08dcda58ab50'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('60520000-5dd4-0015-fdc8-08dcda58ab90', '6560', 'Lease of equipment', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-128f-08dcda58ab91', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.015632+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.015632+00', '60520000-5dd4-0015-8ead-08dcda58ab50'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('60520000-5dd4-0015-b7ee-08dcda58ab91', '6561', 'Lease of software', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-cdce-08dcda58ab91', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.020424+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.020424+00', '60520000-5dd4-0015-8ead-08dcda58ab50'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('60520000-5dd4-0015-4a73-08dcda58ab92', '6562', 'Lease of equipment', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-60d8-08dcda58ab92', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.024191+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.024191+00', '60520000-5dd4-0015-8ead-08dcda58ab50'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('60520000-5dd4-0015-de50-08dcda58ab92', '6570', 'License/update charges', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-f421-08dcda58ab92', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.02796+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.02796+00', '60520000-5dd4-0015-8ead-08dcda58ab50'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('60520000-5dd4-0015-26d9-08dcda58ab94', '6575', 'Network charges', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-3e53-08dcda58ab94', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.036414+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.036414+00', '60520000-5dd4-0015-8ead-08dcda58ab50'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('60520000-5dd4-0015-b938-08dcda58ab94', '6600', 'Newspaper advertising', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-d269-08dcda58ab94', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.040205+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.040205+00', '60520000-5dd4-0015-8ead-08dcda58ab50'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('60520000-5dd4-0015-52a3-08dcda58ab95', '6610', 'Advertising materials, advertising equipment', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-6975-08dcda58ab95', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.044072+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.044072+00', '60520000-5dd4-0015-8ead-08dcda58ab50'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('60520000-5dd4-0015-f145-08dcda58ab95', '6611', 'Advertising items, samples', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-0d48-08dcda58ab96', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.048259+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.048259+00', '60520000-5dd4-0015-8ead-08dcda58ab50'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('60520000-5dd4-0015-b380-08dcda58ab96', '6620', 'Window displays, decorations', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-cb0a-08dcda58ab96', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.053117+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.053117+00', '60520000-5dd4-0015-8ead-08dcda58ab50'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('60520000-5dd4-0015-4c9e-08dcda58ab97', '6621', 'Fairs, exhibitions', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-63fe-08dcda58ab97', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.057037+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.057037+00', '60520000-5dd4-0015-8ead-08dcda58ab50'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('60520000-5dd4-0015-dde2-08dcda58ab97', '6640', 'Travel expenses', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-f9a5-08dcda58ab97', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.060867+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.060867+00', '60520000-5dd4-0015-8ead-08dcda58ab50'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('60520000-5dd4-0015-808f-08dcda58ab98', '6641', 'Customer advisory services', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-9a60-08dcda58ab98', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.064982+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.064982+00', '60520000-5dd4-0015-8ead-08dcda58ab50'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('60520000-5dd4-0015-43cc-08dcda58ab99', '6642', 'Customer gifts', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-5bbe-08dcda58ab99', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.069933+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.069933+00', '60520000-5dd4-0015-8ead-08dcda58ab50'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('60520000-5dd4-0015-d8d2-08dcda58ab99', '6700', 'Economic information', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-f157-08dcda58ab99', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.073762+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.073762+00', '60520000-5dd4-0015-8ead-08dcda58ab50'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('60520000-5dd4-0015-7006-08dcda58ab9a', '6701', 'Legal proceedings', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-89b7-08dcda58ab9a', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.077663+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.077663+00', '60520000-5dd4-0015-8ead-08dcda58ab50'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('60520000-5dd4-0015-0725-08dcda58ab9b', '6710', 'Security', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-33ee-08dcda58ab9b', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.081962+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.081962+00', '60520000-5dd4-0015-8ead-08dcda58ab50'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('60520000-5dd4-0015-dcea-08dcda58ab9b', '6711', 'Surveillance', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-f7b6-08dcda58ab9b', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.087032+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.087032+00', '60520000-5dd4-0015-8ead-08dcda58ab50'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('60520000-5dd4-0015-7a0f-08dcda58ab9c', '6800', 'Bank loan interest', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-95e0-08dcda58ab9c', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.09108+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.09108+00', '60520000-5dd4-0015-8ead-08dcda58ab50'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('60520000-5dd4-0015-0ffa-08dcda58ab9d', '6801', 'Loan interest', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-2a2f-08dcda58ab9d', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.094878+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.094878+00', '60520000-5dd4-0015-8ead-08dcda58ab50'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('60520000-5dd4-0015-b01e-08dcda58ab9d', '6802', 'Mortgage loan interest', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-cb3c-08dcda58ab9d', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.098994+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.098994+00', '60520000-5dd4-0015-8ead-08dcda58ab50'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('60520000-5dd4-0015-8132-08dcda58ab9e', '6803', 'Default interest', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-9bd2-08dcda58ab9e', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.104339+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.104339+00', '60520000-5dd4-0015-8ead-08dcda58ab50'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('60520000-5dd4-0015-1bb1-08dcda58ab9f', '6804', 'Financial charges for customer advances', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-3854-08dcda58ab9f', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.108345+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.108345+00', '60520000-5dd4-0015-8ead-08dcda58ab50'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('60520000-5dd4-0015-beae-08dcda58ab9f', '6820', 'Financial charges for shareholder A''s current account', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-d9e7-08dcda58ab9f', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.112485+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.112485+00', '60520000-5dd4-0015-8ead-08dcda58ab50'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('60520000-5dd4-0015-5b4f-08dcda58aba0', '6830', 'Financial charges for pension fund financing', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-7ab1-08dcda58aba0', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.116597+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.116597+00', '60520000-5dd4-0015-8ead-08dcda58ab50'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('60520000-5dd4-0015-22c9-08dcda58aba1', '6840', 'Bank and postal charges', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-3df0-08dcda58aba1', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.121597+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.121597+00', '60520000-5dd4-0015-8ead-08dcda58ab50'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('60520000-5dd4-0015-c552-08dcda58aba1', '6841', 'Deposit charges', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-e0d6-08dcda58aba1', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.125769+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.125769+00', '60520000-5dd4-0015-8ead-08dcda58ab50'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('60520000-5dd4-0015-61dd-08dcda58aba2', '6842', 'Exchange losses on cash and securities', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-8538-08dcda58aba2', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.129972+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.129972+00', '60520000-5dd4-0015-8ead-08dcda58ab50'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('60520000-5dd4-0015-44aa-08dcda58aba7', '6920', 'Depreciation on machinery and tools', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-6181-08dcda58aba7', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.161831+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.161831+00', '60520000-5dd4-0015-8ead-08dcda58ab50'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('60520000-5dd4-0015-ea38-08dcda58aba7', '6921', 'Depreciation on furniture and installations', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-07ee-08dcda58aba8', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.16609+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.16609+00', '60520000-5dd4-0015-8ead-08dcda58ab50'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('60520000-5dd4-0015-0c8d-08dcda58aba3', '6850', 'Financial income from postal and bank assets', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, true, '34980000-5dd4-0015-760f-08dcdaf3f47f', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.134164+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-22 10:47:29.366946+00', '34980000-5dd4-0015-0e4b-08dcdaf3f479'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('60520000-5dd4-0015-d9f9-08dcda58aba3', '6851', 'Financial income from short-term assets', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, true, '34980000-5dd4-0015-2f7f-08dcdaf3f740', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.139456+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-22 10:47:33.985468+00', '34980000-5dd4-0015-bf6f-08dcdaf3f73f'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('60520000-5dd4-0015-7b17-08dcda58aba4', '6880', 'Financial income from shareholder X''s current account', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, true, '34980000-5dd4-0015-3102-08dcdaf3fc7a', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.143993+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-22 10:47:42.754224+00', '34980000-5dd4-0015-c67f-08dcdaf3fc79'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('60520000-5dd4-0015-2ddf-08dcda58aba5', '6890', 'Financial income from default interest, discounts', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, true, '34980000-5dd4-0015-2e2e-08dcdaf402da', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.148128+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-22 10:47:53.449627+00', '34980000-5dd4-0015-ce34-08dcdaf402d9'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('60520000-5dd4-0015-d5a4-08dcda58aba5', '6891', 'Financial income from advances received', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, true, '34980000-5dd4-0015-6b59-08dcdaf40601', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.152489+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-22 10:47:58.739948+00', '34980000-5dd4-0015-0b81-08dcdaf40601'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('60520000-5dd4-0015-9a10-08dcda58aba6', '6892', 'Foreign exchange gains on cash and securities', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, true, '34980000-5dd4-0015-5e06-08dcdaf408c8', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.157455+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-22 10:48:03.399216+00', '34980000-5dd4-0015-06dd-08dcdaf408c8'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('60520000-5dd4-0015-8cf0-08dcda58aba8', '6922', 'Depreciation on office, IT equipment', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-ab8b-08dcda58aba8', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.170279+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.170279+00', '60520000-5dd4-0015-8ead-08dcda58ab50'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('60520000-5dd4-0015-63f6-08dcda58aba9', '6923', 'Depreciation on vehicles', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-8281-08dcda58aba9', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.175781+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.175781+00', '60520000-5dd4-0015-8ead-08dcda58ab50'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('60520000-5dd4-0015-073b-08dcda58abaa', '6930', 'Depreciation on operating buildings', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-2580-08dcda58abaa', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.179954+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.179954+00', '60520000-5dd4-0015-8ead-08dcda58ab50'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('60520000-5dd4-0015-ae47-08dcda58abaa', '6950', 'Depreciation on incorporation costs', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-cca4-08dcda58abaa', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.184233+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.184233+00', '60520000-5dd4-0015-8ead-08dcda58ab50'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('60520000-5dd4-0015-5961-08dcda58abab', '4200', 'Purchases of goods', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, '60520000-5dd4-0015-7863-08dcda58abab', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:15:55.188628+00', '60520000-5dd4-0015-8ead-08dcda58ab50', '2024-09-21 16:15:55.188628+00', '60520000-5dd4-0015-8ead-08dcda58ab50'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('60520000-5dd4-0015-6d55-08dcda592ca8', '7910', 'Gains on sale of operating equipment', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, true, '60520000-5dd4-0015-7eb0-08dcda592ca8', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:19:31.595227+00', '60520000-5dd4-0015-d3a0-08dcda592c9f', '2024-09-21 16:19:31.595227+00', '60520000-5dd4-0015-d3a0-08dcda592c9f'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('c4170000-5dd4-0015-c93b-08dcda5963b6', '8002', 'Accounting revaluations', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, true, 'c4170000-5dd4-0015-1b5b-08dcda5963be', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:21:04.011097+00', 'c4170000-5dd4-0015-4cd0-08dcda5963b2', '2024-09-21 16:21:04.011097+00', 'c4170000-5dd4-0015-4cd0-08dcda5963b2'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('c4170000-5dd4-0015-f081-08dcda5963c3', '8004', 'Exceptional gains on disposal of fixed assets', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, true, 'c4170000-5dd4-0015-3937-08dcda5963c4', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:21:04.051604+00', 'c4170000-5dd4-0015-4cd0-08dcda5963b2', '2024-09-21 16:21:04.051604+00', 'c4170000-5dd4-0015-4cd0-08dcda5963b2'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('c4170000-5dd4-0015-e540-08dcda5963c4', '8005', 'Grants received', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, true, 'c4170000-5dd4-0015-e9d3-08dcda5963c4', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:21:04.056157+00', 'c4170000-5dd4-0015-4cd0-08dcda5963b2', '2024-09-21 16:21:04.056157+00', 'c4170000-5dd4-0015-4cd0-08dcda5963b2'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('c4170000-5dd4-0015-7b3c-08dcda5963c5', '8006', 'Income from compensation for damages', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, true, 'c4170000-5dd4-0015-80d4-08dcda5963c5', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:21:04.060017+00', 'c4170000-5dd4-0015-4cd0-08dcda5963b2', '2024-09-21 16:21:04.060017+00', 'c4170000-5dd4-0015-4cd0-08dcda5963b2'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('c4170000-5dd4-0015-3c95-08dcda5963c6', '8500', 'Rental income from premises', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, true, 'c4170000-5dd4-0015-43a9-08dcda5963c6', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:21:04.06501+00', 'c4170000-5dd4-0015-4cd0-08dcda5963b2', '2024-09-21 16:21:04.06501+00', 'c4170000-5dd4-0015-4cd0-08dcda5963b2'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('c4170000-5dd4-0015-ce36-08dcda5963c6', '8501', 'Rental income from apartments', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, true, 'c4170000-5dd4-0015-d659-08dcda5963c6', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:21:04.068765+00', 'c4170000-5dd4-0015-4cd0-08dcda5963b2', '2024-09-21 16:21:04.068765+00', 'c4170000-5dd4-0015-4cd0-08dcda5963b2'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('c4170000-5dd4-0015-5b6f-08dcda5963c7', '8502', 'Rental income from garages', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, true, 'c4170000-5dd4-0015-612f-08dcda5963c7', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:21:04.07232+00', 'c4170000-5dd4-0015-4cd0-08dcda5963b2', '2024-09-21 16:21:04.07232+00', 'c4170000-5dd4-0015-4cd0-08dcda5963b2'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('c4170000-5dd4-0015-e270-08dcda5963c7', '8503', 'Internal rental income', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, true, 'c4170000-5dd4-0015-eaa4-08dcda5963c7', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:21:04.075832+00', 'c4170000-5dd4-0015-4cd0-08dcda5963b2', '2024-09-21 16:21:04.075832+00', 'c4170000-5dd4-0015-4cd0-08dcda5963b2'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('c4170000-5dd4-0015-a031-08dcda5963c8', '8700', 'Fees for expert opinions, conferences', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, true, 'c4170000-5dd4-0015-a87a-08dcda5963c8', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:21:04.080695+00', 'c4170000-5dd4-0015-4cd0-08dcda5963b2', '2024-09-21 16:21:04.080695+00', 'c4170000-5dd4-0015-4cd0-08dcda5963b2'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('c4170000-5dd4-0015-2ef5-08dcda5963c9', '8701', 'Attendance fees', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, true, 'c4170000-5dd4-0015-3ad1-08dcda5963c9', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:21:04.084443+00', 'c4170000-5dd4-0015-4cd0-08dcda5963b2', '2024-09-21 16:21:04.084443+00', 'c4170000-5dd4-0015-4cd0-08dcda5963b2'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('c4170000-5dd4-0015-c838-08dcda5963c9', '7920', 'Gains on sale of buildings', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, true, 'c4170000-5dd4-0015-d027-08dcda5963c9', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:21:04.088263+00', 'c4170000-5dd4-0015-4cd0-08dcda5963b2', '2024-09-21 16:21:04.088263+00', 'c4170000-5dd4-0015-4cd0-08dcda5963b2'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('a05e0000-5dd4-0015-19fc-08dcda59fa1b', '8012', 'Exceptional depreciation', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, 'a05e0000-5dd4-0015-389b-08dcda59fa22', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:25:16.325479+00', 'a05e0000-5dd4-0015-cfa3-08dcda59fa16', '2024-09-21 16:25:16.325479+00', 'a05e0000-5dd4-0015-cfa3-08dcda59fa16'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('a05e0000-5dd4-0015-f4ef-08dcda59fa27', '8014', 'Exceptional losses on disposal of fixed assets', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, 'a05e0000-5dd4-0015-3a9c-08dcda59fa28', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:25:16.365234+00', 'a05e0000-5dd4-0015-cfa3-08dcda59fa16', '2024-09-21 16:25:16.365234+00', 'a05e0000-5dd4-0015-cfa3-08dcda59fa16'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('a05e0000-5dd4-0015-da5d-08dcda59fa28', '8015', 'Exceptional losses on receivables', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, 'a05e0000-5dd4-0015-deda-08dcda59fa28', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:25:16.369476+00', 'a05e0000-5dd4-0015-cfa3-08dcda59fa16', '2024-09-21 16:25:16.369476+00', 'a05e0000-5dd4-0015-cfa3-08dcda59fa16'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('a05e0000-5dd4-0015-5cb3-08dcda59fa29', '8016', 'Expenses for compensation for damages', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, 'a05e0000-5dd4-0015-6165-08dcda59fa29', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:25:16.372819+00', 'a05e0000-5dd4-0015-cfa3-08dcda59fa16', '2024-09-21 16:25:16.372819+00', 'a05e0000-5dd4-0015-cfa3-08dcda59fa16'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('a05e0000-5dd4-0015-febe-08dcda59fa29', '8510', 'Mortgage interest', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, 'a05e0000-5dd4-0015-0397-08dcda59fa2a', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:25:16.37697+00', 'a05e0000-5dd4-0015-cfa3-08dcda59fa16', '2024-09-21 16:25:16.37697+00', 'a05e0000-5dd4-0015-cfa3-08dcda59fa16'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('a05e0000-5dd4-0015-8315-08dcda59fa2a', '8511', 'Building maintenance', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, 'a05e0000-5dd4-0015-8940-08dcda59fa2a', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:25:16.380393+00', 'a05e0000-5dd4-0015-cfa3-08dcda59fa16', '2024-09-21 16:25:16.380393+00', 'a05e0000-5dd4-0015-cfa3-08dcda59fa16'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('a05e0000-5dd4-0015-0e41-08dcda59fa2b', '8512', 'Property rights, taxes, land taxes', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, 'a05e0000-5dd4-0015-13ce-08dcda59fa2b', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:25:16.383935+00', 'a05e0000-5dd4-0015-cfa3-08dcda59fa16', '2024-09-21 16:25:16.383935+00', 'a05e0000-5dd4-0015-cfa3-08dcda59fa16'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('a05e0000-5dd4-0015-923c-08dcda59fa2b', '8513', 'Insurance premiums', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, 'a05e0000-5dd4-0015-9902-08dcda59fa2b', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:25:16.387349+00', 'a05e0000-5dd4-0015-cfa3-08dcda59fa16', '2024-09-21 16:25:16.387349+00', 'a05e0000-5dd4-0015-cfa3-08dcda59fa16'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('a05e0000-5dd4-0015-3db9-08dcda59fa2c', '8514', 'Water, wastewater', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, 'a05e0000-5dd4-0015-448c-08dcda59fa2c', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:25:16.39174+00', 'a05e0000-5dd4-0015-cfa3-08dcda59fa16', '2024-09-21 16:25:16.39174+00', 'a05e0000-5dd4-0015-cfa3-08dcda59fa16'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('a05e0000-5dd4-0015-c462-08dcda59fa2c', '8515', 'Waste disposal', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, 'a05e0000-5dd4-0015-cbf4-08dcda59fa2c', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:25:16.395207+00', 'a05e0000-5dd4-0015-cfa3-08dcda59fa16', '2024-09-21 16:25:16.395207+00', 'a05e0000-5dd4-0015-cfa3-08dcda59fa16'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('a05e0000-5dd4-0015-4669-08dcda59fa2d', '8516', 'Administrative charges', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, 'a05e0000-5dd4-0015-4e9d-08dcda59fa2d', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:25:16.39855+00', 'a05e0000-5dd4-0015-cfa3-08dcda59fa16', '2024-09-21 16:25:16.39855+00', 'a05e0000-5dd4-0015-cfa3-08dcda59fa16'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('a05e0000-5dd4-0015-d67a-08dcda59fa2d', '8710', 'Expenses for non-operating activities', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, 'a05e0000-5dd4-0015-de33-08dcda59fa2d', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:25:16.402226+00', 'a05e0000-5dd4-0015-cfa3-08dcda59fa16', '2024-09-21 16:25:16.402226+00', 'a05e0000-5dd4-0015-cfa3-08dcda59fa16'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('a05e0000-5dd4-0015-87a2-08dcda59fa2e', '8900', 'Corporate income tax', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, 'a05e0000-5dd4-0015-8fcc-08dcda59fa2e', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:25:16.406774+00', 'a05e0000-5dd4-0015-cfa3-08dcda59fa16', '2024-09-21 16:25:16.406774+00', 'a05e0000-5dd4-0015-cfa3-08dcda59fa16'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('a05e0000-5dd4-0015-09cd-08dcda59fa2f', '8901', 'Capital tax', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, 'a05e0000-5dd4-0015-11fe-08dcda59fa2f', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:25:16.410104+00', 'a05e0000-5dd4-0015-cfa3-08dcda59fa16', '2024-09-21 16:25:16.410104+00', 'a05e0000-5dd4-0015-cfa3-08dcda59fa16'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('a05e0000-5dd4-0015-8e15-08dcda59fa2f', '8902', 'Back taxes', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, 'a05e0000-5dd4-0015-9681-08dcda59fa2f', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:25:16.413499+00', 'a05e0000-5dd4-0015-cfa3-08dcda59fa16', '2024-09-21 16:25:16.413499+00', 'a05e0000-5dd4-0015-cfa3-08dcda59fa16'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('a05e0000-5dd4-0015-1f87-08dcda59fa30', '8011', 'Exceptional provisions', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 2, true, 'a05e0000-5dd4-0015-2921-08dcda59fa30', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:25:16.417246+00', 'a05e0000-5dd4-0015-cfa3-08dcda59fa16', '2024-09-21 16:25:16.417246+00', 'a05e0000-5dd4-0015-cfa3-08dcda59fa16'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('b0650000-5dd4-0015-41aa-08dcda5af51e', '9100', 'Opening balance sheet', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 4, true, 'b0650000-5dd4-0015-785d-08dcda5af525', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:32:17.45486+00', 'b0650000-5dd4-0015-d93b-08dcda5af519', '2024-09-21 16:32:17.45486+00', 'b0650000-5dd4-0015-d93b-08dcda5af519'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('b0650000-5dd4-0015-188e-08dcda5af52b', '9101', 'Closing balance sheet', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 4, true, 'b0650000-5dd4-0015-5935-08dcda5af52b', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:32:17.493803+00', 'b0650000-5dd4-0015-d93b-08dcda5af519', '2024-09-21 16:32:17.493803+00', 'b0650000-5dd4-0015-d93b-08dcda5af519'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('b0650000-5dd4-0015-fc14-08dcda5af52b', '9200', 'Share of profit for partner X', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 4, true, 'b0650000-5dd4-0015-007d-08dcda5af52c', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:32:17.49812+00', 'b0650000-5dd4-0015-d93b-08dcda5af519', '2024-09-21 16:32:17.49812+00', 'b0650000-5dd4-0015-d93b-08dcda5af519'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('b0650000-5dd4-0015-8079-08dcda5af52c', '9201', 'Share of profit for partner Y', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 4, true, 'b0650000-5dd4-0015-84ff-08dcda5af52c', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:32:17.501513+00', 'b0650000-5dd4-0015-d93b-08dcda5af519', '2024-09-21 16:32:17.501513+00', 'b0650000-5dd4-0015-d93b-08dcda5af519'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('b0650000-5dd4-0015-2435-08dcda5af52d', '9900', 'Grouping entries for debtors', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 4, true, 'b0650000-5dd4-0015-28c0-08dcda5af52d', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:32:17.505704+00', 'b0650000-5dd4-0015-d93b-08dcda5af519', '2024-09-21 16:32:17.505704+00', 'b0650000-5dd4-0015-d93b-08dcda5af519'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('b0650000-5dd4-0015-a67e-08dcda5af52d', '9901', 'Grouping entries for creditors', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 4, true, 'b0650000-5dd4-0015-ac60-08dcda5af52d', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:32:17.509074+00', 'b0650000-5dd4-0015-d93b-08dcda5af519', '2024-09-21 16:32:17.509074+00', 'b0650000-5dd4-0015-d93b-08dcda5af519'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('b0650000-5dd4-0015-6c05-08dcda5af52e', '9910', 'Correction entry', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 4, true, 'b0650000-5dd4-0015-716d-08dcda5af52e', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:32:17.514119+00', 'b0650000-5dd4-0015-d93b-08dcda5af519', '2024-09-21 16:32:17.514119+00', 'b0650000-5dd4-0015-d93b-08dcda5af519'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('b0650000-5dd4-0015-233a-08dcda5af52f', '9000', 'Income statement', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 4, true, 'b0650000-5dd4-0015-2aac-08dcda5af52f', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:32:17.518858+00', 'b0650000-5dd4-0015-d93b-08dcda5af519', '2024-09-21 16:32:17.518858+00', 'b0650000-5dd4-0015-d93b-08dcda5af519'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('4c6f0000-5dd4-0015-cbc6-08dcda56e428', '3902', 'Refunds', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 3, true, 'b0650000-5dd4-0015-575d-08dcda67d032', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-21 16:03:10.969133+00', '4c6f0000-5dd4-0015-fa99-08dcda56e411', '2024-09-21 18:04:18.92145+00', 'b0650000-5dd4-0015-868b-08dcda67d031'); /*TEST VALUES*/ -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('14320000-5dd4-0015-8c30-08dcdb1c487d', 'ZZZ', 'Account for TEST attach', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 4, true, '14320000-5dd4-0015-a80c-08dcdb1c4884', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-22 15:36:10.198397+00', '14320000-5dd4-0015-c26d-08dcdb1c4876', '2024-09-22 15:36:10.198397+00', '14320000-5dd4-0015-c26d-08dcdb1c4876', NULL); -INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by, account_group_id) VALUES ('14320000-5dd4-0015-e9ab-08dcdb1cd8fc', 'ZZZ2', 'Account for TEST attach 2', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 4, true, '14320000-5dd4-0015-0078-08dcdb1cd8fd', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-22 15:40:12.579411+00', '14320000-5dd4-0015-8003-08dcdb1cd8fc', '2024-09-22 15:40:12.579411+00', '14320000-5dd4-0015-8003-08dcdb1cd8fc', NULL); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('14320000-5dd4-0015-8c30-08dcdb1c487d', 'ZZZ', 'Account for TEST attach', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 4, true, '14320000-5dd4-0015-a80c-08dcdb1c4884', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-22 15:36:10.198397+00', '14320000-5dd4-0015-c26d-08dcdb1c4876', '2024-09-22 15:36:10.198397+00', '14320000-5dd4-0015-c26d-08dcdb1c4876'); +INSERT INTO public.accounts (id, code, label, currency_id, description, category, domain, active, version, tenant_id, created_at, created_by, modified_at, modified_by) VALUES ('14320000-5dd4-0015-e9ab-08dcdb1cd8fc', 'ZZZ2', 'Account for TEST attach 2', '248e0000-5dd4-0015-38c5-08dcd98e5b2d', NULL, 0, 4, true, '14320000-5dd4-0015-0078-08dcdb1cd8fd', '74a20000-088f-d0ad-7a4e-08dce86b0459', '2024-09-22 15:40:12.579411+00', '14320000-5dd4-0015-8003-08dcdb1cd8fc', '2024-09-22 15:40:12.579411+00', '14320000-5dd4-0015-8003-08dcdb1cd8fc'); diff --git a/src/Ubik.Accounting.Structure.Api/Models/Account.cs b/src/Ubik.Accounting.Structure.Api/Models/Account.cs index ff844d3f..633ed07e 100644 --- a/src/Ubik.Accounting.Structure.Api/Models/Account.cs +++ b/src/Ubik.Accounting.Structure.Api/Models/Account.cs @@ -9,7 +9,6 @@ public class Account : ITenantEntity, IConcurrencyCheckEntity, IAuditEntity public required string Code { get; set; } public required string Label { get; set; } public required Guid CurrencyId { get; set; } - public Currency? Currency { get; set; } public string? Description { get; set; } public AccountCategory Category { get; set; } public AccountDomain Domain { get; set; } diff --git a/src/Ubik.Accounting.Structure.Api/Models/AccountAccountGroup.cs b/src/Ubik.Accounting.Structure.Api/Models/AccountAccountGroup.cs index 8bd122f7..84b8e681 100644 --- a/src/Ubik.Accounting.Structure.Api/Models/AccountAccountGroup.cs +++ b/src/Ubik.Accounting.Structure.Api/Models/AccountAccountGroup.cs @@ -6,9 +6,7 @@ public class AccountAccountGroup : ITenantEntity, IConcurrencyCheckEntity, IAudi { public Guid Id { get; set; } public Guid AccountId { get; set; } - public Account? Account { get; set; } public Guid AccountGroupId { get; set; } - public AccountGroup? AccountGroup { get; set; } public Guid Version { get; set; } public Guid TenantId { get; set; } public DateTime CreatedAt { get; set; } diff --git a/src/Ubik.Accounting.Structure.Api/Models/AccountGroup.cs b/src/Ubik.Accounting.Structure.Api/Models/AccountGroup.cs index 1aef7fd9..dc435ab3 100644 --- a/src/Ubik.Accounting.Structure.Api/Models/AccountGroup.cs +++ b/src/Ubik.Accounting.Structure.Api/Models/AccountGroup.cs @@ -10,11 +10,7 @@ public class AccountGroup : ITenantEntity, IConcurrencyCheckEntity, IAuditEntity public required string Label { get; set; } public string? Description { get; set; } public Guid ClassificationId { get; set; } - public Classification? Classification { get; set; } public Guid? ParentAccountGroupId { get; set; } - public AccountGroup? ParentAccountGroup { get; set; } - public ICollection? ChildrenAccountGroups { get; set; } - public ICollection? Accounts { get; set; } [ConcurrencyCheck] public Guid Version { get; set; } public Guid TenantId { get; set; } diff --git a/src/Ubik.Accounting.Structure.Api/Models/Classification.cs b/src/Ubik.Accounting.Structure.Api/Models/Classification.cs index 4a638e82..0c3963a6 100644 --- a/src/Ubik.Accounting.Structure.Api/Models/Classification.cs +++ b/src/Ubik.Accounting.Structure.Api/Models/Classification.cs @@ -9,8 +9,6 @@ public class Classification : ITenantEntity, IConcurrencyCheckEntity, IAuditEnti public required string Code { get; set; } public required string Label { get; set; } public string? Description { get; set; } - public ICollection? OwnedAccountGroups { get; set; } - [ConcurrencyCheck] public Guid Version { get; set; } public Guid TenantId { get; set; } public DateTime CreatedAt { get; set; } diff --git a/src/Ubik.Accounting.Transaction.Api/Models/Entry.cs b/src/Ubik.Accounting.Transaction.Api/Models/Entry.cs new file mode 100644 index 00000000..3321d353 --- /dev/null +++ b/src/Ubik.Accounting.Transaction.Api/Models/Entry.cs @@ -0,0 +1,6 @@ +namespace Ubik.Accounting.Transaction.Api.Models +{ + public class Entry + { + } +} diff --git a/src/Ubik.Accounting.Transaction.Api/Program.cs b/src/Ubik.Accounting.Transaction.Api/Program.cs new file mode 100644 index 00000000..4ed63f3f --- /dev/null +++ b/src/Ubik.Accounting.Transaction.Api/Program.cs @@ -0,0 +1,144 @@ +using MassTransit; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc.Infrastructure; +using Microsoft.EntityFrameworkCore; +using System.Reflection; +using System.Text.Json.Serialization; +using Ubik.ApiService.Common.Configure; +using Ubik.ApiService.Common.Configure.Options; +using Ubik.ApiService.Common.Exceptions; +using Ubik.ApiService.Common.Filters; +using Ubik.ApiService.Common.Middlewares; +using Ubik.ApiService.Common.Services; + +var builder = WebApplication.CreateBuilder(args); + +//Options +var authOptions = new AuthServerOptions(); +builder.Configuration.GetSection(AuthServerOptions.Position).Bind(authOptions); +var msgBrokerOptions = new MessageBrokerOptions(); +builder.Configuration.GetSection(MessageBrokerOptions.Position).Bind(msgBrokerOptions); +var swaggerUIOptions = new SwaggerUIOptions(); +builder.Configuration.GetSection(SwaggerUIOptions.Position).Bind(swaggerUIOptions); + +//Default httpclient +builder.Services.ConfigureHttpClientDefaults(http => +{ + http.AddStandardResilienceHandler(); +}); + +builder.Services.AddDbContextFactory( + options => options.UseNpgsql(builder.Configuration.GetConnectionString("AccountingTxContext")), ServiceLifetime.Scoped); + +Dapper.DefaultTypeMap.MatchNamesWithUnderscores = true; + +//MessageBroker with masstransit + outbox +builder.Services.AddMassTransit(config => +{ + config.SetEndpointNameFormatter(new KebabCaseEndpointNameFormatter(prefix: "AccountingTxApi", includeNamespace: false)); + config.UsingRabbitMq((context, configurator) => + { + configurator.Host(new Uri(msgBrokerOptions.Host), h => + { + h.Username(msgBrokerOptions.User); + h.Password(msgBrokerOptions.Password); + }); + + configurator.ConfigureEndpoints(context); + + //TODO:review that Maybe not needed.... it was before I have the Yarp proxy... + configurator.UsePublishFilter(typeof(TenantIdPublishFilter<>), context); + }); + + config.AddEntityFrameworkOutbox(o => + { + o.UsePostgres(); + o.UseBusOutbox(); + }); + + //Add all consumers + config.AddConsumers(Assembly.GetExecutingAssembly()); + + //Add commands clients + +}); + +//Api versioning +builder.Services.AddApiVersionAndExplorer(); + +//TODO: Cors +builder.Services.AddCustomCors(); + +//Tracing and metrics +builder.Logging.AddOpenTelemetry(logging => +{ + logging.IncludeFormattedMessage = true; + logging.IncludeScopes = true; +}); + +//Services +builder.Services.AddScoped(); +builder.Services.AddTransient(); + +builder.Services.AddTracingAndMetrics(); + +builder.Services.AddControllers(o => +{ + o.Filters.Add(new ProducesAttribute("application/json")); +}).AddJsonOptions(options => + options.JsonSerializerOptions.Converters.Add(new JsonStringEnumConverter())); + +builder.Services.AddHttpContextAccessor(); +builder.Services.AddEndpointsApiExplorer(); + +//Route config +builder.Services.Configure(options => +{ + options.LowercaseUrls = true; +}); + +builder.Services.AddControllers(); +// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle +builder.Services.AddEndpointsApiExplorer(); +builder.Services.AddSwaggerGen(); + +var app = builder.Build(); + +app.UseExceptionHandler(app.Logger, app.Environment); + +// Configure the HTTP request pipeline. +if (app.Environment.IsDevelopment()) +{ + app.UseSwagger(); + app.UseSwaggerUIWithAuth(swaggerUIOptions); + + //DB Init on DEV + using var scope = app.Services.CreateScope(); + var services = scope.ServiceProvider; + + //var context = services.GetRequiredService(); + //context.Database.EnsureDeleted(); + //context.Database.EnsureCreated(); + + //await DbInitializer.InitializeAsync(context); +} + +app.UseWhen( + httpContext => httpContext.Request.Path.StartsWithSegments("/admin"), + subApp => subApp.UseMiddleware() +); + +app.UseWhen( + httpContext => !httpContext.Request.Path.StartsWithSegments("/admin") + && !httpContext.Request.Path.StartsWithSegments("/swagger"), + + subApp => subApp.UseMiddleware() +); + +app.UseHttpsRedirection(); + +//app.UseAuthorization(); + +app.MapControllers(); + +app.Run(); diff --git a/src/Ubik.Accounting.Transaction.Api/Properties/launchSettings.json b/src/Ubik.Accounting.Transaction.Api/Properties/launchSettings.json new file mode 100644 index 00000000..1ef1ebc2 --- /dev/null +++ b/src/Ubik.Accounting.Transaction.Api/Properties/launchSettings.json @@ -0,0 +1,41 @@ +{ + "$schema": "http://json.schemastore.org/launchsettings.json", + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:47209", + "sslPort": 44393 + } + }, + "profiles": { + "http": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "launchUrl": "swagger", + "applicationUrl": "http://localhost:5201", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "https": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "launchUrl": "swagger", + "applicationUrl": "https://localhost:7053;http://localhost:5201", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "launchUrl": "swagger", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + } + } +} diff --git a/src/Ubik.Accounting.Transaction.Api/Ubik.Accounting.Transaction.Api.csproj b/src/Ubik.Accounting.Transaction.Api/Ubik.Accounting.Transaction.Api.csproj new file mode 100644 index 00000000..f94c4ab5 --- /dev/null +++ b/src/Ubik.Accounting.Transaction.Api/Ubik.Accounting.Transaction.Api.csproj @@ -0,0 +1,20 @@ + + + + net8.0 + enable + enable + + + + + + + + + + + + + + diff --git a/src/Ubik.Accounting.Transaction.Api/Ubik.Accounting.Transaction.Api.http b/src/Ubik.Accounting.Transaction.Api/Ubik.Accounting.Transaction.Api.http new file mode 100644 index 00000000..1bd55965 --- /dev/null +++ b/src/Ubik.Accounting.Transaction.Api/Ubik.Accounting.Transaction.Api.http @@ -0,0 +1,6 @@ +@Ubik.Accounting.Transaction.Api_HostAddress = http://localhost:5201 + +GET {{Ubik.Accounting.Transaction.Api_HostAddress}}/weatherforecast/ +Accept: application/json + +### diff --git a/src/Ubik.Accounting.Transaction.Api/appsettings.Development.json b/src/Ubik.Accounting.Transaction.Api/appsettings.Development.json new file mode 100644 index 00000000..0c208ae9 --- /dev/null +++ b/src/Ubik.Accounting.Transaction.Api/appsettings.Development.json @@ -0,0 +1,8 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + } +} diff --git a/src/Ubik.Accounting.Transaction.Api/appsettings.json b/src/Ubik.Accounting.Transaction.Api/appsettings.json new file mode 100644 index 00000000..ca74231b --- /dev/null +++ b/src/Ubik.Accounting.Transaction.Api/appsettings.json @@ -0,0 +1,29 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + }, + "AuthServer": { + "MetadataAddress": "http://localhost:8080/realms/ubik/.well-known/openid-configuration", + "Authority": "http://localhost:8080/realms/ubik", + "Audience": "account", + "RequireHttpsMetadata": false, + "AuthorizationUrl": "http://localhost:8080/realms/ubik/protocol/openid-connect/auth", + "TokenUrl": "http://localhost:8080/realms/ubik/protocol/openid-connect/token" + }, + "MessageBroker": { + "Host": "amqp://localhost:5672", + "User": "guest", + "Password": "guest" + }, + "ConnectionStrings": { + "AccountingTxContext": "Host=localhost;Port=5435;Database=ubik_accounting_tx;Username=postgres;Password=test01" + }, + "SwaggerUI": { + "ClientId": "ubik_app", + "ClientSecret": "Ye6Y36ocA4SaGqYzd0HgmqMhVaM2jlkE" + }, + "AllowedHosts": "*" +} diff --git a/src/Ubik.sln b/src/Ubik.sln index a14432a5..da552df2 100644 --- a/src/Ubik.sln +++ b/src/Ubik.sln @@ -29,9 +29,11 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ubik.CodeGenerator", "Ubik. EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ubik.YarpProxy", "Ubik.YarpProxy\Ubik.YarpProxy.csproj", "{E64DD625-FF02-4B02-802F-AF2C0D5DA710}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Ubik.Accounting.SalesOrVatTax.Api", "Ubik.Accounting.SalesOrVatTax.Api\Ubik.Accounting.SalesOrVatTax.Api.csproj", "{88A5C638-DFC5-4723-8736-FBBEE524CF72}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ubik.Accounting.SalesOrVatTax.Api", "Ubik.Accounting.SalesOrVatTax.Api\Ubik.Accounting.SalesOrVatTax.Api.csproj", "{88A5C638-DFC5-4723-8736-FBBEE524CF72}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Ubik.Accounting.SalesOrVatTax.Contracts", "Ubik.Accounting.SalesOrVatTax.Contracts\Ubik.Accounting.SalesOrVatTax.Contracts.csproj", "{EE4F7875-98E7-47FD-9921-CD306448A8E4}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ubik.Accounting.SalesOrVatTax.Contracts", "Ubik.Accounting.SalesOrVatTax.Contracts\Ubik.Accounting.SalesOrVatTax.Contracts.csproj", "{EE4F7875-98E7-47FD-9921-CD306448A8E4}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Ubik.Accounting.Transaction.Api", "Ubik.Accounting.Transaction.Api\Ubik.Accounting.Transaction.Api.csproj", "{9FCE175B-60A5-4657-9655-1D22345DF5B7}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -99,6 +101,10 @@ Global {EE4F7875-98E7-47FD-9921-CD306448A8E4}.Debug|Any CPU.Build.0 = Debug|Any CPU {EE4F7875-98E7-47FD-9921-CD306448A8E4}.Release|Any CPU.ActiveCfg = Release|Any CPU {EE4F7875-98E7-47FD-9921-CD306448A8E4}.Release|Any CPU.Build.0 = Release|Any CPU + {9FCE175B-60A5-4657-9655-1D22345DF5B7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9FCE175B-60A5-4657-9655-1D22345DF5B7}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9FCE175B-60A5-4657-9655-1D22345DF5B7}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9FCE175B-60A5-4657-9655-1D22345DF5B7}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE From e39152cc19b136a1ded55bfd3b657d95a85c8315 Mon Sep 17 00:00:00 2001 From: ubik Date: Tue, 5 Nov 2024 16:05:06 +0100 Subject: [PATCH 47/94] Clean all the useless navigation properties --- .../Data/Config/AccountTaxRateConfigConfiguration.cs | 6 +++--- .../Models/AccountTaxRateConfig.cs | 3 --- .../Data/Config/RoleAuthorizationConfiguration.cs | 4 ++-- src/Ubik.Security.Api/Data/Config/RoleConfiguration.cs | 2 +- src/Ubik.Security.Api/Data/Config/UserConfiguration.cs | 2 +- .../Data/Config/UserRoleByTenantConfiguration.cs | 4 ++-- .../Data/Config/UserTenantConfiguration.cs | 4 ++-- src/Ubik.Security.Api/Models/Role.cs | 1 - src/Ubik.Security.Api/Models/RoleAuthorization.cs | 2 -- src/Ubik.Security.Api/Models/User.cs | 1 - src/Ubik.Security.Api/Models/UserRoleByTenant.cs | 2 -- src/Ubik.Security.Api/Models/UserTenant.cs | 2 -- 12 files changed, 11 insertions(+), 22 deletions(-) diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Data/Config/AccountTaxRateConfigConfiguration.cs b/src/Ubik.Accounting.SalesOrVatTax.Api/Data/Config/AccountTaxRateConfigConfiguration.cs index 11ddc1ae..d993aac8 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Api/Data/Config/AccountTaxRateConfigConfiguration.cs +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Data/Config/AccountTaxRateConfigConfiguration.cs @@ -26,19 +26,19 @@ public void Configure(EntityTypeBuilder builder) builder.HasIndex(a => a.TenantId); builder - .HasOne(s => s.Account) + .HasOne() .WithMany() .HasForeignKey(e => e.AccountId) .IsRequired(true); builder - .HasOne(s => s.TaxRate) + .HasOne() .WithMany() .HasForeignKey(e => e.TaxRateId) .IsRequired(true); builder - .HasOne(s => s.TaxAccount) + .HasOne() .WithMany() .HasForeignKey(e => e.TaxAccountId) .IsRequired(true); diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Models/AccountTaxRateConfig.cs b/src/Ubik.Accounting.SalesOrVatTax.Api/Models/AccountTaxRateConfig.cs index 2dd9aa56..1d1ed7ac 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Api/Models/AccountTaxRateConfig.cs +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Models/AccountTaxRateConfig.cs @@ -6,11 +6,8 @@ public class AccountTaxRateConfig : ITenantEntity, IConcurrencyCheckEntity, IAud { public Guid Id { get; set; } public Guid AccountId { get; set; } - public Account? Account { get; set; } public Guid TaxRateId { get; set; } - public TaxRate? TaxRate { get; set; } public Guid TaxAccountId { get; set; } - public Account? TaxAccount { get; set; } public Guid Version { get; set; } public Guid TenantId { get; set; } public DateTime CreatedAt { get; set; } diff --git a/src/Ubik.Security.Api/Data/Config/RoleAuthorizationConfiguration.cs b/src/Ubik.Security.Api/Data/Config/RoleAuthorizationConfiguration.cs index 4d4deaec..09f2fcc3 100644 --- a/src/Ubik.Security.Api/Data/Config/RoleAuthorizationConfiguration.cs +++ b/src/Ubik.Security.Api/Data/Config/RoleAuthorizationConfiguration.cs @@ -23,12 +23,12 @@ public void Configure(EntityTypeBuilder builder) .IsConcurrencyToken(); builder - .HasOne(e => e.Role) + .HasOne() .WithMany() .HasForeignKey(e => e.RoleId).OnDelete(DeleteBehavior.Cascade); builder - .HasOne(e => e.Authorization) + .HasOne() .WithMany() .HasForeignKey(e => e.AuthorizationId).OnDelete(DeleteBehavior.Cascade); } diff --git a/src/Ubik.Security.Api/Data/Config/RoleConfiguration.cs b/src/Ubik.Security.Api/Data/Config/RoleConfiguration.cs index 26e0fc28..5642e13d 100644 --- a/src/Ubik.Security.Api/Data/Config/RoleConfiguration.cs +++ b/src/Ubik.Security.Api/Data/Config/RoleConfiguration.cs @@ -33,7 +33,7 @@ public void Configure(EntityTypeBuilder builder) //When it's a role specific to a tenant builder - .HasOne(s => s.Tenant) + .HasOne() .WithMany() .HasForeignKey(e => e.TenantId); } diff --git a/src/Ubik.Security.Api/Data/Config/UserConfiguration.cs b/src/Ubik.Security.Api/Data/Config/UserConfiguration.cs index ee017955..2bc971ca 100644 --- a/src/Ubik.Security.Api/Data/Config/UserConfiguration.cs +++ b/src/Ubik.Security.Api/Data/Config/UserConfiguration.cs @@ -31,7 +31,7 @@ public void Configure(EntityTypeBuilder builder) .IsUnique(); builder - .HasOne(e => e.SelectedTenant) + .HasOne() .WithMany() .HasForeignKey(e => e.SelectedTenantId).OnDelete(DeleteBehavior.SetNull); } diff --git a/src/Ubik.Security.Api/Data/Config/UserRoleByTenantConfiguration.cs b/src/Ubik.Security.Api/Data/Config/UserRoleByTenantConfiguration.cs index b3ef435b..e5092402 100644 --- a/src/Ubik.Security.Api/Data/Config/UserRoleByTenantConfiguration.cs +++ b/src/Ubik.Security.Api/Data/Config/UserRoleByTenantConfiguration.cs @@ -17,13 +17,13 @@ public void Configure(EntityTypeBuilder builder) .IsConcurrencyToken(); builder - .HasOne(e => e.UserTenant) + .HasOne() .WithMany() .HasForeignKey(e => e.UserTenantId).OnDelete(DeleteBehavior.Cascade) .IsRequired(); builder - .HasOne(e => e.Role) + .HasOne() .WithMany() .HasForeignKey(e => e.RoleId).OnDelete(DeleteBehavior.Cascade) .IsRequired(); diff --git a/src/Ubik.Security.Api/Data/Config/UserTenantConfiguration.cs b/src/Ubik.Security.Api/Data/Config/UserTenantConfiguration.cs index 6aa98dfc..0a76bf0b 100644 --- a/src/Ubik.Security.Api/Data/Config/UserTenantConfiguration.cs +++ b/src/Ubik.Security.Api/Data/Config/UserTenantConfiguration.cs @@ -24,12 +24,12 @@ public void Configure(EntityTypeBuilder builder) //TODO: very dangerous, change that builder - .HasOne(e => e.User) + .HasOne() .WithMany() .HasForeignKey(e => e.UserId).OnDelete(DeleteBehavior.Cascade); builder - .HasOne(e => e.Tenant) + .HasOne() .WithMany() .HasForeignKey(e => e.TenantId).OnDelete(DeleteBehavior.Cascade); } diff --git a/src/Ubik.Security.Api/Models/Role.cs b/src/Ubik.Security.Api/Models/Role.cs index d5a7b7b1..b71d8f17 100644 --- a/src/Ubik.Security.Api/Models/Role.cs +++ b/src/Ubik.Security.Api/Models/Role.cs @@ -9,7 +9,6 @@ public class Role : IConcurrencyCheckEntity, IAuditEntity public required string Label { get; set; } public string? Description { get; set; } public Guid? TenantId { get; set; } - public Tenant? Tenant { get; set; } public Guid Version { get; set; } public DateTime CreatedAt { get; set; } public Guid CreatedBy { get; set; } diff --git a/src/Ubik.Security.Api/Models/RoleAuthorization.cs b/src/Ubik.Security.Api/Models/RoleAuthorization.cs index ac9792f1..73837b6d 100644 --- a/src/Ubik.Security.Api/Models/RoleAuthorization.cs +++ b/src/Ubik.Security.Api/Models/RoleAuthorization.cs @@ -6,9 +6,7 @@ public class RoleAuthorization : IConcurrencyCheckEntity, IAuditEntity { public Guid Id { get; set; } public Guid RoleId { get; set; } - public Role? Role { get; set; } public Guid AuthorizationId { get; set; } - public Authorization? Authorization { get; set; } public Guid Version { get; set; } public DateTime CreatedAt { get; set; } public Guid CreatedBy { get; set; } diff --git a/src/Ubik.Security.Api/Models/User.cs b/src/Ubik.Security.Api/Models/User.cs index 3ff05525..db02392d 100644 --- a/src/Ubik.Security.Api/Models/User.cs +++ b/src/Ubik.Security.Api/Models/User.cs @@ -11,7 +11,6 @@ public class User : IConcurrencyCheckEntity, IAuditEntity public bool IsActivated { get; set; } = true; public bool IsMegaAdmin { get; set; } = false; public Guid? SelectedTenantId { get; set; } - public Tenant? SelectedTenant { get; set; } public Guid Version { get; set; } public DateTime CreatedAt { get; set; } public Guid CreatedBy { get; set; } diff --git a/src/Ubik.Security.Api/Models/UserRoleByTenant.cs b/src/Ubik.Security.Api/Models/UserRoleByTenant.cs index 9f77e2e1..1ed41672 100644 --- a/src/Ubik.Security.Api/Models/UserRoleByTenant.cs +++ b/src/Ubik.Security.Api/Models/UserRoleByTenant.cs @@ -6,9 +6,7 @@ public class UserRoleByTenant : IConcurrencyCheckEntity, IAuditEntity { public Guid Id { get; set; } public Guid UserTenantId { get; set; } - public UserTenant? UserTenant { get; set; } public Guid RoleId { get; set; } - public Role? Role { get; set; } public Guid Version { get; set; } public DateTime CreatedAt { get; set; } public Guid CreatedBy { get; set; } diff --git a/src/Ubik.Security.Api/Models/UserTenant.cs b/src/Ubik.Security.Api/Models/UserTenant.cs index 44406e36..fad8f4be 100644 --- a/src/Ubik.Security.Api/Models/UserTenant.cs +++ b/src/Ubik.Security.Api/Models/UserTenant.cs @@ -6,9 +6,7 @@ public class UserTenant: IConcurrencyCheckEntity, IAuditEntity { public Guid Id { get; set; } public Guid UserId { get; set; } - public User? User { get; set; } public Guid TenantId { get; set; } - public Tenant? Tenant { get; set; } public Guid Version { get; set; } public DateTime CreatedAt { get; set; } public Guid CreatedBy { get; set; } From b9b238c92cf8a7eb43f05fb1a6631a14bf9ebbec Mon Sep 17 00:00:00 2001 From: ubik Date: Tue, 5 Nov 2024 21:15:31 +0100 Subject: [PATCH 48/94] Not working but some progress on creating a not bad model. --- .../Data/AccountingDbContext.cs | 6 -- .../Data/Config/AccountConfiguration.cs | 1 + .../Data/AccountingTxContext.cs | 94 +++++++++++++++++++ .../Data/Config/EntryConfiguration.cs | 86 +++++++++++++++++ .../Data/Config/TxConfiguration.cs | 6 ++ .../Models/Account.cs | 15 +++ .../Models/AmountAdditionnalInfo.cs | 9 ++ .../Models/Currency.cs | 14 +++ .../Models/Entry.cs | 26 ++++- .../Models/TaxInfo.cs | 18 ++++ .../Models/TaxRate.cs | 12 +++ .../Models/Tx.cs | 18 ++++ .../Program.cs | 7 +- .../Ubik.Accounting.Transaction.Api.csproj | 8 ++ .../Entries/Enums/DebitCredit.cs | 14 +++ .../Entries/Enums/EntryType.cs | 14 +++ ...ik.Accounting.Transaction.Contracts.csproj | 9 ++ src/Ubik.sln | 6 ++ 18 files changed, 352 insertions(+), 11 deletions(-) create mode 100644 src/Ubik.Accounting.Transaction.Api/Data/AccountingTxContext.cs create mode 100644 src/Ubik.Accounting.Transaction.Api/Data/Config/EntryConfiguration.cs create mode 100644 src/Ubik.Accounting.Transaction.Api/Data/Config/TxConfiguration.cs create mode 100644 src/Ubik.Accounting.Transaction.Api/Models/Account.cs create mode 100644 src/Ubik.Accounting.Transaction.Api/Models/AmountAdditionnalInfo.cs create mode 100644 src/Ubik.Accounting.Transaction.Api/Models/Currency.cs create mode 100644 src/Ubik.Accounting.Transaction.Api/Models/TaxInfo.cs create mode 100644 src/Ubik.Accounting.Transaction.Api/Models/TaxRate.cs create mode 100644 src/Ubik.Accounting.Transaction.Api/Models/Tx.cs create mode 100644 src/Ubik.Accounting.Transaction.Contracts/Entries/Enums/DebitCredit.cs create mode 100644 src/Ubik.Accounting.Transaction.Contracts/Entries/Enums/EntryType.cs create mode 100644 src/Ubik.Accounting.Transaction.Contracts/Ubik.Accounting.Transaction.Contracts.csproj diff --git a/src/Ubik.Accounting.Structure.Api/Data/AccountingDbContext.cs b/src/Ubik.Accounting.Structure.Api/Data/AccountingDbContext.cs index 907cadba..e4059873 100644 --- a/src/Ubik.Accounting.Structure.Api/Data/AccountingDbContext.cs +++ b/src/Ubik.Accounting.Structure.Api/Data/AccountingDbContext.cs @@ -105,12 +105,6 @@ private void SetTenantId(ModelBuilder modelBuilder) modelBuilder.Entity() .HasQueryFilter(mt => mt.TenantId == _currentUser.TenantId); - - //modelBuilder.Entity() - // .HasQueryFilter(mt => mt.TenantId == _currentUser.TenantId); - - //modelBuilder.Entity() - // .HasQueryFilter(mt => mt.TenantId == _currentUser.TenantId); } } } diff --git a/src/Ubik.Accounting.Structure.Api/Data/Config/AccountConfiguration.cs b/src/Ubik.Accounting.Structure.Api/Data/Config/AccountConfiguration.cs index f50264a9..e9b9f977 100644 --- a/src/Ubik.Accounting.Structure.Api/Data/Config/AccountConfiguration.cs +++ b/src/Ubik.Accounting.Structure.Api/Data/Config/AccountConfiguration.cs @@ -53,6 +53,7 @@ public void Configure(EntityTypeBuilder builder) .WithMany() .HasForeignKey(a => a.CurrencyId).OnDelete(DeleteBehavior.Restrict) .IsRequired(true); + } } } diff --git a/src/Ubik.Accounting.Transaction.Api/Data/AccountingTxContext.cs b/src/Ubik.Accounting.Transaction.Api/Data/AccountingTxContext.cs new file mode 100644 index 00000000..d3e56232 --- /dev/null +++ b/src/Ubik.Accounting.Transaction.Api/Data/AccountingTxContext.cs @@ -0,0 +1,94 @@ +using MassTransit; +using Microsoft.EntityFrameworkCore; +using Ubik.Accounting.Transaction.Api.Data.Config; +using Ubik.Accounting.Transaction.Api.Models; +using Ubik.ApiService.Common.Errors; +using Ubik.ApiService.Common.Exceptions; +using Ubik.ApiService.Common.Services; +using Ubik.DB.Common.Extensions; + +namespace Ubik.Accounting.Transaction.Api.Data +{ + public class AccountingTxContext(DbContextOptions options + , ICurrentUser userService) : DbContext(options) + { + public DbSet Entries { get; set; } + + protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) + { + optionsBuilder + .UseQueryTrackingBehavior(QueryTrackingBehavior.NoTracking) + .UseSnakeCaseNamingConvention(); + } + + //TODO: need to implement something for a basic standard DBContex conf. + public override async Task SaveChangesAsync(CancellationToken cancellationToken = default) + { + try + { + return await base.SaveChangesAsync(cancellationToken); + } + catch (DbUpdateConcurrencyException) + { + var err = new CustomError() + { + ErrorCode = "DB_CONCURRENCY_CONFLICT", + ErrorFriendlyMessage = "You don't have the last version or the ressource, refresh your data before updating.", + ErrorValueDetails = "Version", + }; + var conflict = new UpdateDbConcurrencyException() + { + CustomErrors = [err] + }; + + throw conflict; + } + } + + public void SetAuditAndSpecialFields() + { + ChangeTracker.SetSpecialFields(userService); + } + + protected override void OnModelCreating(ModelBuilder modelBuilder) + { + //Build for Masstransit inbox/outbox + modelBuilder.AddInboxStateEntity(); + modelBuilder.AddOutboxMessageEntity(); + modelBuilder.AddOutboxStateEntity(); + + //TenantId + SetTenantId(modelBuilder); + + //Configure + new EntryConfiguration().Configure(modelBuilder.Entity()); + //new ClassificationConfiguration().Configure(modelBuilder.Entity()); + //new AccountGroupConfiguration().Configure(modelBuilder.Entity()); + //new AccountConfiguration().Configure(modelBuilder.Entity()); + //new AccountAccountGroupConfiguration().Configure(modelBuilder.Entity()); + //new ApplicationConfiguration().Configure(modelBuilder.Entity()); + //new TransactionConfiguration().Configure(modelBuilder.Entity()); + //new EntryConfiguration().Configure(modelBuilder.Entity()); + + base.OnModelCreating(modelBuilder); + } + + private void SetTenantId(ModelBuilder modelBuilder) + { + modelBuilder.Entity() + .HasQueryFilter(mt => mt.TenantId == userService.TenantId); + + //modelBuilder.Entity() + // .HasQueryFilter(mt => mt.TenantId == _currentUser.TenantId); + + //modelBuilder.Entity() + // .HasQueryFilter(mt => mt.TenantId == _currentUser.TenantId); + + //modelBuilder.Entity() + // .HasQueryFilter(mt => mt.TenantId == _currentUser.TenantId); + + //modelBuilder.Entity() + // .HasQueryFilter(mt => mt.TenantId == _currentUser.TenantId); + } + } +} diff --git a/src/Ubik.Accounting.Transaction.Api/Data/Config/EntryConfiguration.cs b/src/Ubik.Accounting.Transaction.Api/Data/Config/EntryConfiguration.cs new file mode 100644 index 00000000..372eb1fa --- /dev/null +++ b/src/Ubik.Accounting.Transaction.Api/Data/Config/EntryConfiguration.cs @@ -0,0 +1,86 @@ +using Microsoft.EntityFrameworkCore.Metadata.Builders; +using Microsoft.EntityFrameworkCore; +using Ubik.Accounting.Transaction.Api.Models; + +namespace Ubik.Accounting.Transaction.Api.Data.Config +{ + public class EntryConfiguration : IEntityTypeConfiguration + { + public void Configure(EntityTypeBuilder builder) + { + builder.ToTable("entries"); + + builder.Property(a => a.Type) + .IsRequired() + .HasConversion(); + + builder.Property(a => a.Sign) + .IsRequired() + .HasConversion(); + + builder.HasOne() + .WithMany() + .HasForeignKey(a => a.TxId).OnDelete(DeleteBehavior.Cascade) + .IsRequired(true); + + builder.HasOne() + .WithMany() + .HasForeignKey(a => a.AccountId).OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + //TODO: see that tomorrow... I want to be able to enrich the model and link it + // to the DB in a smart way. + builder.OwnsOne(a => a.TaxInfo, taxInfo => + { + taxInfo.Property(t => t.TaxAppliedRate) + .HasPrecision(8, 5) + .IsRequired(false) + .HasConversion(); + + taxInfo.Property(t => t.TaxRateId) + .IsRequired(false); + }); + + //builder.OwnsOne(a => a.AmountExchangeInfo, exchangeInfo => + //{ + // exchangeInfo.Property(t => t.OriginalAmount) + // .HasPrecision(18, 4) + // .IsRequired(false); + + // exchangeInfo.Property(t => t.ExchangeRate) + // .HasPrecision(18, 10) + // .IsRequired(false); + + // exchangeInfo.HasOne() + // .WithMany() + // .HasForeignKey(e => e.OriginalCurrencyId) + // .IsRequired(false); + //}); + + builder.Property(a => a.Label) + .IsRequired() + .HasMaxLength(100); + + builder.Property(a => a.Description) + .HasMaxLength(700); + + builder.Property(a => a.Amount) + .IsRequired() + .HasPrecision(18, 4); + + builder.Property(a => a.Version) + .IsConcurrencyToken(); + + builder.Property(a => a.TenantId) + .IsRequired(); + + builder.Property(a => a.CreatedAt) + .IsRequired(); + + builder.Property(a => a.CreatedBy) + .IsRequired(); + + builder.HasIndex(a => a.TenantId); + } + } +} diff --git a/src/Ubik.Accounting.Transaction.Api/Data/Config/TxConfiguration.cs b/src/Ubik.Accounting.Transaction.Api/Data/Config/TxConfiguration.cs new file mode 100644 index 00000000..68e16bd5 --- /dev/null +++ b/src/Ubik.Accounting.Transaction.Api/Data/Config/TxConfiguration.cs @@ -0,0 +1,6 @@ +namespace Ubik.Accounting.Transaction.Api.Data.Config +{ + public class TxConfiguration + { + } +} diff --git a/src/Ubik.Accounting.Transaction.Api/Models/Account.cs b/src/Ubik.Accounting.Transaction.Api/Models/Account.cs new file mode 100644 index 00000000..52fd4ead --- /dev/null +++ b/src/Ubik.Accounting.Transaction.Api/Models/Account.cs @@ -0,0 +1,15 @@ +using Ubik.DB.Common; + +namespace Ubik.Accounting.Transaction.Api.Models +{ + //Source of truth => Accounting.Structure + public class Account : ITenantEntity + { + public Guid Id { get; set; } + public required string Code { get; set; } + public required string Label { get; set; } + public bool Active { get; set; } = true; + public Guid Version { get; set; } + public Guid TenantId { get; set; } + } +} diff --git a/src/Ubik.Accounting.Transaction.Api/Models/AmountAdditionnalInfo.cs b/src/Ubik.Accounting.Transaction.Api/Models/AmountAdditionnalInfo.cs new file mode 100644 index 00000000..d4759073 --- /dev/null +++ b/src/Ubik.Accounting.Transaction.Api/Models/AmountAdditionnalInfo.cs @@ -0,0 +1,9 @@ +namespace Ubik.Accounting.Transaction.Api.Models +{ + public class AmountAdditionnalInfo + { + public decimal OriginalAmount { get; set; } + public Guid OriginalCurrencyId { get; set; } + public decimal ExchangeRate { get; set; } + } +} diff --git a/src/Ubik.Accounting.Transaction.Api/Models/Currency.cs b/src/Ubik.Accounting.Transaction.Api/Models/Currency.cs new file mode 100644 index 00000000..161442e2 --- /dev/null +++ b/src/Ubik.Accounting.Transaction.Api/Models/Currency.cs @@ -0,0 +1,14 @@ +using System.ComponentModel.DataAnnotations; + +namespace Ubik.Accounting.Transaction.Api.Models +{ + //Source of truth => To be determined + public class Currency + { + public Guid Id { get; set; } + [StringLength(3)] + public required string IsoCode { get; set; } + public Guid Version { get; set; } + public Guid TenantId { get; set; } + } +} diff --git a/src/Ubik.Accounting.Transaction.Api/Models/Entry.cs b/src/Ubik.Accounting.Transaction.Api/Models/Entry.cs index 3321d353..106cce2d 100644 --- a/src/Ubik.Accounting.Transaction.Api/Models/Entry.cs +++ b/src/Ubik.Accounting.Transaction.Api/Models/Entry.cs @@ -1,6 +1,28 @@ -namespace Ubik.Accounting.Transaction.Api.Models +using LanguageExt; +using Ubik.Accounting.Transaction.Contracts.Entries.Enums; +using Ubik.DB.Common; + +namespace Ubik.Accounting.Transaction.Api.Models { - public class Entry + public class Entry : ITenantEntity, IConcurrencyCheckEntity, IAuditEntity { + public Guid Id { get; set; } + public required EntryType Type { get; set; } + public required DebitCredit Sign { get; set; } + public required Guid TxId { get; set; } + public required Guid AccountId { get; set; } + //Used to keep a trace of the VAT rate applied to the entry (at a time) + public string? Label { get; set; } + public string? Description { get; set; } + //See if we want the amount with or without VAT + public required decimal Amount { get; set; } + public AmountAdditionnalInfo? AmountExchangeInfo { get; set; } + public TaxInfo? TaxInfo { get; set; } = default!; + public Guid Version { get; set; } + public Guid TenantId { get; set; } + public required DateTime CreatedAt { get; set; } + public required Guid CreatedBy { get; set; } + public DateTime? ModifiedAt { get; set; } + public Guid? ModifiedBy { get; set; } } } diff --git a/src/Ubik.Accounting.Transaction.Api/Models/TaxInfo.cs b/src/Ubik.Accounting.Transaction.Api/Models/TaxInfo.cs new file mode 100644 index 00000000..b3fe868e --- /dev/null +++ b/src/Ubik.Accounting.Transaction.Api/Models/TaxInfo.cs @@ -0,0 +1,18 @@ +namespace Ubik.Accounting.Transaction.Api.Models +{ + public class TaxInfo + { + private decimal? _taxAppliedRate { get; set; } + public decimal TaxAppliedRate + { + get => _taxAppliedRate ?? 0; + set => _taxAppliedRate = value; + } + + private Guid? _taxRateId; + public Guid TaxRateId { get; set; } + + + } +} +} diff --git a/src/Ubik.Accounting.Transaction.Api/Models/TaxRate.cs b/src/Ubik.Accounting.Transaction.Api/Models/TaxRate.cs new file mode 100644 index 00000000..cfbac17e --- /dev/null +++ b/src/Ubik.Accounting.Transaction.Api/Models/TaxRate.cs @@ -0,0 +1,12 @@ +namespace Ubik.Accounting.Transaction.Api.Models +{ + // Source of truth => Accounting.SalesOrVatTax + public class TaxRate + { + public Guid Id { get; set; } + public required string Code { get; set; } + public decimal Rate { get; set; } + public Guid Version { get; set; } + public Guid TenantId { get; set; } + } +} diff --git a/src/Ubik.Accounting.Transaction.Api/Models/Tx.cs b/src/Ubik.Accounting.Transaction.Api/Models/Tx.cs new file mode 100644 index 00000000..0b4214f8 --- /dev/null +++ b/src/Ubik.Accounting.Transaction.Api/Models/Tx.cs @@ -0,0 +1,18 @@ +using Ubik.DB.Common; + +namespace Ubik.Accounting.Transaction.Api.Models +{ + public class Tx : ITenantEntity, IConcurrencyCheckEntity, IAuditEntity + { + public Guid Id { get; set; } + public required DateOnly ValueDate { get; set; } + public required string Label { get; set; } + public decimal Amount { get; set; } + public Guid Version { get; set; } + public Guid TenantId { get; set; } + public required DateTime CreatedAt { get; set; } + public required Guid CreatedBy { get; set; } + public DateTime? ModifiedAt { get; set; } + public Guid? ModifiedBy { get; set; } + } +} diff --git a/src/Ubik.Accounting.Transaction.Api/Program.cs b/src/Ubik.Accounting.Transaction.Api/Program.cs index 4ed63f3f..d2e80d1d 100644 --- a/src/Ubik.Accounting.Transaction.Api/Program.cs +++ b/src/Ubik.Accounting.Transaction.Api/Program.cs @@ -4,6 +4,7 @@ using Microsoft.EntityFrameworkCore; using System.Reflection; using System.Text.Json.Serialization; +using Ubik.Accounting.Transaction.Api.Data; using Ubik.ApiService.Common.Configure; using Ubik.ApiService.Common.Configure.Options; using Ubik.ApiService.Common.Exceptions; @@ -116,9 +117,9 @@ using var scope = app.Services.CreateScope(); var services = scope.ServiceProvider; - //var context = services.GetRequiredService(); - //context.Database.EnsureDeleted(); - //context.Database.EnsureCreated(); + var context = services.GetRequiredService(); + context.Database.EnsureDeleted(); + context.Database.EnsureCreated(); //await DbInitializer.InitializeAsync(context); } diff --git a/src/Ubik.Accounting.Transaction.Api/Ubik.Accounting.Transaction.Api.csproj b/src/Ubik.Accounting.Transaction.Api/Ubik.Accounting.Transaction.Api.csproj index f94c4ab5..77b713fa 100644 --- a/src/Ubik.Accounting.Transaction.Api/Ubik.Accounting.Transaction.Api.csproj +++ b/src/Ubik.Accounting.Transaction.Api/Ubik.Accounting.Transaction.Api.csproj @@ -8,13 +8,21 @@ + + + + + + + + diff --git a/src/Ubik.Accounting.Transaction.Contracts/Entries/Enums/DebitCredit.cs b/src/Ubik.Accounting.Transaction.Contracts/Entries/Enums/DebitCredit.cs new file mode 100644 index 00000000..a6e3b78e --- /dev/null +++ b/src/Ubik.Accounting.Transaction.Contracts/Entries/Enums/DebitCredit.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Ubik.Accounting.Transaction.Contracts.Entries.Enums +{ + public enum DebitCredit + { + Debit, + Credit + } +} diff --git a/src/Ubik.Accounting.Transaction.Contracts/Entries/Enums/EntryType.cs b/src/Ubik.Accounting.Transaction.Contracts/Entries/Enums/EntryType.cs new file mode 100644 index 00000000..f79bc43e --- /dev/null +++ b/src/Ubik.Accounting.Transaction.Contracts/Entries/Enums/EntryType.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Ubik.Accounting.Transaction.Contracts.Entries.Enums +{ + public enum EntryType + { + Main, + Counterparty, + } +} diff --git a/src/Ubik.Accounting.Transaction.Contracts/Ubik.Accounting.Transaction.Contracts.csproj b/src/Ubik.Accounting.Transaction.Contracts/Ubik.Accounting.Transaction.Contracts.csproj new file mode 100644 index 00000000..fa71b7ae --- /dev/null +++ b/src/Ubik.Accounting.Transaction.Contracts/Ubik.Accounting.Transaction.Contracts.csproj @@ -0,0 +1,9 @@ + + + + net8.0 + enable + enable + + + diff --git a/src/Ubik.sln b/src/Ubik.sln index da552df2..a439ee9c 100644 --- a/src/Ubik.sln +++ b/src/Ubik.sln @@ -35,6 +35,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ubik.Accounting.SalesOrVatT EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Ubik.Accounting.Transaction.Api", "Ubik.Accounting.Transaction.Api\Ubik.Accounting.Transaction.Api.csproj", "{9FCE175B-60A5-4657-9655-1D22345DF5B7}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Ubik.Accounting.Transaction.Contracts", "Ubik.Accounting.Transaction.Contracts\Ubik.Accounting.Transaction.Contracts.csproj", "{B4032FBF-3A2E-45E6-AB38-E148103B3A62}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -105,6 +107,10 @@ Global {9FCE175B-60A5-4657-9655-1D22345DF5B7}.Debug|Any CPU.Build.0 = Debug|Any CPU {9FCE175B-60A5-4657-9655-1D22345DF5B7}.Release|Any CPU.ActiveCfg = Release|Any CPU {9FCE175B-60A5-4657-9655-1D22345DF5B7}.Release|Any CPU.Build.0 = Release|Any CPU + {B4032FBF-3A2E-45E6-AB38-E148103B3A62}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B4032FBF-3A2E-45E6-AB38-E148103B3A62}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B4032FBF-3A2E-45E6-AB38-E148103B3A62}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B4032FBF-3A2E-45E6-AB38-E148103B3A62}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE From 1c55a3d1b276a41e4125f45080cafb71cf902e46 Mon Sep 17 00:00:00 2001 From: fdonnet Date: Wed, 6 Nov 2024 10:08:48 +0100 Subject: [PATCH 49/94] Rename Feature erro type --- .../AccountTaxRateConfigAlreadyExists.cs | 6 +- .../AccountTaxRateConfigNotFoundError.cs | 6 +- .../AccountTaxRateConfigsCommandService.cs | 22 +++--- .../AccountTaxRateConfigsQueryService.cs | 8 +-- .../IAccountTaxRateConfigsCommandService.cs | 4 +- .../IAccountTaxRateConfigsQueryService.cs | 4 +- .../Services/ITaxRateCommandService.cs | 6 +- .../TaxRates/Services/ITaxRateQueryService.cs | 2 +- .../Services/TaxRateCommandService.cs | 26 +++---- .../TaxRates/Services/TaxRateQueryService.cs | 2 +- .../Errors/AccountGroupParentNotFoundError.cs | 6 +- .../Services/AccountGroupCommandService.cs | 32 ++++----- .../Services/AccountGroupQueryService.cs | 4 +- .../Services/IAccountGroupCommandService.cs | 6 +- .../Services/IAccountGroupQueryService.cs | 4 +- ...countAlreadyExistsInClassificationError.cs | 6 +- .../AccountLinkedToExistingEntriesError.cs | 6 +- .../AccountNotExistsInAccountGroupError.cs | 6 +- .../Services/AccountCommandService.cs | 46 ++++++------ .../Accounts/Services/AccountQueryService.cs | 4 +- .../Services/IAccountCommandService.cs | 10 +-- .../Accounts/Services/IAccountQueryService.cs | 4 +- .../Services/ClassificationCommandService.cs | 32 ++++----- .../Services/ClassificationQueryService.cs | 8 +-- .../Services/IClassificationCommandService.cs | 6 +- .../Services/IClassificationQueryService.cs | 8 +-- .../Data/Config/EntryConfiguration.cs | 72 +++++++++++-------- .../Models/AmountAdditionnalInfo.cs | 34 ++++++++- .../Models/Entry.cs | 2 +- .../Models/TaxInfo.cs | 33 +++++++-- .../BadParamExternalResourceNotFound.cs | 6 +- .../Errors/ResourceAlreadyExistsError.cs | 6 +- .../ResourceIdNotMatchWithCommandError.cs | 6 +- .../Errors/ResourceNotFoundError.cs | 6 +- .../Errors/ResourceUpdateConcurrencyError.cs | 6 +- .../Exceptions/ConfigureExceptionHandler.cs | 2 +- .../ControllerProblemDetailsExtension.cs | 10 +-- ...iceAndFeatureError.cs => IFeatureError.cs} | 6 +- .../UpdateDbConcurrencyException.cs | 6 +- .../Validators/CustomValidationException.cs | 4 +- .../Data/Init/AuthInitializer.cs | 2 +- .../Services/AuthorizationsCommandsService.cs | 26 +++---- .../Services/AuthorizationsQueriesService.cs | 2 +- .../IAuthorizationsCommandsService.cs | 6 +- .../Services/IAuthorizationsQueriesService.cs | 2 +- .../Services/IRolesAdminCommandsService.cs | 6 +- .../Services/IRolesAdminQueriesService.cs | 2 +- .../Services/RolesAdminCommandsService.cs | 26 +++---- .../Services/RolesAdminQueriesService.cs | 2 +- .../RoleAuthorizationIsNotABaseRoleError.cs | 6 +- .../IRolesAuthorizationsCommandsService.cs | 4 +- .../IRolesAuthorizationsQueriesService.cs | 2 +- .../RolesAuthorizationsCommandsService.cs | 22 +++--- .../RolesAuthorizationsQueriesService.cs | 2 +- .../Services/ITenantsCommandsService.cs | 6 +- .../Services/ITenantsQueriesService.cs | 2 +- .../Services/TenantsCommandsService.cs | 26 +++---- .../Tenants/Services/TenantsQueriesService.cs | 2 +- .../Users/Errors/CannotGetAuthToken.cs | 6 +- .../Users/Errors/UserAddFatalError.cs | 6 +- ...serCannotBeAddedInAuthProviderBadParams.cs | 6 +- ...UserCannotBeAddedInAuthProviderConflict.cs | 6 +- .../Errors/UserCannotCheckIfPresentInAuth.cs | 6 +- .../Errors/UserCannotGetMainUsrMgtRole.cs | 6 +- .../Users/Errors/UserTenantNotFound.cs | 6 +- .../Services/IUserAuthProviderService.cs | 4 +- .../Users/Services/IUsersCommandsService.cs | 6 +- .../Users/Services/IUsersQueriesService.cs | 20 +++--- .../UserAuthProviderServiceKeycloak.cs | 10 +-- .../Users/Services/UsersCommandsService.cs | 48 ++++++------- .../Users/Services/UsersQueriesService.cs | 26 +++---- 71 files changed, 418 insertions(+), 357 deletions(-) rename src/Ubik.ApiService.Common/Exceptions/{IServiceAndFeatureError.cs => IFeatureError.cs} (77%) diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountTaxRateConfigs/Errors/AccountTaxRateConfigAlreadyExists.cs b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountTaxRateConfigs/Errors/AccountTaxRateConfigAlreadyExists.cs index 766ab8de..4c74e5ae 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountTaxRateConfigs/Errors/AccountTaxRateConfigAlreadyExists.cs +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountTaxRateConfigs/Errors/AccountTaxRateConfigAlreadyExists.cs @@ -2,15 +2,15 @@ namespace Ubik.Accounting.SalesOrVatTax.Api.Features.AccountTaxRateConfigs.Errors { - public record AccountTaxRateConfigAlreadyExists : IServiceAndFeatureError + public record AccountTaxRateConfigAlreadyExists : IFeatureError { - public ServiceAndFeatureErrorType ErrorType { get; init; } + public FeatureErrorType ErrorType { get; init; } public List CustomErrors { get; init; } public AccountTaxRateConfigAlreadyExists(Guid accountId, Guid taxRateId) { - ErrorType = ServiceAndFeatureErrorType.BadParams; + ErrorType = FeatureErrorType.BadParams; CustomErrors = new List() { new CustomError() { ErrorCode = "LINKED_TAX_RATE_ALREADY_EXIST", diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountTaxRateConfigs/Errors/AccountTaxRateConfigNotFoundError.cs b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountTaxRateConfigs/Errors/AccountTaxRateConfigNotFoundError.cs index cdccce59..6e803b15 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountTaxRateConfigs/Errors/AccountTaxRateConfigNotFoundError.cs +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountTaxRateConfigs/Errors/AccountTaxRateConfigNotFoundError.cs @@ -2,15 +2,15 @@ namespace Ubik.Accounting.SalesOrVatTax.Api.Features.AccountTaxRateConfigs.Errors { - public record AccountTaxRateConfigNotFoundError : IServiceAndFeatureError + public record AccountTaxRateConfigNotFoundError : IFeatureError { - public ServiceAndFeatureErrorType ErrorType { get; init; } + public FeatureErrorType ErrorType { get; init; } public List CustomErrors { get; init; } public AccountTaxRateConfigNotFoundError(Guid accountId, Guid taxRateId) { - ErrorType = ServiceAndFeatureErrorType.NotFound; + ErrorType = FeatureErrorType.NotFound; CustomErrors = new List() { new CustomError() { ErrorCode = "LINKED_TAX_RATE_NOT_FOUND", diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountTaxRateConfigs/Services/AccountTaxRateConfigsCommandService.cs b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountTaxRateConfigs/Services/AccountTaxRateConfigsCommandService.cs index 55bd8820..68ff1052 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountTaxRateConfigs/Services/AccountTaxRateConfigsCommandService.cs +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountTaxRateConfigs/Services/AccountTaxRateConfigsCommandService.cs @@ -13,7 +13,7 @@ namespace Ubik.Accounting.SalesOrVatTax.Api.Features.AccountTaxRateConfigs.Servi { public class AccountTaxRateConfigsCommandService(AccountingSalesTaxDbContext ctx, IPublishEndpoint publishEndpoint) : IAccountTaxRateConfigsCommandService { - public async Task> AttachAsync(AddAccountTaxRateConfigCommand command) + public async Task> AttachAsync(AddAccountTaxRateConfigCommand command) { return await GetAsync(command.TaxRateId) .BindAsync(t => GetAccountAsync(command.AccountId)) @@ -24,14 +24,14 @@ public async Task> AttachA } - public async Task> DetachAsync(DeleteAccountTaxRateConfigCommand command) + public async Task> DetachAsync(DeleteAccountTaxRateConfigCommand command) { return await GetAccountTaxRateConfigAsync(command.AccountId, command.TaxRateId) .BindAsync(DeleteInDbContextAsync) .BindAsync(DeletedSaveAndPublishAsync); } - private async Task> DeleteInDbContextAsync(AccountTaxRateConfig current) + private async Task> DeleteInDbContextAsync(AccountTaxRateConfig current) { ctx.Entry(current).State = EntityState.Deleted; @@ -39,7 +39,7 @@ private async Task> Delete return current; } - private async Task> DeletedSaveAndPublishAsync(AccountTaxRateConfig current) + private async Task> DeletedSaveAndPublishAsync(AccountTaxRateConfig current) { await publishEndpoint.Publish(new AccountTaxRateConfigDeleted { Id = current.Id }, CancellationToken.None); await ctx.SaveChangesAsync(); @@ -47,7 +47,7 @@ private async Task> DeletedSaveAndPublishA return true; } - private async Task> GetAccountTaxRateConfigAsync(Guid accountId, Guid taxRateId) + private async Task> GetAccountTaxRateConfigAsync(Guid accountId, Guid taxRateId) { var result = await ctx.AccountTaxRateConfigs.FirstOrDefaultAsync(x => x.AccountId == accountId && x.TaxRateId == taxRateId); @@ -56,7 +56,7 @@ private async Task> GetAcc : result; } - private async Task> AddTaxRateLinkSaveAndPublishAsync(AccountTaxRateConfig current) + private async Task> AddTaxRateLinkSaveAndPublishAsync(AccountTaxRateConfig current) { await publishEndpoint.Publish(current.ToAccountTaxRateConfigAdded(), CancellationToken.None); await ctx.SaveChangesAsync(); @@ -64,7 +64,7 @@ private async Task> AddTax return current; } - private async Task> AddTaxRateLinkInDbContextAsync(AddAccountTaxRateConfigCommand command) + private async Task> AddTaxRateLinkInDbContextAsync(AddAccountTaxRateConfigCommand command) { var accountTaxRateConfig = command.ToAccountTaxRateConfig(); var result = await ctx.AccountTaxRateConfigs.AddAsync(command.ToAccountTaxRateConfig()); @@ -73,7 +73,7 @@ private async Task> AddTax return accountTaxRateConfig; } - private async Task> ValidateIfLinkNotAlreadyExistsAsync(Guid accountId, Guid taxRateId) + private async Task> ValidateIfLinkNotAlreadyExistsAsync(Guid accountId, Guid taxRateId) { var result = await ctx.AccountTaxRateConfigs.AnyAsync(x => x.AccountId == accountId && x.TaxRateId == taxRateId); @@ -83,7 +83,7 @@ private async Task> ValidateIfLinkNotAlrea : true; } - private async Task> GetAccountAsync(Guid accountId) + private async Task> GetAccountAsync(Guid accountId) { var result = await ctx.Accounts.FindAsync(accountId); @@ -92,7 +92,7 @@ private async Task> GetAccountAsync(Gui : result; } - private async Task> GetTaxAccountAsync(Guid taxAccountId) + private async Task> GetTaxAccountAsync(Guid taxAccountId) { var result = await ctx.Accounts.FindAsync(taxAccountId); @@ -101,7 +101,7 @@ private async Task> GetTaxAccountAsync( : result; } - private async Task> GetAsync(Guid taxRateId) + private async Task> GetAsync(Guid taxRateId) { var result = await ctx.TaxRates.FindAsync(taxRateId); diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountTaxRateConfigs/Services/AccountTaxRateConfigsQueryService.cs b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountTaxRateConfigs/Services/AccountTaxRateConfigsQueryService.cs index 849689b3..c32a4052 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountTaxRateConfigs/Services/AccountTaxRateConfigsQueryService.cs +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountTaxRateConfigs/Services/AccountTaxRateConfigsQueryService.cs @@ -10,13 +10,13 @@ namespace Ubik.Accounting.SalesOrVatTax.Api.Features.AccountTaxRateConfigs.Servi public class AccountTaxRateConfigsQueryService(AccountingSalesTaxDbContext ctx) : IAccountTaxRateConfigsQueryService { - public async Task>> GetAllAsync(Guid accountId) + public async Task>> GetAllAsync(Guid accountId) { return await GetAccountAsync(accountId) .MapAsync(a => GetAccountTaxConfigs(a.Id)); } - public async Task> GetAsync(Guid accountId, Guid taxRateId) + public async Task> GetAsync(Guid accountId, Guid taxRateId) { return await GetAccountAsync(accountId) .BindAsync(a => GetAccountTaxConfig(a.Id, taxRateId)); @@ -27,7 +27,7 @@ private async Task> GetAccountTaxConfigs(Guid return await ctx.AccountTaxRateConfigs.Where(c => c.AccountId == accountId).ToListAsync(); } - private async Task> GetAccountTaxConfig(Guid accountId, Guid taxRateId) + private async Task> GetAccountTaxConfig(Guid accountId, Guid taxRateId) { var result = await ctx.AccountTaxRateConfigs.Where(c => c.AccountId == accountId && c.TaxRateId == taxRateId).FirstOrDefaultAsync(); @@ -36,7 +36,7 @@ private async Task> GetAcc : result; } - private async Task> GetAccountAsync(Guid accountId) + private async Task> GetAccountAsync(Guid accountId) { var result = await ctx.Accounts.FindAsync(accountId); diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountTaxRateConfigs/Services/IAccountTaxRateConfigsCommandService.cs b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountTaxRateConfigs/Services/IAccountTaxRateConfigsCommandService.cs index d7e53356..9513d4ba 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountTaxRateConfigs/Services/IAccountTaxRateConfigsCommandService.cs +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountTaxRateConfigs/Services/IAccountTaxRateConfigsCommandService.cs @@ -7,7 +7,7 @@ namespace Ubik.Accounting.SalesOrVatTax.Api.Features.AccountTaxRateConfigs.Servi { public interface IAccountTaxRateConfigsCommandService { - Task> AttachAsync(AddAccountTaxRateConfigCommand command); - Task> DetachAsync(DeleteAccountTaxRateConfigCommand command); + Task> AttachAsync(AddAccountTaxRateConfigCommand command); + Task> DetachAsync(DeleteAccountTaxRateConfigCommand command); } } diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountTaxRateConfigs/Services/IAccountTaxRateConfigsQueryService.cs b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountTaxRateConfigs/Services/IAccountTaxRateConfigsQueryService.cs index 5052329c..b8dbc61c 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountTaxRateConfigs/Services/IAccountTaxRateConfigsQueryService.cs +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/AccountTaxRateConfigs/Services/IAccountTaxRateConfigsQueryService.cs @@ -6,7 +6,7 @@ namespace Ubik.Accounting.SalesOrVatTax.Api.Features.AccountTaxRateConfigs.Servi { public interface IAccountTaxRateConfigsQueryService { - Task>> GetAllAsync(Guid accountId); - Task> GetAsync(Guid accountId, Guid taxRateId); + Task>> GetAllAsync(Guid accountId); + Task> GetAsync(Guid accountId, Guid taxRateId); } } diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Features/TaxRates/Services/ITaxRateCommandService.cs b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/TaxRates/Services/ITaxRateCommandService.cs index cd80784a..eb48d4f5 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Api/Features/TaxRates/Services/ITaxRateCommandService.cs +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/TaxRates/Services/ITaxRateCommandService.cs @@ -7,8 +7,8 @@ namespace Ubik.Accounting.SalesOrVatTax.Api.Features.TaxRates.Services { public interface ITaxRateCommandService { - public Task> AddAsync(AddSalesOrVatTaxRateCommand command); - public Task> UpdateAsync(UpdateSalesOrVatTaxRateCommand command); - public Task> DeleteAsync(Guid id); + public Task> AddAsync(AddSalesOrVatTaxRateCommand command); + public Task> UpdateAsync(UpdateSalesOrVatTaxRateCommand command); + public Task> DeleteAsync(Guid id); } } diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Features/TaxRates/Services/ITaxRateQueryService.cs b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/TaxRates/Services/ITaxRateQueryService.cs index 449ceb21..687bd45e 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Api/Features/TaxRates/Services/ITaxRateQueryService.cs +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/TaxRates/Services/ITaxRateQueryService.cs @@ -6,7 +6,7 @@ namespace Ubik.Accounting.SalesOrVatTax.Api.Features.TaxRates.Services { public interface ITaxRateQueryService { - Task> GetAsync(Guid id); + Task> GetAsync(Guid id); Task> GetAllAsync(); } } diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Features/TaxRates/Services/TaxRateCommandService.cs b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/TaxRates/Services/TaxRateCommandService.cs index 20cf16f7..2096aac7 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Api/Features/TaxRates/Services/TaxRateCommandService.cs +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/TaxRates/Services/TaxRateCommandService.cs @@ -13,14 +13,14 @@ namespace Ubik.Accounting.SalesOrVatTax.Api.Features.TaxRates.Services { public class TaxRateCommandService(AccountingSalesTaxDbContext ctx, IPublishEndpoint publishEndpoint) : ITaxRateCommandService { - public async Task> AddAsync(AddSalesOrVatTaxRateCommand command) + public async Task> AddAsync(AddSalesOrVatTaxRateCommand command) { return await ValidateIfNotAlreadyExistsAsync(command.ToSalesOrVatTaxRate()) .BindAsync(AddInDbContextAsync) .BindAsync(AddSaveAndPublishAsync); } - public async Task> UpdateAsync(UpdateSalesOrVatTaxRateCommand command) + public async Task> UpdateAsync(UpdateSalesOrVatTaxRateCommand command) { var model = command.ToSalesOrVatTaxRate(); @@ -32,14 +32,14 @@ public async Task> UpdateAsync(UpdateSa } //TODO: need to implement check if used in transactions and soft delete - public async Task> DeleteAsync(Guid id) + public async Task> DeleteAsync(Guid id) { return await GetAsync(id) .BindAsync(DeleteInDbContextAsync) .BindAsync(DeletedSaveAndPublishAsync); } - private async Task> DeletedSaveAndPublishAsync(TaxRate current) + private async Task> DeletedSaveAndPublishAsync(TaxRate current) { await publishEndpoint.Publish(new SalesOrVatTaxRateDeleted { Id = current.Id }, CancellationToken.None); await ctx.SaveChangesAsync(); @@ -47,7 +47,7 @@ private async Task> DeletedSaveAndPublishA return true; } - private async Task> DeleteInDbContextAsync(TaxRate current) + private async Task> DeleteInDbContextAsync(TaxRate current) { ctx.Entry(current).State = EntityState.Deleted; @@ -55,7 +55,7 @@ private async Task> DeleteInDbContextAs return current; } - private async Task> UpdateSaveAndPublishAsync(TaxRate current) + private async Task> UpdateSaveAndPublishAsync(TaxRate current) { try { @@ -70,7 +70,7 @@ private async Task> UpdateSaveAndPublis } } - private async Task> GetAsync(Guid id) + private async Task> GetAsync(Guid id) { var result = await ctx.TaxRates.FindAsync(id); @@ -79,7 +79,7 @@ private async Task> GetAsync(Guid id) : result; } - private async Task> UpdateInDbContextAsync(TaxRate current) + private async Task> UpdateInDbContextAsync(TaxRate current) { ctx.Entry(current).State = EntityState.Modified; ctx.SetAuditAndSpecialFields(); @@ -88,7 +88,7 @@ private async Task> UpdateInDbContextAs return current; } - private async Task> ValidateIfNotAlreadyExistsWithOtherIdAsync(TaxRate current) + private async Task> ValidateIfNotAlreadyExistsWithOtherIdAsync(TaxRate current) { var exists = await ctx.TaxRates.AnyAsync(a => a.Code == current.Code && a.Id != current.Id); @@ -97,7 +97,7 @@ private async Task> ValidateIfNotAlread : current; } - private static async Task> MapInDbContextAsync + private static async Task> MapInDbContextAsync (TaxRate current, TaxRate forUpdate) { current = forUpdate.ToSalesOrVatTaxRate(current); @@ -105,14 +105,14 @@ private static async Task> MapInDbConte return current; } - private async Task> AddSaveAndPublishAsync(TaxRate current) + private async Task> AddSaveAndPublishAsync(TaxRate current) { await publishEndpoint.Publish(current.ToSalesOrVatTaxRateAdded(), CancellationToken.None); await ctx.SaveChangesAsync(); return current; } - private async Task> AddInDbContextAsync(TaxRate current) + private async Task> AddInDbContextAsync(TaxRate current) { current.Id = NewId.NextGuid(); await ctx.TaxRates.AddAsync(current); @@ -120,7 +120,7 @@ private async Task> AddInDbContextAsync return current; } - private async Task> ValidateIfNotAlreadyExistsAsync(TaxRate current) + private async Task> ValidateIfNotAlreadyExistsAsync(TaxRate current) { var exists = await ctx.TaxRates.AnyAsync(a => a.Code == current.Code); return exists diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Features/TaxRates/Services/TaxRateQueryService.cs b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/TaxRates/Services/TaxRateQueryService.cs index 4afe4689..684ef288 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Api/Features/TaxRates/Services/TaxRateQueryService.cs +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/TaxRates/Services/TaxRateQueryService.cs @@ -15,7 +15,7 @@ public async Task> GetAllAsync() return result; } - public async Task> GetAsync(Guid id) + public async Task> GetAsync(Guid id) { var result = await ctx.TaxRates.FindAsync(id); diff --git a/src/Ubik.Accounting.Structure.Api/Features/AccountGroups/Errors/AccountGroupParentNotFoundError.cs b/src/Ubik.Accounting.Structure.Api/Features/AccountGroups/Errors/AccountGroupParentNotFoundError.cs index 755eb6de..1c4b72d1 100644 --- a/src/Ubik.Accounting.Structure.Api/Features/AccountGroups/Errors/AccountGroupParentNotFoundError.cs +++ b/src/Ubik.Accounting.Structure.Api/Features/AccountGroups/Errors/AccountGroupParentNotFoundError.cs @@ -2,15 +2,15 @@ namespace Ubik.Accounting.Structure.Api.Features.AccountGroups.Errors { - public record AccountGroupParentNotFoundError : IServiceAndFeatureError + public record AccountGroupParentNotFoundError : IFeatureError { - public ServiceAndFeatureErrorType ErrorType { get; init; } + public FeatureErrorType ErrorType { get; init; } public List CustomErrors { get; init; } public AccountGroupParentNotFoundError(Guid parentAccountGroupId) { - ErrorType = ServiceAndFeatureErrorType.BadParams; + ErrorType = FeatureErrorType.BadParams; CustomErrors = new List() { new CustomError() { ErrorCode = "PARENT_ACCOUNTGROUP_NOTFOUND", diff --git a/src/Ubik.Accounting.Structure.Api/Features/AccountGroups/Services/AccountGroupCommandService.cs b/src/Ubik.Accounting.Structure.Api/Features/AccountGroups/Services/AccountGroupCommandService.cs index 2ca94281..0ba7f3dd 100644 --- a/src/Ubik.Accounting.Structure.Api/Features/AccountGroups/Services/AccountGroupCommandService.cs +++ b/src/Ubik.Accounting.Structure.Api/Features/AccountGroups/Services/AccountGroupCommandService.cs @@ -15,7 +15,7 @@ namespace Ubik.Accounting.Structure.Api.Features.AccountGroups.Services { public class AccountGroupCommandService(AccountingDbContext ctx, IPublishEndpoint publishEndpoint) : IAccountGroupCommandService { - public async Task> AddAsync(AddAccountGroupCommand command) + public async Task> AddAsync(AddAccountGroupCommand command) { return await ValidateIfNotAlreadyExistsAsync(command.ToAccountGroup()) .BindAsync(ValidateIfParentAccountGroupExistsAsync) @@ -24,7 +24,7 @@ public async Task> AddAsync(AddAcc .BindAsync(AddSaveAndPublishAsync); } - public async Task> UpdateAsync(UpdateAccountGroupCommand command) + public async Task> UpdateAsync(UpdateAccountGroupCommand command) { var model = command.ToAccountGroup(); @@ -37,7 +37,7 @@ public async Task> UpdateAsync(Upd .BindAsync(UpdateSaveAndPublishAsync); } - public async Task>> DeleteAsync(Guid id) + public async Task>> DeleteAsync(Guid id) { using var transaction = ctx.Database.BeginTransaction(); var deletedAccountGroups = new List(); @@ -48,7 +48,7 @@ public async Task>> DeleteAsy .BindAsync(ag => DeleteSaveCommitAndPublishAsync(ag, deletedAccountGroups, transaction)); } - private async Task>> DeleteSaveCommitAndPublishAsync(AccountGroup current, + private async Task>> DeleteSaveCommitAndPublishAsync(AccountGroup current, List childAccountGroups, IDbContextTransaction trans) { childAccountGroups.Add(current); @@ -58,7 +58,7 @@ private async Task>> DeleteSa return childAccountGroups; } - private async Task> DeleteAllChildrenOfAsync(AccountGroup current, List deletedAccountGroups) + private async Task> DeleteAllChildrenOfAsync(AccountGroup current, List deletedAccountGroups) { var children = await ctx.AccountGroups.Where(ag => ag.ParentAccountGroupId == current.Id).ToListAsync(); @@ -72,7 +72,7 @@ private async Task> DeleteAllChild return current; } - private async Task> DeleteInDbContextAsync(AccountGroup current) + private async Task> DeleteInDbContextAsync(AccountGroup current) { ctx.Entry(current).State = EntityState.Deleted; @@ -80,7 +80,7 @@ private async Task> DeleteInDbCont return current; } - private async Task> MapInDbContextAsync + private async Task> MapInDbContextAsync (AccountGroup current, AccountGroup forUpdate) { current = forUpdate.ToAccountGroup(current); @@ -88,14 +88,14 @@ private async Task> MapInDbContext return current; } - private async Task> AddSaveAndPublishAsync(AccountGroup accountGroup) + private async Task> AddSaveAndPublishAsync(AccountGroup accountGroup) { await publishEndpoint.Publish(accountGroup.ToAccountGroupAdded(), CancellationToken.None); await ctx.SaveChangesAsync(); return accountGroup; } - private async Task> UpdateSaveAndPublishAsync(AccountGroup accountGroup) + private async Task> UpdateSaveAndPublishAsync(AccountGroup accountGroup) { try { @@ -109,7 +109,7 @@ private async Task> UpdateSaveAndP } } - private async Task> UpdateInDbContext(AccountGroup accountGroup) + private async Task> UpdateInDbContext(AccountGroup accountGroup) { ctx.Entry(accountGroup).State = EntityState.Modified; ctx.SetAuditAndSpecialFields(); @@ -118,7 +118,7 @@ private async Task> UpdateInDbCont return accountGroup; } - private async Task> ValidateIfNotAlreadyExistsWithOtherIdAsync(AccountGroup accountGroup) + private async Task> ValidateIfNotAlreadyExistsWithOtherIdAsync(AccountGroup accountGroup) { var exists = await ctx.AccountGroups.AnyAsync(a => a.Code == accountGroup.Code && a.ClassificationId == accountGroup.ClassificationId @@ -130,7 +130,7 @@ private async Task> ValidateIfNotA : accountGroup; } - private async Task> GetAsync(Guid id) + private async Task> GetAsync(Guid id) { var accountGroup = await ctx.AccountGroups.FindAsync(id); @@ -139,7 +139,7 @@ private async Task> GetAsync(Guid : accountGroup; } - private async Task> AddInDbContextAsync(AccountGroup accountGroup) + private async Task> AddInDbContextAsync(AccountGroup accountGroup) { accountGroup.Id = NewId.NextGuid(); await ctx.AccountGroups.AddAsync(accountGroup); @@ -149,7 +149,7 @@ private async Task> AddInDbContext } - private async Task> ValidateIfNotAlreadyExistsAsync(AccountGroup accountGroup) + private async Task> ValidateIfNotAlreadyExistsAsync(AccountGroup accountGroup) { var exists = await ctx.AccountGroups.AnyAsync(a => a.Code == accountGroup.Code && a.ClassificationId == accountGroup.ClassificationId); @@ -160,14 +160,14 @@ private async Task> ValidateIfNotA : accountGroup; } - private async Task> ValidateIfClassificationExistsAsync(AccountGroup accountGroup) + private async Task> ValidateIfClassificationExistsAsync(AccountGroup accountGroup) { return await ctx.Classifications.AnyAsync(a => a.Id == accountGroup.ClassificationId) ? accountGroup : new BadParamExternalResourceNotFound("AccountGroup", "Classification", "ClassificationId", accountGroup.ClassificationId.ToString()); } - private async Task> ValidateIfParentAccountGroupExistsAsync(AccountGroup accountGroup) + private async Task> ValidateIfParentAccountGroupExistsAsync(AccountGroup accountGroup) { return accountGroup.ParentAccountGroupId != null ? await ctx.AccountGroups.AnyAsync(a => a.Id == (Guid)accountGroup.ParentAccountGroupId) diff --git a/src/Ubik.Accounting.Structure.Api/Features/AccountGroups/Services/AccountGroupQueryService.cs b/src/Ubik.Accounting.Structure.Api/Features/AccountGroups/Services/AccountGroupQueryService.cs index 6cc33a0b..8dac7083 100644 --- a/src/Ubik.Accounting.Structure.Api/Features/AccountGroups/Services/AccountGroupQueryService.cs +++ b/src/Ubik.Accounting.Structure.Api/Features/AccountGroups/Services/AccountGroupQueryService.cs @@ -15,7 +15,7 @@ public async Task> GetAllAsync() return await ctx.AccountGroups.ToListAsync(); } - public async Task> GetAsync(Guid id) + public async Task> GetAsync(Guid id) { var accountGroup = await ctx.AccountGroups.FindAsync(id); @@ -24,7 +24,7 @@ public async Task> GetAsync(Guid i : accountGroup; } - public async Task>> GetChildAccountsAsync(Guid id) + public async Task>> GetChildAccountsAsync(Guid id) { return await GetAsync(id) .MapAsync(async a => diff --git a/src/Ubik.Accounting.Structure.Api/Features/AccountGroups/Services/IAccountGroupCommandService.cs b/src/Ubik.Accounting.Structure.Api/Features/AccountGroups/Services/IAccountGroupCommandService.cs index 29eddb7b..a1e9b323 100644 --- a/src/Ubik.Accounting.Structure.Api/Features/AccountGroups/Services/IAccountGroupCommandService.cs +++ b/src/Ubik.Accounting.Structure.Api/Features/AccountGroups/Services/IAccountGroupCommandService.cs @@ -7,8 +7,8 @@ namespace Ubik.Accounting.Structure.Api.Features.AccountGroups.Services { public interface IAccountGroupCommandService { - public Task> AddAsync(AddAccountGroupCommand command); - public Task> UpdateAsync(UpdateAccountGroupCommand command); - public Task>> DeleteAsync(Guid id); + public Task> AddAsync(AddAccountGroupCommand command); + public Task> UpdateAsync(UpdateAccountGroupCommand command); + public Task>> DeleteAsync(Guid id); } } diff --git a/src/Ubik.Accounting.Structure.Api/Features/AccountGroups/Services/IAccountGroupQueryService.cs b/src/Ubik.Accounting.Structure.Api/Features/AccountGroups/Services/IAccountGroupQueryService.cs index 43d0b7c7..2b36086d 100644 --- a/src/Ubik.Accounting.Structure.Api/Features/AccountGroups/Services/IAccountGroupQueryService.cs +++ b/src/Ubik.Accounting.Structure.Api/Features/AccountGroups/Services/IAccountGroupQueryService.cs @@ -7,7 +7,7 @@ namespace Ubik.Accounting.Structure.Api.Features.AccountGroups.Services public interface IAccountGroupQueryService { Task> GetAllAsync(); - Task> GetAsync(Guid id); - Task>> GetChildAccountsAsync(Guid id); + Task> GetAsync(Guid id); + Task>> GetChildAccountsAsync(Guid id); } } diff --git a/src/Ubik.Accounting.Structure.Api/Features/Accounts/Errors/AccountAlreadyExistsInClassificationError.cs b/src/Ubik.Accounting.Structure.Api/Features/Accounts/Errors/AccountAlreadyExistsInClassificationError.cs index 356fa57f..987d3e24 100644 --- a/src/Ubik.Accounting.Structure.Api/Features/Accounts/Errors/AccountAlreadyExistsInClassificationError.cs +++ b/src/Ubik.Accounting.Structure.Api/Features/Accounts/Errors/AccountAlreadyExistsInClassificationError.cs @@ -2,14 +2,14 @@ namespace Ubik.Accounting.Structure.Api.Features.Accounts.Errors { - public class AccountAlreadyExistsInClassificationError : IServiceAndFeatureError + public class AccountAlreadyExistsInClassificationError : IFeatureError { - public ServiceAndFeatureErrorType ErrorType { get; init; } + public FeatureErrorType ErrorType { get; init; } public List CustomErrors { get; init; } public AccountAlreadyExistsInClassificationError(Guid id, Guid accountGroupId) { - ErrorType = ServiceAndFeatureErrorType.Conflict; + ErrorType = FeatureErrorType.Conflict; CustomErrors = new List() { new() { ErrorCode = "ACCOUNT_ALREADY_EXISTS_IN_CLASSIFICATION", diff --git a/src/Ubik.Accounting.Structure.Api/Features/Accounts/Errors/AccountLinkedToExistingEntriesError.cs b/src/Ubik.Accounting.Structure.Api/Features/Accounts/Errors/AccountLinkedToExistingEntriesError.cs index e4c2dc80..0c2f830a 100644 --- a/src/Ubik.Accounting.Structure.Api/Features/Accounts/Errors/AccountLinkedToExistingEntriesError.cs +++ b/src/Ubik.Accounting.Structure.Api/Features/Accounts/Errors/AccountLinkedToExistingEntriesError.cs @@ -2,14 +2,14 @@ namespace Ubik.Accounting.Structure.Api.Features.Accounts.Errors { - public class AccountLinkedToExistingEntriesError : IServiceAndFeatureError + public class AccountLinkedToExistingEntriesError : IFeatureError { - public ServiceAndFeatureErrorType ErrorType { get; init; } + public FeatureErrorType ErrorType { get; init; } public List CustomErrors { get; init; } public AccountLinkedToExistingEntriesError(Guid id) { - ErrorType = ServiceAndFeatureErrorType.Conflict; + ErrorType = FeatureErrorType.Conflict; CustomErrors = new List() { new() { ErrorCode = "CANNOT_DELETE_ACCOUNT_LINKED_TO_EXISTING_ENTRIES", diff --git a/src/Ubik.Accounting.Structure.Api/Features/Accounts/Errors/AccountNotExistsInAccountGroupError.cs b/src/Ubik.Accounting.Structure.Api/Features/Accounts/Errors/AccountNotExistsInAccountGroupError.cs index f9d119ef..545ae768 100644 --- a/src/Ubik.Accounting.Structure.Api/Features/Accounts/Errors/AccountNotExistsInAccountGroupError.cs +++ b/src/Ubik.Accounting.Structure.Api/Features/Accounts/Errors/AccountNotExistsInAccountGroupError.cs @@ -2,14 +2,14 @@ namespace Ubik.Accounting.Structure.Api.Features.Accounts.Errors { - public class AccountNotExistsInAccountGroupError : IServiceAndFeatureError + public class AccountNotExistsInAccountGroupError : IFeatureError { - public ServiceAndFeatureErrorType ErrorType { get; init; } + public FeatureErrorType ErrorType { get; init; } public List CustomErrors { get; init; } public AccountNotExistsInAccountGroupError(Guid id, Guid accountGroupId) { - ErrorType = ServiceAndFeatureErrorType.NotFound; + ErrorType = FeatureErrorType.NotFound; CustomErrors = new List() { new CustomError() { ErrorCode = "ACCOUNT_NOT_EXISTS_IN_ACCOUNTGROUP", diff --git a/src/Ubik.Accounting.Structure.Api/Features/Accounts/Services/AccountCommandService.cs b/src/Ubik.Accounting.Structure.Api/Features/Accounts/Services/AccountCommandService.cs index 6aa92ec2..fb1a00f9 100644 --- a/src/Ubik.Accounting.Structure.Api/Features/Accounts/Services/AccountCommandService.cs +++ b/src/Ubik.Accounting.Structure.Api/Features/Accounts/Services/AccountCommandService.cs @@ -16,7 +16,7 @@ namespace Ubik.Accounting.Structure.Api.Features.Accounts.Services { public class AccountCommandService(AccountingDbContext ctx, ICurrentUser currentUser, IPublishEndpoint publishEndpoint) : IAccountCommandService { - public async Task> AddAsync(AddAccountCommand command) + public async Task> AddAsync(AddAccountCommand command) { return await ValidateIfNotAlreadyExistsAsync(command.ToAccount()) .BindAsync(ValidateIfCurrencyExistsAsync) @@ -24,7 +24,7 @@ public async Task> AddAsync(AddAccountC .BindAsync(AddSaveAndPublishAsync); } - public async Task> UpdateAsync(UpdateAccountCommand command) + public async Task> UpdateAsync(UpdateAccountCommand command) { var model = command.ToAccount(); @@ -36,14 +36,14 @@ public async Task> UpdateAsync(UpdateAc .BindAsync(UpdateSaveAndPublishAsync); } - public async Task> DeleteAsync(Guid id) + public async Task> DeleteAsync(Guid id) { return await GetAsync(id) .BindAsync(DeleteInDbContextAsync) .BindAsync(DeletedSaveAndPublishAsync); } - public async Task> AddInAccountGroupAsync(AddAccountInAccountGroupCommand command) + public async Task> AddInAccountGroupAsync(AddAccountInAccountGroupCommand command) { var model = command.ToAccountAccountGroup(); return await GetAsync(model.AccountId) @@ -53,14 +53,14 @@ public async Task> AddInAcc .BindAsync(AddAccountGroupLinkSaveAndPublishAsync); } - public async Task> DeleteFromAccountGroupAsync(DeleteAccountInAccountGroupCommand command) + public async Task> DeleteFromAccountGroupAsync(DeleteAccountInAccountGroupCommand command) { return await GetExistingAccountGroupRelationAsync(command.AccountId, command.AccountGroupId) .BindAsync(DeleteAccountGroupLinkInDbContextAsync) .BindAsync(DeleteAccountGroupLinkSaveAndPublishAsync); } - private async Task> DeleteAccountGroupLinkSaveAndPublishAsync(AccountAccountGroup current) + private async Task> DeleteAccountGroupLinkSaveAndPublishAsync(AccountAccountGroup current) { await publishEndpoint.Publish(current.ToAccountDeletedInAccountGroup(), CancellationToken.None); await ctx.SaveChangesAsync(); @@ -68,7 +68,7 @@ private async Task> DeleteA return current; } - private async Task> GetExistingAccountGroupRelationAsync(Guid id, Guid accountGroupId) + private async Task> GetExistingAccountGroupRelationAsync(Guid id, Guid accountGroupId) { var accountAccountGroup = await ctx.AccountsAccountGroups.FirstOrDefaultAsync(aag => aag.AccountId == id @@ -79,7 +79,7 @@ private async Task> GetExis : accountAccountGroup; } - private async Task> DeleteAccountGroupLinkInDbContextAsync(AccountAccountGroup current) + private async Task> DeleteAccountGroupLinkInDbContextAsync(AccountAccountGroup current) { ctx.Entry(current).State = EntityState.Deleted; @@ -87,7 +87,7 @@ private async Task> DeleteA return current; } - private async Task> AddAccountGroupLinkSaveAndPublishAsync(AccountAccountGroup current) + private async Task> AddAccountGroupLinkSaveAndPublishAsync(AccountAccountGroup current) { await publishEndpoint.Publish(current.ToAccountAddedInAccountGroup(), CancellationToken.None); await ctx.SaveChangesAsync(); @@ -95,7 +95,7 @@ private async Task> AddAcco return current; } - private async Task> AddAccountGroupLinkInDbContextAsync(AccountAccountGroup current) + private async Task> AddAccountGroupLinkInDbContextAsync(AccountAccountGroup current) { await ctx.AccountsAccountGroups.AddAsync(current); ctx.SetAuditAndSpecialFields(); @@ -103,7 +103,7 @@ private async Task> AddAcco return current; } - private async Task> ValidateIfNotExistsInTheClassificationAsync(AccountAccountGroup accountAccountGroup) + private async Task> ValidateIfNotExistsInTheClassificationAsync(AccountAccountGroup accountAccountGroup) { var p = new DynamicParameters(); p.Add("@id", accountAccountGroup.AccountId); @@ -130,14 +130,14 @@ FROM classifications c1 } - private async Task> ValidateIfExistsAccountGroupIdAsync(AccountAccountGroup accountAccountGroup) + private async Task> ValidateIfExistsAccountGroupIdAsync(AccountAccountGroup accountAccountGroup) { return await ctx.AccountGroups.AnyAsync(ag => ag.Id == accountAccountGroup.AccountGroupId) ? accountAccountGroup : new BadParamExternalResourceNotFound("Account", "AccountGroup", "AccountGroupId", accountAccountGroup.AccountGroupId.ToString()); } - private async Task> DeletedSaveAndPublishAsync(Account current) + private async Task> DeletedSaveAndPublishAsync(Account current) { await publishEndpoint.Publish(new AccountDeleted { Id = current.Id }, CancellationToken.None); await ctx.SaveChangesAsync(); @@ -145,7 +145,7 @@ private async Task> DeletedSaveAndPublishA return true; } - private async Task> DeleteInDbContextAsync(Account current) + private async Task> DeleteInDbContextAsync(Account current) { ctx.Entry(current).State = EntityState.Deleted; @@ -153,7 +153,7 @@ private async Task> DeleteInDbContextAs return current; } - private async Task> UpdateSaveAndPublishAsync(Account current) + private async Task> UpdateSaveAndPublishAsync(Account current) { try { @@ -168,7 +168,7 @@ private async Task> UpdateSaveAndPublis } } - private async Task> GetAsync(Guid id) + private async Task> GetAsync(Guid id) { var account = await ctx.Accounts.FindAsync(id); @@ -177,7 +177,7 @@ private async Task> GetAsync(Guid id) : account; } - private async Task> UpdateInDbContextAsync(Account current) + private async Task> UpdateInDbContextAsync(Account current) { ctx.Entry(current).State = EntityState.Modified; ctx.SetAuditAndSpecialFields(); @@ -186,7 +186,7 @@ private async Task> UpdateInDbContextAs return current; } - private async Task> ValidateIfNotAlreadyExistsWithOtherIdAsync(Account account) + private async Task> ValidateIfNotAlreadyExistsWithOtherIdAsync(Account account) { var exists = await ctx.Accounts.AnyAsync(a => a.Code == account.Code && a.Id != account.Id); @@ -204,7 +204,7 @@ private async Task> ValidateIfNotAlread // : current; //} - private static async Task> MapInDbContextAsync + private static async Task> MapInDbContextAsync (Account current, Account forUpdate) { current = forUpdate.ToAccount(current); @@ -212,14 +212,14 @@ private static async Task> MapInDbConte return current; } - private async Task> AddSaveAndPublishAsync(Account account) + private async Task> AddSaveAndPublishAsync(Account account) { await publishEndpoint.Publish(account.ToAccountAdded(), CancellationToken.None); await ctx.SaveChangesAsync(); return account; } - private async Task> AddInDbContextAsync(Account account) + private async Task> AddInDbContextAsync(Account account) { account.Id = NewId.NextGuid(); await ctx.Accounts.AddAsync(account); @@ -227,7 +227,7 @@ private async Task> AddInDbContextAsync return account; } - private async Task> ValidateIfNotAlreadyExistsAsync(Account account) + private async Task> ValidateIfNotAlreadyExistsAsync(Account account) { var exists = await ctx.Accounts.AnyAsync(a => a.Code == account.Code); return exists @@ -235,7 +235,7 @@ private async Task> ValidateIfNotAlread : account; } - private async Task> ValidateIfCurrencyExistsAsync(Account account) + private async Task> ValidateIfCurrencyExistsAsync(Account account) { return await ctx.Currencies.AnyAsync(c => c.Id == account.CurrencyId) ? account diff --git a/src/Ubik.Accounting.Structure.Api/Features/Accounts/Services/AccountQueryService.cs b/src/Ubik.Accounting.Structure.Api/Features/Accounts/Services/AccountQueryService.cs index a1bea4da..fb521374 100644 --- a/src/Ubik.Accounting.Structure.Api/Features/Accounts/Services/AccountQueryService.cs +++ b/src/Ubik.Accounting.Structure.Api/Features/Accounts/Services/AccountQueryService.cs @@ -16,7 +16,7 @@ public async Task> GetAllAsync() return await ctx.Accounts.ToListAsync(); } - public async Task> GetAsync(Guid id) + public async Task> GetAsync(Guid id) { var account = await ctx.Accounts.FindAsync(id); @@ -32,7 +32,7 @@ public async Task> GetAllAccountGroupLinksAsync return results; } - public async Task>> GetAccountGroupsWithClassificationInfoAsync(Guid id) + public async Task>> GetAccountGroupsWithClassificationInfoAsync(Guid id) { return await GetAsync(id).ToAsync() .MapAsync(async ac => diff --git a/src/Ubik.Accounting.Structure.Api/Features/Accounts/Services/IAccountCommandService.cs b/src/Ubik.Accounting.Structure.Api/Features/Accounts/Services/IAccountCommandService.cs index 79777a69..ae01930e 100644 --- a/src/Ubik.Accounting.Structure.Api/Features/Accounts/Services/IAccountCommandService.cs +++ b/src/Ubik.Accounting.Structure.Api/Features/Accounts/Services/IAccountCommandService.cs @@ -7,10 +7,10 @@ namespace Ubik.Accounting.Structure.Api.Features.Accounts.Services { public interface IAccountCommandService { - public Task> AddAsync(AddAccountCommand command); - public Task> UpdateAsync(UpdateAccountCommand command); - public Task> DeleteAsync(Guid id); - public Task> AddInAccountGroupAsync(AddAccountInAccountGroupCommand command); - public Task> DeleteFromAccountGroupAsync(DeleteAccountInAccountGroupCommand command); + public Task> AddAsync(AddAccountCommand command); + public Task> UpdateAsync(UpdateAccountCommand command); + public Task> DeleteAsync(Guid id); + public Task> AddInAccountGroupAsync(AddAccountInAccountGroupCommand command); + public Task> DeleteFromAccountGroupAsync(DeleteAccountInAccountGroupCommand command); } } diff --git a/src/Ubik.Accounting.Structure.Api/Features/Accounts/Services/IAccountQueryService.cs b/src/Ubik.Accounting.Structure.Api/Features/Accounts/Services/IAccountQueryService.cs index f67de432..39e28378 100644 --- a/src/Ubik.Accounting.Structure.Api/Features/Accounts/Services/IAccountQueryService.cs +++ b/src/Ubik.Accounting.Structure.Api/Features/Accounts/Services/IAccountQueryService.cs @@ -9,7 +9,7 @@ public interface IAccountQueryService { public Task> GetAllAsync(); public Task> GetAllAccountGroupLinksAsync(); - public Task> GetAsync(Guid id); - public Task>> GetAccountGroupsWithClassificationInfoAsync(Guid id); + public Task> GetAsync(Guid id); + public Task>> GetAccountGroupsWithClassificationInfoAsync(Guid id); } } diff --git a/src/Ubik.Accounting.Structure.Api/Features/Classifications/Services/ClassificationCommandService.cs b/src/Ubik.Accounting.Structure.Api/Features/Classifications/Services/ClassificationCommandService.cs index c09ba462..1591b62a 100644 --- a/src/Ubik.Accounting.Structure.Api/Features/Classifications/Services/ClassificationCommandService.cs +++ b/src/Ubik.Accounting.Structure.Api/Features/Classifications/Services/ClassificationCommandService.cs @@ -15,14 +15,14 @@ namespace Ubik.Accounting.Structure.Api.Features.Classifications.Services { public class ClassificationCommandService(AccountingDbContext ctx, IPublishEndpoint publishEndpoint) : IClassificationCommandService { - public async Task> AddAsync(AddClassificationCommand command) + public async Task> AddAsync(AddClassificationCommand command) { return await ValidateIfNotAlreadyExistsAsync(command.ToClassification()) .BindAsync(AddInDbContextAsync) .BindAsync(AddSaveAndPublishAsync); } - public async Task> UpdateAsync(UpdateClassificationCommand command) + public async Task> UpdateAsync(UpdateClassificationCommand command) { var model = command.ToClassification(); @@ -33,7 +33,7 @@ public async Task> UpdateAsync(U .BindAsync(UpdateSaveAndPublishAsync); } - public async Task>> DeleteAsync(Guid id) + public async Task>> DeleteAsync(Guid id) { using var transaction = ctx.Database.BeginTransaction(); var deletedAccountGroups = new List(); @@ -45,7 +45,7 @@ public async Task>> DeleteAsy .BindAsync(del => DeleteSaveAndPublishAsync(id, del, transaction)); } - private async Task>> DeleteSaveAndPublishAsync(Guid id, List ag, IDbContextTransaction trans) + private async Task>> DeleteSaveAndPublishAsync(Guid id, List ag, IDbContextTransaction trans) { await publishEndpoint.Publish(new ClassificationDeleted() { @@ -59,13 +59,13 @@ await publishEndpoint.Publish(new ClassificationDeleted() return ag; } - private async Task>> DeleteClassificationAsync(Guid id, List deletedAccountGroups) + private async Task>> DeleteClassificationAsync(Guid id, List deletedAccountGroups) { await ctx.Classifications.Where(x => x.Id == id).ExecuteDeleteAsync(); return deletedAccountGroups; } - private async Task>> DeleteFromParentGroupsAsync(List firstLvlAccountGroups, List deletedAccountGroups) + private async Task>> DeleteFromParentGroupsAsync(List firstLvlAccountGroups, List deletedAccountGroups) { foreach (var ag in firstLvlAccountGroups) { @@ -77,7 +77,7 @@ private async Task>> DeleteFr return deletedAccountGroups; } - private async Task>> DeleteAllChildrenAccountGroupsAsync(Guid id, List deletedAccountGroups) + private async Task>> DeleteAllChildrenAccountGroupsAsync(Guid id, List deletedAccountGroups) { var children = await ctx.AccountGroups.Where(ag => ag.ParentAccountGroupId == id).ToListAsync(); @@ -91,14 +91,14 @@ private async Task>> DeleteAl return deletedAccountGroups; } - private async Task>> GetFirstLvlAccountGroupsAsync(Guid classificationId) + private async Task>> GetFirstLvlAccountGroupsAsync(Guid classificationId) { return await ctx.AccountGroups .Where(ag => ag.ClassificationId == classificationId && ag.ParentAccountGroupId == null).ToListAsync(); } - private async Task> UpdateSaveAndPublishAsync(Classification current) + private async Task> UpdateSaveAndPublishAsync(Classification current) { try { @@ -113,7 +113,7 @@ private async Task> UpdateSaveAn } } - private async Task> UpdateInDbContextAsync(Classification current) + private async Task> UpdateInDbContextAsync(Classification current) { ctx.Entry(current).State = EntityState.Modified; ctx.SetAuditAndSpecialFields(); @@ -122,7 +122,7 @@ private async Task> UpdateInDbCo return current; } - private static async Task> MapInDbContextAsync + private static async Task> MapInDbContextAsync (Classification current, Classification forUpdate) { current = forUpdate.ToClassification(current); @@ -130,7 +130,7 @@ private static async Task> MapIn return current; } - private async Task> ValidateIfNotAlreadyExistsWithOtherIdAsync(Classification classification) + private async Task> ValidateIfNotAlreadyExistsWithOtherIdAsync(Classification classification) { var exists = await ctx.Classifications.AnyAsync(a => a.Code == classification.Code && a.Id != classification.Id); @@ -139,7 +139,7 @@ private async Task> ValidateIfNo : classification; } - private async Task> GetAsync(Guid id) + private async Task> GetAsync(Guid id) { var result = await ctx.Classifications.FindAsync(id); @@ -148,14 +148,14 @@ private async Task> GetAsync(Gui : result; } - private async Task> AddSaveAndPublishAsync(Classification current) + private async Task> AddSaveAndPublishAsync(Classification current) { await publishEndpoint.Publish(current.ToClassificationAdded(), CancellationToken.None); await ctx.SaveChangesAsync(); return current; } - private async Task> AddInDbContextAsync(Classification current) + private async Task> AddInDbContextAsync(Classification current) { current.Id = NewId.NextGuid(); await ctx.Classifications.AddAsync(current); @@ -164,7 +164,7 @@ private async Task> AddInDbConte return current; } - private async Task> ValidateIfNotAlreadyExistsAsync(Classification classification) + private async Task> ValidateIfNotAlreadyExistsAsync(Classification classification) { var exists = await ctx.Classifications.AnyAsync(a => a.Code == classification.Code); diff --git a/src/Ubik.Accounting.Structure.Api/Features/Classifications/Services/ClassificationQueryService.cs b/src/Ubik.Accounting.Structure.Api/Features/Classifications/Services/ClassificationQueryService.cs index f0baef6b..dd0f159c 100644 --- a/src/Ubik.Accounting.Structure.Api/Features/Classifications/Services/ClassificationQueryService.cs +++ b/src/Ubik.Accounting.Structure.Api/Features/Classifications/Services/ClassificationQueryService.cs @@ -16,7 +16,7 @@ public async Task> GetAllAsync() return await ctx.Classifications.ToListAsync(); } - public async Task> GetAsync(Guid id) + public async Task> GetAsync(Guid id) { var result = await ctx.Classifications.FindAsync(id); @@ -25,7 +25,7 @@ public async Task> GetAsync(Guid : result; } - public async Task>> GetClassificationAttachedAccountsAsync(Guid id) + public async Task>> GetClassificationAttachedAccountsAsync(Guid id) { var accounts = (await GetAsync(id)) .MapAsync(a => @@ -51,7 +51,7 @@ FROM classifications c return await accounts; } - public async Task>> GetClassificationMissingAccountsAsync(Guid id) + public async Task>> GetClassificationMissingAccountsAsync(Guid id) { var accounts = (await GetAsync(id)) .MapAsync(a => @@ -80,7 +80,7 @@ FROM classifications c return await accounts; } - public async Task> GetClassificationStatusAsync(Guid id) + public async Task> GetClassificationStatusAsync(Guid id) { return (await GetClassificationMissingAccountsAsync(id)) .Map(c => diff --git a/src/Ubik.Accounting.Structure.Api/Features/Classifications/Services/IClassificationCommandService.cs b/src/Ubik.Accounting.Structure.Api/Features/Classifications/Services/IClassificationCommandService.cs index 2b303778..2ffe3060 100644 --- a/src/Ubik.Accounting.Structure.Api/Features/Classifications/Services/IClassificationCommandService.cs +++ b/src/Ubik.Accounting.Structure.Api/Features/Classifications/Services/IClassificationCommandService.cs @@ -7,8 +7,8 @@ namespace Ubik.Accounting.Structure.Api.Features.Classifications.Services { public interface IClassificationCommandService { - public Task> AddAsync(AddClassificationCommand command); - public Task> UpdateAsync(UpdateClassificationCommand command); - public Task>> DeleteAsync(Guid id); + public Task> AddAsync(AddClassificationCommand command); + public Task> UpdateAsync(UpdateClassificationCommand command); + public Task>> DeleteAsync(Guid id); } } diff --git a/src/Ubik.Accounting.Structure.Api/Features/Classifications/Services/IClassificationQueryService.cs b/src/Ubik.Accounting.Structure.Api/Features/Classifications/Services/IClassificationQueryService.cs index 895774d3..a08b14ff 100644 --- a/src/Ubik.Accounting.Structure.Api/Features/Classifications/Services/IClassificationQueryService.cs +++ b/src/Ubik.Accounting.Structure.Api/Features/Classifications/Services/IClassificationQueryService.cs @@ -8,9 +8,9 @@ namespace Ubik.Accounting.Structure.Api.Features.Classifications.Services public interface IClassificationQueryService { public Task> GetAllAsync(); - public Task> GetAsync(Guid id); - public Task>> GetClassificationAttachedAccountsAsync(Guid id); - public Task>> GetClassificationMissingAccountsAsync(Guid id); - public Task> GetClassificationStatusAsync(Guid id); + public Task> GetAsync(Guid id); + public Task>> GetClassificationAttachedAccountsAsync(Guid id); + public Task>> GetClassificationMissingAccountsAsync(Guid id); + public Task> GetClassificationStatusAsync(Guid id); } } diff --git a/src/Ubik.Accounting.Transaction.Api/Data/Config/EntryConfiguration.cs b/src/Ubik.Accounting.Transaction.Api/Data/Config/EntryConfiguration.cs index 372eb1fa..c7ea5705 100644 --- a/src/Ubik.Accounting.Transaction.Api/Data/Config/EntryConfiguration.cs +++ b/src/Ubik.Accounting.Transaction.Api/Data/Config/EntryConfiguration.cs @@ -1,6 +1,7 @@ using Microsoft.EntityFrameworkCore.Metadata.Builders; using Microsoft.EntityFrameworkCore; using Ubik.Accounting.Transaction.Api.Models; +using System.Globalization; namespace Ubik.Accounting.Transaction.Api.Data.Config { @@ -28,35 +29,6 @@ public void Configure(EntityTypeBuilder builder) .HasForeignKey(a => a.AccountId).OnDelete(DeleteBehavior.Restrict) .IsRequired(); - //TODO: see that tomorrow... I want to be able to enrich the model and link it - // to the DB in a smart way. - builder.OwnsOne(a => a.TaxInfo, taxInfo => - { - taxInfo.Property(t => t.TaxAppliedRate) - .HasPrecision(8, 5) - .IsRequired(false) - .HasConversion(); - - taxInfo.Property(t => t.TaxRateId) - .IsRequired(false); - }); - - //builder.OwnsOne(a => a.AmountExchangeInfo, exchangeInfo => - //{ - // exchangeInfo.Property(t => t.OriginalAmount) - // .HasPrecision(18, 4) - // .IsRequired(false); - - // exchangeInfo.Property(t => t.ExchangeRate) - // .HasPrecision(18, 10) - // .IsRequired(false); - - // exchangeInfo.HasOne() - // .WithMany() - // .HasForeignKey(e => e.OriginalCurrencyId) - // .IsRequired(false); - //}); - builder.Property(a => a.Label) .IsRequired() .HasMaxLength(100); @@ -68,6 +40,48 @@ public void Configure(EntityTypeBuilder builder) .IsRequired() .HasPrecision(18, 4); + builder.OwnsOne(a => a.AmountAdditionnalInfo, exchangeInfo => + { + exchangeInfo.Ignore(t => t.OriginalCurrencyId); + exchangeInfo.Ignore(t => t.ExchangeRate); + exchangeInfo.Ignore(t => t.OriginalAmount); + + exchangeInfo.Property("_originalAmount") + .HasColumnName("original_amount") + .HasPrecision(18, 4) + .IsRequired(false); + + exchangeInfo.Property("_exchangeRate") + .HasColumnName("exchange_rate") + .HasPrecision(18, 10) + .IsRequired(false); + + exchangeInfo.Property("_originalCurrencyId") + .HasColumnName("original_currency_id") + .IsRequired(false); + + exchangeInfo.HasOne() + .WithMany() + .HasForeignKey("_originalCurrencyId") + .IsRequired(false); + }); + + builder.OwnsOne(a => a.TaxInfo, taxInfo => + { + taxInfo.Ignore(t => t.TaxAppliedRate); + + taxInfo.Property("_taxAppliedRate") + .HasColumnName("tax_applied_rate") + .HasPrecision(8, 5) + .IsRequired(false); + + taxInfo.Ignore(t => t.TaxRateId); + + taxInfo.Property("_taxRateId") + .HasColumnName("tax_rate_id") + .IsRequired(false); + }); + builder.Property(a => a.Version) .IsConcurrencyToken(); diff --git a/src/Ubik.Accounting.Transaction.Api/Models/AmountAdditionnalInfo.cs b/src/Ubik.Accounting.Transaction.Api/Models/AmountAdditionnalInfo.cs index d4759073..bdef5c5a 100644 --- a/src/Ubik.Accounting.Transaction.Api/Models/AmountAdditionnalInfo.cs +++ b/src/Ubik.Accounting.Transaction.Api/Models/AmountAdditionnalInfo.cs @@ -2,8 +2,36 @@ { public class AmountAdditionnalInfo { - public decimal OriginalAmount { get; set; } - public Guid OriginalCurrencyId { get; set; } - public decimal ExchangeRate { get; set; } + private decimal? _originalAmount; + public decimal OriginalAmount + { + get => _originalAmount ?? throw new NullReferenceException("Original amount cannot be null"); + private set => _originalAmount = value; + } + + private Guid? _originalCurrencyId; + public Guid OriginalCurrencyId + { + get => _originalCurrencyId ?? throw new NullReferenceException("Original amount cannot be null"); + private set => _originalCurrencyId = value; + } + + private decimal? _exchangeRate; + public decimal ExchangeRate + { + get => _exchangeRate ?? throw new NullReferenceException("Echange rate cannot be null"); + private set => _exchangeRate = value; + } + + public AmountAdditionnalInfo(decimal originalAmount, Guid originalCurrencyId, decimal exchangeRate) + { + _originalAmount = originalAmount; + _originalCurrencyId = originalCurrencyId; + _exchangeRate = exchangeRate; + } + + private AmountAdditionnalInfo() + { + } } } diff --git a/src/Ubik.Accounting.Transaction.Api/Models/Entry.cs b/src/Ubik.Accounting.Transaction.Api/Models/Entry.cs index 106cce2d..f18b528b 100644 --- a/src/Ubik.Accounting.Transaction.Api/Models/Entry.cs +++ b/src/Ubik.Accounting.Transaction.Api/Models/Entry.cs @@ -16,7 +16,7 @@ public class Entry : ITenantEntity, IConcurrencyCheckEntity, IAuditEntity public string? Description { get; set; } //See if we want the amount with or without VAT public required decimal Amount { get; set; } - public AmountAdditionnalInfo? AmountExchangeInfo { get; set; } + public AmountAdditionnalInfo? AmountAdditionnalInfo { get; set; } public TaxInfo? TaxInfo { get; set; } = default!; public Guid Version { get; set; } public Guid TenantId { get; set; } diff --git a/src/Ubik.Accounting.Transaction.Api/Models/TaxInfo.cs b/src/Ubik.Accounting.Transaction.Api/Models/TaxInfo.cs index b3fe868e..88336728 100644 --- a/src/Ubik.Accounting.Transaction.Api/Models/TaxInfo.cs +++ b/src/Ubik.Accounting.Transaction.Api/Models/TaxInfo.cs @@ -1,18 +1,37 @@ -namespace Ubik.Accounting.Transaction.Api.Models +using LanguageExt; +using Ubik.ApiService.Common.Errors; + +namespace Ubik.Accounting.Transaction.Api.Models { + //EF core hack to have a nullable tax info owned entity but when it's present, fields are mandatory public class TaxInfo { - private decimal? _taxAppliedRate { get; set; } + private decimal? _taxAppliedRate; public decimal TaxAppliedRate { - get => _taxAppliedRate ?? 0; - set => _taxAppliedRate = value; + get => _taxAppliedRate ?? throw new NullReferenceException("Tax rate cannot be null"); + private set => _taxAppliedRate = value; } private Guid? _taxRateId; - public Guid TaxRateId { get; set; } + public Guid TaxRateId + { + get => _taxRateId ?? throw new NullReferenceException("Tax rate cannot be null"); + private set => _taxRateId = value; + } + + public static async Task> Create(decimal taxAppliedRate, Guid taxRateId) + { + await Task.CompletedTask; - + return new TaxInfo + { + TaxAppliedRate = taxAppliedRate, + TaxRateId = taxRateId + }; + } + private TaxInfo() + { + } } } -} diff --git a/src/Ubik.ApiService.Common/Errors/BadParamExternalResourceNotFound.cs b/src/Ubik.ApiService.Common/Errors/BadParamExternalResourceNotFound.cs index a7933956..37e63614 100644 --- a/src/Ubik.ApiService.Common/Errors/BadParamExternalResourceNotFound.cs +++ b/src/Ubik.ApiService.Common/Errors/BadParamExternalResourceNotFound.cs @@ -1,14 +1,14 @@ namespace Ubik.ApiService.Common.Errors { - public record BadParamExternalResourceNotFound : IServiceAndFeatureError + public record BadParamExternalResourceNotFound : IFeatureError { - public ServiceAndFeatureErrorType ErrorType { get; init; } + public FeatureErrorType ErrorType { get; init; } public List CustomErrors { get; init; } public BadParamExternalResourceNotFound(string resourceName, string externalResourceName, string fieldName, string value) { - ErrorType = ServiceAndFeatureErrorType.BadParams; + ErrorType = FeatureErrorType.BadParams; CustomErrors = [ new CustomError() { ErrorCode = $"{resourceName.ToUpper()}_{externalResourceName.ToUpper()}_NOT_FOUND", diff --git a/src/Ubik.ApiService.Common/Errors/ResourceAlreadyExistsError.cs b/src/Ubik.ApiService.Common/Errors/ResourceAlreadyExistsError.cs index 2c9d82a6..fd577401 100644 --- a/src/Ubik.ApiService.Common/Errors/ResourceAlreadyExistsError.cs +++ b/src/Ubik.ApiService.Common/Errors/ResourceAlreadyExistsError.cs @@ -1,14 +1,14 @@ namespace Ubik.ApiService.Common.Errors { - public record ResourceAlreadyExistsError : IServiceAndFeatureError + public record ResourceAlreadyExistsError : IFeatureError { - public ServiceAndFeatureErrorType ErrorType { get; init; } + public FeatureErrorType ErrorType { get; init; } public List CustomErrors { get; init; } public ResourceAlreadyExistsError(string resourceName, string fieldName, string value) { - ErrorType = ServiceAndFeatureErrorType.Conflict; + ErrorType = FeatureErrorType.Conflict; CustomErrors = [ new() { ErrorCode = $"{resourceName.ToUpper()}_ALREADY_EXISTS", diff --git a/src/Ubik.ApiService.Common/Errors/ResourceIdNotMatchWithCommandError.cs b/src/Ubik.ApiService.Common/Errors/ResourceIdNotMatchWithCommandError.cs index fd054b01..f0e7e1f4 100644 --- a/src/Ubik.ApiService.Common/Errors/ResourceIdNotMatchWithCommandError.cs +++ b/src/Ubik.ApiService.Common/Errors/ResourceIdNotMatchWithCommandError.cs @@ -1,14 +1,14 @@ namespace Ubik.ApiService.Common.Errors { - public record ResourceIdNotMatchWithCommandError : IServiceAndFeatureError + public record ResourceIdNotMatchWithCommandError : IFeatureError { - public ServiceAndFeatureErrorType ErrorType { get; init; } + public FeatureErrorType ErrorType { get; init; } public List CustomErrors { get; init; } public ResourceIdNotMatchWithCommandError(string resourceName, Guid idFromQuery, Guid idFromCommand) { - ErrorType = ServiceAndFeatureErrorType.BadParams; + ErrorType = FeatureErrorType.BadParams; CustomErrors = [ new() { ErrorCode = $"{resourceName.ToUpper()}_COMMAND_IDS_NOT_MATCH", diff --git a/src/Ubik.ApiService.Common/Errors/ResourceNotFoundError.cs b/src/Ubik.ApiService.Common/Errors/ResourceNotFoundError.cs index ef67e4c7..9a93913a 100644 --- a/src/Ubik.ApiService.Common/Errors/ResourceNotFoundError.cs +++ b/src/Ubik.ApiService.Common/Errors/ResourceNotFoundError.cs @@ -1,13 +1,13 @@ namespace Ubik.ApiService.Common.Errors { - public record ResourceNotFoundError : IServiceAndFeatureError + public record ResourceNotFoundError : IFeatureError { - public ServiceAndFeatureErrorType ErrorType { get; init; } + public FeatureErrorType ErrorType { get; init; } public List CustomErrors { get; init; } public ResourceNotFoundError(string resourceName, string fieldName, string value) { - ErrorType = ServiceAndFeatureErrorType.NotFound; + ErrorType = FeatureErrorType.NotFound; CustomErrors = [ new CustomError() { ErrorCode = $"{resourceName.ToUpper()}_NOT_FOUND", diff --git a/src/Ubik.ApiService.Common/Errors/ResourceUpdateConcurrencyError.cs b/src/Ubik.ApiService.Common/Errors/ResourceUpdateConcurrencyError.cs index 965f0b77..3040e88b 100644 --- a/src/Ubik.ApiService.Common/Errors/ResourceUpdateConcurrencyError.cs +++ b/src/Ubik.ApiService.Common/Errors/ResourceUpdateConcurrencyError.cs @@ -1,14 +1,14 @@ namespace Ubik.ApiService.Common.Errors { - public record ResourceUpdateConcurrencyError : IServiceAndFeatureError + public record ResourceUpdateConcurrencyError : IFeatureError { - public ServiceAndFeatureErrorType ErrorType { get; init; } + public FeatureErrorType ErrorType { get; init; } public List CustomErrors { get; init; } public ResourceUpdateConcurrencyError(string resourceName, string version) { - ErrorType = ServiceAndFeatureErrorType.Conflict; + ErrorType = FeatureErrorType.Conflict; CustomErrors = new List() { new CustomError() { ErrorCode = $"{resourceName.ToUpper()}_UPDATE_CONCURRENCY", diff --git a/src/Ubik.ApiService.Common/Exceptions/ConfigureExceptionHandler.cs b/src/Ubik.ApiService.Common/Exceptions/ConfigureExceptionHandler.cs index 606f5b73..9137bddf 100644 --- a/src/Ubik.ApiService.Common/Exceptions/ConfigureExceptionHandler.cs +++ b/src/Ubik.ApiService.Common/Exceptions/ConfigureExceptionHandler.cs @@ -31,7 +31,7 @@ public static void UseExceptionHandler(this IApplicationBuilder app, ILogger log { context.Response.ContentType = "application/json"; - if (contextFeature.Error is IServiceAndFeatureError managedException) + if (contextFeature.Error is IFeatureError managedException) { //Managed excpetion context.Response.StatusCode = (int)managedException.ErrorType; diff --git a/src/Ubik.ApiService.Common/Exceptions/ControllerProblemDetailsExtension.cs b/src/Ubik.ApiService.Common/Exceptions/ControllerProblemDetailsExtension.cs index 4b2e8ee0..23dd3df5 100644 --- a/src/Ubik.ApiService.Common/Exceptions/ControllerProblemDetailsExtension.cs +++ b/src/Ubik.ApiService.Common/Exceptions/ControllerProblemDetailsExtension.cs @@ -6,7 +6,7 @@ namespace Ubik.ApiService.Common.Exceptions { public static class ControllerProblemDetailsExtension { - public static CustomProblemDetails ToValidationProblemDetails(this IServiceAndFeatureError ex, HttpContext httpContext) + public static CustomProblemDetails ToValidationProblemDetails(this IFeatureError ex, HttpContext httpContext) { var problemDetailErrors = ex.CustomErrors.Select(e => new ProblemDetailError() { @@ -19,22 +19,22 @@ public static CustomProblemDetails ToValidationProblemDetails(this IServiceAndFe switch (ex.ErrorType) { - case ServiceAndFeatureErrorType.Conflict: + case FeatureErrorType.Conflict: error.Type = "https://tools.ietf.org/html/rfc7231#section-6.5.8"; error.Status = 409; error.Title = "Resource conflict"; break; - case ServiceAndFeatureErrorType.NotFound: + case FeatureErrorType.NotFound: error.Type = "https://tools.ietf.org/html/rfc7231#section-6.5.4"; error.Status = 404; error.Title = "Resource not found"; break; - case ServiceAndFeatureErrorType.NotAuthorized: + case FeatureErrorType.NotAuthorized: error.Type = "https://tools.ietf.org/html/rfc7231#section-6.5.3"; error.Status = 403; error.Title = "Resource not authorized"; break; - case ServiceAndFeatureErrorType.NotAuthentified: + case FeatureErrorType.NotAuthentified: error.Type = "https://tools.ietf.org/html/rfc7235#section-3.1"; error.Status = 401; error.Title = "No valid authentication detected"; diff --git a/src/Ubik.ApiService.Common/Exceptions/IServiceAndFeatureError.cs b/src/Ubik.ApiService.Common/Exceptions/IFeatureError.cs similarity index 77% rename from src/Ubik.ApiService.Common/Exceptions/IServiceAndFeatureError.cs rename to src/Ubik.ApiService.Common/Exceptions/IFeatureError.cs index bdd9e4b8..d8116b5f 100644 --- a/src/Ubik.ApiService.Common/Exceptions/IServiceAndFeatureError.cs +++ b/src/Ubik.ApiService.Common/Exceptions/IFeatureError.cs @@ -1,6 +1,6 @@ namespace Ubik.ApiService.Common.Errors { - public enum ServiceAndFeatureErrorType + public enum FeatureErrorType { NotFound = 404, BadParams = 400, @@ -17,9 +17,9 @@ public record CustomError public string? ErrorValueDetails { get; set; } } - public interface IServiceAndFeatureError + public interface IFeatureError { - public ServiceAndFeatureErrorType ErrorType { get; } + public FeatureErrorType ErrorType { get; } public List CustomErrors { get; } } } diff --git a/src/Ubik.ApiService.Common/Exceptions/UpdateDbConcurrencyException.cs b/src/Ubik.ApiService.Common/Exceptions/UpdateDbConcurrencyException.cs index 52932afd..f403d0b1 100644 --- a/src/Ubik.ApiService.Common/Exceptions/UpdateDbConcurrencyException.cs +++ b/src/Ubik.ApiService.Common/Exceptions/UpdateDbConcurrencyException.cs @@ -2,14 +2,14 @@ namespace Ubik.ApiService.Common.Exceptions { - public class UpdateDbConcurrencyException : Exception, IServiceAndFeatureError + public class UpdateDbConcurrencyException : Exception, IFeatureError { - public ServiceAndFeatureErrorType ErrorType { get; init; } + public FeatureErrorType ErrorType { get; init; } public List CustomErrors { get; init; } public UpdateDbConcurrencyException() { - ErrorType = ServiceAndFeatureErrorType.Conflict; + ErrorType = FeatureErrorType.Conflict; CustomErrors = new List() { new CustomError() { ErrorCode = "DB_CONCURRENCY_CONFLICT", diff --git a/src/Ubik.ApiService.Common/Validators/CustomValidationException.cs b/src/Ubik.ApiService.Common/Validators/CustomValidationException.cs index af8b76a4..bcae2f59 100644 --- a/src/Ubik.ApiService.Common/Validators/CustomValidationException.cs +++ b/src/Ubik.ApiService.Common/Validators/CustomValidationException.cs @@ -2,9 +2,9 @@ namespace Ubik.ApiService.Common.Validators { - public class CustomValidationException(List errors) : Exception($"Validation errors"), IServiceAndFeatureError + public class CustomValidationException(List errors) : Exception($"Validation errors"), IFeatureError { - public ServiceAndFeatureErrorType ErrorType { get; init; } = ServiceAndFeatureErrorType.BadParams; + public FeatureErrorType ErrorType { get; init; } = FeatureErrorType.BadParams; public List CustomErrors { get; init; } = errors; } } diff --git a/src/Ubik.Security.Api/Data/Init/AuthInitializer.cs b/src/Ubik.Security.Api/Data/Init/AuthInitializer.cs index 00311eb2..8ebd4d3d 100644 --- a/src/Ubik.Security.Api/Data/Init/AuthInitializer.cs +++ b/src/Ubik.Security.Api/Data/Init/AuthInitializer.cs @@ -9,7 +9,7 @@ internal static class AuthInitializer { internal static async Task InitializeAsync(IUserAuthProviderService authProviderService) { - var check = (await authProviderService.CheckIfUsersPresentInAuth()).MatchAsync>( + var check = (await authProviderService.CheckIfUsersPresentInAuth()).MatchAsync>( RightAsync: async ok => { if (!ok) diff --git a/src/Ubik.Security.Api/Features/Authorizations/Services/AuthorizationsCommandsService.cs b/src/Ubik.Security.Api/Features/Authorizations/Services/AuthorizationsCommandsService.cs index 1629abc9..7c75cca3 100644 --- a/src/Ubik.Security.Api/Features/Authorizations/Services/AuthorizationsCommandsService.cs +++ b/src/Ubik.Security.Api/Features/Authorizations/Services/AuthorizationsCommandsService.cs @@ -15,14 +15,14 @@ namespace Ubik.Security.Api.Features.Authorizations.Services public class AuthorizationsCommandsService(SecurityDbContext ctx, IPublishEndpoint publishEndpoint) : IAuthorizationsCommandsService { - public async Task> AddAsync(AddAuthorizationCommand command) + public async Task> AddAsync(AddAuthorizationCommand command) { return await ValidateIfNotAlreadyExistsAsync(command.ToAuthorization()) .BindAsync(AddInDbContextAsync) .BindAsync(AddSaveAndPublishAsync); } - public async Task> UpdateAsync(UpdateAuthorizationCommand command) + public async Task> UpdateAsync(UpdateAuthorizationCommand command) { var model = command.ToAuthorization(); @@ -33,7 +33,7 @@ public async Task> UpdateAsync(Up .BindAsync(UpdateSaveAndPublishAsync); } - public async Task> DeleteAsync(Guid id) + public async Task> DeleteAsync(Guid id) { return await GetAsync(id) @@ -41,14 +41,14 @@ public async Task> DeleteAsync(Guid id) .BindAsync(DeleteSaveAndPublishAsync); } - private async Task> DeleteSaveAndPublishAsync(Authorization current) + private async Task> DeleteSaveAndPublishAsync(Authorization current) { await publishEndpoint.Publish(new AuthorizationDeleted { Id = current.Id }, CancellationToken.None); await ctx.SaveChangesAsync(); return true; } - private async Task> MapInDbContextAsync + private async Task> MapInDbContextAsync (Authorization current, Authorization forUpdate) { current = forUpdate.ToAuthorization(current); @@ -56,14 +56,14 @@ private async Task> MapInDbContex return current; } - private async Task> AddSaveAndPublishAsync(Authorization authorization) + private async Task> AddSaveAndPublishAsync(Authorization authorization) { await publishEndpoint.Publish(authorization.ToAuthorizationAdded(), CancellationToken.None); await ctx.SaveChangesAsync(); return authorization; } - private async Task> UpdateSaveAndPublishAsync(Authorization authorization) + private async Task> UpdateSaveAndPublishAsync(Authorization authorization) { try { @@ -77,7 +77,7 @@ private async Task> UpdateSaveAnd } } - private async Task> ValidateIfNotAlreadyExistsAsync(Authorization auth) + private async Task> ValidateIfNotAlreadyExistsAsync(Authorization auth) { var exists = await ctx.Authorizations.AnyAsync(a => a.Code == auth.Code); return exists @@ -85,7 +85,7 @@ private async Task> ValidateIfNot : auth; } - private async Task> ValidateIfNotAlreadyExistsWithOtherIdAsync(Authorization auth) + private async Task> ValidateIfNotAlreadyExistsWithOtherIdAsync(Authorization auth) { var exists = await ctx.Authorizations.AnyAsync(a => a.Code == auth.Code && a.Id != auth.Id); @@ -94,7 +94,7 @@ private async Task> ValidateIfNot : auth; } - private async Task> GetAsync(Guid id) + private async Task> GetAsync(Guid id) { var result = await ctx.Authorizations.FindAsync(id); @@ -103,7 +103,7 @@ private async Task> GetAsync(Guid : result; } - private async Task> UpdateInDbContextAsync(Authorization authorization) + private async Task> UpdateInDbContextAsync(Authorization authorization) { ctx.Entry(authorization).State = EntityState.Modified; ctx.SetAuditAndSpecialFields(); @@ -112,7 +112,7 @@ private async Task> UpdateInDbCon return authorization; } - private async Task> AddInDbContextAsync(Authorization authorization) + private async Task> AddInDbContextAsync(Authorization authorization) { authorization.Id = NewId.NextGuid(); await ctx.Authorizations.AddAsync(authorization); @@ -120,7 +120,7 @@ private async Task> AddInDbContex return authorization; } - private async Task> DeleteInDbContextAsync(Authorization authorization) + private async Task> DeleteInDbContextAsync(Authorization authorization) { ctx.Entry(authorization).State = EntityState.Deleted; diff --git a/src/Ubik.Security.Api/Features/Authorizations/Services/AuthorizationsQueriesService.cs b/src/Ubik.Security.Api/Features/Authorizations/Services/AuthorizationsQueriesService.cs index ca7267df..7bf8dd00 100644 --- a/src/Ubik.Security.Api/Features/Authorizations/Services/AuthorizationsQueriesService.cs +++ b/src/Ubik.Security.Api/Features/Authorizations/Services/AuthorizationsQueriesService.cs @@ -15,7 +15,7 @@ public async Task> GetAllAsync() return result; } - public async Task> GetAsync(Guid id) + public async Task> GetAsync(Guid id) { var result = await ctx.Authorizations.FindAsync(id); diff --git a/src/Ubik.Security.Api/Features/Authorizations/Services/IAuthorizationsCommandsService.cs b/src/Ubik.Security.Api/Features/Authorizations/Services/IAuthorizationsCommandsService.cs index caca3d3c..bb09f0f3 100644 --- a/src/Ubik.Security.Api/Features/Authorizations/Services/IAuthorizationsCommandsService.cs +++ b/src/Ubik.Security.Api/Features/Authorizations/Services/IAuthorizationsCommandsService.cs @@ -7,8 +7,8 @@ namespace Ubik.Security.Api.Features.Authorizations.Services { public interface IAuthorizationsCommandsService { - public Task> AddAsync(AddAuthorizationCommand authorizationCommand); - public Task> UpdateAsync(UpdateAuthorizationCommand authorizationCommand); - public Task> DeleteAsync(Guid id); + public Task> AddAsync(AddAuthorizationCommand authorizationCommand); + public Task> UpdateAsync(UpdateAuthorizationCommand authorizationCommand); + public Task> DeleteAsync(Guid id); } } diff --git a/src/Ubik.Security.Api/Features/Authorizations/Services/IAuthorizationsQueriesService.cs b/src/Ubik.Security.Api/Features/Authorizations/Services/IAuthorizationsQueriesService.cs index dcbdb268..56ff0922 100644 --- a/src/Ubik.Security.Api/Features/Authorizations/Services/IAuthorizationsQueriesService.cs +++ b/src/Ubik.Security.Api/Features/Authorizations/Services/IAuthorizationsQueriesService.cs @@ -6,7 +6,7 @@ namespace Ubik.Security.Api.Features.Authorizations.Services { public interface IAuthorizationsQueriesService { - Task> GetAsync(Guid id); + Task> GetAsync(Guid id); Task> GetAllAsync(); } } diff --git a/src/Ubik.Security.Api/Features/Roles/Services/IRolesAdminCommandsService.cs b/src/Ubik.Security.Api/Features/Roles/Services/IRolesAdminCommandsService.cs index 96e2985b..a871383e 100644 --- a/src/Ubik.Security.Api/Features/Roles/Services/IRolesAdminCommandsService.cs +++ b/src/Ubik.Security.Api/Features/Roles/Services/IRolesAdminCommandsService.cs @@ -7,8 +7,8 @@ namespace Ubik.Security.Api.Features.Roles.Services { public interface IRolesAdminCommandsService { - public Task> AddAsync(AddRoleCommand authorizationCommand); - public Task> UpdateAsync(UpdateRoleCommand authorizationCommand); - public Task> DeleteAsync(Guid id); + public Task> AddAsync(AddRoleCommand authorizationCommand); + public Task> UpdateAsync(UpdateRoleCommand authorizationCommand); + public Task> DeleteAsync(Guid id); } } diff --git a/src/Ubik.Security.Api/Features/Roles/Services/IRolesAdminQueriesService.cs b/src/Ubik.Security.Api/Features/Roles/Services/IRolesAdminQueriesService.cs index 5c466989..b3ebb76a 100644 --- a/src/Ubik.Security.Api/Features/Roles/Services/IRolesAdminQueriesService.cs +++ b/src/Ubik.Security.Api/Features/Roles/Services/IRolesAdminQueriesService.cs @@ -6,7 +6,7 @@ namespace Ubik.Security.Api.Features.Roles.Services { public interface IRolesAdminQueriesService { - Task> GetAsync(Guid id); + Task> GetAsync(Guid id); Task> GetAllAsync(); } } diff --git a/src/Ubik.Security.Api/Features/Roles/Services/RolesAdminCommandsService.cs b/src/Ubik.Security.Api/Features/Roles/Services/RolesAdminCommandsService.cs index e79c06b9..fac4f384 100644 --- a/src/Ubik.Security.Api/Features/Roles/Services/RolesAdminCommandsService.cs +++ b/src/Ubik.Security.Api/Features/Roles/Services/RolesAdminCommandsService.cs @@ -13,14 +13,14 @@ namespace Ubik.Security.Api.Features.Roles.Services { public class RolesAdminCommandsService(SecurityDbContext ctx, IPublishEndpoint publishEndpoint) : IRolesAdminCommandsService { - public async Task> AddAsync(AddRoleCommand command) + public async Task> AddAsync(AddRoleCommand command) { return await ValidateIfNotAlreadyExistsAsync(command.ToRole()) .BindAsync(AddInDbContextAsync) .BindAsync(AddSaveAndPublishAsync); } - public async Task> UpdateAsync(UpdateRoleCommand command) + public async Task> UpdateAsync(UpdateRoleCommand command) { var model = command.ToRole(); @@ -31,28 +31,28 @@ public async Task> UpdateAsync(UpdateRoleC .BindAsync(UpdateSaveAndPublishAsync); } - public async Task> DeleteAsync(Guid id) + public async Task> DeleteAsync(Guid id) { return await GetAsync(id) .BindAsync(DeleteInDbContextAsync) .BindAsync(DeleteSaveAndPublishAsync); } - private async Task> DeleteSaveAndPublishAsync(Role current) + private async Task> DeleteSaveAndPublishAsync(Role current) { await publishEndpoint.Publish(new RoleDeleted { Id = current.Id }, CancellationToken.None); await ctx.SaveChangesAsync(); return true; } - private async Task> AddSaveAndPublishAsync(Role current) + private async Task> AddSaveAndPublishAsync(Role current) { await publishEndpoint.Publish(current.ToRoleAdded(), CancellationToken.None); await ctx.SaveChangesAsync(); return current; } - private async Task> UpdateSaveAndPublishAsync(Role current) + private async Task> UpdateSaveAndPublishAsync(Role current) { try { @@ -66,7 +66,7 @@ private async Task> UpdateSaveAndPublishAs } } - private async Task> GetAsync(Guid id) + private async Task> GetAsync(Guid id) { var result = await ctx.Roles.FirstOrDefaultAsync(r => r.Id == id && r.TenantId == null); @@ -75,7 +75,7 @@ private async Task> GetAsync(Guid id) : result; } - private async Task> ValidateIfNotAlreadyExistsAsync(Role current) + private async Task> ValidateIfNotAlreadyExistsAsync(Role current) { var exists = await ctx.Roles.AnyAsync(a => a.Code == current.Code && a.TenantId == null); return exists @@ -83,7 +83,7 @@ private async Task> ValidateIfNotAlreadyEx : current; } - private async Task> ValidateIfNotAlreadyExistsWithOtherIdAsync(Role current) + private async Task> ValidateIfNotAlreadyExistsWithOtherIdAsync(Role current) { var exists = await ctx.Roles.AnyAsync(a => a.Code == current.Code && a.Id != current.Id && a.TenantId == null); @@ -92,7 +92,7 @@ private async Task> ValidateIfNotAlreadyEx : current; } - private async Task> MapInDbContextAsync + private async Task> MapInDbContextAsync (Role current, Role forUpdate) { current = forUpdate.ToRole(current); @@ -100,7 +100,7 @@ private async Task> MapInDbContextAsync return current; } - private async Task> UpdateInDbContextAsync(Role current) + private async Task> UpdateInDbContextAsync(Role current) { ctx.Entry(current).State = EntityState.Modified; ctx.SetAuditAndSpecialFields(); @@ -109,7 +109,7 @@ private async Task> UpdateInDbContextAsync return current; } - private async Task> AddInDbContextAsync(Role current) + private async Task> AddInDbContextAsync(Role current) { current.Id = NewId.NextGuid(); await ctx.Roles.AddAsync(current); @@ -117,7 +117,7 @@ private async Task> AddInDbContextAsync(Ro return current; } - private async Task> DeleteInDbContextAsync(Role current) + private async Task> DeleteInDbContextAsync(Role current) { ctx.Entry(current).State = EntityState.Deleted; diff --git a/src/Ubik.Security.Api/Features/Roles/Services/RolesAdminQueriesService.cs b/src/Ubik.Security.Api/Features/Roles/Services/RolesAdminQueriesService.cs index 86651330..7f904921 100644 --- a/src/Ubik.Security.Api/Features/Roles/Services/RolesAdminQueriesService.cs +++ b/src/Ubik.Security.Api/Features/Roles/Services/RolesAdminQueriesService.cs @@ -15,7 +15,7 @@ public async Task> GetAllAsync() return result; } - public async Task> GetAsync(Guid id) + public async Task> GetAsync(Guid id) { var result = await ctx.Roles.FirstOrDefaultAsync(r => r.Id == id && r.TenantId == null); diff --git a/src/Ubik.Security.Api/Features/RolesAuthorizations/Errors/RoleAuthorizationIsNotABaseRoleError.cs b/src/Ubik.Security.Api/Features/RolesAuthorizations/Errors/RoleAuthorizationIsNotABaseRoleError.cs index e3eca2c8..b074b68d 100644 --- a/src/Ubik.Security.Api/Features/RolesAuthorizations/Errors/RoleAuthorizationIsNotABaseRoleError.cs +++ b/src/Ubik.Security.Api/Features/RolesAuthorizations/Errors/RoleAuthorizationIsNotABaseRoleError.cs @@ -2,16 +2,16 @@ namespace Ubik.Security.Api.Features.RolesAuthorizations.Errors { - public record RoleAuthorizationIsNotABaseRoleError : IServiceAndFeatureError + public record RoleAuthorizationIsNotABaseRoleError : IFeatureError { - public ServiceAndFeatureErrorType ErrorType { get; init; } + public FeatureErrorType ErrorType { get; init; } public List CustomErrors { get; init; } public RoleAuthorizationIsNotABaseRoleError(Guid roleId) { - ErrorType = ServiceAndFeatureErrorType.BadParams; + ErrorType = FeatureErrorType.BadParams; CustomErrors = new List() { new CustomError() { ErrorCode = "ROLE_AUTHORIZATION_NOT_A_BASE_ROLE_OR_NOT_EXISTS", diff --git a/src/Ubik.Security.Api/Features/RolesAuthorizations/Services/IRolesAuthorizationsCommandsService.cs b/src/Ubik.Security.Api/Features/RolesAuthorizations/Services/IRolesAuthorizationsCommandsService.cs index 96ec482a..9a219b28 100644 --- a/src/Ubik.Security.Api/Features/RolesAuthorizations/Services/IRolesAuthorizationsCommandsService.cs +++ b/src/Ubik.Security.Api/Features/RolesAuthorizations/Services/IRolesAuthorizationsCommandsService.cs @@ -7,7 +7,7 @@ namespace Ubik.Security.Api.Features.RolesAuthorizations.Services { public interface IRolesAuthorizationsCommandsService { - public Task> AddAsync(AddRoleAuthorizationCommand command); - public Task> ExecuteDeleteAsync(Guid id); + public Task> AddAsync(AddRoleAuthorizationCommand command); + public Task> ExecuteDeleteAsync(Guid id); } } diff --git a/src/Ubik.Security.Api/Features/RolesAuthorizations/Services/IRolesAuthorizationsQueriesService.cs b/src/Ubik.Security.Api/Features/RolesAuthorizations/Services/IRolesAuthorizationsQueriesService.cs index cac51d63..d35e2bb9 100644 --- a/src/Ubik.Security.Api/Features/RolesAuthorizations/Services/IRolesAuthorizationsQueriesService.cs +++ b/src/Ubik.Security.Api/Features/RolesAuthorizations/Services/IRolesAuthorizationsQueriesService.cs @@ -6,7 +6,7 @@ namespace Ubik.Security.Api.Features.RolesAuthorizations.Services { public interface IRolesAuthorizationsQueriesService { - Task> GetAsync(Guid id); + Task> GetAsync(Guid id); Task> GetAllAsync(); } } diff --git a/src/Ubik.Security.Api/Features/RolesAuthorizations/Services/RolesAuthorizationsCommandsService.cs b/src/Ubik.Security.Api/Features/RolesAuthorizations/Services/RolesAuthorizationsCommandsService.cs index 6e955042..e0270a6f 100644 --- a/src/Ubik.Security.Api/Features/RolesAuthorizations/Services/RolesAuthorizationsCommandsService.cs +++ b/src/Ubik.Security.Api/Features/RolesAuthorizations/Services/RolesAuthorizationsCommandsService.cs @@ -13,7 +13,7 @@ namespace Ubik.Security.Api.Features.RolesAuthorizations.Services { public class RolesAuthorizationsCommandsService(SecurityDbContext ctx, IPublishEndpoint publishEndpoint) : IRolesAuthorizationsCommandsService { - public async Task> AddAsync(AddRoleAuthorizationCommand command) + public async Task> AddAsync(AddRoleAuthorizationCommand command) { return await ValidateIfNotAlreadyExistsAsync(command.ToRoleAuthorization()) .BindAsync(ValidateIfForBaseRoleAsync) @@ -22,7 +22,7 @@ public async Task> AddAsync(A .BindAsync(AddSaveAndPublishAsync); } - public async Task> ExecuteDeleteAsync(Guid id) + public async Task> ExecuteDeleteAsync(Guid id) { return await GetAsync(id) .BindAsync(ValidateIfForBaseRoleAsync) @@ -30,7 +30,7 @@ public async Task> ExecuteDeleteAsync(Guid .BindAsync(DeleteSaveAndPublishAsync); } - private async Task> GetAsync(Guid id) + private async Task> GetAsync(Guid id) { var result = await ctx.RolesAuthorizations.FindAsync(id); @@ -39,21 +39,21 @@ private async Task> GetAsync( : result; } - private async Task> DeleteSaveAndPublishAsync(RoleAuthorization current) + private async Task> DeleteSaveAndPublishAsync(RoleAuthorization current) { await publishEndpoint.Publish(new RoleAuthorizationDeleted { Id = current.Id }, CancellationToken.None); await ctx.SaveChangesAsync(); return true; } - private async Task> AddSaveAndPublishAsync(RoleAuthorization current) + private async Task> AddSaveAndPublishAsync(RoleAuthorization current) { await publishEndpoint.Publish(current.ToRoleAuthorizationAdded(), CancellationToken.None); await ctx.SaveChangesAsync(); return current; } - private async Task> ValidateIfForBaseRoleAsync(RoleAuthorization current) + private async Task> ValidateIfForBaseRoleAsync(RoleAuthorization current) { var exists = await ctx.Roles.AnyAsync(r => r.Id == current.RoleId && r.TenantId == null); @@ -62,7 +62,7 @@ private async Task> ValidateI : new RoleAuthorizationIsNotABaseRoleError(current.RoleId); } - private async Task> ValidateIfAuhtorizationAsync(RoleAuthorization current) + private async Task> ValidateIfAuhtorizationAsync(RoleAuthorization current) { var exists = await ctx.Authorizations.FindAsync(current.AuthorizationId) != null; @@ -71,7 +71,7 @@ private async Task> ValidateI : new BadParamExternalResourceNotFound("RoleAuthorization","Authorization","AuthorizationId", current.AuthorizationId.ToString()); } - private async Task> ValidateIfNotAlreadyExistsAsync(RoleAuthorization current) + private async Task> ValidateIfNotAlreadyExistsAsync(RoleAuthorization current) { var exists = await ctx.RolesAuthorizations.AnyAsync(a => a.RoleId == current.RoleId && a.AuthorizationId == current.AuthorizationId); @@ -81,7 +81,7 @@ private async Task> ValidateI : current; } - private async Task> ValidateIfNotAlreadyExistsWithOtherIdAsync(RoleAuthorization current) + private async Task> ValidateIfNotAlreadyExistsWithOtherIdAsync(RoleAuthorization current) { var exists = await ctx.RolesAuthorizations.AnyAsync(a => a.RoleId == current.RoleId && a.AuthorizationId == current.AuthorizationId @@ -92,7 +92,7 @@ private async Task> ValidateI : current; } - private async Task> DeleteInDbContextAsync(RoleAuthorization current) + private async Task> DeleteInDbContextAsync(RoleAuthorization current) { ctx.Entry(current).State = EntityState.Deleted; @@ -100,7 +100,7 @@ private async Task> DeleteInD return current; } - private async Task> AddInDbContextAsync(RoleAuthorization current) + private async Task> AddInDbContextAsync(RoleAuthorization current) { current.Id = NewId.NextGuid(); await ctx.RolesAuthorizations.AddAsync(current); diff --git a/src/Ubik.Security.Api/Features/RolesAuthorizations/Services/RolesAuthorizationsQueriesService.cs b/src/Ubik.Security.Api/Features/RolesAuthorizations/Services/RolesAuthorizationsQueriesService.cs index a5492291..b06f148a 100644 --- a/src/Ubik.Security.Api/Features/RolesAuthorizations/Services/RolesAuthorizationsQueriesService.cs +++ b/src/Ubik.Security.Api/Features/RolesAuthorizations/Services/RolesAuthorizationsQueriesService.cs @@ -22,7 +22,7 @@ WHERE r.tenant_id IS NULL return await con.QueryAsync(sql); } - public async Task> GetAsync(Guid id) + public async Task> GetAsync(Guid id) { var p = new DynamicParameters(); p.Add("@id", id); diff --git a/src/Ubik.Security.Api/Features/Tenants/Services/ITenantsCommandsService.cs b/src/Ubik.Security.Api/Features/Tenants/Services/ITenantsCommandsService.cs index 83a462bb..cd8a4e03 100644 --- a/src/Ubik.Security.Api/Features/Tenants/Services/ITenantsCommandsService.cs +++ b/src/Ubik.Security.Api/Features/Tenants/Services/ITenantsCommandsService.cs @@ -7,8 +7,8 @@ namespace Ubik.Security.Api.Features.Tenants.Services { public interface ITenantsCommandsService { - public Task> AddAsync(AddTenantCommand command); - public Task> UpdateAsync(UpdateTenantCommand command); - public Task> DeleteAsync(Guid id); + public Task> AddAsync(AddTenantCommand command); + public Task> UpdateAsync(UpdateTenantCommand command); + public Task> DeleteAsync(Guid id); } } diff --git a/src/Ubik.Security.Api/Features/Tenants/Services/ITenantsQueriesService.cs b/src/Ubik.Security.Api/Features/Tenants/Services/ITenantsQueriesService.cs index 067a38d6..74cd7efd 100644 --- a/src/Ubik.Security.Api/Features/Tenants/Services/ITenantsQueriesService.cs +++ b/src/Ubik.Security.Api/Features/Tenants/Services/ITenantsQueriesService.cs @@ -6,7 +6,7 @@ namespace Ubik.Security.Api.Features.Tenants.Services { public interface ITenantsQueriesService { - Task> GetAsync(Guid id); + Task> GetAsync(Guid id); Task> GetAllAsync(); } } diff --git a/src/Ubik.Security.Api/Features/Tenants/Services/TenantsCommandsService.cs b/src/Ubik.Security.Api/Features/Tenants/Services/TenantsCommandsService.cs index d3ab2a18..83879614 100644 --- a/src/Ubik.Security.Api/Features/Tenants/Services/TenantsCommandsService.cs +++ b/src/Ubik.Security.Api/Features/Tenants/Services/TenantsCommandsService.cs @@ -13,14 +13,14 @@ namespace Ubik.Security.Api.Features.Tenants.Services { public class TenantsCommandsService(SecurityDbContext ctx, IPublishEndpoint publishEndpoint) : ITenantsCommandsService { - public async Task> AddAsync(AddTenantCommand command) + public async Task> AddAsync(AddTenantCommand command) { return await ValidateIfNotAlreadyExistsAsync(command.ToTenant()) .BindAsync(AddInDbContextAsync) .BindAsync(AddSaveAndPublishAsync); } - public async Task> UpdateAsync(UpdateTenantCommand command) + public async Task> UpdateAsync(UpdateTenantCommand command) { var model = command.ToTenant(); return await GetAsync(model.Id) @@ -31,21 +31,21 @@ public async Task> UpdateAsync(UpdateTen } //TODO: look at the deleted constrain and see if we want to expose that. - public async Task> DeleteAsync(Guid id) + public async Task> DeleteAsync(Guid id) { return await GetAsync(id) .BindAsync(DeleteInDbContextAsync) .BindAsync(DeleteSaveAndPublishAsync); } - private async Task> DeleteSaveAndPublishAsync(Tenant current) + private async Task> DeleteSaveAndPublishAsync(Tenant current) { await publishEndpoint.Publish(new TenantDeleted { Id = current.Id }, CancellationToken.None); await ctx.SaveChangesAsync(); return true; } - private async Task> UpdateSaveAndPublishAsync(Tenant current) + private async Task> UpdateSaveAndPublishAsync(Tenant current) { try { @@ -59,7 +59,7 @@ private async Task> UpdateSaveAndPublish } } - private async Task> MapInDbContextAsync + private async Task> MapInDbContextAsync (Tenant current, Tenant forUpdate) { current = forUpdate.ToTenant(current); @@ -67,14 +67,14 @@ private async Task> MapInDbContextAsync return current; } - private async Task> AddSaveAndPublishAsync(Tenant current) + private async Task> AddSaveAndPublishAsync(Tenant current) { await publishEndpoint.Publish(current.ToTenantAdded(), CancellationToken.None); await ctx.SaveChangesAsync(); return current; } - private async Task> GetAsync(Guid id) + private async Task> GetAsync(Guid id) { var result = await ctx.Tenants.FindAsync(id); @@ -83,7 +83,7 @@ private async Task> GetAsync(Guid id) : result; } - private async Task> UpdateInDbContextAsync(Tenant current) + private async Task> UpdateInDbContextAsync(Tenant current) { ctx.Entry(current).State = EntityState.Modified; ctx.SetAuditAndSpecialFields(); @@ -92,7 +92,7 @@ private async Task> UpdateInDbContextAsy return current; } - private async Task> AddInDbContextAsync(Tenant current) + private async Task> AddInDbContextAsync(Tenant current) { current.Id = NewId.NextGuid(); await ctx.Tenants.AddAsync(current); @@ -100,7 +100,7 @@ private async Task> AddInDbContextAsync( return current; } - private async Task> ValidateIfNotAlreadyExistsAsync(Tenant current) + private async Task> ValidateIfNotAlreadyExistsAsync(Tenant current) { var exists = await ctx.Tenants.AnyAsync(a => a.Code == current.Code); return exists @@ -108,7 +108,7 @@ private async Task> ValidateIfNotAlready : current; } - private async Task> ValidateIfNotAlreadyExistsWithOtherIdAsync(Tenant current) + private async Task> ValidateIfNotAlreadyExistsWithOtherIdAsync(Tenant current) { var exists = await ctx.Tenants.AnyAsync(a => a.Code == current.Code && a.Id != current.Id); @@ -117,7 +117,7 @@ private async Task> ValidateIfNotAlready : current; } - private async Task> DeleteInDbContextAsync(Tenant current) + private async Task> DeleteInDbContextAsync(Tenant current) { ctx.Entry(current).State = EntityState.Deleted; diff --git a/src/Ubik.Security.Api/Features/Tenants/Services/TenantsQueriesService.cs b/src/Ubik.Security.Api/Features/Tenants/Services/TenantsQueriesService.cs index b6c19128..7e2dc2c7 100644 --- a/src/Ubik.Security.Api/Features/Tenants/Services/TenantsQueriesService.cs +++ b/src/Ubik.Security.Api/Features/Tenants/Services/TenantsQueriesService.cs @@ -15,7 +15,7 @@ public async Task> GetAllAsync() return result; } - public async Task> GetAsync(Guid id) + public async Task> GetAsync(Guid id) { var result = await ctx.Tenants.FindAsync(id); diff --git a/src/Ubik.Security.Api/Features/Users/Errors/CannotGetAuthToken.cs b/src/Ubik.Security.Api/Features/Users/Errors/CannotGetAuthToken.cs index 267beb55..a2b94e0e 100644 --- a/src/Ubik.Security.Api/Features/Users/Errors/CannotGetAuthToken.cs +++ b/src/Ubik.Security.Api/Features/Users/Errors/CannotGetAuthToken.cs @@ -2,15 +2,15 @@ namespace Ubik.Security.Api.Features.Users.Errors { - public record CannotGetAuthToken : IServiceAndFeatureError + public record CannotGetAuthToken : IFeatureError { - public ServiceAndFeatureErrorType ErrorType { get; init; } + public FeatureErrorType ErrorType { get; init; } public List CustomErrors { get; init; } public CannotGetAuthToken() { - ErrorType = ServiceAndFeatureErrorType.BadParams; + ErrorType = FeatureErrorType.BadParams; CustomErrors = new List() { new CustomError() { ErrorCode = "USER_CANNOT_GET_AUTH_TOKEN", diff --git a/src/Ubik.Security.Api/Features/Users/Errors/UserAddFatalError.cs b/src/Ubik.Security.Api/Features/Users/Errors/UserAddFatalError.cs index 5a86d0eb..0d3f1c1c 100644 --- a/src/Ubik.Security.Api/Features/Users/Errors/UserAddFatalError.cs +++ b/src/Ubik.Security.Api/Features/Users/Errors/UserAddFatalError.cs @@ -2,15 +2,15 @@ namespace Ubik.Security.Api.Features.Users.Errors { - public record UserAddFatalError : IServiceAndFeatureError + public record UserAddFatalError : IFeatureError { - public ServiceAndFeatureErrorType ErrorType { get; init; } + public FeatureErrorType ErrorType { get; init; } public List CustomErrors { get; init; } public UserAddFatalError() { - ErrorType = ServiceAndFeatureErrorType.BadParams; + ErrorType = FeatureErrorType.BadParams; CustomErrors = new List() { new CustomError() { ErrorCode = "USER_NOT_ADDED_IN_DB_BUT_NOT_IN_AUTH", diff --git a/src/Ubik.Security.Api/Features/Users/Errors/UserCannotBeAddedInAuthProviderBadParams.cs b/src/Ubik.Security.Api/Features/Users/Errors/UserCannotBeAddedInAuthProviderBadParams.cs index 03e98381..c7e2e9ba 100644 --- a/src/Ubik.Security.Api/Features/Users/Errors/UserCannotBeAddedInAuthProviderBadParams.cs +++ b/src/Ubik.Security.Api/Features/Users/Errors/UserCannotBeAddedInAuthProviderBadParams.cs @@ -3,15 +3,15 @@ namespace Ubik.Security.Api.Features.Users.Errors { - public record UserCannotBeAddedInAuthProviderBadParams : IServiceAndFeatureError + public record UserCannotBeAddedInAuthProviderBadParams : IFeatureError { - public ServiceAndFeatureErrorType ErrorType { get; init; } + public FeatureErrorType ErrorType { get; init; } public List CustomErrors { get; init; } public UserCannotBeAddedInAuthProviderBadParams(AddUserCommand user) { - ErrorType = ServiceAndFeatureErrorType.BadParams; + ErrorType = FeatureErrorType.BadParams; CustomErrors = new List() { new CustomError() { ErrorCode = "USER_NOT_ADDED_IN_AUTH_PROVIDER_BAD_PARAM", diff --git a/src/Ubik.Security.Api/Features/Users/Errors/UserCannotBeAddedInAuthProviderConflict.cs b/src/Ubik.Security.Api/Features/Users/Errors/UserCannotBeAddedInAuthProviderConflict.cs index 35ed5ef2..1b59bbe7 100644 --- a/src/Ubik.Security.Api/Features/Users/Errors/UserCannotBeAddedInAuthProviderConflict.cs +++ b/src/Ubik.Security.Api/Features/Users/Errors/UserCannotBeAddedInAuthProviderConflict.cs @@ -3,15 +3,15 @@ namespace Ubik.Security.Api.Features.Users.Errors { - public record UserCannotBeAddedInAuthProviderConflict : IServiceAndFeatureError + public record UserCannotBeAddedInAuthProviderConflict : IFeatureError { - public ServiceAndFeatureErrorType ErrorType { get; init; } + public FeatureErrorType ErrorType { get; init; } public List CustomErrors { get; init; } public UserCannotBeAddedInAuthProviderConflict(AddUserCommand user) { - ErrorType = ServiceAndFeatureErrorType.Conflict; + ErrorType = FeatureErrorType.Conflict; CustomErrors = new List() { new CustomError() { ErrorCode = "USER_NOT_ADDED_IN_AUTH_PROVIDER_CONFLICT", diff --git a/src/Ubik.Security.Api/Features/Users/Errors/UserCannotCheckIfPresentInAuth.cs b/src/Ubik.Security.Api/Features/Users/Errors/UserCannotCheckIfPresentInAuth.cs index 658f864e..ed2704c0 100644 --- a/src/Ubik.Security.Api/Features/Users/Errors/UserCannotCheckIfPresentInAuth.cs +++ b/src/Ubik.Security.Api/Features/Users/Errors/UserCannotCheckIfPresentInAuth.cs @@ -2,15 +2,15 @@ namespace Ubik.Security.Api.Features.Users.Errors { - public record UserCannotCheckIfPresentInAuth : IServiceAndFeatureError + public record UserCannotCheckIfPresentInAuth : IFeatureError { - public ServiceAndFeatureErrorType ErrorType { get; init; } + public FeatureErrorType ErrorType { get; init; } public List CustomErrors { get; init; } public UserCannotCheckIfPresentInAuth() { - ErrorType = ServiceAndFeatureErrorType.Conflict; + ErrorType = FeatureErrorType.Conflict; CustomErrors = new List() { new CustomError() { ErrorCode = "USERs_CANNOT_CHECK_IF_PRESENT_IN_AUTH", diff --git a/src/Ubik.Security.Api/Features/Users/Errors/UserCannotGetMainUsrMgtRole.cs b/src/Ubik.Security.Api/Features/Users/Errors/UserCannotGetMainUsrMgtRole.cs index 365e4226..17a3380a 100644 --- a/src/Ubik.Security.Api/Features/Users/Errors/UserCannotGetMainUsrMgtRole.cs +++ b/src/Ubik.Security.Api/Features/Users/Errors/UserCannotGetMainUsrMgtRole.cs @@ -2,14 +2,14 @@ namespace Ubik.Security.Api.Features.Users.Errors { - public record UserCannotGetMainUsrMgtRole : IServiceAndFeatureError + public record UserCannotGetMainUsrMgtRole : IFeatureError { - public ServiceAndFeatureErrorType ErrorType { get; init; } + public FeatureErrorType ErrorType { get; init; } public List CustomErrors { get; init; } public UserCannotGetMainUsrMgtRole() { - ErrorType = ServiceAndFeatureErrorType.ServerError; + ErrorType = FeatureErrorType.ServerError; CustomErrors = new List() { new CustomError() { ErrorCode = "CANNOT_RETRIEVE_NECESSARY_ROLE", diff --git a/src/Ubik.Security.Api/Features/Users/Errors/UserTenantNotFound.cs b/src/Ubik.Security.Api/Features/Users/Errors/UserTenantNotFound.cs index f29ee804..36eab8d3 100644 --- a/src/Ubik.Security.Api/Features/Users/Errors/UserTenantNotFound.cs +++ b/src/Ubik.Security.Api/Features/Users/Errors/UserTenantNotFound.cs @@ -2,9 +2,9 @@ namespace Ubik.Security.Api.Features.Users.Errors { - public record UserTenantNotFound : IServiceAndFeatureError + public record UserTenantNotFound : IFeatureError { - public ServiceAndFeatureErrorType ErrorType { get; init; } + public FeatureErrorType ErrorType { get; init; } public List CustomErrors { get; init; } public UserTenantNotFound(Guid? tenantId) @@ -13,7 +13,7 @@ public UserTenantNotFound(Guid? tenantId) if(tenantId != null) strTenantId = tenantId.ToString(); - ErrorType = ServiceAndFeatureErrorType.NotFound; + ErrorType = FeatureErrorType.NotFound; CustomErrors = new List() { new CustomError() { ErrorCode = "USER_SELECTED_TENANT_NOT_FOUND", diff --git a/src/Ubik.Security.Api/Features/Users/Services/IUserAuthProviderService.cs b/src/Ubik.Security.Api/Features/Users/Services/IUserAuthProviderService.cs index 954154ee..5973432c 100644 --- a/src/Ubik.Security.Api/Features/Users/Services/IUserAuthProviderService.cs +++ b/src/Ubik.Security.Api/Features/Users/Services/IUserAuthProviderService.cs @@ -6,8 +6,8 @@ namespace Ubik.Security.Api.Features.Users.Services { public interface IUserAuthProviderService { - public Task> AddUserAsync(AddUserCommand user); - public Task> CheckIfUsersPresentInAuth(); + public Task> AddUserAsync(AddUserCommand user); + public Task> CheckIfUsersPresentInAuth(); } } diff --git a/src/Ubik.Security.Api/Features/Users/Services/IUsersCommandsService.cs b/src/Ubik.Security.Api/Features/Users/Services/IUsersCommandsService.cs index 070e3af0..7de94e6a 100644 --- a/src/Ubik.Security.Api/Features/Users/Services/IUsersCommandsService.cs +++ b/src/Ubik.Security.Api/Features/Users/Services/IUsersCommandsService.cs @@ -8,8 +8,8 @@ namespace Ubik.Security.Api.Features.Users.Services { public interface IUsersCommandsService { - Task> AddAsync(AddUserCommand userCommand); - Task> AddNewTenantAsync(Guid userId,AddTenantCommand command); - Task> AddRoleInTenantAsync(Guid userId, Guid roleId); + Task> AddAsync(AddUserCommand userCommand); + Task> AddNewTenantAsync(Guid userId,AddTenantCommand command); + Task> AddRoleInTenantAsync(Guid userId, Guid roleId); } } diff --git a/src/Ubik.Security.Api/Features/Users/Services/IUsersQueriesService.cs b/src/Ubik.Security.Api/Features/Users/Services/IUsersQueriesService.cs index 10548689..bc663e38 100644 --- a/src/Ubik.Security.Api/Features/Users/Services/IUsersQueriesService.cs +++ b/src/Ubik.Security.Api/Features/Users/Services/IUsersQueriesService.cs @@ -7,16 +7,16 @@ namespace Ubik.Security.Api.Features.Users.Services { public interface IUsersQueriesService { - Task> GetAsync(Guid id); - Task> GetUserInSelectedTenantAsync(Guid id); - Task>> GetUserRolesInSelectedTenantAsync(Guid id); - Task> GetUserRoleInSelectedTenantAsync(Guid id, Guid roleId); - Task> GetAsync(string email); - Task> GetUserWithAuhtorizationsByTenants(string email); - Task> GetUserWithAuhtorizationsByTenants(Guid id); - Task> GetUserSelectedTenantAsync(Guid userId); - Task> GetUserTenantAsync(Guid userId, Guid tenantId); - Task>> GetUserAllTenantsAsync(Guid userId); + Task> GetAsync(Guid id); + Task> GetUserInSelectedTenantAsync(Guid id); + Task>> GetUserRolesInSelectedTenantAsync(Guid id); + Task> GetUserRoleInSelectedTenantAsync(Guid id, Guid roleId); + Task> GetAsync(string email); + Task> GetUserWithAuhtorizationsByTenants(string email); + Task> GetUserWithAuhtorizationsByTenants(Guid id); + Task> GetUserSelectedTenantAsync(Guid userId); + Task> GetUserTenantAsync(Guid userId, Guid tenantId); + Task>> GetUserAllTenantsAsync(Guid userId); } } diff --git a/src/Ubik.Security.Api/Features/Users/Services/UserAuthProviderServiceKeycloak.cs b/src/Ubik.Security.Api/Features/Users/Services/UserAuthProviderServiceKeycloak.cs index fa368797..b270fbc1 100644 --- a/src/Ubik.Security.Api/Features/Users/Services/UserAuthProviderServiceKeycloak.cs +++ b/src/Ubik.Security.Api/Features/Users/Services/UserAuthProviderServiceKeycloak.cs @@ -14,20 +14,20 @@ public class UserAuthProviderServiceKeycloak(HttpClient httpClient, IOptions> AddUserAsync(AddUserCommand user) + public async Task> AddUserAsync(AddUserCommand user) { return await GetServiceTokenAsync() .BindAsync(token => SendAddRequestToAuthProviderAsync(user, token)); } - public async Task> CheckIfUsersPresentInAuth() + public async Task> CheckIfUsersPresentInAuth() { return await GetServiceTokenAsync() .BindAsync(token => CheckIfUsersRequestToAuthProviderAsync(token)); } - private async Task> SendAddRequestToAuthProviderAsync(AddUserCommand user, string token) + private async Task> SendAddRequestToAuthProviderAsync(AddUserCommand user, string token) { var userPayload = new AddUserInKeycloakRealm() { @@ -55,7 +55,7 @@ private async Task> SendAddRequestToAuthPr : new UserCannotBeAddedInAuthProviderBadParams(user); } - private async Task> CheckIfUsersRequestToAuthProviderAsync(string token) + private async Task> CheckIfUsersRequestToAuthProviderAsync(string token) { var code = "{@code null}"; @@ -80,7 +80,7 @@ private async Task> CheckIfUsersRequestToA return new UserCannotCheckIfPresentInAuth(); } - private async Task> GetServiceTokenAsync() + private async Task> GetServiceTokenAsync() { var dict = new Dictionary { diff --git a/src/Ubik.Security.Api/Features/Users/Services/UsersCommandsService.cs b/src/Ubik.Security.Api/Features/Users/Services/UsersCommandsService.cs index 0dc2a7d3..56bb052e 100644 --- a/src/Ubik.Security.Api/Features/Users/Services/UsersCommandsService.cs +++ b/src/Ubik.Security.Api/Features/Users/Services/UsersCommandsService.cs @@ -22,7 +22,7 @@ public class UsersCommandsService(SecurityDbContext ctx , ICurrentUser currentUser) : IUsersCommandsService { - public async Task> AddAsync(AddUserCommand command) + public async Task> AddAsync(AddUserCommand command) { //TODO: Enhance this part... dirty asf @@ -35,7 +35,7 @@ public async Task> AddAsync(AddUserCommand { var resultAuth = await authUserProviderService.AddUserAsync(command); - return await resultAuth.MatchAsync>( + return await resultAuth.MatchAsync>( RightAsync: async okAfterAuth => { //Store and publish UserAdded event (auth + DB = OK) @@ -66,7 +66,7 @@ public async Task> AddAsync(AddUserCommand }); } - public async Task> AddNewTenantAsync(Guid userId, AddTenantCommand command) + public async Task> AddNewTenantAsync(Guid userId, AddTenantCommand command) { var model = command.ToTenant(); @@ -84,7 +84,7 @@ public async Task> AddNewTenantAsync(Gui .BindAsync(t => AddSaveAndPublishAsync(t, userId)); } - public async Task> AddRoleInTenantAsync(Guid userId, Guid roleId) + public async Task> AddRoleInTenantAsync(Guid userId, Guid roleId) { return await GetUserInSelectedTenantAsync(userId) .BindAsync(u => CheckIfRoleExistInTenantOrBaseRole(roleId)) @@ -94,7 +94,7 @@ public async Task> AddRoleInTenantAsync(Gu .BindAsync(r => AddRoleInTenantSaveAndPublishAsync(r, userId)); } - private async Task> AddRoleInTenantSaveAndPublishAsync(Role current, Guid userId) + private async Task> AddRoleInTenantSaveAndPublishAsync(Role current, Guid userId) { var userRoleAddedToTenant = new UserRoleAddedToTenant() { @@ -108,7 +108,7 @@ private async Task> AddRoleInTenantSaveAnd return current; } - private async Task> AddSaveAndPublishAsync(Tenant current, Guid userId) + private async Task> AddSaveAndPublishAsync(Tenant current, Guid userId) { var tenandAdded = new UserTenantAdded() { @@ -120,7 +120,7 @@ private async Task> AddSaveAndPublishAsy return current; } - private async Task> GetUserTenantLinkForRole(Guid userId, Role role) + private async Task> GetUserTenantLinkForRole(Guid userId, Role role) { var result = await ctx.UsersTenants.SingleOrDefaultAsync(ut => ut.UserId == userId && ut.TenantId == currentUser.TenantId); @@ -130,7 +130,7 @@ private async Task> AddSaveAndPublishAsy : (result, role); } - private async Task> CheckIfUserTenantRoleAlreadyExists(UserTenant userTenant, Role role) + private async Task> CheckIfUserTenantRoleAlreadyExists(UserTenant userTenant, Role role) { var result = await ctx.UserRolesByTenants.SingleOrDefaultAsync(ut => ut.UserTenantId == userTenant.Id && ut.RoleId == role.Id); @@ -140,7 +140,7 @@ private async Task> AddSaveAndPublishAsy : new ResourceAlreadyExistsError("UserRoleByTenant", "UserTenantId/RoleId", $"{userTenant.Id}/{role.Id}"); } - private async Task> AddRoleToUserInTenantInDbContextAsync(Guid userTenantId, Role role) + private async Task> AddRoleToUserInTenantInDbContextAsync(Guid userTenantId, Role role) { var roleInTenantByUser = new UserRoleByTenant() { @@ -153,7 +153,7 @@ private async Task> AddRoleToUserInTenantI return role; } - private async Task> + private async Task> CheckIfRoleExistInTenantOrBaseRole(Guid roleId) { var p = new DynamicParameters(); @@ -172,11 +172,11 @@ FROM roles r var result = await con.QuerySingleOrDefaultAsync(sql, p); return result == null - ? (Either)new ResourceNotFoundError("Role", "Id", roleId.ToString()) - : (Either)result; + ? (Either)new ResourceNotFoundError("Role", "Id", roleId.ToString()) + : (Either)result; } - private async Task> GetUserInSelectedTenantAsync(Guid id) + private async Task> GetUserInSelectedTenantAsync(Guid id) { var p = new DynamicParameters(); p.Add("@user_id", id); @@ -199,7 +199,7 @@ FROM users u : result; } - private static async Task> CompleteTenantCode(Tenant current, string userEmail) + private static async Task> CompleteTenantCode(Tenant current, string userEmail) { var userEmailForCode = userEmail.Split("@")[0]; current.Code = current.Code + " - " + userEmailForCode; @@ -211,7 +211,7 @@ private static async Task> CompleteTenant return current; } - private async Task> AddUserTenantLinkInDbContextAsync(Guid userId, Tenant current) + private async Task> AddUserTenantLinkInDbContextAsync(Guid userId, Tenant current) { var ut = new UserTenant() { @@ -225,7 +225,7 @@ private async Task> AddUserTenantLin return ut; } - private async Task> AddTenantUserManagerRoleToTheUserInDbContextAsync(Role current, Guid userTenantLinkId) + private async Task> AddTenantUserManagerRoleToTheUserInDbContextAsync(Role current, Guid userTenantLinkId) { var newRoleForUser = new UserRoleByTenant() { @@ -239,7 +239,7 @@ private async Task> AddTenantU return newRoleForUser; } - private async Task> GetTenantUserManagementRole(UserTenant current) + private async Task> GetTenantUserManagementRole(UserTenant current) { var result = await ctx.Roles.FirstOrDefaultAsync(r => r.Code == "usrmgt_all_rw"); @@ -248,7 +248,7 @@ private async Task> AddTenantU : (result, current); } - private async Task> ValidateIfTenantLinkNotAlreadyExistsAsync(Guid userId, Tenant tenant) + private async Task> ValidateIfTenantLinkNotAlreadyExistsAsync(Guid userId, Tenant tenant) { var result = await ctx.UsersTenants.FirstOrDefaultAsync(ut => ut.UserId == userId && ut.TenantId == tenant.Id); @@ -257,7 +257,7 @@ private async Task> ValidateIfTenantLink : new ResourceAlreadyExistsError("UserTenant(link)", "UserId/TenantId", $"{userId}/{tenant.Id}"); } - private async Task> AddTenantInDbContextAsync(Tenant current) + private async Task> AddTenantInDbContextAsync(Tenant current) { current.Id = NewId.NextGuid(); await ctx.Tenants.AddAsync(current); @@ -265,7 +265,7 @@ private async Task> AddTenantInDbContext return current; } - private async Task> ValidateIfTenantNotAlreadyExistsAsync(Tenant current) + private async Task> ValidateIfTenantNotAlreadyExistsAsync(Tenant current) { var exists = await ctx.Tenants.AnyAsync(a => a.Code == current.Code); return exists @@ -273,7 +273,7 @@ private async Task> ValidateIfTenantNotA : current; } - private async Task> AddInDbContextAsync(User current) + private async Task> AddInDbContextAsync(User current) { current.Id = NewId.NextGuid(); await ctx.Users.AddAsync(current); @@ -281,7 +281,7 @@ private async Task> AddInDbContextAsync(Us return current; } - private async Task> ExecuteDeleteAsync(Guid id) + private async Task> ExecuteDeleteAsync(Guid id) { return await GetAsync(id) .MapAsync(async ac => @@ -291,7 +291,7 @@ private async Task> ExecuteDeleteAsync(Gui }); } - private async Task> GetAsync(Guid id) + private async Task> GetAsync(Guid id) { var result = await ctx.Users.FindAsync(id); @@ -300,7 +300,7 @@ private async Task> GetAsync(Guid id) : result; } - private async Task> ValidateIfNotAlreadyExistsAsync(User user) + private async Task> ValidateIfNotAlreadyExistsAsync(User user) { var exists = await ctx.Users.AnyAsync(a => a.Email == user.Email); return exists diff --git a/src/Ubik.Security.Api/Features/Users/Services/UsersQueriesService.cs b/src/Ubik.Security.Api/Features/Users/Services/UsersQueriesService.cs index 8af94602..44fd5090 100644 --- a/src/Ubik.Security.Api/Features/Users/Services/UsersQueriesService.cs +++ b/src/Ubik.Security.Api/Features/Users/Services/UsersQueriesService.cs @@ -15,7 +15,7 @@ namespace Ubik.Security.Api.Features.Users.Services public class UsersQueriesService(SecurityDbContext ctx, ICurrentUser currentUser) : IUsersQueriesService { - public async Task> GetUserInSelectedTenantAsync(Guid id) + public async Task> GetUserInSelectedTenantAsync(Guid id) { var p = new DynamicParameters(); p.Add("@user_id", id); @@ -38,7 +38,7 @@ FROM users u : result; } - public async Task> GetAsync(Guid id) + public async Task> GetAsync(Guid id) { var result = await ctx.Users.FindAsync(id); @@ -47,7 +47,7 @@ public async Task> GetAsync(Guid id) : result; } - public async Task> GetAsync(string email) + public async Task> GetAsync(string email) { var result = await ctx.Users.FirstOrDefaultAsync(u => u.Email == email); @@ -56,7 +56,7 @@ public async Task> GetAsync(string email) : result; } - public async Task> GetUserWithAuhtorizationsByTenants(string email) + public async Task> GetUserWithAuhtorizationsByTenants(string email) { return await GetAsync(email) .MapAsync(async u => @@ -67,7 +67,7 @@ public async Task> GetUserW }); } - public async Task> GetUserWithAuhtorizationsByTenants(Guid id) + public async Task> GetUserWithAuhtorizationsByTenants(Guid id) { return await GetAsync(id) .MapAsync(async u => @@ -78,7 +78,7 @@ public async Task> GetUserW }); } - public async Task>> GetUserRolesInSelectedTenantAsync(Guid id) + public async Task>> GetUserRolesInSelectedTenantAsync(Guid id) { return await GetUserInSelectedTenantAsync(id) .MapAsync(async u => @@ -102,13 +102,13 @@ FROM roles r }); } - public async Task> GetUserRoleInSelectedTenantAsync(Guid id, Guid roleId) + public async Task> GetUserRoleInSelectedTenantAsync(Guid id, Guid roleId) { return await GetUserInSelectedTenantAsync(id) .BindAsync(u => GetRoleForUserAsync(u.Id, roleId)); } - private async Task> GetRoleForUserAsync(Guid id,Guid roleId) + private async Task> GetRoleForUserAsync(Guid id,Guid roleId) { var p = new DynamicParameters(); p.Add("@user_id", id); @@ -177,7 +177,7 @@ FROM users u return dic; } - public async Task> GetUserSelectedTenantAsync(Guid userId) + public async Task> GetUserSelectedTenantAsync(Guid userId) { var result = await GetAsync(userId) .BindAsync(u => GetTenantAsync(u.SelectedTenantId)) @@ -186,7 +186,7 @@ public async Task> GetUserSelectedTenant return result; } - public async Task> GetUserTenantAsync(Guid userId, Guid tenantId) + public async Task> GetUserTenantAsync(Guid userId, Guid tenantId) { var result = await GetAsync(userId) .BindAsync(u => GetTenantAsync(tenantId)) @@ -195,7 +195,7 @@ public async Task> GetUserTenantAsync(Gu return result; } - public async Task>> GetUserAllTenantsAsync(Guid userId) + public async Task>> GetUserAllTenantsAsync(Guid userId) { var tenants = (await GetAsync(userId)) .MapAsync(async u => @@ -218,7 +218,7 @@ FROM tenants t return await tenants; } - private async Task> GetTenantAsync(Guid? tenantId) + private async Task> GetTenantAsync(Guid? tenantId) { if (tenantId == null) return new UserTenantNotFound(tenantId); @@ -230,7 +230,7 @@ private async Task> GetTenantAsync(Guid? } - private async Task> ValidateIfExistsForTheUserAsync(Tenant tenant, Guid userId) + private async Task> ValidateIfExistsForTheUserAsync(Tenant tenant, Guid userId) { var result = await ctx.UsersTenants.FirstOrDefaultAsync(ut => ut.UserId == userId && ut.TenantId == tenant.Id); From 02875ea03ad0298551976c8c19c59d41053d1d1e Mon Sep 17 00:00:00 2001 From: fdonnet Date: Wed, 6 Nov 2024 14:08:19 +0100 Subject: [PATCH 50/94] Prepare transaction service --- .../Data/AccountingTxContext.cs | 7 ++-- .../Data/Config/AccountConfiguration.cs | 32 +++++++++++++++++++ .../Consumers/AccountAddedConsumer.cs | 14 ++++++++ .../Consumers/AccountDeletedConsumer.cs | 14 ++++++++ .../Consumers/AccountUpdatedConsumer.cs | 14 ++++++++ .../Services/AccountCommandService.cs | 30 +++++++++++++++++ .../Services/IAccountCommandService.cs | 11 +++++++ .../Mappers/AccountMappers.cs | 21 ++++++++++++ .../Models/TaxInfo.cs | 12 +++---- .../Program.cs | 2 ++ .../Ubik.Accounting.Transaction.Api.csproj | 2 ++ 11 files changed, 148 insertions(+), 11 deletions(-) create mode 100644 src/Ubik.Accounting.Transaction.Api/Data/Config/AccountConfiguration.cs create mode 100644 src/Ubik.Accounting.Transaction.Api/Features/Accounts/Consumers/AccountAddedConsumer.cs create mode 100644 src/Ubik.Accounting.Transaction.Api/Features/Accounts/Consumers/AccountDeletedConsumer.cs create mode 100644 src/Ubik.Accounting.Transaction.Api/Features/Accounts/Consumers/AccountUpdatedConsumer.cs create mode 100644 src/Ubik.Accounting.Transaction.Api/Features/Accounts/Services/AccountCommandService.cs create mode 100644 src/Ubik.Accounting.Transaction.Api/Features/Accounts/Services/IAccountCommandService.cs create mode 100644 src/Ubik.Accounting.Transaction.Api/Mappers/AccountMappers.cs diff --git a/src/Ubik.Accounting.Transaction.Api/Data/AccountingTxContext.cs b/src/Ubik.Accounting.Transaction.Api/Data/AccountingTxContext.cs index d3e56232..b74f537e 100644 --- a/src/Ubik.Accounting.Transaction.Api/Data/AccountingTxContext.cs +++ b/src/Ubik.Accounting.Transaction.Api/Data/AccountingTxContext.cs @@ -13,6 +13,7 @@ public class AccountingTxContext(DbContextOptions options , ICurrentUser userService) : DbContext(options) { public DbSet Entries { get; set; } + public DbSet Accounts { get; set; } protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) { @@ -62,7 +63,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) //Configure new EntryConfiguration().Configure(modelBuilder.Entity()); - //new ClassificationConfiguration().Configure(modelBuilder.Entity()); + new AccountConfiguration().Configure(modelBuilder.Entity()); //new AccountGroupConfiguration().Configure(modelBuilder.Entity()); //new AccountConfiguration().Configure(modelBuilder.Entity()); //new AccountAccountGroupConfiguration().Configure(modelBuilder.Entity()); @@ -78,8 +79,8 @@ private void SetTenantId(ModelBuilder modelBuilder) modelBuilder.Entity() .HasQueryFilter(mt => mt.TenantId == userService.TenantId); - //modelBuilder.Entity() - // .HasQueryFilter(mt => mt.TenantId == _currentUser.TenantId); + modelBuilder.Entity() + .HasQueryFilter(mt => mt.TenantId == userService.TenantId); //modelBuilder.Entity() // .HasQueryFilter(mt => mt.TenantId == _currentUser.TenantId); diff --git a/src/Ubik.Accounting.Transaction.Api/Data/Config/AccountConfiguration.cs b/src/Ubik.Accounting.Transaction.Api/Data/Config/AccountConfiguration.cs new file mode 100644 index 00000000..3ad17b14 --- /dev/null +++ b/src/Ubik.Accounting.Transaction.Api/Data/Config/AccountConfiguration.cs @@ -0,0 +1,32 @@ +using Microsoft.EntityFrameworkCore.Metadata.Builders; +using Microsoft.EntityFrameworkCore; +using Ubik.Accounting.Transaction.Api.Models; + +namespace Ubik.Accounting.Transaction.Api.Data.Config +{ + public class AccountConfiguration : IEntityTypeConfiguration + { + public void Configure(EntityTypeBuilder builder) + { + builder.Property(a => a.Code) + .IsRequired() + .HasMaxLength(20); + + builder.Property(a => a.Label) + .IsRequired() + .HasMaxLength(100); + + builder.Property(a => a.TenantId) + .IsRequired(); + + builder.Property(a => a.Active) + .IsRequired() + .HasDefaultValue(true); + + builder.HasIndex(a => new { a.Code, a.TenantId }) + .IsUnique(); + + builder.HasIndex(a => a.TenantId); + } + } +} diff --git a/src/Ubik.Accounting.Transaction.Api/Features/Accounts/Consumers/AccountAddedConsumer.cs b/src/Ubik.Accounting.Transaction.Api/Features/Accounts/Consumers/AccountAddedConsumer.cs new file mode 100644 index 00000000..8b08c5ef --- /dev/null +++ b/src/Ubik.Accounting.Transaction.Api/Features/Accounts/Consumers/AccountAddedConsumer.cs @@ -0,0 +1,14 @@ +using MassTransit; +using Ubik.Accounting.Structure.Contracts.Accounts.Events; +using Ubik.Accounting.Transaction.Api.Features.Accounts.Services; + +namespace Ubik.Accounting.Transaction.Api.Features.Accounts.Consumers +{ + public class AccountAddedConsumer(IAccountCommandService commandService) : IConsumer + { + public async Task Consume(ConsumeContext context) + { + await commandService.AddAsync(context.Message); + } + } +} diff --git a/src/Ubik.Accounting.Transaction.Api/Features/Accounts/Consumers/AccountDeletedConsumer.cs b/src/Ubik.Accounting.Transaction.Api/Features/Accounts/Consumers/AccountDeletedConsumer.cs new file mode 100644 index 00000000..cc8af4b4 --- /dev/null +++ b/src/Ubik.Accounting.Transaction.Api/Features/Accounts/Consumers/AccountDeletedConsumer.cs @@ -0,0 +1,14 @@ +using MassTransit; +using Ubik.Accounting.Structure.Contracts.Accounts.Events; +using Ubik.Accounting.Transaction.Api.Features.Accounts.Services; + +namespace Ubik.Accounting.Transaction.Api.Features.Accounts.Consumers +{ + public class AccountDeletedConsumer(IAccountCommandService commandService) : IConsumer + { + public async Task Consume(ConsumeContext context) + { + await commandService.DeleteAsync(context.Message.Id); + } + } +} diff --git a/src/Ubik.Accounting.Transaction.Api/Features/Accounts/Consumers/AccountUpdatedConsumer.cs b/src/Ubik.Accounting.Transaction.Api/Features/Accounts/Consumers/AccountUpdatedConsumer.cs new file mode 100644 index 00000000..b63fefbb --- /dev/null +++ b/src/Ubik.Accounting.Transaction.Api/Features/Accounts/Consumers/AccountUpdatedConsumer.cs @@ -0,0 +1,14 @@ +using MassTransit; +using Ubik.Accounting.Structure.Contracts.Accounts.Events; +using Ubik.Accounting.Transaction.Api.Features.Accounts.Services; + +namespace Ubik.Accounting.Transaction.Api.Features.Accounts.Consumers +{ + public class AccountUpdatedConsumer(IAccountCommandService commandService) : IConsumer + { + public async Task Consume(ConsumeContext context) + { + await commandService.UpdateAsync(context.Message); + } + } +} diff --git a/src/Ubik.Accounting.Transaction.Api/Features/Accounts/Services/AccountCommandService.cs b/src/Ubik.Accounting.Transaction.Api/Features/Accounts/Services/AccountCommandService.cs new file mode 100644 index 00000000..5fde1bb3 --- /dev/null +++ b/src/Ubik.Accounting.Transaction.Api/Features/Accounts/Services/AccountCommandService.cs @@ -0,0 +1,30 @@ +using Microsoft.EntityFrameworkCore; +using Ubik.Accounting.Structure.Contracts.Accounts.Events; +using Ubik.Accounting.Transaction.Api.Data; +using Ubik.Accounting.Transaction.Api.Mappers; + +namespace Ubik.Accounting.Transaction.Api.Features.Accounts.Services +{ + public class AccountCommandService(AccountingTxContext ctx) : IAccountCommandService + { + public async Task AddAsync(AccountAdded accountAdded) + { + await ctx.Accounts.AddAsync(accountAdded.ToAccount()); + await ctx.SaveChangesAsync(); + } + + public async Task DeleteAsync(Guid accountId) + { + await ctx.Accounts.Where(a => a.Id == accountId).ExecuteDeleteAsync(); + } + + public async Task UpdateAsync(AccountUpdated accountUpdated) + { + await ctx.Accounts.Where(a => a.Id == accountUpdated.Id).ExecuteUpdateAsync(setters => setters + .SetProperty(b => b.Active, accountUpdated.Active) + .SetProperty(b => b.Version, accountUpdated.Version) + .SetProperty(b => b.Code, accountUpdated.Code) + .SetProperty(b => b.Label, accountUpdated.Label)); + } + } +} diff --git a/src/Ubik.Accounting.Transaction.Api/Features/Accounts/Services/IAccountCommandService.cs b/src/Ubik.Accounting.Transaction.Api/Features/Accounts/Services/IAccountCommandService.cs new file mode 100644 index 00000000..61ad8011 --- /dev/null +++ b/src/Ubik.Accounting.Transaction.Api/Features/Accounts/Services/IAccountCommandService.cs @@ -0,0 +1,11 @@ +using Ubik.Accounting.Structure.Contracts.Accounts.Events; + +namespace Ubik.Accounting.Transaction.Api.Features.Accounts.Services +{ + public interface IAccountCommandService + { + public Task AddAsync(AccountAdded accountAdded); + public Task UpdateAsync(AccountUpdated accountUpdated); + public Task DeleteAsync(Guid accountId); + } +} diff --git a/src/Ubik.Accounting.Transaction.Api/Mappers/AccountMappers.cs b/src/Ubik.Accounting.Transaction.Api/Mappers/AccountMappers.cs new file mode 100644 index 00000000..6efd6b3b --- /dev/null +++ b/src/Ubik.Accounting.Transaction.Api/Mappers/AccountMappers.cs @@ -0,0 +1,21 @@ +using Ubik.Accounting.Structure.Contracts.Accounts.Events; +using Ubik.Accounting.Transaction.Api.Models; + +namespace Ubik.Accounting.Transaction.Api.Mappers +{ + public static class AccountMappers + { + public static Account ToAccount(this AccountAdded current) + { + return new Account + { + Active = current.Active, + Code = current.Code, + Id = current.Id, + Label = current.Label, + TenantId = current.TenantId, + Version = current.Version + }; + } + } +} diff --git a/src/Ubik.Accounting.Transaction.Api/Models/TaxInfo.cs b/src/Ubik.Accounting.Transaction.Api/Models/TaxInfo.cs index 88336728..fb19ba01 100644 --- a/src/Ubik.Accounting.Transaction.Api/Models/TaxInfo.cs +++ b/src/Ubik.Accounting.Transaction.Api/Models/TaxInfo.cs @@ -20,16 +20,12 @@ public Guid TaxRateId private set => _taxRateId = value; } - public static async Task> Create(decimal taxAppliedRate, Guid taxRateId) + public TaxInfo(decimal taxAppliedRate, Guid taxRateId) { - await Task.CompletedTask; - - return new TaxInfo - { - TaxAppliedRate = taxAppliedRate, - TaxRateId = taxRateId - }; + TaxAppliedRate = taxAppliedRate; + TaxRateId = taxRateId; } + private TaxInfo() { } diff --git a/src/Ubik.Accounting.Transaction.Api/Program.cs b/src/Ubik.Accounting.Transaction.Api/Program.cs index d2e80d1d..a213fe05 100644 --- a/src/Ubik.Accounting.Transaction.Api/Program.cs +++ b/src/Ubik.Accounting.Transaction.Api/Program.cs @@ -5,6 +5,7 @@ using System.Reflection; using System.Text.Json.Serialization; using Ubik.Accounting.Transaction.Api.Data; +using Ubik.Accounting.Transaction.Api.Features.Accounts.Services; using Ubik.ApiService.Common.Configure; using Ubik.ApiService.Common.Configure.Options; using Ubik.ApiService.Common.Exceptions; @@ -79,6 +80,7 @@ //Services builder.Services.AddScoped(); +builder.Services.AddScoped(); builder.Services.AddTransient(); builder.Services.AddTracingAndMetrics(); diff --git a/src/Ubik.Accounting.Transaction.Api/Ubik.Accounting.Transaction.Api.csproj b/src/Ubik.Accounting.Transaction.Api/Ubik.Accounting.Transaction.Api.csproj index 77b713fa..1927f287 100644 --- a/src/Ubik.Accounting.Transaction.Api/Ubik.Accounting.Transaction.Api.csproj +++ b/src/Ubik.Accounting.Transaction.Api/Ubik.Accounting.Transaction.Api.csproj @@ -16,6 +16,7 @@ + @@ -23,6 +24,7 @@ + From 9d25ec4b31663dcb5d32975d3fcdc8b732e0426a Mon Sep 17 00:00:00 2001 From: fdonnet Date: Wed, 6 Nov 2024 14:33:50 +0100 Subject: [PATCH 51/94] Load initial accounts data --- .../Data/Init/AccountsData.cs | 17 ++ .../Data/Init/AccountsData.sql | 266 ++++++++++++++++++ .../Data/Init/DbInitializer.cs | 10 + .../Program.cs | 3 +- .../Ubik.Accounting.Transaction.Api.csproj | 7 +- 5 files changed, 301 insertions(+), 2 deletions(-) create mode 100644 src/Ubik.Accounting.Transaction.Api/Data/Init/AccountsData.cs create mode 100644 src/Ubik.Accounting.Transaction.Api/Data/Init/AccountsData.sql create mode 100644 src/Ubik.Accounting.Transaction.Api/Data/Init/DbInitializer.cs diff --git a/src/Ubik.Accounting.Transaction.Api/Data/Init/AccountsData.cs b/src/Ubik.Accounting.Transaction.Api/Data/Init/AccountsData.cs new file mode 100644 index 00000000..2a50680b --- /dev/null +++ b/src/Ubik.Accounting.Transaction.Api/Data/Init/AccountsData.cs @@ -0,0 +1,17 @@ +using Microsoft.EntityFrameworkCore; +using System.Runtime.CompilerServices; + +namespace Ubik.Accounting.Transaction.Api.Data.Init +{ + internal static class AccountsData + { + internal static async Task LoadAsync(AccountingTxContext context) + { + if (!context.Accounts.Any()) + { + var query = await File.ReadAllTextAsync(@"Data/Init/AccountsData.sql"); + await context.Database.ExecuteSqlAsync(FormattableStringFactory.Create(query)); + } + } + } +} diff --git a/src/Ubik.Accounting.Transaction.Api/Data/Init/AccountsData.sql b/src/Ubik.Accounting.Transaction.Api/Data/Init/AccountsData.sql new file mode 100644 index 00000000..dfc941cb --- /dev/null +++ b/src/Ubik.Accounting.Transaction.Api/Data/Init/AccountsData.sql @@ -0,0 +1,266 @@ +/*Copy from Structure api accounts data*/ +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('248e0000-5dd4-0015-e321-08dcd98b1434', '1020', 'Bank', true, '248e0000-5dd4-0015-f549-08dcd98b1434', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('248e0000-5dd4-0015-f110-08dcd98b20af', '1060', 'Securities', true, '248e0000-5dd4-0015-f77f-08dcd98b20af', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('248e0000-5dd4-0015-aa2d-08dcd98b2ad0', '1100', 'Trade accounts receivable', true, '248e0000-5dd4-0015-b397-08dcd98b2ad0', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('248e0000-5dd4-0015-12f9-08dcd98b3350', '1101', 'Credit card receivables', true, '248e0000-5dd4-0015-1822-08dcd98b3350', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('248e0000-5dd4-0015-8db2-08dcd98b3c4c', '1109', 'Provision for credit losses (Ducroire)', true, '248e0000-5dd4-0015-928a-08dcd98b3c4c', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('248e0000-5dd4-0015-48fb-08dcd98b4a28', '1140', 'Advances and loans granted', true, '248e0000-5dd4-0015-4df0-08dcd98b4a28', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('248e0000-5dd4-0015-13fe-08dcd98b6d70', '1176', 'Withholding tax recoverable', true, '248e0000-5dd4-0015-19ed-08dcd98b6d70', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('248e0000-5dd4-0015-fff6-08dcd98b746a', '1190', 'Other short-term receivables', true, '248e0000-5dd4-0015-04ac-08dcd98b746b', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('248e0000-5dd4-0015-ebad-08dcd98b0949', '1000', 'Case', true, '248e0000-5dd4-0015-a737-08dcd98bcb2b', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('78920000-5dd4-0015-3c01-08dcd9a7702b', '1400', 'Long-term securities', true, '78920000-5dd4-0015-18d4-08dcd9a7702e', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('78920000-5dd4-0015-eaeb-08dcd9a778d2', '1440', 'Long-term loans', true, '78920000-5dd4-0015-f445-08dcd9a778d2', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('78920000-5dd4-0015-6f96-08dcd9a78046', '1441', 'Mortgage loans', true, '78920000-5dd4-0015-7a90-08dcd9a78046', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('248e0000-5dd4-0015-443b-08dcd98b545d', '1170', 'VAT input tax (materials, services)', true, '78920000-5dd4-0015-983d-08dcd9a9beab', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('248e0000-5dd4-0015-133a-08dcd98b5d1d', '1171', 'VAT input tax (investments and other charges)', true, '78920000-5dd4-0015-c8f5-08dcd9a9c7da', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('248e0000-5dd4-0015-c1ce-08dcd98b7c74', '1200', 'Inventory A', true, '78920000-5dd4-0015-f39f-08dcd9a9f93e', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('248e0000-5dd4-0015-2c01-08dcd98b8441', '1201', 'Inventory B', true, '78920000-5dd4-0015-2de6-08dcd9aa042a', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('248e0000-5dd4-0015-9008-08dcd98b8c12', '1209', 'Inventory valuation adjustments', true, '78920000-5dd4-0015-3a44-08dcd9aa0fb7', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('248e0000-5dd4-0015-7165-08dcd98bbffa', '1300', 'Prepaid expenses', true, '78920000-5dd4-0015-392d-08dcd9aa2c96', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('78920000-5dd4-0015-23e7-08dcd9aa3ba7', '1301', 'Receivables for products and services', true, '78920000-5dd4-0015-2a3d-08dcd9aa3ba7', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('ec860000-5dd4-0015-3815-08dcda1dad9e', '1522', 'Communication systems', true, 'ec860000-5dd4-0015-3d50-08dcda1dad9e', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('78920000-5dd4-0015-0644-08dcd9aaf581', '1409', 'Valuation adjustments on long-term invest', true, '78920000-5dd4-0015-c298-08dcd9aaffac', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('78920000-5dd4-0015-a5ff-08dcd9a7ab43', '1449', 'Valuation adjustments on long-term loans', true, '78920000-5dd4-0015-c376-08dcd9ab07a8', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('ec860000-5dd4-0015-1c93-08dcda1d182f', '1500', 'Machinery and equipment', true, 'ec860000-5dd4-0015-ba47-08dcda1d1831', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('ec860000-5dd4-0015-b48d-08dcda1d22ef', '1510', 'Operating furniture', true, 'ec860000-5dd4-0015-bc9f-08dcda1d22ef', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('ec860000-5dd4-0015-061c-08dcda1d2bc2', '1511', 'Workshop installations', true, 'ec860000-5dd4-0015-0fca-08dcda1d2bc2', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('ec860000-5dd4-0015-ddf3-08dcda1d3498', '1512', 'Warehouse installations', true, 'ec860000-5dd4-0015-e2f2-08dcda1d3498', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('ec860000-5dd4-0015-bc68-08dcda1d47f5', '1513', 'Office furniture', true, 'ec860000-5dd4-0015-c79e-08dcda1d47f5', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('ec860000-5dd4-0015-a24f-08dcda1d9931', '1520', 'Office machines', true, 'ec860000-5dd4-0015-a781-08dcda1d9931', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('ec860000-5dd4-0015-9192-08dcda1da58d', '1521', 'IT infrastructure', true, 'ec860000-5dd4-0015-99c4-08dcda1da58d', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('ec860000-5dd4-0015-0173-08dcda1db8d7', '1530', 'Cars', true, 'ec860000-5dd4-0015-07a9-08dcda1db8d7', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('ec860000-5dd4-0015-d472-08dcda1dc37c', '1540', 'Tools and equipment', true, 'ec860000-5dd4-0015-da04-08dcda1dc37c', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('ec860000-5dd4-0015-66d1-08dcda1dd26b', '1550', 'Storage facilities', true, 'ec860000-5dd4-0015-6c02-08dcda1dd26b', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('ec860000-5dd4-0015-11c5-08dcda1de501', '1590', 'Work clothing and uniforms', true, 'ec860000-5dd4-0015-1701-08dcda1de501', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('ec860000-5dd4-0015-3436-08dcda1eb6ce', '1600', 'Operating buildings', true, 'ec860000-5dd4-0015-3c3a-08dcda1eb6ce', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('ec860000-5dd4-0015-f0cf-08dcda1ebfe4', '1601', 'Maintenance, repair, or replacement', true, 'ec860000-5dd4-0015-f4d3-08dcda1ebfe4', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('ec860000-5dd4-0015-12a2-08dcda1ed305', '1800', 'Incorporation costs', true, 'ec860000-5dd4-0015-16a9-08dcda1ed305', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('ec860000-5dd4-0015-69c4-08dcda1edb78', '1801', 'Capital increase costs', true, 'ec860000-5dd4-0015-0c65-08dcda1ef2e0', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('ec860000-5dd4-0015-7012-08dcda1ef826', '1802', 'Organizational costs', true, 'ec860000-5dd4-0015-74d8-08dcda1ef826', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('ec860000-5dd4-0015-ef03-08dcda1f0104', '1850', 'Unissued share capital', true, 'ec860000-5dd4-0015-f553-08dcda1f0104', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('ec860000-5dd4-0015-c9fe-08dcda1f08eb', '1859', 'Valuation adjustments on unissued share capital', true, 'ec860000-5dd4-0015-d01a-08dcda1f08eb', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('ec860000-5dd4-0015-5955-08dcda1eca12', '1609', 'Accumulated depreciation on operating buildings', true, 'ec860000-5dd4-0015-df72-08dcda1f3dbc', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('ec860000-5dd4-0015-1cc9-08dcda20a76e', '2000', 'Liabilities for purchases of materials and goods', true, 'ec860000-5dd4-0015-234c-08dcda20a76e', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('ec860000-5dd4-0015-98ee-08dcda20b16e', '2001', 'Liabilities for services to third parties', true, 'ec860000-5dd4-0015-9c96-08dcda20b16e', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('ec860000-5dd4-0015-1ecb-08dcda20bb14', '2002', 'Liabilities for personnel expenses', true, 'ec860000-5dd4-0015-22db-08dcda20bb14', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('ec860000-5dd4-0015-54dd-08dcda20c7a0', '2003', 'Liabilities for social security contributions', true, 'ec860000-5dd4-0015-5874-08dcda20c7a0', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('ec860000-5dd4-0015-e6b0-08dcda20d5dd', '2005', 'Liabilities for lease transactions', true, 'ec860000-5dd4-0015-eac7-08dcda20d5dd', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('ec860000-5dd4-0015-a0ad-08dcda20cecb', '2004', 'Liabilities for other operating expenses', true, 'ec860000-5dd4-0015-6c4d-08dcda210823', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('ec860000-5dd4-0015-aa11-08dcda2fe630', '2030', 'Customer advances', true, 'ec860000-5dd4-0015-aee3-08dcda2fe630', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('ec860000-5dd4-0015-4e95-08dcda2ff13b', '2100', 'Short-term bank liabilities', true, 'ec860000-5dd4-0015-5350-08dcda2ff13b', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('ec860000-5dd4-0015-2d5c-08dcda306250', '2110', 'Liabilities to post offices', true, 'ec860000-5dd4-0015-3149-08dcda306250', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('ec860000-5dd4-0015-ce96-08dcda306be5', '2111', 'Liabilities to transfer companies', true, 'ec860000-5dd4-0015-d394-08dcda306be5', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('ec860000-5dd4-0015-0733-08dcda307df9', '2160', 'Short-term financial liabilities to shareholder X', true, 'ec860000-5dd4-0015-0a00-08dcda307df9', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('ec860000-5dd4-0015-5593-08dcda308633', '2170', 'Short-term financial liabilities to pension funds', true, 'ec860000-5dd4-0015-584c-08dcda308633', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('ec860000-5dd4-0015-e456-08dcda308e53', '2180', 'Mortgage repayments', true, 'ec860000-5dd4-0015-e818-08dcda308e53', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('ec860000-5dd4-0015-a892-08dcda3094b8', '2181', 'Loan repayments', true, 'ec860000-5dd4-0015-ad23-08dcda3094b8', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('ec860000-5dd4-0015-2309-08dcda309b7b', '2200', 'VAT payable', true, 'ec860000-5dd4-0015-25fe-08dcda309b7b', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('ec860000-5dd4-0015-e12c-08dcda30a42e', '2205', 'AFC - VAT', true, 'ec860000-5dd4-0015-e3a2-08dcda30a42e', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('ec860000-5dd4-0015-e7f6-08dcda30aa7d', '2206', 'Due withholding tax', true, 'ec860000-5dd4-0015-ecc0-08dcda30aa7d', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('ec860000-5dd4-0015-2192-08dcda30b1de', '2207', 'Due stamp duties', true, 'ec860000-5dd4-0015-2506-08dcda30b1de', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('ec860000-5dd4-0015-0ce3-08dcda30bd7f', '2208', 'Due direct taxes', true, 'ec860000-5dd4-0015-0f91-08dcda30bd7f', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('ec860000-5dd4-0015-8e25-08dcda30c7bb', '2230', 'Unclaimed dividends for the year', true, 'ec860000-5dd4-0015-9ad3-08dcda30c7bb', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('ec860000-5dd4-0015-3043-08dcda30ce50', '2231', 'Unclaimed dividends from previous years', true, 'ec860000-5dd4-0015-3371-08dcda30ce50', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('ec860000-5dd4-0015-8e4f-08dcda30d697', '2232', 'Unclaimed bond coupons', true, 'ec860000-5dd4-0015-90fc-08dcda30d697', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('ec860000-5dd4-0015-e4a1-08dcda3073d0', '2140', 'Other short-term financial liabilities to third parties', true, 'ec860000-5dd4-0015-5fe2-08dcda316bc3', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('ec860000-5dd4-0015-f91d-08dcda52f00f', '2300', 'Accrued expenses', true, 'ec860000-5dd4-0015-fcae-08dcda52f00f', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('ec860000-5dd4-0015-b39d-08dcda530d2c', '2301', 'Prepaid income', true, 'ec860000-5dd4-0015-b78d-08dcda530d2c', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('ec860000-5dd4-0015-01b3-08dcda531ef9', '2340', 'Provisions for direct taxes', true, 'ec860000-5dd4-0015-04a4-08dcda531ef9', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('ec860000-5dd4-0015-b414-08dcda532935', '2341', 'Provisions for indirect taxes', true, 'ec860000-5dd4-0015-b722-08dcda532935', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('dc610000-5dd4-0015-07cd-08dcda5647e1', '2400', 'Long-term bank liabilities', true, 'dc610000-5dd4-0015-1264-08dcda5647e8', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('dc610000-5dd4-0015-3646-08dcda5647ed', '2420', 'Liabilities from lease transactions', true, 'dc610000-5dd4-0015-7f38-08dcda5647ed', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('dc610000-5dd4-0015-15f0-08dcda5647ee', '2440', 'Mortgages on operating buildings', true, 'dc610000-5dd4-0015-1a65-08dcda5647ee', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('dc610000-5dd4-0015-c1ff-08dcda5647ee', '2500', 'Long-term loans from third parties', true, 'dc610000-5dd4-0015-c778-08dcda5647ee', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('dc610000-5dd4-0015-41c7-08dcda5647ef', '2560', 'Long-term loans to shareholders', true, 'dc610000-5dd4-0015-4659-08dcda5647ef', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('dc610000-5dd4-0015-c36a-08dcda5647ef', '2570', 'Long-term loans to pension funds', true, 'dc610000-5dd4-0015-ca17-08dcda5647ef', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('dc610000-5dd4-0015-46c8-08dcda5647f0', '2600', 'Provision for repairs', true, 'dc610000-5dd4-0015-4c69-08dcda5647f0', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('dc610000-5dd4-0015-ee99-08dcda5647f0', '2601', 'Provision for renovations', true, 'dc610000-5dd4-0015-f646-08dcda5647f0', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('dc610000-5dd4-0015-724d-08dcda5647f1', '2602', 'Provision for refurbishments', true, 'dc610000-5dd4-0015-7965-08dcda5647f1', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('dc610000-5dd4-0015-0363-08dcda5647f2', '2630', 'Provisions for warranty work', true, 'dc610000-5dd4-0015-0adf-08dcda5647f2', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('dc610000-5dd4-0015-83b1-08dcda5647f2', '2800', 'Equity', true, 'dc610000-5dd4-0015-8a8d-08dcda5647f2', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('dc610000-5dd4-0015-39bb-08dcda5647f3', '2801', 'Spouse''s equity', true, 'dc610000-5dd4-0015-430c-08dcda5647f3', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('dc610000-5dd4-0015-bbae-08dcda5647f3', '2810', 'Partner A''s capital account', true, 'dc610000-5dd4-0015-d5a8-08dcda5647f3', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('dc610000-5dd4-0015-5509-08dcda5647f4', '2811', 'Partner B''s capital account', true, 'dc610000-5dd4-0015-5da7-08dcda5647f4', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('dc610000-5dd4-0015-dac6-08dcda5647f4', '2812', 'Commandite partner C''s capital account', true, 'dc610000-5dd4-0015-e3fa-08dcda5647f4', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('dc610000-5dd4-0015-8943-08dcda5647f5', '2820', 'Share capital of the LLC', true, 'dc610000-5dd4-0015-921d-08dcda5647f5', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('dc610000-5dd4-0015-0ffd-08dcda5647f6', '2840', 'Share capital', true, 'dc610000-5dd4-0015-19d0-08dcda5647f6', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('dc610000-5dd4-0015-95c3-08dcda5647f6', '2841', 'Participation capital', true, 'dc610000-5dd4-0015-9fba-08dcda5647f6', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('dc610000-5dd4-0015-1c3a-08dcda5647f7', '2850', 'Private cash withdrawals', true, 'dc610000-5dd4-0015-2641-08dcda5647f7', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('dc610000-5dd4-0015-c85d-08dcda5647f7', '2851', 'Private in-kind withdrawals', true, 'dc610000-5dd4-0015-d2f0-08dcda5647f7', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('dc610000-5dd4-0015-573b-08dcda5647f8', '2852', 'Private contributions to operating expenses', true, 'dc610000-5dd4-0015-62ae-08dcda5647f8', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('dc610000-5dd4-0015-da37-08dcda5647f8', '2853', 'Rental value of private apartment', true, 'dc610000-5dd4-0015-e55d-08dcda5647f8', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('dc610000-5dd4-0015-65d5-08dcda5647f9', '2854', 'Private insurance premiums', true, 'dc610000-5dd4-0015-71a2-08dcda5647f9', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('dc610000-5dd4-0015-1dfa-08dcda5647fa', '2855', 'Private pension contributions', true, 'dc610000-5dd4-0015-2a34-08dcda5647fa', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('dc610000-5dd4-0015-a720-08dcda5647fa', '2856', 'Private taxes', true, 'dc610000-5dd4-0015-b33d-08dcda5647fa', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('dc610000-5dd4-0015-3f48-08dcda5647fb', '2880', 'Private property A', true, 'dc610000-5dd4-0015-51a4-08dcda5647fb', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('dc610000-5dd4-0015-cdb5-08dcda5647fb', '2900', 'General reserve', true, 'dc610000-5dd4-0015-db04-08dcda5647fb', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('dc610000-5dd4-0015-7a6c-08dcda5647fc', '2901', 'Reserve for treasury shares', true, 'dc610000-5dd4-0015-87e2-08dcda5647fc', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('dc610000-5dd4-0015-0677-08dcda5647fd', '2903', 'Revaluation reserve', true, 'dc610000-5dd4-0015-145f-08dcda5647fd', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('dc610000-5dd4-0015-905e-08dcda5647fd', '2910', 'Statutory reserves', true, 'dc610000-5dd4-0015-9eff-08dcda5647fd', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('dc610000-5dd4-0015-1791-08dcda5647fe', '2990', 'Brought-forward profit / Brought-forward loss', true, 'dc610000-5dd4-0015-25fe-08dcda5647fe', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('dc610000-5dd4-0015-fd1c-08dcda5647fe', '2991', 'Current-year profit / Current-year loss', true, 'dc610000-5dd4-0015-0e56-08dcda5647ff', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('4c6f0000-5dd4-0015-5b3c-08dcda56e416', '3211', 'Gross credit retail sales', true, '4c6f0000-5dd4-0015-81a7-08dcda56e41d', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('4c6f0000-5dd4-0015-7cad-08dcda56e423', '3212', 'Gross credit wholesale sales', true, '4c6f0000-5dd4-0015-bf07-08dcda56e423', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('4c6f0000-5dd4-0015-5a60-08dcda56e424', '3220', 'Gross sales at standard VAT rate (8.00% net VAT)', true, '4c6f0000-5dd4-0015-5ee0-08dcda56e424', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('4c6f0000-5dd4-0015-db2b-08dcda56e424', '3221', 'Gross sales at reduced VAT rate (2.50% net VAT)', true, '4c6f0000-5dd4-0015-dfcf-08dcda56e424', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('4c6f0000-5dd4-0015-ad5b-08dcda56e425', '3222', 'Gross sales at zero VAT rate (0.00% net VAT)', true, '4c6f0000-5dd4-0015-b1bd-08dcda56e425', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('4c6f0000-5dd4-0015-5998-08dcda56e426', '3300', 'Other directly incorporable materials', true, '4c6f0000-5dd4-0015-614e-08dcda56e426', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('4c6f0000-5dd4-0015-e459-08dcda56e426', '3720', 'Internal consumption', true, '4c6f0000-5dd4-0015-e998-08dcda56e426', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('4c6f0000-5dd4-0015-63be-08dcda56e427', '3900', 'Discounts', true, '4c6f0000-5dd4-0015-6abe-08dcda56e427', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('4c6f0000-5dd4-0015-0dad-08dcda56e428', '3901', 'Price rebates', true, '4c6f0000-5dd4-0015-148f-08dcda56e428', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-4a86-08dcda58ab6a', '4292', 'Refunds', true, 'b0650000-5dd4-0015-e575-08dcda6a7f80', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('4c6f0000-5dd4-0015-7bf9-08dcda56e429', '3903', 'Third-party commissions', true, '4c6f0000-5dd4-0015-8393-08dcda56e429', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('4c6f0000-5dd4-0015-0683-08dcda56e42a', '3904', 'Collection fees', true, '4c6f0000-5dd4-0015-0e72-08dcda56e42a', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('4c6f0000-5dd4-0015-ac69-08dcda56e42a', '3905', 'Customer losses', true, '4c6f0000-5dd4-0015-b4e7-08dcda56e42a', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('4c6f0000-5dd4-0015-3498-08dcda56e42b', '3906', 'Foreign exchange differences', true, '4c6f0000-5dd4-0015-3cf3-08dcda56e42b', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('4c6f0000-5dd4-0015-f5b3-08dcda56e42b', '3907', 'Freight and carriage', true, '4c6f0000-5dd4-0015-fec1-08dcda56e42b', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('4c6f0000-5dd4-0015-b18f-08dcda56e42c', '3210', 'Gross cash sales', true, '4c6f0000-5dd4-0015-bac3-08dcda56e42c', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-ab3e-08dcda58ab55', '4208', 'Inventory adjustments', true, '60520000-5dd4-0015-64c7-08dcda58ab5d', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-6395-08dcda58ab63', '4209', 'Deductions obtained on purchases', true, '60520000-5dd4-0015-a651-08dcda58ab63', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-5c21-08dcda58ab64', '4210', 'Purchases of goods at standard VAT rate (8.00% net VAT)', true, '60520000-5dd4-0015-60fe-08dcda58ab64', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-e55a-08dcda58ab64', '4211', 'Purchases of goods at reduced VAT rate (2.50% net VAT)', true, '60520000-5dd4-0015-e987-08dcda58ab64', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-988a-08dcda58ab65', '4212', 'Purchases of goods at zero VAT rate (0.00% net VAT)', true, '60520000-5dd4-0015-9d88-08dcda58ab65', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-3197-08dcda58ab66', '4215', 'Purchase of packaging materials', true, '60520000-5dd4-0015-3a85-08dcda58ab66', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-700a-08dcda58ab67', '4270', 'Purchase freight', true, '60520000-5dd4-0015-763f-08dcda58ab67', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-f70d-08dcda58ab67', '4271', 'Import customs duties', true, '60520000-5dd4-0015-fd6a-08dcda58ab67', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-8547-08dcda58ab68', '4272', 'Purchase transportation costs', true, '60520000-5dd4-0015-8b6e-08dcda58ab68', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-0b7c-08dcda58ab69', '4290', 'Discounts', true, '60520000-5dd4-0015-1190-08dcda58ab69', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-c1b6-08dcda58ab69', '4291', 'Price rebates', true, '60520000-5dd4-0015-c8b6-08dcda58ab69', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-e6d2-08dcda58ab6a', '4293', 'Rebates obtained on purchases', true, '60520000-5dd4-0015-ede7-08dcda58ab6a', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-7563-08dcda58ab6b', '4296', 'Foreign exchange differences', true, '60520000-5dd4-0015-7d56-08dcda58ab6b', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-2576-08dcda58ab6c', '5200', 'Salaries', true, '60520000-5dd4-0015-2c86-08dcda58ab6c', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-b332-08dcda58ab6c', '5205', 'Social security benefits', true, '60520000-5dd4-0015-bb48-08dcda58ab6c', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-374c-08dcda58ab6d', '5270', 'Old-age and survivors'' insurance, disability insurance, income replacement', true, '60520000-5dd4-0015-3f61-08dcda58ab6d', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-c742-08dcda58ab6d', '5271', 'Family allowance fund', true, '60520000-5dd4-0015-d07e-08dcda58ab6d', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-7504-08dcda58ab6e', '5272', 'Occupational pension plan', true, '60520000-5dd4-0015-7e69-08dcda58ab6e', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-fb87-08dcda58ab6e', '5273', 'Accident insurance', true, '60520000-5dd4-0015-04f4-08dcda58ab6f', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-81b9-08dcda58ab6f', '5274', 'Sickness benefits insurance', true, '60520000-5dd4-0015-8b2c-08dcda58ab6f', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-1b0b-08dcda58ab70', '5279', 'Withholding taxes', true, '60520000-5dd4-0015-25a2-08dcda58ab70', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-cc5b-08dcda58ab70', '5280', 'Personnel recruitment', true, '60520000-5dd4-0015-d72a-08dcda58ab70', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-5921-08dcda58ab71', '5281', 'Training and continuing education', true, '60520000-5dd4-0015-63ad-08dcda58ab71', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-e852-08dcda58ab71', '5282', 'Actual expense reimbursements', true, '60520000-5dd4-0015-f392-08dcda58ab71', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-7d83-08dcda58ab72', '5283', 'Flat-rate expense allowances', true, '60520000-5dd4-0015-898e-08dcda58ab72', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-2e91-08dcda58ab73', '5289', 'Other personnel expenses', true, '60520000-5dd4-0015-3c7d-08dcda58ab73', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-bd6a-08dcda58ab73', '5290', 'Temporary employees', true, '60520000-5dd4-0015-c8cf-08dcda58ab73', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-555c-08dcda58ab74', '6000', 'Rent', true, '60520000-5dd4-0015-6281-08dcda58ab74', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-ea28-08dcda58ab74', '6030', 'Accessory charges', true, '60520000-5dd4-0015-f797-08dcda58ab74', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-a2d7-08dcda58ab75', '6040', 'Cleaning', true, '60520000-5dd4-0015-afc8-08dcda58ab75', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-3667-08dcda58ab76', '6050', 'Maintenance', true, '60520000-5dd4-0015-4398-08dcda58ab76', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-c6a2-08dcda58ab76', '6090', 'Premises charges as private withdrawals', true, '60520000-5dd4-0015-d8af-08dcda58ab76', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-627b-08dcda58ab77', '6100', 'Maintenance, repair, or replacement of machinery', true, '60520000-5dd4-0015-7037-08dcda58ab77', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-1874-08dcda58ab78', '6102', 'Maintenance, repair, or replacement of tools and equipment', true, '60520000-5dd4-0015-27de-08dcda58ab78', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-b07e-08dcda58ab78', '6130', 'Maintenance, repair, or replacement of office furniture', true, '60520000-5dd4-0015-bdeb-08dcda58ab78', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-4078-08dcda58ab79', '6131', 'Maintenance, repair, or replacement of office machines', true, '60520000-5dd4-0015-4e76-08dcda58ab79', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-cdcd-08dcda58ab79', '6200', 'Repair, service, and cleaning', true, '60520000-5dd4-0015-dc1c-08dcda58ab79', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-7f75-08dcda58ab7a', '6210', 'Fuel', true, '60520000-5dd4-0015-8de1-08dcda58ab7a', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-1137-08dcda58ab7b', '6220', 'Insurance and taxes', true, '60520000-5dd4-0015-1f7c-08dcda58ab7b', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-a49f-08dcda58ab7b', '6260', 'Lease charges for vehicles', true, '60520000-5dd4-0015-96c3-08dcda58ab7c', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-260f-08dcda58ab7d', '6270', 'Vehicle charges as private withdrawals', true, '60520000-5dd4-0015-3458-08dcda58ab7d', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-d524-08dcda58ab7d', '6300', 'Property damage insurance', true, '60520000-5dd4-0015-e322-08dcda58ab7d', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-61c0-08dcda58ab7e', '6310', 'Liability insurance', true, '60520000-5dd4-0015-74df-08dcda58ab7e', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-ff88-08dcda58ab7e', '6330', 'Life insurance premiums', true, '60520000-5dd4-0015-0ee0-08dcda58ab7f', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-979f-08dcda58ab7f', '6331', 'Surety bond premiums', true, '60520000-5dd4-0015-a81e-08dcda58ab7f', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-4d51-08dcda58ab80', '6360', 'Duties', true, '60520000-5dd4-0015-5d61-08dcda58ab80', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-e36e-08dcda58ab80', '6361', 'Taxes', true, '60520000-5dd4-0015-f3c4-08dcda58ab80', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-7221-08dcda58ab81', '6370', 'Permits', true, '60520000-5dd4-0015-8272-08dcda58ab81', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-0165-08dcda58ab82', '6371', 'Licenses', true, '60520000-5dd4-0015-1251-08dcda58ab82', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-b139-08dcda58ab82', '6400', 'Power', true, '60520000-5dd4-0015-c4bf-08dcda58ab82', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-5258-08dcda58ab83', '6420', 'Fuel oil', true, '60520000-5dd4-0015-62a0-08dcda58ab83', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-dbbf-08dcda58ab83', '6430', 'Water', true, '60520000-5dd4-0015-ee2d-08dcda58ab83', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-6bc2-08dcda58ab84', '6460', 'Waste disposal', true, '60520000-5dd4-0015-7d8d-08dcda58ab84', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-2f77-08dcda58ab85', '6462', 'Wastewater', true, '60520000-5dd4-0015-4245-08dcda58ab85', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-c3ce-08dcda58ab85', '6500', 'Office supplies', true, '60520000-5dd4-0015-d563-08dcda58ab85', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-5394-08dcda58ab86', '6501', 'Printed materials', true, '60520000-5dd4-0015-6602-08dcda58ab86', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-dccc-08dcda58ab86', '6502', 'Photocopies', true, '60520000-5dd4-0015-f0fa-08dcda58ab86', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-a4c4-08dcda58ab87', '6503', 'Technical literature', true, '60520000-5dd4-0015-b723-08dcda58ab87', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-41ee-08dcda58ab88', '6510', 'Telephone', true, '60520000-5dd4-0015-55a7-08dcda58ab88', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-cdf4-08dcda58ab88', '6511', 'Fax', true, '60520000-5dd4-0015-e0ed-08dcda58ab88', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-5f4c-08dcda58ab89', '6512', 'Internet', true, '60520000-5dd4-0015-7205-08dcda58ab89', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-2459-08dcda58ab8a', '6513', 'Postage charges', true, '60520000-5dd4-0015-424e-08dcda58ab8a', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-c4e8-08dcda58ab8a', '6520', 'Contributions', true, '60520000-5dd4-0015-d8c2-08dcda58ab8a', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-58c1-08dcda58ab8b', '6521', 'Donations and gifts', true, '60520000-5dd4-0015-6ca3-08dcda58ab8b', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-ea58-08dcda58ab8b', '6522', 'Tips', true, '60520000-5dd4-0015-fe3d-08dcda58ab8b', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-aab8-08dcda58ab8c', '6530', 'Fiduciary fees', true, '60520000-5dd4-0015-bf8f-08dcda58ab8c', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-3ce8-08dcda58ab8d', '6531', 'Consulting fees', true, '60520000-5dd4-0015-5677-08dcda58ab8d', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-de62-08dcda58ab8d', '6532', 'Legal consulting fees', true, '60520000-5dd4-0015-f256-08dcda58ab8d', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-6d70-08dcda58ab8e', '6540', 'Board of directors fees', true, '60520000-5dd4-0015-8e09-08dcda58ab8e', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-3e66-08dcda58ab8f', '6541', 'General assembly fees', true, '60520000-5dd4-0015-5722-08dcda58ab8f', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-dd01-08dcda58ab8f', '6542', 'Auditing fees', true, '60520000-5dd4-0015-f232-08dcda58ab8f', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-6f55-08dcda58ab90', '6550', 'Administrative charges as private withdrawals', true, '60520000-5dd4-0015-87d2-08dcda58ab90', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-fdc8-08dcda58ab90', '6560', 'Lease of equipment', true, '60520000-5dd4-0015-128f-08dcda58ab91', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-b7ee-08dcda58ab91', '6561', 'Lease of software', true, '60520000-5dd4-0015-cdce-08dcda58ab91', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-4a73-08dcda58ab92', '6562', 'Lease of equipment', true, '60520000-5dd4-0015-60d8-08dcda58ab92', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-de50-08dcda58ab92', '6570', 'License/update charges', true, '60520000-5dd4-0015-f421-08dcda58ab92', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-26d9-08dcda58ab94', '6575', 'Network charges', true, '60520000-5dd4-0015-3e53-08dcda58ab94', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-b938-08dcda58ab94', '6600', 'Newspaper advertising', true, '60520000-5dd4-0015-d269-08dcda58ab94', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-52a3-08dcda58ab95', '6610', 'Advertising materials, advertising equipment', true, '60520000-5dd4-0015-6975-08dcda58ab95', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-f145-08dcda58ab95', '6611', 'Advertising items, samples', true, '60520000-5dd4-0015-0d48-08dcda58ab96', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-b380-08dcda58ab96', '6620', 'Window displays, decorations', true, '60520000-5dd4-0015-cb0a-08dcda58ab96', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-4c9e-08dcda58ab97', '6621', 'Fairs, exhibitions', true, '60520000-5dd4-0015-63fe-08dcda58ab97', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-dde2-08dcda58ab97', '6640', 'Travel expenses', true, '60520000-5dd4-0015-f9a5-08dcda58ab97', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-808f-08dcda58ab98', '6641', 'Customer advisory services', true, '60520000-5dd4-0015-9a60-08dcda58ab98', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-43cc-08dcda58ab99', '6642', 'Customer gifts', true, '60520000-5dd4-0015-5bbe-08dcda58ab99', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-d8d2-08dcda58ab99', '6700', 'Economic information', true, '60520000-5dd4-0015-f157-08dcda58ab99', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-7006-08dcda58ab9a', '6701', 'Legal proceedings', true, '60520000-5dd4-0015-89b7-08dcda58ab9a', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-0725-08dcda58ab9b', '6710', 'Security', true, '60520000-5dd4-0015-33ee-08dcda58ab9b', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-dcea-08dcda58ab9b', '6711', 'Surveillance', true, '60520000-5dd4-0015-f7b6-08dcda58ab9b', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-7a0f-08dcda58ab9c', '6800', 'Bank loan interest', true, '60520000-5dd4-0015-95e0-08dcda58ab9c', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-0ffa-08dcda58ab9d', '6801', 'Loan interest', true, '60520000-5dd4-0015-2a2f-08dcda58ab9d', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-b01e-08dcda58ab9d', '6802', 'Mortgage loan interest', true, '60520000-5dd4-0015-cb3c-08dcda58ab9d', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-8132-08dcda58ab9e', '6803', 'Default interest', true, '60520000-5dd4-0015-9bd2-08dcda58ab9e', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-1bb1-08dcda58ab9f', '6804', 'Financial charges for customer advances', true, '60520000-5dd4-0015-3854-08dcda58ab9f', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-beae-08dcda58ab9f', '6820', 'Financial charges for shareholder A''s current account', true, '60520000-5dd4-0015-d9e7-08dcda58ab9f', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-5b4f-08dcda58aba0', '6830', 'Financial charges for pension fund financing', true, '60520000-5dd4-0015-7ab1-08dcda58aba0', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-22c9-08dcda58aba1', '6840', 'Bank and postal charges', true, '60520000-5dd4-0015-3df0-08dcda58aba1', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-c552-08dcda58aba1', '6841', 'Deposit charges', true, '60520000-5dd4-0015-e0d6-08dcda58aba1', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-61dd-08dcda58aba2', '6842', 'Exchange losses on cash and securities', true, '60520000-5dd4-0015-8538-08dcda58aba2', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-44aa-08dcda58aba7', '6920', 'Depreciation on machinery and tools', true, '60520000-5dd4-0015-6181-08dcda58aba7', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-ea38-08dcda58aba7', '6921', 'Depreciation on furniture and installations', true, '60520000-5dd4-0015-07ee-08dcda58aba8', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-0c8d-08dcda58aba3', '6850', 'Financial income from postal and bank assets', true, '34980000-5dd4-0015-760f-08dcdaf3f47f', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-d9f9-08dcda58aba3', '6851', 'Financial income from short-term assets', true, '34980000-5dd4-0015-2f7f-08dcdaf3f740', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-7b17-08dcda58aba4', '6880', 'Financial income from shareholder X''s current account', true, '34980000-5dd4-0015-3102-08dcdaf3fc7a', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-2ddf-08dcda58aba5', '6890', 'Financial income from default interest, discounts', true, '34980000-5dd4-0015-2e2e-08dcdaf402da', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-d5a4-08dcda58aba5', '6891', 'Financial income from advances received', true, '34980000-5dd4-0015-6b59-08dcdaf40601', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-9a10-08dcda58aba6', '6892', 'Foreign exchange gains on cash and securities', true, '34980000-5dd4-0015-5e06-08dcdaf408c8', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-8cf0-08dcda58aba8', '6922', 'Depreciation on office, IT equipment', true, '60520000-5dd4-0015-ab8b-08dcda58aba8', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-63f6-08dcda58aba9', '6923', 'Depreciation on vehicles', true, '60520000-5dd4-0015-8281-08dcda58aba9', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-073b-08dcda58abaa', '6930', 'Depreciation on operating buildings', true, '60520000-5dd4-0015-2580-08dcda58abaa', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-ae47-08dcda58abaa', '6950', 'Depreciation on incorporation costs', true, '60520000-5dd4-0015-cca4-08dcda58abaa', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-5961-08dcda58abab', '4200', 'Purchases of goods', true, '60520000-5dd4-0015-7863-08dcda58abab', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('60520000-5dd4-0015-6d55-08dcda592ca8', '7910', 'Gains on sale of operating equipment', true, '60520000-5dd4-0015-7eb0-08dcda592ca8', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('c4170000-5dd4-0015-c93b-08dcda5963b6', '8002', 'Accounting revaluations', true, 'c4170000-5dd4-0015-1b5b-08dcda5963be', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('c4170000-5dd4-0015-f081-08dcda5963c3', '8004', 'Exceptional gains on disposal of fixed assets', true, 'c4170000-5dd4-0015-3937-08dcda5963c4', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('c4170000-5dd4-0015-e540-08dcda5963c4', '8005', 'Grants received', true, 'c4170000-5dd4-0015-e9d3-08dcda5963c4', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('c4170000-5dd4-0015-7b3c-08dcda5963c5', '8006', 'Income from compensation for damages', true, 'c4170000-5dd4-0015-80d4-08dcda5963c5', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('c4170000-5dd4-0015-3c95-08dcda5963c6', '8500', 'Rental income from premises', true, 'c4170000-5dd4-0015-43a9-08dcda5963c6', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('c4170000-5dd4-0015-ce36-08dcda5963c6', '8501', 'Rental income from apartments', true, 'c4170000-5dd4-0015-d659-08dcda5963c6', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('c4170000-5dd4-0015-5b6f-08dcda5963c7', '8502', 'Rental income from garages', true, 'c4170000-5dd4-0015-612f-08dcda5963c7', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('c4170000-5dd4-0015-e270-08dcda5963c7', '8503', 'Internal rental income', true, 'c4170000-5dd4-0015-eaa4-08dcda5963c7', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('c4170000-5dd4-0015-a031-08dcda5963c8', '8700', 'Fees for expert opinions, conferences', true, 'c4170000-5dd4-0015-a87a-08dcda5963c8', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('c4170000-5dd4-0015-2ef5-08dcda5963c9', '8701', 'Attendance fees', true, 'c4170000-5dd4-0015-3ad1-08dcda5963c9', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('c4170000-5dd4-0015-c838-08dcda5963c9', '7920', 'Gains on sale of buildings', true, 'c4170000-5dd4-0015-d027-08dcda5963c9', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('a05e0000-5dd4-0015-19fc-08dcda59fa1b', '8012', 'Exceptional depreciation', true, 'a05e0000-5dd4-0015-389b-08dcda59fa22', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('a05e0000-5dd4-0015-f4ef-08dcda59fa27', '8014', 'Exceptional losses on disposal of fixed assets', true, 'a05e0000-5dd4-0015-3a9c-08dcda59fa28', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('a05e0000-5dd4-0015-da5d-08dcda59fa28', '8015', 'Exceptional losses on receivables', true, 'a05e0000-5dd4-0015-deda-08dcda59fa28', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('a05e0000-5dd4-0015-5cb3-08dcda59fa29', '8016', 'Expenses for compensation for damages', true, 'a05e0000-5dd4-0015-6165-08dcda59fa29', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('a05e0000-5dd4-0015-febe-08dcda59fa29', '8510', 'Mortgage interest', true, 'a05e0000-5dd4-0015-0397-08dcda59fa2a', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('a05e0000-5dd4-0015-8315-08dcda59fa2a', '8511', 'Building maintenance', true, 'a05e0000-5dd4-0015-8940-08dcda59fa2a', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('a05e0000-5dd4-0015-0e41-08dcda59fa2b', '8512', 'Property rights, taxes, land taxes', true, 'a05e0000-5dd4-0015-13ce-08dcda59fa2b', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('a05e0000-5dd4-0015-923c-08dcda59fa2b', '8513', 'Insurance premiums', true, 'a05e0000-5dd4-0015-9902-08dcda59fa2b', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('a05e0000-5dd4-0015-3db9-08dcda59fa2c', '8514', 'Water, wastewater', true, 'a05e0000-5dd4-0015-448c-08dcda59fa2c', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('a05e0000-5dd4-0015-c462-08dcda59fa2c', '8515', 'Waste disposal', true, 'a05e0000-5dd4-0015-cbf4-08dcda59fa2c', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('a05e0000-5dd4-0015-4669-08dcda59fa2d', '8516', 'Administrative charges', true, 'a05e0000-5dd4-0015-4e9d-08dcda59fa2d', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('a05e0000-5dd4-0015-d67a-08dcda59fa2d', '8710', 'Expenses for non-operating activities', true, 'a05e0000-5dd4-0015-de33-08dcda59fa2d', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('a05e0000-5dd4-0015-87a2-08dcda59fa2e', '8900', 'Corporate income tax', true, 'a05e0000-5dd4-0015-8fcc-08dcda59fa2e', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('a05e0000-5dd4-0015-09cd-08dcda59fa2f', '8901', 'Capital tax', true, 'a05e0000-5dd4-0015-11fe-08dcda59fa2f', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('a05e0000-5dd4-0015-8e15-08dcda59fa2f', '8902', 'Back taxes', true, 'a05e0000-5dd4-0015-9681-08dcda59fa2f', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('a05e0000-5dd4-0015-1f87-08dcda59fa30', '8011', 'Exceptional provisions', true, 'a05e0000-5dd4-0015-2921-08dcda59fa30', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('b0650000-5dd4-0015-41aa-08dcda5af51e', '9100', 'Opening balance sheet', true, 'b0650000-5dd4-0015-785d-08dcda5af525', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('b0650000-5dd4-0015-188e-08dcda5af52b', '9101', 'Closing balance sheet', true, 'b0650000-5dd4-0015-5935-08dcda5af52b', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('b0650000-5dd4-0015-fc14-08dcda5af52b', '9200', 'Share of profit for partner X', true, 'b0650000-5dd4-0015-007d-08dcda5af52c', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('b0650000-5dd4-0015-8079-08dcda5af52c', '9201', 'Share of profit for partner Y', true, 'b0650000-5dd4-0015-84ff-08dcda5af52c', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('b0650000-5dd4-0015-2435-08dcda5af52d', '9900', 'Grouping entries for debtors', true, 'b0650000-5dd4-0015-28c0-08dcda5af52d', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('b0650000-5dd4-0015-a67e-08dcda5af52d', '9901', 'Grouping entries for creditors', true, 'b0650000-5dd4-0015-ac60-08dcda5af52d', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('b0650000-5dd4-0015-6c05-08dcda5af52e', '9910', 'Correction entry', true, 'b0650000-5dd4-0015-716d-08dcda5af52e', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('b0650000-5dd4-0015-233a-08dcda5af52f', '9000', 'Income statement', true, 'b0650000-5dd4-0015-2aac-08dcda5af52f', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.accounts (id, code, label, active, version, tenant_id) VALUES ('4c6f0000-5dd4-0015-cbc6-08dcda56e428', '3902', 'Refunds', true, 'b0650000-5dd4-0015-575d-08dcda67d032', '74a20000-088f-d0ad-7a4e-08dce86b0459'); diff --git a/src/Ubik.Accounting.Transaction.Api/Data/Init/DbInitializer.cs b/src/Ubik.Accounting.Transaction.Api/Data/Init/DbInitializer.cs new file mode 100644 index 00000000..4cd74d71 --- /dev/null +++ b/src/Ubik.Accounting.Transaction.Api/Data/Init/DbInitializer.cs @@ -0,0 +1,10 @@ +namespace Ubik.Accounting.Transaction.Api.Data.Init +{ + static internal class DbInitializer + { + static internal async Task InitializeAsync(AccountingTxContext context) + { + await AccountsData.LoadAsync(context); + } + } +} diff --git a/src/Ubik.Accounting.Transaction.Api/Program.cs b/src/Ubik.Accounting.Transaction.Api/Program.cs index a213fe05..20e5537f 100644 --- a/src/Ubik.Accounting.Transaction.Api/Program.cs +++ b/src/Ubik.Accounting.Transaction.Api/Program.cs @@ -5,6 +5,7 @@ using System.Reflection; using System.Text.Json.Serialization; using Ubik.Accounting.Transaction.Api.Data; +using Ubik.Accounting.Transaction.Api.Data.Init; using Ubik.Accounting.Transaction.Api.Features.Accounts.Services; using Ubik.ApiService.Common.Configure; using Ubik.ApiService.Common.Configure.Options; @@ -123,7 +124,7 @@ context.Database.EnsureDeleted(); context.Database.EnsureCreated(); - //await DbInitializer.InitializeAsync(context); + await DbInitializer.InitializeAsync(context); } app.UseWhen( diff --git a/src/Ubik.Accounting.Transaction.Api/Ubik.Accounting.Transaction.Api.csproj b/src/Ubik.Accounting.Transaction.Api/Ubik.Accounting.Transaction.Api.csproj index 1927f287..621fcdf5 100644 --- a/src/Ubik.Accounting.Transaction.Api/Ubik.Accounting.Transaction.Api.csproj +++ b/src/Ubik.Accounting.Transaction.Api/Ubik.Accounting.Transaction.Api.csproj @@ -23,8 +23,13 @@ - + + + Always + + + From 2d3495a091c4399ac7b6167c455eaae20ccd7f85 Mon Sep 17 00:00:00 2001 From: fdonnet Date: Wed, 6 Nov 2024 15:09:38 +0100 Subject: [PATCH 52/94] TaxRate in transaction API --- .../Data/AccountingTxContext.cs | 5 ++++ .../Data/Config/TaxRateConfiguration.cs | 30 +++++++++++++++++++ .../Data/Init/DbInitializer.cs | 1 + .../Data/Init/TaxRatesData.cs | 17 +++++++++++ .../Data/Init/TaxRatesData.sql | 5 ++++ .../Ubik.Accounting.Transaction.Api.csproj | 3 ++ 6 files changed, 61 insertions(+) create mode 100644 src/Ubik.Accounting.Transaction.Api/Data/Config/TaxRateConfiguration.cs create mode 100644 src/Ubik.Accounting.Transaction.Api/Data/Init/TaxRatesData.cs create mode 100644 src/Ubik.Accounting.Transaction.Api/Data/Init/TaxRatesData.sql diff --git a/src/Ubik.Accounting.Transaction.Api/Data/AccountingTxContext.cs b/src/Ubik.Accounting.Transaction.Api/Data/AccountingTxContext.cs index b74f537e..04638fe1 100644 --- a/src/Ubik.Accounting.Transaction.Api/Data/AccountingTxContext.cs +++ b/src/Ubik.Accounting.Transaction.Api/Data/AccountingTxContext.cs @@ -14,6 +14,7 @@ public class AccountingTxContext(DbContextOptions options { public DbSet Entries { get; set; } public DbSet Accounts { get; set; } + public DbSet TaxRates { get; set; } protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) { @@ -64,6 +65,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) //Configure new EntryConfiguration().Configure(modelBuilder.Entity()); new AccountConfiguration().Configure(modelBuilder.Entity()); + new TaxRateConfiguration().Configure(modelBuilder.Entity()); //new AccountGroupConfiguration().Configure(modelBuilder.Entity()); //new AccountConfiguration().Configure(modelBuilder.Entity()); //new AccountAccountGroupConfiguration().Configure(modelBuilder.Entity()); @@ -82,6 +84,9 @@ private void SetTenantId(ModelBuilder modelBuilder) modelBuilder.Entity() .HasQueryFilter(mt => mt.TenantId == userService.TenantId); + modelBuilder.Entity() + .HasQueryFilter(mt => mt.TenantId == userService.TenantId); + //modelBuilder.Entity() // .HasQueryFilter(mt => mt.TenantId == _currentUser.TenantId); diff --git a/src/Ubik.Accounting.Transaction.Api/Data/Config/TaxRateConfiguration.cs b/src/Ubik.Accounting.Transaction.Api/Data/Config/TaxRateConfiguration.cs new file mode 100644 index 00000000..027fdf71 --- /dev/null +++ b/src/Ubik.Accounting.Transaction.Api/Data/Config/TaxRateConfiguration.cs @@ -0,0 +1,30 @@ +using Microsoft.EntityFrameworkCore.Metadata.Builders; +using Microsoft.EntityFrameworkCore; +using Ubik.Accounting.Transaction.Api.Models; + +namespace Ubik.Accounting.Transaction.Api.Data.Config +{ + public class TaxRateConfiguration : IEntityTypeConfiguration + { + public void Configure(EntityTypeBuilder builder) + { + builder.Property(a => a.Code) + .HasMaxLength(20) + .IsRequired(); + + builder.Property(a => a.Rate) + .HasPrecision(8, 5); + + builder.Property(a => a.Version) + .IsConcurrencyToken(); + + builder.Property(a => a.TenantId) + .IsRequired(); + + builder.HasIndex(a => new { a.Code, a.TenantId }) + .IsUnique(); + + builder.HasIndex(a => a.TenantId); + } + } +} diff --git a/src/Ubik.Accounting.Transaction.Api/Data/Init/DbInitializer.cs b/src/Ubik.Accounting.Transaction.Api/Data/Init/DbInitializer.cs index 4cd74d71..55300164 100644 --- a/src/Ubik.Accounting.Transaction.Api/Data/Init/DbInitializer.cs +++ b/src/Ubik.Accounting.Transaction.Api/Data/Init/DbInitializer.cs @@ -5,6 +5,7 @@ static internal class DbInitializer static internal async Task InitializeAsync(AccountingTxContext context) { await AccountsData.LoadAsync(context); + await TaxRatesData.LoadAsync(context); } } } diff --git a/src/Ubik.Accounting.Transaction.Api/Data/Init/TaxRatesData.cs b/src/Ubik.Accounting.Transaction.Api/Data/Init/TaxRatesData.cs new file mode 100644 index 00000000..8b8d5cc5 --- /dev/null +++ b/src/Ubik.Accounting.Transaction.Api/Data/Init/TaxRatesData.cs @@ -0,0 +1,17 @@ +using Microsoft.EntityFrameworkCore; +using System.Runtime.CompilerServices; + +namespace Ubik.Accounting.Transaction.Api.Data.Init +{ + internal static class TaxRatesData + { + internal static async Task LoadAsync(AccountingTxContext context) + { + if (!context.TaxRates.Any()) + { + var query = await File.ReadAllTextAsync(@"Data/Init/TaxRatesData.sql"); + await context.Database.ExecuteSqlAsync(FormattableStringFactory.Create(query)); + } + } + } +} diff --git a/src/Ubik.Accounting.Transaction.Api/Data/Init/TaxRatesData.sql b/src/Ubik.Accounting.Transaction.Api/Data/Init/TaxRatesData.sql new file mode 100644 index 00000000..28b8ec44 --- /dev/null +++ b/src/Ubik.Accounting.Transaction.Api/Data/Init/TaxRatesData.sql @@ -0,0 +1,5 @@ +INSERT INTO public.tax_rates (id, code, rate, version, tenant_id) VALUES ('08740000-3c36-7456-6f96-08dcfb48b915', 'v81', 8.10000, '08740000-3c36-7456-e579-08dcfb48b921', '74a20000-088f-d0ad-7a4e-08dce86b0459' ); +INSERT INTO public.tax_rates (id, code, rate, version, tenant_id) VALUES ('08740000-3c36-7456-dc84-08dcfb48d62d', 'v38', 3.80000, '08740000-3c36-7456-e8f3-08dcfb48d62d', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.tax_rates (id, code, rate, version, tenant_id) VALUES ('08740000-3c36-7456-8815-08dcfb48e185', 'v26', 2.60000, '08740000-3c36-7456-a29b-08dcfb48e185', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.tax_rates (id, code, rate, version, tenant_id) VALUES ('e4220000-3c36-7456-212b-08dcfb4a3d2b', 'v211', 2.60000, 'e4220000-3c36-7456-6f15-08dcfb4a3d37', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.tax_rates (id, code, rate, version, tenant_id) VALUES ('e4220000-3c36-7456-d3e1-08dcfb4a4b65', 'v212', 2.60000, 'e4220000-3c36-7456-088c-08dcfb4a4b66', '74a20000-088f-d0ad-7a4e-08dce86b0459'); diff --git a/src/Ubik.Accounting.Transaction.Api/Ubik.Accounting.Transaction.Api.csproj b/src/Ubik.Accounting.Transaction.Api/Ubik.Accounting.Transaction.Api.csproj index 621fcdf5..dbfcbda0 100644 --- a/src/Ubik.Accounting.Transaction.Api/Ubik.Accounting.Transaction.Api.csproj +++ b/src/Ubik.Accounting.Transaction.Api/Ubik.Accounting.Transaction.Api.csproj @@ -30,6 +30,9 @@ Always + + Always + From 7005de0b41d67bc14b452f819732c7f17c20af90 Mon Sep 17 00:00:00 2001 From: fdonnet Date: Wed, 6 Nov 2024 15:34:45 +0100 Subject: [PATCH 53/94] Rename typo --- .../{AmountAdditionnalInfo.cs => AmountAdditionalInfo.cs} | 6 +++--- src/Ubik.Accounting.Transaction.Api/Models/Entry.cs | 2 +- .../Ubik.Accounting.Transaction.Api.csproj | 2 ++ 3 files changed, 6 insertions(+), 4 deletions(-) rename src/Ubik.Accounting.Transaction.Api/Models/{AmountAdditionnalInfo.cs => AmountAdditionalInfo.cs} (84%) diff --git a/src/Ubik.Accounting.Transaction.Api/Models/AmountAdditionnalInfo.cs b/src/Ubik.Accounting.Transaction.Api/Models/AmountAdditionalInfo.cs similarity index 84% rename from src/Ubik.Accounting.Transaction.Api/Models/AmountAdditionnalInfo.cs rename to src/Ubik.Accounting.Transaction.Api/Models/AmountAdditionalInfo.cs index bdef5c5a..293907cd 100644 --- a/src/Ubik.Accounting.Transaction.Api/Models/AmountAdditionnalInfo.cs +++ b/src/Ubik.Accounting.Transaction.Api/Models/AmountAdditionalInfo.cs @@ -1,6 +1,6 @@ namespace Ubik.Accounting.Transaction.Api.Models { - public class AmountAdditionnalInfo + public class AmountAdditionalInfo { private decimal? _originalAmount; public decimal OriginalAmount @@ -23,14 +23,14 @@ public decimal ExchangeRate private set => _exchangeRate = value; } - public AmountAdditionnalInfo(decimal originalAmount, Guid originalCurrencyId, decimal exchangeRate) + public AmountAdditionalInfo(decimal originalAmount, Guid originalCurrencyId, decimal exchangeRate) { _originalAmount = originalAmount; _originalCurrencyId = originalCurrencyId; _exchangeRate = exchangeRate; } - private AmountAdditionnalInfo() + private AmountAdditionalInfo() { } } diff --git a/src/Ubik.Accounting.Transaction.Api/Models/Entry.cs b/src/Ubik.Accounting.Transaction.Api/Models/Entry.cs index f18b528b..bd5cfed4 100644 --- a/src/Ubik.Accounting.Transaction.Api/Models/Entry.cs +++ b/src/Ubik.Accounting.Transaction.Api/Models/Entry.cs @@ -16,7 +16,7 @@ public class Entry : ITenantEntity, IConcurrencyCheckEntity, IAuditEntity public string? Description { get; set; } //See if we want the amount with or without VAT public required decimal Amount { get; set; } - public AmountAdditionnalInfo? AmountAdditionnalInfo { get; set; } + public AmountAdditionalInfo? AmountAdditionnalInfo { get; set; } public TaxInfo? TaxInfo { get; set; } = default!; public Guid Version { get; set; } public Guid TenantId { get; set; } diff --git a/src/Ubik.Accounting.Transaction.Api/Ubik.Accounting.Transaction.Api.csproj b/src/Ubik.Accounting.Transaction.Api/Ubik.Accounting.Transaction.Api.csproj index dbfcbda0..d5794ca3 100644 --- a/src/Ubik.Accounting.Transaction.Api/Ubik.Accounting.Transaction.Api.csproj +++ b/src/Ubik.Accounting.Transaction.Api/Ubik.Accounting.Transaction.Api.csproj @@ -24,6 +24,8 @@ + + From 0e9547eb7066c67787b8ba980f0016dd0013b3f1 Mon Sep 17 00:00:00 2001 From: fdonnet Date: Wed, 6 Nov 2024 16:48:03 +0100 Subject: [PATCH 54/94] Some progress rename --- .../Controllers/v1/TaxRatesController.cs | 2 +- .../Services/ITaxRateCommandService.cs | 2 +- .../Services/TaxRateCommandService.cs | 2 +- .../Mappers/TaxRateMappers.cs | 2 +- .../Events/SalesOrVatTaxRateDeleted.cs | 7 ----- .../Commands/AddTaxRateCommand.cs} | 4 +-- .../Commands/UpdateTaxRateCommand.cs} | 4 +-- .../Events/TaxRateAdded.cs} | 4 +-- .../TaxRates/Events/TaxRateDeleted.cs | 7 +++++ .../Events/TaxRateUpdated.cs} | 4 +-- .../SalesOrVatTaxRateStandardResult.cs | 2 +- .../Services/ITaxRateCommandService.cs | 11 +++++++ .../Services/TaxRateCommandService.cs | 30 +++++++++++++++++++ .../Program.cs | 2 ++ .../Ubik.Accounting.Transaction.Api.csproj | 1 - .../TaxRates/TaxRatesController_Test.cs | 14 ++++----- 16 files changed, 70 insertions(+), 28 deletions(-) delete mode 100644 src/Ubik.Accounting.SalesOrVatTax.Contracts/SalesOrVatTaxRate/Events/SalesOrVatTaxRateDeleted.cs rename src/Ubik.Accounting.SalesOrVatTax.Contracts/{SalesOrVatTaxRate/Commands/AddSalesOrVatTaxRateCommand.cs => TaxRates/Commands/AddTaxRateCommand.cs} (77%) rename src/Ubik.Accounting.SalesOrVatTax.Contracts/{SalesOrVatTaxRate/Commands/UpdateSalesOrVatTaxRateCommand.cs => TaxRates/Commands/UpdateTaxRateCommand.cs} (80%) rename src/Ubik.Accounting.SalesOrVatTax.Contracts/{SalesOrVatTaxRate/Events/SalesOrVatTaxRateAdded.cs => TaxRates/Events/TaxRateAdded.cs} (73%) create mode 100644 src/Ubik.Accounting.SalesOrVatTax.Contracts/TaxRates/Events/TaxRateDeleted.cs rename src/Ubik.Accounting.SalesOrVatTax.Contracts/{SalesOrVatTaxRate/Events/SalesOrVatTaxRateUpdated.cs => TaxRates/Events/TaxRateUpdated.cs} (73%) rename src/Ubik.Accounting.SalesOrVatTax.Contracts/{SalesOrVatTaxRate => TaxRates}/Results/SalesOrVatTaxRateStandardResult.cs (83%) create mode 100644 src/Ubik.Accounting.Transaction.Api/Features/TaxRates/Services/ITaxRateCommandService.cs create mode 100644 src/Ubik.Accounting.Transaction.Api/Features/TaxRates/Services/TaxRateCommandService.cs diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Features/TaxRates/Controllers/v1/TaxRatesController.cs b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/TaxRates/Controllers/v1/TaxRatesController.cs index be841b90..be1b03fe 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Api/Features/TaxRates/Controllers/v1/TaxRatesController.cs +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/TaxRates/Controllers/v1/TaxRatesController.cs @@ -42,7 +42,7 @@ public async Task> Get(Guid id) [ProducesResponseType(typeof(CustomProblemDetails), 400)] [ProducesResponseType(typeof(CustomProblemDetails), 409)] [ProducesResponseType(typeof(CustomProblemDetails), 500)] - public async Task> AddAsync(AddSalesOrVatTaxRateCommand command) + public async Task> AddAsync(TaxRateCommand command) { var result = await commandService.AddAsync(command); diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Features/TaxRates/Services/ITaxRateCommandService.cs b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/TaxRates/Services/ITaxRateCommandService.cs index eb48d4f5..44d8b868 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Api/Features/TaxRates/Services/ITaxRateCommandService.cs +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/TaxRates/Services/ITaxRateCommandService.cs @@ -7,7 +7,7 @@ namespace Ubik.Accounting.SalesOrVatTax.Api.Features.TaxRates.Services { public interface ITaxRateCommandService { - public Task> AddAsync(AddSalesOrVatTaxRateCommand command); + public Task> AddAsync(TaxRateCommand command); public Task> UpdateAsync(UpdateSalesOrVatTaxRateCommand command); public Task> DeleteAsync(Guid id); } diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Features/TaxRates/Services/TaxRateCommandService.cs b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/TaxRates/Services/TaxRateCommandService.cs index 2096aac7..cca83be7 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Api/Features/TaxRates/Services/TaxRateCommandService.cs +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/TaxRates/Services/TaxRateCommandService.cs @@ -13,7 +13,7 @@ namespace Ubik.Accounting.SalesOrVatTax.Api.Features.TaxRates.Services { public class TaxRateCommandService(AccountingSalesTaxDbContext ctx, IPublishEndpoint publishEndpoint) : ITaxRateCommandService { - public async Task> AddAsync(AddSalesOrVatTaxRateCommand command) + public async Task> AddAsync(TaxRateCommand command) { return await ValidateIfNotAlreadyExistsAsync(command.ToSalesOrVatTaxRate()) .BindAsync(AddInDbContextAsync) diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Mappers/TaxRateMappers.cs b/src/Ubik.Accounting.SalesOrVatTax.Api/Mappers/TaxRateMappers.cs index 69b73c07..0aa64c47 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Api/Mappers/TaxRateMappers.cs +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Mappers/TaxRateMappers.cs @@ -21,7 +21,7 @@ public static IEnumerable ToSalesOrVatTaxRateSt }); } - public static TaxRate ToSalesOrVatTaxRate(this AddSalesOrVatTaxRateCommand current) + public static TaxRate ToSalesOrVatTaxRate(this TaxRateCommand current) { return new TaxRate { diff --git a/src/Ubik.Accounting.SalesOrVatTax.Contracts/SalesOrVatTaxRate/Events/SalesOrVatTaxRateDeleted.cs b/src/Ubik.Accounting.SalesOrVatTax.Contracts/SalesOrVatTaxRate/Events/SalesOrVatTaxRateDeleted.cs deleted file mode 100644 index 568d28e8..00000000 --- a/src/Ubik.Accounting.SalesOrVatTax.Contracts/SalesOrVatTaxRate/Events/SalesOrVatTaxRateDeleted.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace Ubik.Accounting.SalesOrVatTax.Contracts.SalesOrVatTaxRate.Events -{ - public record SalesOrVatTaxRateDeleted - { - public Guid Id { get; init; } - } -} diff --git a/src/Ubik.Accounting.SalesOrVatTax.Contracts/SalesOrVatTaxRate/Commands/AddSalesOrVatTaxRateCommand.cs b/src/Ubik.Accounting.SalesOrVatTax.Contracts/TaxRates/Commands/AddTaxRateCommand.cs similarity index 77% rename from src/Ubik.Accounting.SalesOrVatTax.Contracts/SalesOrVatTaxRate/Commands/AddSalesOrVatTaxRateCommand.cs rename to src/Ubik.Accounting.SalesOrVatTax.Contracts/TaxRates/Commands/AddTaxRateCommand.cs index b1080254..8e03a706 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Contracts/SalesOrVatTaxRate/Commands/AddSalesOrVatTaxRateCommand.cs +++ b/src/Ubik.Accounting.SalesOrVatTax.Contracts/TaxRates/Commands/AddTaxRateCommand.cs @@ -1,8 +1,8 @@ using System.ComponentModel.DataAnnotations; -namespace Ubik.Accounting.SalesOrVatTax.Contracts.SalesOrVatTaxRate.Commands +namespace Ubik.Accounting.SalesOrVatTax.Contracts.TaxRates.Commands { - public record AddSalesOrVatTaxRateCommand + public record AddTaxRateCommand { [Required] public DateOnly ValidFrom { get; init; } diff --git a/src/Ubik.Accounting.SalesOrVatTax.Contracts/SalesOrVatTaxRate/Commands/UpdateSalesOrVatTaxRateCommand.cs b/src/Ubik.Accounting.SalesOrVatTax.Contracts/TaxRates/Commands/UpdateTaxRateCommand.cs similarity index 80% rename from src/Ubik.Accounting.SalesOrVatTax.Contracts/SalesOrVatTaxRate/Commands/UpdateSalesOrVatTaxRateCommand.cs rename to src/Ubik.Accounting.SalesOrVatTax.Contracts/TaxRates/Commands/UpdateTaxRateCommand.cs index 627905e6..a8f30216 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Contracts/SalesOrVatTaxRate/Commands/UpdateSalesOrVatTaxRateCommand.cs +++ b/src/Ubik.Accounting.SalesOrVatTax.Contracts/TaxRates/Commands/UpdateTaxRateCommand.cs @@ -1,8 +1,8 @@ using System.ComponentModel.DataAnnotations; -namespace Ubik.Accounting.SalesOrVatTax.Contracts.SalesOrVatTaxRate.Commands +namespace Ubik.Accounting.SalesOrVatTax.Contracts.TaxRates.Commands { - public record UpdateSalesOrVatTaxRateCommand + public record UpdateTaxRateCommand { [Required] public Guid Id { get; init; } diff --git a/src/Ubik.Accounting.SalesOrVatTax.Contracts/SalesOrVatTaxRate/Events/SalesOrVatTaxRateAdded.cs b/src/Ubik.Accounting.SalesOrVatTax.Contracts/TaxRates/Events/TaxRateAdded.cs similarity index 73% rename from src/Ubik.Accounting.SalesOrVatTax.Contracts/SalesOrVatTaxRate/Events/SalesOrVatTaxRateAdded.cs rename to src/Ubik.Accounting.SalesOrVatTax.Contracts/TaxRates/Events/TaxRateAdded.cs index 2a34abcf..742d5294 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Contracts/SalesOrVatTaxRate/Events/SalesOrVatTaxRateAdded.cs +++ b/src/Ubik.Accounting.SalesOrVatTax.Contracts/TaxRates/Events/TaxRateAdded.cs @@ -1,6 +1,6 @@ -namespace Ubik.Accounting.SalesOrVatTax.Contracts.SalesOrVatTaxRate.Events +namespace Ubik.Accounting.SalesOrVatTax.Contracts.TaxRates.Events { - public record SalesOrVatTaxRateAdded + public record TaxRateAdded { public Guid Id { get; init; } public DateOnly ValidFrom { get; init; } diff --git a/src/Ubik.Accounting.SalesOrVatTax.Contracts/TaxRates/Events/TaxRateDeleted.cs b/src/Ubik.Accounting.SalesOrVatTax.Contracts/TaxRates/Events/TaxRateDeleted.cs new file mode 100644 index 00000000..16f161f1 --- /dev/null +++ b/src/Ubik.Accounting.SalesOrVatTax.Contracts/TaxRates/Events/TaxRateDeleted.cs @@ -0,0 +1,7 @@ +namespace Ubik.Accounting.SalesOrVatTax.Contracts.TaxRates.Events +{ + public record TaxRateDeleted + { + public Guid Id { get; init; } + } +} diff --git a/src/Ubik.Accounting.SalesOrVatTax.Contracts/SalesOrVatTaxRate/Events/SalesOrVatTaxRateUpdated.cs b/src/Ubik.Accounting.SalesOrVatTax.Contracts/TaxRates/Events/TaxRateUpdated.cs similarity index 73% rename from src/Ubik.Accounting.SalesOrVatTax.Contracts/SalesOrVatTaxRate/Events/SalesOrVatTaxRateUpdated.cs rename to src/Ubik.Accounting.SalesOrVatTax.Contracts/TaxRates/Events/TaxRateUpdated.cs index 11ca1f34..4270e1dd 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Contracts/SalesOrVatTaxRate/Events/SalesOrVatTaxRateUpdated.cs +++ b/src/Ubik.Accounting.SalesOrVatTax.Contracts/TaxRates/Events/TaxRateUpdated.cs @@ -1,6 +1,6 @@ -namespace Ubik.Accounting.SalesOrVatTax.Contracts.SalesOrVatTaxRate.Events +namespace Ubik.Accounting.SalesOrVatTax.Contracts.TaxRates.Events { - public record SalesOrVatTaxRateUpdated + public record TaxRateUpdated { public Guid Id { get; init; } public DateOnly ValidFrom { get; init; } diff --git a/src/Ubik.Accounting.SalesOrVatTax.Contracts/SalesOrVatTaxRate/Results/SalesOrVatTaxRateStandardResult.cs b/src/Ubik.Accounting.SalesOrVatTax.Contracts/TaxRates/Results/SalesOrVatTaxRateStandardResult.cs similarity index 83% rename from src/Ubik.Accounting.SalesOrVatTax.Contracts/SalesOrVatTaxRate/Results/SalesOrVatTaxRateStandardResult.cs rename to src/Ubik.Accounting.SalesOrVatTax.Contracts/TaxRates/Results/SalesOrVatTaxRateStandardResult.cs index d6c5c078..ad18ce68 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Contracts/SalesOrVatTaxRate/Results/SalesOrVatTaxRateStandardResult.cs +++ b/src/Ubik.Accounting.SalesOrVatTax.Contracts/TaxRates/Results/SalesOrVatTaxRateStandardResult.cs @@ -1,4 +1,4 @@ -namespace Ubik.Accounting.SalesOrVatTax.Contracts.SalesOrVatTaxRate.Results +namespace Ubik.Accounting.SalesOrVatTax.Contracts.TaxRates.Results { public record SalesOrVatTaxRateStandardResult { diff --git a/src/Ubik.Accounting.Transaction.Api/Features/TaxRates/Services/ITaxRateCommandService.cs b/src/Ubik.Accounting.Transaction.Api/Features/TaxRates/Services/ITaxRateCommandService.cs new file mode 100644 index 00000000..06b3333f --- /dev/null +++ b/src/Ubik.Accounting.Transaction.Api/Features/TaxRates/Services/ITaxRateCommandService.cs @@ -0,0 +1,11 @@ +using Ubik.Accounting.Structure.Contracts.Accounts.Events; + +namespace Ubik.Accounting.Transaction.Api.Features.TaxRates.Services +{ + public interface ITaxRateCommandService + { + public Task AddAsync(AccountAdded accountAdded); + public Task UpdateAsync(AccountUpdated accountUpdated); + public Task DeleteAsync(Guid accountId); + } +} diff --git a/src/Ubik.Accounting.Transaction.Api/Features/TaxRates/Services/TaxRateCommandService.cs b/src/Ubik.Accounting.Transaction.Api/Features/TaxRates/Services/TaxRateCommandService.cs new file mode 100644 index 00000000..c116efa6 --- /dev/null +++ b/src/Ubik.Accounting.Transaction.Api/Features/TaxRates/Services/TaxRateCommandService.cs @@ -0,0 +1,30 @@ +using Microsoft.EntityFrameworkCore; +using Ubik.Accounting.Structure.Contracts.Accounts.Events; +using Ubik.Accounting.Transaction.Api.Data; +using Ubik.Accounting.Transaction.Api.Mappers; + +namespace Ubik.Accounting.Transaction.Api.Features.TaxRates.Services +{ + public class TaxRateCommandService(AccountingTxContext ctx) : ITaxRateCommandService + { + public async Task AddAsync(TaxRateAdded accountAdded) + { + await ctx.Accounts.AddAsync(accountAdded.ToAccount()); + await ctx.SaveChangesAsync(); + } + + public async Task DeleteAsync(Guid accountId) + { + await ctx.Accounts.Where(a => a.Id == accountId).ExecuteDeleteAsync(); + } + + public async Task UpdateAsync(AccountUpdated accountUpdated) + { + await ctx.Accounts.Where(a => a.Id == accountUpdated.Id).ExecuteUpdateAsync(setters => setters + .SetProperty(b => b.Active, accountUpdated.Active) + .SetProperty(b => b.Version, accountUpdated.Version) + .SetProperty(b => b.Code, accountUpdated.Code) + .SetProperty(b => b.Label, accountUpdated.Label)); + } + } +} diff --git a/src/Ubik.Accounting.Transaction.Api/Program.cs b/src/Ubik.Accounting.Transaction.Api/Program.cs index 20e5537f..e20994c9 100644 --- a/src/Ubik.Accounting.Transaction.Api/Program.cs +++ b/src/Ubik.Accounting.Transaction.Api/Program.cs @@ -7,6 +7,7 @@ using Ubik.Accounting.Transaction.Api.Data; using Ubik.Accounting.Transaction.Api.Data.Init; using Ubik.Accounting.Transaction.Api.Features.Accounts.Services; +using Ubik.Accounting.Transaction.Api.Features.TaxRates.Services; using Ubik.ApiService.Common.Configure; using Ubik.ApiService.Common.Configure.Options; using Ubik.ApiService.Common.Exceptions; @@ -82,6 +83,7 @@ //Services builder.Services.AddScoped(); builder.Services.AddScoped(); +builder.Services.AddScoped(); builder.Services.AddTransient(); builder.Services.AddTracingAndMetrics(); diff --git a/src/Ubik.Accounting.Transaction.Api/Ubik.Accounting.Transaction.Api.csproj b/src/Ubik.Accounting.Transaction.Api/Ubik.Accounting.Transaction.Api.csproj index d5794ca3..c6a5578a 100644 --- a/src/Ubik.Accounting.Transaction.Api/Ubik.Accounting.Transaction.Api.csproj +++ b/src/Ubik.Accounting.Transaction.Api/Ubik.Accounting.Transaction.Api.csproj @@ -25,7 +25,6 @@ - diff --git a/tests/Ubik.Api.Tests.Integration/Features/Accounting/SalesOrVatTax/TaxRates/TaxRatesController_Test.cs b/tests/Ubik.Api.Tests.Integration/Features/Accounting/SalesOrVatTax/TaxRates/TaxRatesController_Test.cs index 820bc023..cea83746 100644 --- a/tests/Ubik.Api.Tests.Integration/Features/Accounting/SalesOrVatTax/TaxRates/TaxRatesController_Test.cs +++ b/tests/Ubik.Api.Tests.Integration/Features/Accounting/SalesOrVatTax/TaxRates/TaxRatesController_Test.cs @@ -235,7 +235,7 @@ public async Task Add_TaxRate_WithRW_OK() var token = await GetAccessTokenAsync(TokenType.RW); _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); - var command = new AddSalesOrVatTaxRateCommand + var command = new TaxRateCommand { Code = "Test", Description = "Description", @@ -264,7 +264,7 @@ public async Task Add_TaxRate_WithAlreadyExists_409() var token = await GetAccessTokenAsync(TokenType.RW); _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); - var command = new AddSalesOrVatTaxRateCommand + var command = new TaxRateCommand { Code = "v81", Description = "Description", @@ -293,7 +293,7 @@ public async Task Add_TaxRate_WithRO_403() var token = await GetAccessTokenAsync(TokenType.RO); _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); - var command = new AddSalesOrVatTaxRateCommand + var command = new TaxRateCommand { Code = "Test", Description = "Description", @@ -313,7 +313,7 @@ public async Task Add_TaxRate_WithRO_403() public async Task Add_TaxRate_WithNoToken_401() { //Arrange - var command = new AddSalesOrVatTaxRateCommand + var command = new TaxRateCommand { Code = "Test", Description = "Description", @@ -336,7 +336,7 @@ public async Task Add_TaxRate_WithAdmin_403() var token = await GetAccessTokenAsync(TokenType.MegaAdmin); _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); - var command = new AddSalesOrVatTaxRateCommand + var command = new TaxRateCommand { Code = "Test", Description = "Description", @@ -359,7 +359,7 @@ public async Task Add_TaxRate_WithOtherTenant_OK() var token = await GetAccessTokenAsync(TokenType.OtherTenant); _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); - var command = new AddSalesOrVatTaxRateCommand + var command = new TaxRateCommand { Code = "Test", Description = "Description", @@ -387,7 +387,7 @@ public async Task Add_TaxRate_WithNoRole_403() var token = await GetAccessTokenAsync(TokenType.NoRole); _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); - var command = new AddSalesOrVatTaxRateCommand + var command = new TaxRateCommand { Code = "Test", Description = "Description", From 576cff89c8fe5cda259326ec066984751eca797b Mon Sep 17 00:00:00 2001 From: fdonnet Date: Wed, 6 Nov 2024 17:49:11 +0100 Subject: [PATCH 55/94] Renaming --- .../Controllers/v1/TaxRatesController.cs | 20 ++--- .../Services/ITaxRateCommandService.cs | 6 +- .../Services/TaxRateCommandService.cs | 20 ++--- .../Mappers/AccountMappers.cs | 1 - .../Mappers/TaxRateMappers.cs | 28 +++---- .../Events/AccountTaxRateConfigAdded.cs | 1 + .../TaxRates/Events/TaxRateAdded.cs | 1 + .../TaxRates/Events/TaxRateUpdated.cs | 1 + ...dardResult.cs => TaxRateStandardResult.cs} | 2 +- .../Services/ITaxRateCommandService.cs | 7 +- .../Services/TaxRateCommandService.cs | 26 ++++--- .../Mappers/TaxRateMappers.cs | 20 +++++ .../Ubik.Accounting.Transaction.Api.csproj | 1 + .../TaxRates/TaxRatesController_Test.cs | 74 +++++++++---------- 14 files changed, 117 insertions(+), 91 deletions(-) rename src/Ubik.Accounting.SalesOrVatTax.Contracts/TaxRates/Results/{SalesOrVatTaxRateStandardResult.cs => TaxRateStandardResult.cs} (89%) create mode 100644 src/Ubik.Accounting.Transaction.Api/Mappers/TaxRateMappers.cs diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Features/TaxRates/Controllers/v1/TaxRatesController.cs b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/TaxRates/Controllers/v1/TaxRatesController.cs index be1b03fe..4df47eb6 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Api/Features/TaxRates/Controllers/v1/TaxRatesController.cs +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/TaxRates/Controllers/v1/TaxRatesController.cs @@ -2,8 +2,8 @@ using Microsoft.AspNetCore.Mvc; using Ubik.Accounting.SalesOrVatTax.Api.Features.TaxRates.Services; using Ubik.Accounting.SalesOrVatTax.Api.Mappers; -using Ubik.Accounting.SalesOrVatTax.Contracts.SalesOrVatTaxRate.Commands; -using Ubik.Accounting.SalesOrVatTax.Contracts.SalesOrVatTaxRate.Results; +using Ubik.Accounting.SalesOrVatTax.Contracts.TaxRates.Commands; +using Ubik.Accounting.SalesOrVatTax.Contracts.TaxRates.Results; using Ubik.ApiService.Common.Errors; using Ubik.ApiService.Common.Exceptions; @@ -18,9 +18,9 @@ public class TaxRatesController(ITaxRateCommandService commandService, ITaxRateQ [ProducesResponseType(200)] [ProducesResponseType(typeof(CustomProblemDetails), 400)] [ProducesResponseType(typeof(CustomProblemDetails), 500)] - public async Task>> GetAll() + public async Task>> GetAll() { - var results = (await queryService.GetAllAsync()).ToSalesOrVatTaxRateStandardResults(); + var results = (await queryService.GetAllAsync()).ToTaxRateStandardResults(); return Ok(results); } @@ -29,11 +29,11 @@ public async Task>> Ge [ProducesResponseType(typeof(CustomProblemDetails), 400)] [ProducesResponseType(typeof(CustomProblemDetails), 404)] [ProducesResponseType(typeof(CustomProblemDetails), 500)] - public async Task> Get(Guid id) + public async Task> Get(Guid id) { var result = await queryService.GetAsync(id); return result.Match( - Right: ok => Ok(ok.ToSalesOrVatTaxRateStandardResult()), + Right: ok => Ok(ok.ToTaxRateStandardResult()), Left: err => new ObjectResult(err.ToValidationProblemDetails(HttpContext))); } @@ -42,12 +42,12 @@ public async Task> Get(Guid id) [ProducesResponseType(typeof(CustomProblemDetails), 400)] [ProducesResponseType(typeof(CustomProblemDetails), 409)] [ProducesResponseType(typeof(CustomProblemDetails), 500)] - public async Task> AddAsync(TaxRateCommand command) + public async Task> AddAsync(AddTaxRateCommand command) { var result = await commandService.AddAsync(command); return result.Match( - Right: ok => CreatedAtAction(nameof(Get), new { id = ok.Id }, ok.ToSalesOrVatTaxRateStandardResult()), + Right: ok => CreatedAtAction(nameof(Get), new { id = ok.Id }, ok.ToTaxRateStandardResult()), Left: err => new ObjectResult(err.ToValidationProblemDetails(HttpContext))); } @@ -57,7 +57,7 @@ public async Task> AddAsync(TaxRat [ProducesResponseType(typeof(CustomProblemDetails), 404)] [ProducesResponseType(typeof(CustomProblemDetails), 409)] [ProducesResponseType(typeof(CustomProblemDetails), 500)] - public async Task> Update(Guid id, UpdateSalesOrVatTaxRateCommand command) + public async Task> Update(Guid id, UpdateTaxRateCommand command) { if (command.Id != id) return new ObjectResult(new ResourceIdNotMatchWithCommandError("TaxRate", id, command.Id) @@ -66,7 +66,7 @@ public async Task> Update(Guid id, var result = await commandService.UpdateAsync(command); return result.Match( - Right: ok => Ok(ok.ToSalesOrVatTaxRateStandardResult()), + Right: ok => Ok(ok.ToTaxRateStandardResult()), Left: err => new ObjectResult(err.ToValidationProblemDetails(HttpContext))); } diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Features/TaxRates/Services/ITaxRateCommandService.cs b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/TaxRates/Services/ITaxRateCommandService.cs index 44d8b868..b6f7f13a 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Api/Features/TaxRates/Services/ITaxRateCommandService.cs +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/TaxRates/Services/ITaxRateCommandService.cs @@ -1,14 +1,14 @@ using LanguageExt; using Ubik.Accounting.SalesOrVatTax.Api.Models; -using Ubik.Accounting.SalesOrVatTax.Contracts.SalesOrVatTaxRate.Commands; +using Ubik.Accounting.SalesOrVatTax.Contracts.TaxRates.Commands; using Ubik.ApiService.Common.Errors; namespace Ubik.Accounting.SalesOrVatTax.Api.Features.TaxRates.Services { public interface ITaxRateCommandService { - public Task> AddAsync(TaxRateCommand command); - public Task> UpdateAsync(UpdateSalesOrVatTaxRateCommand command); + public Task> AddAsync(AddTaxRateCommand command); + public Task> UpdateAsync(UpdateTaxRateCommand command); public Task> DeleteAsync(Guid id); } } diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Features/TaxRates/Services/TaxRateCommandService.cs b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/TaxRates/Services/TaxRateCommandService.cs index cca83be7..3a8390cd 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Api/Features/TaxRates/Services/TaxRateCommandService.cs +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/TaxRates/Services/TaxRateCommandService.cs @@ -5,24 +5,24 @@ using Ubik.ApiService.Common.Exceptions; using Ubik.Accounting.SalesOrVatTax.Api.Data; using Ubik.Accounting.SalesOrVatTax.Api.Models; -using Ubik.Accounting.SalesOrVatTax.Contracts.SalesOrVatTaxRate.Events; using Ubik.Accounting.SalesOrVatTax.Api.Mappers; -using Ubik.Accounting.SalesOrVatTax.Contracts.SalesOrVatTaxRate.Commands; +using Ubik.Accounting.SalesOrVatTax.Contracts.TaxRates.Commands; +using Ubik.Accounting.SalesOrVatTax.Contracts.TaxRates.Events; namespace Ubik.Accounting.SalesOrVatTax.Api.Features.TaxRates.Services { public class TaxRateCommandService(AccountingSalesTaxDbContext ctx, IPublishEndpoint publishEndpoint) : ITaxRateCommandService { - public async Task> AddAsync(TaxRateCommand command) + public async Task> AddAsync(AddTaxRateCommand command) { - return await ValidateIfNotAlreadyExistsAsync(command.ToSalesOrVatTaxRate()) + return await ValidateIfNotAlreadyExistsAsync(command.ToTaxRate()) .BindAsync(AddInDbContextAsync) .BindAsync(AddSaveAndPublishAsync); } - public async Task> UpdateAsync(UpdateSalesOrVatTaxRateCommand command) + public async Task> UpdateAsync(UpdateTaxRateCommand command) { - var model = command.ToSalesOrVatTaxRate(); + var model = command.ToTaxRate(); return await GetAsync(model.Id) .BindAsync(x => MapInDbContextAsync(x, model)) @@ -41,7 +41,7 @@ public async Task> DeleteAsync(Guid id) private async Task> DeletedSaveAndPublishAsync(TaxRate current) { - await publishEndpoint.Publish(new SalesOrVatTaxRateDeleted { Id = current.Id }, CancellationToken.None); + await publishEndpoint.Publish(new TaxRateDeleted { Id = current.Id }, CancellationToken.None); await ctx.SaveChangesAsync(); return true; @@ -59,7 +59,7 @@ private async Task> UpdateSaveAndPublishAsync(Tax { try { - await publishEndpoint.Publish(current.ToSalesOrVatTaxRateUpdated(), CancellationToken.None); + await publishEndpoint.Publish(current.ToTaxRateUpdated(), CancellationToken.None); await ctx.SaveChangesAsync(); return current; @@ -100,14 +100,14 @@ private async Task> ValidateIfNotAlreadyExistsWit private static async Task> MapInDbContextAsync (TaxRate current, TaxRate forUpdate) { - current = forUpdate.ToSalesOrVatTaxRate(current); + current = forUpdate.ToTaxRate(current); await Task.CompletedTask; return current; } private async Task> AddSaveAndPublishAsync(TaxRate current) { - await publishEndpoint.Publish(current.ToSalesOrVatTaxRateAdded(), CancellationToken.None); + await publishEndpoint.Publish(current.ToTaxRateAdded(), CancellationToken.None); await ctx.SaveChangesAsync(); return current; } diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Mappers/AccountMappers.cs b/src/Ubik.Accounting.SalesOrVatTax.Api/Mappers/AccountMappers.cs index efd94482..fe8ced6d 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Api/Mappers/AccountMappers.cs +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Mappers/AccountMappers.cs @@ -1,5 +1,4 @@ using Ubik.Accounting.SalesOrVatTax.Api.Models; -using Ubik.Accounting.SalesOrVatTax.Contracts.SalesOrVatTaxRate.Commands; using Ubik.Accounting.Structure.Contracts.Accounts.Events; namespace Ubik.Accounting.SalesOrVatTax.Api.Mappers diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Mappers/TaxRateMappers.cs b/src/Ubik.Accounting.SalesOrVatTax.Api/Mappers/TaxRateMappers.cs index 0aa64c47..1e6db02c 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Api/Mappers/TaxRateMappers.cs +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Mappers/TaxRateMappers.cs @@ -1,15 +1,15 @@ using Ubik.Accounting.SalesOrVatTax.Api.Models; -using Ubik.Accounting.SalesOrVatTax.Contracts.SalesOrVatTaxRate.Commands; -using Ubik.Accounting.SalesOrVatTax.Contracts.SalesOrVatTaxRate.Events; -using Ubik.Accounting.SalesOrVatTax.Contracts.SalesOrVatTaxRate.Results; +using Ubik.Accounting.SalesOrVatTax.Contracts.TaxRates.Commands; +using Ubik.Accounting.SalesOrVatTax.Contracts.TaxRates.Events; +using Ubik.Accounting.SalesOrVatTax.Contracts.TaxRates.Results; namespace Ubik.Accounting.SalesOrVatTax.Api.Mappers { public static class TaxRateMappers { - public static IEnumerable ToSalesOrVatTaxRateStandardResults(this IEnumerable current) + public static IEnumerable ToTaxRateStandardResults(this IEnumerable current) { - return current.Select(x => new SalesOrVatTaxRateStandardResult() + return current.Select(x => new TaxRateStandardResult() { Id = x.Id, ValidFrom = x.ValidFrom, @@ -21,7 +21,7 @@ public static IEnumerable ToSalesOrVatTaxRateSt }); } - public static TaxRate ToSalesOrVatTaxRate(this TaxRateCommand current) + public static TaxRate ToTaxRate(this AddTaxRateCommand current) { return new TaxRate { @@ -33,7 +33,7 @@ public static TaxRate ToSalesOrVatTaxRate(this TaxRateCommand current) }; } - public static TaxRate ToSalesOrVatTaxRate(this UpdateSalesOrVatTaxRateCommand current) + public static TaxRate ToTaxRate(this UpdateTaxRateCommand current) { return new TaxRate { @@ -47,9 +47,9 @@ public static TaxRate ToSalesOrVatTaxRate(this UpdateSalesOrVatTaxRateCommand cu }; } - public static SalesOrVatTaxRateAdded ToSalesOrVatTaxRateAdded(this TaxRate current) + public static TaxRateAdded ToTaxRateAdded(this TaxRate current) { - return new SalesOrVatTaxRateAdded() + return new TaxRateAdded() { Id = current.Id, ValidFrom = current.ValidFrom, @@ -61,9 +61,9 @@ public static SalesOrVatTaxRateAdded ToSalesOrVatTaxRateAdded(this TaxRate curre }; } - public static SalesOrVatTaxRateUpdated ToSalesOrVatTaxRateUpdated(this TaxRate current) + public static TaxRateUpdated ToTaxRateUpdated(this TaxRate current) { - return new SalesOrVatTaxRateUpdated() + return new TaxRateUpdated() { Id = current.Id, ValidFrom = current.ValidFrom, @@ -75,7 +75,7 @@ public static SalesOrVatTaxRateUpdated ToSalesOrVatTaxRateUpdated(this TaxRate c }; } - public static TaxRate ToSalesOrVatTaxRate(this TaxRate forUpd, TaxRate model) + public static TaxRate ToTaxRate(this TaxRate forUpd, TaxRate model) { model.Id = forUpd.Id; model.ValidFrom = forUpd.ValidFrom; @@ -88,9 +88,9 @@ public static TaxRate ToSalesOrVatTaxRate(this TaxRate forUpd, TaxRate model) return model; } - public static SalesOrVatTaxRateStandardResult ToSalesOrVatTaxRateStandardResult(this TaxRate current) + public static TaxRateStandardResult ToTaxRateStandardResult(this TaxRate current) { - return new SalesOrVatTaxRateStandardResult() + return new TaxRateStandardResult() { Id = current.Id, ValidFrom = current.ValidFrom, diff --git a/src/Ubik.Accounting.SalesOrVatTax.Contracts/AccountTaxRateConfigs/Events/AccountTaxRateConfigAdded.cs b/src/Ubik.Accounting.SalesOrVatTax.Contracts/AccountTaxRateConfigs/Events/AccountTaxRateConfigAdded.cs index 1c73ef43..3ffbae4f 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Contracts/AccountTaxRateConfigs/Events/AccountTaxRateConfigAdded.cs +++ b/src/Ubik.Accounting.SalesOrVatTax.Contracts/AccountTaxRateConfigs/Events/AccountTaxRateConfigAdded.cs @@ -7,5 +7,6 @@ public record AccountTaxRateConfigAdded public Guid TaxRateId { get; init; } public Guid TaxAccountId { get; init; } public Guid Version { get; init; } + public Guid TenantId { get; init; } } } diff --git a/src/Ubik.Accounting.SalesOrVatTax.Contracts/TaxRates/Events/TaxRateAdded.cs b/src/Ubik.Accounting.SalesOrVatTax.Contracts/TaxRates/Events/TaxRateAdded.cs index 742d5294..9359141f 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Contracts/TaxRates/Events/TaxRateAdded.cs +++ b/src/Ubik.Accounting.SalesOrVatTax.Contracts/TaxRates/Events/TaxRateAdded.cs @@ -9,5 +9,6 @@ public record TaxRateAdded public string? Description { get; init; } public Decimal Rate { get; init; } public Guid Version { get; init; } + public Guid TenantId { get; init; } } } diff --git a/src/Ubik.Accounting.SalesOrVatTax.Contracts/TaxRates/Events/TaxRateUpdated.cs b/src/Ubik.Accounting.SalesOrVatTax.Contracts/TaxRates/Events/TaxRateUpdated.cs index 4270e1dd..bf494e6b 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Contracts/TaxRates/Events/TaxRateUpdated.cs +++ b/src/Ubik.Accounting.SalesOrVatTax.Contracts/TaxRates/Events/TaxRateUpdated.cs @@ -9,5 +9,6 @@ public record TaxRateUpdated public string? Description { get; init; } public Decimal Rate { get; init; } public Guid Version { get; init; } + public Guid TenantId { get; init; } } } diff --git a/src/Ubik.Accounting.SalesOrVatTax.Contracts/TaxRates/Results/SalesOrVatTaxRateStandardResult.cs b/src/Ubik.Accounting.SalesOrVatTax.Contracts/TaxRates/Results/TaxRateStandardResult.cs similarity index 89% rename from src/Ubik.Accounting.SalesOrVatTax.Contracts/TaxRates/Results/SalesOrVatTaxRateStandardResult.cs rename to src/Ubik.Accounting.SalesOrVatTax.Contracts/TaxRates/Results/TaxRateStandardResult.cs index ad18ce68..bc6a1771 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Contracts/TaxRates/Results/SalesOrVatTaxRateStandardResult.cs +++ b/src/Ubik.Accounting.SalesOrVatTax.Contracts/TaxRates/Results/TaxRateStandardResult.cs @@ -1,6 +1,6 @@ namespace Ubik.Accounting.SalesOrVatTax.Contracts.TaxRates.Results { - public record SalesOrVatTaxRateStandardResult + public record TaxRateStandardResult { public Guid Id { get; init; } public DateOnly ValidFrom { get; init; } diff --git a/src/Ubik.Accounting.Transaction.Api/Features/TaxRates/Services/ITaxRateCommandService.cs b/src/Ubik.Accounting.Transaction.Api/Features/TaxRates/Services/ITaxRateCommandService.cs index 06b3333f..98187b2a 100644 --- a/src/Ubik.Accounting.Transaction.Api/Features/TaxRates/Services/ITaxRateCommandService.cs +++ b/src/Ubik.Accounting.Transaction.Api/Features/TaxRates/Services/ITaxRateCommandService.cs @@ -1,11 +1,12 @@ -using Ubik.Accounting.Structure.Contracts.Accounts.Events; +using Ubik.Accounting.SalesOrVatTax.Contracts.TaxRates.Events; +using Ubik.Accounting.Structure.Contracts.Accounts.Events; namespace Ubik.Accounting.Transaction.Api.Features.TaxRates.Services { public interface ITaxRateCommandService { - public Task AddAsync(AccountAdded accountAdded); - public Task UpdateAsync(AccountUpdated accountUpdated); + public Task AddAsync(TaxRateAdded toAdd); + public Task UpdateAsync(TaxRateUpdated toUpd); public Task DeleteAsync(Guid accountId); } } diff --git a/src/Ubik.Accounting.Transaction.Api/Features/TaxRates/Services/TaxRateCommandService.cs b/src/Ubik.Accounting.Transaction.Api/Features/TaxRates/Services/TaxRateCommandService.cs index c116efa6..745afb96 100644 --- a/src/Ubik.Accounting.Transaction.Api/Features/TaxRates/Services/TaxRateCommandService.cs +++ b/src/Ubik.Accounting.Transaction.Api/Features/TaxRates/Services/TaxRateCommandService.cs @@ -1,5 +1,6 @@ -using Microsoft.EntityFrameworkCore; -using Ubik.Accounting.Structure.Contracts.Accounts.Events; +using LanguageExt; +using Microsoft.EntityFrameworkCore; +using Ubik.Accounting.SalesOrVatTax.Contracts.TaxRates.Events; using Ubik.Accounting.Transaction.Api.Data; using Ubik.Accounting.Transaction.Api.Mappers; @@ -7,24 +8,25 @@ namespace Ubik.Accounting.Transaction.Api.Features.TaxRates.Services { public class TaxRateCommandService(AccountingTxContext ctx) : ITaxRateCommandService { - public async Task AddAsync(TaxRateAdded accountAdded) + public async Task AddAsync(TaxRateAdded toAdd) { - await ctx.Accounts.AddAsync(accountAdded.ToAccount()); + await ctx.TaxRates.AddAsync(toAdd.ToTaxRate()); await ctx.SaveChangesAsync(); } - public async Task DeleteAsync(Guid accountId) + public async Task DeleteAsync(Guid Id) { - await ctx.Accounts.Where(a => a.Id == accountId).ExecuteDeleteAsync(); + await ctx.TaxRates.Where(a => a.Id == Id).ExecuteDeleteAsync(); } - public async Task UpdateAsync(AccountUpdated accountUpdated) + public async Task UpdateAsync(TaxRateUpdated toUpd) { - await ctx.Accounts.Where(a => a.Id == accountUpdated.Id).ExecuteUpdateAsync(setters => setters - .SetProperty(b => b.Active, accountUpdated.Active) - .SetProperty(b => b.Version, accountUpdated.Version) - .SetProperty(b => b.Code, accountUpdated.Code) - .SetProperty(b => b.Label, accountUpdated.Label)); + await ctx.TaxRates.Where(a => a.Id == toUpd.Id).ExecuteUpdateAsync(setters => setters + .SetProperty(t => t.Id, toUpd.Id) + .SetProperty(t => t.TenantId, toUpd.TenantId) + .SetProperty(t => t.Code, toUpd.Code) + .SetProperty(t => t.Version, toUpd.Version) + .SetProperty(t => t.Rate, toUpd.Rate)); } } } diff --git a/src/Ubik.Accounting.Transaction.Api/Mappers/TaxRateMappers.cs b/src/Ubik.Accounting.Transaction.Api/Mappers/TaxRateMappers.cs new file mode 100644 index 00000000..9f6fb9cf --- /dev/null +++ b/src/Ubik.Accounting.Transaction.Api/Mappers/TaxRateMappers.cs @@ -0,0 +1,20 @@ +using Ubik.Accounting.SalesOrVatTax.Contracts.TaxRates.Events; +using Ubik.Accounting.Transaction.Api.Models; + +namespace Ubik.Accounting.Transaction.Api.Mappers +{ + public static class TaxRateMappers + { + public static TaxRate ToTaxRate(this TaxRateAdded current) + { + return new TaxRate + { + Code = current.Code, + Id = current.Id, + Rate = current.Rate, + TenantId = current.TenantId, + Version = current.Version + }; + } + } +} diff --git a/src/Ubik.Accounting.Transaction.Api/Ubik.Accounting.Transaction.Api.csproj b/src/Ubik.Accounting.Transaction.Api/Ubik.Accounting.Transaction.Api.csproj index c6a5578a..7c846f5a 100644 --- a/src/Ubik.Accounting.Transaction.Api/Ubik.Accounting.Transaction.Api.csproj +++ b/src/Ubik.Accounting.Transaction.Api/Ubik.Accounting.Transaction.Api.csproj @@ -16,6 +16,7 @@ + diff --git a/tests/Ubik.Api.Tests.Integration/Features/Accounting/SalesOrVatTax/TaxRates/TaxRatesController_Test.cs b/tests/Ubik.Api.Tests.Integration/Features/Accounting/SalesOrVatTax/TaxRates/TaxRatesController_Test.cs index cea83746..f1d20200 100644 --- a/tests/Ubik.Api.Tests.Integration/Features/Accounting/SalesOrVatTax/TaxRates/TaxRatesController_Test.cs +++ b/tests/Ubik.Api.Tests.Integration/Features/Accounting/SalesOrVatTax/TaxRates/TaxRatesController_Test.cs @@ -2,10 +2,10 @@ using System.Net.Http.Headers; using System.Net.Http.Json; using System.Net; -using Ubik.Accounting.SalesOrVatTax.Contracts.SalesOrVatTaxRate.Results; using Ubik.ApiService.Common.Exceptions; using MassTransit; -using Ubik.Accounting.SalesOrVatTax.Contracts.SalesOrVatTaxRate.Commands; +using Ubik.Accounting.SalesOrVatTax.Contracts.TaxRates.Commands; +using Ubik.Accounting.SalesOrVatTax.Contracts.TaxRates.Results; namespace Ubik.Api.Tests.Integration.Features.Accounting.SalesOrVatTax.TaxRates { @@ -33,13 +33,13 @@ public async Task Get_All_TaxRates_WithRW_OK() //Act var response = await _client.GetAsync(_baseUrlForV1); - var result = await response.Content.ReadFromJsonAsync>(); + var result = await response.Content.ReadFromJsonAsync>(); //Assert response.StatusCode.Should().Be(HttpStatusCode.OK); result.Should() .NotBeNull() - .And.BeOfType>(); + .And.BeOfType>(); } [Fact] @@ -51,13 +51,13 @@ public async Task Get_All_TaxRates_WithRO_OK() //Act var response = await _client.GetAsync(_baseUrlForV1); - var result = await response.Content.ReadFromJsonAsync>(); + var result = await response.Content.ReadFromJsonAsync>(); //Assert response.StatusCode.Should().Be(HttpStatusCode.OK); result.Should() .NotBeNull() - .And.BeOfType>(); + .And.BeOfType>(); } [Fact] @@ -107,13 +107,13 @@ public async Task Get_All_TaxRates_WithOtherTenant_OK() //Act var response = await _client.GetAsync(_baseUrlForV1); - var result = await response.Content.ReadFromJsonAsync>(); + var result = await response.Content.ReadFromJsonAsync>(); //Assert response.StatusCode.Should().Be(HttpStatusCode.OK); result.Should() .NotBeNull() - .And.BeOfType>(); + .And.BeOfType>(); } [Fact] @@ -125,13 +125,13 @@ public async Task Get_TaxRate_By_Id_WithRW_OK() //Act var response = await _client.GetAsync($"{_baseUrlForV1}/{_id}"); - var result = await response.Content.ReadFromJsonAsync(); + var result = await response.Content.ReadFromJsonAsync(); //Assert response.StatusCode.Should().Be(HttpStatusCode.OK); result.Should() .NotBeNull() - .And.BeOfType(); + .And.BeOfType(); } [Fact] @@ -143,13 +143,13 @@ public async Task Get_TaxRate_By_Id_WithRO_OK() //Act var response = await _client.GetAsync($"{_baseUrlForV1}/{_id}"); - var result = await response.Content.ReadFromJsonAsync(); + var result = await response.Content.ReadFromJsonAsync(); //Assert response.StatusCode.Should().Be(HttpStatusCode.OK); result.Should() .NotBeNull() - .And.BeOfType(); + .And.BeOfType(); } [Fact] @@ -235,7 +235,7 @@ public async Task Add_TaxRate_WithRW_OK() var token = await GetAccessTokenAsync(TokenType.RW); _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); - var command = new TaxRateCommand + var command = new AddTaxRateCommand { Code = "Test", Description = "Description", @@ -247,14 +247,14 @@ public async Task Add_TaxRate_WithRW_OK() //Act var response = await _client.PostAsJsonAsync(_baseUrlForV1, command); var tmp = await response.Content.ReadAsStringAsync(); - var result = await response.Content.ReadFromJsonAsync(); + var result = await response.Content.ReadFromJsonAsync(); //Assert response.StatusCode.Should().Be(HttpStatusCode.Created); result.Should() .NotBeNull() - .And.BeOfType() - .And.Match(x => x.Code == command.Code); + .And.BeOfType() + .And.Match(x => x.Code == command.Code); } [Fact] @@ -264,7 +264,7 @@ public async Task Add_TaxRate_WithAlreadyExists_409() var token = await GetAccessTokenAsync(TokenType.RW); _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); - var command = new TaxRateCommand + var command = new AddTaxRateCommand { Code = "v81", Description = "Description", @@ -293,7 +293,7 @@ public async Task Add_TaxRate_WithRO_403() var token = await GetAccessTokenAsync(TokenType.RO); _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); - var command = new TaxRateCommand + var command = new AddTaxRateCommand { Code = "Test", Description = "Description", @@ -313,7 +313,7 @@ public async Task Add_TaxRate_WithRO_403() public async Task Add_TaxRate_WithNoToken_401() { //Arrange - var command = new TaxRateCommand + var command = new AddTaxRateCommand { Code = "Test", Description = "Description", @@ -336,7 +336,7 @@ public async Task Add_TaxRate_WithAdmin_403() var token = await GetAccessTokenAsync(TokenType.MegaAdmin); _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); - var command = new TaxRateCommand + var command = new AddTaxRateCommand { Code = "Test", Description = "Description", @@ -359,7 +359,7 @@ public async Task Add_TaxRate_WithOtherTenant_OK() var token = await GetAccessTokenAsync(TokenType.OtherTenant); _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); - var command = new TaxRateCommand + var command = new AddTaxRateCommand { Code = "Test", Description = "Description", @@ -370,14 +370,14 @@ public async Task Add_TaxRate_WithOtherTenant_OK() //Act var response = await _client.PostAsJsonAsync(_baseUrlForV1, command); - var result = await response.Content.ReadFromJsonAsync(); + var result = await response.Content.ReadFromJsonAsync(); //Assert response.StatusCode.Should().Be(HttpStatusCode.Created); result.Should() .NotBeNull() - .And.BeOfType() - .And.Match(x => x.Code == command.Code); + .And.BeOfType() + .And.Match(x => x.Code == command.Code); } [Fact] @@ -387,7 +387,7 @@ public async Task Add_TaxRate_WithNoRole_403() var token = await GetAccessTokenAsync(TokenType.NoRole); _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); - var command = new TaxRateCommand + var command = new AddTaxRateCommand { Code = "Test", Description = "Description", @@ -410,7 +410,7 @@ public async Task Update_TaxRate_WithRW_OK() var token = await GetAccessTokenAsync(TokenType.RW); _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); - var command = new UpdateSalesOrVatTaxRateCommand + var command = new UpdateTaxRateCommand { Id = _idToUpd, Code = "Test2", @@ -423,14 +423,14 @@ public async Task Update_TaxRate_WithRW_OK() //Act var response = await _client.PutAsJsonAsync($"{_baseUrlForV1}/{_idToUpd}", command); - var result = await response.Content.ReadFromJsonAsync(); + var result = await response.Content.ReadFromJsonAsync(); //Assert response.StatusCode.Should().Be(HttpStatusCode.OK); result.Should() .NotBeNull() - .And.BeOfType() - .And.Match(x => x.Code == command.Code); + .And.BeOfType() + .And.Match(x => x.Code == command.Code); } [Fact] @@ -440,7 +440,7 @@ public async Task Update_TaxRate_WithRO_403() var token = await GetAccessTokenAsync(TokenType.RO); _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); - var command = new UpdateSalesOrVatTaxRateCommand + var command = new UpdateTaxRateCommand { Id = _idToUpd, Code = "Test2", @@ -462,7 +462,7 @@ public async Task Update_TaxRate_WithRO_403() public async Task Update_TaxRate_WithNoToken_401() { //Arrange - var command = new UpdateSalesOrVatTaxRateCommand + var command = new UpdateTaxRateCommand { Id = _idToUpd, Code = "Test2", @@ -487,7 +487,7 @@ public async Task Update_TaxRate_WithAdmin_403() var token = await GetAccessTokenAsync(TokenType.MegaAdmin); _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); - var command = new UpdateSalesOrVatTaxRateCommand + var command = new UpdateTaxRateCommand { Id = _idToUpd, Code = "Test2", @@ -512,7 +512,7 @@ public async Task Update_TaxRate_WithOtherTenant_404() var token = await GetAccessTokenAsync(TokenType.OtherTenant); _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); - var command = new UpdateSalesOrVatTaxRateCommand + var command = new UpdateTaxRateCommand { Id = _idToUpd, Code = "Test2", @@ -542,7 +542,7 @@ public async Task Update_TaxRate_WithNoRole_403() var token = await GetAccessTokenAsync(TokenType.NoRole); _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); - var command = new UpdateSalesOrVatTaxRateCommand + var command = new UpdateTaxRateCommand { Id = _idToUpd, Code = "Test2", @@ -569,7 +569,7 @@ public async Task Update_TaxRate_WithNotMatchId_400() var token = await GetAccessTokenAsync(TokenType.RW); _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); - var command = new UpdateSalesOrVatTaxRateCommand + var command = new UpdateTaxRateCommand { Id = NewId.NextGuid(), Code = "Test3", @@ -599,7 +599,7 @@ public async Task Update_TaxRate_WithAlreadyExists_409() var token = await GetAccessTokenAsync(TokenType.RW); _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); - var command = new UpdateSalesOrVatTaxRateCommand + var command = new UpdateTaxRateCommand { Id = _idToUpd, Code = "v81", @@ -630,7 +630,7 @@ public async Task Update_TaxRate_WithBadId_404() _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); var id = NewId.NextGuid(); - var command = new UpdateSalesOrVatTaxRateCommand + var command = new UpdateTaxRateCommand { Id = id, Code = "v81", From 15060cdfafb6ec9c25782e6701dc43e52e65e1e2 Mon Sep 17 00:00:00 2001 From: fdonnet Date: Wed, 6 Nov 2024 17:55:44 +0100 Subject: [PATCH 56/94] Consumer for tax rates in transaction API --- .../TaxRates/Consumers/TaxRateAddedConsumer.cs | 15 +++++++++++++++ .../TaxRates/Consumers/TaxRateDeletedConsumer.cs | 15 +++++++++++++++ .../TaxRates/Consumers/TaxRateUpdatedConsumer.cs | 16 ++++++++++++++++ .../Ubik.Accounting.Transaction.Api.csproj | 1 - 4 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 src/Ubik.Accounting.Transaction.Api/Features/TaxRates/Consumers/TaxRateAddedConsumer.cs create mode 100644 src/Ubik.Accounting.Transaction.Api/Features/TaxRates/Consumers/TaxRateDeletedConsumer.cs create mode 100644 src/Ubik.Accounting.Transaction.Api/Features/TaxRates/Consumers/TaxRateUpdatedConsumer.cs diff --git a/src/Ubik.Accounting.Transaction.Api/Features/TaxRates/Consumers/TaxRateAddedConsumer.cs b/src/Ubik.Accounting.Transaction.Api/Features/TaxRates/Consumers/TaxRateAddedConsumer.cs new file mode 100644 index 00000000..676f777b --- /dev/null +++ b/src/Ubik.Accounting.Transaction.Api/Features/TaxRates/Consumers/TaxRateAddedConsumer.cs @@ -0,0 +1,15 @@ +using MassTransit; +using Ubik.Accounting.SalesOrVatTax.Contracts.TaxRates.Events; +using Ubik.Accounting.Structure.Contracts.Accounts.Events; +using Ubik.Accounting.Transaction.Api.Features.TaxRates.Services; + +namespace Ubik.Accounting.Transaction.Api.Features.TaxRates.Consumers +{ + public class TaxRateAddedConsumer(ITaxRateCommandService commandService) : IConsumer + { + public async Task Consume(ConsumeContext context) + { + await commandService.AddAsync(context.Message); + } + } +} diff --git a/src/Ubik.Accounting.Transaction.Api/Features/TaxRates/Consumers/TaxRateDeletedConsumer.cs b/src/Ubik.Accounting.Transaction.Api/Features/TaxRates/Consumers/TaxRateDeletedConsumer.cs new file mode 100644 index 00000000..48b14a1e --- /dev/null +++ b/src/Ubik.Accounting.Transaction.Api/Features/TaxRates/Consumers/TaxRateDeletedConsumer.cs @@ -0,0 +1,15 @@ +using MassTransit; +using Ubik.Accounting.SalesOrVatTax.Contracts.TaxRates.Events; +using Ubik.Accounting.Structure.Contracts.Accounts.Events; +using Ubik.Accounting.Transaction.Api.Features.TaxRates.Services; + +namespace Ubik.Accounting.Transaction.Api.Features.TaxRates.Consumers +{ + public class TaxRateDeletedConsumer(ITaxRateCommandService commandService) : IConsumer + { + public async Task Consume(ConsumeContext context) + { + await commandService.DeleteAsync(context.Message.Id); + } + } +} diff --git a/src/Ubik.Accounting.Transaction.Api/Features/TaxRates/Consumers/TaxRateUpdatedConsumer.cs b/src/Ubik.Accounting.Transaction.Api/Features/TaxRates/Consumers/TaxRateUpdatedConsumer.cs new file mode 100644 index 00000000..d5ee0a8e --- /dev/null +++ b/src/Ubik.Accounting.Transaction.Api/Features/TaxRates/Consumers/TaxRateUpdatedConsumer.cs @@ -0,0 +1,16 @@ +using MassTransit; +using Ubik.Accounting.SalesOrVatTax.Contracts.TaxRates.Events; +using Ubik.Accounting.Structure.Contracts.Accounts.Events; +using Ubik.Accounting.Transaction.Api.Features.TaxRates.Services; + +namespace Ubik.Accounting.Transaction.Api.Features.TaxRates.Consumers +{ + public class TaxRateUpdatedConsumer(ITaxRateCommandService commandService) : IConsumer + { + public async Task Consume(ConsumeContext context) + { + await commandService.UpdateAsync(context.Message); + } + } +} + diff --git a/src/Ubik.Accounting.Transaction.Api/Ubik.Accounting.Transaction.Api.csproj b/src/Ubik.Accounting.Transaction.Api/Ubik.Accounting.Transaction.Api.csproj index 7c846f5a..0cef88f4 100644 --- a/src/Ubik.Accounting.Transaction.Api/Ubik.Accounting.Transaction.Api.csproj +++ b/src/Ubik.Accounting.Transaction.Api/Ubik.Accounting.Transaction.Api.csproj @@ -25,7 +25,6 @@ - From 5a199691e5c274e484208f45439436e1fd8ae100 Mon Sep 17 00:00:00 2001 From: fdonnet Date: Wed, 6 Nov 2024 18:14:20 +0100 Subject: [PATCH 57/94] Dont' forget to populate tenant_id in events. --- .../Mappers/AccountTaxRateConfigMappers.cs | 1 + .../Mappers/TaxRateMappers.cs | 2 ++ .../Mappers/AccountGroupMappers.cs | 7 +++++-- .../Mappers/ClassificationMappers.cs | 6 ++++-- .../AccountGroups/Events/AccountGroupAdded.cs | 1 + .../AccountGroups/Events/AccountGroupDeleted.cs | 1 + .../AccountGroups/Events/AccountGroupUpdated.cs | 1 + .../Classifications/Events/ClassificationAdded.cs | 1 + .../Classifications/Events/ClassificationUpdated.cs | 1 + src/Ubik.Security.Api/Mappers/RoleMappers.cs | 6 +++++- src/Ubik.Security.Contracts/Roles/Events/RoleAdded.cs | 1 + src/Ubik.Security.Contracts/Roles/Events/RoleUpdated.cs | 1 + 12 files changed, 24 insertions(+), 5 deletions(-) diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Mappers/AccountTaxRateConfigMappers.cs b/src/Ubik.Accounting.SalesOrVatTax.Api/Mappers/AccountTaxRateConfigMappers.cs index 540eeccf..fd768e69 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Api/Mappers/AccountTaxRateConfigMappers.cs +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Mappers/AccountTaxRateConfigMappers.cs @@ -41,6 +41,7 @@ public static AccountTaxRateConfigAdded ToAccountTaxRateConfigAdded(this Account TaxRateId = current.TaxRateId, TaxAccountId = current.TaxAccountId, Version = current.Version, + TenantId = current.TenantId }; } diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Mappers/TaxRateMappers.cs b/src/Ubik.Accounting.SalesOrVatTax.Api/Mappers/TaxRateMappers.cs index 1e6db02c..3d8d80da 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Api/Mappers/TaxRateMappers.cs +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Mappers/TaxRateMappers.cs @@ -58,6 +58,7 @@ public static TaxRateAdded ToTaxRateAdded(this TaxRate current) Description = current.Description, Rate = current.Rate, Version = current.Version, + TenantId = current.TenantId }; } @@ -72,6 +73,7 @@ public static TaxRateUpdated ToTaxRateUpdated(this TaxRate current) Description = current.Description, Rate = current.Rate, Version = current.Version, + TenantId = current.TenantId }; } diff --git a/src/Ubik.Accounting.Structure.Api/Mappers/AccountGroupMappers.cs b/src/Ubik.Accounting.Structure.Api/Mappers/AccountGroupMappers.cs index e6bbb1e6..661eba46 100644 --- a/src/Ubik.Accounting.Structure.Api/Mappers/AccountGroupMappers.cs +++ b/src/Ubik.Accounting.Structure.Api/Mappers/AccountGroupMappers.cs @@ -60,7 +60,8 @@ public static AccountGroupAdded ToAccountGroupAdded(this AccountGroup accountGro Description = accountGroup.Description, ParentAccountGroupId = accountGroup.ParentAccountGroupId, AccountGroupClassificationId = accountGroup.ClassificationId, - Version = accountGroup.Version + Version = accountGroup.Version, + TenantId = accountGroup.TenantId }; } @@ -100,7 +101,8 @@ public static AccountGroupUpdated ToAccountGroupUpdated(this AccountGroup accoun Description = accountGroup.Description, ParentAccountGroupId = accountGroup.ParentAccountGroupId, AccountGroupClassificationId = accountGroup.ClassificationId, - Version = accountGroup.Version + Version = accountGroup.Version, + TenantId = accountGroup.TenantId }; } @@ -112,6 +114,7 @@ public static IEnumerable ToAccountGroupDeleted(this IEnume Code = x.Code, Label = x.Label, ParentAccountGroupId = x.ParentAccountGroupId, + TenantId = x.TenantId, }); } diff --git a/src/Ubik.Accounting.Structure.Api/Mappers/ClassificationMappers.cs b/src/Ubik.Accounting.Structure.Api/Mappers/ClassificationMappers.cs index 8a2f95d1..5467de4d 100644 --- a/src/Ubik.Accounting.Structure.Api/Mappers/ClassificationMappers.cs +++ b/src/Ubik.Accounting.Structure.Api/Mappers/ClassificationMappers.cs @@ -73,7 +73,8 @@ public static ClassificationAdded ToClassificationAdded(this Classification clas Code = classification.Code, Label = classification.Label, Description = classification.Description, - Version = classification.Version + Version = classification.Version, + TenantId = classification.TenantId }; } @@ -85,7 +86,8 @@ public static ClassificationUpdated ToClassificationUpdated(this Classification Code = classification.Code, Label = classification.Label, Description = classification.Description, - Version = classification.Version + Version = classification.Version, + TenantId = classification.TenantId }; } diff --git a/src/Ubik.Accounting.Structure.Contracts/AccountGroups/Events/AccountGroupAdded.cs b/src/Ubik.Accounting.Structure.Contracts/AccountGroups/Events/AccountGroupAdded.cs index ff37dcb1..18a15271 100644 --- a/src/Ubik.Accounting.Structure.Contracts/AccountGroups/Events/AccountGroupAdded.cs +++ b/src/Ubik.Accounting.Structure.Contracts/AccountGroups/Events/AccountGroupAdded.cs @@ -9,5 +9,6 @@ public record AccountGroupAdded public Guid? ParentAccountGroupId { get; init; } public Guid AccountGroupClassificationId { get; init; } public Guid Version { get; init; } + public Guid TenantId { get; init; } } } diff --git a/src/Ubik.Accounting.Structure.Contracts/AccountGroups/Events/AccountGroupDeleted.cs b/src/Ubik.Accounting.Structure.Contracts/AccountGroups/Events/AccountGroupDeleted.cs index 2e709d8b..9e4fe2c1 100644 --- a/src/Ubik.Accounting.Structure.Contracts/AccountGroups/Events/AccountGroupDeleted.cs +++ b/src/Ubik.Accounting.Structure.Contracts/AccountGroups/Events/AccountGroupDeleted.cs @@ -6,5 +6,6 @@ public record AccountGroupDeleted public string Code { get; init; } = default!; public string Label { get; init; } = default!; public Guid? ParentAccountGroupId { get; init; } + public Guid TenantId { get; init; } } } diff --git a/src/Ubik.Accounting.Structure.Contracts/AccountGroups/Events/AccountGroupUpdated.cs b/src/Ubik.Accounting.Structure.Contracts/AccountGroups/Events/AccountGroupUpdated.cs index 0e6ddf5f..7f5970a8 100644 --- a/src/Ubik.Accounting.Structure.Contracts/AccountGroups/Events/AccountGroupUpdated.cs +++ b/src/Ubik.Accounting.Structure.Contracts/AccountGroups/Events/AccountGroupUpdated.cs @@ -9,5 +9,6 @@ public record AccountGroupUpdated public Guid? ParentAccountGroupId { get; init; } public Guid AccountGroupClassificationId { get; init; } public Guid Version { get; init; } + public Guid TenantId { get; init; } } } diff --git a/src/Ubik.Accounting.Structure.Contracts/Classifications/Events/ClassificationAdded.cs b/src/Ubik.Accounting.Structure.Contracts/Classifications/Events/ClassificationAdded.cs index b56bfce4..9a9f8065 100644 --- a/src/Ubik.Accounting.Structure.Contracts/Classifications/Events/ClassificationAdded.cs +++ b/src/Ubik.Accounting.Structure.Contracts/Classifications/Events/ClassificationAdded.cs @@ -7,5 +7,6 @@ public record ClassificationAdded public string Label { get; init; } = default!; public string? Description { get; init; } public Guid Version { get; init; } + public Guid TenantId { get; init; } } } diff --git a/src/Ubik.Accounting.Structure.Contracts/Classifications/Events/ClassificationUpdated.cs b/src/Ubik.Accounting.Structure.Contracts/Classifications/Events/ClassificationUpdated.cs index b508fabe..0ca3ce3c 100644 --- a/src/Ubik.Accounting.Structure.Contracts/Classifications/Events/ClassificationUpdated.cs +++ b/src/Ubik.Accounting.Structure.Contracts/Classifications/Events/ClassificationUpdated.cs @@ -7,5 +7,6 @@ public class ClassificationUpdated public string Label { get; init; } = default!; public string? Description { get; init; } public Guid Version { get; init; } + public Guid TenantId { get; init; } } } diff --git a/src/Ubik.Security.Api/Mappers/RoleMappers.cs b/src/Ubik.Security.Api/Mappers/RoleMappers.cs index 1ec16aff..6d8f4c35 100644 --- a/src/Ubik.Security.Api/Mappers/RoleMappers.cs +++ b/src/Ubik.Security.Api/Mappers/RoleMappers.cs @@ -15,7 +15,7 @@ public static IEnumerable ToRoleStandardResults(this IEnumer Code = x.Code, Label = x.Label, Description = x.Description, - Version = x.Version + Version = x.Version, }); } @@ -38,10 +38,12 @@ public static Role ToRole(this Role forUpd, Role model) model.Label = forUpd.Label; model.Description = forUpd.Description; model.Version = forUpd.Version; + model.TenantId = forUpd.TenantId; return model; } + //Need to check for tenant role public static Role ToRole(this AddRoleCommand current) { return new Role @@ -72,6 +74,7 @@ public static RoleAdded ToRoleAdded(this Role current) Description = current.Description, Version = current.Version, Id = current.Id, + TenantId = current.TenantId }; } @@ -84,6 +87,7 @@ public static RoleUpdated ToRoleUpdated(this Role current) Description = current.Description, Version = current.Version, Id = current.Id, + TenantId = current.TenantId }; } } diff --git a/src/Ubik.Security.Contracts/Roles/Events/RoleAdded.cs b/src/Ubik.Security.Contracts/Roles/Events/RoleAdded.cs index 29300b3d..894151d4 100644 --- a/src/Ubik.Security.Contracts/Roles/Events/RoleAdded.cs +++ b/src/Ubik.Security.Contracts/Roles/Events/RoleAdded.cs @@ -7,5 +7,6 @@ public record RoleAdded public required string Label { get; init; } public string? Description { get; init; } public Guid Version { get; init; } + public Guid? TenantId { get; set; } } } diff --git a/src/Ubik.Security.Contracts/Roles/Events/RoleUpdated.cs b/src/Ubik.Security.Contracts/Roles/Events/RoleUpdated.cs index d98ffb62..098a7822 100644 --- a/src/Ubik.Security.Contracts/Roles/Events/RoleUpdated.cs +++ b/src/Ubik.Security.Contracts/Roles/Events/RoleUpdated.cs @@ -7,5 +7,6 @@ public record RoleUpdated public required string Label { get; init; } public string? Description { get; init; } public Guid Version { get; init; } + public Guid? TenantId { get; set; } } } From 4f3b9e43a600638a218ba8e0c5c207764e20b74f Mon Sep 17 00:00:00 2001 From: ubik Date: Wed, 6 Nov 2024 20:24:55 +0100 Subject: [PATCH 58/94] no browser launch for api --- .../Properties/launchSettings.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Ubik.Accounting.Transaction.Api/Properties/launchSettings.json b/src/Ubik.Accounting.Transaction.Api/Properties/launchSettings.json index 1ef1ebc2..b8437990 100644 --- a/src/Ubik.Accounting.Transaction.Api/Properties/launchSettings.json +++ b/src/Ubik.Accounting.Transaction.Api/Properties/launchSettings.json @@ -22,7 +22,7 @@ "https": { "commandName": "Project", "dotnetRunMessages": true, - "launchBrowser": true, + "launchBrowser": false, "launchUrl": "swagger", "applicationUrl": "https://localhost:7053;http://localhost:5201", "environmentVariables": { From d68273425591bd74150304e7f29f6172de7363f5 Mon Sep 17 00:00:00 2001 From: fdonnet Date: Thu, 7 Nov 2024 17:06:51 +0100 Subject: [PATCH 59/94] Replace audit field in all model by a value object and adapt the change tracker accordinly --- .../Data/AccountingSalesTaxDbContext.cs | 3 +- .../AccountTaxRateConfigConfiguration.cs | 23 ++++-- .../Data/Config/TaxRateConfiguration.cs | 23 ++++-- .../Models/AccountTaxRateConfig.cs | 6 +- .../Models/TaxRate.cs | 6 +- .../AccountAccountGroupConfiguration.cs | 19 +++++ .../Data/Config/AccountConfiguration.cs | 21 ++++- .../Data/Config/AccountGroupConfiguration.cs | 21 ++++- .../Config/ClassificationConfiguration.cs | 23 ++++-- .../Data/Config/EntryConfiguration.cs | 77 ------------------- .../Data/Config/TransactionConfiguration.cs | 33 -------- .../Data/Init/ClassificationsData.cs | 26 +++---- .../Models/Account.cs | 6 +- .../Models/AccountAccountGroup.cs | 6 +- .../Models/AccountGroup.cs | 6 +- .../Models/Classification.cs | 6 +- .../Models/Entry.cs | 44 ----------- .../Models/Transaction.cs | 18 ----- .../Data/AccountingTxContext.cs | 18 ++--- .../Data/Config/EntryConfiguration.cs | 21 ++++- .../Data/Config/TxConfiguration.cs | 30 +++++++- .../Txs/Services/ITxCommandService.cs | 10 +++ .../Models/Entry.cs | 6 +- .../Models/Tx.cs | 6 +- .../Ubik.Accounting.Transaction.Api.csproj | 4 - .../Extensions/ChangeTrackerExtensions.cs | 9 +-- .../Ubik.DB.Common/IAuditEntity.cs | 10 +-- .../Ubik.DB.Common/Models/AuditData.cs | 30 ++++++++ .../Data/Config/AuthorizationConfiguration.cs | 21 ++++- .../Config/RoleAuthorizationConfiguration.cs | 19 +++++ .../Data/Config/RoleConfiguration.cs | 23 ++++-- .../Data/Config/TenantConfiguration.cs | 23 ++++-- .../Data/Config/UserConfiguration.cs | 23 ++++-- .../Config/UserRoleByTenantConfiguration.cs | 19 +++++ .../Data/Config/UserTenantConfiguration.cs | 19 +++++ src/Ubik.Security.Api/Models/Authorization.cs | 6 +- src/Ubik.Security.Api/Models/Role.cs | 6 +- .../Models/RoleAuthorization.cs | 6 +- src/Ubik.Security.Api/Models/Tenant.cs | 6 +- src/Ubik.Security.Api/Models/User.cs | 6 +- .../Models/UserRoleByTenant.cs | 6 +- src/Ubik.Security.Api/Models/UserTenant.cs | 6 +- 42 files changed, 378 insertions(+), 322 deletions(-) delete mode 100644 src/Ubik.Accounting.Structure.Api/Data/Config/EntryConfiguration.cs delete mode 100644 src/Ubik.Accounting.Structure.Api/Data/Config/TransactionConfiguration.cs delete mode 100644 src/Ubik.Accounting.Structure.Api/Models/Entry.cs delete mode 100644 src/Ubik.Accounting.Structure.Api/Models/Transaction.cs create mode 100644 src/Ubik.Accounting.Transaction.Api/Features/Txs/Services/ITxCommandService.cs create mode 100644 src/Ubik.Db.Common/Ubik.DB.Common/Models/AuditData.cs diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Data/AccountingSalesTaxDbContext.cs b/src/Ubik.Accounting.SalesOrVatTax.Api/Data/AccountingSalesTaxDbContext.cs index 3af688c6..0bea6f3a 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Api/Data/AccountingSalesTaxDbContext.cs +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Data/AccountingSalesTaxDbContext.cs @@ -1,10 +1,12 @@ using MassTransit; using Microsoft.EntityFrameworkCore; +using System.Linq.Expressions; using Ubik.Accounting.SalesOrVatTax.Api.Data.Config; using Ubik.Accounting.SalesOrVatTax.Api.Models; using Ubik.ApiService.Common.Errors; using Ubik.ApiService.Common.Exceptions; using Ubik.ApiService.Common.Services; +using Ubik.DB.Common; using Ubik.DB.Common.Extensions; namespace Ubik.Accounting.SalesOrVatTax.Api.Data @@ -64,7 +66,6 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) new AccountConfiguration().Configure(modelBuilder.Entity()); new AccountTaxRateConfigConfiguration().Configure(modelBuilder.Entity()); - base.OnModelCreating(modelBuilder); } diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Data/Config/AccountTaxRateConfigConfiguration.cs b/src/Ubik.Accounting.SalesOrVatTax.Api/Data/Config/AccountTaxRateConfigConfiguration.cs index d993aac8..ee71c3d8 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Api/Data/Config/AccountTaxRateConfigConfiguration.cs +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Data/Config/AccountTaxRateConfigConfiguration.cs @@ -14,11 +14,24 @@ public void Configure(EntityTypeBuilder builder) builder.Property(a => a.TenantId) .IsRequired(); - builder.Property(a => a.CreatedAt) - .IsRequired(); - - builder.Property(a => a.CreatedBy) - .IsRequired(); + builder.OwnsOne(x => x.AuditInfo, auditInfo => + { + auditInfo.Property(a => a.ModifiedAt) + .HasColumnName("modified_at") + .IsRequired(); + + auditInfo.Property(a => a.ModifiedBy) + .HasColumnName("modified_by") + .IsRequired(); + + auditInfo.Property(a => a.CreatedAt) + .HasColumnName("created_at") + .IsRequired(); + + auditInfo.Property(a => a.CreatedBy) + .HasColumnName("created_by") + .IsRequired(); + }); builder.HasIndex(a => new { a.AccountId, a.TaxRateId }) .IsUnique(); diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Data/Config/TaxRateConfiguration.cs b/src/Ubik.Accounting.SalesOrVatTax.Api/Data/Config/TaxRateConfiguration.cs index 9cd64390..0d24b8a6 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Api/Data/Config/TaxRateConfiguration.cs +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Data/Config/TaxRateConfiguration.cs @@ -24,11 +24,24 @@ public void Configure(EntityTypeBuilder builder) builder.Property(a => a.TenantId) .IsRequired(); - builder.Property(a => a.CreatedAt) - .IsRequired(); - - builder.Property(a => a.CreatedBy) - .IsRequired(); + builder.OwnsOne(x => x.AuditInfo, auditInfo => + { + auditInfo.Property(a => a.ModifiedAt) + .HasColumnName("modified_at") + .IsRequired(); + + auditInfo.Property(a => a.ModifiedBy) + .HasColumnName("modified_by") + .IsRequired(); + + auditInfo.Property(a => a.CreatedAt) + .HasColumnName("created_at") + .IsRequired(); + + auditInfo.Property(a => a.CreatedBy) + .HasColumnName("created_by") + .IsRequired(); + }); builder.HasIndex(a => new { a.Code, a.TenantId }) .IsUnique(); diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Models/AccountTaxRateConfig.cs b/src/Ubik.Accounting.SalesOrVatTax.Api/Models/AccountTaxRateConfig.cs index 1d1ed7ac..effec1db 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Api/Models/AccountTaxRateConfig.cs +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Models/AccountTaxRateConfig.cs @@ -1,4 +1,5 @@ using Ubik.DB.Common; +using Ubik.DB.Common.Models; namespace Ubik.Accounting.SalesOrVatTax.Api.Models { @@ -10,9 +11,6 @@ public class AccountTaxRateConfig : ITenantEntity, IConcurrencyCheckEntity, IAud public Guid TaxAccountId { get; set; } public Guid Version { get; set; } public Guid TenantId { get; set; } - public DateTime CreatedAt { get; set; } - public Guid CreatedBy { get; set; } - public DateTime? ModifiedAt { get; set; } - public Guid? ModifiedBy { get; set; } + public AuditData AuditInfo { get; set; } = default!; } } diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Models/TaxRate.cs b/src/Ubik.Accounting.SalesOrVatTax.Api/Models/TaxRate.cs index 3ab3b28f..46fa8c7a 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Api/Models/TaxRate.cs +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Models/TaxRate.cs @@ -1,4 +1,5 @@ using Ubik.DB.Common; +using Ubik.DB.Common.Models; namespace Ubik.Accounting.SalesOrVatTax.Api.Models { @@ -12,9 +13,6 @@ public class TaxRate : ITenantEntity, IConcurrencyCheckEntity, IAuditEntity public decimal Rate { get; set; } public Guid Version { get; set; } public Guid TenantId { get; set; } - public DateTime CreatedAt { get; set; } - public Guid CreatedBy { get; set; } - public DateTime? ModifiedAt { get; set; } - public Guid? ModifiedBy { get; set; } + public AuditData AuditInfo { get; set; } = default!; } } diff --git a/src/Ubik.Accounting.Structure.Api/Data/Config/AccountAccountGroupConfiguration.cs b/src/Ubik.Accounting.Structure.Api/Data/Config/AccountAccountGroupConfiguration.cs index 4c41ec2f..5c10c1eb 100644 --- a/src/Ubik.Accounting.Structure.Api/Data/Config/AccountAccountGroupConfiguration.cs +++ b/src/Ubik.Accounting.Structure.Api/Data/Config/AccountAccountGroupConfiguration.cs @@ -20,6 +20,25 @@ public void Configure(EntityTypeBuilder builder) builder.HasIndex(a => new { a.AccountGroupId, a.AccountId }) .IsUnique(); + builder.OwnsOne(x => x.AuditInfo, auditInfo => + { + auditInfo.Property(a => a.ModifiedAt) + .HasColumnName("modified_at") + .IsRequired(); + + auditInfo.Property(a => a.ModifiedBy) + .HasColumnName("modified_by") + .IsRequired(); + + auditInfo.Property(a => a.CreatedAt) + .HasColumnName("created_at") + .IsRequired(); + + auditInfo.Property(a => a.CreatedBy) + .HasColumnName("created_by") + .IsRequired(); + }); + builder.HasIndex(a => a.TenantId); builder diff --git a/src/Ubik.Accounting.Structure.Api/Data/Config/AccountConfiguration.cs b/src/Ubik.Accounting.Structure.Api/Data/Config/AccountConfiguration.cs index e9b9f977..bd9602a7 100644 --- a/src/Ubik.Accounting.Structure.Api/Data/Config/AccountConfiguration.cs +++ b/src/Ubik.Accounting.Structure.Api/Data/Config/AccountConfiguration.cs @@ -25,11 +25,24 @@ public void Configure(EntityTypeBuilder builder) builder.Property(a => a.TenantId) .IsRequired(); - builder.Property(a => a.CreatedAt) - .IsRequired(); + builder.OwnsOne(x => x.AuditInfo, auditInfo => + { + auditInfo.Property(a => a.ModifiedAt) + .HasColumnName("modified_at") + .IsRequired(); - builder.Property(a => a.CreatedBy) - .IsRequired(); + auditInfo.Property(a => a.ModifiedBy) + .HasColumnName("modified_by") + .IsRequired(); + + auditInfo.Property(a => a.CreatedAt) + .HasColumnName("created_at") + .IsRequired(); + + auditInfo.Property(a => a.CreatedBy) + .HasColumnName("created_by") + .IsRequired(); + }); builder.Property(a=>a.Active) .IsRequired() diff --git a/src/Ubik.Accounting.Structure.Api/Data/Config/AccountGroupConfiguration.cs b/src/Ubik.Accounting.Structure.Api/Data/Config/AccountGroupConfiguration.cs index ff7b5999..8f19c341 100644 --- a/src/Ubik.Accounting.Structure.Api/Data/Config/AccountGroupConfiguration.cs +++ b/src/Ubik.Accounting.Structure.Api/Data/Config/AccountGroupConfiguration.cs @@ -27,11 +27,24 @@ public void Configure(EntityTypeBuilder builder) builder.Property(a => a.TenantId) .IsRequired(); - builder.Property(a => a.CreatedAt) - .IsRequired(); + builder.OwnsOne(x => x.AuditInfo, auditInfo => + { + auditInfo.Property(a => a.ModifiedAt) + .HasColumnName("modified_at") + .IsRequired(); - builder.Property(a => a.CreatedBy) - .IsRequired(); + auditInfo.Property(a => a.ModifiedBy) + .HasColumnName("modified_by") + .IsRequired(); + + auditInfo.Property(a => a.CreatedAt) + .HasColumnName("created_at") + .IsRequired(); + + auditInfo.Property(a => a.CreatedBy) + .HasColumnName("created_by") + .IsRequired(); + }); builder.HasIndex(a => new { a.Code, a.ClassificationId }) .IsUnique(); diff --git a/src/Ubik.Accounting.Structure.Api/Data/Config/ClassificationConfiguration.cs b/src/Ubik.Accounting.Structure.Api/Data/Config/ClassificationConfiguration.cs index e60b9b58..32fcbfce 100644 --- a/src/Ubik.Accounting.Structure.Api/Data/Config/ClassificationConfiguration.cs +++ b/src/Ubik.Accounting.Structure.Api/Data/Config/ClassificationConfiguration.cs @@ -27,11 +27,24 @@ public void Configure(EntityTypeBuilder builder) builder.Property(a => a.TenantId) .IsRequired(); - builder.Property(a => a.CreatedAt) - .IsRequired(); - - builder.Property(a => a.CreatedBy) - .IsRequired(); + builder.OwnsOne(x => x.AuditInfo, auditInfo => + { + auditInfo.Property(a => a.ModifiedAt) + .HasColumnName("modified_at") + .IsRequired(); + + auditInfo.Property(a => a.ModifiedBy) + .HasColumnName("modified_by") + .IsRequired(); + + auditInfo.Property(a => a.CreatedAt) + .HasColumnName("created_at") + .IsRequired(); + + auditInfo.Property(a => a.CreatedBy) + .HasColumnName("created_by") + .IsRequired(); + }); builder.HasIndex(a => new { a.Code, a.TenantId }) .IsUnique(); diff --git a/src/Ubik.Accounting.Structure.Api/Data/Config/EntryConfiguration.cs b/src/Ubik.Accounting.Structure.Api/Data/Config/EntryConfiguration.cs deleted file mode 100644 index c13d18f1..00000000 --- a/src/Ubik.Accounting.Structure.Api/Data/Config/EntryConfiguration.cs +++ /dev/null @@ -1,77 +0,0 @@ -//Will be put in a dedicated service -namespace Ubik.Accounting.Structure.Api.Data.Config -{ - //public class EntryConfiguration : IEntityTypeConfiguration - //{ - // public void Configure(EntityTypeBuilder builder) - // { - // builder.ToTable("entries"); - - // builder.Property(a => a.Type) - // .IsRequired() - // .HasConversion(); - - // builder.Property(a => a.Sign) - // .IsRequired() - // .HasConversion(); - - // builder.Property(a => a.Label) - // .IsRequired() - // .HasMaxLength(100); - - // builder.Property(a => a.Description) - // .HasMaxLength(700); - - // builder.Property(a => a.Amount) - // .IsRequired() - // .HasPrecision(18, 4); - - // builder.Property(a => a.OriginalAmount) - // .HasPrecision(18, 4); - - // builder.Property(a => a.ExchangeRate) - // .HasPrecision(18, 10); - - // builder.Property(a => a.VATAppliedRate) - // .HasPrecision(8, 5); - - // builder.Property(a => a.Version) - // .IsConcurrencyToken(); - - // builder.Property(a => a.TenantId) - // .IsRequired(); - - // builder.Property(a => a.CreatedAt) - // .IsRequired(); - - // builder.Property(a => a.CreatedBy) - // .IsRequired(); - - // builder.HasIndex(a => a.TenantId); - - // builder - // .HasOne(s => s.Transaction) - // .WithMany() - // .HasForeignKey(e => e.TransactionId) - // .IsRequired(true); - - // builder - // .HasOne(s => s.Account) - // .WithMany() - // .HasForeignKey(e => e.AccountId) - // .IsRequired(true); - - // builder - // .HasOne(s => s.OriginalCurrency) - // .WithMany() - // .HasForeignKey(e => e.OriginalCurrencyId) - // .IsRequired(true); - - // builder - // .HasOne(e=> e.VatRate) - // .WithMany() - // .HasForeignKey(e => e.VatRateId) - // .IsRequired(false); - // } - //} -} diff --git a/src/Ubik.Accounting.Structure.Api/Data/Config/TransactionConfiguration.cs b/src/Ubik.Accounting.Structure.Api/Data/Config/TransactionConfiguration.cs deleted file mode 100644 index f43e0451..00000000 --- a/src/Ubik.Accounting.Structure.Api/Data/Config/TransactionConfiguration.cs +++ /dev/null @@ -1,33 +0,0 @@ -//Will be put in a dedicated service -namespace Ubik.Accounting.Structure.Api.Data.Config -{ - //public class TransactionConfiguration : IEntityTypeConfiguration - //{ - // public void Configure(EntityTypeBuilder builder) - // { - // builder.Property(a => a.Label) - // .IsRequired() - // .HasMaxLength(100); - - // builder.Property(a => a.Amount) - // .IsRequired() - // .HasPrecision(18, 4); - - // builder.Property(a => a.Version) - // .IsConcurrencyToken(); - - // builder.Property(a => a.TenantId) - // .IsRequired(); - - // builder.Property(a => a.CreatedAt) - // .IsRequired(); - - // builder.Property(a => a.CreatedBy) - // .IsRequired(); - - // builder.HasIndex(a => a.TenantId); - - // builder.HasIndex(a => a.ValueDate); - // } - //} -} diff --git a/src/Ubik.Accounting.Structure.Api/Data/Init/ClassificationsData.cs b/src/Ubik.Accounting.Structure.Api/Data/Init/ClassificationsData.cs index 620977ae..0604b381 100644 --- a/src/Ubik.Accounting.Structure.Api/Data/Init/ClassificationsData.cs +++ b/src/Ubik.Accounting.Structure.Api/Data/Init/ClassificationsData.cs @@ -1,5 +1,7 @@ using MassTransit; +using System.Security.Cryptography.Xml; using Ubik.Accounting.Structure.Api.Models; +using Ubik.DB.Common.Models; namespace Ubik.Accounting.Structure.Api.Data.Init { @@ -18,52 +20,44 @@ internal static void Load(AccountingDbContext context) new Classification { Id = baseValuesForAccountGroupClassifications.ClassificationId1, - CreatedBy = baseValuesForUsers.UserId1, - CreatedAt = baseValuesGeneral.GenerationTime, Code = "SWISSPLAN-FULL", Description = "For testing purposes", Label = "Standard Swiss Plan (full)", - ModifiedBy = baseValuesForUsers.UserId1, - ModifiedAt = baseValuesGeneral.GenerationTime, + AuditInfo = new AuditData(baseValuesGeneral.GenerationTime, baseValuesForUsers.UserId1 + ,baseValuesGeneral.GenerationTime, baseValuesForUsers.UserId1), Version = NewId.NextGuid(), TenantId = baseValuesForTenants.TenantId }, new Classification { Id = baseValuesForAccountGroupClassifications.ClassificationId2, - CreatedBy = baseValuesForUsers.UserId1, - CreatedAt = baseValuesGeneral.GenerationTime, + AuditInfo = new AuditData(baseValuesGeneral.GenerationTime, baseValuesForUsers.UserId1 + ,baseValuesGeneral.GenerationTime, baseValuesForUsers.UserId1), Code = "SWISSPLAN-TEST1", Description = null, Label = "Test data", - ModifiedBy = baseValuesForUsers.UserId1, - ModifiedAt = baseValuesGeneral.GenerationTime, Version = baseValuesForAccountGroupClassifications.ClassificationId2, TenantId = baseValuesForTenants.TenantId }, new Classification { Id = baseValuesForAccountGroupClassifications.ClassificationId3, - CreatedBy = baseValuesForUsers.UserId1, - CreatedAt = baseValuesGeneral.GenerationTime, + AuditInfo = new AuditData(baseValuesGeneral.GenerationTime, baseValuesForUsers.UserId1 + ,baseValuesGeneral.GenerationTime, baseValuesForUsers.UserId1), Code = "SWISSPLAN-TEST2", Description = null, Label = "Test data", - ModifiedBy = baseValuesForUsers.UserId1, - ModifiedAt = baseValuesGeneral.GenerationTime, Version = baseValuesForAccountGroupClassifications.ClassificationId3, TenantId = baseValuesForTenants.TenantId }, new Classification { Id = baseValuesForAccountGroupClassifications.ClassificationIdForDel, - CreatedBy = baseValuesForUsers.UserId1, - CreatedAt = baseValuesGeneral.GenerationTime, + AuditInfo = new AuditData(baseValuesGeneral.GenerationTime, baseValuesForUsers.UserId1 + ,baseValuesGeneral.GenerationTime, baseValuesForUsers.UserId1), Code = "SWISSPLAN-TESTZZZZ", Description = null, Label = "Test data", - ModifiedBy = baseValuesForUsers.UserId1, - ModifiedAt = baseValuesGeneral.GenerationTime, Version = baseValuesForAccountGroupClassifications.ClassificationIdForDel, TenantId = baseValuesForTenants.TenantId } diff --git a/src/Ubik.Accounting.Structure.Api/Models/Account.cs b/src/Ubik.Accounting.Structure.Api/Models/Account.cs index 633ed07e..4a36b072 100644 --- a/src/Ubik.Accounting.Structure.Api/Models/Account.cs +++ b/src/Ubik.Accounting.Structure.Api/Models/Account.cs @@ -1,5 +1,6 @@ using Ubik.Accounting.Structure.Contracts.Accounts.Enums; using Ubik.DB.Common; +using Ubik.DB.Common.Models; namespace Ubik.Accounting.Structure.Api.Models { @@ -15,9 +16,6 @@ public class Account : ITenantEntity, IConcurrencyCheckEntity, IAuditEntity public bool Active { get; set; } = true; public Guid Version { get; set; } public Guid TenantId { get; set; } - public DateTime CreatedAt { get; set; } - public Guid CreatedBy { get; set; } - public DateTime? ModifiedAt { get; set; } - public Guid? ModifiedBy { get; set; } + public AuditData AuditInfo { get; set; } = default!; } } diff --git a/src/Ubik.Accounting.Structure.Api/Models/AccountAccountGroup.cs b/src/Ubik.Accounting.Structure.Api/Models/AccountAccountGroup.cs index 84b8e681..0fdf0990 100644 --- a/src/Ubik.Accounting.Structure.Api/Models/AccountAccountGroup.cs +++ b/src/Ubik.Accounting.Structure.Api/Models/AccountAccountGroup.cs @@ -1,4 +1,5 @@ using Ubik.DB.Common; +using Ubik.DB.Common.Models; namespace Ubik.Accounting.Structure.Api.Models { @@ -9,9 +10,6 @@ public class AccountAccountGroup : ITenantEntity, IConcurrencyCheckEntity, IAudi public Guid AccountGroupId { get; set; } public Guid Version { get; set; } public Guid TenantId { get; set; } - public DateTime CreatedAt { get; set; } - public Guid CreatedBy { get; set; } - public DateTime? ModifiedAt { get; set; } - public Guid? ModifiedBy { get; set; } + public AuditData AuditInfo { get; set; } = default!; } } diff --git a/src/Ubik.Accounting.Structure.Api/Models/AccountGroup.cs b/src/Ubik.Accounting.Structure.Api/Models/AccountGroup.cs index dc435ab3..0fde187f 100644 --- a/src/Ubik.Accounting.Structure.Api/Models/AccountGroup.cs +++ b/src/Ubik.Accounting.Structure.Api/Models/AccountGroup.cs @@ -1,5 +1,6 @@ using System.ComponentModel.DataAnnotations; using Ubik.DB.Common; +using Ubik.DB.Common.Models; namespace Ubik.Accounting.Structure.Api.Models { @@ -14,9 +15,6 @@ public class AccountGroup : ITenantEntity, IConcurrencyCheckEntity, IAuditEntity [ConcurrencyCheck] public Guid Version { get; set; } public Guid TenantId { get; set; } - public DateTime CreatedAt { get; set; } - public Guid CreatedBy { get; set; } - public DateTime? ModifiedAt { get; set; } - public Guid? ModifiedBy { get; set; } + public AuditData AuditInfo { get; set; } = default!; } } diff --git a/src/Ubik.Accounting.Structure.Api/Models/Classification.cs b/src/Ubik.Accounting.Structure.Api/Models/Classification.cs index 0c3963a6..74c3dc74 100644 --- a/src/Ubik.Accounting.Structure.Api/Models/Classification.cs +++ b/src/Ubik.Accounting.Structure.Api/Models/Classification.cs @@ -1,5 +1,6 @@ using System.ComponentModel.DataAnnotations; using Ubik.DB.Common; +using Ubik.DB.Common.Models; namespace Ubik.Accounting.Structure.Api.Models { @@ -11,9 +12,6 @@ public class Classification : ITenantEntity, IConcurrencyCheckEntity, IAuditEnti public string? Description { get; set; } public Guid Version { get; set; } public Guid TenantId { get; set; } - public DateTime CreatedAt { get; set; } - public Guid CreatedBy { get; set; } - public DateTime? ModifiedAt { get; set; } - public Guid? ModifiedBy { get; set; } + public AuditData AuditInfo { get; set; } = default!; } } diff --git a/src/Ubik.Accounting.Structure.Api/Models/Entry.cs b/src/Ubik.Accounting.Structure.Api/Models/Entry.cs deleted file mode 100644 index d507f84b..00000000 --- a/src/Ubik.Accounting.Structure.Api/Models/Entry.cs +++ /dev/null @@ -1,44 +0,0 @@ -//Will be put in a dedicated service -namespace Ubik.Accounting.Structure.Api.Models -{ - //public enum DebitCredit - //{ - // Debit, - // Credit - //} - - //public enum EntryType - //{ - // Main, - // Counterparty, - //} - - //public class Entry : ITenantEntity, IConcurrencyCheckEntity, IAuditEntity - //{ - // public Guid Id { get; set; } - // public required EntryType Type { get; set; } - // public required DebitCredit Sign { get; set; } - // public required Guid TransactionId { get; set; } - // public Transaction? Transaction { get; set; } - // public required Guid AccountId { get; set; } - // public Account? Account { get; set; } - // //Used to keep a trace of the VAT rate applied to the entry (at a time) - // public decimal VATAppliedRate { get; set; } - // public Guid? VatRateId { get; set; } - // public VatRate? VatRate { get; set; } - // public string? Label { get; set; } - // public string? Description { get; set; } - // //See if we want the amount with or without VAT - // public required decimal Amount { get; set; } - // public decimal? OriginalAmount { get; set; } - // public Guid? OriginalCurrencyId { get; set; } - // public Currency? OriginalCurrency { get; set; } - // public decimal? ExchangeRate { get; set; } - // public Guid Version { get; set; } - // public Guid TenantId { get; set; } - // public required DateTime CreatedAt { get; set; } - // public required Guid CreatedBy { get; set; } - // public DateTime? ModifiedAt { get; set; } - // public Guid? ModifiedBy { get; set; } - //} -} diff --git a/src/Ubik.Accounting.Structure.Api/Models/Transaction.cs b/src/Ubik.Accounting.Structure.Api/Models/Transaction.cs deleted file mode 100644 index 115f402b..00000000 --- a/src/Ubik.Accounting.Structure.Api/Models/Transaction.cs +++ /dev/null @@ -1,18 +0,0 @@ -namespace Ubik.Accounting.Structure.Api.Models -{ - //Will be put in a dedicated service - //Containes the entries packet - //public class Transaction : ITenantEntity, IConcurrencyCheckEntity, IAuditEntity - //{ - // public Guid Id { get; set; } - // public required DateTime ValueDate { get; set; } - // public required string Label { get; set; } - // public decimal Amount { get; set; } - // public Guid Version { get; set; } - // public Guid TenantId { get; set; } - // public required DateTime CreatedAt { get; set; } - // public required Guid CreatedBy { get; set; } - // public DateTime? ModifiedAt { get; set; } - // public Guid? ModifiedBy { get; set; } - //} -} diff --git a/src/Ubik.Accounting.Transaction.Api/Data/AccountingTxContext.cs b/src/Ubik.Accounting.Transaction.Api/Data/AccountingTxContext.cs index 04638fe1..8f5a86ba 100644 --- a/src/Ubik.Accounting.Transaction.Api/Data/AccountingTxContext.cs +++ b/src/Ubik.Accounting.Transaction.Api/Data/AccountingTxContext.cs @@ -5,6 +5,7 @@ using Ubik.ApiService.Common.Errors; using Ubik.ApiService.Common.Exceptions; using Ubik.ApiService.Common.Services; +using Ubik.DB.Common; using Ubik.DB.Common.Extensions; namespace Ubik.Accounting.Transaction.Api.Data @@ -13,6 +14,7 @@ public class AccountingTxContext(DbContextOptions options , ICurrentUser userService) : DbContext(options) { public DbSet Entries { get; set; } + public DbSet Txs { get; set; } public DbSet Accounts { get; set; } public DbSet TaxRates { get; set; } @@ -54,24 +56,19 @@ public void SetAuditAndSpecialFields() protected override void OnModelCreating(ModelBuilder modelBuilder) { - //Build for Masstransit inbox/outbox + // Build for Masstransit inbox/outbox modelBuilder.AddInboxStateEntity(); modelBuilder.AddOutboxMessageEntity(); modelBuilder.AddOutboxStateEntity(); - //TenantId + // TenantId SetTenantId(modelBuilder); - //Configure + // Configure new EntryConfiguration().Configure(modelBuilder.Entity()); new AccountConfiguration().Configure(modelBuilder.Entity()); new TaxRateConfiguration().Configure(modelBuilder.Entity()); - //new AccountGroupConfiguration().Configure(modelBuilder.Entity()); - //new AccountConfiguration().Configure(modelBuilder.Entity()); - //new AccountAccountGroupConfiguration().Configure(modelBuilder.Entity()); - //new ApplicationConfiguration().Configure(modelBuilder.Entity()); - //new TransactionConfiguration().Configure(modelBuilder.Entity()); - //new EntryConfiguration().Configure(modelBuilder.Entity()); + new TxConfiguration().Configure(modelBuilder.Entity()); base.OnModelCreating(modelBuilder); } @@ -87,6 +84,9 @@ private void SetTenantId(ModelBuilder modelBuilder) modelBuilder.Entity() .HasQueryFilter(mt => mt.TenantId == userService.TenantId); + modelBuilder.Entity() + .HasQueryFilter(mt => mt.TenantId == userService.TenantId); + //modelBuilder.Entity() // .HasQueryFilter(mt => mt.TenantId == _currentUser.TenantId); diff --git a/src/Ubik.Accounting.Transaction.Api/Data/Config/EntryConfiguration.cs b/src/Ubik.Accounting.Transaction.Api/Data/Config/EntryConfiguration.cs index c7ea5705..3cfce3e9 100644 --- a/src/Ubik.Accounting.Transaction.Api/Data/Config/EntryConfiguration.cs +++ b/src/Ubik.Accounting.Transaction.Api/Data/Config/EntryConfiguration.cs @@ -88,11 +88,24 @@ public void Configure(EntityTypeBuilder builder) builder.Property(a => a.TenantId) .IsRequired(); - builder.Property(a => a.CreatedAt) - .IsRequired(); + builder.OwnsOne(x => x.AuditInfo, auditInfo => + { + auditInfo.Property(a => a.ModifiedAt) + .HasColumnName("modified_at") + .IsRequired(); - builder.Property(a => a.CreatedBy) - .IsRequired(); + auditInfo.Property(a => a.ModifiedBy) + .HasColumnName("modified_by") + .IsRequired(); + + auditInfo.Property(a => a.CreatedAt) + .HasColumnName("created_at") + .IsRequired(); + + auditInfo.Property(a => a.CreatedBy) + .HasColumnName("created_by") + .IsRequired(); + }); builder.HasIndex(a => a.TenantId); } diff --git a/src/Ubik.Accounting.Transaction.Api/Data/Config/TxConfiguration.cs b/src/Ubik.Accounting.Transaction.Api/Data/Config/TxConfiguration.cs index 68e16bd5..5e36df48 100644 --- a/src/Ubik.Accounting.Transaction.Api/Data/Config/TxConfiguration.cs +++ b/src/Ubik.Accounting.Transaction.Api/Data/Config/TxConfiguration.cs @@ -1,6 +1,32 @@ -namespace Ubik.Accounting.Transaction.Api.Data.Config +using Microsoft.EntityFrameworkCore.Metadata.Builders; +using Microsoft.EntityFrameworkCore; +using Ubik.Accounting.Transaction.Api.Models; + +namespace Ubik.Accounting.Transaction.Api.Data.Config { - public class TxConfiguration + public class TxConfiguration : IEntityTypeConfiguration { + public void Configure(EntityTypeBuilder builder) + { + builder.OwnsOne(x => x.AuditInfo, auditInfo => + { + auditInfo.Property(a => a.ModifiedAt) + .HasColumnName("modified_at") + .IsRequired(); + + auditInfo.Property(a => a.ModifiedBy) + .HasColumnName("modified_by") + .IsRequired(); + + auditInfo.Property(a => a.CreatedAt) + .HasColumnName("created_at") + .IsRequired(); + + auditInfo.Property(a => a.CreatedBy) + .HasColumnName("created_by") + .IsRequired(); + }); + } } + } diff --git a/src/Ubik.Accounting.Transaction.Api/Features/Txs/Services/ITxCommandService.cs b/src/Ubik.Accounting.Transaction.Api/Features/Txs/Services/ITxCommandService.cs new file mode 100644 index 00000000..f8421ccf --- /dev/null +++ b/src/Ubik.Accounting.Transaction.Api/Features/Txs/Services/ITxCommandService.cs @@ -0,0 +1,10 @@ +using LanguageExt; +using Ubik.ApiService.Common.Errors; + +namespace Ubik.Accounting.Transaction.Api.Features.Txs.Services +{ + public interface ITxCommandService + { + //public Task> SumbitTx(SubmitTxCommand command); + } +} diff --git a/src/Ubik.Accounting.Transaction.Api/Models/Entry.cs b/src/Ubik.Accounting.Transaction.Api/Models/Entry.cs index bd5cfed4..997a71be 100644 --- a/src/Ubik.Accounting.Transaction.Api/Models/Entry.cs +++ b/src/Ubik.Accounting.Transaction.Api/Models/Entry.cs @@ -1,6 +1,7 @@ using LanguageExt; using Ubik.Accounting.Transaction.Contracts.Entries.Enums; using Ubik.DB.Common; +using Ubik.DB.Common.Models; namespace Ubik.Accounting.Transaction.Api.Models { @@ -20,9 +21,6 @@ public class Entry : ITenantEntity, IConcurrencyCheckEntity, IAuditEntity public TaxInfo? TaxInfo { get; set; } = default!; public Guid Version { get; set; } public Guid TenantId { get; set; } - public required DateTime CreatedAt { get; set; } - public required Guid CreatedBy { get; set; } - public DateTime? ModifiedAt { get; set; } - public Guid? ModifiedBy { get; set; } + public AuditData AuditInfo { get; set; } = default!; } } diff --git a/src/Ubik.Accounting.Transaction.Api/Models/Tx.cs b/src/Ubik.Accounting.Transaction.Api/Models/Tx.cs index 0b4214f8..8e0b7c07 100644 --- a/src/Ubik.Accounting.Transaction.Api/Models/Tx.cs +++ b/src/Ubik.Accounting.Transaction.Api/Models/Tx.cs @@ -1,4 +1,5 @@ using Ubik.DB.Common; +using Ubik.DB.Common.Models; namespace Ubik.Accounting.Transaction.Api.Models { @@ -10,9 +11,6 @@ public class Tx : ITenantEntity, IConcurrencyCheckEntity, IAuditEntity public decimal Amount { get; set; } public Guid Version { get; set; } public Guid TenantId { get; set; } - public required DateTime CreatedAt { get; set; } - public required Guid CreatedBy { get; set; } - public DateTime? ModifiedAt { get; set; } - public Guid? ModifiedBy { get; set; } + public AuditData AuditInfo { get; set; } = default!; } } diff --git a/src/Ubik.Accounting.Transaction.Api/Ubik.Accounting.Transaction.Api.csproj b/src/Ubik.Accounting.Transaction.Api/Ubik.Accounting.Transaction.Api.csproj index 0cef88f4..826cface 100644 --- a/src/Ubik.Accounting.Transaction.Api/Ubik.Accounting.Transaction.Api.csproj +++ b/src/Ubik.Accounting.Transaction.Api/Ubik.Accounting.Transaction.Api.csproj @@ -23,10 +23,6 @@ - - - - Always diff --git a/src/Ubik.Db.Common/Ubik.DB.Common/Extensions/ChangeTrackerExtensions.cs b/src/Ubik.Db.Common/Ubik.DB.Common/Extensions/ChangeTrackerExtensions.cs index 6310f733..d0e49839 100644 --- a/src/Ubik.Db.Common/Ubik.DB.Common/Extensions/ChangeTrackerExtensions.cs +++ b/src/Ubik.Db.Common/Ubik.DB.Common/Extensions/ChangeTrackerExtensions.cs @@ -2,6 +2,7 @@ using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.ChangeTracking; using Ubik.ApiService.Common.Services; +using Ubik.DB.Common.Models; namespace Ubik.DB.Common.Extensions { @@ -53,14 +54,10 @@ private static void SetAuditFields(IEnumerable entities, ICurrentUs switch (entry.State) { case EntityState.Added: - entity.CreatedAt = timestamp; - entity.CreatedBy = userId; - entity.ModifiedAt = timestamp; - entity.ModifiedBy = userId; + entity.AuditInfo = new AuditData(timestamp, userId, timestamp, userId); break; case EntityState.Modified: - entity.ModifiedAt = timestamp; - entity.ModifiedBy = userId; + entity.AuditInfo.SetModified(timestamp, userId); break; } } diff --git a/src/Ubik.Db.Common/Ubik.DB.Common/IAuditEntity.cs b/src/Ubik.Db.Common/Ubik.DB.Common/IAuditEntity.cs index e0cf5450..e3c9740d 100644 --- a/src/Ubik.Db.Common/Ubik.DB.Common/IAuditEntity.cs +++ b/src/Ubik.Db.Common/Ubik.DB.Common/IAuditEntity.cs @@ -1,11 +1,9 @@ -namespace Ubik.DB.Common +using Ubik.DB.Common.Models; + +namespace Ubik.DB.Common { public interface IAuditEntity { - public DateTime CreatedAt { get; set; } - public Guid CreatedBy { get; set; } - public DateTime? ModifiedAt { get; set; } - public Guid? ModifiedBy { get; set; } - + public AuditData AuditInfo { get; set; } } } diff --git a/src/Ubik.Db.Common/Ubik.DB.Common/Models/AuditData.cs b/src/Ubik.Db.Common/Ubik.DB.Common/Models/AuditData.cs new file mode 100644 index 00000000..c2518ae3 --- /dev/null +++ b/src/Ubik.Db.Common/Ubik.DB.Common/Models/AuditData.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Ubik.DB.Common.Models +{ + public class AuditData + { + public DateTime CreatedAt { get; private set; } + public Guid CreatedBy { get; private set; } + public DateTime ModifiedAt { get; private set; } + public Guid ModifiedBy { get; private set; } + + public AuditData(DateTime createdAt, Guid createdBy, DateTime modifiedAt, Guid modifiedBy) + { + CreatedAt = createdAt; + CreatedBy = createdBy; + ModifiedAt = modifiedAt; + ModifiedBy = modifiedBy; + } + + public void SetModified(DateTime modifiedAt, Guid modifiedBy) + { + ModifiedAt = modifiedAt; + ModifiedBy = modifiedBy; + } + } +} diff --git a/src/Ubik.Security.Api/Data/Config/AuthorizationConfiguration.cs b/src/Ubik.Security.Api/Data/Config/AuthorizationConfiguration.cs index 69862241..b16b2272 100644 --- a/src/Ubik.Security.Api/Data/Config/AuthorizationConfiguration.cs +++ b/src/Ubik.Security.Api/Data/Config/AuthorizationConfiguration.cs @@ -25,11 +25,24 @@ public void Configure(EntityTypeBuilder builder) builder.Property(a => a.Version) .IsConcurrencyToken(); - builder.Property(a => a.CreatedAt) - .IsRequired(); + builder.OwnsOne(x => x.AuditInfo, auditInfo => + { + auditInfo.Property(a => a.ModifiedAt) + .HasColumnName("modified_at") + .IsRequired(); - builder.Property(a => a.CreatedBy) - .IsRequired(); + auditInfo.Property(a => a.ModifiedBy) + .HasColumnName("modified_by") + .IsRequired(); + + auditInfo.Property(a => a.CreatedAt) + .HasColumnName("created_at") + .IsRequired(); + + auditInfo.Property(a => a.CreatedBy) + .HasColumnName("created_by") + .IsRequired(); + }); } } } diff --git a/src/Ubik.Security.Api/Data/Config/RoleAuthorizationConfiguration.cs b/src/Ubik.Security.Api/Data/Config/RoleAuthorizationConfiguration.cs index 09f2fcc3..d3253942 100644 --- a/src/Ubik.Security.Api/Data/Config/RoleAuthorizationConfiguration.cs +++ b/src/Ubik.Security.Api/Data/Config/RoleAuthorizationConfiguration.cs @@ -22,6 +22,25 @@ public void Configure(EntityTypeBuilder builder) builder.Property(a => a.Version) .IsConcurrencyToken(); + builder.OwnsOne(x => x.AuditInfo, auditInfo => + { + auditInfo.Property(a => a.ModifiedAt) + .HasColumnName("modified_at") + .IsRequired(); + + auditInfo.Property(a => a.ModifiedBy) + .HasColumnName("modified_by") + .IsRequired(); + + auditInfo.Property(a => a.CreatedAt) + .HasColumnName("created_at") + .IsRequired(); + + auditInfo.Property(a => a.CreatedBy) + .HasColumnName("created_by") + .IsRequired(); + }); + builder .HasOne() .WithMany() diff --git a/src/Ubik.Security.Api/Data/Config/RoleConfiguration.cs b/src/Ubik.Security.Api/Data/Config/RoleConfiguration.cs index 5642e13d..0dd3b7e4 100644 --- a/src/Ubik.Security.Api/Data/Config/RoleConfiguration.cs +++ b/src/Ubik.Security.Api/Data/Config/RoleConfiguration.cs @@ -25,11 +25,24 @@ public void Configure(EntityTypeBuilder builder) builder.Property(a => a.Version) .IsConcurrencyToken(); - builder.Property(a => a.CreatedAt) - .IsRequired(); - - builder.Property(a => a.CreatedBy) - .IsRequired(); + builder.OwnsOne(x => x.AuditInfo, auditInfo => + { + auditInfo.Property(a => a.ModifiedAt) + .HasColumnName("modified_at") + .IsRequired(); + + auditInfo.Property(a => a.ModifiedBy) + .HasColumnName("modified_by") + .IsRequired(); + + auditInfo.Property(a => a.CreatedAt) + .HasColumnName("created_at") + .IsRequired(); + + auditInfo.Property(a => a.CreatedBy) + .HasColumnName("created_by") + .IsRequired(); + }); //When it's a role specific to a tenant builder diff --git a/src/Ubik.Security.Api/Data/Config/TenantConfiguration.cs b/src/Ubik.Security.Api/Data/Config/TenantConfiguration.cs index ba3970b8..19a2ab43 100644 --- a/src/Ubik.Security.Api/Data/Config/TenantConfiguration.cs +++ b/src/Ubik.Security.Api/Data/Config/TenantConfiguration.cs @@ -25,11 +25,24 @@ public void Configure(EntityTypeBuilder builder) builder.Property(a => a.IsActivated) .IsRequired(); - builder.Property(a => a.CreatedAt) - .IsRequired(); - - builder.Property(a => a.CreatedBy) - .IsRequired(); + builder.OwnsOne(x => x.AuditInfo, auditInfo => + { + auditInfo.Property(a => a.ModifiedAt) + .HasColumnName("modified_at") + .IsRequired(); + + auditInfo.Property(a => a.ModifiedBy) + .HasColumnName("modified_by") + .IsRequired(); + + auditInfo.Property(a => a.CreatedAt) + .HasColumnName("created_at") + .IsRequired(); + + auditInfo.Property(a => a.CreatedBy) + .HasColumnName("created_by") + .IsRequired(); + }); builder.HasIndex(a => a.Code) .IsUnique(); diff --git a/src/Ubik.Security.Api/Data/Config/UserConfiguration.cs b/src/Ubik.Security.Api/Data/Config/UserConfiguration.cs index 2bc971ca..8502c756 100644 --- a/src/Ubik.Security.Api/Data/Config/UserConfiguration.cs +++ b/src/Ubik.Security.Api/Data/Config/UserConfiguration.cs @@ -21,11 +21,24 @@ public void Configure(EntityTypeBuilder builder) builder.Property(a => a.Version) .IsConcurrencyToken(); - builder.Property(a => a.CreatedAt) - .IsRequired(); - - builder.Property(a => a.CreatedBy) - .IsRequired(); + builder.OwnsOne(x => x.AuditInfo, auditInfo => + { + auditInfo.Property(a => a.ModifiedAt) + .HasColumnName("modified_at") + .IsRequired(); + + auditInfo.Property(a => a.ModifiedBy) + .HasColumnName("modified_by") + .IsRequired(); + + auditInfo.Property(a => a.CreatedAt) + .HasColumnName("created_at") + .IsRequired(); + + auditInfo.Property(a => a.CreatedBy) + .HasColumnName("created_by") + .IsRequired(); + }); builder.HasIndex(a => a.Email) .IsUnique(); diff --git a/src/Ubik.Security.Api/Data/Config/UserRoleByTenantConfiguration.cs b/src/Ubik.Security.Api/Data/Config/UserRoleByTenantConfiguration.cs index e5092402..29453e18 100644 --- a/src/Ubik.Security.Api/Data/Config/UserRoleByTenantConfiguration.cs +++ b/src/Ubik.Security.Api/Data/Config/UserRoleByTenantConfiguration.cs @@ -13,6 +13,25 @@ public void Configure(EntityTypeBuilder builder) builder.HasIndex(a => new { a.UserTenantId, a.RoleId }) .IsUnique(); + builder.OwnsOne(x => x.AuditInfo, auditInfo => + { + auditInfo.Property(a => a.ModifiedAt) + .HasColumnName("modified_at") + .IsRequired(); + + auditInfo.Property(a => a.ModifiedBy) + .HasColumnName("modified_by") + .IsRequired(); + + auditInfo.Property(a => a.CreatedAt) + .HasColumnName("created_at") + .IsRequired(); + + auditInfo.Property(a => a.CreatedBy) + .HasColumnName("created_by") + .IsRequired(); + }); + builder.Property(a => a.Version) .IsConcurrencyToken(); diff --git a/src/Ubik.Security.Api/Data/Config/UserTenantConfiguration.cs b/src/Ubik.Security.Api/Data/Config/UserTenantConfiguration.cs index 0a76bf0b..f448d9b0 100644 --- a/src/Ubik.Security.Api/Data/Config/UserTenantConfiguration.cs +++ b/src/Ubik.Security.Api/Data/Config/UserTenantConfiguration.cs @@ -22,6 +22,25 @@ public void Configure(EntityTypeBuilder builder) builder.Property(a => a.Version) .IsConcurrencyToken(); + builder.OwnsOne(x => x.AuditInfo, auditInfo => + { + auditInfo.Property(a => a.ModifiedAt) + .HasColumnName("modified_at") + .IsRequired(); + + auditInfo.Property(a => a.ModifiedBy) + .HasColumnName("modified_by") + .IsRequired(); + + auditInfo.Property(a => a.CreatedAt) + .HasColumnName("created_at") + .IsRequired(); + + auditInfo.Property(a => a.CreatedBy) + .HasColumnName("created_by") + .IsRequired(); + }); + //TODO: very dangerous, change that builder .HasOne() diff --git a/src/Ubik.Security.Api/Models/Authorization.cs b/src/Ubik.Security.Api/Models/Authorization.cs index 9295f06f..5670ffb9 100644 --- a/src/Ubik.Security.Api/Models/Authorization.cs +++ b/src/Ubik.Security.Api/Models/Authorization.cs @@ -1,4 +1,5 @@ using Ubik.DB.Common; +using Ubik.DB.Common.Models; namespace Ubik.Security.Api.Models { @@ -9,9 +10,6 @@ public class Authorization : IConcurrencyCheckEntity, IAuditEntity public required string Label { get; set; } public string? Description { get; set; } public Guid Version { get; set; } - public DateTime CreatedAt { get; set; } - public Guid CreatedBy { get; set; } - public DateTime? ModifiedAt { get; set; } - public Guid? ModifiedBy { get; set; } + public AuditData AuditInfo { get; set; } = default!; } } diff --git a/src/Ubik.Security.Api/Models/Role.cs b/src/Ubik.Security.Api/Models/Role.cs index b71d8f17..1650f3eb 100644 --- a/src/Ubik.Security.Api/Models/Role.cs +++ b/src/Ubik.Security.Api/Models/Role.cs @@ -1,4 +1,5 @@ using Ubik.DB.Common; +using Ubik.DB.Common.Models; namespace Ubik.Security.Api.Models { @@ -10,9 +11,6 @@ public class Role : IConcurrencyCheckEntity, IAuditEntity public string? Description { get; set; } public Guid? TenantId { get; set; } public Guid Version { get; set; } - public DateTime CreatedAt { get; set; } - public Guid CreatedBy { get; set; } - public DateTime? ModifiedAt { get; set; } - public Guid? ModifiedBy { get; set; } + public AuditData AuditInfo { get; set; } = default!; } } diff --git a/src/Ubik.Security.Api/Models/RoleAuthorization.cs b/src/Ubik.Security.Api/Models/RoleAuthorization.cs index 73837b6d..f11c0dda 100644 --- a/src/Ubik.Security.Api/Models/RoleAuthorization.cs +++ b/src/Ubik.Security.Api/Models/RoleAuthorization.cs @@ -1,4 +1,5 @@ using Ubik.DB.Common; +using Ubik.DB.Common.Models; namespace Ubik.Security.Api.Models { @@ -8,9 +9,6 @@ public class RoleAuthorization : IConcurrencyCheckEntity, IAuditEntity public Guid RoleId { get; set; } public Guid AuthorizationId { get; set; } public Guid Version { get; set; } - public DateTime CreatedAt { get; set; } - public Guid CreatedBy { get; set; } - public DateTime? ModifiedAt { get; set; } - public Guid? ModifiedBy { get; set; } + public AuditData AuditInfo { get; set; } = default!; } } diff --git a/src/Ubik.Security.Api/Models/Tenant.cs b/src/Ubik.Security.Api/Models/Tenant.cs index 7cf3d935..6e8040f1 100644 --- a/src/Ubik.Security.Api/Models/Tenant.cs +++ b/src/Ubik.Security.Api/Models/Tenant.cs @@ -1,4 +1,5 @@ using Ubik.DB.Common; +using Ubik.DB.Common.Models; namespace Ubik.Security.Api.Models { @@ -10,9 +11,6 @@ public class Tenant : IConcurrencyCheckEntity, IAuditEntity public required string Description { get; set; } public bool IsActivated { get; set; } = true; public Guid Version { get; set; } - public DateTime CreatedAt { get; set; } - public Guid CreatedBy { get; set; } - public DateTime? ModifiedAt { get; set; } - public Guid? ModifiedBy { get; set; } + public AuditData AuditInfo { get; set; } = default!; } } diff --git a/src/Ubik.Security.Api/Models/User.cs b/src/Ubik.Security.Api/Models/User.cs index db02392d..10cae079 100644 --- a/src/Ubik.Security.Api/Models/User.cs +++ b/src/Ubik.Security.Api/Models/User.cs @@ -1,4 +1,5 @@ using Ubik.DB.Common; +using Ubik.DB.Common.Models; namespace Ubik.Security.Api.Models { @@ -12,9 +13,6 @@ public class User : IConcurrencyCheckEntity, IAuditEntity public bool IsMegaAdmin { get; set; } = false; public Guid? SelectedTenantId { get; set; } public Guid Version { get; set; } - public DateTime CreatedAt { get; set; } - public Guid CreatedBy { get; set; } - public DateTime? ModifiedAt { get; set; } - public Guid? ModifiedBy { get; set; } + public AuditData AuditInfo { get; set; } = default!; } } diff --git a/src/Ubik.Security.Api/Models/UserRoleByTenant.cs b/src/Ubik.Security.Api/Models/UserRoleByTenant.cs index 1ed41672..8e11dc14 100644 --- a/src/Ubik.Security.Api/Models/UserRoleByTenant.cs +++ b/src/Ubik.Security.Api/Models/UserRoleByTenant.cs @@ -1,4 +1,5 @@ using Ubik.DB.Common; +using Ubik.DB.Common.Models; namespace Ubik.Security.Api.Models { @@ -8,9 +9,6 @@ public class UserRoleByTenant : IConcurrencyCheckEntity, IAuditEntity public Guid UserTenantId { get; set; } public Guid RoleId { get; set; } public Guid Version { get; set; } - public DateTime CreatedAt { get; set; } - public Guid CreatedBy { get; set; } - public DateTime? ModifiedAt { get; set; } - public Guid? ModifiedBy { get; set; } + public AuditData AuditInfo { get; set; } = default!; } } diff --git a/src/Ubik.Security.Api/Models/UserTenant.cs b/src/Ubik.Security.Api/Models/UserTenant.cs index fad8f4be..6d7111f3 100644 --- a/src/Ubik.Security.Api/Models/UserTenant.cs +++ b/src/Ubik.Security.Api/Models/UserTenant.cs @@ -1,4 +1,5 @@ using Ubik.DB.Common; +using Ubik.DB.Common.Models; namespace Ubik.Security.Api.Models { @@ -8,9 +9,6 @@ public class UserTenant: IConcurrencyCheckEntity, IAuditEntity public Guid UserId { get; set; } public Guid TenantId { get; set; } public Guid Version { get; set; } - public DateTime CreatedAt { get; set; } - public Guid CreatedBy { get; set; } - public DateTime? ModifiedAt { get; set; } - public Guid? ModifiedBy { get; set; } + public AuditData AuditInfo { get; set; } = default!; } } From 00817e5dd44650b11c8394260f9159e8ff6e4d75 Mon Sep 17 00:00:00 2001 From: fdonnet Date: Thu, 7 Nov 2024 17:09:51 +0100 Subject: [PATCH 60/94] docker support for tx api --- .../Dockerfile | 35 +++++++++++++++ .../Properties/launchSettings.json | 45 +++++++++++-------- .../Ubik.Accounting.Transaction.Api.csproj | 4 ++ 3 files changed, 66 insertions(+), 18 deletions(-) create mode 100644 src/Ubik.Accounting.Transaction.Api/Dockerfile diff --git a/src/Ubik.Accounting.Transaction.Api/Dockerfile b/src/Ubik.Accounting.Transaction.Api/Dockerfile new file mode 100644 index 00000000..ed777358 --- /dev/null +++ b/src/Ubik.Accounting.Transaction.Api/Dockerfile @@ -0,0 +1,35 @@ +# See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging. + +# This stage is used when running from VS in fast mode (Default for Debug configuration) +FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base +USER app +WORKDIR /app +EXPOSE 8080 +EXPOSE 8081 + + +# This stage is used to build the service project +FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build +ARG BUILD_CONFIGURATION=Release +WORKDIR / +COPY ["src/Ubik.Accounting.Transaction.Api/Ubik.Accounting.Transaction.Api.csproj", "src/Ubik.Accounting.Transaction.Api/"] +COPY ["src/Ubik.Accounting.SalesOrVatTax.Contracts/Ubik.Accounting.SalesOrVatTax.Contracts.csproj", "src/Ubik.Accounting.SalesOrVatTax.Contracts/"] +COPY ["src/Ubik.Accounting.Structure.Contracts/Ubik.Accounting.Structure.Contracts.csproj", "src/Ubik.Accounting.Structure.Contracts/"] +COPY ["src/Ubik.Accounting.Transaction.Contracts/Ubik.Accounting.Transaction.Contracts.csproj", "src/Ubik.Accounting.Transaction.Contracts/"] +COPY ["src/Ubik.ApiService.Common/Ubik.ApiService.Common.csproj", "src/Ubik.ApiService.Common/"] +COPY ["src/Ubik.Db.Common/Ubik.DB.Common/Ubik.DB.Common.csproj", "src/Ubik.Db.Common/Ubik.DB.Common/"] +RUN dotnet restore "./src/Ubik.Accounting.Transaction.Api/Ubik.Accounting.Transaction.Api.csproj" +COPY . . +WORKDIR "/src/src/Ubik.Accounting.Transaction.Api" +RUN dotnet build "./Ubik.Accounting.Transaction.Api.csproj" -c $BUILD_CONFIGURATION -o /app/build + +# This stage is used to publish the service project to be copied to the final stage +FROM build AS publish +ARG BUILD_CONFIGURATION=Release +RUN dotnet publish "./Ubik.Accounting.Transaction.Api.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false + +# This stage is used in production or when running from VS in regular mode (Default when not using the Debug configuration) +FROM base AS final +WORKDIR /app +COPY --from=publish /app/publish . +ENTRYPOINT ["dotnet", "Ubik.Accounting.Transaction.Api.dll"] diff --git a/src/Ubik.Accounting.Transaction.Api/Properties/launchSettings.json b/src/Ubik.Accounting.Transaction.Api/Properties/launchSettings.json index b8437990..acf4e790 100644 --- a/src/Ubik.Accounting.Transaction.Api/Properties/launchSettings.json +++ b/src/Ubik.Accounting.Transaction.Api/Properties/launchSettings.json @@ -1,33 +1,23 @@ -{ - "$schema": "http://json.schemastore.org/launchsettings.json", - "iisSettings": { - "windowsAuthentication": false, - "anonymousAuthentication": true, - "iisExpress": { - "applicationUrl": "http://localhost:47209", - "sslPort": 44393 - } - }, +{ "profiles": { "http": { "commandName": "Project", - "dotnetRunMessages": true, "launchBrowser": true, "launchUrl": "swagger", - "applicationUrl": "http://localhost:5201", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" - } + }, + "dotnetRunMessages": true, + "applicationUrl": "http://localhost:5201" }, "https": { "commandName": "Project", - "dotnetRunMessages": true, - "launchBrowser": false, "launchUrl": "swagger", - "applicationUrl": "https://localhost:7053;http://localhost:5201", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" - } + }, + "dotnetRunMessages": true, + "applicationUrl": "https://localhost:7053;http://localhost:5201" }, "IIS Express": { "commandName": "IISExpress", @@ -36,6 +26,25 @@ "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" } + }, + "Container (Dockerfile)": { + "commandName": "Docker", + "launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}/swagger", + "environmentVariables": { + "ASPNETCORE_HTTPS_PORTS": "8081", + "ASPNETCORE_HTTP_PORTS": "8080" + }, + "publishAllPorts": true, + "useSSL": true + } + }, + "$schema": "http://json.schemastore.org/launchsettings.json", + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:47209", + "sslPort": 44393 } } -} +} \ No newline at end of file diff --git a/src/Ubik.Accounting.Transaction.Api/Ubik.Accounting.Transaction.Api.csproj b/src/Ubik.Accounting.Transaction.Api/Ubik.Accounting.Transaction.Api.csproj index 826cface..ab90f512 100644 --- a/src/Ubik.Accounting.Transaction.Api/Ubik.Accounting.Transaction.Api.csproj +++ b/src/Ubik.Accounting.Transaction.Api/Ubik.Accounting.Transaction.Api.csproj @@ -4,6 +4,9 @@ net8.0 enable enable + d337cfef-0f21-4554-9dff-619334c801cb + Linux + ..\.. @@ -11,6 +14,7 @@ + From 52c9539dfd831039fa6d3196856a082e01527983 Mon Sep 17 00:00:00 2001 From: fdonnet Date: Thu, 7 Nov 2024 17:35:48 +0100 Subject: [PATCH 61/94] Prepare for Submit TX --- .../Features/Txs/Services/TxCommandService.cs | 6 +++ .../Txs/Commands/SubmitTxCommand.cs | 44 +++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 src/Ubik.Accounting.Transaction.Api/Features/Txs/Services/TxCommandService.cs create mode 100644 src/Ubik.Accounting.Transaction.Contracts/Txs/Commands/SubmitTxCommand.cs diff --git a/src/Ubik.Accounting.Transaction.Api/Features/Txs/Services/TxCommandService.cs b/src/Ubik.Accounting.Transaction.Api/Features/Txs/Services/TxCommandService.cs new file mode 100644 index 00000000..866e73fa --- /dev/null +++ b/src/Ubik.Accounting.Transaction.Api/Features/Txs/Services/TxCommandService.cs @@ -0,0 +1,6 @@ +namespace Ubik.Accounting.Transaction.Api.Features.Txs.Services +{ + public class TxCommandService + { + } +} diff --git a/src/Ubik.Accounting.Transaction.Contracts/Txs/Commands/SubmitTxCommand.cs b/src/Ubik.Accounting.Transaction.Contracts/Txs/Commands/SubmitTxCommand.cs new file mode 100644 index 00000000..b380bbe6 --- /dev/null +++ b/src/Ubik.Accounting.Transaction.Contracts/Txs/Commands/SubmitTxCommand.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Ubik.Accounting.Transaction.Contracts.Entries.Enums; + +namespace Ubik.Accounting.Transaction.Contracts.Txs.Commands +{ + public record SubmitTxCommand + { + public Guid Id { get; init; } + public required DateOnly ValueDate { get; init; } + public required string Label { get; init; } + public decimal Amount { get; init; } + public IEnumerable Entries { get; init; } = default!; + } + + public record TxEntry + { + public required EntryType Type { get; init; } + public required DebitCredit Sign { get; init; } + public required Guid AccountId { get; init; } + public string? Label { get; set; } + public string? Description { get; set; } + public required decimal Amount { get; set; } + public TxEntryAdditionalAmountInfo? AmountAdditionnalInfo { get; set; } + public TxEntryTaxInfo? TaxInfo { get; set; } = default!; + } + + public record TxEntryAdditionalAmountInfo + { + public decimal OriginalAmount { get; init; } + public Guid OriginalCurrencyId { get; init; } + public decimal ExchangeRate { get; init; } + } + + public record TxEntryTaxInfo + { + public decimal TaxAppliedRate { get; init; } + public Guid TaxRateId { get; init; } + } +} From d0a70c5d4ee6c190851e44f3103ae60bdb7f713b Mon Sep 17 00:00:00 2001 From: fdonnet Date: Thu, 7 Nov 2024 18:05:31 +0100 Subject: [PATCH 62/94] Begin for tx submit --- .../Data/Config/EntryConfiguration.cs | 12 +++++++++++- .../Data/Config/TxConfiguration.cs | 17 +++++++++++++++++ .../Models/Tx.cs | 1 - .../Txs/Commands/SubmitTxCommand.cs | 11 +++++------ 4 files changed, 33 insertions(+), 8 deletions(-) diff --git a/src/Ubik.Accounting.Transaction.Api/Data/Config/EntryConfiguration.cs b/src/Ubik.Accounting.Transaction.Api/Data/Config/EntryConfiguration.cs index 3cfce3e9..4eb82369 100644 --- a/src/Ubik.Accounting.Transaction.Api/Data/Config/EntryConfiguration.cs +++ b/src/Ubik.Accounting.Transaction.Api/Data/Config/EntryConfiguration.cs @@ -9,7 +9,12 @@ public class EntryConfiguration : IEntityTypeConfiguration { public void Configure(EntityTypeBuilder builder) { - builder.ToTable("entries"); + //builder.ToTable("entries"); + + builder.ToTable("entries", t => + { + t.HasCheckConstraint("ck_entry_label_main_type", "type != 0 OR label IS NOT NULL"); + }); builder.Property(a => a.Type) .IsRequired() @@ -66,6 +71,8 @@ public void Configure(EntityTypeBuilder builder) .IsRequired(false); }); + builder.Navigation(m => m.AmountAdditionnalInfo).IsRequired(false); + builder.OwnsOne(a => a.TaxInfo, taxInfo => { taxInfo.Ignore(t => t.TaxAppliedRate); @@ -82,6 +89,8 @@ public void Configure(EntityTypeBuilder builder) .IsRequired(false); }); + builder.Navigation(m => m.TaxInfo).IsRequired(false); + builder.Property(a => a.Version) .IsConcurrencyToken(); @@ -108,6 +117,7 @@ public void Configure(EntityTypeBuilder builder) }); builder.HasIndex(a => a.TenantId); + } } } diff --git a/src/Ubik.Accounting.Transaction.Api/Data/Config/TxConfiguration.cs b/src/Ubik.Accounting.Transaction.Api/Data/Config/TxConfiguration.cs index 5e36df48..dd0796c5 100644 --- a/src/Ubik.Accounting.Transaction.Api/Data/Config/TxConfiguration.cs +++ b/src/Ubik.Accounting.Transaction.Api/Data/Config/TxConfiguration.cs @@ -8,6 +8,23 @@ public class TxConfiguration : IEntityTypeConfiguration { public void Configure(EntityTypeBuilder builder) { + builder.Property(x => x.Amount) + .IsRequired() + .HasPrecision(18, 4); + + builder.Property(x => x.ValueDate) + .IsRequired(); + + builder.Property(a => a.Version) + .IsConcurrencyToken(); + + builder.Property(a => a.TenantId) + .IsRequired(); + + builder.HasIndex(x => x.TenantId).IsUnique(); + + builder.HasIndex(x => x.ValueDate); + builder.OwnsOne(x => x.AuditInfo, auditInfo => { auditInfo.Property(a => a.ModifiedAt) diff --git a/src/Ubik.Accounting.Transaction.Api/Models/Tx.cs b/src/Ubik.Accounting.Transaction.Api/Models/Tx.cs index 8e0b7c07..e2dbbade 100644 --- a/src/Ubik.Accounting.Transaction.Api/Models/Tx.cs +++ b/src/Ubik.Accounting.Transaction.Api/Models/Tx.cs @@ -7,7 +7,6 @@ public class Tx : ITenantEntity, IConcurrencyCheckEntity, IAuditEntity { public Guid Id { get; set; } public required DateOnly ValueDate { get; set; } - public required string Label { get; set; } public decimal Amount { get; set; } public Guid Version { get; set; } public Guid TenantId { get; set; } diff --git a/src/Ubik.Accounting.Transaction.Contracts/Txs/Commands/SubmitTxCommand.cs b/src/Ubik.Accounting.Transaction.Contracts/Txs/Commands/SubmitTxCommand.cs index b380bbe6..4e2f12e6 100644 --- a/src/Ubik.Accounting.Transaction.Contracts/Txs/Commands/SubmitTxCommand.cs +++ b/src/Ubik.Accounting.Transaction.Contracts/Txs/Commands/SubmitTxCommand.cs @@ -12,7 +12,6 @@ public record SubmitTxCommand { public Guid Id { get; init; } public required DateOnly ValueDate { get; init; } - public required string Label { get; init; } public decimal Amount { get; init; } public IEnumerable Entries { get; init; } = default!; } @@ -22,11 +21,11 @@ public record TxEntry public required EntryType Type { get; init; } public required DebitCredit Sign { get; init; } public required Guid AccountId { get; init; } - public string? Label { get; set; } - public string? Description { get; set; } - public required decimal Amount { get; set; } - public TxEntryAdditionalAmountInfo? AmountAdditionnalInfo { get; set; } - public TxEntryTaxInfo? TaxInfo { get; set; } = default!; + public string? Label { get; init; } + public string? Description { get; init; } + public required decimal Amount { get; init; } + public TxEntryAdditionalAmountInfo? AmountAdditionnalInfo { get; init; } + public TxEntryTaxInfo? TaxInfo { get; init; } = default!; } public record TxEntryAdditionalAmountInfo From 98969f9abe09c2fcd762b5350eeaad45aaab3497 Mon Sep 17 00:00:00 2001 From: ubik Date: Fri, 8 Nov 2024 10:42:49 +0100 Subject: [PATCH 63/94] Ok, very first steps for submiting a TX --- .../Txs/Controllers/v1/TxController.cs | 28 +++++ .../AccountsInEntriesAreMissingError.cs | 29 +++++ .../Txs/Errors/EntriesAmountsError.cs | 29 +++++ .../Txs/Services/ITxCommandService.cs | 5 +- .../Features/Txs/Services/TxCommandService.cs | 102 +++++++++++++++++- .../Mappers/TxMappers.cs | 52 +++++++++ .../Txs/Commands/SubmitTxCommand.cs | 36 +++++-- .../Txs/Events/TxSubmited.cs | 44 ++++++++ .../Data/Init/AuthorizationsData.sql | 2 + .../Data/Init/RolesAuthorizationsData.sql | 3 + src/Ubik.YarpProxy/appsettings.json | 15 +++ 11 files changed, 331 insertions(+), 14 deletions(-) create mode 100644 src/Ubik.Accounting.Transaction.Api/Features/Txs/Controllers/v1/TxController.cs create mode 100644 src/Ubik.Accounting.Transaction.Api/Features/Txs/Errors/AccountsInEntriesAreMissingError.cs create mode 100644 src/Ubik.Accounting.Transaction.Api/Features/Txs/Errors/EntriesAmountsError.cs create mode 100644 src/Ubik.Accounting.Transaction.Api/Mappers/TxMappers.cs create mode 100644 src/Ubik.Accounting.Transaction.Contracts/Txs/Events/TxSubmited.cs diff --git a/src/Ubik.Accounting.Transaction.Api/Features/Txs/Controllers/v1/TxController.cs b/src/Ubik.Accounting.Transaction.Api/Features/Txs/Controllers/v1/TxController.cs new file mode 100644 index 00000000..c1d94ca6 --- /dev/null +++ b/src/Ubik.Accounting.Transaction.Api/Features/Txs/Controllers/v1/TxController.cs @@ -0,0 +1,28 @@ +using Asp.Versioning; +using Microsoft.AspNetCore.Mvc; +using Ubik.Accounting.Structure.Contracts.Accounts.Results; +using Ubik.Accounting.Transaction.Api.Features.Txs.Services; +using Ubik.Accounting.Transaction.Contracts.Txs.Commands; +using Ubik.Accounting.Transaction.Contracts.Txs.Events; +using Ubik.ApiService.Common.Exceptions; + +namespace Ubik.Accounting.Transaction.Api.Features.Txs.Controllers.v1 +{ + [ApiController] + [ApiVersion("1.0")] + [Route("api/v{version:apiVersion}/[controller]")] + public class TxController(ITxCommandService commandService) : ControllerBase + { + [HttpPost("submit")] + [ProducesResponseType(200)] + [ProducesResponseType(typeof(CustomProblemDetails), 400)] + [ProducesResponseType(typeof(CustomProblemDetails), 500)] + public async Task> SubmitTx(SubmitTxCommand command) + { + var result = await commandService.SubmitTx(command); + return result.Match( + Right: ok => Ok(ok), + Left: err => new ObjectResult(err.ToValidationProblemDetails(HttpContext))); + } + } +} diff --git a/src/Ubik.Accounting.Transaction.Api/Features/Txs/Errors/AccountsInEntriesAreMissingError.cs b/src/Ubik.Accounting.Transaction.Api/Features/Txs/Errors/AccountsInEntriesAreMissingError.cs new file mode 100644 index 00000000..be9c1d2a --- /dev/null +++ b/src/Ubik.Accounting.Transaction.Api/Features/Txs/Errors/AccountsInEntriesAreMissingError.cs @@ -0,0 +1,29 @@ +using Ubik.Accounting.Transaction.Contracts.Txs.Commands; +using Ubik.ApiService.Common.Errors; + +namespace Ubik.Accounting.Transaction.Api.Features.Txs.Errors +{ + //TODO: do better error reporting (see when UI) + public record AccountsInEntriesAreMissingError: IFeatureError + { + public FeatureErrorType ErrorType { get; init; } + public List CustomErrors { get; init; } + + public AccountsInEntriesAreMissingError(IEnumerable entriesInError) + { + + ErrorType = FeatureErrorType.BadParams; + CustomErrors = new List(); + + foreach (var entry in entriesInError) + { + CustomErrors.Add(new CustomError() + { + ErrorCode = "ACCOUNT_ID_NOT_FOUND_FOR_THIS_ENTRY", + ErrorFriendlyMessage = "This account id is not found and cannot be used.", + ErrorValueDetails = $"Field:AccountId / Value:{entry.AccountId} - Field:Amount / Value:{entry.Amount}" + }); + } + } + } +} diff --git a/src/Ubik.Accounting.Transaction.Api/Features/Txs/Errors/EntriesAmountsError.cs b/src/Ubik.Accounting.Transaction.Api/Features/Txs/Errors/EntriesAmountsError.cs new file mode 100644 index 00000000..748df0a0 --- /dev/null +++ b/src/Ubik.Accounting.Transaction.Api/Features/Txs/Errors/EntriesAmountsError.cs @@ -0,0 +1,29 @@ +using Ubik.Accounting.Transaction.Contracts.Txs.Commands; +using Ubik.ApiService.Common.Errors; + +namespace Ubik.Accounting.Transaction.Api.Features.Txs.Errors +{ + //TODO: do better error reporting (see when UI) + public record EntriesAmountsError : IFeatureError + { + public FeatureErrorType ErrorType { get; init; } + public List CustomErrors { get; init; } + + public EntriesAmountsError(IEnumerable entriesInError) + { + + ErrorType = FeatureErrorType.BadParams; + CustomErrors = new List(); + + foreach (var entry in entriesInError) + { + CustomErrors.Add(new CustomError() + { + ErrorCode = "BAD_AMOUNT_PARAMS_FOR_ENTRY", + ErrorFriendlyMessage = "This entry contains invalid amount value(s)", + ErrorValueDetails = $"Can be the amount or the additional amount info" + }); + } + } + } +} diff --git a/src/Ubik.Accounting.Transaction.Api/Features/Txs/Services/ITxCommandService.cs b/src/Ubik.Accounting.Transaction.Api/Features/Txs/Services/ITxCommandService.cs index f8421ccf..c757bf4a 100644 --- a/src/Ubik.Accounting.Transaction.Api/Features/Txs/Services/ITxCommandService.cs +++ b/src/Ubik.Accounting.Transaction.Api/Features/Txs/Services/ITxCommandService.cs @@ -1,10 +1,13 @@ using LanguageExt; +using Ubik.Accounting.Transaction.Api.Models; +using Ubik.Accounting.Transaction.Contracts.Txs.Commands; +using Ubik.Accounting.Transaction.Contracts.Txs.Events; using Ubik.ApiService.Common.Errors; namespace Ubik.Accounting.Transaction.Api.Features.Txs.Services { public interface ITxCommandService { - //public Task> SumbitTx(SubmitTxCommand command); + public Task> SubmitTx(SubmitTxCommand command); } } diff --git a/src/Ubik.Accounting.Transaction.Api/Features/Txs/Services/TxCommandService.cs b/src/Ubik.Accounting.Transaction.Api/Features/Txs/Services/TxCommandService.cs index 866e73fa..85632381 100644 --- a/src/Ubik.Accounting.Transaction.Api/Features/Txs/Services/TxCommandService.cs +++ b/src/Ubik.Accounting.Transaction.Api/Features/Txs/Services/TxCommandService.cs @@ -1,6 +1,104 @@ -namespace Ubik.Accounting.Transaction.Api.Features.Txs.Services +using Dapper; +using LanguageExt; +using Microsoft.EntityFrameworkCore; +using System.Reflection.Metadata.Ecma335; +using Ubik.Accounting.Transaction.Api.Data; +using Ubik.Accounting.Transaction.Api.Models; +using Ubik.Accounting.Transaction.Api.Features.Txs.Errors; +using Ubik.Accounting.Transaction.Contracts.Txs.Commands; +using Ubik.ApiService.Common.Errors; +using Ubik.ApiService.Common.Services; +using MassTransit.Transports; +using MassTransit; +using Ubik.Accounting.Transaction.Contracts.Txs.Events; +using Ubik.Accounting.Transaction.Api.Mappers; + +namespace Ubik.Accounting.Transaction.Api.Features.Txs.Services { - public class TxCommandService + public class TxCommandService(AccountingTxContext ctx + , ICurrentUser currentUser + , IPublishEndpoint publishEndpoint) : ITxCommandService { + public async Task> SubmitTx(SubmitTxCommand command) + { + return await ValidateEntryAccounts(command) + .BindAsync(ValidateEntriesAmounts) + .BindAsync(PublishSubmittedAsync); + } + + private async Task> PublishSubmittedAsync(SubmitTxCommand current) + { + //Publish that a tx as been submitted and checked for the ez validation + var submited = current.ToTxSubmited(); + await publishEndpoint.Publish(submited, CancellationToken.None); + + return submited; + } + + + private async Task> ValidateEntryAccounts(SubmitTxCommand tx) + { + //Check all the accounts at the same time + var targetAccountIds = tx.Entries.Select(e => e.AccountId).Distinct().ToList(); + + var p = new DynamicParameters(); + p.Add("@ids", targetAccountIds); + p.Add("@tenantId", currentUser.TenantId); + + var con = ctx.Database.GetDbConnection(); + + var sql = """ + SELECT a.Id + FROM accounts a + WHERE id IN @ids + AND a.tenant_id = @tenantId + """; + + var results = await con.QueryAsync(sql, p); + + var missingAccounts = targetAccountIds.Except(results.Select(r => r.Id)).ToList(); + + if (missingAccounts.Count == 0) + return tx; + else + { + var badEntries = tx.Entries.Where(e => missingAccounts.Contains(e.AccountId)); + return new AccountsInEntriesAreMissingError(badEntries); + } + } + + private async Task> ValidateEntriesAmounts(SubmitTxCommand tx) + { + var errEntries = new List(); + foreach (var entry in tx.Entries) + { + if (entry.Amount <= 0) + { + errEntries.Add(entry); + } + + if (entry.AmountAdditionnalInfo != null) + { + if (entry.AmountAdditionnalInfo.OriginalAmount <= 0) + { + errEntries.Add(entry); + } + + var expectedAmount = entry.AmountAdditionnalInfo.OriginalAmount * entry.AmountAdditionnalInfo.ExchangeRate; + if (expectedAmount != entry.Amount) + { + errEntries.Add(entry); + } + } + } + if(errEntries.Count > 0) + return new EntriesAmountsError(errEntries); + else + { + //Maybe we will need to be async... (very dirty check for now) + await Task.CompletedTask; + return tx; + } + } } } diff --git a/src/Ubik.Accounting.Transaction.Api/Mappers/TxMappers.cs b/src/Ubik.Accounting.Transaction.Api/Mappers/TxMappers.cs new file mode 100644 index 00000000..d823aa9d --- /dev/null +++ b/src/Ubik.Accounting.Transaction.Api/Mappers/TxMappers.cs @@ -0,0 +1,52 @@ +using Ubik.Accounting.Transaction.Contracts.Txs.Commands; +using Ubik.Accounting.Transaction.Contracts.Txs.Events; + +namespace Ubik.Accounting.Transaction.Api.Mappers +{ + public static class TxMappers + { + public static TxSubmited ToTxSubmited(this SubmitTxCommand current) + { + return new TxSubmited + { + ValueDate = current.ValueDate, + Amount = current.Amount, + Entries = current.Entries.Select(x => x.ToTxEntrySubmited()) + }; + } + + public static TxEntrySubmited ToTxEntrySubmited(this SubmitTxEntry current) + { + return new TxEntrySubmited + { + Description = current.Description, + AccountId = current.AccountId, + Amount = current.Amount, + AmountAdditionnalInfo = current.AmountAdditionnalInfo?.ToTxEntryAdditionalAmountInfoSubmited(), + Label = current.Label, + Sign = current.Sign, + TaxInfo = current.TaxInfo?.ToTxEntryTaxInfoSubmited(), + Type = current.Type + }; + } + + public static TxEntryAdditionalAmountInfoSubmited ToTxEntryAdditionalAmountInfoSubmited(this SubmitTxEntryAdditionalAmountInfo current) + { + return new TxEntryAdditionalAmountInfoSubmited + { + ExchangeRate = current.ExchangeRate, + OriginalAmount = current.OriginalAmount, + OriginalCurrencyId = current.OriginalCurrencyId + }; + } + + public static TxEntryTaxInfoSubmited ToTxEntryTaxInfoSubmited(this SubmitTxEntryTaxInfo current) + { + return new TxEntryTaxInfoSubmited + { + TaxAppliedRate = current.TaxAppliedRate, + TaxRateId = current.TaxRateId + }; + } + } +} diff --git a/src/Ubik.Accounting.Transaction.Contracts/Txs/Commands/SubmitTxCommand.cs b/src/Ubik.Accounting.Transaction.Contracts/Txs/Commands/SubmitTxCommand.cs index 4e2f12e6..7a1039c1 100644 --- a/src/Ubik.Accounting.Transaction.Contracts/Txs/Commands/SubmitTxCommand.cs +++ b/src/Ubik.Accounting.Transaction.Contracts/Txs/Commands/SubmitTxCommand.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; using System.Globalization; using System.Linq; using System.Text; @@ -11,33 +12,46 @@ namespace Ubik.Accounting.Transaction.Contracts.Txs.Commands public record SubmitTxCommand { public Guid Id { get; init; } + [Required] public required DateOnly ValueDate { get; init; } - public decimal Amount { get; init; } - public IEnumerable Entries { get; init; } = default!; + [Required] + public required decimal Amount { get; init; } + public IEnumerable Entries { get; init; } = default!; } - public record TxEntry + public record SubmitTxEntry { + [Required] public required EntryType Type { get; init; } + [Required] public required DebitCredit Sign { get; init; } + [Required] public required Guid AccountId { get; init; } + [MaxLength(100)] public string? Label { get; init; } + [MaxLength(700)] public string? Description { get; init; } + [Required] public required decimal Amount { get; init; } - public TxEntryAdditionalAmountInfo? AmountAdditionnalInfo { get; init; } - public TxEntryTaxInfo? TaxInfo { get; init; } = default!; + public SubmitTxEntryAdditionalAmountInfo? AmountAdditionnalInfo { get; init; } + public SubmitTxEntryTaxInfo? TaxInfo { get; init; } = default!; } - public record TxEntryAdditionalAmountInfo + public record SubmitTxEntryAdditionalAmountInfo { - public decimal OriginalAmount { get; init; } - public Guid OriginalCurrencyId { get; init; } + [Required] + public required decimal OriginalAmount { get; init; } + [Required] + public required Guid OriginalCurrencyId { get; init; } + [Required] public decimal ExchangeRate { get; init; } } - public record TxEntryTaxInfo + public record SubmitTxEntryTaxInfo { - public decimal TaxAppliedRate { get; init; } - public Guid TaxRateId { get; init; } + [Required] + public required decimal TaxAppliedRate { get; init; } + [Required] + public required Guid TaxRateId { get; init; } } } diff --git a/src/Ubik.Accounting.Transaction.Contracts/Txs/Events/TxSubmited.cs b/src/Ubik.Accounting.Transaction.Contracts/Txs/Events/TxSubmited.cs new file mode 100644 index 00000000..6c515c2b --- /dev/null +++ b/src/Ubik.Accounting.Transaction.Contracts/Txs/Events/TxSubmited.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Ubik.Accounting.Transaction.Contracts.Entries.Enums; +using Ubik.Accounting.Transaction.Contracts.Txs.Commands; + +namespace Ubik.Accounting.Transaction.Contracts.Txs.Events +{ + public record class TxSubmited + { + public Guid Id { get; init; } + public required DateOnly ValueDate { get; init; } + public required decimal Amount { get; init; } + public IEnumerable Entries { get; init; } = default!; + } + + public record TxEntrySubmited + { + public required EntryType Type { get; init; } + public required DebitCredit Sign { get; init; } + public required Guid AccountId { get; init; } + public string? Label { get; init; } + public string? Description { get; init; } + public required decimal Amount { get; init; } + public TxEntryAdditionalAmountInfoSubmited? AmountAdditionnalInfo { get; init; } + public TxEntryTaxInfoSubmited? TaxInfo { get; init; } = default!; + } + + public record TxEntryAdditionalAmountInfoSubmited + { + public required decimal OriginalAmount { get; init; } + public required Guid OriginalCurrencyId { get; init; } + public decimal ExchangeRate { get; init; } + } + + public record TxEntryTaxInfoSubmited + { + public required decimal TaxAppliedRate { get; init; } + public required Guid TaxRateId { get; init; } + } +} diff --git a/src/Ubik.Security.Api/Data/Init/AuthorizationsData.sql b/src/Ubik.Security.Api/Data/Init/AuthorizationsData.sql index c91959a3..60608128 100644 --- a/src/Ubik.Security.Api/Data/Init/AuthorizationsData.sql +++ b/src/Ubik.Security.Api/Data/Init/AuthorizationsData.sql @@ -14,4 +14,6 @@ INSERT INTO public.authorizations (id, code, label, description, version, create INSERT INTO public.authorizations (id, code, label, description, version, created_at, created_by, modified_at, modified_by) VALUES ('a83b0000-3c36-7456-2f3f-08dcf2677eca', 'accounting_currency_read', 'currency read', NULL, 'a83b0000-3c36-7456-dea7-08dcf2677ed2', '2024-10-22 07:02:30.306454+00', '5c5e0000-3c36-7456-b9da-08dcdf9832e2', '2024-10-22 07:02:30.306454+00', '5c5e0000-3c36-7456-b9da-08dcdf9832e2'); INSERT INTO public.authorizations (id, code, label, description, version, created_at, created_by, modified_at, modified_by) VALUES ('b4740000-3c36-7456-c9d0-08dcfa601a89', 'accounting_salesvattaxrate_read', 'salesvattaxrate read', NULL, 'b4740000-3c36-7456-32af-08dcfa601a90', '2024-11-01 10:29:44.922482+00', '5c5e0000-3c36-7456-b9da-08dcdf9832e2', '2024-11-01 10:29:44.922482+00', '5c5e0000-3c36-7456-b9da-08dcdf9832e2'); INSERT INTO public.authorizations (id, code, label, description, version, created_at, created_by, modified_at, modified_by) VALUES ('b4740000-3c36-7456-f16f-08dcfa6028e6', 'accounting_salesvattaxrate_write', 'salesvattaxrate write', NULL, 'b4740000-3c36-7456-179b-08dcfa6028e7', '2024-11-01 10:30:08.980406+00', '5c5e0000-3c36-7456-b9da-08dcdf9832e2', '2024-11-01 10:30:08.980406+00', '5c5e0000-3c36-7456-b9da-08dcdf9832e2'); +INSERT INTO public.authorizations (id, code, label, description, version, created_at, created_by, modified_at, modified_by) VALUES ('e0480000-3c36-7456-4408-08dcffd8c63a', 'accounting_tx_read', 'tx read', NULL, 'e0480000-3c36-7456-bb3b-08dcffd8c641', '2024-11-08 09:36:08.397859+00', '5c5e0000-3c36-7456-b9da-08dcdf9832e2', '2024-11-08 09:36:08.397859+00', '5c5e0000-3c36-7456-b9da-08dcdf9832e2'); +INSERT INTO public.authorizations (id, code, label, description, version, created_at, created_by, modified_at, modified_by) VALUES ('e0480000-3c36-7456-d15f-08dcffd8d908', 'accounting_tx_write', 'tx write', NULL, 'e0480000-3c36-7456-f070-08dcffd8d908', '2024-11-08 09:36:39.902717+00', '5c5e0000-3c36-7456-b9da-08dcdf9832e2', '2024-11-08 09:36:39.902717+00', '5c5e0000-3c36-7456-b9da-08dcdf9832e2'); diff --git a/src/Ubik.Security.Api/Data/Init/RolesAuthorizationsData.sql b/src/Ubik.Security.Api/Data/Init/RolesAuthorizationsData.sql index f9f845be..065d60b3 100644 --- a/src/Ubik.Security.Api/Data/Init/RolesAuthorizationsData.sql +++ b/src/Ubik.Security.Api/Data/Init/RolesAuthorizationsData.sql @@ -23,3 +23,6 @@ INSERT INTO public.roles_authorizations (id, role_id, authorization_id, version, INSERT INTO public.roles_authorizations (id, role_id, authorization_id, version, created_at, created_by, modified_at, modified_by) VALUES ('b4740000-3c36-7456-07cb-08dcfa60831d', '181a0000-088f-d0ad-5f22-08dcee8ac275', 'b4740000-3c36-7456-c9d0-08dcfa601a89', 'b4740000-3c36-7456-6437-08dcfa60831e', '2024-11-01 10:32:40.337786+00', '5c5e0000-3c36-7456-b9da-08dcdf9832e2', '2024-11-01 10:32:40.337786+00', '5c5e0000-3c36-7456-b9da-08dcdf9832e2'); INSERT INTO public.roles_authorizations (id, role_id, authorization_id, version, created_at, created_by, modified_at, modified_by) VALUES ('b4740000-3c36-7456-bd61-08dcfa60930d', '181a0000-088f-d0ad-5f22-08dcee8ac275', 'b4740000-3c36-7456-f16f-08dcfa6028e6', 'b4740000-3c36-7456-c46c-08dcfa60930d', '2024-11-01 10:33:07.072503+00', '5c5e0000-3c36-7456-b9da-08dcdf9832e2', '2024-11-01 10:33:07.072503+00', '5c5e0000-3c36-7456-b9da-08dcdf9832e2'); INSERT INTO public.roles_authorizations (id, role_id, authorization_id, version, created_at, created_by, modified_at, modified_by) VALUES ('b4740000-3c36-7456-6163-08dcfa609876', '181a0000-088f-d0ad-c555-08dcee8ac9fd', 'b4740000-3c36-7456-c9d0-08dcfa601a89', 'b4740000-3c36-7456-6681-08dcfa609876', '2024-11-01 10:33:16.14685+00', '5c5e0000-3c36-7456-b9da-08dcdf9832e2', '2024-11-01 10:33:16.14685+00', '5c5e0000-3c36-7456-b9da-08dcdf9832e2'); +INSERT INTO public.roles_authorizations (id, role_id, authorization_id, version, created_at, created_by, modified_at, modified_by) VALUES ('e0480000-3c36-7456-368c-08dcffd9069c', '181a0000-088f-d0ad-5f22-08dcee8ac275', 'e0480000-3c36-7456-4408-08dcffd8c63a', 'e0480000-3c36-7456-2baf-08dcffd9069d', '2024-11-08 09:37:56.37169+00', '5c5e0000-3c36-7456-b9da-08dcdf9832e2', '2024-11-08 09:37:56.37169+00', '5c5e0000-3c36-7456-b9da-08dcdf9832e2'); +INSERT INTO public.roles_authorizations (id, role_id, authorization_id, version, created_at, created_by, modified_at, modified_by) VALUES ('e0480000-3c36-7456-fabd-08dcffd910df', '181a0000-088f-d0ad-5f22-08dcee8ac275', 'e0480000-3c36-7456-d15f-08dcffd8d908', 'e0480000-3c36-7456-0188-08dcffd910e0', '2024-11-08 09:38:13.586974+00', '5c5e0000-3c36-7456-b9da-08dcdf9832e2', '2024-11-08 09:38:13.586974+00', '5c5e0000-3c36-7456-b9da-08dcdf9832e2'); +INSERT INTO public.roles_authorizations (id, role_id, authorization_id, version, created_at, created_by, modified_at, modified_by) VALUES ('e0480000-3c36-7456-481f-08dcffd9214a', '181a0000-088f-d0ad-c555-08dcee8ac9fd', 'e0480000-3c36-7456-4408-08dcffd8c63a', 'e0480000-3c36-7456-4cc5-08dcffd9214a', '2024-11-08 09:38:41.127132+00', '5c5e0000-3c36-7456-b9da-08dcdf9832e2', '2024-11-08 09:38:41.127132+00', '5c5e0000-3c36-7456-b9da-08dcdf9832e2'); diff --git a/src/Ubik.YarpProxy/appsettings.json b/src/Ubik.YarpProxy/appsettings.json index b9a8ff6e..7c385d6a 100644 --- a/src/Ubik.YarpProxy/appsettings.json +++ b/src/Ubik.YarpProxy/appsettings.json @@ -438,6 +438,21 @@ ] } } + }, + "ubik_accounting_tx": { + "Destinations": { + "destination1": { + "Address": "https://localhost:7053/", + "Swaggers": [ + { + "PrefixPath": "/accounting", + "Paths": [ + "swagger/v1/swagger.json" + ] + } + ] + } + } } } } From 111c77a0767724826dff67fe952c25665b8ffe1c Mon Sep 17 00:00:00 2001 From: ubik Date: Fri, 8 Nov 2024 11:14:40 +0100 Subject: [PATCH 64/94] First tx submit (with minimal and naive checks). --- .../v1/{TxController.cs => TxsController.cs} | 2 +- .../Features/Txs/Services/TxCommandService.cs | 22 +++++-------------- .../Program.cs | 2 ++ .../Txs/Commands/SubmitTxCommand.cs | 1 - .../Txs/Events/TxSubmited.cs | 1 - src/Ubik.YarpProxy/Program.cs | 6 ++++- src/Ubik.YarpProxy/appsettings.json | 10 ++++++++- 7 files changed, 23 insertions(+), 21 deletions(-) rename src/Ubik.Accounting.Transaction.Api/Features/Txs/Controllers/v1/{TxController.cs => TxsController.cs} (92%) diff --git a/src/Ubik.Accounting.Transaction.Api/Features/Txs/Controllers/v1/TxController.cs b/src/Ubik.Accounting.Transaction.Api/Features/Txs/Controllers/v1/TxsController.cs similarity index 92% rename from src/Ubik.Accounting.Transaction.Api/Features/Txs/Controllers/v1/TxController.cs rename to src/Ubik.Accounting.Transaction.Api/Features/Txs/Controllers/v1/TxsController.cs index c1d94ca6..2685437e 100644 --- a/src/Ubik.Accounting.Transaction.Api/Features/Txs/Controllers/v1/TxController.cs +++ b/src/Ubik.Accounting.Transaction.Api/Features/Txs/Controllers/v1/TxsController.cs @@ -11,7 +11,7 @@ namespace Ubik.Accounting.Transaction.Api.Features.Txs.Controllers.v1 [ApiController] [ApiVersion("1.0")] [Route("api/v{version:apiVersion}/[controller]")] - public class TxController(ITxCommandService commandService) : ControllerBase + public class TxsController(ITxCommandService commandService) : ControllerBase { [HttpPost("submit")] [ProducesResponseType(200)] diff --git a/src/Ubik.Accounting.Transaction.Api/Features/Txs/Services/TxCommandService.cs b/src/Ubik.Accounting.Transaction.Api/Features/Txs/Services/TxCommandService.cs index 85632381..3272e4f2 100644 --- a/src/Ubik.Accounting.Transaction.Api/Features/Txs/Services/TxCommandService.cs +++ b/src/Ubik.Accounting.Transaction.Api/Features/Txs/Services/TxCommandService.cs @@ -16,7 +16,6 @@ namespace Ubik.Accounting.Transaction.Api.Features.Txs.Services { public class TxCommandService(AccountingTxContext ctx - , ICurrentUser currentUser , IPublishEndpoint publishEndpoint) : ITxCommandService { public async Task> SubmitTx(SubmitTxCommand command) @@ -31,6 +30,7 @@ private async Task> PublishSubmittedAsync(Subm //Publish that a tx as been submitted and checked for the ez validation var submited = current.ToTxSubmited(); await publishEndpoint.Publish(submited, CancellationToken.None); + await ctx.SaveChangesAsync(); return submited; } @@ -41,22 +41,12 @@ private async Task> ValidateEntryAccounts //Check all the accounts at the same time var targetAccountIds = tx.Entries.Select(e => e.AccountId).Distinct().ToList(); - var p = new DynamicParameters(); - p.Add("@ids", targetAccountIds); - p.Add("@tenantId", currentUser.TenantId); + var results = await ctx.Accounts + .Where(a => targetAccountIds.Contains(a.Id)) + .Select(a => a.Id) + .ToListAsync(); - var con = ctx.Database.GetDbConnection(); - - var sql = """ - SELECT a.Id - FROM accounts a - WHERE id IN @ids - AND a.tenant_id = @tenantId - """; - - var results = await con.QueryAsync(sql, p); - - var missingAccounts = targetAccountIds.Except(results.Select(r => r.Id)).ToList(); + var missingAccounts = targetAccountIds.Except(results.Select(r => r)).ToList(); if (missingAccounts.Count == 0) return tx; diff --git a/src/Ubik.Accounting.Transaction.Api/Program.cs b/src/Ubik.Accounting.Transaction.Api/Program.cs index e20994c9..00fa8b8d 100644 --- a/src/Ubik.Accounting.Transaction.Api/Program.cs +++ b/src/Ubik.Accounting.Transaction.Api/Program.cs @@ -8,6 +8,7 @@ using Ubik.Accounting.Transaction.Api.Data.Init; using Ubik.Accounting.Transaction.Api.Features.Accounts.Services; using Ubik.Accounting.Transaction.Api.Features.TaxRates.Services; +using Ubik.Accounting.Transaction.Api.Features.Txs.Services; using Ubik.ApiService.Common.Configure; using Ubik.ApiService.Common.Configure.Options; using Ubik.ApiService.Common.Exceptions; @@ -84,6 +85,7 @@ builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); +builder.Services.AddScoped(); builder.Services.AddTransient(); builder.Services.AddTracingAndMetrics(); diff --git a/src/Ubik.Accounting.Transaction.Contracts/Txs/Commands/SubmitTxCommand.cs b/src/Ubik.Accounting.Transaction.Contracts/Txs/Commands/SubmitTxCommand.cs index 7a1039c1..81134dad 100644 --- a/src/Ubik.Accounting.Transaction.Contracts/Txs/Commands/SubmitTxCommand.cs +++ b/src/Ubik.Accounting.Transaction.Contracts/Txs/Commands/SubmitTxCommand.cs @@ -11,7 +11,6 @@ namespace Ubik.Accounting.Transaction.Contracts.Txs.Commands { public record SubmitTxCommand { - public Guid Id { get; init; } [Required] public required DateOnly ValueDate { get; init; } [Required] diff --git a/src/Ubik.Accounting.Transaction.Contracts/Txs/Events/TxSubmited.cs b/src/Ubik.Accounting.Transaction.Contracts/Txs/Events/TxSubmited.cs index 6c515c2b..93c641f4 100644 --- a/src/Ubik.Accounting.Transaction.Contracts/Txs/Events/TxSubmited.cs +++ b/src/Ubik.Accounting.Transaction.Contracts/Txs/Events/TxSubmited.cs @@ -11,7 +11,6 @@ namespace Ubik.Accounting.Transaction.Contracts.Txs.Events { public record class TxSubmited { - public Guid Id { get; init; } public required DateOnly ValueDate { get; init; } public required decimal Amount { get; init; } public IEnumerable Entries { get; init; } = default!; diff --git a/src/Ubik.YarpProxy/Program.cs b/src/Ubik.YarpProxy/Program.cs index 1c3833c9..8eaea8cb 100644 --- a/src/Ubik.YarpProxy/Program.cs +++ b/src/Ubik.YarpProxy/Program.cs @@ -112,7 +112,11 @@ .AddPolicy("CanSalesOrVatTaxRatesAndAccountsRead", policy => policy.Requirements.Add(new UserWithAuthorizationsRequirement(["accounting_salesvattaxrate_read", "accounting_account_read"]))) .AddPolicy("CanSalesOrVatTaxRatesAndAccountsWrite", policy => - policy.Requirements.Add(new UserWithAuthorizationsRequirement(["accounting_salesvattaxrate_write", "accounting_account_write"]))); + policy.Requirements.Add(new UserWithAuthorizationsRequirement(["accounting_salesvattaxrate_write", "accounting_account_write"]))) + .AddPolicy("CanTxRead", policy => + policy.Requirements.Add(new UserWithAuthorizationsRequirement(["accounting_tx_read"]))) + .AddPolicy("CanTxWrite", policy => + policy.Requirements.Add(new UserWithAuthorizationsRequirement(["accounting_tx_write"]))); //Proxy var configProxy = builder.Configuration.GetSection("ReverseProxy"); diff --git a/src/Ubik.YarpProxy/appsettings.json b/src/Ubik.YarpProxy/appsettings.json index 7c385d6a..561e1b04 100644 --- a/src/Ubik.YarpProxy/appsettings.json +++ b/src/Ubik.YarpProxy/appsettings.json @@ -390,8 +390,16 @@ "Methods": [ "DELETE" ] }, "Transforms": [ { "PathPattern": "/api/{apiversion}/accounts/{id:Guid}/taxrates/{tax_rate_id:Guid}" } ] + }, + "route_accounting_tx_submit": { + "ClusterId": "ubik_accounting_tx", + "AuthorizationPolicy": "CanTxWrite", + "Match": { + "Path": "/accounting/api/{apiversion}/txs/submit", + "Methods": [ "POST" ] + }, + "Transforms": [ { "PathPattern": "/api/{apiversion}/txs/submit" } ] } - }, "Clusters": { "ubik_users_admin": { From a6aeca42ada9af4cb4dd004e37fbd242cd50ca53 Mon Sep 17 00:00:00 2001 From: ubik Date: Fri, 8 Nov 2024 11:43:29 +0100 Subject: [PATCH 65/94] Renaming --- ...rror.cs => AccountsInEntriesAreNotFoundError.cs} | 10 +++++----- .../Features/Txs/Services/TxCommandService.cs | 13 +++++++------ 2 files changed, 12 insertions(+), 11 deletions(-) rename src/Ubik.Accounting.Transaction.Api/Features/Txs/Errors/{AccountsInEntriesAreMissingError.cs => AccountsInEntriesAreNotFoundError.cs} (64%) diff --git a/src/Ubik.Accounting.Transaction.Api/Features/Txs/Errors/AccountsInEntriesAreMissingError.cs b/src/Ubik.Accounting.Transaction.Api/Features/Txs/Errors/AccountsInEntriesAreNotFoundError.cs similarity index 64% rename from src/Ubik.Accounting.Transaction.Api/Features/Txs/Errors/AccountsInEntriesAreMissingError.cs rename to src/Ubik.Accounting.Transaction.Api/Features/Txs/Errors/AccountsInEntriesAreNotFoundError.cs index be9c1d2a..afd361e6 100644 --- a/src/Ubik.Accounting.Transaction.Api/Features/Txs/Errors/AccountsInEntriesAreMissingError.cs +++ b/src/Ubik.Accounting.Transaction.Api/Features/Txs/Errors/AccountsInEntriesAreNotFoundError.cs @@ -4,12 +4,12 @@ namespace Ubik.Accounting.Transaction.Api.Features.Txs.Errors { //TODO: do better error reporting (see when UI) - public record AccountsInEntriesAreMissingError: IFeatureError + public record AccountsInEntriesAreNotFoundError: IFeatureError { public FeatureErrorType ErrorType { get; init; } public List CustomErrors { get; init; } - public AccountsInEntriesAreMissingError(IEnumerable entriesInError) + public AccountsInEntriesAreNotFoundError(IEnumerable entriesInError) { ErrorType = FeatureErrorType.BadParams; @@ -19,9 +19,9 @@ public AccountsInEntriesAreMissingError(IEnumerable entriesInErro { CustomErrors.Add(new CustomError() { - ErrorCode = "ACCOUNT_ID_NOT_FOUND_FOR_THIS_ENTRY", - ErrorFriendlyMessage = "This account id is not found and cannot be used.", - ErrorValueDetails = $"Field:AccountId / Value:{entry.AccountId} - Field:Amount / Value:{entry.Amount}" + ErrorCode = "ACCOUNT_NOT_FOUND_FOR_ENTRY", + ErrorFriendlyMessage = "This account is not found.", + ErrorValueDetails = $"Field:AccountId / Value:{entry.AccountId}" }); } } diff --git a/src/Ubik.Accounting.Transaction.Api/Features/Txs/Services/TxCommandService.cs b/src/Ubik.Accounting.Transaction.Api/Features/Txs/Services/TxCommandService.cs index 3272e4f2..11c5ca04 100644 --- a/src/Ubik.Accounting.Transaction.Api/Features/Txs/Services/TxCommandService.cs +++ b/src/Ubik.Accounting.Transaction.Api/Features/Txs/Services/TxCommandService.cs @@ -20,14 +20,14 @@ public class TxCommandService(AccountingTxContext ctx { public async Task> SubmitTx(SubmitTxCommand command) { - return await ValidateEntryAccounts(command) - .BindAsync(ValidateEntriesAmounts) + return await ValidateEntriesAccountsAsync(command) + .BindAsync(ValidateEntriesAmountsAsync) .BindAsync(PublishSubmittedAsync); } private async Task> PublishSubmittedAsync(SubmitTxCommand current) { - //Publish that a tx as been submitted and checked for the ez validation + //Publish that a tx has been submitted and checked for the ez validation var submited = current.ToTxSubmited(); await publishEndpoint.Publish(submited, CancellationToken.None); await ctx.SaveChangesAsync(); @@ -36,7 +36,7 @@ private async Task> PublishSubmittedAsync(Subm } - private async Task> ValidateEntryAccounts(SubmitTxCommand tx) + private async Task> ValidateEntriesAccountsAsync(SubmitTxCommand tx) { //Check all the accounts at the same time var targetAccountIds = tx.Entries.Select(e => e.AccountId).Distinct().ToList(); @@ -53,11 +53,11 @@ private async Task> ValidateEntryAccounts else { var badEntries = tx.Entries.Where(e => missingAccounts.Contains(e.AccountId)); - return new AccountsInEntriesAreMissingError(badEntries); + return new AccountsInEntriesAreNotFoundError(badEntries); } } - private async Task> ValidateEntriesAmounts(SubmitTxCommand tx) + private async Task> ValidateEntriesAmountsAsync(SubmitTxCommand tx) { var errEntries = new List(); foreach (var entry in tx.Entries) @@ -74,6 +74,7 @@ private async Task> ValidateEntriesAmount errEntries.Add(entry); } + //TODO: make a special case for that var expectedAmount = entry.AmountAdditionnalInfo.OriginalAmount * entry.AmountAdditionnalInfo.ExchangeRate; if (expectedAmount != entry.Amount) { From 2e9ffc46d35354b0cdc06dd22aa32a3974ca6055 Mon Sep 17 00:00:00 2001 From: ubik Date: Fri, 8 Nov 2024 11:45:08 +0100 Subject: [PATCH 66/94] Clean not needed using. --- .../Data/AccountingSalesTaxDbContext.cs | 2 -- .../Features/Accounts/Consumers/AccountAddedConsumer.cs | 1 - .../Data/Init/ClassificationsData.cs | 1 - .../Models/Classification.cs | 3 +-- .../Data/AccountingTxContext.cs | 1 - .../Data/Config/EntryConfiguration.cs | 1 - .../Features/TaxRates/Consumers/TaxRateAddedConsumer.cs | 1 - .../TaxRates/Consumers/TaxRateDeletedConsumer.cs | 1 - .../TaxRates/Consumers/TaxRateUpdatedConsumer.cs | 1 - .../Features/TaxRates/Services/ITaxRateCommandService.cs | 1 - .../Features/Txs/Controllers/v1/TxsController.cs | 1 - .../Features/Txs/Services/ITxCommandService.cs | 1 - .../Features/Txs/Services/TxCommandService.cs | 7 +------ src/Ubik.Accounting.Transaction.Api/Models/Entry.cs | 3 +-- src/Ubik.Accounting.Transaction.Api/Models/TaxInfo.cs | 5 +---- .../Entries/Enums/DebitCredit.cs | 8 +------- .../Entries/Enums/EntryType.cs | 8 +------- .../Txs/Commands/SubmitTxCommand.cs | 8 +------- .../Txs/Events/TxSubmited.cs | 9 +-------- src/Ubik.Db.Common/Ubik.DB.Common/Models/AuditData.cs | 8 +------- 20 files changed, 9 insertions(+), 62 deletions(-) diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Data/AccountingSalesTaxDbContext.cs b/src/Ubik.Accounting.SalesOrVatTax.Api/Data/AccountingSalesTaxDbContext.cs index 0bea6f3a..12493087 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Api/Data/AccountingSalesTaxDbContext.cs +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Data/AccountingSalesTaxDbContext.cs @@ -1,12 +1,10 @@ using MassTransit; using Microsoft.EntityFrameworkCore; -using System.Linq.Expressions; using Ubik.Accounting.SalesOrVatTax.Api.Data.Config; using Ubik.Accounting.SalesOrVatTax.Api.Models; using Ubik.ApiService.Common.Errors; using Ubik.ApiService.Common.Exceptions; using Ubik.ApiService.Common.Services; -using Ubik.DB.Common; using Ubik.DB.Common.Extensions; namespace Ubik.Accounting.SalesOrVatTax.Api.Data diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Features/Accounts/Consumers/AccountAddedConsumer.cs b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/Accounts/Consumers/AccountAddedConsumer.cs index 5b57bfae..c49c6fd9 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Api/Features/Accounts/Consumers/AccountAddedConsumer.cs +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/Accounts/Consumers/AccountAddedConsumer.cs @@ -1,5 +1,4 @@ using MassTransit; -using Ubik.Accounting.SalesOrVatTax.Api.Data; using Ubik.Accounting.SalesOrVatTax.Api.Features.Accounts.Services; using Ubik.Accounting.Structure.Contracts.Accounts.Events; diff --git a/src/Ubik.Accounting.Structure.Api/Data/Init/ClassificationsData.cs b/src/Ubik.Accounting.Structure.Api/Data/Init/ClassificationsData.cs index 0604b381..567e9eea 100644 --- a/src/Ubik.Accounting.Structure.Api/Data/Init/ClassificationsData.cs +++ b/src/Ubik.Accounting.Structure.Api/Data/Init/ClassificationsData.cs @@ -1,5 +1,4 @@ using MassTransit; -using System.Security.Cryptography.Xml; using Ubik.Accounting.Structure.Api.Models; using Ubik.DB.Common.Models; diff --git a/src/Ubik.Accounting.Structure.Api/Models/Classification.cs b/src/Ubik.Accounting.Structure.Api/Models/Classification.cs index 74c3dc74..595f81bf 100644 --- a/src/Ubik.Accounting.Structure.Api/Models/Classification.cs +++ b/src/Ubik.Accounting.Structure.Api/Models/Classification.cs @@ -1,5 +1,4 @@ -using System.ComponentModel.DataAnnotations; -using Ubik.DB.Common; +using Ubik.DB.Common; using Ubik.DB.Common.Models; namespace Ubik.Accounting.Structure.Api.Models diff --git a/src/Ubik.Accounting.Transaction.Api/Data/AccountingTxContext.cs b/src/Ubik.Accounting.Transaction.Api/Data/AccountingTxContext.cs index 8f5a86ba..6a6ec3a6 100644 --- a/src/Ubik.Accounting.Transaction.Api/Data/AccountingTxContext.cs +++ b/src/Ubik.Accounting.Transaction.Api/Data/AccountingTxContext.cs @@ -5,7 +5,6 @@ using Ubik.ApiService.Common.Errors; using Ubik.ApiService.Common.Exceptions; using Ubik.ApiService.Common.Services; -using Ubik.DB.Common; using Ubik.DB.Common.Extensions; namespace Ubik.Accounting.Transaction.Api.Data diff --git a/src/Ubik.Accounting.Transaction.Api/Data/Config/EntryConfiguration.cs b/src/Ubik.Accounting.Transaction.Api/Data/Config/EntryConfiguration.cs index 4eb82369..f1e16027 100644 --- a/src/Ubik.Accounting.Transaction.Api/Data/Config/EntryConfiguration.cs +++ b/src/Ubik.Accounting.Transaction.Api/Data/Config/EntryConfiguration.cs @@ -1,7 +1,6 @@ using Microsoft.EntityFrameworkCore.Metadata.Builders; using Microsoft.EntityFrameworkCore; using Ubik.Accounting.Transaction.Api.Models; -using System.Globalization; namespace Ubik.Accounting.Transaction.Api.Data.Config { diff --git a/src/Ubik.Accounting.Transaction.Api/Features/TaxRates/Consumers/TaxRateAddedConsumer.cs b/src/Ubik.Accounting.Transaction.Api/Features/TaxRates/Consumers/TaxRateAddedConsumer.cs index 676f777b..ec86594b 100644 --- a/src/Ubik.Accounting.Transaction.Api/Features/TaxRates/Consumers/TaxRateAddedConsumer.cs +++ b/src/Ubik.Accounting.Transaction.Api/Features/TaxRates/Consumers/TaxRateAddedConsumer.cs @@ -1,6 +1,5 @@ using MassTransit; using Ubik.Accounting.SalesOrVatTax.Contracts.TaxRates.Events; -using Ubik.Accounting.Structure.Contracts.Accounts.Events; using Ubik.Accounting.Transaction.Api.Features.TaxRates.Services; namespace Ubik.Accounting.Transaction.Api.Features.TaxRates.Consumers diff --git a/src/Ubik.Accounting.Transaction.Api/Features/TaxRates/Consumers/TaxRateDeletedConsumer.cs b/src/Ubik.Accounting.Transaction.Api/Features/TaxRates/Consumers/TaxRateDeletedConsumer.cs index 48b14a1e..714cf753 100644 --- a/src/Ubik.Accounting.Transaction.Api/Features/TaxRates/Consumers/TaxRateDeletedConsumer.cs +++ b/src/Ubik.Accounting.Transaction.Api/Features/TaxRates/Consumers/TaxRateDeletedConsumer.cs @@ -1,6 +1,5 @@ using MassTransit; using Ubik.Accounting.SalesOrVatTax.Contracts.TaxRates.Events; -using Ubik.Accounting.Structure.Contracts.Accounts.Events; using Ubik.Accounting.Transaction.Api.Features.TaxRates.Services; namespace Ubik.Accounting.Transaction.Api.Features.TaxRates.Consumers diff --git a/src/Ubik.Accounting.Transaction.Api/Features/TaxRates/Consumers/TaxRateUpdatedConsumer.cs b/src/Ubik.Accounting.Transaction.Api/Features/TaxRates/Consumers/TaxRateUpdatedConsumer.cs index d5ee0a8e..0c1453c0 100644 --- a/src/Ubik.Accounting.Transaction.Api/Features/TaxRates/Consumers/TaxRateUpdatedConsumer.cs +++ b/src/Ubik.Accounting.Transaction.Api/Features/TaxRates/Consumers/TaxRateUpdatedConsumer.cs @@ -1,6 +1,5 @@ using MassTransit; using Ubik.Accounting.SalesOrVatTax.Contracts.TaxRates.Events; -using Ubik.Accounting.Structure.Contracts.Accounts.Events; using Ubik.Accounting.Transaction.Api.Features.TaxRates.Services; namespace Ubik.Accounting.Transaction.Api.Features.TaxRates.Consumers diff --git a/src/Ubik.Accounting.Transaction.Api/Features/TaxRates/Services/ITaxRateCommandService.cs b/src/Ubik.Accounting.Transaction.Api/Features/TaxRates/Services/ITaxRateCommandService.cs index 98187b2a..9097c26b 100644 --- a/src/Ubik.Accounting.Transaction.Api/Features/TaxRates/Services/ITaxRateCommandService.cs +++ b/src/Ubik.Accounting.Transaction.Api/Features/TaxRates/Services/ITaxRateCommandService.cs @@ -1,5 +1,4 @@ using Ubik.Accounting.SalesOrVatTax.Contracts.TaxRates.Events; -using Ubik.Accounting.Structure.Contracts.Accounts.Events; namespace Ubik.Accounting.Transaction.Api.Features.TaxRates.Services { diff --git a/src/Ubik.Accounting.Transaction.Api/Features/Txs/Controllers/v1/TxsController.cs b/src/Ubik.Accounting.Transaction.Api/Features/Txs/Controllers/v1/TxsController.cs index 2685437e..ad5b020d 100644 --- a/src/Ubik.Accounting.Transaction.Api/Features/Txs/Controllers/v1/TxsController.cs +++ b/src/Ubik.Accounting.Transaction.Api/Features/Txs/Controllers/v1/TxsController.cs @@ -1,6 +1,5 @@ using Asp.Versioning; using Microsoft.AspNetCore.Mvc; -using Ubik.Accounting.Structure.Contracts.Accounts.Results; using Ubik.Accounting.Transaction.Api.Features.Txs.Services; using Ubik.Accounting.Transaction.Contracts.Txs.Commands; using Ubik.Accounting.Transaction.Contracts.Txs.Events; diff --git a/src/Ubik.Accounting.Transaction.Api/Features/Txs/Services/ITxCommandService.cs b/src/Ubik.Accounting.Transaction.Api/Features/Txs/Services/ITxCommandService.cs index c757bf4a..861d4a19 100644 --- a/src/Ubik.Accounting.Transaction.Api/Features/Txs/Services/ITxCommandService.cs +++ b/src/Ubik.Accounting.Transaction.Api/Features/Txs/Services/ITxCommandService.cs @@ -1,5 +1,4 @@ using LanguageExt; -using Ubik.Accounting.Transaction.Api.Models; using Ubik.Accounting.Transaction.Contracts.Txs.Commands; using Ubik.Accounting.Transaction.Contracts.Txs.Events; using Ubik.ApiService.Common.Errors; diff --git a/src/Ubik.Accounting.Transaction.Api/Features/Txs/Services/TxCommandService.cs b/src/Ubik.Accounting.Transaction.Api/Features/Txs/Services/TxCommandService.cs index 11c5ca04..6de21a9f 100644 --- a/src/Ubik.Accounting.Transaction.Api/Features/Txs/Services/TxCommandService.cs +++ b/src/Ubik.Accounting.Transaction.Api/Features/Txs/Services/TxCommandService.cs @@ -1,14 +1,9 @@ -using Dapper; -using LanguageExt; +using LanguageExt; using Microsoft.EntityFrameworkCore; -using System.Reflection.Metadata.Ecma335; using Ubik.Accounting.Transaction.Api.Data; -using Ubik.Accounting.Transaction.Api.Models; using Ubik.Accounting.Transaction.Api.Features.Txs.Errors; using Ubik.Accounting.Transaction.Contracts.Txs.Commands; using Ubik.ApiService.Common.Errors; -using Ubik.ApiService.Common.Services; -using MassTransit.Transports; using MassTransit; using Ubik.Accounting.Transaction.Contracts.Txs.Events; using Ubik.Accounting.Transaction.Api.Mappers; diff --git a/src/Ubik.Accounting.Transaction.Api/Models/Entry.cs b/src/Ubik.Accounting.Transaction.Api/Models/Entry.cs index 997a71be..2dda93c7 100644 --- a/src/Ubik.Accounting.Transaction.Api/Models/Entry.cs +++ b/src/Ubik.Accounting.Transaction.Api/Models/Entry.cs @@ -1,5 +1,4 @@ -using LanguageExt; -using Ubik.Accounting.Transaction.Contracts.Entries.Enums; +using Ubik.Accounting.Transaction.Contracts.Entries.Enums; using Ubik.DB.Common; using Ubik.DB.Common.Models; diff --git a/src/Ubik.Accounting.Transaction.Api/Models/TaxInfo.cs b/src/Ubik.Accounting.Transaction.Api/Models/TaxInfo.cs index fb19ba01..ec9c5b2a 100644 --- a/src/Ubik.Accounting.Transaction.Api/Models/TaxInfo.cs +++ b/src/Ubik.Accounting.Transaction.Api/Models/TaxInfo.cs @@ -1,7 +1,4 @@ -using LanguageExt; -using Ubik.ApiService.Common.Errors; - -namespace Ubik.Accounting.Transaction.Api.Models +namespace Ubik.Accounting.Transaction.Api.Models { //EF core hack to have a nullable tax info owned entity but when it's present, fields are mandatory public class TaxInfo diff --git a/src/Ubik.Accounting.Transaction.Contracts/Entries/Enums/DebitCredit.cs b/src/Ubik.Accounting.Transaction.Contracts/Entries/Enums/DebitCredit.cs index a6e3b78e..021ff67e 100644 --- a/src/Ubik.Accounting.Transaction.Contracts/Entries/Enums/DebitCredit.cs +++ b/src/Ubik.Accounting.Transaction.Contracts/Entries/Enums/DebitCredit.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Ubik.Accounting.Transaction.Contracts.Entries.Enums +namespace Ubik.Accounting.Transaction.Contracts.Entries.Enums { public enum DebitCredit { diff --git a/src/Ubik.Accounting.Transaction.Contracts/Entries/Enums/EntryType.cs b/src/Ubik.Accounting.Transaction.Contracts/Entries/Enums/EntryType.cs index f79bc43e..6f0104b4 100644 --- a/src/Ubik.Accounting.Transaction.Contracts/Entries/Enums/EntryType.cs +++ b/src/Ubik.Accounting.Transaction.Contracts/Entries/Enums/EntryType.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Ubik.Accounting.Transaction.Contracts.Entries.Enums +namespace Ubik.Accounting.Transaction.Contracts.Entries.Enums { public enum EntryType { diff --git a/src/Ubik.Accounting.Transaction.Contracts/Txs/Commands/SubmitTxCommand.cs b/src/Ubik.Accounting.Transaction.Contracts/Txs/Commands/SubmitTxCommand.cs index 81134dad..58527c4d 100644 --- a/src/Ubik.Accounting.Transaction.Contracts/Txs/Commands/SubmitTxCommand.cs +++ b/src/Ubik.Accounting.Transaction.Contracts/Txs/Commands/SubmitTxCommand.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Globalization; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System.ComponentModel.DataAnnotations; using Ubik.Accounting.Transaction.Contracts.Entries.Enums; namespace Ubik.Accounting.Transaction.Contracts.Txs.Commands diff --git a/src/Ubik.Accounting.Transaction.Contracts/Txs/Events/TxSubmited.cs b/src/Ubik.Accounting.Transaction.Contracts/Txs/Events/TxSubmited.cs index 93c641f4..bd1ce92f 100644 --- a/src/Ubik.Accounting.Transaction.Contracts/Txs/Events/TxSubmited.cs +++ b/src/Ubik.Accounting.Transaction.Contracts/Txs/Events/TxSubmited.cs @@ -1,11 +1,4 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Ubik.Accounting.Transaction.Contracts.Entries.Enums; -using Ubik.Accounting.Transaction.Contracts.Txs.Commands; +using Ubik.Accounting.Transaction.Contracts.Entries.Enums; namespace Ubik.Accounting.Transaction.Contracts.Txs.Events { diff --git a/src/Ubik.Db.Common/Ubik.DB.Common/Models/AuditData.cs b/src/Ubik.Db.Common/Ubik.DB.Common/Models/AuditData.cs index c2518ae3..28f71bdb 100644 --- a/src/Ubik.Db.Common/Ubik.DB.Common/Models/AuditData.cs +++ b/src/Ubik.Db.Common/Ubik.DB.Common/Models/AuditData.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Ubik.DB.Common.Models +namespace Ubik.DB.Common.Models { public class AuditData { From 6861307f1719d510e95a2ab7f71da286535298ff Mon Sep 17 00:00:00 2001 From: ubik Date: Fri, 8 Nov 2024 15:12:03 +0100 Subject: [PATCH 67/94] Not bad, before trying to loop only one time to mangage TX simple entry error. --- ...ndError.cs => AccountAreNotFoundErrors.cs} | 4 +- ...EntriesAmountsError.cs => AmountErrors.cs} | 8 +- .../Features/Txs/Errors/BalanceError.cs | 25 ++++++ .../Features/Txs/Errors/ExchangeRateErrors.cs | 29 +++++++ .../Txs/Errors/MoreThanOneMainEntryError.cs | 27 +++++++ .../Features/Txs/Services/TxCommandService.cs | 76 ++++++++++++++++--- 6 files changed, 153 insertions(+), 16 deletions(-) rename src/Ubik.Accounting.Transaction.Api/Features/Txs/Errors/{AccountsInEntriesAreNotFoundError.cs => AccountAreNotFoundErrors.cs} (84%) rename src/Ubik.Accounting.Transaction.Api/Features/Txs/Errors/{EntriesAmountsError.cs => AmountErrors.cs} (71%) create mode 100644 src/Ubik.Accounting.Transaction.Api/Features/Txs/Errors/BalanceError.cs create mode 100644 src/Ubik.Accounting.Transaction.Api/Features/Txs/Errors/ExchangeRateErrors.cs create mode 100644 src/Ubik.Accounting.Transaction.Api/Features/Txs/Errors/MoreThanOneMainEntryError.cs diff --git a/src/Ubik.Accounting.Transaction.Api/Features/Txs/Errors/AccountsInEntriesAreNotFoundError.cs b/src/Ubik.Accounting.Transaction.Api/Features/Txs/Errors/AccountAreNotFoundErrors.cs similarity index 84% rename from src/Ubik.Accounting.Transaction.Api/Features/Txs/Errors/AccountsInEntriesAreNotFoundError.cs rename to src/Ubik.Accounting.Transaction.Api/Features/Txs/Errors/AccountAreNotFoundErrors.cs index afd361e6..22853ac9 100644 --- a/src/Ubik.Accounting.Transaction.Api/Features/Txs/Errors/AccountsInEntriesAreNotFoundError.cs +++ b/src/Ubik.Accounting.Transaction.Api/Features/Txs/Errors/AccountAreNotFoundErrors.cs @@ -4,12 +4,12 @@ namespace Ubik.Accounting.Transaction.Api.Features.Txs.Errors { //TODO: do better error reporting (see when UI) - public record AccountsInEntriesAreNotFoundError: IFeatureError + public record AccountAreNotFoundErrors: IFeatureError { public FeatureErrorType ErrorType { get; init; } public List CustomErrors { get; init; } - public AccountsInEntriesAreNotFoundError(IEnumerable entriesInError) + public AccountAreNotFoundErrors(IEnumerable entriesInError) { ErrorType = FeatureErrorType.BadParams; diff --git a/src/Ubik.Accounting.Transaction.Api/Features/Txs/Errors/EntriesAmountsError.cs b/src/Ubik.Accounting.Transaction.Api/Features/Txs/Errors/AmountErrors.cs similarity index 71% rename from src/Ubik.Accounting.Transaction.Api/Features/Txs/Errors/EntriesAmountsError.cs rename to src/Ubik.Accounting.Transaction.Api/Features/Txs/Errors/AmountErrors.cs index 748df0a0..19a8e6b9 100644 --- a/src/Ubik.Accounting.Transaction.Api/Features/Txs/Errors/EntriesAmountsError.cs +++ b/src/Ubik.Accounting.Transaction.Api/Features/Txs/Errors/AmountErrors.cs @@ -4,12 +4,12 @@ namespace Ubik.Accounting.Transaction.Api.Features.Txs.Errors { //TODO: do better error reporting (see when UI) - public record EntriesAmountsError : IFeatureError + public record AmountErrors : IFeatureError { public FeatureErrorType ErrorType { get; init; } public List CustomErrors { get; init; } - public EntriesAmountsError(IEnumerable entriesInError) + public AmountErrors(IEnumerable entriesInError) { ErrorType = FeatureErrorType.BadParams; @@ -20,8 +20,8 @@ public EntriesAmountsError(IEnumerable entriesInError) CustomErrors.Add(new CustomError() { ErrorCode = "BAD_AMOUNT_PARAMS_FOR_ENTRY", - ErrorFriendlyMessage = "This entry contains invalid amount value(s)", - ErrorValueDetails = $"Can be the amount or the additional amount info" + ErrorFriendlyMessage = "This entry contains invalid amount value(s). Amount > 0", + ErrorValueDetails = $"Field:Amount / Value:{entry.Amount} - Field:OriginalAmount / Value:{entry.AmountAdditionnalInfo?.OriginalAmount}" }); } } diff --git a/src/Ubik.Accounting.Transaction.Api/Features/Txs/Errors/BalanceError.cs b/src/Ubik.Accounting.Transaction.Api/Features/Txs/Errors/BalanceError.cs new file mode 100644 index 00000000..448d36a3 --- /dev/null +++ b/src/Ubik.Accounting.Transaction.Api/Features/Txs/Errors/BalanceError.cs @@ -0,0 +1,25 @@ +using Ubik.ApiService.Common.Errors; + +namespace Ubik.Accounting.Transaction.Api.Features.Txs.Errors +{ + public class BalanceError : IFeatureError + { + public FeatureErrorType ErrorType { get; init; } + public List CustomErrors { get; init; } + + public BalanceError(decimal amount, decimal debitAmount, decimal creditAmount) + { + ErrorType = FeatureErrorType.BadParams; + CustomErrors = new List() + { + new CustomError() + { + ErrorCode = "TX_BALANCE_ERROR", + ErrorFriendlyMessage = "The total of the TX or the Debit/credit amounts don't match.", + ErrorValueDetails = $"Field:Amount / Value:{amount} - CaluculatedField:DebitAmount / Value:{debitAmount} - CaluculatedField:CreditAmount / Value:{creditAmount}" + } + }; + } + } +} +} diff --git a/src/Ubik.Accounting.Transaction.Api/Features/Txs/Errors/ExchangeRateErrors.cs b/src/Ubik.Accounting.Transaction.Api/Features/Txs/Errors/ExchangeRateErrors.cs new file mode 100644 index 00000000..4857f4a5 --- /dev/null +++ b/src/Ubik.Accounting.Transaction.Api/Features/Txs/Errors/ExchangeRateErrors.cs @@ -0,0 +1,29 @@ +using Ubik.Accounting.Transaction.Contracts.Txs.Commands; +using Ubik.ApiService.Common.Errors; + +namespace Ubik.Accounting.Transaction.Api.Features.Txs.Errors +{ + public class ExchangeRateErrors : IFeatureError + { + public FeatureErrorType ErrorType { get; init; } + public List CustomErrors { get; init; } + + public ExchangeRateErrors(IEnumerable entriesInError) + { + + ErrorType = FeatureErrorType.BadParams; + CustomErrors = new List(); + + foreach (var entry in entriesInError) + { + CustomErrors.Add(new CustomError() + { + ErrorCode = "BAD_EXCHANGE_RATE_PARAMS_FOR_ENTRY", + ErrorFriendlyMessage = "This entry contains invalid exchange rates info.", + ErrorValueDetails = $"Field:Amount / Value:{entry.Amount} - Field:OriginalAmount / Value:{entry.AmountAdditionnalInfo?.OriginalAmount} - Field:ExchangeRate / Value:{entry.AmountAdditionnalInfo?.ExchangeRate}" + }); + } + } + } +} +} diff --git a/src/Ubik.Accounting.Transaction.Api/Features/Txs/Errors/MoreThanOneMainEntryError.cs b/src/Ubik.Accounting.Transaction.Api/Features/Txs/Errors/MoreThanOneMainEntryError.cs new file mode 100644 index 00000000..e5dac71a --- /dev/null +++ b/src/Ubik.Accounting.Transaction.Api/Features/Txs/Errors/MoreThanOneMainEntryError.cs @@ -0,0 +1,27 @@ +using Ubik.Accounting.Transaction.Contracts.Txs.Commands; +using Ubik.ApiService.Common.Errors; + +namespace Ubik.Accounting.Transaction.Api.Features.Txs.Errors +{ + public class MoreThanOneMainEntryError : IFeatureError + { + public FeatureErrorType ErrorType { get; init; } + public List CustomErrors { get; init; } + + public MoreThanOneMainEntryError() + { + + ErrorType = FeatureErrorType.BadParams; + CustomErrors = new List() + { + new CustomError() + { + ErrorCode = "TX_COUNTAINS_MORE_THAN_ONE_MAIN_ENTRY", + ErrorFriendlyMessage = "A tx cannot contain more than one entry", + ErrorValueDetails = string.Empty, + } + }; + } + } +} + diff --git a/src/Ubik.Accounting.Transaction.Api/Features/Txs/Services/TxCommandService.cs b/src/Ubik.Accounting.Transaction.Api/Features/Txs/Services/TxCommandService.cs index 6de21a9f..5f4f1883 100644 --- a/src/Ubik.Accounting.Transaction.Api/Features/Txs/Services/TxCommandService.cs +++ b/src/Ubik.Accounting.Transaction.Api/Features/Txs/Services/TxCommandService.cs @@ -7,6 +7,7 @@ using MassTransit; using Ubik.Accounting.Transaction.Contracts.Txs.Events; using Ubik.Accounting.Transaction.Api.Mappers; +using Ubik.Accounting.Transaction.Contracts.Entries.Enums; namespace Ubik.Accounting.Transaction.Api.Features.Txs.Services { @@ -15,8 +16,11 @@ public class TxCommandService(AccountingTxContext ctx { public async Task> SubmitTx(SubmitTxCommand command) { - return await ValidateEntriesAccountsAsync(command) + return await ValidateOnlyOneMainEntryAsync(command) + .BindAsync(ValidateBalanceAsync) .BindAsync(ValidateEntriesAmountsAsync) + .BindAsync(ValidateExchangeRatesInfoAsync) + .BindAsync(ValidateEntriesAccountsAsync) .BindAsync(PublishSubmittedAsync); } @@ -30,6 +34,39 @@ private async Task> PublishSubmittedAsync(Subm return submited; } + private async Task> ValidateOnlyOneMainEntryAsync(SubmitTxCommand tx) + { + var count = tx.Entries.Count(e => e.Type == EntryType.Main); + + await Task.CompletedTask; + + if (count == 1) + return tx; + else + return new MoreThanOneMainEntryError(); + } + + private async Task> ValidateBalanceAsync(SubmitTxCommand tx) + { + var totalDebit = tx.Entries.Where(e => e.Sign == DebitCredit.Debit).Sum(e => e.Amount); + var totalCredit = tx.Entries.Where(e => e.Sign == DebitCredit.Credit).Sum(e => e.Amount); + + await Task.CompletedTask; + + if (totalDebit == totalCredit + && totalCredit == tx.Amount + && totalDebit == tx.Amount) + + return tx; + else + return new BalanceError(tx.Amount,totalDebit,totalCredit); + } + + private async Task> ValidateEntriesInfoAsync(SubmitTxCommand tx) + { + var err = new List(); + + } private async Task> ValidateEntriesAccountsAsync(SubmitTxCommand tx) { @@ -48,7 +85,33 @@ private async Task> ValidateEntriesAccoun else { var badEntries = tx.Entries.Where(e => missingAccounts.Contains(e.AccountId)); - return new AccountsInEntriesAreNotFoundError(badEntries); + return new AccountAreNotFoundErrors(badEntries); + } + } + + private async Task> ValidateExchangeRatesInfoAsync(SubmitTxCommand tx) + { + var exchangeRateEntriesInErr = new List(); + + foreach (var entry in tx.Entries) + { + if (entry.AmountAdditionnalInfo != null) + { + if (entry.AmountAdditionnalInfo.ExchangeRate <= 0) + exchangeRateEntriesInErr.Add(entry); + + var calculatedAmount = entry.AmountAdditionnalInfo.OriginalAmount * entry.AmountAdditionnalInfo.ExchangeRate; + if (calculatedAmount != entry.Amount) + exchangeRateEntriesInErr.Add(entry); + } + } + + if (exchangeRateEntriesInErr.Count > 0) + return new ExchangeRateErrors(exchangeRateEntriesInErr); + else + { + await Task.CompletedTask; + return tx; } } @@ -68,17 +131,10 @@ private async Task> ValidateEntriesAmount { errEntries.Add(entry); } - - //TODO: make a special case for that - var expectedAmount = entry.AmountAdditionnalInfo.OriginalAmount * entry.AmountAdditionnalInfo.ExchangeRate; - if (expectedAmount != entry.Amount) - { - errEntries.Add(entry); - } } } if(errEntries.Count > 0) - return new EntriesAmountsError(errEntries); + return new AmountErrors(errEntries); else { //Maybe we will need to be async... (very dirty check for now) From 0db167438b06750b73be142878383f20c9f06f57 Mon Sep 17 00:00:00 2001 From: ubik Date: Fri, 8 Nov 2024 15:27:25 +0100 Subject: [PATCH 68/94] Loop on entries check info. --- .../Features/Txs/Services/TxCommandService.cs | 107 +++++++++--------- 1 file changed, 51 insertions(+), 56 deletions(-) diff --git a/src/Ubik.Accounting.Transaction.Api/Features/Txs/Services/TxCommandService.cs b/src/Ubik.Accounting.Transaction.Api/Features/Txs/Services/TxCommandService.cs index 5f4f1883..60ff1ecf 100644 --- a/src/Ubik.Accounting.Transaction.Api/Features/Txs/Services/TxCommandService.cs +++ b/src/Ubik.Accounting.Transaction.Api/Features/Txs/Services/TxCommandService.cs @@ -18,8 +18,7 @@ public async Task> SubmitTx(SubmitTxCommand co { return await ValidateOnlyOneMainEntryAsync(command) .BindAsync(ValidateBalanceAsync) - .BindAsync(ValidateEntriesAmountsAsync) - .BindAsync(ValidateExchangeRatesInfoAsync) + .BindAsync(ValidateEntriesInfoAsync) .BindAsync(ValidateEntriesAccountsAsync) .BindAsync(PublishSubmittedAsync); } @@ -59,13 +58,61 @@ private async Task> ValidateBalanceAsync( return tx; else - return new BalanceError(tx.Amount,totalDebit,totalCredit); + return new BalanceError(tx.Amount, totalDebit, totalCredit); } private async Task> ValidateEntriesInfoAsync(SubmitTxCommand tx) { - var err = new List(); + var errExchangeRates = new List(); + var errAmounts = new List(); + foreach (var entry in tx.Entries) + { + if (!ValidateExchangeRatesInfo(entry)) + errExchangeRates.Add(entry); + + if (!ValidateEntriesAmounts(entry)) + errAmounts.Add(entry); + } + + await Task.CompletedTask; + + if (errExchangeRates.Count == 0 && errAmounts.Count == 0) + return tx; + else + { + if(errExchangeRates.Count > 0) + return new ExchangeRateErrors(errExchangeRates); + else + return new AmountErrors(errAmounts); + } + } + + private static bool ValidateEntriesAmounts(SubmitTxEntry entry) + { + if (entry.Amount <= 0) + return false; + + if (entry.AmountAdditionnalInfo != null + && entry.AmountAdditionnalInfo.OriginalAmount <= 0) + + return false; + + return true; + } + + private bool ValidateExchangeRatesInfo(SubmitTxEntry entry) + { + if (entry.AmountAdditionnalInfo != null) + { + if (entry.AmountAdditionnalInfo.ExchangeRate <= 0) + return false; + + var calculatedAmount = entry.AmountAdditionnalInfo.OriginalAmount * entry.AmountAdditionnalInfo.ExchangeRate; + if (calculatedAmount != entry.Amount) + return false; + } + return true; } private async Task> ValidateEntriesAccountsAsync(SubmitTxCommand tx) @@ -89,58 +136,6 @@ private async Task> ValidateEntriesAccoun } } - private async Task> ValidateExchangeRatesInfoAsync(SubmitTxCommand tx) - { - var exchangeRateEntriesInErr = new List(); - - foreach (var entry in tx.Entries) - { - if (entry.AmountAdditionnalInfo != null) - { - if (entry.AmountAdditionnalInfo.ExchangeRate <= 0) - exchangeRateEntriesInErr.Add(entry); - - var calculatedAmount = entry.AmountAdditionnalInfo.OriginalAmount * entry.AmountAdditionnalInfo.ExchangeRate; - if (calculatedAmount != entry.Amount) - exchangeRateEntriesInErr.Add(entry); - } - } - if (exchangeRateEntriesInErr.Count > 0) - return new ExchangeRateErrors(exchangeRateEntriesInErr); - else - { - await Task.CompletedTask; - return tx; - } - } - - private async Task> ValidateEntriesAmountsAsync(SubmitTxCommand tx) - { - var errEntries = new List(); - foreach (var entry in tx.Entries) - { - if (entry.Amount <= 0) - { - errEntries.Add(entry); - } - - if (entry.AmountAdditionnalInfo != null) - { - if (entry.AmountAdditionnalInfo.OriginalAmount <= 0) - { - errEntries.Add(entry); - } - } - } - if(errEntries.Count > 0) - return new AmountErrors(errEntries); - else - { - //Maybe we will need to be async... (very dirty check for now) - await Task.CompletedTask; - return tx; - } - } } } From 2093795c63637034b827863d323754b3a6763948 Mon Sep 17 00:00:00 2001 From: ubik Date: Fri, 8 Nov 2024 16:08:11 +0100 Subject: [PATCH 69/94] Submit transaction: first minimal version. (not checking from VAT api now) --- .../Data/Init/CurrenciesData.cs | 31 ++------ .../Data/Init/CurrenciesData.sql | 2 + .../Data/Init/DbInitializer.cs | 2 +- .../Models/Currency.cs | 2 +- .../Ubik.Accounting.Structure.Api.csproj | 3 + .../Data/AccountingTxContext.cs | 5 ++ .../Data/Config/CurrencyConfiguration.cs | 28 ++++++++ .../Data/Init/CurrenciesData.cs | 17 +++++ .../Data/Init/CurrenciesData.sql | 2 + .../Data/Init/DbInitializer.cs | 1 + .../Features/Txs/Errors/AmountErrors.cs | 29 -------- .../Features/Txs/Errors/BalanceError.cs | 1 - .../Features/Txs/Errors/EntriesInfoErrors.cs | 71 +++++++++++++++++++ .../Features/Txs/Errors/ExchangeRateErrors.cs | 29 -------- .../Features/Txs/Services/TxCommandService.cs | 71 +++++++++++-------- .../Mappers/TxMappers.cs | 5 +- .../Models/Currency.cs | 3 +- .../Models/TaxRate.cs | 6 +- .../Ubik.Accounting.Transaction.Api.csproj | 3 + .../Txs/Events/TxSubmited.cs | 2 + 20 files changed, 193 insertions(+), 120 deletions(-) create mode 100644 src/Ubik.Accounting.Structure.Api/Data/Init/CurrenciesData.sql create mode 100644 src/Ubik.Accounting.Transaction.Api/Data/Config/CurrencyConfiguration.cs create mode 100644 src/Ubik.Accounting.Transaction.Api/Data/Init/CurrenciesData.cs create mode 100644 src/Ubik.Accounting.Transaction.Api/Data/Init/CurrenciesData.sql delete mode 100644 src/Ubik.Accounting.Transaction.Api/Features/Txs/Errors/AmountErrors.cs create mode 100644 src/Ubik.Accounting.Transaction.Api/Features/Txs/Errors/EntriesInfoErrors.cs delete mode 100644 src/Ubik.Accounting.Transaction.Api/Features/Txs/Errors/ExchangeRateErrors.cs diff --git a/src/Ubik.Accounting.Structure.Api/Data/Init/CurrenciesData.cs b/src/Ubik.Accounting.Structure.Api/Data/Init/CurrenciesData.cs index b5ef4cd9..8455d681 100644 --- a/src/Ubik.Accounting.Structure.Api/Data/Init/CurrenciesData.cs +++ b/src/Ubik.Accounting.Structure.Api/Data/Init/CurrenciesData.cs @@ -1,39 +1,18 @@ using MassTransit; +using Microsoft.EntityFrameworkCore; +using System.Runtime.CompilerServices; using Ubik.Accounting.Structure.Api.Models; namespace Ubik.Accounting.Structure.Api.Data.Init { internal static class CurrenciesData { - internal static void Load(AccountingDbContext context) + internal static async Task LoadAsync(AccountingDbContext context) { if (!context.Currencies.Any()) { - var baseValuesForTenants = new BaseValuesForTenants(); - var baseValuesForCurrencies = new BaseValuesForCurrencies(); - - var currencies = new Currency[] - { - new Currency - { - Id= baseValuesForCurrencies.CurrencyId1, - IsoCode = "CHF", - TenantId= baseValuesForTenants.TenantId, - Version = NewId.NextGuid() - }, - new Currency - { - Id= baseValuesForCurrencies.CurrencyId2, - IsoCode = "USD", - TenantId= baseValuesForTenants.TenantId, - Version = NewId.NextGuid() - } - }; - foreach (Currency c in currencies) - { - context.Currencies.Add(c); - } - context.SaveChanges(); + var query = await File.ReadAllTextAsync(@"Data/Init/CurrenciesData.sql"); + await context.Database.ExecuteSqlAsync(FormattableStringFactory.Create(query)); } } } diff --git a/src/Ubik.Accounting.Structure.Api/Data/Init/CurrenciesData.sql b/src/Ubik.Accounting.Structure.Api/Data/Init/CurrenciesData.sql new file mode 100644 index 00000000..e2a94eaf --- /dev/null +++ b/src/Ubik.Accounting.Structure.Api/Data/Init/CurrenciesData.sql @@ -0,0 +1,2 @@ +INSERT INTO public.currencies (id, iso_code, version, tenant_id) VALUES ('248e0000-5dd4-0015-291d-08dcd98e55f8', 'USD', '60280000-3c36-7456-566c-08dd00020a7e', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.currencies (id, iso_code, version, tenant_id) VALUES ('248e0000-5dd4-0015-38c5-08dcd98e5b2d', 'CHF', '60280000-3c36-7456-4e08-08dd00020a7e', '74a20000-088f-d0ad-7a4e-08dce86b0459'); diff --git a/src/Ubik.Accounting.Structure.Api/Data/Init/DbInitializer.cs b/src/Ubik.Accounting.Structure.Api/Data/Init/DbInitializer.cs index 95302495..7d52922b 100644 --- a/src/Ubik.Accounting.Structure.Api/Data/Init/DbInitializer.cs +++ b/src/Ubik.Accounting.Structure.Api/Data/Init/DbInitializer.cs @@ -6,7 +6,7 @@ static internal class DbInitializer { static internal async Task InitializeAsync(AccountingDbContext context) { - CurrenciesData.Load(context); + await CurrenciesData.LoadAsync(context); ClassificationsData.Load(context); await AccountGroupsData.LoadAsync(context); await AccountsData.LoadAsync(context); diff --git a/src/Ubik.Accounting.Structure.Api/Models/Currency.cs b/src/Ubik.Accounting.Structure.Api/Models/Currency.cs index d2da5801..a08add66 100644 --- a/src/Ubik.Accounting.Structure.Api/Models/Currency.cs +++ b/src/Ubik.Accounting.Structure.Api/Models/Currency.cs @@ -3,7 +3,7 @@ namespace Ubik.Accounting.Structure.Api.Models { - //TODO: will be updated by another service + //Source of truth => To be determined public class Currency : ITenantEntity { public Guid Id { get; set; } diff --git a/src/Ubik.Accounting.Structure.Api/Ubik.Accounting.Structure.Api.csproj b/src/Ubik.Accounting.Structure.Api/Ubik.Accounting.Structure.Api.csproj index ef8ebdf0..aece3434 100644 --- a/src/Ubik.Accounting.Structure.Api/Ubik.Accounting.Structure.Api.csproj +++ b/src/Ubik.Accounting.Structure.Api/Ubik.Accounting.Structure.Api.csproj @@ -58,6 +58,9 @@ Always + + Always + diff --git a/src/Ubik.Accounting.Transaction.Api/Data/AccountingTxContext.cs b/src/Ubik.Accounting.Transaction.Api/Data/AccountingTxContext.cs index 6a6ec3a6..81f51bec 100644 --- a/src/Ubik.Accounting.Transaction.Api/Data/AccountingTxContext.cs +++ b/src/Ubik.Accounting.Transaction.Api/Data/AccountingTxContext.cs @@ -16,6 +16,7 @@ public class AccountingTxContext(DbContextOptions options public DbSet Txs { get; set; } public DbSet Accounts { get; set; } public DbSet TaxRates { get; set; } + public DbSet Currencies { get; set; } protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) { @@ -68,6 +69,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) new AccountConfiguration().Configure(modelBuilder.Entity()); new TaxRateConfiguration().Configure(modelBuilder.Entity()); new TxConfiguration().Configure(modelBuilder.Entity()); + new CurrencyConfiguration().Configure(modelBuilder.Entity()); base.OnModelCreating(modelBuilder); } @@ -86,6 +88,9 @@ private void SetTenantId(ModelBuilder modelBuilder) modelBuilder.Entity() .HasQueryFilter(mt => mt.TenantId == userService.TenantId); + modelBuilder.Entity() + .HasQueryFilter(mt => mt.TenantId == userService.TenantId); + //modelBuilder.Entity() // .HasQueryFilter(mt => mt.TenantId == _currentUser.TenantId); diff --git a/src/Ubik.Accounting.Transaction.Api/Data/Config/CurrencyConfiguration.cs b/src/Ubik.Accounting.Transaction.Api/Data/Config/CurrencyConfiguration.cs new file mode 100644 index 00000000..f29430c1 --- /dev/null +++ b/src/Ubik.Accounting.Transaction.Api/Data/Config/CurrencyConfiguration.cs @@ -0,0 +1,28 @@ +using Microsoft.EntityFrameworkCore.Metadata.Builders; +using Microsoft.EntityFrameworkCore; +using Ubik.Accounting.Transaction.Api.Models; + +namespace Ubik.Accounting.Transaction.Api.Data.Config +{ + public class CurrencyConfiguration : IEntityTypeConfiguration + { + public void Configure(EntityTypeBuilder builder) + { + builder.ToTable("currencies"); + + builder.Property(a => a.IsoCode) + .IsRequired() + .HasMaxLength(3); + + builder.Property(a => a.TenantId) + .IsRequired(); + + builder.HasIndex(a => new { a.IsoCode, a.TenantId }) + .IsUnique(); + + builder.HasIndex(a => a.TenantId); + + } + } + +} diff --git a/src/Ubik.Accounting.Transaction.Api/Data/Init/CurrenciesData.cs b/src/Ubik.Accounting.Transaction.Api/Data/Init/CurrenciesData.cs new file mode 100644 index 00000000..d85bd1a1 --- /dev/null +++ b/src/Ubik.Accounting.Transaction.Api/Data/Init/CurrenciesData.cs @@ -0,0 +1,17 @@ +using Microsoft.EntityFrameworkCore; +using System.Runtime.CompilerServices; + +namespace Ubik.Accounting.Transaction.Api.Data.Init +{ + internal static class CurrenciesData + { + internal static async Task LoadAsync(AccountingTxContext context) + { + if (!context.Currencies.Any()) + { + var query = await File.ReadAllTextAsync(@"Data/Init/CurrenciesData.sql"); + await context.Database.ExecuteSqlAsync(FormattableStringFactory.Create(query)); + } + } + } +} diff --git a/src/Ubik.Accounting.Transaction.Api/Data/Init/CurrenciesData.sql b/src/Ubik.Accounting.Transaction.Api/Data/Init/CurrenciesData.sql new file mode 100644 index 00000000..2a20fef9 --- /dev/null +++ b/src/Ubik.Accounting.Transaction.Api/Data/Init/CurrenciesData.sql @@ -0,0 +1,2 @@ +INSERT INTO public.currencies (id, iso_code, version, tenant_id) VALUES ('248e0000-5dd4-0015-291d-08dcd98e55f8', 'USD', '60280000-3c36-7456-566c-08dd00020a7e', '74a20000-088f-d0ad-7a4e-08dce86b0459'); +INSERT INTO public.currencies (id, iso_code, version, tenant_id) VALUES ('248e0000-5dd4-0015-38c5-08dcd98e5b2d', 'CHF', '60280000-3c36-7456-4e08-08dd00020a7e', '74a20000-088f-d0ad-7a4e-08dce86b0459'); diff --git a/src/Ubik.Accounting.Transaction.Api/Data/Init/DbInitializer.cs b/src/Ubik.Accounting.Transaction.Api/Data/Init/DbInitializer.cs index 55300164..24e4f80c 100644 --- a/src/Ubik.Accounting.Transaction.Api/Data/Init/DbInitializer.cs +++ b/src/Ubik.Accounting.Transaction.Api/Data/Init/DbInitializer.cs @@ -6,6 +6,7 @@ static internal async Task InitializeAsync(AccountingTxContext context) { await AccountsData.LoadAsync(context); await TaxRatesData.LoadAsync(context); + await CurrenciesData.LoadAsync(context); } } } diff --git a/src/Ubik.Accounting.Transaction.Api/Features/Txs/Errors/AmountErrors.cs b/src/Ubik.Accounting.Transaction.Api/Features/Txs/Errors/AmountErrors.cs deleted file mode 100644 index 19a8e6b9..00000000 --- a/src/Ubik.Accounting.Transaction.Api/Features/Txs/Errors/AmountErrors.cs +++ /dev/null @@ -1,29 +0,0 @@ -using Ubik.Accounting.Transaction.Contracts.Txs.Commands; -using Ubik.ApiService.Common.Errors; - -namespace Ubik.Accounting.Transaction.Api.Features.Txs.Errors -{ - //TODO: do better error reporting (see when UI) - public record AmountErrors : IFeatureError - { - public FeatureErrorType ErrorType { get; init; } - public List CustomErrors { get; init; } - - public AmountErrors(IEnumerable entriesInError) - { - - ErrorType = FeatureErrorType.BadParams; - CustomErrors = new List(); - - foreach (var entry in entriesInError) - { - CustomErrors.Add(new CustomError() - { - ErrorCode = "BAD_AMOUNT_PARAMS_FOR_ENTRY", - ErrorFriendlyMessage = "This entry contains invalid amount value(s). Amount > 0", - ErrorValueDetails = $"Field:Amount / Value:{entry.Amount} - Field:OriginalAmount / Value:{entry.AmountAdditionnalInfo?.OriginalAmount}" - }); - } - } - } -} diff --git a/src/Ubik.Accounting.Transaction.Api/Features/Txs/Errors/BalanceError.cs b/src/Ubik.Accounting.Transaction.Api/Features/Txs/Errors/BalanceError.cs index 448d36a3..d2aada63 100644 --- a/src/Ubik.Accounting.Transaction.Api/Features/Txs/Errors/BalanceError.cs +++ b/src/Ubik.Accounting.Transaction.Api/Features/Txs/Errors/BalanceError.cs @@ -22,4 +22,3 @@ public BalanceError(decimal amount, decimal debitAmount, decimal creditAmount) } } } -} diff --git a/src/Ubik.Accounting.Transaction.Api/Features/Txs/Errors/EntriesInfoErrors.cs b/src/Ubik.Accounting.Transaction.Api/Features/Txs/Errors/EntriesInfoErrors.cs new file mode 100644 index 00000000..4079f197 --- /dev/null +++ b/src/Ubik.Accounting.Transaction.Api/Features/Txs/Errors/EntriesInfoErrors.cs @@ -0,0 +1,71 @@ +using Ubik.Accounting.Transaction.Contracts.Txs.Commands; +using Ubik.ApiService.Common.Errors; + +namespace Ubik.Accounting.Transaction.Api.Features.Txs.Errors +{ + public enum EntryErrorType + { + ExchangeRate, + Amount, + Currency, + } + + public class EntriesInfoErrors : IFeatureError + { + public FeatureErrorType ErrorType { get; init; } + public List CustomErrors { get; init; } + + public EntriesInfoErrors(Dictionary> entriesInError) + { + ErrorType = FeatureErrorType.BadParams; + CustomErrors = []; + + foreach (var entryGroup in entriesInError) + { + foreach (var entry in entryGroup.Value) + { + CustomErrors.Add(new CustomError() + { + ErrorCode = GetErrorCode(entryGroup.Key), + ErrorFriendlyMessage = GetErrorFriendlyMessage(entryGroup.Key), + ErrorValueDetails = GetErrorValueDetails(entryGroup.Key, entry) + }); + } + } + } + + private static string GetErrorCode(EntryErrorType errorType) + { + return errorType switch + { + EntryErrorType.ExchangeRate => "BAD_EXCHANGE_RATE_PARAMS_FOR_ENTRY", + EntryErrorType.Amount => "BAD_AMOUNT_PARAMS_FOR_ENTRY", + EntryErrorType.Currency => "BAD_CURRENCY_PARAMS_FOR_ENTRY", + _ => "UNKNOWN_ERROR" + }; + } + + private static string GetErrorFriendlyMessage(EntryErrorType errorType) + { + return errorType switch + { + EntryErrorType.ExchangeRate => "This entry contains invalid exchange rates info.", + EntryErrorType.Amount => "This entry contains invalid amount info.", + EntryErrorType.Currency => "This entry contains invalid currency info.", + _ => "This entry contains unknown error info." + }; + } + + private static string GetErrorValueDetails(EntryErrorType errorType, SubmitTxEntry entry) + { + return errorType switch + { + EntryErrorType.ExchangeRate => $"Field:Amount / Value:{entry.Amount} - Field:OriginalAmount / Value:{entry.AmountAdditionnalInfo?.OriginalAmount} - Field:ExchangeRate / Value:{entry.AmountAdditionnalInfo?.ExchangeRate}", + EntryErrorType.Amount => $"Field:Amount / Value:{entry.Amount}", + EntryErrorType.Currency => $"Field:Currency / Value:{entry.AmountAdditionnalInfo?.OriginalCurrencyId}", + _ => "Unknown error details." + }; + } + } +} + diff --git a/src/Ubik.Accounting.Transaction.Api/Features/Txs/Errors/ExchangeRateErrors.cs b/src/Ubik.Accounting.Transaction.Api/Features/Txs/Errors/ExchangeRateErrors.cs deleted file mode 100644 index 4857f4a5..00000000 --- a/src/Ubik.Accounting.Transaction.Api/Features/Txs/Errors/ExchangeRateErrors.cs +++ /dev/null @@ -1,29 +0,0 @@ -using Ubik.Accounting.Transaction.Contracts.Txs.Commands; -using Ubik.ApiService.Common.Errors; - -namespace Ubik.Accounting.Transaction.Api.Features.Txs.Errors -{ - public class ExchangeRateErrors : IFeatureError - { - public FeatureErrorType ErrorType { get; init; } - public List CustomErrors { get; init; } - - public ExchangeRateErrors(IEnumerable entriesInError) - { - - ErrorType = FeatureErrorType.BadParams; - CustomErrors = new List(); - - foreach (var entry in entriesInError) - { - CustomErrors.Add(new CustomError() - { - ErrorCode = "BAD_EXCHANGE_RATE_PARAMS_FOR_ENTRY", - ErrorFriendlyMessage = "This entry contains invalid exchange rates info.", - ErrorValueDetails = $"Field:Amount / Value:{entry.Amount} - Field:OriginalAmount / Value:{entry.AmountAdditionnalInfo?.OriginalAmount} - Field:ExchangeRate / Value:{entry.AmountAdditionnalInfo?.ExchangeRate}" - }); - } - } - } -} -} diff --git a/src/Ubik.Accounting.Transaction.Api/Features/Txs/Services/TxCommandService.cs b/src/Ubik.Accounting.Transaction.Api/Features/Txs/Services/TxCommandService.cs index 60ff1ecf..3b720d4a 100644 --- a/src/Ubik.Accounting.Transaction.Api/Features/Txs/Services/TxCommandService.cs +++ b/src/Ubik.Accounting.Transaction.Api/Features/Txs/Services/TxCommandService.cs @@ -18,7 +18,7 @@ public async Task> SubmitTx(SubmitTxCommand co { return await ValidateOnlyOneMainEntryAsync(command) .BindAsync(ValidateBalanceAsync) - .BindAsync(ValidateEntriesInfoAsync) + .BindAsync(ValidateEntriesInfoAsync) //Exchange rates, amounts and currencies .BindAsync(ValidateEntriesAccountsAsync) .BindAsync(PublishSubmittedAsync); } @@ -33,16 +33,15 @@ private async Task> PublishSubmittedAsync(Subm return submited; } - private async Task> ValidateOnlyOneMainEntryAsync(SubmitTxCommand tx) + private static async Task> ValidateOnlyOneMainEntryAsync(SubmitTxCommand tx) { var count = tx.Entries.Count(e => e.Type == EntryType.Main); await Task.CompletedTask; - if (count == 1) - return tx; - else - return new MoreThanOneMainEntryError(); + return count == 1 + ? tx + : new MoreThanOneMainEntryError(); } private async Task> ValidateBalanceAsync(SubmitTxCommand tx) @@ -52,19 +51,18 @@ private async Task> ValidateBalanceAsync( await Task.CompletedTask; - if (totalDebit == totalCredit + return totalDebit == totalCredit && totalCredit == tx.Amount - && totalDebit == tx.Amount) - - return tx; - else - return new BalanceError(tx.Amount, totalDebit, totalCredit); + && totalDebit == tx.Amount + ? tx + : new BalanceError(tx.Amount, totalDebit, totalCredit); } private async Task> ValidateEntriesInfoAsync(SubmitTxCommand tx) { var errExchangeRates = new List(); var errAmounts = new List(); + var errCurrencies = new List(); foreach (var entry in tx.Entries) { @@ -73,35 +71,39 @@ private async Task> ValidateEntriesInfoAs if (!ValidateEntriesAmounts(entry)) errAmounts.Add(entry); + + if (!await ValidateCurrencyAsync(entry)) + errCurrencies.Add(entry); } await Task.CompletedTask; - if (errExchangeRates.Count == 0 && errAmounts.Count == 0) + if (errExchangeRates.Count == 0 + && errAmounts.Count == 0 + && errCurrencies.Count == 0) + return tx; else { - if(errExchangeRates.Count > 0) - return new ExchangeRateErrors(errExchangeRates); - else - return new AmountErrors(errAmounts); + var dic = new Dictionary>(); + if (errExchangeRates.Count > 0) + dic[EntryErrorType.ExchangeRate] = errExchangeRates; + if (errAmounts.Count > 0) + dic[EntryErrorType.Amount] = errAmounts; + if (errCurrencies.Count > 0) + dic[EntryErrorType.Currency] = errCurrencies; + + return new EntriesInfoErrors(dic); } } private static bool ValidateEntriesAmounts(SubmitTxEntry entry) { - if (entry.Amount <= 0) - return false; - - if (entry.AmountAdditionnalInfo != null - && entry.AmountAdditionnalInfo.OriginalAmount <= 0) - - return false; - - return true; + return entry.Amount > 0 + && (entry.AmountAdditionnalInfo == null || entry.AmountAdditionnalInfo.OriginalAmount > 0); } - private bool ValidateExchangeRatesInfo(SubmitTxEntry entry) + private static bool ValidateExchangeRatesInfo(SubmitTxEntry entry) { if (entry.AmountAdditionnalInfo != null) { @@ -115,6 +117,19 @@ private bool ValidateExchangeRatesInfo(SubmitTxEntry entry) return true; } + private async Task ValidateCurrencyAsync(SubmitTxEntry entry) + { + if (entry.AmountAdditionnalInfo != null) + { + var exist = await ctx.Currencies.FindAsync(entry.AmountAdditionnalInfo.OriginalCurrencyId); + + if (exist == null) + return false; + } + + return true; + } + private async Task> ValidateEntriesAccountsAsync(SubmitTxCommand tx) { //Check all the accounts at the same time @@ -135,7 +150,5 @@ private async Task> ValidateEntriesAccoun return new AccountAreNotFoundErrors(badEntries); } } - - } } diff --git a/src/Ubik.Accounting.Transaction.Api/Mappers/TxMappers.cs b/src/Ubik.Accounting.Transaction.Api/Mappers/TxMappers.cs index d823aa9d..131d851c 100644 --- a/src/Ubik.Accounting.Transaction.Api/Mappers/TxMappers.cs +++ b/src/Ubik.Accounting.Transaction.Api/Mappers/TxMappers.cs @@ -1,4 +1,5 @@ -using Ubik.Accounting.Transaction.Contracts.Txs.Commands; +using MassTransit; +using Ubik.Accounting.Transaction.Contracts.Txs.Commands; using Ubik.Accounting.Transaction.Contracts.Txs.Events; namespace Ubik.Accounting.Transaction.Api.Mappers @@ -9,6 +10,7 @@ public static TxSubmited ToTxSubmited(this SubmitTxCommand current) { return new TxSubmited { + Id = NewId.NextGuid(), ValueDate = current.ValueDate, Amount = current.Amount, Entries = current.Entries.Select(x => x.ToTxEntrySubmited()) @@ -19,6 +21,7 @@ public static TxEntrySubmited ToTxEntrySubmited(this SubmitTxEntry current) { return new TxEntrySubmited { + Id = NewId.NextGuid(), Description = current.Description, AccountId = current.AccountId, Amount = current.Amount, diff --git a/src/Ubik.Accounting.Transaction.Api/Models/Currency.cs b/src/Ubik.Accounting.Transaction.Api/Models/Currency.cs index 161442e2..d82821cc 100644 --- a/src/Ubik.Accounting.Transaction.Api/Models/Currency.cs +++ b/src/Ubik.Accounting.Transaction.Api/Models/Currency.cs @@ -1,9 +1,10 @@ using System.ComponentModel.DataAnnotations; +using Ubik.DB.Common; namespace Ubik.Accounting.Transaction.Api.Models { //Source of truth => To be determined - public class Currency + public class Currency : ITenantEntity { public Guid Id { get; set; } [StringLength(3)] diff --git a/src/Ubik.Accounting.Transaction.Api/Models/TaxRate.cs b/src/Ubik.Accounting.Transaction.Api/Models/TaxRate.cs index cfbac17e..4dabba8d 100644 --- a/src/Ubik.Accounting.Transaction.Api/Models/TaxRate.cs +++ b/src/Ubik.Accounting.Transaction.Api/Models/TaxRate.cs @@ -1,7 +1,9 @@ -namespace Ubik.Accounting.Transaction.Api.Models +using Ubik.DB.Common; + +namespace Ubik.Accounting.Transaction.Api.Models { // Source of truth => Accounting.SalesOrVatTax - public class TaxRate + public class TaxRate : ITenantEntity { public Guid Id { get; set; } public required string Code { get; set; } diff --git a/src/Ubik.Accounting.Transaction.Api/Ubik.Accounting.Transaction.Api.csproj b/src/Ubik.Accounting.Transaction.Api/Ubik.Accounting.Transaction.Api.csproj index ab90f512..5df00f1d 100644 --- a/src/Ubik.Accounting.Transaction.Api/Ubik.Accounting.Transaction.Api.csproj +++ b/src/Ubik.Accounting.Transaction.Api/Ubik.Accounting.Transaction.Api.csproj @@ -31,6 +31,9 @@ Always + + Always + Always diff --git a/src/Ubik.Accounting.Transaction.Contracts/Txs/Events/TxSubmited.cs b/src/Ubik.Accounting.Transaction.Contracts/Txs/Events/TxSubmited.cs index bd1ce92f..eaafec5d 100644 --- a/src/Ubik.Accounting.Transaction.Contracts/Txs/Events/TxSubmited.cs +++ b/src/Ubik.Accounting.Transaction.Contracts/Txs/Events/TxSubmited.cs @@ -4,6 +4,7 @@ namespace Ubik.Accounting.Transaction.Contracts.Txs.Events { public record class TxSubmited { + public required Guid Id { get; init; } public required DateOnly ValueDate { get; init; } public required decimal Amount { get; init; } public IEnumerable Entries { get; init; } = default!; @@ -11,6 +12,7 @@ public record class TxSubmited public record TxEntrySubmited { + public required Guid Id { get; init; } public required EntryType Type { get; init; } public required DebitCredit Sign { get; init; } public required Guid AccountId { get; init; } From ac25ce9210b26b19da9aab56ab65a63264a9494c Mon Sep 17 00:00:00 2001 From: ubik Date: Fri, 8 Nov 2024 16:25:36 +0100 Subject: [PATCH 70/94] Cleanup db enpoint for TX api. For testing. --- docker-integration-tests.yml | 30 +++++++++++++++++++ .../Dockerfile | 2 +- .../Controllers/v1/ApplicationController.cs | 24 +++++++++++++++ .../Services/ApplicationCommandService.cs | 29 ++++++++++++++++++ .../Services/IApplicationCommandService.cs | 7 +++++ .../Program.cs | 2 ++ src/Ubik.YarpProxy/appsettings.json | 10 ++++++- ...aseIntegrationTestAccountingSalesVatTax.cs | 4 +-- .../BaseIntegrationTestAccountingTx.cs | 30 +++++++++++++++++++ .../IntegrationTestProxyFactory.cs | 2 ++ 10 files changed, 136 insertions(+), 4 deletions(-) create mode 100644 src/Ubik.Accounting.Transaction.Api/Features/Application/Controllers/v1/ApplicationController.cs create mode 100644 src/Ubik.Accounting.Transaction.Api/Features/Application/Services/ApplicationCommandService.cs create mode 100644 src/Ubik.Accounting.Transaction.Api/Features/Application/Services/IApplicationCommandService.cs create mode 100644 tests/Ubik.Api.Tests.Integration/BaseIntegrationTestAccountingTx.cs diff --git a/docker-integration-tests.yml b/docker-integration-tests.yml index 4d552214..2032bd55 100644 --- a/docker-integration-tests.yml +++ b/docker-integration-tests.yml @@ -87,6 +87,36 @@ services: ports: - "5002:8080" + accounting-tx-api-test: + build: + context: ./ + dockerfile: src/Ubik.Accounting.Transaction.Api/Dockerfile + container_name: "ubik-accounting-tx-api-test" + environment: + - "ASPNETCORE_ENVIRONMENT=Development" + - "AuthServer__MetadataAddress=http://keycloak:8080/realms/ubik/.well-known/openid-configuration" + - "AuthServer__Authority=http://keycloak:8080/realms/ubik" + - "AuthServer__AuthorizationUrl=http://keycloak:8080/realms/ubik/protocol/openid-connect/auth" + - "AuthServer__TokenUrl=http://keycloak:8080/realms/ubik/protocol/openid-connect/token" + - "ConnectionStrings__AccountingTxContext=Host=db-test;Port=5432;Database=ubik_accounting_tx;Username=postgres;Password=test01" + - "AuthManagerKeyCloakClient__RootUrl=http://keycloak:8080/" + - "MessageBroker__Host=amqp://rabbit:5672" + depends_on: + rabbitmq: + condition: service_started + keycloak-last: + condition: service_healthy + ubik-proxy-cache: + condition: service_started + ubik-postgres: + condition: service_started + + networks: + - ubik-network + + ports: + - "5003:8080" + finisher: container_name: wait-for-completion image: alpine diff --git a/src/Ubik.Accounting.Transaction.Api/Dockerfile b/src/Ubik.Accounting.Transaction.Api/Dockerfile index ed777358..a0cdf8bc 100644 --- a/src/Ubik.Accounting.Transaction.Api/Dockerfile +++ b/src/Ubik.Accounting.Transaction.Api/Dockerfile @@ -20,7 +20,7 @@ COPY ["src/Ubik.ApiService.Common/Ubik.ApiService.Common.csproj", "src/Ubik.ApiS COPY ["src/Ubik.Db.Common/Ubik.DB.Common/Ubik.DB.Common.csproj", "src/Ubik.Db.Common/Ubik.DB.Common/"] RUN dotnet restore "./src/Ubik.Accounting.Transaction.Api/Ubik.Accounting.Transaction.Api.csproj" COPY . . -WORKDIR "/src/src/Ubik.Accounting.Transaction.Api" +WORKDIR "/src/Ubik.Accounting.Transaction.Api" RUN dotnet build "./Ubik.Accounting.Transaction.Api.csproj" -c $BUILD_CONFIGURATION -o /app/build # This stage is used to publish the service project to be copied to the final stage diff --git a/src/Ubik.Accounting.Transaction.Api/Features/Application/Controllers/v1/ApplicationController.cs b/src/Ubik.Accounting.Transaction.Api/Features/Application/Controllers/v1/ApplicationController.cs new file mode 100644 index 00000000..25ecc0e7 --- /dev/null +++ b/src/Ubik.Accounting.Transaction.Api/Features/Application/Controllers/v1/ApplicationController.cs @@ -0,0 +1,24 @@ +using Asp.Versioning; +using Microsoft.AspNetCore.Mvc; +using Ubik.Accounting.Transaction.Api.Features.Application.Services; +using Ubik.ApiService.Common.Exceptions; + +namespace Ubik.Accounting.Transaction.Api.Features.Application.Controllers.v1 +{ + [ApiController] + [ApiVersion("1.0")] + [Route("admin/api/v{version:apiVersion}/tx-app")] + public class ApplicationController(IApplicationCommandService commandService) : ControllerBase + { + //Cannot be used in PROD, command and queries DB can be different + [HttpDelete("cleanupdb")] + [ProducesResponseType(200)] + [ProducesResponseType(typeof(CustomProblemDetails), 400)] + [ProducesResponseType(500)] + public async Task> CleanupDatabaseInDev() + { + var result = await commandService.CleanupDatabaseInDevAsync(); + return result ? Ok(result) : StatusCode(500); + } + } +} diff --git a/src/Ubik.Accounting.Transaction.Api/Features/Application/Services/ApplicationCommandService.cs b/src/Ubik.Accounting.Transaction.Api/Features/Application/Services/ApplicationCommandService.cs new file mode 100644 index 00000000..4e0945d5 --- /dev/null +++ b/src/Ubik.Accounting.Transaction.Api/Features/Application/Services/ApplicationCommandService.cs @@ -0,0 +1,29 @@ + +using Ubik.Accounting.Transaction.Api.Data; +using Ubik.Accounting.Transaction.Api.Data.Init; + +namespace Ubik.Accounting.Transaction.Api.Features.Application.Services +{ + public class ApplicationCommandService(AccountingTxContext ctx, IWebHostEnvironment env) : IApplicationCommandService + { + public async Task CleanupDatabaseInDevAsync() + { + try + { + if (env.IsDevelopment()) + { + await ctx.Database.EnsureDeletedAsync(); + await ctx.Database.EnsureCreatedAsync(); + await DbInitializer.InitializeAsync(ctx); + return true; + } + } + catch + { + return false; + } + + return false; + } + } +} diff --git a/src/Ubik.Accounting.Transaction.Api/Features/Application/Services/IApplicationCommandService.cs b/src/Ubik.Accounting.Transaction.Api/Features/Application/Services/IApplicationCommandService.cs new file mode 100644 index 00000000..a706e475 --- /dev/null +++ b/src/Ubik.Accounting.Transaction.Api/Features/Application/Services/IApplicationCommandService.cs @@ -0,0 +1,7 @@ +namespace Ubik.Accounting.Transaction.Api.Features.Application.Services +{ + public interface IApplicationCommandService + { + public Task CleanupDatabaseInDevAsync(); + } +} diff --git a/src/Ubik.Accounting.Transaction.Api/Program.cs b/src/Ubik.Accounting.Transaction.Api/Program.cs index 00fa8b8d..d5483ea8 100644 --- a/src/Ubik.Accounting.Transaction.Api/Program.cs +++ b/src/Ubik.Accounting.Transaction.Api/Program.cs @@ -7,6 +7,7 @@ using Ubik.Accounting.Transaction.Api.Data; using Ubik.Accounting.Transaction.Api.Data.Init; using Ubik.Accounting.Transaction.Api.Features.Accounts.Services; +using Ubik.Accounting.Transaction.Api.Features.Application.Services; using Ubik.Accounting.Transaction.Api.Features.TaxRates.Services; using Ubik.Accounting.Transaction.Api.Features.Txs.Services; using Ubik.ApiService.Common.Configure; @@ -86,6 +87,7 @@ builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); +builder.Services.AddScoped(); builder.Services.AddTransient(); builder.Services.AddTracingAndMetrics(); diff --git a/src/Ubik.YarpProxy/appsettings.json b/src/Ubik.YarpProxy/appsettings.json index 561e1b04..531adbdd 100644 --- a/src/Ubik.YarpProxy/appsettings.json +++ b/src/Ubik.YarpProxy/appsettings.json @@ -104,7 +104,7 @@ }, "Transforms": [ { "PathPattern": "/admin/api/{apiversion}/{**catch-all}" } ] }, - "route_accounting_sales_vat_tax-admin": { + "route_accounting_sales_vat_tax_admin": { "ClusterId": "ubik_accounting_sales_vat_tax", "AuthorizationPolicy": "IsMegaAdmin", "Match": { @@ -112,6 +112,14 @@ }, "Transforms": [ { "PathPattern": "/admin/api/{apiversion}/sales-vat-tax-app/{**catch-all}" } ] }, + "route_accounting_tx_admin": { + "ClusterId": "ubik_accounting_tx", + "AuthorizationPolicy": "IsMegaAdmin", + "Match": { + "Path": "/accounting/admin/api/{apiversion}/tx-app/{**catch-all}" + }, + "Transforms": [ { "PathPattern": "/admin/api/{apiversion}/tx-app/{**catch-all}" } ] + }, "route_accounting_accountgroup_get": { "ClusterId": "ubik_accounting_struct", "AuthorizationPolicy": "CanAccountGroupsRead", diff --git a/tests/Ubik.Api.Tests.Integration/BaseIntegrationTestAccountingSalesVatTax.cs b/tests/Ubik.Api.Tests.Integration/BaseIntegrationTestAccountingSalesVatTax.cs index b018b3ad..4f38571e 100644 --- a/tests/Ubik.Api.Tests.Integration/BaseIntegrationTestAccountingSalesVatTax.cs +++ b/tests/Ubik.Api.Tests.Integration/BaseIntegrationTestAccountingSalesVatTax.cs @@ -10,7 +10,7 @@ public BaseIntegrationTestAccountingSalesVatTax(IntegrationTestProxyFactory fact protected override async Task CleanupDb() { - if (!Factory.IsDbCleanedAccountingSalesVatTax) + if (!Factory.IsDbCleanedAccountingTx) { using var client = Factory.CreateClient(); var token = await GetAccessTokenAsync(TokenType.MegaAdmin); @@ -18,7 +18,7 @@ protected override async Task CleanupDb() var response = await client.DeleteAsync($"/accounting/admin/api/v1/sales-vat-tax-app/cleanupdb"); response.EnsureSuccessStatusCode(); - Factory.IsDbCleanedAccountingSalesVatTax = true; + Factory.IsDbCleanedAccountingTx = true; } } } diff --git a/tests/Ubik.Api.Tests.Integration/BaseIntegrationTestAccountingTx.cs b/tests/Ubik.Api.Tests.Integration/BaseIntegrationTestAccountingTx.cs new file mode 100644 index 00000000..2af443be --- /dev/null +++ b/tests/Ubik.Api.Tests.Integration/BaseIntegrationTestAccountingTx.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Net.Http.Headers; +using System.Text; +using System.Threading.Tasks; + +namespace Ubik.Api.Tests.Integration +{ + internal class BaseIntegrationTestAccountingTx : BaseIntegrationTest + { + public BaseIntegrationTestAccountingTx(IntegrationTestProxyFactory factory) : base(factory) + { + } + + protected override async Task CleanupDb() + { + if (!Factory.IsDbCleanedAccountingSalesVatTax) + { + using var client = Factory.CreateClient(); + var token = await GetAccessTokenAsync(TokenType.MegaAdmin); + client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); + + var response = await client.DeleteAsync($"/accounting/admin/api/v1/sales-vat-tax-app/cleanupdb"); + response.EnsureSuccessStatusCode(); + Factory.IsDbCleanedAccountingSalesVatTax = true; + } + } + } +} diff --git a/tests/Ubik.Api.Tests.Integration/IntegrationTestProxyFactory.cs b/tests/Ubik.Api.Tests.Integration/IntegrationTestProxyFactory.cs index 746d3811..50a82ef2 100644 --- a/tests/Ubik.Api.Tests.Integration/IntegrationTestProxyFactory.cs +++ b/tests/Ubik.Api.Tests.Integration/IntegrationTestProxyFactory.cs @@ -10,6 +10,7 @@ public class IntegrationTestProxyFactory private readonly HttpClient _client = new(); public bool IsDbCleanedAccountingStruct { get; set; } = false; public bool IsDbCleanedAccountingSalesVatTax { get; set; } = false; + public bool IsDbCleanedAccountingTx { get; set; } = false; public bool IsDbCleanedSecurity { get; set; } = false; public IntegrationTestProxyFactory() @@ -44,6 +45,7 @@ private void SetTestEnvVariablesForProxy() Environment.SetEnvironmentVariable("ReverseProxy__Clusters__ubik_users_admin__Destinations__destination1__Address", $"http://localhost:5000/"); Environment.SetEnvironmentVariable("ReverseProxy__Clusters__ubik_accounting_struct__Destinations__destination1__Address", $"http://localhost:5001/"); Environment.SetEnvironmentVariable("ReverseProxy__Clusters__ubik_accounting_sales_vat_tax__Destinations__destination1__Address", $"http://localhost:5002/"); + Environment.SetEnvironmentVariable("ReverseProxy__Clusters__ubik_accounting_tx__Destinations__destination1__Address", $"http://localhost:5003/"); Environment.SetEnvironmentVariable("ApiSecurityForAdmin__HostAndPort", $"http://localhost:5000/"); var authTokenUrl = $"http://localhost:8080/"; From 5141c5ce3af05a4becf0d98f2dc3fe9f87ec0513 Mon Sep 17 00:00:00 2001 From: ubik Date: Fri, 8 Nov 2024 16:38:22 +0100 Subject: [PATCH 71/94] First submit TX test OK. --- .../Entries/Enums/DebitCredit.cs | 5 +- .../Entries/Enums/EntryType.cs | 5 +- .../BaseIntegrationTestAccountingTx.cs | 2 +- .../Transaction/Txs/TxsController_Test.cs | 79 +++++++++++++++++++ .../Ubik.Api.Tests.Integration.csproj | 1 + 5 files changed, 89 insertions(+), 3 deletions(-) create mode 100644 tests/Ubik.Api.Tests.Integration/Features/Accounting/Transaction/Txs/TxsController_Test.cs diff --git a/src/Ubik.Accounting.Transaction.Contracts/Entries/Enums/DebitCredit.cs b/src/Ubik.Accounting.Transaction.Contracts/Entries/Enums/DebitCredit.cs index 021ff67e..a9d06b78 100644 --- a/src/Ubik.Accounting.Transaction.Contracts/Entries/Enums/DebitCredit.cs +++ b/src/Ubik.Accounting.Transaction.Contracts/Entries/Enums/DebitCredit.cs @@ -1,5 +1,8 @@ -namespace Ubik.Accounting.Transaction.Contracts.Entries.Enums +using System.Text.Json.Serialization; + +namespace Ubik.Accounting.Transaction.Contracts.Entries.Enums { + [JsonConverter(typeof(JsonStringEnumConverter))] public enum DebitCredit { Debit, diff --git a/src/Ubik.Accounting.Transaction.Contracts/Entries/Enums/EntryType.cs b/src/Ubik.Accounting.Transaction.Contracts/Entries/Enums/EntryType.cs index 6f0104b4..5c31ec19 100644 --- a/src/Ubik.Accounting.Transaction.Contracts/Entries/Enums/EntryType.cs +++ b/src/Ubik.Accounting.Transaction.Contracts/Entries/Enums/EntryType.cs @@ -1,5 +1,8 @@ -namespace Ubik.Accounting.Transaction.Contracts.Entries.Enums +using System.Text.Json.Serialization; + +namespace Ubik.Accounting.Transaction.Contracts.Entries.Enums { + [JsonConverter(typeof(JsonStringEnumConverter))] public enum EntryType { Main, diff --git a/tests/Ubik.Api.Tests.Integration/BaseIntegrationTestAccountingTx.cs b/tests/Ubik.Api.Tests.Integration/BaseIntegrationTestAccountingTx.cs index 2af443be..096d5983 100644 --- a/tests/Ubik.Api.Tests.Integration/BaseIntegrationTestAccountingTx.cs +++ b/tests/Ubik.Api.Tests.Integration/BaseIntegrationTestAccountingTx.cs @@ -21,7 +21,7 @@ protected override async Task CleanupDb() var token = await GetAccessTokenAsync(TokenType.MegaAdmin); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); - var response = await client.DeleteAsync($"/accounting/admin/api/v1/sales-vat-tax-app/cleanupdb"); + var response = await client.DeleteAsync($"/accounting/admin/api/v1/tx-app/cleanupdb"); response.EnsureSuccessStatusCode(); Factory.IsDbCleanedAccountingSalesVatTax = true; } diff --git a/tests/Ubik.Api.Tests.Integration/Features/Accounting/Transaction/Txs/TxsController_Test.cs b/tests/Ubik.Api.Tests.Integration/Features/Accounting/Transaction/Txs/TxsController_Test.cs new file mode 100644 index 00000000..ffeeff29 --- /dev/null +++ b/tests/Ubik.Api.Tests.Integration/Features/Accounting/Transaction/Txs/TxsController_Test.cs @@ -0,0 +1,79 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Net.Http.Headers; +using System.Net.Http.Json; +using System.Net; +using System.Text; +using System.Threading.Tasks; +using Ubik.Accounting.SalesOrVatTax.Contracts.AccountTaxRateConfigs.Commands; +using Ubik.Accounting.SalesOrVatTax.Contracts.AccountTaxRateConfigs.Results; +using Ubik.Accounting.Transaction.Contracts.Txs.Commands; +using Ubik.Accounting.Transaction.Contracts.Txs.Events; +using FluentAssertions; +using Ubik.Accounting.Transaction.Contracts.Entries.Enums; + +namespace Ubik.Api.Tests.Integration.Features.Accounting.Transaction.Txs +{ + public class TxsController_Test : BaseIntegrationTestAccountingSalesVatTax + { + + private readonly string _baseUrlForV1; + private readonly HttpClient _client; + + public TxsController_Test(IntegrationTestProxyFactory factory) : base(factory) + { + _baseUrlForV1 = "/accounting/api/v1"; + _client = Factory.CreateDefaultClient(); + } + + [Fact] + public async Task Submit_Tx_WithRW_OK() + { + var token = await GetAccessTokenAsync(TokenType.RW); + _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); + + var command = new SubmitTxCommand() + { + Amount = 1000, + ValueDate = DateOnly.FromDateTime(DateTime.Now), + Entries = new List() + { + new SubmitTxEntry() + { + AccountId = new Guid("248e0000-5dd4-0015-c1ce-08dcd98b7c74"), + Amount = 1000, + AmountAdditionnalInfo = null, + Description = "Test", + Label = "Test", + Sign = DebitCredit.Debit, + TaxInfo = null, + Type = EntryType.Main + }, + new SubmitTxEntry() + { + AccountId = new Guid("248e0000-5dd4-0015-48fb-08dcd98b4a28"), + Amount = 1000, + AmountAdditionnalInfo = null, + Description = "Test", + Label = "Test", + Sign = DebitCredit.Credit, + TaxInfo = null, + Type = EntryType.Counterparty + } + } + }; + + //Act + var response = await _client.PostAsJsonAsync($"{_baseUrlForV1}/txs/submit", command); + var result = await response.Content.ReadFromJsonAsync(); + + //Assert + response.StatusCode.Should().Be(HttpStatusCode.OK); + result.Should() + .NotBeNull() + .And.BeOfType() + .And.Match(x => x.Amount == command.Amount); + } + } +} diff --git a/tests/Ubik.Api.Tests.Integration/Ubik.Api.Tests.Integration.csproj b/tests/Ubik.Api.Tests.Integration/Ubik.Api.Tests.Integration.csproj index bd5caef0..344008de 100644 --- a/tests/Ubik.Api.Tests.Integration/Ubik.Api.Tests.Integration.csproj +++ b/tests/Ubik.Api.Tests.Integration/Ubik.Api.Tests.Integration.csproj @@ -40,6 +40,7 @@ + From ecdd453dd20ac143a445b8bef9b42044b3871aae Mon Sep 17 00:00:00 2001 From: ubik Date: Fri, 8 Nov 2024 16:43:43 +0100 Subject: [PATCH 72/94] Base routes testing for submit TX (security) --- .../Transaction/Txs/TxsController_Test.cs | 223 ++++++++++++++++++ 1 file changed, 223 insertions(+) diff --git a/tests/Ubik.Api.Tests.Integration/Features/Accounting/Transaction/Txs/TxsController_Test.cs b/tests/Ubik.Api.Tests.Integration/Features/Accounting/Transaction/Txs/TxsController_Test.cs index ffeeff29..b2d46220 100644 --- a/tests/Ubik.Api.Tests.Integration/Features/Accounting/Transaction/Txs/TxsController_Test.cs +++ b/tests/Ubik.Api.Tests.Integration/Features/Accounting/Transaction/Txs/TxsController_Test.cs @@ -12,6 +12,7 @@ using Ubik.Accounting.Transaction.Contracts.Txs.Events; using FluentAssertions; using Ubik.Accounting.Transaction.Contracts.Entries.Enums; +using Ubik.ApiService.Common.Exceptions; namespace Ubik.Api.Tests.Integration.Features.Accounting.Transaction.Txs { @@ -75,5 +76,227 @@ public async Task Submit_Tx_WithRW_OK() .And.BeOfType() .And.Match(x => x.Amount == command.Amount); } + + [Fact] + public async Task Submit_Tx_WithRO_403() + { + var token = await GetAccessTokenAsync(TokenType.RO); + _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); + + var command = new SubmitTxCommand() + { + Amount = 1000, + ValueDate = DateOnly.FromDateTime(DateTime.Now), + Entries = new List() + { + new SubmitTxEntry() + { + AccountId = new Guid("248e0000-5dd4-0015-c1ce-08dcd98b7c74"), + Amount = 1000, + AmountAdditionnalInfo = null, + Description = "Test", + Label = "Test", + Sign = DebitCredit.Debit, + TaxInfo = null, + Type = EntryType.Main + }, + new SubmitTxEntry() + { + AccountId = new Guid("248e0000-5dd4-0015-48fb-08dcd98b4a28"), + Amount = 1000, + AmountAdditionnalInfo = null, + Description = "Test", + Label = "Test", + Sign = DebitCredit.Credit, + TaxInfo = null, + Type = EntryType.Counterparty + } + } + }; + + //Act + var response = await _client.PostAsJsonAsync($"{_baseUrlForV1}/txs/submit", command); + + //Assert + response.StatusCode.Should().Be(HttpStatusCode.Forbidden); + } + + [Fact] + public async Task Submit_Tx_WithNoToken_401() + { + var command = new SubmitTxCommand() + { + Amount = 1000, + ValueDate = DateOnly.FromDateTime(DateTime.Now), + Entries = new List() + { + new SubmitTxEntry() + { + AccountId = new Guid("248e0000-5dd4-0015-c1ce-08dcd98b7c74"), + Amount = 1000, + AmountAdditionnalInfo = null, + Description = "Test", + Label = "Test", + Sign = DebitCredit.Debit, + TaxInfo = null, + Type = EntryType.Main + }, + new SubmitTxEntry() + { + AccountId = new Guid("248e0000-5dd4-0015-48fb-08dcd98b4a28"), + Amount = 1000, + AmountAdditionnalInfo = null, + Description = "Test", + Label = "Test", + Sign = DebitCredit.Credit, + TaxInfo = null, + Type = EntryType.Counterparty + } + } + }; + + //Act + var response = await _client.PostAsJsonAsync($"{_baseUrlForV1}/txs/submit", command); + + //Assert + response.StatusCode.Should().Be(HttpStatusCode.Unauthorized); + } + + [Fact] + public async Task Submit_Tx_WithAdmin_403() + { + var token = await GetAccessTokenAsync(TokenType.MegaAdmin); + _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); + + var command = new SubmitTxCommand() + { + Amount = 1000, + ValueDate = DateOnly.FromDateTime(DateTime.Now), + Entries = new List() + { + new SubmitTxEntry() + { + AccountId = new Guid("248e0000-5dd4-0015-c1ce-08dcd98b7c74"), + Amount = 1000, + AmountAdditionnalInfo = null, + Description = "Test", + Label = "Test", + Sign = DebitCredit.Debit, + TaxInfo = null, + Type = EntryType.Main + }, + new SubmitTxEntry() + { + AccountId = new Guid("248e0000-5dd4-0015-48fb-08dcd98b4a28"), + Amount = 1000, + AmountAdditionnalInfo = null, + Description = "Test", + Label = "Test", + Sign = DebitCredit.Credit, + TaxInfo = null, + Type = EntryType.Counterparty + } + } + }; + + //Act + var response = await _client.PostAsJsonAsync($"{_baseUrlForV1}/txs/submit", command); + + //Assert + response.StatusCode.Should().Be(HttpStatusCode.Forbidden); + } + + [Fact] + public async Task Submit_Tx_WithNoRole_403() + { + var token = await GetAccessTokenAsync(TokenType.NoRole); + _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); + + var command = new SubmitTxCommand() + { + Amount = 1000, + ValueDate = DateOnly.FromDateTime(DateTime.Now), + Entries = new List() + { + new SubmitTxEntry() + { + AccountId = new Guid("248e0000-5dd4-0015-c1ce-08dcd98b7c74"), + Amount = 1000, + AmountAdditionnalInfo = null, + Description = "Test", + Label = "Test", + Sign = DebitCredit.Debit, + TaxInfo = null, + Type = EntryType.Main + }, + new SubmitTxEntry() + { + AccountId = new Guid("248e0000-5dd4-0015-48fb-08dcd98b4a28"), + Amount = 1000, + AmountAdditionnalInfo = null, + Description = "Test", + Label = "Test", + Sign = DebitCredit.Credit, + TaxInfo = null, + Type = EntryType.Counterparty + } + } + }; + + //Act + var response = await _client.PostAsJsonAsync($"{_baseUrlForV1}/txs/submit", command); + + //Assert + response.StatusCode.Should().Be(HttpStatusCode.Forbidden); + } + + [Fact] + public async Task Submit_Tx_WithOtherTenant_400() + { + var token = await GetAccessTokenAsync(TokenType.OtherTenant); + _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); + + var command = new SubmitTxCommand() + { + Amount = 1000, + ValueDate = DateOnly.FromDateTime(DateTime.Now), + Entries = new List() + { + new SubmitTxEntry() + { + AccountId = new Guid("248e0000-5dd4-0015-c1ce-08dcd98b7c74"), + Amount = 1000, + AmountAdditionnalInfo = null, + Description = "Test", + Label = "Test", + Sign = DebitCredit.Debit, + TaxInfo = null, + Type = EntryType.Main + }, + new SubmitTxEntry() + { + AccountId = new Guid("248e0000-5dd4-0015-48fb-08dcd98b4a28"), + Amount = 1000, + AmountAdditionnalInfo = null, + Description = "Test", + Label = "Test", + Sign = DebitCredit.Credit, + TaxInfo = null, + Type = EntryType.Counterparty + } + } + }; + + //Act + var response = await _client.PostAsJsonAsync($"{_baseUrlForV1}/txs/submit", command); + var result = await response.Content.ReadFromJsonAsync(); + + //Assert + response.StatusCode.Should().Be(HttpStatusCode.BadRequest); + result.Should() + .NotBeNull() + .And.BeOfType() + .And.Match(x => x.Errors.First().Code == "ACCOUNT_NOT_FOUND_FOR_ENTRY"); + } } } From 49a4879702313df850df5313a03bacf52edd6bc7 Mon Sep 17 00:00:00 2001 From: ubik Date: Fri, 8 Nov 2024 20:29:51 +0100 Subject: [PATCH 73/94] Some tests --- .../Features/Txs/Services/TxCommandService.cs | 3 + .../Transaction/Txs/TxsController_Test.cs | 101 ++++++++++++++++++ 2 files changed, 104 insertions(+) diff --git a/src/Ubik.Accounting.Transaction.Api/Features/Txs/Services/TxCommandService.cs b/src/Ubik.Accounting.Transaction.Api/Features/Txs/Services/TxCommandService.cs index 3b720d4a..6a976c6c 100644 --- a/src/Ubik.Accounting.Transaction.Api/Features/Txs/Services/TxCommandService.cs +++ b/src/Ubik.Accounting.Transaction.Api/Features/Txs/Services/TxCommandService.cs @@ -11,6 +11,9 @@ namespace Ubik.Accounting.Transaction.Api.Features.Txs.Services { + //TODO: implement a better error management for transaction. Return a special errors payload + //with all the details for each error, the user needs to receive ONE error payload. + //or maybe not... return when 1 error or test for all errors... public class TxCommandService(AccountingTxContext ctx , IPublishEndpoint publishEndpoint) : ITxCommandService { diff --git a/tests/Ubik.Api.Tests.Integration/Features/Accounting/Transaction/Txs/TxsController_Test.cs b/tests/Ubik.Api.Tests.Integration/Features/Accounting/Transaction/Txs/TxsController_Test.cs index b2d46220..517333bf 100644 --- a/tests/Ubik.Api.Tests.Integration/Features/Accounting/Transaction/Txs/TxsController_Test.cs +++ b/tests/Ubik.Api.Tests.Integration/Features/Accounting/Transaction/Txs/TxsController_Test.cs @@ -298,5 +298,106 @@ public async Task Submit_Tx_WithOtherTenant_400() .And.BeOfType() .And.Match(x => x.Errors.First().Code == "ACCOUNT_NOT_FOUND_FOR_ENTRY"); } + + [Fact] + public async Task Submit_Tx_WithMoreThanOneMainEntry_400() + { + var token = await GetAccessTokenAsync(TokenType.RW); + _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); + + var command = new SubmitTxCommand() + { + Amount = 1000, + ValueDate = DateOnly.FromDateTime(DateTime.Now), + Entries = new List() + { + new SubmitTxEntry() + { + AccountId = new Guid("248e0000-5dd4-0015-c1ce-08dcd98b7c74"), + Amount = 1000, + AmountAdditionnalInfo = null, + Description = "Test", + Label = "Test", + Sign = DebitCredit.Debit, + TaxInfo = null, + Type = EntryType.Main + }, + new SubmitTxEntry() + { + AccountId = new Guid("248e0000-5dd4-0015-48fb-08dcd98b4a28"), + Amount = 1000, + AmountAdditionnalInfo = null, + Description = "Test", + Label = "Test", + Sign = DebitCredit.Credit, + TaxInfo = null, + Type = EntryType.Main + } + } + }; + + //Act + var response = await _client.PostAsJsonAsync($"{_baseUrlForV1}/txs/submit", command); + var result = await response.Content.ReadFromJsonAsync(); + + //Assert + response.StatusCode.Should().Be(HttpStatusCode.BadRequest); + result.Should() + .NotBeNull() + .And.BeOfType() + .And.Match(x => x.Errors.First().Code == "TX_COUNTAINS_MORE_THAN_ONE_MAIN_ENTRY"); + } + + [Theory] + [InlineData(1001, 1000, 1000)] + [InlineData(1000, 1001, 1000)] + [InlineData(1000, 1000, 1001)] + public async Task Submit_Tx_WithBadBalance_400(decimal total, decimal mainAmount, decimal cpAmount) + { + var token = await GetAccessTokenAsync(TokenType.RW); + _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); + + var command = new SubmitTxCommand() + { + Amount = total, + ValueDate = DateOnly.FromDateTime(DateTime.Now), + Entries = new List() + { + new SubmitTxEntry() + { + AccountId = new Guid("248e0000-5dd4-0015-c1ce-08dcd98b7c74"), + Amount = mainAmount, + AmountAdditionnalInfo = null, + Description = "Test", + Label = "Test", + Sign = DebitCredit.Debit, + TaxInfo = null, + Type = EntryType.Main + }, + new SubmitTxEntry() + { + AccountId = new Guid("248e0000-5dd4-0015-48fb-08dcd98b4a28"), + Amount = cpAmount, + AmountAdditionnalInfo = null, + Description = "Test", + Label = "Test", + Sign = DebitCredit.Credit, + TaxInfo = null, + Type = EntryType.Counterparty + } + } + }; + + //Act + var response = await _client.PostAsJsonAsync($"{_baseUrlForV1}/txs/submit", command); + var result = await response.Content.ReadFromJsonAsync(); + + //Assert + response.StatusCode.Should().Be(HttpStatusCode.BadRequest); + result.Should() + .NotBeNull() + .And.BeOfType() + .And.Match(x => x.Errors.First().Code == "TX_BALANCE_ERROR"); + } } } From bd16901d42b4935dc7b943647c63a98429205cc1 Mon Sep 17 00:00:00 2001 From: ubik Date: Mon, 11 Nov 2024 10:21:16 +0100 Subject: [PATCH 74/94] Tx minimal first submit version --- .../Txs/Errors/TaxRatesNotFoundError.cs | 28 ++ .../Txs/Errors/TaxRatesNotMatchError.cs | 28 ++ .../Features/Txs/Services/TxCommandService.cs | 46 +- .../Transaction/Txs/TxsController_Test.cs | 442 ++++++++++++++++-- 4 files changed, 516 insertions(+), 28 deletions(-) create mode 100644 src/Ubik.Accounting.Transaction.Api/Features/Txs/Errors/TaxRatesNotFoundError.cs create mode 100644 src/Ubik.Accounting.Transaction.Api/Features/Txs/Errors/TaxRatesNotMatchError.cs diff --git a/src/Ubik.Accounting.Transaction.Api/Features/Txs/Errors/TaxRatesNotFoundError.cs b/src/Ubik.Accounting.Transaction.Api/Features/Txs/Errors/TaxRatesNotFoundError.cs new file mode 100644 index 00000000..3f9b6c43 --- /dev/null +++ b/src/Ubik.Accounting.Transaction.Api/Features/Txs/Errors/TaxRatesNotFoundError.cs @@ -0,0 +1,28 @@ +using Ubik.Accounting.Transaction.Contracts.Txs.Commands; +using Ubik.ApiService.Common.Errors; + +namespace Ubik.Accounting.Transaction.Api.Features.Txs.Errors +{ + public record TaxRatesNotFoundError : IFeatureError + { + public FeatureErrorType ErrorType { get; init; } + public List CustomErrors { get; init; } + + public TaxRatesNotFoundError(IEnumerable entriesInError) + { + + ErrorType = FeatureErrorType.BadParams; + CustomErrors = new List(); + + foreach (var entry in entriesInError) + { + CustomErrors.Add(new CustomError() + { + ErrorCode = "TAX_RATE_NOT_FOUND_FOR_ENTRY", + ErrorFriendlyMessage = "The specified tax rate is not found.", + ErrorValueDetails = $"Field:TaxInfo.TaxRateId / Value:{entry.TaxInfo!.TaxRateId}" + }); + } + } + } +} diff --git a/src/Ubik.Accounting.Transaction.Api/Features/Txs/Errors/TaxRatesNotMatchError.cs b/src/Ubik.Accounting.Transaction.Api/Features/Txs/Errors/TaxRatesNotMatchError.cs new file mode 100644 index 00000000..98c4e138 --- /dev/null +++ b/src/Ubik.Accounting.Transaction.Api/Features/Txs/Errors/TaxRatesNotMatchError.cs @@ -0,0 +1,28 @@ +using Ubik.Accounting.Transaction.Contracts.Txs.Commands; +using Ubik.ApiService.Common.Errors; + +namespace Ubik.Accounting.Transaction.Api.Features.Txs.Errors +{ + public record TaxRatesNotMatchError : IFeatureError + { + public FeatureErrorType ErrorType { get; init; } + public List CustomErrors { get; init; } + + public TaxRatesNotMatchError(IEnumerable entriesInError) + { + + ErrorType = FeatureErrorType.BadParams; + CustomErrors = new List(); + + foreach (var entry in entriesInError) + { + CustomErrors.Add(new CustomError() + { + ErrorCode = "TAX_RATE_NOT_MATCH_FOR_ENTRY", + ErrorFriendlyMessage = "The tax rate provided not match the actual configuration.", + ErrorValueDetails = $"Field:TaxInfo.TaxRateId / Value:{entry.TaxInfo!.TaxRateId} - Field:TaxInfo.TaxAppliedRate / Value:{entry.TaxInfo!.TaxAppliedRate}" + }); + } + } + } +} diff --git a/src/Ubik.Accounting.Transaction.Api/Features/Txs/Services/TxCommandService.cs b/src/Ubik.Accounting.Transaction.Api/Features/Txs/Services/TxCommandService.cs index 6a976c6c..125e23be 100644 --- a/src/Ubik.Accounting.Transaction.Api/Features/Txs/Services/TxCommandService.cs +++ b/src/Ubik.Accounting.Transaction.Api/Features/Txs/Services/TxCommandService.cs @@ -23,6 +23,7 @@ public async Task> SubmitTx(SubmitTxCommand co .BindAsync(ValidateBalanceAsync) .BindAsync(ValidateEntriesInfoAsync) //Exchange rates, amounts and currencies .BindAsync(ValidateEntriesAccountsAsync) + .BindAsync(ValidateEntriesTaxRatesInfoAsync) .BindAsync(PublishSubmittedAsync); } @@ -72,7 +73,7 @@ private async Task> ValidateEntriesInfoAs if (!ValidateExchangeRatesInfo(entry)) errExchangeRates.Add(entry); - if (!ValidateEntriesAmounts(entry)) + if (!ValidateEntryAmounts(entry)) errAmounts.Add(entry); if (!await ValidateCurrencyAsync(entry)) @@ -100,7 +101,7 @@ private async Task> ValidateEntriesInfoAs } } - private static bool ValidateEntriesAmounts(SubmitTxEntry entry) + private static bool ValidateEntryAmounts(SubmitTxEntry entry) { return entry.Amount > 0 && (entry.AmountAdditionnalInfo == null || entry.AmountAdditionnalInfo.OriginalAmount > 0); @@ -153,5 +154,46 @@ private async Task> ValidateEntriesAccoun return new AccountAreNotFoundErrors(badEntries); } } + + private async Task> ValidateEntriesTaxRatesInfoAsync(SubmitTxCommand tx) + { + //All entries with tax info + var taxRateEntries = tx.Entries + .Where(e => e.TaxInfo != null) + .Distinct() + .ToList(); + + //All tax rates used + var foundTaxRates = await ctx.TaxRates + .Where(tr => taxRateEntries.Select(t => t.TaxInfo!.TaxRateId).Contains(tr.Id)) + .ToListAsync(); + + //Missing tax rates ids + var missingTaxRateIds = taxRateEntries.Select(t => t.TaxInfo!.TaxRateId).Except(foundTaxRates.Select(f => f.Id)).ToList(); + + //If missing tax rates + if (missingTaxRateIds.Count > 0) + { + var badEntriesMissingRate = tx.Entries + .Where(e => e.TaxInfo != null && missingTaxRateIds.Contains(e.TaxInfo!.TaxRateId)) + .ToList(); + return new TaxRatesNotFoundError(badEntriesMissingRate); + } + + //If tax rates found not respect the configured rate + var badEntriesTaxRateNotMatch = new List(); + foreach (var entry in taxRateEntries) + { + var taxRate = foundTaxRates.First(tr => tr.Id == entry.TaxInfo!.TaxRateId); + if (taxRate.Rate != entry.TaxInfo!.TaxAppliedRate) + { + badEntriesTaxRateNotMatch.Add(entry); + } + } + + return badEntriesTaxRateNotMatch.Count > 0 + ? new TaxRatesNotMatchError(badEntriesTaxRateNotMatch) + : tx; + } } } diff --git a/tests/Ubik.Api.Tests.Integration/Features/Accounting/Transaction/Txs/TxsController_Test.cs b/tests/Ubik.Api.Tests.Integration/Features/Accounting/Transaction/Txs/TxsController_Test.cs index 517333bf..fcd360ad 100644 --- a/tests/Ubik.Api.Tests.Integration/Features/Accounting/Transaction/Txs/TxsController_Test.cs +++ b/tests/Ubik.Api.Tests.Integration/Features/Accounting/Transaction/Txs/TxsController_Test.cs @@ -38,8 +38,8 @@ public async Task Submit_Tx_WithRW_OK() { Amount = 1000, ValueDate = DateOnly.FromDateTime(DateTime.Now), - Entries = new List() - { + Entries = + [ new SubmitTxEntry() { AccountId = new Guid("248e0000-5dd4-0015-c1ce-08dcd98b7c74"), @@ -62,7 +62,7 @@ public async Task Submit_Tx_WithRW_OK() TaxInfo = null, Type = EntryType.Counterparty } - } + ] }; //Act @@ -87,9 +87,9 @@ public async Task Submit_Tx_WithRO_403() { Amount = 1000, ValueDate = DateOnly.FromDateTime(DateTime.Now), - Entries = new List() - { - new SubmitTxEntry() + Entries = + [ + new() { AccountId = new Guid("248e0000-5dd4-0015-c1ce-08dcd98b7c74"), Amount = 1000, @@ -100,7 +100,7 @@ public async Task Submit_Tx_WithRO_403() TaxInfo = null, Type = EntryType.Main }, - new SubmitTxEntry() + new() { AccountId = new Guid("248e0000-5dd4-0015-48fb-08dcd98b4a28"), Amount = 1000, @@ -111,7 +111,7 @@ public async Task Submit_Tx_WithRO_403() TaxInfo = null, Type = EntryType.Counterparty } - } + ] }; //Act @@ -128,8 +128,8 @@ public async Task Submit_Tx_WithNoToken_401() { Amount = 1000, ValueDate = DateOnly.FromDateTime(DateTime.Now), - Entries = new List() - { + Entries = + [ new SubmitTxEntry() { AccountId = new Guid("248e0000-5dd4-0015-c1ce-08dcd98b7c74"), @@ -152,7 +152,7 @@ public async Task Submit_Tx_WithNoToken_401() TaxInfo = null, Type = EntryType.Counterparty } - } + ] }; //Act @@ -172,8 +172,8 @@ public async Task Submit_Tx_WithAdmin_403() { Amount = 1000, ValueDate = DateOnly.FromDateTime(DateTime.Now), - Entries = new List() - { + Entries = + [ new SubmitTxEntry() { AccountId = new Guid("248e0000-5dd4-0015-c1ce-08dcd98b7c74"), @@ -196,7 +196,7 @@ public async Task Submit_Tx_WithAdmin_403() TaxInfo = null, Type = EntryType.Counterparty } - } + ] }; //Act @@ -216,8 +216,8 @@ public async Task Submit_Tx_WithNoRole_403() { Amount = 1000, ValueDate = DateOnly.FromDateTime(DateTime.Now), - Entries = new List() - { + Entries = + [ new SubmitTxEntry() { AccountId = new Guid("248e0000-5dd4-0015-c1ce-08dcd98b7c74"), @@ -240,7 +240,7 @@ public async Task Submit_Tx_WithNoRole_403() TaxInfo = null, Type = EntryType.Counterparty } - } + ] }; //Act @@ -260,8 +260,8 @@ public async Task Submit_Tx_WithOtherTenant_400() { Amount = 1000, ValueDate = DateOnly.FromDateTime(DateTime.Now), - Entries = new List() - { + Entries = + [ new SubmitTxEntry() { AccountId = new Guid("248e0000-5dd4-0015-c1ce-08dcd98b7c74"), @@ -284,7 +284,7 @@ public async Task Submit_Tx_WithOtherTenant_400() TaxInfo = null, Type = EntryType.Counterparty } - } + ] }; //Act @@ -309,8 +309,8 @@ public async Task Submit_Tx_WithMoreThanOneMainEntry_400() { Amount = 1000, ValueDate = DateOnly.FromDateTime(DateTime.Now), - Entries = new List() - { + Entries = + [ new SubmitTxEntry() { AccountId = new Guid("248e0000-5dd4-0015-c1ce-08dcd98b7c74"), @@ -333,7 +333,7 @@ public async Task Submit_Tx_WithMoreThanOneMainEntry_400() TaxInfo = null, Type = EntryType.Main } - } + ] }; //Act @@ -361,8 +361,8 @@ public async Task Submit_Tx_WithBadBalance_400(decimal total, decimal mainAmount { Amount = total, ValueDate = DateOnly.FromDateTime(DateTime.Now), - Entries = new List() - { + Entries = + [ new SubmitTxEntry() { AccountId = new Guid("248e0000-5dd4-0015-c1ce-08dcd98b7c74"), @@ -385,7 +385,7 @@ public async Task Submit_Tx_WithBadBalance_400(decimal total, decimal mainAmount TaxInfo = null, Type = EntryType.Counterparty } - } + ] }; //Act @@ -399,5 +399,395 @@ public async Task Submit_Tx_WithBadBalance_400(decimal total, decimal mainAmount .And.BeOfType() .And.Match(x => x.Errors.First().Code == "TX_BALANCE_ERROR"); } + + [Fact] + public async Task Submit_Tx_WithExchangeRateAtZero_400() + { + var token = await GetAccessTokenAsync(TokenType.RW); + _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); + + var command = new SubmitTxCommand() + { + Amount = 1000, + ValueDate = DateOnly.FromDateTime(DateTime.Now), + Entries = + [ + new SubmitTxEntry() + { + AccountId = new Guid("248e0000-5dd4-0015-c1ce-08dcd98b7c74"), + Amount = 1000, + AmountAdditionnalInfo = new SubmitTxEntryAdditionalAmountInfo() + { + ExchangeRate = 0, + OriginalAmount = 900, + OriginalCurrencyId = new Guid("248e0000-5dd4-0015-291d-08dcd98e55f8") + }, + Description = "Test", + Label = "Test", + Sign = DebitCredit.Debit, + TaxInfo = null, + Type = EntryType.Main + }, + new SubmitTxEntry() + { + AccountId = new Guid("248e0000-5dd4-0015-48fb-08dcd98b4a28"), + Amount = 1000, + AmountAdditionnalInfo = null, + Description = "Test", + Label = "Test", + Sign = DebitCredit.Credit, + TaxInfo = null, + Type = EntryType.Counterparty + } + ] + }; + + //Act + var response = await _client.PostAsJsonAsync($"{_baseUrlForV1}/txs/submit", command); + var result = await response.Content.ReadFromJsonAsync(); + + //Assert + response.StatusCode.Should().Be(HttpStatusCode.BadRequest); + result.Should() + .NotBeNull() + .And.BeOfType() + .And.Match(x => x.Errors.First().Code == "BAD_EXCHANGE_RATE_PARAMS_FOR_ENTRY"); + } + + [Fact] + public async Task Submit_Tx_WithExchangeBadCalc_400() + { + var token = await GetAccessTokenAsync(TokenType.RW); + _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); + + var command = new SubmitTxCommand() + { + Amount = 1100, + ValueDate = DateOnly.FromDateTime(DateTime.Now), + Entries = + [ + new SubmitTxEntry() + { + AccountId = new Guid("248e0000-5dd4-0015-c1ce-08dcd98b7c74"), + Amount = 1100, + AmountAdditionnalInfo = new SubmitTxEntryAdditionalAmountInfo() + { + ExchangeRate = 1.11m, + OriginalAmount = 1000, + OriginalCurrencyId = new Guid("248e0000-5dd4-0015-291d-08dcd98e55f8") + }, + Description = "Test", + Label = "Test", + Sign = DebitCredit.Debit, + TaxInfo = null, + Type = EntryType.Main + }, + new SubmitTxEntry() + { + AccountId = new Guid("248e0000-5dd4-0015-48fb-08dcd98b4a28"), + Amount = 1100, + AmountAdditionnalInfo = null, + Description = "Test", + Label = "Test", + Sign = DebitCredit.Credit, + TaxInfo = null, + Type = EntryType.Counterparty + } + ] + }; + + //Act + var response = await _client.PostAsJsonAsync($"{_baseUrlForV1}/txs/submit", command); + var result = await response.Content.ReadFromJsonAsync(); + + //Assert + response.StatusCode.Should().Be(HttpStatusCode.BadRequest); + result.Should() + .NotBeNull() + .And.BeOfType() + .And.Match(x => x.Errors.First().Code == "BAD_EXCHANGE_RATE_PARAMS_FOR_ENTRY"); + } + + [Fact] + public async Task Submit_Tx_WithBadCurrencyId_400() + { + var token = await GetAccessTokenAsync(TokenType.RW); + _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); + + var command = new SubmitTxCommand() + { + Amount = 1100, + ValueDate = DateOnly.FromDateTime(DateTime.Now), + Entries = + [ + new SubmitTxEntry() + { + AccountId = new Guid("248e0000-5dd4-0015-c1ce-08dcd98b7c74"), + Amount = 1100, + AmountAdditionnalInfo = new SubmitTxEntryAdditionalAmountInfo() + { + ExchangeRate = 1.1m, + OriginalAmount = 1000, + OriginalCurrencyId = new Guid("248e0000-5dd4-0015-291d-08dcd98e55f1") + }, + Description = "Test", + Label = "Test", + Sign = DebitCredit.Debit, + TaxInfo = null, + Type = EntryType.Main + }, + new SubmitTxEntry() + { + AccountId = new Guid("248e0000-5dd4-0015-48fb-08dcd98b4a28"), + Amount = 1100, + AmountAdditionnalInfo = null, + Description = "Test", + Label = "Test", + Sign = DebitCredit.Credit, + TaxInfo = null, + Type = EntryType.Counterparty + } + ] + }; + + //Act + var response = await _client.PostAsJsonAsync($"{_baseUrlForV1}/txs/submit", command); + var result = await response.Content.ReadFromJsonAsync(); + + //Assert + response.StatusCode.Should().Be(HttpStatusCode.BadRequest); + result.Should() + .NotBeNull() + .And.BeOfType() + .And.Match(x => x.Errors.First().Code == "BAD_CURRENCY_PARAMS_FOR_ENTRY"); + } + + [Fact] + public async Task Submit_Tx_WithBadAccountId_400() + { + var token = await GetAccessTokenAsync(TokenType.RW); + _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); + + var command = new SubmitTxCommand() + { + Amount = 1100, + ValueDate = DateOnly.FromDateTime(DateTime.Now), + Entries = + [ + new SubmitTxEntry() + { + AccountId = new Guid("248e0000-5dd4-0015-c1ce-08dcd98b7c71"), + Amount = 1100, + AmountAdditionnalInfo = new SubmitTxEntryAdditionalAmountInfo() + { + ExchangeRate = 1.1m, + OriginalAmount = 1000, + OriginalCurrencyId = new Guid("248e0000-5dd4-0015-291d-08dcd98e55f8") + }, + Description = "Test", + Label = "Test", + Sign = DebitCredit.Debit, + TaxInfo = null, + Type = EntryType.Main + }, + new SubmitTxEntry() + { + AccountId = new Guid("248e0000-5dd4-0015-48fb-08dcd98b4a28"), + Amount = 1100, + AmountAdditionnalInfo = null, + Description = "Test", + Label = "Test", + Sign = DebitCredit.Credit, + TaxInfo = null, + Type = EntryType.Counterparty + } + ] + }; + + //Act + var response = await _client.PostAsJsonAsync($"{_baseUrlForV1}/txs/submit", command); + var result = await response.Content.ReadFromJsonAsync(); + + //Assert + response.StatusCode.Should().Be(HttpStatusCode.BadRequest); + result.Should() + .NotBeNull() + .And.BeOfType() + .And.Match(x => x.Errors.First().Code == "ACCOUNT_NOT_FOUND_FOR_ENTRY"); + } + + [Fact] + public async Task Submit_Tx_WithAllInfo_OK() + { + var token = await GetAccessTokenAsync(TokenType.RW); + _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); + + var command = new SubmitTxCommand() + { + Amount = 1100, + ValueDate = DateOnly.FromDateTime(DateTime.Now), + Entries = + [ + new SubmitTxEntry() + { + AccountId = new Guid("248e0000-5dd4-0015-c1ce-08dcd98b7c74"), + Amount = 1100, + AmountAdditionnalInfo = new SubmitTxEntryAdditionalAmountInfo() + { + ExchangeRate = 1.1m, + OriginalAmount = 1000, + OriginalCurrencyId = new Guid("248e0000-5dd4-0015-291d-08dcd98e55f8") + }, + Description = "Test", + Label = "Test", + Sign = DebitCredit.Debit, + TaxInfo = new SubmitTxEntryTaxInfo() + { + TaxAppliedRate = 8.1m, + TaxRateId = new Guid("08740000-3c36-7456-6f96-08dcfb48b915"), + }, + Type = EntryType.Main + }, + new SubmitTxEntry() + { + AccountId = new Guid("248e0000-5dd4-0015-48fb-08dcd98b4a28"), + Amount = 1100, + AmountAdditionnalInfo = null, + Description = "Test", + Label = "Test", + Sign = DebitCredit.Credit, + TaxInfo = null, + Type = EntryType.Counterparty + } + ] + }; + + //Act + var response = await _client.PostAsJsonAsync($"{_baseUrlForV1}/txs/submit", command); + var result = await response.Content.ReadFromJsonAsync(); + + //Assert + response.StatusCode.Should().Be(HttpStatusCode.OK); + result.Should() + .NotBeNull() + .And.BeOfType() + .And.Match(x => x.Amount == command.Amount); + } + + [Fact] + public async Task Submit_Tx_WithMissingTaxRate_OK() + { + var token = await GetAccessTokenAsync(TokenType.RW); + _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); + + var command = new SubmitTxCommand() + { + Amount = 1100, + ValueDate = DateOnly.FromDateTime(DateTime.Now), + Entries = + [ + new SubmitTxEntry() + { + AccountId = new Guid("248e0000-5dd4-0015-c1ce-08dcd98b7c74"), + Amount = 1100, + AmountAdditionnalInfo = new SubmitTxEntryAdditionalAmountInfo() + { + ExchangeRate = 1.1m, + OriginalAmount = 1000, + OriginalCurrencyId = new Guid("248e0000-5dd4-0015-291d-08dcd98e55f8") + }, + Description = "Test", + Label = "Test", + Sign = DebitCredit.Debit, + TaxInfo = new SubmitTxEntryTaxInfo() + { + TaxAppliedRate = 8.1m, + TaxRateId = new Guid("08740000-3c36-7456-6f96-08dcfb48b911"), + }, + Type = EntryType.Main + }, + new SubmitTxEntry() + { + AccountId = new Guid("248e0000-5dd4-0015-48fb-08dcd98b4a28"), + Amount = 1100, + AmountAdditionnalInfo = null, + Description = "Test", + Label = "Test", + Sign = DebitCredit.Credit, + TaxInfo = null, + Type = EntryType.Counterparty + } + ] + }; + + //Act + var response = await _client.PostAsJsonAsync($"{_baseUrlForV1}/txs/submit", command); + var result = await response.Content.ReadFromJsonAsync(); + + //Assert + response.StatusCode.Should().Be(HttpStatusCode.BadRequest); + result.Should() + .NotBeNull() + .And.BeOfType() + .And.Match(x => x.Errors.First().Code == "TAX_RATE_NOT_FOUND_FOR_ENTRY"); + } + + [Fact] + public async Task Submit_Tx_WithNotMatchingTaxRate_OK() + { + var token = await GetAccessTokenAsync(TokenType.RW); + _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); + + var command = new SubmitTxCommand() + { + Amount = 1100, + ValueDate = DateOnly.FromDateTime(DateTime.Now), + Entries = + [ + new SubmitTxEntry() + { + AccountId = new Guid("248e0000-5dd4-0015-c1ce-08dcd98b7c74"), + Amount = 1100, + AmountAdditionnalInfo = new SubmitTxEntryAdditionalAmountInfo() + { + ExchangeRate = 1.1m, + OriginalAmount = 1000, + OriginalCurrencyId = new Guid("248e0000-5dd4-0015-291d-08dcd98e55f8") + }, + Description = "Test", + Label = "Test", + Sign = DebitCredit.Debit, + TaxInfo = new SubmitTxEntryTaxInfo() + { + TaxAppliedRate = 8.0m, + TaxRateId = new Guid("08740000-3c36-7456-6f96-08dcfb48b915"), + }, + Type = EntryType.Main + }, + new SubmitTxEntry() + { + AccountId = new Guid("248e0000-5dd4-0015-48fb-08dcd98b4a28"), + Amount = 1100, + AmountAdditionnalInfo = null, + Description = "Test", + Label = "Test", + Sign = DebitCredit.Credit, + TaxInfo = null, + Type = EntryType.Counterparty + } + ] + }; + + //Act + var response = await _client.PostAsJsonAsync($"{_baseUrlForV1}/txs/submit", command); + var result = await response.Content.ReadFromJsonAsync(); + + //Assert + response.StatusCode.Should().Be(HttpStatusCode.BadRequest); + result.Should() + .NotBeNull() + .And.BeOfType() + .And.Match(x => x.Errors.First().Code == "TAX_RATE_NOT_MATCH_FOR_ENTRY"); + } } } From 1df19a36f0b6ad32915e71a02cff378b5c9b907e Mon Sep 17 00:00:00 2001 From: ubik Date: Mon, 11 Nov 2024 16:34:28 +0100 Subject: [PATCH 75/94] Saga or not ? --- .../Ubik.Accounting.Transaction.Api.csproj | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Ubik.Accounting.Transaction.Api/Ubik.Accounting.Transaction.Api.csproj b/src/Ubik.Accounting.Transaction.Api/Ubik.Accounting.Transaction.Api.csproj index 5df00f1d..22a22a62 100644 --- a/src/Ubik.Accounting.Transaction.Api/Ubik.Accounting.Transaction.Api.csproj +++ b/src/Ubik.Accounting.Transaction.Api/Ubik.Accounting.Transaction.Api.csproj @@ -39,4 +39,8 @@ + + + + From ba716f7d9dee8c0866ca4066102cf0438cc4198a Mon Sep 17 00:00:00 2001 From: ubik Date: Mon, 11 Nov 2024 18:15:17 +0100 Subject: [PATCH 76/94] Entry link for tax/vat entries that will be linked to other entries --- .../Data/Config/EntryConfiguration.cs | 20 +++++++++-- .../Models/Entry.cs | 1 + .../Models/EntryLink.cs | 34 +++++++++++++++++++ .../Entries/Enums/LinkType.cs | 13 +++++++ 4 files changed, 66 insertions(+), 2 deletions(-) create mode 100644 src/Ubik.Accounting.Transaction.Api/Models/EntryLink.cs create mode 100644 src/Ubik.Accounting.Transaction.Contracts/Entries/Enums/LinkType.cs diff --git a/src/Ubik.Accounting.Transaction.Api/Data/Config/EntryConfiguration.cs b/src/Ubik.Accounting.Transaction.Api/Data/Config/EntryConfiguration.cs index f1e16027..c3e5dc14 100644 --- a/src/Ubik.Accounting.Transaction.Api/Data/Config/EntryConfiguration.cs +++ b/src/Ubik.Accounting.Transaction.Api/Data/Config/EntryConfiguration.cs @@ -8,8 +8,6 @@ public class EntryConfiguration : IEntityTypeConfiguration { public void Configure(EntityTypeBuilder builder) { - //builder.ToTable("entries"); - builder.ToTable("entries", t => { t.HasCheckConstraint("ck_entry_label_main_type", "type != 0 OR label IS NOT NULL"); @@ -90,6 +88,24 @@ public void Configure(EntityTypeBuilder builder) builder.Navigation(m => m.TaxInfo).IsRequired(false); + builder.OwnsOne(a => a.Link, link => + { + link.Ignore(t => t.EntryId); + + link.Property("_entryId") + .HasColumnName("link_entry_id") + .IsRequired(false); + + link.Ignore(t => t.LinkType); + + link.Property("_linkType") + .HasColumnName("link_type") + .HasConversion() + .IsRequired(false); + }); + + builder.Navigation(m => m.Link).IsRequired(false); + builder.Property(a => a.Version) .IsConcurrencyToken(); diff --git a/src/Ubik.Accounting.Transaction.Api/Models/Entry.cs b/src/Ubik.Accounting.Transaction.Api/Models/Entry.cs index 2dda93c7..6908cc65 100644 --- a/src/Ubik.Accounting.Transaction.Api/Models/Entry.cs +++ b/src/Ubik.Accounting.Transaction.Api/Models/Entry.cs @@ -18,6 +18,7 @@ public class Entry : ITenantEntity, IConcurrencyCheckEntity, IAuditEntity public required decimal Amount { get; set; } public AmountAdditionalInfo? AmountAdditionnalInfo { get; set; } public TaxInfo? TaxInfo { get; set; } = default!; + public EntryLink? Link { get; set; } public Guid Version { get; set; } public Guid TenantId { get; set; } public AuditData AuditInfo { get; set; } = default!; diff --git a/src/Ubik.Accounting.Transaction.Api/Models/EntryLink.cs b/src/Ubik.Accounting.Transaction.Api/Models/EntryLink.cs new file mode 100644 index 00000000..a744254f --- /dev/null +++ b/src/Ubik.Accounting.Transaction.Api/Models/EntryLink.cs @@ -0,0 +1,34 @@ +using Ubik.Accounting.Transaction.Contracts.Entries.Enums; + +namespace Ubik.Accounting.Transaction.Api.Models +{ + //Ef core hack for owned type + public class EntryLink + { + private LinkType? _linkType; + + public LinkType LinkType + { + get => _linkType ?? throw new NullReferenceException("Link type cannot be null"); + private set => _linkType = value; + } + + private Guid? _entryId; + + public Guid EntryId + { + get => _entryId ?? throw new NullReferenceException("Entry Id cannot be null"); + private set => _entryId = value; + } + + public EntryLink(LinkType linkType, Guid entryId) + { + _linkType = linkType; + _entryId = entryId; + } + + private EntryLink() + { + } + } +} diff --git a/src/Ubik.Accounting.Transaction.Contracts/Entries/Enums/LinkType.cs b/src/Ubik.Accounting.Transaction.Contracts/Entries/Enums/LinkType.cs new file mode 100644 index 00000000..c436ac71 --- /dev/null +++ b/src/Ubik.Accounting.Transaction.Contracts/Entries/Enums/LinkType.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Ubik.Accounting.Transaction.Contracts.Entries.Enums +{ + public enum LinkType + { + TaxLink, + } +} From 85709f9b70205ec7352a29633b978cdc32cb824e Mon Sep 17 00:00:00 2001 From: ubik Date: Mon, 11 Nov 2024 18:17:50 +0100 Subject: [PATCH 77/94] comment --- .../Features/Currencies/Controller/v1/CurrenciesController.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Ubik.Accounting.Structure.Api/Features/Currencies/Controller/v1/CurrenciesController.cs b/src/Ubik.Accounting.Structure.Api/Features/Currencies/Controller/v1/CurrenciesController.cs index 9ca2d798..2c1e40d4 100644 --- a/src/Ubik.Accounting.Structure.Api/Features/Currencies/Controller/v1/CurrenciesController.cs +++ b/src/Ubik.Accounting.Structure.Api/Features/Currencies/Controller/v1/CurrenciesController.cs @@ -7,6 +7,8 @@ namespace Ubik.Accounting.Structure.Api.Features.Currencies.Controller.v1 { + + //TODO: to be replaced with the real source of truth API (currencies will not be managed in accounting structure) [ApiController] [ApiVersion("1.0")] [Route("api/v{version:apiVersion}/[controller]")] From 2c127d2947ba6e89bcc5ada3e2d3d0ec925362b7 Mon Sep 17 00:00:00 2001 From: fdonnet Date: Tue, 12 Nov 2024 16:24:05 +0100 Subject: [PATCH 78/94] Seems to work to add a simple tx without tax validation. --- .../Program.cs | 4 +- src/Ubik.Accounting.Structure.Api/Program.cs | 4 +- .../Data/Config/EntryConfiguration.cs | 8 +- .../Data/Config/TxConfiguration.cs | 2 +- .../Txs/Consumers/TxSubmittedConsumer.cs | 26 +++ .../Txs/Consumers/TxValidatedConsumer.cs | 15 ++ .../Txs/Controllers/v1/TxsController.cs | 4 +- .../Txs/Services/ITxCommandService.cs | 5 +- .../Features/Txs/Services/TxCommandService.cs | 43 ++++- .../Mappers/TxMappers.cs | 160 ++++++++++++++++-- .../Models/Tx.cs | 3 +- .../Program.cs | 10 +- .../Ubik.Accounting.Transaction.Api.csproj | 5 + .../Txs/Events/TxAdded.cs | 47 +++++ .../Events/{TxSubmited.cs => TxSubmitted.cs} | 14 +- .../Txs/Events/TxValidated.cs | 38 +++++ ...er.cs => TenantAndUserIdsConsumeFilter.cs} | 11 +- ...er.cs => TenantAndUserIdsPublishFilter.cs} | 3 +- .../Extensions/ChangeTrackerExtensions.cs | 58 ++++--- src/Ubik.Security.Api/Program.cs | 4 +- src/Ubik.YarpProxy/appsettings.json | 2 +- .../Transaction/Txs/TxsController_Test.cs | 12 +- 22 files changed, 399 insertions(+), 79 deletions(-) create mode 100644 src/Ubik.Accounting.Transaction.Api/Features/Txs/Consumers/TxSubmittedConsumer.cs create mode 100644 src/Ubik.Accounting.Transaction.Api/Features/Txs/Consumers/TxValidatedConsumer.cs create mode 100644 src/Ubik.Accounting.Transaction.Contracts/Txs/Events/TxAdded.cs rename src/Ubik.Accounting.Transaction.Contracts/Txs/Events/{TxSubmited.cs => TxSubmitted.cs} (70%) create mode 100644 src/Ubik.Accounting.Transaction.Contracts/Txs/Events/TxValidated.cs rename src/Ubik.ApiService.Common/Filters/{TenantIdConsumeFilter.cs => TenantAndUserIdsConsumeFilter.cs} (66%) rename src/Ubik.ApiService.Common/Filters/{TenantIdPublishFilter.cs => TenantAndUserIdsPublishFilter.cs} (78%) diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Program.cs b/src/Ubik.Accounting.SalesOrVatTax.Api/Program.cs index 53d02b7d..29f47a98 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Api/Program.cs +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Program.cs @@ -56,8 +56,8 @@ //TODO:review that Maybe not needed.... it was before I have the Yarp proxy... //Use to pass tenantid when message broker is used to contact the api (async) //configurator.UseSendFilter(typeof(TenantIdSendFilter<>), context); - configurator.UsePublishFilter(typeof(TenantIdPublishFilter<>), context); - //configurator.UseConsumeFilter(typeof(TenantIdConsumeFilter<>), context); + configurator.UsePublishFilter(typeof(TenantAndUserIdsPublishFilter<>), context); + configurator.UseConsumeFilter(typeof(TenantAndUserIdsConsumeFilter<>), context); }); config.AddEntityFrameworkOutbox(o => diff --git a/src/Ubik.Accounting.Structure.Api/Program.cs b/src/Ubik.Accounting.Structure.Api/Program.cs index 677965b6..712e71ff 100644 --- a/src/Ubik.Accounting.Structure.Api/Program.cs +++ b/src/Ubik.Accounting.Structure.Api/Program.cs @@ -72,8 +72,8 @@ public static async Task Main(string[] args) //TODO:review that //Use to pass tenantid when message broker is used to contact the api (async) //configurator.UseSendFilter(typeof(TenantIdSendFilter<>), context); - configurator.UsePublishFilter(typeof(TenantIdPublishFilter<>), context); - //configurator.UseConsumeFilter(typeof(TenantIdConsumeFilter<>), context); + configurator.UsePublishFilter(typeof(TenantAndUserIdsPublishFilter<>), context); + configurator.UseConsumeFilter(typeof(TenantAndUserIdsConsumeFilter<>), context); }); config.AddEntityFrameworkOutbox(o => diff --git a/src/Ubik.Accounting.Transaction.Api/Data/Config/EntryConfiguration.cs b/src/Ubik.Accounting.Transaction.Api/Data/Config/EntryConfiguration.cs index c3e5dc14..03ba5a0b 100644 --- a/src/Ubik.Accounting.Transaction.Api/Data/Config/EntryConfiguration.cs +++ b/src/Ubik.Accounting.Transaction.Api/Data/Config/EntryConfiguration.cs @@ -68,8 +68,6 @@ public void Configure(EntityTypeBuilder builder) .IsRequired(false); }); - builder.Navigation(m => m.AmountAdditionnalInfo).IsRequired(false); - builder.OwnsOne(a => a.TaxInfo, taxInfo => { taxInfo.Ignore(t => t.TaxAppliedRate); @@ -86,8 +84,6 @@ public void Configure(EntityTypeBuilder builder) .IsRequired(false); }); - builder.Navigation(m => m.TaxInfo).IsRequired(false); - builder.OwnsOne(a => a.Link, link => { link.Ignore(t => t.EntryId); @@ -104,8 +100,6 @@ public void Configure(EntityTypeBuilder builder) .IsRequired(false); }); - builder.Navigation(m => m.Link).IsRequired(false); - builder.Property(a => a.Version) .IsConcurrencyToken(); @@ -131,6 +125,8 @@ public void Configure(EntityTypeBuilder builder) .IsRequired(); }); + builder.Navigation(m => m.AuditInfo).IsRequired(true); + builder.HasIndex(a => a.TenantId); } diff --git a/src/Ubik.Accounting.Transaction.Api/Data/Config/TxConfiguration.cs b/src/Ubik.Accounting.Transaction.Api/Data/Config/TxConfiguration.cs index dd0796c5..10933a1e 100644 --- a/src/Ubik.Accounting.Transaction.Api/Data/Config/TxConfiguration.cs +++ b/src/Ubik.Accounting.Transaction.Api/Data/Config/TxConfiguration.cs @@ -21,7 +21,7 @@ public void Configure(EntityTypeBuilder builder) builder.Property(a => a.TenantId) .IsRequired(); - builder.HasIndex(x => x.TenantId).IsUnique(); + builder.HasIndex(x => x.TenantId); builder.HasIndex(x => x.ValueDate); diff --git a/src/Ubik.Accounting.Transaction.Api/Features/Txs/Consumers/TxSubmittedConsumer.cs b/src/Ubik.Accounting.Transaction.Api/Features/Txs/Consumers/TxSubmittedConsumer.cs new file mode 100644 index 00000000..83e7d4a7 --- /dev/null +++ b/src/Ubik.Accounting.Transaction.Api/Features/Txs/Consumers/TxSubmittedConsumer.cs @@ -0,0 +1,26 @@ +using MassTransit; +using Ubik.Accounting.Transaction.Api.Features.Txs.Services; +using Ubik.Accounting.Transaction.Api.Mappers; +using Ubik.Accounting.Transaction.Contracts.Txs.Events; + +namespace Ubik.Accounting.Transaction.Api.Features.Txs.Consumers +{ + public class TxSubmittedConsumer(ITxCommandService commandService) : IConsumer + { + public async Task Consume(ConsumeContext context) + { + var tx = context.Message; + + if(commandService.CheckIfTxNeedTaxValidation(tx)) + { + //Publish tax validation request + + } + else + { + //Publish validated event (tax validation skipped) + commandService.PublishValidated(tx.ToTxValidated()); + } + } + } +} diff --git a/src/Ubik.Accounting.Transaction.Api/Features/Txs/Consumers/TxValidatedConsumer.cs b/src/Ubik.Accounting.Transaction.Api/Features/Txs/Consumers/TxValidatedConsumer.cs new file mode 100644 index 00000000..5605c159 --- /dev/null +++ b/src/Ubik.Accounting.Transaction.Api/Features/Txs/Consumers/TxValidatedConsumer.cs @@ -0,0 +1,15 @@ +using MassTransit; +using Ubik.Accounting.Transaction.Api.Features.Txs.Services; +using Ubik.Accounting.Transaction.Contracts.Txs.Events; + +namespace Ubik.Accounting.Transaction.Api.Features.Txs.Consumers +{ + public class TxValidatedConsumer(ITxCommandService commandService) : IConsumer + { + public async Task Consume(ConsumeContext context) + { + var tx = context.Message; + await commandService.AddTxAsync(tx); + } + } +} diff --git a/src/Ubik.Accounting.Transaction.Api/Features/Txs/Controllers/v1/TxsController.cs b/src/Ubik.Accounting.Transaction.Api/Features/Txs/Controllers/v1/TxsController.cs index ad5b020d..5883b332 100644 --- a/src/Ubik.Accounting.Transaction.Api/Features/Txs/Controllers/v1/TxsController.cs +++ b/src/Ubik.Accounting.Transaction.Api/Features/Txs/Controllers/v1/TxsController.cs @@ -16,9 +16,9 @@ public class TxsController(ITxCommandService commandService) : ControllerBase [ProducesResponseType(200)] [ProducesResponseType(typeof(CustomProblemDetails), 400)] [ProducesResponseType(typeof(CustomProblemDetails), 500)] - public async Task> SubmitTx(SubmitTxCommand command) + public async Task> SubmitTx(SubmitTxCommand command) { - var result = await commandService.SubmitTx(command); + var result = await commandService.SubmitTxAsync(command); return result.Match( Right: ok => Ok(ok), Left: err => new ObjectResult(err.ToValidationProblemDetails(HttpContext))); diff --git a/src/Ubik.Accounting.Transaction.Api/Features/Txs/Services/ITxCommandService.cs b/src/Ubik.Accounting.Transaction.Api/Features/Txs/Services/ITxCommandService.cs index 861d4a19..49c002ee 100644 --- a/src/Ubik.Accounting.Transaction.Api/Features/Txs/Services/ITxCommandService.cs +++ b/src/Ubik.Accounting.Transaction.Api/Features/Txs/Services/ITxCommandService.cs @@ -7,6 +7,9 @@ namespace Ubik.Accounting.Transaction.Api.Features.Txs.Services { public interface ITxCommandService { - public Task> SubmitTx(SubmitTxCommand command); + public Task> SubmitTxAsync(SubmitTxCommand command); + public bool CheckIfTxNeedTaxValidation(TxSubmitted tx); + public void PublishValidated(TxValidated tx); + public Task AddTxAsync(TxValidated tx); } } diff --git a/src/Ubik.Accounting.Transaction.Api/Features/Txs/Services/TxCommandService.cs b/src/Ubik.Accounting.Transaction.Api/Features/Txs/Services/TxCommandService.cs index 125e23be..4e9c4472 100644 --- a/src/Ubik.Accounting.Transaction.Api/Features/Txs/Services/TxCommandService.cs +++ b/src/Ubik.Accounting.Transaction.Api/Features/Txs/Services/TxCommandService.cs @@ -8,6 +8,8 @@ using Ubik.Accounting.Transaction.Contracts.Txs.Events; using Ubik.Accounting.Transaction.Api.Mappers; using Ubik.Accounting.Transaction.Contracts.Entries.Enums; +using Ubik.Accounting.Transaction.Api.Models; +using Ubik.ApiService.Common.Services; namespace Ubik.Accounting.Transaction.Api.Features.Txs.Services { @@ -15,9 +17,9 @@ namespace Ubik.Accounting.Transaction.Api.Features.Txs.Services //with all the details for each error, the user needs to receive ONE error payload. //or maybe not... return when 1 error or test for all errors... public class TxCommandService(AccountingTxContext ctx - , IPublishEndpoint publishEndpoint) : ITxCommandService + , IPublishEndpoint publishEndpoint, ICurrentUser currentUser) : ITxCommandService { - public async Task> SubmitTx(SubmitTxCommand command) + public async Task> SubmitTxAsync(SubmitTxCommand command) { return await ValidateOnlyOneMainEntryAsync(command) .BindAsync(ValidateBalanceAsync) @@ -27,10 +29,43 @@ public async Task> SubmitTx(SubmitTxCommand co .BindAsync(PublishSubmittedAsync); } - private async Task> PublishSubmittedAsync(SubmitTxCommand current) + + public bool CheckIfTxNeedTaxValidation(TxSubmitted tx) + { + return tx.Entries.Any(e => e.TaxInfo != null); + } + + public void PublishValidated(TxValidated tx) + { + publishEndpoint.Publish(tx, CancellationToken.None); + } + + + public async Task AddTxAsync(TxValidated tx) + { + var newTx = tx.ToTx(); + ctx.Txs.Add(newTx); + + var txEntries = tx.Entries.Select(e => e.ToEntry(newTx.Id)); + + foreach (var entry in txEntries) + { + ctx.Entries.Add(entry); + } + + ctx.SetAuditAndSpecialFields(); + + var addedTx = newTx.ToTxAdded(txEntries); + + await publishEndpoint.Publish(addedTx, CancellationToken.None); + await ctx.SaveChangesAsync(); + return addedTx; + } + + private async Task> PublishSubmittedAsync(SubmitTxCommand current) { //Publish that a tx has been submitted and checked for the ez validation - var submited = current.ToTxSubmited(); + var submited = current.ToTxSubmitted(); await publishEndpoint.Publish(submited, CancellationToken.None); await ctx.SaveChangesAsync(); diff --git a/src/Ubik.Accounting.Transaction.Api/Mappers/TxMappers.cs b/src/Ubik.Accounting.Transaction.Api/Mappers/TxMappers.cs index 131d851c..42c04360 100644 --- a/src/Ubik.Accounting.Transaction.Api/Mappers/TxMappers.cs +++ b/src/Ubik.Accounting.Transaction.Api/Mappers/TxMappers.cs @@ -1,41 +1,129 @@ -using MassTransit; +using LanguageExt; +using MassTransit; +using Ubik.Accounting.Transaction.Api.Models; using Ubik.Accounting.Transaction.Contracts.Txs.Commands; using Ubik.Accounting.Transaction.Contracts.Txs.Events; +using Ubik.DB.Common.Models; namespace Ubik.Accounting.Transaction.Api.Mappers { public static class TxMappers { - public static TxSubmited ToTxSubmited(this SubmitTxCommand current) + + public static TxSubmitted ToTxSubmitted(this SubmitTxCommand current) + { + return new TxSubmitted + { + Id = NewId.NextGuid(), + ValueDate = current.ValueDate, + Amount = current.Amount, + Entries = current.Entries.Select(x => x.ToTxEntrySubmitted()), + }; + } + + public static TxValidated ToTxValidated(this TxSubmitted current) { - return new TxSubmited + return new TxValidated { Id = NewId.NextGuid(), ValueDate = current.ValueDate, Amount = current.Amount, - Entries = current.Entries.Select(x => x.ToTxEntrySubmited()) + Entries = current.Entries.Select(x => x.ToTxEntryValidated()), + }; + } + + public static Tx ToTx(this TxValidated current) + { + var now = DateTime.UtcNow; + return new Tx + { + Id = current.Id, + ValueDate = current.ValueDate, + Amount = current.Amount, + }; + } + + public static TxAdded ToTxAdded(this Tx current, IEnumerable entries) + { + return new TxAdded + { + Id = current.Id, + ValueDate = current.ValueDate, + Amount = current.Amount, + Entries = entries.Select(x=>x.ToTxEntryAdded()), + Version = current.Version }; } - public static TxEntrySubmited ToTxEntrySubmited(this SubmitTxEntry current) + public static TxEntrySubmitted ToTxEntrySubmitted(this SubmitTxEntry current) { - return new TxEntrySubmited + return new TxEntrySubmitted { Id = NewId.NextGuid(), Description = current.Description, AccountId = current.AccountId, Amount = current.Amount, - AmountAdditionnalInfo = current.AmountAdditionnalInfo?.ToTxEntryAdditionalAmountInfoSubmited(), + AmountAdditionnalInfo = current.AmountAdditionnalInfo?.ToTxEntryAdditionalAmountInfoSubmitted(), Label = current.Label, Sign = current.Sign, - TaxInfo = current.TaxInfo?.ToTxEntryTaxInfoSubmited(), + TaxInfo = current.TaxInfo?.ToTxEntryTaxInfoSubmitted(), Type = current.Type }; } - public static TxEntryAdditionalAmountInfoSubmited ToTxEntryAdditionalAmountInfoSubmited(this SubmitTxEntryAdditionalAmountInfo current) + public static TxEntryValidated ToTxEntryValidated(this TxEntrySubmitted current) + { + return new TxEntryValidated + { + Id = NewId.NextGuid(), + Description = current.Description, + AccountId = current.AccountId, + Amount = current.Amount, + AmountAdditionnalInfo = current.AmountAdditionnalInfo?.ToTxEntryAdditionalAmountInfoValidated(), + Label = current.Label, + Sign = current.Sign, + TaxInfo = current.TaxInfo?.ToTxEntryTaxInfoValidated(), + Type = current.Type + }; + } + + public static Entry ToEntry(this TxEntryValidated current, Guid txId) + { + return new Entry + { + Id = current.Id, + Description = current.Description, + AccountId = current.AccountId, + Amount = current.Amount, + AmountAdditionnalInfo = current.AmountAdditionnalInfo?.ToAmountAdditionnalInfo(), + Label = current.Label, + Sign = current.Sign, + TaxInfo = current.TaxInfo?.ToTaxInfo(), + Type = current.Type, + TxId = txId, + }; + } + + public static TxEntryAdded ToTxEntryAdded(this Entry current) { - return new TxEntryAdditionalAmountInfoSubmited + return new TxEntryAdded + { + Id = current.Id, + Description = current.Description, + AccountId = current.AccountId, + Amount = current.Amount, + AmountAdditionnalInfo = current.AmountAdditionnalInfo?.ToTxEntryAdditionalAmountInfoAdded(), + Label = current.Label, + Sign = current.Sign, + TaxInfo = current.TaxInfo?.ToTxEntryTaxInfoAdded(), + Type = current.Type, + Version = current.Version, + }; + } + + public static TxEntryAdditionalAmountInfoSubmitted ToTxEntryAdditionalAmountInfoSubmitted(this SubmitTxEntryAdditionalAmountInfo current) + { + return new TxEntryAdditionalAmountInfoSubmitted { ExchangeRate = current.ExchangeRate, OriginalAmount = current.OriginalAmount, @@ -43,9 +131,57 @@ public static TxEntryAdditionalAmountInfoSubmited ToTxEntryAdditionalAmountInfoS }; } - public static TxEntryTaxInfoSubmited ToTxEntryTaxInfoSubmited(this SubmitTxEntryTaxInfo current) + public static TxEntryAdditionalAmountInfoValidated ToTxEntryAdditionalAmountInfoValidated(this TxEntryAdditionalAmountInfoSubmitted current) + { + return new TxEntryAdditionalAmountInfoValidated + { + ExchangeRate = current.ExchangeRate, + OriginalAmount = current.OriginalAmount, + OriginalCurrencyId = current.OriginalCurrencyId + }; + } + + public static AmountAdditionalInfo ToAmountAdditionnalInfo(this TxEntryAdditionalAmountInfoValidated current) + { + return new AmountAdditionalInfo(current.OriginalAmount, current.OriginalCurrencyId, current.ExchangeRate); + } + + public static TxEntryAdditionalAmountInfoAdded ToTxEntryAdditionalAmountInfoAdded(this AmountAdditionalInfo current) + { + return new TxEntryAdditionalAmountInfoAdded + { + ExchangeRate = current.ExchangeRate, + OriginalAmount = current.OriginalAmount, + OriginalCurrencyId = current.OriginalCurrencyId, + }; + } + + public static TxEntryTaxInfoSubmitted ToTxEntryTaxInfoSubmitted(this SubmitTxEntryTaxInfo current) + { + return new TxEntryTaxInfoSubmitted + { + TaxAppliedRate = current.TaxAppliedRate, + TaxRateId = current.TaxRateId + }; + } + + public static TxEntryTaxInfoValidated ToTxEntryTaxInfoValidated(this TxEntryTaxInfoSubmitted current) + { + return new TxEntryTaxInfoValidated + { + TaxAppliedRate = current.TaxAppliedRate, + TaxRateId = current.TaxRateId + }; + } + + public static TaxInfo ToTaxInfo(this TxEntryTaxInfoValidated current) + { + return new TaxInfo(current.TaxAppliedRate, current.TaxRateId); + } + + public static TxEntryTaxInfoAdded ToTxEntryTaxInfoAdded(this TaxInfo current) { - return new TxEntryTaxInfoSubmited + return new TxEntryTaxInfoAdded { TaxAppliedRate = current.TaxAppliedRate, TaxRateId = current.TaxRateId diff --git a/src/Ubik.Accounting.Transaction.Api/Models/Tx.cs b/src/Ubik.Accounting.Transaction.Api/Models/Tx.cs index e2dbbade..5c07090d 100644 --- a/src/Ubik.Accounting.Transaction.Api/Models/Tx.cs +++ b/src/Ubik.Accounting.Transaction.Api/Models/Tx.cs @@ -1,4 +1,5 @@ -using Ubik.DB.Common; +using MassTransit; +using Ubik.DB.Common; using Ubik.DB.Common.Models; namespace Ubik.Accounting.Transaction.Api.Models diff --git a/src/Ubik.Accounting.Transaction.Api/Program.cs b/src/Ubik.Accounting.Transaction.Api/Program.cs index d5483ea8..510fb02f 100644 --- a/src/Ubik.Accounting.Transaction.Api/Program.cs +++ b/src/Ubik.Accounting.Transaction.Api/Program.cs @@ -53,7 +53,8 @@ configurator.ConfigureEndpoints(context); //TODO:review that Maybe not needed.... it was before I have the Yarp proxy... - configurator.UsePublishFilter(typeof(TenantIdPublishFilter<>), context); + configurator.UsePublishFilter(typeof(TenantAndUserIdsPublishFilter<>), context); + configurator.UseConsumeFilter(typeof(TenantAndUserIdsConsumeFilter<>), context); }); config.AddEntityFrameworkOutbox(o => @@ -110,7 +111,12 @@ builder.Services.AddControllers(); // Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle builder.Services.AddEndpointsApiExplorer(); -builder.Services.AddSwaggerGen(); + +//Swagger config +var xmlPath = Path.Combine(AppContext.BaseDirectory, + $"{Assembly.GetExecutingAssembly().GetName().Name}.xml"); + +builder.Services.AddSwaggerGenWithAuth(authOptions, xmlPath); var app = builder.Build(); diff --git a/src/Ubik.Accounting.Transaction.Api/Ubik.Accounting.Transaction.Api.csproj b/src/Ubik.Accounting.Transaction.Api/Ubik.Accounting.Transaction.Api.csproj index 22a22a62..82101bc8 100644 --- a/src/Ubik.Accounting.Transaction.Api/Ubik.Accounting.Transaction.Api.csproj +++ b/src/Ubik.Accounting.Transaction.Api/Ubik.Accounting.Transaction.Api.csproj @@ -9,6 +9,11 @@ ..\.. + + true + $(NoWarn);1591 + + diff --git a/src/Ubik.Accounting.Transaction.Contracts/Txs/Events/TxAdded.cs b/src/Ubik.Accounting.Transaction.Contracts/Txs/Events/TxAdded.cs new file mode 100644 index 00000000..0b4c0cd9 --- /dev/null +++ b/src/Ubik.Accounting.Transaction.Contracts/Txs/Events/TxAdded.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Ubik.Accounting.Transaction.Contracts.Entries.Enums; + +namespace Ubik.Accounting.Transaction.Contracts.Txs.Events +{ + public record class TxAdded + { + public required Guid Id { get; init; } + public required DateOnly ValueDate { get; init; } + public required decimal Amount { get; init; } + public IEnumerable Entries { get; init; } = default!; + public Guid Version { get; set; } + public Guid TenantId { get; set; } + } + + public record TxEntryAdded + { + public required Guid Id { get; init; } + public required EntryType Type { get; init; } + public required DebitCredit Sign { get; init; } + public required Guid AccountId { get; init; } + public string? Label { get; init; } + public string? Description { get; init; } + public required decimal Amount { get; init; } + public TxEntryAdditionalAmountInfoAdded? AmountAdditionnalInfo { get; init; } + public TxEntryTaxInfoAdded? TaxInfo { get; init; } = default!; + public Guid Version { get; set; } + public Guid TenantId { get; set; } + } + + public record TxEntryAdditionalAmountInfoAdded + { + public required decimal OriginalAmount { get; init; } + public required Guid OriginalCurrencyId { get; init; } + public decimal ExchangeRate { get; init; } + } + + public record TxEntryTaxInfoAdded + { + public required decimal TaxAppliedRate { get; init; } + public required Guid TaxRateId { get; init; } + } +} diff --git a/src/Ubik.Accounting.Transaction.Contracts/Txs/Events/TxSubmited.cs b/src/Ubik.Accounting.Transaction.Contracts/Txs/Events/TxSubmitted.cs similarity index 70% rename from src/Ubik.Accounting.Transaction.Contracts/Txs/Events/TxSubmited.cs rename to src/Ubik.Accounting.Transaction.Contracts/Txs/Events/TxSubmitted.cs index eaafec5d..1b93fc6e 100644 --- a/src/Ubik.Accounting.Transaction.Contracts/Txs/Events/TxSubmited.cs +++ b/src/Ubik.Accounting.Transaction.Contracts/Txs/Events/TxSubmitted.cs @@ -2,15 +2,15 @@ namespace Ubik.Accounting.Transaction.Contracts.Txs.Events { - public record class TxSubmited + public record class TxSubmitted { public required Guid Id { get; init; } public required DateOnly ValueDate { get; init; } public required decimal Amount { get; init; } - public IEnumerable Entries { get; init; } = default!; + public IEnumerable Entries { get; init; } = default!; } - public record TxEntrySubmited + public record TxEntrySubmitted { public required Guid Id { get; init; } public required EntryType Type { get; init; } @@ -19,18 +19,18 @@ public record TxEntrySubmited public string? Label { get; init; } public string? Description { get; init; } public required decimal Amount { get; init; } - public TxEntryAdditionalAmountInfoSubmited? AmountAdditionnalInfo { get; init; } - public TxEntryTaxInfoSubmited? TaxInfo { get; init; } = default!; + public TxEntryAdditionalAmountInfoSubmitted? AmountAdditionnalInfo { get; init; } + public TxEntryTaxInfoSubmitted? TaxInfo { get; init; } = default!; } - public record TxEntryAdditionalAmountInfoSubmited + public record TxEntryAdditionalAmountInfoSubmitted { public required decimal OriginalAmount { get; init; } public required Guid OriginalCurrencyId { get; init; } public decimal ExchangeRate { get; init; } } - public record TxEntryTaxInfoSubmited + public record TxEntryTaxInfoSubmitted { public required decimal TaxAppliedRate { get; init; } public required Guid TaxRateId { get; init; } diff --git a/src/Ubik.Accounting.Transaction.Contracts/Txs/Events/TxValidated.cs b/src/Ubik.Accounting.Transaction.Contracts/Txs/Events/TxValidated.cs new file mode 100644 index 00000000..12fc4e1b --- /dev/null +++ b/src/Ubik.Accounting.Transaction.Contracts/Txs/Events/TxValidated.cs @@ -0,0 +1,38 @@ +using Ubik.Accounting.Transaction.Contracts.Entries.Enums; + +namespace Ubik.Accounting.Transaction.Contracts.Txs.Events +{ + public record class TxValidated + { + public required Guid Id { get; init; } + public required DateOnly ValueDate { get; init; } + public required decimal Amount { get; init; } + public IEnumerable Entries { get; init; } = default!; + } + + public record TxEntryValidated + { + public required Guid Id { get; init; } + public required EntryType Type { get; init; } + public required DebitCredit Sign { get; init; } + public required Guid AccountId { get; init; } + public string? Label { get; init; } + public string? Description { get; init; } + public required decimal Amount { get; init; } + public TxEntryAdditionalAmountInfoValidated? AmountAdditionnalInfo { get; init; } + public TxEntryTaxInfoValidated? TaxInfo { get; init; } = default!; + } + + public record TxEntryAdditionalAmountInfoValidated + { + public required decimal OriginalAmount { get; init; } + public required Guid OriginalCurrencyId { get; init; } + public decimal ExchangeRate { get; init; } + } + + public record TxEntryTaxInfoValidated + { + public required decimal TaxAppliedRate { get; init; } + public required Guid TaxRateId { get; init; } + } +} diff --git a/src/Ubik.ApiService.Common/Filters/TenantIdConsumeFilter.cs b/src/Ubik.ApiService.Common/Filters/TenantAndUserIdsConsumeFilter.cs similarity index 66% rename from src/Ubik.ApiService.Common/Filters/TenantIdConsumeFilter.cs rename to src/Ubik.ApiService.Common/Filters/TenantAndUserIdsConsumeFilter.cs index bb3070eb..63052643 100644 --- a/src/Ubik.ApiService.Common/Filters/TenantIdConsumeFilter.cs +++ b/src/Ubik.ApiService.Common/Filters/TenantAndUserIdsConsumeFilter.cs @@ -4,16 +4,21 @@ //TODO: change to be adapted to select tenantId not first tenantid of the list namespace Ubik.ApiService.Common.Filters { - public class TenantIdConsumeFilter(ICurrentUser currentUser) : + public class TenantAndUserIdsConsumeFilter(ICurrentUser currentUser) : IFilter> where T : class { public Task Send(ConsumeContext context, IPipe> next) { var tenantId = context.Headers.Get("TenantId"); + var userId = context.Headers.Get("UserId"); - currentUser.TenantId = Guid.TryParse(tenantId, out var setTenantID) - ? setTenantID + currentUser.TenantId = Guid.TryParse(tenantId, out var setTenantId) + ? setTenantId + : default; + + currentUser.Id = Guid.TryParse(userId, out var setUserId) + ? setUserId : default; return next.Send(context); diff --git a/src/Ubik.ApiService.Common/Filters/TenantIdPublishFilter.cs b/src/Ubik.ApiService.Common/Filters/TenantAndUserIdsPublishFilter.cs similarity index 78% rename from src/Ubik.ApiService.Common/Filters/TenantIdPublishFilter.cs rename to src/Ubik.ApiService.Common/Filters/TenantAndUserIdsPublishFilter.cs index b66fc8fa..0c4be704 100644 --- a/src/Ubik.ApiService.Common/Filters/TenantIdPublishFilter.cs +++ b/src/Ubik.ApiService.Common/Filters/TenantAndUserIdsPublishFilter.cs @@ -4,13 +4,14 @@ //TODO: change filter thing to be set on selected tenant id (not the first) namespace Ubik.ApiService.Common.Filters { - public class TenantIdPublishFilter(ICurrentUser currentUser) : + public class TenantAndUserIdsPublishFilter(ICurrentUser currentUser) : IFilter> where T : class { public Task Send(PublishContext context, IPipe> next) { context.Headers.Set("TenantId", currentUser.TenantId.ToString()); + context.Headers.Set("UserId", currentUser.Id.ToString()); return next.Send(context); } diff --git a/src/Ubik.Db.Common/Ubik.DB.Common/Extensions/ChangeTrackerExtensions.cs b/src/Ubik.Db.Common/Ubik.DB.Common/Extensions/ChangeTrackerExtensions.cs index d0e49839..f365a512 100644 --- a/src/Ubik.Db.Common/Ubik.DB.Common/Extensions/ChangeTrackerExtensions.cs +++ b/src/Ubik.Db.Common/Ubik.DB.Common/Extensions/ChangeTrackerExtensions.cs @@ -36,29 +36,32 @@ public static void SetSpecialFieldsForAdminUser(this ChangeTracker changeTracker /// private static void SetAuditFields(IEnumerable entities, ICurrentUser currentUser) { - var auditEntities = entities - .Where(t => t.Entity is IAuditEntity && - ( - t.State == EntityState.Added || t.State == EntityState.Modified - )); - - if (auditEntities.Any()) + if (currentUser.Id != Guid.Empty) { - DateTime timestamp = DateTime.UtcNow; - Guid userId = currentUser.Id; + var auditEntities = entities + .Where(t => t.Entity is IAuditEntity && + ( + t.State == EntityState.Added || t.State == EntityState.Modified + )); - foreach (EntityEntry entry in auditEntities) + if (auditEntities.Any()) { - IAuditEntity entity = (IAuditEntity)entry.Entity; + DateTime timestamp = DateTime.UtcNow; + Guid userId = currentUser.Id; - switch (entry.State) + foreach (EntityEntry entry in auditEntities) { - case EntityState.Added: - entity.AuditInfo = new AuditData(timestamp, userId, timestamp, userId); - break; - case EntityState.Modified: - entity.AuditInfo.SetModified(timestamp, userId); - break; + IAuditEntity entity = (IAuditEntity)entry.Entity; + + switch (entry.State) + { + case EntityState.Added: + entity.AuditInfo = new AuditData(timestamp, userId, timestamp, userId); + break; + case EntityState.Modified: + entity.AuditInfo.SetModified(timestamp, userId); + break; + } } } } @@ -71,21 +74,24 @@ private static void SetAuditFields(IEnumerable entities, ICurrentUs /// private static void SetTenantField(IEnumerable entities, ICurrentUser currentUser) { - var tenantEntities = entities + if (currentUser.Id != Guid.Empty) + { + var tenantEntities = entities .Where(t => t.Entity is ITenantEntity && ( t.State == EntityState.Added || t.State == EntityState.Modified )); - if (tenantEntities.Any()) - { - foreach (EntityEntry entry in tenantEntities) + if (tenantEntities.Any()) { - ITenantEntity entity = (ITenantEntity)entry.Entity; - if (currentUser.TenantId == null) - throw new InvalidDataException("TenanId is missing, cannot continue"); + foreach (EntityEntry entry in tenantEntities) + { + ITenantEntity entity = (ITenantEntity)entry.Entity; + if (currentUser.TenantId == null) + throw new InvalidDataException("TenanId is missing, cannot continue"); - entity.TenantId = (Guid)currentUser.TenantId; + entity.TenantId = (Guid)currentUser.TenantId; + } } } } diff --git a/src/Ubik.Security.Api/Program.cs b/src/Ubik.Security.Api/Program.cs index 6351c0bd..a2cf137e 100644 --- a/src/Ubik.Security.Api/Program.cs +++ b/src/Ubik.Security.Api/Program.cs @@ -71,8 +71,8 @@ //Use to pass tenantid when message broker is used to contact the api (async) //TODO:See if needed //configurator.UseSendFilter(typeof(TenantIdSendFilter<>), context); - configurator.UsePublishFilter(typeof(TenantIdPublishFilter<>), context); - configurator.UseConsumeFilter(typeof(TenantIdConsumeFilter<>), context); + configurator.UsePublishFilter(typeof(TenantAndUserIdsPublishFilter<>), context); + configurator.UseConsumeFilter(typeof(TenantAndUserIdsConsumeFilter<>), context); }); config.AddEntityFrameworkOutbox(o => diff --git a/src/Ubik.YarpProxy/appsettings.json b/src/Ubik.YarpProxy/appsettings.json index 531adbdd..f1260a15 100644 --- a/src/Ubik.YarpProxy/appsettings.json +++ b/src/Ubik.YarpProxy/appsettings.json @@ -25,7 +25,7 @@ "AllowedHosts": "*", "ReverseProxy": { "Swagger": { - "IsCommonDocument": true, + "IsCommonDocument": false, "CommonDocumentName": "ubik_app" }, "Routes": { diff --git a/tests/Ubik.Api.Tests.Integration/Features/Accounting/Transaction/Txs/TxsController_Test.cs b/tests/Ubik.Api.Tests.Integration/Features/Accounting/Transaction/Txs/TxsController_Test.cs index fcd360ad..32469359 100644 --- a/tests/Ubik.Api.Tests.Integration/Features/Accounting/Transaction/Txs/TxsController_Test.cs +++ b/tests/Ubik.Api.Tests.Integration/Features/Accounting/Transaction/Txs/TxsController_Test.cs @@ -67,14 +67,14 @@ public async Task Submit_Tx_WithRW_OK() //Act var response = await _client.PostAsJsonAsync($"{_baseUrlForV1}/txs/submit", command); - var result = await response.Content.ReadFromJsonAsync(); + var result = await response.Content.ReadFromJsonAsync(); //Assert response.StatusCode.Should().Be(HttpStatusCode.OK); result.Should() .NotBeNull() - .And.BeOfType() - .And.Match(x => x.Amount == command.Amount); + .And.BeOfType() + .And.Match(x => x.Amount == command.Amount); } [Fact] @@ -664,14 +664,14 @@ public async Task Submit_Tx_WithAllInfo_OK() //Act var response = await _client.PostAsJsonAsync($"{_baseUrlForV1}/txs/submit", command); - var result = await response.Content.ReadFromJsonAsync(); + var result = await response.Content.ReadFromJsonAsync(); //Assert response.StatusCode.Should().Be(HttpStatusCode.OK); result.Should() .NotBeNull() - .And.BeOfType() - .And.Match(x => x.Amount == command.Amount); + .And.BeOfType() + .And.Match(x => x.Amount == command.Amount); } [Fact] From a56614f19d856c3adceeb6750653055a19e201ca Mon Sep 17 00:00:00 2001 From: fdonnet Date: Wed, 13 Nov 2024 09:02:05 +0100 Subject: [PATCH 79/94] Some packages update --- .../Ubik.Accounting.SalesOrVatTax.Api.csproj | 6 +++--- .../Ubik.Accounting.Structure.Api.csproj | 6 +++--- .../Ubik.Accounting.Transaction.Api.csproj | 2 +- .../Ubik.ApiService.Common.csproj | 16 ++++++++-------- src/Ubik.Security.Api/Ubik.Security.Api.csproj | 2 +- .../Ubik.Api.Tests.Integration.csproj | 2 +- 6 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Ubik.Accounting.SalesOrVatTax.Api.csproj b/src/Ubik.Accounting.SalesOrVatTax.Api/Ubik.Accounting.SalesOrVatTax.Api.csproj index 7a79b5b6..78761c48 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Api/Ubik.Accounting.SalesOrVatTax.Api.csproj +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Ubik.Accounting.SalesOrVatTax.Api.csproj @@ -22,9 +22,9 @@ - - - + + + diff --git a/src/Ubik.Accounting.Structure.Api/Ubik.Accounting.Structure.Api.csproj b/src/Ubik.Accounting.Structure.Api/Ubik.Accounting.Structure.Api.csproj index aece3434..fcb64e45 100644 --- a/src/Ubik.Accounting.Structure.Api/Ubik.Accounting.Structure.Api.csproj +++ b/src/Ubik.Accounting.Structure.Api/Ubik.Accounting.Structure.Api.csproj @@ -26,8 +26,8 @@ - - + + @@ -40,7 +40,7 @@ - + diff --git a/src/Ubik.Accounting.Transaction.Api/Ubik.Accounting.Transaction.Api.csproj b/src/Ubik.Accounting.Transaction.Api/Ubik.Accounting.Transaction.Api.csproj index 82101bc8..c95c2edc 100644 --- a/src/Ubik.Accounting.Transaction.Api/Ubik.Accounting.Transaction.Api.csproj +++ b/src/Ubik.Accounting.Transaction.Api/Ubik.Accounting.Transaction.Api.csproj @@ -21,7 +21,7 @@ - + diff --git a/src/Ubik.ApiService.Common/Ubik.ApiService.Common.csproj b/src/Ubik.ApiService.Common/Ubik.ApiService.Common.csproj index 8b01a510..3cd9e884 100644 --- a/src/Ubik.ApiService.Common/Ubik.ApiService.Common.csproj +++ b/src/Ubik.ApiService.Common/Ubik.ApiService.Common.csproj @@ -9,20 +9,20 @@ - - + + - - - + + + - + - - + + diff --git a/src/Ubik.Security.Api/Ubik.Security.Api.csproj b/src/Ubik.Security.Api/Ubik.Security.Api.csproj index 8f98ea20..3a4d762e 100644 --- a/src/Ubik.Security.Api/Ubik.Security.Api.csproj +++ b/src/Ubik.Security.Api/Ubik.Security.Api.csproj @@ -42,7 +42,7 @@ - + diff --git a/tests/Ubik.Api.Tests.Integration/Ubik.Api.Tests.Integration.csproj b/tests/Ubik.Api.Tests.Integration/Ubik.Api.Tests.Integration.csproj index 344008de..68556c6c 100644 --- a/tests/Ubik.Api.Tests.Integration/Ubik.Api.Tests.Integration.csproj +++ b/tests/Ubik.Api.Tests.Integration/Ubik.Api.Tests.Integration.csproj @@ -20,7 +20,7 @@ - + From 76edc611c4ff2f59d78eed2cca3c97fa27173c17 Mon Sep 17 00:00:00 2001 From: fdonnet Date: Wed, 13 Nov 2024 09:20:03 +0100 Subject: [PATCH 80/94] Blazor not used thing --- src/Ubik.Accounting.WebApp/Program.cs | 5 +- .../Security/UserService.cs | 93 ++++++++++--------- 2 files changed, 50 insertions(+), 48 deletions(-) diff --git a/src/Ubik.Accounting.WebApp/Program.cs b/src/Ubik.Accounting.WebApp/Program.cs index 7302d89f..456e6d68 100644 --- a/src/Ubik.Accounting.WebApp/Program.cs +++ b/src/Ubik.Accounting.WebApp/Program.cs @@ -144,8 +144,9 @@ //User service with circuit builder.Services.AddScoped(); -builder.Services.TryAddEnumerable( - ServiceDescriptor.Scoped()); +//TODO:check I think this thing is never used +//builder.Services.TryAddEnumerable( +// ServiceDescriptor.Scoped()); builder.Services.AddHttpClient(); diff --git a/src/Ubik.Accounting.WebApp/Security/UserService.cs b/src/Ubik.Accounting.WebApp/Security/UserService.cs index 47e3d8bd..c7d8eed2 100644 --- a/src/Ubik.Accounting.WebApp/Security/UserService.cs +++ b/src/Ubik.Accounting.WebApp/Security/UserService.cs @@ -65,51 +65,52 @@ internal void SetUser(ClaimsPrincipal user) } } - internal sealed class UserCircuitHandler( - AuthenticationStateProvider authenticationStateProvider, - UserService userService) : CircuitHandler, IDisposable - { - private readonly AuthenticationStateProvider authenticationStateProvider = authenticationStateProvider; - private readonly UserService userService = userService; - - public override Task OnCircuitOpenedAsync(Circuit circuit, - CancellationToken cancellationToken) - { - authenticationStateProvider.AuthenticationStateChanged += - AuthenticationChanged; - - return base.OnCircuitOpenedAsync(circuit, cancellationToken); - } - - private void AuthenticationChanged(Task task) - { - _ = UpdateAuthentication(task); - - async Task UpdateAuthentication(Task task) - { - try - { - var state = await task; - userService.SetUser(state.User); - } - catch - { - } - } - } - - public override async Task OnConnectionUpAsync(Circuit circuit, - CancellationToken cancellationToken) - { - var state = await authenticationStateProvider.GetAuthenticationStateAsync(); - userService.SetUser(state.User); - } - - public void Dispose() - { - authenticationStateProvider.AuthenticationStateChanged -= - AuthenticationChanged; - } - } + //TODO:Check, I think this ting is never used + //internal sealed class UserCircuitHandler( + // AuthenticationStateProvider authenticationStateProvider, + // UserService userService) : CircuitHandler, IDisposable + //{ + // private readonly AuthenticationStateProvider authenticationStateProvider = authenticationStateProvider; + // private readonly UserService userService = userService; + + // public override Task OnCircuitOpenedAsync(Circuit circuit, + // CancellationToken cancellationToken) + // { + // authenticationStateProvider.AuthenticationStateChanged += + // AuthenticationChanged; + + // return base.OnCircuitOpenedAsync(circuit, cancellationToken); + // } + + // private void AuthenticationChanged(Task task) + // { + // _ = UpdateAuthentication(task); + + // async Task UpdateAuthentication(Task task) + // { + // try + // { + // var state = await task; + // userService.SetUser(state.User); + // } + // catch + // { + // } + // } + // } + + // public override async Task OnConnectionUpAsync(Circuit circuit, + // CancellationToken cancellationToken) + // { + // var state = await authenticationStateProvider.GetAuthenticationStateAsync(); + // userService.SetUser(state.User); + // } + + // public void Dispose() + // { + // authenticationStateProvider.AuthenticationStateChanged -= + // AuthenticationChanged; + // } + //} } } From 6c738152dc8cab0f37ec6c5c81b1b559e9a3f195 Mon Sep 17 00:00:00 2001 From: fdonnet Date: Wed, 13 Nov 2024 13:48:29 +0100 Subject: [PATCH 81/94] Ok Tx submit with state in the DB --- .../Dockerfile | 4 + .../Data/Config/TxConfiguration.cs | 13 ++ .../Dockerfile | 4 + .../Txs/Consumers/TxSubmittedConsumer.cs | 24 +++- .../Txs/Consumers/TxValidatedConsumer.cs | 9 +- .../Txs/Services/ITxCommandService.cs | 6 +- .../Features/Txs/Services/TxCommandService.cs | 72 +++++++--- .../Mappers/TxMappers.cs | 123 +++++------------- .../Models/Tx.cs | 2 + .../Models/TxStateInfo.cs | 10 ++ .../Txs/Commands/ChangeTxStateCommand.cs | 17 +++ .../Txs/Enums/TxState.cs | 14 ++ .../Txs/Events/TxAdded.cs | 47 ------- .../Txs/Events/TxSubmitted.cs | 10 ++ .../Txs/Events/TxTaxValidationRequestSent.cs | 14 ++ .../Txs/Events/TxValidated.cs | 30 +---- 16 files changed, 204 insertions(+), 195 deletions(-) create mode 100644 src/Ubik.Accounting.Transaction.Api/Models/TxStateInfo.cs create mode 100644 src/Ubik.Accounting.Transaction.Contracts/Txs/Commands/ChangeTxStateCommand.cs create mode 100644 src/Ubik.Accounting.Transaction.Contracts/Txs/Enums/TxState.cs delete mode 100644 src/Ubik.Accounting.Transaction.Contracts/Txs/Events/TxAdded.cs create mode 100644 src/Ubik.Accounting.Transaction.Contracts/Txs/Events/TxTaxValidationRequestSent.cs diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Dockerfile b/src/Ubik.Accounting.SalesOrVatTax.Api/Dockerfile index d224fff9..da1a3512 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Api/Dockerfile +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Dockerfile @@ -16,6 +16,10 @@ COPY ["src/Ubik.Accounting.SalesOrVatTax.Api/Ubik.Accounting.SalesOrVatTax.Api.c COPY ["src/Ubik.Accounting.SalesOrVatTax.Contracts/Ubik.Accounting.SalesOrVatTax.Contracts.csproj", "src/Ubik.Accounting.SalesOrVatTax.Contracts/"] COPY ["src/Ubik.ApiService.Common/Ubik.ApiService.Common.csproj", "src/Ubik.ApiService.Common/"] COPY ["src/Ubik.Db.Common/Ubik.DB.Common/Ubik.DB.Common.csproj", "src/Ubik.Db.Common/Ubik.DB.Common/"] +#COPY ["src/mycert.cer", "src/"] +#ADD ./src/mycert.cer /usr/local/share/ca-certificates/mycert.cer +#ADD ./src/mycert.cer /etc/ssl/certs/mycert.cer +#RUN chmod 644 /usr/local/share/ca-certificates/mycert.cer && update-ca-certificates RUN dotnet restore "./src/Ubik.Accounting.SalesOrVatTax.Api/Ubik.Accounting.SalesOrVatTax.Api.csproj" COPY . . WORKDIR "/src/Ubik.Accounting.SalesOrVatTax.Api" diff --git a/src/Ubik.Accounting.Transaction.Api/Data/Config/TxConfiguration.cs b/src/Ubik.Accounting.Transaction.Api/Data/Config/TxConfiguration.cs index 10933a1e..743f5ca9 100644 --- a/src/Ubik.Accounting.Transaction.Api/Data/Config/TxConfiguration.cs +++ b/src/Ubik.Accounting.Transaction.Api/Data/Config/TxConfiguration.cs @@ -21,6 +21,19 @@ public void Configure(EntityTypeBuilder builder) builder.Property(a => a.TenantId) .IsRequired(); + builder.OwnsOne(x => x.State, stateInfo => + { + stateInfo.Property(s => s.State) + .HasColumnName("state") + .HasConversion() + .IsRequired(); + stateInfo.Property(s => s.Reason) + .HasColumnName("state_reason") + .HasMaxLength(400); + + stateInfo.HasIndex(x => x.State); + }); + builder.HasIndex(x => x.TenantId); builder.HasIndex(x => x.ValueDate); diff --git a/src/Ubik.Accounting.Transaction.Api/Dockerfile b/src/Ubik.Accounting.Transaction.Api/Dockerfile index a0cdf8bc..cfafdebc 100644 --- a/src/Ubik.Accounting.Transaction.Api/Dockerfile +++ b/src/Ubik.Accounting.Transaction.Api/Dockerfile @@ -18,6 +18,10 @@ COPY ["src/Ubik.Accounting.Structure.Contracts/Ubik.Accounting.Structure.Contrac COPY ["src/Ubik.Accounting.Transaction.Contracts/Ubik.Accounting.Transaction.Contracts.csproj", "src/Ubik.Accounting.Transaction.Contracts/"] COPY ["src/Ubik.ApiService.Common/Ubik.ApiService.Common.csproj", "src/Ubik.ApiService.Common/"] COPY ["src/Ubik.Db.Common/Ubik.DB.Common/Ubik.DB.Common.csproj", "src/Ubik.Db.Common/Ubik.DB.Common/"] +#COPY ["src/mycert.cer", "src/"] +#ADD ./src/mycert.cer /usr/local/share/ca-certificates/mycert.cer +#ADD ./src/mycert.cer /etc/ssl/certs/mycert.cer +#RUN chmod 644 /usr/local/share/ca-certificates/mycert.cer && update-ca-certificates RUN dotnet restore "./src/Ubik.Accounting.Transaction.Api/Ubik.Accounting.Transaction.Api.csproj" COPY . . WORKDIR "/src/Ubik.Accounting.Transaction.Api" diff --git a/src/Ubik.Accounting.Transaction.Api/Features/Txs/Consumers/TxSubmittedConsumer.cs b/src/Ubik.Accounting.Transaction.Api/Features/Txs/Consumers/TxSubmittedConsumer.cs index 83e7d4a7..ccad73cf 100644 --- a/src/Ubik.Accounting.Transaction.Api/Features/Txs/Consumers/TxSubmittedConsumer.cs +++ b/src/Ubik.Accounting.Transaction.Api/Features/Txs/Consumers/TxSubmittedConsumer.cs @@ -1,6 +1,8 @@ using MassTransit; using Ubik.Accounting.Transaction.Api.Features.Txs.Services; using Ubik.Accounting.Transaction.Api.Mappers; +using Ubik.Accounting.Transaction.Contracts.Txs.Commands; +using Ubik.Accounting.Transaction.Contracts.Txs.Enums; using Ubik.Accounting.Transaction.Contracts.Txs.Events; namespace Ubik.Accounting.Transaction.Api.Features.Txs.Consumers @@ -10,16 +12,26 @@ public class TxSubmittedConsumer(ITxCommandService commandService) : IConsumer context) { var tx = context.Message; + var needTaxValidation = commandService.CheckIfTxNeedTaxValidation(tx); - if(commandService.CheckIfTxNeedTaxValidation(tx)) + //Need tax validation + if (needTaxValidation) + await commandService.SendTaxValidationRequest(tx); + + //Change state + var result =await commandService.ChangeTxStateAsync(new ChangeTxStateCommand { - //Publish tax validation request + TxId = tx.Id, + State = needTaxValidation + ? TxState.WaitingForTaxValidation + : TxState.Confirmed, - } - else + Version = tx.Version + }); + + if (result.IsLeft) { - //Publish validated event (tax validation skipped) - commandService.PublishValidated(tx.ToTxValidated()); + throw new Exception("Error while changing tx state"); } } } diff --git a/src/Ubik.Accounting.Transaction.Api/Features/Txs/Consumers/TxValidatedConsumer.cs b/src/Ubik.Accounting.Transaction.Api/Features/Txs/Consumers/TxValidatedConsumer.cs index 5605c159..3180d5c5 100644 --- a/src/Ubik.Accounting.Transaction.Api/Features/Txs/Consumers/TxValidatedConsumer.cs +++ b/src/Ubik.Accounting.Transaction.Api/Features/Txs/Consumers/TxValidatedConsumer.cs @@ -1,5 +1,7 @@ using MassTransit; using Ubik.Accounting.Transaction.Api.Features.Txs.Services; +using Ubik.Accounting.Transaction.Contracts.Txs.Commands; +using Ubik.Accounting.Transaction.Contracts.Txs.Enums; using Ubik.Accounting.Transaction.Contracts.Txs.Events; namespace Ubik.Accounting.Transaction.Api.Features.Txs.Consumers @@ -9,7 +11,12 @@ public class TxValidatedConsumer(ITxCommandService commandService) : IConsumer context) { var tx = context.Message; - await commandService.AddTxAsync(tx); + await commandService.ChangeTxStateAsync(new ChangeTxStateCommand + { + TxId = tx.Id, + State = TxState.Confirmed, + Version = tx.Version + }); } } } diff --git a/src/Ubik.Accounting.Transaction.Api/Features/Txs/Services/ITxCommandService.cs b/src/Ubik.Accounting.Transaction.Api/Features/Txs/Services/ITxCommandService.cs index 49c002ee..087a1b83 100644 --- a/src/Ubik.Accounting.Transaction.Api/Features/Txs/Services/ITxCommandService.cs +++ b/src/Ubik.Accounting.Transaction.Api/Features/Txs/Services/ITxCommandService.cs @@ -1,5 +1,7 @@ using LanguageExt; +using Ubik.Accounting.Transaction.Api.Models; using Ubik.Accounting.Transaction.Contracts.Txs.Commands; +using Ubik.Accounting.Transaction.Contracts.Txs.Enums; using Ubik.Accounting.Transaction.Contracts.Txs.Events; using Ubik.ApiService.Common.Errors; @@ -9,7 +11,7 @@ public interface ITxCommandService { public Task> SubmitTxAsync(SubmitTxCommand command); public bool CheckIfTxNeedTaxValidation(TxSubmitted tx); - public void PublishValidated(TxValidated tx); - public Task AddTxAsync(TxValidated tx); + public Task> ChangeTxStateAsync(ChangeTxStateCommand command); + public Task SendTaxValidationRequest(TxSubmitted tx); } } diff --git a/src/Ubik.Accounting.Transaction.Api/Features/Txs/Services/TxCommandService.cs b/src/Ubik.Accounting.Transaction.Api/Features/Txs/Services/TxCommandService.cs index 4e9c4472..6b395aa1 100644 --- a/src/Ubik.Accounting.Transaction.Api/Features/Txs/Services/TxCommandService.cs +++ b/src/Ubik.Accounting.Transaction.Api/Features/Txs/Services/TxCommandService.cs @@ -10,6 +10,8 @@ using Ubik.Accounting.Transaction.Contracts.Entries.Enums; using Ubik.Accounting.Transaction.Api.Models; using Ubik.ApiService.Common.Services; +using Ubik.ApiService.Common.Configure; +using Ubik.Accounting.Transaction.Contracts.Txs.Enums; namespace Ubik.Accounting.Transaction.Api.Features.Txs.Services { @@ -17,7 +19,7 @@ namespace Ubik.Accounting.Transaction.Api.Features.Txs.Services //with all the details for each error, the user needs to receive ONE error payload. //or maybe not... return when 1 error or test for all errors... public class TxCommandService(AccountingTxContext ctx - , IPublishEndpoint publishEndpoint, ICurrentUser currentUser) : ITxCommandService + , IPublishEndpoint publishEndpoint) : ITxCommandService { public async Task> SubmitTxAsync(SubmitTxCommand command) { @@ -26,27 +28,68 @@ public async Task> SubmitTxAsync(SubmitTxComm .BindAsync(ValidateEntriesInfoAsync) //Exchange rates, amounts and currencies .BindAsync(ValidateEntriesAccountsAsync) .BindAsync(ValidateEntriesTaxRatesInfoAsync) - .BindAsync(PublishSubmittedAsync); + .BindAsync(AddSubmittedTxInDbContextAsync) + .BindAsync(SaveAndPublishSubmittedAsync); } + public async Task> ChangeTxStateAsync(ChangeTxStateCommand command) + { + return await GetTxAsync(command.TxId) + .BindAsync(t => ChangeTxStateInDbContextAsync(t, new TxStateInfo + { + State = command.State, + Reason = command.Reason + } )) + .BindAsync(SaveNewTxStateAsync); + } + + public async Task SendTaxValidationRequest(TxSubmitted tx) + { + await publishEndpoint.Publish(new TxTaxValidationRequestSent + { + Id = tx.Id, + Tx = tx + }, CancellationToken.None); + } public bool CheckIfTxNeedTaxValidation(TxSubmitted tx) { return tx.Entries.Any(e => e.TaxInfo != null); } - public void PublishValidated(TxValidated tx) + private async Task> SaveNewTxStateAsync(Tx tx) { - publishEndpoint.Publish(tx, CancellationToken.None); + await ctx.SaveChangesAsync(); + return tx; } + private async Task> GetTxAsync(Guid id) + { + var result = await ctx.Txs.FindAsync(id); - public async Task AddTxAsync(TxValidated tx) + if (result == null) + return new ResourceNotFoundError("Tx", "Id", id.ToString()); + else + return result; + } + + private async Task> ChangeTxStateInDbContextAsync(Tx current, TxStateInfo newState) + { + current.State = newState; + ctx.Entry(current).State = EntityState.Modified; + + ctx.SetAuditAndSpecialFields(); + + await Task.CompletedTask; + return current; + } + + private async Task> AddSubmittedTxInDbContextAsync(SubmitTxCommand command) { - var newTx = tx.ToTx(); + var newTx = command.ToTx(); ctx.Txs.Add(newTx); - var txEntries = tx.Entries.Select(e => e.ToEntry(newTx.Id)); + var txEntries = command.Entries.Select(e => e.ToEntry(newTx.Id)); foreach (var entry in txEntries) { @@ -55,21 +98,18 @@ public async Task AddTxAsync(TxValidated tx) ctx.SetAuditAndSpecialFields(); - var addedTx = newTx.ToTxAdded(txEntries); + var submittedTx = newTx.ToTxSubmitted(txEntries); - await publishEndpoint.Publish(addedTx, CancellationToken.None); - await ctx.SaveChangesAsync(); - return addedTx; + await Task.CompletedTask; + return submittedTx; } - private async Task> PublishSubmittedAsync(SubmitTxCommand current) + private async Task> SaveAndPublishSubmittedAsync(TxSubmitted current) { - //Publish that a tx has been submitted and checked for the ez validation - var submited = current.ToTxSubmitted(); - await publishEndpoint.Publish(submited, CancellationToken.None); + await publishEndpoint.Publish(current, CancellationToken.None); await ctx.SaveChangesAsync(); - return submited; + return current; } private static async Task> ValidateOnlyOneMainEntryAsync(SubmitTxCommand tx) diff --git a/src/Ubik.Accounting.Transaction.Api/Mappers/TxMappers.cs b/src/Ubik.Accounting.Transaction.Api/Mappers/TxMappers.cs index 42c04360..50d705ac 100644 --- a/src/Ubik.Accounting.Transaction.Api/Mappers/TxMappers.cs +++ b/src/Ubik.Accounting.Transaction.Api/Mappers/TxMappers.cs @@ -1,7 +1,9 @@ using LanguageExt; using MassTransit; +using MassTransit.Caching.Internals; using Ubik.Accounting.Transaction.Api.Models; using Ubik.Accounting.Transaction.Contracts.Txs.Commands; +using Ubik.Accounting.Transaction.Contracts.Txs.Enums; using Ubik.Accounting.Transaction.Contracts.Txs.Events; using Ubik.DB.Common.Models; @@ -10,14 +12,16 @@ namespace Ubik.Accounting.Transaction.Api.Mappers public static class TxMappers { - public static TxSubmitted ToTxSubmitted(this SubmitTxCommand current) + public static TxSubmitted ToTxSubmitted(this Tx current, IEnumerable entries) { return new TxSubmitted { - Id = NewId.NextGuid(), + Id = current.Id, ValueDate = current.ValueDate, Amount = current.Amount, - Entries = current.Entries.Select(x => x.ToTxEntrySubmitted()), + Entries = entries.Select(e => e.ToTxEntrySubmitted()), + Version = current.Version, + State = current.State.ToTxTxStateInfoSubmitted() }; } @@ -25,73 +29,49 @@ public static TxValidated ToTxValidated(this TxSubmitted current) { return new TxValidated { - Id = NewId.NextGuid(), - ValueDate = current.ValueDate, - Amount = current.Amount, - Entries = current.Entries.Select(x => x.ToTxEntryValidated()), + Id = current.Id, + Version = current.Version }; } - public static Tx ToTx(this TxValidated current) + public static Tx ToTx(this SubmitTxCommand current) { var now = DateTime.UtcNow; return new Tx { - Id = current.Id, - ValueDate = current.ValueDate, - Amount = current.Amount, - }; - } - - public static TxAdded ToTxAdded(this Tx current, IEnumerable entries) - { - return new TxAdded - { - Id = current.Id, + Id = NewId.NextGuid(), ValueDate = current.ValueDate, Amount = current.Amount, - Entries = entries.Select(x=>x.ToTxEntryAdded()), - Version = current.Version + State = new TxStateInfo + { + State = TxState.Submitted, + Reason = null + } }; } - public static TxEntrySubmitted ToTxEntrySubmitted(this SubmitTxEntry current) + public static TxEntrySubmitted ToTxEntrySubmitted(this Entry current) { return new TxEntrySubmitted { - Id = NewId.NextGuid(), + Id = current.Id, Description = current.Description, AccountId = current.AccountId, Amount = current.Amount, AmountAdditionnalInfo = current.AmountAdditionnalInfo?.ToTxEntryAdditionalAmountInfoSubmitted(), Label = current.Label, Sign = current.Sign, + Version = current.Version, TaxInfo = current.TaxInfo?.ToTxEntryTaxInfoSubmitted(), Type = current.Type }; } - public static TxEntryValidated ToTxEntryValidated(this TxEntrySubmitted current) - { - return new TxEntryValidated - { - Id = NewId.NextGuid(), - Description = current.Description, - AccountId = current.AccountId, - Amount = current.Amount, - AmountAdditionnalInfo = current.AmountAdditionnalInfo?.ToTxEntryAdditionalAmountInfoValidated(), - Label = current.Label, - Sign = current.Sign, - TaxInfo = current.TaxInfo?.ToTxEntryTaxInfoValidated(), - Type = current.Type - }; - } - - public static Entry ToEntry(this TxEntryValidated current, Guid txId) + public static Entry ToEntry(this SubmitTxEntry current, Guid txId) { return new Entry { - Id = current.Id, + Id = NewId.NextGuid(), Description = current.Description, AccountId = current.AccountId, Amount = current.Amount, @@ -104,24 +84,7 @@ public static Entry ToEntry(this TxEntryValidated current, Guid txId) }; } - public static TxEntryAdded ToTxEntryAdded(this Entry current) - { - return new TxEntryAdded - { - Id = current.Id, - Description = current.Description, - AccountId = current.AccountId, - Amount = current.Amount, - AmountAdditionnalInfo = current.AmountAdditionnalInfo?.ToTxEntryAdditionalAmountInfoAdded(), - Label = current.Label, - Sign = current.Sign, - TaxInfo = current.TaxInfo?.ToTxEntryTaxInfoAdded(), - Type = current.Type, - Version = current.Version, - }; - } - - public static TxEntryAdditionalAmountInfoSubmitted ToTxEntryAdditionalAmountInfoSubmitted(this SubmitTxEntryAdditionalAmountInfo current) + public static TxEntryAdditionalAmountInfoSubmitted ToTxEntryAdditionalAmountInfoSubmitted(this AmountAdditionalInfo current) { return new TxEntryAdditionalAmountInfoSubmitted { @@ -131,32 +94,12 @@ public static TxEntryAdditionalAmountInfoSubmitted ToTxEntryAdditionalAmountInfo }; } - public static TxEntryAdditionalAmountInfoValidated ToTxEntryAdditionalAmountInfoValidated(this TxEntryAdditionalAmountInfoSubmitted current) - { - return new TxEntryAdditionalAmountInfoValidated - { - ExchangeRate = current.ExchangeRate, - OriginalAmount = current.OriginalAmount, - OriginalCurrencyId = current.OriginalCurrencyId - }; - } - - public static AmountAdditionalInfo ToAmountAdditionnalInfo(this TxEntryAdditionalAmountInfoValidated current) + public static AmountAdditionalInfo ToAmountAdditionnalInfo(this SubmitTxEntryAdditionalAmountInfo current) { return new AmountAdditionalInfo(current.OriginalAmount, current.OriginalCurrencyId, current.ExchangeRate); } - public static TxEntryAdditionalAmountInfoAdded ToTxEntryAdditionalAmountInfoAdded(this AmountAdditionalInfo current) - { - return new TxEntryAdditionalAmountInfoAdded - { - ExchangeRate = current.ExchangeRate, - OriginalAmount = current.OriginalAmount, - OriginalCurrencyId = current.OriginalCurrencyId, - }; - } - - public static TxEntryTaxInfoSubmitted ToTxEntryTaxInfoSubmitted(this SubmitTxEntryTaxInfo current) + public static TxEntryTaxInfoSubmitted ToTxEntryTaxInfoSubmitted(this TaxInfo current) { return new TxEntryTaxInfoSubmitted { @@ -165,27 +108,19 @@ public static TxEntryTaxInfoSubmitted ToTxEntryTaxInfoSubmitted(this SubmitTxEnt }; } - public static TxEntryTaxInfoValidated ToTxEntryTaxInfoValidated(this TxEntryTaxInfoSubmitted current) + public static TxStateInfoSubmitted ToTxTxStateInfoSubmitted(this TxStateInfo current) { - return new TxEntryTaxInfoValidated + return new TxStateInfoSubmitted { - TaxAppliedRate = current.TaxAppliedRate, - TaxRateId = current.TaxRateId + State = current.State, + Reason = current.Reason }; } - public static TaxInfo ToTaxInfo(this TxEntryTaxInfoValidated current) + public static TaxInfo ToTaxInfo(this SubmitTxEntryTaxInfo current) { return new TaxInfo(current.TaxAppliedRate, current.TaxRateId); } - public static TxEntryTaxInfoAdded ToTxEntryTaxInfoAdded(this TaxInfo current) - { - return new TxEntryTaxInfoAdded - { - TaxAppliedRate = current.TaxAppliedRate, - TaxRateId = current.TaxRateId - }; - } } } diff --git a/src/Ubik.Accounting.Transaction.Api/Models/Tx.cs b/src/Ubik.Accounting.Transaction.Api/Models/Tx.cs index 5c07090d..5f1ac51f 100644 --- a/src/Ubik.Accounting.Transaction.Api/Models/Tx.cs +++ b/src/Ubik.Accounting.Transaction.Api/Models/Tx.cs @@ -1,4 +1,5 @@ using MassTransit; +using Ubik.Accounting.Transaction.Contracts.Txs.Enums; using Ubik.DB.Common; using Ubik.DB.Common.Models; @@ -7,6 +8,7 @@ namespace Ubik.Accounting.Transaction.Api.Models public class Tx : ITenantEntity, IConcurrencyCheckEntity, IAuditEntity { public Guid Id { get; set; } + public TxStateInfo State { get; set; } = default!; public required DateOnly ValueDate { get; set; } public decimal Amount { get; set; } public Guid Version { get; set; } diff --git a/src/Ubik.Accounting.Transaction.Api/Models/TxStateInfo.cs b/src/Ubik.Accounting.Transaction.Api/Models/TxStateInfo.cs new file mode 100644 index 00000000..15b80eac --- /dev/null +++ b/src/Ubik.Accounting.Transaction.Api/Models/TxStateInfo.cs @@ -0,0 +1,10 @@ +using Ubik.Accounting.Transaction.Contracts.Txs.Enums; + +namespace Ubik.Accounting.Transaction.Api.Models +{ + public class TxStateInfo + { + public TxState State { get; set; } + public string? Reason { get; set; } + } +} diff --git a/src/Ubik.Accounting.Transaction.Contracts/Txs/Commands/ChangeTxStateCommand.cs b/src/Ubik.Accounting.Transaction.Contracts/Txs/Commands/ChangeTxStateCommand.cs new file mode 100644 index 00000000..8a8b7ec3 --- /dev/null +++ b/src/Ubik.Accounting.Transaction.Contracts/Txs/Commands/ChangeTxStateCommand.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Ubik.Accounting.Transaction.Contracts.Txs.Enums; + +namespace Ubik.Accounting.Transaction.Contracts.Txs.Commands +{ + public record ChangeTxStateCommand + { + public Guid TxId { get; init; } + public Guid Version { get; init; } + public TxState State { get; init; } + public string? Reason { get; init; } + } +} diff --git a/src/Ubik.Accounting.Transaction.Contracts/Txs/Enums/TxState.cs b/src/Ubik.Accounting.Transaction.Contracts/Txs/Enums/TxState.cs new file mode 100644 index 00000000..0713576c --- /dev/null +++ b/src/Ubik.Accounting.Transaction.Contracts/Txs/Enums/TxState.cs @@ -0,0 +1,14 @@ +using System.Text.Json.Serialization; + +namespace Ubik.Accounting.Transaction.Contracts.Txs.Enums +{ + [JsonConverter(typeof(JsonStringEnumConverter))] + public enum TxState + { + Submitted, + WaitingForTaxValidation, + TaxValidated, + Confirmed, + Rejected + } +} diff --git a/src/Ubik.Accounting.Transaction.Contracts/Txs/Events/TxAdded.cs b/src/Ubik.Accounting.Transaction.Contracts/Txs/Events/TxAdded.cs deleted file mode 100644 index 0b4c0cd9..00000000 --- a/src/Ubik.Accounting.Transaction.Contracts/Txs/Events/TxAdded.cs +++ /dev/null @@ -1,47 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Ubik.Accounting.Transaction.Contracts.Entries.Enums; - -namespace Ubik.Accounting.Transaction.Contracts.Txs.Events -{ - public record class TxAdded - { - public required Guid Id { get; init; } - public required DateOnly ValueDate { get; init; } - public required decimal Amount { get; init; } - public IEnumerable Entries { get; init; } = default!; - public Guid Version { get; set; } - public Guid TenantId { get; set; } - } - - public record TxEntryAdded - { - public required Guid Id { get; init; } - public required EntryType Type { get; init; } - public required DebitCredit Sign { get; init; } - public required Guid AccountId { get; init; } - public string? Label { get; init; } - public string? Description { get; init; } - public required decimal Amount { get; init; } - public TxEntryAdditionalAmountInfoAdded? AmountAdditionnalInfo { get; init; } - public TxEntryTaxInfoAdded? TaxInfo { get; init; } = default!; - public Guid Version { get; set; } - public Guid TenantId { get; set; } - } - - public record TxEntryAdditionalAmountInfoAdded - { - public required decimal OriginalAmount { get; init; } - public required Guid OriginalCurrencyId { get; init; } - public decimal ExchangeRate { get; init; } - } - - public record TxEntryTaxInfoAdded - { - public required decimal TaxAppliedRate { get; init; } - public required Guid TaxRateId { get; init; } - } -} diff --git a/src/Ubik.Accounting.Transaction.Contracts/Txs/Events/TxSubmitted.cs b/src/Ubik.Accounting.Transaction.Contracts/Txs/Events/TxSubmitted.cs index 1b93fc6e..0bcc7160 100644 --- a/src/Ubik.Accounting.Transaction.Contracts/Txs/Events/TxSubmitted.cs +++ b/src/Ubik.Accounting.Transaction.Contracts/Txs/Events/TxSubmitted.cs @@ -1,13 +1,16 @@ using Ubik.Accounting.Transaction.Contracts.Entries.Enums; +using Ubik.Accounting.Transaction.Contracts.Txs.Enums; namespace Ubik.Accounting.Transaction.Contracts.Txs.Events { public record class TxSubmitted { public required Guid Id { get; init; } + public required TxStateInfoSubmitted State { get; init; } public required DateOnly ValueDate { get; init; } public required decimal Amount { get; init; } public IEnumerable Entries { get; init; } = default!; + public required Guid Version { get; init; } } public record TxEntrySubmitted @@ -21,6 +24,7 @@ public record TxEntrySubmitted public required decimal Amount { get; init; } public TxEntryAdditionalAmountInfoSubmitted? AmountAdditionnalInfo { get; init; } public TxEntryTaxInfoSubmitted? TaxInfo { get; init; } = default!; + public required Guid Version { get; init; } } public record TxEntryAdditionalAmountInfoSubmitted @@ -35,4 +39,10 @@ public record TxEntryTaxInfoSubmitted public required decimal TaxAppliedRate { get; init; } public required Guid TaxRateId { get; init; } } + + public record TxStateInfoSubmitted + { + public required TxState State { get; init; } + public string? Reason { get; init; } + } } diff --git a/src/Ubik.Accounting.Transaction.Contracts/Txs/Events/TxTaxValidationRequestSent.cs b/src/Ubik.Accounting.Transaction.Contracts/Txs/Events/TxTaxValidationRequestSent.cs new file mode 100644 index 00000000..f0afff23 --- /dev/null +++ b/src/Ubik.Accounting.Transaction.Contracts/Txs/Events/TxTaxValidationRequestSent.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Ubik.Accounting.Transaction.Contracts.Txs.Events +{ + public record TxTaxValidationRequestSent + { + public required Guid Id { get; init; } + public required TxSubmitted Tx { get; init; } + } +} diff --git a/src/Ubik.Accounting.Transaction.Contracts/Txs/Events/TxValidated.cs b/src/Ubik.Accounting.Transaction.Contracts/Txs/Events/TxValidated.cs index 12fc4e1b..6495ece5 100644 --- a/src/Ubik.Accounting.Transaction.Contracts/Txs/Events/TxValidated.cs +++ b/src/Ubik.Accounting.Transaction.Contracts/Txs/Events/TxValidated.cs @@ -5,34 +5,6 @@ namespace Ubik.Accounting.Transaction.Contracts.Txs.Events public record class TxValidated { public required Guid Id { get; init; } - public required DateOnly ValueDate { get; init; } - public required decimal Amount { get; init; } - public IEnumerable Entries { get; init; } = default!; - } - - public record TxEntryValidated - { - public required Guid Id { get; init; } - public required EntryType Type { get; init; } - public required DebitCredit Sign { get; init; } - public required Guid AccountId { get; init; } - public string? Label { get; init; } - public string? Description { get; init; } - public required decimal Amount { get; init; } - public TxEntryAdditionalAmountInfoValidated? AmountAdditionnalInfo { get; init; } - public TxEntryTaxInfoValidated? TaxInfo { get; init; } = default!; - } - - public record TxEntryAdditionalAmountInfoValidated - { - public required decimal OriginalAmount { get; init; } - public required Guid OriginalCurrencyId { get; init; } - public decimal ExchangeRate { get; init; } - } - - public record TxEntryTaxInfoValidated - { - public required decimal TaxAppliedRate { get; init; } - public required Guid TaxRateId { get; init; } + public required Guid Version { get; init; } } } From d5ebfe4d66b55b68de0a5d40c72e3034ea5423d4 Mon Sep 17 00:00:00 2001 From: fdonnet Date: Wed, 13 Nov 2024 14:09:44 +0100 Subject: [PATCH 82/94] Fake consumer for tax validation --- .../Consumers/ValidationRequestConsumer.cs | 34 +++++++++++++++++++ .../Ubik.Accounting.SalesOrVatTax.Api.csproj | 1 + .../Txs/Events/TxRejected.cs | 15 ++++++++ 3 files changed, 50 insertions(+) create mode 100644 src/Ubik.Accounting.SalesOrVatTax.Api/Features/Txs/Consumers/ValidationRequestConsumer.cs create mode 100644 src/Ubik.Accounting.Transaction.Contracts/Txs/Events/TxRejected.cs diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Features/Txs/Consumers/ValidationRequestConsumer.cs b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/Txs/Consumers/ValidationRequestConsumer.cs new file mode 100644 index 00000000..e92a4f81 --- /dev/null +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/Txs/Consumers/ValidationRequestConsumer.cs @@ -0,0 +1,34 @@ +using MassTransit; +using Ubik.Accounting.Transaction.Contracts.Txs.Events; + +namespace Ubik.Accounting.SalesOrVatTax.Api.Features.Txs.Consumers +{ + public class ValidationRequestConsumer(IPublishEndpoint publishEndpoint) : IConsumer + { + //TODO: Publish and validation need to be put in a service + public async Task Consume(ConsumeContext context) + { + var tx = context.Message.Tx; + var random = new Random(); + var i = random.Next(2); + + if(i == 0) + { + await publishEndpoint.Publish(new TxValidated + { + Id = tx.Id, + Version = tx.Version + }); + } + else + { + await publishEndpoint.Publish(new TxRejected + { + Id = tx.Id, + Version = tx.Version, + Reason = "Random rejection" + }); + } + } + } +} diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Ubik.Accounting.SalesOrVatTax.Api.csproj b/src/Ubik.Accounting.SalesOrVatTax.Api/Ubik.Accounting.SalesOrVatTax.Api.csproj index 78761c48..2f531ded 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Api/Ubik.Accounting.SalesOrVatTax.Api.csproj +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Ubik.Accounting.SalesOrVatTax.Api.csproj @@ -30,6 +30,7 @@ + diff --git a/src/Ubik.Accounting.Transaction.Contracts/Txs/Events/TxRejected.cs b/src/Ubik.Accounting.Transaction.Contracts/Txs/Events/TxRejected.cs new file mode 100644 index 00000000..15e5c34c --- /dev/null +++ b/src/Ubik.Accounting.Transaction.Contracts/Txs/Events/TxRejected.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Ubik.Accounting.Transaction.Contracts.Txs.Events +{ + public class TxRejected + { + public required Guid Id { get; init; } + public required Guid Version { get; init; } + public required string Reason { get; init; } + } +} From 17490c24b5935f1f0c072e3b3669b327eca945ed Mon Sep 17 00:00:00 2001 From: fdonnet Date: Wed, 13 Nov 2024 14:25:02 +0100 Subject: [PATCH 83/94] Publish the state of a TX for other components... --- .../Txs/Consumers/TxRejectedConsumer.cs | 23 +++++++++++++++++++ .../Features/Txs/Services/TxCommandService.cs | 11 +++++++-- .../Txs/Events/TxStateChanged.cs | 16 +++++++++++++ 3 files changed, 48 insertions(+), 2 deletions(-) create mode 100644 src/Ubik.Accounting.Transaction.Api/Features/Txs/Consumers/TxRejectedConsumer.cs create mode 100644 src/Ubik.Accounting.Transaction.Contracts/Txs/Events/TxStateChanged.cs diff --git a/src/Ubik.Accounting.Transaction.Api/Features/Txs/Consumers/TxRejectedConsumer.cs b/src/Ubik.Accounting.Transaction.Api/Features/Txs/Consumers/TxRejectedConsumer.cs new file mode 100644 index 00000000..0d5a39da --- /dev/null +++ b/src/Ubik.Accounting.Transaction.Api/Features/Txs/Consumers/TxRejectedConsumer.cs @@ -0,0 +1,23 @@ +using MassTransit; +using Ubik.Accounting.Transaction.Api.Features.Txs.Services; +using Ubik.Accounting.Transaction.Contracts.Txs.Commands; +using Ubik.Accounting.Transaction.Contracts.Txs.Enums; +using Ubik.Accounting.Transaction.Contracts.Txs.Events; + +namespace Ubik.Accounting.Transaction.Api.Features.Txs.Consumers +{ + public class TxRejectedConsumer(ITxCommandService commandService) : IConsumer + { + public async Task Consume(ConsumeContext context) + { + var tx = context.Message; + await commandService.ChangeTxStateAsync(new ChangeTxStateCommand + { + TxId = tx.Id, + State = TxState.Confirmed, + Version = tx.Version, + Reason = tx.Reason + }); + } + } +} diff --git a/src/Ubik.Accounting.Transaction.Api/Features/Txs/Services/TxCommandService.cs b/src/Ubik.Accounting.Transaction.Api/Features/Txs/Services/TxCommandService.cs index 6b395aa1..1abe6bd2 100644 --- a/src/Ubik.Accounting.Transaction.Api/Features/Txs/Services/TxCommandService.cs +++ b/src/Ubik.Accounting.Transaction.Api/Features/Txs/Services/TxCommandService.cs @@ -40,7 +40,7 @@ public async Task> ChangeTxStateAsync(ChangeTxStateCom State = command.State, Reason = command.Reason } )) - .BindAsync(SaveNewTxStateAsync); + .BindAsync(SaveAndPublishNewTxStateAsync); } public async Task SendTaxValidationRequest(TxSubmitted tx) @@ -57,8 +57,15 @@ public bool CheckIfTxNeedTaxValidation(TxSubmitted tx) return tx.Entries.Any(e => e.TaxInfo != null); } - private async Task> SaveNewTxStateAsync(Tx tx) + private async Task> SaveAndPublishNewTxStateAsync(Tx tx) { + await publishEndpoint.Publish(new TxStateChanged + { + TxId = tx.Id, + State = tx.State.State, + Reason = tx.State.Reason + }, CancellationToken.None); + await ctx.SaveChangesAsync(); return tx; } diff --git a/src/Ubik.Accounting.Transaction.Contracts/Txs/Events/TxStateChanged.cs b/src/Ubik.Accounting.Transaction.Contracts/Txs/Events/TxStateChanged.cs new file mode 100644 index 00000000..894f58cf --- /dev/null +++ b/src/Ubik.Accounting.Transaction.Contracts/Txs/Events/TxStateChanged.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Ubik.Accounting.Transaction.Contracts.Txs.Enums; + +namespace Ubik.Accounting.Transaction.Contracts.Txs.Events +{ + public record TxStateChanged + { + public Guid TxId { get; init; } + public TxState State { get; init; } + public string? Reason { get; init; } + } +} From e468758950f05bfeee7797c67a7704390c2e3a0f Mon Sep 17 00:00:00 2001 From: fdonnet Date: Wed, 13 Nov 2024 17:21:20 +0100 Subject: [PATCH 84/94] Not working masstransit state serialization, very strange.... --- .../Txs/Consumers/TxRejectedConsumer.cs | 7 ++++- .../Txs/Consumers/TxSubmittedConsumer.cs | 29 ++++++++++--------- .../Txs/Consumers/TxValidatedConsumer.cs | 7 ++++- .../Txs/Services/ITxCommandService.cs | 1 + .../Features/Txs/Services/TxCommandService.cs | 10 +++++++ .../Ubik.Accounting.Transaction.Api.csproj | 2 +- 6 files changed, 39 insertions(+), 17 deletions(-) diff --git a/src/Ubik.Accounting.Transaction.Api/Features/Txs/Consumers/TxRejectedConsumer.cs b/src/Ubik.Accounting.Transaction.Api/Features/Txs/Consumers/TxRejectedConsumer.cs index 0d5a39da..0a3d04ba 100644 --- a/src/Ubik.Accounting.Transaction.Api/Features/Txs/Consumers/TxRejectedConsumer.cs +++ b/src/Ubik.Accounting.Transaction.Api/Features/Txs/Consumers/TxRejectedConsumer.cs @@ -11,13 +11,18 @@ public class TxRejectedConsumer(ITxCommandService commandService) : IConsumer context) { var tx = context.Message; - await commandService.ChangeTxStateAsync(new ChangeTxStateCommand + var result = await commandService.ChangeTxStateAsync(new ChangeTxStateCommand { TxId = tx.Id, State = TxState.Confirmed, Version = tx.Version, Reason = tx.Reason }); + + if (result.IsLeft) + { + throw new Exception("Error while changing tx state"); + } } } } diff --git a/src/Ubik.Accounting.Transaction.Api/Features/Txs/Consumers/TxSubmittedConsumer.cs b/src/Ubik.Accounting.Transaction.Api/Features/Txs/Consumers/TxSubmittedConsumer.cs index ccad73cf..4fe18050 100644 --- a/src/Ubik.Accounting.Transaction.Api/Features/Txs/Consumers/TxSubmittedConsumer.cs +++ b/src/Ubik.Accounting.Transaction.Api/Features/Txs/Consumers/TxSubmittedConsumer.cs @@ -14,25 +14,26 @@ public async Task Consume(ConsumeContext context) var tx = context.Message; var needTaxValidation = commandService.CheckIfTxNeedTaxValidation(tx); - //Need tax validation if (needTaxValidation) - await commandService.SendTaxValidationRequest(tx); - - //Change state - var result =await commandService.ChangeTxStateAsync(new ChangeTxStateCommand { - TxId = tx.Id, - State = needTaxValidation - ? TxState.WaitingForTaxValidation - : TxState.Confirmed, + //Need tax validation + await commandService.SendTaxValidationRequest(tx); - Version = tx.Version - }); + var result = await commandService.ChangeTxStateAsync(new ChangeTxStateCommand + { + TxId = tx.Id, + State = TxState.WaitingForTaxValidation, + Version = tx.Version + }); - if (result.IsLeft) - { - throw new Exception("Error while changing tx state"); + if (result.IsLeft) + { + throw new Exception("Error while changing tx state"); + } } + else + // IsValidated + await commandService.SendTxValidated(tx); } } } diff --git a/src/Ubik.Accounting.Transaction.Api/Features/Txs/Consumers/TxValidatedConsumer.cs b/src/Ubik.Accounting.Transaction.Api/Features/Txs/Consumers/TxValidatedConsumer.cs index 3180d5c5..6b1c983b 100644 --- a/src/Ubik.Accounting.Transaction.Api/Features/Txs/Consumers/TxValidatedConsumer.cs +++ b/src/Ubik.Accounting.Transaction.Api/Features/Txs/Consumers/TxValidatedConsumer.cs @@ -11,12 +11,17 @@ public class TxValidatedConsumer(ITxCommandService commandService) : IConsumer context) { var tx = context.Message; - await commandService.ChangeTxStateAsync(new ChangeTxStateCommand + var result = await commandService.ChangeTxStateAsync(new ChangeTxStateCommand { TxId = tx.Id, State = TxState.Confirmed, Version = tx.Version }); + + if (result.IsLeft) + { + throw new Exception("Error while changing tx state"); + } } } } diff --git a/src/Ubik.Accounting.Transaction.Api/Features/Txs/Services/ITxCommandService.cs b/src/Ubik.Accounting.Transaction.Api/Features/Txs/Services/ITxCommandService.cs index 087a1b83..d9dc071d 100644 --- a/src/Ubik.Accounting.Transaction.Api/Features/Txs/Services/ITxCommandService.cs +++ b/src/Ubik.Accounting.Transaction.Api/Features/Txs/Services/ITxCommandService.cs @@ -13,5 +13,6 @@ public interface ITxCommandService public bool CheckIfTxNeedTaxValidation(TxSubmitted tx); public Task> ChangeTxStateAsync(ChangeTxStateCommand command); public Task SendTaxValidationRequest(TxSubmitted tx); + public Task SendTxValidated(TxSubmitted tx); } } diff --git a/src/Ubik.Accounting.Transaction.Api/Features/Txs/Services/TxCommandService.cs b/src/Ubik.Accounting.Transaction.Api/Features/Txs/Services/TxCommandService.cs index 1abe6bd2..b0c3df5b 100644 --- a/src/Ubik.Accounting.Transaction.Api/Features/Txs/Services/TxCommandService.cs +++ b/src/Ubik.Accounting.Transaction.Api/Features/Txs/Services/TxCommandService.cs @@ -52,6 +52,16 @@ await publishEndpoint.Publish(new TxTaxValidationRequestSent }, CancellationToken.None); } + + public async Task SendTxValidated(TxSubmitted tx) + { + await publishEndpoint.Publish(new TxValidated + { + Id = tx.Id, + Version = tx.Version + }, CancellationToken.None); + } + public bool CheckIfTxNeedTaxValidation(TxSubmitted tx) { return tx.Entries.Any(e => e.TaxInfo != null); diff --git a/src/Ubik.Accounting.Transaction.Api/Ubik.Accounting.Transaction.Api.csproj b/src/Ubik.Accounting.Transaction.Api/Ubik.Accounting.Transaction.Api.csproj index c95c2edc..91a50973 100644 --- a/src/Ubik.Accounting.Transaction.Api/Ubik.Accounting.Transaction.Api.csproj +++ b/src/Ubik.Accounting.Transaction.Api/Ubik.Accounting.Transaction.Api.csproj @@ -45,7 +45,7 @@ - + From 646f2cc8625c205fecefb219259d25c19c3f1403 Mon Sep 17 00:00:00 2001 From: fdonnet Date: Wed, 13 Nov 2024 17:34:03 +0100 Subject: [PATCH 85/94] Masstransit: strinjson Enum error.... --- src/Ubik.Accounting.Transaction.Api/Program.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Ubik.Accounting.Transaction.Api/Program.cs b/src/Ubik.Accounting.Transaction.Api/Program.cs index 510fb02f..45ef5cd6 100644 --- a/src/Ubik.Accounting.Transaction.Api/Program.cs +++ b/src/Ubik.Accounting.Transaction.Api/Program.cs @@ -50,6 +50,13 @@ h.Password(msgBrokerOptions.Password); }); + configurator.ConfigureJsonSerializerOptions(o => + { + o.Converters.Add(new JsonStringEnumConverter()); + return o; + }); + + configurator.ConfigureEndpoints(context); //TODO:review that Maybe not needed.... it was before I have the Yarp proxy... From cc95110167c1b0e7e9b671e0ceef1b4e9c29026a Mon Sep 17 00:00:00 2001 From: ubik Date: Wed, 13 Nov 2024 20:35:35 +0100 Subject: [PATCH 86/94] See why it's bugged on update but now the masstransit queue seems to react correctly to special enums serialization. --- .../Data/Config/TxConfiguration.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Ubik.Accounting.Transaction.Api/Data/Config/TxConfiguration.cs b/src/Ubik.Accounting.Transaction.Api/Data/Config/TxConfiguration.cs index 743f5ca9..825c3063 100644 --- a/src/Ubik.Accounting.Transaction.Api/Data/Config/TxConfiguration.cs +++ b/src/Ubik.Accounting.Transaction.Api/Data/Config/TxConfiguration.cs @@ -34,6 +34,9 @@ public void Configure(EntityTypeBuilder builder) stateInfo.HasIndex(x => x.State); }); + builder.Navigation(x => x.State) + .IsRequired(); + builder.HasIndex(x => x.TenantId); builder.HasIndex(x => x.ValueDate); From a9f12d8419e8e2cf38fb98dfe7d3215db59645a9 Mon Sep 17 00:00:00 2001 From: fdonnet Date: Thu, 14 Nov 2024 10:27:11 +0100 Subject: [PATCH 87/94] Correction bug for update --- .../Features/Txs/Services/TxCommandService.cs | 6 ++++-- src/Ubik.Accounting.Transaction.Api/Program.cs | 1 - .../Ubik.DB.Common/Extensions/ChangeTrackerExtensions.cs | 2 +- src/Ubik.Db.Common/Ubik.DB.Common/Models/AuditData.cs | 6 ------ 4 files changed, 5 insertions(+), 10 deletions(-) diff --git a/src/Ubik.Accounting.Transaction.Api/Features/Txs/Services/TxCommandService.cs b/src/Ubik.Accounting.Transaction.Api/Features/Txs/Services/TxCommandService.cs index b0c3df5b..8a16ffe7 100644 --- a/src/Ubik.Accounting.Transaction.Api/Features/Txs/Services/TxCommandService.cs +++ b/src/Ubik.Accounting.Transaction.Api/Features/Txs/Services/TxCommandService.cs @@ -93,7 +93,7 @@ private async Task> GetTxAsync(Guid id) private async Task> ChangeTxStateInDbContextAsync(Tx current, TxStateInfo newState) { current.State = newState; - ctx.Entry(current).State = EntityState.Modified; + ctx.Entry(current.State).State = EntityState.Modified; ctx.SetAuditAndSpecialFields(); @@ -108,14 +108,16 @@ private async Task> AddSubmittedTxInDbContext var txEntries = command.Entries.Select(e => e.ToEntry(newTx.Id)); + var newEntries = new List(); foreach (var entry in txEntries) { ctx.Entries.Add(entry); + newEntries.Add(entry); } ctx.SetAuditAndSpecialFields(); - var submittedTx = newTx.ToTxSubmitted(txEntries); + var submittedTx = newTx.ToTxSubmitted(newEntries); await Task.CompletedTask; return submittedTx; diff --git a/src/Ubik.Accounting.Transaction.Api/Program.cs b/src/Ubik.Accounting.Transaction.Api/Program.cs index 45ef5cd6..8a6db219 100644 --- a/src/Ubik.Accounting.Transaction.Api/Program.cs +++ b/src/Ubik.Accounting.Transaction.Api/Program.cs @@ -56,7 +56,6 @@ return o; }); - configurator.ConfigureEndpoints(context); //TODO:review that Maybe not needed.... it was before I have the Yarp proxy... diff --git a/src/Ubik.Db.Common/Ubik.DB.Common/Extensions/ChangeTrackerExtensions.cs b/src/Ubik.Db.Common/Ubik.DB.Common/Extensions/ChangeTrackerExtensions.cs index f365a512..3e95a54f 100644 --- a/src/Ubik.Db.Common/Ubik.DB.Common/Extensions/ChangeTrackerExtensions.cs +++ b/src/Ubik.Db.Common/Ubik.DB.Common/Extensions/ChangeTrackerExtensions.cs @@ -59,7 +59,7 @@ private static void SetAuditFields(IEnumerable entities, ICurrentUs entity.AuditInfo = new AuditData(timestamp, userId, timestamp, userId); break; case EntityState.Modified: - entity.AuditInfo.SetModified(timestamp, userId); + entity.AuditInfo = new AuditData(entity.AuditInfo.CreatedAt, entity.AuditInfo.CreatedBy, timestamp, userId); break; } } diff --git a/src/Ubik.Db.Common/Ubik.DB.Common/Models/AuditData.cs b/src/Ubik.Db.Common/Ubik.DB.Common/Models/AuditData.cs index 28f71bdb..87123f44 100644 --- a/src/Ubik.Db.Common/Ubik.DB.Common/Models/AuditData.cs +++ b/src/Ubik.Db.Common/Ubik.DB.Common/Models/AuditData.cs @@ -14,11 +14,5 @@ public AuditData(DateTime createdAt, Guid createdBy, DateTime modifiedAt, Guid m ModifiedAt = modifiedAt; ModifiedBy = modifiedBy; } - - public void SetModified(DateTime modifiedAt, Guid modifiedBy) - { - ModifiedAt = modifiedAt; - ModifiedBy = modifiedBy; - } } } From deefd3ff00f18af98a855422a7c71cbddee72342 Mon Sep 17 00:00:00 2001 From: fdonnet Date: Thu, 14 Nov 2024 13:47:25 +0100 Subject: [PATCH 88/94] Seems to work. --- src/Ubik.Accounting.Structure.Api/Program.cs | 6 ++++++ .../Features/Txs/Services/TxCommandService.cs | 4 +++- .../Mappers/TxMappers.cs | 10 ---------- .../Txs/Events/TxSubmitted.cs | 7 ------- 4 files changed, 9 insertions(+), 18 deletions(-) diff --git a/src/Ubik.Accounting.Structure.Api/Program.cs b/src/Ubik.Accounting.Structure.Api/Program.cs index 712e71ff..bf4d7d0c 100644 --- a/src/Ubik.Accounting.Structure.Api/Program.cs +++ b/src/Ubik.Accounting.Structure.Api/Program.cs @@ -67,6 +67,12 @@ public static async Task Main(string[] args) h.Password(msgBrokerOptions.Password); }); + configurator.ConfigureJsonSerializerOptions(o => + { + o.Converters.Add(new JsonStringEnumConverter()); + return o; + }); + configurator.ConfigureEndpoints(context); //TODO:review that diff --git a/src/Ubik.Accounting.Transaction.Api/Features/Txs/Services/TxCommandService.cs b/src/Ubik.Accounting.Transaction.Api/Features/Txs/Services/TxCommandService.cs index 8a16ffe7..c23da935 100644 --- a/src/Ubik.Accounting.Transaction.Api/Features/Txs/Services/TxCommandService.cs +++ b/src/Ubik.Accounting.Transaction.Api/Features/Txs/Services/TxCommandService.cs @@ -92,8 +92,10 @@ private async Task> GetTxAsync(Guid id) private async Task> ChangeTxStateInDbContextAsync(Tx current, TxStateInfo newState) { + ctx.Txs.Attach(current); + current.State = newState; - ctx.Entry(current.State).State = EntityState.Modified; + ctx.Entry(current).State = EntityState.Modified; ctx.SetAuditAndSpecialFields(); diff --git a/src/Ubik.Accounting.Transaction.Api/Mappers/TxMappers.cs b/src/Ubik.Accounting.Transaction.Api/Mappers/TxMappers.cs index 50d705ac..bca454e0 100644 --- a/src/Ubik.Accounting.Transaction.Api/Mappers/TxMappers.cs +++ b/src/Ubik.Accounting.Transaction.Api/Mappers/TxMappers.cs @@ -21,7 +21,6 @@ public static TxSubmitted ToTxSubmitted(this Tx current, IEnumerable entr Amount = current.Amount, Entries = entries.Select(e => e.ToTxEntrySubmitted()), Version = current.Version, - State = current.State.ToTxTxStateInfoSubmitted() }; } @@ -108,15 +107,6 @@ public static TxEntryTaxInfoSubmitted ToTxEntryTaxInfoSubmitted(this TaxInfo cur }; } - public static TxStateInfoSubmitted ToTxTxStateInfoSubmitted(this TxStateInfo current) - { - return new TxStateInfoSubmitted - { - State = current.State, - Reason = current.Reason - }; - } - public static TaxInfo ToTaxInfo(this SubmitTxEntryTaxInfo current) { return new TaxInfo(current.TaxAppliedRate, current.TaxRateId); diff --git a/src/Ubik.Accounting.Transaction.Contracts/Txs/Events/TxSubmitted.cs b/src/Ubik.Accounting.Transaction.Contracts/Txs/Events/TxSubmitted.cs index 0bcc7160..d079dbef 100644 --- a/src/Ubik.Accounting.Transaction.Contracts/Txs/Events/TxSubmitted.cs +++ b/src/Ubik.Accounting.Transaction.Contracts/Txs/Events/TxSubmitted.cs @@ -6,7 +6,6 @@ namespace Ubik.Accounting.Transaction.Contracts.Txs.Events public record class TxSubmitted { public required Guid Id { get; init; } - public required TxStateInfoSubmitted State { get; init; } public required DateOnly ValueDate { get; init; } public required decimal Amount { get; init; } public IEnumerable Entries { get; init; } = default!; @@ -39,10 +38,4 @@ public record TxEntryTaxInfoSubmitted public required decimal TaxAppliedRate { get; init; } public required Guid TaxRateId { get; init; } } - - public record TxStateInfoSubmitted - { - public required TxState State { get; init; } - public string? Reason { get; init; } - } } From cb3fd02e239a6b818bf764c56189480a5497f849 Mon Sep 17 00:00:00 2001 From: fdonnet Date: Thu, 14 Nov 2024 13:53:00 +0100 Subject: [PATCH 89/94] Seems to work good. --- .../Features/Txs/Consumers/ValidationRequestConsumer.cs | 2 +- .../Features/Txs/Consumers/TxRejectedConsumer.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Ubik.Accounting.SalesOrVatTax.Api/Features/Txs/Consumers/ValidationRequestConsumer.cs b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/Txs/Consumers/ValidationRequestConsumer.cs index e92a4f81..8e906c6e 100644 --- a/src/Ubik.Accounting.SalesOrVatTax.Api/Features/Txs/Consumers/ValidationRequestConsumer.cs +++ b/src/Ubik.Accounting.SalesOrVatTax.Api/Features/Txs/Consumers/ValidationRequestConsumer.cs @@ -26,7 +26,7 @@ await publishEndpoint.Publish(new TxRejected { Id = tx.Id, Version = tx.Version, - Reason = "Random rejection" + Reason = "Random tax rejection" }); } } diff --git a/src/Ubik.Accounting.Transaction.Api/Features/Txs/Consumers/TxRejectedConsumer.cs b/src/Ubik.Accounting.Transaction.Api/Features/Txs/Consumers/TxRejectedConsumer.cs index 0a3d04ba..64de57c6 100644 --- a/src/Ubik.Accounting.Transaction.Api/Features/Txs/Consumers/TxRejectedConsumer.cs +++ b/src/Ubik.Accounting.Transaction.Api/Features/Txs/Consumers/TxRejectedConsumer.cs @@ -14,7 +14,7 @@ public async Task Consume(ConsumeContext context) var result = await commandService.ChangeTxStateAsync(new ChangeTxStateCommand { TxId = tx.Id, - State = TxState.Confirmed, + State = TxState.Rejected, Version = tx.Version, Reason = tx.Reason }); From d2d23d22e6ef475c9cc0d28e070ee7e7cec72fd5 Mon Sep 17 00:00:00 2001 From: fdonnet Date: Thu, 14 Nov 2024 17:15:07 +0100 Subject: [PATCH 90/94] force ubik name as docker compose project --- docker-compose.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/docker-compose.yml b/docker-compose.yml index 0997dd2c..9f7a2c1e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,3 +1,4 @@ +name: ubik networks: ubik-network: driver: bridge From 95e6b53e5b2063b48e37cf336f528a99d123c528 Mon Sep 17 00:00:00 2001 From: ubik Date: Thu, 14 Nov 2024 20:17:08 +0100 Subject: [PATCH 91/94] Config for minikube for accounting-tx and accounting-tax --- .../accounting-tax-api-deploy.yaml | 51 +++++++++++++++++++ .../accounting-transaction-api-deploy.yaml | 51 +++++++++++++++++++ deploy/deploy-local-readme.md | 28 ++++++++++ deploy/ubik-proxy/proxy-api-deploy.yaml | 6 ++- 4 files changed, 135 insertions(+), 1 deletion(-) create mode 100644 deploy/accounting-tax-api/accounting-tax-api-deploy.yaml create mode 100644 deploy/accounting-transaction-api/accounting-transaction-api-deploy.yaml diff --git a/deploy/accounting-tax-api/accounting-tax-api-deploy.yaml b/deploy/accounting-tax-api/accounting-tax-api-deploy.yaml new file mode 100644 index 00000000..d756a1bf --- /dev/null +++ b/deploy/accounting-tax-api/accounting-tax-api-deploy.yaml @@ -0,0 +1,51 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: accounting-sales-vat-tax-api + labels: + app: accounting-sales-vat-tax-api +spec: + replicas: 1 + selector: + matchLabels: + app: accounting-sales-vat-tax-api + template: + metadata: + labels: + app: accounting-sales-vat-tax-api + spec: + containers: + - name: accounting-sales-vat-tax-api + image: ubik-accounting-sales-vat-tax-api-test:latest + imagePullPolicy: Never + env: + - name: ConnectionStrings__AccountingSalesTaxDbContext + value: 'Host=ubik-postgres-postgresql;Port=5432;Database=ubik_accounting_salestax;Username=postgres;Password=test01' + - name: ASPNETCORE_ENVIRONMENT + value: Development + - name: MessageBroker__Host + value: 'amqp://ubik-rabbitmq:5672' + - name: AuthServer__MetadataAddress + value: "https://keycloak-local/realms/ubik/.well-known/openid-configuration" + - name: AuthServer__Authority + value: "https://keycloak-local/realms/ubik" + - name: AuthServer__AuthorizationUrl + value: "https://keycloak-local/realms/ubik/protocol/openid-connect/auth" + - name: AuthServer__TokenUrl + value: "https://keycloak-local/realms/ubik/protocol/openid-connect/token" + - name: AuthManagerKeyCloakClient__RootUrl + value: "http://keycloak-local/" + ports: + - containerPort: 8080 +--- +apiVersion: v1 +kind: Service +metadata: + name: accounting-sales-vat-tax-api +spec: + selector: + app: accounting-sales-vat-tax-api + ports: + - protocol: TCP + port: 80 + targetPort: 8080 diff --git a/deploy/accounting-transaction-api/accounting-transaction-api-deploy.yaml b/deploy/accounting-transaction-api/accounting-transaction-api-deploy.yaml new file mode 100644 index 00000000..2dac176e --- /dev/null +++ b/deploy/accounting-transaction-api/accounting-transaction-api-deploy.yaml @@ -0,0 +1,51 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: accounting-transaction-api + labels: + app: accounting-transaction-api +spec: + replicas: 1 + selector: + matchLabels: + app: accounting-transaction-api + template: + metadata: + labels: + app: accounting-transaction-api + spec: + containers: + - name: accounting-transaction-api + image: ubik-accounting-tx-api-test:latest + imagePullPolicy: Never + env: + - name: ConnectionStrings__AccountingTxContext + value: 'Host=ubik-postgres-postgresql;Port=5432;Database=ubik_accounting_tx;Username=postgres;Password=test01' + - name: ASPNETCORE_ENVIRONMENT + value: Development + - name: MessageBroker__Host + value: 'amqp://ubik-rabbitmq:5672' + - name: AuthServer__MetadataAddress + value: "https://keycloak-local/realms/ubik/.well-known/openid-configuration" + - name: AuthServer__Authority + value: "https://keycloak-local/realms/ubik" + - name: AuthServer__AuthorizationUrl + value: "https://keycloak-local/realms/ubik/protocol/openid-connect/auth" + - name: AuthServer__TokenUrl + value: "https://keycloak-local/realms/ubik/protocol/openid-connect/token" + - name: AuthManagerKeyCloakClient__RootUrl + value: "http://keycloak-local/" + ports: + - containerPort: 8080 +--- +apiVersion: v1 +kind: Service +metadata: + name: accounting-transaction-api +spec: + selector: + app: accounting-transaction-api + ports: + - protocol: TCP + port: 80 + targetPort: 8080 diff --git a/deploy/deploy-local-readme.md b/deploy/deploy-local-readme.md index 54c1e4ce..c5df3cb0 100644 --- a/deploy/deploy-local-readme.md +++ b/deploy/deploy-local-readme.md @@ -87,6 +87,34 @@ Apply deployement `kubectl apply -f ./accounting-structure-api/accounting-structure-api-deploy.yaml` +## Accounting Transaction Api + +Build image + +`docker build -t ubik-accounting-tx-api-test:latest -f ../src/Ubik.Accounting.Transaction.Api/Dockerfile ../` + +Load image in minikube + +`minikube image load ubik-accounting-tx-api-test:latest` + +Apply deployement + +`kubectl apply -f ./accounting-transaction-api/accounting-transaction-api-deploy.yaml` + +## Accounting Sales Vat Tax Api + +Build image + +`docker build -t ubik-accounting-sales-vat-tax-api-test:latest -f ../src/Ubik.Accounting.SalesOrVatTax.Api/Dockerfile ../` + +Load image in minikube + +`minikube image load ubik-accounting-sales-vat-tax-api-test:latest` + +Apply deployement + +`kubectl apply -f ./accounting-tax-api/accounting-tax-api-deploy.yaml` + ## Security api Build image diff --git a/deploy/ubik-proxy/proxy-api-deploy.yaml b/deploy/ubik-proxy/proxy-api-deploy.yaml index 99314fdf..54cd5a5f 100644 --- a/deploy/ubik-proxy/proxy-api-deploy.yaml +++ b/deploy/ubik-proxy/proxy-api-deploy.yaml @@ -35,8 +35,12 @@ spec: value: http://security-api/ - name: ReverseProxy__Clusters__ubik_users_admin__Destinations__destination1__Address value: http://security-api/ - - name: ReverseProxy__Clusters__ubik_accounting__Destinations__destination1__Address + - name: ReverseProxy__Clusters__ubik_accounting_struct__Destinations__destination1__Address value: http://accounting-structure-api/ + - name: ReverseProxy__Clusters__ubik_accounting_sales_vat_tax__Destinations__destination1__Address + value: http://accounting-sales-vat-tax-api/ + - name: ReverseProxy__Clusters__ubik_accounting_tx__Destinations__destination1__Address + value: http://accounting-transaction-api/ - name: RedisCache__ConnectionString value: ubik-cache-redis-master:6379 ports: From bbd49e3a04cac6115e245b9e3c8fc0e99515ab0b Mon Sep 17 00:00:00 2001 From: ubik Date: Thu, 14 Nov 2024 20:20:13 +0100 Subject: [PATCH 92/94] comment in README --- deploy/deploy-local-readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deploy/deploy-local-readme.md b/deploy/deploy-local-readme.md index c5df3cb0..354edaf0 100644 --- a/deploy/deploy-local-readme.md +++ b/deploy/deploy-local-readme.md @@ -59,7 +59,7 @@ Contains config to access the already existing postgres db ### Generate self signed certificate (if you want to change them in ingress) -To remember the commands only: +To remember the commands only (you can skip this part): `openssl req -newkey rsa:2048 -nodes -keyout tls.key -out tls.csr` From 343a5d8b767b8e4e862cc6fb3fff3015c1fad02b Mon Sep 17 00:00:00 2001 From: ubik Date: Fri, 15 Nov 2024 08:33:22 +0100 Subject: [PATCH 93/94] update readme --- README.md | 85 +++--- .../Styles/app.output.css | 248 +++++++++--------- src/Ubik.Accounting.WebApp/package-lock.json | 49 ++-- src/Ubik.Accounting.WebApp/package.json | 2 +- 4 files changed, 202 insertions(+), 182 deletions(-) diff --git a/README.md b/README.md index 33e1cffc..c42454ab 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,17 @@ -NEW BIG PR implemented: +LAST BIG PR implemented: -- security api and tenant management -- remove authorization via roles from keycloack -- implement Yarp as a proxy and authorization manager (call the security api and forward request to backend apis, authorization via policy requierments for each route) -- remove masstransit for request/response, keep it only for events (pub/sub) -- review and simplify the test parts (complete review) => only integration tests for the moment. No real backend functions to unit test. -- Blazor app now calls the Yarp proxy +- double-entry preparation +- 2 new backend apis (tx and sales-or-vat-tax) +- Blazor better token management + +Next steps between: + +- vat-sales tax module implementation +- .Net 9 (Blazor adaptations) +- SingalR hub to trace tx status +- Blazor double-entry ui +- Aspire (re-test the thing) +- will see... # Ubik - Accounting @@ -26,11 +32,11 @@ At this stage, **DO NOT USE THIS SYSTEM ON A PRODUCTION** environnement. ## For the Kubernetes/Minikube guys -For detailed instructions on deploying locally with Minikube, please refer to the [local deployment guide](./deploy/deploy-local-readme.md). +For detailed instructions on deploying locally with Minikube (full experience), please refer to the [local deployment guide](./deploy/deploy-local-readme.md). ## Build and Run -At the root of the repository. "Mount" the dependencies with Docker by running this command in your terminal: +**At the root of the repository**, "Mount" the dependencies with Docker by running this command in your terminal: `docker compose -f .\docker-compose.yml -f .\docker-integration-tests.yml up -d` @@ -43,11 +49,15 @@ At the root of the repository. "Mount" the dependencies with Docker by running t > - Pgadmin: to admin your dbs if needed > - Apis: backend apis (security/accounting) for integration testing -### Ready to play +### Ready to play and debug + +#### Run backend Apis or define a multiple projects startup + +`dotnet run --launch-profile https --project ./src/Ubik.Accounting.SalesOrVatTax.Api/Ubik.Accounting.SalesOrVatTax.Api.csproj` -#### Run backend Apis +`dotnet run --launch-profile https --project ./src/Ubik.Accounting.Transaction.Api/Ubik.Accounting.Transaction.Api.csproj` -`dotnet run --launch-profile https --project ./src/Ubik.Accounting.Api/Ubik.Accounting.Api.csproj` +`dotnet run --launch-profile https --project ./src/Ubik.Accounting.Structure.Api/Ubik.Accounting.Structure.Api.csproj` `dotnet run --launch-profile https --project ./src/Ubik.Security.Api/Ubik.Security.Api.csproj` @@ -59,10 +69,7 @@ At the root of the repository. "Mount" the dependencies with Docker by running t `dotnet run --launch-profile https --project ./src/Ubik.Accounting.WebApp/Ubik.Accounting.WebApp.csproj` -And now, you can access the very first version of a the Blazor 8 webapp here - -*Don't change the ports of the api and the blazor apps. It's hard coded in the Blazor prj (need to be changed) because no service discovery for the moment.* -*In Debug, create a multiple project startup that runs all this stuff* +And now (when all the stuff are up and running), you can access the very first version of a the Blazor 8 webapp here ### All the things are up @@ -82,11 +89,22 @@ Try to log with different access rights and play with the only available "Accoun Now you can run your preferred code editor and start to deep dive... (see below) +## External libs + +| Package | For what | +|----------- | -------- | +| [Asp.Versioning](https://github.com/dotnet/aspnet-api-versioning) | automatic versioning of API (controllers / endpoints) | +| EfCore | commands and ez queries + data init etc | +| [Dapper](https://github.com/DapperLib/Dapper) | some read queries | +| [EFCore.NamingConvention](https://github.com/efcore/EFCore.NamingConventions) | force EF core to postgres SnakeCase => way better if you need to use Dapper too | +| [LanguageExt.Core](https://github.com/louthy/language-ext) | use Either pattern | +| [Masstransit](https://github.com/MassTransit/MassTransit) | message bus abstraction + inbox/outbox pattern | + ## Yarp Proxy -- Ubik.YarpProxy -- -Manages all the authorization stuff by calling the security api and forward the requests to the backend. (cool af) +Manages all the authorization stuff by calling the security api and forward the requests to the backend. ## Security Api @@ -94,20 +112,23 @@ Manages all the authorization stuff by calling the security api and forward the Used by the proxy to manage authorizations and exposes admin and user endpoints to manage the authorizations/users/tenants config. -## Accounting Api +## Accounting structure Api --- Ubik.Accounting.Api -- +-- Ubik.Accounting.Structure.Api -- -Some used external libs: +Manages the accounting structure. -| Package | For what | -|----------- | -------- | -| [Asp.Versioning](https://github.com/dotnet/aspnet-api-versioning) | automatic versioning of API (controllers / endpoints) | -| EfCore | commands and ez queries + data init etc | -| [Dapper](https://github.com/DapperLib/Dapper) | some read queries | -| [EFCore.NamingConvention](https://github.com/efcore/EFCore.NamingConventions) | force EF core to postgres SnakeCase => way better if you need to use Dapper too | -| [LanguageExt.Core](https://github.com/louthy/language-ext) | use Either pattern | -| [Masstransit](https://github.com/MassTransit/MassTransit) | message bus abstraction + inbox/outbox pattern | +## Accounting tx Api + +-- Ubik.Accounting.Transaction.Api -- + +For the moment, implement the submit Tx endpoint and create some states and events related to future Txs management. + +# Accounting sales or VAT tax + +-- Ubik.Accounting.SalesOrVatTax.Api -- + +Will implement all the rules related to sales or VAT taxes and validate a Tx when needed. Will be used to declare and enforce the rules. (for each country etc) ## Features folder in backend Apis @@ -115,7 +136,7 @@ Contains the core features (in Vertical Slices mode). - Command and query services - When a command is executed with success, an event is published to the message bus (pub/sub) -- Functional `Either` patterns in all layers to transfer errors between layer and to keep the code not too dirty. (not an expert but I like it) +- Functional `Either` patterns in all layers to transfer errors between layer and to keep the code not too dirty. ## Frontend Blazor @@ -149,7 +170,7 @@ Send some love on github to this projects... - Typed HttpClient to access the backend api - Tailwind config - Tailwind Flowbite design layout etc - A very minimal reverse proxy controller that allows components (automode) to call the backend api when they are WASM. -- Some stuff about security (Token cache service, UserService with circuit, middleware) +- Some stuff about security (Token cache service) In program.cs, you can access the config of: @@ -158,6 +179,8 @@ In program.cs, you can access the config of: - Cookie auth with OpenIdC (connection + refresh token in OnValidatePrincipal) - ... +=> next, implement new .Net 9 Blazor stuff related to authentication and render modes. + ### Ubik.Accounting.WebApp.Client (client-auto side) @@ -184,7 +207,7 @@ In program.cs, you can access the config of: ## Others --- Ubik.Accounting.ApiService.Common -- / -- Ubik.Db.Common -- / -- Ubik.Accounting.Contracts -- +-- Ubik.Accounting.ApiService.Common -- / -- Ubik.Db.Common -- / -- Ubik.xxx.Contracts -- - Common config things that can be reused in other projects - This part will maybe grow diff --git a/src/Ubik.Accounting.WebApp/Styles/app.output.css b/src/Ubik.Accounting.WebApp/Styles/app.output.css index 922f8052..6ab9fb46 100644 --- a/src/Ubik.Accounting.WebApp/Styles/app.output.css +++ b/src/Ubik.Accounting.WebApp/Styles/app.output.css @@ -107,7 +107,7 @@ } /* -! tailwindcss v3.4.14 | MIT License | https://tailwindcss.com +! tailwindcss v3.4.15 | MIT License | https://tailwindcss.com */ /* @@ -757,12 +757,12 @@ h1 { line-height: 1; letter-spacing: -0.025em; --tw-text-opacity: 1; - color: rgb(17 24 39 / var(--tw-text-opacity)); + color: rgb(17 24 39 / var(--tw-text-opacity, 1)); } h1:is(.dark *) { --tw-text-opacity: 1; - color: rgb(255 255 255 / var(--tw-text-opacity)); + color: rgb(255 255 255 / var(--tw-text-opacity, 1)); } @media (min-width: 768px) { @@ -787,17 +787,17 @@ h2 { h2:is(.dark *) { --tw-text-opacity: 1; - color: rgb(255 255 255 / var(--tw-text-opacity)); + color: rgb(255 255 255 / var(--tw-text-opacity, 1)); } p { --tw-text-opacity: 1; - color: rgb(107 114 128 / var(--tw-text-opacity)); + color: rgb(107 114 128 / var(--tw-text-opacity, 1)); } p:is(.dark *) { --tw-text-opacity: 1; - color: rgb(156 163 175 / var(--tw-text-opacity)); + color: rgb(156 163 175 / var(--tw-text-opacity, 1)); } .sr-only { @@ -1330,82 +1330,82 @@ p:is(.dark *) { .border-blue-700 { --tw-border-opacity: 1; - border-color: rgb(29 78 216 / var(--tw-border-opacity)); + border-color: rgb(29 78 216 / var(--tw-border-opacity, 1)); } .border-gray-200 { --tw-border-opacity: 1; - border-color: rgb(229 231 235 / var(--tw-border-opacity)); + border-color: rgb(229 231 235 / var(--tw-border-opacity, 1)); } .border-gray-300 { --tw-border-opacity: 1; - border-color: rgb(209 213 219 / var(--tw-border-opacity)); + border-color: rgb(209 213 219 / var(--tw-border-opacity, 1)); } .border-purple-700 { --tw-border-opacity: 1; - border-color: rgb(126 34 206 / var(--tw-border-opacity)); + border-color: rgb(126 34 206 / var(--tw-border-opacity, 1)); } .border-red-300 { --tw-border-opacity: 1; - border-color: rgb(252 165 165 / var(--tw-border-opacity)); + border-color: rgb(252 165 165 / var(--tw-border-opacity, 1)); } .border-red-500 { --tw-border-opacity: 1; - border-color: rgb(239 68 68 / var(--tw-border-opacity)); + border-color: rgb(239 68 68 / var(--tw-border-opacity, 1)); } .border-red-800 { --tw-border-opacity: 1; - border-color: rgb(153 27 27 / var(--tw-border-opacity)); + border-color: rgb(153 27 27 / var(--tw-border-opacity, 1)); } .border-b-gray-600 { --tw-border-opacity: 1; - border-bottom-color: rgb(75 85 99 / var(--tw-border-opacity)); + border-bottom-color: rgb(75 85 99 / var(--tw-border-opacity, 1)); } .bg-blue-700 { --tw-bg-opacity: 1; - background-color: rgb(29 78 216 / var(--tw-bg-opacity)); + background-color: rgb(29 78 216 / var(--tw-bg-opacity, 1)); } .bg-gray-100 { --tw-bg-opacity: 1; - background-color: rgb(243 244 246 / var(--tw-bg-opacity)); + background-color: rgb(243 244 246 / var(--tw-bg-opacity, 1)); } .bg-gray-200 { --tw-bg-opacity: 1; - background-color: rgb(229 231 235 / var(--tw-bg-opacity)); + background-color: rgb(229 231 235 / var(--tw-bg-opacity, 1)); } .bg-gray-50 { --tw-bg-opacity: 1; - background-color: rgb(249 250 251 / var(--tw-bg-opacity)); + background-color: rgb(249 250 251 / var(--tw-bg-opacity, 1)); } .bg-green-50 { --tw-bg-opacity: 1; - background-color: rgb(240 253 244 / var(--tw-bg-opacity)); + background-color: rgb(240 253 244 / var(--tw-bg-opacity, 1)); } .bg-red-50 { --tw-bg-opacity: 1; - background-color: rgb(254 242 242 / var(--tw-bg-opacity)); + background-color: rgb(254 242 242 / var(--tw-bg-opacity, 1)); } .bg-red-600 { --tw-bg-opacity: 1; - background-color: rgb(220 38 38 / var(--tw-bg-opacity)); + background-color: rgb(220 38 38 / var(--tw-bg-opacity, 1)); } .bg-red-800 { --tw-bg-opacity: 1; - background-color: rgb(153 27 27 / var(--tw-bg-opacity)); + background-color: rgb(153 27 27 / var(--tw-bg-opacity, 1)); } .bg-transparent { @@ -1414,7 +1414,7 @@ p:is(.dark *) { .bg-white { --tw-bg-opacity: 1; - background-color: rgb(255 255 255 / var(--tw-bg-opacity)); + background-color: rgb(255 255 255 / var(--tw-bg-opacity, 1)); } .bg-white\/60 { @@ -1423,12 +1423,12 @@ p:is(.dark *) { .bg-yellow-50 { --tw-bg-opacity: 1; - background-color: rgb(254 252 232 / var(--tw-bg-opacity)); + background-color: rgb(254 252 232 / var(--tw-bg-opacity, 1)); } .bg-zinc-300 { --tw-bg-opacity: 1; - background-color: rgb(212 212 216 / var(--tw-bg-opacity)); + background-color: rgb(212 212 216 / var(--tw-bg-opacity, 1)); } .fill-blue-600 { @@ -1633,107 +1633,107 @@ p:is(.dark *) { .text-blue-600 { --tw-text-opacity: 1; - color: rgb(37 99 235 / var(--tw-text-opacity)); + color: rgb(37 99 235 / var(--tw-text-opacity, 1)); } .text-blue-700 { --tw-text-opacity: 1; - color: rgb(29 78 216 / var(--tw-text-opacity)); + color: rgb(29 78 216 / var(--tw-text-opacity, 1)); } .text-gray-200 { --tw-text-opacity: 1; - color: rgb(229 231 235 / var(--tw-text-opacity)); + color: rgb(229 231 235 / var(--tw-text-opacity, 1)); } .text-gray-400 { --tw-text-opacity: 1; - color: rgb(156 163 175 / var(--tw-text-opacity)); + color: rgb(156 163 175 / var(--tw-text-opacity, 1)); } .text-gray-500 { --tw-text-opacity: 1; - color: rgb(107 114 128 / var(--tw-text-opacity)); + color: rgb(107 114 128 / var(--tw-text-opacity, 1)); } .text-gray-600 { --tw-text-opacity: 1; - color: rgb(75 85 99 / var(--tw-text-opacity)); + color: rgb(75 85 99 / var(--tw-text-opacity, 1)); } .text-gray-700 { --tw-text-opacity: 1; - color: rgb(55 65 81 / var(--tw-text-opacity)); + color: rgb(55 65 81 / var(--tw-text-opacity, 1)); } .text-gray-800 { --tw-text-opacity: 1; - color: rgb(31 41 55 / var(--tw-text-opacity)); + color: rgb(31 41 55 / var(--tw-text-opacity, 1)); } .text-gray-900 { --tw-text-opacity: 1; - color: rgb(17 24 39 / var(--tw-text-opacity)); + color: rgb(17 24 39 / var(--tw-text-opacity, 1)); } .text-green-700 { --tw-text-opacity: 1; - color: rgb(21 128 61 / var(--tw-text-opacity)); + color: rgb(21 128 61 / var(--tw-text-opacity, 1)); } .text-green-800 { --tw-text-opacity: 1; - color: rgb(22 101 52 / var(--tw-text-opacity)); + color: rgb(22 101 52 / var(--tw-text-opacity, 1)); } .text-purple-700 { --tw-text-opacity: 1; - color: rgb(126 34 206 / var(--tw-text-opacity)); + color: rgb(126 34 206 / var(--tw-text-opacity, 1)); } .text-red-500 { --tw-text-opacity: 1; - color: rgb(239 68 68 / var(--tw-text-opacity)); + color: rgb(239 68 68 / var(--tw-text-opacity, 1)); } .text-red-600 { --tw-text-opacity: 1; - color: rgb(220 38 38 / var(--tw-text-opacity)); + color: rgb(220 38 38 / var(--tw-text-opacity, 1)); } .text-red-700 { --tw-text-opacity: 1; - color: rgb(185 28 28 / var(--tw-text-opacity)); + color: rgb(185 28 28 / var(--tw-text-opacity, 1)); } .text-red-800 { --tw-text-opacity: 1; - color: rgb(153 27 27 / var(--tw-text-opacity)); + color: rgb(153 27 27 / var(--tw-text-opacity, 1)); } .text-red-900 { --tw-text-opacity: 1; - color: rgb(127 29 29 / var(--tw-text-opacity)); + color: rgb(127 29 29 / var(--tw-text-opacity, 1)); } .text-white { --tw-text-opacity: 1; - color: rgb(255 255 255 / var(--tw-text-opacity)); + color: rgb(255 255 255 / var(--tw-text-opacity, 1)); } .text-yellow-800 { --tw-text-opacity: 1; - color: rgb(133 77 14 / var(--tw-text-opacity)); + color: rgb(133 77 14 / var(--tw-text-opacity, 1)); } .placeholder-red-700::-moz-placeholder { --tw-placeholder-opacity: 1; - color: rgb(185 28 28 / var(--tw-placeholder-opacity)); + color: rgb(185 28 28 / var(--tw-placeholder-opacity, 1)); } .placeholder-red-700::placeholder { --tw-placeholder-opacity: 1; - color: rgb(185 28 28 / var(--tw-placeholder-opacity)); + color: rgb(185 28 28 / var(--tw-placeholder-opacity, 1)); } .shadow { @@ -1786,13 +1786,13 @@ p:is(.dark *) { .after\:border-gray-300::after { content: var(--tw-content); --tw-border-opacity: 1; - border-color: rgb(209 213 219 / var(--tw-border-opacity)); + border-color: rgb(209 213 219 / var(--tw-border-opacity, 1)); } .after\:bg-white::after { content: var(--tw-content); --tw-bg-opacity: 1; - background-color: rgb(255 255 255 / var(--tw-bg-opacity)); + background-color: rgb(255 255 255 / var(--tw-bg-opacity, 1)); } .after\:transition-all::after { @@ -1809,52 +1809,52 @@ p:is(.dark *) { .hover\:bg-blue-800:hover { --tw-bg-opacity: 1; - background-color: rgb(30 64 175 / var(--tw-bg-opacity)); + background-color: rgb(30 64 175 / var(--tw-bg-opacity, 1)); } .hover\:bg-gray-100:hover { --tw-bg-opacity: 1; - background-color: rgb(243 244 246 / var(--tw-bg-opacity)); + background-color: rgb(243 244 246 / var(--tw-bg-opacity, 1)); } .hover\:bg-gray-200:hover { --tw-bg-opacity: 1; - background-color: rgb(229 231 235 / var(--tw-bg-opacity)); + background-color: rgb(229 231 235 / var(--tw-bg-opacity, 1)); } .hover\:bg-purple-800:hover { --tw-bg-opacity: 1; - background-color: rgb(107 33 168 / var(--tw-bg-opacity)); + background-color: rgb(107 33 168 / var(--tw-bg-opacity, 1)); } .hover\:bg-red-200:hover { --tw-bg-opacity: 1; - background-color: rgb(254 202 202 / var(--tw-bg-opacity)); + background-color: rgb(254 202 202 / var(--tw-bg-opacity, 1)); } .hover\:bg-red-800:hover { --tw-bg-opacity: 1; - background-color: rgb(153 27 27 / var(--tw-bg-opacity)); + background-color: rgb(153 27 27 / var(--tw-bg-opacity, 1)); } .hover\:bg-red-900:hover { --tw-bg-opacity: 1; - background-color: rgb(127 29 29 / var(--tw-bg-opacity)); + background-color: rgb(127 29 29 / var(--tw-bg-opacity, 1)); } .hover\:bg-white:hover { --tw-bg-opacity: 1; - background-color: rgb(255 255 255 / var(--tw-bg-opacity)); + background-color: rgb(255 255 255 / var(--tw-bg-opacity, 1)); } .hover\:text-gray-900:hover { --tw-text-opacity: 1; - color: rgb(17 24 39 / var(--tw-text-opacity)); + color: rgb(17 24 39 / var(--tw-text-opacity, 1)); } .hover\:text-white:hover { --tw-text-opacity: 1; - color: rgb(255 255 255 / var(--tw-text-opacity)); + color: rgb(255 255 255 / var(--tw-text-opacity, 1)); } .hover\:underline:hover { @@ -1867,22 +1867,22 @@ p:is(.dark *) { .focus\:border-blue-500:focus { --tw-border-opacity: 1; - border-color: rgb(59 130 246 / var(--tw-border-opacity)); + border-color: rgb(59 130 246 / var(--tw-border-opacity, 1)); } .focus\:border-red-500:focus { --tw-border-opacity: 1; - border-color: rgb(239 68 68 / var(--tw-border-opacity)); + border-color: rgb(239 68 68 / var(--tw-border-opacity, 1)); } .focus\:bg-gray-100:focus { --tw-bg-opacity: 1; - background-color: rgb(243 244 246 / var(--tw-bg-opacity)); + background-color: rgb(243 244 246 / var(--tw-bg-opacity, 1)); } .focus\:text-gray-900:focus { --tw-text-opacity: 1; - color: rgb(17 24 39 / var(--tw-text-opacity)); + color: rgb(17 24 39 / var(--tw-text-opacity, 1)); } .focus\:outline-none:focus { @@ -1904,52 +1904,52 @@ p:is(.dark *) { .focus\:ring-blue-300:focus { --tw-ring-opacity: 1; - --tw-ring-color: rgb(147 197 253 / var(--tw-ring-opacity)); + --tw-ring-color: rgb(147 197 253 / var(--tw-ring-opacity, 1)); } .focus\:ring-blue-500:focus { --tw-ring-opacity: 1; - --tw-ring-color: rgb(59 130 246 / var(--tw-ring-opacity)); + --tw-ring-color: rgb(59 130 246 / var(--tw-ring-opacity, 1)); } .focus\:ring-gray-200:focus { --tw-ring-opacity: 1; - --tw-ring-color: rgb(229 231 235 / var(--tw-ring-opacity)); + --tw-ring-color: rgb(229 231 235 / var(--tw-ring-opacity, 1)); } .focus\:ring-purple-300:focus { --tw-ring-opacity: 1; - --tw-ring-color: rgb(216 180 254 / var(--tw-ring-opacity)); + --tw-ring-color: rgb(216 180 254 / var(--tw-ring-opacity, 1)); } .focus\:ring-red-300:focus { --tw-ring-opacity: 1; - --tw-ring-color: rgb(252 165 165 / var(--tw-ring-opacity)); + --tw-ring-color: rgb(252 165 165 / var(--tw-ring-opacity, 1)); } .focus\:ring-red-400:focus { --tw-ring-opacity: 1; - --tw-ring-color: rgb(248 113 113 / var(--tw-ring-opacity)); + --tw-ring-color: rgb(248 113 113 / var(--tw-ring-opacity, 1)); } .focus\:ring-red-500:focus { --tw-ring-opacity: 1; - --tw-ring-color: rgb(239 68 68 / var(--tw-ring-opacity)); + --tw-ring-color: rgb(239 68 68 / var(--tw-ring-opacity, 1)); } .focus\:hover\:bg-gray-600:hover:focus { --tw-bg-opacity: 1; - background-color: rgb(75 85 99 / var(--tw-bg-opacity)); + background-color: rgb(75 85 99 / var(--tw-bg-opacity, 1)); } .disabled\:text-gray-300:disabled { --tw-text-opacity: 1; - color: rgb(209 213 219 / var(--tw-text-opacity)); + color: rgb(209 213 219 / var(--tw-text-opacity, 1)); } .peer:checked ~ .peer-checked\:bg-blue-600 { --tw-bg-opacity: 1; - background-color: rgb(37 99 235 / var(--tw-bg-opacity)); + background-color: rgb(37 99 235 / var(--tw-bg-opacity, 1)); } .peer:checked ~ .peer-checked\:after\:translate-x-full::after { @@ -1961,7 +1961,7 @@ p:is(.dark *) { .peer:checked ~ .peer-checked\:after\:border-white::after { content: var(--tw-content); --tw-border-opacity: 1; - border-color: rgb(255 255 255 / var(--tw-border-opacity)); + border-color: rgb(255 255 255 / var(--tw-border-opacity, 1)); } .peer:focus ~ .peer-focus\:outline-none { @@ -1977,7 +1977,7 @@ p:is(.dark *) { .peer:focus ~ .peer-focus\:ring-blue-300 { --tw-ring-opacity: 1; - --tw-ring-color: rgb(147 197 253 / var(--tw-ring-opacity)); + --tw-ring-color: rgb(147 197 253 / var(--tw-ring-opacity, 1)); } .dark\:border:is(.dark *) { @@ -1986,72 +1986,72 @@ p:is(.dark *) { .dark\:border-blue-500:is(.dark *) { --tw-border-opacity: 1; - border-color: rgb(59 130 246 / var(--tw-border-opacity)); + border-color: rgb(59 130 246 / var(--tw-border-opacity, 1)); } .dark\:border-blue-600:is(.dark *) { --tw-border-opacity: 1; - border-color: rgb(37 99 235 / var(--tw-border-opacity)); + border-color: rgb(37 99 235 / var(--tw-border-opacity, 1)); } .dark\:border-gray-500:is(.dark *) { --tw-border-opacity: 1; - border-color: rgb(107 114 128 / var(--tw-border-opacity)); + border-color: rgb(107 114 128 / var(--tw-border-opacity, 1)); } .dark\:border-gray-600:is(.dark *) { --tw-border-opacity: 1; - border-color: rgb(75 85 99 / var(--tw-border-opacity)); + border-color: rgb(75 85 99 / var(--tw-border-opacity, 1)); } .dark\:border-gray-700:is(.dark *) { --tw-border-opacity: 1; - border-color: rgb(55 65 81 / var(--tw-border-opacity)); + border-color: rgb(55 65 81 / var(--tw-border-opacity, 1)); } .dark\:border-purple-400:is(.dark *) { --tw-border-opacity: 1; - border-color: rgb(192 132 252 / var(--tw-border-opacity)); + border-color: rgb(192 132 252 / var(--tw-border-opacity, 1)); } .dark\:border-red-500:is(.dark *) { --tw-border-opacity: 1; - border-color: rgb(239 68 68 / var(--tw-border-opacity)); + border-color: rgb(239 68 68 / var(--tw-border-opacity, 1)); } .dark\:border-red-600:is(.dark *) { --tw-border-opacity: 1; - border-color: rgb(220 38 38 / var(--tw-border-opacity)); + border-color: rgb(220 38 38 / var(--tw-border-opacity, 1)); } .dark\:border-red-800:is(.dark *) { --tw-border-opacity: 1; - border-color: rgb(153 27 27 / var(--tw-border-opacity)); + border-color: rgb(153 27 27 / var(--tw-border-opacity, 1)); } .dark\:border-b-gray-600:is(.dark *) { --tw-border-opacity: 1; - border-bottom-color: rgb(75 85 99 / var(--tw-border-opacity)); + border-bottom-color: rgb(75 85 99 / var(--tw-border-opacity, 1)); } .dark\:bg-blue-600:is(.dark *) { --tw-bg-opacity: 1; - background-color: rgb(37 99 235 / var(--tw-bg-opacity)); + background-color: rgb(37 99 235 / var(--tw-bg-opacity, 1)); } .dark\:bg-gray-700:is(.dark *) { --tw-bg-opacity: 1; - background-color: rgb(55 65 81 / var(--tw-bg-opacity)); + background-color: rgb(55 65 81 / var(--tw-bg-opacity, 1)); } .dark\:bg-gray-800:is(.dark *) { --tw-bg-opacity: 1; - background-color: rgb(31 41 55 / var(--tw-bg-opacity)); + background-color: rgb(31 41 55 / var(--tw-bg-opacity, 1)); } .dark\:bg-gray-900:is(.dark *) { --tw-bg-opacity: 1; - background-color: rgb(17 24 39 / var(--tw-bg-opacity)); + background-color: rgb(17 24 39 / var(--tw-bg-opacity, 1)); } .dark\:bg-gray-900\/80:is(.dark *) { @@ -2060,7 +2060,7 @@ p:is(.dark *) { .dark\:bg-red-600:is(.dark *) { --tw-bg-opacity: 1; - background-color: rgb(220 38 38 / var(--tw-bg-opacity)); + background-color: rgb(220 38 38 / var(--tw-bg-opacity, 1)); } .dark\:bg-gradient-to-br:is(.dark *) { @@ -2089,177 +2089,177 @@ p:is(.dark *) { .dark\:text-blue-400:is(.dark *) { --tw-text-opacity: 1; - color: rgb(96 165 250 / var(--tw-text-opacity)); + color: rgb(96 165 250 / var(--tw-text-opacity, 1)); } .dark\:text-blue-500:is(.dark *) { --tw-text-opacity: 1; - color: rgb(59 130 246 / var(--tw-text-opacity)); + color: rgb(59 130 246 / var(--tw-text-opacity, 1)); } .dark\:text-gray-200:is(.dark *) { --tw-text-opacity: 1; - color: rgb(229 231 235 / var(--tw-text-opacity)); + color: rgb(229 231 235 / var(--tw-text-opacity, 1)); } .dark\:text-gray-300:is(.dark *) { --tw-text-opacity: 1; - color: rgb(209 213 219 / var(--tw-text-opacity)); + color: rgb(209 213 219 / var(--tw-text-opacity, 1)); } .dark\:text-gray-400:is(.dark *) { --tw-text-opacity: 1; - color: rgb(156 163 175 / var(--tw-text-opacity)); + color: rgb(156 163 175 / var(--tw-text-opacity, 1)); } .dark\:text-gray-500:is(.dark *) { --tw-text-opacity: 1; - color: rgb(107 114 128 / var(--tw-text-opacity)); + color: rgb(107 114 128 / var(--tw-text-opacity, 1)); } .dark\:text-gray-600:is(.dark *) { --tw-text-opacity: 1; - color: rgb(75 85 99 / var(--tw-text-opacity)); + color: rgb(75 85 99 / var(--tw-text-opacity, 1)); } .dark\:text-green-400:is(.dark *) { --tw-text-opacity: 1; - color: rgb(74 222 128 / var(--tw-text-opacity)); + color: rgb(74 222 128 / var(--tw-text-opacity, 1)); } .dark\:text-purple-400:is(.dark *) { --tw-text-opacity: 1; - color: rgb(192 132 252 / var(--tw-text-opacity)); + color: rgb(192 132 252 / var(--tw-text-opacity, 1)); } .dark\:text-red-400:is(.dark *) { --tw-text-opacity: 1; - color: rgb(248 113 113 / var(--tw-text-opacity)); + color: rgb(248 113 113 / var(--tw-text-opacity, 1)); } .dark\:text-red-500:is(.dark *) { --tw-text-opacity: 1; - color: rgb(239 68 68 / var(--tw-text-opacity)); + color: rgb(239 68 68 / var(--tw-text-opacity, 1)); } .dark\:text-white:is(.dark *) { --tw-text-opacity: 1; - color: rgb(255 255 255 / var(--tw-text-opacity)); + color: rgb(255 255 255 / var(--tw-text-opacity, 1)); } .dark\:text-yellow-300:is(.dark *) { --tw-text-opacity: 1; - color: rgb(253 224 71 / var(--tw-text-opacity)); + color: rgb(253 224 71 / var(--tw-text-opacity, 1)); } .dark\:placeholder-gray-400:is(.dark *)::-moz-placeholder { --tw-placeholder-opacity: 1; - color: rgb(156 163 175 / var(--tw-placeholder-opacity)); + color: rgb(156 163 175 / var(--tw-placeholder-opacity, 1)); } .dark\:placeholder-gray-400:is(.dark *)::placeholder { --tw-placeholder-opacity: 1; - color: rgb(156 163 175 / var(--tw-placeholder-opacity)); + color: rgb(156 163 175 / var(--tw-placeholder-opacity, 1)); } .dark\:placeholder-red-500:is(.dark *)::-moz-placeholder { --tw-placeholder-opacity: 1; - color: rgb(239 68 68 / var(--tw-placeholder-opacity)); + color: rgb(239 68 68 / var(--tw-placeholder-opacity, 1)); } .dark\:placeholder-red-500:is(.dark *)::placeholder { --tw-placeholder-opacity: 1; - color: rgb(239 68 68 / var(--tw-placeholder-opacity)); + color: rgb(239 68 68 / var(--tw-placeholder-opacity, 1)); } .dark\:hover\:bg-blue-500:hover:is(.dark *) { --tw-bg-opacity: 1; - background-color: rgb(59 130 246 / var(--tw-bg-opacity)); + background-color: rgb(59 130 246 / var(--tw-bg-opacity, 1)); } .dark\:hover\:bg-blue-700:hover:is(.dark *) { --tw-bg-opacity: 1; - background-color: rgb(29 78 216 / var(--tw-bg-opacity)); + background-color: rgb(29 78 216 / var(--tw-bg-opacity, 1)); } .dark\:hover\:bg-gray-600:hover:is(.dark *) { --tw-bg-opacity: 1; - background-color: rgb(75 85 99 / var(--tw-bg-opacity)); + background-color: rgb(75 85 99 / var(--tw-bg-opacity, 1)); } .dark\:hover\:bg-gray-700:hover:is(.dark *) { --tw-bg-opacity: 1; - background-color: rgb(55 65 81 / var(--tw-bg-opacity)); + background-color: rgb(55 65 81 / var(--tw-bg-opacity, 1)); } .dark\:hover\:bg-gray-800:hover:is(.dark *) { --tw-bg-opacity: 1; - background-color: rgb(31 41 55 / var(--tw-bg-opacity)); + background-color: rgb(31 41 55 / var(--tw-bg-opacity, 1)); } .dark\:hover\:bg-purple-500:hover:is(.dark *) { --tw-bg-opacity: 1; - background-color: rgb(168 85 247 / var(--tw-bg-opacity)); + background-color: rgb(168 85 247 / var(--tw-bg-opacity, 1)); } .dark\:hover\:bg-red-600:hover:is(.dark *) { --tw-bg-opacity: 1; - background-color: rgb(220 38 38 / var(--tw-bg-opacity)); + background-color: rgb(220 38 38 / var(--tw-bg-opacity, 1)); } .dark\:hover\:bg-red-700:hover:is(.dark *) { --tw-bg-opacity: 1; - background-color: rgb(185 28 28 / var(--tw-bg-opacity)); + background-color: rgb(185 28 28 / var(--tw-bg-opacity, 1)); } .dark\:hover\:text-white:hover:is(.dark *) { --tw-text-opacity: 1; - color: rgb(255 255 255 / var(--tw-text-opacity)); + color: rgb(255 255 255 / var(--tw-text-opacity, 1)); } .dark\:focus\:border-blue-500:focus:is(.dark *) { --tw-border-opacity: 1; - border-color: rgb(59 130 246 / var(--tw-border-opacity)); + border-color: rgb(59 130 246 / var(--tw-border-opacity, 1)); } .dark\:focus\:text-white:focus:is(.dark *) { --tw-text-opacity: 1; - color: rgb(255 255 255 / var(--tw-text-opacity)); + color: rgb(255 255 255 / var(--tw-text-opacity, 1)); } .dark\:focus\:ring-blue-500:focus:is(.dark *) { --tw-ring-opacity: 1; - --tw-ring-color: rgb(59 130 246 / var(--tw-ring-opacity)); + --tw-ring-color: rgb(59 130 246 / var(--tw-ring-opacity, 1)); } .dark\:focus\:ring-blue-800:focus:is(.dark *) { --tw-ring-opacity: 1; - --tw-ring-color: rgb(30 64 175 / var(--tw-ring-opacity)); + --tw-ring-color: rgb(30 64 175 / var(--tw-ring-opacity, 1)); } .dark\:focus\:ring-gray-600:focus:is(.dark *) { --tw-ring-opacity: 1; - --tw-ring-color: rgb(75 85 99 / var(--tw-ring-opacity)); + --tw-ring-color: rgb(75 85 99 / var(--tw-ring-opacity, 1)); } .dark\:focus\:ring-purple-900:focus:is(.dark *) { --tw-ring-opacity: 1; - --tw-ring-color: rgb(88 28 135 / var(--tw-ring-opacity)); + --tw-ring-color: rgb(88 28 135 / var(--tw-ring-opacity, 1)); } .dark\:focus\:ring-red-800:focus:is(.dark *) { --tw-ring-opacity: 1; - --tw-ring-color: rgb(153 27 27 / var(--tw-ring-opacity)); + --tw-ring-color: rgb(153 27 27 / var(--tw-ring-opacity, 1)); } .disabled\:dark\:text-gray-700:is(.dark *):disabled { --tw-text-opacity: 1; - color: rgb(55 65 81 / var(--tw-text-opacity)); + color: rgb(55 65 81 / var(--tw-text-opacity, 1)); } .peer:focus ~ .dark\:peer-focus\:ring-blue-800:is(.dark *) { --tw-ring-opacity: 1; - --tw-ring-color: rgb(30 64 175 / var(--tw-ring-opacity)); + --tw-ring-color: rgb(30 64 175 / var(--tw-ring-opacity, 1)); } @media (min-width: 640px) { diff --git a/src/Ubik.Accounting.WebApp/package-lock.json b/src/Ubik.Accounting.WebApp/package-lock.json index 88773079..170f41d1 100644 --- a/src/Ubik.Accounting.WebApp/package-lock.json +++ b/src/Ubik.Accounting.WebApp/package-lock.json @@ -7,7 +7,7 @@ "dependencies": { "autoprefixer": "^10.4.16", "postcss": "^8.4.31", - "tailwindcss": "^3.4.14" + "tailwindcss": "^3.4.15" }, "devDependencies": { "@tailwindcss/forms": "^0.5.7", @@ -926,10 +926,9 @@ } }, "node_modules/picocolors": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.0.tgz", - "integrity": "sha512-TQ92mBOW0l3LeMeyLV6mzy/kWr8lkd/hp3mTg7wYK7zJhuBStmGMBG0BdeDZS/dZx1IukaX6Bk11zcln25o1Aw==", - "license": "ISC" + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==" }, "node_modules/picomatch": { "version": "2.3.1", @@ -962,9 +961,9 @@ } }, "node_modules/postcss": { - "version": "8.4.45", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.45.tgz", - "integrity": "sha512-7KTLTdzdZZYscUc65XmjFiB73vBhBfbPztCYdUNvlaso9PrzjzcmjqBPR0lNGkcVlcO4BjiO5rK/qNz+XAen1Q==", + "version": "8.4.49", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.49.tgz", + "integrity": "sha512-OCVPnIObs4N29kxTjzLfUryOkvZEq+pf8jTF0lg8E7uETuWHA+v7j3c/xJmiqpX450191LlmZfUKkXxkTry7nA==", "funding": [ { "type": "opencollective", @@ -979,11 +978,10 @@ "url": "https://github.com/sponsors/ai" } ], - "license": "MIT", "dependencies": { "nanoid": "^3.3.7", - "picocolors": "^1.0.1", - "source-map-js": "^1.2.0" + "picocolors": "^1.1.1", + "source-map-js": "^1.2.1" }, "engines": { "node": "^10 || ^12 || >=14" @@ -1380,33 +1378,32 @@ } }, "node_modules/tailwindcss": { - "version": "3.4.14", - "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.4.14.tgz", - "integrity": "sha512-IcSvOcTRcUtQQ7ILQL5quRDg7Xs93PdJEk1ZLbhhvJc7uj/OAhYOnruEiwnGgBvUtaUAJ8/mhSw1o8L2jCiENA==", - "license": "MIT", + "version": "3.4.15", + "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.4.15.tgz", + "integrity": "sha512-r4MeXnfBmSOuKUWmXe6h2CcyfzJCEk4F0pptO5jlnYSIViUkVmsawj80N5h2lO3gwcmSb4n3PuN+e+GC1Guylw==", "dependencies": { "@alloc/quick-lru": "^5.2.0", "arg": "^5.0.2", - "chokidar": "^3.5.3", + "chokidar": "^3.6.0", "didyoumean": "^1.2.2", "dlv": "^1.1.3", - "fast-glob": "^3.3.0", + "fast-glob": "^3.3.2", "glob-parent": "^6.0.2", "is-glob": "^4.0.3", - "jiti": "^1.21.0", + "jiti": "^1.21.6", "lilconfig": "^2.1.0", - "micromatch": "^4.0.5", + "micromatch": "^4.0.8", "normalize-path": "^3.0.0", "object-hash": "^3.0.0", - "picocolors": "^1.0.0", - "postcss": "^8.4.23", + "picocolors": "^1.1.1", + "postcss": "^8.4.47", "postcss-import": "^15.1.0", "postcss-js": "^4.0.1", - "postcss-load-config": "^4.0.1", - "postcss-nested": "^6.0.1", - "postcss-selector-parser": "^6.0.11", - "resolve": "^1.22.2", - "sucrase": "^3.32.0" + "postcss-load-config": "^4.0.2", + "postcss-nested": "^6.2.0", + "postcss-selector-parser": "^6.1.2", + "resolve": "^1.22.8", + "sucrase": "^3.35.0" }, "bin": { "tailwind": "lib/cli.js", diff --git a/src/Ubik.Accounting.WebApp/package.json b/src/Ubik.Accounting.WebApp/package.json index 0a19faab..33ac0498 100644 --- a/src/Ubik.Accounting.WebApp/package.json +++ b/src/Ubik.Accounting.WebApp/package.json @@ -5,7 +5,7 @@ "dependencies": { "autoprefixer": "^10.4.16", "postcss": "^8.4.31", - "tailwindcss": "^3.4.14" + "tailwindcss": "^3.4.15" }, "devDependencies": { "@tailwindcss/forms": "^0.5.7", From 91d21dbade357683aaaa6d5c5ef8a1ab1a0f3b8b Mon Sep 17 00:00:00 2001 From: ubik Date: Fri, 15 Nov 2024 08:36:53 +0100 Subject: [PATCH 94/94] Remove unused usings --- .../Data/Init/CurrenciesData.cs | 4 +--- .../Features/Txs/Consumers/TxSubmittedConsumer.cs | 1 - .../Features/Txs/Errors/MoreThanOneMainEntryError.cs | 3 +-- .../Features/Txs/Services/ITxCommandService.cs | 1 - .../Features/Txs/Services/TxCommandService.cs | 3 --- src/Ubik.Accounting.Transaction.Api/Mappers/TxMappers.cs | 2 -- src/Ubik.Accounting.Transaction.Api/Models/Tx.cs | 4 +--- .../Entries/Enums/LinkType.cs | 8 +------- .../Txs/Commands/ChangeTxStateCommand.cs | 7 +------ .../Txs/Events/TxRejected.cs | 8 +------- .../Txs/Events/TxStateChanged.cs | 7 +------ .../Txs/Events/TxSubmitted.cs | 1 - .../Txs/Events/TxTaxValidationRequestSent.cs | 8 +------- .../Txs/Events/TxValidated.cs | 4 +--- src/Ubik.Accounting.WebApp/Program.cs | 3 --- src/Ubik.Accounting.WebApp/Security/UserService.cs | 4 +--- .../BaseIntegrationTestAccountingTx.cs | 7 +------ .../Accounting/Transaction/Txs/TxsController_Test.cs | 9 +-------- 18 files changed, 12 insertions(+), 72 deletions(-) diff --git a/src/Ubik.Accounting.Structure.Api/Data/Init/CurrenciesData.cs b/src/Ubik.Accounting.Structure.Api/Data/Init/CurrenciesData.cs index 8455d681..6de967d6 100644 --- a/src/Ubik.Accounting.Structure.Api/Data/Init/CurrenciesData.cs +++ b/src/Ubik.Accounting.Structure.Api/Data/Init/CurrenciesData.cs @@ -1,7 +1,5 @@ -using MassTransit; -using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore; using System.Runtime.CompilerServices; -using Ubik.Accounting.Structure.Api.Models; namespace Ubik.Accounting.Structure.Api.Data.Init { diff --git a/src/Ubik.Accounting.Transaction.Api/Features/Txs/Consumers/TxSubmittedConsumer.cs b/src/Ubik.Accounting.Transaction.Api/Features/Txs/Consumers/TxSubmittedConsumer.cs index 4fe18050..e9d21f99 100644 --- a/src/Ubik.Accounting.Transaction.Api/Features/Txs/Consumers/TxSubmittedConsumer.cs +++ b/src/Ubik.Accounting.Transaction.Api/Features/Txs/Consumers/TxSubmittedConsumer.cs @@ -1,6 +1,5 @@ using MassTransit; using Ubik.Accounting.Transaction.Api.Features.Txs.Services; -using Ubik.Accounting.Transaction.Api.Mappers; using Ubik.Accounting.Transaction.Contracts.Txs.Commands; using Ubik.Accounting.Transaction.Contracts.Txs.Enums; using Ubik.Accounting.Transaction.Contracts.Txs.Events; diff --git a/src/Ubik.Accounting.Transaction.Api/Features/Txs/Errors/MoreThanOneMainEntryError.cs b/src/Ubik.Accounting.Transaction.Api/Features/Txs/Errors/MoreThanOneMainEntryError.cs index e5dac71a..14c65d2c 100644 --- a/src/Ubik.Accounting.Transaction.Api/Features/Txs/Errors/MoreThanOneMainEntryError.cs +++ b/src/Ubik.Accounting.Transaction.Api/Features/Txs/Errors/MoreThanOneMainEntryError.cs @@ -1,5 +1,4 @@ -using Ubik.Accounting.Transaction.Contracts.Txs.Commands; -using Ubik.ApiService.Common.Errors; +using Ubik.ApiService.Common.Errors; namespace Ubik.Accounting.Transaction.Api.Features.Txs.Errors { diff --git a/src/Ubik.Accounting.Transaction.Api/Features/Txs/Services/ITxCommandService.cs b/src/Ubik.Accounting.Transaction.Api/Features/Txs/Services/ITxCommandService.cs index d9dc071d..1db83ba1 100644 --- a/src/Ubik.Accounting.Transaction.Api/Features/Txs/Services/ITxCommandService.cs +++ b/src/Ubik.Accounting.Transaction.Api/Features/Txs/Services/ITxCommandService.cs @@ -1,7 +1,6 @@ using LanguageExt; using Ubik.Accounting.Transaction.Api.Models; using Ubik.Accounting.Transaction.Contracts.Txs.Commands; -using Ubik.Accounting.Transaction.Contracts.Txs.Enums; using Ubik.Accounting.Transaction.Contracts.Txs.Events; using Ubik.ApiService.Common.Errors; diff --git a/src/Ubik.Accounting.Transaction.Api/Features/Txs/Services/TxCommandService.cs b/src/Ubik.Accounting.Transaction.Api/Features/Txs/Services/TxCommandService.cs index c23da935..2159d0e7 100644 --- a/src/Ubik.Accounting.Transaction.Api/Features/Txs/Services/TxCommandService.cs +++ b/src/Ubik.Accounting.Transaction.Api/Features/Txs/Services/TxCommandService.cs @@ -9,9 +9,6 @@ using Ubik.Accounting.Transaction.Api.Mappers; using Ubik.Accounting.Transaction.Contracts.Entries.Enums; using Ubik.Accounting.Transaction.Api.Models; -using Ubik.ApiService.Common.Services; -using Ubik.ApiService.Common.Configure; -using Ubik.Accounting.Transaction.Contracts.Txs.Enums; namespace Ubik.Accounting.Transaction.Api.Features.Txs.Services { diff --git a/src/Ubik.Accounting.Transaction.Api/Mappers/TxMappers.cs b/src/Ubik.Accounting.Transaction.Api/Mappers/TxMappers.cs index bca454e0..254d9c88 100644 --- a/src/Ubik.Accounting.Transaction.Api/Mappers/TxMappers.cs +++ b/src/Ubik.Accounting.Transaction.Api/Mappers/TxMappers.cs @@ -1,11 +1,9 @@ using LanguageExt; using MassTransit; -using MassTransit.Caching.Internals; using Ubik.Accounting.Transaction.Api.Models; using Ubik.Accounting.Transaction.Contracts.Txs.Commands; using Ubik.Accounting.Transaction.Contracts.Txs.Enums; using Ubik.Accounting.Transaction.Contracts.Txs.Events; -using Ubik.DB.Common.Models; namespace Ubik.Accounting.Transaction.Api.Mappers { diff --git a/src/Ubik.Accounting.Transaction.Api/Models/Tx.cs b/src/Ubik.Accounting.Transaction.Api/Models/Tx.cs index 5f1ac51f..2954584c 100644 --- a/src/Ubik.Accounting.Transaction.Api/Models/Tx.cs +++ b/src/Ubik.Accounting.Transaction.Api/Models/Tx.cs @@ -1,6 +1,4 @@ -using MassTransit; -using Ubik.Accounting.Transaction.Contracts.Txs.Enums; -using Ubik.DB.Common; +using Ubik.DB.Common; using Ubik.DB.Common.Models; namespace Ubik.Accounting.Transaction.Api.Models diff --git a/src/Ubik.Accounting.Transaction.Contracts/Entries/Enums/LinkType.cs b/src/Ubik.Accounting.Transaction.Contracts/Entries/Enums/LinkType.cs index c436ac71..4e33aa53 100644 --- a/src/Ubik.Accounting.Transaction.Contracts/Entries/Enums/LinkType.cs +++ b/src/Ubik.Accounting.Transaction.Contracts/Entries/Enums/LinkType.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Ubik.Accounting.Transaction.Contracts.Entries.Enums +namespace Ubik.Accounting.Transaction.Contracts.Entries.Enums { public enum LinkType { diff --git a/src/Ubik.Accounting.Transaction.Contracts/Txs/Commands/ChangeTxStateCommand.cs b/src/Ubik.Accounting.Transaction.Contracts/Txs/Commands/ChangeTxStateCommand.cs index 8a8b7ec3..b67a3833 100644 --- a/src/Ubik.Accounting.Transaction.Contracts/Txs/Commands/ChangeTxStateCommand.cs +++ b/src/Ubik.Accounting.Transaction.Contracts/Txs/Commands/ChangeTxStateCommand.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Ubik.Accounting.Transaction.Contracts.Txs.Enums; +using Ubik.Accounting.Transaction.Contracts.Txs.Enums; namespace Ubik.Accounting.Transaction.Contracts.Txs.Commands { diff --git a/src/Ubik.Accounting.Transaction.Contracts/Txs/Events/TxRejected.cs b/src/Ubik.Accounting.Transaction.Contracts/Txs/Events/TxRejected.cs index 15e5c34c..57823b0c 100644 --- a/src/Ubik.Accounting.Transaction.Contracts/Txs/Events/TxRejected.cs +++ b/src/Ubik.Accounting.Transaction.Contracts/Txs/Events/TxRejected.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Ubik.Accounting.Transaction.Contracts.Txs.Events +namespace Ubik.Accounting.Transaction.Contracts.Txs.Events { public class TxRejected { diff --git a/src/Ubik.Accounting.Transaction.Contracts/Txs/Events/TxStateChanged.cs b/src/Ubik.Accounting.Transaction.Contracts/Txs/Events/TxStateChanged.cs index 894f58cf..3c809483 100644 --- a/src/Ubik.Accounting.Transaction.Contracts/Txs/Events/TxStateChanged.cs +++ b/src/Ubik.Accounting.Transaction.Contracts/Txs/Events/TxStateChanged.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Ubik.Accounting.Transaction.Contracts.Txs.Enums; +using Ubik.Accounting.Transaction.Contracts.Txs.Enums; namespace Ubik.Accounting.Transaction.Contracts.Txs.Events { diff --git a/src/Ubik.Accounting.Transaction.Contracts/Txs/Events/TxSubmitted.cs b/src/Ubik.Accounting.Transaction.Contracts/Txs/Events/TxSubmitted.cs index d079dbef..0eac0c0a 100644 --- a/src/Ubik.Accounting.Transaction.Contracts/Txs/Events/TxSubmitted.cs +++ b/src/Ubik.Accounting.Transaction.Contracts/Txs/Events/TxSubmitted.cs @@ -1,5 +1,4 @@ using Ubik.Accounting.Transaction.Contracts.Entries.Enums; -using Ubik.Accounting.Transaction.Contracts.Txs.Enums; namespace Ubik.Accounting.Transaction.Contracts.Txs.Events { diff --git a/src/Ubik.Accounting.Transaction.Contracts/Txs/Events/TxTaxValidationRequestSent.cs b/src/Ubik.Accounting.Transaction.Contracts/Txs/Events/TxTaxValidationRequestSent.cs index f0afff23..2e499687 100644 --- a/src/Ubik.Accounting.Transaction.Contracts/Txs/Events/TxTaxValidationRequestSent.cs +++ b/src/Ubik.Accounting.Transaction.Contracts/Txs/Events/TxTaxValidationRequestSent.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Ubik.Accounting.Transaction.Contracts.Txs.Events +namespace Ubik.Accounting.Transaction.Contracts.Txs.Events { public record TxTaxValidationRequestSent { diff --git a/src/Ubik.Accounting.Transaction.Contracts/Txs/Events/TxValidated.cs b/src/Ubik.Accounting.Transaction.Contracts/Txs/Events/TxValidated.cs index 6495ece5..9fe9f909 100644 --- a/src/Ubik.Accounting.Transaction.Contracts/Txs/Events/TxValidated.cs +++ b/src/Ubik.Accounting.Transaction.Contracts/Txs/Events/TxValidated.cs @@ -1,6 +1,4 @@ -using Ubik.Accounting.Transaction.Contracts.Entries.Enums; - -namespace Ubik.Accounting.Transaction.Contracts.Txs.Events +namespace Ubik.Accounting.Transaction.Contracts.Txs.Events { public record class TxValidated { diff --git a/src/Ubik.Accounting.WebApp/Program.cs b/src/Ubik.Accounting.WebApp/Program.cs index 456e6d68..b1f067c3 100644 --- a/src/Ubik.Accounting.WebApp/Program.cs +++ b/src/Ubik.Accounting.WebApp/Program.cs @@ -1,13 +1,10 @@ using Microsoft.AspNetCore.Authentication.Cookies; using Microsoft.AspNetCore.Authentication.OpenIdConnect; -using Microsoft.AspNetCore.Components.Server.Circuits; -using Microsoft.Extensions.DependencyInjection.Extensions; using System.IdentityModel.Tokens.Jwt; using System.Security.Claims; using Ubik.Accounting.WebApp.ApiClients; using Ubik.Accounting.WebApp.Components; using Ubik.Accounting.WebApp.Security; -using static Ubik.Accounting.WebApp.Security.UserService; using Ubik.ApiService.Common.Configure.Options; using Ubik.Accounting.WebApp.Render; using Ubik.Accounting.Webapp.Shared.Render; diff --git a/src/Ubik.Accounting.WebApp/Security/UserService.cs b/src/Ubik.Accounting.WebApp/Security/UserService.cs index c7d8eed2..28b010b6 100644 --- a/src/Ubik.Accounting.WebApp/Security/UserService.cs +++ b/src/Ubik.Accounting.WebApp/Security/UserService.cs @@ -1,6 +1,4 @@ -using Microsoft.AspNetCore.Components.Authorization; -using Microsoft.AspNetCore.Components.Server.Circuits; -using System.Security.Claims; +using System.Security.Claims; using Ubik.Security.Contracts.Users.Results; namespace Ubik.Accounting.WebApp.Security diff --git a/tests/Ubik.Api.Tests.Integration/BaseIntegrationTestAccountingTx.cs b/tests/Ubik.Api.Tests.Integration/BaseIntegrationTestAccountingTx.cs index 096d5983..96f3271b 100644 --- a/tests/Ubik.Api.Tests.Integration/BaseIntegrationTestAccountingTx.cs +++ b/tests/Ubik.Api.Tests.Integration/BaseIntegrationTestAccountingTx.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Net.Http.Headers; -using System.Text; -using System.Threading.Tasks; +using System.Net.Http.Headers; namespace Ubik.Api.Tests.Integration { diff --git a/tests/Ubik.Api.Tests.Integration/Features/Accounting/Transaction/Txs/TxsController_Test.cs b/tests/Ubik.Api.Tests.Integration/Features/Accounting/Transaction/Txs/TxsController_Test.cs index 32469359..97227443 100644 --- a/tests/Ubik.Api.Tests.Integration/Features/Accounting/Transaction/Txs/TxsController_Test.cs +++ b/tests/Ubik.Api.Tests.Integration/Features/Accounting/Transaction/Txs/TxsController_Test.cs @@ -1,13 +1,6 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Net.Http.Headers; +using System.Net.Http.Headers; using System.Net.Http.Json; using System.Net; -using System.Text; -using System.Threading.Tasks; -using Ubik.Accounting.SalesOrVatTax.Contracts.AccountTaxRateConfigs.Commands; -using Ubik.Accounting.SalesOrVatTax.Contracts.AccountTaxRateConfigs.Results; using Ubik.Accounting.Transaction.Contracts.Txs.Commands; using Ubik.Accounting.Transaction.Contracts.Txs.Events; using FluentAssertions;