@gesagro/jaspion-sdk 2.0.0 → 2.0.1

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
@@ -613,6 +613,46 @@ var FarrowingCollectionForm = class extends Report {
613
613
  }
614
614
  };
615
615
 
616
+ // src/namespaces/pig-master/reports/farrowing-forecast.ts
617
+ var FarrowingForecast = class extends Report {
618
+ constructor() {
619
+ super(...arguments);
620
+ this.template = "@pig-master/farrowing-forecast";
621
+ this.fileName = "Previs\xE3o de partos";
622
+ }
623
+ async pdf(input) {
624
+ await this.requestPdf({
625
+ resources: this.getResources(input),
626
+ parameters: [
627
+ ...this.getParameters(input),
628
+ { key: "DATA_ONLY", value: false }
629
+ ]
630
+ });
631
+ }
632
+ async csv(input) {
633
+ await this.requestCsv({
634
+ resources: this.getResources(input),
635
+ parameters: [
636
+ ...this.getParameters(input),
637
+ { key: "DATA_ONLY", value: true }
638
+ ]
639
+ });
640
+ }
641
+ getResources(input) {
642
+ return [{ key: "FARM_ID", value: input.farmId }];
643
+ }
644
+ getParameters(input) {
645
+ return [
646
+ { key: "DATE_BEGIN", value: input.dateRange.start },
647
+ { key: "DATE_END", value: input.dateRange.end },
648
+ { key: "CALENDAR", value: input.calendarType },
649
+ { key: "PARITY", value: input.parity?.toString() ?? null },
650
+ { key: "LOCATION_ID", value: input.locationId },
651
+ { key: "PEN", value: input.pen }
652
+ ];
653
+ }
654
+ };
655
+
616
656
  // src/core/to-snake-case.ts
