@gesagro/jaspion-sdk 1.0.1 → 1.0.3

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/dist/index.mjs CHANGED
@@ -1,21 +1,55 @@
1
- // src/client.ts
2
- import axios from "axios";
1
+ // src/core/http-client.ts
2
+ var HttpClient = class {
3
+ constructor(baseUrl) {
4
+ this.baseUrl = baseUrl;
5
+ this.headers = {
6
+ "Content-Type": "application/json"
7
+ };
8
+ }
9
+ setHeader(key, value) {
10
+ this.headers[key] = value;
11
+ }
12
+ async post(path, body) {
13
+ const response = await fetch(`${this.baseUrl}${path}`, {
14
+ method: "POST",
15
+ headers: this.headers,
16
+ body: JSON.stringify(body)
17
+ });
18
+ if (!response.ok) {
19
+ throw new Error(`Request failed with status ${response.status}`);
20
+ }
21
+ }
22
+ };
3
23
 
4
24
  // src/core/report.ts
5
25
  var Report = class {
6
- constructor(http, config) {
26
+ constructor(http) {
7
27
  this.http = http;
8
- this.config = config;
28
+ }
29
+ async requestPdf(input) {
30
+ return this.request({
31
+ ...input,
32
+ contentType: "application/pdf"
33
+ });
34
+ }
35
+ async requestCsv(input) {
36
+ return this.request({
37
+ ...input,
38
+ contentType: "text/csv"
39
+ });
9
40
  }
10
41
  async request({
11
42
  contentType,
12
43
  parameters,
13
44
  resources
14
45
  }) {
15
- const extension = contentType === "application/pdf" ? ".pdf" : ".csv";
16
- const fileName = `${this.config.fileName}${extension}`;
46
+ const fileExtensions = {
47
+ "application/pdf": ".pdf",
48
+ "text/csv": ".csv"
49
+ };
50
+ const fileName = `${this.fileName}${fileExtensions[contentType]}`;
17
51
  await this.http.post("/reports", {
18
- template: this.config.template,
52
+ template: this.template,
19
53
  fileName,
20
54
  parameters,
21
55
  resources,
@@ -25,40 +59,2287 @@ var Report = class {
25
59
  }
26
60
  };
27
61
 
28
- // src/namespaces/pig-master/reports/origin-list.ts
29
- var OriginList = class extends Report {
30
- constructor(http) {
31
- super(http, {
32
- template: "@pig-master/origin-list",
33
- fileName: "Listagem de origens"
62
+ // src/namespaces/pig-master/reports/birth-place-list.ts
63
+ var BirthPlaceList = class extends Report {
64
+ constructor() {
65
+ super(...arguments);
66
+ this.template = "@pig-master/birth-place-list";
67
+ this.fileName = "Listagem de proced\xEAncias";
68
+ }
69
+ async pdf(input) {
70
+ return this.requestPdf({
71
+ resources: this.getResources(input),
72
+ parameters: [
73
+ ...this.getParameters(input),
74
+ { key: "DATA_ONLY", value: false }
75
+ ]
76
+ });
77
+ }
78
+ async csv(input) {
79
+ return this.requestCsv({
80
+ resources: this.getResources(input),
81
+ parameters: [
82
+ ...this.getParameters(input),
83
+ { key: "DATA_ONLY", value: true }
84
+ ]
85
+ });
86
+ }
87
+ getResources(input) {
88
+ return [{ key: "FARM_ID", value: input.farmId }];
89
+ }
90
+ getParameters(input) {
91
+ return [{ key: "LOCATE", value: input.language.replace("-", "_") }];
92
+ }
93
+ };
94
+
95
+ // src/namespaces/pig-master/reports/boar-by-breed-list.ts
96
+ var BoarByBreedList = class extends Report {
97
+ constructor() {
98
+ super(...arguments);
99
+ this.template = "@pig-master/boar-by-breed-list";
100
+ this.fileName = "Machos por ra\xE7a";
101
+ }
102
+ async pdf(input) {
103
+ return this.requestPdf({
104
+ resources: this.getResources(input),
105
+ parameters: [
106
+ ...this.getParameters(input),
107
+ { key: "DATA_ONLY", value: false }
108
+ ]
109
+ });
110
+ }
111
+ async csv(input) {
112
+ return this.requestCsv({
113
+ resources: this.getResources(input),
114
+ parameters: [
115
+ ...this.getParameters(input),
116
+ { key: "DATA_ONLY", value: true }
117
+ ]
34
118
  });
35
119
  }
120
+ getResources(input) {
121
+ return [{ key: "FARM_ID", value: input.farmId }];
122
+ }
123
+ getParameters(input) {
124
+ return [
125
+ { key: "LOCATE", value: input.language.replace("-", "_") },
126
+ { key: "BREED_ID", value: input.breedId },
127
+ { key: "CALENDAR", value: input.calendarType }
128
+ ];
129
+ }
130
+ };
131
+
132
+ // src/namespaces/pig-master/reports/boar-death-collection-form.ts
133
+ var BoarDeathCollectionForm = class extends Report {
134
+ constructor() {
135
+ super(...arguments);
136
+ this.template = "@pig-master/boar-death-collection-form";
137
+ this.fileName = "Morte de macho";
138
+ }
36
139
  async pdf(input) {
37
- return await this.request({
38
- contentType: "application/pdf",
140
+ return this.requestPdf({
39
141
  resources: [{ key: "FARM_ID", value: input.farmId }],
142
+ parameters: [{ key: "CALENDAR", value: input.calendarType }]
143
+ });
144
+ }
145
+ };
146
+
147
+ // src/namespaces/pig-master/reports/boar-death-list.ts
148
+ var BoarDeathList = class extends Report {
149
+ constructor() {
150
+ super(...arguments);
151
+ this.template = "@pig-master/boar-death-list";
152
+ this.fileName = "Mortes de machos";
153
+ }
154
+ async pdf(input) {
155
+ return this.requestPdf({
156
+ resources: this.getResources(input),
40
157
  parameters: [
41
- { key: "DATA_ONLY", value: false },
42
- { key: "LOCATE", value: input.language.replace("-", "_") }
158
+ ...this.getParameters(input),
159
+ { key: "DATA_ONLY", value: false }
160
+ ]
161
+ });
162
+ }
163
+ async csv(input) {
164
+ return this.requestCsv({
165
+ resources: this.getResources(input),
166
+ parameters: [
167
+ ...this.getParameters(input),
168
+ { key: "DATA_ONLY", value: true }
169
+ ]
170
+ });
171
+ }
172
+ getResources(input) {
173
+ return [{ key: "FARM_ID", value: input.farmId }];
174
+ }
175
+ getParameters(input) {
176
+ return [
177
+ { key: "LOCATE", value: input.language.replace("-", "_") },
178
+ { key: "CAUSE_ID", value: input.causeId },
179
+ { key: "BREED_ID", value: input.breedId },
180
+ { key: "ORIGIN_ID", value: input.originId },
181
+ { key: "BIRTH_PLACE_ID", value: input.birthPlaceId },
182
+ { key: "DATE_BEGIN", value: input.dateRange?.start ?? null },
183
+ { key: "DATE_END", value: input.dateRange?.end ?? null },
184
+ { key: "CALENDAR", value: input.calendarType },
185
+ {
186
+ key: "ARRIVAL_DATE_BEGIN",
187
+ value: input.arrivalDateRange?.start ?? null
188
+ },
189
+ { key: "ARRIVAL_DATE_END", value: input.arrivalDateRange?.end ?? null }
190
+ ];
191
+ }
192
+ };
193
+
194
+ // src/namespaces/pig-master/reports/boar-discard-collection-form.ts
195
+ var BoarDiscardCollectionForm = class extends Report {
196
+ constructor() {
197
+ super(...arguments);
198
+ this.template = "@pig-master/boar-discard-collection-form";
199
+ this.fileName = "Descarte de macho";
200
+ }
201
+ async pdf(input) {
202
+ return this.requestPdf({
203
+ resources: [{ key: "FARM_ID", value: input.farmId }],
204
+ parameters: [{ key: "CALENDAR", value: input.calendarType }]
205
+ });
206
+ }
207
+ };
208
+
209
+ // src/namespaces/pig-master/reports/boar-discard-list.ts
210
+ var BoarDiscardList = class extends Report {
211
+ constructor() {
212
+ super(...arguments);
213
+ this.template = "@pig-master/boar-discard-list";
214
+ this.fileName = "Descartes de machos";
215
+ }
216
+ async pdf(input) {
217
+ return this.requestPdf({
218
+ resources: this.getResources(input),
219
+ parameters: [
220
+ ...this.getParameters(input),
221
+ { key: "DATA_ONLY", value: false }
222
+ ]
223
+ });
224
+ }
225
+ async csv(input) {
226
+ return this.requestCsv({
227
+ resources: this.getResources(input),
228
+ parameters: [
229
+ ...this.getParameters(input),
230
+ { key: "DATA_ONLY", value: true }
231
+ ]
232
+ });
233
+ }
234
+ getResources(input) {
235
+ return [{ key: "FARM_ID", value: input.farmId }];
236
+ }
237
+ getParameters(input) {
238
+ return [
239
+ { key: "LOCATE", value: input.language.replace("-", "_") },
240
+ { key: "CAUSE_ID", value: input.causeId },
241
+ { key: "BREED_ID", value: input.breedId },
242
+ { key: "ORIGIN_ID", value: input.originId },
243
+ { key: "BIRTH_PLACE_ID", value: input.birthPlaceId },
244
+ { key: "DATE_BEGIN", value: input.dateRange?.start ?? null },
245
+ { key: "DATE_END", value: input.dateRange?.end ?? null },
246
+ { key: "RECIPIENT_ID", value: input.recipientId },
247
+ { key: "CALENDAR", value: input.calendarType },
248
+ {
249
+ key: "ARRIVAL_DATE_BEGIN",
250
+ value: input.arrivalDateRange?.start ?? null
251
+ },
252
+ { key: "ARRIVAL_DATE_END", value: input.arrivalDateRange?.end ?? null }
253
+ ];
254
+ }
255
+ };
256
+
257
+ // src/namespaces/pig-master/reports/boar-ear-tag-replacement-list.ts
258
+ var BoarEarTagReplacementList = class extends Report {
259
+ constructor() {
260
+ super(...arguments);
261
+ this.template = "@pig-master/boar-ear-tag-replacement-list";
262
+ this.fileName = "Trocas de brinco de macho";
263
+ }
264
+ async pdf(input) {
265
+ return this.requestPdf({
266
+ resources: this.getResources(input),
267
+ parameters: [
268
+ ...this.getParameters(input),
269
+ { key: "DATA_ONLY", value: false }
43
270
  ]
44
271
  });
45
272
  }
46
273
  async csv(input) {
47
- return await this.request({
48
- contentType: "text/csv",
274
+ return this.requestCsv({
275
+ resources: this.getResources(input),
276
+ parameters: [
277
+ ...this.getParameters(input),
278
+ { key: "DATA_ONLY", value: true }
279
+ ]
280
+ });
281
+ }
282
+ getResources(input) {
283
+ return [{ key: "FARM_ID", value: input.farmId }];
284
+ }
285
+ getParameters(input) {
286
+ return [
287
+ { key: "DATE_BEGIN", value: input.dateRange?.start ?? null },
288
+ { key: "DATE_END", value: input.dateRange?.end ?? null },
289
+ { key: "OLD_EAR_TAG", value: input.oldEarTag },
290
+ { key: "NEW_EAR_TAG", value: input.newEarTag },
291
+ { key: "CALENDAR", value: input.calendarType }
292
+ ];
293
+ }
294
+ };
295
+
296
+ // src/namespaces/pig-master/reports/boar-treatment-collection-form.ts
297
+ var BoarTreatmentCollectionForm = class extends Report {
298
+ constructor() {
299
+ super(...arguments);
300
+ this.template = "@pig-master/boar-treatment-collection-form";
301
+ this.fileName = "Medica\xE7\xE3o / vacina\xE7\xE3o de macho";
302
+ }
303
+ async pdf(input) {
304
+ return this.requestPdf({
49
305
  resources: [{ key: "FARM_ID", value: input.farmId }],
306
+ parameters: [{ key: "CALENDAR", value: input.calendarType }]
307
+ });
308
+ }
309
+ };
310
+
311
+ // src/namespaces/pig-master/reports/boar-treatment-list.ts
312
+ var BoarTreatmentList = class extends Report {
313
+ constructor() {
314
+ super(...arguments);
315
+ this.template = "@pig-master/boar-treatment-list";
316
+ this.fileName = "Listagem de medica\xE7\xF5es / vacinas (machos)";
317
+ }
318
+ async pdf(input) {
319
+ return this.requestPdf({
320
+ resources: this.getResources(input),
50
321
  parameters: [
51
- { key: "DATA_ONLY", value: false },
52
- { key: "LOCATE", value: input.language.replace("-", "_") }
322
+ ...this.getParameters(input),
323
+ { key: "DATA_ONLY", value: false }
324
+ ]
325
+ });
326
+ }
327
+ async csv(input) {
328
+ return this.requestCsv({
329
+ resources: this.getResources(input),
330
+ parameters: [
331
+ ...this.getParameters(input),
332
+ { key: "DATA_ONLY", value: true }
333
+ ]
334
+ });
335
+ }
336
+ getResources(input) {
337
+ return [{ key: "FARM_ID", value: input.farmId }];
338
+ }
339
+ getParameters(input) {
340
+ return [
341
+ { key: "CALENDAR", value: input.calendarType },
342
+ { key: "LOCATE", value: input.language.replace("-", "_") },
343
+ { key: "DATE_BEGIN", value: input.dateRange?.start ?? null },
344
+ { key: "DATE_END", value: input.dateRange?.end ?? null },
345
+ { key: "BOAR_ID", value: input.boarId }
346
+ ];
347
+ }
348
+ };
349
+
350
+ // src/namespaces/pig-master/reports/boars-inventory.ts
351
+ var BoarsInventory = class extends Report {
352
+ constructor() {
353
+ super(...arguments);
354
+ this.template = "@pig-master/boars-inventory";
355
+ this.fileName = "Estoque de machos";
356
+ }
357
+ async pdf(input) {
358
+ return this.requestPdf({
359
+ resources: this.getResources(input),
360
+ parameters: [
361
+ ...this.getParameters(input),
362
+ { key: "DATA_ONLY", value: false }
363
+ ]
364
+ });
365
+ }
366
+ async csv(input) {
367
+ return this.requestCsv({
368
+ resources: this.getResources(input),
369
+ parameters: [
370
+ ...this.getParameters(input),
371
+ { key: "DATA_ONLY", value: true }
372
+ ]
373
+ });
374
+ }
375
+ getResources(input) {
376
+ return [{ key: "FARM_ID", value: input.farmId }];
377
+ }
378
+ getParameters(input) {
379
+ return [
380
+ { key: "DATE_BEGIN", value: input.dateRange.start },
381
+ { key: "DATE_END", value: input.dateRange.end },
382
+ { key: "CALENDAR", value: input.calendarType },
383
+ { key: "ORIGIN_ID", value: input.originId },
384
+ { key: "BREED_ID", value: input.breedId },
385
+ { key: "BIRTH_PLACE_ID", value: input.birthPlaceId }
386
+ ];
387
+ }
388
+ };
389
+
390
+ // src/namespaces/pig-master/reports/breed-list.ts
391
+ var BreedList = class extends Report {
392
+ constructor() {
393
+ super(...arguments);
394
+ this.template = "@pig-master/breed-list";
395
+ this.fileName = "Listagem de ra\xE7as";
396
+ }
397
+ async pdf(input) {
398
+ return this.requestPdf({
399
+ resources: this.getResources(input),
400
+ parameters: [
401
+ ...this.getParameters(input),
402
+ { key: "DATA_ONLY", value: false }
403
+ ]
404
+ });
405
+ }
406
+ async csv(input) {
407
+ return this.requestCsv({
408
+ resources: this.getResources(input),
409
+ parameters: [
410
+ ...this.getParameters(input),
411
+ { key: "DATA_ONLY", value: true }
412
+ ]
413
+ });
414
+ }
415
+ getResources(input) {
416
+ return [{ key: "FARM_ID", value: input.farmId }];
417
+ }
418
+ getParameters(input) {
419
+ return [{ key: "LOCATE", value: input.language.replace("-", "_") }];
420
+ }
421
+ };
422
+
423
+ // src/namespaces/pig-master/reports/breeding-monitor.ts
424
+ var BreedingMonitor = class extends Report {
425
+ constructor() {
426
+ super(...arguments);
427
+ this.template = "@pig-master/breeding-monitor";
428
+ this.fileName = "Monitor de Reprodu\xE7\xE3o";
429
+ }
430
+ async pdf(input) {
431
+ return this.requestPdf({
432
+ resources: [{ key: "FARM_ID", value: input.farmId }],
433
+ parameters: [
434
+ { key: "DATE_BEGIN", value: input.dateRange.start },
435
+ { key: "DATE_END", value: input.dateRange.end },
436
+ { key: "CALENDAR", value: input.calendarType },
437
+ { key: "DATA_ONLY", value: false }
438
+ ]
439
+ });
440
+ }
441
+ };
442
+
443
+ // src/namespaces/pig-master/reports/cause-list.ts
444
+ var CauseList = class extends Report {
445
+ constructor() {
446
+ super(...arguments);
447
+ this.template = "@pig-master/cause-list";
448
+ this.fileName = "Listagem de motivos";
449
+ }
450
+ async pdf(input) {
451
+ return this.requestPdf({
452
+ resources: this.getResources(input),
453
+ parameters: [
454
+ ...this.getParameters(input),
455
+ { key: "DATA_ONLY", value: false }
456
+ ]
457
+ });
458
+ }
459
+ async csv(input) {
460
+ return this.requestCsv({
461
+ resources: this.getResources(input),
462
+ parameters: [
463
+ ...this.getParameters(input),
464
+ { key: "DATA_ONLY", value: true }
465
+ ]
466
+ });
467
+ }
468
+ getResources(input) {
469
+ return [{ key: "FARM_ID", value: input.farmId }];
470
+ }
471
+ getParameters(input) {
472
+ return [
473
+ { key: "LOCATE", value: input.language.replace("-", "_") },
474
+ { key: "ORDERBYCOLUMN", value: input.orderBy.column },
475
+ { key: "ORDERBYDIRECTION", value: input.orderBy.direction },
476
+ { key: "DESCRIPTION", value: input.description },
477
+ { key: "AVAILABILITY", value: input.availability }
478
+ ];
479
+ }
480
+ };
481
+
482
+ // src/namespaces/pig-master/reports/drug-list.ts
483
+ var DrugList = class extends Report {
484
+ constructor() {
485
+ super(...arguments);
486
+ this.template = "@pig-master/drug-list";
487
+ this.fileName = "Listagem de medicamentos / vacinas";
488
+ }
489
+ async pdf(input) {
490
+ return this.requestPdf({
491
+ resources: this.getResources(input),
492
+ parameters: [
493
+ ...this.getParameters(input),
494
+ { key: "DATA_ONLY", value: false }
495
+ ]
496
+ });
497
+ }
498
+ async csv(input) {
499
+ return this.requestCsv({
500
+ resources: this.getResources(input),
501
+ parameters: [
502
+ ...this.getParameters(input),
503
+ { key: "DATA_ONLY", value: true }
504
+ ]
505
+ });
506
+ }
507
+ getResources(input) {
508
+ return [{ key: "FARM_ID", value: input.farmId }];
509
+ }
510
+ getParameters(input) {
511
+ return [{ key: "LOCATE", value: input.language.replace("-", "_") }];
512
+ }
513
+ };
514
+
515
+ // src/namespaces/pig-master/reports/employee-list.ts
516
+ var EmployeeList = class extends Report {
517
+ constructor() {
518
+ super(...arguments);
519
+ this.template = "@pig-master/employee-list";
520
+ this.fileName = "Listagem de funcion\xE1rios";
521
+ }
522
+ async pdf(input) {
523
+ return this.requestPdf({
524
+ resources: this.getResources(input),
525
+ parameters: [
526
+ ...this.getParameters(input),
527
+ { key: "DATA_ONLY", value: false }
528
+ ]
529
+ });
530
+ }
531
+ async csv(input) {
532
+ return this.requestCsv({
533
+ resources: this.getResources(input),
534
+ parameters: [
535
+ ...this.getParameters(input),
536
+ { key: "DATA_ONLY", value: true }
537
+ ]
538
+ });
539
+ }
540
+ getResources(input) {
541
+ return [{ key: "FARM_ID", value: input.farmId }];
542
+ }
543
+ getParameters(input) {
544
+ return [
545
+ { key: "LOCATE", value: input.language.replace("-", "_") },
546
+ { key: "CALENDAR", value: input.calendarType }
547
+ ];
548
+ }
549
+ };
550
+
551
+ // src/namespaces/pig-master/reports/farm-summary.ts
552
+ var FarmSummary = class extends Report {
553
+ constructor() {
554
+ super(...arguments);
555
+ this.template = "@pig-master/farm-summary";
556
+ this.fileName = "Fechamento de per\xEDodo";
557
+ }
558
+ async pdf(input) {
559
+ return this.requestPdf({
560
+ resources: this.getResources(input),
561
+ parameters: [
562
+ ...this.getParameters(input),
563
+ { key: "DATA_ONLY", value: false }
564
+ ]
565
+ });
566
+ }
567
+ async csv(input) {
568
+ return this.requestCsv({
569
+ resources: this.getResources(input),
570
+ parameters: [
571
+ ...this.getParameters(input),
572
+ { key: "DATA_ONLY", value: true }
573
+ ]
574
+ });
575
+ }
576
+ getResources(input) {
577
+ return [{ key: "FARM_ID", value: input.farmId }];
578
+ }
579
+ getParameters(input) {
580
+ return [
581
+ { key: "DATE_BEGIN", value: input.dateRange.start },
582
+ { key: "DATE_END", value: input.dateRange.end },
583
+ { key: "CALENDAR", value: input.calendarType }
584
+ ];
585
+ }
586
+ };
587
+
588
+ // src/namespaces/pig-master/reports/farrowing-analysis.ts
589
+ var FarrowingAnalysis = class extends Report {
590
+ constructor() {
591
+ super(...arguments);
592
+ this.template = "@pig-master/farrowing-analysis";
593
+ this.fileName = "An\xE1lise de partos";
594
+ }
595
+ async pdf(input) {
596
+ return this.requestPdf({
597
+ resources: [{ key: "FARM_ID", value: input.farmId }],
598
+ parameters: [
599
+ { key: "DATE_BEGIN", value: input.dateRange?.start ?? null },
600
+ { key: "DATE_END", value: input.dateRange?.end ?? null },
601
+ { key: "CALENDAR", value: input.calendarType },
602
+ { key: "GROUP", value: input.groupBy },
603
+ { key: "FIELD", value: input.emphasis },
604
+ { key: "PARITY", value: input.parity },
605
+ { key: "ORIGIN_ID", value: input.originId },
606
+ { key: "BREED_ID", value: input.breedId },
607
+ { key: "BIRTH_PLACE_ID", value: input.birthPlaceId },
608
+ { key: "FEMALE_SWINE_ID", value: input.femaleSwineId },
609
+ { key: "LOCATE", value: input.language.replace("-", "_") },
610
+ {
611
+ key: "MATING_DATE_BEGIN",
612
+ value: input.matingDateRange?.start ?? null
613
+ },
614
+ { key: "MATING_DATE_END", value: input.matingDateRange?.end ?? null }
615
+ ]
616
+ });
617
+ }
618
+ };
619
+
620
+ // src/namespaces/pig-master/reports/farrowing-collection-form.ts
621
+ var FarrowingCollectionForm = class extends Report {
622
+ constructor() {
623
+ super(...arguments);
624
+ this.template = "@pig-master/farrowing-collection-form";
625
+ this.fileName = "Parto";
626
+ }
627
+ async pdf(input) {
628
+ return this.requestPdf({
629
+ resources: [{ key: "FARM_ID", value: input.farmId }],
630
+ parameters: [{ key: "CALENDAR", value: input.calendarType }]
631
+ });
632
+ }
633
+ };
634
+
635
+ // src/namespaces/pig-master/reports/farrowing-type-list.ts
636
+ var FarrowingTypeList = class extends Report {
637
+ constructor() {
638
+ super(...arguments);
639
+ this.template = "@pig-master/farrowing-type-list";
640
+ this.fileName = "Listagem de tipos de parto";
641
+ }
642
+ async pdf(input) {
643
+ return this.requestPdf({
644
+ resources: this.getResources(input),
645
+ parameters: [
646
+ ...this.getParameters(input),
647
+ { key: "DATA_ONLY", value: false }
648
+ ]
649
+ });
650
+ }
651
+ async csv(input) {
652
+ return this.requestCsv({
653
+ resources: this.getResources(input),
654
+ parameters: [
655
+ ...this.getParameters(input),
656
+ { key: "DATA_ONLY", value: true }
657
+ ]
658
+ });
659
+ }
660
+ getResources(input) {
661
+ return [{ key: "FARM_ID", value: input.farmId }];
662
+ }
663
+ getParameters(input) {
664
+ return [{ key: "LOCATE", value: input.language.replace("-", "_") }];
665
+ }
666
+ };
667
+
668
+ // src/namespaces/pig-master/reports/female-swine-arrival-monitoring.ts
669
+ var FemaleSwineArrivalMonitoring = class extends Report {
670
+ constructor() {
671
+ super(...arguments);
672
+ this.template = "@pig-master/female-swine-arrival-monitoring";
673
+ this.fileName = "Acompanhamento do lote";
674
+ }
675
+ async pdf(input) {
676
+ return this.requestPdf({
677
+ resources: this.getResources(input),
678
+ parameters: [
679
+ ...this.getParameters(input),
680
+ { key: "DATA_ONLY", value: false }
681
+ ]
682
+ });
683
+ }
684
+ async csv(input) {
685
+ return this.requestCsv({
686
+ resources: this.getResources(input),
687
+ parameters: [
688
+ ...this.getParameters(input),
689
+ { key: "DATA_ONLY", value: true }
53
690
  ]
54
691
  });
55
692
  }
693
+ getResources(input) {
694
+ return [{ key: "FARM_ID", value: input.farmId }];
695
+ }
696
+ getParameters(input) {
697
+ return [
698
+ { key: "DATE_BEGIN", value: input.dateRange.start },
699
+ { key: "DATE_END", value: input.dateRange.end },
700
+ { key: "CALENDAR", value: input.calendarType },
701
+ { key: "PAGE", value: input.pagination.page },
702
+ { key: "PER_PAGE", value: input.pagination.perPage },
703
+ { key: "ORIGIN_ID", value: input.originId }
704
+ ];
705
+ }
706
+ };
707
+
708
+ // src/namespaces/pig-master/reports/female-swine-by-breed-list.ts
709
+ var FemaleSwineByBreedList = class extends Report {
710
+ constructor() {
711
+ super(...arguments);
712
+ this.template = "@pig-master/female-swine-by-breed-list";
713
+ this.fileName = "F\xEAmeas por ra\xE7a";
714
+ }
715
+ async pdf(input) {
716
+ return this.requestPdf({
717
+ resources: this.getResources(input),
718
+ parameters: [
719
+ ...this.getParameters(input),
720
+ { key: "DATA_ONLY", value: false }
721
+ ]
722
+ });
723
+ }
724
+ async csv(input) {
725
+ return this.requestCsv({
726
+ resources: this.getResources(input),
727
+ parameters: [
728
+ ...this.getParameters(input),
729
+ { key: "DATA_ONLY", value: true }
730
+ ]
731
+ });
732
+ }
733
+ getResources(input) {
734
+ return [{ key: "FARM_ID", value: input.farmId }];
735
+ }
736
+ getParameters(input) {
737
+ return [
738
+ { key: "LOCATE", value: input.language.replace("-", "_") },
739
+ { key: "BREED_ID", value: input.breedId },
740
+ {
741
+ key: "REMOVE_GILT_SOW",
742
+ value: input.productivityStatus === "productive"
743
+ },
744
+ { key: "CALENDAR", value: input.calendarType }
745
+ ];
746
+ }
747
+ };
748
+
749
+ // src/namespaces/pig-master/reports/female-swine-by-parity-list.ts
750
+ var FemaleSwineByParityList = class extends Report {
751
+ constructor() {
752
+ super(...arguments);
753
+ this.template = "@pig-master/female-swine-by-parity-list";
754
+ this.fileName = "F\xEAmeas por cria";
755
+ }
756
+ async pdf(input) {
757
+ return this.requestPdf({
758
+ resources: this.getResources(input),
759
+ parameters: [
760
+ ...this.getParameters(input),
761
+ { key: "DATA_ONLY", value: false }
762
+ ]
763
+ });
764
+ }
765
+ async csv(input) {
766
+ return this.requestCsv({
767
+ resources: this.getResources(input),
768
+ parameters: [
769
+ ...this.getParameters(input),
770
+ { key: "DATA_ONLY", value: true }
771
+ ]
772
+ });
773
+ }
774
+ getResources(input) {
775
+ return [{ key: "FARM_ID", value: input.farmId }];
776
+ }
777
+ getParameters(input) {
778
+ return [
779
+ { key: "LOCATE", value: input.language.replace("-", "_") },
780
+ { key: "PARITY", value: input.parity },
781
+ { key: "BREED_ID", value: input.breedId },
782
+ { key: "ORIGIN_ID", value: input.originId },
783
+ { key: "BIRTH_PLACE_ID", value: input.birthPlaceId },
784
+ { key: "STATUS", value: input.status },
785
+ { key: "CALENDAR", value: input.calendarType }
786
+ ];
787
+ }
788
+ };
789
+
790
+ // src/namespaces/pig-master/reports/female-swine-by-status-list.ts
791
+ var FemaleSwineByStatusList = class extends Report {
792
+ constructor() {
793
+ super(...arguments);
794
+ this.template = "@pig-master/female-swine-by-status-list";
795
+ this.fileName = "F\xEAmeas por status";
796
+ }
797
+ async pdf(input) {
798
+ return this.requestPdf({
799
+ resources: this.getResources(input),
800
+ parameters: [
801
+ ...this.getParameters(input),
802
+ { key: "DATA_ONLY", value: false }
803
+ ]
804
+ });
805
+ }
806
+ async csv(input) {
807
+ return this.requestCsv({
808
+ resources: this.getResources(input),
809
+ parameters: [
810
+ ...this.getParameters(input),
811
+ { key: "DATA_ONLY", value: true }
812
+ ]
813
+ });
814
+ }
815
+ getResources(input) {
816
+ return [{ key: "FARM_ID", value: input.farmId }];
817
+ }
818
+ getParameters(input) {
819
+ return [
820
+ { key: "LOCATE", value: input.language.replace("-", "_") },
821
+ { key: "STATUS", value: input.status },
822
+ {
823
+ key: "DAYSTODAY_BEGIN",
824
+ value: input.gestationLengthRange?.start ?? null
825
+ },
826
+ { key: "DAYSTODAY_END", value: input.gestationLengthRange?.end ?? null },
827
+ { key: "CALENDAR", value: input.calendarType },
828
+ {
829
+ key: "LAST_EVENT_DATE_BEGIN",
830
+ value: input.lastEventDateRange?.start ?? null
831
+ },
832
+ {
833
+ key: "LAST_EVENT_DATE_END",
834
+ value: input.lastEventDateRange?.end ?? null
835
+ },
836
+ { key: "PARITY", value: input.parity },
837
+ { key: "BREED_ID", value: input.breedId },
838
+ { key: "ORIGIN_ID", value: input.originId },
839
+ { key: "BIRTH_PLACE_ID", value: input.birthPlaceId },
840
+ { key: "LIFECYCLE_STATUS", value: input.lifecycleStatus },
841
+ {
842
+ key: "ARRIVAL_DATE_BEGIN",
843
+ value: input.arrivalDateRange?.start ?? null
844
+ },
845
+ { key: "ARRIVAL_DATE_END", value: input.arrivalDateRange?.end ?? null },
846
+ { key: "ORDERBYCOLUMN", value: input.orderBy.column },
847
+ { key: "ORDERBYDIRECTION", value: input.orderBy.direction }
848
+ ];
849
+ }
850
+ };
851
+
852
+ // src/namespaces/pig-master/reports/female-swine-by-traceability-list.ts
853
+ var FemaleSwineByTraceabilityList = class extends Report {
854
+ constructor() {
855
+ super(...arguments);
856
+ this.template = "@pig-master/female-swine-by-traceability-list";
857
+ this.fileName = "F\xEAmeas por rastreabilidade";
858
+ }
859
+ async pdf(input) {
860
+ return this.requestPdf({
861
+ resources: this.getResources(input),
862
+ parameters: [
863
+ ...this.getParameters(input),
864
+ { key: "DATA_ONLY", value: false }
865
+ ]
866
+ });
867
+ }
868
+ async csv(input) {
869
+ return this.requestCsv({
870
+ resources: this.getResources(input),
871
+ parameters: [
872
+ ...this.getParameters(input),
873
+ { key: "DATA_ONLY", value: true }
874
+ ]
875
+ });
876
+ }
877
+ getResources(input) {
878
+ return [{ key: "FARM_ID", value: input.farmId }];
879
+ }
880
+ getParameters(input) {
881
+ return [
882
+ { key: "LOCATE", value: input.language.replace("-", "_") },
883
+ { key: "BIRTH_PLACE_ID", value: input.birthPlaceId },
884
+ { key: "ORIGIN_ID", value: input.originId },
885
+ { key: "GTA_ID", value: input.gtaId },
886
+ { key: "CALENDAR", value: input.calendarType },
887
+ {
888
+ key: "ARRIVAL_DATE_BEGIN",
889
+ value: input.arrivalDateRange?.start ?? null
890
+ },
891
+ { key: "ARRIVAL_DATE_END", value: input.arrivalDateRange?.end ?? null },
892
+ { key: "LIFECYCLE_STATUS", value: input.lifecycleStatus }
893
+ ];
894
+ }
895
+ };
896
+
897
+ // src/namespaces/pig-master/reports/female-swine-death-analysis.ts
898
+ var FemaleSwineDeathAnalysis = class extends Report {
899
+ constructor() {
900
+ super(...arguments);
901
+ this.template = "@pig-master/female-swine-death-analysis";
902
+ this.fileName = "An\xE1lise morte de f\xEAmeas";
903
+ }
904
+ async pdf(input) {
905
+ return this.requestPdf({
906
+ resources: [{ key: "FARM_ID", value: input.farmId }],
907
+ parameters: [
908
+ { key: "LOCATE", value: input.language.replace("-", "_") },
909
+ { key: "GROUPED_DESCRIPTION", value: input.groupBy },
910
+ { key: "DATE_BEGIN", value: input.dateRange?.start ?? null },
911
+ { key: "DATE_END", value: input.dateRange?.end ?? null },
912
+ { key: "CAUSE_ID", value: input.causeId },
913
+ { key: "PARITY", value: input.parity },
914
+ { key: "BREED_ID", value: input.breedId },
915
+ { key: "ORIGIN_ID", value: input.originId },
916
+ { key: "BIRTH_PLACE_ID", value: input.birthPlaceId },
917
+ { key: "STATUS", value: input.status },
918
+ { key: "CALENDAR", value: input.calendarType },
919
+ {
920
+ key: "ARRIVAL_DATE_BEGIN",
921
+ value: input.arrivalDateRange?.start ?? null
922
+ },
923
+ { key: "ARRIVAL_DATE_END", value: input.arrivalDateRange?.end ?? null }
924
+ ]
925
+ });
926
+ }
927
+ };
928
+
929
+ // src/namespaces/pig-master/reports/female-swine-death-collection-form.ts
930
+ var FemaleSwineDeathCollectionForm = class extends Report {
931
+ constructor() {
932
+ super(...arguments);
933
+ this.template = "@pig-master/female-swine-death-collection-form";
934
+ this.fileName = "Morte de f\xEAmea";
935
+ }
936
+ async pdf(input) {
937
+ return this.requestPdf({
938
+ resources: [{ key: "FARM_ID", value: input.farmId }],
939
+ parameters: [{ key: "CALENDAR", value: input.calendarType }]
940
+ });
941
+ }
942
+ };
943
+
944
+ // src/namespaces/pig-master/reports/female-swine-death-list.ts
945
+ var FemaleSwineDeathList = class extends Report {
946
+ constructor() {
947
+ super(...arguments);
948
+ this.template = "@pig-master/female-swine-death-list";
949
+ this.fileName = "Morte de f\xEAmeas";
950
+ }
951
+ async pdf(input) {
952
+ return this.requestPdf({
953
+ resources: this.getResources(input),
954
+ parameters: [
955
+ ...this.getParameters(input),
956
+ { key: "DATA_ONLY", value: false }
957
+ ]
958
+ });
959
+ }
960
+ async csv(input) {
961
+ return this.requestCsv({
962
+ resources: this.getResources(input),
963
+ parameters: [
964
+ ...this.getParameters(input),
965
+ { key: "DATA_ONLY", value: true }
966
+ ]
967
+ });
968
+ }
969
+ getResources(input) {
970
+ return [{ key: "FARM_ID", value: input.farmId }];
971
+ }
972
+ getParameters(input) {
973
+ return [
974
+ { key: "LOCATE", value: input.language.replace("-", "_") },
975
+ { key: "DATE_BEGIN", value: input.dateRange?.start ?? null },
976
+ { key: "DATE_END", value: input.dateRange?.end ?? null },
977
+ { key: "CAUSE_ID", value: input.causeId },
978
+ { key: "PARITY", value: input.parity },
979
+ { key: "BREED_ID", value: input.breedId },
980
+ { key: "ORIGIN_ID", value: input.originId },
981
+ { key: "BIRTH_PLACE_ID", value: input.birthPlaceId },
982
+ { key: "STATUS", value: input.status },
983
+ { key: "CALENDAR", value: input.calendarType },
984
+ {
985
+ key: "ARRIVAL_DATE_BEGIN",
986
+ value: input.arrivalDateRange?.start ?? null
987
+ },
988
+ { key: "ARRIVAL_DATE_END", value: input.arrivalDateRange?.end ?? null }
989
+ ];
990
+ }
991
+ };
992
+
993
+ // src/namespaces/pig-master/reports/female-swine-discard-analysis.ts
994
+ var FemaleSwineDiscardAnalysis = class extends Report {
995
+ constructor() {
996
+ super(...arguments);
997
+ this.template = "@pig-master/female-swine-discard-analysis";
998
+ this.fileName = "An\xE1lise descarte de f\xEAmeas";
999
+ }
1000
+ async pdf(input) {
1001
+ return this.requestPdf({
1002
+ resources: [{ key: "FARM_ID", value: input.farmId }],
1003
+ parameters: [
1004
+ { key: "LOCATE", value: input.language.replace("-", "_") },
1005
+ { key: "GROUPED_DESCRIPTION", value: input.groupBy },
1006
+ { key: "DATE_BEGIN", value: input.dateRange?.start ?? null },
1007
+ { key: "DATE_END", value: input.dateRange?.end ?? null },
1008
+ { key: "CAUSE_ID", value: input.causeId },
1009
+ { key: "PARITY", value: input.parity },
1010
+ { key: "BREED_ID", value: input.breedId },
1011
+ { key: "ORIGIN_ID", value: input.originId },
1012
+ { key: "BIRTH_PLACE_ID", value: input.birthPlaceId },
1013
+ { key: "RECIPIENT_ID", value: input.recipientId },
1014
+ { key: "STATUS", value: input.status },
1015
+ { key: "CALENDAR", value: input.calendarType },
1016
+ {
1017
+ key: "ARRIVAL_DATE_BEGIN",
1018
+ value: input.arrivalDateRange?.start ?? null
1019
+ },
1020
+ { key: "ARRIVAL_DATE_END", value: input.arrivalDateRange?.end ?? null }
1021
+ ]
1022
+ });
1023
+ }
1024
+ };
1025
+
1026
+ // src/namespaces/pig-master/reports/female-swine-discard-collection-form.ts
1027
+ var FemaleSwineDiscardCollectionForm = class extends Report {
1028
+ constructor() {
1029
+ super(...arguments);
1030
+ this.template = "@pig-master/female-swine-discard-collection-form";
1031
+ this.fileName = "Descarte de f\xEAmea";
1032
+ }
1033
+ async pdf(input) {
1034
+ return this.requestPdf({
1035
+ resources: [{ key: "FARM_ID", value: input.farmId }],
1036
+ parameters: [{ key: "CALENDAR", value: input.calendarType }]
1037
+ });
1038
+ }
1039
+ };
1040
+
1041
+ // src/namespaces/pig-master/reports/female-swine-discard-list.ts
1042
+ var FemaleSwineDiscardList = class extends Report {
1043
+ constructor() {
1044
+ super(...arguments);
1045
+ this.template = "@pig-master/female-swine-discard-list";
1046
+ this.fileName = "Descarte de f\xEAmeas";
1047
+ }
1048
+ async pdf(input) {
1049
+ return this.requestPdf({
1050
+ resources: this.getResources(input),
1051
+ parameters: [
1052
+ ...this.getParameters(input),
1053
+ { key: "DATA_ONLY", value: false }
1054
+ ]
1055
+ });
1056
+ }
1057
+ async csv(input) {
1058
+ return this.requestCsv({
1059
+ resources: this.getResources(input),
1060
+ parameters: [
1061
+ ...this.getParameters(input),
1062
+ { key: "DATA_ONLY", value: true }
1063
+ ]
1064
+ });
1065
+ }
1066
+ getResources(input) {
1067
+ return [{ key: "FARM_ID", value: input.farmId }];
1068
+ }
1069
+ getParameters(input) {
1070
+ return [
1071
+ { key: "LOCATE", value: input.language.replace("-", "_") },
1072
+ { key: "CAUSE_ID", value: input.causeId },
1073
+ { key: "BREED_ID", value: input.breedId },
1074
+ { key: "ORIGIN_ID", value: input.originId },
1075
+ { key: "BIRTH_PLACE_ID", value: input.birthPlaceId },
1076
+ { key: "DATE_BEGIN", value: input.dateRange?.start ?? null },
1077
+ { key: "DATE_END", value: input.dateRange?.end ?? null },
1078
+ { key: "PARITY", value: input.parity },
1079
+ { key: "RECIPIENT_ID", value: input.recipientId },
1080
+ { key: "STATUS", value: input.status },
1081
+ { key: "CALENDAR", value: input.calendarType },
1082
+ {
1083
+ key: "ARRIVAL_DATE_BEGIN",
1084
+ value: input.arrivalDateRange?.start ?? null
1085
+ },
1086
+ { key: "ARRIVAL_DATE_END", value: input.arrivalDateRange?.end ?? null }
1087
+ ];
1088
+ }
1089
+ };
1090
+
1091
+ // src/namespaces/pig-master/reports/female-swine-ear-tag-replacement-list.ts
1092
+ var FemaleSwineEarTagReplacementList = class extends Report {
1093
+ constructor() {
1094
+ super(...arguments);
1095
+ this.template = "@pig-master/female-swine-ear-tag-replacement-list";
1096
+ this.fileName = "Trocas de brinco de f\xEAmeas";
1097
+ }
1098
+ async pdf(input) {
1099
+ return this.requestPdf({
1100
+ resources: this.getResources(input),
1101
+ parameters: [
1102
+ ...this.getParameters(input),
1103
+ { key: "DATA_ONLY", value: false }
1104
+ ]
1105
+ });
1106
+ }
1107
+ async csv(input) {
1108
+ return this.requestCsv({
1109
+ resources: this.getResources(input),
1110
+ parameters: [
1111
+ ...this.getParameters(input),
1112
+ { key: "DATA_ONLY", value: true }
1113
+ ]
1114
+ });
1115
+ }
1116
+ getResources(input) {
1117
+ return [{ key: "FARM_ID", value: input.farmId }];
1118
+ }
1119
+ getParameters(input) {
1120
+ return [
1121
+ { key: "DATE_BEGIN", value: input.dateRange?.start ?? null },
1122
+ { key: "DATE_END", value: input.dateRange?.end ?? null },
1123
+ { key: "OLD_EAR_TAG", value: input.oldEarTag },
1124
+ { key: "NEW_EAR_TAG", value: input.newEarTag },
1125
+ { key: "CALENDAR", value: input.calendarType }
1126
+ ];
1127
+ }
1128
+ };
1129
+
1130
+ // src/namespaces/pig-master/reports/female-swine-inventory.ts
1131
+ var FemaleSwineInventory = class extends Report {
1132
+ constructor() {
1133
+ super(...arguments);
1134
+ this.template = "@pig-master/female-swine-inventory";
1135
+ this.fileName = "Estoque de f\xEAmeas";
1136
+ }
1137
+ async pdf(input) {
1138
+ return this.requestPdf({
1139
+ resources: this.getResources(input),
1140
+ parameters: [
1141
+ ...this.getParameters(input),
1142
+ { key: "DATA_ONLY", value: false }
1143
+ ]
1144
+ });
1145
+ }
1146
+ async csv(input) {
1147
+ return this.requestCsv({
1148
+ resources: this.getResources(input),
1149
+ parameters: [
1150
+ ...this.getParameters(input),
1151
+ { key: "DATA_ONLY", value: true }
1152
+ ]
1153
+ });
1154
+ }
1155
+ getResources(input) {
1156
+ return [{ key: "FARM_ID", value: input.farmId }];
1157
+ }
1158
+ getParameters(input) {
1159
+ return [
1160
+ { key: "DATE_BEGIN", value: input.dateRange.start },
1161
+ { key: "DATE_END", value: input.dateRange.end },
1162
+ { key: "CALENDAR", value: input.calendarType },
1163
+ { key: "ORIGIN_ID", value: input.originId },
1164
+ { key: "BREED_ID", value: input.breedId },
1165
+ { key: "BIRTH_PLACE_ID", value: input.birthPlaceId }
1166
+ ];
1167
+ }
1168
+ };
1169
+
1170
+ // src/namespaces/pig-master/reports/female-swine-pending-action-list.ts
1171
+ var FemaleSwinePendingActionList = class extends Report {
1172
+ constructor() {
1173
+ super(...arguments);
1174
+ this.template = "@pig-master/female-swine-pending-action-list";
1175
+ this.fileName = "A\xE7\xF5es pendentes";
1176
+ }
1177
+ async pdf(input) {
1178
+ return this.requestPdf({
1179
+ resources: this.getResources(input),
1180
+ parameters: [
1181
+ ...this.getParameters(input),
1182
+ { key: "DATA_ONLY", value: false }
1183
+ ]
1184
+ });
1185
+ }
1186
+ async csv(input) {
1187
+ return this.requestCsv({
1188
+ resources: this.getResources(input),
1189
+ parameters: [
1190
+ ...this.getParameters(input),
1191
+ { key: "DATA_ONLY", value: true }
1192
+ ]
1193
+ });
1194
+ }
1195
+ getResources(input) {
1196
+ return [{ key: "FARM_ID", value: input.farmId }];
1197
+ }
1198
+ getParameters(input) {
1199
+ return [
1200
+ { key: "LOCATE", value: input.language.replace("-", "_") },
1201
+ { key: "STATUS", value: input.status },
1202
+ { key: "CALENDAR", value: input.calendarType }
1203
+ ];
1204
+ }
1205
+ };
1206
+
1207
+ // src/namespaces/pig-master/reports/female-swine-pre-discard-list.ts
1208
+ var FemaleSwinePreDiscardList = class extends Report {
1209
+ constructor() {
1210
+ super(...arguments);
1211
+ this.template = "@pig-master/female-swine-pre-discard-list";
1212
+ this.fileName = "Listagem de pr\xE9-descartes de f\xEAmeas";
1213
+ }
1214
+ async pdf(input) {
1215
+ return this.requestPdf({
1216
+ resources: this.getResources(input),
1217
+ parameters: [
1218
+ ...this.getParameters(input),
1219
+ { key: "DATA_ONLY", value: false }
1220
+ ]
1221
+ });
1222
+ }
1223
+ async csv(input) {
1224
+ return this.requestCsv({
1225
+ resources: this.getResources(input),
1226
+ parameters: [
1227
+ ...this.getParameters(input),
1228
+ { key: "DATA_ONLY", value: true }
1229
+ ]
1230
+ });
1231
+ }
1232
+ getResources(input) {
1233
+ return [{ key: "FARM_ID", value: input.farmId }];
1234
+ }
1235
+ getParameters(input) {
1236
+ return [
1237
+ { key: "CALENDAR", value: input.calendarType },
1238
+ { key: "LOCATE", value: input.language.replace("-", "_") },
1239
+ { key: "PRE_DISCARD", value: input.preDiscard },
1240
+ { key: "DATE_BEGIN", value: input.dateRange?.start ?? null },
1241
+ { key: "DATE_END", value: input.dateRange?.end ?? null },
1242
+ { key: "ORDERBYCOLUMN", value: input.orderBy.column },
1243
+ { key: "ORDERBYDIRECTION", value: input.orderBy.direction }
1244
+ ];
1245
+ }
1246
+ };
1247
+
1248
+ // src/namespaces/pig-master/reports/female-swine-record.ts
1249
+ var FemaleSwineRecord = class extends Report {
1250
+ constructor() {
1251
+ super(...arguments);
1252
+ this.template = "@pig-master/female-swine-record";
1253
+ this.fileName = "Ficha da f\xEAmea";
1254
+ }
1255
+ async pdf(input) {
1256
+ return this.requestPdf({
1257
+ resources: [{ key: "FARM_ID", value: input.farmId }],
1258
+ parameters: [
1259
+ { key: "LOCATE", value: input.language.replace("-", "_") },
1260
+ { key: "FEMALE_SWINE_ID", value: input.femaleSwineId },
1261
+ { key: "BORN_FOLLOW", value: input.farrowingAssistance },
1262
+ { key: "CALENDAR", value: input.calendarType }
1263
+ ]
1264
+ });
1265
+ }
1266
+ };
1267
+
1268
+ // src/namespaces/pig-master/reports/female-swine-sale-planning-list.ts
1269
+ var FemaleSwineSalePlanningList = class extends Report {
1270
+ constructor() {
1271
+ super(...arguments);
1272
+ this.template = "@pig-master/female-swine-sale-planning-list";
1273
+ this.fileName = "Listagem de f\xEAmeas planejadas para venda";
1274
+ }
1275
+ async pdf(input) {
1276
+ return this.requestPdf({
1277
+ resources: this.getResources(input),
1278
+ parameters: [
1279
+ ...this.getParameters(input),
1280
+ { key: "DATA_ONLY", value: false }
1281
+ ]
1282
+ });
1283
+ }
1284
+ async csv(input) {
1285
+ return this.requestCsv({
1286
+ resources: this.getResources(input),
1287
+ parameters: [
1288
+ ...this.getParameters(input),
1289
+ { key: "DATA_ONLY", value: true }
1290
+ ]
1291
+ });
1292
+ }
1293
+ getResources(input) {
1294
+ return [{ key: "FARM_ID", value: input.farmId }];
1295
+ }
1296
+ getParameters(input) {
1297
+ return [
1298
+ { key: "CALENDAR", value: input.calendarType },
1299
+ { key: "DATE_BEGIN", value: input.dateRange?.start ?? null },
1300
+ { key: "DATE_END", value: input.dateRange?.end ?? null },
1301
+ { key: "RECIPIENT_ID", value: input.recipientId },
1302
+ { key: "ORDERBYCOLUMN", value: input.orderBy.column },
1303
+ { key: "ORDERBYDIRECTION", value: input.orderBy.direction }
1304
+ ];
1305
+ }
1306
+ };
1307
+
1308
+ // src/namespaces/pig-master/reports/female-swine-treatment-collection-form.ts
1309
+ var FemaleSwineTreatmentCollectionForm = class extends Report {
1310
+ constructor() {
1311
+ super(...arguments);
1312
+ this.template = "@pig-master/female-swine-treatment-collection-form";
1313
+ this.fileName = "Medica\xE7\xE3o / vacina\xE7\xE3o de f\xEAmea";
1314
+ }
1315
+ async pdf(input) {
1316
+ return this.requestPdf({
1317
+ resources: [{ key: "FARM_ID", value: input.farmId }],
1318
+ parameters: [{ key: "CALENDAR", value: input.calendarType }]
1319
+ });
1320
+ }
1321
+ };
1322
+
1323
+ // src/namespaces/pig-master/reports/female-swine-treatment-list.ts
1324
+ var FemaleSwineTreatmentList = class extends Report {
1325
+ constructor() {
1326
+ super(...arguments);
1327
+ this.template = "@pig-master/female-swine-treatment-list";
1328
+ this.fileName = "Listagem de medica\xE7\xF5es / vacinas (f\xEAmeas)";
1329
+ }
1330
+ async pdf(input) {
1331
+ return this.requestPdf({
1332
+ resources: this.getResources(input),
1333
+ parameters: [
1334
+ ...this.getParameters(input),
1335
+ { key: "DATA_ONLY", value: false }
1336
+ ]
1337
+ });
1338
+ }
1339
+ async csv(input) {
1340
+ return this.requestCsv({
1341
+ resources: this.getResources(input),
1342
+ parameters: [
1343
+ ...this.getParameters(input),
1344
+ { key: "DATA_ONLY", value: true }
1345
+ ]
1346
+ });
1347
+ }
1348
+ getResources(input) {
1349
+ return [{ key: "FARM_ID", value: input.farmId }];
1350
+ }
1351
+ getParameters(input) {
1352
+ return [
1353
+ { key: "CALENDAR", value: input.calendarType },
1354
+ { key: "LOCATE", value: input.language.replace("-", "_") },
1355
+ { key: "DATE_BEGIN", value: input.dateRange?.start ?? null },
1356
+ { key: "DATE_END", value: input.dateRange?.end ?? null },
1357
+ { key: "FEMALE_SWINE_ID", value: input.femaleSwineId }
1358
+ ];
1359
+ }
1360
+ };
1361
+
1362
+ // src/namespaces/pig-master/reports/finishing-piglet-death-collection-form.ts
1363
+ var FinishingPigletDeathCollectionForm = class extends Report {
1364
+ constructor() {
1365
+ super(...arguments);
1366
+ this.template = "@pig-master/finishing-piglet-death-collection-form";
1367
+ this.fileName = "Morte de leit\xE3o na termina\xE7\xE3o";
1368
+ }
1369
+ async pdf(input) {
1370
+ return this.requestPdf({
1371
+ resources: [{ key: "FARM_ID", value: input.farmId }],
1372
+ parameters: [{ key: "CALENDAR", value: input.calendarType }]
1373
+ });
1374
+ }
1375
+ };
1376
+
1377
+ // src/namespaces/pig-master/reports/flushing-female-swine-list.ts
1378
+ var FlushingFemaleSwineList = class extends Report {
1379
+ constructor() {
1380
+ super(...arguments);
1381
+ this.template = "@pig-master/flushing-female-swine-list";
1382
+ this.fileName = "F\xEAmeas flushing";
1383
+ }
1384
+ async pdf(input) {
1385
+ return this.requestPdf({
1386
+ resources: this.getResources(input),
1387
+ parameters: [
1388
+ ...this.getParameters(input),
1389
+ { key: "DATA_ONLY", value: false }
1390
+ ]
1391
+ });
1392
+ }
1393
+ async csv(input) {
1394
+ return this.requestCsv({
1395
+ resources: this.getResources(input),
1396
+ parameters: [
1397
+ ...this.getParameters(input),
1398
+ { key: "DATA_ONLY", value: true }
1399
+ ]
1400
+ });
1401
+ }
1402
+ getResources(input) {
1403
+ return [{ key: "FARM_ID", value: input.farmId }];
1404
+ }
1405
+ getParameters(input) {
1406
+ return [
1407
+ { key: "DATE_BEGIN", value: input.dateRange.start },
1408
+ { key: "DATE_END", value: input.dateRange.end },
1409
+ { key: "CALENDAR", value: input.calendarType },
1410
+ { key: "ORIGIN_ID", value: input.originId }
1411
+ ];
1412
+ }
1413
+ };
1414
+
1415
+ // src/namespaces/pig-master/reports/flushing-monitor.ts
1416
+ var FlushingMonitor = class extends Report {
1417
+ constructor() {
1418
+ super(...arguments);
1419
+ this.template = "@pig-master/flushing-monitor";
1420
+ this.fileName = "Flushing";
1421
+ }
1422
+ async pdf(input) {
1423
+ return this.requestPdf({
1424
+ resources: this.getResources(input),
1425
+ parameters: [
1426
+ ...this.getParameters(input),
1427
+ { key: "DATA_ONLY", value: false }
1428
+ ]
1429
+ });
1430
+ }
1431
+ async csv(input) {
1432
+ return this.requestCsv({
1433
+ resources: this.getResources(input),
1434
+ parameters: [
1435
+ ...this.getParameters(input),
1436
+ { key: "DATA_ONLY", value: true }
1437
+ ]
1438
+ });
1439
+ }
1440
+ getResources(input) {
1441
+ return [{ key: "FARM_ID", value: input.farmId }];
1442
+ }
1443
+ getParameters(input) {
1444
+ return [
1445
+ { key: "DATE_BEGIN", value: input.dateRange.start },
1446
+ { key: "DATE_END", value: input.dateRange.end },
1447
+ { key: "CALENDAR", value: input.calendarType },
1448
+ { key: "ORIGIN_ID", value: input.originId }
1449
+ ];
1450
+ }
1451
+ };
1452
+
1453
+ // src/namespaces/pig-master/reports/gilt-inventory.ts
1454
+ var GiltInventory = class extends Report {
1455
+ constructor() {
1456
+ super(...arguments);
1457
+ this.template = "@pig-master/gilt-inventory";
1458
+ this.fileName = "Estoque de leitoas";
1459
+ }
1460
+ async pdf(input) {
1461
+ return this.requestPdf({
1462
+ resources: this.getResources(input),
1463
+ parameters: [
1464
+ ...this.getParameters(input),
1465
+ { key: "DATA_ONLY", value: false }
1466
+ ]
1467
+ });
1468
+ }
1469
+ async csv(input) {
1470
+ return this.requestCsv({
1471
+ resources: this.getResources(input),
1472
+ parameters: [
1473
+ ...this.getParameters(input),
1474
+ { key: "DATA_ONLY", value: true }
1475
+ ]
1476
+ });
1477
+ }
1478
+ getResources(input) {
1479
+ return [{ key: "FARM_ID", value: input.farmId }];
1480
+ }
1481
+ getParameters(input) {
1482
+ return [
1483
+ { key: "DATE_BEGIN", value: input.dateRange.start },
1484
+ { key: "DATE_END", value: input.dateRange.end },
1485
+ { key: "CALENDAR", value: input.calendarType },
1486
+ { key: "ORIGIN_ID", value: input.originId },
1487
+ { key: "BREED_ID", value: input.breedId },
1488
+ { key: "BIRTH_PLACE_ID", value: input.birthPlaceId }
1489
+ ];
1490
+ }
1491
+ };
1492
+
1493
+ // src/namespaces/pig-master/reports/gta-list.ts
1494
+ var GtaList = class extends Report {
1495
+ constructor() {
1496
+ super(...arguments);
1497
+ this.template = "@pig-master/gta-list";
1498
+ this.fileName = "Listagem de gtas";
1499
+ }
1500
+ async pdf(input) {
1501
+ return this.requestPdf({
1502
+ resources: this.getResources(input),
1503
+ parameters: [
1504
+ ...this.getParameters(input),
1505
+ { key: "DATA_ONLY", value: false }
1506
+ ]
1507
+ });
1508
+ }
1509
+ async csv(input) {
1510
+ return this.requestCsv({
1511
+ resources: this.getResources(input),
1512
+ parameters: [
1513
+ ...this.getParameters(input),
1514
+ { key: "DATA_ONLY", value: true }
1515
+ ]
1516
+ });
1517
+ }
1518
+ getResources(input) {
1519
+ return [{ key: "FARM_ID", value: input.farmId }];
1520
+ }
1521
+ getParameters(input) {
1522
+ return [
1523
+ { key: "LOCATE", value: input.language.replace("-", "_") },
1524
+ { key: "CALENDAR", value: input.calendarType }
1525
+ ];
1526
+ }
1527
+ };
1528
+
1529
+ // src/namespaces/pig-master/reports/heat-detection-collection-form.ts
1530
+ var HeatDetectionCollectionForm = class extends Report {
1531
+ constructor() {
1532
+ super(...arguments);
1533
+ this.template = "@pig-master/heat-detection-collection-form";
1534
+ this.fileName = "Registro de cio";
1535
+ }
1536
+ async pdf(input) {
1537
+ return this.requestPdf({
1538
+ resources: [{ key: "FARM_ID", value: input.farmId }],
1539
+ parameters: [{ key: "CALENDAR", value: input.calendarType }]
1540
+ });
1541
+ }
1542
+ };
1543
+
1544
+ // src/namespaces/pig-master/reports/heat-detection-list.ts
1545
+ var HeatDetectionList = class extends Report {
1546
+ constructor() {
1547
+ super(...arguments);
1548
+ this.template = "@pig-master/heat-detection-list";
1549
+ this.fileName = "Listagem de registros de cio";
1550
+ }
1551
+ async pdf(input) {
1552
+ return this.requestPdf({
1553
+ resources: this.getResources(input),
1554
+ parameters: [
1555
+ ...this.getParameters(input),
1556
+ { key: "DATA_ONLY", value: false }
1557
+ ]
1558
+ });
1559
+ }
1560
+ async csv(input) {
1561
+ return this.requestCsv({
1562
+ resources: this.getResources(input),
1563
+ parameters: [
1564
+ ...this.getParameters(input),
1565
+ { key: "DATA_ONLY", value: true }
1566
+ ]
1567
+ });
1568
+ }
1569
+ getResources(input) {
1570
+ return [{ key: "FARM_ID", value: input.farmId }];
1571
+ }
1572
+ getParameters(input) {
1573
+ return [
1574
+ { key: "LOCATE", value: input.language.replace("-", "_") },
1575
+ { key: "CALENDAR", value: input.calendarType },
1576
+ { key: "ORIGIN_ID", value: input.originId },
1577
+ {
1578
+ key: "ARRIVAL_DATE_BEGIN",
1579
+ value: input.arrivalDateRange?.start ?? null
1580
+ },
1581
+ { key: "ARRIVAL_DATE_END", value: input.arrivalDateRange?.end ?? null },
1582
+ { key: "DATE_BEGIN", value: input.dateRange?.start ?? null },
1583
+ { key: "DATE_END", value: input.dateRange?.end ?? null },
1584
+ { key: "FEMALE_SWINE_ID", value: input.femaleSwineId },
1585
+ { key: "NUMBER", value: input.number },
1586
+ { key: "STIMULUS", value: input.stimulus },
1587
+ { key: "ORDERBYDIRECTION", value: input.orderBy.direction },
1588
+ { key: "ORDERBYCOLUMN", value: input.orderBy.column }
1589
+ ];
1590
+ }
1591
+ };
1592
+
1593
+ // src/namespaces/pig-master/reports/heat-monitoring.ts
1594
+ var HeatMonitoring = class extends Report {
1595
+ constructor() {
1596
+ super(...arguments);
1597
+ this.template = "@pig-master/heat-monitoring";
1598
+ this.fileName = "Mapa de Cio";
1599
+ }
1600
+ async pdf(input) {
1601
+ return this.requestPdf({
1602
+ resources: this.getResources(input),
1603
+ parameters: [
1604
+ ...this.getParameters(input),
1605
+ { key: "DATA_ONLY", value: false }
1606
+ ]
1607
+ });
1608
+ }
1609
+ async csv(input) {
1610
+ return this.requestCsv({
1611
+ resources: this.getResources(input),
1612
+ parameters: [
1613
+ ...this.getParameters(input),
1614
+ { key: "DATA_ONLY", value: true }
1615
+ ]
1616
+ });
1617
+ }
1618
+ getResources(input) {
1619
+ return [{ key: "FARM_ID", value: input.farmId }];
1620
+ }
1621
+ getParameters(input) {
1622
+ return [
1623
+ { key: "DATE_BEGIN", value: input.dateRange.start },
1624
+ { key: "DATE_END", value: input.dateRange.end },
1625
+ { key: "CALENDAR", value: input.calendarType },
1626
+ { key: "PAGE", value: input.pagination.page },
1627
+ { key: "PER_PAGE", value: input.pagination.perPage },
1628
+ { key: "ORIGIN_ID", value: input.originId }
1629
+ ];
1630
+ }
1631
+ };
1632
+
1633
+ // src/namespaces/pig-master/reports/location-list.ts
1634
+ var LocationList = class extends Report {
1635
+ constructor() {
1636
+ super(...arguments);
1637
+ this.template = "@pig-master/location-list";
1638
+ this.fileName = "Listagem de localiza\xE7\xF5es";
1639
+ }
1640
+ async pdf(input) {
1641
+ return this.requestPdf({
1642
+ resources: this.getResources(input),
1643
+ parameters: [
1644
+ ...this.getParameters(input),
1645
+ { key: "DATA_ONLY", value: false }
1646
+ ]
1647
+ });
1648
+ }
1649
+ async csv(input) {
1650
+ return this.requestCsv({
1651
+ resources: this.getResources(input),
1652
+ parameters: [
1653
+ ...this.getParameters(input),
1654
+ { key: "DATA_ONLY", value: true }
1655
+ ]
1656
+ });
1657
+ }
1658
+ getResources(input) {
1659
+ return [{ key: "FARM_ID", value: input.farmId }];
1660
+ }
1661
+ getParameters(input) {
1662
+ return [{ key: "LOCATE", value: input.language.replace("-", "_") }];
1663
+ }
1664
+ };
1665
+
1666
+ // src/namespaces/pig-master/reports/maternity-piglet-death-collection-form.ts
1667
+ var MaternityPigletDeathCollectionForm = class extends Report {
1668
+ constructor() {
1669
+ super(...arguments);
1670
+ this.template = "@pig-master/maternity-piglet-death-collection-form";
1671
+ this.fileName = "Morte de leit\xE3o na maternidade";
1672
+ }
1673
+ async pdf(input) {
1674
+ return this.requestPdf({
1675
+ resources: [{ key: "FARM_ID", value: input.farmId }],
1676
+ parameters: [{ key: "CALENDAR", value: input.calendarType }]
1677
+ });
1678
+ }
1679
+ };
1680
+
1681
+ // src/namespaces/pig-master/reports/maternity-piglet-transfer-collection-form.ts
1682
+ var MaternityPigletTransferCollectionForm = class extends Report {
1683
+ constructor() {
1684
+ super(...arguments);
1685
+ this.template = "@pig-master/maternity-piglet-transfer-collection-form";
1686
+ this.fileName = "Transfer\xEAncia de leit\xE3o na maternidade";
1687
+ }
1688
+ async pdf(input) {
1689
+ return this.requestPdf({
1690
+ resources: [{ key: "FARM_ID", value: input.farmId }],
1691
+ parameters: [{ key: "CALENDAR", value: input.calendarType }]
1692
+ });
1693
+ }
1694
+ };
1695
+
1696
+ // src/namespaces/pig-master/reports/mating-analysis.ts
1697
+ var MatingAnalysis = class extends Report {
1698
+ constructor() {
1699
+ super(...arguments);
1700
+ this.template = "@pig-master/mating-analysis";
1701
+ this.fileName = "An\xE1lise de coberturas";
1702
+ }
1703
+ async pdf(input) {
1704
+ return this.requestPdf({
1705
+ resources: [{ key: "FARM_ID", value: input.farmId }],
1706
+ parameters: [
1707
+ { key: "DATE_BEGIN", value: input.dateRange?.start ?? null },
1708
+ { key: "DATE_END", value: input.dateRange?.end ?? null },
1709
+ { key: "CALENDAR", value: input.calendarType },
1710
+ { key: "GROUP", value: input.groupBy },
1711
+ { key: "FIELD", value: input.emphasis },
1712
+ { key: "PARITY", value: input.parity },
1713
+ { key: "ORIGIN_ID", value: input.originId },
1714
+ { key: "BREED_ID", value: input.breedId },
1715
+ { key: "BIRTH_PLACE_ID", value: input.birthPlaceId },
1716
+ { key: "FEMALE_SWINE_ID", value: input.femaleSwineId },
1717
+ {
1718
+ key: "ARRIVAL_DATE_BEGIN",
1719
+ value: input.arrivalDateRange?.start ?? null
1720
+ },
1721
+ { key: "ARRIVAL_DATE_END", value: input.arrivalDateRange?.end ?? null },
1722
+ {
1723
+ key: "ARRIVAL_REPRODUCTIVE_STATUS",
1724
+ value: input.arrivalReproductiveStatus
1725
+ },
1726
+ { key: "MATING_CONTEXT", value: input.matingContext },
1727
+ { key: "METHOD", value: input.method },
1728
+ { key: "LOCATE", value: input.language.replace("-", "_") }
1729
+ ]
1730
+ });
1731
+ }
1732
+ };
1733
+
1734
+ // src/namespaces/pig-master/reports/mating-collection-form.ts
1735
+ var MatingCollectionForm = class extends Report {
1736
+ constructor() {
1737
+ super(...arguments);
1738
+ this.template = "@pig-master/mating-collection-form";
1739
+ this.fileName = "Cobertura";
1740
+ }
1741
+ async pdf(input) {
1742
+ return this.requestPdf({
1743
+ resources: [{ key: "FARM_ID", value: input.farmId }],
1744
+ parameters: [{ key: "CALENDAR", value: input.calendarType }]
1745
+ });
1746
+ }
1747
+ };
1748
+
1749
+ // src/namespaces/pig-master/reports/mating-group-list.ts
1750
+ var MatingGroupList = class extends Report {
1751
+ constructor() {
1752
+ super(...arguments);
1753
+ this.template = "@pig-master/mating-group-list";
1754
+ this.fileName = "Listagem de grupos de cobertura";
1755
+ }
1756
+ async pdf(input) {
1757
+ return this.requestPdf({
1758
+ resources: this.getResources(input),
1759
+ parameters: [
1760
+ ...this.getParameters(input),
1761
+ { key: "DATA_ONLY", value: false }
1762
+ ]
1763
+ });
1764
+ }
1765
+ async csv(input) {
1766
+ return this.requestCsv({
1767
+ resources: this.getResources(input),
1768
+ parameters: [
1769
+ ...this.getParameters(input),
1770
+ { key: "DATA_ONLY", value: true }
1771
+ ]
1772
+ });
1773
+ }
1774
+ getResources(input) {
1775
+ return [{ key: "FARM_ID", value: input.farmId }];
1776
+ }
1777
+ getParameters(input) {
1778
+ return [{ key: "LOCATE", value: input.language.replace("-", "_") }];
1779
+ }
1780
+ };
1781
+
1782
+ // src/namespaces/pig-master/reports/mating-list.ts
1783
+ var MatingList = class extends Report {
1784
+ constructor() {
1785
+ super(...arguments);
1786
+ this.template = "@pig-master/mating-list";
1787
+ this.fileName = "Listagem de coberturas";
1788
+ }
1789
+ async pdf(input) {
1790
+ return this.requestPdf({
1791
+ resources: this.getResources(input),
1792
+ parameters: [
1793
+ ...this.getParameters(input),
1794
+ { key: "DATA_ONLY", value: false }
1795
+ ]
1796
+ });
1797
+ }
1798
+ async csv(input) {
1799
+ return this.requestCsv({
1800
+ resources: this.getResources(input),
1801
+ parameters: [
1802
+ ...this.getParameters(input),
1803
+ { key: "DATA_ONLY", value: true }
1804
+ ]
1805
+ });
1806
+ }
1807
+ getResources(input) {
1808
+ return [{ key: "FARM_ID", value: input.farmId }];
1809
+ }
1810
+ getParameters(input) {
1811
+ return [
1812
+ { key: "DATE_BEGIN", value: input.dateRange?.start ?? null },
1813
+ { key: "DATE_END", value: input.dateRange?.end ?? null },
1814
+ { key: "CALENDAR", value: input.calendarType },
1815
+ { key: "MANAGEMENT_CYCLE", value: input.managementCycle },
1816
+ { key: "PARITY", value: input.parity },
1817
+ { key: "ORIGIN_ID", value: input.originId },
1818
+ { key: "BREED_ID", value: input.breedId },
1819
+ { key: "BIRTH_PLACE_ID", value: input.birthPlaceId },
1820
+ { key: "FEMALE_SWINE_ID", value: input.femaleSwineId },
1821
+ {
1822
+ key: "ARRIVAL_DATE_BEGIN",
1823
+ value: input.arrivalDateRange?.start ?? null
1824
+ },
1825
+ { key: "ARRIVAL_DATE_END", value: input.arrivalDateRange?.end ?? null },
1826
+ {
1827
+ key: "ARRIVAL_REPRODUCTIVE_STATUS",
1828
+ value: input.arrivalReproductiveStatus
1829
+ },
1830
+ { key: "MATING_CONTEXT", value: input.matingContext },
1831
+ { key: "ORDER_BY_COLUMN", value: input.orderBy.column },
1832
+ { key: "ORDER_BY_DIRECTION", value: input.orderBy.direction },
1833
+ { key: "METHOD", value: input.method },
1834
+ { key: "LOCATE", value: input.language.replace("-", "_") }
1835
+ ];
1836
+ }
1837
+ };
1838
+
1839
+ // src/namespaces/pig-master/reports/mating-overview.ts
1840
+ var MatingOverview = class extends Report {
1841
+ constructor() {
1842
+ super(...arguments);
1843
+ this.template = "@pig-master/mating-overview";
1844
+ this.fileName = "Performance de coberturas";
1845
+ }
1846
+ async pdf(input) {
1847
+ return this.requestPdf({
1848
+ resources: this.getResources(input),
1849
+ parameters: [
1850
+ ...this.getParameters(input),
1851
+ { key: "DATA_ONLY", value: false }
1852
+ ]
1853
+ });
1854
+ }
1855
+ async csv(input) {
1856
+ return this.requestCsv({
1857
+ resources: this.getResources(input),
1858
+ parameters: [
1859
+ ...this.getParameters(input),
1860
+ { key: "DATA_ONLY", value: true }
1861
+ ]
1862
+ });
1863
+ }
1864
+ getResources(input) {
1865
+ return [{ key: "FARM_ID", value: input.farmId }];
1866
+ }
1867
+ getParameters(input) {
1868
+ return [
1869
+ { key: "DATE_BEGIN", value: input.dateRange.start },
1870
+ { key: "DATE_END", value: input.dateRange.end },
1871
+ { key: "CALENDAR", value: input.calendarType },
1872
+ { key: "ORIGIN_ID", value: input.originId },
1873
+ { key: "BREED_ID", value: input.breedId },
1874
+ { key: "BIRTH_PLACE_ID", value: input.birthPlaceId }
1875
+ ];
1876
+ }
1877
+ };
1878
+
1879
+ // src/namespaces/pig-master/reports/mbrf-female-swine-record.ts
1880
+ var MbrfFemaleSwineRecord = class extends Report {
1881
+ constructor() {
1882
+ super(...arguments);
1883
+ this.template = "@pig-master/mbrf-female-swine-record";
1884
+ this.fileName = "Ficha fim";
1885
+ }
1886
+ async pdf(input) {
1887
+ return this.requestPdf({
1888
+ resources: [{ key: "FARM_ID", value: input.farmId }],
1889
+ parameters: [
1890
+ { key: "FEMALE_SWINE_ID", value: input.femaleSwineId },
1891
+ { key: "CALENDAR", value: input.calendarType }
1892
+ ]
1893
+ });
1894
+ }
1895
+ };
1896
+
1897
+ // src/namespaces/pig-master/reports/nursery-piglet-death-collection-form.ts
1898
+ var NurseryPigletDeathCollectionForm = class extends Report {
1899
+ constructor() {
1900
+ super(...arguments);
1901
+ this.template = "@pig-master/nursery-piglet-death-collection-form";
1902
+ this.fileName = "Morte de leit\xE3o na creche";
1903
+ }
1904
+ async pdf(input) {
1905
+ return this.requestPdf({
1906
+ resources: [{ key: "FARM_ID", value: input.farmId }],
1907
+ parameters: [{ key: "CALENDAR", value: input.calendarType }]
1908
+ });
1909
+ }
1910
+ };
1911
+
1912
+ // src/namespaces/pig-master/reports/origin-list.ts
1913
+ var OriginList = class extends Report {
1914
+ constructor() {
1915
+ super(...arguments);
1916
+ this.template = "@pig-master/origin-list";
1917
+ this.fileName = "Listagem de origens";
1918
+ }
1919
+ async pdf(input) {
1920
+ return this.requestPdf({
1921
+ resources: this.getResources(input),
1922
+ parameters: [
1923
+ ...this.getParameters(input),
1924
+ { key: "DATA_ONLY", value: false }
1925
+ ]
1926
+ });
1927
+ }
1928
+ async csv(input) {
1929
+ return this.requestCsv({
1930
+ resources: this.getResources(input),
1931
+ parameters: [
1932
+ ...this.getParameters(input),
1933
+ { key: "DATA_ONLY", value: true }
1934
+ ]
1935
+ });
1936
+ }
1937
+ getResources(input) {
1938
+ return [{ key: "FARM_ID", value: input.farmId }];
1939
+ }
1940
+ getParameters(input) {
1941
+ return [{ key: "LOCATE", value: input.language.replace("-", "_") }];
1942
+ }
1943
+ };
1944
+
1945
+ // src/namespaces/pig-master/reports/parity-structure.ts
1946
+ var ParityStructure = class extends Report {
1947
+ constructor() {
1948
+ super(...arguments);
1949
+ this.template = "@pig-master/parity-structure";
1950
+ this.fileName = "Estrutura et\xE1ria";
1951
+ }
1952
+ async pdf(input) {
1953
+ return this.requestPdf({
1954
+ resources: [{ key: "FARM_ID", value: input.farmId }],
1955
+ parameters: [
1956
+ { key: "LOCATE", value: input.language.replace("-", "_") },
1957
+ { key: "BREED_ID", value: input.breedId },
1958
+ { key: "BIRTH_PLACE_ID", value: input.birthPlaceId },
1959
+ { key: "ORIGIN_ID", value: input.originId },
1960
+ { key: "STATUS", value: input.status }
1961
+ ]
1962
+ });
1963
+ }
1964
+ };
1965
+
1966
+ // src/namespaces/pig-master/reports/pre-flushing-female-swine-list.ts
1967
+ var PreFlushingFemaleSwineList = class extends Report {
1968
+ constructor() {
1969
+ super(...arguments);
1970
+ this.template = "@pig-master/pre-flushing-female-swine-list";
1971
+ this.fileName = "F\xEAmeas pr\xE9-flushing";
1972
+ }
1973
+ async pdf(input) {
1974
+ return this.requestPdf({
1975
+ resources: this.getResources(input),
1976
+ parameters: [
1977
+ ...this.getParameters(input),
1978
+ { key: "DATA_ONLY", value: false }
1979
+ ]
1980
+ });
1981
+ }
1982
+ async csv(input) {
1983
+ return this.requestCsv({
1984
+ resources: this.getResources(input),
1985
+ parameters: [
1986
+ ...this.getParameters(input),
1987
+ { key: "DATA_ONLY", value: true }
1988
+ ]
1989
+ });
1990
+ }
1991
+ getResources(input) {
1992
+ return [{ key: "FARM_ID", value: input.farmId }];
1993
+ }
1994
+ getParameters(input) {
1995
+ return [
1996
+ { key: "DATE_BEGIN", value: input.dateRange.start },
1997
+ { key: "DATE_END", value: input.dateRange.end },
1998
+ { key: "CALENDAR", value: input.calendarType },
1999
+ { key: "ORIGIN_ID", value: input.originId }
2000
+ ];
2001
+ }
2002
+ };
2003
+
2004
+ // src/namespaces/pig-master/reports/pregnant-female-swine-list.ts
2005
+ var PregnantFemaleSwineList = class extends Report {
2006
+ constructor() {
2007
+ super(...arguments);
2008
+ this.template = "@pig-master/pregnant-female-swine-list";
2009
+ this.fileName = "F\xEAmeas gestantes";
2010
+ }
2011
+ async pdf(input) {
2012
+ return this.requestPdf({
2013
+ resources: this.getResources(input),
2014
+ parameters: [
2015
+ { key: "DATA_ONLY", value: false },
2016
+ ...this.getParameters(input)
2017
+ ]
2018
+ });
2019
+ }
2020
+ async csv(input) {
2021
+ return this.requestCsv({
2022
+ resources: this.getResources(input),
2023
+ parameters: [
2024
+ { key: "DATA_ONLY", value: true },
2025
+ ...this.getParameters(input)
2026
+ ]
2027
+ });
2028
+ }
2029
+ getResources(input) {
2030
+ return [{ key: "FARM_ID", value: input.farmId }];
2031
+ }
2032
+ getParameters(input) {
2033
+ return [
2034
+ { key: "MATING_DATE_BEGIN", value: input.matingDateRange.start },
2035
+ { key: "MATING_DATE_END", value: input.matingDateRange.end },
2036
+ { key: "CALENDAR", value: input.calendarType },
2037
+ { key: "GESTATION_WEEK", value: input.gestationWeek }
2038
+ ];
2039
+ }
2040
+ };
2041
+
2042
+ // src/namespaces/pig-master/reports/pregnant-female-swine-sale-list.ts
2043
+ var PregnantFemaleSwineSaleList = class extends Report {
2044
+ constructor() {
2045
+ super(...arguments);
2046
+ this.template = "@pig-master/pregnant-female-swine-sale-list";
2047
+ this.fileName = "Listagem de vendas de gestantes";
2048
+ }
2049
+ async pdf(input) {
2050
+ return this.requestPdf({
2051
+ resources: this.getResources(input),
2052
+ parameters: [
2053
+ ...this.getParameters(input),
2054
+ { key: "DATA_ONLY", value: false }
2055
+ ]
2056
+ });
2057
+ }
2058
+ async csv(input) {
2059
+ return this.requestCsv({
2060
+ resources: this.getResources(input),
2061
+ parameters: [
2062
+ ...this.getParameters(input),
2063
+ { key: "DATA_ONLY", value: true }
2064
+ ]
2065
+ });
2066
+ }
2067
+ getResources(input) {
2068
+ return [{ key: "FARM_ID", value: input.farmId }];
2069
+ }
2070
+ getParameters(input) {
2071
+ return [
2072
+ { key: "CALENDAR", value: input.calendarType },
2073
+ { key: "LOCATE", value: input.language.replace("-", "_") },
2074
+ { key: "DATE_BEGIN", value: input.dateRange?.start ?? null },
2075
+ { key: "DATE_END", value: input.dateRange?.end ?? null },
2076
+ { key: "MATING_DATE_BEGIN", value: input.matingDateRange?.start ?? null },
2077
+ { key: "MATING_DATE_END", value: input.matingDateRange?.end ?? null },
2078
+ { key: "RECIPIENT_ID", value: input.recipientId },
2079
+ {
2080
+ key: "ARRIVAL_DATE_BEGIN",
2081
+ value: input.arrivalDateRange?.start ?? null
2082
+ },
2083
+ { key: "ARRIVAL_DATE_END", value: input.arrivalDateRange?.end ?? null },
2084
+ { key: "ORDERBYCOLUMN", value: input.orderBy.column },
2085
+ { key: "ORDERBYDIRECTION", value: input.orderBy.direction },
2086
+ { key: "DUE_DATE_BEGIN", value: input.dueDateRange?.start ?? null },
2087
+ { key: "DUE_DATE_END", value: input.dueDateRange?.end ?? null },
2088
+ { key: "ORIGIN_ID", value: input.originId },
2089
+ { key: "P_WEEKDAY", value: input.yearPeriod.weekday },
2090
+ { key: "P_WEEK", value: input.yearPeriod.week }
2091
+ ];
2092
+ }
2093
+ };
2094
+
2095
+ // src/namespaces/pig-master/reports/reproductive-failure-analysis.ts
2096
+ var ReproductiveFailureAnalysis = class extends Report {
2097
+ constructor() {
2098
+ super(...arguments);
2099
+ this.template = "@pig-master/reproductive-failure-analysis";
2100
+ this.fileName = "An\xE1lise de perdas de cobertura";
2101
+ }
2102
+ async pdf(input) {
2103
+ return this.requestPdf({
2104
+ resources: [{ key: "FARM_ID", value: input.farmId }],
2105
+ parameters: [
2106
+ { key: "GROUP", value: input.groupBy },
2107
+ { key: "FIELD", value: input.emphasis },
2108
+ { key: "CALENDAR", value: input.calendarType },
2109
+ { key: "DATE_BEGIN", value: input.dateRange?.start ?? null },
2110
+ { key: "DATE_END", value: input.dateRange?.end ?? null },
2111
+ {
2112
+ key: "MATING_DATE_BEGIN",
2113
+ value: input.matingDateRange?.start ?? null
2114
+ },
2115
+ { key: "MATING_DATE_END", value: input.matingDateRange?.end ?? null },
2116
+ { key: "FEMALE_SWINE_ID", value: input.femaleSwineId },
2117
+ { key: "PARITY", value: input.parity },
2118
+ { key: "CONTEXT", value: input.context },
2119
+ { key: "BREED_ID", value: input.breedId },
2120
+ { key: "BIRTH_PLACE_ID", value: input.birthPlaceId },
2121
+ { key: "ORIGIN_ID", value: input.originId },
2122
+ { key: "LOCATE", value: input.language.replace("-", "_") }
2123
+ ]
2124
+ });
2125
+ }
2126
+ };
2127
+
2128
+ // src/namespaces/pig-master/reports/reproductive-failure-collection-form.ts
2129
+ var ReproductiveFailureCollectionForm = class extends Report {
2130
+ constructor() {
2131
+ super(...arguments);
2132
+ this.template = "@pig-master/reproductive-failure-collection-form";
2133
+ this.fileName = "Perda de cobertura";
2134
+ }
2135
+ async pdf(input) {
2136
+ return this.requestPdf({
2137
+ resources: [{ key: "FARM_ID", value: input.farmId }],
2138
+ parameters: [{ key: "CALENDAR", value: input.calendarType }]
2139
+ });
2140
+ }
2141
+ };
2142
+
2143
+ // src/namespaces/pig-master/reports/reproductive-failure-list.ts
2144
+ var ReproductiveFailureList = class extends Report {
2145
+ constructor() {
2146
+ super(...arguments);
2147
+ this.template = "@pig-master/reproductive-failure-list";
2148
+ this.fileName = "Perdas de cobertura";
2149
+ }
2150
+ async pdf(input) {
2151
+ return this.requestPdf({
2152
+ resources: this.getResources(input),
2153
+ parameters: [
2154
+ ...this.getParameters(input),
2155
+ { key: "DATA_ONLY", value: false }
2156
+ ]
2157
+ });
2158
+ }
2159
+ async csv(input) {
2160
+ return this.requestCsv({
2161
+ resources: this.getResources(input),
2162
+ parameters: [
2163
+ ...this.getParameters(input),
2164
+ { key: "DATA_ONLY", value: true }
2165
+ ]
2166
+ });
2167
+ }
2168
+ getResources(input) {
2169
+ return [{ key: "FARM_ID", value: input.farmId }];
2170
+ }
2171
+ getParameters(input) {
2172
+ return [
2173
+ { key: "DATE_BEGIN", value: input.dateRange?.start ?? null },
2174
+ { key: "DATE_END", value: input.dateRange?.end ?? null },
2175
+ { key: "CALENDAR", value: input.calendarType },
2176
+ { key: "PARITY", value: input.parity },
2177
+ { key: "ORIGIN_ID", value: input.originId },
2178
+ { key: "BREED_ID", value: input.breedId },
2179
+ { key: "BIRTH_PLACE_ID", value: input.birthPlaceId },
2180
+ { key: "FEMALE_SWINE_ID", value: input.femaleSwineId },
2181
+ { key: "MATING_DATE_BEGIN", value: input.matingDateRange?.start ?? null },
2182
+ { key: "MATING_DATE_END", value: input.matingDateRange?.end ?? null },
2183
+ { key: "CONTEXT", value: input.context },
2184
+ { key: "ORDERBYCOLUMN", value: input.orderBy.column },
2185
+ { key: "ORDERBYDIRECTION", value: input.orderBy.direction }
2186
+ ];
2187
+ }
2188
+ };
2189
+
2190
+ // src/namespaces/pig-master/reports/score-list.ts
2191
+ var ScoreList = class extends Report {
2192
+ constructor() {
2193
+ super(...arguments);
2194
+ this.template = "@pig-master/score-list";
2195
+ this.fileName = "Listagem de escores";
2196
+ }
2197
+ async pdf(input) {
2198
+ return this.requestPdf({
2199
+ resources: this.getResources(input),
2200
+ parameters: [
2201
+ ...this.getParameters(input),
2202
+ { key: "DATA_ONLY", value: false }
2203
+ ]
2204
+ });
2205
+ }
2206
+ async csv(input) {
2207
+ return this.requestCsv({
2208
+ resources: this.getResources(input),
2209
+ parameters: [
2210
+ ...this.getParameters(input),
2211
+ { key: "DATA_ONLY", value: true }
2212
+ ]
2213
+ });
2214
+ }
2215
+ getResources(input) {
2216
+ return [{ key: "FARM_ID", value: input.farmId }];
2217
+ }
2218
+ getParameters(input) {
2219
+ return [{ key: "LOCATE", value: input.language.replace("-", "_") }];
2220
+ }
2221
+ };
2222
+
2223
+ // src/namespaces/pig-master/reports/weaning-analysis.ts
2224
+ var WeaningAnalysis = class extends Report {
2225
+ constructor() {
2226
+ super(...arguments);
2227
+ this.template = "@pig-master/weaning-analysis";
2228
+ this.fileName = "An\xE1lise de desmames";
2229
+ }
2230
+ async pdf(input) {
2231
+ return this.requestPdf({
2232
+ resources: [{ key: "FARM_ID", value: input.farmId }],
2233
+ parameters: [
2234
+ { key: "DATE_BEGIN", value: input.dateRange?.start ?? null },
2235
+ { key: "DATE_END", value: input.dateRange?.end ?? null },
2236
+ { key: "CALENDAR", value: input.calendarType },
2237
+ { key: "GROUP", value: input.groupBy },
2238
+ { key: "FIELD", value: input.emphasis },
2239
+ { key: "PARITY", value: input.parity },
2240
+ { key: "ORIGIN_ID", value: input.originId },
2241
+ { key: "BREED_ID", value: input.breedId },
2242
+ { key: "BIRTH_PLACE_ID", value: input.birthPlaceId },
2243
+ { key: "FEMALE_SWINE_ID", value: input.femaleSwineId },
2244
+ { key: "LOCATE", value: input.language.replace("-", "_") },
2245
+ {
2246
+ key: "MATING_DATE_BEGIN",
2247
+ value: input.matingDateRange?.start ?? null
2248
+ },
2249
+ { key: "MATING_DATE_END", value: input.matingDateRange?.end ?? null },
2250
+ { key: "CONTEXT", value: input.context }
2251
+ ]
2252
+ });
2253
+ }
2254
+ };
2255
+
2256
+ // src/namespaces/pig-master/reports/weaning-collection-form.ts
2257
+ var WeaningCollectionForm = class extends Report {
2258
+ constructor() {
2259
+ super(...arguments);
2260
+ this.template = "@pig-master/weaning-collection-form";
2261
+ this.fileName = "Desmame";
2262
+ }
2263
+ async pdf(input) {
2264
+ return this.requestPdf({
2265
+ resources: [{ key: "FARM_ID", value: input.farmId }],
2266
+ parameters: [{ key: "CALENDAR", value: input.calendarType }]
2267
+ });
2268
+ }
56
2269
  };
57
2270
 
58
2271
  // src/namespaces/pig-master/index.ts
59
- var PigMasterNamespace = class {
2272
+ var PigMaster = class {
60
2273
  constructor(http) {
2274
+ this.birthPlaceList = new BirthPlaceList(http);
2275
+ this.boarByBreedList = new BoarByBreedList(http);
2276
+ this.boarDeathCollectionForm = new BoarDeathCollectionForm(http);
2277
+ this.boarDeathList = new BoarDeathList(http);
2278
+ this.boarDiscardCollectionForm = new BoarDiscardCollectionForm(http);
2279
+ this.boarDiscardList = new BoarDiscardList(http);
2280
+ this.boarEarTagReplacementList = new BoarEarTagReplacementList(http);
2281
+ this.boarsInventory = new BoarsInventory(http);
2282
+ this.boarTreatmentCollectionForm = new BoarTreatmentCollectionForm(http);
2283
+ this.boarTreatmentList = new BoarTreatmentList(http);
2284
+ this.breedingMonitor = new BreedingMonitor(http);
2285
+ this.breedList = new BreedList(http);
2286
+ this.causeList = new CauseList(http);
2287
+ this.drugList = new DrugList(http);
2288
+ this.employeeList = new EmployeeList(http);
2289
+ this.farmSummary = new FarmSummary(http);
2290
+ this.farrowingAnalysis = new FarrowingAnalysis(http);
2291
+ this.farrowingCollectionForm = new FarrowingCollectionForm(http);
2292
+ this.farrowingTypeList = new FarrowingTypeList(http);
2293
+ this.femaleSwineArrivalMonitoring = new FemaleSwineArrivalMonitoring(http);
2294
+ this.femaleSwineByBreedList = new FemaleSwineByBreedList(http);
2295
+ this.femaleSwineByParityList = new FemaleSwineByParityList(http);
2296
+ this.femaleSwineByStatusList = new FemaleSwineByStatusList(http);
2297
+ this.femaleSwineByTraceabilityList = new FemaleSwineByTraceabilityList(http);
2298
+ this.femaleSwineDeathAnalysis = new FemaleSwineDeathAnalysis(http);
2299
+ this.femaleSwineDeathCollectionForm = new FemaleSwineDeathCollectionForm(
2300
+ http
2301
+ );
2302
+ this.femaleSwineDeathList = new FemaleSwineDeathList(http);
2303
+ this.femaleSwineDiscardAnalysis = new FemaleSwineDiscardAnalysis(http);
2304
+ this.femaleSwineDiscardCollectionForm = new FemaleSwineDiscardCollectionForm(http);
2305
+ this.femaleSwineDiscardList = new FemaleSwineDiscardList(http);
2306
+ this.femaleSwineEarTagReplacementList = new FemaleSwineEarTagReplacementList(http);
2307
+ this.femaleSwineInventory = new FemaleSwineInventory(http);
2308
+ this.femaleSwinePendingActionList = new FemaleSwinePendingActionList(http);
2309
+ this.femaleSwinePreDiscardList = new FemaleSwinePreDiscardList(http);
2310
+ this.femaleSwineRecord = new FemaleSwineRecord(http);
2311
+ this.femaleSwineSalePlanningList = new FemaleSwineSalePlanningList(http);
2312
+ this.femaleSwineTreatmentCollectionForm = new FemaleSwineTreatmentCollectionForm(http);
2313
+ this.femaleSwineTreatmentList = new FemaleSwineTreatmentList(http);
2314
+ this.finishingPigletDeathCollectionForm = new FinishingPigletDeathCollectionForm(http);
2315
+ this.flushingFemaleSwineList = new FlushingFemaleSwineList(http);
2316
+ this.flushingMonitor = new FlushingMonitor(http);
2317
+ this.giltInventory = new GiltInventory(http);
2318
+ this.gtaList = new GtaList(http);
2319
+ this.heatDetectionCollectionForm = new HeatDetectionCollectionForm(http);
2320
+ this.heatDetectionList = new HeatDetectionList(http);
2321
+ this.heatMonitoring = new HeatMonitoring(http);
2322
+ this.locationList = new LocationList(http);
2323
+ this.maternityPigletDeathCollectionForm = new MaternityPigletDeathCollectionForm(http);
2324
+ this.maternityPigletTransferCollectionForm = new MaternityPigletTransferCollectionForm(http);
2325
+ this.matingAnalysis = new MatingAnalysis(http);
2326
+ this.matingCollectionForm = new MatingCollectionForm(http);
2327
+ this.matingGroupList = new MatingGroupList(http);
2328
+ this.matingList = new MatingList(http);
2329
+ this.matingOverview = new MatingOverview(http);
2330
+ this.mbrfFemaleSwineRecord = new MbrfFemaleSwineRecord(http);
2331
+ this.nurseryPigletDeathCollectionForm = new NurseryPigletDeathCollectionForm(http);
61
2332
  this.originList = new OriginList(http);
2333
+ this.parityStructure = new ParityStructure(http);
2334
+ this.preFlushingFemaleSwineList = new PreFlushingFemaleSwineList(http);
2335
+ this.pregnantFemaleSwineList = new PregnantFemaleSwineList(http);
2336
+ this.pregnantFemaleSwineSaleList = new PregnantFemaleSwineSaleList(http);
2337
+ this.reproductiveFailureAnalysis = new ReproductiveFailureAnalysis(http);
2338
+ this.reproductiveFailureCollectionForm = new ReproductiveFailureCollectionForm(http);
2339
+ this.reproductiveFailureList = new ReproductiveFailureList(http);
2340
+ this.scoreList = new ScoreList(http);
2341
+ this.weaningAnalysis = new WeaningAnalysis(http);
2342
+ this.weaningCollectionForm = new WeaningCollectionForm(http);
62
2343
  }
63
2344
  };
64
2345
 
@@ -66,14 +2347,14 @@ var PigMasterNamespace = class {
66
2347
  var JaspionClient = class {
67
2348
  constructor(http) {
68
2349
  this.http = http;
69
- this.pigMaster = new PigMasterNamespace(http);
2350
+ this.pigMaster = new PigMaster(http);
70
2351
  }
71
2352
  setAccessToken(token) {
72
- this.http.defaults.headers.common.Authorization = `Bearer ${token}`;
2353
+ this.http.setHeader("Authorization", `Bearer ${token}`);
73
2354
  }
74
2355
  };
75
- function jaspion(baseURL) {
76
- const http = axios.create({ baseURL });
2356
+ function jaspion(baseUrl) {
2357
+ const http = new HttpClient(baseUrl);
77
2358
  return new JaspionClient(http);
78
2359
  }
79
2360
  export {