a68a0ca86f
Test Suite / test (24.15.0) (push) Has been cancelled
- Added new API path for unit mappings in `api_paths.dart`. - Implemented `upsertUnitMapping` method in `ImportRepository` to handle unit mapping creation. - Updated `ReceiptImportTab` to learn and save unit mappings during receipt import. - Created DTO for unit mapping with validation in `create-unit-mapping.dto.ts`. - Added SQL migration for `UnitMapping` table creation with necessary constraints.
63 lines
1.8 KiB
TypeScript
63 lines
1.8 KiB
TypeScript
import { PrismaService } from '../prisma/prisma.service';
|
|
import { CreatePantryItemDto } from './dto/create-pantry-item.dto';
|
|
export declare class PantryService {
|
|
private readonly prisma;
|
|
constructor(prisma: PrismaService);
|
|
findAll(userId: number): import(".prisma/client").Prisma.PrismaPromise<({
|
|
product: {
|
|
name: string;
|
|
category: string | null;
|
|
status: string;
|
|
id: number;
|
|
categoryId: number | null;
|
|
normalizedName: string;
|
|
canonicalName: string | null;
|
|
isActive: boolean;
|
|
deletedAt: Date | null;
|
|
createdAt: Date;
|
|
updatedAt: Date;
|
|
ownerId: number;
|
|
isPrivate: boolean;
|
|
};
|
|
} & {
|
|
id: number;
|
|
createdAt: Date;
|
|
updatedAt: Date;
|
|
productId: number;
|
|
location: string | null;
|
|
userId: number;
|
|
})[]>;
|
|
create(userId: number, data: CreatePantryItemDto): Promise<{
|
|
product: {
|
|
name: string;
|
|
category: string | null;
|
|
status: string;
|
|
id: number;
|
|
categoryId: number | null;
|
|
normalizedName: string;
|
|
canonicalName: string | null;
|
|
isActive: boolean;
|
|
deletedAt: Date | null;
|
|
createdAt: Date;
|
|
updatedAt: Date;
|
|
ownerId: number;
|
|
isPrivate: boolean;
|
|
};
|
|
} & {
|
|
id: number;
|
|
createdAt: Date;
|
|
updatedAt: Date;
|
|
productId: number;
|
|
location: string | null;
|
|
userId: number;
|
|
}>;
|
|
remove(userId: number, id: number): Promise<{
|
|
id: number;
|
|
createdAt: Date;
|
|
updatedAt: Date;
|
|
productId: number;
|
|
location: string | null;
|
|
userId: number;
|
|
}>;
|
|
}
|