49 lines
2.1 KiB
Python
49 lines
2.1 KiB
Python
# Generated by Django 6.0.4 on 2026-04-08 16:53
|
|
|
|
import django.db.models.deletion
|
|
from django.db import migrations, models
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
initial = True
|
|
|
|
dependencies = [
|
|
('booking', '0001_initial'),
|
|
]
|
|
|
|
operations = [
|
|
migrations.CreateModel(
|
|
name='WebhookEvent',
|
|
fields=[
|
|
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
('stripe_event_id', models.CharField(max_length=255, unique=True)),
|
|
('event_type', models.CharField(max_length=120)),
|
|
('payload', models.JSONField(default=dict)),
|
|
('processed', models.BooleanField(default=False)),
|
|
('processed_at', models.DateTimeField(blank=True, null=True)),
|
|
('created_at', models.DateTimeField(auto_now_add=True)),
|
|
],
|
|
options={
|
|
'ordering': ('-created_at',),
|
|
},
|
|
),
|
|
migrations.CreateModel(
|
|
name='PaymentRecord',
|
|
fields=[
|
|
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
('stripe_payment_intent_id', models.CharField(max_length=255, unique=True)),
|
|
('stripe_charge_id', models.CharField(blank=True, max_length=255)),
|
|
('amount', models.DecimalField(decimal_places=2, max_digits=10)),
|
|
('currency', models.CharField(default='usd', max_length=8)),
|
|
('status', models.CharField(choices=[('requires_payment', 'Requires Payment'), ('processing', 'Processing'), ('succeeded', 'Succeeded'), ('failed', 'Failed'), ('refunded', 'Refunded')], default='requires_payment', max_length=32)),
|
|
('created_at', models.DateTimeField(auto_now_add=True)),
|
|
('updated_at', models.DateTimeField(auto_now=True)),
|
|
('booking', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='payments', to='booking.booking')),
|
|
],
|
|
options={
|
|
'ordering': ('-created_at',),
|
|
},
|
|
),
|
|
]
|