Initial commit

This commit is contained in:
2025-01-20 14:33:03 +05:00
commit 4d0eb86478
84 changed files with 4436 additions and 0 deletions

View File

@ -0,0 +1,56 @@
# Generated by Django 5.1.2 on 2025-01-20 04:50
import django.db.models.deletion
import django.utils.timezone
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.CreateModel(
name="Device",
fields=[
(
"id",
models.CharField(max_length=255, primary_key=True, serialize=False),
),
("name", models.CharField(max_length=255)),
("mac", models.CharField(max_length=255)),
(
"reason_for_blocking",
models.CharField(blank=True, max_length=255, null=True),
),
("is_active", models.BooleanField(default=False)),
("registered", models.BooleanField(default=False)),
("blocked", models.BooleanField(default=False)),
(
"blocked_by",
models.CharField(
choices=[("ADMIN", "Admin"), ("PARENT", "Parent")],
default="PARENT",
max_length=255,
),
),
("expiry_date", models.DateTimeField(blank=True, null=True)),
("created_at", models.DateTimeField(default=django.utils.timezone.now)),
("updated_at", models.DateTimeField(auto_now=True)),
(
"user",
models.ForeignKey(
blank=True,
null=True,
on_delete=django.db.models.deletion.SET_NULL,
related_name="devices",
to=settings.AUTH_USER_MODEL,
),
),
],
),
]

View File

@ -0,0 +1,93 @@
# Generated by Django 5.1.2 on 2025-01-20 06:58
import django.db.models.deletion
import django.utils.timezone
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("billing", "0001_initial"),
("devices", "0003_device_delete_billformula_remove_topup_user_and_more"),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.CreateModel(
name="BillFormula",
fields=[
(
"id",
models.CharField(max_length=255, primary_key=True, serialize=False),
),
("formula", models.CharField(max_length=255)),
("base_amount", models.FloatField()),
("discount_percentage", models.FloatField()),
("created_at", models.DateTimeField(default=django.utils.timezone.now)),
("updated_at", models.DateTimeField(auto_now=True)),
],
),
migrations.CreateModel(
name="Payment",
fields=[
(
"id",
models.CharField(max_length=255, primary_key=True, serialize=False),
),
("number_of_months", models.IntegerField()),
("amount", models.FloatField()),
("paid", models.BooleanField(default=False)),
("paid_at", models.DateTimeField(blank=True, null=True)),
(
"method",
models.CharField(
choices=[("WALLET", "Wallet"), ("TRANSFER", "Transfer")],
default="TRANSFER",
max_length=255,
),
),
("expires_at", models.DateTimeField(blank=True, null=True)),
("created_at", models.DateTimeField(default=django.utils.timezone.now)),
("updated_at", models.DateTimeField(auto_now=True)),
(
"devices",
models.ManyToManyField(
related_name="payments", to="devices.device"
),
),
(
"user",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
related_name="payments",
to=settings.AUTH_USER_MODEL,
),
),
],
),
migrations.CreateModel(
name="Topup",
fields=[
(
"id",
models.CharField(max_length=255, primary_key=True, serialize=False),
),
("amount", models.FloatField()),
("paid", models.BooleanField(default=False)),
("created_at", models.DateTimeField(default=django.utils.timezone.now)),
("updated_at", models.DateTimeField(auto_now=True)),
(
"user",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
related_name="topups",
to=settings.AUTH_USER_MODEL,
),
),
],
),
migrations.DeleteModel(
name="Device",
),
]

View File