test: add unit tests for DAOs

This commit is contained in:
2026-01-18 18:36:34 -03:00
parent e125fb6e64
commit dfacc39e57
9 changed files with 420 additions and 38 deletions

View File

@@ -1,2 +1,37 @@
export type QueryResult<T> = { rows: T[]};
export type BatchOp = [string, any[]];
import { Chain } from '../models/Chain';
import { Establishment } from '../models/Establishment';
export type QueryResult<T> = { rows: T[] };
export type BatchOp = [string, any[]];
export type PurchaseQueryResult = {
id: number;
price: number;
quantity: number;
date: number;
establishment_id: number;
product_id: number;
barcode: string;
product_image: string | null;
product_name: string;
address: string;
chain_id: number;
chain_image: string | null;
chain_name: string | null;
};
export type ProductEstablishmentQueryResult = {
address: string;
barcode: string;
chain_id: number;
chain_image: string | null;
chain_name: string | null;
establishment_id: number;
id: number;
product_id: number;
product_image: string | null;
product_name: string;
};
export type EstablishmentQueryResult = Omit<Establishment, 'chain'> &
Omit<Chain, 'id'> & { id: number; chain_id: number };