Testing Guide
Sample test cases and expected responses for the Store Management Processor System
1. Valid Request with Existing Store IDs
Testing with valid store_ids that exist in the CSV file
Request Payload:
{
"count": 2,
"visits": [
{
"store_id": "RP00001",
"image_url": [
"https://www.gstatic.com/webp/gallery/2.jpg",
"https://www.gstatic.com/webp/gallery/3.jpg"
],
"visit_time": "2024-03-15T10:00:00Z"
},
{
"store_id": "RP00002",
"image_url": [
"https://www.gstatic.com/webp/gallery/4.jpg"
],
"visit_time": "2024-03-15T11:00:00Z"
}
]
}
Expected Response for Successful Job Creation:
{
"job_id": "1"
}
Expected Response for Job Status (After Completion):
{
"status": "completed",
"job_id": "1"
}
2. Invalid Request with Non-Existent Store IDs
Testing with store_ids that don't exist in the CSV file
Request Payload:
{
"count": 2,
"visits": [
{
"store_id": "RP99999",
"image_url": [
"https://www.gstatic.com/webp/gallery/2.jpg",
"https://www.gstatic.com/webp/gallery/3.jpg"
],
"visit_time": "2024-03-15T10:00:00Z"
},
{
"store_id": "RP00002",
"image_url": [
"https://www.gstatic.com/webp/gallery/4.jpg"
],
"visit_time": "2024-03-15T11:00:00Z"
}
]
}
Expected Response for Job Status (Failure due to Invalid Store ID):
{
"status": "failed",
"job_id": "2",
"error": [
{
"store_id": "RP99999",
"error": "Store ID RP99999 does not exist in the store master data."
}
]
}
3. Partially Valid Request with Some Invalid Store IDs
Testing with a mix of valid and invalid store_ids
Request Payload:
{
"count": 2,
"visits": [
{
"store_id": "RP00001",
"image_url": [
"https://www.gstatic.com/webp/gallery/5.jpg"
],
"visit_time": "2024-03-15T09:00:00Z"
},
{
"store_id": "RP88888",
"image_url": [
"https://www.gstatic.com/webp/gallery/6.jpg"
],
"visit_time": "2024-03-15T12:00:00Z"
}
]
}
Expected Response for Job Status (Failure with Specific Invalid Store ID):
{
"status": "failed",
"job_id": "3",
"error": [
{
"store_id": "RP88888",
"error": "Store ID RP88888 does not exist in the store master data."
}
]
}