@unimaze/billing 0.1.1 → 0.1.2-rc.2

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.
Files changed (29) hide show
  1. package/lib/common/components/payment-method/index.js +10 -10
  2. package/lib/create-credit-note/index.d.ts +2 -2
  3. package/lib/create-credit-note/index.js +12 -15
  4. package/lib/index.d.ts +2 -3
  5. package/lib/index.js +3 -5
  6. package/lib/src/common/components/attachments/Attachment.d.ts +15 -0
  7. package/lib/src/common/components/attachments/index.d.ts +3 -0
  8. package/lib/src/common/components/base-information/index.d.ts +9 -0
  9. package/lib/src/common/components/billing-lines/index.d.ts +27 -0
  10. package/lib/src/common/components/component-container/Content.d.ts +7 -0
  11. package/lib/src/common/components/component-container/Header.d.ts +9 -0
  12. package/lib/src/common/components/component-container/index.d.ts +10 -0
  13. package/lib/src/common/components/delivery-location/index.d.ts +3 -0
  14. package/lib/src/common/components/editable-cell/index.d.ts +11 -0
  15. package/lib/src/common/components/editable-row/index.d.ts +6 -0
  16. package/lib/src/common/components/issuer/index.d.ts +7 -0
  17. package/lib/src/common/components/payer/index.d.ts +3 -0
  18. package/lib/src/common/components/payment-method/index.d.ts +3 -0
  19. package/lib/src/common/consts/validationRules.d.ts +7 -0
  20. package/lib/src/create-credit-note/index.d.ts +9 -0
  21. package/lib/src/create-invoice/index.d.ts +15 -0
  22. package/lib/src/index.d.ts +4 -0
  23. package/lib/utils/ApiUtility.d.ts +14 -0
  24. package/lib/utils/ApiUtility.js +43 -0
  25. package/lib/utils/ConversionUtility.d.ts +4 -0
  26. package/lib/utils/ConversionUtility.js +158 -0
  27. package/lib/utils/index.d.ts +2 -5
  28. package/lib/utils/index.js +5 -162
  29. package/package.json +2 -2
@@ -13,9 +13,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
13
13
  var react_1 = __importStar(require("react"));
14
14
  var component_container_1 = __importDefault(require("../component-container"));
15
15
  var antd_1 = require("antd");
