Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding MDMS v2 contract #25

Merged
merged 1 commit into from
Apr 10, 2024
Merged

Adding MDMS v2 contract #25

merged 1 commit into from
Apr 10, 2024

Conversation

shashwat-egov
Copy link
Collaborator

@shashwat-egov shashwat-egov commented Apr 10, 2024

Summary by CodeRabbit

  • New Features
    • Introduced an OpenAPI specification for the Master Data Management Service, enabling APIs to manage and retrieve master data across different schemas and tenants.

Copy link

coderabbitai bot commented Apr 10, 2024

Walkthrough

The update introduces a new OpenAPI specification for the Master Data Management Service (MDMS), enhancing its configurability and user-friendliness with features like schema creation, data manipulation, and advanced search capabilities.

Changes

File Path Change Summary
Common Services/.../mdms-v2.yaml Introduced OpenAPI spec for MDMS with endpoints for schema and data management.

Possibly related issues

  • Redesign and rewrite of MDMS Digit-Core#76: The changes align with the redesign objectives of making MDMS more configurable and user-friendly, implementing create, search, update, and schema validation functionalities.

🐇✨
In the land of code and byte,
A rabbit hopped through the night.
With each leap, a line of code,
Master data, now on the road.
Celebrate, for MDMS shines bright!
🌟📜


Recent Review Details

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 3404906 and 4e95c89.
Files selected for processing (1)
  • Common Services/mdms-v2.yaml (1 hunks)
Additional comments not posted (5)
Common Services/mdms-v2.yaml (5)

1-9: Ensure the version number in the info section reflects the actual version of the API being released, especially if this is an update or a new version.


13-39: The endpoint /egov-mdms-service/schema/v1/_create is well-defined. However, ensure that the schema SchemaDefinitionRequest referenced in the request body is correctly defined in the components section to avoid validation errors.


66-99: For the /egov-mdms-service/v2/_create/{schemaCode} endpoint, verify that the MdmsRequest schema used in the request body is properly defined and includes all necessary fields as per the API's requirements.


190-250: In the Mdms schema definition, ensure that the data property's structure meets the requirements of the API consumers. If the structure is complex, consider providing a more detailed example or description.


362-398: For the MdmsCriteriaV2 schema, ensure that all required fields such as tenantId are appropriately marked and validated in the API implementation to prevent runtime errors.


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@talele08 talele08 merged commit c680040 into master Apr 10, 2024
1 check passed
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

Comment on lines +40 to +65
post:
tags:
- MDMS-Schema
summary: Get list of masters for a particular module and tenantId.
description: Get list of masters for a perticulare module and tenantId.
requestBody:
description: Details of module and master which need to be search using MDMS
.
content:
'*/*':
schema:
$ref: '#/components/schemas/SchemaDefSearchRequest'
required: true
responses:
200:
description: Schema Definition searched sucessfully.
content:
'*/*':
schema:
$ref: '#/components/schemas/SchemaDefinitionResponse'
400:
description: Invalid input.
content:
'*/*':
schema:
$ref: 'https://raw.githubusercontent.com/egovernments/DIGIT-Specs/service-contracts/Common%20Services/common-contract.yaml#/components/schemas/ErrorRes'
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The summary and description for the /egov-mdms-service/schema/v1/_search endpoint contain a typo: "perticulare" should be "particular". Correcting this will improve the professionalism of the documentation.

- Get list of masters for a perticulare module and tenantId.
+ Get list of masters for a particular module and tenantId.

Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
post:
tags:
- MDMS-Schema
summary: Get list of masters for a particular module and tenantId.
description: Get list of masters for a perticulare module and tenantId.
requestBody:
description: Details of module and master which need to be search using MDMS
.
content:
'*/*':
schema:
$ref: '#/components/schemas/SchemaDefSearchRequest'
required: true
responses:
200:
description: Schema Definition searched sucessfully.
content:
'*/*':
schema:
$ref: '#/components/schemas/SchemaDefinitionResponse'
400:
description: Invalid input.
content:
'*/*':
schema:
$ref: 'https://raw.githubusercontent.com/egovernments/DIGIT-Specs/service-contracts/Common%20Services/common-contract.yaml#/components/schemas/ErrorRes'
post:
tags:
- MDMS-Schema
summary: Get list of masters for a particular module and tenantId.
description: Get list of masters for a particular module and tenantId.
requestBody:
description: Details of module and master which need to be search using MDMS
.
content:
'*/*':
schema:
$ref: '#/components/schemas/SchemaDefSearchRequest'
required: true
responses:
description: Schema Definition searched sucessfully.
content:
'*/*':
schema:
$ref: '#/components/schemas/SchemaDefinitionResponse'
description: Invalid input.
content:
'*/*':
schema:
$ref: 'https://raw.githubusercontent.com/egovernments/DIGIT-Specs/service-contracts/Common%20Services/common-contract.yaml#/components/schemas/ErrorRes'

