diff --git a/talentmap_api/fsbid/services/bureau.py b/talentmap_api/fsbid/services/bureau.py index 489396d3b..36156f1d2 100644 --- a/talentmap_api/fsbid/services/bureau.py +++ b/talentmap_api/fsbid/services/bureau.py @@ -9,8 +9,9 @@ from talentmap_api.common.common_helpers import ensure_date, validate_values -import talentmap_api.fsbid.services.common as services +import talentmap_api.fsbid.services.bid as bid_services import talentmap_api.fsbid.services.cdo as cdoservices +import talentmap_api.fsbid.services.common as services from talentmap_api.available_positions.models import AvailablePositionRanking @@ -103,7 +104,8 @@ def get_bureau_position_bids_csv(self, id, query, jwt_token, host): pos_num = get_bureau_position(id, jwt_token)["position"]["position_number"] filename = f"position_{pos_num}_bidders" - response = services.get_bidders_csv(self, id, data, filename, True) + mappedResult = bid_services.map_bids_handshake_status_by_cp_id(data, id) + response = services.get_bidders_csv(self, id, mappedResult, filename, True) return response def fsbid_bureau_position_bids_to_talentmap(bid, jwt): diff --git a/talentmap_api/fsbid/services/common.py b/talentmap_api/fsbid/services/common.py index 86205071f..155b1ca47 100644 --- a/talentmap_api/fsbid/services/common.py +++ b/talentmap_api/fsbid/services/common.py @@ -384,6 +384,8 @@ def get_bids_csv(data, filename, jwt_token): headers.append(smart_str(u"Incumbent")) headers.append(smart_str(u"Bid Cycle")) headers.append(smart_str(u"Bid Status")) + headers.append(smart_str(u"Handshake Status")) + headers.append(smart_str(u"Handshake Accepted/Declined by CDO")) headers.append(smart_str(u"Capsule Description")) writer.writerow(headers) @@ -395,7 +397,7 @@ def get_bids_csv(data, filename, jwt_token): ted = smart_str(maya.parse(position_data["ted"]).datetime().strftime('%m/%d/%Y')) except: ted = "None listed" - + hs_status = record['hs_status_code'].replace('_', ' ') row = [] row.append(smart_str(record["position"]["title"])) row.append(smart_str("=\"%s\"" % record["position"]["position_number"])) @@ -416,6 +418,8 @@ def get_bids_csv(data, filename, jwt_token): row.append(smart_str("handshake_registered")) else: row.append(smart_str(record.get("status"))) + row.append(hs_status) + row.append(smart_str(record["hs_cdo_indicator"])) row.append(smart_str(position_data["position"]["description"]["content"])) writer.writerow(row) @@ -479,6 +483,8 @@ def get_bidders_csv(self, pk, data, filename, jwt_token): headers.append(smart_str(u"TED")) headers.append(smart_str(u"CDO")) headers.append(smart_str(u"CDO Email")) + headers.append(smart_str(u"Handshake Status")) + headers.append(smart_str(u"Handshake Accepted/Declined by CDO")) writer.writerow(headers) @@ -498,6 +504,7 @@ def get_bidders_csv(self, pk, data, filename, jwt_token): cdo_name = '' cdo_email = '' + hs_status = record['hs_status_code'].replace('_', ' ') record['has_competing_rank'] = has_competing_rank(self, record.get('emp_id'), pk) row = [] row.append(smart_str(record["name"])) @@ -510,6 +517,8 @@ def get_bidders_csv(self, pk, data, filename, jwt_token): row.append(ted) row.append(cdo_name) row.append(cdo_email) + row.append(hs_status) + row.append(smart_str(record["hs_cdo_indicator"])) writer.writerow(row) return response diff --git a/talentmap_api/fsbid/views/bureau.py b/talentmap_api/fsbid/views/bureau.py index b9ec0845c..9f6ae73d8 100644 --- a/talentmap_api/fsbid/views/bureau.py +++ b/talentmap_api/fsbid/views/bureau.py @@ -126,6 +126,6 @@ class FSBidBureauPositionBidsExportView(BaseView): def get(self, request, pk): ''' - Gets all bureau positions for export + Gets a bureau position's bids for export ''' return services.get_bureau_position_bids_csv(self, pk, request.query_params, request.META['HTTP_JWT'], f"{request.scheme}://{request.get_host()}") \ No newline at end of file