I am studying backend development using NodeJS and TypeScript. To start, I am checking this sample inventory. While reading the models, I got confused because there is an interface that is both extended (but inside the Model wrapper) and implemented.
The interface:
interface SaleAttributes {
id: string;
quantity: number;
// foreign key
productId?: string;
}
Base Class:
export class Sale extends Model<SaleAttributes, SaleCreationAttributes>
implements SaleAttributes {
.
.
.
}
This is the complete code.