GSA / ITDB-schema

IT Dashboard submissions schema, documentation and example files.
18 stars 24 forks source link

[IT COllect] - "already in use" where I have no posted ledgers #465

Open KellyHarrisT opened 2 years ago

KellyHarrisT commented 2 years ago

Posting to Ledgers, produces a "already in use" where I have no posted ledgers to be found. https://staging-itc-cpic.itdashboard.gov/v1/services/015000200102/ledgers

Json: {"agencyId":"2021FS056DMEAgency","costItem":"IRS Operations Support (One Year)","year":2021,"amount":0.790924,"type":"DME","costPool":"Internal Labor","ITTower":"End User","fundingSource":"015-45-0919","source":"Internal Funding","ledgerElementStyle":"Funding Sources Only","isRetired":false}

Response: 422 Result: {"@context":"\/contexts\/ConstraintViolationList","@type":"ConstraintViolationList","hydra:title":"Validation Errors Encountered","hydra:description":"Found 1 constraint violations","violations":[{"propertyPath":"agencyId","message":"Property agencyId with value 2021FS056DMEAgency is already in use. The property agencyId must be unique.","code":null}],"hydra:request_id":"0c4864fa-9a7a-928a-8928-bf5d9d8a8e50"}

Kelly

KellyHarrisT commented 2 years ago

I am also getting inconsistent values between Testing & Production. Production Produces: "Update error: {\"@context\":\"\/contexts\/ConstraintViolationList\",\"@type\":\"ConstraintViolationList\",\"hydra:title\":\"Validation Errors Encountered\",\"hydra:description\":\"Found 1 constraint violations\",\"violations\":[{\"propertyPath\":\"\",\"message\":\"The ledgerElementStyle TBM Only requires omission of the fields type, source, fundingSource. Fields not omitted: type, source\",\"code\":null}],\"hydra:request_id\":\"9b0dd2a2-06a8-9b37-a992-ca6490316beb\"}",

rydougherty commented 2 years ago

HI Kelly,

Thanks for reaching out. The reason you are receiving this error is because the agency id 2021FS056DMEAgency is already in use under the service with id 015000000046. As a reminder, each agency id must be unique across the application, not just within a given service.

We are taking a look at the second response now, and will let you know as soon as we have more information.

Thanks, Ryan

rydougherty commented 2 years ago

Hi Kelly,

I was able to reproduce the error on Dev and Staging as well in the second request. IT Collect does not allow source, type, or fundingSource on TBM Only Ledger submissions. This validation prevents TBM data from erroneously being including in aggregated funding totals. If you need include both funding sources and TBM data in a single ledger submission, you can set the ledgerElementStyle to All.

Also, for your awareness, this validation was deployed on 9/9, and a reference email went out to the community on 9/10. If you have any further questions regarding this validation, please let us know.

KellyHarrisT commented 2 years ago

Thanks for your responses Ryan. We were not aware that the AgencyId needs to be unique across the whole app. We will adjust.

As for the one with the error, your example shows differently "TBM only" has the type set. { "agencyId": "09FEH78QDY7QPM31KX6WH6QY36", "costItem": "IT Dashboard Infrastructure Expense", "year": 2022, "amount": 100, "type": "O&M", "costPool": "Outside Services", "ITTower": "Data Center", "fundingSource": "001-00-9004", "source": "Internal Funding", "ledgerElementStyle": "TBM Only", "rebaseLineId": "", "isRetired": false }

rydougherty commented 2 years ago

Hi Kelly,

Thanks, the request samples are more designed to mimic technical submission request formats. But, we can work to update the sample to include the more realistic TBM Ledger Element Style = All option. If you would like more information on Ledger submissions, I would recommend that you take a look at the How To: Ledger guide on Github.