first
This commit is contained in:
commit
89a5d70512
284 files changed
+8364
No files matched your search
+161
@@ -0,0 +1,161 @@
|
||||
media/*
|
||||
# Byte-compiled / optimized / DLL files
|
||||
__pycache__/
|
||||
*.py[cod]
|
||||
*$py.class
|
||||
|
||||
# C extensions
|
||||
*.so
|
||||
|
||||
# Distribution / packaging
|
||||
.Python
|
||||
build/
|
||||
develop-eggs/
|
||||
dist/
|
||||
downloads/
|
||||
eggs/
|
||||
.eggs/
|
||||
lib/
|
||||
lib64/
|
||||
parts/
|
||||
sdist/
|
||||
var/
|
||||
wheels/
|
||||
share/python-wheels/
|
||||
*.egg-info/
|
||||
.installed.cfg
|
||||
*.egg
|
||||
MANIFEST
|
||||
|
||||
# PyInstaller
|
||||
# Usually these files are written by a python script from a template
|
||||
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
||||
*.manifest
|
||||
*.spec
|
||||
|
||||
# Installer logs
|
||||
pip-log.txt
|
||||
pip-delete-this-directory.txt
|
||||
|
||||
# Unit test / coverage reports
|
||||
htmlcov/
|
||||
.tox/
|
||||
.nox/
|
||||
.coverage
|
||||
.coverage.*
|
||||
.cache
|
||||
nosetests.xml
|
||||
coverage.xml
|
||||
*.cover
|
||||
*.py,cover
|
||||
.hypothesis/
|
||||
.pytest_cache/
|
||||
cover/
|
||||
|
||||
# Translations
|
||||
*.mo
|
||||
*.pot
|
||||
|
||||
# Django stuff:
|
||||
*.log
|
||||
local_settings.py
|
||||
db.sqlite3
|
||||
db.sqlite3-journal
|
||||
|
||||
# Flask stuff:
|
||||
instance/
|
||||
.webassets-cache
|
||||
|
||||
# Scrapy stuff:
|
||||
.scrapy
|
||||
|
||||
# Sphinx documentation
|
||||
docs/_build/
|
||||
|
||||
# PyBuilder
|
||||
.pybuilder/
|
||||
target/
|
||||
|
||||
# Jupyter Notebook
|
||||
.ipynb_checkpoints
|
||||
|
||||
# IPython
|
||||
profile_default/
|
||||
ipython_config.py
|
||||
|
||||
# pyenv
|
||||
# For a library or package, you might want to ignore these files since the code is
|
||||
# intended to run in multiple environments; otherwise, check them in:
|
||||
# .python-version
|
||||
|
||||
# pipenv
|
||||
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
||||
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
||||
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
||||
# install all needed dependencies.
|
||||
#Pipfile.lock
|
||||
|
||||
# poetry
|
||||
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
||||
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
||||
# commonly ignored for libraries.
|
||||
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
||||
#poetry.lock
|
||||
|
||||
# pdm
|
||||
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
||||
#pdm.lock
|
||||
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
|
||||
# in version control.
|
||||
# https://pdm.fming.dev/#use-with-ide
|
||||
.pdm.toml
|
||||
|
||||
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
||||
__pypackages__/
|
||||
|
||||
# Celery stuff
|
||||
celerybeat-schedule
|
||||
celerybeat.pid
|
||||
|
||||
# SageMath parsed files
|
||||
*.sage.py
|
||||
|
||||
# Environments
|
||||
.env
|
||||
.venv
|
||||
env/
|
||||
venv/
|
||||
ENV/
|
||||
env.bak/
|
||||
venv.bak/
|
||||
|
||||
# Spyder project settings
|
||||
.spyderproject
|
||||
.spyproject
|
||||
|
||||
# Rope project settings
|
||||
.ropeproject
|
||||
|
||||
# mkdocs documentation
|
||||
/site
|
||||
|
||||
# mypy
|
||||
.mypy_cache/
|
||||
.dmypy.json
|
||||
dmypy.json
|
||||
|
||||
# Pyre type checker
|
||||
.pyre/
|
||||
|
||||
# pytype static type analyzer
|
||||
.pytype/
|
||||
|
||||
# Cython debug symbols
|
||||
cython_debug/
|
||||
|
||||
# PyCharm
|
||||
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
||||
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
||||
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
||||
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
||||
#.idea/
|
||||
Generated
+24
@@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="PYTHON_MODULE" version="4">
|
||||
<component name="FacetManager">
|
||||
<facet type="django" name="Django">
|
||||
<configuration>
|
||||
<option name="rootFolder" value="$MODULE_DIR$" />
|
||||
<option name="settingsModule" value="settings.py" />
|
||||
<option name="manageScript" value="$MODULE_DIR$/manage.py" />
|
||||
<option name="environment" value="<map/>" />
|
||||
<option name="doNotUseTestRunner" value="false" />
|
||||
<option name="trackFilePattern" value="migrations" />
|
||||
</configuration>
|
||||
</facet>
|
||||
</component>
|
||||
<component name="NewModuleRootManager">
|
||||
<content url="file://$MODULE_DIR$" />
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
<component name="PyDocumentationSettings">
|
||||
<option name="format" value="PLAIN" />
|
||||
<option name="myDocStringFormat" value="Plain" />
|
||||
</component>
|
||||
</module>
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
<component name="InspectionProjectProfileManager">
|
||||
<profile version="1.0">
|
||||
<option name="myName" value="Project Default" />
|
||||
<inspection_tool class="Eslint" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
</profile>
|
||||
</component>
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
<component name="InspectionProjectProfileManager">
|
||||
<settings>
|
||||
<option name="USE_PROJECT_PROFILE" value="false" />
|
||||
<version value="1.0" />
|
||||
</settings>
|
||||
</component>
|
||||
Generated
+4
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectRootManager" version="2" project-jdk-name="crmApiEnv" project-jdk-type="Python SDK" />
|
||||
</project>
|
||||
Generated
+8
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/crmApi.iml" filepath="$PROJECT_DIR$/.idea/crmApi.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
||||
Generated
+6
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
||||
Generated
+95
@@ -0,0 +1,95 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="87c5db51-3e89-4a98-9bbb-121c9c52ab3c" name="Changes" comment="" />
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
||||
<option name="LAST_RESOLUTION" value="IGNORE" />
|
||||
</component>
|
||||
<component name="DjangoConsoleOptions" custom-start-script="import sys; print('Python %s on %s' % (sys.version, sys.platform)) import django; print('Django %s' % django.get_version()) sys.path.extend([WORKING_DIR_AND_PYTHON_PATHS]) if 'setup' in dir(django): django.setup() import django_manage_shell; django_manage_shell.run(PROJECT_ROOT)">
|
||||
<option name="myCustomStartScript" value="import sys; print('Python %s on %s' % (sys.version, sys.platform)) import django; print('Django %s' % django.get_version()) sys.path.extend([WORKING_DIR_AND_PYTHON_PATHS]) if 'setup' in dir(django): django.setup() import django_manage_shell; django_manage_shell.run(PROJECT_ROOT)" />
|
||||
</component>
|
||||
<component name="FileTemplateManagerImpl">
|
||||
<option name="RECENT_TEMPLATES">
|
||||
<list>
|
||||
<option value="Python Script" />
|
||||
</list>
|
||||
</option>
|
||||
</component>
|
||||
<component name="MarkdownSettingsMigration">
|
||||
<option name="stateVersion" value="1" />
|
||||
</component>
|
||||
<component name="ProjectId" id="2SvKNIPBcTXVjDKPSdS8NHW9I0w" />
|
||||
<component name="ProjectLevelVcsManager" settingsEditedManually="true" />
|
||||
<component name="ProjectViewState">
|
||||
<option name="hideEmptyMiddlePackages" value="true" />
|
||||
<option name="showLibraryContents" value="true" />
|
||||
</component>
|
||||
<component name="PropertiesComponent">{
|
||||
"keyToString": {
|
||||
"RunOnceActivity.OpenProjectViewOnStart": "true",
|
||||
"RunOnceActivity.ShowReadmeOnStart": "true",
|
||||
"WebServerToolWindowFactoryState": "false",
|
||||
"last_opened_file_path": "E:/Projects/crmProject/Project/api-Project/crmApi",
|
||||
"node.js.detected.package.eslint": "true",
|
||||
"node.js.selected.package.eslint": "(autodetect)",
|
||||
"settings.editor.selected.configurable": "com.jetbrains.python.configuration.PyActiveSdkModuleConfigurable"
|
||||
}
|
||||
}</component>
|
||||
<component name="RecentsManager">
|
||||
<key name="MoveFile.RECENT_KEYS">
|
||||
<recent name="E:\Projects\crmProject\Project\api-Project\crmApi\utils" />
|
||||
<recent name="E:\Projects\crmProject\Project\api-Project\crmApi\apps\jwt_auth" />
|
||||
</key>
|
||||
</component>
|
||||
<component name="RunManager">
|
||||
<configuration name="crmApi" type="Python.DjangoServer" factoryName="Django server">
|
||||
<module name="crmApi" />
|
||||
<option name="INTERPRETER_OPTIONS" value="" />
|
||||
<option name="PARENT_ENVS" value="true" />
|
||||
<envs>
|
||||
<env name="PYTHONUNBUFFERED" value="1" />
|
||||
</envs>
|
||||
<option name="SDK_HOME" value="" />
|
||||
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
|
||||
<option name="IS_MODULE_SDK" value="true" />
|
||||
<option name="ADD_CONTENT_ROOTS" value="true" />
|
||||
<option name="ADD_SOURCE_ROOTS" value="true" />
|
||||
<option name="launchJavascriptDebuger" value="false" />
|
||||
<option name="port" value="8000" />
|
||||
<option name="host" value="127.0.0.1" />
|
||||
<option name="additionalOptions" value="" />
|
||||
<option name="browserUrl" value="" />
|
||||
<option name="runTestServer" value="false" />
|
||||
<option name="runNoReload" value="false" />
|
||||
<option name="useCustomRunCommand" value="false" />
|
||||
<option name="customRunCommand" value="" />
|
||||
<method v="2" />
|
||||
</configuration>
|
||||
</component>
|
||||
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
|
||||
<component name="TaskManager">
|
||||
<task active="true" id="Default" summary="Default task">
|
||||
<changelist id="87c5db51-3e89-4a98-9bbb-121c9c52ab3c" name="Changes" comment="" />
|
||||
<created>1690021572968</created>
|
||||
<option name="number" value="Default" />
|
||||
<option name="presentableId" value="Default" />
|
||||
<updated>1690021572968</updated>
|
||||
<workItem from="1690021574224" duration="35093000" />
|
||||
<workItem from="1691306230591" duration="37336000" />
|
||||
<workItem from="1691557935843" duration="15754000" />
|
||||
<workItem from="1691643121333" duration="14494000" />
|
||||
<workItem from="1691822728558" duration="65591000" />
|
||||
<workItem from="1692433349535" duration="24154000" />
|
||||
<workItem from="1697269439761" duration="66295000" />
|
||||
<workItem from="1702900258020" duration="63755000" />
|
||||
<workItem from="1704088148329" duration="105568000" />
|
||||
<workItem from="1704951046597" duration="69392000" />
|
||||
</task>
|
||||
<servers />
|
||||
</component>
|
||||
<component name="TypeScriptGeneratedFilesManager">
|
||||
<option name="version" value="3" />
|
||||
</component>
|
||||
</project>
|
||||
Whitespace-only changes.
Whitespace-only changes.
@@ -0,0 +1,30 @@
|
||||
from django.contrib import admin
|
||||
from apps.cuser.models import (
|
||||
CUser as CUserModel,
|
||||
CuserRole as CuserRoleModel,
|
||||
RoleType as RoleTypeModel,
|
||||
SmsOpt as SmsOptModel
|
||||
)
|
||||
# Register your models here.
|
||||
|
||||
|
||||
class CUserAdmin(admin.ModelAdmin):
|
||||
pass
|
||||
|
||||
|
||||
class CUserRoleAdmin(admin.ModelAdmin):
|
||||
pass
|
||||
|
||||
|
||||
class RoleTypeAdmin(admin.ModelAdmin):
|
||||
pass
|
||||
|
||||
|
||||
class SmsOptAdmin(admin.ModelAdmin):
|
||||
pass
|
||||
|
||||
|
||||
admin.site.register(CUserModel, CUserAdmin)
|
||||
admin.site.register(CuserRoleModel, CUserRoleAdmin)
|
||||
admin.site.register(RoleTypeModel, RoleTypeAdmin)
|
||||
admin.site.register(SmsOptModel, SmsOptAdmin)
|
||||
@@ -0,0 +1,6 @@
|
||||
from django.apps import AppConfig
|
||||
|
||||
|
||||
class CuserConfig(AppConfig):
|
||||
default_auto_field = 'django.db.models.BigAutoField'
|
||||
name = 'apps.cuser'
|
||||
@@ -0,0 +1,37 @@
|
||||
# Generated by Django 4.2.1 on 2023-07-22 12:07
|
||||
|
||||
from django.db import migrations, models
|
||||
import uuid
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
initial = True
|
||||
|
||||
dependencies = [
|
||||
('auth', '0012_alter_user_first_name_max_length'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='CUser',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('password', models.CharField(max_length=128, verbose_name='password')),
|
||||
('last_login', models.DateTimeField(blank=True, null=True, verbose_name='last login')),
|
||||
('created_at', models.DateTimeField(auto_now_add=True)),
|
||||
('updated_at', models.DateTimeField(auto_now=True)),
|
||||
('username', models.CharField(max_length=50, unique=True)),
|
||||
('name_family', models.CharField(blank=True, max_length=50, null=True)),
|
||||
('is_active', models.BooleanField(default=False)),
|
||||
('is_staff', models.BooleanField(default=False)),
|
||||
('is_superuser', models.BooleanField(default=False)),
|
||||
('uuid', models.UUIDField(default=uuid.uuid4, editable=False, unique=True)),
|
||||
('groups', models.ManyToManyField(blank=True, help_text='The groups this user belongs to. A user will get all permissions granted to each of their groups.', related_name='user_set', related_query_name='user', to='auth.group', verbose_name='groups')),
|
||||
('user_permissions', models.ManyToManyField(blank=True, help_text='Specific permissions for this user.', related_name='user_set', related_query_name='user', to='auth.permission', verbose_name='user permissions')),
|
||||
],
|
||||
options={
|
||||
'abstract': False,
|
||||
},
|
||||
),
|
||||
]
|
||||
@@ -0,0 +1,47 @@
|
||||
# Generated by Django 4.2.1 on 2023-07-23 05:20
|
||||
|
||||
from django.conf import settings
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
import uuid
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('cuser', '0001_initial'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='RoleType',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('created_at', models.DateTimeField(auto_now_add=True)),
|
||||
('updated_at', models.DateTimeField(auto_now=True)),
|
||||
('role_name', models.CharField(max_length=20)),
|
||||
],
|
||||
options={
|
||||
'abstract': False,
|
||||
},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='CuserRole',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('created_at', models.DateTimeField(auto_now_add=True)),
|
||||
('updated_at', models.DateTimeField(auto_now=True)),
|
||||
('name_family', models.CharField(max_length=30)),
|
||||
('title', models.CharField(blank=True, max_length=30, null=True)),
|
||||
('mobile', models.PositiveBigIntegerField()),
|
||||
('mobile_verify', models.BooleanField(default=False)),
|
||||
('uuid', models.UUIDField(default=uuid.uuid4, editable=False, unique=True)),
|
||||
('is_active', models.BooleanField(default=False)),
|
||||
('cuser', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='cuser_role', to=settings.AUTH_USER_MODEL)),
|
||||
('role_type', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='role_type', to='cuser.roletype')),
|
||||
],
|
||||
options={
|
||||
'abstract': False,
|
||||
},
|
||||
),
|
||||
]
|
||||
@@ -0,0 +1,18 @@
|
||||
# Generated by Django 4.2.1 on 2023-08-08 08:44
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('cuser', '0002_roletype_cuserrole'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='roletype',
|
||||
name='role_name_en',
|
||||
field=models.CharField(default='', max_length=20),
|
||||
),
|
||||
]
|
||||
@@ -0,0 +1,17 @@
|
||||
# Generated by Django 4.2.1 on 2023-08-10 05:19
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('cuser', '0003_roletype_role_name_en'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterModelOptions(
|
||||
name='cuser',
|
||||
options={'permissions': [('user_is_workspace_owner', 'user is workspace owner'), ('user_is_workspace_admin', 'user is workspace admin'), ('user_is_workspace_operator', 'user is workspace operator'), ('user_is_workspace_customer', 'user is workspace customer')]},
|
||||
),
|
||||
]
|
||||
@@ -0,0 +1,27 @@
|
||||
# Generated by Django 4.2.1 on 2023-08-20 08:10
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('cuser', '0004_alter_cuser_options'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='SmsOpt',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('created_at', models.DateTimeField(auto_now_add=True)),
|
||||
('updated_at', models.DateTimeField(auto_now=True)),
|
||||
('mobile', models.BigIntegerField()),
|
||||
('opt', models.IntegerField()),
|
||||
('expire', models.DateTimeField(blank=True, null=True)),
|
||||
],
|
||||
options={
|
||||
'abstract': False,
|
||||
},
|
||||
),
|
||||
]
|
||||
@@ -0,0 +1,18 @@
|
||||
# Generated by Django 4.2.1 on 2024-01-21 08:09
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('cuser', '0005_smsopt'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='cuser',
|
||||
name='mobile',
|
||||
field=models.PositiveBigIntegerField(default=411),
|
||||
),
|
||||
]
|
||||
@@ -0,0 +1,18 @@
|
||||
# Generated by Django 4.2.1 on 2024-01-21 08:10
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('cuser', '0006_cuser_mobile'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='cuser',
|
||||
name='mobile',
|
||||
field=models.PositiveBigIntegerField(unique=True),
|
||||
),
|
||||
]
|
||||
Whitespace-only changes.
@@ -0,0 +1,82 @@
|
||||
from django.db import models
|
||||
from django.contrib.auth.models import AbstractBaseUser, BaseUserManager, PermissionsMixin
|
||||
from utils.base_model import BaseModel
|
||||
#from apps.workspace.models import Workspace as WorkspaceModel
|
||||
import uuid
|
||||
|
||||
# Create your models here.
|
||||
import random
|
||||
|
||||
class CUserManager(BaseUserManager):
|
||||
def create_user(self, username, password, **extra_fields):
|
||||
if not username:
|
||||
raise ValueError("Please Enter username")
|
||||
user = self.model(username=username, **extra_fields)
|
||||
user.set_password(password)
|
||||
user.save()
|
||||
return user
|
||||
|
||||
def create_superuser(self, username, password, **extra_fields):
|
||||
extra_fields.setdefault('is_staff', True)
|
||||
extra_fields.setdefault('is_superuser', True)
|
||||
extra_fields.setdefault('is_active', True)
|
||||
|
||||
return self.create_user(username, password, **extra_fields)
|
||||
|
||||
|
||||
class CUser(BaseModel, AbstractBaseUser, PermissionsMixin):
|
||||
username = models.CharField(max_length=50, null=False, blank=False, unique=True)
|
||||
mobile = models.PositiveBigIntegerField(null=False, blank=False, unique=True)
|
||||
name_family = models.CharField(max_length=50, null=True, blank=True)
|
||||
is_active = models.BooleanField(default=False)
|
||||
is_staff = models.BooleanField(default=False)
|
||||
is_superuser = models.BooleanField(default=False)
|
||||
uuid = models.UUIDField(default=uuid.uuid4, editable=False, unique=True)
|
||||
|
||||
USERNAME_FIELD = 'username'
|
||||
|
||||
objects = CUserManager()
|
||||
|
||||
class Meta:
|
||||
permissions = [
|
||||
('user_is_workspace_owner', 'user is workspace owner'),
|
||||
('user_is_workspace_admin', 'user is workspace admin'),
|
||||
('user_is_workspace_operator', 'user is workspace operator'),
|
||||
('user_is_workspace_customer', 'user is workspace customer'),
|
||||
]
|
||||
|
||||
def __str__(self):
|
||||
return str(self.username)
|
||||
|
||||
|
||||
class RoleType(BaseModel):
|
||||
role_name = models.CharField(max_length=20, null=False, blank=False)
|
||||
role_name_en = models.CharField(max_length=20, null=False, blank=False, default='')
|
||||
|
||||
def __str__(self):
|
||||
return str(self.role_name)
|
||||
|
||||
|
||||
class CuserRole(BaseModel):
|
||||
cuser = models.ForeignKey(CUser, on_delete=models.CASCADE, related_name='cuser_role')
|
||||
role_type = models.ForeignKey(RoleType, on_delete=models.CASCADE, related_name='role_type')
|
||||
name_family = models.CharField(max_length=30, null=False, blank=False)
|
||||
title = models.CharField(max_length=30, null=True, blank=True)
|
||||
mobile = models.PositiveBigIntegerField(null=False, blank=False)
|
||||
mobile_verify = models.BooleanField(default=False)
|
||||
#sys_ws = models.ForeignKey(WorkspaceModel, on_delete=models.CASCADE, null=True, blank=True, default=None)
|
||||
|
||||
uuid = models.UUIDField(default=uuid.uuid4, editable=False, unique=True)
|
||||
is_active = models.BooleanField(default=False)
|
||||
|
||||
def __str__(self):
|
||||
return f'{str(self.cuser) } - { str(self.id) }'
|
||||
|
||||
|
||||
class SmsOpt(BaseModel):
|
||||
mobile = models.BigIntegerField(null=False, blank=False)
|
||||
opt = models.IntegerField(null=False, blank=False)
|
||||
expire = models.DateTimeField(null=True, blank=True)
|
||||
|
||||
def __str__(self):
|
||||
return f'{self.mobile} {self.opt}'
|
||||
@@ -0,0 +1,3 @@
|
||||
from django.test import TestCase
|
||||
|
||||
# Create your tests here.
|
||||
@@ -0,0 +1,6 @@
|
||||
from django.urls import path
|
||||
from apps.cuser.views import *
|
||||
|
||||
urlpatterns = [
|
||||
path('info/', CUserGetInfo.as_view(), name='cuser_info'),
|
||||
]
|
||||
@@ -0,0 +1,17 @@
|
||||
from rest_framework import views
|
||||
from apps.cuser.models import CuserRole as CuserRoleModel
|
||||
from utils.get_cuser_role import get_cuser_role_uuid
|
||||
from rest_framework.response import Response
|
||||
from rest_framework import status
|
||||
# Create your views here.
|
||||
|
||||
|
||||
class CUserGetInfo(views.APIView):
|
||||
def get(self, request):
|
||||
|
||||
cuser_role_uuid = get_cuser_role_uuid(request)
|
||||
cuser_obj = CuserRoleModel.objects.get(uuid=cuser_role_uuid)
|
||||
|
||||
return Response(data={"name_family": cuser_obj.name_family}, status=status.HTTP_200_OK)
|
||||
|
||||
|
||||
Whitespace-only changes.
@@ -0,0 +1,46 @@
|
||||
from django.contrib import admin
|
||||
from apps.customer.models import (
|
||||
Customer as CustomerModel,
|
||||
CustomerNote as CustomerNoteModel,
|
||||
ShiveAshenaei as ShiveAshenaeiModel,
|
||||
ResponsibleGroup as ResponsibleGroupModel,
|
||||
CustomerResponsible as CustomerResponsibleModel,
|
||||
CustomerGroupType as CustomerGroupTypeModel,
|
||||
CustomerGroup as CustomerGroupModel,
|
||||
)
|
||||
# Register your models here.
|
||||
|
||||
|
||||
@admin.register(CustomerModel)
|
||||
class CustomerAdmin(admin.ModelAdmin):
|
||||
pass
|
||||
|
||||
|
||||
@admin.register(CustomerNoteModel)
|
||||
class CustomerNoteAdmin(admin.ModelAdmin):
|
||||
pass
|
||||
|
||||
|
||||
@admin.register(ShiveAshenaeiModel)
|
||||
class ShiveAshenaeiAdmin(admin.ModelAdmin):
|
||||
pass
|
||||
|
||||
|
||||
@admin.register(ResponsibleGroupModel)
|
||||
class ResponsibleGroupAdmin(admin.ModelAdmin):
|
||||
pass
|
||||
|
||||
|
||||
@admin.register(CustomerResponsibleModel)
|
||||
class CustomerResponsibleAdmin(admin.ModelAdmin):
|
||||
pass
|
||||
|
||||
|
||||
@admin.register(CustomerGroupTypeModel)
|
||||
class CustomerGroupTypeAdmin(admin.ModelAdmin):
|
||||
pass
|
||||
|
||||
|
||||
@admin.register(CustomerGroupModel)
|
||||
class CustomerGroupAdmin(admin.ModelAdmin):
|
||||
pass
|
||||
@@ -0,0 +1,6 @@
|
||||
from django.apps import AppConfig
|
||||
|
||||
|
||||
class CustomerConfig(AppConfig):
|
||||
default_auto_field = 'django.db.models.BigAutoField'
|
||||
name = 'apps.customer'
|
||||
@@ -0,0 +1,104 @@
|
||||
# Generated by Django 4.2.1 on 2023-08-08 08:37
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
initial = True
|
||||
|
||||
dependencies = [
|
||||
('workspace', '0002_city'),
|
||||
('cuser', '0002_roletype_cuserrole'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='ShiveAshenaei',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('created_at', models.DateTimeField(auto_now_add=True)),
|
||||
('updated_at', models.DateTimeField(auto_now=True)),
|
||||
('name', models.CharField(max_length=15)),
|
||||
('sys_ws', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='workspace.workspace')),
|
||||
],
|
||||
options={
|
||||
'abstract': False,
|
||||
},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='ResponsibleGroup',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('created_at', models.DateTimeField(auto_now_add=True)),
|
||||
('updated_at', models.DateTimeField(auto_now=True)),
|
||||
('name', models.CharField(max_length=15)),
|
||||
('sys_ws', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='workspace.workspace')),
|
||||
],
|
||||
options={
|
||||
'abstract': False,
|
||||
},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='CustomerResponsible',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('created_at', models.DateTimeField(auto_now_add=True)),
|
||||
('updated_at', models.DateTimeField(auto_now=True)),
|
||||
('cuser_role', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='cuser.cuserrole')),
|
||||
('responsible_group', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='customer.responsiblegroup')),
|
||||
('sys_ws', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='workspace.workspace')),
|
||||
],
|
||||
options={
|
||||
'abstract': False,
|
||||
},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='CustomerGroupType',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('created_at', models.DateTimeField(auto_now_add=True)),
|
||||
('updated_at', models.DateTimeField(auto_now=True)),
|
||||
('name', models.CharField(max_length=10)),
|
||||
('sys_ws', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='workspace.workspace')),
|
||||
],
|
||||
options={
|
||||
'abstract': False,
|
||||
},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='CustomerGroup',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('created_at', models.DateTimeField(auto_now_add=True)),
|
||||
('updated_at', models.DateTimeField(auto_now=True)),
|
||||
('name', models.CharField(max_length=15)),
|
||||
('group_type', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='customer.customergrouptype')),
|
||||
('sys_ws', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='workspace.workspace')),
|
||||
],
|
||||
options={
|
||||
'abstract': False,
|
||||
},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='Customer',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('created_at', models.DateTimeField(auto_now_add=True)),
|
||||
('updated_at', models.DateTimeField(auto_now=True)),
|
||||
('name_family', models.CharField(max_length=25)),
|
||||
('mobile', models.PositiveBigIntegerField(blank=True, null=True)),
|
||||
('phone', models.PositiveBigIntegerField(blank=True, null=True)),
|
||||
('address', models.CharField(max_length=100)),
|
||||
('city', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='workspace.city')),
|
||||
('cuser_role', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='cuser.cuserrole')),
|
||||
('responsible_group', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='customer.responsiblegroup')),
|
||||
('shive_ashenaei', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='customer.shiveashenaei')),
|
||||
('sys_ws', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='workspace.workspace')),
|
||||
],
|
||||
options={
|
||||
'abstract': False,
|
||||
},
|
||||
),
|
||||
]
|
||||
@@ -0,0 +1,18 @@
|
||||
# Generated by Django 4.2.1 on 2023-08-13 05:45
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('customer', '0001_initial'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='responsiblegroup',
|
||||
name='name',
|
||||
field=models.CharField(max_length=20),
|
||||
),
|
||||
]
|
||||
@@ -0,0 +1,18 @@
|
||||
# Generated by Django 4.2.1 on 2023-08-19 12:54
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('customer', '0002_alter_responsiblegroup_name'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='customer',
|
||||
name='address',
|
||||
field=models.CharField(blank=True, max_length=100, null=True),
|
||||
),
|
||||
]
|
||||
@@ -0,0 +1,19 @@
|
||||
# Generated by Django 4.2.1 on 2024-01-09 10:05
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('customer', '0003_alter_customer_address'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='customerresponsible',
|
||||
name='responsible_group',
|
||||
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='customer_responsible', to='customer.responsiblegroup'),
|
||||
),
|
||||
]
|
||||
@@ -0,0 +1,35 @@
|
||||
# Generated by Django 4.2.1 on 2024-01-10 12:08
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('cuser', '0005_smsopt'),
|
||||
('workspace', '0003_alter_workspace_uuid'),
|
||||
('customer', '0004_alter_customerresponsible_responsible_group'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterModelOptions(
|
||||
name='customer',
|
||||
options={'ordering': ['-created_at']},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='CustomerNote',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('created_at', models.DateTimeField(auto_now_add=True)),
|
||||
('updated_at', models.DateTimeField(auto_now=True)),
|
||||
('desc', models.CharField(max_length=200)),
|
||||
('cuser_role', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='cuser.cuserrole')),
|
||||
('customer', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='customer.customer')),
|
||||
('sys_ws', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='workspace.workspace')),
|
||||
],
|
||||
options={
|
||||
'abstract': False,
|
||||
},
|
||||
),
|
||||
]
|
||||
@@ -0,0 +1,17 @@
|
||||
# Generated by Django 4.2.1 on 2024-01-13 10:29
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('customer', '0005_alter_customer_options_customernote'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterModelOptions(
|
||||
name='customernote',
|
||||
options={'ordering': ['-created_at']},
|
||||
),
|
||||
]
|
||||
Whitespace-only changes.
@@ -0,0 +1,83 @@
|
||||
from django.db import models
|
||||
from utils.base_model import BaseModel
|
||||
from apps.workspace.models import City as CityModel, Workspace as WorkspaceModel
|
||||
from apps.cuser.models import CuserRole as CuserRoleModel
|
||||
from django.core.exceptions import ValidationError
|
||||
# Create your models here.
|
||||
|
||||
|
||||
class ShiveAshenaei(BaseModel):
|
||||
name = models.CharField(max_length=15, null=False, blank=False)
|
||||
sys_ws = models.ForeignKey(WorkspaceModel, on_delete=models.CASCADE, null=False, blank=False)
|
||||
|
||||
def __str__(self):
|
||||
return str(self.name)
|
||||
|
||||
|
||||
class ResponsibleGroup(BaseModel):
|
||||
name = models.CharField(max_length=20, null=False, blank=False)
|
||||
sys_ws = models.ForeignKey(WorkspaceModel, on_delete=models.CASCADE, null=False, blank=False)
|
||||
|
||||
def __str__(self):
|
||||
return str(self.name)
|
||||
|
||||
|
||||
class CustomerResponsible(BaseModel):
|
||||
responsible_group = models.ForeignKey(ResponsibleGroup, on_delete=models.CASCADE, null=False, blank=False, related_name='customer_responsible')
|
||||
cuser_role = models.ForeignKey(CuserRoleModel, on_delete=models.CASCADE, null=False, blank=False)
|
||||
sys_ws = models.ForeignKey(WorkspaceModel, on_delete=models.CASCADE, null=False, blank=False)
|
||||
|
||||
def __str__(self):
|
||||
return str(self.responsible_group)
|
||||
|
||||
|
||||
class CustomerGroupType(BaseModel):
|
||||
name = models.CharField(max_length=10, null=False, blank=False)
|
||||
sys_ws = models.ForeignKey(WorkspaceModel, on_delete=models.CASCADE, null=False, blank=False)
|
||||
|
||||
def __str__(self):
|
||||
return str(self.name)
|
||||
|
||||
|
||||
class CustomerGroup(BaseModel):
|
||||
name = models.CharField(max_length=15, null=False, blank=False)
|
||||
group_type = models.ForeignKey(CustomerGroupType, on_delete=models.SET_NULL, null=True, blank=True)
|
||||
sys_ws = models.ForeignKey(WorkspaceModel, on_delete=models.CASCADE, null=False, blank=False)
|
||||
|
||||
def __str__(self):
|
||||
return str(self.name)
|
||||
|
||||
|
||||
class Customer(BaseModel):
|
||||
name_family = models.CharField(max_length=25, null=False, blank=False)
|
||||
mobile = models.PositiveBigIntegerField(null=True, blank=True)
|
||||
phone = models.PositiveBigIntegerField(null=True, blank=True)
|
||||
address = models.CharField(max_length=100, null=True, blank=True)
|
||||
city = models.ForeignKey(CityModel, on_delete=models.SET_NULL, null=True, blank=True)
|
||||
shive_ashenaei = models.ForeignKey(ShiveAshenaei, on_delete=models.SET_NULL, null=True, blank=True)
|
||||
responsible_group = models.ForeignKey(ResponsibleGroup, on_delete=models.SET_NULL, null=True, blank=True)
|
||||
cuser_role = models.ForeignKey(CuserRoleModel, on_delete=models.SET_NULL, null=True, blank=True)
|
||||
sys_ws = models.ForeignKey(WorkspaceModel, on_delete=models.CASCADE, null=False, blank=False)
|
||||
|
||||
class Meta:
|
||||
ordering = ['-created_at']
|
||||
|
||||
def __str__(self):
|
||||
return str(self.name_family)
|
||||
|
||||
def clean(self):
|
||||
if self.cuser_role and not self.cuser_role.role_type.role_name_en == 'workspace_customer':
|
||||
raise ValidationError("cuser_role type must be customer")
|
||||
|
||||
|
||||
class CustomerNote(BaseModel):
|
||||
customer = models.ForeignKey(Customer, on_delete=models.CASCADE, null=False, blank=False)
|
||||
cuser_role = models.ForeignKey(CuserRoleModel, on_delete=models.CASCADE, null=False, blank=False)
|
||||
desc = models.CharField(max_length=200, null=False, blank=False)
|
||||
sys_ws = models.ForeignKey(WorkspaceModel, on_delete=models.CASCADE, null=False, blank=False)
|
||||
|
||||
class Meta:
|
||||
ordering = ['-created_at']
|
||||
|
||||
def __str__(self):
|
||||
return str(self.customer.name_family)
|
||||
@@ -0,0 +1,150 @@
|
||||
from apps.customer.models import ResponsibleGroup as ResponsibleGroupModel, CustomerResponsible as CustomerResponsibleModel
|
||||
from apps.customer.models import ShiveAshenaei as ShiveAshenaeiModel
|
||||
from apps.workspace.models import City as CityModel
|
||||
from apps.customer.models import Customer as CustomerModel
|
||||
from rest_framework import exceptions
|
||||
from utils.get_user_workspace import get_user_workspace_uuid
|
||||
from utils.get_cuser_role import get_cuser_role_uuid
|
||||
from apps.lead.models import Lead as LeadModel
|
||||
from apps.customer.models import CustomerNote as CustomerNoteModel
|
||||
from apps.reminder.models import Reminder as ReminderModel
|
||||
|
||||
|
||||
|
||||
def retrieve_responsible_group(responsible_group_id: int, workspace_uuid: str):
|
||||
try:
|
||||
responsible_group_obj = ResponsibleGroupModel.objects.get(id=responsible_group_id, sys_ws__uuid=workspace_uuid)
|
||||
return responsible_group_obj
|
||||
except Exception as exp:
|
||||
message = f'Error Retrieve ResponsibleGroup: {exp}'
|
||||
raise exceptions.ValidationError({'error': message})
|
||||
|
||||
|
||||
def list_responsible_group(workspace_uuid: str) -> ResponsibleGroupModel:
|
||||
try:
|
||||
responsible_group_objs = ResponsibleGroupModel.objects.filter(sys_ws__uuid=workspace_uuid)
|
||||
return responsible_group_objs
|
||||
except Exception as exp:
|
||||
message = f'Error Fetch ResponsibleGroup List: {exp}'
|
||||
raise exceptions.ValidationError({'error': message})
|
||||
|
||||
|
||||
def retrieve_shive_ashenaei(shive_id: int, workspace_uuid: str):
|
||||
try:
|
||||
responsible_group_obj = ShiveAshenaeiModel.objects.get(id=shive_id, sys_ws__uuid=workspace_uuid)
|
||||
return responsible_group_obj
|
||||
except Exception as exp:
|
||||
message = f'Error Retrieve ShiveAshenaei: {exp}'
|
||||
raise exceptions.ValidationError({'error': message})
|
||||
|
||||
|
||||
def list_shive_ashenaei(workspace_uuid: str) -> ResponsibleGroupModel:
|
||||
try:
|
||||
shive_ashenaei_objs = ShiveAshenaeiModel.objects.filter(sys_ws__uuid=workspace_uuid)
|
||||
return shive_ashenaei_objs
|
||||
except Exception as exp:
|
||||
message = f'Error Fetch ShiveAshenaei List: {exp}'
|
||||
raise exceptions.ValidationError({'error': message})
|
||||
|
||||
|
||||
def retrieve_customer(customer_id: int, workspace_uuid: str):
|
||||
try:
|
||||
customer_obj = CustomerModel.objects.get(id=customer_id, sys_ws__uuid=workspace_uuid)
|
||||
return customer_obj
|
||||
except Exception as exp:
|
||||
message = f'Error Retrieve Customer: {exp}'
|
||||
raise exceptions.ValidationError({'error': message})
|
||||
|
||||
|
||||
def list_customer(workspace_uuid: str, name_family: str = None, mobile: int = None):
|
||||
try:
|
||||
customer_objs = CustomerModel.objects.filter(sys_ws__uuid=workspace_uuid)
|
||||
|
||||
if name_family is not None:
|
||||
customer_objs = customer_objs.filter(name_family__contains=name_family)
|
||||
if mobile is not None:
|
||||
customer_objs = customer_objs.filter(mobile__=mobile)
|
||||
|
||||
return customer_objs[:3]
|
||||
except Exception as exp:
|
||||
message = f'Error Fetch Customer List: {exp}'
|
||||
raise exceptions.ValidationError({'error': message})
|
||||
|
||||
|
||||
def list_customer_v2(request):
|
||||
try:
|
||||
|
||||
user_workspace_uuid = get_user_workspace_uuid(request=request)
|
||||
user_cuser_role_uuid = get_cuser_role_uuid(request=request)
|
||||
|
||||
customer_responsible = CustomerResponsibleModel.objects.filter(cuser_role__uuid=user_cuser_role_uuid)
|
||||
|
||||
customer_objs = CustomerModel.objects.filter(sys_ws__uuid=user_workspace_uuid,
|
||||
responsible_group__customer_responsible__in=customer_responsible)
|
||||
|
||||
return customer_objs
|
||||
except Exception as exp:
|
||||
message = f'Error Fetch Customer List: {exp}'
|
||||
raise exceptions.ValidationError({'error': message})
|
||||
|
||||
|
||||
def customer_form_item(request):
|
||||
|
||||
workspace_uuid = get_user_workspace_uuid(request)
|
||||
|
||||
shive_ashenaei = ShiveAshenaeiModel.objects.filter(sys_ws__uuid=workspace_uuid)
|
||||
shahr = CityModel.objects.filter()
|
||||
responsible_groups = ResponsibleGroupModel.objects.filter(sys_ws__uuid=workspace_uuid)
|
||||
|
||||
data = {
|
||||
'shive_ashenaei': shive_ashenaei,
|
||||
'shahr': shahr,
|
||||
'responsible_groups': responsible_groups
|
||||
}
|
||||
|
||||
return data
|
||||
|
||||
|
||||
def customer_summery(request, customer_id:int):
|
||||
|
||||
workspace_uuid = get_user_workspace_uuid(request)
|
||||
cuser_role_uuid = get_cuser_role_uuid(request)
|
||||
|
||||
customer_notes = CustomerNoteModel.objects.filter(customer_id=customer_id, sys_ws__uuid=workspace_uuid)[:4]
|
||||
customer_leads = LeadModel.objects.filter(customer_id=customer_id, sys_ws__uuid=workspace_uuid)[:4]
|
||||
|
||||
data = {
|
||||
'customer_notes': customer_notes,
|
||||
'customer_leads': customer_leads,
|
||||
}
|
||||
|
||||
return data
|
||||
|
||||
|
||||
def customer_note_list(request, customer_id: int) -> CustomerNoteModel:
|
||||
|
||||
workspace_uuid = get_user_workspace_uuid(request)
|
||||
|
||||
customer_notes = CustomerNoteModel.objects.filter(customer_id=customer_id, sys_ws__uuid=workspace_uuid)[:20]
|
||||
|
||||
return customer_notes
|
||||
|
||||
|
||||
def customer_note_retrieve(request, customer_id: int, note_id: int) -> CustomerNoteModel:
|
||||
|
||||
workspace_uuid = get_user_workspace_uuid(request)
|
||||
|
||||
customer_note = CustomerNoteModel.objects.get(id=note_id, customer_id=customer_id, sys_ws__uuid=workspace_uuid)
|
||||
customer_note_reminder = None
|
||||
try:
|
||||
customer_note_reminder = ReminderModel.objects.get(type='NO', id_type=note_id, customer_id=customer_id, sys_ws__uuid=workspace_uuid)
|
||||
except Exception as exp:
|
||||
pass
|
||||
|
||||
output = {
|
||||
'customer_note': customer_note,
|
||||
'customer_note_reminder': customer_note_reminder
|
||||
}
|
||||
return output
|
||||
|
||||
|
||||
@@ -0,0 +1,235 @@
|
||||
from apps.customer.models import (
|
||||
ResponsibleGroup as ResponsibleGroupModel,
|
||||
ShiveAshenaei as ShiveAshenaeiModel,
|
||||
Customer as CustomerModel,
|
||||
CustomerNote as CustomerNoteModel
|
||||
)
|
||||
from apps.reminder.models import Reminder as ReminderModel
|
||||
from apps.workspace.models import Workspace as WorkspaceModel
|
||||
from rest_framework import exceptions
|
||||
from utils.get_user_workspace import get_user_workspace, get_user_workspace_uuid
|
||||
from utils.get_cuser_role import get_cuser_role
|
||||
from django.db import transaction
|
||||
|
||||
|
||||
def create_responsible_group(name: str, workspace: WorkspaceModel):
|
||||
try:
|
||||
responsible_group_obj = ResponsibleGroupModel(name=name, sys_ws=workspace)
|
||||
responsible_group_obj.full_clean()
|
||||
responsible_group_obj.save()
|
||||
|
||||
return responsible_group_obj
|
||||
|
||||
except Exception as exp:
|
||||
message = f'Error creating ResponsibleGroup: {exp}'
|
||||
raise exceptions.ValidationError({'error': message})
|
||||
|
||||
|
||||
def delete_responsible_group(responsible_group_id: int, workspace_uuid: str):
|
||||
try:
|
||||
ResponsibleGroupModel.objects.get(id=responsible_group_id, sys_ws__uuid=workspace_uuid).delete()
|
||||
except Exception as exp:
|
||||
message = f'Error Deleting ResponsibleGroup: {exp}'
|
||||
raise exceptions.ValidationError({'error': message})
|
||||
|
||||
|
||||
def create_shive_ashenaei(name: str, workspace: WorkspaceModel) -> ShiveAshenaeiModel:
|
||||
try:
|
||||
shive_obj = ShiveAshenaeiModel(name=name, sys_ws=workspace)
|
||||
shive_obj.full_clean()
|
||||
shive_obj.save()
|
||||
return shive_obj
|
||||
except Exception as exp:
|
||||
message = f'Error creating ShiveAshenaei: {exp}'
|
||||
raise exceptions.ValidationError({'error': message})
|
||||
|
||||
|
||||
def delete_shive_ashenaei(shive_id: int, workspace_uuid: str) -> ShiveAshenaeiModel:
|
||||
try:
|
||||
ShiveAshenaeiModel.objects.get(id=shive_id, sys_ws__uuid=workspace_uuid).delete()
|
||||
except Exception as exp:
|
||||
message = f'Error Delete ShiveAshenaei: {exp}'
|
||||
raise exceptions.ValidationError({'error': message})
|
||||
|
||||
|
||||
def create_customer(name_family: str , mobile: int, phone: int, address: str, city: int, shive_ashenaei: int,
|
||||
responsible_group: int, cuser_role: int = None, workspace: WorkspaceModel = None) -> CustomerModel:
|
||||
try:
|
||||
customer_obj = CustomerModel()
|
||||
customer_obj.name_family = name_family
|
||||
customer_obj.mobile = mobile
|
||||
customer_obj.phone = phone
|
||||
customer_obj.address = address
|
||||
customer_obj.city = city
|
||||
customer_obj.shive_ashenaei = shive_ashenaei
|
||||
customer_obj.responsible_group = responsible_group
|
||||
if cuser_role is not None:
|
||||
customer_obj.cuser_role = cuser_role
|
||||
customer_obj.sys_ws = workspace
|
||||
|
||||
customer_obj.full_clean()
|
||||
customer_obj.save()
|
||||
return customer_obj
|
||||
except Exception as exp:
|
||||
message = f'Error Creating Customer: {exp}'
|
||||
raise exceptions.ValidationError({'error': message})
|
||||
|
||||
|
||||
def update_customer(customer_id: int, name_family: str = None , mobile: int = None, phone: int = None, address: str = None,
|
||||
city: int = None, shive_ashenaei: int = None, responsible_group: int = None, cuser_role: int = None, workspace_uuid: str = None) -> CustomerModel:
|
||||
try:
|
||||
customer_obj = CustomerModel.objects.get(id=customer_id, sys_ws__uuid=workspace_uuid)
|
||||
|
||||
if name_family is not None:
|
||||
customer_obj.name_family = name_family
|
||||
if mobile is not None:
|
||||
customer_obj.mobile = mobile
|
||||
if phone is not None:
|
||||
customer_obj.phone = phone
|
||||
if address is not None:
|
||||
customer_obj.address = address
|
||||
if city is not None:
|
||||
customer_obj.city = city
|
||||
if shive_ashenaei is not None:
|
||||
customer_obj.shive_ashenaei = shive_ashenaei
|
||||
if responsible_group is not None:
|
||||
customer_obj.responsible_group = responsible_group
|
||||
if cuser_role is not None:
|
||||
customer_obj.cuser_role = cuser_role
|
||||
|
||||
customer_obj.full_clean()
|
||||
customer_obj.save()
|
||||
return customer_obj
|
||||
except Exception as exp:
|
||||
message = f'Error Creating Customer: {exp}'
|
||||
raise exceptions.ValidationError({'error': message})
|
||||
|
||||
|
||||
def delete_customer(customer_id: int, workspace_uuid: str = None) -> CustomerModel:
|
||||
try:
|
||||
CustomerModel.objects.get(id=customer_id, sys_ws__uuid=workspace_uuid).delete()
|
||||
except Exception as exp:
|
||||
message = f'Error Deleting Customer: {exp}'
|
||||
raise exceptions.ValidationError({'error': message})
|
||||
|
||||
|
||||
def create_customer_v2(request, name_family: str , mobile: int, phone: int, address: str, city: int, shive_ashenaei: int,
|
||||
responsible_group: int, cuser_role: int = None) -> CustomerModel:
|
||||
try:
|
||||
workspace = get_user_workspace(request=request)
|
||||
|
||||
customer_obj = CustomerModel()
|
||||
customer_obj.name_family = name_family
|
||||
customer_obj.mobile = mobile
|
||||
customer_obj.phone = phone
|
||||
customer_obj.address = address
|
||||
customer_obj.city_id = city
|
||||
customer_obj.shive_ashenaei = ShiveAshenaeiModel.objects.get(id=shive_ashenaei, sys_ws=workspace)
|
||||
|
||||
customer_obj.responsible_group = ResponsibleGroupModel.objects.get(id=responsible_group, sys_ws=workspace)
|
||||
if cuser_role is not None:
|
||||
customer_obj.cuser_role = cuser_role
|
||||
customer_obj.sys_ws = workspace
|
||||
|
||||
customer_obj.full_clean()
|
||||
customer_obj.save()
|
||||
return customer_obj
|
||||
except Exception as exp:
|
||||
message = f'Error Creating Customer: {exp}'
|
||||
raise exceptions.ValidationError({'error': message})
|
||||
|
||||
|
||||
def create_customer_note(request, customer_id: int, desc: str,
|
||||
reminder_datetime: str = None, reminder_desc: str = None) -> CustomerNoteModel:
|
||||
with transaction.atomic():
|
||||
try:
|
||||
workspace = get_user_workspace(request=request)
|
||||
cuser_role = get_cuser_role(request=request)
|
||||
|
||||
customer_note = CustomerNoteModel()
|
||||
customer_note.customer = CustomerModel.objects.get(id=customer_id, sys_ws=workspace)
|
||||
customer_note.desc = desc
|
||||
customer_note.sys_ws = workspace
|
||||
customer_note.cuser_role = cuser_role
|
||||
customer_note.save()
|
||||
|
||||
if reminder_datetime:
|
||||
try:
|
||||
reminder = ReminderModel()
|
||||
reminder.type = 'NO'
|
||||
reminder.note = customer_note
|
||||
reminder.id_type = customer_note.id
|
||||
reminder.customer = customer_note.customer
|
||||
reminder.datetime = reminder_datetime
|
||||
if reminder_desc:
|
||||
reminder.desc = reminder_desc
|
||||
reminder.cuser_role = cuser_role
|
||||
reminder.sys_ws = workspace
|
||||
reminder.save()
|
||||
|
||||
except Exception as exp:
|
||||
transaction.set_rollback(True)
|
||||
message = f'Error Creating Customer Note and Set Reminder: {exp}'
|
||||
raise exceptions.ValidationError({'error': message})
|
||||
|
||||
return customer_note
|
||||
|
||||
except Exception as exp:
|
||||
transaction.set_rollback(True)
|
||||
message = f'Error Creating Customer Note: {exp}'
|
||||
raise exceptions.ValidationError({'error': message})
|
||||
|
||||
|
||||
def customer_note_edit(request, customer_id: int, note_id: int, desc: str,
|
||||
reminder_datetime: str = None, reminder_desc: str = None) -> CustomerNoteModel:
|
||||
try:
|
||||
workspace = get_user_workspace(request)
|
||||
cuser_role = get_cuser_role(request)
|
||||
|
||||
customer_note = CustomerNoteModel.objects.get(id=note_id, customer_id=customer_id, sys_ws=workspace)
|
||||
customer_note.desc = desc
|
||||
customer_note.save()
|
||||
|
||||
if reminder_datetime:
|
||||
try:
|
||||
try:
|
||||
reminder = ReminderModel.objects.get(type='NO', note=customer_note, id_type=note_id, customer_id=customer_id)
|
||||
reminder.datetime = reminder_datetime
|
||||
reminder.desc = reminder_desc
|
||||
reminder.save()
|
||||
except Exception as exp:
|
||||
try:
|
||||
reminder = ReminderModel()
|
||||
reminder.type = 'NO'
|
||||
reminder.note = customer_note
|
||||
reminder.id_type = customer_note.id
|
||||
reminder.customer = customer_note.customer
|
||||
reminder.datetime = reminder_datetime
|
||||
if reminder_desc:
|
||||
reminder.desc = reminder_desc
|
||||
reminder.cuser_role = cuser_role
|
||||
reminder.sys_ws = workspace
|
||||
reminder.save()
|
||||
except Exception as exp:
|
||||
print(exp)
|
||||
except Exception as exp:
|
||||
print(exp)
|
||||
|
||||
return customer_note
|
||||
|
||||
except Exception as exp:
|
||||
message = f'Error Edit Customer Note: {exp}'
|
||||
raise exceptions.ValidationError({'error': message})
|
||||
|
||||
|
||||
def customer_note_delete(request, customer_id: int, note_id: int) -> CustomerNoteModel:
|
||||
try:
|
||||
workspace = get_user_workspace_uuid(request=request)
|
||||
|
||||
customer_note = CustomerNoteModel.objects.get(id=note_id, customer_id=customer_id, sys_ws__uuid=workspace).delete()
|
||||
|
||||
return customer_note
|
||||
|
||||
except Exception as exp:
|
||||
message = f'Error Delete Customer Note: {exp}'
|
||||
raise exceptions.ValidationError({'error': message})
|
||||
@@ -0,0 +1,3 @@
|
||||
from django.test import TestCase
|
||||
|
||||
# Create your tests here.
|
||||
@@ -0,0 +1,39 @@
|
||||
from django.urls import path
|
||||
from apps.customer.views import *
|
||||
|
||||
urlpatterns = [
|
||||
path('responsible-group/list/', ResponsibleGroupListApi.as_view(), name='list_responsible_group'),
|
||||
path('responsible-group/<int:responsible_group_id>/', ResponsibleGroupRetrieveApi.as_view(),
|
||||
name='retrieve_responsible_group'),
|
||||
path('responsible-group/create/', ResponsibleGroupCreateApi.as_view(), name='create_responsible_group'),
|
||||
path('responsible-group/delete/<int:responsible_group_id>/', ResponsibleGroupDeleteApi.as_view(), name='delete_responsible_group'),
|
||||
|
||||
path('shive_ashenaei/create/', ShiveAshenaeiCreateApi.as_view(), name='create_shive_ashenaei'),
|
||||
path('shive_ashenaei/delete/<int:shive_id>/', ShiveAshenaeiDeleteApi.as_view(), name='delete_shive_ashenaei'),
|
||||
path('shive_ashenaei/list/', ShiveAshenaeiListApi.as_view(), name='list_shive_ashenaei'),
|
||||
path('shive_ashenaei/<int:shive_id>/', ShiveAshenaeiRetrieveApi.as_view(), name='retrive_shive_ashenaei'),
|
||||
|
||||
path('create/', CustomerCreateApi.as_view(), name='create_customer'),
|
||||
path('update/<int:customer_id>/', CustomerUpdateApi.as_view(), name='update_customer'),
|
||||
path('delete/<int:customer_id>/', CustomerDeleteApi.as_view(), name='delete_customer'),
|
||||
path('list/', CustomerListApi.as_view(), name='list_customer'),
|
||||
path('<int:customer_id>/', CustomerRetrieveApi.as_view(), name='retrive_customer'),
|
||||
|
||||
path('<int:customer_id>/summary/', CustomerSummary.as_view(), name='customer_summary'),
|
||||
|
||||
path('<int:customer_id>/note/create/', CustomerCreateNoteApi.as_view(), name='customer_note_create'),
|
||||
|
||||
path('<int:customer_id>/note/list/', CustomerListNoteApi.as_view(), name='customer_note_list'),
|
||||
|
||||
path('<int:customer_id>/note/<int:note_id>/', CustomerRetrieveNoteApi.as_view(), name='customer_note_retrieve'),
|
||||
|
||||
path('<int:customer_id>/note/<int:note_id>/delete/', CustomerDeleteNoteApi.as_view(), name='customer_note_delete'),
|
||||
|
||||
path('<int:customer_id>/note/<int:note_id>/edit/', CustomerEditNoteApi.as_view(), name='customer_note_edit'),
|
||||
|
||||
path('v2/list/', CustomerListApiV2.as_view(), name='list_customer_v2'),
|
||||
|
||||
path('v2/create/', CustomerCreateApiV2.as_view(), name='customer_create_v2'),
|
||||
|
||||
path('form-item/', CustomerFormItemApi.as_view(), name='customer-form-item'),
|
||||
]
|
||||
@@ -0,0 +1,9 @@
|
||||
from .responsible_group import ResponsibleGroupCreateApi, ResponsibleGroupDeleteApi,\
|
||||
ResponsibleGroupRetrieveApi, ResponsibleGroupListApi
|
||||
|
||||
from .shive_ashenaei import ShiveAshenaeiCreateApi, ShiveAshenaeiDeleteApi, ShiveAshenaeiListApi, ShiveAshenaeiRetrieveApi
|
||||
|
||||
from .customer import *
|
||||
from .form_item import *
|
||||
from .customer_summary import *
|
||||
from .customer_note import *
|
||||
@@ -0,0 +1,226 @@
|
||||
from rest_framework.views import APIView
|
||||
from rest_framework import serializers
|
||||
from apps.customer.models import Customer as CustomerModel
|
||||
from apps.customer.selectors import retrieve_customer, list_customer, list_customer_v2
|
||||
from utils.get_user_workspace import get_user_workspace_uuid, get_user_workspace
|
||||
from rest_framework.response import Response
|
||||
from rest_framework import status
|
||||
from rest_framework.permissions import IsAuthenticated
|
||||
from utils import custom_permissions
|
||||
from rest_framework import generics
|
||||
from apps.customer.services import create_customer, update_customer, delete_customer, create_customer_v2
|
||||
from apps.workspace.models import City as CityModel
|
||||
from utils.tools import inline_model_serializer, inline_serializer
|
||||
from utils.pagination import CustomPagination
|
||||
from django_filters import rest_framework as filters
|
||||
|
||||
|
||||
|
||||
|
||||
class CustomerRetrieveApi(APIView):
|
||||
|
||||
permission_classes = (IsAuthenticated, custom_permissions.WorkspaceOperatorPermission)
|
||||
|
||||
class OutputSerializer(serializers.ModelSerializer):
|
||||
class Meta:
|
||||
model = CustomerModel
|
||||
fields = '__all__'
|
||||
|
||||
def get(self, request, customer_id: int):
|
||||
user_workspace_uuid = get_user_workspace_uuid(request=request)
|
||||
|
||||
customer_obj = retrieve_customer(customer_id=customer_id, workspace_uuid=user_workspace_uuid)
|
||||
|
||||
output = self.OutputSerializer(customer_obj)
|
||||
|
||||
return Response(data=output.data, status=status.HTTP_200_OK)
|
||||
|
||||
|
||||
class CustomerListApi(generics.ListAPIView):
|
||||
|
||||
permission_classes = (IsAuthenticated, custom_permissions.WorkspaceOperatorPermission)
|
||||
|
||||
class OutputSerializer(serializers.ModelSerializer):
|
||||
|
||||
class CitySerializer(serializers.ModelSerializer):
|
||||
|
||||
class OstanSerializer(serializers.ModelSerializer):
|
||||
class Meta:
|
||||
model = CityModel
|
||||
fields = '__all__'
|
||||
|
||||
ostan = OstanSerializer()
|
||||
class Meta:
|
||||
model = CityModel
|
||||
fields = '__all__'
|
||||
|
||||
city = CitySerializer()
|
||||
|
||||
class Meta:
|
||||
model = CustomerModel
|
||||
fields = '__all__'
|
||||
|
||||
serializer_class = OutputSerializer
|
||||
|
||||
def get_queryset(self):
|
||||
|
||||
user_workspace_uuid = get_user_workspace_uuid(request=self.request)
|
||||
|
||||
name_family = self.request.query_params.get('name_family')
|
||||
mobile = self.request.query_params.get('mobile')
|
||||
|
||||
customer_objs = list_customer(workspace_uuid=user_workspace_uuid, name_family=name_family, mobile=mobile)
|
||||
|
||||
return customer_objs
|
||||
|
||||
|
||||
class CustomerCreateApi(APIView):
|
||||
|
||||
permission_classes = (IsAuthenticated, custom_permissions.WorkspaceOperatorPermission)
|
||||
|
||||
class InputSerializer(serializers.ModelSerializer):
|
||||
class Meta:
|
||||
model = CustomerModel
|
||||
fields = '__all__'
|
||||
read_only_fields = ['sys_ws', '']
|
||||
|
||||
class OutputSerializer(serializers.ModelSerializer):
|
||||
class Meta:
|
||||
model = CustomerModel
|
||||
exclude = ('sys_ws', )
|
||||
|
||||
def post(self, request):
|
||||
serializer = self.InputSerializer(data=request.data)
|
||||
serializer.is_valid(raise_exception=True)
|
||||
|
||||
user_workspace = get_user_workspace(request=request)
|
||||
|
||||
customer_obj = create_customer(**serializer.validated_data, workspace=user_workspace)
|
||||
output = self.OutputSerializer(customer_obj)
|
||||
|
||||
return Response(data=output.data, status=status.HTTP_201_CREATED)
|
||||
|
||||
|
||||
class CustomerUpdateApi(APIView):
|
||||
|
||||
permission_classes = (IsAuthenticated, custom_permissions.WorkspaceOperatorPermission)
|
||||
|
||||
class InputSerializer(serializers.ModelSerializer):
|
||||
class Meta:
|
||||
model = CustomerModel
|
||||
fields = '__all__'
|
||||
read_only_fields = ['sys_ws', '']
|
||||
|
||||
class OutputSerializer(serializers.ModelSerializer):
|
||||
class Meta:
|
||||
model = CustomerModel
|
||||
exclude = ('sys_ws', )
|
||||
|
||||
def patch(self, request, customer_id: int):
|
||||
serializer = self.InputSerializer(data=request.data)
|
||||
serializer.is_valid(raise_exception=True)
|
||||
|
||||
user_workspace_uuid = get_user_workspace_uuid(request=request)
|
||||
|
||||
customer_obj = update_customer(**serializer.validated_data, customer_id=customer_id, workspace_uuid=user_workspace_uuid)
|
||||
output = self.OutputSerializer(customer_obj)
|
||||
|
||||
return Response(data=output.data, status=status.HTTP_200_OK)
|
||||
|
||||
|
||||
class CustomerDeleteApi(APIView):
|
||||
|
||||
permission_classes = (IsAuthenticated, custom_permissions.WorkspaceOperatorPermission)
|
||||
|
||||
class OutputSerializer(serializers.ModelSerializer):
|
||||
class Meta:
|
||||
model = CustomerModel
|
||||
exclude = ('sys_ws', )
|
||||
|
||||
def delete(self, request, customer_id: int):
|
||||
|
||||
user_workspace_uuid = get_user_workspace_uuid(request=request)
|
||||
|
||||
delete_customer(customer_id=customer_id, workspace_uuid=user_workspace_uuid)
|
||||
|
||||
return Response(status=status.HTTP_200_OK)
|
||||
|
||||
|
||||
class CustomerListApiV2(generics.ListAPIView):
|
||||
|
||||
permission_classes = (IsAuthenticated, custom_permissions.WorkspaceOperatorPermission)
|
||||
|
||||
class Pagination(CustomPagination):
|
||||
page_size = 10
|
||||
page_size_query_param = 'page_size'
|
||||
max_page_size = 20
|
||||
|
||||
class OutputSerializer(serializers.ModelSerializer):
|
||||
|
||||
city = inline_serializer(fields={
|
||||
'id': serializers.IntegerField(),
|
||||
'name': serializers.CharField(),
|
||||
'ostan': inline_serializer(many=False, fields={
|
||||
'id': serializers.IntegerField(),
|
||||
'name': serializers.CharField()
|
||||
})
|
||||
})
|
||||
|
||||
shive_ashenaei = inline_serializer(fields={
|
||||
'id': serializers.IntegerField(),
|
||||
'name': serializers.CharField(),
|
||||
})
|
||||
|
||||
responsible_group = inline_serializer(fields={
|
||||
'id': serializers.IntegerField(),
|
||||
'name': serializers.CharField(),
|
||||
})
|
||||
|
||||
class Meta:
|
||||
model = CustomerModel
|
||||
fields = '__all__'
|
||||
|
||||
class CustomerFilter(filters.FilterSet):
|
||||
class Meta:
|
||||
model = CustomerModel
|
||||
fields = {
|
||||
'name_family': ['exact', 'contains'],
|
||||
'mobile': ['exact', 'contains'],
|
||||
}
|
||||
|
||||
serializer_class = OutputSerializer
|
||||
|
||||
pagination_class = Pagination
|
||||
|
||||
filter_backends = [filters.DjangoFilterBackend, ]
|
||||
filterset_class = CustomerFilter
|
||||
|
||||
def get_queryset(self):
|
||||
customer_objs = list_customer_v2(request=self.request)
|
||||
|
||||
return customer_objs
|
||||
|
||||
|
||||
class CustomerCreateApiV2(APIView):
|
||||
|
||||
permission_classes = (IsAuthenticated, custom_permissions.WorkspaceOperatorPermission)
|
||||
|
||||
class InputSerializer(serializers.Serializer):
|
||||
name_family = serializers.CharField(max_length=25, required=True)
|
||||
mobile = serializers.IntegerField(required=True)
|
||||
phone = serializers.IntegerField(required=True)
|
||||
address = serializers.CharField(max_length=300, required=True)
|
||||
city = serializers.IntegerField(required=True)
|
||||
shive_ashenaei = serializers.IntegerField(required=True)
|
||||
responsible_group = serializers.IntegerField(required=True)
|
||||
|
||||
def post(self, request):
|
||||
|
||||
serializer = self.InputSerializer(data=request.data)
|
||||
serializer.is_valid(raise_exception=True)
|
||||
|
||||
customer = create_customer_v2(request=request, **serializer.validated_data)
|
||||
|
||||
return Response(data={'id': customer.id}, status=status.HTTP_201_CREATED)
|
||||
|
||||
|
||||
@@ -0,0 +1,94 @@
|
||||
from rest_framework.views import APIView
|
||||
from rest_framework import serializers
|
||||
from rest_framework.response import Response
|
||||
from rest_framework import status
|
||||
from apps.customer.services import create_customer_note, customer_note_edit, customer_note_delete
|
||||
from apps.customer.selectors import customer_note_retrieve, customer_note_list
|
||||
from apps.customer.models import CustomerNote as CustomerNoteModel
|
||||
from apps.reminder.models import Reminder as ReminderModel
|
||||
from utils.tools import inline_serializer
|
||||
|
||||
|
||||
|
||||
class CustomerCreateNoteApi(APIView):
|
||||
class InputSerializer(serializers.Serializer):
|
||||
desc = serializers.CharField()
|
||||
reminder_datetime = serializers.DateTimeField(required=False, allow_null=True)
|
||||
reminder_desc = serializers.CharField(required=False, allow_null=True, max_length=200)
|
||||
|
||||
def post(self, request, customer_id):
|
||||
serializer = self.InputSerializer(data=request.data)
|
||||
serializer.is_valid(raise_exception=True)
|
||||
|
||||
output = create_customer_note(request=request, customer_id=customer_id, **serializer.validated_data)
|
||||
|
||||
return Response(data={'id': output.id}, status=status.HTTP_201_CREATED)
|
||||
|
||||
|
||||
class CustomerListNoteApi(APIView):
|
||||
|
||||
class OutputSerializer(serializers.ModelSerializer):
|
||||
class Meta:
|
||||
model = CustomerNoteModel
|
||||
exclude = ['cuser_role', 'sys_ws']
|
||||
|
||||
def get(self, request, customer_id):
|
||||
notes = customer_note_list(request=request, customer_id=customer_id)
|
||||
output = self.OutputSerializer(notes, many=True)
|
||||
|
||||
return Response(data=output.data, status=status.HTTP_200_OK)
|
||||
|
||||
|
||||
class CustomerRetrieveNoteApi(APIView):
|
||||
|
||||
class OutputSerializer(serializers.Serializer):
|
||||
|
||||
class CustomerNoteSerializer(serializers.ModelSerializer):
|
||||
class Meta:
|
||||
model = CustomerNoteModel
|
||||
fields = '__all__'
|
||||
|
||||
class CustomerNoteReminderSerializer(serializers.ModelSerializer):
|
||||
class Meta:
|
||||
model = ReminderModel
|
||||
fields = '__all__'
|
||||
|
||||
customer_note = CustomerNoteSerializer(many=False, required=True)
|
||||
customer_note_reminder = CustomerNoteReminderSerializer(many=False, required=False)
|
||||
|
||||
def get(self, request, customer_id, note_id):
|
||||
note = customer_note_retrieve(request=request, customer_id=customer_id, note_id=note_id)
|
||||
output = self.OutputSerializer(note)
|
||||
|
||||
return Response(data=output.data, status=status.HTTP_200_OK)
|
||||
|
||||
|
||||
class CustomerEditNoteApi(APIView):
|
||||
|
||||
class InputSerializer(serializers.Serializer):
|
||||
desc = serializers.CharField(required=True)
|
||||
reminder_datetime = serializers.DateTimeField(required=False, allow_null=True)
|
||||
reminder_desc = serializers.CharField(required=False, allow_null=True, max_length=200)
|
||||
|
||||
class OutputSerializer(serializers.ModelSerializer):
|
||||
class Meta:
|
||||
model = CustomerNoteModel
|
||||
fields = '__all__'
|
||||
|
||||
def patch(self, request, customer_id, note_id):
|
||||
|
||||
serializer = self.InputSerializer(data=request.data)
|
||||
serializer.is_valid(raise_exception=True)
|
||||
|
||||
note = customer_note_edit(request=request, customer_id=customer_id, note_id=note_id, **serializer.validated_data)
|
||||
|
||||
return Response(data={'id': note.id}, status=status.HTTP_201_CREATED)
|
||||
|
||||
|
||||
class CustomerDeleteNoteApi(APIView):
|
||||
|
||||
def delete(self, request, customer_id, note_id):
|
||||
note = customer_note_delete(request=request, customer_id=customer_id, note_id=note_id)
|
||||
|
||||
return Response(data={'result': 'deleted'}, status=status.HTTP_200_OK)
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
from rest_framework import serializers
|
||||
from rest_framework.response import Response
|
||||
from rest_framework.views import APIView
|
||||
from apps.customer.models import Customer as CustomerModel
|
||||
from rest_framework import status
|
||||
from apps.customer.selectors import customer_summery
|
||||
from utils.tools import inline_serializer
|
||||
|
||||
|
||||
class CustomerSummary(APIView):
|
||||
|
||||
class OutputSerializer(serializers.Serializer):
|
||||
customer_notes = inline_serializer(many=True, fields={
|
||||
'id': serializers.IntegerField(required=True),
|
||||
'created_at': serializers.DateTimeField(required=True),
|
||||
'desc': serializers.CharField(required=True)
|
||||
})
|
||||
customer_leads = inline_serializer(many=True, fields={
|
||||
'id': serializers.IntegerField(required=True),
|
||||
'title': serializers.CharField(required=True),
|
||||
'created_at': serializers.DateTimeField(required=True),
|
||||
})
|
||||
|
||||
def get(self, request, customer_id):
|
||||
|
||||
summery = customer_summery(request=request, customer_id=customer_id)
|
||||
output = self.OutputSerializer(summery)
|
||||
|
||||
return Response(data=output.data, status=status.HTTP_200_OK)
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
from rest_framework.views import APIView
|
||||
from apps.customer.models import ShiveAshenaei as ShiveAshenaeiModel
|
||||
from apps.workspace.models import City as CityModel
|
||||
from rest_framework import serializers
|
||||
from utils.tools import inline_serializer
|
||||
from rest_framework import status
|
||||
from apps.customer.selectors import customer_form_item
|
||||
from rest_framework.response import Response
|
||||
from rest_framework.permissions import IsAuthenticated
|
||||
from utils import custom_permissions
|
||||
|
||||
|
||||
class CustomerFormItemApi(APIView):
|
||||
|
||||
permission_classes = (IsAuthenticated, custom_permissions.WorkspaceOperatorPermission)
|
||||
|
||||
class OutputSerializer(serializers.Serializer):
|
||||
|
||||
shive_ashenaei = inline_serializer(many=True, fields={
|
||||
'id': serializers.IntegerField(),
|
||||
'name': serializers.CharField()
|
||||
})
|
||||
|
||||
shahr = inline_serializer(many=True, fields={
|
||||
'id': serializers.IntegerField(),
|
||||
'name': serializers.CharField(),
|
||||
'ostan': inline_serializer(fields={'id': serializers.IntegerField(), }),
|
||||
'is_ostan': serializers.BooleanField(),
|
||||
})
|
||||
|
||||
responsible_groups = inline_serializer(many=True, fields={
|
||||
'id': serializers.IntegerField(),
|
||||
'name': serializers.CharField()
|
||||
})
|
||||
|
||||
def get(self, request):
|
||||
|
||||
fields_value = customer_form_item(request)
|
||||
serializer = self.OutputSerializer(fields_value)
|
||||
|
||||
return Response(data=serializer.data, status=status.HTTP_200_OK)
|
||||
|
||||
@@ -0,0 +1,81 @@
|
||||
from rest_framework.views import APIView
|
||||
from rest_framework import generics
|
||||
from rest_framework import serializers
|
||||
from rest_framework.response import Response
|
||||
from apps.customer.services import create_responsible_group, delete_responsible_group
|
||||
from apps.customer.selectors import retrieve_responsible_group, list_responsible_group
|
||||
from utils.get_user_workspace import get_user_workspace_uuid, get_user_workspace
|
||||
from rest_framework import status
|
||||
from utils import custom_permissions
|
||||
from apps.customer.models import ResponsibleGroup
|
||||
from rest_framework.permissions import IsAuthenticated
|
||||
|
||||
|
||||
class ResponsibleGroupRetrieveApi(APIView):
|
||||
|
||||
permission_classes = (IsAuthenticated, custom_permissions.WorkspaceOperatorPermission, )
|
||||
|
||||
class OutputSerializer(serializers.ModelSerializer):
|
||||
class Meta:
|
||||
model = ResponsibleGroup
|
||||
fields = '__all__'
|
||||
|
||||
def get(self, request, responsible_group_id: int):
|
||||
|
||||
user_workspace_uuid = get_user_workspace_uuid(request)
|
||||
responsible_group_obj = retrieve_responsible_group(responsible_group_id=responsible_group_id, workspace_uuid=user_workspace_uuid)
|
||||
|
||||
output = self.OutputSerializer(responsible_group_obj)
|
||||
return Response(data=output.data, status=status.HTTP_200_OK)
|
||||
|
||||
|
||||
class ResponsibleGroupListApi(generics.ListAPIView):
|
||||
|
||||
permission_classes = (IsAuthenticated, custom_permissions.WorkspaceOperatorPermission, )
|
||||
|
||||
class OutputSerializer(serializers.ModelSerializer):
|
||||
class Meta:
|
||||
model = ResponsibleGroup
|
||||
fields = '__all__'
|
||||
|
||||
serializer_class = OutputSerializer
|
||||
|
||||
def get_queryset(self):
|
||||
user_workspace_uuid = get_user_workspace_uuid(self.request)
|
||||
return list_responsible_group(workspace_uuid=user_workspace_uuid)
|
||||
|
||||
|
||||
class ResponsibleGroupCreateApi(APIView):
|
||||
|
||||
permission_classes = (IsAuthenticated, custom_permissions.WorkspaceAdminPermission,)
|
||||
|
||||
class InputSerializer(serializers.Serializer):
|
||||
name = serializers.CharField(max_length=20)
|
||||
|
||||
class OutputSerializer(serializers.Serializer):
|
||||
name = serializers.CharField(max_length=20)
|
||||
|
||||
def post(self, request):
|
||||
serializer = self.InputSerializer(data=request.data)
|
||||
serializer.is_valid(raise_exception=True)
|
||||
|
||||
group_name = serializer.validated_data.get
|
||||
user_workspace = get_user_workspace(request=request)
|
||||
|
||||
responsible_group_obj = create_responsible_group(name=group_name, workspace=user_workspace)
|
||||
output = self.OutputSerializer(responsible_group_obj)
|
||||
|
||||
return Response(data=output.data, status=status.HTTP_201_CREATED)
|
||||
|
||||
|
||||
class ResponsibleGroupDeleteApi(APIView):
|
||||
|
||||
permission_classes = (IsAuthenticated, custom_permissions.WorkspaceAdminPermission,)
|
||||
|
||||
def delete(self, request, responsible_group_id: int):
|
||||
|
||||
user_workspace_uuid = get_user_workspace_uuid(request)
|
||||
delete_responsible_group(responsible_group_id=responsible_group_id, workspace_uuid=user_workspace_uuid)
|
||||
|
||||
return Response(status=status.HTTP_200_OK)
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
from apps.customer.models import ShiveAshenaei as ShiveAshenaeiModel
|
||||
from rest_framework.views import APIView
|
||||
from rest_framework import generics
|
||||
from utils.get_user_workspace import get_user_workspace_uuid, get_user_workspace
|
||||
from utils import custom_permissions
|
||||
from rest_framework.permissions import IsAuthenticated
|
||||
from rest_framework import serializers
|
||||
from apps.customer.services import create_shive_ashenaei, delete_shive_ashenaei
|
||||
from apps.customer.selectors import list_shive_ashenaei, retrieve_shive_ashenaei
|
||||
from rest_framework.response import Response
|
||||
from rest_framework import status
|
||||
|
||||
|
||||
class ShiveAshenaeiCreateApi(APIView):
|
||||
permission_classes = (IsAuthenticated, custom_permissions.WorkspaceAdminPermission)
|
||||
|
||||
class InputSerializer(serializers.Serializer):
|
||||
name = serializers.CharField(max_length=20)
|
||||
|
||||
def post(self, request):
|
||||
serializer = self.InputSerializer(data=request.data)
|
||||
serializer.is_valid(raise_exception=True)
|
||||
|
||||
user_workspace = get_user_workspace(request=request)
|
||||
name = serializer.validated_data.get
|
||||
|
||||
create_shive_ashenaei(name=name, workspace=user_workspace)
|
||||
|
||||
return Response(status=status.HTTP_201_CREATED)
|
||||
|
||||
|
||||
class ShiveAshenaeiDeleteApi(APIView):
|
||||
permission_classes = (IsAuthenticated, custom_permissions.WorkspaceAdminPermission)
|
||||
|
||||
def delete(self, request, shive_id: int):
|
||||
|
||||
user_workspace_uuid = get_user_workspace_uuid(request=request)
|
||||
delete_shive_ashenaei(shive_id=shive_id, workspace_uuid=user_workspace_uuid)
|
||||
|
||||
return Response(status=status.HTTP_200_OK)
|
||||
|
||||
|
||||
class ShiveAshenaeiRetrieveApi(APIView):
|
||||
|
||||
permission_classes = (IsAuthenticated, custom_permissions.WorkspaceOperatorPermission, )
|
||||
|
||||
class OutputSerializer(serializers.ModelSerializer):
|
||||
class Meta:
|
||||
model = ShiveAshenaeiModel
|
||||
fields = '__all__'
|
||||
|
||||
def get(self, request, shive_id: int):
|
||||
|
||||
user_workspace_uuid = get_user_workspace_uuid(request)
|
||||
responsible_group_obj = retrieve_shive_ashenaei(shive_id=shive_id, workspace_uuid=user_workspace_uuid)
|
||||
|
||||
output = self.OutputSerializer(responsible_group_obj)
|
||||
return Response(data=output.data, status=status.HTTP_200_OK)
|
||||
|
||||
|
||||
class ShiveAshenaeiListApi(generics.ListAPIView):
|
||||
permission_classes = (IsAuthenticated, custom_permissions.WorkspaceOperatorPermission)
|
||||
|
||||
class OutputSerializer(serializers.ModelSerializer):
|
||||
class Meta:
|
||||
model = ShiveAshenaeiModel
|
||||
fields = '__all__'
|
||||
|
||||
serializer_class = OutputSerializer
|
||||
|
||||
def get_queryset(self):
|
||||
user_workspace_uuid = get_user_workspace_uuid(self.request)
|
||||
return list_shive_ashenaei(workspace_uuid=user_workspace_uuid)
|
||||
Whitespace-only changes.
@@ -0,0 +1,22 @@
|
||||
from django.contrib import admin
|
||||
from apps.customform.models import (
|
||||
CustomForm as CustomFormModel,
|
||||
CustomFormData as CustomFormDataModel,
|
||||
CustomFormField as CustomFormFieldModel,
|
||||
)
|
||||
# Register your models here.
|
||||
|
||||
|
||||
@admin.register(CustomFormModel)
|
||||
class CustomFormAdmin(admin.ModelAdmin):
|
||||
pass
|
||||
|
||||
|
||||
@admin.register(CustomFormDataModel)
|
||||
class CustomFormDataAdmin(admin.ModelAdmin):
|
||||
pass
|
||||
|
||||
|
||||
@admin.register(CustomFormFieldModel)
|
||||
class CustomFormFieldAdmin(admin.ModelAdmin):
|
||||
pass
|
||||
@@ -0,0 +1,6 @@
|
||||
from django.apps import AppConfig
|
||||
|
||||
|
||||
class CustomformConfig(AppConfig):
|
||||
default_auto_field = 'django.db.models.BigAutoField'
|
||||
name = 'apps.customform'
|
||||
@@ -0,0 +1,60 @@
|
||||
# Generated by Django 4.2.1 on 2023-07-23 06:48
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
initial = True
|
||||
|
||||
dependencies = [
|
||||
('cuser', '0002_roletype_cuserrole'),
|
||||
('workspace', '0001_initial'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='CustomForm',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('created_at', models.DateTimeField(auto_now_add=True)),
|
||||
('updated_at', models.DateTimeField(auto_now=True)),
|
||||
('name', models.CharField(max_length=20)),
|
||||
('desc', models.CharField(blank=True, max_length=30, null=True)),
|
||||
('sys_ws', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='workspace.workspace')),
|
||||
],
|
||||
options={
|
||||
'abstract': False,
|
||||
},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='CustomFormField',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('created_at', models.DateTimeField(auto_now_add=True)),
|
||||
('updated_at', models.DateTimeField(auto_now=True)),
|
||||
('field_name_fa', models.CharField(max_length=20)),
|
||||
('field_name_en', models.CharField(max_length=20)),
|
||||
('validator', models.CharField(blank=True, max_length=50, null=True)),
|
||||
('form', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='field', to='customform.customform')),
|
||||
],
|
||||
options={
|
||||
'abstract': False,
|
||||
},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='CustomFormData',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('created_at', models.DateTimeField(auto_now_add=True)),
|
||||
('updated_at', models.DateTimeField(auto_now=True)),
|
||||
('data', models.JSONField()),
|
||||
('form', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='customform.customform')),
|
||||
('form_filler', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='cuser.cuserrole')),
|
||||
],
|
||||
options={
|
||||
'abstract': False,
|
||||
},
|
||||
),
|
||||
]
|
||||
@@ -0,0 +1,23 @@
|
||||
# Generated by Django 4.2.1 on 2023-07-23 06:53
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('customform', '0001_initial'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='customform',
|
||||
name='desc',
|
||||
field=models.CharField(blank=True, max_length=50, null=True),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='customform',
|
||||
name='name',
|
||||
field=models.CharField(max_length=40),
|
||||
),
|
||||
]
|
||||
Whitespace-only changes.
@@ -0,0 +1,34 @@
|
||||
from django.db import models
|
||||
from utils.base_model import BaseModel
|
||||
import uuid
|
||||
from apps.workspace.models import Workspace as WorkspaceModel
|
||||
from apps.cuser.models import CuserRole as CuserRoleModel
|
||||
# Create your models here.
|
||||
|
||||
|
||||
class CustomForm(BaseModel):
|
||||
name = models.CharField(max_length=40, null=False, blank=False)
|
||||
desc = models.CharField(max_length=50, null=True, blank=True)
|
||||
sys_ws = models.ForeignKey(WorkspaceModel, on_delete=models.CASCADE)
|
||||
|
||||
def __str__(self):
|
||||
return f'{self.name}'
|
||||
|
||||
|
||||
class CustomFormField(BaseModel):
|
||||
form = models.ForeignKey(CustomForm, on_delete=models.CASCADE, related_name='field')
|
||||
field_name_fa = models.CharField(max_length=20, null=False, blank=False)
|
||||
field_name_en = models.CharField(max_length=20, null=False, blank=False)
|
||||
validator = models.CharField(max_length=50, null=True, blank=True)
|
||||
|
||||
def __str__(self):
|
||||
return f'{self.form} -> {self.field_name_en}'
|
||||
|
||||
|
||||
class CustomFormData(BaseModel):
|
||||
form = models.ForeignKey(CustomForm, on_delete=models.CASCADE)
|
||||
form_filler = models.ForeignKey(CuserRoleModel, on_delete=models.CASCADE)
|
||||
data = models.JSONField(null=False, blank=False)
|
||||
|
||||
def __str__(self):
|
||||
return f'{self.form} -> {self.field_name_en}'
|
||||
@@ -0,0 +1,3 @@
|
||||
from django.test import TestCase
|
||||
|
||||
# Create your tests here.
|
||||
@@ -0,0 +1,3 @@
|
||||
from django.shortcuts import render
|
||||
|
||||
# Create your views here.
|
||||
Whitespace-only changes.
@@ -0,0 +1,17 @@
|
||||
from django.contrib import admin
|
||||
from apps.jwt_auth.models import (
|
||||
JwtToken as JwtTokenModel,
|
||||
CUserRoleLoginOpt as CUserRoleLoginOptModel,
|
||||
)
|
||||
|
||||
# Register your models here.
|
||||
|
||||
|
||||
@admin.register(JwtTokenModel)
|
||||
class JwtTokenAdmin(admin.ModelAdmin):
|
||||
pass
|
||||
|
||||
|
||||
@admin.register(CUserRoleLoginOptModel)
|
||||
class CUserRoleLoginOptAdmin(admin.ModelAdmin):
|
||||
pass
|
||||
@@ -0,0 +1,6 @@
|
||||
from django.apps import AppConfig
|
||||
|
||||
|
||||
class AuthConfig(AppConfig):
|
||||
default_auto_field = 'django.db.models.BigAutoField'
|
||||
name = 'apps.jwt_auth'
|
||||
@@ -0,0 +1,28 @@
|
||||
# Generated by Django 4.2.1 on 2023-07-23 11:23
|
||||
|
||||
from django.conf import settings
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
initial = True
|
||||
|
||||
dependencies = [
|
||||
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='JwtToken',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('refresh', models.CharField(max_length=350)),
|
||||
('access', models.CharField(blank=True, max_length=350, null=True)),
|
||||
('expire', models.DateTimeField(blank=True, null=True)),
|
||||
('is_blocked', models.BooleanField(default=False)),
|
||||
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
|
||||
],
|
||||
),
|
||||
]
|
||||
@@ -0,0 +1,25 @@
|
||||
# Generated by Django 4.2.1 on 2023-07-23 11:45
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('cuser', '0002_roletype_cuserrole'),
|
||||
('jwt_auth', '0001_initial'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RenameField(
|
||||
model_name='jwttoken',
|
||||
old_name='user',
|
||||
new_name='cuser',
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='jwttoken',
|
||||
name='cuser_role',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='cuser.cuserrole'),
|
||||
),
|
||||
]
|
||||
@@ -0,0 +1,20 @@
|
||||
# Generated by Django 4.2.1 on 2023-07-23 11:45
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('cuser', '0002_roletype_cuserrole'),
|
||||
('jwt_auth', '0002_rename_user_jwttoken_cuser_jwttoken_cuser_role'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='jwttoken',
|
||||
name='cuser_role',
|
||||
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='cuser.cuserrole'),
|
||||
),
|
||||
]
|
||||
@@ -0,0 +1,25 @@
|
||||
# Generated by Django 4.2.1 on 2023-07-24 07:53
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
import uuid
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('cuser', '0002_roletype_cuserrole'),
|
||||
('jwt_auth', '0003_alter_jwttoken_cuser_role'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='CUserRoleLoginOpt',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('expire', models.DateTimeField()),
|
||||
('uuid', models.UUIDField(default=uuid.UUID('37c7f6dd-cba7-4960-ae50-3849df2f7403'), unique=True)),
|
||||
('cuser_role', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='cuser.cuserrole')),
|
||||
],
|
||||
),
|
||||
]
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
# Generated by Django 4.2.1 on 2023-08-07 08:37
|
||||
|
||||
from django.db import migrations, models
|
||||
import uuid
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('jwt_auth', '0004_cuserroleloginopt'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='cuserroleloginopt',
|
||||
name='uuid',
|
||||
field=models.UUIDField(default=uuid.UUID('49367381-4117-42f8-a300-4ea7fdefe797'), unique=True),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='jwttoken',
|
||||
name='access',
|
||||
field=models.CharField(blank=True, max_length=500, null=True),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='jwttoken',
|
||||
name='refresh',
|
||||
field=models.CharField(max_length=500),
|
||||
),
|
||||
]
|
||||
@@ -0,0 +1,19 @@
|
||||
# Generated by Django 4.2.1 on 2023-08-07 12:00
|
||||
|
||||
from django.db import migrations, models
|
||||
import uuid
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('jwt_auth', '0005_alter_cuserroleloginopt_uuid_alter_jwttoken_access_and_more'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='cuserroleloginopt',
|
||||
name='uuid',
|
||||
field=models.UUIDField(default=uuid.UUID('d747675e-0e3c-49d2-ac17-ee32b8669a56'), unique=True),
|
||||
),
|
||||
]
|
||||
@@ -0,0 +1,19 @@
|
||||
# Generated by Django 4.2.1 on 2023-08-07 12:03
|
||||
|
||||
from django.db import migrations, models
|
||||
import uuid
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('jwt_auth', '0006_alter_cuserroleloginopt_uuid'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='cuserroleloginopt',
|
||||
name='uuid',
|
||||
field=models.UUIDField(default=uuid.UUID('a688bf23-0a6c-4080-b31e-e67b96bae559'), unique=True),
|
||||
),
|
||||
]
|
||||
@@ -0,0 +1,19 @@
|
||||
# Generated by Django 4.2.1 on 2023-08-08 08:37
|
||||
|
||||
from django.db import migrations, models
|
||||
import uuid
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('jwt_auth', '0007_alter_cuserroleloginopt_uuid'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='cuserroleloginopt',
|
||||
name='uuid',
|
||||
field=models.UUIDField(default=uuid.UUID('d78832c8-ecf7-43a9-b26f-76095fb09b69'), unique=True),
|
||||
),
|
||||
]
|
||||
@@ -0,0 +1,19 @@
|
||||
# Generated by Django 4.2.1 on 2023-08-08 08:44
|
||||
|
||||
from django.db import migrations, models
|
||||
import uuid
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('jwt_auth', '0008_alter_cuserroleloginopt_uuid'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='cuserroleloginopt',
|
||||
name='uuid',
|
||||
field=models.UUIDField(default=uuid.UUID('541dd0c2-e8e3-40fe-94e3-71c54f258e31'), unique=True),
|
||||
),
|
||||
]
|
||||
@@ -0,0 +1,19 @@
|
||||
# Generated by Django 4.2.1 on 2023-08-08 08:48
|
||||
|
||||
from django.db import migrations, models
|
||||
import uuid
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('jwt_auth', '0009_alter_cuserroleloginopt_uuid'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='cuserroleloginopt',
|
||||
name='uuid',
|
||||
field=models.UUIDField(default=uuid.UUID('de316bc9-33a1-433f-a169-b033ceee4189'), unique=True),
|
||||
),
|
||||
]
|
||||
@@ -0,0 +1,19 @@
|
||||
# Generated by Django 4.2.1 on 2023-08-08 08:48
|
||||
|
||||
from django.db import migrations, models
|
||||
import uuid
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('jwt_auth', '0010_alter_cuserroleloginopt_uuid'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='cuserroleloginopt',
|
||||
name='uuid',
|
||||
field=models.UUIDField(default=uuid.UUID('22233ca2-ac64-459d-acae-61ce323085e4'), unique=True),
|
||||
),
|
||||
]
|
||||
@@ -0,0 +1,19 @@
|
||||
# Generated by Django 4.2.1 on 2023-08-10 05:19
|
||||
|
||||
from django.db import migrations, models
|
||||
import uuid
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('jwt_auth', '0011_alter_cuserroleloginopt_uuid'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='cuserroleloginopt',
|
||||
name='uuid',
|
||||
field=models.UUIDField(default=uuid.UUID('3de52e99-5b0d-4de3-853a-c5f356edcee2'), unique=True),
|
||||
),
|
||||
]
|
||||
@@ -0,0 +1,19 @@
|
||||
# Generated by Django 4.2.1 on 2023-08-10 05:39
|
||||
|
||||
from django.db import migrations, models
|
||||
import uuid
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('jwt_auth', '0012_alter_cuserroleloginopt_uuid'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='cuserroleloginopt',
|
||||
name='uuid',
|
||||
field=models.UUIDField(default=uuid.UUID('8b8db649-32ea-4d85-bd7f-70f37023dc83'), unique=True),
|
||||
),
|
||||
]
|
||||
@@ -0,0 +1,19 @@
|
||||
# Generated by Django 4.2.1 on 2023-08-13 05:45
|
||||
|
||||
from django.db import migrations, models
|
||||
import uuid
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('jwt_auth', '0013_alter_cuserroleloginopt_uuid'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='cuserroleloginopt',
|
||||
name='uuid',
|
||||
field=models.UUIDField(default=uuid.UUID('d04a18c0-3728-45f5-a24d-368f35760491'), unique=True),
|
||||
),
|
||||
]
|
||||
@@ -0,0 +1,19 @@
|
||||
# Generated by Django 4.2.1 on 2023-08-13 05:51
|
||||
|
||||
from django.db import migrations, models
|
||||
import uuid
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('jwt_auth', '0014_alter_cuserroleloginopt_uuid'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='cuserroleloginopt',
|
||||
name='uuid',
|
||||
field=models.UUIDField(default=uuid.UUID('e2754ac6-d826-412b-830c-36824044059a'), unique=True),
|
||||
),
|
||||
]
|
||||
@@ -0,0 +1,19 @@
|
||||
# Generated by Django 4.2.1 on 2023-08-13 05:52
|
||||
|
||||
from django.db import migrations, models
|
||||
import uuid
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('jwt_auth', '0015_alter_cuserroleloginopt_uuid'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='cuserroleloginopt',
|
||||
name='uuid',
|
||||
field=models.UUIDField(default=uuid.UUID('0c143a3f-9352-4091-9166-3a36b259712d'), unique=True),
|
||||
),
|
||||
]
|
||||
@@ -0,0 +1,19 @@
|
||||
# Generated by Django 4.2.1 on 2023-08-13 05:55
|
||||
|
||||
from django.db import migrations, models
|
||||
import uuid
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('jwt_auth', '0016_alter_cuserroleloginopt_uuid'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='cuserroleloginopt',
|
||||
name='uuid',
|
||||
field=models.UUIDField(default=uuid.UUID('e0cfd6f4-e278-4a1c-9d86-9d0ae5609feb'), unique=True),
|
||||
),
|
||||
]
|
||||
@@ -0,0 +1,19 @@
|
||||
# Generated by Django 4.2.1 on 2023-08-13 05:55
|
||||
|
||||
from django.db import migrations, models
|
||||
import uuid
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('jwt_auth', '0017_alter_cuserroleloginopt_uuid'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='cuserroleloginopt',
|
||||
name='uuid',
|
||||
field=models.UUIDField(default=uuid.UUID('e78b913c-d449-4a86-bd1f-f62f14891c6e'), unique=True),
|
||||
),
|
||||
]
|
||||
@@ -0,0 +1,19 @@
|
||||
# Generated by Django 4.2.1 on 2023-08-14 05:48
|
||||
|
||||
from django.db import migrations, models
|
||||
import uuid
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('jwt_auth', '0018_alter_cuserroleloginopt_uuid'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='cuserroleloginopt',
|
||||
name='uuid',
|
||||
field=models.UUIDField(default=uuid.UUID('fc09e8f3-8f33-408e-85c6-1f152d18d553'), unique=True),
|
||||
),
|
||||
]
|
||||
@@ -0,0 +1,19 @@
|
||||
# Generated by Django 4.2.1 on 2023-08-14 05:49
|
||||
|
||||
from django.db import migrations, models
|
||||
import uuid
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('jwt_auth', '0019_alter_cuserroleloginopt_uuid'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='cuserroleloginopt',
|
||||
name='uuid',
|
||||
field=models.UUIDField(default=uuid.UUID('762e49d2-f2e7-4fe1-a13b-22c5870b45ff'), unique=True),
|
||||
),
|
||||
]
|
||||
@@ -0,0 +1,19 @@
|
||||
# Generated by Django 4.2.1 on 2023-08-19 12:54
|
||||
|
||||
from django.db import migrations, models
|
||||
import uuid
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('jwt_auth', '0020_alter_cuserroleloginopt_uuid'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='cuserroleloginopt',
|
||||
name='uuid',
|
||||
field=models.UUIDField(default=uuid.UUID('b3c6473e-841d-42f7-82bf-0f32ea31cdff'), unique=True),
|
||||
),
|
||||
]
|
||||
@@ -0,0 +1,19 @@
|
||||
# Generated by Django 4.2.1 on 2023-08-20 08:10
|
||||
|
||||
from django.db import migrations, models
|
||||
import uuid
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('jwt_auth', '0021_alter_cuserroleloginopt_uuid'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='cuserroleloginopt',
|
||||
name='uuid',
|
||||
field=models.UUIDField(default=uuid.UUID('d8115499-21f1-4bfd-a716-fd70fdb7e250'), unique=True),
|
||||
),
|
||||
]
|
||||
@@ -0,0 +1,19 @@
|
||||
# Generated by Django 4.2.1 on 2023-10-22 06:55
|
||||
|
||||
from django.db import migrations, models
|
||||
import uuid
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('jwt_auth', '0022_alter_cuserroleloginopt_uuid'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='cuserroleloginopt',
|
||||
name='uuid',
|
||||
field=models.UUIDField(default=uuid.UUID('7cc5a6b6-2729-4e2b-b03e-aa29cc66befe'), unique=True),
|
||||
),
|
||||
]
|
||||
@@ -0,0 +1,19 @@
|
||||
# Generated by Django 4.2.1 on 2023-10-22 07:00
|
||||
|
||||
from django.db import migrations, models
|
||||
import uuid
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('jwt_auth', '0023_alter_cuserroleloginopt_uuid'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='cuserroleloginopt',
|
||||
name='uuid',
|
||||
field=models.UUIDField(default=uuid.UUID('f1b3355e-44b6-4fed-869d-1f264cf2888e'), unique=True),
|
||||
),
|
||||
]
|
||||
@@ -0,0 +1,19 @@
|
||||
# Generated by Django 4.2.1 on 2023-10-22 07:20
|
||||
|
||||
from django.db import migrations, models
|
||||
import uuid
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('jwt_auth', '0024_alter_cuserroleloginopt_uuid'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='cuserroleloginopt',
|
||||
name='uuid',
|
||||
field=models.UUIDField(default=uuid.UUID('ac36e3e3-c59d-4db2-9fa9-3602dddb5a06'), unique=True),
|
||||
),
|
||||
]
|
||||
@@ -0,0 +1,19 @@
|
||||
# Generated by Django 4.2.1 on 2023-12-20 10:41
|
||||
|
||||
from django.db import migrations, models
|
||||
import uuid
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('jwt_auth', '0025_alter_cuserroleloginopt_uuid'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='cuserroleloginopt',
|
||||
name='uuid',
|
||||
field=models.UUIDField(default=uuid.UUID('d2983df9-8544-4517-9f87-6c5eac1ae08d'), unique=True),
|
||||
),
|
||||
]
|
||||
@@ -0,0 +1,19 @@
|
||||
# Generated by Django 4.2.1 on 2023-12-20 11:32
|
||||
|
||||
from django.db import migrations, models
|
||||
import uuid
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('jwt_auth', '0026_alter_cuserroleloginopt_uuid'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='cuserroleloginopt',
|
||||
name='uuid',
|
||||
field=models.UUIDField(default=uuid.UUID('1d347d2e-e288-4646-a03a-a8ac30f6d941'), unique=True),
|
||||
),
|
||||
]
|
||||
@@ -0,0 +1,19 @@
|
||||
# Generated by Django 4.2.1 on 2023-12-24 06:43
|
||||
|
||||
from django.db import migrations, models
|
||||
import uuid
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('jwt_auth', '0027_alter_cuserroleloginopt_uuid'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='cuserroleloginopt',
|
||||
name='uuid',
|
||||
field=models.UUIDField(default=uuid.UUID('fe63de9e-93c0-4138-87c3-da38fd98ce3d'), unique=True),
|
||||
),
|
||||
]
|
||||
@@ -0,0 +1,19 @@
|
||||
# Generated by Django 4.2.1 on 2023-12-24 06:43
|
||||
|
||||
from django.db import migrations, models
|
||||
import uuid
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('jwt_auth', '0028_alter_cuserroleloginopt_uuid'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='cuserroleloginopt',
|
||||
name='uuid',
|
||||
field=models.UUIDField(default=uuid.UUID('73ce073c-a35d-4517-a7eb-82fcfc46df02'), unique=True),
|
||||
),
|
||||
]
|
||||
@@ -0,0 +1,19 @@
|
||||
# Generated by Django 4.2.1 on 2023-12-24 06:44
|
||||
|
||||
from django.db import migrations, models
|
||||
import uuid
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('jwt_auth', '0029_alter_cuserroleloginopt_uuid'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='cuserroleloginopt',
|
||||
name='uuid',
|
||||
field=models.UUIDField(default=uuid.UUID('c038407d-b9a8-46bc-be64-110dce94ef24'), unique=True),
|
||||
),
|
||||
]
|
||||
@@ -0,0 +1,19 @@
|
||||
# Generated by Django 4.2.1 on 2023-12-24 06:49
|
||||
|
||||
from django.db import migrations, models
|
||||
import uuid
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('jwt_auth', '0030_alter_cuserroleloginopt_uuid'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='cuserroleloginopt',
|
||||
name='uuid',
|
||||
field=models.UUIDField(default=uuid.UUID('48aeb395-3ca3-4d86-8b4b-48e4ac33fdc0'), unique=True),
|
||||
),
|
||||
]
|
||||
@@ -0,0 +1,19 @@
|
||||
# Generated by Django 4.2.1 on 2023-12-24 06:54
|
||||
|
||||
from django.db import migrations, models
|
||||
import uuid
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('jwt_auth', '0031_alter_cuserroleloginopt_uuid'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='cuserroleloginopt',
|
||||
name='uuid',
|
||||
field=models.UUIDField(default=uuid.UUID('a7685a15-7e73-4bd5-9a26-61f218c3fee8'), unique=True),
|
||||
),
|
||||
]
|
||||
@@ -0,0 +1,19 @@
|
||||
# Generated by Django 4.2.1 on 2023-12-24 06:55
|
||||
|
||||
from django.db import migrations, models
|
||||
import uuid
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('jwt_auth', '0032_alter_cuserroleloginopt_uuid'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='cuserroleloginopt',
|
||||
name='uuid',
|
||||
field=models.UUIDField(default=uuid.UUID('4fae2729-617a-4b63-a8dd-f767d3ddca1d'), unique=True),
|
||||
),
|
||||
]
|
||||
@@ -0,0 +1,19 @@
|
||||
# Generated by Django 4.2.1 on 2023-12-24 07:04
|
||||
|
||||
from django.db import migrations, models
|
||||
import uuid
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('jwt_auth', '0033_alter_cuserroleloginopt_uuid'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='cuserroleloginopt',
|
||||
name='uuid',
|
||||
field=models.UUIDField(default=uuid.UUID('7b45d40b-1ae5-4ef6-9e96-c7d663590faa'), unique=True),
|
||||
),
|
||||
]
|
||||
@@ -0,0 +1,19 @@
|
||||
# Generated by Django 4.2.1 on 2023-12-24 07:09
|
||||
|
||||
from django.db import migrations, models
|
||||
import uuid
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('jwt_auth', '0034_alter_cuserroleloginopt_uuid'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='cuserroleloginopt',
|
||||
name='uuid',
|
||||
field=models.UUIDField(default=uuid.UUID('1775f974-b6fa-42f8-86e9-7e70488ff983'), unique=True),
|
||||
),
|
||||
]
|
||||
@@ -0,0 +1,19 @@
|
||||
# Generated by Django 4.2.1 on 2023-12-24 07:11
|
||||
|
||||
from django.db import migrations, models
|
||||
import uuid
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('jwt_auth', '0035_alter_cuserroleloginopt_uuid'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='cuserroleloginopt',
|
||||
name='uuid',
|
||||
field=models.UUIDField(default=uuid.UUID('e0ab2d69-5a5d-497f-a1ef-35472005e935'), unique=True),
|
||||
),
|
||||
]
|
||||
@@ -0,0 +1,19 @@
|
||||
# Generated by Django 4.2.1 on 2023-12-25 08:53
|
||||
|
||||
from django.db import migrations, models
|
||||
import uuid
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('jwt_auth', '0036_alter_cuserroleloginopt_uuid'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='cuserroleloginopt',
|
||||
name='uuid',
|
||||
field=models.UUIDField(default=uuid.UUID('ed6a4531-68e1-4c30-a2eb-07340ab502c3'), unique=True),
|
||||
),
|
||||
]
|
||||
@@ -0,0 +1,19 @@
|
||||
# Generated by Django 4.2.1 on 2024-01-01 11:05
|
||||
|
||||
from django.db import migrations, models
|
||||
import uuid
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('jwt_auth', '0037_alter_cuserroleloginopt_uuid'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='cuserroleloginopt',
|
||||
name='uuid',
|
||||
field=models.UUIDField(default=uuid.UUID('c9472e6e-8808-47a2-a156-c850c9a17b58'), unique=True),
|
||||
),
|
||||
]
|
||||
@@ -0,0 +1,19 @@
|
||||
# Generated by Django 4.2.1 on 2024-01-01 11:07
|
||||
|
||||
from django.db import migrations, models
|
||||
import uuid
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('jwt_auth', '0038_alter_cuserroleloginopt_uuid'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='cuserroleloginopt',
|
||||
name='uuid',
|
||||
field=models.UUIDField(default=uuid.UUID('536eb30f-f56d-4e5f-9c4a-b193418f9571'), unique=True),
|
||||
),
|
||||
]
|
||||
@@ -0,0 +1,19 @@
|
||||
# Generated by Django 4.2.1 on 2024-01-01 11:08
|
||||
|
||||
from django.db import migrations, models
|
||||
import uuid
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('jwt_auth', '0039_alter_cuserroleloginopt_uuid'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='cuserroleloginopt',
|
||||
name='uuid',
|
||||
field=models.UUIDField(default=uuid.UUID('8bf5e304-391f-4365-868b-cf852d8337b4'), unique=True),
|
||||
),
|
||||
]
|
||||
@@ -0,0 +1,19 @@
|
||||
# Generated by Django 4.2.1 on 2024-01-05 07:11
|
||||
|
||||
from django.db import migrations, models
|
||||
import uuid
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('jwt_auth', '0040_alter_cuserroleloginopt_uuid'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='cuserroleloginopt',
|
||||
name='uuid',
|
||||
field=models.UUIDField(default=uuid.UUID('c63107f7-41d6-41f9-95c7-3fbbcbde82ac'), unique=True),
|
||||
),
|
||||
]
|
||||
@@ -0,0 +1,19 @@
|
||||
# Generated by Django 4.2.1 on 2024-01-07 15:15
|
||||
|
||||
from django.db import migrations, models
|
||||
import uuid
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('jwt_auth', '0041_alter_cuserroleloginopt_uuid'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='cuserroleloginopt',
|
||||
name='uuid',
|
||||
field=models.UUIDField(default=uuid.UUID('7ac2bbe1-3ce1-4853-b906-da5590eed9d4'), unique=True),
|
||||
),
|
||||
]
|
||||
Loaded 100 of 284 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user