typeorm-model-generator has converted our database entities to valid TypeScript, but they need a bit of cleanup. Each entity from the below list needs the following changes:
Rename entity file/class to Pascal case (I.e. CancellationPolicy.ts and CancellationPolicy, not cancellationpolicy.ts and Cancellationpolicy.)
Singularize class/filename (I.e. User and User.ts, not Users and Users.ts). If the filename is changed, ensure that it uses the correct table by matching the argument to @Entity (I.e. to map to a users table do @Entity("users").)
Fix any TSLint errors reported by, for example, yarn tslint src/entities/User.ts.
Re-export the class in src/index.ts. I.e. export {PostalCode} from "./entities/PostalCode"
Ensure that yarn build reports no compilation errors.
To clean up an entity, perform the above steps, then either commit directly to master or submit a PR. Committing directly to master is preferred at this stage--TypeScript and TSLint should catch any significant errors, and any that slip past can be corrected later. Once an entity is cleaned up, check it off of the below list.
typeorm-model-generator has converted our database entities to valid TypeScript, but they need a bit of cleanup. Each entity from the below list needs the following changes:
@Entity
(I.e. to map to a users table do@Entity("users")
.)yarn tslint src/entities/User.ts
.export {PostalCode} from "./entities/PostalCode"
yarn build
reports no compilation errors.To clean up an entity, perform the above steps, then either commit directly to master or submit a PR. Committing directly to master is preferred at this stage--TypeScript and TSLint should catch any significant errors, and any that slip past can be corrected later. Once an entity is cleaned up, check it off of the below list.
See src/entities/User.ts for an example of a converted entity.