Add products module #46
This commit is contained in:
Vendored
+71
-1
@@ -279,4 +279,74 @@ export function newPaymentTerms(): PaymentTerms {
|
||||
isFixed: false,
|
||||
days: 14
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export interface ProductCategory {
|
||||
id: number;
|
||||
name: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
}
|
||||
|
||||
export function newProductCategory(): ProductCategory {
|
||||
return {
|
||||
id: 0,
|
||||
name: '',
|
||||
createdAt: new Date(),
|
||||
updatedAt: new Date()
|
||||
}
|
||||
}
|
||||
|
||||
export interface Unit {
|
||||
id: number;
|
||||
name: string;
|
||||
symbol: string | null;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
}
|
||||
|
||||
export function newUnit(): Unit {
|
||||
return {
|
||||
id: 0,
|
||||
name: '',
|
||||
symbol: null,
|
||||
createdAt: new Date(),
|
||||
updatedAt: new Date()
|
||||
}
|
||||
}
|
||||
|
||||
export interface Product {
|
||||
id: number;
|
||||
title: string;
|
||||
description: string | null;
|
||||
notes: string | null;
|
||||
vendorUrl: string | null;
|
||||
categoryId: number | null;
|
||||
category: ProductCategory | null;
|
||||
price: number | null;
|
||||
margin: number;
|
||||
unitId: number | null;
|
||||
unit: Unit | null;
|
||||
image: string | null;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
}
|
||||
|
||||
export function newProduct(): Product {
|
||||
return {
|
||||
id: 0,
|
||||
title: '',
|
||||
description: null,
|
||||
notes: null,
|
||||
vendorUrl: null,
|
||||
categoryId: null,
|
||||
category: null,
|
||||
price: null,
|
||||
margin: 0.2,
|
||||
unitId: null,
|
||||
unit: null,
|
||||
image: null,
|
||||
createdAt: new Date(),
|
||||
updatedAt: new Date()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user