# Generated by Django 5.2.7 on 2026-02-06 10:18

import django.db.models.deletion
import django.utils.timezone
from django.db import migrations, models


class Migration(migrations.Migration):

    dependencies = [
        ('core', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='Faktur',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('faktur_number', models.CharField(max_length=100, unique=True, verbose_name='Nomor Faktur')),
                ('date', models.DateField(default=django.utils.timezone.now, verbose_name='Tanggal')),
                ('faktur_type', models.CharField(choices=[('MASUK', 'Faktur Masuk (Supplier)'), ('KELUAR', 'Faktur Keluar')], default='MASUK', max_length=10, verbose_name='Tipe Faktur')),
                ('notes', models.TextField(blank=True, verbose_name='Catatan')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
            ],
            options={
                'verbose_name': 'Faktur',
                'verbose_name_plural': 'Faktur',
            },
        ),
        migrations.CreateModel(
            name='Supplier',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=255, verbose_name='Nama Supplier')),
                ('contact_person', models.CharField(blank=True, max_length=100, verbose_name='Kontak Person')),
                ('phone', models.CharField(blank=True, max_length=20, verbose_name='Telepon')),
                ('address', models.TextField(blank=True, verbose_name='Alamat')),
            ],
            options={
                'verbose_name': 'Supplier',
                'verbose_name_plural': 'Supplier',
            },
        ),
        migrations.AlterModelOptions(
            name='batch',
            options={'verbose_name': 'Batch Barang', 'verbose_name_plural': 'Batch Barang'},
        ),
        migrations.AlterModelOptions(
            name='category',
            options={'verbose_name': 'Kategori', 'verbose_name_plural': 'Kategori'},
        ),
        migrations.AlterModelOptions(
            name='medicine',
            options={'verbose_name': 'Barang/Obat', 'verbose_name_plural': 'Barang/Obat'},
        ),
        migrations.AlterModelOptions(
            name='stocktransaction',
            options={'verbose_name': 'Transaksi Stok', 'verbose_name_plural': 'Transaksi Stok'},
        ),
        migrations.AlterField(
            model_name='batch',
            name='batch_number',
            field=models.CharField(max_length=100, verbose_name='Nomor Batch/Lot'),
        ),
        migrations.AlterField(
            model_name='batch',
            name='buying_price',
            field=models.DecimalField(decimal_places=2, max_digits=12, verbose_name='Harga Beli'),
        ),
        migrations.AlterField(
            model_name='batch',
            name='expiry_date',
            field=models.DateField(verbose_name='Tanggal Kadaluarsa'),
        ),
        migrations.AlterField(
            model_name='batch',
            name='medicine',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='batches', to='core.medicine', verbose_name='Barang'),
        ),
        migrations.AlterField(
            model_name='batch',
            name='quantity',
            field=models.IntegerField(default=0, verbose_name='Jumlah Stok'),
        ),
        migrations.AlterField(
            model_name='batch',
            name='selling_price',
            field=models.DecimalField(decimal_places=2, max_digits=12, verbose_name='Harga Jual'),
        ),
        migrations.AlterField(
            model_name='category',
            name='description',
            field=models.TextField(blank=True, verbose_name='Deskripsi'),
        ),
        migrations.AlterField(
            model_name='category',
            name='name',
            field=models.CharField(max_length=100, verbose_name='Nama Kategori'),
        ),
        migrations.AlterField(
            model_name='medicine',
            name='category',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='medicines', to='core.category', verbose_name='Kategori'),
        ),
        migrations.AlterField(
            model_name='medicine',
            name='min_stock',
            field=models.IntegerField(default=10, verbose_name='Stok Minimal'),
        ),
        migrations.AlterField(
            model_name='medicine',
            name='name',
            field=models.CharField(max_length=255, verbose_name='Nama Barang'),
        ),
        migrations.AlterField(
            model_name='medicine',
            name='sku',
            field=models.CharField(max_length=50, unique=True, verbose_name='SKU/Kode'),
        ),
        migrations.AlterField(
            model_name='medicine',
            name='unit',
            field=models.CharField(choices=[('Tablet', 'Tablet'), ('Kapsul', 'Kapsul'), ('Botol', 'Botol'), ('Strip', 'Strip'), ('Pcs', 'Pcs'), ('Box', 'Box')], default='Tablet', max_length=20, verbose_name='Satuan'),
        ),
        migrations.AlterField(
            model_name='stocktransaction',
            name='batch',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='transactions', to='core.batch', verbose_name='Batch'),
        ),
        migrations.AlterField(
            model_name='stocktransaction',
            name='created_at',
            field=models.DateTimeField(auto_now_add=True, verbose_name='Waktu'),
        ),
        migrations.AlterField(
            model_name='stocktransaction',
            name='medicine',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.medicine', verbose_name='Barang'),
        ),
        migrations.AlterField(
            model_name='stocktransaction',
            name='note',
            field=models.TextField(blank=True, verbose_name='Keterangan'),
        ),
        migrations.AlterField(
            model_name='stocktransaction',
            name='quantity',
            field=models.IntegerField(verbose_name='Jumlah'),
        ),
        migrations.AlterField(
            model_name='stocktransaction',
            name='transaction_type',
            field=models.CharField(choices=[('IN', 'Barang Masuk'), ('OUT', 'Barang Keluar'), ('ADJ', 'Penyesuaian')], max_length=3, verbose_name='Tipe Transaksi'),
        ),
        migrations.AddField(
            model_name='batch',
            name='faktur',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='batches', to='core.faktur', verbose_name='Faktur'),
        ),
        migrations.AddField(
            model_name='stocktransaction',
            name='faktur',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='transactions', to='core.faktur', verbose_name='Faktur'),
        ),
        migrations.AddField(
            model_name='faktur',
            name='supplier',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='core.supplier', verbose_name='Supplier'),
        ),
    ]
