@a-cube-io/ereceipts-js-sdk 2.2.2 → 2.2.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.
@@ -4785,6 +4785,34 @@ class PointOfSaleMapper {
4785
4785
  end_at: input.endAt,
4786
4786
  };
4787
4787
  }
4788
+ static toEmergencyReportApiInput(input) {
4789
+ return {
4790
+ datetime: input.datetime,
4791
+ documents_count: input.documentsCount,
4792
+ cash_payment_amount: input.cashPaymentAmount,
4793
+ electronic_payment_amount: input.electronicPaymentAmount,
4794
+ ticket_restaurant_payment_amount: input.ticketRestaurantPaymentAmount,
4795
+ ticket_restaurant_quantity: input.ticketRestaurantQuantity,
4796
+ entries: input.entries.map((entry) => this.toDailyReportEntryApiInput(entry)),
4797
+ discount: input.discount,
4798
+ };
4799
+ }
4800
+ static toDailyReportEntryApiInput(input) {
4801
+ return {
4802
+ vat_rate_code: input.vatRateCode,
4803
+ vat_amount: input.vatAmount,
4804
+ simplified_vat_allocation: input.simplifiedVatAllocation,
4805
+ partial_amount: input.partialAmount,
4806
+ total_returned_amount: input.totalReturnedAmount,
4807
+ total_voided_amount: input.totalVoidedAmount,
4808
+ total_prepaid_or_voucher_amount: input.totalPrepaidOrVoucherAmount,
4809
+ total_uncollected_services: input.totalUncollectedServices,
4810
+ total_uncollected_invoiced: input.totalUncollectedInvoiced,
4811
+ total_uncollected_dcr_to_ssn: input.totalUncollectedDcrToSsn,
4812
+ total_uncollected_complimentary: input.totalUncollectedComplimentary,
4813
+ ateco_code: input.atecoCode,
4814
+ };
4815
+ }
4788
4816
  }
4789
4817
 
4790
4818
  // this repository is used for MF1 endpoints
@@ -4817,6 +4845,10 @@ class PointOfSaleRepositoryImpl {
4817
4845
  const apiInput = PointOfSaleMapper.toInactivityApiInput(input);
4818
4846
  await this.http.post(`/mf1/pems/${serialNumber}/inactivity-period`, apiInput);
4819
4847
  }
4848
+ async uploadEmergencyReport(serialNumber, input) {
4849
+ const apiInput = PointOfSaleMapper.toEmergencyReportApiInput(input);
4850
+ await this.http.post(`/mf1/pems/${serialNumber}/emergency-report`, apiInput);
4851
+ }
4820
4852
  async communicateOffline(serialNumber, input) {
4821
4853
  const apiInput = PointOfSaleMapper.toOfflineApiInput(input);
4822
4854
  await this.http.post(`/mf1/pems/${serialNumber}/communicate-offline`, apiInput);