Skip to content
This repository has been archived by the owner on May 8, 2023. It is now read-only.

Different problems when sending requests with either empty or whitespace values #1070

Closed
prtandrup opened this issue Jan 20, 2022 · 6 comments
Assignees
Labels
bug Something isn't working PI9 Team Volt

Comments

@prtandrup
Copy link
Contributor

prtandrup commented Jan 20, 2022

Submitting requests to the Charges domain with empty - or whitespace values are problematic

Mostly they results in the actor receiving a StatusCode 500 - internal server error
And in one case, the whitespace value is allowed, but will cause a problem downstream between charges and messagehub (message hub throws an exception as GLN is missing).

We need a solution to these whitespace and empty value problems, which returns a useful rejection to the sender.

COO: According to TI, we are not allowed to cleanup spaces.

Observations:

  • (VR.223) Submitting empty or whitespaces as ChargeOperationId (cim:mRID) => StatusCode 500; System.InvalidOperationException => (Cannot ReadValueAs when there is no value (CanReadValue is false).)
  • (VR.424) Submitting 'D02' in cim:process.processType => status 500.
  • (VR.449) Submitting whitespaces as ChargeType => StatusCode 500; System.InvalidOperationException => (Cannot ReadValueAs when there is no value (CanReadValue is false).)
  • (VR.912) Submitting a schema valid value (P1Y) for Charge Prices only (D08) => StatusCode 500. Problem lies in the ChargeCommandBundleConverter.cs in conjunction with public static string Map(Resolution resolution) in the ResolutionMapper.cs
@PerTHenriksen
Copy link

VR912 to be addressed, afterwhich the bug is ready for product backlog

@prtandrup prtandrup removed their assignment Nov 3, 2022
@prtandrup
Copy link
Contributor Author

VR.912 issue still relevant. Added a few notes to it. Moved to product backlog

@prtandrup prtandrup self-assigned this Nov 3, 2022
@prtandrup
Copy link
Contributor Author

prtandrup commented Nov 3, 2022

Removed below, as they are no longer relevant:

  • (VR.150) Submitting whitespaces as sender GLN => causes invalid data available => exception in post office: GLN must be filled.
  • (VR.153) Submitting whitespaces as receiver GLN => StatusCode 500; System.InvalidOperationException => Cannot ReadValueAs when there is no value (CanReadValue is false)
  • (VR.440) Submitting empty or whitespaces as ChargeId => StatusCode 500; System.InvalidOperationException => (Cannot ReadValueAs when there is no value (CanReadValue is false).)
  • (VR.488) Submitting whitespaces as VatPayer (VAT classification) => StatusCode 500; System.InvalidOperationException => (Cannot ReadValueAs when there is no value (CanReadValue is false).)

@x-platformcoder
Copy link
Contributor

All exceptions thrown as part of parsing the marketdocument is thrown as a synchron B2B message. Values that can be ignored and collected either as a documentvalidation or inputvalidation don't throw a synchron B2B message.

@IreneDataHub
Copy link
Contributor

18.11.
space is not covered by the changes - expect b2b errors.
It must also be rejected when codes other than D08 and D18 are used (ie not only D02).
Space in codes - awaiting processing according to new roadmap
Jan looks at the others issue again.

@IreneDataHub
Copy link
Contributor

28.11.2022
Environment T-001
All test = OK

Status OK
B2B-005

B2B-005
Syntax validation failed for business message.
'mRID' is either empty or contains only whitespace.

(VR.223) Submitting empty or whitespaces as ChargeOperationId (cim:mRID) => StatusCode 500; System.InvalidOperationException => (Cannot ReadValueAs when there is no value (CanReadValue is false).)

OK
Wrong code
cim:Reason
cim:codeD02</cim:code>
cim:textDocument type Unknown not allowed together with business reason code UpdateChargeInformation.</cim:text>

Space

B2B-005
Syntax validation failed for business message.
'type' is either empty or contains only whitespace.

Type doesn't exit

B2B-005 The specified input does not pass schema validation.
SchemaValidationError The 'urn:ediel.org:structure:requestchangeofpricelist:0:1:type' element is invalid - The value 'D99' is invalid according to its datatype 'urn:ediel.org:structure:requestchangeofpricelist:0:1:MessageKind_String' - The value 'D99' is not valid according to any of the memberTypes of the union.

(VR.424) Submitting 'D02' in cim:process.processType => status 500.

Status OK
Wrong chargetype
or>
B2B-005
The specified input does not pass schema validation.

SchemaValidationError The 'urn:ediel.org:structure:requestchangeofpricelist:0:1:type' element is invalid - The value 'D05' is invalid according to its datatype 'urn:ediel.org:structure:requestchangeofpricelist:0:1:ChargeKind_String' - The value 'D05' is not valid according to any of the memberTypes of the union.

Emty
B2B-005
The specified input does not pass schema validation.

Space
SchemaValidationError
The 'urn:ediel.org:structure:requestchangeofpricelist:0:1:type' element is invalid - The value ' ' is invalid according to its datatype 'urn:ediel.org:structure:requestchangeofpricelist:0:1:ChargeKind_String' - The value ' ' is not valid according to any of the memberTypes of the union.

(VR.449) Submitting whitespaces as ChargeType => StatusCode 500; System.InvalidOperationException => (Cannot ReadValueAs when there is no value (CanReadValue is false).)

Status
Using P1Y

B2B-005
Syntax validation failed for business message.
Provided 'resolution' value 'P1Y' is invalid.

(VR.912) Submitting a schema valid value (P1Y) for Charge Prices only (D08) => StatusCode 500. Problem lies in the ChargeCommandBundleConverter.cs in conjunction with public static string Map(Resolution resolution) in the ResolutionMapper.cs

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working PI9 Team Volt
Projects
None yet
Development

No branches or pull requests

6 participants