export default class Product extends Base implements IProduct {
name: string;
description?: string;
brand?: IBrand;
bestseller: boolean;
type: string;
category?: ICategory | null;
lsExternalId?: string;
archived: boolean;
stockCount?: number;
constructor({
id = undefined,
createdAt = undefined,
updatedAt = undefined,
name,
description = undefined,
brand = undefined,
bestseller = false,
type,
category = undefined,
lsExternalId = undefined,
archived = false,
stockCount = undefined,
}: IBase & IProduct) {
super({ id, createdAt, updatedAt });
this.name = name;
this.description = description;
this.brand = new Brand({ ...brand });
this.bestseller = bestseller;
this.type = type;
this.category = category ? new Category({ ...category }) : undefined;
this.lsExternalId = lsExternalId;
this.archived = archived;
this.stockCount = stockCount;
}
}
export default class Product extends Base implements IProduct {
name: string;
description?: string;
brand?: IBrand;
bestseller: boolean;
type: string;
category?: ICategory | null;
lsExternalId?: string;
archived: boolean;
stockCount?: number;
constructor({
id = undefined,
createdAt = undefined,
updatedAt = undefined,
name,
description = undefined,
brand = undefined,
bestseller = false,
type,
category = undefined,
lsExternalId = undefined,
archived = false,
stockCount = undefined,
}: IBase & IProduct) {
super({ id, createdAt, updatedAt });
this.name = name;
this.description = description;
this.brand = new Brand({ ...brand });
this.bestseller = bestseller;
this.type = type;
this.category = category ? new Category({ ...category }) : undefined;
this.lsExternalId = lsExternalId;
this.archived = archived;
this.stockCount = stockCount;
}
}