Evergreen farms (pos) - Feature #7462: implement multiple payments in expenses

Anonymous
2026-02-04T11:30:18Z

% Done changed from 0 to 100

Added payments array in Expense schema to track multiple payments.

Added paidAmount and dueAmount fields, calculated automatically with Mongoose pre-save hooks.

Created API to add payments with validation to prevent overpayment.

Updated GET API to filter expenses by paidBy inside the payments array using aggregation

write an apis for for expense stats

alter get expense apis make sure to support latest chages without crashing