Files
google-labs-jules[bot] af4c9461e8 Refactor legacy codebase into AniScrap Django platform (#45)
- Initialized 'aniscrap_core' project.
- Implemented 'users', 'content', 'billing', 'scraper_module', 'core' apps.
- Added models for Anime, Episode, VideoFile (HLS/Encrypted), User, Wallet, etc.
- Implemented Celery tasks for Video Encoding (H.265/HLS) and Revenue Distribution.
- Integrated Shopier mock payment flow.
- Configured Unfold Admin Dashboard.
- Refactored Jikan scraper client.
- Added 'init_aniscrap' management command.

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
2026-01-19 09:52:12 +00:00

30 lines
1.2 KiB
Python

from django.db import models
from django.conf import settings
from django.utils.translation import gettext_lazy as _
class SubscriptionPlan(models.Model):
name = models.CharField(max_length=100)
price = models.DecimalField(max_digits=6, decimal_places=2)
duration_days = models.PositiveIntegerField(default=30)
def __str__(self):
return f"{self.name} ({self.price})"
class ShopierPayment(models.Model):
STATUS_CHOICES = (
('pending', 'Pending'),
('success', 'Success'),
('failed', 'Failed'),
)
user = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.CASCADE, related_name='payments')
plan = models.ForeignKey(SubscriptionPlan, on_delete=models.SET_NULL, null=True)
amount = models.DecimalField(max_digits=10, decimal_places=2)
transaction_id = models.CharField(max_length=100, unique=True)
status = models.CharField(max_length=10, choices=STATUS_CHOICES, default='pending')
created_at = models.DateTimeField(auto_now_add=True)
processed_at = models.DateTimeField(null=True, blank=True)
is_distributed = models.BooleanField(default=False)
def __str__(self):
return f"{self.user} - {self.amount} - {self.status}"