diff --git a/core/tickets/migrations/0012_shippingvoucher.py b/core/tickets/migrations/0012_shippingvoucher.py index f00c4cd..0c40df1 100644 --- a/core/tickets/migrations/0012_shippingvoucher.py +++ b/core/tickets/migrations/0012_shippingvoucher.py @@ -1,4 +1,4 @@ -# Generated by Django 4.2.7 on 2024-06-18 14:42 +# Generated by Django 4.2.7 on 2024-06-18 14:54 from django.db import migrations, models import django.db.models.deletion @@ -15,7 +15,7 @@ class Migration(migrations.Migration): name='ShippingVoucher', fields=[ ('id', models.AutoField(primary_key=True, serialize=False)), - ('code', models.CharField(max_length=255)), + ('voucher', models.CharField(max_length=255)), ('type', models.CharField(max_length=255)), ('timestamp', models.DateTimeField(auto_now_add=True)), ('used_at', models.DateTimeField(null=True)), diff --git a/core/tickets/models.py b/core/tickets/models.py index a1e6c91..81176a9 100644 --- a/core/tickets/models.py +++ b/core/tickets/models.py @@ -141,7 +141,7 @@ class ItemRelation(models.Model): class ShippingVoucher(models.Model): id = models.AutoField(primary_key=True) issue_thread = models.ForeignKey(IssueThread, on_delete=models.CASCADE, related_name='shipping_vouchers', null=True) - code = models.CharField(max_length=255) + voucher = models.CharField(max_length=255) type = models.CharField(max_length=255) timestamp = models.DateTimeField(auto_now_add=True) used_at = models.DateTimeField(null=True) diff --git a/core/tickets/serializers.py b/core/tickets/serializers.py index acd8afc..c2e07e2 100644 --- a/core/tickets/serializers.py +++ b/core/tickets/serializers.py @@ -127,8 +127,8 @@ class IssueSerializer(serializers.ModelSerializer): 'type': 'shipping_voucher', 'id': shipping_voucher.id, 'timestamp': shipping_voucher.used_at, - 'code': shipping_voucher.code, - 'code_type': shipping_voucher.type, + 'voucher': shipping_voucher.voucher, + 'voucher_type': shipping_voucher.type, }) return sorted(timeline, key=lambda x: x['timestamp'])