@ramiidv/arca-empleados 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +380 -0
- package/dist/constants.d.ts +314 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +511 -0
- package/dist/constants.js.map +1 -0
- package/dist/errors.d.ts +16 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +22 -0
- package/dist/errors.js.map +1 -0
- package/dist/f935-builder.d.ts +91 -0
- package/dist/f935-builder.d.ts.map +1 -0
- package/dist/f935-builder.js +246 -0
- package/dist/f935-builder.js.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +21 -0
- package/dist/index.js.map +1 -0
- package/dist/serializer.d.ts +58 -0
- package/dist/serializer.d.ts.map +1 -0
- package/dist/serializer.js +304 -0
- package/dist/serializer.js.map +1 -0
- package/dist/types.d.ts +204 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +5 -0
- package/dist/types.js.map +1 -0
- package/dist/validators.d.ts +38 -0
- package/dist/validators.d.ts.map +1 -0
- package/dist/validators.js +255 -0
- package/dist/validators.js.map +1 -0
- package/llms.txt +269 -0
- package/package.json +64 -0
|
@@ -0,0 +1,304 @@
|
|
|
1
|
+
import { ArcaSerializationError } from './errors.js';
|
|
2
|
+
import { TipoOperacion } from './constants.js';
|
|
3
|
+
import { normalizeCuil } from './validators.js';
|
|
4
|
+
// ---------------------------------------------------------------------------
|
|
5
|
+
// Formatting helpers
|
|
6
|
+
// ---------------------------------------------------------------------------
|
|
7
|
+
/**
|
|
8
|
+
* Formats a Date as DDMMYYYY.
|
|
9
|
+
*/
|
|
10
|
+
export function formatDate(date) {
|
|
11
|
+
const day = String(date.getDate()).padStart(2, '0');
|
|
12
|
+
const month = String(date.getMonth() + 1).padStart(2, '0');
|
|
13
|
+
const year = String(date.getFullYear());
|
|
14
|
+
return `${day}${month}${year}`;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Converts a boolean to 'S' or 'N'.
|
|
18
|
+
*/
|
|
19
|
+
export function boolToStr(val) {
|
|
20
|
+
return val ? 'S' : 'N';
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Formats a number with 2 decimal places as a string (e.g. 1500.50 -> "1500.50").
|
|
24
|
+
*/
|
|
25
|
+
function formatMonto(val) {
|
|
26
|
+
if (val === undefined || val === null)
|
|
27
|
+
return '';
|
|
28
|
+
return val.toFixed(2);
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Returns the string representation of a value, or empty string if undefined/null.
|
|
32
|
+
*/
|
|
33
|
+
function str(val) {
|
|
34
|
+
if (val === undefined || val === null)
|
|
35
|
+
return '';
|
|
36
|
+
return String(val);
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Escapes a string field for the pipe-delimited format.
|
|
40
|
+
* Replaces pipe characters (|), newlines, and carriage returns to prevent
|
|
41
|
+
* corruption of the file format.
|
|
42
|
+
*/
|
|
43
|
+
function escapeField(val) {
|
|
44
|
+
if (!val)
|
|
45
|
+
return '';
|
|
46
|
+
return val
|
|
47
|
+
.replace(/\\/g, '\\\\')
|
|
48
|
+
.replace(/\|/g, '\\|')
|
|
49
|
+
.replace(/\n/g, '\\n')
|
|
50
|
+
.replace(/\r/g, '\\r');
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Returns the escaped string representation of a value, or empty string if undefined/null.
|
|
54
|
+
* Use this for free-text fields (calle, localidad, razon social, nombres, etc.).
|
|
55
|
+
*/
|
|
56
|
+
function strEsc(val) {
|
|
57
|
+
if (val === undefined || val === null)
|
|
58
|
+
return '';
|
|
59
|
+
return escapeField(val);
|
|
60
|
+
}
|
|
61
|
+
// ---------------------------------------------------------------------------
|
|
62
|
+
// Record serializers
|
|
63
|
+
// ---------------------------------------------------------------------------
|
|
64
|
+
/**
|
|
65
|
+
* Serializes the file header line.
|
|
66
|
+
* Format: 00|CUIT|RAZON_SOCIAL|FECHA_GENERACION|CANTIDAD_REGISTROS|
|
|
67
|
+
*/
|
|
68
|
+
export function serializeHeader(archivo) {
|
|
69
|
+
const cuit = normalizeCuil(archivo.cuitEmpleador);
|
|
70
|
+
const razon = strEsc(archivo.razonSocial ?? '');
|
|
71
|
+
const fecha = formatDate(archivo.fechaGeneracion);
|
|
72
|
+
const cantidad = String(archivo.cantidadRegistros);
|
|
73
|
+
return `00|${cuit}|${razon}|${fecha}|${cantidad}|`;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Serializes an alta (employee registration) record.
|
|
77
|
+
* Format: 01|CUIT_EMPLEADOR|TIPO_OP|CUIL|FECHA_INICIO|MODALIDAD|OBRA_SOCIAL|ACTIVIDAD|AGROPECUARIO|FECHA_FIN|CALLE|NUMERO|PISO|DEPTO|LOCALIDAD|CP|PROVINCIA|TELEFONO|
|
|
78
|
+
*/
|
|
79
|
+
export function serializeAlta(cuitEmpleador, alta) {
|
|
80
|
+
const cuit = normalizeCuil(cuitEmpleador);
|
|
81
|
+
const cuil = normalizeCuil(alta.cuil);
|
|
82
|
+
const dom = alta.domicilioExplotacion;
|
|
83
|
+
const fields = [
|
|
84
|
+
'01',
|
|
85
|
+
cuit,
|
|
86
|
+
String(TipoOperacion.ALTA),
|
|
87
|
+
cuil,
|
|
88
|
+
formatDate(alta.fechaInicio),
|
|
89
|
+
String(alta.modalidadContratacion),
|
|
90
|
+
alta.obraSocial,
|
|
91
|
+
alta.actividadEconomica,
|
|
92
|
+
boolToStr(alta.trabajadorAgropecuario),
|
|
93
|
+
alta.fechaFin ? formatDate(alta.fechaFin) : '',
|
|
94
|
+
strEsc(dom.calle),
|
|
95
|
+
strEsc(dom.numero),
|
|
96
|
+
strEsc(dom.piso),
|
|
97
|
+
strEsc(dom.depto),
|
|
98
|
+
strEsc(dom.localidad),
|
|
99
|
+
dom.codigoPostal,
|
|
100
|
+
String(dom.provincia),
|
|
101
|
+
strEsc(dom.telefono),
|
|
102
|
+
];
|
|
103
|
+
return fields.join('|') + '|';
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Serializes a baja (employee termination) record.
|
|
107
|
+
* Format: 01|CUIT_EMPLEADOR|TIPO_OP|CUIL|FECHA_BAJA|MOTIVO_BAJA|
|
|
108
|
+
*/
|
|
109
|
+
export function serializeBaja(cuitEmpleador, baja) {
|
|
110
|
+
const cuit = normalizeCuil(cuitEmpleador);
|
|
111
|
+
const cuil = normalizeCuil(baja.cuil);
|
|
112
|
+
const fields = [
|
|
113
|
+
'01',
|
|
114
|
+
cuit,
|
|
115
|
+
String(TipoOperacion.BAJA),
|
|
116
|
+
cuil,
|
|
117
|
+
formatDate(baja.fechaBaja),
|
|
118
|
+
String(baja.motivoBaja),
|
|
119
|
+
];
|
|
120
|
+
return fields.join('|') + '|';
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Serializes a modificacion (employee modification) record.
|
|
124
|
+
* Format: 01|CUIT_EMPLEADOR|TIPO_OP|CUIL|FECHA_INICIO|MODALIDAD|OBRA_SOCIAL|ACTIVIDAD|AGROPECUARIO|FECHA_FIN|CALLE|NUMERO|PISO|DEPTO|LOCALIDAD|CP|PROVINCIA|TELEFONO|
|
|
125
|
+
*/
|
|
126
|
+
export function serializeModificacion(cuitEmpleador, mod) {
|
|
127
|
+
const cuit = normalizeCuil(cuitEmpleador);
|
|
128
|
+
const cuil = normalizeCuil(mod.cuil);
|
|
129
|
+
const dom = mod.domicilioExplotacion;
|
|
130
|
+
const fields = [
|
|
131
|
+
'01',
|
|
132
|
+
cuit,
|
|
133
|
+
String(TipoOperacion.MODIFICACION),
|
|
134
|
+
cuil,
|
|
135
|
+
formatDate(mod.fechaInicio),
|
|
136
|
+
str(mod.modalidadContratacion),
|
|
137
|
+
str(mod.obraSocial),
|
|
138
|
+
str(mod.actividadEconomica),
|
|
139
|
+
mod.trabajadorAgropecuario !== undefined ? boolToStr(mod.trabajadorAgropecuario) : '',
|
|
140
|
+
mod.fechaFin ? formatDate(mod.fechaFin) : '',
|
|
141
|
+
dom ? strEsc(dom.calle) : '',
|
|
142
|
+
dom ? strEsc(dom.numero) : '',
|
|
143
|
+
dom ? strEsc(dom.piso) : '',
|
|
144
|
+
dom ? strEsc(dom.depto) : '',
|
|
145
|
+
dom ? strEsc(dom.localidad) : '',
|
|
146
|
+
dom ? dom.codigoPostal : '',
|
|
147
|
+
dom ? String(dom.provincia) : '',
|
|
148
|
+
dom ? strEsc(dom.telefono) : '',
|
|
149
|
+
];
|
|
150
|
+
return fields.join('|') + '|';
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* Serializes a datos complementarios record.
|
|
154
|
+
* Format: 02|CUIT_EMPLEADOR|CUIL|FECHA_INICIO|SITUACION_REVISTA|NIVEL_EDUCACION|PUESTO|CCT|TIPO_SERVICIO|MOD_LIQUIDACION|ESTADO_CIVIL|REMUNERACION|HORAS|APORTE_ADICIONAL|CONTRIB_TAREAS_DIF|COD_SINIESTRADO|MARCA_PREAVISO|FECHA_PREAVISO|CONCEPTO_LIQUIDACION|
|
|
155
|
+
*/
|
|
156
|
+
export function serializeDatosComplementarios(cuitEmpleador, datos) {
|
|
157
|
+
const cuit = normalizeCuil(cuitEmpleador);
|
|
158
|
+
const cuil = normalizeCuil(datos.cuil);
|
|
159
|
+
const fields = [
|
|
160
|
+
'02',
|
|
161
|
+
cuit,
|
|
162
|
+
cuil,
|
|
163
|
+
formatDate(datos.fechaInicio),
|
|
164
|
+
String(datos.situacionRevista),
|
|
165
|
+
str(datos.nivelEducacion),
|
|
166
|
+
strEsc(datos.puestoDesempenado),
|
|
167
|
+
strEsc(datos.convenioColectivo),
|
|
168
|
+
str(datos.tipoServicio),
|
|
169
|
+
str(datos.modalidadLiquidacion),
|
|
170
|
+
str(datos.estadoCivil),
|
|
171
|
+
formatMonto(datos.remuneracion),
|
|
172
|
+
str(datos.cantidadHorasTrabajadas),
|
|
173
|
+
formatMonto(datos.porcentajeAporteAdicionalSS),
|
|
174
|
+
str(datos.contribucionTareasDiferenciales),
|
|
175
|
+
str(datos.codigoSiniestrado),
|
|
176
|
+
datos.marcaPreaviso !== undefined ? boolToStr(datos.marcaPreaviso) : '',
|
|
177
|
+
datos.fechaPreaviso ? formatDate(datos.fechaPreaviso) : '',
|
|
178
|
+
str(datos.conceptoLiquidacion),
|
|
179
|
+
];
|
|
180
|
+
return fields.join('|') + '|';
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* Serializes a CBU record.
|
|
184
|
+
* Format: 03|CUIT_EMPLEADOR|CUIL|FECHA_INICIO|CBU|TIPO_CUENTA|
|
|
185
|
+
*/
|
|
186
|
+
export function serializeCBU(cuitEmpleador, cbuData) {
|
|
187
|
+
const cuit = normalizeCuil(cuitEmpleador);
|
|
188
|
+
const cuil = normalizeCuil(cbuData.cuil);
|
|
189
|
+
const fields = [
|
|
190
|
+
'03',
|
|
191
|
+
cuit,
|
|
192
|
+
cuil,
|
|
193
|
+
formatDate(cbuData.fechaInicio),
|
|
194
|
+
cbuData.cbu,
|
|
195
|
+
str(cbuData.tipoCuenta),
|
|
196
|
+
];
|
|
197
|
+
return fields.join('|') + '|';
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* Serializes a relacion familiar record.
|
|
201
|
+
* Format: 04|CUIT_EMPLEADOR|CUIL|FECHA_INICIO|TIPO_RELACION|CUIL_FAMILIAR|DNI_FAMILIAR|NOMBRE|APELLIDO|FECHA_NACIMIENTO|DISCAPACITADO|ESCOLARIDAD|OBRA_SOCIAL_FAMILIAR|CUIL_TITULAR_OS|
|
|
202
|
+
*/
|
|
203
|
+
export function serializeRelacionFamiliar(cuitEmpleador, rel) {
|
|
204
|
+
const cuit = normalizeCuil(cuitEmpleador);
|
|
205
|
+
const cuil = normalizeCuil(rel.cuil);
|
|
206
|
+
const fields = [
|
|
207
|
+
'04',
|
|
208
|
+
cuit,
|
|
209
|
+
cuil,
|
|
210
|
+
formatDate(rel.fechaInicio),
|
|
211
|
+
String(rel.tipoRelacion),
|
|
212
|
+
rel.cuilFamiliar ? normalizeCuil(rel.cuilFamiliar) : '',
|
|
213
|
+
str(rel.dniFamiliar),
|
|
214
|
+
strEsc(rel.nombreFamiliar),
|
|
215
|
+
strEsc(rel.apellidoFamiliar),
|
|
216
|
+
formatDate(rel.fechaNacimiento),
|
|
217
|
+
rel.discapacitado !== undefined ? boolToStr(rel.discapacitado) : '',
|
|
218
|
+
str(rel.escolaridad),
|
|
219
|
+
str(rel.obraSocialFamiliar),
|
|
220
|
+
rel.cuilTitularObraSocial ? normalizeCuil(rel.cuilTitularObraSocial) : '',
|
|
221
|
+
];
|
|
222
|
+
return fields.join('|') + '|';
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* Serializes a domicilio de explotacion record.
|
|
226
|
+
* Format: 05|CUIT_EMPLEADOR|CUIL|CALLE|NUMERO|PISO|DEPTO|LOCALIDAD|CP|PROVINCIA|TELEFONO|ACTIVIDAD_ECONOMICA|
|
|
227
|
+
*/
|
|
228
|
+
export function serializeDomicilio(cuitEmpleador, dom) {
|
|
229
|
+
const cuit = normalizeCuil(cuitEmpleador);
|
|
230
|
+
const cuil = normalizeCuil(dom.cuil);
|
|
231
|
+
const fields = [
|
|
232
|
+
'05',
|
|
233
|
+
cuit,
|
|
234
|
+
cuil,
|
|
235
|
+
strEsc(dom.calle),
|
|
236
|
+
strEsc(dom.numero),
|
|
237
|
+
strEsc(dom.piso),
|
|
238
|
+
strEsc(dom.depto),
|
|
239
|
+
strEsc(dom.localidad),
|
|
240
|
+
dom.codigoPostal,
|
|
241
|
+
String(dom.provincia),
|
|
242
|
+
strEsc(dom.telefono),
|
|
243
|
+
str(dom.actividadEconomica),
|
|
244
|
+
];
|
|
245
|
+
return fields.join('|') + '|';
|
|
246
|
+
}
|
|
247
|
+
// ---------------------------------------------------------------------------
|
|
248
|
+
// Full file serializer
|
|
249
|
+
// ---------------------------------------------------------------------------
|
|
250
|
+
/**
|
|
251
|
+
* Serializes a complete F935Archivo to a string.
|
|
252
|
+
* Returns the full file content with header and all record lines.
|
|
253
|
+
* @throws ArcaSerializationError if serialization fails.
|
|
254
|
+
*/
|
|
255
|
+
export function serializeArchivo(archivo) {
|
|
256
|
+
try {
|
|
257
|
+
const lines = [];
|
|
258
|
+
// Header
|
|
259
|
+
lines.push(serializeHeader(archivo));
|
|
260
|
+
// Records
|
|
261
|
+
for (const registro of archivo.registros) {
|
|
262
|
+
lines.push(serializeRegistro(archivo.cuitEmpleador, registro));
|
|
263
|
+
}
|
|
264
|
+
return lines.join('\n');
|
|
265
|
+
}
|
|
266
|
+
catch (error) {
|
|
267
|
+
if (error instanceof ArcaSerializationError) {
|
|
268
|
+
throw error;
|
|
269
|
+
}
|
|
270
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
271
|
+
throw new ArcaSerializationError(`Error al serializar el archivo F935: ${message}`);
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
/**
|
|
275
|
+
* Serializes a single F935Registro based on its type.
|
|
276
|
+
*/
|
|
277
|
+
function serializeRegistro(cuitEmpleador, registro) {
|
|
278
|
+
switch (registro.tipo) {
|
|
279
|
+
case 1:
|
|
280
|
+
switch (registro.operacion) {
|
|
281
|
+
case 0:
|
|
282
|
+
return serializeAlta(cuitEmpleador, registro.data);
|
|
283
|
+
case 1:
|
|
284
|
+
return serializeBaja(cuitEmpleador, registro.data);
|
|
285
|
+
case 2:
|
|
286
|
+
return serializeModificacion(cuitEmpleador, registro.data);
|
|
287
|
+
default:
|
|
288
|
+
throw new ArcaSerializationError(`Tipo de operacion desconocido en registro tipo 1`);
|
|
289
|
+
}
|
|
290
|
+
case 2:
|
|
291
|
+
return serializeDatosComplementarios(cuitEmpleador, registro.data);
|
|
292
|
+
case 3:
|
|
293
|
+
return serializeCBU(cuitEmpleador, registro.data);
|
|
294
|
+
case 4:
|
|
295
|
+
return serializeRelacionFamiliar(cuitEmpleador, registro.data);
|
|
296
|
+
case 5:
|
|
297
|
+
return serializeDomicilio(cuitEmpleador, registro.data);
|
|
298
|
+
default: {
|
|
299
|
+
const _exhaustive = registro;
|
|
300
|
+
throw new ArcaSerializationError(`Tipo de registro desconocido: ${_exhaustive.tipo}`);
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
//# sourceMappingURL=serializer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serializer.js","sourceRoot":"","sources":["../src/serializer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAYrD,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD,8EAA8E;AAC9E,qBAAqB;AACrB,8EAA8E;AAE9E;;GAEG;AACH,MAAM,UAAU,UAAU,CAAC,IAAU;IACnC,MAAM,GAAG,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;IACpD,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;IAC3D,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC;IACxC,OAAO,GAAG,GAAG,GAAG,KAAK,GAAG,IAAI,EAAE,CAAC;AACjC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,SAAS,CAAC,GAAa;IACrC,OAAO,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC;AACzB,CAAC;AAED;;GAEG;AACH,SAAS,WAAW,CAAC,GAAY;IAC/B,IAAI,GAAG,KAAK,SAAS,IAAI,GAAG,KAAK,IAAI;QAAE,OA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AC;oBACJ,OAAO,aAAa,CAAC,aAAa,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC;gBACrD,KAAK,CAAC;oBACJ,OAAO,qBAAqB,CAAC,aAAa,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC;gBAC7D;oBACE,MAAM,IAAI,sBAAsB,CAC9B,kDAAkD,CACnD,CAAC;YACN,CAAC;QACH,KAAK,CAAC;YACJ,OAAO,6BAA6B,CAAC,aAAa,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC;QACrE,KAAK,CAAC;YACJ,OAAO,YAAY,CAAC,aAAa,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC;QACpD,KAAK,CAAC;YACJ,OAAO,yBAAyB,CAAC,aAAa,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC;QACjE,KAAK,CAAC;YACJ,OAAO,kBAAkB,CAAC,aAAa,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC;QAC1D,OAAO,CAAC,CAAC,CAAC;YACR,MAAM,WAAW,GAAU,QAAQ,CAAC;YACpC,MAAM,IAAI,sBAAsB,CAC9B,iCAAkC,WAA4B,CAAC,IAAI,EAAE,CACtE,CAAC;QACJ,CAAC;IACH,CAAC;AACH,CAAC"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
/** Configuration for the ArcaEmpleados builder. */
|
|
2
|
+
export interface ArcaEmpleadosConfig {
|
|
3
|
+
/** CUIT del empleador (11 digitos, con o sin guiones). */
|
|
4
|
+
cuitEmpleador: string;
|
|
5
|
+
/** Razon social del empleador (opcional, se incluye en el header del archivo). */
|
|
6
|
+
razonSocial?: string;
|
|
7
|
+
/** Si es true (default), valida todos los campos al agregar registros. */
|
|
8
|
+
strict?: boolean;
|
|
9
|
+
}
|
|
10
|
+
/** Domicilio de explotacion (lugar de trabajo). */
|
|
11
|
+
export interface DomicilioExplotacion {
|
|
12
|
+
calle: string;
|
|
13
|
+
numero: string;
|
|
14
|
+
piso?: string;
|
|
15
|
+
depto?: string;
|
|
16
|
+
localidad: string;
|
|
17
|
+
codigoPostal: string;
|
|
18
|
+
/** Codigo de provincia (0-23). */
|
|
19
|
+
provincia: number;
|
|
20
|
+
telefono?: string;
|
|
21
|
+
actividadEconomica?: string;
|
|
22
|
+
}
|
|
23
|
+
/** Datos para el alta de un empleado (Tipo de Operacion 0). */
|
|
24
|
+
export interface AltaEmpleado {
|
|
25
|
+
/** CUIL del trabajador (11 digitos, con o sin guiones). */
|
|
26
|
+
cuil: string;
|
|
27
|
+
/** Fecha de inicio de la relacion laboral. */
|
|
28
|
+
fechaInicio: Date;
|
|
29
|
+
/** Codigo de modalidad de contratacion (tabla T03). */
|
|
30
|
+
modalidadContratacion: number;
|
|
31
|
+
/** Codigo de obra social. */
|
|
32
|
+
obraSocial: string;
|
|
33
|
+
/** Domicilio de explotacion donde se desempena el trabajador. */
|
|
34
|
+
domicilioExplotacion: DomicilioExplotacion;
|
|
35
|
+
/** Codigo de actividad economica. */
|
|
36
|
+
actividadEconomica: string;
|
|
37
|
+
/** Marca de trabajador agropecuario (default: false). */
|
|
38
|
+
trabajadorAgropecuario?: boolean;
|
|
39
|
+
/** Fecha de fin (requerida para contratos a plazo fijo, eventuales, aprendizaje, pasantia). */
|
|
40
|
+
fechaFin?: Date;
|
|
41
|
+
}
|
|
42
|
+
/** Datos para la baja de un empleado (Tipo de Operacion 1). */
|
|
43
|
+
export interface BajaEmpleado {
|
|
44
|
+
/** CUIL del trabajador. */
|
|
45
|
+
cuil: string;
|
|
46
|
+
/** Fecha de baja de la relacion laboral. */
|
|
47
|
+
fechaBaja: Date;
|
|
48
|
+
/** Codigo de motivo de baja. */
|
|
49
|
+
motivoBaja: number;
|
|
50
|
+
}
|
|
51
|
+
/** Datos para la modificacion de un empleado (Tipo de Operacion 2). */
|
|
52
|
+
export interface ModificacionEmpleado {
|
|
53
|
+
/** CUIL del trabajador. */
|
|
54
|
+
cuil: string;
|
|
55
|
+
/** Fecha de inicio de la relacion laboral (identifica la relacion a modificar). */
|
|
56
|
+
fechaInicio: Date;
|
|
57
|
+
modalidadContratacion?: number;
|
|
58
|
+
obraSocial?: string;
|
|
59
|
+
domicilioExplotacion?: DomicilioExplotacion;
|
|
60
|
+
actividadEconomica?: string;
|
|
61
|
+
trabajadorAgropecuario?: boolean;
|
|
62
|
+
fechaFin?: Date;
|
|
63
|
+
}
|
|
64
|
+
/** Datos complementarios del trabajador. */
|
|
65
|
+
export interface DatosComplementarios {
|
|
66
|
+
/** CUIL del trabajador. */
|
|
67
|
+
cuil: string;
|
|
68
|
+
/** Fecha de inicio de la relacion laboral. */
|
|
69
|
+
fechaInicio: Date;
|
|
70
|
+
/** Situacion de revista del trabajador. */
|
|
71
|
+
situacionRevista: number;
|
|
72
|
+
nivelEducacion?: number;
|
|
73
|
+
/** Codigo de puesto desempenado. */
|
|
74
|
+
puestoDesempenado?: string;
|
|
75
|
+
/** Codigo de convenio colectivo de trabajo. */
|
|
76
|
+
convenioColectivo?: string;
|
|
77
|
+
tipoServicio?: number;
|
|
78
|
+
modalidadLiquidacion?: number;
|
|
79
|
+
estadoCivil?: number;
|
|
80
|
+
/** Remuneracion pactada (en pesos). */
|
|
81
|
+
remuneracion?: number;
|
|
82
|
+
cantidadHorasTrabajadas?: number;
|
|
83
|
+
/** Porcentaje de aporte adicional de seguridad social. */
|
|
84
|
+
porcentajeAporteAdicionalSS?: number;
|
|
85
|
+
/** Contribucion por tareas diferenciales. */
|
|
86
|
+
contribucionTareasDiferenciales?: number;
|
|
87
|
+
/** Codigo de siniestrado. */
|
|
88
|
+
codigoSiniestrado?: number;
|
|
89
|
+
/** Marca de preaviso. */
|
|
90
|
+
marcaPreaviso?: boolean;
|
|
91
|
+
/** Fecha de preaviso. */
|
|
92
|
+
fechaPreaviso?: Date;
|
|
93
|
+
/** Concepto de liquidacion. */
|
|
94
|
+
conceptoLiquidacion?: number;
|
|
95
|
+
}
|
|
96
|
+
/** Datos bancarios (CBU) del trabajador. */
|
|
97
|
+
export interface DatosCBU {
|
|
98
|
+
/** CUIL del trabajador. */
|
|
99
|
+
cuil: string;
|
|
100
|
+
/** Fecha de inicio de la relacion laboral. */
|
|
101
|
+
fechaInicio: Date;
|
|
102
|
+
/** CBU (22 digitos). */
|
|
103
|
+
cbu: string;
|
|
104
|
+
/** Tipo de cuenta bancaria. */
|
|
105
|
+
tipoCuenta?: number;
|
|
106
|
+
}
|
|
107
|
+
/** Datos de un familiar a cargo del trabajador. */
|
|
108
|
+
export interface RelacionFamiliar {
|
|
109
|
+
/** CUIL del trabajador. */
|
|
110
|
+
cuil: string;
|
|
111
|
+
/** Fecha de inicio de la relacion laboral. */
|
|
112
|
+
fechaInicio: Date;
|
|
113
|
+
/** Tipo de relacion familiar. */
|
|
114
|
+
tipoRelacion: number;
|
|
115
|
+
/** CUIL del familiar (si lo tiene). */
|
|
116
|
+
cuilFamiliar?: string;
|
|
117
|
+
/** DNI del familiar (si no tiene CUIL). */
|
|
118
|
+
dniFamiliar?: string;
|
|
119
|
+
/** Nombre del familiar. */
|
|
120
|
+
nombreFamiliar: string;
|
|
121
|
+
/** Apellido del familiar. */
|
|
122
|
+
apellidoFamiliar: string;
|
|
123
|
+
/** Fecha de nacimiento del familiar. */
|
|
124
|
+
fechaNacimiento: Date;
|
|
125
|
+
/** Indica si el familiar tiene discapacidad. */
|
|
126
|
+
discapacitado?: boolean;
|
|
127
|
+
/** Nivel de escolaridad del familiar. */
|
|
128
|
+
escolaridad?: number;
|
|
129
|
+
/** Codigo de obra social del familiar. */
|
|
130
|
+
obraSocialFamiliar?: string;
|
|
131
|
+
/** CUIL del titular de la obra social del familiar. */
|
|
132
|
+
cuilTitularObraSocial?: string;
|
|
133
|
+
}
|
|
134
|
+
/** Registro de tipo alta en el archivo F935. */
|
|
135
|
+
export interface F935RegistroAlta {
|
|
136
|
+
tipo: 1;
|
|
137
|
+
operacion: 0;
|
|
138
|
+
data: AltaEmpleado;
|
|
139
|
+
}
|
|
140
|
+
/** Registro de tipo baja en el archivo F935. */
|
|
141
|
+
export interface F935RegistroBaja {
|
|
142
|
+
tipo: 1;
|
|
143
|
+
operacion: 1;
|
|
144
|
+
data: BajaEmpleado;
|
|
145
|
+
}
|
|
146
|
+
/** Registro de tipo modificacion en el archivo F935. */
|
|
147
|
+
export interface F935RegistroModificacion {
|
|
148
|
+
tipo: 1;
|
|
149
|
+
operacion: 2;
|
|
150
|
+
data: ModificacionEmpleado;
|
|
151
|
+
}
|
|
152
|
+
/** Registro de datos complementarios. */
|
|
153
|
+
export interface F935RegistroDatosComplementarios {
|
|
154
|
+
tipo: 2;
|
|
155
|
+
data: DatosComplementarios;
|
|
156
|
+
}
|
|
157
|
+
/** Registro de CBU. */
|
|
158
|
+
export interface F935RegistroCBU {
|
|
159
|
+
tipo: 3;
|
|
160
|
+
data: DatosCBU;
|
|
161
|
+
}
|
|
162
|
+
/** Registro de relacion familiar. */
|
|
163
|
+
export interface F935RegistroRelacionFamiliar {
|
|
164
|
+
tipo: 4;
|
|
165
|
+
data: RelacionFamiliar;
|
|
166
|
+
}
|
|
167
|
+
/** Registro de domicilio de explotacion. */
|
|
168
|
+
export interface F935RegistroDomicilio {
|
|
169
|
+
tipo: 5;
|
|
170
|
+
data: DomicilioExplotacion & {
|
|
171
|
+
cuil: string;
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
/** Union discriminada de todos los tipos de registro. */
|
|
175
|
+
export type F935Registro = F935RegistroAlta | F935RegistroBaja | F935RegistroModificacion | F935RegistroDatosComplementarios | F935RegistroCBU | F935RegistroRelacionFamiliar | F935RegistroDomicilio;
|
|
176
|
+
/** Metadata del archivo F935 generado. */
|
|
177
|
+
export interface F935Archivo {
|
|
178
|
+
cuitEmpleador: string;
|
|
179
|
+
razonSocial?: string;
|
|
180
|
+
fechaGeneracion: Date;
|
|
181
|
+
registros: F935Registro[];
|
|
182
|
+
cantidadRegistros: number;
|
|
183
|
+
}
|
|
184
|
+
/** Resumen de registros en el archivo. */
|
|
185
|
+
export interface F935Resumen {
|
|
186
|
+
totalRegistros: number;
|
|
187
|
+
altas: number;
|
|
188
|
+
bajas: number;
|
|
189
|
+
modificaciones: number;
|
|
190
|
+
datosComplementarios: number;
|
|
191
|
+
cbus: number;
|
|
192
|
+
familiares: number;
|
|
193
|
+
domicilios: number;
|
|
194
|
+
}
|
|
195
|
+
/** Resultado de la generacion del archivo F935. */
|
|
196
|
+
export interface F935Output {
|
|
197
|
+
/** Contenido del archivo (texto plano). */
|
|
198
|
+
contenido: string;
|
|
199
|
+
/** Metadata del archivo. */
|
|
200
|
+
archivo: F935Archivo;
|
|
201
|
+
/** Resumen de registros. */
|
|
202
|
+
resumen: F935Resumen;
|
|
203
|
+
}
|
|
204
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAIA,mDAAmD;AACnD,MAAM,WAAW,mBAAmB;IAClC,0DAA0D;IAC1D,aAAa,EAAE,MAAM,CAAC;IACtB,kFAAkF;IAClF,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,0EAA0E;IAC1E,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAMD,mDAAmD;AACnD,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,kCAAkC;IAClC,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAMD,+DAA+D;AAC/D,MAAM,WAAW,YAAY;IAC3B,2DAA2D;IAC3D,IAAI,EAAE,MAAM,CAAC;IACb,8CAA8C;IAC9C,W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,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,eAAe,EAAE,IAAI,CAAC;IACtB,SAAS,EAAE,YAAY,EAAE,CAAC;IAC1B,iBAAiB,EAAE,MAAM,CAAC;CAC3B;AAED,0CAA0C;AAC1C,MAAM,WAAW,WAAW;IAC1B,cAAc,EAAE,MAAM,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,cAAc,EAAE,MAAM,CAAC;IACvB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,mDAAmD;AACnD,MAAM,WAAW,UAAU;IACzB,2CAA2C;IAC3C,SAAS,EAAE,MAAM,CAAC;IAClB,4BAA4B;IAC5B,OAAO,EAAE,WAAW,CAAC;IACrB,4BAA4B;IAC5B,OAAO,EAAE,WAAW,CAAC;CACtB"}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,gBAAgB;AAChB,8EAA8E"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export { validateCuil, validateCBU, normalizeCuil, formatCuil, validateFecha, validateFechaRango, collectErrors, collectErrorsWithPrefix, } from '@ramiidv/arca-common';
|
|
2
|
+
import type { AltaEmpleado, BajaEmpleado, ModificacionEmpleado, DatosComplementarios, DatosCBU, RelacionFamiliar, DomicilioExplotacion } from './types.js';
|
|
3
|
+
/**
|
|
4
|
+
* Validates all fields of an AltaEmpleado record.
|
|
5
|
+
* @throws ArcaValidationError if any field is invalid.
|
|
6
|
+
*/
|
|
7
|
+
export declare function validateAlta(alta: AltaEmpleado): void;
|
|
8
|
+
/**
|
|
9
|
+
* Validates all fields of a BajaEmpleado record.
|
|
10
|
+
* @throws ArcaValidationError if any field is invalid.
|
|
11
|
+
*/
|
|
12
|
+
export declare function validateBaja(baja: BajaEmpleado): void;
|
|
13
|
+
/**
|
|
14
|
+
* Validates all fields of a ModificacionEmpleado record.
|
|
15
|
+
* @throws ArcaValidationError if any field is invalid.
|
|
16
|
+
*/
|
|
17
|
+
export declare function validateModificacion(mod: ModificacionEmpleado): void;
|
|
18
|
+
/**
|
|
19
|
+
* Validates all fields of a DatosComplementarios record.
|
|
20
|
+
* @throws ArcaValidationError if any field is invalid.
|
|
21
|
+
*/
|
|
22
|
+
export declare function validateDatosComplementarios(datos: DatosComplementarios): void;
|
|
23
|
+
/**
|
|
24
|
+
* Validates all fields of a DatosCBU record.
|
|
25
|
+
* @throws ArcaValidationError if any field is invalid.
|
|
26
|
+
*/
|
|
27
|
+
export declare function validateCBUData(cbuData: DatosCBU): void;
|
|
28
|
+
/**
|
|
29
|
+
* Validates all fields of a RelacionFamiliar record.
|
|
30
|
+
* @throws ArcaValidationError if any field is invalid.
|
|
31
|
+
*/
|
|
32
|
+
export declare function validateRelacionFamiliar(rel: RelacionFamiliar): void;
|
|
33
|
+
/**
|
|
34
|
+
* Validates all fields of a DomicilioExplotacion record.
|
|
35
|
+
* @throws ArcaValidationError if any field is invalid.
|
|
36
|
+
*/
|
|
37
|
+
export declare function validateDomicilio(dom: DomicilioExplotacion): void;
|
|
38
|
+
//# sourceMappingURL=validators.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validators.d.ts","sourceRoot":"","sources":["../src/validators.ts"],"names":[],"mappings":"AACA,OAAO,EACL,YAAY,EACZ,WAAW,EACX,aAAa,EACb,UAAU,EACV,aAAa,EACb,kBAAkB,EAClB,aAAa,EACb,uBAAuB,GACxB,MAAM,sBAAsB,CAAC;AAY9B,OAAO,KAAK,EACV,YAAY,EACZ,YAAY,EACZ,oBAAoB,EACpB,oBAAoB,EACpB,QAAQ,EACR,gBAAgB,EAChB,oBAAoB,EACrB,MAAM,YAAY,CAAC;AA2BpB;;;GAGG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,YAAY,GAAG,IAAI,CA2DrD;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,YAAY,GAAG,IAAI,CAqBrD;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,oBAAoB,GAAG,IAAI,CAqBpE;AAED;;;GAGG;AACH,wBAAgB,4BAA4B,CAAC,KAAK,EAAE,oBAAoB,GAAG,IAAI,CAyC9E;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,QAAQ,GAAG,IAAI,CAevD;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,GAAG,EAAE,gBAAgB,GAAG,IAAI,CAiDpE;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,oBAAoB,GAAG,IAAI,CAyDjE"}
|