@tec.pet/tecpet-sdk 0.0.168 → 0.0.169
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/domain/integrationInvoice/dto/pa.edit-integration-invoice.dto.d.ts +83 -0
- package/dist/domain/integrationInvoice/dto/pa.edit-integration-invoice.dto.js +32 -0
- package/dist/domain/integrationInvoice/dto/pa.get-integration-invoice-by-extern-id.dto.d.ts +3 -0
- package/dist/domain/integrationInvoice/dto/pa.get-integration-invoice-by-extern-id.dto.js +2 -0
- package/dist/domain/integrationInvoice/dto/pa.get-integration-invoice.dto.d.ts +6 -0
- package/dist/domain/integrationInvoice/dto/pa.get-integration-invoice.dto.js +2 -0
- package/dist/domain/integrationInvoice/dto/pa.set-integration-invoice-item-stock-movement.dto.d.ts +7 -0
- package/dist/domain/integrationInvoice/dto/pa.set-integration-invoice-item-stock-movement.dto.js +2 -0
- package/dist/domain/integrationInvoice/index.d.ts +5 -0
- package/dist/domain/integrationInvoice/index.js +21 -0
- package/dist/domain/integrationInvoice/integrationInvoice.service.d.ts +13 -0
- package/dist/domain/integrationInvoice/integrationInvoice.service.js +22 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +4 -0
- package/package.json +1 -1
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { ApiIntegrationType } from '../../integrationShop/dto/pa.get-integration-shop-by-login.dto';
|
|
2
|
+
export declare enum IntegrationInvoiceStatusType {
|
|
3
|
+
NONE = "NONE",
|
|
4
|
+
PROCESSING = "PROCESSING",
|
|
5
|
+
AWAITING_PAYMENT = "AWAITING_PAYMENT",
|
|
6
|
+
AWAITING_ISSUE = "AWAITING_ISSUE",
|
|
7
|
+
INTEGRATED = "INTEGRATED",
|
|
8
|
+
ISSUED = "ISSUED",
|
|
9
|
+
CANCELED = "CANCELED",
|
|
10
|
+
FAILED = "FAILED"
|
|
11
|
+
}
|
|
12
|
+
export declare enum IntegrationInvoiceItemType {
|
|
13
|
+
SERVICE = "SERVICE",
|
|
14
|
+
PRODUCT = "PRODUCT",
|
|
15
|
+
PRODUCT_SUPPLY = "PRODUCT_SUPPLY"
|
|
16
|
+
}
|
|
17
|
+
export declare enum IntegrationSyncDirection {
|
|
18
|
+
TECPET = "TECPET",
|
|
19
|
+
EXTERNAL = "EXTERNAL"
|
|
20
|
+
}
|
|
21
|
+
export declare enum IntegrationSyncTrigger {
|
|
22
|
+
WEBHOOK_PUSH = "WEBHOOK_PUSH",
|
|
23
|
+
ERP_CALLBACK = "ERP_CALLBACK",
|
|
24
|
+
MANUAL = "MANUAL",
|
|
25
|
+
CRON = "CRON"
|
|
26
|
+
}
|
|
27
|
+
export interface PaEditIntegrationInvoiceRequest {
|
|
28
|
+
id?: string;
|
|
29
|
+
type: ApiIntegrationType;
|
|
30
|
+
invoiceId: string;
|
|
31
|
+
integrationShopId?: number;
|
|
32
|
+
status?: IntegrationInvoiceStatusType;
|
|
33
|
+
externId?: string;
|
|
34
|
+
externReference?: string;
|
|
35
|
+
nfId?: string;
|
|
36
|
+
reference?: number;
|
|
37
|
+
value?: number;
|
|
38
|
+
errorMessage?: string;
|
|
39
|
+
syncDirection?: IntegrationSyncDirection;
|
|
40
|
+
syncTrigger?: IntegrationSyncTrigger;
|
|
41
|
+
}
|
|
42
|
+
export interface IntegrationInvoiceItemResponse {
|
|
43
|
+
id: string;
|
|
44
|
+
name: string;
|
|
45
|
+
itemType: IntegrationInvoiceItemType;
|
|
46
|
+
value: number;
|
|
47
|
+
quantity?: number;
|
|
48
|
+
unitPrice?: number;
|
|
49
|
+
externalId?: string;
|
|
50
|
+
code?: string;
|
|
51
|
+
lot?: string;
|
|
52
|
+
locationId?: string;
|
|
53
|
+
stockMovementExternalId?: string;
|
|
54
|
+
stockMovementQuantity?: number;
|
|
55
|
+
invoiceItem?: {
|
|
56
|
+
id: string;
|
|
57
|
+
};
|
|
58
|
+
integrationService?: {
|
|
59
|
+
id: number;
|
|
60
|
+
externId?: string;
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
export interface IntegrationInvoiceResponse {
|
|
64
|
+
id: string;
|
|
65
|
+
reference?: number;
|
|
66
|
+
type: ApiIntegrationType;
|
|
67
|
+
status: IntegrationInvoiceStatusType;
|
|
68
|
+
closed: boolean;
|
|
69
|
+
externId?: string;
|
|
70
|
+
externReference?: string;
|
|
71
|
+
nfId?: string;
|
|
72
|
+
value: number;
|
|
73
|
+
clientName?: string;
|
|
74
|
+
errorMessage?: string;
|
|
75
|
+
items?: IntegrationInvoiceItemResponse[];
|
|
76
|
+
lastSyncedAt?: string;
|
|
77
|
+
syncDirection?: IntegrationSyncDirection;
|
|
78
|
+
consecutiveFailures?: number;
|
|
79
|
+
lastSuccessAt?: string;
|
|
80
|
+
lastErrorAt?: string;
|
|
81
|
+
createdAt?: string;
|
|
82
|
+
updatedAt?: string;
|
|
83
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.IntegrationSyncTrigger = exports.IntegrationSyncDirection = exports.IntegrationInvoiceItemType = exports.IntegrationInvoiceStatusType = void 0;
|
|
4
|
+
var IntegrationInvoiceStatusType;
|
|
5
|
+
(function (IntegrationInvoiceStatusType) {
|
|
6
|
+
IntegrationInvoiceStatusType["NONE"] = "NONE";
|
|
7
|
+
IntegrationInvoiceStatusType["PROCESSING"] = "PROCESSING";
|
|
8
|
+
IntegrationInvoiceStatusType["AWAITING_PAYMENT"] = "AWAITING_PAYMENT";
|
|
9
|
+
IntegrationInvoiceStatusType["AWAITING_ISSUE"] = "AWAITING_ISSUE";
|
|
10
|
+
IntegrationInvoiceStatusType["INTEGRATED"] = "INTEGRATED";
|
|
11
|
+
IntegrationInvoiceStatusType["ISSUED"] = "ISSUED";
|
|
12
|
+
IntegrationInvoiceStatusType["CANCELED"] = "CANCELED";
|
|
13
|
+
IntegrationInvoiceStatusType["FAILED"] = "FAILED";
|
|
14
|
+
})(IntegrationInvoiceStatusType || (exports.IntegrationInvoiceStatusType = IntegrationInvoiceStatusType = {}));
|
|
15
|
+
var IntegrationInvoiceItemType;
|
|
16
|
+
(function (IntegrationInvoiceItemType) {
|
|
17
|
+
IntegrationInvoiceItemType["SERVICE"] = "SERVICE";
|
|
18
|
+
IntegrationInvoiceItemType["PRODUCT"] = "PRODUCT";
|
|
19
|
+
IntegrationInvoiceItemType["PRODUCT_SUPPLY"] = "PRODUCT_SUPPLY";
|
|
20
|
+
})(IntegrationInvoiceItemType || (exports.IntegrationInvoiceItemType = IntegrationInvoiceItemType = {}));
|
|
21
|
+
var IntegrationSyncDirection;
|
|
22
|
+
(function (IntegrationSyncDirection) {
|
|
23
|
+
IntegrationSyncDirection["TECPET"] = "TECPET";
|
|
24
|
+
IntegrationSyncDirection["EXTERNAL"] = "EXTERNAL";
|
|
25
|
+
})(IntegrationSyncDirection || (exports.IntegrationSyncDirection = IntegrationSyncDirection = {}));
|
|
26
|
+
var IntegrationSyncTrigger;
|
|
27
|
+
(function (IntegrationSyncTrigger) {
|
|
28
|
+
IntegrationSyncTrigger["WEBHOOK_PUSH"] = "WEBHOOK_PUSH";
|
|
29
|
+
IntegrationSyncTrigger["ERP_CALLBACK"] = "ERP_CALLBACK";
|
|
30
|
+
IntegrationSyncTrigger["MANUAL"] = "MANUAL";
|
|
31
|
+
IntegrationSyncTrigger["CRON"] = "CRON";
|
|
32
|
+
})(IntegrationSyncTrigger || (exports.IntegrationSyncTrigger = IntegrationSyncTrigger = {}));
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export * from './integrationInvoice.service';
|
|
2
|
+
export * from './dto/pa.edit-integration-invoice.dto';
|
|
3
|
+
export * from './dto/pa.set-integration-invoice-item-stock-movement.dto';
|
|
4
|
+
export * from './dto/pa.get-integration-invoice.dto';
|
|
5
|
+
export * from './dto/pa.get-integration-invoice-by-extern-id.dto';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./integrationInvoice.service"), exports);
|
|
18
|
+
__exportStar(require("./dto/pa.edit-integration-invoice.dto"), exports);
|
|
19
|
+
__exportStar(require("./dto/pa.set-integration-invoice-item-stock-movement.dto"), exports);
|
|
20
|
+
__exportStar(require("./dto/pa.get-integration-invoice.dto"), exports);
|
|
21
|
+
__exportStar(require("./dto/pa.get-integration-invoice-by-extern-id.dto"), exports);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { HttpClient } from "../../infra/http/client.http";
|
|
2
|
+
import { IntegrationInvoiceResponse, PaEditIntegrationInvoiceRequest } from "./dto/pa.edit-integration-invoice.dto";
|
|
3
|
+
import { PaSetIntegrationInvoiceItemStockMovementRequest, PaSetIntegrationInvoiceItemStockMovementResponse } from "./dto/pa.set-integration-invoice-item-stock-movement.dto";
|
|
4
|
+
import { PaGetIntegrationInvoiceRequest } from "./dto/pa.get-integration-invoice.dto";
|
|
5
|
+
import { PaGetIntegrationInvoiceByExternIdRequest } from "./dto/pa.get-integration-invoice-by-extern-id.dto";
|
|
6
|
+
export declare class IntegrationInvoiceService {
|
|
7
|
+
private readonly api;
|
|
8
|
+
constructor(api: HttpClient);
|
|
9
|
+
edit(body: PaEditIntegrationInvoiceRequest, shopId: number): Promise<IntegrationInvoiceResponse>;
|
|
10
|
+
get(query: PaGetIntegrationInvoiceRequest, shopId: number): Promise<IntegrationInvoiceResponse[]>;
|
|
11
|
+
getByExternId(query: PaGetIntegrationInvoiceByExternIdRequest, shopId: number): Promise<IntegrationInvoiceResponse[]>;
|
|
12
|
+
setItemStockMovement(itemId: string, body: PaSetIntegrationInvoiceItemStockMovementRequest, shopId: number): Promise<PaSetIntegrationInvoiceItemStockMovementResponse>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.IntegrationInvoiceService = void 0;
|
|
4
|
+
class IntegrationInvoiceService {
|
|
5
|
+
api;
|
|
6
|
+
constructor(api) {
|
|
7
|
+
this.api = api;
|
|
8
|
+
}
|
|
9
|
+
async edit(body, shopId) {
|
|
10
|
+
return await this.api.patch(`/integrationInvoice`, body, shopId);
|
|
11
|
+
}
|
|
12
|
+
async get(query, shopId) {
|
|
13
|
+
return await this.api.get(`/integrationInvoice`, query, shopId);
|
|
14
|
+
}
|
|
15
|
+
async getByExternId(query, shopId) {
|
|
16
|
+
return await this.api.get(`/integrationInvoice/byExternId`, query, shopId);
|
|
17
|
+
}
|
|
18
|
+
async setItemStockMovement(itemId, body, shopId) {
|
|
19
|
+
return await this.api.patch(`/integrationInvoice/items/${itemId}/stockMovement`, body, shopId);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
exports.IntegrationInvoiceService = IntegrationInvoiceService;
|
package/dist/index.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ import { BookingGuardService } from "./domain/bookingGuard/bookingGuard.service"
|
|
|
15
15
|
import { IntegrationShopService } from "./domain/integrationShop/integrationShop.service";
|
|
16
16
|
import { IntegrationClientService } from "./domain/integrationClient/integrationClient.service";
|
|
17
17
|
import { FiscalInvoiceService } from "./domain/fiscalInvoice/fiscalInvoice.service";
|
|
18
|
+
import { IntegrationInvoiceService } from "./domain/integrationInvoice/integrationInvoice.service";
|
|
18
19
|
import { InvoiceService } from "./domain/invoice/invoice.service";
|
|
19
20
|
import { ServiceRecommendationService } from "./domain/serviceRecommendation/serviceRecommendation.service";
|
|
20
21
|
import { BlockedTimeService } from "./domain/blockedTime/blockedTime.service";
|
|
@@ -38,6 +39,7 @@ export declare class TecpetSDK {
|
|
|
38
39
|
integrationShop: IntegrationShopService;
|
|
39
40
|
integrationClient: IntegrationClientService;
|
|
40
41
|
fiscalInvoice: FiscalInvoiceService;
|
|
42
|
+
integrationInvoice: IntegrationInvoiceService;
|
|
41
43
|
invoice: InvoiceService;
|
|
42
44
|
serviceRecommendation: ServiceRecommendationService;
|
|
43
45
|
blockedTime: BlockedTimeService;
|
|
@@ -61,6 +63,7 @@ export * from './domain/token';
|
|
|
61
63
|
export * from './domain/integrationShop';
|
|
62
64
|
export * from './domain/integrationClient';
|
|
63
65
|
export * from './domain/fiscalInvoice';
|
|
66
|
+
export * from './domain/integrationInvoice';
|
|
64
67
|
export * from './domain/invoice';
|
|
65
68
|
export * from './domain/serviceRecommendation';
|
|
66
69
|
export * from './domain/blockedTime';
|
package/dist/index.js
CHANGED
|
@@ -33,6 +33,7 @@ const bookingGuard_service_1 = require("./domain/bookingGuard/bookingGuard.servi
|
|
|
33
33
|
const integrationShop_service_1 = require("./domain/integrationShop/integrationShop.service");
|
|
34
34
|
const integrationClient_service_1 = require("./domain/integrationClient/integrationClient.service");
|
|
35
35
|
const fiscalInvoice_service_1 = require("./domain/fiscalInvoice/fiscalInvoice.service");
|
|
36
|
+
const integrationInvoice_service_1 = require("./domain/integrationInvoice/integrationInvoice.service");
|
|
36
37
|
const invoice_service_1 = require("./domain/invoice/invoice.service");
|
|
37
38
|
const serviceRecommendation_service_1 = require("./domain/serviceRecommendation/serviceRecommendation.service");
|
|
38
39
|
const blockedTime_service_1 = require("./domain/blockedTime/blockedTime.service");
|
|
@@ -56,6 +57,7 @@ class TecpetSDK {
|
|
|
56
57
|
integrationShop;
|
|
57
58
|
integrationClient;
|
|
58
59
|
fiscalInvoice;
|
|
60
|
+
integrationInvoice;
|
|
59
61
|
invoice;
|
|
60
62
|
serviceRecommendation;
|
|
61
63
|
blockedTime;
|
|
@@ -79,6 +81,7 @@ class TecpetSDK {
|
|
|
79
81
|
this.integrationShop = new integrationShop_service_1.IntegrationShopService(this.api);
|
|
80
82
|
this.integrationClient = new integrationClient_service_1.IntegrationClientService(this.api);
|
|
81
83
|
this.fiscalInvoice = new fiscalInvoice_service_1.FiscalInvoiceService(this.api);
|
|
84
|
+
this.integrationInvoice = new integrationInvoice_service_1.IntegrationInvoiceService(this.api);
|
|
82
85
|
this.invoice = new invoice_service_1.InvoiceService(this.api);
|
|
83
86
|
this.serviceRecommendation = new serviceRecommendation_service_1.ServiceRecommendationService(this.api);
|
|
84
87
|
this.blockedTime = new blockedTime_service_1.BlockedTimeService(this.api);
|
|
@@ -103,6 +106,7 @@ __exportStar(require("./domain/token"), exports);
|
|
|
103
106
|
__exportStar(require("./domain/integrationShop"), exports);
|
|
104
107
|
__exportStar(require("./domain/integrationClient"), exports);
|
|
105
108
|
__exportStar(require("./domain/fiscalInvoice"), exports);
|
|
109
|
+
__exportStar(require("./domain/integrationInvoice"), exports);
|
|
106
110
|
__exportStar(require("./domain/invoice"), exports);
|
|
107
111
|
__exportStar(require("./domain/serviceRecommendation"), exports);
|
|
108
112
|
__exportStar(require("./domain/blockedTime"), exports);
|