Skip to content

Commit fe6bc40

Browse files
authored
Merge pull request #38 from PPeitsch/feature/standardize-absence-codes
⚡[Feature]: Standardize Day Types and Improve Initial Data
2 parents 6bf5cf0 + 9fee848 commit fe6bc40

3 files changed

Lines changed: 23 additions & 17 deletions

File tree

CHANGELOG.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,16 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

88

9+
## [1.3.0] - 2025-08-23
10+
11+
### Changed
12+
- **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.
13+
- Refactored the data initialization script (`init_data.py`) by extracting the default codes into a constant, improving readability and maintainability.
14+
15+
### Removed
16+
- 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.
17+
18+
919
## [1.2.3] - 2025-08-22
1020

1121
### Added
@@ -148,6 +158,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
148158

149159

150160

161+
[1.3.0]: https://github.com/PPeitsch/TimeTrack/compare/v1.2.3...v1.3.0
151162
[1.2.3]: https://github.com/PPeitsch/TimeTrack/compare/v1.2.2...v1.2.3
152163
[1.2.2]: https://github.com/PPeitsch/TimeTrack/compare/v1.2.1...v1.2.2
153164
[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
163174
[1.0.3]: https://github.com/PPeitsch/TimeTrack/compare/v1.0.2...v1.0.3
164175
[1.0.2]: https://github.com/PPeitsch/TimeTrack/compare/v1.0.1...v1.0.2
165176
[1.0.1]: https://github.com/PPeitsch/TimeTrack/compare/v1.0.0...v1.0.1
166-
[1.0.0]: https://github.com/PPeitsch/TimeTrack/releases/tag/v1.0.0
177+
[1.0.0]: https://github.com/PPeitsch/TimeTrack/releases/tag/v1.0.0

app/config/config.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,3 @@ class Config:
1818
# Configuración horaria
1919
WORKING_HOURS_PER_DAY = 8
2020
WORKING_DAYS_PER_WEEK = 5
21-
22-
ABSENCE_CODES = [
23-
"LAR",
24-
"FRANCO COMPENSATORIO",
25-
"LICENCIA MÉDICA",
26-
"COMISIÓN DE SERVICIO",
27-
"EXAMEN",
28-
"LICENCIA SIN GOCE",
29-
]

app/utils/init_data.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
from app.db.database import db
22
from app.models.models import AbsenceCode, Employee
33

4+
DEFAULT_ABSENCE_CODES = [
5+
"Compensatory Time",
6+
"Off-site Duty",
7+
"Personal Leave",
8+
"Sick Leave",
9+
"Study Leave",
10+
"Unpaid Leave",
11+
"Vacation",
12+
]
13+
414

515
def init_data():
616
try:
@@ -10,13 +20,7 @@ def init_data():
1020
db.session.add(default_user)
1121

1222
# Absence codes
13-
codes = [
14-
"LAR",
15-
"FRANCO COMPENSATORIO",
16-
"LICENCIA MÉDICA",
17-
"COMISIÓN DE SERVICIO",
18-
]
19-
for code in codes:
23+
for code in DEFAULT_ABSENCE_CODES:
2024
if not AbsenceCode.query.filter_by(code=code).first():
2125
db.session.add(AbsenceCode(code=code))
2226

0 commit comments

Comments
 (0)