Skip to content

Commit 8efda99

Browse files
authored
Myeclpay fix (#704)
### Description Please explain the changes you made here. ### Checklist - [ ] Created tests which fail without the change (if possible) - [ ] All tests passing - [ ] Extended the documentation, if necessary
1 parent b681ba2 commit 8efda99

File tree

2 files changed

+10
-18
lines changed

2 files changed

+10
-18
lines changed

app/core/myeclpay/cruds_myeclpay.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -332,10 +332,7 @@ async def get_sellers_by_user_id(
332332
async def update_seller(
333333
seller_user_id: str,
334334
store_id: UUID,
335-
can_bank: bool,
336-
can_see_history: bool,
337-
can_cancel: bool,
338-
can_manage_sellers: bool,
335+
seller_update: schemas_myeclpay.SellerUpdate,
339336
db: AsyncSession,
340337
) -> None:
341338
await db.execute(
@@ -345,10 +342,7 @@ async def update_seller(
345342
models_myeclpay.Seller.store_id == store_id,
346343
)
347344
.values(
348-
can_bank=can_bank,
349-
can_see_history=can_see_history,
350-
can_cancel=can_cancel,
351-
can_manage_sellers=can_manage_sellers,
345+
**seller_update.model_dump(exclude_none=True),
352346
),
353347
)
354348

app/core/myeclpay/endpoints_myeclpay.py

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -368,10 +368,12 @@ async def confirm_structure_manager_transfer(
368368
await cruds_myeclpay.update_seller(
369369
seller_user_id=request.user_id,
370370
store_id=store.id,
371-
can_bank=True,
372-
can_see_history=True,
373-
can_cancel=True,
374-
can_manage_sellers=True,
371+
seller_update=schemas_myeclpay.SellerUpdate(
372+
can_bank=True,
373+
can_see_history=True,
374+
can_cancel=True,
375+
can_manage_sellers=True,
376+
),
375377
db=db,
376378
)
377379
await db.commit()
@@ -893,11 +895,7 @@ async def update_store_seller(
893895
await cruds_myeclpay.update_seller(
894896
seller_user_id=seller_user_id,
895897
store_id=store_id,
896-
can_bank=seller_update.can_bank or seller.can_bank,
897-
can_see_history=seller_update.can_see_history or seller.can_see_history,
898-
can_cancel=seller_update.can_cancel or seller.can_cancel,
899-
can_manage_sellers=seller_update.can_manage_sellers
900-
or seller.can_manage_sellers,
898+
seller_update=seller_update,
901899
db=db,
902900
)
903901

@@ -2274,7 +2272,7 @@ async def refund_transaction(
22742272
status_code=400,
22752273
detail="Please provide an amount for the refund if it is not a complete refund",
22762274
)
2277-
if refund_info.amount >= transaction.total:
2275+
if refund_info.amount > transaction.total:
22782276
raise HTTPException(
22792277
status_code=400,
22802278
detail="Refund amount is greater than the transaction total",

0 commit comments

Comments
 (0)