-
-
Notifications
You must be signed in to change notification settings - Fork 27
Expand file tree
/
Copy pathitem.ts
More file actions
62 lines (54 loc) · 1.2 KB
/
item.ts
File metadata and controls
62 lines (54 loc) · 1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
import { WeightUnit } from "enums";
import { Category } from "./category";
export interface BaseItem {
name: string;
categoryId: number;
product_name?: string;
weight?: number;
weight_unit?: WeightUnit;
price?: number;
product_url?: string;
notes?: string;
}
export interface Item extends BaseItem {
id: number;
Category: Category;
createdAt: string;
updatedAt: string;
}
export type CreateItem = Omit<BaseItem, 'categoryId'> & {
categoryId?: number;
newCategory: boolean;
excludeWeight: boolean;
}
export type UpdateItem = Omit<BaseItem, 'categoryId'> & {
id: number;
categoryId?: number;
newCategory: boolean;
}
export interface NewPackItem {
quantity?: number;
sort_order?: number;
worn?: boolean;
notes?: string;
itemId: number;
packId: number;
}
export interface PackItemAttr {
quantity: number;
sort_order: number;
worn: boolean;
notes: string;
itemId?: number;
packId?: number;
createdAt?: string;
updatedAt?: string;
}
export interface PackItem extends Item {
packItem: PackItemAttr;
}
export enum ItemConstants {
name = 200,
product_name = 500,
product_url = 500
}