feat(investment): settle purchases from Holdings; broken-period interest to settlement date

- Purchases are saved as Pending Settlement. Holdings show the status and
  a Settle button (from the settlement date), and the GL transaction id
  once settled.
- The transaction log shows "Not posted (pending settlement)" until a
  deal is settled, and dates the purchase on its settlement date.
- Broken-period interest is counted up to the settlement date.
- Accounting Preview title and the Holdings Settlement Date column
  reflect settlement-date posting.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-14 10:28:19 +05:30
co-authored by Claude Opus 5.5
parent 6a04a92113
commit c803e20628
4 changed files with 66 additions and 16 deletions
+14 -1
View File
@@ -12,6 +12,7 @@ import { Observable, forkJoin } from 'rxjs';
import { map, tap } from 'rxjs/operators';
import {
DailyScriptRate,
HoldingStatus,
InstrumentType,
InvestmentHolding,
PARTY_MASTER,
@@ -119,6 +120,8 @@ export interface InvestmentPurchaseDto {
crGlName: string;
otherDetails?: string;
status: string;
glTransactionId?: string;
settledOnDate?: string;
}
export interface InvestmentGlAccount {
@@ -200,6 +203,14 @@ export class InvestmentService {
return this.http.delete(`/investment/daily-rates/${rateId}`);
}
/** Settles a deal: posts it to GL dated its settlement date. Under maker-checker the response only says it awaits approval. */
settlePurchase(purchaseId: number): Observable<{ transactionId?: string; rollbackTransaction?: boolean }> {
return this.http.post<{ transactionId?: string; rollbackTransaction?: boolean }>(
`/investment/purchases/${purchaseId}/settle`,
{}
);
}
createPurchase(body: object): Observable<{ resourceId: number; resourceIdentifier: string }> {
return this.http.post<{ resourceId: number; resourceIdentifier: string }>('/investment/purchases', body);
}
@@ -316,7 +327,9 @@ export function toHolding(p: InvestmentPurchaseDto): InvestmentHolding {
glName: p.investmentGlName,
crToAc: p.crGlCode,
brokerCode: '',
status: 'ACTIVE',
status: p.status as HoldingStatus,
settlementDate: p.settlementDate,
glTransactionId: p.glTransactionId,
category: p.category,
bookValue: p.bookValue,
settlementAmount: p.settlementAmount