bcgov / namerequest

Public Front End for the Name Request System
1 stars 42 forks source link

16634 mapped EntityType to CorpTypeCd + cleanup #622

Closed severinbeauvais closed 1 year ago

severinbeauvais commented 1 year ago

Issue #: bcgov/entity#16634

Description of changes:

Commit 1:

Commit 2:

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of the namerequest license (Apache 2.0).

severinbeauvais commented 1 year ago

Sorry about the large list of reviewers, but this is a small (but possibly significant) change that I think you should know about, since you are touching, or have recently touched, this repo. Thx.

severinbeauvais commented 1 year ago

For some reason, TS and eslint are happy with this code, but the build process isn't. I'm trying to resolve this. Don't merge yet.

image

Update: fixed. See comments below.

severinbeauvais commented 1 year ago

For some reason, TS and eslint are happy with this code, but the build process isn't. I'm trying to resolve this. Don't merge yet.

It seems the build process doesn't want to mix enum-strings with pure-strings, so I did this and it's happy with it:

// Namerequest-only entity types
enum Other {
  SO = 'SO',
  XUL = 'XUL',
  RLC = 'RLC',
  XLP = 'XLP',
  XLL = 'XLL',
  XSO = 'XSO',
  INFO = 'INFO'
}

/** Enum for Entity Type codes. */
export enum EntityType {
  // BC Entity Types:
  BC = CorpTypeCd.BC_COMPANY,
  ...
  SO = Other.SO,

In other words, the EntityType enum takes values from other enums, instead of a mix of enum/string.

severinbeauvais commented 1 year ago

I have tested this locally and it works fine.

Madhavkapoor28 commented 1 year ago

LGTM!