uselotus__lotus METASEP

lotus/wsgi.py METASEP
"""
WSGI config for lotus project.

It exposes the WSGI callable as a module-level variable named ``application``.

For more information on this file, see
https://docs.djangoproject.com/en/4.0/howto/deployment/wsgi/
"""

import os

from django.core.wsgi import get_wsgi_application

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "lotus.settings")

application = get_wsgi_application()

lotus/urls.py METASEP
"""lotus URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/4.0/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path
from django.conf.urls import include
from rest_framework import routers
from billing.views import EventViewSet
from billing import track

router = routers.DefaultRouter()
router.register(r"event", EventViewSet)

urlpatterns = [
    path("grappelli/", include("grappelli.urls")),
    path("admin/", admin.site.urls),
    path("api/", include(router.urls)),
    path("track/", track.track_event, name="track_event"),
    path("track", track.track_event, name="track_event"),
]

lotus/settings.py METASEP
"""
Django settings for lotus project.

Generated by 'django-admin startproject' using Django 4.0.6.

For more information on this file, see
https://docs.djangoproject.com/en/4.0/topics/settings/

For the full list of settings and their values, see
https://docs.djangoproject.com/en/4.0/ref/settings/
"""

from pathlib import Path

# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent


# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/4.0/howto/deployment/checklist/

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = os.environ["SECRET_KEY"]

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True

ALLOWED_HOSTS = []


# Application definition

INSTALLED_APPS = [
    "grappelli",
    "django.contrib.admin",
    "django.contrib.auth",
    "django.contrib.contenttypes",
    "django.contrib.sessions",
    "django.contrib.messages",
    "django.contrib.staticfiles",
    "rest_framework",
    "rest_framework_api_key",
    "billing",
    "djmoney",
    "corsheaders",
]

MIDDLEWARE = [
    "django.middleware.security.SecurityMiddleware",
    "django.contrib.sessions.middleware.SessionMiddleware",
    "corsheaders.middleware.CorsMiddleware",
    "django.middleware.common.CommonMiddleware",
    "django.middleware.csrf.CsrfViewMiddleware",
    "django.contrib.auth.middleware.AuthenticationMiddleware",
    "django.contrib.messages.middleware.MessageMiddleware",
    "django.middleware.clickjacking.XFrameOptionsMiddleware",
]

ROOT_URLCONF = "lotus.urls"

TEMPLATES = [
    {
        "BACKEND": "django.template.backends.django.DjangoTemplates",
        "DIRS": [],
        "APP_DIRS": True,
        "OPTIONS": {
            "context_processors": [
                "django.template.context_processors.debug",
                "django.template.context_processors.request",
                "django.contrib.auth.context_processors.auth",
                "django.contrib.messages.context_processors.messages",
            ],
        },
    },
]

WSGI_APPLICATION = "lotus.wsgi.application"


# Database
# https://docs.djangoproject.com/en/4.0/ref/settings/#databases

DATABASES = {
    "default": {
        "ENGINE": "django.db.backends.sqlite3",
        "NAME": BASE_DIR / "db.sqlite3",
    }
}


# Password validation
# https://docs.djangoproject.com/en/4.0/ref/settings/#auth-password-validators

AUTH_PASSWORD_VALIDATORS = [
    {
        "NAME": "django.contrib.auth.password_validation.UserAttributeSimilarityValidator",
    },
    {
        "NAME": "django.contrib.auth.password_validation.MinimumLengthValidator",
    },
    {
        "NAME": "django.contrib.auth.password_validation.CommonPasswordValidator",
    },
    {
        "NAME": "django.contrib.auth.password_validation.NumericPasswordValidator",
    },
]


# Internationalization
# https://docs.djangoproject.com/en/4.0/topics/i18n/

LANGUAGE_CODE = "en-us"

TIME_ZONE = "UTC"

USE_I18N = True

USE_TZ = True


# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/4.0/howto/static-files/

STATIC_URL = "static/"

REST_FRAMEWORK = {
    "DEFAULT_PERMISSION_CLASSES": [
        "rest_framework_api_key.permissions.HasAPIKey",
    ]
}


# Default primary key field type
# https://docs.djangoproject.com/en/4.0/ref/settings/#default-auto-field

DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField"

CORS_ORIGIN_ALLOW_ALL = True
CORS_ALLOW_CREDENTIALS = True

lotus/asgi.py METASEP
"""
ASGI config for lotus project.

It exposes the ASGI callable as a module-level variable named ``application``.

