@atomsolution/invoice-sdk-api 1.29.1 → 1.31.0

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/api.d.ts CHANGED
@@ -1083,6 +1083,51 @@ export interface GetInvoiceSerialsError {
1083
1083
  */
1084
1084
  datail?: Array<any>;
1085
1085
  }
1086
+ /**
1087
+ *
1088
+ * @export
1089
+ * @interface GetQuotasRequest
1090
+ */
1091
+ export interface GetQuotasRequest {
1092
+ /**
1093
+ * Mã sản phẩm
1094
+ * @type {string}
1095
+ * @memberof GetQuotasRequest
1096
+ */
1097
+ product_code: string;
1098
+ }
1099
+ /**
1100
+ *
1101
+ * @export
1102
+ * @interface GetQuotasResponse
1103
+ */
1104
+ export interface GetQuotasResponse {
1105
+ /**
1106
+ * Trạng thái của yêu cầu
1107
+ * @type {string}
1108
+ * @memberof GetQuotasResponse
1109
+ */
1110
+ success?: string;
1111
+ /**
1112
+ * Dữ liệu thông tin số lượng hóa đơn
1113
+ * @type {Array<any>}
1114
+ * @memberof GetQuotasResponse
1115
+ */
1116
+ data?: Array<any>;
1117
+ }
1118
+ /**
1119
+ *
1120
+ * @export
1121
+ * @interface GetQuotasError
1122
+ */
1123
+ export interface GetQuotasError {
1124
+ /**
1125
+ * Lỗi khi lấy thông tin số lượng hóa đơn
1126
+ * @type {string}
1127
+ * @memberof GetQuotasError
1128
+ */
1129
+ error?: string;
1130
+ }
1086
1131
  /**
1087
1132
  * DefaultApi - axios parameter creator
1088
1133
  * @export
@@ -1191,6 +1236,14 @@ export declare const DefaultApiAxiosParamCreator: (configuration?: Configuration
1191
1236
  * @throws {RequiredError}
1192
1237
  */
1193
1238
  getInvoiceSerials: (params: GetInvoiceSerialsRequest, options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
1239
+ /**
1240
+ * Lấy thông tin số lượng hóa đơn dựa trên mã sản phẩm.
1241
+ * @summary API lấy thông tin số lượng hóa đơn
1242
+ * @param {GetQuotasRequest} params
1243
+ * @param {*} [options] Override http request option.
1244
+ * @throws {RequiredError}
1245
+ */
1246
+ getQuotas: (params: GetQuotasRequest, options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
1194
1247
  };
1195
1248
  /**
1196
1249
  * DefaultApi - functional programming interface
@@ -1305,6 +1358,14 @@ export declare const DefaultApiFp: (configuration?: Configuration) => {
1305
1358
  * @throws {RequiredError}
1306
1359
  */
1307
1360
  getInvoiceSerials(params: GetInvoiceSerialsRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetInvoiceSerialsResponse>>;
1361
+ /**
1362
+ * Lấy thông tin số lượng hóa đơn dựa trên mã sản phẩm.
1363
+ * @summary API lấy thông tin số lượng hóa đơn
1364
+ * @param {GetQuotasRequest} params
1365
+ * @param {*} [options] Override http request option.
1366
+ * @throws {RequiredError}
1367
+ */
1368
+ getQuotas(params: GetQuotasRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetQuotasResponse>>;
1308
1369
  };
1309
1370
  /**
1310
1371
  * Unified API functions distinguished by provider in configuration
@@ -1365,4 +1426,19 @@ export declare const InvoiceApi: (configuration?: Configuration, basePath?: stri
1365
1426
  * Get invoice serials
1366
1427
  */
1367
1428
  getInvoiceSerials(params: GetInvoiceSerialsRequest, options?: RawAxiosRequestConfig): Promise<import('axios').AxiosResponse<GetInvoiceSerialsResponse, any>>;
1429
+ /**
1430
+ * Get invoice quotas (Unified)
1431
+ */
1432
+ getQuotas(params: GetQuotasRequest, options?: RawAxiosRequestConfig): Promise<import('axios').AxiosResponse<GetQuotasResponse, any>>;
1433
+ /**
1434
+ * Get Transaction History
1435
+ */
1436
+ getTransactionHistory(params: {
1437
+ bank: string;
1438
+ provider: string;
1439
+ taxCode: string;
1440
+ limit?: number;
1441
+ page?: number;
1442
+ sort?: string;
1443
+ }, options?: RawAxiosRequestConfig): Promise<import('axios').AxiosResponse<any, any>>;
1368
1444
  };
package/dist/index.esm.js CHANGED
@@ -784,6 +784,42 @@ const DefaultApiAxiosParamCreator = function(configuration) {
784
784
  url: localVarUrlObj ? toPathString(localVarUrlObj) : "",
785
785
  options: localVarRequestOptions
786
786
  };
787
+ }),
788
+ /**
789
+ * Lấy thông tin số lượng hóa đơn dựa trên mã sản phẩm.
790
+ * @summary API lấy thông tin số lượng hóa đơn
791
+ * @param {GetQuotasRequest} params
792
+ * @param {*} [options] Override http request option.
793
+ * @throws {RequiredError}
794
+ */
795
+ getQuotas: (_0, ..._1) => __async(null, [_0, ..._1], function* (params, options = {}) {
796
+ assertParamExists("getQuotas", "getQuotasRequest", params);
797
+ let baseOptions;
798
+ let localVarPath;
799
+ let localVarUrlObj;
800
+ if (configuration) {
801
+ baseOptions = configuration.baseOptions;
802
+ localVarPath = "".concat(configuration.provider, "/get-quotas");
803
+ localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
804
+ }
805
+ const localVarRequestOptions = __spreadValues(__spreadValues({
806
+ method: "GET"
807
+ }, baseOptions), options);
808
+ const localVarHeaderParameter = {};
809
+ const localVarQueryParameter = {};
810
+ yield setBearerAuthToObject(localVarHeaderParameter, configuration);
811
+ if (params.product_code !== void 0) {
812
+ localVarQueryParameter["product_code"] = params.product_code;
813
+ }
814
+ if (localVarUrlObj) {
815
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
816
+ }
817
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
818
+ localVarRequestOptions.headers = __spreadValues(__spreadValues(__spreadValues({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
819
+ return {
820
+ url: localVarUrlObj ? toPathString(localVarUrlObj) : "",
821
+ options: localVarRequestOptions
822
+ };
787
823
  })
788
824
  };
789
825
  };
@@ -1087,6 +1123,30 @@ const DefaultApiFp = function(configuration) {
1087
1123
  configuration
1088
1124
  )(axios, localVarOperationServerBasePath || basePath);
1089
1125
  });
