BE-001: Biometrics - Servicio minimo de solo lectura - biometrics.service.ts con metodos de consulta - biometrics.controller.ts con 10 endpoints GET - DTOs para filtros y respuestas - README actualizado BE-002: Invoices - Marcado como deprecated - DEPRECATED.md con plan de migracion - Entities marcadas con @deprecated - Mapeo a modulo financial documentado Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
80 lines
2.3 KiB
TypeScript
80 lines
2.3 KiB
TypeScript
import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateColumn, DeleteDateColumn, Index } from 'typeorm';
|
|
|
|
/**
|
|
* Payment Entity
|
|
*
|
|
* @deprecated Since 2026-02-03. Use financial/payment.entity.ts instead.
|
|
* @see Payment from '@modules/financial/entities'
|
|
*/
|
|
@Entity({ name: 'payments', schema: 'billing' })
|
|
export class Payment {
|
|
@PrimaryGeneratedColumn('uuid')
|
|
id: string;
|
|
|
|
@Index()
|
|
@Column({ name: 'tenant_id', type: 'uuid' })
|
|
tenantId: string;
|
|
|
|
@Index()
|
|
@Column({ name: 'payment_number', type: 'varchar', length: 30 })
|
|
paymentNumber: string;
|
|
|
|
@Index()
|
|
@Column({ name: 'payment_type', type: 'varchar', length: 20, default: 'received' })
|
|
paymentType: 'received' | 'made';
|
|
|
|
@Index()
|
|
@Column({ name: 'partner_id', type: 'uuid' })
|
|
partnerId: string;
|
|
|
|
@Column({ name: 'partner_name', type: 'varchar', length: 200, nullable: true })
|
|
partnerName: string;
|
|
|
|
@Column({ type: 'varchar', length: 3, default: 'MXN' })
|
|
currency: string;
|
|
|
|
@Column({ type: 'decimal', precision: 15, scale: 2 })
|
|
amount: number;
|
|
|
|
@Column({ name: 'exchange_rate', type: 'decimal', precision: 10, scale: 6, default: 1 })
|
|
exchangeRate: number;
|
|
|
|
@Column({ name: 'payment_date', type: 'date', default: () => 'CURRENT_DATE' })
|
|
paymentDate: Date;
|
|
|
|
@Index()
|
|
@Column({ name: 'payment_method', type: 'varchar', length: 50 })
|
|
paymentMethod: string;
|
|
|
|
@Column({ type: 'varchar', length: 100, nullable: true })
|
|
reference: string;
|
|
|
|
@Column({ name: 'bank_account_id', type: 'uuid', nullable: true })
|
|
bankAccountId: string;
|
|
|
|
@Index()
|
|
@Column({ type: 'varchar', length: 20, default: 'draft' })
|
|
status: 'draft' | 'confirmed' | 'reconciled' | 'cancelled';
|
|
|
|
@Column({ type: 'text', nullable: true })
|
|
notes: string;
|
|
|
|
@Column({ name: 'cfdi_uuid', type: 'varchar', length: 40, nullable: true })
|
|
cfdiUuid: string;
|
|
|
|
@Column({ name: 'cfdi_status', type: 'varchar', length: 20, nullable: true })
|
|
cfdiStatus: string;
|
|
|
|
@CreateDateColumn({ name: 'created_at', type: 'timestamptz' })
|
|
createdAt: Date;
|
|
|
|
@Column({ name: 'created_by', type: 'uuid', nullable: true })
|
|
createdBy?: string;
|
|
|
|
@UpdateDateColumn({ name: 'updated_at', type: 'timestamptz' })
|
|
updatedAt: Date;
|
|
|
|
@DeleteDateColumn({ name: 'deleted_at', type: 'timestamptz', nullable: true })
|
|
deletedAt: Date;
|
|
}
|