58 lines
3.2 KiB
Python
58 lines
3.2 KiB
Python
# Generated by Django 5.2.7 on 2026-04-17 02:21
|
|
|
|
import django.db.models.deletion
|
|
from decimal import Decimal
|
|
from django.conf import settings
|
|
from django.db import migrations, models
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
initial = True
|
|
|
|
dependencies = [
|
|
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
|
]
|
|
|
|
operations = [
|
|
migrations.CreateModel(
|
|
name='BusinessProfile',
|
|
fields=[
|
|
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
('business_name', models.CharField(blank=True, max_length=120)),
|
|
('logo', models.FileField(blank=True, null=True, upload_to='business_logos/')),
|
|
('opening_ecash', models.DecimalField(decimal_places=2, default=Decimal('0.00'), max_digits=12)),
|
|
('opening_physical_cash', models.DecimalField(decimal_places=2, default=Decimal('0.00'), max_digits=12)),
|
|
('current_ecash', models.DecimalField(decimal_places=2, default=Decimal('0.00'), max_digits=12)),
|
|
('current_physical_cash', models.DecimalField(decimal_places=2, default=Decimal('0.00'), max_digits=12)),
|
|
('created_at', models.DateTimeField(auto_now_add=True)),
|
|
('updated_at', models.DateTimeField(auto_now=True)),
|
|
('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='business_profile', to=settings.AUTH_USER_MODEL)),
|
|
],
|
|
options={
|
|
'ordering': ['user__username'],
|
|
},
|
|
),
|
|
migrations.CreateModel(
|
|
name='Transaction',
|
|
fields=[
|
|
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
('client_name', models.CharField(max_length=120)),
|
|
('amount', models.DecimalField(decimal_places=2, max_digits=12)),
|
|
('transaction_type', models.CharField(choices=[('cash_out', 'Cash-out'), ('cash_in', 'Cash-In'), ('sending', 'Sending'), ('airtime', 'Airtime'), ('transfer', 'Transfer'), ('debt', 'Debt'), ('expenditure', 'Expenditure'), ('credit', 'Credit')], max_length=20)),
|
|
('service_charge', models.DecimalField(decimal_places=2, default=Decimal('0.00'), max_digits=12)),
|
|
('notes', models.CharField(blank=True, max_length=255)),
|
|
('ecash_before', models.DecimalField(decimal_places=2, max_digits=12)),
|
|
('ecash_after', models.DecimalField(decimal_places=2, max_digits=12)),
|
|
('physical_before', models.DecimalField(decimal_places=2, max_digits=12)),
|
|
('physical_after', models.DecimalField(decimal_places=2, max_digits=12)),
|
|
('created_at', models.DateTimeField(auto_now_add=True)),
|
|
('business', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='transactions', to='core.businessprofile')),
|
|
('created_by', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='momo_transactions', to=settings.AUTH_USER_MODEL)),
|
|
],
|
|
options={
|
|
'ordering': ['-created_at', '-id'],
|
|
},
|
|
),
|
|
]
|