[add]: pending salaries

This commit was merged in pull request #26.
This commit is contained in:
VivianDee
2025-06-19 12:49:15 +01:00
parent a105cf2a99
commit 31e38da473
3 changed files with 28 additions and 2 deletions
+12 -1
View File
@@ -57,4 +57,15 @@ class Salary(db.Model):
except Exception as e:
db.session.rollback()
logger.info(f"error : {str(e)}")
raise Exception(f"Error adding salary data: {str(e)}")
raise Exception(f"Error adding salary data: {str(e)}")
@classmethod
def get_pending_salaries(cls):
"""
Retrieve all salary entries with status 'START', ordered by ID ascending.
"""
try:
return cls.query.filter_by(status='START').order_by(cls.id.asc()).all()
except Exception as e:
logger.error(f"Error fetching pending salaries: {str(e)}")
return []