compare_periods
ChatGPTCompares spending or income between two inclusive date ranges. delta is the second period minus the first. percentChange is null when the first amount is zero. partial is true when the second period ends today and its week (a range of 7 days or less that does not end on Sunday) or calendar month (a longer range that does not end on the last day of the month) is not finished. Do not call a partial period a complete month or week. LOAN_PAYMENTS (credit-card and loan payments) are already left out of spending, because those amounts are also purchases on the card. Do not add them back. Totals already leave out a transfer between the user's own linked accounts. A card payment is the same amount leaving a depository account and arriving on a credit account within 3 days, with no merchant on either side. A transfer between two depository accounts counts only when both names share one number of at least 6 digits. internalTransferAmount is already removed from this total. Do not add it back. On get_cash_flow that field is the spending side plus the income side. An unmatched TRANSFER_IN or TRANSFER_OUT is a transfer with another person and stays in the total. transferInAmount and transferOutAmount are that unmatched portion already inside the total. Do not add them to the total or subtract them. If the other account is not linked, no pair is found and the transaction stays in the total. transferAmount is transferOutAmount for spending and transferInAmount for income.




