OpenBCM.Server.TrialDisbursement 0.1.0
OpenBCM.Server.TrialDisbursement
The trial disbursement calculation engine for OpenBCM: the port of the Delphi
TTWTrialDisburse, retargeted from a Windows desktop application to a
cross-platform server library.
using OpenBCM.Server.TrialDisbursement;
using OpenBCM.Server.TrialDisbursement.ArrearsInterest;
using OpenBCM.Server.TrialDisbursement.Data;
using OpenBCM.Server.TrialDisbursement.Delinquency;
using OpenBCM.Server.TrialDisbursement.Engine;
using OpenBCM.Server.TrialDisbursement.GradClaimPayment;
using OpenBCM.Server.TrialDisbursement.MinToUnsecured;
// The four helper steps that replace the legacy mid-run .exe launches. Use the
// NoOp implementations until each is ported; they warn instead of running.
using var engine = new TrialDisburseEngine(
new NoOpGradClaimPaymentUpdater(),
new NoOpMinToUnsecuredAdjuster(),
new NoOpArrearsInterestRecalculator(),
new NoOpDelinquencyUpdater());
engine.OnProgress = (caption, level) => logger.Log(caption, level);
// Three physically separate connections - the engine reads on one while it
// writes on another and runs a nested query on the third.
engine.Connect(selectConnection, execConnection, subSelectConnection);
// The token suffixes this run's work tables. On a server give every run its own
// (a job id, a GUID): all requests share one service account, so the legacy
// Environment.UserName default would let two concurrent runs collide.
engine.LoadConfiguration(runToken);
engine.Run(new TrialDisburseOptions
{
FromCase = caseNumber,
RunForDate = "08/31/2026",
DisbConf = true,
UserID = runToken, // suffixes CurrDisburseWk; keep it equal to the token
});
// A completed run with warnings did less than the Delphi original would have:
// each one names a helper step that reported it did not run. Say so.
foreach (string warning in engine.Warnings) report.Add(warning);
// The engine drops and re-creates its work tables at the start of a run and
// never at the end, so a per-run token leaves five tables behind every time.
// Read what the run produced out of them first, then drop them.
using (var cleanup = TrusteeConnection.Open(execConnection))
WorkTableCleanup.Drop(cleanup, engine.TempSchema, engine.UserID);
A run produces three reports, and Printing/ in this package renders all three
to PDF bytes. TrialDisburseReportGenerator.AttachTo(engine) swaps the engine's
SAPrint sink — which defaults to NullSAPrintReport and discards everything —
for PdfSAPrintReport, and the finished PDFs are collected from it afterwards.
It has to be attached before Run: CheckstoTrustee and
No Fee Adjustments Report are printed part-way through the run, off work tables
that no longer hold that state once it ends, so they cannot be regenerated. The
third, TrialDisburse, is the single-case results printout;
GenerateDisplayReport produces it after the run, from the run's work tables, so
it too has to be produced before those tables are dropped.
See the solution-level README for where this came from, what changed on the way across from the Windows port, and the known divergences.
No packages depend on OpenBCM.Server.TrialDisbursement.
Initial release. The engine only: no printing implementation ships with it, and the four external helper programs the Delphi engine shelled out to are now injected interfaces supplied by the caller.
.NET 10.0
- OpenBCM.Server.Bankruptcy (>= 0.3.38)
- OpenBCM.Server.Reports (>= 0.1.0)
- OpenBCM.Server.TrialDisbursement.ArrearsInterest (>= 0.1.0)
- OpenBCM.Server.TrialDisbursement.Delinquency (>= 0.1.0)
- OpenBCM.Server.TrialDisbursement.GradClaimPayment (>= 0.1.0)
- OpenBCM.Server.TrialDisbursement.MinToUnsecured (>= 0.1.0)
- Microsoft.EntityFrameworkCore (>= 10.0.11)
- Microsoft.EntityFrameworkCore.SqlServer (>= 10.0.11)
- PDFsharp (>= 6.1.1)
| Version | Downloads | Last updated |
|---|---|---|
| 0.1.0 | 15 | 08/26/2026 |