kwartzlab / kos-base

KwartzlabOS
4 stars 1 forks source link

feature request: user access report #1

Open john-potts opened 2 years ago

john-potts commented 2 years ago

I would like to be able to specify a member and a range of time, and receive a report stating whether or not they used their fob within that time period.

this is intended to be used in distinguishing "abandoned" memberships vs members who used the space without paying and were subsequently terminated for non-payment.

IanEdington commented 5 months ago

This is currently being accomplished with the following query

select u.first_name,
       u.last_name,
       u.id user_id,
       max(lock_in) most_recent_visit,
       min(lock_in) first_visit
        from kos.authentications a
join kos.users u on a.user_id = u.id
        where u.id = <user_id>
         group by u.id
limit 100;
Kpapadak1 commented 4 weeks ago

We need a portal/report be created so that a non-technical BOD member do this? having to do DB queries is not an easy thing for people that do not have access or understand how the backend works. Also this report should show what door and tools where used with their fob

IanEdington commented 4 weeks ago
-- who used the table saw in the last 48 hours
select a.lock_in,
       concat(u.first_name, ' ', u.last_name) full_name,
       g.name gatekeeper
from kos.authentications a
         join kos.users u on a.user_id = u.id
         join kos.gatekeepers g on a.gatekeeper_id = g.id
where a.created_at >= now() - interval 2 day
order by 1