add pos devices sharing informations to list of rancher inventories
This commit is contained in:
18
apps/pos_device/services/services.py
Normal file
18
apps/pos_device/services/services.py
Normal file
@@ -0,0 +1,18 @@
|
||||
from apps.pos_device.models import Device
|
||||
import typing
|
||||
|
||||
|
||||
def pos_organizations_sharing_information(device: Device) -> typing.Any:
|
||||
"""
|
||||
pos sharing organizations' information,
|
||||
device have multiple organizations (sub_accounts) for sharing money
|
||||
"""
|
||||
stake_holders = device.stake_holders.select_related('broker', 'broker_amount', 'organization')
|
||||
|
||||
sharing_information_list = [{
|
||||
"organization_name": item.organization.name,
|
||||
"broker": item.broker.name,
|
||||
"amount": item.broker_amount.value
|
||||
} for item in stake_holders]
|
||||
|
||||
return sharing_information_list
|
||||
Reference in New Issue
Block a user