kwartzlab / kos-base

KwartzlabOS
3 stars 0 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 3 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;