From 03328c7d4a3f36c9cade1ef55178b4fc3bc28486 Mon Sep 17 00:00:00 2001 From: PPeitsch Date: Tue, 18 Nov 2025 00:34:13 -0300 Subject: [PATCH 1/4] feat: Standardize default absence codes to English --- app/utils/init_data.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/app/utils/init_data.py b/app/utils/init_data.py index fda579d..eb153b2 100644 --- a/app/utils/init_data.py +++ b/app/utils/init_data.py @@ -11,10 +11,13 @@ def init_data(): # Absence codes codes = [ - "LAR", - "FRANCO COMPENSATORIO", - "LICENCIA MÉDICA", - "COMISIÓN DE SERVICIO", + "Compensatory Time", + "Off-site Duty", + "Personal Leave", + "Sick Leave", + "Study Leave", + "Unpaid Leave", + "Vacation", ] for code in codes: if not AbsenceCode.query.filter_by(code=code).first(): @@ -23,4 +26,4 @@ def init_data(): db.session.commit() except Exception as e: db.session.rollback() - raise e + raise e \ No newline at end of file From beaf6385617b989d7e04e3236213df21df328ac5 Mon Sep 17 00:00:00 2001 From: PPeitsch Date: Tue, 18 Nov 2025 00:35:21 -0300 Subject: [PATCH 2/4] refactor: Extract default absence codes to a constant --- app/utils/init_data.py | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/app/utils/init_data.py b/app/utils/init_data.py index eb153b2..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,20 +20,11 @@ def init_data(): db.session.add(default_user) # Absence codes - codes = [ - "Compensatory Time", - "Off-site Duty", - "Personal Leave", - "Sick Leave", - "Study Leave", - "Unpaid Leave", - "Vacation", - ] - 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)) db.session.commit() except Exception as e: db.session.rollback() - raise e \ No newline at end of file + raise e From ad9062b525ea0cd4f8b11b28a3f24847bb12ceb2 Mon Sep 17 00:00:00 2001 From: PPeitsch Date: Tue, 18 Nov 2025 00:38:34 -0300 Subject: [PATCH 3/4] refactor: Remove unused ABSENCE_CODES from config --- app/config/config.py | 9 --------- 1 file changed, 9 deletions(-) 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", - ] From 9fee8482a25176590091e16538a7dc597cc67752 Mon Sep 17 00:00:00 2001 From: PPeitsch Date: Tue, 18 Nov 2025 00:46:10 -0300 Subject: [PATCH 4/4] docs: Update changelog for version 1.3.0 --- CHANGELOG.md | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) 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