payroll-in-python
payroll-in-python copied to clipboard
An Implementation of a Payroll Application for comparison and show of good design
Use Cases:
- Add a new employee
- Delete an employee
- Post a time card
- Post a sales receipt
- Post a union service charge
- Change employee details
- Run the payroll for today
Use Case 1: Add new Employee
A new employee is added by the receipt of an AddEmp Transaction. This Transaction contains the employee's name, address, and assigned employee number. The transaction has three forms:
- AddEmp <EmpID> "
" "" H - AddEmp <EmpID> "
" "" S - AddEmp <EmpID> "
" "" C
The employee record is created with its fields assigned appropriately.
Alternative 1: An error in the transaction structure
If the transaction structure is inappropriate, it is printed out in an error message, and no action is taken
Use Case 2: Deleting an Employee
Employees are deleted when a DelEmp transaction is received. The form of this transaction is as follows:
DelEmp <EmpID>
When this transaction is received, trhe appropriate employee record is deleted.
Alternative 1: Invalid or unknown EmpID
If the <EmpID> field is not structured correctly or does not refer to a valid employee record, the transaction is pinted with an error message, and no other action is taken.
Use Case 3: Post a Time Card
On receipt of a TimeCard transaction, the system will create a time card record an associate it with the appropriate employee record.
TimeCard <EmpID>
Alternative 1: The selected employee is not hourly
The system will print an appropriate error message and take no further action.
Alternative 2: An error in the transaction structure
The system will print an appropriate error message and take no further action.
Use Case 4: Post a Sales Receipt
On receipt of the SalesReceipt Transaction, the system will create a new salesreceipt record and associate it with the appropriate commissioned employee.
SalesReceipt <EmpID>
Alternative 1: The selected employee not commissioned
The system will print an appropriate error message and take no further action.
Alternative 2: An error in the transaction structure
The system will print an appropriate error message and take no further action.
Use Case 5: Post a Union Service Charge
On receipt of this transaction, the system will create a service-charge record and associate it with the appropriate union member.
ServiceCharge <memberID>
Alternative 1: Poorly formed transaction
If the transaction is not well formed or if the <memberID> does not refer to an existing union member, the transaction is printed with an appropriate error message.
Use Case 6: Changing Employee Details
Upon receipt of this transaction, the system will alter one of the details of the appropriate employee record. There are several possible variations to this transaction.
ChgEmp <EmpID> Name
Alternative 1: Transaction errors
If the structure of the transaction is improper, <EmpID> does not refer to a real employee, or <memberID> alreday refers to a member, the system will print a suitable error and take no further action.
Use Case 7: Run the Payroll for today
On receipt of the payday transaction, the system finds all those employees that should be paid on the specified date. The system then determines how much they are owed and pays them according to ther selected payment method. An audit-trail report is printed showing the action taken for each employee.
Payday