feat: provision a teamer from a received application

This commit is contained in:
fromme committed 2026-09-25 14:36:24 +02:00
1 parent d5f4b12f0a
commit b530679658
23 files changed
+2433 -148

No files matched your search

@@ -38,7 +38,8 @@
<dl class="divide-y divide-gray-100">
{{ _self.row('eingegangen am', submission.submittedAt|date('d.m.Y, H:i')) }}
{{ _self.row('Name', [submission.firstName, submission.lastName]|filter(part => part is not empty)|join(' ')) }}
{{ _self.row('Geburtsdatum', submission.birthDate) }}
{{ _self.row('Geburtsdatum', submission.dateOfBirth ? submission.dateOfBirth|date('d.m.Y') : submission.birthDate) }}
{{ _self.row('Geschlecht', submission.gender) }}
{# Three states: the form said yes, said no, or never asked - and only the first one
earns the automatic receipt mail, so "-" is not the same as "nein" here. #}
{{ _self.row('EU (inkl. Schweiz)', submission.eu) }}
@@ -105,6 +106,41 @@
{{ form_rest(callsForm) }}
{{ form_end(callsForm) }}
</div>
{% if feature('application_form_teamer_provisioning') or submission.teamerCreatedAt %}
<div>
<dl class="divide-y divide-gray-100">
{{ _self.row('übernommen am', submission.teamerCreatedAt ? submission.teamerCreatedAt|date('d.m.Y, H:i') : null) }}
</dl>
<div class="pt-4">
{% if submission.user and submission.user.teamer %}
<a href="{{ path('app_administrative_teamer_profile', { 'uuid': submission.user.teamer.uuid, 'r': forwarded_return_url() }) }}"
class="btn btn--small btn--secondary">
Teamer:innenprofil öffnen
</a>
{% elseif submission.email %}
<button type="button"
class="btn btn--small"
hx-get="{{ path('app_admin_application_form_submission_create_teamer', { 'uuid': submission.uuid, 'r': forwarded_return_url() }) }}"
hx-target="body"
hx-swap="beforeend">
Teamer:in anlegen
</button>
{% if submission.busProAddressId %}
{# Step 1 is done and the rest is not: naming it here is what makes a
retry a resume rather than a guess. #}
<div class="pt-2 text-sm">
Die BusPro-Adresse {{ submission.busProAddressId }} wurde schon angelegt,
die Übernahme wurde aber nicht abgeschlossen.
</div>
{% endif %}
{% else %}
<div class="text-sm">
Ohne E-Mail-Adresse kann kein Teamer:innenkonto angelegt werden.
</div>
{% endif %}
</div>
</div>
{% endif %}
</div>
<h2 class="font-bold text-lg pb-4">
@@ -0,0 +1,49 @@
{% extends 'htmx_confirmation_modal.html.twig' %}
{% block title %}Teamer:in anlegen{% endblock %}
{% block content %}
<div>
<em>{{ [submission.firstName, submission.lastName]|filter(part => part is not empty)|join(' ') }}</em>
als Teamer:in übernehmen?
<div class="pt-2 text-sm">
Dabei wird in BusPro eine Adresse angelegt und das Teamer-Merkmal gesetzt. Kennt BusPro
die Person schon, wird die vorhandene Adresse verwendet. Anschließend entsteht hier das
Teamer:innenkonto, und BusPro schickt eine Mail zum Setzen des Passworts.
</div>
{# The three writes cannot be undone from here, so what goes to BusPro is shown before it
goes, not afterwards in a log entry nobody reads. #}
<dl class="pt-4 text-sm grid grid-cols-3 gap-y-1">
<dt class="font-bold">Geburtsdatum</dt>
<dd class="col-span-2">
{% if submission.dateOfBirth %}
{{ submission.dateOfBirth|date('d.m.Y') }}
{% else %}
<strong>fehlt</strong> - ohne Geburtsdatum kann keine Adresse angelegt werden
{% endif %}
</dd>
<dt class="font-bold">Geschlecht</dt>
<dd class="col-span-2">{{ submission.gender }}</dd>
<dt class="font-bold">E-Mail</dt>
<dd class="col-span-2">{{ submission.email ?: 'fehlt' }}</dd>
<dt class="font-bold">Adresse</dt>
<dd class="col-span-2">
{# Street and postcode are mandatory in BusPro, so step 1 fails without them. Said
here, before the write, rather than only in the error message afterwards. #}
{% if submission.street is empty or submission.zipCode is empty or submission.city is empty %}
<strong>unvollständig</strong> - ohne Straße, PLZ und Ort kann BusPro keine Adresse anlegen
{% else %}
{{ [submission.street, [submission.zipCode, submission.city]|filter(part => part is not empty)|join(' ')]|filter(part => part is not empty)|join(', ') }}
{% endif %}
</dd>
</dl>
{% if submission.busProAddressId %}
<div class="pt-4 text-sm">
In BusPro besteht für diese Bewerbung schon die Adresse
{{ submission.busProAddressId }} - sie wird nicht erneut angelegt.
</div>
{% endif %}
</div>
{% endblock %}
{% block button_confirm %}Anlegen{% endblock %}