@a-cube-io/ereceipts-js-sdk 2.2.2 → 2.2.4

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.cjs.js CHANGED
@@ -4383,6 +4383,7 @@ class ReceiptMapper {
4383
4383
  isReturnable: output.is_returnable,
4384
4384
  isVoidable: output.is_voidable,
4385
4385
  pdfUrl: output.pdf_url,
4386
+ status: output.status,
4386
4387
  parentReceiptUuid: output.parent_receipt_uuid,
4387
4388
  };
4388
4389
  }
@@ -4808,6 +4809,34 @@ class PointOfSaleMapper {
4808
4809
  end_at: input.endAt,
4809
4810
  };
4810
4811
  }
4812
+ static toEmergencyReportApiInput(input) {
4813
+ return {
4814
+ datetime: input.datetime,
4815
+ documents_count: input.documentsCount,
4816
+ cash_payment_amount: input.cashPaymentAmount,
4817
+ electronic_payment_amount: input.electronicPaymentAmount,
4818
+ ticket_restaurant_payment_amount: input.ticketRestaurantPaymentAmount,
4819
+ ticket_restaurant_quantity: input.ticketRestaurantQuantity,
4820
+ entries: input.entries.map((entry) => this.toDailyReportEntryApiInput(entry)),
4821
+ discount: input.discount,
4822
+ };
4823
+ }
4824
+ static toDailyReportEntryApiInput(input) {
4825
+ return {
4826
+ vat_rate_code: input.vatRateCode,
4827
+ vat_amount: input.vatAmount,
4828
+ simplified_vat_allocation: input.simplifiedVatAllocation,
4829
+ partial_amount: input.partialAmount,
4830
+ total_returned_amount: input.totalReturnedAmount,
4831
+ total_voided_amount: input.totalVoidedAmount,
4832
+ total_prepaid_or_voucher_amount: input.totalPrepaidOrVoucherAmount,
4833
+ total_uncollected_services: input.totalUncollectedServices,
4834
+ total_uncollected_invoiced: input.totalUncollectedInvoiced,
4835
+ total_uncollected_dcr_to_ssn: input.totalUncollectedDcrToSsn,
4836
+ total_uncollected_complimentary: input.totalUncollectedComplimentary,
4837
+ ateco_code: input.atecoCode,
4838
+ };
4839
+ }
4811
4840
  }
4812
4841
 
4813
4842
  // this repository is used for MF1 endpoints
@@ -4840,6 +4869,10 @@ class PointOfSaleRepositoryImpl {
4840
4869
  const apiInput = PointOfSaleMapper.toInactivityApiInput(input);
4841
4870
  await this.http.post(`/mf1/pems/${serialNumber}/inactivity-period`, apiInput);
4842
4871
  }
4872
+ async uploadEmergencyReport(serialNumber, input) {
4873
+ const apiInput = PointOfSaleMapper.toEmergencyReportApiInput(input);
4874
+ await this.http.post(`/mf1/pems/${serialNumber}/emergency-report`, apiInput);
4875
+ }
4843
4876
  async communicateOffline(serialNumber, input) {
4844
4877
  const apiInput = PointOfSaleMapper.toOfflineApiInput(input);
4845
4878
  await this.http.post(`/mf1/pems/${serialNumber}/communicate-offline`, apiInput);