- Read Tutorial
- Watch Guide Video
In this guide, we are going to plan the audit log functionality.
Essentially, the goal of an audit log is to keep track if an employee had logged overtime or not. Remember, these are salaried employees, so logging overtime may not be the norm. This means, not all employees would log overtime every week.
Based on this goal, our dependency will be that it needs to be connected to a user
.
That's probably the only requirement we need right away because I don't think it needs to be associated with posts at this time.
So, the attributes that we'll use include are going to be:
status
with the type ofinteger
. We are going to use only two options, namely, pending and complete.start_date
with thedate
data type. Since we need our audit log to be weekly, the default value should be the previous Monday. Based on my conversations with the client, most overtime will occur over the weekends, so it makes sense to send the notification on Sunday evening, and have the default value as the previous week.date_verified
with thedate
data type. This will be the date when the user logs in and confirms if they had overtime. This will be nil to start with.
This should give us what we need to get started. Let's start implementing it in the next guide.