36 lines
1.5 KiB
Python
36 lines
1.5 KiB
Python
# Generated by Django 5.2.17 on 2026-09-15 09:29
|
|
|
|
import django.db.models.deletion
|
|
import uuid
|
|
from django.db import migrations, models
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
initial = True
|
|
|
|
dependencies = [
|
|
('workflows', '0001_initial'),
|
|
]
|
|
|
|
operations = [
|
|
migrations.CreateModel(
|
|
name='PricingRule',
|
|
fields=[
|
|
('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
|
|
('created_at', models.DateTimeField(auto_now_add=True, db_index=True)),
|
|
('updated_at', models.DateTimeField(auto_now=True)),
|
|
('name', models.CharField(max_length=200)),
|
|
('rule_type', models.CharField(choices=[('fixed', 'Fixed'), ('per_kg', 'Per kilogram'), ('per_unit', 'Per unit'), ('percentage', 'Percentage'), ('tiered', 'Tiered'), ('discount', 'Discount'), ('tax', 'Tax'), ('fee', 'Additional fee')], max_length=16)),
|
|
('amount', models.DecimalField(decimal_places=2, default=0, max_digits=18)),
|
|
('config', models.JSONField(blank=True, default=dict)),
|
|
('active', models.BooleanField(default=True)),
|
|
('priority', models.IntegerField(default=0)),
|
|
('step', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='pricing_rules', to='workflows.workflowstep')),
|
|
],
|
|
options={
|
|
'ordering': ['priority'],
|
|
},
|
|
),
|
|
]
|