From 93f568a9ac40d6f7b0d9a4d2e5ebebfb2e6abd01 Mon Sep 17 00:00:00 2001 From: Karl Determe Date: Mon, 10 Aug 2026 12:28:18 +0200 Subject: [PATCH] feat: implement generic inspection system for assets and interventions --- streetup/assets/admin.py | 2 +- .../assets/locale/fr/LC_MESSAGES/django.mo | Bin 99971 -> 99976 bytes .../assets/locale/fr/LC_MESSAGES/django.po | 4 +- ...tinspection_asset_content_type_and_more.py | 39 ++++++++ .../0017_add_bike_parking_category.py | 59 +++++++++++ ...018_remove_parkingspot_scooter_capacity.py | 17 ++++ streetup/assets/models/parking.py | 6 +- .../assets/components/asset_inspections.html | 6 ++ streetup/assets/tests_parking_inspections.py | 7 +- streetup/assets/views/parking.py | 2 +- streetup/inspections/admin.py | 2 +- ..._verified_drop_off_stand_count_and_more.py | 23 +++++ streetup/inspections/models.py | 10 +- .../components/asset_fields/_parkingspot.html | 93 +++++++++++++++--- .../components/inspection_form_modal.html | 2 + .../inspections/inspections_list.html | 6 ++ streetup/inspections/views.py | 12 ++- .../locale/fr/LC_MESSAGES/django.mo | Bin 122505 -> 122505 bytes .../locale/fr/LC_MESSAGES/django.po | 2 +- ...0002_signpanel_funding_program_and_more.py | 33 +++++++ 20 files changed, 297 insertions(+), 28 deletions(-) create mode 100644 streetup/assets/migrations/0016_remove_assetinspection_asset_content_type_and_more.py create mode 100644 streetup/assets/migrations/0017_add_bike_parking_category.py create mode 100644 streetup/assets/migrations/0018_remove_parkingspot_scooter_capacity.py create mode 100644 streetup/inspections/migrations/0003_parkingspotinspection_verified_drop_off_stand_count_and_more.py create mode 100644 streetup/sign/migrations/0002_signpanel_funding_program_and_more.py diff --git a/streetup/assets/admin.py b/streetup/assets/admin.py index c089b69..931f0ff 100644 --- a/streetup/assets/admin.py +++ b/streetup/assets/admin.py @@ -694,7 +694,7 @@ class ParkingLocationAdmin(AssetGISAdmin): class ParkingSpotAdmin(AssetGISAdmin): list_display = ( "code", "name_fr", "spot_type", "stand_type", - "standard_stand_count", "cargo_stand_count", "total_stand_count", + "standard_stand_count", "cargo_stand_count", "drop_off_stand_count", "total_stand_count", "has_scooter_drop_zone", "is_compliant", "inspection_status", "status" ) list_filter = ( diff --git a/streetup/assets/locale/fr/LC_MESSAGES/django.mo b/streetup/assets/locale/fr/LC_MESSAGES/django.mo index aef3922463f00021452d871ffbd4f1daf44f1588..0e611af162d76c4a7f1c30182db7dce23e96d0ad 100644 GIT binary patch delta 9051 zcmXZhdEAdx`oQt;W6eZJB`F?cO+5C;zNAD7mCBPn8bwpK5c%3EBzvXhmwB}qib}~# zq^6XTW+>C7WVB6X9mda(((m(m&h^*(KIgvgbFOn;=iJ{XO`l(4&ioSV`nJrTlgVUW zte2Cy6kov$aA)`}mZE(MYhsZrax&**9lRJ@V_Ccz|A0f{{=MNeEKmQ^@P%+AR-pgm zD{``#a$I~vM@c-24tNR;?40^(!t!Wfm*ctEGQ1iuqTLHG#9>$(Cu41#8~0yB7xEF7 zz|Zh<+*?1JR+70g1yBjAaHASJVFxUZz0p8#M*|yy4m1`Wcv7@y;d!*@hfkv8tVRRf ziZ1XU(f%>Z#U*r{4J$QBrD%$#s2AqqP^^fvqWv`1r~Nj%l7nIShN%?IF_-?1SPciG z0nZ5Mq8ZOF;=+iZKx?%MUC}0V#qWoE(13nKUp#}wuxMUN`8nZ*=yTP>=4jyE!old? zc_6j3nZ;bxqGL50=`O5HJ^b7G(Y-Rq7$z|Gq?>c<>%-)N6}1{Y?4Y* z9(}$sx=DLrCFalc<-!;4M<<+*PP8Ok6>dQX+>NIA>*zlgmS~#Zs~qN`$MR})hf(G(8ybOOtOHsU8dZ8+M{%fKAEu;S?G_V3R6GNgs8r@S5qNQDc zuKX4B7;kCD`S;?Z=-7j9x&!DYJ06}vBQM%Km7*e6r=5$g@T%|zbi6*{P`r}%Nc5CE zgH7-~tcRzXbN*dPjTSkXqSzLTU`I57&S)vRqX7&G$D%2HDDFQVzKmw@ujun%q8U4k z2AY$fPD5$*{mZjlc%vy=iuTdI4G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qNlCe>&0c{TrVqI4#Ua zUucFWVG$ZYcXVg{upt(s3ufWNXdo-G4Q|9nxF6kM^;^>T=4iV+)^`1oJh+oP(UdRo z2V94B@qILf`>+*Oo{;`&)fL;)o`U0WEqaz}PfR=QfR<<=`l%j?$6LjDY=uZC^J-vUJlmf1a{$sKYdgzM75$Ff!T6DfCXlCw0OYjhSJ627K z`~Mmp9=fe)jSry{R=hP?4V|C{Iza>UFkOt^_daN##b}_T&`eB5Py55@hMqu6x+dIk zEBD_WY@|c~iKgr~G>~$)rG;ywJ86P0+!j5o-O-X=jThh~bmz;^g>^CtA|o z=(uB9bX1v~4#fp%ihH6F4~zD=XwN_wd=L%jS@d3Szy|m}7U555Mp{it3wA;e@o+Sd zF=!^Tn|bg9GYO4&CYtJbXet+@J6?s3+k^)AZuI{H9rrC7z)^IE^=?o9&8G`m>lx^{ zQuO^5$h=wZztTf)a}4-6+=~v(O-)t{>!TC3LIdi7W@J$G--y!!+ac%rt(4Tglo}Lz8C$1)tZq4Z;KwLOVJJV zLQnUV=&iag+6&OYmZIOA4Kuj^?sO*|F8nEaIuC~bht}+O^fpxGx|*r_Xh~XPV=Tdz zcn`L~m!rKO+tbdUnNmJ9T!^jde{&`SjOZ{Op7M&b(xEyVt$ic({v|ElM#m56Av}uRvC7<(kwIw0C1`2JJ%9P| hl5OStj-NPg)J+@LH_1ELd(ncQt8d&mC2vRN{|BZ{{ leaf.verified_cargo_stand_count }} {% endif %} + {% if leaf and leaf.verified_drop_off_stand_count is not None %} +
  • + {% translate "Arceaux drop-off constatés" %} + {{ leaf.verified_drop_off_stand_count }} +
  • + {% endif %} {% endwith %} diff --git a/streetup/assets/tests_parking_inspections.py b/streetup/assets/tests_parking_inspections.py index 63aea4a..219221a 100644 --- a/streetup/assets/tests_parking_inspections.py +++ b/streetup/assets/tests_parking_inspections.py @@ -48,13 +48,13 @@ class ParkingSpotAndInspectionTest(TestCase): cargo_stand_count=2, stand_type="mixed", has_scooter_drop_zone=True, - scooter_capacity=10, geom=poly ) def test_parking_spot_creation_and_stand_counts(self): self.assertEqual(self.spot.standard_stand_count, 3) self.assertEqual(self.spot.cargo_stand_count, 2) + self.assertEqual(self.spot.drop_off_stand_count, 0) self.assertEqual(self.spot.total_stand_count, 5) self.assertTrue(self.spot.has_scooter_drop_zone) self.assertTrue(self.spot.is_compliant) @@ -91,6 +91,7 @@ class ParkingSpotAndInspectionTest(TestCase): result_status="updated", verified_standard_stand_count=4, verified_cargo_stand_count=3, + verified_drop_off_stand_count=5, verified_has_scooter_drop_zone=True, verified_marking_quality="good", apply_changes_to_asset=True, @@ -101,7 +102,8 @@ class ParkingSpotAndInspectionTest(TestCase): self.spot.refresh_from_db() self.assertEqual(self.spot.standard_stand_count, 4) # Modifié avec l'opt-in self.assertEqual(self.spot.cargo_stand_count, 3) # Modifié avec l'opt-in - self.assertEqual(self.spot.total_stand_count, 7) + self.assertEqual(self.spot.drop_off_stand_count, 5) # Modifié avec l'opt-in + self.assertEqual(self.spot.total_stand_count, 12) self.assertEqual(self.spot.validation_status, "validated") self.assertEqual(self.spot.inspection_status, "updated") self.assertIsNotNone(self.spot.last_inspection_date) @@ -134,6 +136,7 @@ class ParkingSpotAndInspectionTest(TestCase): self.assertEqual(feat["properties"]["code"], "SPOT-VELO-01") self.assertEqual(feat["properties"]["standard_stand_count"], 3) self.assertEqual(feat["properties"]["cargo_stand_count"], 2) + self.assertEqual(feat["properties"]["drop_off_stand_count"], 0) self.assertEqual(feat["properties"]["total_stand_count"], 5) self.assertTrue(feat["properties"]["has_scooter_drop_zone"]) diff --git a/streetup/assets/views/parking.py b/streetup/assets/views/parking.py index 1c6c42b..695d90f 100644 --- a/streetup/assets/views/parking.py +++ b/streetup/assets/views/parking.py @@ -174,11 +174,11 @@ def parking_assets_geojson(request): "spot_type_display": spot.get_spot_type_display(), "standard_stand_count": spot.standard_stand_count, "cargo_stand_count": spot.cargo_stand_count, + "drop_off_stand_count": spot.drop_off_stand_count, "total_stand_count": spot.total_stand_count, "stand_type": spot.stand_type, "stand_type_display": spot.get_stand_type_display(), "has_scooter_drop_zone": spot.has_scooter_drop_zone, - "scooter_capacity": spot.scooter_capacity, "capacity": spot.capacity, "marking_quality": spot.marking_quality, "is_compliant": spot.is_compliant, diff --git a/streetup/inspections/admin.py b/streetup/inspections/admin.py index dfd0509..5445602 100644 --- a/streetup/inspections/admin.py +++ b/streetup/inspections/admin.py @@ -32,7 +32,7 @@ class ParkingSpotInspectionAdmin(admin.ModelAdmin): list_display = ( "id", "asset", "inspector", "inspection_date", "result_status", "verified_standard_stand_count", - "verified_cargo_stand_count", "verified_has_scooter_drop_zone", + "verified_cargo_stand_count", "verified_drop_off_stand_count", "verified_has_scooter_drop_zone", "apply_changes_to_asset" ) list_filter = ("result_status", "apply_changes_to_asset", "inspection_date") diff --git a/streetup/inspections/migrations/0003_parkingspotinspection_verified_drop_off_stand_count_and_more.py b/streetup/inspections/migrations/0003_parkingspotinspection_verified_drop_off_stand_count_and_more.py new file mode 100644 index 0000000..9b3e184 --- /dev/null +++ b/streetup/inspections/migrations/0003_parkingspotinspection_verified_drop_off_stand_count_and_more.py @@ -0,0 +1,23 @@ +# Generated by Django 6.0.7 on 2026-08-10 08:42 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('inspections', '0002_migrate_existing_inspections'), + ] + + operations = [ + migrations.AddField( + model_name='parkingspotinspection', + name='verified_drop_off_stand_count', + field=models.IntegerField(blank=True, null=True, verbose_name="Nombre d'arceaux drop-off constaté"), + ), + migrations.AlterField( + model_name='inspection', + name='result_status', + field=models.CharField(choices=[('compliant', 'Conforme'), ('non_compliant', 'Non conforme / Anomalie'), ('damaged', 'Endommagé'), ('missing', 'Absent / Retiré')], default='compliant', max_length=50, verbose_name='Résultat du contrôle'), + ), + ] diff --git a/streetup/inspections/models.py b/streetup/inspections/models.py index 93fdca7..a6f8582 100644 --- a/streetup/inspections/models.py +++ b/streetup/inspections/models.py @@ -17,7 +17,7 @@ INSPECTION_RESULT_CONFIG = { 'color_hex': '#198754', }, 'non_compliant': { - 'label': _('Non conforme / Anomalie'), + 'label': _('Non conforme'), 'badge_class': 'bg-warning text-dark', 'btn_class': 'btn-outline-warning text-dark', 'icon': 'bi-exclamation-triangle-fill', @@ -331,6 +331,11 @@ class ParkingSpotInspection(Inspection): blank=True, verbose_name=_("Nombre d'arceaux cargo constaté") ) + verified_drop_off_stand_count = models.IntegerField( + null=True, + blank=True, + verbose_name=_("Nombre d'arceaux drop-off constaté") + ) verified_stand_type = models.CharField( max_length=50, null=True, @@ -375,6 +380,9 @@ class ParkingSpotInspection(Inspection): if self.verified_cargo_stand_count is not None and hasattr(target_asset, 'cargo_stand_count'): target_asset.cargo_stand_count = self.verified_cargo_stand_count modified = True + if self.verified_drop_off_stand_count is not None and hasattr(target_asset, 'drop_off_stand_count'): + target_asset.drop_off_stand_count = self.verified_drop_off_stand_count + modified = True if self.verified_has_scooter_drop_zone is not None and hasattr(target_asset, 'has_scooter_drop_zone'): target_asset.has_scooter_drop_zone = self.verified_has_scooter_drop_zone modified = True diff --git a/streetup/inspections/templates/inspections/components/asset_fields/_parkingspot.html b/streetup/inspections/templates/inspections/components/asset_fields/_parkingspot.html index df3b766..e3d4bba 100644 --- a/streetup/inspections/templates/inspections/components/asset_fields/_parkingspot.html +++ b/streetup/inspections/templates/inspections/components/asset_fields/_parkingspot.html @@ -5,24 +5,87 @@ {% translate "Contrôles spécifiques stationnement" %} -
    -
    +
    +
    - +
    -
    +
    - + +
    +
    + +
    -
    - - + + +
    + +
    +
    + + +
    +
    + + +
    +
    -
    + + +
    + +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    +
    + + {% if show_apply_physical_counts %} +
    + + +
    + {% endif %} +
    \ No newline at end of file diff --git a/streetup/inspections/templates/inspections/components/inspection_form_modal.html b/streetup/inspections/templates/inspections/components/inspection_form_modal.html index 4ec8594..51bcb87 100644 --- a/streetup/inspections/templates/inspections/components/inspection_form_modal.html +++ b/streetup/inspections/templates/inspections/components/inspection_form_modal.html @@ -87,6 +87,7 @@ {% endif %}
    + {% if show_create_intervention %}
    @@ -94,6 +95,7 @@ {% translate "Créer automatiquement une intervention en cas d'anomalie / dégât" %}
    + {% endif %}
    diff --git a/streetup/inspections/templates/inspections/inspections_list.html b/streetup/inspections/templates/inspections/inspections_list.html index f395635..b5c32a2 100644 --- a/streetup/inspections/templates/inspections/inspections_list.html +++ b/streetup/inspections/templates/inspections/inspections_list.html @@ -217,6 +217,12 @@ {{ leaf.verified_cargo_stand_count }} {% endif %} + {% if leaf.verified_drop_off_stand_count is not None %} +
  • + {% translate "Arceaux drop-off constatés" %} + {{ leaf.verified_drop_off_stand_count }} +
  • + {% endif %} {% if leaf.verified_marking_quality %}
  • {% translate "Qualité du marquage" %} diff --git a/streetup/inspections/views.py b/streetup/inspections/views.py index 27541ad..f37419d 100644 --- a/streetup/inspections/views.py +++ b/streetup/inspections/views.py @@ -299,12 +299,22 @@ def create_inspection_api(request): inspection.verified_standard_stand_count = int(request.POST['verified_standard_stand_count']) if 'verified_cargo_stand_count' in request.POST and request.POST['verified_cargo_stand_count'] != '': inspection.verified_cargo_stand_count = int(request.POST['verified_cargo_stand_count']) + if 'verified_drop_off_stand_count' in request.POST and request.POST['verified_drop_off_stand_count'] != '': + inspection.verified_drop_off_stand_count = int(request.POST['verified_drop_off_stand_count']) if 'verified_stand_type' in request.POST and request.POST['verified_stand_type'] != '': inspection.verified_stand_type = request.POST['verified_stand_type'] if 'verified_has_scooter_drop_zone' in request.POST: - inspection.verified_has_scooter_drop_zone = (request.POST['verified_has_scooter_drop_zone'] == 'true') + val = request.POST['verified_has_scooter_drop_zone'] + if val == 'true': + inspection.verified_has_scooter_drop_zone = True + elif val == 'false': + inspection.verified_has_scooter_drop_zone = False + elif val == '': + inspection.verified_has_scooter_drop_zone = None if 'verified_marking_quality' in request.POST and request.POST['verified_marking_quality'] != '': inspection.verified_marking_quality = request.POST['verified_marking_quality'] + + inspection.apply_physical_counts_to_asset = (request.POST.get('apply_physical_counts_to_asset') == 'true') inspection.save() else: diff --git a/streetup/interventions/locale/fr/LC_MESSAGES/django.mo b/streetup/interventions/locale/fr/LC_MESSAGES/django.mo index 248183c34ee22466361720e5a2384967efe364e7..2737a683982d5de563bc920882a17e4c74aa4577 100644 GIT binary patch delta 21 dcmeC&%ig({y