Repair botched rebase resolutions from ui-bug-fixers

The rebase onto Dev resolved five conflicts; four were wrong. In the
service files Dev's constructor parameter lists won while the branch's
field declarations and constructor bodies stayed, so the bodies assigned
parameters that no longer existed.

- AdjustmentService: restore fifo, approvals, db and serialTracking
  parameters (Dev's glAccounts kept, configuration dropped).
- FifoCostingService: restore the LowStockTracker field, parameter and
  assignment.
- CountService: restore _serialTracking and _adjustments, and delete
  Dev's PostAdjustmentJournalAsync. Dev's call site did not survive the
  rebase, so the method was orphaned dead code referencing fields this
  class no longer has. The branch routes count variances through
  AdjustmentService.SubmitAsync, which posts via Dev's role-keyed
  glCodes, so nothing is lost by removing it.
- PurchaseInvoicePaymentService: this one compiled. paymentDay was
  computed but the GL period and EntryDate still used now, so a
  back-dated payment posted its journal to today's period. Use
  paymentDay, and resolve "today" through BusinessClock, matching
  SalesInvoicePaymentService.
- ErpDbContextModelSnapshot: the resolution dropped the whole Expense
  module from the definition and relationship sections while leaving its
  navigation entries behind, so the snapshot no longer loaded. Rebuilt as
  the branch's snapshot plus Dev's GlAccountConfig blocks; EF now reports
  no pending model changes.

Tests: BankDepositTestSupport's FakeGeneralLedger gains the
ListAccountsAsync member Dev added to IGeneralLedgerService, and
DualApprovalTests passes a StubGlAccountConfigService in place of the
removed IConfiguration.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
2026-10-14 09:44:32 +05:30
parent d0354ed169
commit 3be425284c
7 changed files with 657 additions and 49 deletions
+5 -1
View File
@@ -9,6 +9,7 @@ using ERPCore.Infra.Auth;
using ERPCore.Infra.Persistence;
using ERPCore.Repositories;
using ERPCore.Services;
using ERPCore.Services.Gl;
using ERPCore.Services.Interfaces;
using ERPCore.Services.Stock;
using ERPCore.System.Errors;
@@ -300,7 +301,10 @@ public class DualApprovalTests
new Repository<StockAdjustment>(db), new Repository<Warehouse>(db), new Repository<Item>(db),
new Repository<ReasonCode>(db), new Repository<StockLedger>(db), mutator, new FixedValuation(),
numbers, user, new FakeBranchConfig(), notifications, approvals, uow, db, gl,
new ConfigurationBuilder().Build(),
new StubGlAccountConfigService(
(GlAccountRole.Inventory, "1200"),
(GlAccountRole.InventoryGain, "4900"),
(GlAccountRole.InventoryLoss, "5900")),
new SerialTrackingService(new Repository<Serial>(db), new Repository<SerialMovement>(db), new Repository<StockLayer>(db),
new Repository<ProductConfig>(db), user));
var prices = new PriceAdjustmentService(
@@ -45,6 +45,10 @@ internal sealed class FakeGeneralLedger : IGeneralLedgerService
public Task<GlPeriod> GetPeriodByDateAsync(DateOnly date, CancellationToken ct) => Task.FromResult(new GlPeriod(1, 1));
public Task<IReadOnlyList<GlBankAccount>> ListBankAccountsAsync(CancellationToken ct) => Task.FromResult(Accounts);
/// <summary>Not implemented on purpose — nothing here picks a GL account by code; see
/// <see cref="StubGeneralLedgerService"/> for the fake that does.</summary>
public Task<IReadOnlyList<GlAccount>> ListAccountsAsync(CancellationToken ct) => throw new NotSupportedException();
}
/// <summary>The in-memory provider has no transactions: run the work, then save — what the real one commits.</summary>