I have a login/registration module and I want to write a model for them.
I would use interfaces, but I need to have one predefined value.
And I was wondering - should I put the predefined out as a constant (it won't be changed, altered) and use interfaces. Or write it as classes (as currently)
Currently, I wrote two separate classes - registration.model.ts, login.model.ts, could I be able to abstract to use only one model? (example: user.model.ts)
Some examples:
export class LoginUser { constructor( private email, private password, // I need to have it, backend expects it to be sent private connection = 'Username-Password-Authentication' ) { } } export class RegistrateUser { constructor( public name: string, public lastName: string, public email: string, public password: string, // I need to have it, backend expects it to be sent private connection = 'Username-Password-Authentication' ) { } }