-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from TheWitcher1991/develop
Develop
- Loading branch information
Showing
82 changed files
with
660 additions
and
113 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
__pycache__ | ||
venv | ||
.venv | ||
.git | ||
.gitignore | ||
.gitattributes | ||
.github | ||
.idea | ||
docs | ||
scripts | ||
bin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
__pycache__ | ||
*.pyc | ||
*.pyo | ||
*.pyd | ||
.Python | ||
pip-log.txt | ||
pip-delete-this-directory.txt | ||
.tox | ||
.coverage | ||
.coverage.* | ||
.cache | ||
.gitignore | ||
nosetests.xml | ||
coverage.xml | ||
.flake8 | ||
*,cover | ||
.git | ||
venv | ||
.pre-commit-config.yaml | ||
.pre-commit-hooks.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
ZOOKEEPER_CLIENT_PORT=2181 | ||
ZOOKEEPER_TICK_TIME=2000 | ||
|
||
KAFKA_BROKER_ID=1 | ||
KAFKA_ZOOKEEPER_CONNECT=zookeeper:2181 | ||
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP=PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT | ||
KAFKA_ADVERTISED_LISTENERS=PLAINTEXT://kafka:29092,PLAINTEXT_HOST://localhost:9092 | ||
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR=1 | ||
KAFKA_GROUP_INITIAL_REBALANCE_DELAY_MS=0 | ||
KAFKA_CONFLUENT_LICENSE_TOPIC_REPLICATION_FACTOR=1 | ||
KAFKA_CONFLUENT_BALANCER_TOPIC_REPLICATION_FACTOR=1 | ||
KAFKA_TRANSACTION_STATE_LOG_MIN_ISR=1 | ||
KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR=1 | ||
KAFKA_JMX_PORT=9997 | ||
KAFKA_JMX_HOSTNAME=kafka |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,131 @@ | ||
# Generated by Django 5.1 on 2024-10-05 07:42 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
initial = True | ||
|
||
dependencies = [] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name="Invoice", | ||
fields=[ | ||
("id", models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")), | ||
("created", models.DateTimeField(auto_now_add=True, verbose_name="Дата создания")), | ||
("updated", models.DateTimeField(auto_now=True, verbose_name="Дата обновления")), | ||
( | ||
"payment_id", | ||
models.CharField(blank=True, max_length=255, null=True, verbose_name="ID платежа YooKassa"), | ||
), | ||
("payment_url", models.URLField(blank=True, null=True, verbose_name="Ссылка на оплату")), | ||
( | ||
"payment_method", | ||
models.CharField( | ||
blank=True, | ||
choices=[ | ||
("bank_card", "Банковская карта"), | ||
("sberbank", "SberPay"), | ||
("tinkoff_bank", "T‑Pay"), | ||
("sbp", "СБП (Система быстрых платежей)"), | ||
("yoo_money", "ЮMoney"), | ||
("balance", "С лицевого счета"), | ||
("cashless", "Безналичная оплата"), | ||
], | ||
max_length=32, | ||
null=True, | ||
verbose_name="Способ оплаты", | ||
), | ||
), | ||
( | ||
"payer_type", | ||
models.CharField( | ||
choices=[("INDIVIDUAL", "Физическое лицо"), ("LEGAL", "ЮЛ / ИП")], | ||
default="INDIVIDUAL", | ||
max_length=32, | ||
verbose_name="Тип плательщика", | ||
), | ||
), | ||
( | ||
"target", | ||
models.CharField( | ||
choices=[("BALANCE", "Пополнение баланса"), ("SERVICE", "Оплата услуги")], | ||
max_length=32, | ||
verbose_name="Цель оплаты", | ||
), | ||
), | ||
( | ||
"description", | ||
models.CharField(blank=True, max_length=255, null=True, verbose_name="Назначение платежа"), | ||
), | ||
( | ||
"amount", | ||
models.DecimalField( | ||
blank=True, decimal_places=2, default=0, max_digits=10, null=True, verbose_name="Сумма оплаты" | ||
), | ||
), | ||
("is_paid", models.BooleanField(default=False, verbose_name="Оплачен")), | ||
( | ||
"expires_at", | ||
models.DateTimeField(blank=True, null=True, verbose_name="Дата истечения срока действия"), | ||
), | ||
("captured_at", models.DateTimeField(blank=True, null=True, verbose_name="Дата оплаты счета")), | ||
], | ||
options={ | ||
"verbose_name": "Счет", | ||
"verbose_name_plural": "Счета", | ||
"ordering": ("-created",), | ||
}, | ||
), | ||
migrations.CreateModel( | ||
name="InvoiceOrder", | ||
fields=[ | ||
("id", models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")), | ||
("created", models.DateTimeField(auto_now_add=True, verbose_name="Дата создания")), | ||
("updated", models.DateTimeField(auto_now=True, verbose_name="Дата обновления")), | ||
("quantity", models.PositiveIntegerField(default=1, verbose_name="Количество")), | ||
], | ||
options={ | ||
"verbose_name": "Услуга по счету", | ||
"verbose_name_plural": "Услуги по счетам", | ||
}, | ||
), | ||
migrations.CreateModel( | ||
name="Transaction", | ||
fields=[ | ||
("id", models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")), | ||
("created", models.DateTimeField(auto_now_add=True, verbose_name="Дата создания")), | ||
("updated", models.DateTimeField(auto_now=True, verbose_name="Дата обновления")), | ||
( | ||
"amount", | ||
models.DecimalField( | ||
blank=True, | ||
decimal_places=2, | ||
default=0, | ||
max_digits=10, | ||
null=True, | ||
verbose_name="Сумма транзакции", | ||
), | ||
), | ||
( | ||
"transaction_type", | ||
models.CharField( | ||
choices=[("DEPOSIT", "Доход"), ("WITHDRAWAL", "Расход"), ("TRANSFER", "Перевод средств")], | ||
max_length=32, | ||
verbose_name="Тип транзакции", | ||
), | ||
), | ||
( | ||
"description", | ||
models.CharField(blank=True, max_length=255, null=True, verbose_name="Описание транзакции"), | ||
), | ||
], | ||
options={ | ||
"verbose_name": "Транзакция", | ||
"verbose_name_plural": "Транзакции", | ||
"ordering": ("-created",), | ||
}, | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# Generated by Django 5.1 on 2024-10-05 07:42 | ||
|
||
import django.db.models.deletion | ||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
initial = True | ||
|
||
dependencies = [ | ||
("business", "0001_initial"), | ||
("employee", "0001_initial"), | ||
("patient", "0001_initial"), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name="invoice", | ||
name="patient", | ||
field=models.ForeignKey( | ||
on_delete=django.db.models.deletion.CASCADE, related_name="invoices", to="patient.patient" | ||
), | ||
), | ||
migrations.AddField( | ||
model_name="invoiceorder", | ||
name="invoice", | ||
field=models.ForeignKey( | ||
on_delete=django.db.models.deletion.CASCADE, related_name="services", to="business.invoice" | ||
), | ||
), | ||
migrations.AddField( | ||
model_name="invoiceorder", | ||
name="service", | ||
field=models.ForeignKey( | ||
on_delete=django.db.models.deletion.CASCADE, related_name="orders", to="employee.service" | ||
), | ||
), | ||
migrations.AddField( | ||
model_name="transaction", | ||
name="invoice", | ||
field=models.ForeignKey( | ||
blank=True, | ||
null=True, | ||
on_delete=django.db.models.deletion.CASCADE, | ||
related_name="transactions", | ||
to="business.invoice", | ||
), | ||
), | ||
migrations.AddField( | ||
model_name="transaction", | ||
name="patient", | ||
field=models.ForeignKey( | ||
on_delete=django.db.models.deletion.CASCADE, related_name="transactions", to="patient.patient" | ||
), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
-12 Bytes
(100%)
backend/business/services/__pycache__/payment.cpython-312.pyc
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,7 +39,7 @@ | |
"patient", | ||
"employee", | ||
"business", | ||
"graphql", | ||
"schemas", | ||
] | ||
|
||
MIDDLEWARE = [ | ||
|
@@ -142,6 +142,11 @@ | |
USE_I18N = True | ||
USE_L10N = True | ||
|
||
DJANGO_SUPERUSER_USERNAME = env("DJANGO_SUPERUSER_USERNAME", default="admin") | ||
DJANGO_SUPERUSER_EMAIL = env("DJANGO_SUPERUSER_EMAIL", default="[email protected]") | ||
DJANGO_SUPERUSER_PHONE = env("DJANGO_SUPERUSER_PHONE", default="+79999999999") | ||
DJANGO_SUPERUSER_PASSWORD = env("DJANGO_SUPERUSER_PASSWORD", default="admin") | ||
|
||
SECURE_HSTS_PRELOAD = not DEBUG | ||
SECURE_SSL_REDIRECT = not DEBUG | ||
SECURE_HSTS_INCLUDE_SUBDOMAINS = True | ||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
from django.core.management.base import BaseCommand | ||
|
||
from config.settings import ( | ||
DJANGO_SUPERUSER_EMAIL, | ||
DJANGO_SUPERUSER_PASSWORD, | ||
DJANGO_SUPERUSER_PHONE, | ||
DJANGO_SUPERUSER_USERNAME, | ||
) | ||
from core.models import User | ||
|
||
|
||
class Command(BaseCommand): | ||
|
||
def handle(self, *args, **options): | ||
username = DJANGO_SUPERUSER_USERNAME | ||
email = DJANGO_SUPERUSER_EMAIL | ||
phone = DJANGO_SUPERUSER_PHONE | ||
password = DJANGO_SUPERUSER_PASSWORD | ||
|
||
if not User.objects.filter(email=email).exists(): | ||
print("Creating account for %s (%s)" % (username, email)) | ||
User.objects.create_superuser( | ||
email=email, | ||
password=password, | ||
phone=phone, | ||
username=username, | ||
) | ||
else: | ||
print("Admin account has already been initialized.") |
Oops, something went wrong.