For more information on this file, see
https://docs.djangoproject.com/en/4.0/howto/deployment/asgi/
"""

import os

from django.core.asgi import get_asgi_application

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "lotus.settings")

application = get_asgi_application()

lotus/__init__.py METASEP

requirements.txt METASEP
#
# These requirements were autogenerated by pipenv
# To regenerate from the project's Pipfile, run:
#
#    pipenv lock --requirements
#

-i https://pypi.org/simple
asgiref==3.5.2; python_version >= '3.7'
django==4.0.6
djangorestframework==3.13.1
pytz==2022.1
sqlparse==0.4.2; python_version >= '3.5'

renovate.json METASEP
{
  "$schema": "https://docs.renovatebot.com/renovate-schema.json",
  "extends": [
    "config:base"
  ]
}

README.md METASEP
# lotus

Pipfile.lock METASEP
{
    "_meta": {
        "hash": {
            "sha256": "ae1db546af7dfede2507757e61cd0130de5167b1ef265362ba3efd8791619329"
        },
        "pipfile-spec": 6,
        "requires": {
            "python_version": "3.9"
        },
        "sources": [
            {
                "name": "pypi",
                "url": "https://pypi.org/simple",
                "verify_ssl": true
            }
        ]
    },
    "default": {
        "asgiref": {
            "hashes": [
                "sha256:1d2880b792ae8757289136f1db2b7b99100ce959b2aa57fd69dab783d05afac4",
                "sha256:4a29362a6acebe09bf1d6640db38c1dc3d9217c68e6f9f6204d72667fc19a424"
            ],
            "markers": "python_version >= '3.7'",
            "version": "==3.5.2"
        },
        "babel": {
            "hashes": [
                "sha256:7614553711ee97490f732126dc077f8d0ae084ebc6a96e23db1482afabdb2c51",
                "sha256:ff56f4892c1c4bf0d814575ea23471c230d544203c7748e8c68f0089478d48eb"
            ],
            "markers": "python_version >= '3.6'",
            "version": "==2.10.3"
        },
        "cfgv": {
            "hashes": [
                "sha256:c6a0883f3917a037485059700b9e75da2464e6c27051014ad85ba6aaa5884426",
                "sha256:f5a830efb9ce7a445376bb66ec94c638a9787422f96264c98edc6bdeed8ab736"
            ],
            "markers": "python_full_version >= '3.6.1'",
            "version": "==3.3.1"
        },
        "distlib": {
            "hashes": [
                "sha256:a7f75737c70be3b25e2bee06288cec4e4c221de18455b2dd037fe2a795cab2fe",
                "sha256:b710088c59f06338ca514800ad795a132da19fda270e3ce4affc74abf955a26c"
            ],
            "version": "==0.3.5"
        },
        "django": {
            "hashes": [
                "sha256:a67a793ff6827fd373555537dca0da293a63a316fe34cb7f367f898ccca3c3ae",
                "sha256:ca54ebedfcbc60d191391efbf02ba68fb52165b8bf6ccd6fe71f098cac1fe59e"
            ],
            "index": "pypi",
            "version": "==4.0.6"
        },
        "django-cors-headers": {
            "hashes": [
                "sha256:37e42883b5f1f2295df6b4bba96eb2417a14a03270cb24b2a07f021cd4487cf4",
                "sha256:f9dc6b4e3f611c3199700b3e5f3398c28757dcd559c2f82932687f3d0443cfdf"
            ],
            "index": "pypi",
            "version": "==3.13.0"
        },
        "django-grappelli": {
            "hashes": [
                "sha256:7d60304200f4ea202862fda3b0efaa91c70280841ca22b1b22f49f1017ed2afc",
                "sha256:a98883407f995896f4c4d108ef3ef6cfc00e581211738c5a13c536950a95bcc8"
            ],
            "index": "pypi",
            "version": "==3.0.3"
        },
        "django-loginas": {
            "hashes": [
                "sha256:2d609ddcc68ff840b3e59baa58ac58b870cd1aef491aaab8cd796d022d961c40",
                "sha256:8d81f31d993b3c3c9f9018b385bfbdf74ead320e0a4b18493141d0e2dbc8ad6b"
            ],
            "index": "pypi",
            "version": "==0.3.10"
        },
        "django-model-utils": {
            "hashes": [
                "sha256:a768a25c80514e0ad4e4a6f9c02c44498985f36c5dfdea47b5b1e8cf994beba6",
                "sha256:e7a95e102f9c9653427eadab980d5d59e1dea972913b9c9e01ac37f86bba0ddf"
            ],
            "index": "pypi",
            "version": "==4.2.0"
        },
        "django-money": {
            "hashes": [
                "sha256:1f2a760d5da28de8e1beb05bfc66db0c29b4329c7e382cf69f2577315da3ee91",
                "sha256:4213604537d0e61abb5a7bbb39f0c90bd347a6605c67e96868f5fa9fbbe40278"
            ],
            "index": "pypi",
            "version": "==3.0.0"
        },
        "djangorestframework": {
            "hashes": [
                "sha256:0c33407ce23acc68eca2a6e46424b008c9c02eceb8cf18581921d0092bc1f2ee",
                "sha256:24c4bf58ed7e85d1fe4ba250ab2da926d263cd57d64b03e8dcef0ac683f8b1aa"
            ],
            "index": "pypi",
            "version": "==3.13.1"
        },
        "djangorestframework-api-key": {
            "hashes": [
                "sha256:41b7c988f356d62410fb42b9982a3017be035b84d68f187e127c0b52e6557b19",
                "sha256:c9884e52f2802994a02781eaba0a63a628a150ed55d58603d5c9c57a6657de43"
            ],
            "index": "pypi",
            "version": "==2.2.0"
        },
        "filelock": {
            "hashes": [
                "sha256:37def7b658813cda163b56fc564cdc75e86d338246458c4c28ae84cabefa2404",
                "sha256:3a0fd85166ad9dbab54c9aec96737b744106dc5f15c0b09a6744a445299fcf04"
            ],
            "markers": "python_version >= '3.7'",
            "version": "==3.7.1"
        },
        "identify": {
            "hashes": [
                "sha256:a3d4c096b384d50d5e6dc5bc8b9bc44f1f61cefebd750a7b3e9f939b53fb214d",
                "sha256:feaa9db2dc0ce333b453ce171c0cf1247bbfde2c55fc6bb785022d411a1b78b5"
            ],
            "markers": "python_version >= '3.7'",
            "version": "==2.5.2"
        },
        "jsonfield": {
            "hashes": [
                "sha256:7e4e84597de21eeaeeaaa7cc5da08c61c48a9b64d0c446b2d71255d01812887a",
                "sha256:df857811587f252b97bafba42e02805e70a398a7a47870bc6358a0308dd689ed"
            ],
            "index": "pypi",
            "version": "==3.1.0"
        },
        "nodeenv": {
            "hashes": [
                "sha256:27083a7b96a25f2f5e1d8cb4b6317ee8aeda3bdd121394e5ac54e498028a042e",
                "sha256:e0e7f7dfb85fc5394c6fe1e8fa98131a2473e04311a45afb6508f7cf1836fa2b"
            ],
            "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6'",
            "version": "==1.7.0"
        },
        "platformdirs": {
            "hashes": [
                "sha256:027d8e83a2d7de06bbac4e5ef7e023c02b863d7ea5d079477e722bb41ab25788",
                "sha256:58c8abb07dcb441e6ee4b11d8df0ac856038f944ab98b7be6b27b2a3c7feef19"
            ],
            "markers": "python_version >= '3.7'",
            "version": "==2.5.2"
        },
        "pre-commit": {
            "hashes": [
                "sha256:51a5ba7c480ae8072ecdb6933df22d2f812dc897d5fe848778116129a681aac7",
                "sha256:a978dac7bc9ec0bcee55c18a277d553b0f419d259dadb4b9418ff2d00eb43959"
            ],
            "index": "pypi",
            "version": "==2.20.0"
        },
        "py-moneyed": {
            "hashes": [
                "sha256:1fafe552cfa3cba579d026924c27b070d71b4140e50ef4535e4083b3f4f2473f",
                "sha256:a56e1987deacb2e0eac5904552699a5d3fa251042e528bf2ff74a72359f5e5b3"
            ],
            "markers": "python_version >= '3.6'",
            "version": "==2.0"
        },
        "pytz": {
            "hashes": [
                "sha256:1e760e2fe6a8163bc0b3d9a19c4f84342afa0a2affebfaa84b01b978a02ecaa7",
                "sha256:e68985985296d9a66a881eb3193b0906246245294a881e7c8afe623866ac6a5c"
            ],
            "version": "==2022.1"
        },
        "pyyaml": {
            "hashes": [
                "sha256:0283c35a6a9fbf047493e3a0ce8d79ef5030852c51e9d911a27badfde0605293",
                "sha256:055d937d65826939cb044fc8c9b08889e8c743fdc6a32b33e2390f66013e449b",
                "sha256:07751360502caac1c067a8132d150cf3d61339af5691fe9e87803040dbc5db57",
                "sha256:0b4624f379dab24d3725ffde76559cff63d9ec94e1736b556dacdfebe5ab6d4b",
                "sha256:0ce82d761c532fe4ec3f87fc45688bdd3a4c1dc5e0b4a19814b9009a29baefd4",
                "sha256:1e4747bc279b4f613a09eb64bba2ba602d8a6664c6ce6396a4d0cd413a50ce07",
                "sha256:213c60cd50106436cc818accf5baa1aba61c0189ff610f64f4a3e8c6726218ba",
                "sha256:231710d57adfd809ef5d34183b8ed1eeae3f76459c18fb4a0b373ad56bedcdd9",
                "sha256:277a0ef2981ca40581a47093e9e2d13b3f1fbbeffae064c1d21bfceba2030287",
                "sha256:2cd5df3de48857ed0544b34e2d40e9fac445930039f3cfe4bcc592a1f836d513",
                "sha256:40527857252b61eacd1d9af500c3337ba8deb8fc298940291486c465c8b46ec0",
                "sha256:473f9edb243cb1935ab5a084eb238d842fb8f404ed2193a915d1784b5a6b5fc0",
                "sha256:48c346915c114f5fdb3ead70312bd042a953a8ce5c7106d5bfb1a5254e47da92",
                "sha256:50602afada6d6cbfad699b0c7bb50d5ccffa7e46a3d738092afddc1f9758427f",
                "sha256:68fb519c14306fec9720a2a5b45bc9f0c8d1b9c72adf45c37baedfcd949c35a2",
                "sha256:77f396e6ef4c73fdc33a9157446466f1cff553d979bd00ecb64385760c6babdc",
                "sha256:819b3830a1543db06c4d4b865e70ded25be52a2e0631ccd2f6a47a2822f2fd7c",
                "sha256:897b80890765f037df3403d22bab41627ca8811ae55e9a722fd0392850ec4d86",
                "sha256:98c4d36e99714e55cfbaaee6dd5badbc9a1ec339ebfc3b1f52e293aee6bb71a4",
                "sha256:9df7ed3b3d2e0ecfe09e14741b857df43adb5a3ddadc919a2d94fbdf78fea53c",
                "sha256:9fa600030013c4de8165339db93d182b9431076eb98eb40ee068700c9c813e34",
                "sha256:a80a78046a72361de73f8f395f1f1e49f956c6be882eed58505a15f3e430962b",
                "sha256:b3d267842bf12586ba6c734f89d1f5b871df0273157918b0ccefa29deb05c21c",
                "sha256:b5b9eccad747aabaaffbc6064800670f0c297e52c12754eb1d976c57e4f74dcb",
                "sha256:c5687b8d43cf58545ade1fe3e055f70eac7a5a1a0bf42824308d868289a95737",
                "sha256:cba8c411ef271aa037d7357a2bc8f9ee8b58b9965831d9e51baf703280dc73d3",
                "sha256:d15a181d1ecd0d4270dc32edb46f7cb7733c7c508857278d3d378d14d606db2d",
                "sha256:d4db7c7aef085872ef65a8fd7d6d09a14ae91f691dec3e87ee5ee0539d516f53",
                "sha256:d4eccecf9adf6fbcc6861a38015c2a64f38b9d94838ac1810a9023a0609e1b78",
                "sha256:d67d839ede4ed1b28a4e8909735fc992a923cdb84e618544973d7dfc71540803",
                "sha256:daf496c58a8c52083df09b80c860005194014c3698698d1a57cbcfa182142a3a",
                "sha256:e61ceaab6f49fb8bdfaa0f92c4b57bcfbea54c09277b1b4f7ac376bfb7a7c174",
                "sha256:f84fbc98b019fef2ee9a1cb3ce93e3187a6df0b2538a651bfb890254ba9f90b5"
            ],
            "markers": "python_version >= '3.6'",
            "version": "==6.0"
        },
        "setuptools": {
            "hashes": [
                "sha256:0d33c374d41c7863419fc8f6c10bfe25b7b498aa34164d135c622e52580c6b16",
                "sha256:c04b44a57a6265fe34a4a444e965884716d34bae963119a76353434d6f18e450"
            ],
            "markers": "python_version >= '3.7'",
            "version": "==63.2.0"
        },
        "six": {
            "hashes": [
                "sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926",
                "sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254"
            ],
            "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'",
            "version": "==1.16.0"
        },
        "sqlparse": {
            "hashes": [
                "sha256:0c00730c74263a94e5a9919ade150dfc3b19c574389985446148402998287dae",
                "sha256:48719e356bb8b42991bdbb1e8b83223757b93789c00910a616a071910ca4a64d"
            ],
            "markers": "python_version >= '3.5'",
            "version": "==0.4.2"
        },
        "toml": {
            "hashes": [
                "sha256:806143ae5bfb6a3c6e736a764057db0e6a0e05e338b5630894a5f779cabb4f9b",
                "sha256:b3bda1d108d5dd99f4a20d24d9c348e91c4db7ab1b749200bded2f839ccbe68f"
            ],
            "markers": "python_version >= '2.6' and python_version not in '3.0, 3.1, 3.2, 3.3'",
            "version": "==0.10.2"
        },
        "typing-extensions": {
            "hashes": [
                "sha256:25642c956049920a5aa49edcdd6ab1e06d7e5d467fc00e0506c44ac86fbfca02",
                "sha256:e6d2677a32f47fc7eb2795db1dd15c1f34eff616bcaf2cfb5e997f854fa1c4a6"
            ],
            "markers": "python_version >= '3.7'",
            "version": "==4.3.0"
        },
        "virtualenv": {
            "hashes": [
                "sha256:288171134a2ff3bfb1a2f54f119e77cd1b81c29fc1265a2356f3e8d14c7d58c4",
                "sha256:b30aefac647e86af6d82bfc944c556f8f1a9c90427b2fb4e3bfbf338cb82becf"
            ],
            "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'",
            "version": "==20.15.1"
        }
    },
    "develop": {
        "astroid": {
            "hashes": [
                "sha256:86b0a340a512c65abf4368b80252754cda17c02cdbbd3f587dddf98112233e7b",
                "sha256:bb24615c77f4837c707669d16907331374ae8a964650a66999da3f5ca68dc946"
            ],
            "markers": "python_full_version >= '3.6.2'",
            "version": "==2.11.7"
        },
        "dill": {
            "hashes": [
                "sha256:33501d03270bbe410c72639b350e941882a8b0fd55357580fbc873fba0c59302",
                "sha256:d75e41f3eff1eee599d738e76ba8f4ad98ea229db8b085318aa2b3333a208c86"
            ],
            "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6'",
            "version": "==0.3.5.1"
        },
        "isort": {
            "hashes": [
                "sha256:6f62d78e2f89b4500b080fe3a81690850cd254227f27f75c3a0c491a1f351ba7",
                "sha256:e8443a5e7a020e9d7f97f1d7d9cd17c88bcb3bc7e218bf9cf5095fe550be2951"
            ],
            "markers": "python_version < '4.0' and python_full_version >= '3.6.1'",
            "version": "==5.10.1"
        },
        "lazy-object-proxy": {
            "hashes": [
                "sha256:043651b6cb706eee4f91854da4a089816a6606c1428fd391573ef8cb642ae4f7",
                "sha256:07fa44286cda977bd4803b656ffc1c9b7e3bc7dff7d34263446aec8f8c96f88a",
                "sha256:12f3bb77efe1367b2515f8cb4790a11cffae889148ad33adad07b9b55e0ab22c",
                "sha256:2052837718516a94940867e16b1bb10edb069ab475c3ad84fd1e1a6dd2c0fcfc",
                "sha256:2130db8ed69a48a3440103d4a520b89d8a9405f1b06e2cc81640509e8bf6548f",
                "sha256:39b0e26725c5023757fc1ab2a89ef9d7ab23b84f9251e28f9cc114d5b59c1b09",
                "sha256:46ff647e76f106bb444b4533bb4153c7370cdf52efc62ccfc1a28bdb3cc95442",
                "sha256:4dca6244e4121c74cc20542c2ca39e5c4a5027c81d112bfb893cf0790f96f57e",
                "sha256:553b0f0d8dbf21890dd66edd771f9b1b5f51bd912fa5f26de4449bfc5af5e029",
                "sha256:677ea950bef409b47e51e733283544ac3d660b709cfce7b187f5ace137960d61",
                "sha256:6a24357267aa976abab660b1d47a34aaf07259a0c3859a34e536f1ee6e76b5bb",
                "sha256:6a6e94c7b02641d1311228a102607ecd576f70734dc3d5e22610111aeacba8a0",
                "sha256:6aff3fe5de0831867092e017cf67e2750c6a1c7d88d84d2481bd84a2e019ec35",
                "sha256:6ecbb350991d6434e1388bee761ece3260e5228952b1f0c46ffc800eb313ff42",
                "sha256:7096a5e0c1115ec82641afbdd70451a144558ea5cf564a896294e346eb611be1",
                "sha256:70ed0c2b380eb6248abdef3cd425fc52f0abd92d2b07ce26359fcbc399f636ad",
                "sha256:8561da8b3dd22d696244d6d0d5330618c993a215070f473b699e00cf1f3f6443",
                "sha256:85b232e791f2229a4f55840ed54706110c80c0a210d076eee093f2b2e33e1bfd",
                "sha256:898322f8d078f2654d275124a8dd19b079080ae977033b713f677afcfc88e2b9",
                "sha256:8f3953eb575b45480db6568306893f0bd9d8dfeeebd46812aa09ca9579595148",
                "sha256:91ba172fc5b03978764d1df5144b4ba4ab13290d7bab7a50f12d8117f8630c38",
                "sha256:9d166602b525bf54ac994cf833c385bfcc341b364e3ee71e3bf5a1336e677b55",
                "sha256:a57d51ed2997e97f3b8e3500c984db50a554bb5db56c50b5dab1b41339b37e36",
                "sha256:b9e89b87c707dd769c4ea91f7a31538888aad05c116a59820f28d59b3ebfe25a",
                "sha256:bb8c5fd1684d60a9902c60ebe276da1f2281a318ca16c1d0a96db28f62e9166b",
                "sha256:c19814163728941bb871240d45c4c30d33b8a2e85972c44d4e63dd7107faba44",
                "sha256:c4ce15276a1a14549d7e81c243b887293904ad2d94ad767f42df91e75fd7b5b6",
                "sha256:c7a683c37a8a24f6428c28c561c80d5f4fd316ddcf0c7cab999b15ab3f5c5c69",
                "sha256:d609c75b986def706743cdebe5e47553f4a5a1da9c5ff66d76013ef396b5a8a4",
                "sha256:d66906d5785da8e0be7360912e99c9188b70f52c422f9fc18223347235691a84",
                "sha256:dd7ed7429dbb6c494aa9bc4e09d94b778a3579be699f9d67da7e6804c422d3de",
                "sha256:df2631f9d67259dc9620d831384ed7732a198eb434eadf69aea95ad18c587a28",
                "sha256:e368b7f7eac182a59ff1f81d5f3802161932a41dc1b1cc45c1f757dc876b5d2c",
                "sha256:e40f2013d96d30217a51eeb1db28c9ac41e9d0ee915ef9d00da639c5b63f01a1",
                "sha256:f769457a639403073968d118bc70110e7dce294688009f5c24ab78800ae56dc8",
                "sha256:fccdf7c2c5821a8cbd0a9440a456f5050492f2270bd54e94360cac663398739b",
                "sha256:fd45683c3caddf83abbb1249b653a266e7069a09f486daa8863fb0e7496a9fdb"
            ],
            "markers": "python_version >= '3.6'",
            "version": "==1.7.1"
        },
        "mccabe": {
            "hashes": [
                "sha256:348e0240c33b60bbdf4e523192ef919f28cb2c3d7d5c7794f74009290f236325",
                "sha256:6c2d30ab6be0e4a46919781807b4f0d834ebdd6c6e3dca0bda5a15f863427b6e"
            ],
            "markers": "python_version >= '3.6'",
            "version": "==0.7.0"
        },
        "platformdirs": {
            "hashes": [
                "sha256:027d8e83a2d7de06bbac4e5ef7e023c02b863d7ea5d079477e722bb41ab25788",
                "sha256:58c8abb07dcb441e6ee4b11d8df0ac856038f944ab98b7be6b27b2a3c7feef19"
            ],
            "markers": "python_version >= '3.7'",
            "version": "==2.5.2"
        },
        "pylint": {
            "hashes": [
                "sha256:487ce2192eee48211269a0e976421f334cf94de1806ca9d0a99449adcdf0285e",
                "sha256:fabe30000de7d07636d2e82c9a518ad5ad7908590fe135ace169b44839c15f90"
            ],
            "index": "pypi",
            "version": "==2.14.5"
        },
        "setuptools": {
            "hashes": [
                "sha256:0d33c374d41c7863419fc8f6c10bfe25b7b498aa34164d135c622e52580c6b16",
                "sha256:c04b44a57a6265fe34a4a444e965884716d34bae963119a76353434d6f18e450"
            ],
            "markers": "python_version >= '3.7'",
            "version": "==63.2.0"
        },
        "tomli": {
            "hashes": [
                "sha256:939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc",
                "sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f"
            ],
            "markers": "python_version < '3.11'",
            "version": "==2.0.1"
        },
        "tomlkit": {
            "hashes": [
                "sha256:1c5bebdf19d5051e2e1de6cf70adfc5948d47221f097fcff7a3ffc91e953eaf5",
                "sha256:61901f81ff4017951119cd0d1ed9b7af31c821d6845c8c477587bbdcd5e5854e"
            ],
            "markers": "python_version >= '3.6' and python_version < '4.0'",
            "version": "==0.11.1"
        },
        "typing-extensions": {
            "hashes": [
                "sha256:25642c956049920a5aa49edcdd6ab1e06d7e5d467fc00e0506c44ac86fbfca02",
                "sha256:e6d2677a32f47fc7eb2795db1dd15c1f34eff616bcaf2cfb5e997f854fa1c4a6"
            ],
            "markers": "python_version >= '3.7'",
            "version": "==4.3.0"
        },
        "wrapt": {
            "hashes": [
                "sha256:00b6d4ea20a906c0ca56d84f93065b398ab74b927a7a3dbd470f6fc503f95dc3",
                "sha256:01c205616a89d09827986bc4e859bcabd64f5a0662a7fe95e0d359424e0e071b",
                "sha256:02b41b633c6261feff8ddd8d11c711df6842aba629fdd3da10249a53211a72c4",
                "sha256:07f7a7d0f388028b2df1d916e94bbb40624c59b48ecc6cbc232546706fac74c2",
                "sha256:11871514607b15cfeb87c547a49bca19fde402f32e2b1c24a632506c0a756656",
                "sha256:1b376b3f4896e7930f1f772ac4b064ac12598d1c38d04907e696cc4d794b43d3",
                "sha256:21ac0156c4b089b330b7666db40feee30a5d52634cc4560e1905d6529a3897ff",
                "sha256:257fd78c513e0fb5cdbe058c27a0624c9884e735bbd131935fd49e9fe719d310",
                "sha256:2b39d38039a1fdad98c87279b48bc5dce2c0ca0d73483b12cb72aa9609278e8a",
                "sha256:2cf71233a0ed05ccdabe209c606fe0bac7379fdcf687f39b944420d2a09fdb57",
                "sha256:2fe803deacd09a233e4762a1adcea5db5d31e6be577a43352936179d14d90069",
                "sha256:3232822c7d98d23895ccc443bbdf57c7412c5a65996c30442ebe6ed3df335383",
                "sha256:34aa51c45f28ba7f12accd624225e2b1e5a3a45206aa191f6f9aac931d9d56fe",
                "sha256:36f582d0c6bc99d5f39cd3ac2a9062e57f3cf606ade29a0a0d6b323462f4dd87",
                "sha256:380a85cf89e0e69b7cfbe2ea9f765f004ff419f34194018a6827ac0e3edfed4d",
                "sha256:40e7bc81c9e2b2734ea4bc1aceb8a8f0ceaac7c5299bc5d69e37c44d9081d43b",
                "sha256:43ca3bbbe97af00f49efb06e352eae40434ca9d915906f77def219b88e85d907",
                "sha256:4fcc4649dc762cddacd193e6b55bc02edca674067f5f98166d7713b193932b7f",
                "sha256:5a0f54ce2c092aaf439813735584b9537cad479575a09892b8352fea5e988dc0",
                "sha256:5a9a0d155deafd9448baff28c08e150d9b24ff010e899311ddd63c45c2445e28",
                "sha256:5b02d65b9ccf0ef6c34cba6cf5bf2aab1bb2f49c6090bafeecc9cd81ad4ea1c1",
                "sha256:60db23fa423575eeb65ea430cee741acb7c26a1365d103f7b0f6ec412b893853",
                "sha256:642c2e7a804fcf18c222e1060df25fc210b9c58db7c91416fb055897fc27e8cc",
                "sha256:6a9a25751acb379b466ff6be78a315e2b439d4c94c1e99cb7266d40a537995d3",
                "sha256:6b1a564e6cb69922c7fe3a678b9f9a3c54e72b469875aa8018f18b4d1dd1adf3",
                "sha256:6d323e1554b3d22cfc03cd3243b5bb815a51f5249fdcbb86fda4bf62bab9e164",
                "sha256:6e743de5e9c3d1b7185870f480587b75b1cb604832e380d64f9504a0535912d1",
                "sha256:709fe01086a55cf79d20f741f39325018f4df051ef39fe921b1ebe780a66184c",
                "sha256:7b7c050ae976e286906dd3f26009e117eb000fb2cf3533398c5ad9ccc86867b1",
                "sha256:7d2872609603cb35ca513d7404a94d6d608fc13211563571117046c9d2bcc3d7",
                "sha256:7ef58fb89674095bfc57c4069e95d7a31cfdc0939e2a579882ac7d55aadfd2a1",
                "sha256:80bb5c256f1415f747011dc3604b59bc1f91c6e7150bd7db03b19170ee06b320",
                "sha256:81b19725065dcb43df02b37e03278c011a09e49757287dca60c5aecdd5a0b8ed",
                "sha256:833b58d5d0b7e5b9832869f039203389ac7cbf01765639c7309fd50ef619e0b1",
                "sha256:88bd7b6bd70a5b6803c1abf6bca012f7ed963e58c68d76ee20b9d751c74a3248",
                "sha256:8ad85f7f4e20964db4daadcab70b47ab05c7c1cf2a7c1e51087bfaa83831854c",
                "sha256:8c0ce1e99116d5ab21355d8ebe53d9460366704ea38ae4d9f6933188f327b456",
                "sha256:8d649d616e5c6a678b26d15ece345354f7c2286acd6db868e65fcc5ff7c24a77",
                "sha256:903500616422a40a98a5a3c4ff4ed9d0066f3b4c951fa286018ecdf0750194ef",
                "sha256:9736af4641846491aedb3c3f56b9bc5568d92b0692303b5a305301a95dfd38b1",
                "sha256:988635d122aaf2bdcef9e795435662bcd65b02f4f4c1ae37fbee7401c440b3a7",
                "sha256:9cca3c2cdadb362116235fdbd411735de4328c61425b0aa9f872fd76d02c4e86",
                "sha256:9e0fd32e0148dd5dea6af5fee42beb949098564cc23211a88d799e434255a1f4",
                "sha256:9f3e6f9e05148ff90002b884fbc2a86bd303ae847e472f44ecc06c2cd2fcdb2d",
                "sha256:a85d2b46be66a71bedde836d9e41859879cc54a2a04fad1191eb50c2066f6e9d",
                "sha256:a9a52172be0b5aae932bef82a79ec0a0ce87288c7d132946d645eba03f0ad8a8",
                "sha256:aa31fdcc33fef9eb2552cbcbfee7773d5a6792c137b359e82879c101e98584c5",
                "sha256:b014c23646a467558be7da3d6b9fa409b2c567d2110599b7cf9a0c5992b3b471",
                "sha256:b21bb4c09ffabfa0e85e3a6b623e19b80e7acd709b9f91452b8297ace2a8ab00",
                "sha256:b5901a312f4d14c59918c221323068fad0540e34324925c8475263841dbdfe68",
                "sha256:b9b7a708dd92306328117d8c4b62e2194d00c365f18eff11a9b53c6f923b01e3",
                "sha256:d1967f46ea8f2db647c786e78d8cc7e4313dbd1b0aca360592d8027b8508e24d",
                "sha256:d52a25136894c63de15a35bc0bdc5adb4b0e173b9c0d07a2be9d3ca64a332735",
                "sha256:d77c85fedff92cf788face9bfa3ebaa364448ebb1d765302e9af11bf449ca36d",
                "sha256:d79d7d5dc8a32b7093e81e97dad755127ff77bcc899e845f41bf71747af0c569",
                "sha256:dbcda74c67263139358f4d188ae5faae95c30929281bc6866d00573783c422b7",
                "sha256:ddaea91abf8b0d13443f6dac52e89051a5063c7d014710dcb4d4abb2ff811a59",
                "sha256:dee0ce50c6a2dd9056c20db781e9c1cfd33e77d2d569f5d1d9321c641bb903d5",
                "sha256:dee60e1de1898bde3b238f18340eec6148986da0455d8ba7848d50470a7a32fb",
                "sha256:e2f83e18fe2f4c9e7db597e988f72712c0c3676d337d8b101f6758107c42425b",
                "sha256:e3fb1677c720409d5f671e39bac6c9e0e422584e5f518bfd50aa4cbbea02433f",
                "sha256:ee2b1b1769f6707a8a445162ea16dddf74285c3964f605877a20e38545c3c462",
                "sha256:ee6acae74a2b91865910eef5e7de37dc6895ad96fa23603d1d27ea69df545015",
                "sha256:ef3f72c9666bba2bab70d2a8b79f2c6d2c1a42a7f7e2b0ec83bb2f9e383950af"
            ],
            "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'",
            "version": "==1.14.1"
        }
    }
}

Pipfile METASEP
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]
django = "*"
djangorestframework = "*"
django-loginas = "*"
django-grappelli = "*"
django-model-utils = "*"
pre-commit = "*"
django-money = "*"
django-cors-headers = "*"
jsonfield = "*"
djangorestframework-api-key = "==2.*"

[dev-packages]
pylint = "*"

[requires]
python_version = "3.9"

billing/tests/tests.py METASEP
from django.test import TestCase

# Create your tests here.

billing/tests/test_track.py METASEP
from django.test import TestCase, Client
from ..models import Customer, Event
import uuid
import json
from django.urls import reverse
from rest_framework import status
from django.core.serializers.json import DjangoJSONEncoder


from ..track import track_event


class TrackEventTest(TestCase):
    """
    Testcases for the track_event function view.
    """

    def setUp(self):

        Customer.objects.create(external_id="7fa09280-957c-4a5f-925a-6a3498a1d299")

        self.client = Client()
        idempotency_id = uuid.uuid4()

        self.valid_payload = {
            "event_name": "Emails",
            "properties": {"email": ""},
            "idempotency_id": idempotency_id,
            "time_created": "2022-07-25T01:11:42.535Z",
            "customer_id": "7fa09280-957c-4a5f-925a-6a3498a1d299",
        }
        self.invalid_payload = {
            "event_name": "Emails",
            "properties": {"email": ""},
            "idempotency_id": idempotency_id,
            "time_created": "2022-07-25T01:11:42.535Z",
            "customer_id": "7fa09280-957c-3w5f-925a-6a3498a1d299",
        }

    def test_track_event_if_customer_does_not_exist(self):
        """
        Test that track_event returns bad request with message "Customer does not exist" if the customer's external_id does not exist in the database.
        """
        response = self.client.post(
            reverse("track_event"),
            data=json.dumps(self.invalid_payload, cls=DjangoJSONEncoder),
            content_type="application/json",
        )
        self.assertEqual(response.message, "Customer does not exist")

        self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST)

    def test_valid_track_event_creates_event(self):
        """
        Test that track_event creates an event in the database.
        """
        self.assertEqual(
            Event.objects.all()
            .filter(idempotency_id=self.valid_payload["idempotency_id"])
            .count(),
            0,
        )
        response = self.client.post(
            reverse("track_event"),
            data=json.dumps(self.valid_payload, cls=DjangoJSONEncoder),
            content_type="application/json",
        )
        self.assertEqual(response.status_code, 200)
        self.assertEqual(
            Event.objects.all()
            .filter(idempotency_id=self.valid_payload["idempotency_id"])
            .count(),
            1,
        )

billing/tests/__init__.py METASEP

manage.py METASEP
#!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys


def main():
    """Run administrative tasks."""
    os.environ.setdefault("DJANGO_SETTINGS_MODULE", "lotus.settings")
    try:
        from django.core.management import execute_from_command_line
    except ImportError as exc:
        raise ImportError(
            "Couldn't import Django. Are you sure it's installed and "
            "available on your PYTHONPATH environment variable? Did you "
            "forget to activate a virtual environment?"
        ) from exc
    execute_from_command_line(sys.argv)


if __name__ == "__main__":
    main()

billing/views.py METASEP
from django.shortcuts import render
from django.forms.models import model_to_dict
from .models import Customer, Event
from .serializers import EventSerializer
from rest_framework import viewsets
from rest_framework_api_key.permissions import HasAPIKey


# Create your views here.


class EventViewSet(viewsets.ModelViewSet):
    queryset = Event.objects.all()
    serializer_class = EventSerializer

billing/track.py METASEP
from re import S
from .models import Event, Customer, BillingPlan
from django.http import HttpResponse, HttpResponseBadRequest, JsonResponse, HttpRequest
from django.contrib.auth.models import User
from rest_framework.authtoken.models import Token
from django.db import IntegrityError
from django.views.decorators.csrf import csrf_exempt
import json
import base64
from urllib.parse import urlparse
from typing import Dict, Union, List
from rest_framework.decorators import permission_classes
from rest_framework_api_key.permissions import HasAPIKey
from rest_framework.permissions import IsAuthenticated


def load_event(request: HttpRequest) -> Union[None, Dict]:
    """
    Loads an event from the request body.
    """
    if request.method != "POST":
        event_data = request.GET.get("data")
    else:

        if request.content_type == "application/json":
            event_data = request.body
        else:
            event_data = request.POST

    if event_data is None:
        return None
    if not isinstance(event_data, str):
        return event_data

    try:
        event_data = json.load(event_data)

    except json.JSONDecodeError:
        # if not, it's probably base64 encoded from other libraries
        event_data = json.load(
            base64.b64decode(event_data + "===")
            .decode("utf8", "surrogatepass")
            .encode("utf-16", "surrogatepass")
        )
    print(type(event_data))
    return event_data


def ingest_event(request, data: dict, customer: Customer) -> None:

    db_event = Event.objects.create(
        event_name=data["event_name"],
        idempotency_id=data["idempotency_id"],
        properties=data["properties"],
        customer=customer,
        time_created=data["time_created"],
    )
    db_event.save()


@csrf_exempt
@permission_classes((HasAPIKey))
def track_event(request):
    print(request.headers)
    data = load_event(request)
    if not data:
        return HttpResponseBadRequest("No data provided")
    # token = _get_token(data, request)
    # if not token  :
    #     return HttpResponseBadRequest("No api_key set")
    print(data)
    customer_id = data["customer_id"]
    try:
        customer = Customer.objects.get(external_id=customer_id)
    except Customer.DoesNotExist:
        return HttpResponseBadRequest("Customer does not exist")

    if isinstance(data, list):
        for i in data:
            try:
                ingest_event(request=request, data=i, customer=customer)
            except KeyError:
                return JsonResponse(
                    {
                        "code": "validation",
                        "message": "You need to set a distinct_id.",
                        "item": data,
                    },
                    status=400,
                )
    else:
        ingest_event(request=request, data=data, customer=customer)

    return JsonResponse({"status": "Success"}, status=200)

billing/serializers.py METASEP
from rest_framework import serializers

from .models import Event, Customer


class EventSerializer(serializers.HyperlinkedModelSerializer):
    class Meta:
        model = Event
        fields = (
            "customer",
            "event_name",
            "time_created",
            "properties",
            "idempotency_id",
        )


class CustomerSerializer(serializers.HyperlinkedModelSerializer):
    class Meta:
        model = Customer
        fields = (
            "first_name",
            "last_name",
            "company_name",
            "external_id",
            "billing_id",
        )

billing/models.py METASEP
from operator import mod
from django.db import models
import uuid
from model_utils import Choices
from djmoney.models.fields import MoneyField
from django.contrib.auth.models import AbstractUser, BaseUserManager
from django.utils.translation import gettext_lazy as _
from djmoney.models.fields import MoneyField
import jsonfield

# Create your models here.

# Customer Model, Attempt 1
class Customer(models.Model):
    """
    Customer object. An explanation of the Customer's fields follows:
    first_name: self-explanatory
    last_name: self-explanatory
    billing_id: internal billing system identifier
    external_id: customer's id within the users backend system
    billing_address: currently set to null, but we will need to set this to an "address" object later
    company_name: self-explanatory
    email_address: self-explanatory
    phone_number: self-explanatory
    """

    first_name = models.CharField(max_length=30)  # 30 characters is arbitrary
    last_name = models.CharField(max_length=30)

    company_name = models.CharField(max_length=30, default=" ")
    external_id = models.CharField(max_length=40, default=" ")
    billing_id = models.CharField(max_length=40, default=uuid.uuid4)

    # # auto generated when I typed "__init__, not sure what all this stuff is"


#    def __init__(self: _Self, *args, **kwargs) -> None:
#        super().__init__(*args, **kwargs)


class Event(models.Model):
    """
    Event object. An explanation of the Event's fields follows:
    event_name: The type of event that occurred.
    time_created: The time at which the event occurred.
    customer: The customer that the event occurred to.
    idempotency_id: A unique identifier for the event.
    """

    customer: models.ForeignKey = models.ForeignKey(
        Customer, on_delete=models.CASCADE, null=False
    )
    event_name = models.CharField(max_length=200, null=False)
    time_created: models.CharField = models.CharField(max_length=100)
    properties: models.JSONField = models.JSONField(default=dict)
    idempotency_id: models.CharField = models.CharField(max_length=255, unique=True)

    class Meta:
        ordering = ["idempotency_id"]

    def __str__(self):
        return str(self.event_name) + "-" + str(self.idempotency_id)


class BillingPlan(models.Model):
    """
    AGGREGATION_CHOICES: TODO
    Billing_ID: Id for this specific plan
    time_created: self-explanatory
    currency: self-explanatory
    interval: determines whether plan charges weekly, monthly, or yearly
    base_rate: amount to charge every week, month, or year (depending on choice of interval)
    billable_metrics: a json containing a list of billable_metrics objects
    """

    class AGGREGATION_TYPES(object):
        COUNT = "count"
        SUM = "sum"
        MAX = "max"

    AGGREGATION_CHOICES = Choices(
        (AGGREGATION_TYPES.COUNT, _("Count")),
        (AGGREGATION_TYPES.SUM, _("Sum")),
        (AGGREGATION_TYPES.MAX, _("Max")),
    )

    billing_id = models.CharField(
        max_length=36, blank=True, unique=True, default=uuid.uuid4
    )

    time_created = models.TimeField()
    currency = models.CharField(max_length=30, default="USD")  # 30 is arbitrary

    INTERVAL_CHOICES = Choices(
        ("week", _("Week")),
        ("month", _("Month")),
        ("year", _("Year")),
    )

    interval = models.CharField(
        max_length=5,
        choices=INTERVAL_CHOICES,
        default=INTERVAL_CHOICES.month,
    )

    # these are somewhat arbitrary, gotta look into these later
    base_rate = MoneyField(
        decimal_places=2, max_digits=8, default_currency="USD", default=0.0
    )

    # we may need to specify that the json will contain
    # BillableMetrics objects, but I'm not sure
    billable_metrics = jsonfield.JSONField(default=list)

    description = models.CharField(max_length=256, default=" ")

billing/apps.py METASEP
from django.apps import AppConfig


class BillingConfig(AppConfig):
    default_auto_field = "django.db.models.BigAutoField"
    name = "billing"

billing/admin.py METASEP
from django.contrib import admin
from .models import BillingPlan, Customer, Event

# Register your models here.
admin.site.register(Customer)
admin.site.register(Event)
admin.site.register(BillingPlan)

billing/__init__.py METASEP

billing/migrations/__init__.py METASEP

billing/migrations/0006_alter_event_options_event_idempotency_id.py METASEP
# Generated by Django 4.0.6 on 2022-07-24 21:13

from django.db import migrations, models


class Migration(migrations.Migration):

    dependencies = [
        ("billing", "0005_alter_customer_billing_id"),
    ]

    operations = [
        migrations.AlterModelOptions(
            name="event",
            options={"ordering": ["idempotency_id"]},
        ),
        migrations.AddField(
            model_name="event",
            name="idempotency_id",
            field=models.CharField(default=0, max_length=255, unique=True),
            preserve_default=False,
        ),
    ]

billing/migrations/0005_alter_customer_billing_id.py METASEP
# Generated by Django 4.0.6 on 2022-07-24 21:00

from django.db import migrations, models
import uuid


class Migration(migrations.Migration):

    dependencies = [
        ("billing", "0004_customer_billing_id_customer_external_id"),
    ]

    operations = [
        migrations.AlterField(
            model_name="customer",
            name="billing_id",
            field=models.CharField(default=uuid.uuid4, max_length=40),
        ),
    ]

billing/migrations/0004_customer_billing_id_customer_external_id.py METASEP
# Generated by Django 4.0.6 on 2022-07-24 18:40

from django.db import migrations, models


class Migration(migrations.Migration):

    dependencies = [
        (
            "billing",
            "0003_remove_billingplan_active_remove_billingplan_amount_and_more",
        ),
    ]

    operations = [
        migrations.AddField(
            model_name="customer",
            name="billing_id",
            field=models.CharField(default=" ", max_length=40),
        ),
        migrations.AddField(
            model_name="customer",
            name="external_id",
            field=models.CharField(default=" ", max_length=40),
        ),
    ]

billing/migrations/0003_remove_billingplan_active_remove_billingplan_amount_and_more.py METASEP
# Generated by Django 4.0.6 on 2022-07-24 01:56

from decimal import Decimal
from django.db import migrations, models
import djmoney.models.fields
import jsonfield.fields


class Migration(migrations.Migration):

    dependencies = [
        ("billing", "0002_rename_system_id_customer_external_id_and_more"),
    ]

    operations = [
        migrations.RemoveField(
            model_name="billingplan",
            name="active",
        ),
        migrations.RemoveField(
            model_name="billingplan",
            name="amount",
        ),
        migrations.RemoveField(
            model_name="billingplan",
            name="amount_decimal",
        ),
        migrations.RemoveField(
            model_name="billingplan",
            name="billing_scheme",
        ),
        migrations.RemoveField(
            model_name="billingplan",
            name="interval_count",
        ),
        migrations.RemoveField(
            model_name="billingplan",
            name="nickname",
        ),
        migrations.RemoveField(
            model_name="billingplan",
            name="product",
        ),
        migrations.RemoveField(
            model_name="billingplan",
            name="tiers_mode",
        ),
        migrations.RemoveField(
            model_name="billingplan",
            name="trial_period_days",
        ),
        migrations.RemoveField(
            model_name="billingplan",
            name="usage_type",
        ),
        migrations.RemoveField(
            model_name="customer",
            name="balance",
        ),
        migrations.RemoveField(
            model_name="customer",
            name="balance_currency",
        ),
        migrations.RemoveField(
            model_name="customer",
            name="billing_id",
        ),
        migrations.RemoveField(
            model_name="customer",
            name="email_address",
        ),
        migrations.RemoveField(
            model_name="customer",
            name="external_id",
        ),
        migrations.RemoveField(
            model_name="customer",
            name="invoice_prefix",
        ),
        migrations.RemoveField(
            model_name="customer",
            name="next_invoice_sequence",
        ),
        migrations.RemoveField(
            model_name="customer",
            name="phone_number",
        ),
        migrations.RemoveField(
            model_name="customer",
            name="tax_exempt",
        ),
        migrations.RemoveField(
            model_name="customer",
            name="time_created",
        ),
        migrations.AddField(
            model_name="billingplan",
            name="base_rate",
            field=djmoney.models.fields.MoneyField(
                decimal_places=2,
                default=Decimal("0.0"),
                default_currency="USD",
                max_digits=8,
            ),
        ),
        migrations.AddField(
            model_name="billingplan",
            name="base_rate_currency",
            field=djmoney.models.fields.CurrencyField(
                choices=[
                    ("XUA", "ADB Unit of Account"),
                    ("AFN", "Afghan Afghani"),
                    ("AFA", "Afghan Afghani (1927–2002)"),
                    ("ALL", "Albanian Lek"),
                    ("ALK", "Albanian Lek (1946–1965)"),
                    ("DZD", "Algerian Dinar"),
                    ("ADP", "Andorran Peseta"),
                    ("AOA", "Angolan Kwanza"),
                    ("AOK", "Angolan Kwanza (1977–1991)"),
                    ("AON", "Angolan New Kwanza (1990–2000)"),
                    ("AOR", "Angolan Readjusted Kwanza (1995–1999)"),
                    ("ARA", "Argentine Austral"),
                    ("ARS", "Argentine Peso"),
                    ("ARM", "Argentine Peso (1881–1970)"),
                    ("ARP", "Argentine Peso (1983–1985)"),
                    ("ARL", "Argentine Peso Ley (1970–1983)"),
                    ("AMD", "Armenian Dram"),
                    ("AWG", "Aruban Florin"),
                    ("AUD", "Australian Dollar"),
                    ("ATS", "Austrian Schilling"),
                    ("AZN", "Azerbaijani Manat"),
                    ("AZM", "Azerbaijani Manat (1993–2006)"),
                    ("BSD", "Bahamian Dollar"),
                    ("BHD", "Bahraini Dinar"),
                    ("BDT", "Bangladeshi Taka"),
                    ("BBD", "Barbadian Dollar"),
                    ("BYN", "Belarusian Ruble"),
                    ("BYB", "Belarusian Ruble (1994–1999)"),
                    ("BYR", "Belarusian Ruble (2000–2016)"),
                    ("BEF", "Belgian Franc"),
                    ("BEC", "Belgian Franc (convertible)"),
                    ("BEL", "Belgian Franc (financial)"),
                    ("BZD", "Belize Dollar"),
                    ("BMD", "Bermudan Dollar"),
                    ("BTN", "Bhutanese Ngultrum"),
                    ("BOB", "Bolivian Boliviano"),
                    ("BOL", "Bolivian Boliviano (1863–1963)"),
                    ("BOV", "Bolivian Mvdol"),
                    ("BOP", "Bolivian Peso"),
                    ("BAM", "Bosnia-Herzegovina Convertible Mark"),
                    ("BAD", "Bosnia-Herzegovina Dinar (1992–1994)"),
                    ("BAN", "Bosnia-Herzegovina New Dinar (1994–1997)"),
                    ("BWP", "Botswanan Pula"),
                    ("BRC", "Brazilian Cruzado (1986–1989)"),
                    ("BRZ", "Brazilian Cruzeiro (1942–1967)"),
                    ("BRE", "Brazilian Cruzeiro (1990–1993)"),
                    ("BRR", "Brazilian Cruzeiro (1993–1994)"),
                    ("BRN", "Brazilian New Cruzado (1989–1990)"),
                    ("BRB", "Brazilian New Cruzeiro (1967–1986)"),
                    ("BRL", "Brazilian Real"),
                    ("GBP", "British Pound"),
                    ("BND", "Brunei Dollar"),
                    ("BGL", "Bulgarian Hard Lev"),
                    ("BGN", "Bulgarian Lev"),
                    ("BGO", "Bulgarian Lev (1879–1952)"),
                    ("BGM", "Bulgarian Socialist Lev"),
                    ("BUK", "Burmese Kyat"),
                    ("BIF", "Burundian Franc"),
                    ("XPF", "CFP Franc"),
                    ("KHR", "Cambodian Riel"),
                    ("CAD", "Canadian Dollar"),
                    ("CVE", "Cape Verdean Escudo"),
                    ("KYD", "Cayman Islands Dollar"),
                    ("XAF", "Central African CFA Franc"),
                    ("CLE", "Chilean Escudo"),
                    ("CLP", "Chilean Peso"),
                    ("CLF", "Chilean Unit of Account (UF)"),
                    ("CNX", "Chinese People’s Bank Dollar"),
                    ("CNY", "Chinese Yuan"),
                    ("CNH", "Chinese Yuan (offshore)"),
                    ("COP", "Colombian Peso"),
                    ("COU", "Colombian Real Value Unit"),
                    ("KMF", "Comorian Franc"),
                    ("CDF", "Congolese Franc"),
                    ("CRC", "Costa Rican Colón"),
                    ("HRD", "Croatian Dinar"),
                    ("HRK", "Croatian Kuna"),
                    ("CUC", "Cuban Convertible Peso"),
                    ("CUP", "Cuban Peso"),
                    ("CYP", "Cypriot Pound"),
                    ("CZK", "Czech Koruna"),
                    ("CSK", "Czechoslovak Hard Koruna"),
                    ("DKK", "Danish Krone"),
                    ("DJF", "Djiboutian Franc"),
                    ("DOP", "Dominican Peso"),
                    ("NLG", "Dutch Guilder"),
                    ("XCD", "East Caribbean Dollar"),
                    ("DDM", "East German Mark"),
                    ("ECS", "Ecuadorian Sucre"),
                    ("ECV", "Ecuadorian Unit of Constant Value"),
                    ("EGP", "Egyptian Pound"),
                    ("GQE", "Equatorial Guinean Ekwele"),
                    ("ERN", "Eritrean Nakfa"),
                    ("EEK", "Estonian Kroon"),
                    ("ETB", "Ethiopian Birr"),
                    ("EUR", "Euro"),
                    ("XBA", "European Composite Unit"),
                    ("XEU", "European Currency Unit"),
                    ("XBB", "European Monetary Unit"),
                    ("XBC", "European Unit of Account (XBC)"),
                    ("XBD", "European Unit of Account (XBD)"),
                    ("FKP", "Falkland Islands Pound"),
                    ("FJD", "Fijian Dollar"),
                    ("FIM", "Finnish Markka"),
                    ("FRF", "French Franc"),
                    ("XFO", "French Gold Franc"),
                    ("XFU", "French UIC-Franc"),
                    ("GMD", "Gambian Dalasi"),
                    ("GEK", "Georgian Kupon Larit"),
                    ("GEL", "Georgian Lari"),
                    ("DEM", "German Mark"),
                    ("GHS", "Ghanaian Cedi"),
                    ("GHC", "Ghanaian Cedi (1979–2007)"),
                    ("GIP", "Gibraltar Pound"),
                    ("XAU", "Gold"),
                    ("GRD", "Greek Drachma"),
                    ("GTQ", "Guatemalan Quetzal"),
                    ("GWP", "Guinea-Bissau Peso"),
                    ("GNF", "Guinean Franc"),
                    ("GNS", "Guinean Syli"),
                    ("GYD", "Guyanaese Dollar"),
                    ("HTG", "Haitian Gourde"),
                    ("HNL", "Honduran Lempira"),
                    ("HKD", "Hong Kong Dollar"),
                    ("HUF", "Hungarian Forint"),
                    ("IMP", "IMP"),
                    ("ISK", "Icelandic Króna"),
                    ("ISJ", "Icelandic Króna (1918–1981)"),
                    ("INR", "Indian Rupee"),
                    ("IDR", "Indonesian Rupiah"),
                    ("IRR", "Iranian Rial"),
                    ("IQD", "Iraqi Dinar"),
                    ("IEP", "Irish Pound"),
                    ("ILS", "Israeli New Shekel"),
                    ("ILP", "Israeli Pound"),
                    ("ILR", "Israeli Shekel (1980–1985)"),
                    ("ITL", "Italian Lira"),
                    ("JMD", "Jamaican Dollar"),
                    ("JPY", "Japanese Yen"),
                    ("JOD", "Jordanian Dinar"),
                    ("KZT", "Kazakhstani Tenge"),
                    ("KES", "Kenyan Shilling"),
                    ("KWD", "Kuwaiti Dinar"),
                    ("KGS", "Kyrgystani Som"),
                    ("LAK", "Laotian Kip"),
                    ("LVL", "Latvian Lats"),
                    ("LVR", "Latvian Ruble"),
                    ("LBP", "Lebanese Pound"),
                    ("LSL", "Lesotho Loti"),
                    ("LRD", "Liberian Dollar"),
                    ("LYD", "Libyan Dinar"),
                    ("LTL", "Lithuanian Litas"),
                    ("LTT", "Lithuanian Talonas"),
                    ("LUL", "Luxembourg Financial Franc"),
                    ("LUC", "Luxembourgian Convertible Franc"),
                    ("LUF", "Luxembourgian Franc"),
                    ("MOP", "Macanese Pataca"),
                    ("MKD", "Macedonian Denar"),
                    ("MKN", "Macedonian Denar (1992–1993)"),
                    ("MGA", "Malagasy Ariary"),
                    ("MGF", "Malagasy Franc"),
                    ("MWK", "Malawian Kwacha"),
                    ("MYR", "Malaysian Ringgit"),
                    ("MVR", "Maldivian Rufiyaa"),
                    ("MVP", "Maldivian Rupee (1947–1981)"),
                    ("MLF", "Malian Franc"),
                    ("MTL", "Maltese Lira"),
                    ("MTP", "Maltese Pound"),
                    ("MRU", "Mauritanian Ouguiya"),
                    ("MRO", "Mauritanian Ouguiya (1973–2017)"),
                    ("MUR", "Mauritian Rupee"),
                    ("MXV", "Mexican Investment Unit"),
                    ("MXN", "Mexican Peso"),
                    ("MXP", "Mexican Silver Peso (1861–1992)"),
                    ("MDC", "Moldovan Cupon"),
                    ("MDL", "Moldovan Leu"),
                    ("MCF", "Monegasque Franc"),
                    ("MNT", "Mongolian Tugrik"),
                    ("MAD", "Moroccan Dirham"),
                    ("MAF", "Moroccan Franc"),
                    ("MZE", "Mozambican Escudo"),
                    ("MZN", "Mozambican Metical"),
                    ("MZM", "Mozambican Metical (1980–2006)"),
                    ("MMK", "Myanmar Kyat"),
                    ("NAD", "Namibian Dollar"),
                    ("NPR", "Nepalese Rupee"),
                    ("ANG", "Netherlands Antillean Guilder"),
                    ("TWD", "New Taiwan Dollar"),
                    ("NZD", "New Zealand Dollar"),
                    ("NIO", "Nicaraguan Córdoba"),
                    ("NIC", "Nicaraguan Córdoba (1988–1991)"),
                    ("NGN", "Nigerian Naira"),
                    ("KPW", "North Korean Won"),
                    ("NOK", "Norwegian Krone"),
                    ("OMR", "Omani Rial"),
                    ("PKR", "Pakistani Rupee"),
                    ("XPD", "Palladium"),
                    ("PAB", "Panamanian Balboa"),
                    ("PGK", "Papua New Guinean Kina"),
                    ("PYG", "Paraguayan Guarani"),
                    ("PEI", "Peruvian Inti"),
                    ("PEN", "Peruvian Sol"),
                    ("PES", "Peruvian Sol (1863–1965)"),
                    ("PHP", "Philippine Peso"),
                    ("XPT", "Platinum"),
                    ("PLN", "Polish Zloty"),
                    ("PLZ", "Polish Zloty (1950–1995)"),
                    ("PTE", "Portuguese Escudo"),
                    ("GWE", "Portuguese Guinea Escudo"),
                    ("QAR", "Qatari Rial"),
                    ("XRE", "RINET Funds"),
                    ("RHD", "Rhodesian Dollar"),
                    ("RON", "Romanian Leu"),
                    ("ROL", "Romanian Leu (1952–2006)"),
                    ("RUB", "Russian Ruble"),
                    ("RUR", "Russian Ruble (1991–1998)"),
                    ("RWF", "Rwandan Franc"),
                    ("SVC", "Salvadoran Colón"),
                    ("WST", "Samoan Tala"),
                    ("SAR", "Saudi Riyal"),
                    ("RSD", "Serbian Dinar"),
                    ("CSD", "Serbian Dinar (2002–2006)"),
                    ("SCR", "Seychellois Rupee"),
                    ("SLL", "Sierra Leonean Leone"),
                    ("XAG", "Silver"),
                    ("SGD", "Singapore Dollar"),
                    ("SKK", "Slovak Koruna"),
                    ("SIT", "Slovenian Tolar"),
                    ("SBD", "Solomon Islands Dollar"),
                    ("SOS", "Somali Shilling"),
                    ("ZAR", "South African Rand"),
                    ("ZAL", "South African Rand (financial)"),
                    ("KRH", "South Korean Hwan (1953–1962)"),
                    ("KRW", "South Korean Won"),
                    ("KRO", "South Korean Won (1945–1953)"),
                    ("SSP", "South Sudanese Pound"),
                    ("SUR", "Soviet Rouble"),
                    ("ESP", "Spanish Peseta"),
                    ("ESA", "Spanish Peseta (A account)"),
                    ("ESB", "Spanish Peseta (convertible account)"),
                    ("XDR", "Special Drawing Rights"),
                    ("LKR", "Sri Lankan Rupee"),
                    ("SHP", "St. Helena Pound"),
                    ("XSU", "Sucre"),
                    ("SDD", "Sudanese Dinar (1992–2007)"),
                    ("SDG", "Sudanese Pound"),
                    ("SDP", "Sudanese Pound (1957–1998)"),
                    ("SRD", "Surinamese Dollar"),
                    ("SRG", "Surinamese Guilder"),
                    ("SZL", "Swazi Lilangeni"),
                    ("SEK", "Swedish Krona"),
                    ("CHF", "Swiss Franc"),
                    ("SYP", "Syrian Pound"),
                    ("STN", "São Tomé & Príncipe Dobra"),
                    ("STD", "São Tomé & Príncipe Dobra (1977–2017)"),
                    ("TVD", "TVD"),
                    ("TJR", "Tajikistani Ruble"),
                    ("TJS", "Tajikistani Somoni"),
                    ("TZS", "Tanzanian Shilling"),
                    ("XTS", "Testing Currency Code"),
                    ("THB", "Thai Baht"),
                    (
                        "XXX",
                        "The codes assigned for transactions where no currency is involved",
                    ),
                    ("TPE", "Timorese Escudo"),
                    ("TOP", "Tongan Paʻanga"),
                    ("TTD", "Trinidad & Tobago Dollar"),
                    ("TND", "Tunisian Dinar"),
                    ("TRY", "Turkish Lira"),
                    ("TRL", "Turkish Lira (1922–2005)"),
                    ("TMT", "Turkmenistani Manat"),
                    ("TMM", "Turkmenistani Manat (1993–2009)"),
                    ("USD", "US Dollar"),
                    ("USN", "US Dollar (Next day)"),
                    ("USS", "US Dollar (Same day)"),
                    ("UGX", "Ugandan Shilling"),
                    ("UGS", "Ugandan Shilling (1966–1987)"),
                    ("UAH", "Ukrainian Hryvnia"),
                    ("UAK", "Ukrainian Karbovanets"),
                    ("AED", "United Arab Emirates Dirham"),
                    ("UYW", "Uruguayan Nominal Wage Index Unit"),
                    ("UYU", "Uruguayan Peso"),
                    ("UYP", "Uruguayan Peso (1975–1993)"),
                    ("UYI", "Uruguayan Peso (Indexed Units)"),
                    ("UZS", "Uzbekistani Som"),
                    ("VUV", "Vanuatu Vatu"),
                    ("VES", "Venezuelan Bolívar"),
                    ("VEB", "Venezuelan Bolívar (1871–2008)"),
                    ("VEF", "Venezuelan Bolívar (2008–2018)"),
                    ("VND", "Vietnamese Dong"),
                    ("VNN", "Vietnamese Dong (1978–1985)"),
                    ("CHE", "WIR Euro"),
                    ("CHW", "WIR Franc"),
                    ("XOF", "West African CFA Franc"),
                    ("YDD", "Yemeni Dinar"),
                    ("YER", "Yemeni Rial"),
                    ("YUN", "Yugoslavian Convertible Dinar (1990–1992)"),
                    ("YUD", "Yugoslavian Hard Dinar (1966–1990)"),
                    ("YUM", "Yugoslavian New Dinar (1994–2002)"),
                    ("YUR", "Yugoslavian Reformed Dinar (1992–1993)"),
                    ("ZWN", "ZWN"),
                    ("ZRN", "Zairean New Zaire (1993–1998)"),
                    ("ZRZ", "Zairean Zaire (1971–1993)"),
                    ("ZMW", "Zambian Kwacha"),
                    ("ZMK", "Zambian Kwacha (1968–2012)"),
                    ("ZWD", "Zimbabwean Dollar (1980–2008)"),
                    ("ZWR", "Zimbabwean Dollar (2008)"),
                    ("ZWL", "Zimbabwean Dollar (2009)"),
                ],
                default="USD",
                editable=False,
                max_length=3,
            ),
        ),
        migrations.AddField(
            model_name="billingplan",
            name="billable_metrics",
            field=jsonfield.fields.JSONField(default=list),
        ),
        migrations.AddField(
            model_name="billingplan",
            name="currency",
            field=models.CharField(default="USD", max_length=30),
        ),
        migrations.AddField(
            model_name="billingplan",
            name="description",
            field=models.CharField(default=" ", max_length=256),
        ),
        migrations.AddField(
            model_name="customer",
            name="company_name",
            field=models.CharField(default=" ", max_length=30),
        ),
    ]

billing/migrations/0002_rename_system_id_customer_external_id_and_more.py METASEP
# Generated by Django 4.0.6 on 2022-07-23 20:49

from decimal import Decimal
from django.db import migrations, models
import djmoney.models.fields


class Migration(migrations.Migration):

    dependencies = [
        ("billing", "0001_initial"),
    ]

    operations = [
        migrations.RenameField(
            model_name="customer",
            old_name="system_id",
            new_name="external_id",
        ),
        migrations.RemoveField(
            model_name="customer",
            name="default_payment_source",
        ),
        migrations.AddField(
            model_name="customer",
            name="balance",
            field=djmoney.models.fields.MoneyField(
                decimal_places=2,
                default=Decimal("0"),
                default_currency="USD",
                max_digits=11,
            ),
        ),
        migrations.AddField(
            model_name="customer",
            name="balance_currency",
            field=djmoney.models.fields.CurrencyField(
                choices=[
                    ("XUA", "ADB Unit of Account"),
                    ("AFN", "Afghan Afghani"),
                    ("AFA", "Afghan Afghani (1927–2002)"),
                    ("ALL", "Albanian Lek"),
                    ("ALK", "Albanian Lek (1946–1965)"),
                    ("DZD", "Algerian Dinar"),
                    ("ADP", "Andorran Peseta"),
                    ("AOA", "Angolan Kwanza"),
                    ("AOK", "Angolan Kwanza (1977–1991)"),
                    ("AON", "Angolan New Kwanza (1990–2000)"),
                    ("AOR", "Angolan Readjusted Kwanza (1995–1999)"),
                    ("ARA", "Argentine Austral"),
                    ("ARS", "Argentine Peso"),
                    ("ARM", "Argentine Peso (1881–1970)"),
                    ("ARP", "Argentine Peso (1983–1985)"),
                    ("ARL", "Argentine Peso Ley (1970–1983)"),
                    ("AMD", "Armenian Dram"),
                    ("AWG", "Aruban Florin"),
                    ("AUD", "Australian Dollar"),
                    ("ATS", "Austrian Schilling"),
                    ("AZN", "Azerbaijani Manat"),
                    ("AZM", "Azerbaijani Manat (1993–2006)"),
                    ("BSD", "Bahamian Dollar"),
                    ("BHD", "Bahraini Dinar"),
                    ("BDT", "Bangladeshi Taka"),
                    ("BBD", "Barbadian Dollar"),
                    ("BYN", "Belarusian Ruble"),
                    ("BYB", "Belarusian Ruble (1994–1999)"),
                    ("BYR", "Belarusian Ruble (2000–2016)"),
                    ("BEF", "Belgian Franc"),
                    ("BEC", "Belgian Franc (convertible)"),
                    ("BEL", "Belgian Franc (financial)"),
                    ("BZD", "Belize Dollar"),
                    ("BMD", "Bermudan Dollar"),
                    ("BTN", "Bhutanese Ngultrum"),
                    ("BOB", "Bolivian Boliviano"),
                    ("BOL", "Bolivian Boliviano (1863–1963)"),
                    ("BOV", "Bolivian Mvdol"),
                    ("BOP", "Bolivian Peso"),
                    ("BAM", "Bosnia-Herzegovina Convertible Mark"),
                    ("BAD", "Bosnia-Herzegovina Dinar (1992–1994)"),
                    ("BAN", "Bosnia-Herzegovina New Dinar (1994–1997)"),
                    ("BWP", "Botswanan Pula"),
                    ("BRC", "Brazilian Cruzado (1986–1989)"),
                    ("BRZ", "Brazilian Cruzeiro (1942–1967)"),
                    ("BRE", "Brazilian Cruzeiro (1990–1993)"),
                    ("BRR", "Brazilian Cruzeiro (1993–1994)"),
                    ("BRN", "Brazilian New Cruzado (1989–1990)"),
                    ("BRB", "Brazilian New Cruzeiro (1967–1986)"),
                    ("BRL", "Brazilian Real"),
                    ("GBP", "British Pound"),
                    ("BND", "Brunei Dollar"),
                    ("BGL", "Bulgarian Hard Lev"),
                    ("BGN", "Bulgarian Lev"),
                    ("BGO", "Bulgarian Lev (1879–1952)"),
                    ("BGM", "Bulgarian Socialist Lev"),
                    ("BUK", "Burmese Kyat"),
                    ("BIF", "Burundian Franc"),
                    ("XPF", "CFP Franc"),
                    ("KHR", "Cambodian Riel"),
                    ("CAD", "Canadian Dollar"),
                    ("CVE", "Cape Verdean Escudo"),
                    ("KYD", "Cayman Islands Dollar"),
                    ("XAF", "Central African CFA Franc"),
                    ("CLE", "Chilean Escudo"),
                    ("CLP", "Chilean Peso"),
                    ("CLF", "Chilean Unit of Account (UF)"),
                    ("CNX", "Chinese People’s Bank Dollar"),
                    ("CNY", "Chinese Yuan"),
                    ("CNH", "Chinese Yuan (offshore)"),
                    ("COP", "Colombian Peso"),
                    ("COU", "Colombian Real Value Unit"),
                    ("KMF", "Comorian Franc"),
                    ("CDF", "Congolese Franc"),
                    ("CRC", "Costa Rican Colón"),
                    ("HRD", "Croatian Dinar"),
                    ("HRK", "Croatian Kuna"),
                    ("CUC", "Cuban Convertible Peso"),
                    ("CUP", "Cuban Peso"),
                    ("CYP", "Cypriot Pound"),
                    ("CZK", "Czech Koruna"),
                    ("CSK", "Czechoslovak Hard Koruna"),
                    ("DKK", "Danish Krone"),
                    ("DJF", "Djiboutian Franc"),
                    ("DOP", "Dominican Peso"),
                    ("NLG", "Dutch Guilder"),
                    ("XCD", "East Caribbean Dollar"),
                    ("DDM", "East German Mark"),
                    ("ECS", "Ecuadorian Sucre"),
                    ("ECV", "Ecuadorian Unit of Constant Value"),
                    ("EGP", "Egyptian Pound"),
                    ("GQE", "Equatorial Guinean Ekwele"),
                    ("ERN", "Eritrean Nakfa"),
                    ("EEK", "Estonian Kroon"),
                    ("ETB", "Ethiopian Birr"),
                    ("EUR", "Euro"),
                    ("XBA", "European Composite Unit"),
                    ("XEU", "European Currency Unit"),
                    ("XBB", "European Monetary Unit"),
                    ("XBC", "European Unit of Account (XBC)"),
                    ("XBD", "European Unit of Account (XBD)"),
                    ("FKP", "Falkland Islands Pound"),
                    ("FJD", "Fijian Dollar"),
                    ("FIM", "Finnish Markka"),
                    ("FRF", "French Franc"),
                    ("XFO", "French Gold Franc"),
                    ("XFU", "French UIC-Franc"),
                    ("GMD", "Gambian Dalasi"),
                    ("GEK", "Georgian Kupon Larit"),
                    ("GEL", "Georgian Lari"),
                    ("DEM", "German Mark"),
                    ("GHS", "Ghanaian Cedi"),
                    ("GHC", "Ghanaian Cedi (1979–2007)"),
                    ("GIP", "Gibraltar Pound"),
                    ("XAU", "Gold"),
                    ("GRD", "Greek Drachma"),
                    ("GTQ", "Guatemalan Quetzal"),
                    ("GWP", "Guinea-Bissau Peso"),
                    ("GNF", "Guinean Franc"),
                    ("GNS", "Guinean Syli"),
                    ("GYD", "Guyanaese Dollar"),
                    ("HTG", "Haitian Gourde"),
                    ("HNL", "Honduran Lempira"),
                    ("HKD", "Hong Kong Dollar"),
                    ("HUF", "Hungarian Forint"),
                    ("IMP", "IMP"),
                    ("ISK", "Icelandic Króna"),
                    ("ISJ", "Icelandic Króna (1918–1981)"),
                    ("INR", "Indian Rupee"),
                    ("IDR", "Indonesian Rupiah"),
                    ("IRR", "Iranian Rial"),
                    ("IQD", "Iraqi Dinar"),
                    ("IEP", "Irish Pound"),
                    ("ILS", "Israeli New Shekel"),
                    ("ILP", "Israeli Pound"),
                    ("ILR", "Israeli Shekel (1980–1985)"),
                    ("ITL", "Italian Lira"),
                    ("JMD", "Jamaican Dollar"),
                    ("JPY", "Japanese Yen"),
                    ("JOD", "Jordanian Dinar"),
                    ("KZT", "Kazakhstani Tenge"),
                    ("KES", "Kenyan Shilling"),
                    ("KWD", "Kuwaiti Dinar"),
                    ("KGS", "Kyrgystani Som"),
                    ("LAK", "Laotian Kip"),
                    ("LVL", "Latvian Lats"),
                    ("LVR", "Latvian Ruble"),
                    ("LBP", "Lebanese Pound"),
                    ("LSL", "Lesotho Loti"),
                    ("LRD", "Liberian Dollar"),
                    ("LYD", "Libyan Dinar"),
                    ("LTL", "Lithuanian Litas"),
                    ("LTT", "Lithuanian Talonas"),
                    ("LUL", "Luxembourg Financial Franc"),
                    ("LUC", "Luxembourgian Convertible Franc"),
                    ("LUF", "Luxembourgian Franc"),
                    ("MOP", "Macanese Pataca"),
                    ("MKD", "Macedonian Denar"),
                    ("MKN", "Macedonian Denar (1992–1993)"),
                    ("MGA", "Malagasy Ariary"),
                    ("MGF", "Malagasy Franc"),
                    ("MWK", "Malawian Kwacha"),
                    ("MYR", "Malaysian Ringgit"),
                    ("MVR", "Maldivian Rufiyaa"),
                    ("MVP", "Maldivian Rupee (1947–1981)"),
                    ("MLF", "Malian Franc"),
                    ("MTL", "Maltese Lira"),
                    ("MTP", "Maltese Pound"),
                    ("MRU", "Mauritanian Ouguiya"),
                    ("MRO", "Mauritanian Ouguiya (1973–2017)"),
                    ("MUR", "Mauritian Rupee"),
                    ("MXV", "Mexican Investment Unit"),
                    ("MXN", "Mexican Peso"),
                    ("MXP", "Mexican Silver Peso (1861–1992)"),
                    ("MDC", "Moldovan Cupon"),
                    ("MDL", "Moldovan Leu"),
                    ("MCF", "Monegasque Franc"),
                    ("MNT", "Mongolian Tugrik"),
                    ("MAD", "Moroccan Dirham"),
                    ("MAF", "Moroccan Franc"),
                    ("MZE", "Mozambican Escudo"),
                    ("MZN", "Mozambican Metical"),
                    ("MZM", "Mozambican Metical (1980–2006)"),
                    ("MMK", "Myanmar Kyat"),
                    ("NAD", "Namibian Dollar"),
                    ("NPR", "Nepalese Rupee"),
                    ("ANG", "Netherlands Antillean Guilder"),
                    ("TWD", "New Taiwan Dollar"),
                    ("NZD", "New Zealand Dollar"),
                    ("NIO", "Nicaraguan Córdoba"),
                    ("NIC", "Nicaraguan Córdoba (1988–1991)"),
                    ("NGN", "Nigerian Naira"),
                    ("KPW", "North Korean Won"),
                    ("NOK", "Norwegian Krone"),
                    ("OMR", "Omani Rial"),
                    ("PKR", "Pakistani Rupee"),
                    ("XPD", "Palladium"),
                    ("PAB", "Panamanian Balboa"),
                    ("PGK", "Papua New Guinean Kina"),
                    ("PYG", "Paraguayan Guarani"),
                    ("PEI", "Peruvian Inti"),
                    ("PEN", "Peruvian Sol"),
                    ("PES", "Peruvian Sol (1863–1965)"),
                    ("PHP", "Philippine Peso"),
                    ("XPT", "Platinum"),
                    ("PLN", "Polish Zloty"),
                    ("PLZ", "Polish Zloty (1950–1995)"),
                    ("PTE", "Portuguese Escudo"),
                    ("GWE", "Portuguese Guinea Escudo"),
                    ("QAR", "Qatari Rial"),
                    ("XRE", "RINET Funds"),
                    ("RHD", "Rhodesian Dollar"),
                    ("RON", "Romanian Leu"),
                    ("ROL", "Romanian Leu (1952–2006)"),
                    ("RUB", "Russian Ruble"),
                    ("RUR", "Russian Ruble (1991–1998)"),
                    ("RWF", "Rwandan Franc"),
                    ("SVC", "Salvadoran Colón"),
                    ("WST", "Samoan Tala"),
                    ("SAR", "Saudi Riyal"),
                    ("RSD", "Serbian Dinar"),
                    ("CSD", "Serbian Dinar (2002–2006)"),
                    ("SCR", "Seychellois Rupee"),
                    ("SLL", "Sierra Leonean Leone"),
                    ("XAG", "Silver"),
                    ("SGD", "Singapore Dollar"),
                    ("SKK", "Slovak Koruna"),
                    ("SIT", "Slovenian Tolar"),
                    ("SBD", "Solomon Islands Dollar"),
                    ("SOS", "Somali Shilling"),
                    ("ZAR", "South African Rand"),
                    ("ZAL", "South African Rand (financial)"),
                    ("KRH", "South Korean Hwan (1953–1962)"),
                    ("KRW", "South Korean Won"),
                    ("KRO", "South Korean Won (1945–1953)"),
                    ("SSP", "South Sudanese Pound"),
                    ("SUR", "Soviet Rouble"),
                    ("ESP", "Spanish Peseta"),
                    ("ESA", "Spanish Peseta (A account)"),
                    ("ESB", "Spanish Peseta (convertible account)"),
                    ("XDR", "Special Drawing Rights"),
                    ("LKR", "Sri Lankan Rupee"),
                    ("SHP", "St. Helena Pound"),
                    ("XSU", "Sucre"),
                    ("SDD", "Sudanese Dinar (1992–2007)"),
                    ("SDG", "Sudanese Pound"),
                    ("SDP", "Sudanese Pound (1957–1998)"),
                    ("SRD", "Surinamese Dollar"),
                    ("SRG", "Surinamese Guilder"),
                    ("SZL", "Swazi Lilangeni"),
                    ("SEK", "Swedish Krona"),
                    ("CHF", "Swiss Franc"),
                    ("SYP", "Syrian Pound"),
                    ("STN", "São Tomé & Príncipe Dobra"),
                    ("STD", "São Tomé & Príncipe Dobra (1977–2017)"),
                    ("TVD", "TVD"),
                    ("TJR", "Tajikistani Ruble"),
                    ("TJS", "Tajikistani Somoni"),
                    ("TZS", "Tanzanian Shilling"),
                    ("XTS", "Testing Currency Code"),
                    ("THB", "Thai Baht"),
                    (
                        "XXX",
                        "The codes assigned for transactions where no currency is involved",
                    ),
                    ("TPE", "Timorese Escudo"),
                    ("TOP", "Tongan Paʻanga"),
                    ("TTD", "Trinidad & Tobago Dollar"),
                    ("TND", "Tunisian Dinar"),
                    ("TRY", "Turkish Lira"),
                    ("TRL", "Turkish Lira (1922–2005)"),
                    ("TMT", "Turkmenistani Manat"),
                    ("TMM", "Turkmenistani Manat (1993–2009)"),
                    ("USD", "US Dollar"),
                    ("USN", "US Dollar (Next day)"),
                    ("USS", "US Dollar (Same day)"),
                    ("UGX", "Ugandan Shilling"),
                    ("UGS", "Ugandan Shilling (1966–1987)"),
                    ("UAH", "Ukrainian Hryvnia"),
                    ("UAK", "Ukrainian Karbovanets"),
                    ("AED", "United Arab Emirates Dirham"),
                    ("UYW", "Uruguayan Nominal Wage Index Unit"),
                    ("UYU", "Uruguayan Peso"),
                    ("UYP", "Uruguayan Peso (1975–1993)"),
                    ("UYI", "Uruguayan Peso (Indexed Units)"),
                    ("UZS", "Uzbekistani Som"),
                    ("VUV", "Vanuatu Vatu"),
                    ("VES", "Venezuelan Bolívar"),
                    ("VEB", "Venezuelan Bolívar (1871–2008)"),
                    ("VEF", "Venezuelan Bolívar (2008–2018)"),
                    ("VND", "Vietnamese Dong"),
                    ("VNN", "Vietnamese Dong (1978–1985)"),
                    ("CHE", "WIR Euro"),
                    ("CHW", "WIR Franc"),
                    ("XOF", "West African CFA Franc"),
                    ("YDD", "Yemeni Dinar"),
                    ("YER", "Yemeni Rial"),
                    ("YUN", "Yugoslavian Convertible Dinar (1990–1992)"),
                    ("YUD", "Yugoslavian Hard Dinar (1966–1990)"),
                    ("YUM", "Yugoslavian New Dinar (1994–2002)"),
                    ("YUR", "Yugoslavian Reformed Dinar (1992–1993)"),
                    ("ZWN", "ZWN"),
                    ("ZRN", "Zairean New Zaire (1993–1998)"),
                    ("ZRZ", "Zairean Zaire (1971–1993)"),
                    ("ZMW", "Zambian Kwacha"),
                    ("ZMK", "Zambian Kwacha (1968–2012)"),
                    ("ZWD", "Zimbabwean Dollar (1980–2008)"),
                    ("ZWR", "Zimbabwean Dollar (2008)"),
                    ("ZWL", "Zimbabwean Dollar (2009)"),
                ],
                default="USD",
                editable=False,
                max_length=3,
            ),
        ),
        migrations.AddField(
            model_name="event",
            name="properties",
            field=models.JSONField(default=dict),
        ),
        migrations.AlterField(
            model_name="event",
            name="time_created",
            field=models.CharField(max_length=100),
        ),
    ]

billing/migrations/0001_initial.py METASEP
# Generated by Django 4.0.6 on 2022-07-23 04:55

from django.db import migrations, models
import django.db.models.deletion
import uuid


class Migration(migrations.Migration):

    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name="BillingPlan",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "billing_id",
                    models.CharField(
                        blank=True, default=uuid.uuid4, max_length=36, unique=True
                    ),
                ),
                ("active", models.BooleanField()),
                ("amount", models.IntegerField()),
                (
                    "amount_decimal",
                    models.DecimalField(decimal_places=2, max_digits=11),
                ),
                ("billing_scheme", models.CharField(max_length=30)),
                ("time_created", models.TimeField()),
                (
                    "interval",
                    models.CharField(
                        choices=[
                            ("week", "Week"),
                            ("month", "Month"),
                            ("year", "Year"),
                        ],
                        default="month",
                        max_length=5,
                    ),
                ),
                ("interval_count", models.IntegerField()),
                ("nickname", models.CharField(max_length=30)),
                ("product", models.CharField(max_length=30)),
                ("tiers_mode", models.CharField(max_length=30)),
                ("trial_period_days", models.IntegerField()),
                (
                    "usage_type",
                    models.CharField(
                        choices=[("LI", "Licensed"), ("ME", "Metered")],
                        default="ME",
                        max_length=2,
                    ),
                ),
            ],
        ),
        migrations.CreateModel(
            name="Customer",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("first_name", models.CharField(max_length=30)),
                ("last_name", models.CharField(max_length=30)),
                (
                    "billing_id",
                    models.CharField(
                        blank=True, default=uuid.uuid4, max_length=100, unique=True
                    ),
                ),
                ("system_id", models.CharField(max_length=100, unique=True)),
                ("email_address", models.CharField(max_length=30)),
                ("phone_number", models.CharField(max_length=30)),
                ("time_created", models.DateTimeField(auto_now_add=True)),
                ("default_payment_source", models.CharField(max_length=60)),
                ("invoice_prefix", models.CharField(max_length=30)),
                ("next_invoice_sequence", models.CharField(max_length=30)),
                ("tax_exempt", models.CharField(max_length=30)),
            ],
        ),
        migrations.CreateModel(
            name="Event",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("event_name", models.CharField(max_length=200)),
                ("time_created", models.DateTimeField(auto_now_add=True)),
                (
                    "customer",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        to="billing.customer",
                    ),
                ),
            ],
        ),
    ]

billing/migrations/0007_subscription_invoice.py METASEP

# Generated by Django 4.0.6 on 2022-07-26 05:40

from django.db import migrations, models
import django.db.models.deletion
import djmoney.models.fields
import uuid
non_informative
# Generated by Django 4.0.6 on 2022-07-26 05:40

from django.db import migrations, models
import django.db.models.deletion
import djmoney.models.fields
non_informative
non_informative
# Generated by Django 4.0.6 on 2022-07-26 05:40

from django.db import migrations, models
import django.db.models.deletion
import djmoney.models.fields
import uuid


class Migration(migrations.Migration):

    dependencies = [
        ("billing", "0006_alter_event_options_event_idempotency_id"),
non_informative
# Generated by Django 4.0.6 on 2022-07-26 05:40

from django.db import migrations, models
import django.db.models.deletion
import djmoney.models.fields
import uuid


non_informative
# Generated by Django 4.0.6 on 2022-07-26 05:40

from django.db import migrations, models
import django.db.models.deletion
import djmoney.models.fields
import uuid


class Migration(migrations.Migration):

    dependencies = [
        ("billing", "0006_alter_event_options_event_idempotency_id"),
    ]

    operations = [
        migrations.CreateModel(
            name="Subscription",
            fields=[
                (
                    "id",
                    models.CharField(
                        default=uuid.uuid4,
                        max_length=36,
                        primary_key=True,
                        serialize=False,
                    ),
                ),
                ("start_date", models.DateTimeField(auto_now=True, max_length=100)),
                ("end_date", models.DateTimeField(auto_now=True, max_length=100)),
                (
                    "status",
                    models.CharField(
                        choices=[("active", "Active"), ("ended", "Ended")],
                        default="active",
                        max_length=6,
                    ),
                ),
                (
                    "billing_plan",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        to="billing.billingplan",
                    ),
                ),
                (
                    "customer",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        to="billing.customer",
                    ),
                ),
            ],
        ),
        migrations.CreateModel(
            name="Invoice",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "cost_due_currency",
                    djmoney.models.fields.CurrencyField(
                        choices=[
                            ("XUA", "ADB Unit of Account"),
                            ("AFN", "Afghan Afghani"),
                            ("AFA", "Afghan Afghani (1927–2002)"),
                            ("ALL", "Albanian Lek"),
                            ("ALK", "Albanian Lek (1946–1965)"),
                            ("DZD", "Algerian Dinar"),
                            ("ADP", "Andorran Peseta"),
                            ("AOA", "Angolan Kwanza"),
                            ("AOK", "Angolan Kwanza (1977–1991)"),
                            ("AON", "Angolan New Kwanza (1990–2000)"),
                            ("AOR", "Angolan Readjusted Kwanza (1995–1999)"),
                            ("ARA", "Argentine Austral"),
                            ("ARS", "Argentine Peso"),
                            ("ARM", "Argentine Peso (1881–1970)"),
                            ("ARP", "Argentine Peso (1983–1985)"),
                            ("ARL", "Argentine Peso Ley (1970–1983)"),
                            ("AMD", "Armenian Dram"),
                            ("AWG", "Aruban Florin"),
                            ("AUD", "Australian Dollar"),
                            ("ATS", "Austrian Schilling"),
                            ("AZN", "Azerbaijani Manat"),
                            ("AZM", "Azerbaijani Manat (1993–2006)"),
                            ("BSD", "Bahamian Dollar"),
                            ("BHD", "Bahraini Dinar"),
                            ("BDT", "Bangladeshi Taka"),
                            ("BBD", "Barbadian Dollar"),
                            ("BYN", "Belarusian Ruble"),
                            ("BYB", "Belarusian Ruble (1994–1999)"),
                            ("BYR", "Belarusian Ruble (2000–2016)"),
                            ("BEF", "Belgian Franc"),
                            ("BEC", "Belgian Franc (convertible)"),
                            ("BEL", "Belgian Franc (financial)"),
                            ("BZD", "Belize Dollar"),
                            ("BMD", "Bermudan Dollar"),
                            ("BTN", "Bhutanese Ngultrum"),
                            ("BOB", "Bolivian Boliviano"),
                            ("BOL", "Bolivian Boliviano (1863–1963)"),
                            ("BOV", "Bolivian Mvdol"),
                            ("BOP", "Bolivian Peso"),
                            ("BAM", "Bosnia-Herzegovina Convertible Mark"),
                            ("BAD", "Bosnia-Herzegovina Dinar (1992–1994)"),
                            ("BAN", "Bosnia-Herzegovina New Dinar (1994–1997)"),
                            ("BWP", "Botswanan Pula"),
                            ("BRC", "Brazilian Cruzado (1986–1989)"),
                            ("BRZ", "Brazilian Cruzeiro (1942–1967)"),
                            ("BRE", "Brazilian Cruzeiro (1990–1993)"),
                            ("BRR", "Brazilian Cruzeiro (1993–1994)"),
                            ("BRN", "Brazilian New Cruzado (1989–1990)"),
                            ("BRB", "Brazilian New Cruzeiro (1967–1986)"),
                            ("BRL", "Brazilian Real"),
                            ("GBP", "British Pound"),
                            ("BND", "Brunei Dollar"),
                            ("BGL", "Bulgarian Hard Lev"),
                            ("BGN", "Bulgarian Lev"),
                            ("BGO", "Bulgarian Lev (1879–1952)"),
                            ("BGM", "Bulgarian Socialist Lev"),
                            ("BUK", "Burmese Kyat"),
                            ("BIF", "Burundian Franc"),
                            ("XPF", "CFP Franc"),
                            ("KHR", "Cambodian Riel"),
                            ("CAD", "Canadian Dollar"),
                            ("CVE", "Cape Verdean Escudo"),
                            ("KYD", "Cayman Islands Dollar"),
                            ("XAF", "Central African CFA Franc"),
                            ("CLE", "Chilean Escudo"),
                            ("CLP", "Chilean Peso"),
                            ("CLF", "Chilean Unit of Account (UF)"),
                            ("CNX", "Chinese People’s Bank Dollar"),
                            ("CNY", "Chinese Yuan"),
                            ("CNH", "Chinese Yuan (offshore)"),
                            ("COP", "Colombian Peso"),
                            ("COU", "Colombian Real Value Unit"),
                            ("KMF", "Comorian Franc"),
                            ("CDF", "Congolese Franc"),
                            ("CRC", "Costa Rican Colón"),
                            ("HRD", "Croatian Dinar"),
                            ("HRK", "Croatian Kuna"),
                            ("CUC", "Cuban Convertible Peso"),
                            ("CUP", "Cuban Peso"),
                            ("CYP", "Cypriot Pound"),
                            ("CZK", "Czech Koruna"),
                            ("CSK", "Czechoslovak Hard Koruna"),
                            ("DKK", "Danish Krone"),
                            ("DJF", "Djiboutian Franc"),
                            ("DOP", "Dominican Peso"),
                            ("NLG", "Dutch Guilder"),
                            ("XCD", "East Caribbean Dollar"),
                            ("DDM", "East German Mark"),
                            ("ECS", "Ecuadorian Sucre"),
                            ("ECV", "Ecuadorian Unit of Constant Value"),
                            ("EGP", "Egyptian Pound"),
                            ("GQE", "Equatorial Guinean Ekwele"),
                            ("ERN", "Eritrean Nakfa"),
                            ("EEK", "Estonian Kroon"),
                            ("ETB", "Ethiopian Birr"),
                            ("EUR", "Euro"),
                            ("XBA", "European Composite Unit"),
                            ("XEU", "European Currency Unit"),
                            ("XBB", "European Monetary Unit"),
                            ("XBC", "European Unit of Account (XBC)"),
                            ("XBD", "European Unit of Account (XBD)"),
                            ("FKP", "Falkland Islands Pound"),
                            ("FJD", "Fijian Dollar"),
                            ("FIM", "Finnish Markka"),
                            ("FRF", "French Franc"),
                            ("XFO", "French Gold Franc"),
                            ("XFU", "French UIC-Franc"),
                            ("GMD", "Gambian Dalasi"),
                            ("GEK", "Georgian Kupon Larit"),
                            ("GEL", "Georgian Lari"),
                            ("DEM", "German Mark"),
                            ("GHS", "Ghanaian Cedi"),
                            ("GHC", "Ghanaian Cedi (1979–2007)"),
                            ("GIP", "Gibraltar Pound"),
                            ("XAU", "Gold"),
                            ("GRD", "Greek Drachma"),
                            ("GTQ", "Guatemalan Quetzal"),
                            ("GWP", "Guinea-Bissau Peso"),
                            ("GNF", "Guinean Franc"),
                            ("GNS", "Guinean Syli"),
                            ("GYD", "Guyanaese Dollar"),
                            ("HTG", "Haitian Gourde"),
                            ("HNL", "Honduran Lempira"),
                            ("HKD", "Hong Kong Dollar"),
                            ("HUF", "Hungarian Forint"),
                            ("IMP", "IMP"),
                            ("ISK", "Icelandic Króna"),
                            ("ISJ", "Icelandic Króna (1918–1981)"),
                            ("INR", "Indian Rupee"),
                            ("IDR", "Indonesian Rupiah"),
                            ("IRR", "Iranian Rial"),
                            ("IQD", "Iraqi Dinar"),
                            ("IEP", "Irish Pound"),
                            ("ILS", "Israeli New Shekel"),
                            ("ILP", "Israeli Pound"),
                            ("ILR", "Israeli Shekel (1980–1985)"),
                            ("ITL", "Italian Lira"),
                            ("JMD", "Jamaican Dollar"),
                            ("JPY", "Japanese Yen"),
                            ("JOD", "Jordanian Dinar"),
                            ("KZT", "Kazakhstani Tenge"),
                            ("KES", "Kenyan Shilling"),
                            ("KWD", "Kuwaiti Dinar"),
                            ("KGS", "Kyrgystani Som"),
                            ("LAK", "Laotian Kip"),
                            ("LVL", "Latvian Lats"),
                            ("LVR", "Latvian Ruble"),
                            ("LBP", "Lebanese Pound"),
                            ("LSL", "Lesotho Loti"),
                            ("LRD", "Liberian Dollar"),
                            ("LYD", "Libyan Dinar"),
                            ("LTL", "Lithuanian Litas"),
                            ("LTT", "Lithuanian Talonas"),
                            ("LUL", "Luxembourg Financial Franc"),
                            ("LUC", "Luxembourgian Convertible Franc"),
                            ("LUF", "Luxembourgian Franc"),
                            ("MOP", "Macanese Pataca"),
                            ("MKD", "Macedonian Denar"),
                            ("MKN", "Macedonian Denar (1992–1993)"),
                            ("MGA", "Malagasy Ariary"),
                            ("MGF", "Malagasy Franc"),
                            ("MWK", "Malawian Kwacha"),
                            ("MYR", "Malaysian Ringgit"),
                            ("MVR", "Maldivian Rufiyaa"),
                            ("MVP", "Maldivian Rupee (1947–1981)"),
                            ("MLF", "Malian Franc"),
                            ("MTL", "Maltese Lira"),
                            ("MTP", "Maltese Pound"),
                            ("MRU", "Mauritanian Ouguiya"),
                            ("MRO", "Mauritanian Ouguiya (1973–2017)"),
                            ("MUR", "Mauritian Rupee"),
                            ("MXV", "Mexican Investment Unit"),
                            ("MXN", "Mexican Peso"),
                            ("MXP", "Mexican Silver Peso (1861–1992)"),
                            ("MDC", "Moldovan Cupon"),
                            ("MDL", "Moldovan Leu"),
                            ("MCF", "Monegasque Franc"),
                            ("MNT", "Mongolian Tugrik"),
                            ("MAD", "Moroccan Dirham"),
                            ("MAF", "Moroccan Franc"),
                            ("MZE", "Mozambican Escudo"),
                            ("MZN", "Mozambican Metical"),
                            ("MZM", "Mozambican Metical (1980–2006)"),
                            ("MMK", "Myanmar Kyat"),
                            ("NAD", "Namibian Dollar"),
                            ("NPR", "Nepalese Rupee"),
                            ("ANG", "Netherlands Antillean Guilder"),
                            ("TWD", "New Taiwan Dollar"),
                            ("NZD", "New Zealand Dollar"),
                            ("NIO", "Nicaraguan Córdoba"),
                            ("NIC", "Nicaraguan Córdoba (1988–1991)"),
                            ("NGN", "Nigerian Naira"),
                            ("KPW", "North Korean Won"),
                            ("NOK", "Norwegian Krone"),
                            ("OMR", "Omani Rial"),
                            ("PKR", "Pakistani Rupee"),
                            ("XPD", "Palladium"),
                            ("PAB", "Panamanian Balboa"),
                            ("PGK", "Papua New Guinean Kina"),
                            ("PYG", "Paraguayan Guarani"),
                            ("PEI", "Peruvian Inti"),
                            ("PEN", "Peruvian Sol"),
                            ("PES", "Peruvian Sol (1863–1965)"),
                            ("PHP", "Philippine Peso"),
                            ("XPT", "Platinum"),
                            ("PLN", "Polish Zloty"),
                            ("PLZ", "Polish Zloty (1950–1995)"),
                            ("PTE", "Portuguese Escudo"),
                            ("GWE", "Portuguese Guinea Escudo"),
                            ("QAR", "Qatari Rial"),
                            ("XRE", "RINET Funds"),
                            ("RHD", "Rhodesian Dollar"),
                            ("RON", "Romanian Leu"),
                            ("ROL", "Romanian Leu (1952–2006)"),
                            ("RUB", "Russian Ruble"),
                            ("RUR", "Russian Ruble (1991–1998)"),
                            ("RWF", "Rwandan Franc"),
                            ("SVC", "Salvadoran Colón"),
                            ("WST", "Samoan Tala"),
                            ("SAR", "Saudi Riyal"),
                            ("RSD", "Serbian Dinar"),
                            ("CSD", "Serbian Dinar (2002–2006)"),
                            ("SCR", "Seychellois Rupee"),
                            ("SLL", "Sierra Leonean Leone"),
                            ("XAG", "Silver"),
                            ("SGD", "Singapore Dollar"),
                            ("SKK", "Slovak Koruna"),
                            ("SIT", "Slovenian Tolar"),
                            ("SBD", "Solomon Islands Dollar"),
                            ("SOS", "Somali Shilling"),
                            ("ZAR", "South African Rand"),
                            ("ZAL", "South African Rand (financial)"),
                            ("KRH", "South Korean Hwan (1953–1962)"),
                            ("KRW", "South Korean Won"),
                            ("KRO", "South Korean Won (1945–1953)"),
                            ("SSP", "South Sudanese Pound"),
                            ("SUR", "Soviet Rouble"),
                            ("ESP", "Spanish Peseta"),
                            ("ESA", "Spanish Peseta (A account)"),
                            ("ESB", "Spanish Peseta (convertible account)"),
                            ("XDR", "Special Drawing Rights"),
                            ("LKR", "Sri Lankan Rupee"),
                            ("SHP", "St. Helena Pound"),
                            ("XSU", "Sucre"),
                            ("SDD", "Sudanese Dinar (1992–2007)"),
                            ("SDG", "Sudanese Pound"),
                            ("SDP", "Sudanese Pound (1957–1998)"),
                            ("SRD", "Surinamese Dollar"),
                            ("SRG", "Surinamese Guilder"),
                            ("SZL", "Swazi Lilangeni"),
                            ("SEK", "Swedish Krona"),
                            ("CHF", "Swiss Franc"),
                            ("SYP", "Syrian Pound"),
                            ("STN", "São Tomé & Príncipe Dobra"),
                            ("STD", "São Tomé & Príncipe Dobra (1977–2017)"),
                            ("TVD", "TVD"),
                            ("TJR", "Tajikistani Ruble"),
                            ("TJS", "Tajikistani Somoni"),
                            ("TZS", "Tanzanian Shilling"),
                            ("XTS", "Testing Currency Code"),
                            ("THB", "Thai Baht"),
                            (
                                "XXX",
                                "The codes assigned for transactions where no currency is involved",
                            ),
                            ("TPE", "Timorese Escudo"),
                            ("TOP", "Tongan Paʻanga"),
                            ("TTD", "Trinidad & Tobago Dollar"),
random
# Generated by Django 4.0.6 on 2022-07-26 05:40

from django.db import migrations, models
import django.db.models.deletion
import djmoney.models.fields
import uuid


class Migration(migrations.Migration):

    dependencies = [
        ("billing", "0006_alter_event_options_event_idempotency_id"),
    ]

    operations = [
        migrations.CreateModel(
            name="Subscription",
            fields=[
                (
                    "id",
                    models.CharField(
                        default=uuid.uuid4,
                        max_length=36,
                        primary_key=True,
                        serialize=False,
                    ),
                ),
                ("start_date", models.DateTimeField(auto_now=True, max_length=100)),
                ("end_date", models.DateTimeField(auto_now=True, max_length=100)),
                (
                    "status",
                    models.CharField(
                        choices=[("active", "Active"), ("ended", "Ended")],
                        default="active",
                        max_length=6,
                    ),
                ),
                (
                    "billing_plan",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        to="billing.billingplan",
                    ),
                ),
                (
                    "customer",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        to="billing.customer",
                    ),
                ),
            ],
        ),
        migrations.CreateModel(
            name="Invoice",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "cost_due_currency",
                    djmoney.models.fields.CurrencyField(
                        choices=[
                            ("XUA", "ADB Unit of Account"),
                            ("AFN", "Afghan Afghani"),
                            ("AFA", "Afghan Afghani (1927–2002)"),
                            ("ALL", "Albanian Lek"),
                            ("ALK", "Albanian Lek (1946–1965)"),
                            ("DZD", "Algerian Dinar"),
                            ("ADP", "Andorran Peseta"),
                            ("AOA", "Angolan Kwanza"),
                            ("AOK", "Angolan Kwanza (1977–1991)"),
                            ("AON", "Angolan New Kwanza (1990–2000)"),
                            ("AOR", "Angolan Readjusted Kwanza (1995–1999)"),
                            ("ARA", "Argentine Austral"),
                            ("ARS", "Argentine Peso"),
                            ("ARM", "Argentine Peso (1881–1970)"),
                            ("ARP", "Argentine Peso (1983–1985)"),
                            ("ARL", "Argentine Peso Ley (1970–1983)"),
                            ("AMD", "Armenian Dram"),
                            ("AWG", "Aruban Florin"),
                            ("AUD", "Australian Dollar"),
                            ("ATS", "Austrian Schilling"),
                            ("AZN", "Azerbaijani Manat"),
                            ("AZM", "Azerbaijani Manat (1993–2006)"),
                            ("BSD", "Bahamian Dollar"),
                            ("BHD", "Bahraini Dinar"),
                            ("BDT", "Bangladeshi Taka"),
                            ("BBD", "Barbadian Dollar"),
                            ("BYN", "Belarusian Ruble"),
                            ("BYB", "Belarusian Ruble (1994–1999)"),
                            ("BYR", "Belarusian Ruble (2000–2016)"),
                            ("BEF", "Belgian Franc"),
                            ("BEC", "Belgian Franc (convertible)"),
                            ("BEL", "Belgian Franc (financial)"),
                            ("BZD", "Belize Dollar"),
                            ("BMD", "Bermudan Dollar"),
                            ("BTN", "Bhutanese Ngultrum"),
                            ("BOB", "Bolivian Boliviano"),
                            ("BOL", "Bolivian Boliviano (1863–1963)"),
                            ("BOV", "Bolivian Mvdol"),
                            ("BOP", "Bolivian Peso"),
                            ("BAM", "Bosnia-Herzegovina Convertible Mark"),
                            ("BAD", "Bosnia-Herzegovina Dinar (1992–1994)"),
                            ("BAN", "Bosnia-Herzegovina New Dinar (1994–1997)"),
                            ("BWP", "Botswanan Pula"),
                            ("BRC", "Brazilian Cruzado (1986–1989)"),
                            ("BRZ", "Brazilian Cruzeiro (1942–1967)"),
                            ("BRE", "Brazilian Cruzeiro (1990–1993)"),
                            ("BRR", "Brazilian Cruzeiro (1993–1994)"),
                            ("BRN", "Brazilian New Cruzado (1989–1990)"),
                            ("BRB", "Brazilian New Cruzeiro (1967–1986)"),
                            ("BRL", "Brazilian Real"),
                            ("GBP", "British Pound"),
                            ("BND", "Brunei Dollar"),
                            ("BGL", "Bulgarian Hard Lev"),
                            ("BGN", "Bulgarian Lev"),
                            ("BGO", "Bulgarian Lev (1879–1952)"),
                            ("BGM", "Bulgarian Socialist Lev"),
                            ("BUK", "Burmese Kyat"),
                            ("BIF", "Burundian Franc"),
                            ("XPF", "CFP Franc"),
                            ("KHR", "Cambodian Riel"),
                            ("CAD", "Canadian Dollar"),
                            ("CVE", "Cape Verdean Escudo"),
                            ("KYD", "Cayman Islands Dollar"),
                            ("XAF", "Central African CFA Franc"),
                            ("CLE", "Chilean Escudo"),
                            ("CLP", "Chilean Peso"),
                            ("CLF", "Chilean Unit of Account (UF)"),
                            ("CNX", "Chinese People’s Bank Dollar"),
                            ("CNY", "Chinese Yuan"),
                            ("CNH", "Chinese Yuan (offshore)"),
                            ("COP", "Colombian Peso"),
                            ("COU", "Colombian Real Value Unit"),
                            ("KMF", "Comorian Franc"),
                            ("CDF", "Congolese Franc"),
                            ("CRC", "Costa Rican Colón"),
                            ("HRD", "Croatian Dinar"),
                            ("HRK", "Croatian Kuna"),
                            ("CUC", "Cuban Convertible Peso"),
                            ("CUP", "Cuban Peso"),
                            ("CYP", "Cypriot Pound"),
                            ("CZK", "Czech Koruna"),
                            ("CSK", "Czechoslovak Hard Koruna"),
                            ("DKK", "Danish Krone"),
                            ("DJF", "Djiboutian Franc"),
                            ("DOP", "Dominican Peso"),
                            ("NLG", "Dutch Guilder"),
                            ("XCD", "East Caribbean Dollar"),
                            ("DDM", "East German Mark"),
                            ("ECS", "Ecuadorian Sucre"),
                            ("ECV", "Ecuadorian Unit of Constant Value"),
                            ("EGP", "Egyptian Pound"),
                            ("GQE", "Equatorial Guinean Ekwele"),
                            ("ERN", "Eritrean Nakfa"),
                            ("EEK", "Estonian Kroon"),
                            ("ETB", "Ethiopian Birr"),
                            ("EUR", "Euro"),
                            ("XBA", "European Composite Unit"),
                            ("XEU", "European Currency Unit"),
                            ("XBB", "European Monetary Unit"),
                            ("XBC", "European Unit of Account (XBC)"),
                            ("XBD", "European Unit of Account (XBD)"),
                            ("FKP", "Falkland Islands Pound"),
                            ("FJD", "Fijian Dollar"),
                            ("FIM", "Finnish Markka"),
                            ("FRF", "French Franc"),
                            ("XFO", "French Gold Franc"),
                            ("XFU", "French UIC-Franc"),
                            ("GMD", "Gambian Dalasi"),
                            ("GEK", "Georgian Kupon Larit"),
                            ("GEL", "Georgian Lari"),
                            ("DEM", "German Mark"),
                            ("GHS", "Ghanaian Cedi"),
                            ("GHC", "Ghanaian Cedi (1979–2007)"),
                            ("GIP", "Gibraltar Pound"),
                            ("XAU", "Gold"),
                            ("GRD", "Greek Drachma"),
                            ("GTQ", "Guatemalan Quetzal"),
                            ("GWP", "Guinea-Bissau Peso"),
                            ("GNF", "Guinean Franc"),
                            ("GNS", "Guinean Syli"),
                            ("GYD", "Guyanaese Dollar"),
                            ("HTG", "Haitian Gourde"),
                            ("HNL", "Honduran Lempira"),
                            ("HKD", "Hong Kong Dollar"),
                            ("HUF", "Hungarian Forint"),
                            ("IMP", "IMP"),
                            ("ISK", "Icelandic Króna"),
                            ("ISJ", "Icelandic Króna (1918–1981)"),
                            ("INR", "Indian Rupee"),
                            ("IDR", "Indonesian Rupiah"),
                            ("IRR", "Iranian Rial"),
                            ("IQD", "Iraqi Dinar"),
                            ("IEP", "Irish Pound"),
                            ("ILS", "Israeli New Shekel"),
                            ("ILP", "Israeli Pound"),
                            ("ILR", "Israeli Shekel (1980–1985)"),
                            ("ITL", "Italian Lira"),
                            ("JMD", "Jamaican Dollar"),
                            ("JPY", "Japanese Yen"),
                            ("JOD", "Jordanian Dinar"),
                            ("KZT", "Kazakhstani Tenge"),
                            ("KES", "Kenyan Shilling"),
                            ("KWD", "Kuwaiti Dinar"),
                            ("KGS", "Kyrgystani Som"),
                            ("LAK", "Laotian Kip"),
                            ("LVL", "Latvian Lats"),
                            ("LVR", "Latvian Ruble"),
                            ("LBP", "Lebanese Pound"),
                            ("LSL", "Lesotho Loti"),
                            ("LRD", "Liberian Dollar"),
                            ("LYD", "Libyan Dinar"),
                            ("LTL", "Lithuanian Litas"),
                            ("LTT", "Lithuanian Talonas"),
                            ("LUL", "Luxembourg Financial Franc"),
                            ("LUC", "Luxembourgian Convertible Franc"),
                            ("LUF", "Luxembourgian Franc"),
                            ("MOP", "Macanese Pataca"),
                            ("MKD", "Macedonian Denar"),
                            ("MKN", "Macedonian Denar (1992–1993)"),
                            ("MGA", "Malagasy Ariary"),
                            ("MGF", "Malagasy Franc"),
                            ("MWK", "Malawian Kwacha"),
                            ("MYR", "Malaysian Ringgit"),
                            ("MVR", "Maldivian Rufiyaa"),
                            ("MVP", "Maldivian Rupee (1947–1981)"),
                            ("MLF", "Malian Franc"),
                            ("MTL", "Maltese Lira"),
                            ("MTP", "Maltese Pound"),
                            ("MRU", "Mauritanian Ouguiya"),
                            ("MRO", "Mauritanian Ouguiya (1973–2017)"),
                            ("MUR", "Mauritian Rupee"),
                            ("MXV", "Mexican Investment Unit"),
                            ("MXN", "Mexican Peso"),
                            ("MXP", "Mexican Silver Peso (1861–1992)"),
                            ("MDC", "Moldovan Cupon"),
                            ("MDL", "Moldovan Leu"),
                            ("MCF", "Monegasque Franc"),
                            ("MNT", "Mongolian Tugrik"),
                            ("MAD", "Moroccan Dirham"),
                            ("MAF", "Moroccan Franc"),
                            ("MZE", "Mozambican Escudo"),
                            ("MZN", "Mozambican Metical"),
                            ("MZM", "Mozambican Metical (1980–2006)"),
                            ("MMK", "Myanmar Kyat"),
                            ("NAD", "Namibian Dollar"),
                            ("NPR", "Nepalese Rupee"),
                            ("ANG", "Netherlands Antillean Guilder"),
                            ("TWD", "New Taiwan Dollar"),
                            ("NZD", "New Zealand Dollar"),
                            ("NIO", "Nicaraguan Córdoba"),
                            ("NIC", "Nicaraguan Córdoba (1988–1991)"),
                            ("NGN", "Nigerian Naira"),
                            ("KPW", "North Korean Won"),
                            ("NOK", "Norwegian Krone"),
                            ("OMR", "Omani Rial"),
                            ("PKR", "Pakistani Rupee"),
                            ("XPD", "Palladium"),
                            ("PAB", "Panamanian Balboa"),
                            ("PGK", "Papua New Guinean Kina"),
                            ("PYG", "Paraguayan Guarani"),
                            ("PEI", "Peruvian Inti"),
                            ("PEN", "Peruvian Sol"),
                            ("PES", "Peruvian Sol (1863–1965)"),
                            ("PHP", "Philippine Peso"),
                            ("XPT", "Platinum"),
                            ("PLN", "Polish Zloty"),
                            ("PLZ", "Polish Zloty (1950–1995)"),
                            ("PTE", "Portuguese Escudo"),
                            ("GWE", "Portuguese Guinea Escudo"),
                            ("QAR", "Qatari Rial"),
                            ("XRE", "RINET Funds"),
                            ("RHD", "Rhodesian Dollar"),
                            ("RON", "Romanian Leu"),
                            ("ROL", "Romanian Leu (1952–2006)"),
                            ("RUB", "Russian Ruble"),
                            ("RUR", "Russian Ruble (1991–1998)"),
                            ("RWF", "Rwandan Franc"),
                            ("SVC", "Salvadoran Colón"),
                            ("WST", "Samoan Tala"),
                            ("SAR", "Saudi Riyal"),
                            ("RSD", "Serbian Dinar"),
                            ("CSD", "Serbian Dinar (2002–2006)"),
                            ("SCR", "Seychellois Rupee"),
                            ("SLL", "Sierra Leonean Leone"),
                            ("XAG", "Silver"),
                            ("SGD", "Singapore Dollar"),
                            ("SKK", "Slovak Koruna"),
                            ("SIT", "Slovenian Tolar"),
                            ("SBD", "Solomon Islands Dollar"),
                            ("SOS", "Somali Shilling"),
                            ("ZAR", "South African Rand"),
                            ("ZAL", "South African Rand (financial)"),
                            ("KRH", "South Korean Hwan (1953–1962)"),
                            ("KRW", "South Korean Won"),
                            ("KRO", "South Korean Won (1945–1953)"),
                            ("SSP", "South Sudanese Pound"),
                            ("SUR", "Soviet Rouble"),
                            ("ESP", "Spanish Peseta"),
                            ("ESA", "Spanish Peseta (A account)"),
                            ("ESB", "Spanish Peseta (convertible account)"),
                            ("XDR", "Special Drawing Rights"),
                            ("LKR", "Sri Lankan Rupee"),
                            ("SHP", "St. Helena Pound"),
                            ("XSU", "Sucre"),
                            ("SDD", "Sudanese Dinar (1992–2007)"),
                            ("SDG", "Sudanese Pound"),
                            ("SDP", "Sudanese Pound (1957–1998)"),
                            ("SRD", "Surinamese Dollar"),
                            ("SRG", "Surinamese Guilder"),
                            ("SZL", "Swazi Lilangeni"),
                            ("SEK", "Swedish Krona"),
                            ("CHF", "Swiss Franc"),
                            ("SYP", "Syrian Pound"),
                            ("STN", "São Tomé & Príncipe Dobra"),
                            ("STD", "São Tomé & Príncipe Dobra (1977–2017)"),
                            ("TVD", "TVD"),
                            ("TJR", "Tajikistani Ruble"),
                            ("TJS", "Tajikistani Somoni"),
                            ("TZS", "Tanzanian Shilling"),
                            ("XTS", "Testing Currency Code"),
                            ("THB", "Thai Baht"),
                            (
                                "XXX",
                                "The codes assigned for transactions where no currency is involved",
                            ),
                            ("TPE", "Timorese Escudo"),
                            ("TOP", "Tongan Paʻanga"),
                            ("TTD", "Trinidad & Tobago Dollar"),
                            ("TND", "Tunisian Dinar"),
                            ("TRY", "Turkish Lira"),
                            ("TRL", "Turkish Lira (1922–2005)"),
                            ("TMT", "Turkmenistani Manat"),
                            ("TMM", "Turkmenistani Manat (1993–2009)"),
                            ("USD", "US Dollar"),
                            ("USN", "US Dollar (Next day)"),
                            ("USS", "US Dollar (Same day)"),
                            ("UGX", "Ugandan Shilling"),
                            ("UGS", "Ugandan Shilling (1966–1987)"),
                            ("UAH", "Ukrainian Hryvnia"),
                            ("UAK", "Ukrainian Karbovanets"),
                            ("AED", "United Arab Emirates Dirham"),
                            ("UYW", "Uruguayan Nominal Wage Index Unit"),
                            ("UYU", "Uruguayan Peso"),
                            ("UYP", "Uruguayan Peso (1975–1993)"),
                            ("UYI", "Uruguayan Peso (Indexed Units)"),
                            ("UZS", "Uzbekistani Som"),
                            ("VUV", "Vanuatu Vatu"),
                            ("VES", "Venezuelan Bolívar"),
                            ("VEB", "Venezuelan Bolívar (1871–2008)"),
                            ("VEF", "Venezuelan Bolívar (2008–2018)"),
                            ("VND", "Vietnamese Dong"),
                            ("VNN", "Vietnamese Dong (1978–1985)"),
                            ("CHE", "WIR Euro"),
                            ("CHW", "WIR Franc"),
                            ("XOF", "West African CFA Franc"),
                            ("YDD", "Yemeni Dinar"),
                            ("YER", "Yemeni Rial"),
                            ("YUN", "Yugoslavian Convertible Dinar (1990–1992)"),
                            ("YUD", "Yugoslavian Hard Dinar (1966–1990)"),
                            ("YUM", "Yugoslavian New Dinar (1994–2002)"),
                            ("YUR", "Yugoslavian Reformed Dinar (1992–1993)"),
                            ("ZWN", "ZWN"),
                            ("ZRN", "Zairean New Zaire (1993–1998)"),
                            ("ZRZ", "Zairean Zaire (1971–1993)"),
                            ("ZMW", "Zambian Kwacha"),
                            ("ZMK", "Zambian Kwacha (1968–2012)"),
                            ("ZWD", "Zimbabwean Dollar (1980–2008)"),
                            ("ZWR", "Zimbabwean Dollar (2008)"),
                            ("ZWL", "Zimbabwean Dollar (2009)"),
                        ],
                        default=None,
random
# Generated by Django 4.0.6 on 2022-07-26 05:40

from django.db import migrations, models
import django.db.models.deletion
import djmoney.models.fields
import uuid


class Migration(migrations.Migration):

    dependencies = [
        ("billing", "0006_alter_event_options_event_idempotency_id"),
    ]

    operations = [
        migrations.CreateModel(
            name="Subscription",
            fields=[
                (
                    "id",
                    models.CharField(
                        default=uuid.uuid4,
                        max_length=36,
                        primary_key=True,
                        serialize=False,
                    ),
                ),
                ("start_date", models.DateTimeField(auto_now=True, max_length=100)),
                ("end_date", models.DateTimeField(auto_now=True, max_length=100)),
                (
                    "status",
                    models.CharField(
                        choices=[("active", "Active"), ("ended", "Ended")],
                        default="active",
                        max_length=6,
                    ),
                ),
                (
                    "billing_plan",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        to="billing.billingplan",
                    ),
                ),
                (
                    "customer",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        to="billing.customer",
                    ),
                ),
            ],
        ),
        migrations.CreateModel(
            name="Invoice",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "cost_due_currency",
                    djmoney.models.fields.CurrencyField(
                        choices=[
                            ("XUA", "ADB Unit of Account"),
                            ("AFN", "Afghan Afghani"),
                            ("AFA", "Afghan Afghani (1927–2002)"),
                            ("ALL", "Albanian Lek"),
                            ("ALK", "Albanian Lek (1946–1965)"),
                            ("DZD", "Algerian Dinar"),
                            ("ADP", "Andorran Peseta"),
                            ("AOA", "Angolan Kwanza"),
                            ("AOK", "Angolan Kwanza (1977–1991)"),
                            ("AON", "Angolan New Kwanza (1990–2000)"),
                            ("AOR", "Angolan Readjusted Kwanza (1995–1999)"),
                            ("ARA", "Argentine Austral"),
                            ("ARS", "Argentine Peso"),
                            ("ARM", "Argentine Peso (1881–1970)"),
                            ("ARP", "Argentine Peso (1983–1985)"),
                            ("ARL", "Argentine Peso Ley (1970–1983)"),
                            ("AMD", "Armenian Dram"),
                            ("AWG", "Aruban Florin"),
                            ("AUD", "Australian Dollar"),
                            ("ATS", "Austrian Schilling"),
                            ("AZN", "Azerbaijani Manat"),
                            ("AZM", "Azerbaijani Manat (1993–2006)"),
                            ("BSD", "Bahamian Dollar"),
                            ("BHD", "Bahraini Dinar"),
                            ("BDT", "Bangladeshi Taka"),
                            ("BBD", "Barbadian Dollar"),
                            ("BYN", "Belarusian Ruble"),
                            ("BYB", "Belarusian Ruble (1994–1999)"),
                            ("BYR", "Belarusian Ruble (2000–2016)"),
                            ("BEF", "Belgian Franc"),
                            ("BEC", "Belgian Franc (convertible)"),
                            ("BEL", "Belgian Franc (financial)"),
                            ("BZD", "Belize Dollar"),
                            ("BMD", "Bermudan Dollar"),
                            ("BTN", "Bhutanese Ngultrum"),
                            ("BOB", "Bolivian Boliviano"),
                            ("BOL", "Bolivian Boliviano (1863–1963)"),
                            ("BOV", "Bolivian Mvdol"),
                            ("BOP", "Bolivian Peso"),
                            ("BAM", "Bosnia-Herzegovina Convertible Mark"),
                            ("BAD", "Bosnia-Herzegovina Dinar (1992–1994)"),
                            ("BAN", "Bosnia-Herzegovina New Dinar (1994–1997)"),
                            ("BWP", "Botswanan Pula"),
                            ("BRC", "Brazilian Cruzado (1986–1989)"),
                            ("BRZ", "Brazilian Cruzeiro (1942–1967)"),
                            ("BRE", "Brazilian Cruzeiro (1990–1993)"),
                            ("BRR", "Brazilian Cruzeiro (1993–1994)"),
                            ("BRN", "Brazilian New Cruzado (1989–1990)"),
                            ("BRB", "Brazilian New Cruzeiro (1967–1986)"),
                            ("BRL", "Brazilian Real"),
                            ("GBP", "British Pound"),
                            ("BND", "Brunei Dollar"),
                            ("BGL", "Bulgarian Hard Lev"),
                            ("BGN", "Bulgarian Lev"),
                            ("BGO", "Bulgarian Lev (1879–1952)"),
                            ("BGM", "Bulgarian Socialist Lev"),
                            ("BUK", "Burmese Kyat"),
                            ("BIF", "Burundian Franc"),
                            ("XPF", "CFP Franc"),
                            ("KHR", "Cambodian Riel"),
                            ("CAD", "Canadian Dollar"),
                            ("CVE", "Cape Verdean Escudo"),
                            ("KYD", "Cayman Islands Dollar"),
                            ("XAF", "Central African CFA Franc"),
                            ("CLE", "Chilean Escudo"),
                            ("CLP", "Chilean Peso"),
                            ("CLF", "Chilean Unit of Account (UF)"),
                            ("CNX", "Chinese People’s Bank Dollar"),
                            ("CNY", "Chinese Yuan"),
                            ("CNH", "Chinese Yuan (offshore)"),
                            ("COP", "Colombian Peso"),
                            ("COU", "Colombian Real Value Unit"),
                            ("KMF", "Comorian Franc"),
                            ("CDF", "Congolese Franc"),
                            ("CRC", "Costa Rican Colón"),
                            ("HRD", "Croatian Dinar"),
                            ("HRK", "Croatian Kuna"),
                            ("CUC", "Cuban Convertible Peso"),
                            ("CUP", "Cuban Peso"),
                            ("CYP", "Cypriot Pound"),
                            ("CZK", "Czech Koruna"),
                            ("CSK", "Czechoslovak Hard Koruna"),
                            ("DKK", "Danish Krone"),
                            ("DJF", "Djiboutian Franc"),
                            ("DOP", "Dominican Peso"),
                            ("NLG", "Dutch Guilder"),
                            ("XCD", "East Caribbean Dollar"),
                            ("DDM", "East German Mark"),
                            ("ECS", "Ecuadorian Sucre"),
                            ("ECV", "Ecuadorian Unit of Constant Value"),
                            ("EGP", "Egyptian Pound"),
                            ("GQE", "Equatorial Guinean Ekwele"),
                            ("ERN", "Eritrean Nakfa"),
                            ("EEK", "Estonian Kroon"),
                            ("ETB", "Ethiopian Birr"),
                            ("EUR", "Euro"),
                            ("XBA", "European Composite Unit"),
                            ("XEU", "European Currency Unit"),
                            ("XBB", "European Monetary Unit"),
                            ("XBC", "European Unit of Account (XBC)"),
                            ("XBD", "European Unit of Account (XBD)"),
                            ("FKP", "Falkland Islands Pound"),
                            ("FJD", "Fijian Dollar"),
                            ("FIM", "Finnish Markka"),
                            ("FRF", "French Franc"),
                            ("XFO", "French Gold Franc"),
                            ("XFU", "French UIC-Franc"),
                            ("GMD", "Gambian Dalasi"),
                            ("GEK", "Georgian Kupon Larit"),
                            ("GEL", "Georgian Lari"),
                            ("DEM", "German Mark"),
                            ("GHS", "Ghanaian Cedi"),
                            ("GHC", "Ghanaian Cedi (1979–2007)"),
                            ("GIP", "Gibraltar Pound"),
                            ("XAU", "Gold"),
                            ("GRD", "Greek Drachma"),
                            ("GTQ", "Guatemalan Quetzal"),
                            ("GWP", "Guinea-Bissau Peso"),
                            ("GNF", "Guinean Franc"),
                            ("GNS", "Guinean Syli"),
                            ("GYD", "Guyanaese Dollar"),
                            ("HTG", "Haitian Gourde"),
                            ("HNL", "Honduran Lempira"),
                            ("HKD", "Hong Kong Dollar"),
                            ("HUF", "Hungarian Forint"),
                            ("IMP", "IMP"),
                            ("ISK", "Icelandic Króna"),
                            ("ISJ", "Icelandic Króna (1918–1981)"),
                            ("INR", "Indian Rupee"),
                            ("IDR", "Indonesian Rupiah"),
                            ("IRR", "Iranian Rial"),
                            ("IQD", "Iraqi Dinar"),
                            ("IEP", "Irish Pound"),
                            ("ILS", "Israeli New Shekel"),
                            ("ILP", "Israeli Pound"),
                            ("ILR", "Israeli Shekel (1980–1985)"),
                            ("ITL", "Italian Lira"),
                            ("JMD", "Jamaican Dollar"),
                            ("JPY", "Japanese Yen"),
                            ("JOD", "Jordanian Dinar"),
                            ("KZT", "Kazakhstani Tenge"),
                            ("KES", "Kenyan Shilling"),
                            ("KWD", "Kuwaiti Dinar"),
                            ("KGS", "Kyrgystani Som"),
                            ("LAK", "Laotian Kip"),
                            ("LVL", "Latvian Lats"),
                            ("LVR", "Latvian Ruble"),
                            ("LBP", "Lebanese Pound"),
                            ("LSL", "Lesotho Loti"),
                            ("LRD", "Liberian Dollar"),
                            ("LYD", "Libyan Dinar"),
                            ("LTL", "Lithuanian Litas"),
                            ("LTT", "Lithuanian Talonas"),
                            ("LUL", "Luxembourg Financial Franc"),
                            ("LUC", "Luxembourgian Convertible Franc"),
                            ("LUF", "Luxembourgian Franc"),
                            ("MOP", "Macanese Pataca"),
                            ("MKD", "Macedonian Denar"),
                            ("MKN", "Macedonian Denar (1992–1993)"),
                            ("MGA", "Malagasy Ariary"),
                            ("MGF", "Malagasy Franc"),
                            ("MWK", "Malawian Kwacha"),
                            ("MYR", "Malaysian Ringgit"),
                            ("MVR", "Maldivian Rufiyaa"),
                            ("MVP", "Maldivian Rupee (1947–1981)"),
                            ("MLF", "Malian Franc"),
                            ("MTL", "Maltese Lira"),
                            ("MTP", "Maltese Pound"),
                            ("MRU", "Mauritanian Ouguiya"),
                            ("MRO", "Mauritanian Ouguiya (1973–2017)"),
                            ("MUR", "Mauritian Rupee"),
                            ("MXV", "Mexican Investment Unit"),
                            ("MXN", "Mexican Peso"),
                            ("MXP", "Mexican Silver Peso (1861–1992)"),
                            ("MDC", "Moldovan Cupon"),
                            ("MDL", "Moldovan Leu"),
                            ("MCF", "Monegasque Franc"),
                            ("MNT", "Mongolian Tugrik"),
                            ("MAD", "Moroccan Dirham"),
                            ("MAF", "Moroccan Franc"),
                            ("MZE", "Mozambican Escudo"),
                            ("MZN", "Mozambican Metical"),
                            ("MZM", "Mozambican Metical (1980–2006)"),
                            ("MMK", "Myanmar Kyat"),
                            ("NAD", "Namibian Dollar"),
                            ("NPR", "Nepalese Rupee"),
                            ("ANG", "Netherlands Antillean Guilder"),
                            ("TWD", "New Taiwan Dollar"),
                            ("NZD", "New Zealand Dollar"),
                            ("NIO", "Nicaraguan Córdoba"),
                            ("NIC", "Nicaraguan Córdoba (1988–1991)"),
                            ("NGN", "Nigerian Naira"),
                            ("KPW", "North Korean Won"),
                            ("NOK", "Norwegian Krone"),
                            ("OMR", "Omani Rial"),
                            ("PKR", "Pakistani Rupee"),
                            ("XPD", "Palladium"),
                            ("PAB", "Panamanian Balboa"),
                            ("PGK", "Papua New Guinean Kina"),
                            ("PYG", "Paraguayan Guarani"),
                            ("PEI", "Peruvian Inti"),
                            ("PEN", "Peruvian Sol"),
                            ("PES", "Peruvian Sol (1863–1965)"),
                            ("PHP", "Philippine Peso"),
                            ("XPT", "Platinum"),
                            ("PLN", "Polish Zloty"),
                            ("PLZ", "Polish Zloty (1950–1995)"),
                            ("PTE", "Portuguese Escudo"),
                            ("GWE", "Portuguese Guinea Escudo"),
                            ("QAR", "Qatari Rial"),
                            ("XRE", "RINET Funds"),
                            ("RHD", "Rhodesian Dollar"),
                            ("RON", "Romanian Leu"),
                            ("ROL", "Romanian Leu (1952–2006)"),
                            ("RUB", "Russian Ruble"),
                            ("RUR", "Russian Ruble (1991–1998)"),
                            ("RWF", "Rwandan Franc"),
                            ("SVC", "Salvadoran Colón"),
                            ("WST", "Samoan Tala"),
                            ("SAR", "Saudi Riyal"),
                            ("RSD", "Serbian Dinar"),
                            ("CSD", "Serbian Dinar (2002–2006)"),
                            ("SCR", "Seychellois Rupee"),
                            ("SLL", "Sierra Leonean Leone"),
                            ("XAG", "Silver"),
                            ("SGD", "Singapore Dollar"),
                            ("SKK", "Slovak Koruna"),
                            ("SIT", "Slovenian Tolar"),
                            ("SBD", "Solomon Islands Dollar"),
                            ("SOS", "Somali Shilling"),
                            ("ZAR", "South African Rand"),
                            ("ZAL", "South African Rand (financial)"),
                            ("KRH", "South Korean Hwan (1953–1962)"),
                            ("KRW", "South Korean Won"),
                            ("KRO", "South Korean Won (1945–1953)"),
                            ("SSP", "South Sudanese Pound"),
                            ("SUR", "Soviet Rouble"),
                            ("ESP", "Spanish Peseta"),
                            ("ESA", "Spanish Peseta (A account)"),
                            ("ESB", "Spanish Peseta (convertible account)"),
                            ("XDR", "Special Drawing Rights"),
                            ("LKR", "Sri Lankan Rupee"),
                            ("SHP", "St. Helena Pound"),
                            ("XSU", "Sucre"),
                            ("SDD", "Sudanese Dinar (1992–2007)"),
                            ("SDG", "Sudanese Pound"),
                            ("SDP", "Sudanese Pound (1957–1998)"),
                            ("SRD", "Surinamese Dollar"),
                            ("SRG", "Surinamese Guilder"),
                            ("SZL", "Swazi Lilangeni"),
                            ("SEK", "Swedish Krona"),
                            ("CHF", "Swiss Franc"),
                            ("SYP", "Syrian Pound"),
                            ("STN", "São Tomé & Príncipe Dobra"),
                            ("STD", "São Tomé & Príncipe Dobra (1977–2017)"),
                            ("TVD", "TVD"),
                            ("TJR", "Tajikistani Ruble"),
                            ("TJS", "Tajikistani Somoni"),
                            ("TZS", "Tanzanian Shilling"),
                            ("XTS", "Testing Currency Code"),
                            ("THB", "Thai Baht"),
                            (
                                "XXX",
                                "The codes assigned for transactions where no currency is involved",
                            ),
                            ("TPE", "Timorese Escudo"),
                            ("TOP", "Tongan Paʻanga"),
                            ("TTD", "Trinidad & Tobago Dollar"),
                            ("TND", "Tunisian Dinar"),
                            ("TRY", "Turkish Lira"),
                            ("TRL", "Turkish Lira (1922–2005)"),
                            ("TMT", "Turkmenistani Manat"),
                            ("TMM", "Turkmenistani Manat (1993–2009)"),
                            ("USD", "US Dollar"),
                            ("USN", "US Dollar (Next day)"),
                            ("USS", "US Dollar (Same day)"),
                            ("UGX", "Ugandan Shilling"),
                            ("UGS", "Ugandan Shilling (1966–1987)"),
                            ("UAH", "Ukrainian Hryvnia"),
                            ("UAK", "Ukrainian Karbovanets"),
                            ("AED", "United Arab Emirates Dirham"),
                            ("UYW", "Uruguayan Nominal Wage Index Unit"),
                            ("UYU", "Uruguayan Peso"),
                            ("UYP", "Uruguayan Peso (1975–1993)"),
                            ("UYI", "Uruguayan Peso (Indexed Units)"),
                            ("UZS", "Uzbekistani Som"),
                            ("VUV", "Vanuatu Vatu"),
                            ("VES", "Venezuelan Bolívar"),
                            ("VEB", "Venezuelan Bolívar (1871–2008)"),
                            ("VEF", "Venezuelan Bolívar (2008–2018)"),
                            ("VND", "Vietnamese Dong"),
                            ("VNN", "Vietnamese Dong (1978–1985)"),
                            ("CHE", "WIR Euro"),
                            ("CHW", "WIR Franc"),
                            ("XOF", "West African CFA Franc"),
                            ("YDD", "Yemeni Dinar"),
                            ("YER", "Yemeni Rial"),
                            ("YUN", "Yugoslavian Convertible Dinar (1990–1992)"),
random
# Generated by Django 4.0.6 on 2022-07-26 05:40

from django.db import migrations, models
import django.db.models.deletion
import djmoney.models.fields
import uuid


class Migration(migrations.Migration):

    dependencies = [
        ("billing", "0006_alter_event_options_event_idempotency_id"),
    ]

    operations = [
        migrations.CreateModel(
            name="Subscription",
            fields=[
                (
                    "id",
                    models.CharField(
                        default=uuid.uuid4,
                        max_length=36,
                        primary_key=True,
                        serialize=False,
                    ),
                ),
                ("start_date", models.DateTimeField(auto_now=True, max_length=100)),
                ("end_date", models.DateTimeField(auto_now=True, max_length=100)),
                (
                    "status",
                    models.CharField(
                        choices=[("active", "Active"), ("ended", "Ended")],
                        default="active",
                        max_length=6,
                    ),
                ),
                (
                    "billing_plan",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        to="billing.billingplan",
                    ),
                ),
                (
                    "customer",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        to="billing.customer",
                    ),
                ),
            ],
        ),
        migrations.CreateModel(
            name="Invoice",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "cost_due_currency",
                    djmoney.models.fields.CurrencyField(
                        choices=[
                            ("XUA", "ADB Unit of Account"),
                            ("AFN", "Afghan Afghani"),
                            ("AFA", "Afghan Afghani (1927–2002)"),
                            ("ALL", "Albanian Lek"),
                            ("ALK", "Albanian Lek (1946–1965)"),
                            ("DZD", "Algerian Dinar"),
                            ("ADP", "Andorran Peseta"),
                            ("AOA", "Angolan Kwanza"),
                            ("AOK", "Angolan Kwanza (1977–1991)"),
                            ("AON", "Angolan New Kwanza (1990–2000)"),
                            ("AOR", "Angolan Readjusted Kwanza (1995–1999)"),
                            ("ARA", "Argentine Austral"),
                            ("ARS", "Argentine Peso"),
                            ("ARM", "Argentine Peso (1881–1970)"),
                            ("ARP", "Argentine Peso (1983–1985)"),
                            ("ARL", "Argentine Peso Ley (1970–1983)"),
                            ("AMD", "Armenian Dram"),
                            ("AWG", "Aruban Florin"),
                            ("AUD", "Australian Dollar"),
                            ("ATS", "Austrian Schilling"),
                            ("AZN", "Azerbaijani Manat"),
                            ("AZM", "Azerbaijani Manat (1993–2006)"),
                            ("BSD", "Bahamian Dollar"),
                            ("BHD", "Bahraini Dinar"),
                            ("BDT", "Bangladeshi Taka"),
                            ("BBD", "Barbadian Dollar"),
                            ("BYN", "Belarusian Ruble"),
                            ("BYB", "Belarusian Ruble (1994–1999)"),
                            ("BYR", "Belarusian Ruble (2000–2016)"),
                            ("BEF", "Belgian Franc"),
                            ("BEC", "Belgian Franc (convertible)"),
                            ("BEL", "Belgian Franc (financial)"),
                            ("BZD", "Belize Dollar"),
                            ("BMD", "Bermudan Dollar"),
                            ("BTN", "Bhutanese Ngultrum"),
                            ("BOB", "Bolivian Boliviano"),
                            ("BOL", "Bolivian Boliviano (1863–1963)"),
                            ("BOV", "Bolivian Mvdol"),
                            ("BOP", "Bolivian Peso"),
                            ("BAM", "Bosnia-Herzegovina Convertible Mark"),
                            ("BAD", "Bosnia-Herzegovina Dinar (1992–1994)"),
                            ("BAN", "Bosnia-Herzegovina New Dinar (1994–1997)"),
                            ("BWP", "Botswanan Pula"),
                            ("BRC", "Brazilian Cruzado (1986–1989)"),
                            ("BRZ", "Brazilian Cruzeiro (1942–1967)"),
                            ("BRE", "Brazilian Cruzeiro (1990–1993)"),
                            ("BRR", "Brazilian Cruzeiro (1993–1994)"),
                            ("BRN", "Brazilian New Cruzado (1989–1990)"),
                            ("BRB", "Brazilian New Cruzeiro (1967–1986)"),
                            ("BRL", "Brazilian Real"),
                            ("GBP", "British Pound"),
                            ("BND", "Brunei Dollar"),
                            ("BGL", "Bulgarian Hard Lev"),
                            ("BGN", "Bulgarian Lev"),
                            ("BGO", "Bulgarian Lev (1879–1952)"),
                            ("BGM", "Bulgarian Socialist Lev"),
                            ("BUK", "Burmese Kyat"),
                            ("BIF", "Burundian Franc"),
                            ("XPF", "CFP Franc"),
                            ("KHR", "Cambodian Riel"),
                            ("CAD", "Canadian Dollar"),
                            ("CVE", "Cape Verdean Escudo"),
                            ("KYD", "Cayman Islands Dollar"),
                            ("XAF", "Central African CFA Franc"),
                            ("CLE", "Chilean Escudo"),
                            ("CLP", "Chilean Peso"),
                            ("CLF", "Chilean Unit of Account (UF)"),
                            ("CNX", "Chinese People’s Bank Dollar"),
                            ("CNY", "Chinese Yuan"),
                            ("CNH", "Chinese Yuan (offshore)"),
                            ("COP", "Colombian Peso"),
                            ("COU", "Colombian Real Value Unit"),
                            ("KMF", "Comorian Franc"),
                            ("CDF", "Congolese Franc"),
                            ("CRC", "Costa Rican Colón"),
                            ("HRD", "Croatian Dinar"),
                            ("HRK", "Croatian Kuna"),
                            ("CUC", "Cuban Convertible Peso"),
                            ("CUP", "Cuban Peso"),
                            ("CYP", "Cypriot Pound"),
                            ("CZK", "Czech Koruna"),
                            ("CSK", "Czechoslovak Hard Koruna"),
                            ("DKK", "Danish Krone"),
                            ("DJF", "Djiboutian Franc"),
                            ("DOP", "Dominican Peso"),
                            ("NLG", "Dutch Guilder"),
                            ("XCD", "East Caribbean Dollar"),
                            ("DDM", "East German Mark"),
                            ("ECS", "Ecuadorian Sucre"),
                            ("ECV", "Ecuadorian Unit of Constant Value"),
                            ("EGP", "Egyptian Pound"),
                            ("GQE", "Equatorial Guinean Ekwele"),
                            ("ERN", "Eritrean Nakfa"),
                            ("EEK", "Estonian Kroon"),
                            ("ETB", "Ethiopian Birr"),
                            ("EUR", "Euro"),
                            ("XBA", "European Composite Unit"),
                            ("XEU", "European Currency Unit"),
                            ("XBB", "European Monetary Unit"),
                            ("XBC", "European Unit of Account (XBC)"),
                            ("XBD", "European Unit of Account (XBD)"),
                            ("FKP", "Falkland Islands Pound"),
                            ("FJD", "Fijian Dollar"),
                            ("FIM", "Finnish Markka"),
                            ("FRF", "French Franc"),
                            ("XFO", "French Gold Franc"),
                            ("XFU", "French UIC-Franc"),
                            ("GMD", "Gambian Dalasi"),
                            ("GEK", "Georgian Kupon Larit"),
                            ("GEL", "Georgian Lari"),
                            ("DEM", "German Mark"),
                            ("GHS", "Ghanaian Cedi"),
                            ("GHC", "Ghanaian Cedi (1979–2007)"),
                            ("GIP", "Gibraltar Pound"),
                            ("XAU", "Gold"),
                            ("GRD", "Greek Drachma"),
                            ("GTQ", "Guatemalan Quetzal"),
                            ("GWP", "Guinea-Bissau Peso"),
                            ("GNF", "Guinean Franc"),
                            ("GNS", "Guinean Syli"),
                            ("GYD", "Guyanaese Dollar"),
                            ("HTG", "Haitian Gourde"),
                            ("HNL", "Honduran Lempira"),
                            ("HKD", "Hong Kong Dollar"),
                            ("HUF", "Hungarian Forint"),
                            ("IMP", "IMP"),
                            ("ISK", "Icelandic Króna"),
                            ("ISJ", "Icelandic Króna (1918–1981)"),
                            ("INR", "Indian Rupee"),
                            ("IDR", "Indonesian Rupiah"),
                            ("IRR", "Iranian Rial"),
                            ("IQD", "Iraqi Dinar"),
                            ("IEP", "Irish Pound"),
                            ("ILS", "Israeli New Shekel"),
                            ("ILP", "Israeli Pound"),
                            ("ILR", "Israeli Shekel (1980–1985)"),
                            ("ITL", "Italian Lira"),
                            ("JMD", "Jamaican Dollar"),
                            ("JPY", "Japanese Yen"),
                            ("JOD", "Jordanian Dinar"),
                            ("KZT", "Kazakhstani Tenge"),
                            ("KES", "Kenyan Shilling"),
                            ("KWD", "Kuwaiti Dinar"),
                            ("KGS", "Kyrgystani Som"),
                            ("LAK", "Laotian Kip"),
                            ("LVL", "Latvian Lats"),
                            ("LVR", "Latvian Ruble"),
                            ("LBP", "Lebanese Pound"),
                            ("LSL", "Lesotho Loti"),
                            ("LRD", "Liberian Dollar"),
                            ("LYD", "Libyan Dinar"),
                            ("LTL", "Lithuanian Litas"),
                            ("LTT", "Lithuanian Talonas"),
                            ("LUL", "Luxembourg Financial Franc"),
                            ("LUC", "Luxembourgian Convertible Franc"),
                            ("LUF", "Luxembourgian Franc"),
                            ("MOP", "Macanese Pataca"),
                            ("MKD", "Macedonian Denar"),
                            ("MKN", "Macedonian Denar (1992–1993)"),
                            ("MGA", "Malagasy Ariary"),
                            ("MGF", "Malagasy Franc"),
                            ("MWK", "Malawian Kwacha"),
                            ("MYR", "Malaysian Ringgit"),
                            ("MVR", "Maldivian Rufiyaa"),
                            ("MVP", "Maldivian Rupee (1947–1981)"),
                            ("MLF", "Malian Franc"),
                            ("MTL", "Maltese Lira"),
                            ("MTP", "Maltese Pound"),
                            ("MRU", "Mauritanian Ouguiya"),
                            ("MRO", "Mauritanian Ouguiya (1973–2017)"),
                            ("MUR", "Mauritian Rupee"),
                            ("MXV", "Mexican Investment Unit"),
                            ("MXN", "Mexican Peso"),
                            ("MXP", "Mexican Silver Peso (1861–1992)"),
                            ("MDC", "Moldovan Cupon"),
                            ("MDL", "Moldovan Leu"),
                            ("MCF", "Monegasque Franc"),
                            ("MNT", "Mongolian Tugrik"),
                            ("MAD", "Moroccan Dirham"),
                            ("MAF", "Moroccan Franc"),
                            ("MZE", "Mozambican Escudo"),
                            ("MZN", "Mozambican Metical"),
                            ("MZM", "Mozambican Metical (1980–2006)"),
                            ("MMK", "Myanmar Kyat"),
                            ("NAD", "Namibian Dollar"),
                            ("NPR", "Nepalese Rupee"),
                            ("ANG", "Netherlands Antillean Guilder"),
                            ("TWD", "New Taiwan Dollar"),
                            ("NZD", "New Zealand Dollar"),
                            ("NIO", "Nicaraguan Córdoba"),
                            ("NIC", "Nicaraguan Córdoba (1988–1991)"),
                            ("NGN", "Nigerian Naira"),
                            ("KPW", "North Korean Won"),
                            ("NOK", "Norwegian Krone"),
                            ("OMR", "Omani Rial"),
                            ("PKR", "Pakistani Rupee"),
                            ("XPD", "Palladium"),
                            ("PAB", "Panamanian Balboa"),
                            ("PGK", "Papua New Guinean Kina"),
                            ("PYG", "Paraguayan Guarani"),
                            ("PEI", "Peruvian Inti"),
                            ("PEN", "Peruvian Sol"),
                            ("PES", "Peruvian Sol (1863–1965)"),
                            ("PHP", "Philippine Peso"),
                            ("XPT", "Platinum"),
                            ("PLN", "Polish Zloty"),
                            ("PLZ", "Polish Zloty (1950–1995)"),
                            ("PTE", "Portuguese Escudo"),
                            ("GWE", "Portuguese Guinea Escudo"),
                            ("QAR", "Qatari Rial"),
                            ("XRE", "RINET Funds"),
                            ("RHD", "Rhodesian Dollar"),
                            ("RON", "Romanian Leu"),
                            ("ROL", "Romanian Leu (1952–2006)"),
                            ("RUB", "Russian Ruble"),
                            ("RUR", "Russian Ruble (1991–1998)"),
                            ("RWF", "Rwandan Franc"),
                            ("SVC", "Salvadoran Colón"),
                            ("WST", "Samoan Tala"),
                            ("SAR", "Saudi Riyal"),
                            ("RSD", "Serbian Dinar"),
                            ("CSD", "Serbian Dinar (2002–2006)"),
                            ("SCR", "Seychellois Rupee"),
                            ("SLL", "Sierra Leonean Leone"),
                            ("XAG", "Silver"),
                            ("SGD", "Singapore Dollar"),
                            ("SKK", "Slovak Koruna"),
                            ("SIT", "Slovenian Tolar"),
                            ("SBD", "Solomon Islands Dollar"),
                            ("SOS", "Somali Shilling"),
                            ("ZAR", "South African Rand"),
                            ("ZAL", "South African Rand (financial)"),
                            ("KRH", "South Korean Hwan (1953–1962)"),
                            ("KRW", "South Korean Won"),
                            ("KRO", "South Korean Won (1945–1953)"),
                            ("SSP", "South Sudanese Pound"),
                            ("SUR", "Soviet Rouble"),
                            ("ESP", "Spanish Peseta"),
                            ("ESA", "Spanish Peseta (A account)"),
                            ("ESB", "Spanish Peseta (convertible account)"),
                            ("XDR", "Special Drawing Rights"),
                            ("LKR", "Sri Lankan Rupee"),
                            ("SHP", "St. Helena Pound"),
                            ("XSU", "Sucre"),
                            ("SDD", "Sudanese Dinar (1992–2007)"),
                            ("SDG", "Sudanese Pound"),
                            ("SDP", "Sudanese Pound (1957–1998)"),
                            ("SRD", "Surinamese Dollar"),
                            ("SRG", "Surinamese Guilder"),
                            ("SZL", "Swazi Lilangeni"),
                            ("SEK", "Swedish Krona"),
                            ("CHF", "Swiss Franc"),
                            ("SYP", "Syrian Pound"),
                            ("STN", "São Tomé & Príncipe Dobra"),
                            ("STD", "São Tomé & Príncipe Dobra (1977–2017)"),
                            ("TVD", "TVD"),
                            ("TJR", "Tajikistani Ruble"),
                            ("TJS", "Tajikistani Somoni"),
                            ("TZS", "Tanzanian Shilling"),
                            ("XTS", "Testing Currency Code"),
                            ("THB", "Thai Baht"),
                            (
                                "XXX",
                                "The codes assigned for transactions where no currency is involved",
                            ),
                            ("TPE", "Timorese Escudo"),
                            ("TOP", "Tongan Paʻanga"),
                            ("TTD", "Trinidad & Tobago Dollar"),
                            ("TND", "Tunisian Dinar"),
                            ("TRY", "Turkish Lira"),
                            ("TRL", "Turkish Lira (1922–2005)"),
                            ("TMT", "Turkmenistani Manat"),
                            ("TMM", "Turkmenistani Manat (1993–2009)"),
                            ("USD", "US Dollar"),
                            ("USN", "US Dollar (Next day)"),
                            ("USS", "US Dollar (Same day)"),
                            ("UGX", "Ugandan Shilling"),
                            ("UGS", "Ugandan Shilling (1966–1987)"),
                            ("UAH", "Ukrainian Hryvnia"),
                            ("UAK", "Ukrainian Karbovanets"),
                            ("AED", "United Arab Emirates Dirham"),
                            ("UYW", "Uruguayan Nominal Wage Index Unit"),
                            ("UYU", "Uruguayan Peso"),
                            ("UYP", "Uruguayan Peso (1975–1993)"),
                            ("UYI", "Uruguayan Peso (Indexed Units)"),
                            ("UZS", "Uzbekistani Som"),
                            ("VUV", "Vanuatu Vatu"),
                            ("VES", "Venezuelan Bolívar"),
                            ("VEB", "Venezuelan Bolívar (1871–2008)"),
                            ("VEF", "Venezuelan Bolívar (2008–2018)"),
                            ("VND", "Vietnamese Dong"),
                            ("VNN", "Vietnamese Dong (1978–1985)"),
                            ("CHE", "WIR Euro"),
                            ("CHW", "WIR Franc"),
                            ("XOF", "West African CFA Franc"),
                            ("YDD", "Yemeni Dinar"),
                            ("YER", "Yemeni Rial"),
                            ("YUN", "Yugoslavian Convertible Dinar (1990–1992)"),
                            ("YUD", "Yugoslavian Hard Dinar (1966–1990)"),
                            ("YUM", "Yugoslavian New Dinar (1994–2002)"),
                            ("YUR", "Yugoslavian Reformed Dinar (1992–1993)"),
                            ("ZWN", "ZWN"),
                            ("ZRN", "Zairean New Zaire (1993–1998)"),
                            ("ZRZ", "Zairean Zaire (1971–1993)"),
                            ("ZMW", "Zambian Kwacha"),
                            ("ZMK", "Zambian Kwacha (1968–2012)"),
                            ("ZWD", "Zimbabwean Dollar (1980–2008)"),
                            ("ZWR", "Zimbabwean Dollar (2008)"),
                            ("ZWL", "Zimbabwean Dollar (2009)"),
                        ],
                        default=None,
                        editable=False,
                        max_length=3,
                        null=True,
                    ),
                ),
                (
                    "cost_due",
                    djmoney.models.fields.MoneyField(
                        decimal_places=2, max_digits=10, null=True
                    ),
                ),
                ("currency", models.CharField(default="USD", max_length=10)),
random
# Generated by Django 4.0.6 on 2022-07-26 05:40

from django.db import migrations, models
import django.db.models.deletion
import djmoney.models.fields
import uuid


class Migration(migrations.Migration):

    dependencies = [
        ("billing", "0006_alter_event_options_event_idempotency_id"),
    ]

    operations = [
        migrations.CreateModel(
            name="Subscription",
            fields=[
                (
                    "id",
                    models.CharField(
                        default=uuid.uuid4,
                        max_length=36,
                        primary_key=True,
                        serialize=False,
                    ),
                ),
                ("start_date", models.DateTimeField(auto_now=True, max_length=100)),
                ("end_date", models.DateTimeField(auto_now=True, max_length=100)),
                (
                    "status",
                    models.CharField(
                        choices=[("active", "Active"), ("ended", "Ended")],
                        default="active",
                        max_length=6,
                    ),
                ),
                (
                    "billing_plan",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        to="billing.billingplan",
                    ),
                ),
                (
                    "customer",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        to="billing.customer",
                    ),
                ),
            ],
        ),
        migrations.CreateModel(
            name="Invoice",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "cost_due_currency",
                    djmoney.models.fields.CurrencyField(
                        choices=[
                            ("XUA", "ADB Unit of Account"),
                            ("AFN", "Afghan Afghani"),
                            ("AFA", "Afghan Afghani (1927–2002)"),
                            ("ALL", "Albanian Lek"),
                            ("ALK", "Albanian Lek (1946–1965)"),
                            ("DZD", "Algerian Dinar"),
                            ("ADP", "Andorran Peseta"),
                            ("AOA", "Angolan Kwanza"),
                            ("AOK", "Angolan Kwanza (1977–1991)"),
                            ("AON", "Angolan New Kwanza (1990–2000)"),
                            ("AOR", "Angolan Readjusted Kwanza (1995–1999)"),
                            ("ARA", "Argentine Austral"),
                            ("ARS", "Argentine Peso"),
                            ("ARM", "Argentine Peso (1881–1970)"),
                            ("ARP", "Argentine Peso (1983–1985)"),
                            ("ARL", "Argentine Peso Ley (1970–1983)"),
                            ("AMD", "Armenian Dram"),
                            ("AWG", "Aruban Florin"),
                            ("AUD", "Australian Dollar"),
                            ("ATS", "Austrian Schilling"),
                            ("AZN", "Azerbaijani Manat"),
                            ("AZM", "Azerbaijani Manat (1993–2006)"),
                            ("BSD", "Bahamian Dollar"),
                            ("BHD", "Bahraini Dinar"),
                            ("BDT", "Bangladeshi Taka"),
                            ("BBD", "Barbadian Dollar"),
                            ("BYN", "Belarusian Ruble"),
                            ("BYB", "Belarusian Ruble (1994–1999)"),
                            ("BYR", "Belarusian Ruble (2000–2016)"),
                            ("BEF", "Belgian Franc"),
                            ("BEC", "Belgian Franc (convertible)"),
                            ("BEL", "Belgian Franc (financial)"),
                            ("BZD", "Belize Dollar"),
                            ("BMD", "Bermudan Dollar"),
                            ("BTN", "Bhutanese Ngultrum"),
                            ("BOB", "Bolivian Boliviano"),
                            ("BOL", "Bolivian Boliviano (1863–1963)"),
                            ("BOV", "Bolivian Mvdol"),
                            ("BOP", "Bolivian Peso"),
                            ("BAM", "Bosnia-Herzegovina Convertible Mark"),
                            ("BAD", "Bosnia-Herzegovina Dinar (1992–1994)"),
                            ("BAN", "Bosnia-Herzegovina New Dinar (1994–1997)"),
                            ("BWP", "Botswanan Pula"),
                            ("BRC", "Brazilian Cruzado (1986–1989)"),
                            ("BRZ", "Brazilian Cruzeiro (1942–1967)"),
                            ("BRE", "Brazilian Cruzeiro (1990–1993)"),
                            ("BRR", "Brazilian Cruzeiro (1993–1994)"),
                            ("BRN", "Brazilian New Cruzado (1989–1990)"),
                            ("BRB", "Brazilian New Cruzeiro (1967–1986)"),
                            ("BRL", "Brazilian Real"),
                            ("GBP", "British Pound"),
                            ("BND", "Brunei Dollar"),
                            ("BGL", "Bulgarian Hard Lev"),
                            ("BGN", "Bulgarian Lev"),
                            ("BGO", "Bulgarian Lev (1879–1952)"),
                            ("BGM", "Bulgarian Socialist Lev"),
                            ("BUK", "Burmese Kyat"),
                            ("BIF", "Burundian Franc"),
                            ("XPF", "CFP Franc"),
                            ("KHR", "Cambodian Riel"),
                            ("CAD", "Canadian Dollar"),
                            ("CVE", "Cape Verdean Escudo"),
                            ("KYD", "Cayman Islands Dollar"),
                            ("XAF", "Central African CFA Franc"),
                            ("CLE", "Chilean Escudo"),
                            ("CLP", "Chilean Peso"),
                            ("CLF", "Chilean Unit of Account (UF)"),
                            ("CNX", "Chinese People’s Bank Dollar"),
                            ("CNY", "Chinese Yuan"),
                            ("CNH", "Chinese Yuan (offshore)"),
                            ("COP", "Colombian Peso"),
                            ("COU", "Colombian Real Value Unit"),
                            ("KMF", "Comorian Franc"),
                            ("CDF", "Congolese Franc"),
                            ("CRC", "Costa Rican Colón"),
                            ("HRD", "Croatian Dinar"),
                            ("HRK", "Croatian Kuna"),
                            ("CUC", "Cuban Convertible Peso"),
                            ("CUP", "Cuban Peso"),
                            ("CYP", "Cypriot Pound"),
                            ("CZK", "Czech Koruna"),
                            ("CSK", "Czechoslovak Hard Koruna"),
                            ("DKK", "Danish Krone"),
                            ("DJF", "Djiboutian Franc"),
                            ("DOP", "Dominican Peso"),
                            ("NLG", "Dutch Guilder"),
                            ("XCD", "East Caribbean Dollar"),
                            ("DDM", "East German Mark"),
                            ("ECS", "Ecuadorian Sucre"),
                            ("ECV", "Ecuadorian Unit of Constant Value"),
                            ("EGP", "Egyptian Pound"),
                            ("GQE", "Equatorial Guinean Ekwele"),
random
import uuid # Generated by Django 4.0.6 on 2022-07-26 05:40     ] class Migration(migrations.Migration):                             ("TND", "Tunisian Dinar"),                         editable=False,                             ("YUD", "Yugoslavian Hard Dinar (1966–1990)"),                 ("time_created", models.DateTimeField(auto_now=True, max_length=100)),                             ("ERN", "Eritrean Nakfa"),