Refactor code structure for improved readability and maintainability
Test Suite / test (24.15.0) (push) Has been cancelled

This commit is contained in:
Nils-Johan Gynther
2026-05-06 07:37:59 +02:00
parent e4f201ea36
commit 969dafdbc6
273 changed files with 11357 additions and 39 deletions
+200
View File
@@ -0,0 +1,200 @@
import { CreateInventoryDto } from './dto/create-inventory.dto';
import { UpdateInventoryDto } from './dto/update-inventory.dto';
import { InventoryService } from './inventory.service';
import { ConsumeInventoryDto } from './dto/consume-inventory.dto';
export declare class InventoryController {
private readonly inventoryService;
constructor(inventoryService: InventoryService);
consume(id: number, body: ConsumeInventoryDto): Promise<{
product: {
category: string | null;
status: string;
name: string;
categoryId: number | null;
canonicalName: string | null;
id: number;
normalizedName: string;
isActive: boolean;
deletedAt: Date | null;
createdAt: Date;
updatedAt: Date;
ownerId: number;
isPrivate: boolean;
};
} & {
id: number;
createdAt: Date;
updatedAt: Date;
productId: number;
quantity: import("@prisma/client/runtime/library").Decimal;
unit: string;
brand: string | null;
origin: string | null;
receiptName: string | null;
location: string | null;
purchaseDate: Date | null;
opened: boolean | null;
suitableFor: string | null;
bestBeforeDate: Date | null;
comment: string | null;
}>;
findConsumptionHistory(id: number): Promise<{
inventoryItem: {
unit: string;
};
id: number;
createdAt: Date;
comment: string | null;
amountUsed: import("@prisma/client/runtime/library").Decimal;
inventoryItemId: number;
}[]>;
findAll(location?: string, sort?: string): Promise<({
product: {
category: string | null;
status: string;
name: string;
categoryId: number | null;
canonicalName: string | null;
id: number;
normalizedName: string;
isActive: boolean;
deletedAt: Date | null;
createdAt: Date;
updatedAt: Date;
ownerId: number;
isPrivate: boolean;
};
} & {
id: number;
createdAt: Date;
updatedAt: Date;
productId: number;
quantity: import("@prisma/client/runtime/library").Decimal;
unit: string;
brand: string | null;
origin: string | null;
receiptName: string | null;
location: string | null;
purchaseDate: Date | null;
opened: boolean | null;
suitableFor: string | null;
bestBeforeDate: Date | null;
comment: string | null;
})[]>;
findExpiring(): Promise<({
product: {
category: string | null;
status: string;
name: string;
categoryId: number | null;
canonicalName: string | null;
id: number;
normalizedName: string;
isActive: boolean;
deletedAt: Date | null;
createdAt: Date;
updatedAt: Date;
ownerId: number;
isPrivate: boolean;
};
} & {
id: number;
createdAt: Date;
updatedAt: Date;
productId: number;
quantity: import("@prisma/client/runtime/library").Decimal;
unit: string;
brand: string | null;
origin: string | null;
receiptName: string | null;
location: string | null;
purchaseDate: Date | null;
opened: boolean | null;
suitableFor: string | null;
bestBeforeDate: Date | null;
comment: string | null;
})[]>;
create(body: CreateInventoryDto): Promise<{
product: {
category: string | null;
status: string;
name: string;
categoryId: number | null;
canonicalName: string | null;
id: number;
normalizedName: string;
isActive: boolean;
deletedAt: Date | null;
createdAt: Date;
updatedAt: Date;
ownerId: number;
isPrivate: boolean;
};
} & {
id: number;
createdAt: Date;
updatedAt: Date;
productId: number;
quantity: import("@prisma/client/runtime/library").Decimal;
unit: string;
brand: string | null;
origin: string | null;
receiptName: string | null;
location: string | null;
purchaseDate: Date | null;
opened: boolean | null;
suitableFor: string | null;
bestBeforeDate: Date | null;
comment: string | null;
}>;
update(id: number, body: UpdateInventoryDto): Promise<{
product: {
category: string | null;
status: string;
name: string;
categoryId: number | null;
canonicalName: string | null;
id: number;
normalizedName: string;
isActive: boolean;
deletedAt: Date | null;
createdAt: Date;
updatedAt: Date;
ownerId: number;
isPrivate: boolean;
};
} & {
id: number;
createdAt: Date;
updatedAt: Date;
productId: number;
quantity: import("@prisma/client/runtime/library").Decimal;
unit: string;
brand: string | null;
origin: string | null;
receiptName: string | null;
location: string | null;
purchaseDate: Date | null;
opened: boolean | null;
suitableFor: string | null;
bestBeforeDate: Date | null;
comment: string | null;
}>;
remove(id: number): Promise<{
id: number;
createdAt: Date;
updatedAt: Date;
productId: number;
quantity: import("@prisma/client/runtime/library").Decimal;
unit: string;
brand: string | null;
origin: string | null;
receiptName: string | null;
location: string | null;
purchaseDate: Date | null;
opened: boolean | null;
suitableFor: string | null;
bestBeforeDate: Date | null;
comment: string | null;
}>;
}