fix merge
All checks were successful
Deploy Amap / deploy (push) Successful in 1m51s

This commit is contained in:
2026-09-07 19:29:27 +02:00
17 changed files with 995 additions and 434 deletions

View File

@@ -0,0 +1,33 @@
"""add minimum for payment method cheque
Revision ID: 31071e10af15
Revises: e777ed5729ce
Create Date: 2026-09-07 18:48:08.498571
"""
from typing import Sequence, Union
from alembic import op
import sqlalchemy as sa
import sqlmodel.sql.sqltypes
# revision identifiers, used by Alembic.
revision: str = '31071e10af15'
down_revision: Union[str, Sequence[str], None] = 'e777ed5729ce'
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None
def upgrade() -> None:
"""Upgrade schema."""
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('paymentmethod', sa.Column('min', sa.Integer(), nullable=True))
# ### end Alembic commands ###
def downgrade() -> None:
"""Downgrade schema."""
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('paymentmethod', 'min')
# ### end Alembic commands ###

View File

@@ -42,7 +42,6 @@ def get_one(
"""Get one contract"""
return session.get(models.Contract, contract_id)
def create_one(
session: Session,
contract: models.ContractCreate

View File

@@ -61,6 +61,7 @@ class PaymentMethodBase(SQLModel):
name: str
details: str
max: int | None
min: int | None
class PaymentMethod(PaymentMethodBase, table=True):

View File

@@ -63,12 +63,14 @@ def update_one(
if 'payment_methods' in productor_updates:
new_productor.payment_methods.clear()
for pm in productor_updates['payment_methods']:
print(pm)
new_productor.payment_methods.append(
models.PaymentMethod(
name=pm['name'],
details=pm['details'],
productor_id=id,
max=pm['max']
max=pm['max'],
min=pm['min']
)
)
del productor_updates['payment_methods']

View File

@@ -80,6 +80,7 @@ class TestUsersService:
role_names=['test role']
)
user_id = users[0].id
print(user_id)
result = users_service.update_one(session, user_id, user_update)
assert result.id == user_id