diff --git a/CHANGELOG.md b/CHANGELOG.md index d367990..74c55e4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,16 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [1.3.0] - 2025-08-23 + +### Changed +- **Standardized Default Absence Codes:** Replaced the initial Spanish absence codes (e.g., "LICENCIA MÉDICA") with a set of universal, English-language defaults (e.g., "Sick Leave", "Vacation"). This provides a more consistent out-of-the-box experience for new users. +- Refactored the data initialization script (`init_data.py`) by extracting the default codes into a constant, improving readability and maintainability. + +### Removed +- Removed the unused `ABSENCE_CODES` list from the `config.py` file. This eliminates redundancy and establishes the database as the single source of truth for absence codes. + + ## [1.2.3] - 2025-08-22 ### Added @@ -148,6 +158,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 +[1.3.0]: https://github.com/PPeitsch/TimeTrack/compare/v1.2.3...v1.3.0 [1.2.3]: https://github.com/PPeitsch/TimeTrack/compare/v1.2.2...v1.2.3 [1.2.2]: https://github.com/PPeitsch/TimeTrack/compare/v1.2.1...v1.2.2 [1.2.1]: https://github.com/PPeitsch/TimeTrack/compare/v1.2.0...v1.2.1 @@ -163,4 +174,4 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 [1.0.3]: https://github.com/PPeitsch/TimeTrack/compare/v1.0.2...v1.0.3 [1.0.2]: https://github.com/PPeitsch/TimeTrack/compare/v1.0.1...v1.0.2 [1.0.1]: https://github.com/PPeitsch/TimeTrack/compare/v1.0.0...v1.0.1 -[1.0.0]: https://github.com/PPeitsch/TimeTrack/releases/tag/v1.0.0 +[1.0.0]: https://github.com/PPeitsch/TimeTrack/releases/tag/v1.0.0 \ No newline at end of file diff --git a/app/config/config.py b/app/config/config.py index 64a5ced..ad8fbcb 100644 --- a/app/config/config.py +++ b/app/config/config.py @@ -18,12 +18,3 @@ class Config: # Configuración horaria WORKING_HOURS_PER_DAY = 8 WORKING_DAYS_PER_WEEK = 5 - - ABSENCE_CODES = [ - "LAR", - "FRANCO COMPENSATORIO", - "LICENCIA MÉDICA", - "COMISIÓN DE SERVICIO", - "EXAMEN", - "LICENCIA SIN GOCE", - ] diff --git a/app/utils/init_data.py b/app/utils/init_data.py index fda579d..589093c 100644 --- a/app/utils/init_data.py +++ b/app/utils/init_data.py @@ -1,6 +1,16 @@ from app.db.database import db from app.models.models import AbsenceCode, Employee +DEFAULT_ABSENCE_CODES = [ + "Compensatory Time", + "Off-site Duty", + "Personal Leave", + "Sick Leave", + "Study Leave", + "Unpaid Leave", + "Vacation", +] + def init_data(): try: @@ -10,13 +20,7 @@ def init_data(): db.session.add(default_user) # Absence codes - codes = [ - "LAR", - "FRANCO COMPENSATORIO", - "LICENCIA MÉDICA", - "COMISIÓN DE SERVICIO", - ] - for code in codes: + for code in DEFAULT_ABSENCE_CODES: if not AbsenceCode.query.filter_by(code=code).first(): db.session.add(AbsenceCode(code=code))