Conversion_Kitchen_Code/kitchen_counter/centralizePayment/models.py

191 lines
10 KiB
Python
Raw Permalink Normal View History

2024-04-27 09:33:09 +00:00
from django.db import models
import uuid
from django.contrib.auth import get_user_model
# from centralisedFileSystem.models import BeatSheet
# from subtitling3.models import Subtitles
# from centralisedFileSystem.models import BeatSheet
# from projectcenter.models import Generatedmodel
from mnfapp.models import MNFScriptDatabase
User = get_user_model()
class PromoCode(models.Model):
id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
name = models.CharField(max_length=245)
amount = models.DecimalField(max_digits=10, decimal_places=2)
validity = models.DateTimeField()
def __str__(self) -> str:
return self.name
PAYMENT_RESULT = [("init", "init"),("success", "success"), ("failed", "failed"),("refund-claimed", "refund-claimed"),("refunded", "refunded"),("refunded-rejected", "refunded-rejected"),("auto-refunded", "auto-refunded"),("auto-refund-failed", "auto-refund-failed"),("monthly_user", "monthly_user")]
GATEWAY = [("razorPay", "razorPay"), ("Stripe", "Stripe")]
class CentralPayment(models.Model):
id = models.UUIDField(max_length=36, primary_key=True, default=uuid.uuid4, editable=False)
date = models.DateTimeField(auto_now_add=True)
promo_code = models.CharField(null=True, blank=True, max_length=50)
services_used = models.CharField(null=True, blank=True, max_length=30)
services_id = models.CharField(null=True, blank=True, max_length=50)
user_id = models.ForeignKey(User, on_delete=models.CASCADE)
qtn = models.IntegerField(null=True, blank=True)
total_amount = models.FloatField(null=True, blank=True)
amount_charged = models.FloatField(null=True, blank=True)
discount = models.FloatField(null=True, blank=True)
im_discount = models.FloatField(null=True, blank=True)
gateway_fee = models.FloatField(null=True, blank=True)
currency = models.CharField(default="INR", max_length=30)
payment_status = models.CharField(null=True, blank=True, choices=PAYMENT_RESULT, max_length=50)
payment_gateway = models.CharField(null=True, blank=True, choices=GATEWAY, max_length=10)
payment_id = models.CharField(max_length=100)
order_id = models.CharField(max_length=100)
signature_id = models.CharField(max_length=100)
def __str__(self):
return str(self.payment_id)
# class ScriptwriterPackage(models.Model):
# EVENT_CHOICES = [
# ('Long Jump', 'Long Jump'),
# ('Triple Jump', 'Triple Jump'),
# ('High Jump', 'High Jump'),
# ('Pole Vault', 'Pole Vault'),
# ]
# id = models.UUIDField(max_length=36, primary_key=True, default=uuid.uuid4, editable=False)
# date = models.DateTimeField(auto_now_add=True)
# event = models.CharField(max_length=20, choices=EVENT_CHOICES)
# validity_in_days = models.IntegerField()
# price = models.FloatField()
# screenplay_per_beat_price = models.FloatField()
# screenplay_audit = models.BooleanField()
# conversion_languages = models.IntegerField()
# narration_one_pager = models.BooleanField()
# elevator_pitch = models.BooleanField()
# screenplay_analysis = models.BooleanField()
# character_introduction = models.BooleanField()
# line_by_line_narration = models.BooleanField()
# characterwise_narration = models.BooleanField()
# project_schedule_and_budget = models.BooleanField()
# def __str__(self):
# return f"{self.event} Package"
# class ProductionHousePackage(models.Model):
# PACKAGE_CHOICES = [
# ('Radiate', 'Radiate'),
# ('Regionalise', 'Regionalise'),
# ('Globalise', 'Globalise'),
# ]
# id = models.UUIDField(max_length=36, primary_key=True, default=uuid.uuid4, editable=False)
# date = models.DateTimeField(auto_now_add=True)
# package_name = models.CharField(max_length=20, choices=PACKAGE_CHOICES)
# validity_in_days = models.IntegerField()
# price = models.FloatField()
# subtitling_minutes_input = models.IntegerField()
# output_languages = models.IntegerField()
# iterations_per_language = models.IntegerField()
# project_schedules_and_budgets = models.IntegerField()
# script_pages_for_conversion = models.IntegerField()
# conversion_languages = models.IntegerField()
# ai_assisted_scene_generation = models.IntegerField()
# screenplay_audit_unlimited = models.BooleanField()
# def __str__(self):
# return f"{self.package_name} Package"
# class JuggernautPackage(models.Model):
# id = models.UUIDField(max_length=36, primary_key=True, default=uuid.uuid4, editable=False)
# user_id = models.ForeignKey(User, on_delete=models.CASCADE)
# package_name = models.CharField(max_length=20,null=True, blank=True)
# date = models.DateTimeField(auto_now_add=True)
# updated_at = models.DateTimeField(auto_now=True)
# validity_days = models.IntegerField(default=0, null=True, blank=True)
# price = models.IntegerField(default=0, null=True, blank=True)
# beat_scene_generation = models.IntegerField(default=0, null=True, blank=True)
# beat_scene_generation_initial = models.IntegerField(default=0, null=True, blank=True)
# audit_pages = models.IntegerField(default=0, null=True, blank=True)
# conversion_pages_initial = models.IntegerField(default=0, null=True, blank=True)
# conversion_pages = models.IntegerField(default=0, null=True, blank=True)
# subtitling_minutes_initial = models.IntegerField(default=0, null=True, blank=True)
# subtitling_minutes = models.IntegerField(default=0, null=True, blank=True)
# scheduling_and_budget_projects = models.IntegerField(default=0, null=True, blank=True)
# scheduling_and_budget_projects_initial = models.IntegerField(default=0, null=True, blank=True)
# pitchdeck_one_pager = models.IntegerField(default=0, null=True, blank=True)
# pitchdeck_elevator = models.IntegerField(default=0, null=True, blank=True)
# pitchdeck_screenplay = models.IntegerField(default=0, null=True, blank=True)
# narrarion_character_intro = models.IntegerField(default=0, null=True, blank=True)
# narrarion_line_by_line = models.IntegerField(default=0, null=True, blank=True)
# narrarion_characterwise = models.IntegerField(default=0, null=True, blank=True)
# conversion_iteration = models.IntegerField(default=0, null=True, blank=True)
# conversion_languages = models.IntegerField(default=0, null=True, blank=True)
# subtitling_iteration = models.IntegerField(default=0, null=True, blank=True)
# subtitling_languages = models.IntegerField(default=0, null=True, blank=True)
# language_alert = models.BooleanField(default=False, null=True, blank=True)
# class JuggernautConversionSet(models.Model):
# uuid = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
# associated_project = models.ForeignKey(MNFScriptDatabase, on_delete=models.CASCADE)
# actionline_lang = models.CharField(max_length=150, null=False, blank=False)
# actionline_script = models.CharField(max_length=150, null=False, blank=False)
# dial_lang = models.CharField(max_length=150, null=False, blank=False)
# dial_script = models.CharField(max_length=150, null=False, blank=False)
# class JuggernautConversion(models.Model):
# id = models.UUIDField(max_length=36, primary_key=True, default=uuid.uuid4, editable=False)
# package = models.ForeignKey(JuggernautPackage, on_delete=models.CASCADE)
# created_at = models.DateTimeField(auto_now_add=True)
# updated_at = models.DateTimeField(auto_now=True)
# associated_project = models.ForeignKey(MNFScriptDatabase, on_delete=models.CASCADE)
# project_name = models.CharField(max_length=200,null=True, blank=True)
# project_details = models.IntegerField(default=0, null=True, blank=True) #pages in this case
# languages = models.IntegerField(default=0, null=True, blank=True)
# iterations = models.IntegerField(default=0, null=True, blank=True)
# class JuggernautPitchdeck(models.Model):
# id = models.UUIDField(max_length=36, primary_key=True, default=uuid.uuid4, editable=False)
# package = models.ForeignKey(JuggernautPackage, on_delete=models.CASCADE)
# created_at = models.DateTimeField(auto_now_add=True)
# updated_at = models.DateTimeField(auto_now=True)
# associated_project = models.ForeignKey(MNFScriptDatabase, on_delete=models.CASCADE)
# project_name = models.CharField(max_length=200,null=True, blank=True)
# class JuggernautNarration(models.Model):
# id = models.UUIDField(max_length=36, primary_key=True, default=uuid.uuid4, editable=False)
# package = models.ForeignKey(JuggernautPackage, on_delete=models.CASCADE)
# created_at = models.DateTimeField(auto_now_add=True)
# updated_at = models.DateTimeField(auto_now=True)
# associated_project = models.ForeignKey(MNFScriptDatabase, on_delete=models.CASCADE)
# project_name = models.CharField(max_length=200,null=True, blank=True)
# class JuggernautSubtitling(models.Model):
# id = models.UUIDField(max_length=36, primary_key=True, default=uuid.uuid4, editable=False)
# package = models.ForeignKey(JuggernautPackage, on_delete=models.CASCADE)
# created_at = models.DateTimeField(auto_now_add=True)
# updated_at = models.DateTimeField(auto_now=True)
# associated_project = models.ForeignKey(Subtitles, on_delete=models.CASCADE)
# project_name = models.CharField(max_length=200,null=True, blank=True)
# project_details = models.IntegerField(default=0, null=True, blank=True) #minutes in this case
# languages = models.IntegerField(default=0, null=True, blank=True)
# iterations= models.IntegerField(default=0, null=True, blank=True)
# class JuggernautProjectCenter(models.Model):
# id = models.UUIDField(max_length=36, primary_key=True, default=uuid.uuid4, editable=False)
# package = models.ForeignKey(JuggernautPackage, on_delete=models.CASCADE)
# created_at = models.DateTimeField(auto_now_add=True)
# updated_at = models.DateTimeField(auto_now=True)
# associated_project = models.ForeignKey(Generatedmodel, on_delete=models.CASCADE)
# project_name = models.CharField(max_length=200,null=True, blank=True)
# class JuggernautBeatSheet(models.Model):
# id = models.UUIDField(max_length=36, primary_key=True, default=uuid.uuid4, editable=False)
# package = models.ForeignKey(JuggernautPackage, on_delete=models.CASCADE)
# created_at = models.DateTimeField(auto_now_add=True)
# updated_at = models.DateTimeField(auto_now=True)
# associated_project = models.ForeignKey(BeatSheet, on_delete=models.CASCADE)
# project_name = models.CharField(max_length=200,null=True, blank=True)