0% found this document useful (0 votes)
7 views2 pages

Product

Uploaded by

Caue Santana
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views2 pages

Product

Uploaded by

Caue Santana
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

export class newProduct {

constructor(
public readonly fkCategory: number,
public readonly userSeller: number,
public readonly fkDiscount: number,
public readonly name: string,
public readonly description: string,
public readonly price: number,
public readonly stock: number,
) { }
}

export class Product extends newProduct {


constructor(
public readonly id: number,
fkCategory?: number,
userSeller?: number,
fkDiscount?: number,
name?: string,
description?: string,
price?: number,
stock?: number,
) {
super(fkCategory, userSeller, fkDiscount, name,
description, price, stock);
}
}
import { newProduct, Product } from
"src/Domain/Entities/Market/product.entity";

export interface ProductRepository {


create(product: newProduct): Promise<newProduct>;
update(product: Product): Promise<Product>;
delete(id: number): Promise<void>;

findAll(): Promise<Product[]>;
findById(id: number): Promise<Product | null>;
findByCategory(fkCategory: number): Promise<Product[]>;
findBySeller(userSeller: number): Promise<Product[]>;
}

You might also like