Skip to content

Commit

Permalink
change:adapt new data
Browse files Browse the repository at this point in the history
  • Loading branch information
Yiru committed Dec 5, 2023
1 parent 7c2f38b commit a1454be
Show file tree
Hide file tree
Showing 13 changed files with 171 additions and 180 deletions.
34 changes: 0 additions & 34 deletions Back-end/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,40 +172,6 @@ def test_connection():

@app.route('/api/all_resource/', methods=['GET'])
def get_all_resource():
# cursor = mycol_party.find()
# res_list = []
# for data_party in cursor:
# desired_contract_id = data_party["contract_id"]
# data_general = mycol_general.find_one({'contract_id': int(desired_contract_id)})
# data_award = mycol_award.find_one({'contract_id': int(desired_contract_id)})

# if data_general:
# org_name = data_general["general"]["buyer"]["name"]
# # print(org_name)
# else:
# continue

# if data_award:
# vendor_name = data_award["awards"]["suppliers"]["name"]
# contract_status = data_award["awards"]["status"]
# else:
# continue

# if data_party:
# # certification
# certification = data_party["parties"]["party2"]["details"]["classfication3"]["description"]
# else:
# continue

# contract_info = {
# "Vendor Name": vendor_name,
# "Organization Name": org_name,
# "Contract Details": desired_contract_id,
# "Contract Status": contract_status,
# "Certifications": certification,
# "Availability": "80%"
# }
# res_list.append(contract_info)
documents_list = list(mycol_vendor.find({}, {'_id': 0}))
# print(documents_list)
return json.dumps(documents_list, indent=4), 200
Expand Down
6 changes: 3 additions & 3 deletions Back-end/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,21 @@ def setUp(self):

def test_get_all_resource(self):
response = requests.get(f'{self.base_url}/api/all_resource/')
print(response.text)
# print(response.text)
self.assertEqual(response.status_code, 200)

def test_get_resource_by_vendor_id(self):
vendor_id = "104138" # Replace with a valid resource ID
response = requests.get(f'{self.base_url}/api/resource/vendor/{vendor_id}')
print(response.text)
# print(response.text)
self.assertEqual(response.status_code, 200)
# Add more assertions to validate the response data as needed


def test_get_resource_by_id(self):
resource_id = 30006385 # Replace with a valid resource ID
response = requests.get(f'{self.base_url}/api/resource/{resource_id}')
print(response.text)
# print(response.text)
self.assertEqual(response.status_code, 200)
# Add more assertions to validate the response data as needed

Expand Down
3 changes: 2 additions & 1 deletion Front-end/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ const App = () => {
title: 'Organization Name',
dataIndex: 'org',
key: 'org',
...getColumnSearchProps('org'),
sorter: (a, b) => a.org.localeCompare(b.org),
sortDirections: ['ascend', 'descend'],
},
Expand Down Expand Up @@ -304,7 +305,7 @@ const App = () => {
onCancel={() => setModal1Open(false)}
>
<div className="contract-container">
<h1>{ContractData["Vendor Name"]}c</h1>
<h1>{ContractData["Vendor Name"]}</h1>
<div className="status-section">
<span className="status active">ACTIVE</span>
</div>
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added Mapping/BPS Sample Reports/BuySpeed Report.xlsx
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
12 changes: 12 additions & 0 deletions Mapping/config.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[FILEPATH]
MASTER_CONTRACT_FILE_PATH = master contract 30007897.xlsx
PO_LISTING_FILE_PATH = BPS Sample Reports/SAP PO Listing Report.XLSX
BYSPEED_FILE_PATH = BPS Sample Reports/BuySpeed Report.xlsx
CONTRACT_LISTING_FILE_PATH = BPS Sample Reports/SAP Contract Listing Report.XLSX
B2G_FILE_PATH = BPS Sample Reports/B2G Contract Status Report.xlsm
; MASTER_CONTRACT_FILE_PATH = master contract 30007897.xlsx
; PO_LISTING_FILE_PATH = SAP PO Listing Report FY2019-23.xlsx
; BYSPEED_FILE_PATH = BuySpeed Report.xlsx
; CONTRACT_LISTING_FILE_PATH = SAP Contract Listing Report FY2019-23 from PO Listing Report.xlsx
; B2G_FILE_PATH = B2G Contract Status Report.xlsx

Loading

0 comments on commit a1454be

Please sign in to comment.