Add min cheque value and view contract at the end of form flow

This commit is contained in:
2026-09-07 19:15:06 +02:00
parent b4b4fa7643
commit 768fdb8d97
17 changed files with 1042 additions and 473 deletions

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

@@ -55,6 +55,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']