cc-py-commons 0.5.19__tar.gz → 0.5.20__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/PKG-INFO +1 -1
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/bids/bid_schema.py +11 -11
- cc_py_commons-0.5.20/cc_py_commons/services/booking_agent/list_bids.py +33 -0
- cc_py_commons-0.5.20/cc_py_commons/services/booking_agent/list_quotes.py +27 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons.egg-info/PKG-INFO +1 -1
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons.egg-info/SOURCES.txt +2 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/setup.py +1 -1
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/README.md +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/__init__.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/bids/__init__.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/bids/bid.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/bids/bid_history.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/bids/bid_history_schema.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/carriers/__init__.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/carriers/account_carrier_map.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/carriers/account_carrier_map_schema.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/carriers/carrier.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/carriers/carrier_schema.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/carriers/contact.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/carriers/contact_schema.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/config/__init__.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/config/c4_account_settings.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/config/env.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/config/mcleod_load_fields.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/config/pc_miler_config.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/db/__init__.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/db/connection.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/geolocate.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/lanes/__init__.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/lanes/carrier_lane.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/lanes/carrier_lane_schema.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/lanes/lane.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/lanes/lane_schema.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/loads/__init__.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/loads/equipment.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/loads/equipment_schema.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/loads/equipment_types.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/loads/freighthub_contact.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/loads/freighthub_contact_schema.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/loads/load.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/loads/load_schema.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/loads/load_status.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/loads/location.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/loads/location_schema.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/loads/map_load_response.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/quotes/__init__.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/quotes/quote.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/quotes/quote_schema.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/quotes/quote_status.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/rfp/__init__.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/rfp/create_table.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/rfp/rfp_status.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/rfp/truck_lane_search_mapper.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/schemas/__init__.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/schemas/camel_case_schema.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/services/__init__.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/services/analytics/__init__.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/services/analytics/analytics_event.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/services/booking_agent/__init__.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/services/booking_agent/accept_bid.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/services/booking_agent/cancel_bid.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/services/booking_agent/constants.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/services/booking_agent/counter_bid.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/services/booking_agent/decline_bid.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/services/booking_agent/get_bid_by_amazon_order_id.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/services/booking_agent/get_quote.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/services/booking_agent/get_quote_by_load_id.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/services/booking_agent/update_bid.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/services/c4/__init__.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/services/c4/amazon_session_token.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/services/c4/constants.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/services/c4/get_account.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/services/c4/get_account_settings.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/services/c4/get_integration.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/services/c4/get_users_for_account.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/services/c4/refresh_amazon_token.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/services/carrier_hub/__init__.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/services/carrier_hub/get_carrier.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/services/carrier_hub/list_carriers.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/services/carrier_hub/list_contacts.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/services/carrier_hub/update_contact.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/services/freight_hub/__init__.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/services/freight_hub/post_freight_hub_load.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/services/mercury/__init__.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/services/mercury/create_account_folder.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/services/mercury/db/__init__.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/services/mercury/db/delete_table.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/services/mercury/get_client.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/services/mercury/get_green_screens_lane_price.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/services/mercury/get_import_stat.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/services/mercury/get_lane_price.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/services/mercury/get_lane_price_for_bulk.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/services/mercury/list_clients.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/services/mercury/post_import_stat.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/services/mercury/update_import_stat.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/services/slack/__init__.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/services/slack/send_slack_message.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/sns/__init__.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/sns/book_load_notification.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/sns/booking_agent/__init__.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/sns/booking_agent/bid_counter_failure_notification.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/sns/booking_agent/constants.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/sns/booking_agent/send_sns_notification.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/sns/booking_assistant_flow_notification.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/sns/import_movements_notification.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/sns/parsed_carrier_notification.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/sns/sns_service.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/sqs/__init__.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/sqs/booking_assistant_flow_event.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/sqs/sqs_service.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/tests/__init__.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/tests/test_case_conversion.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/tests/test_lambda_utils.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/tests/test_map_transaction.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/tests/test_temperature_utils.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/transactions/__init__.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/transactions/equipment_clas_schema.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/transactions/equipment_class.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/transactions/equipment_mapping.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/transactions/equipment_mapping_schema.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/transactions/map_transaction.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/transactions/transaction.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/transactions/transaction_schema.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/utils/__init__.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/utils/bulk_lane_price_result_utils.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/utils/case_conversion.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/utils/datadog_logger.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/utils/datetimes.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/utils/dimension_utils.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/utils/geocode_location.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/utils/get_delivery_date.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/utils/json_logger.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/utils/lambda_utils.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/utils/local_file.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/utils/logger.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/utils/logger_v2.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/utils/pc_miler_utils.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/utils/price_utils.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/utils/redis.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/utils/s3_file.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/utils/temperature_utils.py +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons.egg-info/dependency_links.txt +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons.egg-info/requires.txt +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons.egg-info/top_level.txt +0 -0
- {cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/setup.cfg +0 -0
@@ -13,23 +13,23 @@ class BidSchema(CamelCaseSchema):
|
|
13
13
|
receipt_id = fields.String(allow_none=True)
|
14
14
|
amount = fields.Integer()
|
15
15
|
estimated_days = fields.Integer()
|
16
|
-
notes = fields.String(allow_none=True)
|
16
|
+
notes = fields.String(allow_none=True, missing=None)
|
17
17
|
match_score = fields.Float(allow_none=True)
|
18
18
|
status_id = fields.UUID()
|
19
19
|
pickup_date = fields.Date()
|
20
20
|
delivery_date = fields.Date()
|
21
|
-
decline_reason = fields.String(allow_none=True)
|
21
|
+
decline_reason = fields.String(allow_none=True, missing=None)
|
22
22
|
bid_histories = fields.List(fields.Nested(BidHistorySchema), allow_none=True)
|
23
23
|
origin_deadhead = fields.Float(allow_none=True)
|
24
|
-
porus_truck_id = fields.UUID(allow_none=True)
|
25
|
-
truck_lane_id = fields.UUID(allow_none=True)
|
26
|
-
distance = fields.Float(allow_none=True)
|
27
|
-
origin_city = fields.String()
|
28
|
-
origin_state = fields.String()
|
29
|
-
origin_zip = fields.String(allow_none=True)
|
30
|
-
dest_city = fields.String()
|
31
|
-
dest_state = fields.String()
|
32
|
-
dest_zip = fields.String(allow_none=True)
|
24
|
+
porus_truck_id = fields.UUID(allow_none=True, missing=None)
|
25
|
+
truck_lane_id = fields.UUID(allow_none=True, missing=None)
|
26
|
+
distance = fields.Float(allow_none=True, missing=None)
|
27
|
+
origin_city = fields.String(missing=None)
|
28
|
+
origin_state = fields.String(missing=None)
|
29
|
+
origin_zip = fields.String(allow_none=True, missing=None)
|
30
|
+
dest_city = fields.String(missing=None)
|
31
|
+
dest_state = fields.String(missing=None)
|
32
|
+
dest_zip = fields.String(allow_none=True, missing=None)
|
33
33
|
invite_emailed_at = fields.DateTime(allow_none=True)
|
34
34
|
|
35
35
|
@post_load
|
@@ -0,0 +1,33 @@
|
|
1
|
+
import os
|
2
|
+
|
3
|
+
import requests
|
4
|
+
from dateutil.parser import parse
|
5
|
+
|
6
|
+
from cc_py_commons.bids.bid_schema import BidSchema
|
7
|
+
from cc_py_commons.utils import json_logger
|
8
|
+
|
9
|
+
BOOKING_AGENT_URL = os.environ.get('BOOKING_AGENT_URL')
|
10
|
+
BOOKING_AGENT_TOKEN = os.environ.get("BOOKING_AGENT_TOKEN")
|
11
|
+
|
12
|
+
|
13
|
+
def execute(account_id, filters_dict):
|
14
|
+
url = f"{BOOKING_AGENT_URL}/bid/match"
|
15
|
+
token = f"Bearer {BOOKING_AGENT_TOKEN}"
|
16
|
+
headers = {
|
17
|
+
"Authorization": token
|
18
|
+
}
|
19
|
+
json_logger.debug(account_id, f"Requesting bids from booking-agent", url=url, filters=filters_dict)
|
20
|
+
response = requests.get(url, headers=headers, params=filters_dict)
|
21
|
+
bids = []
|
22
|
+
if response.status_code == 200:
|
23
|
+
bids = response.json()['content']
|
24
|
+
for bid in bids:
|
25
|
+
bid['pickupDate'] = parse(bid['pickupDate']).strftime('%Y-%m-%d')
|
26
|
+
bid['deliveryDate'] = parse(bid['deliveryDate']).strftime('%Y-%m-%d')
|
27
|
+
if bid.get('inviteEmailedAt'):
|
28
|
+
bid['inviteEmailedAt'] = parse(bid['inviteEmailedAt']).isoformat()
|
29
|
+
for bid_history in bid.get('bidHistories', []):
|
30
|
+
bid_history['pickupDate'] = parse(bid_history['pickupDate']).strftime('%Y-%m-%d')
|
31
|
+
bid_history['deliveryDate'] = parse(bid_history['deliveryDate']).strftime('%Y-%m-%d')
|
32
|
+
bids = BidSchema().load(bids, many=True)
|
33
|
+
return bids
|
@@ -0,0 +1,27 @@
|
|
1
|
+
import requests
|
2
|
+
import os
|
3
|
+
from dateutil.parser import parse
|
4
|
+
|
5
|
+
from cc_py_commons.utils import json_logger
|
6
|
+
from cc_py_commons.quotes.quote_schema import QuoteSchema
|
7
|
+
|
8
|
+
BOOKING_AGENT_URL = os.environ.get('BOOKING_AGENT_URL')
|
9
|
+
BOOKING_AGENT_TOKEN = os.environ.get("BOOKING_AGENT_TOKEN")
|
10
|
+
|
11
|
+
|
12
|
+
def execute(account_id, filters_dict):
|
13
|
+
url = f"{BOOKING_AGENT_URL}/quote"
|
14
|
+
token = f"Bearer {BOOKING_AGENT_TOKEN}"
|
15
|
+
headers = {
|
16
|
+
"Authorization": token
|
17
|
+
}
|
18
|
+
json_logger.debug(account_id, f"Requesting quotes from booking-agent", url=url, filters=filters_dict)
|
19
|
+
response = requests.get(url, headers=headers, params=filters_dict)
|
20
|
+
quotes = []
|
21
|
+
if response.status_code == 200:
|
22
|
+
quotes = response.json()['content']
|
23
|
+
for quote in quotes:
|
24
|
+
quote['pickupDate'] = parse(quote['pickupDate']).strftime('%Y-%m-%d')
|
25
|
+
quote['deliveryDate'] = parse(quote['deliveryDate']).strftime('%Y-%m-%d')
|
26
|
+
quotes = QuoteSchema().load(quotes, many=True)
|
27
|
+
return quotes
|
@@ -65,6 +65,8 @@ cc_py_commons/services/booking_agent/decline_bid.py
|
|
65
65
|
cc_py_commons/services/booking_agent/get_bid_by_amazon_order_id.py
|
66
66
|
cc_py_commons/services/booking_agent/get_quote.py
|
67
67
|
cc_py_commons/services/booking_agent/get_quote_by_load_id.py
|
68
|
+
cc_py_commons/services/booking_agent/list_bids.py
|
69
|
+
cc_py_commons/services/booking_agent/list_quotes.py
|
68
70
|
cc_py_commons/services/booking_agent/update_bid.py
|
69
71
|
cc_py_commons/services/c4/__init__.py
|
70
72
|
cc_py_commons/services/c4/amazon_session_token.py
|
@@ -3,7 +3,7 @@ from setuptools import setup, find_packages
|
|
3
3
|
setup(
|
4
4
|
name='cc_py_commons',
|
5
5
|
description='Common code for microservices',
|
6
|
-
version='0.5.
|
6
|
+
version='0.5.20',
|
7
7
|
url='https://github.com/Cargo-Chief/py-commons',
|
8
8
|
author='CargoChief',
|
9
9
|
author_email='engineering@cargochief.com',
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/carriers/account_carrier_map_schema.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/loads/freighthub_contact_schema.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/services/analytics/analytics_event.py
RENAMED
File without changes
|
{cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/services/booking_agent/__init__.py
RENAMED
File without changes
|
{cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/services/booking_agent/accept_bid.py
RENAMED
File without changes
|
{cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/services/booking_agent/cancel_bid.py
RENAMED
File without changes
|
{cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/services/booking_agent/constants.py
RENAMED
File without changes
|
{cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/services/booking_agent/counter_bid.py
RENAMED
File without changes
|
{cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/services/booking_agent/decline_bid.py
RENAMED
File without changes
|
File without changes
|
{cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/services/booking_agent/get_quote.py
RENAMED
File without changes
|
File without changes
|
{cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/services/booking_agent/update_bid.py
RENAMED
File without changes
|
File without changes
|
{cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/services/c4/amazon_session_token.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/services/c4/get_account_settings.py
RENAMED
File without changes
|
File without changes
|
{cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/services/c4/get_users_for_account.py
RENAMED
File without changes
|
{cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/services/c4/refresh_amazon_token.py
RENAMED
File without changes
|
{cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/services/carrier_hub/__init__.py
RENAMED
File without changes
|
{cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/services/carrier_hub/get_carrier.py
RENAMED
File without changes
|
{cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/services/carrier_hub/list_carriers.py
RENAMED
File without changes
|
{cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/services/carrier_hub/list_contacts.py
RENAMED
File without changes
|
{cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/services/carrier_hub/update_contact.py
RENAMED
File without changes
|
{cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/services/freight_hub/__init__.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/services/mercury/db/delete_table.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/services/mercury/get_import_stat.py
RENAMED
File without changes
|
{cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/services/mercury/get_lane_price.py
RENAMED
File without changes
|
File without changes
|
{cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/services/mercury/list_clients.py
RENAMED
File without changes
|
{cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/services/mercury/post_import_stat.py
RENAMED
File without changes
|
{cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/services/mercury/update_import_stat.py
RENAMED
File without changes
|
File without changes
|
{cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/services/slack/send_slack_message.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/sns/import_movements_notification.py
RENAMED
File without changes
|
{cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/sns/parsed_carrier_notification.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/sqs/booking_assistant_flow_event.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/transactions/equipment_clas_schema.py
RENAMED
File without changes
|
File without changes
|
{cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/transactions/equipment_mapping.py
RENAMED
File without changes
|
{cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/transactions/equipment_mapping_schema.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/transactions/transaction_schema.py
RENAMED
File without changes
|
File without changes
|
{cc_py_commons-0.5.19 → cc_py_commons-0.5.20}/cc_py_commons/utils/bulk_lane_price_result_utils.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|