File: //home/arjun/projects/unlimited-leads/Unlimited-Leads-Be/payment/migrations/0001_initial.py
# Generated by Django 4.2.16 on 2024-11-22 04:53
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import uuid
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.CreateModel(
name='Product',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('plan_name', models.CharField(max_length=255)),
('amount', models.DecimalField(decimal_places=2, max_digits=10)),
('description', models.TextField(blank=True)),
('currency', models.CharField(max_length=3)),
('product_id', models.CharField(default=uuid.uuid4, editable=False, unique=True)),
('billing_period', models.CharField(blank=True, choices=[('day', 'Day'), ('month', 'Month'), ('year', 'Year')], max_length=10, null=True)),
('is_active', models.BooleanField(default=True)),
('is_free', models.BooleanField(default=False)),
('limit', models.CharField(choices=[('Unlimited', 'Unlimited'), ('100', '100'), ('10000', '10000')], default='0', max_length=20)),
],
),
migrations.CreateModel(
name='Transaction',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('amount', models.DecimalField(decimal_places=2, max_digits=10)),
('purpose', models.CharField(max_length=255)),
('payment_status', models.CharField(choices=[('succeeded', 'Succeeded'), ('pending', 'Pending'), ('failed', 'Failed')], default='pending', max_length=20)),
('is_subscription', models.BooleanField(default=False)),
('subscription_id', models.CharField(blank=True, max_length=255, null=True)),
('subscription_status', models.CharField(blank=True, choices=[('active', 'Active'), ('cancelled', 'Cancelled'), ('past_due', 'Past Due'), ('unpaid', 'Unpaid'), ('incomplete', 'Incomplete')], max_length=20, null=True)),
('subscription_start', models.DateTimeField(blank=True, null=True)),
('subscription_end', models.DateTimeField(blank=True, null=True)),
('invoice_id', models.CharField(blank=True, max_length=255, null=True)),
('receipt_url', models.URLField(blank=True, null=True)),
('created_at', models.DateTimeField(auto_now_add=True)),
('transaction_id', models.CharField(blank=True, max_length=255, null=True)),
('transaction_date', models.DateTimeField(blank=True, null=True)),
('charge_id', models.CharField(blank=True, max_length=255, null=True)),
('customer', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
('product', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='payment.product')),
],
),
]