Coverage for src/backend/InvenTree/common/migrations/0030_barcodescanresult.py: 100%
7 statements
« prev ^ index » next coverage.py v7.15.2, created at 2026-10-07 17:47 +0000
« prev ^ index » next coverage.py v7.15.2, created at 2026-10-07 17:47 +0000
1# Generated by Django 4.2.15 on 2024-09-21 06:05
3import InvenTree.models
4from django.conf import settings
5from django.db import migrations, models
6import django.db.models.deletion
9class Migration(migrations.Migration):
11 dependencies = [
12 migrations.swappable_dependency(settings.AUTH_USER_MODEL),
13 ('common', '0029_inventreecustomuserstatemodel'),
14 ]
16 operations = [
17 migrations.CreateModel(
18 name='BarcodeScanResult',
19 fields=[
20 ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
21 ('data', models.CharField(help_text='Barcode data', max_length=250, verbose_name='Data')),
22 ('timestamp', models.DateTimeField(auto_now_add=True, help_text='Date and time of the barcode scan', verbose_name='Timestamp')),
23 ('endpoint', models.CharField(blank=True, help_text='URL endpoint which processed the barcode', max_length=250, null=True, verbose_name='Path')),
24 ('context', models.JSONField(blank=True, help_text='Context data for the barcode scan', max_length=1000, null=True, verbose_name='Context')),
25 ('response', models.JSONField(blank=True, help_text='Response data from the barcode scan', max_length=1000, null=True, verbose_name='Response')),
26 ('result', models.BooleanField(default=False, help_text='Was the barcode scan successful?', verbose_name='Result')),
27 ('user', models.ForeignKey(blank=True, help_text='User who scanned the barcode', null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL, verbose_name='User')),
28 ],
29 options={
30 'verbose_name': 'Barcode Scan',
31 },
32 bases=(InvenTree.models.PluginValidationMixin, models.Model),
33 ),
34 ]