# Generated by Django 5.2.11 on 2026-03-05 15:13

import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('projects', '0001_initial'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='Rekkins',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('numurs', models.CharField(help_text='Piem: INV-2024-001', max_length=50, unique=True, verbose_name='Rēķina numurs')),
                ('apraksts', models.TextField(blank=True, verbose_name='Apraksts / Darbu saraksts')),
                ('summa', models.DecimalField(decimal_places=2, max_digits=10, verbose_name='Summa (EUR)')),
                ('statuss', models.CharField(choices=[('GAIDA', 'Gaida apmaksu'), ('APMAKSATS', 'Apmaksāts'), ('NOKAVETS', 'Nokavēts'), ('ATCELTS', 'Atcelts')], default='GAIDA', max_length=20, verbose_name='Statuss')),
                ('izrakstits', models.DateField(verbose_name='Izrakstīšanas datums')),
                ('termins', models.DateField(blank=True, null=True, verbose_name='Apmaksas termiņš')),
                ('apmaksats_datums', models.DateField(blank=True, null=True, verbose_name='Apmaksas datums')),
                ('izveidots', models.DateTimeField(auto_now_add=True)),
                ('atjaunots', models.DateTimeField(auto_now=True)),
                ('klients', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='rekkini', to=settings.AUTH_USER_MODEL, verbose_name='Klients')),
                ('projekts', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='rekkini', to='projects.projekts', verbose_name='Projekts')),
            ],
            options={
                'verbose_name': 'Rēķins',
                'verbose_name_plural': 'Rēķini',
                'ordering': ['-izrakstits'],
            },
        ),
    ]
