As I delve into Angular and TypeScript, I've encountered a perplexing issue. Let's say I have two classes - Employee and Department. On the server-side, I've established a Many-To-One relationship between these entities using Sequelize:
db.employee.belongsTo(db.department, {foreignKey: 'emp_depID'});
db.department.hasMany(db.employee);
In this schema, I've specified 'emp_depID' as the foreign key in the employee table, linking it to the department's id in the department table. Consequently, my client-side model mirrors this structure:
export interface Employee {
id?: number;
firstName: string;
lastName: string;
isActive: boolean;
emp_depID: number;
}
export interface Department {
id?: number;
depName: string;
}
My question is, is it advisable to treat emp_depID solely as a number in this context?