export interface IDiscount { regular ? : number ; vip ? : number ; } export interface IProduct { id : number ; name : string ; price : number ; inventory : number ; discounts : IDiscount ; } export class Product implements IProduct { constructor ( public id = ( Math . floor ( Math . random ( ) * 1000 ) ) , public name = '?' , public price = 0 , public inventory = 0 , public discounts ) { } }