updated Payment service

This commit is contained in:
2025-06-30 21:34:16 +03:00
parent 5c640ddcee
commit 88afa6b329
55 changed files with 6860 additions and 130 deletions

View File

@@ -12,12 +12,12 @@ COPY /pyproject.toml ./pyproject.toml
RUN poetry config virtualenvs.create false && poetry install --no-interaction --no-ansi --no-root --only main && pip cache purge && rm -rf ~/.cache/pypoetry
# Copy application code
COPY /api_services/api_controllers /api_controllers
COPY /api_services/schemas /schemas
COPY /api_services/api_modules /api_modules
COPY /ServicesApi/Controllers /Controllers
COPY /ServicesApi/Schemas /Schemas
COPY /ServicesApi/Extensions /Extensions
COPY /api_services/api_builds/initial-service /initial-service
COPY /api_services/api_builds/initial-service /
COPY /ServicesApi/Builds/Initial /initial-service
COPY /ServicesApi/Builds/Initial /
# Set Python path to include app directory
ENV PYTHONPATH=/ PYTHONUNBUFFERED=1 PYTHONDONTWRITEBYTECODE=1

View File

@@ -1,6 +1,6 @@
import os
from api_controllers.postgres.engine import get_db
from Controllers.Postgres.engine import get_db
from init_app_defaults import create_application_defaults
from init_enums import init_api_enums_build_types
from init_alembic import generate_alembic

View File

