Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
9 changes: 0 additions & 9 deletions app/config/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
]
18 changes: 11 additions & 7 deletions app/utils/init_data.py
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -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))

Expand Down