19 lines
599 B
Python
19 lines
599 B
Python
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
|