I use Python / Django, but it's more about the “data model” and how I interact with the information - I really just want to know if I'm crazy here.
I am working on a small application in my company (~ 55 employees) that will track the available vacation time / time. Part of the goal is to integrate self-service into our intranet so that employees can send Time Requests electronically instead of filling out and submitting the document to HR.
Obviously, this application should maintain the current balance for one employee and will verify that the employee has enough leave remaining for everything that they request.
As with financial / accounting software, I know that I don't have to store floating point values or just keep one working balance.
My idea is to use the database table structure, for example, to store "credits" and "debits":
Employee | Year | Credit/Debit | Amount | Timestamp
“Year” is the year to which the credit / debit relates, since holidays and sick time are processed on an annual basis, and not on the current balance per employee.
To determine which employees are available for vacation / time, I get "transactions" for the employee for the given year and find the balance.
, , : ,, , ?