@gesagro/jaspion-sdk 1.0.8 → 1.0.10

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.d.mts CHANGED
@@ -1294,6 +1294,35 @@ declare class WeaningCollectionForm extends Report implements PdfReport {
1294
1294
  pdf(input: WeaningCollectionFormInput): Promise<void>;
1295
1295
  }
1296
1296
 
1297
+ interface WeaningListInput {
1298
+ farmId: string;
1299
+ dateRange: {
1300
+ start: string;
1301
+ end: string;
1302
+ } | null;
1303
+ matingDateRange: {
1304
+ start: string;
1305
+ end: string;
1306
+ } | null;
1307
+ calendarType: CalendarType;
1308
+ parity: number | null;
1309
+ originId: string | null;
1310
+ breedId: string | null;
1311
+ birthPlaceId: string | null;
1312
+ femaleSwineId: string | null;
1313
+ context: MaternityContext | null;
1314
+ nurseryPigletBatchId: string | null;
1315
+ orderBy: OrderBy<'date' | 'parity' | 'weanedPiglets' | 'createdAt'>;
1316
+ }
1317
+ declare class WeaningList extends Report implements PdfReport, CsvReport {
1318
+ readonly template = "@pig-master/weaning-list";
1319
+ fileName: string;
1320
+ pdf(input: WeaningListInput): Promise<void>;
1321
+ csv(input: WeaningListInput): Promise<void>;
1322
+ private getResources;
1323
+ private getParameters;
1324
+ }
1325
+
1297
1326
  declare class PigMaster {
1298
1327
  readonly birthPlaceList: BirthPlaceList;
1299
1328
  readonly boarByBreedList: BoarByBreedList;
@@ -1363,6 +1392,7 @@ declare class PigMaster {
1363
1392
  readonly weaningAnalysis: WeaningAnalysis;
1364
1393
  readonly weaningCollectionForm: WeaningCollectionForm;
1365
1394
  readonly maternityPigletDeathList: MaternityPigletDeathList;
1395
+ readonly weaningList: WeaningList;
1366
1396
  constructor(http: HttpClient);
1367
1397
  }
1368
1398
 
package/dist/index.d.ts CHANGED
@@ -1294,6 +1294,35 @@ declare class WeaningCollectionForm extends Report implements PdfReport {
1294
1294
  pdf(input: WeaningCollectionFormInput): Promise<void>;
1295
1295
  }
1296
1296
 
1297
+ interface WeaningListInput {
1298
+ farmId: string;
1299
+ dateRange: {
1300
+ start: string;
1301
+ end: string;
1302
+ } | null;
1303
+ matingDateRange: {
1304
+ start: string;
1305
+ end: string;
1306
+ } | null;
1307
+ calendarType: CalendarType;
1308
+ parity: number | null;
1309
+ originId: string | null;
1310
+ breedId: string | null;
1311
+ birthPlaceId: string | null;
1312
+ femaleSwineId: string | null;
1313
+ context: MaternityContext | null;
1314
+ nurseryPigletBatchId: string | null;
1315
+ orderBy: OrderBy<'date' | 'parity' | 'weanedPiglets' | 'createdAt'>;
1316
+ }
1317
+ declare class WeaningList extends Report implements PdfReport, CsvReport {
1318
+ readonly template = "@pig-master/weaning-list";
1319
+ fileName: string;
1320
+ pdf(input: WeaningListInput): Promise<void>;
1321
+ csv(input: WeaningListInput): Promise<void>;
1322
+ private getResources;
1323
+ private getParameters;
1324
+ }
1325
+
1297
1326
  declare class PigMaster {
1298
1327
  readonly birthPlaceList: BirthPlaceList;
1299
1328
  readonly boarByBreedList: BoarByBreedList;
@@ -1363,6 +1392,7 @@ declare class PigMaster {
1363
1392
  readonly weaningAnalysis: WeaningAnalysis;
1364
1393
  readonly weaningCollectionForm: WeaningCollectionForm;
1365
1394
  readonly maternityPigletDeathList: MaternityPigletDeathList;
1395
+ readonly weaningList: WeaningList;
1366
1396
  constructor(http: HttpClient);
1367
1397
  }
1368
1398
 
package/dist/index.js CHANGED
@@ -2339,6 +2339,68 @@ var WeaningCollectionForm = class extends Report {
2339
2339
  }
2340
2340
  };
2341
2341
 
2342
+ // src/namespaces/pig-master/reports/weaning-list.ts
2343
+ var WeaningList = class extends Report {
2344
+ constructor() {
2345
+ super(...arguments);
2346
+ this.template = "@pig-master/weaning-list";
2347
+ this.fileName = "Listagem de desmames";
2348
+ }
2349
+ async pdf(input) {
2350
+ return this.requestPdf({
2351
+ resources: this.getResources(input),
2352
+ parameters: [
2353
+ ...this.getParameters(input),
2354
+ { key: "DATA_ONLY", value: false }
2355
+ ]
2356
+ });
2357
+ }
2358
+ async csv(input) {
2359
+ return this.requestCsv({
2360
+ resources: this.getResources(input),
2361
+ parameters: [
2362
+ ...this.getParameters(input),
2363
+ { key: "DATA_ONLY", value: true }
2364
+ ]
2365
+ });
2366
+ }
2367
+ getResources(input) {
2368
+ return [{ key: "FARM_ID", value: input.farmId }];
2369
+ }
2370
+ getParameters(input) {
2371
+ let orderByColumn = input.orderBy.column;
2372
+ switch (orderByColumn) {
2373
+ case "createdAt":
2374
+ orderByColumn = "created_at";
2375
+ break;
2376
+ case "weanedPiglets":
2377
+ orderByColumn = "weaned_piglets";
2378
+ break;
2379
+ default:
2380
+ break;
2381
+ }
2382
+ return [
2383
+ { key: "DATE_BEGIN", value: input.dateRange?.start ?? null },
2384
+ { key: "DATE_END", value: input.dateRange?.end ?? null },
2385
+ { key: "CALENDAR", value: input.calendarType },
2386
+ { key: "PARITY", value: input.parity?.toString() ?? null },
2387
+ { key: "ORIGIN_ID", value: input.originId },
2388
+ { key: "BREED_ID", value: input.breedId },
2389
+ { key: "BIRTH_PLACE_ID", value: input.birthPlaceId },
2390
+ { key: "FEMALE_SWINE_ID", value: input.femaleSwineId },
2391
+ {
2392
+ key: "MATING_DATE_BEGIN",
2393
+ value: input.matingDateRange?.start ?? null
2394
+ },
2395
+ { key: "MATING_DATE_END", value: input.matingDateRange?.end ?? null },
2396
+ { key: "CONTEXT", value: input.context },
2397
+ { key: "PIGLET_BATCH_ID", value: input.nurseryPigletBatchId },
2398
+ { key: "ORDERBYDIRECTION", value: input.orderBy.direction },
2399
+ { key: "ORDERBYCOLUMN", value: orderByColumn }
2400
+ ];
2401
+ }
2402
+ };
2403
+
2342
2404
  // src/namespaces/pig-master/index.ts
2343
2405
  var PigMaster = class {
2344
2406
  constructor(http) {
@@ -2412,6 +2474,7 @@ var PigMaster = class {
2412
2474
  this.weaningAnalysis = new WeaningAnalysis(http);
2413
2475
  this.weaningCollectionForm = new WeaningCollectionForm(http);
2414
2476
  this.maternityPigletDeathList = new MaternityPigletDeathList(http);
2477
+ this.weaningList = new WeaningList(http);
2415
2478
  }
2416
2479
  };
2417
2480