@unimaze/billing 0.21.65 → 0.21.66

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.
@@ -162,7 +162,7 @@ var SubmitConfirmation = function (props) {
162
162
  }
163
163
  } }, invoiceSubmittingStatus === AttachmentUploadStatus_1.SubmittingStatus.Failed ? props.intl.formatMessage(exports.translationMessages.submitConfirmation_retryButton) : props.intl.formatMessage(exports.translationMessages.submitConfirmation_retryFailedAttachments)))),
164
164
  react_1.default.createElement(antd_1.Flex, { vertical: true, align: "center", style: { paddingTop: "20px" } }, (0, SubmitConfirmationUtility_1.getNumberOfFailedAttachments)(allAttachmentsWithStatuses) > 0
165
- ? react_1.default.createElement(antd_1.Typography.Title, { level: 2 }, props.intl.formatMessage(exports.translationMessages.submitConfirmation_submitWithFailedAttachmentsInfoMessage))
165
+ ? react_1.default.createElement(antd_1.Typography.Title, { level: 4 }, props.intl.formatMessage(exports.translationMessages.submitConfirmation_submitWithFailedAttachmentsInfoMessage))
166
166
  : react_1.default.createElement(react_1.default.Fragment, null, allAttachmentsUploadedSuccessfully &&
167
167
  react_1.default.createElement(react_1.default.Fragment, null,
168
168
  react_1.default.createElement(antd_1.Typography.Title, { level: 2 }, props.intl.formatMessage(exports.translationMessages.submitConfirmation_title)),
@@ -417,7 +417,7 @@ var CreateInvoiceConstructor = function (props) {
417
417
  var failed = (0, SubmitConfirmationUtility_1.getAllFailedUploads)(allAttachmentsWithStatuses);
418
418
  var success = (0, SubmitConfirmationUtility_1.getAllSuccessfulUploads)(allAttachmentsWithStatuses);
419
419
  setNumberOfAttemptedCalls(success.length + 1);
420
- (0, ApiUtility_1.submitAttachmentIfAnyLeft)(messageIdForRetryAttachments, failed, props.mapiBaseUrl, tokenForRetryAttachments, intl, numberOfAttemptedCalls, setNumberOfAttemptedCalls, [], __spreadArray([], success, true));
420
+ (0, ApiUtility_1.submitAttachmentIfAnyLeft)(messageIdForRetryAttachments, failed, props.mapiBaseUrl, tokenForRetryAttachments, intl, numberOfAttemptedCalls, setNumberOfAttemptedCalls, [], __spreadArray([], success, true), setAllAttachmentsWithStatuses);
421
421
  setAlreadyRetried(true);
422
422
  };
423
423
  var retrySubmittingInvoice = function () {
@@ -1,5 +1,4 @@
1
- import { ImportDocumentValidationData, MessageOutput } from "@unimaze/api-clients/lib/mapi";
2
- import { InvoiceMetadataInput, TransactionProcessingMode } from "@unimaze/api-clients/lib/mapi";
1
+ import { ImportDocumentValidationData, MessageOutput, InvoiceMetadataInput, TransactionProcessingMode } from "@unimaze/api-clients/lib/mapi";
3
2
  import { AxiosPromise, CancelToken } from "axios";
4
3
  import { LanguageProp } from "../common/types/CommonProps";
5
4
  import { AttachmentProps } from "../create-invoice";
@@ -23,5 +22,5 @@ declare const submitDocumentFetch: (data: any, attachDocument: AttachDocument, m
23
22
  declare const submitInvoice: (createSubmitInvoice: CreateSubmitInvoice, mapiBaseUrl: string, token: string, callName?: string, language?: LanguageProp) => AxiosPromise<ImportDocumentValidationData[] | MessageOutput>;
24
23
  declare const getAuthToken: (rapiBaseUrl: string, entityIsoIdentifier: string) => AxiosPromise<string>;
25
24
  declare const getCancelToken: (callName: string, showMessage?: boolean) => CancelToken;
26
- declare const submitAttachmentIfAnyLeft: (_messageId: string, _attachments: AttachmentProps[], _mapiBaseUrl: string, token: string, intl: IntlShape, numberOfAttemptedCalls: number, setNumberOfAttemptedCalls: (numberOfAttemptedCalls: number) => void, numberOfFailedAttempts: number[], allAttachmentsWithStatuses: AttachmentProps[], setAllAttachmentsWithStatuses?: (allNewAttachments: AttachmentProps[]) => void) => void;
25
+ declare const submitAttachmentIfAnyLeft: (_messageId: string, _attachments: AttachmentProps[], _mapiBaseUrl: string, token: string, intl: IntlShape, numberOfAttemptedCalls: number, setNumberOfAttemptedCalls: (numberOfAttemptedCalls: number) => void, numberOfFailedAttempts: number[], allAttachmentsWithStatuses: AttachmentProps[], setAllAttachmentsWithStatuses: (allNewAttachments: AttachmentProps[]) => void) => void;
27
26
  export { submitInvoice, CreateSubmitInvoice, submitDocument, AttachDocument, submitDocumentFetch, submitAttachmentIfAnyLeft, getAuthToken, getCancelToken };
@@ -135,16 +135,16 @@ var submitAttachmentIfAnyLeft = function (_messageId, _attachments, _mapiBaseUrl
135
135
  var nextFileDescription_1 = nextFileArray_1[0].description;
136
136
  if (!nextFile)
137
137
  throw new Error("NextFile is empty");
138
+ var anyFailedAttachments = allAttachmentsWithStatuses.some(function (item) { return item.status === AttachmentUploadStatus_1.SubmittingStatus.Failed; });
138
139
  var createAttachDocument = {
139
140
  messageId: _messageId,
140
141
  contentType: nextFile.type,
141
- more: numberOfFailedAttempts.length > 0 ? true : _attachments.length > 0,
142
+ more: numberOfFailedAttempts.length > 0 || _attachments.length > 0 || anyFailedAttachments,
142
143
  name: nextFileDescription_1, // nextFile.name,
143
144
  };
144
145
  var newNumberOfAttachments_1 = numberOfAttemptedCalls + 1;
145
146
  setNumberOfAttemptedCalls(newNumberOfAttachments_1);
146
- // TODO remove aa bb just testing
147
- submitDocumentFetch(nextFileDescription_1 === 'aa' || nextFileDescription_1 === 'bb' ? undefined : nextFile, createAttachDocument, _mapiBaseUrl, token)
147
+ submitDocumentFetch(nextFile, createAttachDocument, _mapiBaseUrl, token)
148
148
  .then(function (submitDocumentResponse) {
149
149
  if (submitDocumentResponse.status === 200 || submitDocumentResponse.status === 201) {
150
150
  var newAttachmentsWithStatuses = __spreadArray(__spreadArray([], allAttachmentsWithStatuses, true), [{
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unimaze/billing",
3
- "version": "0.21.65",
3
+ "version": "0.21.66",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",