1126
+ },
1127
+ /**
1128
+ * Lấy thông tin số lượng hóa đơn dựa trên mã sản phẩm.
1129
+ * @summary API lấy thông tin số lượng hóa đơn
1130
+ * @param {GetQuotasRequest} params
1131
+ * @param {*} [options] Override http request option.
1132
+ * @throws {RequiredError}
1133
+ */
1134
+ getQuotas(params, options) {
1135
+ return __async(this, null, function* () {
1136
+ var _a2, _b, _c;
1137
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.getQuotas(
1138
+ params,
1139
+ options
1140
+ );
1141
+ const localVarOperationServerIndex = (_a2 = configuration == null ? void 0 : configuration.serverIndex) != null ? _a2 : 0;
1142
+ const localVarOperationServerBasePath = (_c = (_b = operationServerMap["DefaultApi.getQuotas"]) == null ? void 0 : _b[localVarOperationServerIndex]) == null ? void 0 : _c.url;
1143
+ return (axios, basePath) => createRequestFunction(
1144
+ localVarAxiosArgs,
1145
+ globalAxios,
1146
+ BASE_PATH,
1147
+ configuration
1148
+ )(axios, localVarOperationServerBasePath || basePath);
1149
+ });
1090
1150
  }
1091
1151
  };
1092
1152
  };
@@ -1111,10 +1171,7 @@ const InvoiceApi = function(configuration, basePath, axios) {
1111
1171
  * Get Invoices (Unified)
1112
1172
  */
1113
1173
  getInvoices(params, options) {
1114
- return localVarFp.getInvoices(
1115
- params,
1116
- options
1117
- ).then((request) => request(axios, basePath));
1174
+ return localVarFp.getInvoices(params, options).then((request) => request(axios, basePath));
1118
1175
  },
1119
1176
  /**
1120
1177
  * Sign Contract (Unified)
@@ -1132,7 +1189,12 @@ const InvoiceApi = function(configuration, basePath, axios) {
1132
1189
  * View Print Invoice (Unified)
1133
1190
  */
1134
1191
  viewPrintInvoice(params, options) {
1135
- return localVarFp.viewPrintInvoice(params.id, params.stax, params.template_code, options).then((request) => request(axios, basePath));
1192
+ return localVarFp.viewPrintInvoice(
1193
+ params.id,
1194
+ params.stax,
1195
+ params.template_code,
1196
+ options
1197
+ ).then((request) => request(axios, basePath));
1136
1198
  },
1137
1199
  /**
1138
1200
  * Tax Info (Unified)
@@ -1169,6 +1231,44 @@ const InvoiceApi = function(configuration, basePath, axios) {
1169
1231
  */
1170
1232
  getInvoiceSerials(params, options) {
1171
1233
  return localVarFp.getInvoiceSerials(params, options).then((request) => request(axios, basePath));
1234
+ },
1235
+ /**
1236
+ * Get invoice quotas (Unified)
1237
+ */
1238
+ getQuotas(params, options) {
1239
+ return localVarFp.getQuotas(params, options).then((request) => request(axios, basePath));
1240
+ },
1241
+ /**
1242
+ * Get Transaction History
1243
+ */
1244
+ getTransactionHistory(params, options) {
1245
+ var _a, _b, _c;
1246
+ if (!axios) {
1247
+ return Promise.reject(new Error("Axios not found"));
1248
+ }
1249
+ const query = new URLSearchParams({
1250
+ bank: params.bank,
1251
+ provider: params.provider,
1252
+ taxCode: params.taxCode,
1253
+ limit: String((_a = params.limit) != null ? _a : 10),
1254
+ page: String((_b = params.page) != null ? _b : 1),
1255
+ sort: (_c = params.sort) != null ? _c : "-createdAt"
1256
+ }).toString();
1257
+ const url = "".concat(basePath || "", "/core-api/orders/history?").concat(query);
1258
+ return axios.get(url, options).then((response) => {
1259
+ if (!response) {
1260
+ throw new Error("No response received");
1261
+ }
1262
+ return response;
1263
+ }).catch((error) => {
1264
+ error.requestContext = {
1265
+ url,
1266
+ params,
1267
+ basePath,
1268
+ method: "GET"
1269
+ };
1270
+ throw error;
1271
+ });
1172
1272
  }
1173
1273
  };
1174
1274
  };