ofcoop-shared-core 0.1.0-alpha.2 → 0.1.0-alpha.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,6 @@
1
1
  import type { SavingLedgerContract } from '../contracts/SavingLedgerContract.js';
2
+ import { type FinanceAccount, type FinanceDbAdapterLike, type FinanceProjectionServicesRef, type FinanceSyncEnqueuer, type JournalDraftInput } from 'offinance-shared-core';
3
+ import type { ServiceRuntimeOptions } from '../services/impl/runtimeSupport.js';
2
4
  export interface ScopedAccountMapping<TMapping> {
3
5
  default: TMapping;
4
6
  byTenant?: Record<string, Partial<TMapping>>;
@@ -30,4 +32,21 @@ export interface ProjectCoopSavingFinanceInput {
30
32
  journalId?: string;
31
33
  referencePrefix?: string;
32
34
  }
35
+ export interface BuildCoopSavingJournalDraftOptions {
36
+ ledgerProfileId: string;
37
+ financeDomainId?: string;
38
+ }
39
+ export interface CreateCoopSavingFinanceRuntimeOptions {
40
+ dbAdapter: FinanceDbAdapterLike;
41
+ resolveFinanceServices: () => FinanceProjectionServicesRef | null;
42
+ resolveLedgerProfileId: () => string;
43
+ resolveSyncEnqueuer?: () => FinanceSyncEnqueuer | null;
44
+ requiredAccounts: FinanceAccount[];
45
+ savingAccountMapping: ScopedAccountMapping<CoopSavingAccountMapping>;
46
+ financeDomainId?: string;
47
+ missingServicesErrorCode?: string;
48
+ missingLedgerProfileErrorCode?: string;
49
+ }
33
50
  export declare function projectSavingLedgerToScopedFinance(input: ProjectCoopSavingFinanceInput): CoopSavingFinanceProjection;
51
+ export declare function buildJournalDraftFromCoopSavingFinanceProjection(projection: CoopSavingFinanceProjection, options: BuildCoopSavingJournalDraftOptions): JournalDraftInput;
52
+ export declare function createCoopSavingFinanceRuntimeOptions(options: CreateCoopSavingFinanceRuntimeOptions): Partial<ServiceRuntimeOptions>;