Comment on lines +100 to +134
/egov-mdms-service/v2/_update/{schemaCode}:
post:
tags:
- MDMS
summary: Get list of masters for a particular module and tenantId.
description: Get list of masters for a perticulare module and tenantId.
parameters:
- in: path
name: schemaCode
schema:
type: string
required: true
description: Unique schema code from schema master

requestBody:
description: Details of module and master which need to be search using MDMS
.
content:
'*/*':
schema:
$ref: '#/components/schemas/MdmsRequest'
required: true
responses:
200:
description: Data updated sucessfully.
content:
'*/*':
schema:
$ref: '#/components/schemas/MdmsResponseV2'
400:
description: Invalid input.
content:
'*/*':
schema:
$ref: 'https://raw.githubusercontent.com/egovernments/DIGIT-Specs/service-contracts/Common%20Services/common-contract.yaml#/components/schemas/ErrorRes'
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The description for the /egov-mdms-service/v2/_update/{schemaCode} endpoint is duplicated from a search endpoint. This should be updated to accurately reflect the update functionality.

- Get list of masters for a perticulare module and tenantId.
+ Update master data for a given schemaCode and tenantId.

Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
/egov-mdms-service/v2/_update/{schemaCode}:
post:
tags:
- MDMS
summary: Get list of masters for a particular module and tenantId.
description: Get list of masters for a perticulare module and tenantId.
parameters:
- in: path
name: schemaCode
schema:
type: string
required: true
description: Unique schema code from schema master
requestBody:
description: Details of module and master which need to be search using MDMS
.
content:
'*/*':
schema:
$ref: '#/components/schemas/MdmsRequest'
required: true
responses:
200:
description: Data updated sucessfully.
content:
'*/*':
schema:
$ref: '#/components/schemas/MdmsResponseV2'
400:
description: Invalid input.
content:
'*/*':
schema:
$ref: 'https://raw.githubusercontent.com/egovernments/DIGIT-Specs/service-contracts/Common%20Services/common-contract.yaml#/components/schemas/ErrorRes'
/egov-mdms-service/v2/_update/{schemaCode}:
post:
tags:
- MDMS
summary: Get list of masters for a particular module and tenantId.
description: Update master data for a given schemaCode and tenantId.
parameters:
- in: path
name: schemaCode
schema:
type: string
required: true
description: Unique schema code from schema master
requestBody:
description: Details of module and master which need to be search using MDMS
.
content:
'*/*':
schema:
$ref: '#/components/schemas/MdmsRequest'
required: true
responses:
description: Data updated sucessfully.
content:
'*/*':
schema:
$ref: '#/components/schemas/MdmsResponseV2'
description: Invalid input.
content:
'*/*':
schema:
$ref: 'https://raw.githubusercontent.com/egovernments/DIGIT-Specs/service-contracts/Common%20Services/common-contract.yaml#/components/schemas/ErrorRes'

Comment on lines +253 to +267
type: object
properties:
action:
type: string
description: 'Action of the workflow to be performned on the request'
comment:
type: string
description: 'comment for the workflow action to be performed'
assignees:
type: array
items:
type: string
description: ' uuid of the users in the system to assign workflow to the specific user intead of a all the users with the gien role.'

required: [ action ]
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Workflow schema is missing a description for the action property. Adding a description can provide better clarity to API consumers on how to use this property.

+ description: 'Specify the action to be performed as part of the workflow'

Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
type: object
properties:
action:
type: string
description: 'Action of the workflow to be performned on the request'
comment:
type: string
description: 'comment for the workflow action to be performed'
assignees:
type: array
items:
type: string
description: ' uuid of the users in the system to assign workflow to the specific user intead of a all the users with the gien role.'
required: [ action ]
type: object
properties:
action:
type: string
description: 'Specify the action to be performed as part of the workflow'
comment:
type: string
description: 'comment for the workflow action to be performed'
assignees:
type: array
items:
type: string
description: ' uuid of the users in the system to assign workflow to the specific user intead of a all the users with the gien role.'
required: [ action ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants