feat(company-edit): add year_established field to profile edit form
Some checks are pending
NordaBiz Tests / Unit & Integration Tests (push) Waiting to run
NordaBiz Tests / E2E Tests (Playwright) (push) Blocked by required conditions
NordaBiz Tests / Smoke Tests (Production) (push) Blocked by required conditions
NordaBiz Tests / Send Failure Notification (push) Blocked by required conditions

Allows company managers to set or correct the founding year. Field is
read-only when the year comes from KRS/CEIDG registry data.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Maciej Pienczyn 2026-03-18 18:07:27 +01:00
parent 73c42f59a6
commit a35ba310e0
2 changed files with 26 additions and 0 deletions

View File

@ -212,6 +212,19 @@ def _save_description(db, company):
request.form.get('core_values', '')
) or None
# Year established — only save if not from registry
if not company.krs_registration_date and not company.business_start_date:
year_raw = request.form.get('year_established', '').strip()
if year_raw:
try:
year = int(year_raw)
if 1800 <= year <= 2030:
company.year_established = year
except ValueError:
pass
else:
company.year_established = None
category_id_raw = request.form.get('category_id', '')
if category_id_raw:
try:

View File

@ -780,6 +780,19 @@
<p class="form-help">Główna kategoria widoczna przy nazwie firmy w katalogu</p>
</div>
<div class="form-group">
<label for="year_established" class="form-label">Rok założenia firmy</label>
<input type="number" id="year_established" name="year_established" class="form-input" style="max-width: 200px;"
min="1800" max="2030" placeholder="np. 2015"
value="{{ company.year_established or '' }}"
{% if company.krs_registration_date or company.business_start_date %}readonly{% endif %}>
{% if company.krs_registration_date or company.business_start_date %}
<p class="form-help">Rok pochodzi z rejestru {% if company.krs_registration_date %}KRS{% else %}CEIDG{% endif %} — aby zmienić, skontaktuj się z administratorem</p>
{% else %}
<p class="form-help">Rok rozpoczęcia działalności firmy</p>
{% endif %}
</div>
<div class="form-group">
<label for="description_short" class="form-label">Krótki opis firmy</label>
<textarea id="description_short" name="description_short" class="form-input" rows="3" maxlength="500" placeholder="Np. Specjalizujemy się w usługach IT dla firm z Pomorza...">{{ company.description_short or '' }}</textarea>