16
- var mapi_1 = require("@unimaze/api-clients/lib/mapi/");
16
+ var models_1 = require("@unimaze/api-clients/lib/mapi/models");
17
17
  var PaymentMethod = function () {
18
- var _a = react_1.useState(mapi_1.PaymentMeansMetadataTypeEnum.NotSpecified), paymentMethod = _a[0], setPaymentMethod = _a[1];
18
+ var _a = react_1.useState(models_1.PaymentMeansMetadataTypeEnum.NotSpecified), paymentMethod = _a[0], setPaymentMethod = _a[1];
19
19
  var domesticTransferFormFields = react_1.default.createElement(react_1.default.Fragment, null,
20
20
  react_1.default.createElement(antd_1.Form.Item, { label: "Bank no.", name: "paymentMethod:bankNo" },
21
21
  react_1.default.createElement(antd_1.Input, null)),
@@ -35,12 +35,12 @@ var PaymentMethod = function () {
35
35
  react_1.default.createElement(antd_1.Input, null)));
36
36
  var renderFormFields = function (payMthd) {
37
37
  switch (payMthd) {
38
- case mapi_1.PaymentMeansMetadataTypeEnum.NotSpecified:
39
- case mapi_1.PaymentMeansMetadataTypeEnum.MutuallyAgreed:
38
+ case models_1.PaymentMeansMetadataTypeEnum.NotSpecified:
39
+ case models_1.PaymentMeansMetadataTypeEnum.MutuallyAgreed:
40
40
  return null;
41
- case mapi_1.PaymentMeansMetadataTypeEnum.DomesticTransfer:
41
+ case models_1.PaymentMeansMetadataTypeEnum.DomesticTransfer:
42
42
  return (domesticTransferFormFields);
43
- case mapi_1.PaymentMeansMetadataTypeEnum.DomesticClaim:
43
+ case models_1.PaymentMeansMetadataTypeEnum.DomesticClaim:
44
44
  return (icelandicClaimFormFields);
45
45
  default:
46
46
  return null;
@@ -48,19 +48,19 @@ var PaymentMethod = function () {
48
48
  };
49
49
  var paymentMethods = [
50
50
  {
51
- value: mapi_1.PaymentMeansMetadataTypeEnum.NotSpecified,
51
+ value: models_1.PaymentMeansMetadataTypeEnum.NotSpecified,
52
52
  display: "Undefined"
53
53
  },
54
54
  {
55
- value: mapi_1.PaymentMeansMetadataTypeEnum.MutuallyAgreed,
55
+ value: models_1.PaymentMeansMetadataTypeEnum.MutuallyAgreed,
56
56
  display: "Mutually agreed"
57
57
  },
58
58
  {
59
- value: mapi_1.PaymentMeansMetadataTypeEnum.DomesticTransfer,
59
+ value: models_1.PaymentMeansMetadataTypeEnum.DomesticTransfer,
60
60
  display: "Domestic transfer"
61
61
  },
62
62
  {
63
- value: mapi_1.PaymentMeansMetadataTypeEnum.DomesticClaim,
63
+ value: models_1.PaymentMeansMetadataTypeEnum.DomesticClaim,
64
64
  display: "Claim (Icelandic)"
65
65
  }
66
66
  ];
@@ -1,8 +1,8 @@
1
+ import "antd/dist/antd.compact.css";
2
+ import "../style/index.css";
1
3
  import React from "react";
2
- import { CreateCorrectWithCreditRequest } from "@unimaze/api-clients/lib/mapi";
3
4
  import { ProfileOutput } from "@unimaze/api-clients/lib/wapi2";
4
5
  interface Props {
5
- handleCorrectWithCredit: (createCorrectWithCreditRequest: CreateCorrectWithCreditRequest) => void;
6
6
  issuer: ProfileOutput;
7
7
  }
8
8
  declare const CreateInvoice: React.FC<Props>;
@@ -10,31 +10,28 @@ var __assign = (this && this.__assign) || function () {
10
10
  };
11
11
  return __assign.apply(this, arguments);
12
12
  };
13
- var __importStar = (this && this.__importStar) || function (mod) {
14
- if (mod && mod.__esModule) return mod;
15
- var result = {};
16
- if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
17
- result["default"] = mod;
18
- return result;
19
- };
20
13
  var __importDefault = (this && this.__importDefault) || function (mod) {
21
14
  return (mod && mod.__esModule) ? mod : { "default": mod };
22
15
  };
23
16
  Object.defineProperty(exports, "__esModule", { value: true });
24
- var react_1 = __importStar(require("react"));
17
+ require("antd/dist/antd.compact.css");
18
+ require("../style/index.css");
19
+ var react_1 = __importDefault(require("react"));
25
20
  var antd_1 = require("antd");
26
21
  var payer_1 = __importDefault(require("../common/components/payer"));
27
22
  var issuer_1 = __importDefault(require("../common/components/issuer"));
28
23
  var base_information_1 = __importDefault(require("../common/components/base-information"));
29
24
  var billing_lines_1 = __importDefault(require("../common/components/billing-lines"));
30
25
  var attachments_1 = __importDefault(require("../common/components/attachments"));
31
- var _a = react_1.useState({
32
- conversationIdentifier: "test",
33
- creditNoteMetadataInput: {},
34
- messageId: "test_mid",
35
- more: false,
36
- services: [],
37
- }), createCorrectWithCreditRequest = _a[0], setCreateCorrectWithCreditRequest = _a[1];
26
+ // const [createCorrectWithCreditRequest, setCreateCorrectWithCreditRequest] = useState<CreateCorrectWithCreditRequest>(
27
+ // {
28
+ // conversationIdentifier: "test",
29
+ // creditNoteMetadataInput: {} as CreditNoteMetadataInput,
30
+ // messageId: "test_mid",
31
+ // more: false,
32
+ // services: [],
33
+ // }
34
+ // );
38
35
  var form = antd_1.Form.useForm()[0];
39
36
  var handleSetBillingLineMetadata = function (formInstance, billingLineMetadata) {
40
37
  formInstance.setFieldsValue({
package/lib/index.d.ts CHANGED
@@ -1,5 +1,4 @@
1
1
  export * from "./common/enums";
2
2
  export * from "./common/types";
3
- import CreateInvoice from "./create-invoice";
4
- import CreateCreditNote from "./create-credit-note";
5
- export { CreateInvoice, CreateCreditNote };
3
+ export { default as CreateInvoice } from "./create-invoice";
4
+ export { default as CreateCreditNote } from "./create-credit-note";
package/lib/index.js CHANGED
@@ -1,9 +1,7 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
- var create_invoice_1 = __importDefault(require("./create-invoice"));
3
+ // Components
4
+ var create_invoice_1 = require("./create-invoice");
7
5
  exports.CreateInvoice = create_invoice_1.default;
8
- var create_credit_note_1 = __importDefault(require("./create-credit-note"));
6
+ var create_credit_note_1 = require("./create-credit-note");
9
7
  exports.CreateCreditNote = create_credit_note_1.default;
@@ -0,0 +1,15 @@
1
+ import * as React from 'react';
2
+ import '@ant-design/compatible/assets/index.css';
3
+ interface Props {
4
+ fieldName: string;
5
+ }
6
+ interface States {
7
+ file: any[];
8
+ }
9
+ declare class Attachment extends React.Component<Props, States> {
10
+ constructor(props: Props);
11
+ handleRemoveFile: () => void;
12
+ normFile: (e: any) => any;
13
+ render(): JSX.Element;
14
+ }
15
+ export default Attachment;
@@ -0,0 +1,3 @@
1
+ import * as React from 'react';
2
+ declare const AttachmentsGroup: React.FC;
3
+ export default AttachmentsGroup;
@@ -0,0 +1,9 @@
1
+ import * as React from 'react';
2
+ import '@ant-design/compatible/assets/index.css';
3
+ import { FormInstance } from "antd/es/form";
4
+ interface Props {
5
+ form: FormInstance;
6
+ documentType: "creditNote" | "invoice";
7
+ }
8
+ declare const BaseInformation: React.FC<Props>;
9
+ export default BaseInformation;
@@ -0,0 +1,27 @@
1
+ import * as React from 'react';
2
+ import '@ant-design/compatible/assets/index.css';
3
+ import { BillingLineMetadata } from "@unimaze/api-clients/lib/mapi/models";
4
+ import { BillingLineMetadataOverride } from "../../types/BillingLineMetadataOverride";
5
+ import { FormInstance } from "antd/es/form";
6
+ import { ColumnType } from 'antd/es/table';
7
+ interface EditableColumnProps<T> extends ColumnType<T> {
8
+ editable?: boolean;
9
+ }
10
+ interface Props {
11
+ form: FormInstance;
12
+ setBillingLineMetadata: (form: FormInstance, billingLineMetadata: BillingLineMetadata[]) => void;
13
+ }
14
+ interface States {
15
+ dataSource: BillingLineMetadataOverride[];
16
+ editableIndex: number | null;
17
+ }
18
+ declare class BillingLines extends React.Component<Props, States> {
19
+ columns: EditableColumnProps<BillingLineMetadataOverride>[];
20
+ constructor(props: Props);
21
+ renderCurrencyColumn: (text: string) => string;
22
+ handleDelete: (index: number) => void;
23
+ handleAdd: () => void;
24
+ handleSave: (row: BillingLineMetadataOverride, form: FormInstance) => void;
25
+ render(): JSX.Element;
26
+ }
27
+ export default BillingLines;
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import { HeightProperty } from "csstype";
3
+ interface Props {
4
+ height?: HeightProperty<number>;
5
+ }
6
+ declare const Content: React.FC<Props>;
7
+ export default Content;
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import { IconProps } from "@ant-design/compatible/es/icon";
3
+ interface HeaderProps {
4
+ iconProps?: IconProps;
5
+ title?: string;
6
+ action?: React.ReactNode;
7
+ }
8
+ declare const Header: React.FC<HeaderProps>;
9
+ export default Header;
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import { IconProps } from "@ant-design/compatible/es/icon";
3
+ interface Props {
4
+ iconProps?: IconProps;
5
+ title?: string;
6
+ action?: React.ReactNode;
7
+ noPadding?: boolean;
8
+ }
9
+ declare const ComponentContainer: React.FC<Props>;
10
+ export default ComponentContainer;
@@ -0,0 +1,3 @@
1
+ import * as React from 'react';
2
+ declare const DeliveryLocation: React.FC;
3
+ export default DeliveryLocation;
@@ -0,0 +1,11 @@
1
+ import React from "react";
2
+ import { BillingLineMetadataOverride } from "../../types/BillingLineMetadataOverride";
3
+ interface EditableCellProps {
4
+ record: BillingLineMetadataOverride;
5
+ handleSave: (billingLineMetadata: BillingLineMetadataOverride) => void;
6
+ dataIndex: keyof BillingLineMetadataOverride;
7
+ editable: boolean;
8
+ index: number;
9
+ }
10
+ declare const EditableCell: React.FC<EditableCellProps>;
11
+ export default EditableCell;
@@ -0,0 +1,6 @@
1
+ import * as React from "react";
2
+ import { WrappedFormUtils } from '@ant-design/compatible/es/form/Form';
3
+ import '@ant-design/compatible/assets/index.css';
4
+ export declare const EditableContext: React.Context<WrappedFormUtils<any>>;
5
+ declare const _default: import("@ant-design/compatible/lib/form/interface").ConnectedComponentClass<({ form, index, ...props }: any) => JSX.Element, Pick<import("@ant-design/compatible/lib/form").FormComponentProps<any>, "wrappedComponentRef">>;
6
+ export default _default;
@@ -0,0 +1,7 @@
1
+ import * as React from 'react';
2
+ import { wapi2 } from "@unimaze/api-clients";
3
+ interface Props {
4
+ issuer: wapi2.ProfileOutput;
5
+ }
6
+ declare const Issuer: React.FC<Props>;
7
+ export default Issuer;
@@ -0,0 +1,3 @@
1
+ import * as React from 'react';
2
+ declare const Payer: React.FC;
3
+ export default Payer;
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ declare const PaymentMethod: () => JSX.Element;
3
+ export default PaymentMethod;
@@ -0,0 +1,7 @@
1
+ import { BillingLineMetadataOverride } from "../types/BillingLineMetadataOverride";
2
+ import { Rule } from "rc-field-form/lib/interface";
3
+ declare type ValidationRulesObject = {
4
+ [key in keyof BillingLineMetadataOverride]: Rule[];
5
+ };
6
+ export declare const validationRules: ValidationRulesObject;
7
+ export {};
@@ -0,0 +1,9 @@
1
+ import "antd/dist/antd.compact.css";
2
+ import "../style/index.css";
3
+ import React from "react";
4
+ import { ProfileOutput } from "@unimaze/api-clients/lib/wapi2";
5
+ interface Props {
6
+ issuer: ProfileOutput;
7
+ }
8
+ declare const CreateInvoice: React.FC<Props>;
9
+ export default CreateInvoice;
@@ -0,0 +1,15 @@
1
+ import "antd/dist/antd.compact.css";
2
+ import "../style/index.css";
3
+ import React from "react";
4
+ import { ProfileOutput } from "@unimaze/api-clients/lib/wapi2";
5
+ import { CommonProps } from "../common/types/CommonProps";
6
+ interface Props extends CommonProps {
7
+ issuer: ProfileOutput;
8
+ }
9
+ /**
10
+ * Component for creating a form for creating an invoice and submitting it to the MAPI transaction services
11
+ *
12
+ * @component
13
+ */
14
+ declare const CreateInvoice: React.FC<Props>;
15
+ export default CreateInvoice;
@@ -0,0 +1,4 @@
1
+ export * from "./common/enums";
2
+ export * from "./common/types";
3
+ export { default as CreateInvoice } from "./create-invoice";
4
+ export { default as CreateCreditNote } from "./create-credit-note";
@@ -0,0 +1,14 @@
1
+ import { mapi } from "@unimaze/api-clients";
2
+ import { InvoiceMetadataInput, TransactionProcessingMode } from "@unimaze/api-clients/lib/mapi/api";
3
+ import { AxiosPromise } from "axios";
4
+ import { LanguageProp } from "../common/types/CommonProps";
5
+ interface CreateSubmitInvoice {
6
+ messageId: string;
7
+ more: boolean;
8
+ conversationIdentifier?: string;
9
+ processingMode?: TransactionProcessingMode;
10
+ services?: string[];
11
+ invoiceMetadataInput?: InvoiceMetadataInput;
12
+ }
13
+ declare const submitInvoice: (createSubmitInvoice: CreateSubmitInvoice, mapiBaseUrl: string, apiKey?: string | undefined, callName?: string | undefined, language?: LanguageProp) => AxiosPromise<mapi.MessageOutput>;
14
+ export { submitInvoice, CreateSubmitInvoice };
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
13
+ var __importDefault = (this && this.__importDefault) || function (mod) {
14
+ return (mod && mod.__esModule) ? mod : { "default": mod };
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ var api_clients_1 = require("@unimaze/api-clients");
18
+ var mapi_1 = require("@unimaze/api-clients/lib/mapi");
19
+ var axios_1 = __importDefault(require("axios"));
20
+ var initialiseTransactionApi = function (mapiBaseUrl) {
21
+ var apiConfig = {
22
+ basePath: mapiBaseUrl,
23
+ };
24
+ var initiatedConfig = new mapi_1.Configuration(apiConfig);
25
+ return new api_clients_1.mapi.TransactionApi(initiatedConfig);
26
+ };
27
+ var submitInvoice = function (createSubmitInvoice, mapiBaseUrl, apiKey, callName, language) {
28
+ var transactionApi = initialiseTransactionApi(mapiBaseUrl);
29
+ var messageId = createSubmitInvoice.messageId, more = createSubmitInvoice.more, conversationIdentifier = createSubmitInvoice.conversationIdentifier, processingMode = createSubmitInvoice.processingMode, services = createSubmitInvoice.services, invoiceMetadataInput = createSubmitInvoice.invoiceMetadataInput;
30
+ return transactionApi.createSubmitInvoice(messageId, more, conversationIdentifier, processingMode, services, invoiceMetadataInput, createOptions(apiKey, callName, language));
31
+ };
32
+ exports.submitInvoice = submitInvoice;
33
+ var createOptions = function (apiKey, callName, language) {
34
+ return __assign({ headers: __assign({ "Accept-Language": language ? language : "en" }, (apiKey && { Authorization: "Bearer apikey-" + apiKey })) }, (callName && { cancelToken: getCancelToken(callName) }));
35
+ };
36
+ var getCancelToken = function (callName) {
37
+ var cancelTokenSource = window[callName];
38
+ if (cancelTokenSource) {
39
+ cancelTokenSource.cancel("only one call allowed. Canceling previous call");
40
+ }
41
+ window[callName] = axios_1.default.CancelToken.source();
42
+ return window[callName].token;
43
+ };
@@ -0,0 +1,4 @@
1
+ import { CreditNoteMetadataInput, InvoiceMetadataInput } from "@unimaze/api-clients/lib/mapi";
2
+ declare const convertToInvoiceMetadataInput: (formValues: any) => InvoiceMetadataInput;
3
+ declare const convertToCreditNoteMetadataInput: (formValues: any) => CreditNoteMetadataInput;
4
+ export { convertToCreditNoteMetadataInput, convertToInvoiceMetadataInput };
@@ -0,0 +1,158 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var convertToInvoiceMetadataInput = function (formValues) {
4
+ return {
5
+ messageHandling: {
6
+ receiverIdentifier: "",
7
+ fallbackEmailAddress: "",
8
+ fallbackContactName: "",
9
+ },
10
+ invoice: {
11
+ supplier: {
12
+ identifier: "",
13
+ address: {
14
+ streetNameAndNumber: "",
15
+ postalZone: "",
16
+ city: "",
17
+ countryCode: "",
18
+ countrySubEntity: "",
19
+ addressLine2: "",
20
+ addressLine3: ""
21
+ },
22
+ name: "",
23
+ vatNumber: "",
24
+ contact: {
25
+ electronicMail: "",
26
+ fax: "",
27
+ name: "",
28
+ telephone: ""
29
+ }
30
+ },
31
+ customer: {
32
+ identifier: "",
33
+ address: {
34
+ streetNameAndNumber: "",
35
+ postalZone: "",
36
+ city: "",
37
+ countryCode: "",
38
+ countrySubEntity: "",
39
+ addressLine2: "",
40
+ addressLine3: ""
41
+ },
42
+ name: "",
43
+ contact: {
44
+ electronicMail: "",
45
+ fax: "",
46
+ name: "",
47
+ telephone: ""
48
+ },
49
+ },
50
+ delivery: {
51
+ actualDeliveryDate: null,
52
+ address: {
53
+ streetNameAndNumber: "",
54
+ postalZone: "",
55
+ city: "",
56
+ countryCode: "",
57
+ countrySubEntity: "",
58
+ addressLine2: "",
59
+ addressLine3: ""
60
+ },
61
+ locationIdentifier: "",
62
+ partyName: ""
63
+ },
64
+ issueDate: new Date(),
65
+ dueDate: null,
66
+ invoiceNo: "",
67
+ paymentTerms: {
68
+ note: ""
69
+ },
70
+ currencyCode: "",
71
+ invoiceLines: [],
72
+ notes: "",
73
+ payableAmount: 0,
74
+ orderReference: {
75
+ documentNo: "",
76
+ },
77
+ }
78
+ };
79
+ };
80
+ exports.convertToInvoiceMetadataInput = convertToInvoiceMetadataInput;
81
+ var convertToCreditNoteMetadataInput = function (formValues) {
82
+ return {
83
+ messageHandling: {
84
+ receiverIdentifier: "",
85
+ fallbackEmailAddress: "",
86
+ fallbackContactName: "",
87
+ },
88
+ creditNote: {
89
+ supplier: {
90
+ identifier: "",
91
+ address: {
92
+ streetNameAndNumber: "",
93
+ postalZone: "",
94
+ city: "",
95
+ countryCode: "",
96
+ countrySubEntity: "",
97
+ addressLine2: "",
98
+ addressLine3: ""
99
+ },
100
+ name: "",
101
+ vatNumber: "",
102
+ contact: {
103
+ electronicMail: "",
104
+ fax: "",
105
+ name: "",
106
+ telephone: ""
107
+ }
108
+ },
109
+ customer: {
110
+ identifier: "",
111
+ address: {
112
+ streetNameAndNumber: "",
113
+ postalZone: "",
114
+ city: "",
115
+ countryCode: "",
116
+ countrySubEntity: "",
117
+ addressLine2: "",
118
+ addressLine3: ""
119
+ },
120
+ name: "",
121
+ contact: {
122
+ electronicMail: "",
123
+ fax: "",
124
+ name: "",
125
+ telephone: ""
126
+ },
127
+ },
128
+ delivery: {
129
+ actualDeliveryDate: null,
130
+ address: {
131
+ streetNameAndNumber: "",
132
+ postalZone: "",
133
+ city: "",
134
+ countryCode: "",
135
+ countrySubEntity: "",
136
+ addressLine2: "",
137
+ addressLine3: ""
138
+ },
139
+ locationIdentifier: "",
140
+ partyName: ""
141
+ },
142
+ issueDate: new Date(),
143
+ creditNoteNo: "",
144
+ currencyCode: "",
145
+ creditNoteLines: [],
146
+ notes: "",
147
+ payableAmount: 0,
148
+ orderReference: {
149
+ documentNo: "",
150
+ },
151
+ billingReferences: {
152
+ invoices: [],
153
+ creditNotes: [],
154
+ }
155
+ }
156
+ };
157
+ };
158
+ exports.convertToCreditNoteMetadataInput = convertToCreditNoteMetadataInput;
@@ -1,5 +1,2 @@
1
- import { InvoiceMetadataInput, CreditNoteMetadataInput } from "@unimaze/api-clients/lib/mapi";
2
- export declare class Utility {
3
- static convertToInvoiceMetadataInput: (formValues: any) => InvoiceMetadataInput;
4
- static convertToCreditNoteMetadataInput: (formValues: any) => CreditNoteMetadataInput;
5
- }
1
+ export { convertToInvoiceMetadataInput, convertToCreditNoteMetadataInput } from "./ConversionUtility";
2
+ export { submitInvoice, CreateSubmitInvoice } from "./ApiUtility";
@@ -1,164 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- var Utility = /** @class */ (function () {
4
- function Utility() {
5
- }
6
- Utility.convertToInvoiceMetadataInput = function (formValues) {
7
- return {
8
- messageHandling: {
9
- receiverIdentifier: "",
10
- fallbackEmailAddress: "",
11
- fallbackContactName: "",
12
- },
13
- invoice: {
14
- supplier: {
15
- identifier: "",
16
- address: {
17
- streetNameAndNumber: "",
18
- postalZone: "",
19
- city: "",
20
- countryCode: "",
21
- countrySubEntity: "",
22
- addressLine2: "",
23
- addressLine3: ""
24
- },
25
- name: "",
26
- vatNumber: "",
27
- contact: {
28
- electronicMail: "",
29
- fax: "",
30
- name: "",
31
- telephone: ""
32
- }
33
- },
34
- customer: {
35
- identifier: "",
36
- address: {
37
- streetNameAndNumber: "",
38
- postalZone: "",
39
- city: "",
40
- countryCode: "",
41
- countrySubEntity: "",
42
- addressLine2: "",
43
- addressLine3: ""
44
- },
45
- name: "",
46
- contact: {
47
- electronicMail: "",
48
- fax: "",
49
- name: "",
50
- telephone: ""
51
- },
52
- },
53
- delivery: {
54
- actualDeliveryDate: null,
55
- address: {
56
- streetNameAndNumber: "",
57
- postalZone: "",
58
- city: "",
59
- countryCode: "",
60
- countrySubEntity: "",
61
- addressLine2: "",
62
- addressLine3: ""
63
- },
64
- locationIdentifier: "",
65
- partyName: ""
66
- },
67
- issueDate: new Date(),
68
- dueDate: null,
69
- invoiceNo: "",
70
- paymentTerms: {
71
- note: ""
72
- },
73
- currencyCode: "",
74
- invoiceLines: [],
75
- notes: "",
76
- payableAmount: 0,
77
- orderReference: {
78
- documentNo: "",
79
- issueDate: undefined,
80
- },
81
- }
82
- };
83
- };
84
- Utility.convertToCreditNoteMetadataInput = function (formValues) {
85
- return {
86
- messageHandling: {
87
- receiverIdentifier: "",
88
- fallbackEmailAddress: "",
89
- fallbackContactName: "",
90
- },
91
- creditNote: {
92
- supplier: {
93
- identifier: "",
94
- address: {
95
- streetNameAndNumber: "",
96
- postalZone: "",
97
- city: "",
98
- countryCode: "",
99
- countrySubEntity: "",
100
- addressLine2: "",
101
- addressLine3: ""
102
- },
103
- name: "",
104
- vatNumber: "",
105
- contact: {
106
- electronicMail: "",
107
- fax: "",
108
- name: "",
109
- telephone: ""
110
- }
111
- },
112
- customer: {
113
- identifier: "",
114
- address: {
115
- streetNameAndNumber: "",
116
- postalZone: "",
117
- city: "",
118
- countryCode: "",
119
- countrySubEntity: "",
120
- addressLine2: "",
121
- addressLine3: ""
122
- },
123
- name: "",
124
- contact: {
125
- electronicMail: "",
126
- fax: "",
127
- name: "",
128
- telephone: ""
129
- },
130
- },
131
- delivery: {
132
- actualDeliveryDate: null,
133
- address: {
134
- streetNameAndNumber: "",
135
- postalZone: "",
136
- city: "",
137
- countryCode: "",
138
- countrySubEntity: "",
139
- addressLine2: "",
140
- addressLine3: ""
141
- },
142
- locationIdentifier: "",
143
- partyName: ""
144
- },
145
- issueDate: new Date(),
146
- creditNoteNo: "",
147
- currencyCode: "",
148
- creditNoteLines: [],
149
- notes: "",
150
- payableAmount: 0,
151
- orderReference: {
152
- documentNo: "",
153
- issueDate: undefined,
154
- },
155
- billingReferences: {
156
- invoices: [],
157
- creditNotes: [],
158
- }
159
- }
160
- };
161
- };
162
- return Utility;
163
- }());
164
- exports.Utility = Utility;
3
+ var ConversionUtility_1 = require("./ConversionUtility");
4
+ exports.convertToInvoiceMetadataInput = ConversionUtility_1.convertToInvoiceMetadataInput;
5
+ exports.convertToCreditNoteMetadataInput = ConversionUtility_1.convertToCreditNoteMetadataInput;
6
+ var ApiUtility_1 = require("./ApiUtility");
7
+ exports.submitInvoice = ApiUtility_1.submitInvoice;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unimaze/billing",
3
- "version": "0.1.1",
3
+ "version": "0.1.2-rc.2",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -9,7 +9,7 @@
9
9
  ],
10
10
  "dependencies": {
11
11
  "@ant-design/compatible": "latest",
12
- "@unimaze/api-clients": "latest",
12
+ "@unimaze/api-clients": "^1.1.0",
13
13
  "react-hot-loader": "^4.12.20"
14
14
  },
15
15
  "devDependencies": {