ab-ms-core / tests /unit /test_barrier_api.sh
PupaClic
Add comprehensive unit tests for various endpoints and features
7ff20d3
#!/bin/bash
echo "πŸ§ͺ Testing Barrier Sizes API to verify InventoryId is now included"
echo "=================================================================="
# Test the API endpoint that was missing InventoryId
echo "πŸ“‘ Testing: GET /api/v1/bidders/21365/barrier-sizes"
echo ""
curl -s -X GET "https://aquabarrier-ab-ms-core.hf.space/api/v1/bidders/21365/barrier-sizes" \
-H "Accept: application/json" | jq '.[0] // empty' | head -20
echo ""
echo "πŸ” Looking specifically for InventoryId field..."
echo ""
curl -s -X GET "https://aquabarrier-ab-ms-core.hf.space/api/v1/bidders/21365/barrier-sizes" \
-H "Accept: application/json" | jq '.[0].InventoryId // "InventoryId field not found"'
echo ""
echo "πŸ” Looking specifically for InstallAdvisorFees field..."
echo ""
curl -s -X GET "https://aquabarrier-ab-ms-core.hf.space/api/v1/bidders/21365/barrier-sizes" \
-H "Accept: application/json" | jq '.[0].InstallAdvisorFees // "InstallAdvisorFees field not found"'
echo ""
echo "πŸ“‹ Expected vs Current Response Structure:"
echo ""
echo "❌ OLD (missing fields):"
echo '{"Id":21362,"Height":10.0,"Width":12.0,"Lenght":15.0,"CableUnits":1500.0,"Price":25000.0,"IsStandard":true}'
echo ""
echo "βœ… NEW (with all fields):"
echo '{"Id":456,"InventoryId":12345,"BidderId":21365,"BarrierSizeId":21362,"InstallAdvisorFees":500.0,"IsStandard":true,"Height":10.0,"Width":12.0,"Lenght":15.0,"CableUnits":1500,"Price":25000.0}'
echo ""
echo "πŸ”§ Key additions:"
echo " β€’ InventoryId - from BiddersBarrierSizes table"
echo " β€’ InstallAdvisorFees - from BiddersBarrierSizes table"
echo " β€’ BidderId - from BiddersBarrierSizes table"
echo " β€’ BarrierSizeId - from BiddersBarrierSizes table"
echo " β€’ Id now refers to BiddersBarrierSizes.Id (not BarrierSizes.Id)"