hmrc / vat-api

Apache License 2.0
67 stars 17 forks source link

Testing Sandbox Appears to Ignore Query Parameters when Getting Obligations #890

Closed leoriviera closed 2 years ago

leoriviera commented 2 years ago

Bug report

You must read the information below before you submit a bug report.

The MTD API team cannot help if your bug report is about:

For any of the above, you must contact the Software Developer Support Team directly at SDSTeam@hmrc.gov.uk. The SDS Team do not monitor this repository.

This repository is for bug reports relating to VAT API code in this repository only.

Fill in the sections below to submit your bug report:

Describe the bug A clear and concise description of what the bug is.

The endpoint used to get obligations appears to ignore the from, to and status parameters when in the testing sandbox.

To Reproduce Steps to reproduce the behavior:

Making a request to /organisations/vat/{vrn}/obligations?from=2017-01-01&to=2017-03-31&status=F returns the following.

[
  {
    periodKey: '18A1',
    start: '2017-01-01',
    end: '2017-03-31',
    due: '2017-05-07',
    status: 'F',
    received: '2017-05-06'
  },
  {
    periodKey: '18A2',
    start: '2017-04-01',
    end: '2017-06-30',
    due: '2017-08-07',
    status: 'O'
  }
]

Expected behavior A clear and concise description of what you expected to happen.

It's expected that

This means the result from the API would look like

[
  {
    periodKey: '18A1',
    start: '2017-01-01',
    end: '2017-03-31',
    due: '2017-05-07',
    status: 'F',
    received: '2017-05-06'
  }
]

Screenshots / Requests / Responses If applicable, add screenshots to help explain your problem.

Additional context Add any other context about the problem here.

DDCTLS-DEV-TEAM commented 2 years ago

Hello @leoriviera

Apologies we haven't gotten back to you on this one. The external test environment uses stub data so it will only ever return the same data and dates.

We have checked production events and the call works as needed.

Thank you again.

glenrobson commented 2 years ago

It would be really useful if the sandbox respected the query parameters from and to. It is unclear from the documentation whether the matching on dates is inclusive of the start and end dates provided or if you need to take a day off the start and add one to the end to match the quarter date range.

I can see from your comment above you don't need to but finding the answer in a closed issue is not ideal.