payment gateways and plans billing and signup pages refactored
This commit is contained in:
@@ -0,0 +1,63 @@
|
||||
# Generated by Django 5.2.9 on 2026-01-07 12:26
|
||||
|
||||
from django.conf import settings
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('billing', '0028_cleanup_payment_method_config'),
|
||||
('igny8_core_auth', '0020_fix_historical_account'),
|
||||
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='WebhookEvent',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('event_id', models.CharField(db_index=True, help_text='Unique event ID from the payment provider', max_length=255, unique=True)),
|
||||
('provider', models.CharField(choices=[('stripe', 'Stripe'), ('paypal', 'PayPal')], db_index=True, help_text='Payment provider (stripe or paypal)', max_length=20)),
|
||||
('event_type', models.CharField(db_index=True, help_text='Event type from the provider', max_length=100)),
|
||||
('payload', models.JSONField(help_text='Full webhook payload')),
|
||||
('processed', models.BooleanField(db_index=True, default=False, help_text='Whether this event has been successfully processed')),
|
||||
('processed_at', models.DateTimeField(blank=True, help_text='When the event was processed', null=True)),
|
||||
('error_message', models.TextField(blank=True, help_text='Error message if processing failed')),
|
||||
('retry_count', models.IntegerField(default=0, help_text='Number of processing attempts')),
|
||||
('created_at', models.DateTimeField(auto_now_add=True)),
|
||||
],
|
||||
options={
|
||||
'verbose_name': 'Webhook Event',
|
||||
'verbose_name_plural': 'Webhook Events',
|
||||
'db_table': 'igny8_webhook_events',
|
||||
'ordering': ['-created_at'],
|
||||
},
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='historicalpayment',
|
||||
name='manual_reference',
|
||||
field=models.CharField(blank=True, help_text='Bank transfer reference, wallet transaction ID, etc.', max_length=255, null=True),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='payment',
|
||||
name='manual_reference',
|
||||
field=models.CharField(blank=True, help_text='Bank transfer reference, wallet transaction ID, etc.', max_length=255, null=True),
|
||||
),
|
||||
migrations.AddConstraint(
|
||||
model_name='payment',
|
||||
constraint=models.UniqueConstraint(condition=models.Q(('manual_reference__isnull', False), models.Q(('manual_reference', ''), _negated=True)), fields=('manual_reference',), name='unique_manual_reference_when_not_null'),
|
||||
),
|
||||
migrations.AddIndex(
|
||||
model_name='webhookevent',
|
||||
index=models.Index(fields=['provider', 'event_type'], name='igny8_webho_provide_ee8a78_idx'),
|
||||
),
|
||||
migrations.AddIndex(
|
||||
model_name='webhookevent',
|
||||
index=models.Index(fields=['processed', 'created_at'], name='igny8_webho_process_88c670_idx'),
|
||||
),
|
||||
migrations.AddIndex(
|
||||
model_name='webhookevent',
|
||||
index=models.Index(fields=['provider', 'processed'], name='igny8_webho_provide_df293b_idx'),
|
||||
),
|
||||
]
|
||||
Reference in New Issue
Block a user