Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Temps passé par un bénéfiaire d'un service #23

Closed
wants to merge 7 commits into from
Closed
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@
.cache_ggshield
.envrc
*.logs
.history
2 changes: 2 additions & 0 deletions back/dora/data_inclusion/mappings.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,8 @@ def map_service(service_data: dict, is_authenticated: bool) -> dict:
"short_desc": service_data["presentation_resume"] or "",
"slug": f"{service_data['source']}--{service_data['id']}",
"source": service_data["source"],
"spending_time_total_hours": None,
"spending_time_precision": None,
"status": ServiceStatus.PUBLISHED.value,
"structure": service_data["structure_id"],
"structure_info": {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Generated by Django 4.2.15 on 2024-08-29 10:31

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
("services", "0110_remove_service_fee_pass_numerique"),
]

operations = [
migrations.AddField(
model_name="service",
name="spending_time_precision",
field=models.CharField(
blank=True,
max_length=60,
verbose_name="Précision sur la répartition du temps passé",
),
),
migrations.AddField(
model_name="service",
name="spending_time_total_hours",
field=models.PositiveIntegerField(
blank=True,
null=True,
verbose_name="Temps passé (total des heures passées par le bénéficiaire)",
),
),
]
13 changes: 13 additions & 0 deletions back/dora/services/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,19 @@ class Service(ModerationMixin, models.Model):
verbose_name="Lien de prise de rendez-vous", blank=True
)

# Spending time (Loi Travail 2025)

spending_time_total_hours = models.PositiveIntegerField(
verbose_name="Temps passé (total des heures passées par le bénéficiaire)",
blank=True,
null=True
)
spending_time_precision = models.CharField(
verbose_name="Précision sur la répartition du temps passé",
max_length=60,
blank=True,
)

##########
# Metadata

Expand Down
4 changes: 4 additions & 0 deletions back/dora/services/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,8 @@ class Meta:
"requirements_display",
"short_desc",
"slug",
"spending_time_precision",
"spending_time_total_hours",
"status",
"structure",
"structure",
Expand Down Expand Up @@ -512,6 +514,8 @@ class Meta:
"requirements_display",
"short_desc",
"slug",
"spending_time_precision",
"spending_time_total_hours",
"structure",
"structure_info",
"subcategories",
Expand Down
4 changes: 4 additions & 0 deletions back/dora/support/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,8 @@ class Meta:
"short_desc",
"slug",
"structure",
"spending_time_total_hours",
"spending_time_precision",
"subcategories_display",
]
read_only_fields = [
Expand Down Expand Up @@ -422,6 +424,8 @@ class Meta:
"short_desc",
"slug",
"structure",
"spending_time_total_hours",
"spending_time_precision",
"subcategories_display",
]
lookup_field = "slug"
Expand Down
Loading
Loading