Skip to content

Refactor Enumerators #30

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

Closed
1 of 3 tasks
FlatBallFlyer opened this issue Jan 9, 2024 · 2 comments
Closed
1 of 3 tasks

Refactor Enumerators #30

FlatBallFlyer opened this issue Jan 9, 2024 · 2 comments

Comments

@FlatBallFlyer
Copy link
Contributor

FlatBallFlyer commented Jan 9, 2024

Enumerated valid value lists are present in the project in 2 places. They are used both in the Schema applied to the model, and the Enumerators collection used by the UI for validation lists. This issue will update the
applySchema.js to add code that populats enumerators from the enumerators data. This issue should also update the Mongo Database Standards to describe this implementation.

// Function to inject enumerators into the schema
function injectEnumeratorsIntoSchema(schema, enumeratorsDoc, collectionName) {
  Object.keys(enumeratorsDoc[collectionName]).forEach(attribute => {
    schema.properties[attribute].enum = Object.keys(enumeratorsDoc[collectionName][attribute]);
   }
}
  • Remove enum constraints from existing schema's, bumping patch level for each.
    • This may be done over time and can be coordinated with work being done on Active issues.
    • The code should be tolerant of schema's that have enum constraints by removing the existing constraint before adding the data driven constraint.
    • The tolerance specific code should be tagged, and removed after all schema's have been upgraded. At that point the existence of a enum constraint should cause the script to fail-fast.
@FlatBallFlyer
Copy link
Contributor Author

Person Status values:

  • pending - signed up and awaiting a mentor assignment
  • active - actively meeting with a mentor
  • drip - on a drip follow-up campaign, not active
  • archived - soft-delete indicator.

@michquinn michquinn changed the title Refactor Enumirators Refactor Enumerators Jan 19, 2024
@FlatBallFlyer
Copy link
Contributor Author

We should change drip to inactive, the drip term has confused many and is only common in sales communities.

@FlatBallFlyer FlatBallFlyer mentioned this issue Jan 22, 2024
5 tasks
@michquinn michquinn removed their assignment Feb 20, 2024
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

No branches or pull requests

2 participants