hmrc / vat-api

Apache License 2.0
67 stars 17 forks source link

Can't test/demo the standard VAT Return lifecycle using Sandbox #365

Closed DigitalDan1 closed 5 years ago

DigitalDan1 commented 5 years ago

I need to run through the following scenario using the Sandbox (in order to demonstrate the software to HMRC's Digital Relationship Managers, aka DRM, before getting access to production):

  1. Check for the most recent Open Obligation (using /organisations/vat/{vrn}/obligations and get its periodKey)
  2. Submit the VAT Return for the Obligation period (using /organisations/vat/{vrn}/returns and the periodKey from step 1)
  3. Confirm that Obligation is now Fulfilled (using /organisations/vat/{vrn}/obligations again)

In my correspondence with DRM they've said:

the next step will be to see you test and demonstrate your product showing the customer journey using your software to prepare and submit data within the VAT Sandbox environment

I guess this is the exact same lifecycle that all users want to see and all software developers are going to have to demo to DRM. Unfortunately, the Sandbox doesn't allow me to do this without faking data and ignoring various API responses.

The main issue is the lack of consistency between the /obligations and /returns endpoints. Running through the first time:

  1. The most recent Open Obligation's periodKey is 18A2
  2. VAT Return 18A2 submitted
  3. The Obligation should be Fulfilled but it's still Open

Running through a second (and any subequent) time:

  1. The Open Obligation's periodKey is still 18A2
  2. VAT Return 18A2 can't be submitted (DUPLICATE_SUBMISSION error)
  3. Obligation still Open

This makes preparing a demo very difficult. I'm having to do the following:

  1. Call /organisations/vat/{vrn}/obligations but ignore the response. Instead fake a new periodKey (being sure not to use the same one twice)
  2. Submit a test VAT Return for the newly faked periodKey
  3. Call /organisations/vat/{vrn}/obligations again and fake a response to make it look like the periodKey is now Fulfilled

It looks like some of the Sandbox api endpoints were designed with unit testing in mind, but not for integration testing, and certainly not for demonstrating a system working end-to-end.

I get the feeling the first time I'll be able to test this properly is in the Production environment using real Obligations and a real VAT Return.

Has everyone else had to do the same for their testing and demos or am I missing something? Have I got the wrong expectation of what the DRMs want to see during the demo.

ghost commented 5 years ago

Hi Dan,

I've got our demo coming up on the 19th and this is what I plan to do...

When we retrieve Obligations they display in a browse and when the user double-clicks on a row it either calls the Submit or the View Return API depending upon the status of the row (fulfilled or outstanding).

So the steps I'll use are...

1) View Obligations - with testing scenario 'quarterly non met' 2) Select Period 18A1 and submit return for that period 3) View Obligations - testing quarterly one met 4) Select Period 18A1 (which is marked Fullfilled) and get return for that period

ViewReturn for period 18A1 will show what you submitted in step 2 so make figures memorable :-) I've been using the Nil VAT Return that was used for the XML API testing (attached)

NilPayment.zip

Graham

adamdavi3s commented 5 years ago

HMRC won’t worry about that much detail! They understand that the sandbox is static data (although you can get your return fine) and that your application is returning the correct information.

And agree, the first time you can actually test it fully is when you go live!

@grahamHDawson that sir is inspired!

DigitalDan1 commented 5 years ago

@GrahamHDawson. Thanks for sharing your plan. In step 2. won't you get a DUPLICATE_SUBMISSION error if you run through the demo more than once?

ghost commented 5 years ago

HI Dan,

Simply create 2 or 3 test users at the start of the demo - then switch to a new user if you need to repeat.

ghost commented 5 years ago

Hi Dan, I fact you can repeat the demo using the same sequence (with slight changes each run through) at least 3 times using the quarterly returns. Simply change the testing scenario each run through So first time through it's as above ie

View Obligations - with testing scenario 'quarterly non met' Select Period 18A1 and submit return for that period View Obligations - testing quarterly one met Select Period 18A1 (which is marked Fullfilled) and get return for that period

second time through you change the scenario and period key so

View Obligations - with testing scenario 'quarterly ONE met' Select Period 18A2 and submit return for that period View Obligations - testing quarterly TWO met Select Period 18A2 (which is marked Fullfilled) and get return for that period

third time through same sort of thing...

View Obligations - with testing scenario 'quarterly TWO met' Select Period 18A3 and submit return for that period View Obligations - testing quarterly THREE met Select Period 18A3 (which is marked Fullfilled) and get return for that period

Graham

DigitalDan1 commented 5 years ago

@GrahamHDawson, ah, yes, creating a new (organisation) user will create a new vat return number, good thinking!

jacobbrownlow commented 5 years ago

Hi @DigitalDan1

I hope you have been able to find a solution for testing a journey. We appreciate the sandbox doesn't offer everything wanted by vendors, but unfortunately we can't serve up a fully simulated backend.

Thanks @GrahamHDawson for the suggestions, that is exactly what we would expect vendors to do.

Jacob