Coverage for modules\hr\migrations\0005_add_month13_bonus.py: 100%
6 statements
« prev ^ index » next coverage.py v7.16.0, created at 2026-09-06 16:58 +0800
« prev ^ index » next coverage.py v7.16.0, created at 2026-09-06 16:58 +0800
1# Generated by Django 5.1.15 on 2026-09-05 11:51
3import django.db.models.deletion
4import uuid
5from django.db import migrations, models
8class Migration(migrations.Migration):
10 dependencies = [
11 ('hr', '0004_add_payslip'),
12 ]
14 operations = [
15 migrations.CreateModel(
16 name='Month13Bonus',
17 fields=[
18 ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
19 ('tenant_id', models.UUIDField(db_index=True, help_text='Organization / Tenant ID')),
20 ('year', models.PositiveIntegerField()),
21 ('status', models.CharField(default='DRAFT', max_length=16)),
22 ('total_gross', models.DecimalField(decimal_places=2, default=0, max_digits=16)),
23 ('total_net', models.DecimalField(decimal_places=2, default=0, max_digits=16)),
24 ('item_count', models.PositiveIntegerField(default=0)),
25 ('notes', models.TextField(blank=True)),
26 ('created_at', models.DateTimeField(auto_now_add=True)),
27 ('updated_at', models.DateTimeField(auto_now=True)),
28 ],
29 options={
30 'constraints': [models.UniqueConstraint(fields=('tenant_id', 'year'), name='hr_month13_year_tenant_unique')],
31 },
32 ),
33 migrations.CreateModel(
34 name='Month13Item',
35 fields=[
36 ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
37 ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)),
38 ('updated_at', models.DateTimeField(auto_now=True)),
39 ('tenant_id', models.UUIDField(db_index=True, help_text='Organization / Tenant ID')),
40 ('employee_name', models.CharField(max_length=256)),
41 ('employee_number', models.CharField(max_length=32)),
42 ('months_employed', models.PositiveIntegerField(default=12)),
43 ('months_employed_json', models.JSONField(blank=True, default=list)),
44 ('basic_salary_total', models.DecimalField(decimal_places=2, default=0, max_digits=16)),
45 ('bonus_amount', models.DecimalField(decimal_places=2, default=0, max_digits=14)),
46 ('status', models.CharField(default='PENDING', max_length=16)),
47 ('released_at', models.DateTimeField(blank=True, null=True)),
48 ('bonus', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='items', to='hr.month13bonus')),
49 ('profile', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='month13_items', to='hr.employeeprofile')),
50 ],
51 options={
52 'constraints': [models.UniqueConstraint(fields=('bonus', 'profile'), name='hr_month13_item_unique')],
53 },
54 ),
55 ]