feat(purchase): add per-purchase participant splits

This commit is contained in:
2026-03-11 14:34:27 +04:00
parent 98988159eb
commit 8401688032
26 changed files with 5050 additions and 114 deletions

View File

@@ -22,5 +22,6 @@ export type {
SettlementMemberLine,
SettlementPurchaseInput,
SettlementResult,
PurchaseSplitMode,
UtilitySplitMode
} from './settlement-primitives'

View File

@@ -3,6 +3,7 @@ import type { BillingCycleId, MemberId, PurchaseEntryId } from './ids'
import type { Money } from './money'
export type UtilitySplitMode = 'equal' | 'weighted_by_days'
export type PurchaseSplitMode = 'equal' | 'custom_amounts'
export interface SettlementMemberInput {
memberId: MemberId
@@ -19,6 +20,11 @@ export interface SettlementPurchaseInput {
payerId: MemberId
amount: Money
description?: string
splitMode?: PurchaseSplitMode
participants?: readonly {
memberId: MemberId
shareAmount?: Money
}[]
}
export interface SettlementInput {