Given a stream of card transaction records, each containing fields: id, date, card_type, and amount — produce output records with the same fields but replacing 'amount' with an accumulated (running) total, effectively implementing a group-by aggregation over the relevant fields. A…