|
|
@@ -43,6 +43,18 @@ def check_cxos() -> None:
|
|
|
print('outbid on', f'{order["MaterialTicker"]}.{order["ExchangeCode"]}')
|
|
|
elif order['OrderType'] == 'SELLING' and state['Ask'] is not None and state['Ask'] < order['Limit']:
|
|
|
print('undercut on', f'{order["MaterialTicker"]}.{order["ExchangeCode"]}')
|
|
|
+ print()
|
|
|
+
|
|
|
+ warehouses: typing.Sequence[Warehouse] = cache.get('https://rest.fnar.net/sites/warehouses/' + config.username,
|
|
|
+ headers={'Authorization': config.fio_api_key})
|
|
|
+ for warehouse in warehouses:
|
|
|
+ if warehouse['LocationNaturalId'] in config.ignore_warehouses:
|
|
|
+ continue
|
|
|
+ storage: Storage = cache.get(f'https://rest.fnar.net/storage/{config.username}/{warehouse["StoreId"]}',
|
|
|
+ headers={'Authorization': config.fio_api_key})
|
|
|
+ if storage['WeightLoad'] > 0 or storage['VolumeLoad'] > 0:
|
|
|
+ print('warehouse', warehouse['LocationNaturalId'], 'is not empty')
|
|
|
+ print()
|
|
|
|
|
|
class ExchangeOrder(typing.TypedDict):
|
|
|
MaterialTicker: str
|
|
|
@@ -56,6 +68,15 @@ class ExchangeSummary(typing.TypedDict):
|
|
|
Bid: float | None
|
|
|
Ask: float | None
|
|
|
|
|
|
+class Warehouse(typing.TypedDict):
|
|
|
+ StoreId: str
|
|
|
+ LocationNaturalId: str
|
|
|
+
|
|
|
+class Storage(typing.TypedDict):
|
|
|
+ StorageItems: typing.Sequence
|
|
|
+ WeightLoad: float
|
|
|
+ VolumeLoad: float
|
|
|
+
|
|
|
class RawPrice(typing.TypedDict):
|
|
|
FullTicker: str
|
|
|
Bid: float | None
|