homemanager-fe/src/interfaces/storage.interfaces.ts

67 lines
1.4 KiB
TypeScript

import { ItemType } from '../enums/item-type.enum';
import { StorageSetType } from '../enums/storage-set-type.enum';
import { StorageType } from '../enums/storage-type.enum';
import { TransactionType } from '../enums/transaction-type.enum';
import { AddedBy } from './user.interfaces';
export interface StorageSharedType {
id: number;
displayName: string;
location: string;
locationDescription: string;
color: string;
createdAt: string;
updatedAt: string;
}
export interface StorageListItem extends StorageSharedType {
type: StorageType;
items?: StoredItem[];
itemCount: number;
}
export interface StorageSetListItem extends StorageSharedType {
type: StorageSetType;
storages: StorageListItem[];
}
export interface StorageItem {
id: number;
displayName: string;
type: ItemType;
barcode?: string;
consumable?: boolean;
image?: string;
weight?: number;
url?: string;
notes?: string;
public: boolean;
createdAt: string;
updatedAt: string;
}
export interface StoredItemTransaction {
id: number;
type: TransactionType;
price?: number;
currency?: string;
notes?: string;
actionAt: string;
createdAt: string;
updatedAt: string;
actor?: AddedBy;
}
export interface StoredItem {
id: number;
notes: string;
expiresAt?: string;
acquiredAt?: string;
consumedAt?: string;
item: StorageItem;
addedBy: AddedBy;
createdAt: string;
updatedAt: string;
transactions?: StoredItemTransaction[];
}