feat: insurance section — overview, documents, analysis, KVG premium comparison
- Insurance overview page (/insurance): current policies table with type, provider, premium, franchise, coverage, and document links - Documents page: upload and manage insurance documents - Analysis page: coverage gap analysis per insurance type - Priminfo integration (/insurance/priminfo): KVG premium comparison by insurer, model (TAR/HMO/etc.), franchise level, and accident coverage via embedded Priminfo iframe (no public API available) - Backend: Insurance, PraemienEntry, PraemienPolice models with migrations - Sidebar: insurance nav group with flyout and dropdown - i18n: all keys in DE/EN/FR/IT
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
# Generated by Django 6.0.4 on 2026-05-24 10:31
|
||||
|
||||
import django.db.models.deletion
|
||||
from django.conf import settings
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('finance', '0020_email_verify_token_expiry'),
|
||||
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='Insurance',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('insurance_type', models.CharField(choices=[('kvg', 'Krankenkasse Grundversicherung (KVG)'), ('kk_zusatz', 'KK-Zusatzversicherung'), ('nbu', 'Nicht-Berufsunfallversicherung (NBU)'), ('haftpflicht', 'Privathaftpflicht'), ('hausrat', 'Hausrat'), ('mfz', 'MFZ-Haftpflicht'), ('rechtsschutz', 'Rechtsschutz'), ('saule_3a', 'Säule 3a'), ('leben', 'Lebensversicherung'), ('reise', 'Reiseversicherung'), ('other', 'Sonstiges')], max_length=30)),
|
||||
('insurer', models.CharField(max_length=200)),
|
||||
('policy_number', models.CharField(blank=True, default='', max_length=100)),
|
||||
('premium', models.DecimalField(decimal_places=2, max_digits=10)),
|
||||
('premium_period', models.CharField(choices=[('monthly', 'Monatlich'), ('quarterly', 'Vierteljährlich'), ('semi_annual', 'Halbjährlich'), ('annual', 'Jährlich')], default='monthly', max_length=20)),
|
||||
('coverage_amount', models.DecimalField(blank=True, decimal_places=2, max_digits=12, null=True)),
|
||||
('deductible', models.DecimalField(blank=True, decimal_places=2, max_digits=10, null=True)),
|
||||
('valid_from', models.DateField(blank=True, null=True)),
|
||||
('valid_until', models.DateField(blank=True, null=True)),
|
||||
('notes', models.TextField(blank=True, default='')),
|
||||
('created_at', models.DateTimeField(auto_now_add=True)),
|
||||
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='insurances', to=settings.AUTH_USER_MODEL)),
|
||||
],
|
||||
options={
|
||||
'ordering': ['insurance_type'],
|
||||
},
|
||||
),
|
||||
]
|
||||
@@ -0,0 +1,34 @@
|
||||
# Generated by Django 6.0.4 on 2026-05-24 11:14
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('finance', '0021_add_insurance_model'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='PraemienEntry',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('plz', models.CharField(db_index=True, max_length=10)),
|
||||
('ort', models.CharField(max_length=200)),
|
||||
('kanton', models.CharField(max_length=2)),
|
||||
('region', models.PositiveSmallIntegerField()),
|
||||
('bfs_nr', models.PositiveIntegerField(db_index=True)),
|
||||
('gemeinde', models.CharField(max_length=200)),
|
||||
('bezirk', models.CharField(blank=True, default='', max_length=200)),
|
||||
('avg_adult', models.DecimalField(decimal_places=2, max_digits=8)),
|
||||
('avg_young_adult', models.DecimalField(decimal_places=2, max_digits=8)),
|
||||
('avg_child', models.DecimalField(decimal_places=2, max_digits=8)),
|
||||
('data_year', models.PositiveSmallIntegerField(db_index=True)),
|
||||
],
|
||||
options={
|
||||
'ordering': ['kanton', 'ort'],
|
||||
'unique_together': {('plz', 'ort', 'data_year')},
|
||||
},
|
||||
),
|
||||
]
|
||||
@@ -0,0 +1,34 @@
|
||||
# Generated by Django 6.0.4 on 2026-05-24 11:38
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('finance', '0022_add_praemien_entry'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='PraemienPolice',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('versicherer_id', models.PositiveIntegerField(db_index=True)),
|
||||
('kanton', models.CharField(max_length=2)),
|
||||
('region', models.PositiveSmallIntegerField()),
|
||||
('altersklasse', models.CharField(max_length=10)),
|
||||
('unfalleinschluss', models.CharField(max_length=10)),
|
||||
('tariftyp', models.CharField(max_length=10)),
|
||||
('tarifbezeichnung', models.CharField(max_length=200)),
|
||||
('franchisestufe', models.CharField(max_length=10)),
|
||||
('franchise_chf', models.PositiveSmallIntegerField()),
|
||||
('praemie', models.DecimalField(decimal_places=2, max_digits=8)),
|
||||
('data_year', models.PositiveSmallIntegerField(db_index=True)),
|
||||
],
|
||||
options={
|
||||
'indexes': [models.Index(fields=['kanton', 'region', 'altersklasse', 'unfalleinschluss', 'tariftyp', 'franchisestufe', 'data_year'], name='finance_pra_kanton_e430cb_idx')],
|
||||
'unique_together': {('versicherer_id', 'kanton', 'region', 'altersklasse', 'unfalleinschluss', 'tariftyp', 'franchisestufe', 'data_year')},
|
||||
},
|
||||
),
|
||||
]
|
||||
Reference in New Issue
Block a user