[SYNC] chore: Add jest config and update carta-porte services

- Add jest.config.js for testing
- Update figura-transporte DTO
- Update services index exports

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Adrian Flores Cortes 2026-02-03 08:12:35 -06:00
parent 825e349f37
commit e6c4d6b847
3 changed files with 36 additions and 8 deletions

30
jest.config.js Normal file
View File

@ -0,0 +1,30 @@
/** @type {import('ts-jest').JestConfigWithTsJest} */
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
roots: ['<rootDir>/src'],
testMatch: [
'**/__tests__/**/*.+(ts|tsx|js)',
'**/?(*.)+(spec|test).+(ts|tsx|js)'
],
transform: {
'^.+\\.(ts|tsx)$': ['ts-jest', {
useESM: false,
tsconfig: 'tsconfig.json',
}],
},
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
moduleNameMapper: {
'^(\\.{1,2}/.*)\\.js$': '$1',
},
collectCoverageFrom: [
'src/**/*.{ts,tsx}',
'!src/**/*.d.ts',
'!src/**/__tests__/**',
],
coverageDirectory: 'coverage',
verbose: true,
testTimeout: 30000,
clearMocks: true,
restoreMocks: true,
};

View File

@ -9,7 +9,7 @@ import {
Matches,
} from 'class-validator';
import { Type } from 'class-transformer';
import { TipoFiguraTransporte } from '../entities';
import { TipoFigura } from '../entities';
/**
* DTO para partes de transporte (propietario/arrendador)
@ -76,15 +76,15 @@ export class DomicilioFiguraDto {
*/
export class CreateFiguraTransporteDto {
/**
* Tipo de figura de transporte (catalogo c_TipoFiguraTransporte)
* Tipo de figura de transporte (catalogo c_TipoFigura)
* 01 = Operador
* 02 = Propietario
* 03 = Arrendador
* 04 = Notificado
*/
@IsEnum(TipoFiguraTransporte, { message: 'tipoFigura debe ser 01, 02, 03 o 04' })
@IsEnum(TipoFigura, { message: 'tipoFigura debe ser 01, 02, 03 o 04' })
@IsNotEmpty()
tipoFigura!: TipoFiguraTransporte;
tipoFigura!: TipoFigura;
/**
* RFC de la figura (opcional para operadores extranjeros)

View File

@ -18,7 +18,5 @@ export * from './figura-transporte.service';
// Inspeccion Pre-Viaje (Pre-trip Inspection) Service
export * from './inspeccion-pre-viaje.service';
// TODO: Implement additional services
// - carta-porte-validator.service.ts (validacion SAT detallada)
// - pac-integration.service.ts (integracion con PAC)
// - cfdi-generator.service.ts (generacion XML CFDI)
// XML Generator Service (CFDI + Carta Porte 3.1)
export * from './carta-porte-xml.service';