Tesis 1.0.0
Loading...
Searching...
No Matches
0001_initial.py
Go to the documentation of this file.
1# Generated by Django 5.2.1 on 2025-05-13 02:00
2
3import django.db.models.deletion
4import django.utils.timezone
5import uuid
6from django.db import migrations, models
7
8
9class Migration(migrations.Migration):
10
11 initial = True
12
13 dependencies = [
14 ]
15
16 operations = [
17 migrations.CreateModel(
18 name='PaymentRequest',
19 fields=[
20 ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
21 ('user_token', models.CharField(help_text='Token de autenticación del usuario', max_length=255)),
22 ('preference_id', models.CharField(blank=True, help_text='ID de la preferencia en Mercado Pago', max_length=255, null=True)),
23 ('init_point', models.URLField(blank=True, help_text='URL para redirigir al usuario para el pago', null=True)),
24 ('status', models.CharField(default='pending', help_text='Estado del pago', max_length=50)),
25 ('total_amount', models.DecimalField(blank=True, decimal_places=2, help_text='Monto total del pago', max_digits=10, null=True)),
26 ('cart_data', models.JSONField(blank=True, help_text='Datos del carrito del usuario', null=True)),
27 ('created_at', models.DateTimeField(default=django.utils.timezone.now, help_text='Fecha de creación')),
28 ('updated_at', models.DateTimeField(auto_now=True, help_text='Fecha de actualización')),
29 ],
30 options={
31 'verbose_name': 'Solicitud de pago',
32 'verbose_name_plural': 'Solicitudes de pago',
33 'ordering': ['-created_at'],
34 },
35 ),
36 migrations.CreateModel(
37 name='PaymentNotification',
38 fields=[
39 ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
40 ('payment_id', models.CharField(help_text='ID del pago en Mercado Pago', max_length=255)),
41 ('topic', models.CharField(help_text='Tipo de notificación', max_length=50)),
42 ('raw_data', models.JSONField(help_text='Datos completos de la notificación')),
43 ('processed', models.BooleanField(default=False, help_text='Indica si la notificación ya fue procesada')),
44 ('created_at', models.DateTimeField(default=django.utils.timezone.now, help_text='Fecha de recepción')),
45 ('payment_request', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='notifications', to='payment_service.paymentrequest')),
46 ],
47 options={
48 'verbose_name': 'Notificación de pago',
49 'verbose_name_plural': 'Notificaciones de pago',
50 'ordering': ['-created_at'],
51 },
52 ),
53 ]