yashovardhan99 / HealersDiary

Healers Diary - an android app for healers to keep track of their patients and help in instant billing. The app is currently in development.
https://play.google.com/store/apps/details?id=com.yashovardhan99.healersdiary&utm_source=github&utm_campaign=github&pcampaignid=MKT-Other-global-all-co-prtnr-py-PartBadge-Mar2515-1
Apache License 2.0
8 stars 0 forks source link

Refactor Dashboard #54

Closed yashovardhan99 closed 2 years ago

yashovardhan99 commented 3 years ago

Stats from SQL

Instead of manually adding up/counting totals, we can use SQL directly to get count and sums for stats

This will give us the no. of healings between 2 dates:-

SELECT COUNT(*) FROM healings  WHERE time BETWEEN :startDate AND :endDate

And this will give the total earnings (= sum of healings charges) between 2 dates.

SELECT SUM(charge) FROM healings  WHERE time BETWEEN :startDate AND :endDate

We can use these directly to improve home page performance.

Paging

We can now add paging in dashboard for all activities till date. This allows us to create an endless scrolling page with much faster performance.

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.