54 lines
898 B
TypeScript
54 lines
898 B
TypeScript
import { ObjectId } from 'mongodb';
|
|
|
|
export interface Category {
|
|
_id: ObjectId;
|
|
name: string;
|
|
createdAt: Date;
|
|
updatedAt: Date;
|
|
}
|
|
|
|
export interface Subcategory {
|
|
_id: ObjectId;
|
|
name: string;
|
|
categoryId: ObjectId;
|
|
createdAt: Date;
|
|
updatedAt: Date;
|
|
}
|
|
|
|
export interface Supplier {
|
|
_id: ObjectId;
|
|
name: string;
|
|
createdAt: Date;
|
|
updatedAt: Date;
|
|
}
|
|
|
|
export interface ProductDoc {
|
|
_id: ObjectId;
|
|
code: string;
|
|
name: string;
|
|
categoryId: ObjectId;
|
|
subcategoryId: ObjectId;
|
|
quantity: number;
|
|
unit: string;
|
|
unitPrice: number;
|
|
vat: number;
|
|
supplierId: ObjectId;
|
|
createdAt: Date;
|
|
updatedAt: Date;
|
|
}
|
|
|
|
export interface ProductWithRefs {
|
|
_id: string;
|
|
code: string;
|
|
name: string;
|
|
category: string;
|
|
subcategory: string;
|
|
quantity: number;
|
|
unit: string;
|
|
unitPrice: number;
|
|
vat: number;
|
|
supplier: string;
|
|
createdAt: string;
|
|
updatedAt: string;
|
|
}
|