michangarrito/apps/backend/dist/modules/customers/customers.service.d.ts
rckrdmrd 48dea7a5d0 feat: Initial commit - michangarrito
Marketplace móvil para negocios locales mexicanos.

Estructura inicial:
- apps/backend (NestJS API)
- apps/frontend (React Web)
- apps/mobile (Expo/React Native)
- apps/mcp-server (Claude MCP Server)
- apps/whatsapp-service (WhatsApp Business API)
- database/ (PostgreSQL DDL)
- docs/ (Documentación)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-07 04:41:02 -06:00

35 lines
1.7 KiB
TypeScript

import { Repository } from 'typeorm';
import { Customer } from './entities/customer.entity';
import { Fiado } from './entities/fiado.entity';
import { FiadoPayment } from './entities/fiado-payment.entity';
import { CreateCustomerDto, UpdateCustomerDto, CreateFiadoDto, PayFiadoDto } from './dto/customer.dto';
export declare class CustomersService {
private readonly customerRepo;
private readonly fiadoRepo;
private readonly fiadoPaymentRepo;
constructor(customerRepo: Repository<Customer>, fiadoRepo: Repository<Fiado>, fiadoPaymentRepo: Repository<FiadoPayment>);
findAll(tenantId: string): Promise<Customer[]>;
findOne(tenantId: string, id: string): Promise<Customer>;
findByPhone(tenantId: string, phone: string): Promise<Customer | null>;
create(tenantId: string, dto: CreateCustomerDto): Promise<Customer>;
update(tenantId: string, id: string, dto: UpdateCustomerDto): Promise<Customer>;
toggleActive(tenantId: string, id: string): Promise<Customer>;
getWithFiados(tenantId: string): Promise<Customer[]>;
createFiado(tenantId: string, dto: CreateFiadoDto): Promise<Fiado>;
getFiados(tenantId: string, customerId?: string): Promise<Fiado[]>;
getPendingFiados(tenantId: string): Promise<Fiado[]>;
payFiado(tenantId: string, fiadoId: string, dto: PayFiadoDto, userId?: string): Promise<Fiado>;
cancelFiado(tenantId: string, fiadoId: string): Promise<Fiado>;
getCustomerStats(tenantId: string, customerId: string): Promise<{
customer: Customer;
stats: {
totalPurchases: number;
purchaseCount: number;
fiadoBalance: number;
fiadoLimit: number;
fiadoAvailable: number;
pendingFiados: number;
};
}>;
}