Added refunds

This commit is contained in:
ben
2022-08-27 16:37:31 +01:00
parent 330a026379
commit 99595ba96b
5 changed files with 80 additions and 9 deletions
+6 -2
View File
@@ -13,7 +13,6 @@ from .crud import (
create_card,
create_hit,
delete_card,
get_all_cards,
get_card,
get_card_by_otp,
get_card_by_uid,
@@ -22,6 +21,7 @@ from .crud import (
update_card,
update_card_counter,
update_card_otp,
get_refunds,
)
from .models import CreateCardData
from .nxp424 import decryptSUN, getSunMAC
@@ -135,5 +135,9 @@ async def api_hits(
cards_ids = []
for card in cards:
cards_ids.append(card.id)
hits = await get_hits(cards_ids)
hits_ids = []
for hit in hits:
hits_ids.append(hit.id)
return [hit.dict() for hit in await get_hits(cards_ids)]
return [refund.dict() for refund in await get_refunds(hits_ids)]