bcgov / bcgov/entity

Codes and Enums

Open
#6,666 3 comments 0 reactions 0 assignees View on GitHub
Pay techdebt
Dominant language
JavaScript
Stars
23
Forks
62
Avg merge
24m
Merged PRs (30d)
1

Description

## What is the problem?
* There are a lot of codes table in database like org_statuses, product_codes, membership_statues etc. which are referenced by other tables as foreign key. While there are hardcoded enums in source code utils, which have same values as in database tables but may in different order, and are wildly used through backend and frontend.

## What is the impact?
* Two set of values at data level and application level, in case they were not synced, it may cause errors, and need more work to maintain.

## Proposed solution
* There are two possible solutions:
1. enum values and names could be read from database codes tables
2. Could use ENUM data type in Postgres to replace codes tables.
Research need to be done to find out pros and cons for these two solutions and choose proper solution which could be easily extend or modified, in case there are changes to existing codes due to business change.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.