beckn / beckn-ui-workspace

Mono Repo for Beckn UI Workspace
9 stars 11 forks source link

Improvements in the layer2 configs created for the retail, uei, mobility, and logistics domain #1374

Open rajaneeshk90 opened 2 months ago

rajaneeshk90 commented 2 months ago

Description

There are some rules added in the layer2 configs for the retail, uei, mobility, and logistics domains which need deeper look.

Goals

RCA and resolution of these issues.

Expected Outcome

Make the added rules work as expected. find a way to correctly apply if else in openAPI 3.0

Acceptance Criteria

Make the added rules work as expected. find a way to correctly apply if else in openAPI 3.0

Mockups / Wireframes

Product Name

layer2 configurations

Domains

All

Tech Skills Needed:

Proficiency in network configuration and management. Familiarity with the layer 2 config specifications. Experience with API testing and postman collections. Knowledge of BPP response structures and requirements.

rajaneeshk90 commented 2 months ago

experimenting on this to figure out the issues.

rajaneeshk90 commented 2 months ago

Examples: the if else condition is added in the BPPItem component of the retail layer2 config. this if else condition requires that if the item.descriptor.code is "ELECTRONICS", the add-ons[i].descriptor.code is "USER_MANUAL"

The BPPOrder component is using the BPPItem component.

The on_* apis except on_search are using the BPPOrder component.

we used the openAPI validator tool created by Venkatesh to validate some sample jsons to test out these scenarios. The validator is able to detect these rules for BPPItem and BPPOrder component but the on_* api are not detecting the rule.

deployed the retail layer2 config in the protocol server on the onix-bpp to test out the same, this restriction is not detected there as well.

other approach could be to add the if else condition directly at the API level but that will be required for 9 apis and at 9 places. It will also not follow the dry principle.

still looking for an efficient approach to make it work without having to put the same if else at 9 places in the file.