Adding the unique id into entity and entityType#229
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
VISHNUDAS-tunerlabs
left a comment
There was a problem hiding this comment.
Reviewed May 7 2026
| type: String, | ||
| index: true, | ||
| }, | ||
| entityUniqueId: { |
There was a problem hiding this comment.
@vishwanath1004 Lets call this "code" instead "entityUniqueId"
| name: 'entities', | ||
| schema: { | ||
| entityTypeId: 'ObjectId', | ||
| entityTypeUniqueId: { |
There was a problem hiding this comment.
@vishwanath1004 Please rename this variable to entityTypeCode
| type: String, | ||
| index: true, | ||
| }, | ||
| entityUniqueId: { |
There was a problem hiding this comment.
@vishwanath1004 Please introduce compoundIndex with code+tenantId
| type: String, | ||
| index: true, | ||
| }, | ||
| entityUniqueId: { |
There was a problem hiding this comment.
@vishwanath1004 if this key used as foreignKey anywhere else call it entityCode
| name: { | ||
| type: String, | ||
| }, | ||
| entityTypeUniqueId: { |
| childHierarchyPath: childHierarchyPath, | ||
| entityType: queryParams.type, | ||
| entityType: entityTypeDocument.name || queryParams.type, | ||
| entityUniqueId: singleEntity.externalId, |
There was a problem hiding this comment.
@vishwanath1004 where ever we used "UniqueId" in variable please replace them with "Code"
| childHierarchyPath: childHierarchyPath, | ||
| entityType: queryParams.type, | ||
| entityType: entityTypeDocument.name || queryParams.type, | ||
| entityUniqueId: singleEntity.externalId, |
There was a problem hiding this comment.
@vishwanath1004 are we reusing externalId of entity for code?. why can't we use same strategy we used for entityType
| entityTypeUniqueId: | ||
| entityTypeDocument.entityTypeUniqueId || | ||
| entityTypeUniqueId || | ||
| buildEntityTypeUniqueId(entityTypeDocument.name, tenantId), |
There was a problem hiding this comment.
@vishwanath1004 Please rename this function to "generateUniqueCode"
| // Retrieve the schema meta information key | ||
| let schemaMetaInformation = this.entitiesSchemaData().SCHEMA_METAINFORMATION | ||
| let tenantId = req.userDetails.userInformation.tenantId | ||
| let tenantId = req.userDetails?.tenantAndOrgInfo?.tenantId || req.userDetails?.userInformation?.tenantId |
There was a problem hiding this comment.
@vishwanath1004 Why are we changing logic of tenant capture?
| }, | ||
| listByEntityType: function () { | ||
| req.checkParams('_id').exists().withMessage('required Entity type') | ||
| req.checkParams('_id').exists().isMongoId().withMessage('Invalid Entity ID') |
No description provided.