@p7m/billing-backend 0.1.1
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/README.md +176 -0
- package/dist/ApiClient.js +703 -0
- package/dist/api/BankAccountApi.js +115 -0
- package/dist/api/CustomerApi.js +199 -0
- package/dist/api/InvoiceApi.js +233 -0
- package/dist/index.js +139 -0
- package/dist/model/BankAccount.js +178 -0
- package/dist/model/BankAccountData.js +130 -0
- package/dist/model/Currency.js +160 -0
- package/dist/model/CurrencyData.js +130 -0
- package/dist/model/Customer.js +307 -0
- package/dist/model/CustomerData.js +130 -0
- package/dist/model/DetailedInvoice.js +146 -0
- package/dist/model/Invoice.js +389 -0
- package/dist/model/InvoiceData.js +130 -0
- package/dist/model/InvoicePosition.js +238 -0
- package/dist/model/NewBankAccount.js +140 -0
- package/dist/model/NewCustomer.js +269 -0
- package/dist/model/NewInvoice.js +164 -0
- package/dist/model/NewInvoicePosition.js +196 -0
- package/dist/model/Salutation.js +68 -0
- package/package.json +46 -0
@@ -0,0 +1,146 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports["default"] = void 0;
|
7
|
+
var _ApiClient = _interopRequireDefault(require("../ApiClient"));
|
8
|
+
var _Invoice = _interopRequireDefault(require("./Invoice"));
|
9
|
+
var _InvoicePosition = _interopRequireDefault(require("./InvoicePosition"));
|
10
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
11
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
12
|
+
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
13
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
14
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
15
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
16
|
+
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
17
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
18
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
19
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /**
|
20
|
+
* Billing Backend
|
21
|
+
* # API for managing billing of customers The purpose of this API is to manage customers, articles, recurring billing, and payments. The caller has to be authenticated with the system and provide a JWT token in the Authorization header of the HTTP request. When using the API you typically get this token by authenticating first with OAuth 2.0. When you are trying this API using the Swagger interface, you need to click the `Authorize` button and then again the Authorize button in the pop-up that gets opened.
|
22
|
+
*
|
23
|
+
* The version of the OpenAPI document: 0.1.1
|
24
|
+
* Contact: tech@p7m.de
|
25
|
+
*
|
26
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
27
|
+
* https://openapi-generator.tech
|
28
|
+
* Do not edit the class manually.
|
29
|
+
*
|
30
|
+
*/
|
31
|
+
/**
|
32
|
+
* The DetailedInvoice model module.
|
33
|
+
* @module model/DetailedInvoice
|
34
|
+
* @version 0.1.1
|
35
|
+
*/
|
36
|
+
var DetailedInvoice = /*#__PURE__*/function () {
|
37
|
+
/**
|
38
|
+
* Constructs a new <code>DetailedInvoice</code>.
|
39
|
+
* @alias module:model/DetailedInvoice
|
40
|
+
* @param basic {module:model/Invoice}
|
41
|
+
* @param positions {Array.<module:model/InvoicePosition>}
|
42
|
+
*/
|
43
|
+
function DetailedInvoice(basic, positions) {
|
44
|
+
_classCallCheck(this, DetailedInvoice);
|
45
|
+
DetailedInvoice.initialize(this, basic, positions);
|
46
|
+
}
|
47
|
+
|
48
|
+
/**
|
49
|
+
* Initializes the fields of this object.
|
50
|
+
* This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
|
51
|
+
* Only for internal use.
|
52
|
+
*/
|
53
|
+
return _createClass(DetailedInvoice, null, [{
|
54
|
+
key: "initialize",
|
55
|
+
value: function initialize(obj, basic, positions) {
|
56
|
+
obj['basic'] = basic;
|
57
|
+
obj['positions'] = positions;
|
58
|
+
}
|
59
|
+
|
60
|
+
/**
|
61
|
+
* Constructs a <code>DetailedInvoice</code> from a plain JavaScript object, optionally creating a new instance.
|
62
|
+
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
|
63
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
64
|
+
* @param {module:model/DetailedInvoice} obj Optional instance to populate.
|
65
|
+
* @return {module:model/DetailedInvoice} The populated <code>DetailedInvoice</code> instance.
|
66
|
+
*/
|
67
|
+
}, {
|
68
|
+
key: "constructFromObject",
|
69
|
+
value: function constructFromObject(data, obj) {
|
70
|
+
if (data) {
|
71
|
+
obj = obj || new DetailedInvoice();
|
72
|
+
if (data.hasOwnProperty('basic')) {
|
73
|
+
obj['basic'] = _Invoice["default"].constructFromObject(data['basic']);
|
74
|
+
}
|
75
|
+
if (data.hasOwnProperty('positions')) {
|
76
|
+
obj['positions'] = _ApiClient["default"].convertToType(data['positions'], [_InvoicePosition["default"]]);
|
77
|
+
}
|
78
|
+
}
|
79
|
+
return obj;
|
80
|
+
}
|
81
|
+
|
82
|
+
/**
|
83
|
+
* Validates the JSON data with respect to <code>DetailedInvoice</code>.
|
84
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
85
|
+
* @return {boolean} to indicate whether the JSON data is valid with respect to <code>DetailedInvoice</code>.
|
86
|
+
*/
|
87
|
+
}, {
|
88
|
+
key: "validateJSON",
|
89
|
+
value: function validateJSON(data) {
|
90
|
+
// check to make sure all required properties are present in the JSON string
|
91
|
+
var _iterator = _createForOfIteratorHelper(DetailedInvoice.RequiredProperties),
|
92
|
+
_step;
|
93
|
+
try {
|
94
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
95
|
+
var property = _step.value;
|
96
|
+
if (!data.hasOwnProperty(property)) {
|
97
|
+
throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
|
98
|
+
}
|
99
|
+
}
|
100
|
+
// validate the optional field `basic`
|
101
|
+
} catch (err) {
|
102
|
+
_iterator.e(err);
|
103
|
+
} finally {
|
104
|
+
_iterator.f();
|
105
|
+
}
|
106
|
+
if (data['basic']) {
|
107
|
+
// data not null
|
108
|
+
_Invoice["default"].validateJSON(data['basic']);
|
109
|
+
}
|
110
|
+
if (data['positions']) {
|
111
|
+
// data not null
|
112
|
+
// ensure the json data is an array
|
113
|
+
if (!Array.isArray(data['positions'])) {
|
114
|
+
throw new Error("Expected the field `positions` to be an array in the JSON data but got " + data['positions']);
|
115
|
+
}
|
116
|
+
// validate the optional field `positions` (array)
|
117
|
+
var _iterator2 = _createForOfIteratorHelper(data['positions']),
|
118
|
+
_step2;
|
119
|
+
try {
|
120
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
121
|
+
var item = _step2.value;
|
122
|
+
_InvoicePosition["default"].validateJSON(item);
|
123
|
+
}
|
124
|
+
} catch (err) {
|
125
|
+
_iterator2.e(err);
|
126
|
+
} finally {
|
127
|
+
_iterator2.f();
|
128
|
+
}
|
129
|
+
;
|
130
|
+
}
|
131
|
+
return true;
|
132
|
+
}
|
133
|
+
}]);
|
134
|
+
}();
|
135
|
+
DetailedInvoice.RequiredProperties = ["basic", "positions"];
|
136
|
+
|
137
|
+
/**
|
138
|
+
* @member {module:model/Invoice} basic
|
139
|
+
*/
|
140
|
+
DetailedInvoice.prototype['basic'] = undefined;
|
141
|
+
|
142
|
+
/**
|
143
|
+
* @member {Array.<module:model/InvoicePosition>} positions
|
144
|
+
*/
|
145
|
+
DetailedInvoice.prototype['positions'] = undefined;
|
146
|
+
var _default = exports["default"] = DetailedInvoice;
|
@@ -0,0 +1,389 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports["default"] = void 0;
|
7
|
+
var _ApiClient = _interopRequireDefault(require("../ApiClient"));
|
8
|
+
var _Salutation = _interopRequireDefault(require("./Salutation"));
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
10
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
11
|
+
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
12
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
13
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
14
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
15
|
+
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
16
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
17
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
18
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /**
|
19
|
+
* Billing Backend
|
20
|
+
* # API for managing billing of customers The purpose of this API is to manage customers, articles, recurring billing, and payments. The caller has to be authenticated with the system and provide a JWT token in the Authorization header of the HTTP request. When using the API you typically get this token by authenticating first with OAuth 2.0. When you are trying this API using the Swagger interface, you need to click the `Authorize` button and then again the Authorize button in the pop-up that gets opened.
|
21
|
+
*
|
22
|
+
* The version of the OpenAPI document: 0.1.1
|
23
|
+
* Contact: tech@p7m.de
|
24
|
+
*
|
25
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
26
|
+
* https://openapi-generator.tech
|
27
|
+
* Do not edit the class manually.
|
28
|
+
*
|
29
|
+
*/
|
30
|
+
/**
|
31
|
+
* The Invoice model module.
|
32
|
+
* @module model/Invoice
|
33
|
+
* @version 0.1.1
|
34
|
+
*/
|
35
|
+
var Invoice = /*#__PURE__*/function () {
|
36
|
+
/**
|
37
|
+
* Constructs a new <code>Invoice</code>.
|
38
|
+
* @alias module:model/Invoice
|
39
|
+
* @param invoiceId {String}
|
40
|
+
* @param tenantId {String}
|
41
|
+
* @param numberGroup {String}
|
42
|
+
* @param invoiceNumber {Number}
|
43
|
+
* @param invoiceDate {Date}
|
44
|
+
* @param dueDate {Date}
|
45
|
+
* @param customerId {String}
|
46
|
+
* @param visibleCustomerId {Number}
|
47
|
+
* @param salutation {module:model/Salutation}
|
48
|
+
* @param companyName {String}
|
49
|
+
* @param givenName {String}
|
50
|
+
* @param familyName {String}
|
51
|
+
* @param deliveryInstructions {String}
|
52
|
+
* @param address {String}
|
53
|
+
* @param addressExtra {String}
|
54
|
+
* @param zip {String}
|
55
|
+
* @param town {String}
|
56
|
+
* @param country {String}
|
57
|
+
* @param netTotal {Number}
|
58
|
+
* @param grossTotal {Number}
|
59
|
+
* @param currencyId {String}
|
60
|
+
* @param bankAccounts {Array.<String>}
|
61
|
+
* @param lastChange {Date}
|
62
|
+
*/
|
63
|
+
function Invoice(invoiceId, tenantId, numberGroup, invoiceNumber, invoiceDate, dueDate, customerId, visibleCustomerId, salutation, companyName, givenName, familyName, deliveryInstructions, address, addressExtra, zip, town, country, netTotal, grossTotal, currencyId, bankAccounts, lastChange) {
|
64
|
+
_classCallCheck(this, Invoice);
|
65
|
+
Invoice.initialize(this, invoiceId, tenantId, numberGroup, invoiceNumber, invoiceDate, dueDate, customerId, visibleCustomerId, salutation, companyName, givenName, familyName, deliveryInstructions, address, addressExtra, zip, town, country, netTotal, grossTotal, currencyId, bankAccounts, lastChange);
|
66
|
+
}
|
67
|
+
|
68
|
+
/**
|
69
|
+
* Initializes the fields of this object.
|
70
|
+
* This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
|
71
|
+
* Only for internal use.
|
72
|
+
*/
|
73
|
+
return _createClass(Invoice, null, [{
|
74
|
+
key: "initialize",
|
75
|
+
value: function initialize(obj, invoiceId, tenantId, numberGroup, invoiceNumber, invoiceDate, dueDate, customerId, visibleCustomerId, salutation, companyName, givenName, familyName, deliveryInstructions, address, addressExtra, zip, town, country, netTotal, grossTotal, currencyId, bankAccounts, lastChange) {
|
76
|
+
obj['invoiceId'] = invoiceId;
|
77
|
+
obj['tenantId'] = tenantId;
|
78
|
+
obj['numberGroup'] = numberGroup;
|
79
|
+
obj['invoiceNumber'] = invoiceNumber;
|
80
|
+
obj['invoiceDate'] = invoiceDate;
|
81
|
+
obj['dueDate'] = dueDate;
|
82
|
+
obj['customerId'] = customerId;
|
83
|
+
obj['visibleCustomerId'] = visibleCustomerId;
|
84
|
+
obj['salutation'] = salutation;
|
85
|
+
obj['companyName'] = companyName;
|
86
|
+
obj['givenName'] = givenName;
|
87
|
+
obj['familyName'] = familyName;
|
88
|
+
obj['deliveryInstructions'] = deliveryInstructions;
|
89
|
+
obj['address'] = address;
|
90
|
+
obj['addressExtra'] = addressExtra;
|
91
|
+
obj['zip'] = zip;
|
92
|
+
obj['town'] = town;
|
93
|
+
obj['country'] = country;
|
94
|
+
obj['netTotal'] = netTotal;
|
95
|
+
obj['grossTotal'] = grossTotal;
|
96
|
+
obj['currencyId'] = currencyId;
|
97
|
+
obj['bankAccounts'] = bankAccounts;
|
98
|
+
obj['lastChange'] = lastChange;
|
99
|
+
}
|
100
|
+
|
101
|
+
/**
|
102
|
+
* Constructs a <code>Invoice</code> from a plain JavaScript object, optionally creating a new instance.
|
103
|
+
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
|
104
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
105
|
+
* @param {module:model/Invoice} obj Optional instance to populate.
|
106
|
+
* @return {module:model/Invoice} The populated <code>Invoice</code> instance.
|
107
|
+
*/
|
108
|
+
}, {
|
109
|
+
key: "constructFromObject",
|
110
|
+
value: function constructFromObject(data, obj) {
|
111
|
+
if (data) {
|
112
|
+
obj = obj || new Invoice();
|
113
|
+
if (data.hasOwnProperty('invoiceId')) {
|
114
|
+
obj['invoiceId'] = _ApiClient["default"].convertToType(data['invoiceId'], 'String');
|
115
|
+
}
|
116
|
+
if (data.hasOwnProperty('tenantId')) {
|
117
|
+
obj['tenantId'] = _ApiClient["default"].convertToType(data['tenantId'], 'String');
|
118
|
+
}
|
119
|
+
if (data.hasOwnProperty('numberGroup')) {
|
120
|
+
obj['numberGroup'] = _ApiClient["default"].convertToType(data['numberGroup'], 'String');
|
121
|
+
}
|
122
|
+
if (data.hasOwnProperty('invoiceNumber')) {
|
123
|
+
obj['invoiceNumber'] = _ApiClient["default"].convertToType(data['invoiceNumber'], 'Number');
|
124
|
+
}
|
125
|
+
if (data.hasOwnProperty('invoiceDate')) {
|
126
|
+
obj['invoiceDate'] = _ApiClient["default"].convertToType(data['invoiceDate'], 'Date');
|
127
|
+
}
|
128
|
+
if (data.hasOwnProperty('dueDate')) {
|
129
|
+
obj['dueDate'] = _ApiClient["default"].convertToType(data['dueDate'], 'Date');
|
130
|
+
}
|
131
|
+
if (data.hasOwnProperty('customerId')) {
|
132
|
+
obj['customerId'] = _ApiClient["default"].convertToType(data['customerId'], 'String');
|
133
|
+
}
|
134
|
+
if (data.hasOwnProperty('visibleCustomerId')) {
|
135
|
+
obj['visibleCustomerId'] = _ApiClient["default"].convertToType(data['visibleCustomerId'], 'Number');
|
136
|
+
}
|
137
|
+
if (data.hasOwnProperty('salutation')) {
|
138
|
+
obj['salutation'] = _Salutation["default"].constructFromObject(data['salutation']);
|
139
|
+
}
|
140
|
+
if (data.hasOwnProperty('companyName')) {
|
141
|
+
obj['companyName'] = _ApiClient["default"].convertToType(data['companyName'], 'String');
|
142
|
+
}
|
143
|
+
if (data.hasOwnProperty('givenName')) {
|
144
|
+
obj['givenName'] = _ApiClient["default"].convertToType(data['givenName'], 'String');
|
145
|
+
}
|
146
|
+
if (data.hasOwnProperty('familyName')) {
|
147
|
+
obj['familyName'] = _ApiClient["default"].convertToType(data['familyName'], 'String');
|
148
|
+
}
|
149
|
+
if (data.hasOwnProperty('deliveryInstructions')) {
|
150
|
+
obj['deliveryInstructions'] = _ApiClient["default"].convertToType(data['deliveryInstructions'], 'String');
|
151
|
+
}
|
152
|
+
if (data.hasOwnProperty('address')) {
|
153
|
+
obj['address'] = _ApiClient["default"].convertToType(data['address'], 'String');
|
154
|
+
}
|
155
|
+
if (data.hasOwnProperty('addressExtra')) {
|
156
|
+
obj['addressExtra'] = _ApiClient["default"].convertToType(data['addressExtra'], 'String');
|
157
|
+
}
|
158
|
+
if (data.hasOwnProperty('zip')) {
|
159
|
+
obj['zip'] = _ApiClient["default"].convertToType(data['zip'], 'String');
|
160
|
+
}
|
161
|
+
if (data.hasOwnProperty('town')) {
|
162
|
+
obj['town'] = _ApiClient["default"].convertToType(data['town'], 'String');
|
163
|
+
}
|
164
|
+
if (data.hasOwnProperty('country')) {
|
165
|
+
obj['country'] = _ApiClient["default"].convertToType(data['country'], 'String');
|
166
|
+
}
|
167
|
+
if (data.hasOwnProperty('netTotal')) {
|
168
|
+
obj['netTotal'] = _ApiClient["default"].convertToType(data['netTotal'], 'Number');
|
169
|
+
}
|
170
|
+
if (data.hasOwnProperty('grossTotal')) {
|
171
|
+
obj['grossTotal'] = _ApiClient["default"].convertToType(data['grossTotal'], 'Number');
|
172
|
+
}
|
173
|
+
if (data.hasOwnProperty('currencyId')) {
|
174
|
+
obj['currencyId'] = _ApiClient["default"].convertToType(data['currencyId'], 'String');
|
175
|
+
}
|
176
|
+
if (data.hasOwnProperty('bankAccounts')) {
|
177
|
+
obj['bankAccounts'] = _ApiClient["default"].convertToType(data['bankAccounts'], ['String']);
|
178
|
+
}
|
179
|
+
if (data.hasOwnProperty('lastChange')) {
|
180
|
+
obj['lastChange'] = _ApiClient["default"].convertToType(data['lastChange'], 'Date');
|
181
|
+
}
|
182
|
+
}
|
183
|
+
return obj;
|
184
|
+
}
|
185
|
+
|
186
|
+
/**
|
187
|
+
* Validates the JSON data with respect to <code>Invoice</code>.
|
188
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
189
|
+
* @return {boolean} to indicate whether the JSON data is valid with respect to <code>Invoice</code>.
|
190
|
+
*/
|
191
|
+
}, {
|
192
|
+
key: "validateJSON",
|
193
|
+
value: function validateJSON(data) {
|
194
|
+
// check to make sure all required properties are present in the JSON string
|
195
|
+
var _iterator = _createForOfIteratorHelper(Invoice.RequiredProperties),
|
196
|
+
_step;
|
197
|
+
try {
|
198
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
199
|
+
var property = _step.value;
|
200
|
+
if (!data.hasOwnProperty(property)) {
|
201
|
+
throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
|
202
|
+
}
|
203
|
+
}
|
204
|
+
// ensure the json data is a string
|
205
|
+
} catch (err) {
|
206
|
+
_iterator.e(err);
|
207
|
+
} finally {
|
208
|
+
_iterator.f();
|
209
|
+
}
|
210
|
+
if (data['invoiceId'] && !(typeof data['invoiceId'] === 'string' || data['invoiceId'] instanceof String)) {
|
211
|
+
throw new Error("Expected the field `invoiceId` to be a primitive type in the JSON string but got " + data['invoiceId']);
|
212
|
+
}
|
213
|
+
// ensure the json data is a string
|
214
|
+
if (data['tenantId'] && !(typeof data['tenantId'] === 'string' || data['tenantId'] instanceof String)) {
|
215
|
+
throw new Error("Expected the field `tenantId` to be a primitive type in the JSON string but got " + data['tenantId']);
|
216
|
+
}
|
217
|
+
// ensure the json data is a string
|
218
|
+
if (data['numberGroup'] && !(typeof data['numberGroup'] === 'string' || data['numberGroup'] instanceof String)) {
|
219
|
+
throw new Error("Expected the field `numberGroup` to be a primitive type in the JSON string but got " + data['numberGroup']);
|
220
|
+
}
|
221
|
+
// ensure the json data is a string
|
222
|
+
if (data['customerId'] && !(typeof data['customerId'] === 'string' || data['customerId'] instanceof String)) {
|
223
|
+
throw new Error("Expected the field `customerId` to be a primitive type in the JSON string but got " + data['customerId']);
|
224
|
+
}
|
225
|
+
// ensure the json data is a string
|
226
|
+
if (data['companyName'] && !(typeof data['companyName'] === 'string' || data['companyName'] instanceof String)) {
|
227
|
+
throw new Error("Expected the field `companyName` to be a primitive type in the JSON string but got " + data['companyName']);
|
228
|
+
}
|
229
|
+
// ensure the json data is a string
|
230
|
+
if (data['givenName'] && !(typeof data['givenName'] === 'string' || data['givenName'] instanceof String)) {
|
231
|
+
throw new Error("Expected the field `givenName` to be a primitive type in the JSON string but got " + data['givenName']);
|
232
|
+
}
|
233
|
+
// ensure the json data is a string
|
234
|
+
if (data['familyName'] && !(typeof data['familyName'] === 'string' || data['familyName'] instanceof String)) {
|
235
|
+
throw new Error("Expected the field `familyName` to be a primitive type in the JSON string but got " + data['familyName']);
|
236
|
+
}
|
237
|
+
// ensure the json data is a string
|
238
|
+
if (data['deliveryInstructions'] && !(typeof data['deliveryInstructions'] === 'string' || data['deliveryInstructions'] instanceof String)) {
|
239
|
+
throw new Error("Expected the field `deliveryInstructions` to be a primitive type in the JSON string but got " + data['deliveryInstructions']);
|
240
|
+
}
|
241
|
+
// ensure the json data is a string
|
242
|
+
if (data['address'] && !(typeof data['address'] === 'string' || data['address'] instanceof String)) {
|
243
|
+
throw new Error("Expected the field `address` to be a primitive type in the JSON string but got " + data['address']);
|
244
|
+
}
|
245
|
+
// ensure the json data is a string
|
246
|
+
if (data['addressExtra'] && !(typeof data['addressExtra'] === 'string' || data['addressExtra'] instanceof String)) {
|
247
|
+
throw new Error("Expected the field `addressExtra` to be a primitive type in the JSON string but got " + data['addressExtra']);
|
248
|
+
}
|
249
|
+
// ensure the json data is a string
|
250
|
+
if (data['zip'] && !(typeof data['zip'] === 'string' || data['zip'] instanceof String)) {
|
251
|
+
throw new Error("Expected the field `zip` to be a primitive type in the JSON string but got " + data['zip']);
|
252
|
+
}
|
253
|
+
// ensure the json data is a string
|
254
|
+
if (data['town'] && !(typeof data['town'] === 'string' || data['town'] instanceof String)) {
|
255
|
+
throw new Error("Expected the field `town` to be a primitive type in the JSON string but got " + data['town']);
|
256
|
+
}
|
257
|
+
// ensure the json data is a string
|
258
|
+
if (data['country'] && !(typeof data['country'] === 'string' || data['country'] instanceof String)) {
|
259
|
+
throw new Error("Expected the field `country` to be a primitive type in the JSON string but got " + data['country']);
|
260
|
+
}
|
261
|
+
// ensure the json data is a string
|
262
|
+
if (data['currencyId'] && !(typeof data['currencyId'] === 'string' || data['currencyId'] instanceof String)) {
|
263
|
+
throw new Error("Expected the field `currencyId` to be a primitive type in the JSON string but got " + data['currencyId']);
|
264
|
+
}
|
265
|
+
// ensure the json data is an array
|
266
|
+
if (!Array.isArray(data['bankAccounts'])) {
|
267
|
+
throw new Error("Expected the field `bankAccounts` to be an array in the JSON data but got " + data['bankAccounts']);
|
268
|
+
}
|
269
|
+
return true;
|
270
|
+
}
|
271
|
+
}]);
|
272
|
+
}();
|
273
|
+
Invoice.RequiredProperties = ["invoiceId", "tenantId", "numberGroup", "invoiceNumber", "invoiceDate", "dueDate", "customerId", "visibleCustomerId", "salutation", "companyName", "givenName", "familyName", "deliveryInstructions", "address", "addressExtra", "zip", "town", "country", "netTotal", "grossTotal", "currencyId", "bankAccounts", "lastChange"];
|
274
|
+
|
275
|
+
/**
|
276
|
+
* @member {String} invoiceId
|
277
|
+
*/
|
278
|
+
Invoice.prototype['invoiceId'] = undefined;
|
279
|
+
|
280
|
+
/**
|
281
|
+
* @member {String} tenantId
|
282
|
+
*/
|
283
|
+
Invoice.prototype['tenantId'] = undefined;
|
284
|
+
|
285
|
+
/**
|
286
|
+
* @member {String} numberGroup
|
287
|
+
*/
|
288
|
+
Invoice.prototype['numberGroup'] = undefined;
|
289
|
+
|
290
|
+
/**
|
291
|
+
* @member {Number} invoiceNumber
|
292
|
+
*/
|
293
|
+
Invoice.prototype['invoiceNumber'] = undefined;
|
294
|
+
|
295
|
+
/**
|
296
|
+
* @member {Date} invoiceDate
|
297
|
+
*/
|
298
|
+
Invoice.prototype['invoiceDate'] = undefined;
|
299
|
+
|
300
|
+
/**
|
301
|
+
* @member {Date} dueDate
|
302
|
+
*/
|
303
|
+
Invoice.prototype['dueDate'] = undefined;
|
304
|
+
|
305
|
+
/**
|
306
|
+
* @member {String} customerId
|
307
|
+
*/
|
308
|
+
Invoice.prototype['customerId'] = undefined;
|
309
|
+
|
310
|
+
/**
|
311
|
+
* @member {Number} visibleCustomerId
|
312
|
+
*/
|
313
|
+
Invoice.prototype['visibleCustomerId'] = undefined;
|
314
|
+
|
315
|
+
/**
|
316
|
+
* @member {module:model/Salutation} salutation
|
317
|
+
*/
|
318
|
+
Invoice.prototype['salutation'] = undefined;
|
319
|
+
|
320
|
+
/**
|
321
|
+
* @member {String} companyName
|
322
|
+
*/
|
323
|
+
Invoice.prototype['companyName'] = undefined;
|
324
|
+
|
325
|
+
/**
|
326
|
+
* @member {String} givenName
|
327
|
+
*/
|
328
|
+
Invoice.prototype['givenName'] = undefined;
|
329
|
+
|
330
|
+
/**
|
331
|
+
* @member {String} familyName
|
332
|
+
*/
|
333
|
+
Invoice.prototype['familyName'] = undefined;
|
334
|
+
|
335
|
+
/**
|
336
|
+
* @member {String} deliveryInstructions
|
337
|
+
*/
|
338
|
+
Invoice.prototype['deliveryInstructions'] = undefined;
|
339
|
+
|
340
|
+
/**
|
341
|
+
* @member {String} address
|
342
|
+
*/
|
343
|
+
Invoice.prototype['address'] = undefined;
|
344
|
+
|
345
|
+
/**
|
346
|
+
* @member {String} addressExtra
|
347
|
+
*/
|
348
|
+
Invoice.prototype['addressExtra'] = undefined;
|
349
|
+
|
350
|
+
/**
|
351
|
+
* @member {String} zip
|
352
|
+
*/
|
353
|
+
Invoice.prototype['zip'] = undefined;
|
354
|
+
|
355
|
+
/**
|
356
|
+
* @member {String} town
|
357
|
+
*/
|
358
|
+
Invoice.prototype['town'] = undefined;
|
359
|
+
|
360
|
+
/**
|
361
|
+
* @member {String} country
|
362
|
+
*/
|
363
|
+
Invoice.prototype['country'] = undefined;
|
364
|
+
|
365
|
+
/**
|
366
|
+
* @member {Number} netTotal
|
367
|
+
*/
|
368
|
+
Invoice.prototype['netTotal'] = undefined;
|
369
|
+
|
370
|
+
/**
|
371
|
+
* @member {Number} grossTotal
|
372
|
+
*/
|
373
|
+
Invoice.prototype['grossTotal'] = undefined;
|
374
|
+
|
375
|
+
/**
|
376
|
+
* @member {String} currencyId
|
377
|
+
*/
|
378
|
+
Invoice.prototype['currencyId'] = undefined;
|
379
|
+
|
380
|
+
/**
|
381
|
+
* @member {Array.<String>} bankAccounts
|
382
|
+
*/
|
383
|
+
Invoice.prototype['bankAccounts'] = undefined;
|
384
|
+
|
385
|
+
/**
|
386
|
+
* @member {Date} lastChange
|
387
|
+
*/
|
388
|
+
Invoice.prototype['lastChange'] = undefined;
|
389
|
+
var _default = exports["default"] = Invoice;
|
@@ -0,0 +1,130 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports["default"] = void 0;
|
7
|
+
var _ApiClient = _interopRequireDefault(require("../ApiClient"));
|
8
|
+
var _Invoice = _interopRequireDefault(require("./Invoice"));
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
10
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
11
|
+
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
12
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
13
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
14
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
15
|
+
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
16
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
17
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
18
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /**
|
19
|
+
* Billing Backend
|
20
|
+
* # API for managing billing of customers The purpose of this API is to manage customers, articles, recurring billing, and payments. The caller has to be authenticated with the system and provide a JWT token in the Authorization header of the HTTP request. When using the API you typically get this token by authenticating first with OAuth 2.0. When you are trying this API using the Swagger interface, you need to click the `Authorize` button and then again the Authorize button in the pop-up that gets opened.
|
21
|
+
*
|
22
|
+
* The version of the OpenAPI document: 0.1.1
|
23
|
+
* Contact: tech@p7m.de
|
24
|
+
*
|
25
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
26
|
+
* https://openapi-generator.tech
|
27
|
+
* Do not edit the class manually.
|
28
|
+
*
|
29
|
+
*/
|
30
|
+
/**
|
31
|
+
* The InvoiceData model module.
|
32
|
+
* @module model/InvoiceData
|
33
|
+
* @version 0.1.1
|
34
|
+
*/
|
35
|
+
var InvoiceData = /*#__PURE__*/function () {
|
36
|
+
/**
|
37
|
+
* Constructs a new <code>InvoiceData</code>.
|
38
|
+
* @alias module:model/InvoiceData
|
39
|
+
* @param data {Array.<module:model/Invoice>}
|
40
|
+
*/
|
41
|
+
function InvoiceData(data) {
|
42
|
+
_classCallCheck(this, InvoiceData);
|
43
|
+
InvoiceData.initialize(this, data);
|
44
|
+
}
|
45
|
+
|
46
|
+
/**
|
47
|
+
* Initializes the fields of this object.
|
48
|
+
* This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
|
49
|
+
* Only for internal use.
|
50
|
+
*/
|
51
|
+
return _createClass(InvoiceData, null, [{
|
52
|
+
key: "initialize",
|
53
|
+
value: function initialize(obj, data) {
|
54
|
+
obj['data'] = data;
|
55
|
+
}
|
56
|
+
|
57
|
+
/**
|
58
|
+
* Constructs a <code>InvoiceData</code> from a plain JavaScript object, optionally creating a new instance.
|
59
|
+
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
|
60
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
61
|
+
* @param {module:model/InvoiceData} obj Optional instance to populate.
|
62
|
+
* @return {module:model/InvoiceData} The populated <code>InvoiceData</code> instance.
|
63
|
+
*/
|
64
|
+
}, {
|
65
|
+
key: "constructFromObject",
|
66
|
+
value: function constructFromObject(data, obj) {
|
67
|
+
if (data) {
|
68
|
+
obj = obj || new InvoiceData();
|
69
|
+
if (data.hasOwnProperty('data')) {
|
70
|
+
obj['data'] = _ApiClient["default"].convertToType(data['data'], [_Invoice["default"]]);
|
71
|
+
}
|
72
|
+
}
|
73
|
+
return obj;
|
74
|
+
}
|
75
|
+
|
76
|
+
/**
|
77
|
+
* Validates the JSON data with respect to <code>InvoiceData</code>.
|
78
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
79
|
+
* @return {boolean} to indicate whether the JSON data is valid with respect to <code>InvoiceData</code>.
|
80
|
+
*/
|
81
|
+
}, {
|
82
|
+
key: "validateJSON",
|
83
|
+
value: function validateJSON(data) {
|
84
|
+
// check to make sure all required properties are present in the JSON string
|
85
|
+
var _iterator = _createForOfIteratorHelper(InvoiceData.RequiredProperties),
|
86
|
+
_step;
|
87
|
+
try {
|
88
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
89
|
+
var property = _step.value;
|
90
|
+
if (!data.hasOwnProperty(property)) {
|
91
|
+
throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
|
92
|
+
}
|
93
|
+
}
|
94
|
+
} catch (err) {
|
95
|
+
_iterator.e(err);
|
96
|
+
} finally {
|
97
|
+
_iterator.f();
|
98
|
+
}
|
99
|
+
if (data['data']) {
|
100
|
+
// data not null
|
101
|
+
// ensure the json data is an array
|
102
|
+
if (!Array.isArray(data['data'])) {
|
103
|
+
throw new Error("Expected the field `data` to be an array in the JSON data but got " + data['data']);
|
104
|
+
}
|
105
|
+
// validate the optional field `data` (array)
|
106
|
+
var _iterator2 = _createForOfIteratorHelper(data['data']),
|
107
|
+
_step2;
|
108
|
+
try {
|
109
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
110
|
+
var item = _step2.value;
|
111
|
+
_Invoice["default"].validateJSON(item);
|
112
|
+
}
|
113
|
+
} catch (err) {
|
114
|
+
_iterator2.e(err);
|
115
|
+
} finally {
|
116
|
+
_iterator2.f();
|
117
|
+
}
|
118
|
+
;
|
119
|
+
}
|
120
|
+
return true;
|
121
|
+
}
|
122
|
+
}]);
|
123
|
+
}();
|
124
|
+
InvoiceData.RequiredProperties = ["data"];
|
125
|
+
|
126
|
+
/**
|
127
|
+
* @member {Array.<module:model/Invoice>} data
|
128
|
+
*/
|
129
|
+
InvoiceData.prototype['data'] = undefined;
|
130
|
+
var _default = exports["default"] = InvoiceData;
|