import type { CreateJournalEntryRequest, UpdateJournalEntryRequest, JournalEntryQuery, PostJournalEntryRequest, ReverseJournalEntryRequest } from "@prodobit/types"; import type { Database } from "@prodobit/database"; import Decimal from "decimal.js"; export declare class JournalEntryService { private db; constructor(db: Database); /** * List journal entries with filters */ listJournalEntries(tenantId: string, filters?: Partial): Promise<{ id: string; tenantId: string; entryNumber: string; entryDate: string; postingDate: string; reference: string | null; description: string; status: string; entryType: string; sourceModule: string | null; sourceDocumentId: string | null; debitTotal: Decimal; creditTotal: Decimal; currency: string; reversedEntryId: string | null; reversalReason: string | null; isRecurring: boolean; recurringScheduleId: string | null; approvalStatus: string | null; approvedBy: string | null; approvedAt: Date | null; entryHash: string | null; createdBy: string; insertedAt: Date; updatedAt: Date; deletedAt: Date | null; }[]>; /** * Get a single journal entry by ID with lines */ getJournalEntry(entryId: string, tenantId: string): Promise<{ lines: { id: string; lineNumber: number; accountId: string; accountCode: string | null; accountName: string | null; debit: Decimal; credit: Decimal; description: string | null; costCenterId: string | null; projectId: string | null; departmentId: string | null; currency: string; exchangeRate: Decimal | null; isReconciled: boolean; }[]; id: string; tenantId: string; entryNumber: string; entryDate: string; postingDate: string; reference: string | null; description: string; status: string; entryType: string; sourceModule: string | null; sourceDocumentId: string | null; debitTotal: Decimal; creditTotal: Decimal; currency: string; reversedEntryId: string | null; reversalReason: string | null; isRecurring: boolean; recurringScheduleId: string | null; approvalStatus: string | null; approvedBy: string | null; approvedAt: Date | null; entryHash: string | null; createdBy: string; insertedAt: Date; updatedAt: Date; deletedAt: Date | null; } | null>; /** * Generate next entry number */ generateEntryNumber(tenantId: string, prefix?: string): Promise; /** * Create a new journal entry (draft) */ createJournalEntry(tenantId: string, data: CreateJournalEntryRequest, userId: string): Promise<{ lines: { id: string; lineNumber: number; accountId: string; accountCode: string | null; accountName: string | null; debit: Decimal; credit: Decimal; description: string | null; costCenterId: string | null; projectId: string | null; departmentId: string | null; currency: string; exchangeRate: Decimal | null; isReconciled: boolean; }[]; id: string; tenantId: string; entryNumber: string; entryDate: string; postingDate: string; reference: string | null; description: string; status: string; entryType: string; sourceModule: string | null; sourceDocumentId: string | null; debitTotal: Decimal; creditTotal: Decimal; currency: string; reversedEntryId: string | null; reversalReason: string | null; isRecurring: boolean; recurringScheduleId: string | null; approvalStatus: string | null; approvedBy: string | null; approvedAt: Date | null; entryHash: string | null; createdBy: string; insertedAt: Date; updatedAt: Date; deletedAt: Date | null; } | null>; /** * Update a draft journal entry */ updateJournalEntry(entryId: string, tenantId: string, data: UpdateJournalEntryRequest, userId: string): Promise<{ lines: { id: string; lineNumber: number; accountId: string; accountCode: string | null; accountName: string | null; debit: Decimal; credit: Decimal; description: string | null; costCenterId: string | null; projectId: string | null; departmentId: string | null; currency: string; exchangeRate: Decimal | null; isReconciled: boolean; }[]; id: string; tenantId: string; entryNumber: string; entryDate: string; postingDate: string; reference: string | null; description: string; status: string; entryType: string; sourceModule: string | null; sourceDocumentId: string | null; debitTotal: Decimal; creditTotal: Decimal; currency: string; reversedEntryId: string | null; reversalReason: string | null; isRecurring: boolean; recurringScheduleId: string | null; approvalStatus: string | null; approvedBy: string | null; approvedAt: Date | null; entryHash: string | null; createdBy: string; insertedAt: Date; updatedAt: Date; deletedAt: Date | null; } | null>; /** * Calculate entry hash for integrity (Sardis-ready) */ private calculateEntryHash; /** * Post a journal entry (make it immutable) */ postJournalEntry(entryId: string, tenantId: string, data: PostJournalEntryRequest | null, userId: string): Promise<{ lines: { id: string; lineNumber: number; accountId: string; accountCode: string | null; accountName: string | null; debit: Decimal; credit: Decimal; description: string | null; costCenterId: string | null; projectId: string | null; departmentId: string | null; currency: string; exchangeRate: Decimal | null; isReconciled: boolean; }[]; id: string; tenantId: string; entryNumber: string; entryDate: string; postingDate: string; reference: string | null; description: string; status: string; entryType: string; sourceModule: string | null; sourceDocumentId: string | null; debitTotal: Decimal; creditTotal: Decimal; currency: string; reversedEntryId: string | null; reversalReason: string | null; isRecurring: boolean; recurringScheduleId: string | null; approvalStatus: string | null; approvedBy: string | null; approvedAt: Date | null; entryHash: string | null; createdBy: string; insertedAt: Date; updatedAt: Date; deletedAt: Date | null; } | null>; /** * Reverse a posted journal entry */ reverseJournalEntry(entryId: string, tenantId: string, data: ReverseJournalEntryRequest, userId: string): Promise<{ lines: { id: string; lineNumber: number; accountId: string; accountCode: string | null; accountName: string | null; debit: Decimal; credit: Decimal; description: string | null; costCenterId: string | null; projectId: string | null; departmentId: string | null; currency: string; exchangeRate: Decimal | null; isReconciled: boolean; }[]; id: string; tenantId: string; entryNumber: string; entryDate: string; postingDate: string; reference: string | null; description: string; status: string; entryType: string; sourceModule: string | null; sourceDocumentId: string | null; debitTotal: Decimal; creditTotal: Decimal; currency: string; reversedEntryId: string | null; reversalReason: string | null; isRecurring: boolean; recurringScheduleId: string | null; approvalStatus: string | null; approvedBy: string | null; approvedAt: Date | null; entryHash: string | null; createdBy: string; insertedAt: Date; updatedAt: Date; deletedAt: Date | null; } | null>; /** * Delete a draft journal entry */ deleteJournalEntry(entryId: string, tenantId: string): Promise<{ lines: { id: string; lineNumber: number; accountId: string; accountCode: string | null; accountName: string | null; debit: Decimal; credit: Decimal; description: string | null; costCenterId: string | null; projectId: string | null; departmentId: string | null; currency: string; exchangeRate: Decimal | null; isReconciled: boolean; }[]; id: string; tenantId: string; entryNumber: string; entryDate: string; postingDate: string; reference: string | null; description: string; status: string; entryType: string; sourceModule: string | null; sourceDocumentId: string | null; debitTotal: Decimal; creditTotal: Decimal; currency: string; reversedEntryId: string | null; reversalReason: string | null; isRecurring: boolean; recurringScheduleId: string | null; approvalStatus: string | null; approvedBy: string | null; approvedAt: Date | null; entryHash: string | null; createdBy: string; insertedAt: Date; updatedAt: Date; deletedAt: Date | null; }>; /** * Update account balances after posting */ private updateAccountBalances; } //# sourceMappingURL=JournalEntryService.d.ts.map