You can write a simple logic to do single account aggregation. Refer to my article below where I have developed the quicklink approach to do the Single Account Aggregation. You can copy the logic of single account aggregation and use it in after provisioning rule.