@@ -216,12 +216,12 @@ def init_api_enums_build_types(db_session):
{
"enum_class": "DebitTypes",
"type_code": "DT-D",
"type_name": "Debit Sender",
"type_name": "Incoming Fund",
},
{
"enum_class": "DebitTypes",
"type_code": "DT-R",
"type_name": "Credit Receiver",
"type_name": "Outgoing Fund",
},
{
"enum_class": "DebitTypes",

View File

@@ -231,28 +231,18 @@ class CrudCollection(CrudMixin):
__repr__ = ReprMixin.__repr__
# Outer reference fields
ref_id: Mapped[str] = mapped_column(
String(100), nullable=True, index=True, comment="External reference ID"
)
replication_id: Mapped[int] = mapped_column(
SmallInteger, server_default="0", comment="Replication identifier"
)
ref_int: Mapped[int] = mapped_column(Integer, nullable=True, index=True, comment="External reference ID")
ref_id: Mapped[str] = mapped_column(String(100), nullable=True, index=True, comment="External reference UUID")
replication_id: Mapped[int] = mapped_column(SmallInteger, server_default="0", comment="Replication identifier")
# Cryptographic and user tracking
cryp_uu_id: Mapped[str] = mapped_column(
String, nullable=True, index=True, comment="Cryptographic UUID"
)
cryp_uu_id: Mapped[str] = mapped_column(String, nullable=True, index=True, comment="Cryptographic UUID")
# Token fields of modification
created_credentials_token: Mapped[str] = mapped_column(
String, nullable=True, comment="Created Credentials token"
)
updated_credentials_token: Mapped[str] = mapped_column(
String, nullable=True, comment="Updated Credentials token"
)
confirmed_credentials_token: Mapped[str] = mapped_column(
String, nullable=True, comment="Confirmed Credentials token"
)
created_credentials_token: Mapped[str] = mapped_column(String, nullable=True, comment="Created Credentials token")
updated_credentials_token: Mapped[str] = mapped_column(String, nullable=True, comment="Updated Credentials token")
confirmed_credentials_token: Mapped[str] = mapped_column(String, nullable=True, comment="Confirmed Credentials token")
# Status flags
is_confirmed: Mapped[bool] = mapped_column(

View File

@@ -451,6 +451,12 @@ class AccountRecords(CrudCollection):
build_decision_book_uu_id: Mapped[str] = mapped_column(
String, nullable=True, comment="Build Decision Book UU ID"
)
# payment_result_type = Mapped[int] = mapped_column(
# ForeignKey("api_enum_dropdown.id"), nullable=True
# )
# payment_result_type_uu_id: Mapped[str] = mapped_column(
# String, nullable=True, comment="Payment Result Type UU ID"
# )
__table_args__ = (
Index("_budget_records_ndx_00", is_receipt_mail_send, bank_date),

View File

@@ -549,12 +549,9 @@ class BuildDecisionBookPayments(CrudCollection):
)
currency: Mapped[str] = mapped_column(String(8), server_default="TRY")
payment_types_id: Mapped[int] = mapped_column(
ForeignKey("api_enum_dropdown.id"), nullable=True
)
payment_types_uu_id: Mapped[str] = mapped_column(
String, nullable=True, comment="Dues Type UUID"
)
account_is_debit: Mapped[bool] = mapped_column(Boolean, nullable=True, server_default="1", comment="Is Debit")
payment_types_id: Mapped[int] = mapped_column(ForeignKey("api_enum_dropdown.id"), nullable=True)
payment_types_uu_id: Mapped[str] = mapped_column(String, nullable=True, comment="Dues Type UUID")
period_time: Mapped[str] = mapped_column(String(12))
process_date_y: Mapped[int] = mapped_column(SmallInteger)
@@ -568,32 +565,18 @@ class BuildDecisionBookPayments(CrudCollection):
build_decision_book_item_uu_id: Mapped[str] = mapped_column(
String, nullable=False, comment="Decision Book Item UUID"
)
# build_decision_book_id: Mapped[int] = mapped_column(
# ForeignKey("build_decision_book.id"), nullable=True
# )
# build_decision_book_uu_id: Mapped[str] = mapped_column(
# String, nullable=True, comment="Decision Book UUID"
# )
build_parts_id: Mapped[int] = mapped_column(
ForeignKey("build_parts.id"), nullable=False
)
build_parts_uu_id: Mapped[str] = mapped_column(
String, nullable=False, comment="Build Part UUID"
)
build_decision_book_id: Mapped[int] = mapped_column(ForeignKey("build_decision_book.id"), nullable=True)
build_decision_book_uu_id: Mapped[str] = mapped_column(String, nullable=True, comment="Decision Book UUID")
build_parts_id: Mapped[int] = mapped_column(ForeignKey("build_parts.id"), nullable=False)
build_parts_uu_id: Mapped[str] = mapped_column(String, nullable=False, comment="Build Part UUID")
decision_book_project_id: Mapped[int] = mapped_column(
ForeignKey("build_decision_book_projects.id"),
nullable=True,
comment="Decision Book Project ID",
)
decision_book_project_uu_id: Mapped[str] = mapped_column(
String, nullable=True, comment="Decision Book Project UUID"
)
account_records_id: Mapped[int] = mapped_column(
ForeignKey("account_records.id"), nullable=True
)
account_records_uu_id: Mapped[str] = mapped_column(
String, nullable=True, comment="Account Record UU ID"
)
decision_book_project_uu_id: Mapped[str] = mapped_column(String, nullable=True, comment="Decision Book Project UUID")
account_records_id: Mapped[int] = mapped_column(ForeignKey("account_records.id"), nullable=True)
account_records_uu_id: Mapped[str] = mapped_column(String, nullable=True, comment="Account Record UU ID")
# budget_records_id: Mapped[int] = mapped_column(ForeignKey("account_records.id"), nullable=True)
# budget_records_uu_id: Mapped[str] = mapped_column(
@@ -626,12 +609,15 @@ class BuildDecisionBookPayments(CrudCollection):
__table_args__ = (
Index(
"build_decision_book_payments_detail_ndx_00",
"uu_id",
"ref_id",
build_decision_book_item_id,
build_parts_id,
payment_plan_time_periods,
process_date,
payment_types_id,
account_records_id,
account_is_debit,
unique=True,
),
Index("build_decision_book_payments_detail_ndx_01", account_records_id),

0
ServicesApi/__init__.py Normal file
View File