617
657
  function toSnakeCase(str) {
618
658
  return str.replace(/[A-Z]/g, (letter, index) => {
@@ -1333,6 +1373,7 @@ var FemaleSwineSalePlanningList = class extends Report {
1333
1373
  getParameters(input) {
1334
1374
  return [
1335
1375
  { key: "CALENDAR", value: input.calendarType },
1376
+ { key: "QUERY", value: input.query },
1336
1377
  { key: "DATE_BEGIN", value: input.dateRange?.start ?? null },
1337
1378
  { key: "DATE_END", value: input.dateRange?.end ?? null },
1338
1379
  { key: "RECIPIENT_ID", value: input.recipientId },
@@ -1772,6 +1813,52 @@ var MaternityPigletTransferCollectionForm = class extends Report {
1772
1813
  }
1773
1814
  };
1774
1815
 
1816
+ // src/namespaces/pig-master/reports/maternity-piglet-transfer-list.ts
1817
+ var MaternityPigletTransferList = class extends Report {
1818
+ constructor() {
1819
+ super(...arguments);
1820
+ this.template = "@pig-master/maternity-piglet-transfer-list";
1821
+ this.fileName = "Listagem de transfer\xEAncias de leit\xE3o";
1822
+ }
1823
+ async pdf(input) {
1824
+ await this.requestPdf({
1825
+ resources: this.getResources(input),
1826
+ parameters: [
1827
+ ...this.getParameters(input),
1828
+ { key: "DATA_ONLY", value: false }
1829
+ ]
1830
+ });
1831
+ }
1832
+ async csv(input) {
1833
+ await this.requestCsv({
1834
+ resources: this.getResources(input),
1835
+ parameters: [
1836
+ ...this.getParameters(input),
1837
+ { key: "DATA_ONLY", value: true }
1838
+ ]
1839
+ });
1840
+ }
1841
+ getResources(input) {
1842
+ return [{ key: "FARM_ID", value: input.farmId }];
1843
+ }
1844
+ getParameters(input) {
1845
+ return [
1846
+ { key: "DATE_BEGIN", value: input.dateRange?.start ?? null },
1847
+ { key: "DATE_END", value: input.dateRange?.end ?? null },
1848
+ { key: "CALENDAR", value: input.calendarType },
1849
+ { key: "DONOR_ID", value: input.donorId },
1850
+ { key: "DONOR_PARITY", value: input.donorParity?.toString() ?? null },
1851
+ { key: "DONOR_CONTEXT", value: input.donorContext },
1852
+ { key: "RECIPIENT_ID", value: input.recipientId },
1853
+ {
1854
+ key: "RECIPIENT_PARITY",
1855
+ value: input.recipientParity?.toString() ?? null
1856
+ },
1857
+ { key: "RECIPIENT_CONTEXT", value: input.recipientContext }
1858
+ ];
1859
+ }
1860
+ };
1861
+
1775
1862
  // src/namespaces/pig-master/reports/mating-analysis.ts
1776
1863
  var MatingAnalysis = class extends Report {
1777
1864
  constructor() {
@@ -2347,6 +2434,55 @@ var WeaningCollectionForm = class extends Report {
2347
2434
  }
2348
2435
  };
2349
2436
 
2437
+ // src/namespaces/pig-master/reports/weaning-forecast.ts
2438
+ var WeaningForecast = class extends Report {
2439
+ constructor() {
2440
+ super(...arguments);
2441
+ this.template = "@pig-master/weaning-forecast";
2442
+ this.fileName = "Previs\xE3o de desmames";
2443
+ }
2444
+ async pdf(input) {
2445
+ await this.requestPdf({
2446
+ resources: this.getResources(input),
2447
+ parameters: [
2448
+ ...this.getParameters(input),
2449
+ { key: "DATA_ONLY", value: false }
2450
+ ]
2451
+ });
2452
+ }
2453
+ async csv(input) {
2454
+ await this.requestCsv({
2455
+ resources: this.getResources(input),
2456
+ parameters: [
2457
+ ...this.getParameters(input),
2458
+ { key: "DATA_ONLY", value: true }
2459
+ ]
2460
+ });
2461
+ }
2462
+ getResources(input) {
2463
+ return [{ key: "FARM_ID", value: input.farmId }];
2464
+ }
2465
+ getParameters(input) {
2466
+ return [
2467
+ { key: "WEANING_DATE", value: input.weaningDate },
2468
+ { key: "CALENDAR", value: input.calendarType },
2469
+ { key: "PARITY", value: input.parity?.toString() ?? null },
2470
+ { key: "LOCATION_ID", value: input.locationId },
2471
+ { key: "PEN", value: input.pen },
2472
+ {
2473
+ key: "MIN_LACTATION_DAYS",
2474
+ value: input.lactationLengthRange?.start.toString() ?? null
2475
+ },
2476
+ {
2477
+ key: "MAX_LACTATION_DAYS",
2478
+ value: input.lactationLengthRange?.end.toString() ?? null
2479
+ },
2480
+ { key: "ORDERBYDIRECTION", value: input.orderBy.direction },
2481
+ { key: "ORDERBYCOLUMN", value: toSnakeCase(input.orderBy.column) }
2482
+ ];
2483
+ }
2484
+ };
2485
+
2350
2486
  // src/namespaces/pig-master/reports/weaning-list.ts
2351
2487
  var WeaningList = class extends Report {
2352
2488
  constructor() {
@@ -2484,6 +2620,9 @@ var PigMaster = class {
2484
2620
  this.maternityPigletDeathList = new MaternityPigletDeathList(http);
2485
2621
  this.weaningList = new WeaningList(http);
2486
2622
  this.farrowingList = new FarrowingList(http);
2623
+ this.maternityPigletTransferList = new MaternityPigletTransferList(http);
2624
+ this.weaningForecast = new WeaningForecast(http);
2625
+ this.farrowingForecast = new FarrowingForecast(http);
2487
2626
  }
2488
2627
  };
2489
2628