Skip to content

chore(#10546): add constant for contact document type#10614

Open
akshaypatra00 wants to merge 1 commit intomedic:masterfrom
akshaypatra00:fix/add-contact-document-type-constant
Open

chore(#10546): add constant for contact document type#10614
akshaypatra00 wants to merge 1 commit intomedic:masterfrom
akshaypatra00:fix/add-contact-document-type-constant

Conversation

@akshaypatra00
Copy link

Description

Adds a shared constant for the contact document type and replaces
hard-coded usages with the new constant. This improves consistency and
maintainability by avoiding repeated string literals across the codebase.

Fixes #10546

Code review checklist

  • Readable: Concise, well named, follows the style guide.
  • Backwards compatible: Works with existing data and configuration.

License

The software is provided under AGPL-3.0. Contributions to this project are accepted under the same license.

@mrjones-plip
Copy link
Contributor

@akshaypatra00 - sorry this issue didn't get a review! I've reached out to an engineer who should follow up soon.

Copy link
Member

@dianabarsan dianabarsan left a comment

Choose a reason for hiding this comment

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

Good start. I added a comment about the webapp offline user view map not being able to require things.
Also, if I search the codebase by 'contact', I am finding a LOT of occurrences. All relevant ones should be changed in this PR.

@@ -1,14 +1,15 @@
module.exports.map = (doc) => {
const skip = [ '_id', '_rev', 'type', 'refid', 'geolocation' ];
const { DOC_TYPES } = require('@medic/constants');
Copy link
Member

Choose a reason for hiding this comment

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

CouchDb view maps can't require unfortunately. So this file shouldn't be changed.

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.

Add constant for 'district_hospital' document type

3 participants