- Add missing fields to transport entities (tracking, viajes, ordenes-transporte) - Update enums to match service expectations (EstadoOrdenTransporte, TipoEventoTracking) - Add fiscal module from erp-core - Create app.ts entry point - Disable strictPropertyInitialization in tsconfig for TypeORM entities Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
50 lines
1.1 KiB
TypeScript
50 lines
1.1 KiB
TypeScript
import {
|
|
Entity,
|
|
PrimaryGeneratedColumn,
|
|
Column,
|
|
CreateDateColumn,
|
|
UpdateDateColumn,
|
|
Index,
|
|
} from 'typeorm';
|
|
|
|
export enum PersonType {
|
|
NATURAL = 'natural', // Persona fisica
|
|
LEGAL = 'legal', // Persona moral
|
|
BOTH = 'both',
|
|
}
|
|
|
|
@Entity({ schema: 'fiscal', name: 'fiscal_regimes' })
|
|
@Index('idx_fiscal_regimes_code', ['code'], { unique: true })
|
|
@Index('idx_fiscal_regimes_applies', ['appliesTo'])
|
|
export class FiscalRegime {
|
|
@PrimaryGeneratedColumn('uuid')
|
|
id: string;
|
|
|
|
@Column({ type: 'varchar', length: 10, nullable: false, unique: true })
|
|
code: string;
|
|
|
|
@Column({ type: 'varchar', length: 255, nullable: false })
|
|
name: string;
|
|
|
|
@Column({ type: 'text', nullable: true })
|
|
description: string | null;
|
|
|
|
@Column({
|
|
type: 'enum',
|
|
enum: PersonType,
|
|
nullable: false,
|
|
default: PersonType.BOTH,
|
|
name: 'applies_to',
|
|
})
|
|
appliesTo: PersonType;
|
|
|
|
@Column({ type: 'boolean', default: true, nullable: false, name: 'is_active' })
|
|
isActive: boolean;
|
|
|
|
@CreateDateColumn({ name: 'created_at', type: 'timestamptz' })
|
|
createdAt: Date;
|
|
|
|
@UpdateDateColumn({ name: 'updated_at', type: 'timestamptz' })
|
|
updatedAt: Date;
|
|
}
|