暫無描述

0001_initial.py 3.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. # Generated by Django 4.2.24 on 2025-09-24 06:05
  2. from django.db import migrations, models
  3. import django.utils.timezone
  4. class Migration(migrations.Migration):
  5. initial = True
  6. dependencies = [
  7. ]
  8. operations = [
  9. migrations.CreateModel(
  10. name='Invoice',
  11. fields=[
  12. ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
  13. ('created_at', models.DateTimeField(auto_now_add=True)),
  14. ('updated_at', models.DateTimeField(auto_now=True)),
  15. ('currency_code', models.CharField(default='USD', max_length=8)),
  16. ('total_amount', models.DecimalField(decimal_places=2, default=0, max_digits=14)),
  17. ('status', models.CharField(choices=[('draft', 'Draft'), ('issued', 'Issued'), ('paid', 'Paid'), ('void', 'Void')], db_index=True, default='draft', max_length=8)),
  18. ('issued_at', models.DateTimeField(blank=True, null=True)),
  19. ('due_at', models.DateTimeField(blank=True, null=True)),
  20. ],
  21. options={
  22. 'abstract': False,
  23. },
  24. ),
  25. migrations.CreateModel(
  26. name='InvoiceLine',
  27. fields=[
  28. ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
  29. ('created_at', models.DateTimeField(auto_now_add=True)),
  30. ('updated_at', models.DateTimeField(auto_now=True)),
  31. ('description', models.CharField(max_length=255)),
  32. ('quantity', models.DecimalField(decimal_places=3, max_digits=12)),
  33. ('unit', models.CharField(choices=[('kg', 'Kilogram'), ('lb', 'Pound'), ('pcs', 'Pieces')], default='kg', max_length=8)),
  34. ('unit_price', models.DecimalField(decimal_places=2, max_digits=12)),
  35. ('line_total', models.DecimalField(decimal_places=2, max_digits=14)),
  36. ],
  37. options={
  38. 'abstract': False,
  39. },
  40. ),
  41. migrations.CreateModel(
  42. name='Payment',
  43. fields=[
  44. ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
  45. ('created_at', models.DateTimeField(auto_now_add=True)),
  46. ('updated_at', models.DateTimeField(auto_now=True)),
  47. ('amount', models.DecimalField(decimal_places=2, max_digits=14)),
  48. ('currency_code', models.CharField(default='USD', max_length=8)),
  49. ('received_at', models.DateTimeField(default=django.utils.timezone.now)),
  50. ('reference', models.CharField(blank=True, max_length=128)),
  51. ],
  52. options={
  53. 'abstract': False,
  54. },
  55. ),
  56. migrations.CreateModel(
  57. name='Payout',
  58. fields=[
  59. ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
  60. ('created_at', models.DateTimeField(auto_now_add=True)),
  61. ('updated_at', models.DateTimeField(auto_now=True)),
  62. ('amount', models.DecimalField(decimal_places=2, max_digits=14)),
  63. ('currency_code', models.CharField(default='USD', max_length=8)),
  64. ('paid_at', models.DateTimeField(default=django.utils.timezone.now)),
  65. ('reference', models.CharField(blank=True, max_length=128)),
  66. ],
  67. options={
  68. 'abstract': False,
  69. },
  70. ),
  71. ]