Staging endpoint SYNC should return 400 when the staging table does not exist to be complain with INTAKE endpoint

Description

PRDE - Story default text according to the team DoR (Definition of Ready)

01 - PERSON OF CONTACT (PERSON THAT CAN ANSWER QUESTIONS ABOUT THE PROBLEM):
02 - PROBLEM (WHAT'S THE CURRENT PROBLEM SCENARIO OR PAIN TO BE RESOLVED?):

The endpoint /sync is returning 404 when the staging table does not exist, the endpoint intake returns 400 for the same situation.

We should have the same behavior for both endpoints to avoid problems for Smartlink integrations (allowing them to detect that the table does not exist).

Scenarios explored, the result obtained and the expected result:

#######################################
SYNC
#######################################

Right staging table name and right connectorID, it returns 200: OK
---

curl -X 'POST' \
  'https://poffo.carol.ai/api/v3/staging/tables/COMPANY/sync?connectorId=905f9f98c299488db6f2ce7209eedf19&returnData=true' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer 125b4ba3abe94a31afa765c62033319d' \
  -d '{"taxid": "1111"}'


Staging table wrong, it returns 404: it should return 400
---

curl -X 'POST' \
  'https://poffo.carol.ai/api/v3/staging/tables/COMPANYa/sync?connectorId=905f9f98c299488db6f2ce7209eedf19&returnData=true' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer 125b4ba3abe94a31afa765c62033319d' \
  -d '{"taxid": "1111"}'


Connector ID wrong, it retuns 400: OK
---

curl -X 'POST' \
  'https://poffo.carol.ai/api/v3/staging/tables/COMPANYa/sync?connectorId=905f9f98c299488db6f2ce7209eedf19a&returnData=true' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer 125b4ba3abe94a31afa765c62033319d' \
  -d '{"taxid": "1111"}'

Wrong authorization token, it retuns 401: OK
---

curl -X 'POST' \
  'https://poffo.carol.ai/api/v3/staging/tables/COMPANY/sync?connectorId=905f9f98c299488db6f2ce7209eedf19a&returnData=true' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer 125b4ba3abe94a31afa765c62033319dttt' \
  -d '{"taxid": "1111"}'

#######################################
Intake
#######################################


Right staging table name and right connectorID, it returns 200: OK
---

curl -X 'POST' \
  'https://poffo.carol.ai/api/v3/staging/tables/COMPANY?connectorId=905f9f98c299488db6f2ce7209eedf19&returnData=true' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer 125b4ba3abe94a31afa765c62033319d' \
  -d '{"taxid": "1111"}'


Staging table wrong, it returns 400: OK
---

curl -X 'POST' \
  'https://poffo.carol.ai/api/v3/staging/tables/COMPANYa?connectorId=905f9f98c299488db6f2ce7209eedf19&returnData=true' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer 125b4ba3abe94a31afa765c62033319d' \
  -d '{"taxid": "1111"}'


Connector ID wrong, it retuns 400: OK
---

curl -X 'POST' \
  'https://poffo.carol.ai/api/v3/staging/tables/COMPANYa?connectorId=905f9f98c299488db6f2ce7209eedf19a&returnData=true' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer 125b4ba3abe94a31afa765c62033319d' \
  -d '{"taxid": "1111"}'


Wrong authorization token, it retuns 401: OK
---

curl -X 'POST' \
  'https://poffo.carol.ai/api/v3/staging/tables/COMPANY?connectorId=905f9f98c299488db6f2ce7209eedf19a&returnData=true' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer 125b4ba3abe94a31afa765c62033319dttt' \
  -d '{"taxid": "1111"}'

06 - ACCEPTANCE CRITERIA:

  • /sync endpoint on staging should returns 400 when the staging table does not exist.