@tec.pet/tecpet-sdk 0.0.213 → 0.0.215
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/employee/dto/pa.employee-allocation.dto.d.ts +15 -0
- package/dist/domain/employee/dto/pa.employee-allocation.dto.js +2 -0
- package/dist/domain/employee/dto/pa.employee-availability.dto.d.ts +19 -0
- package/dist/domain/employee/dto/pa.employee-availability.dto.js +2 -0
- package/dist/domain/employee/employee.service.d.ts +4 -0
- package/dist/domain/employee/employee.service.js +14 -0
- package/dist/domain/employee/index.d.ts +2 -0
- package/dist/domain/employee/index.js +2 -0
- package/dist/domain/integrationShop/dto/pa.edit-integration-shop.dto.d.ts +2 -0
- package/dist/domain/invoice/dto/pa.register-invoice-pdv-payment.dto.d.ts +1 -0
- package/dist/domain/invoice/invoice.service.d.ts +1 -1
- package/dist/domain/invoice/invoice.service.js +3 -2
- package/package.json +1 -1
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface PaGetEmployeesAllocationBody {
|
|
2
|
+
timeIds: Array<string>;
|
|
3
|
+
}
|
|
4
|
+
export interface PaTimeAllocationEmployeeResponse {
|
|
5
|
+
id: number;
|
|
6
|
+
name: string;
|
|
7
|
+
serviceIds: Array<number>;
|
|
8
|
+
}
|
|
9
|
+
export interface PaTimeAllocationResponse {
|
|
10
|
+
timeId: string;
|
|
11
|
+
employees: PaTimeAllocationEmployeeResponse[];
|
|
12
|
+
}
|
|
13
|
+
export interface PaGetEmployeesAllocationResponse {
|
|
14
|
+
data: PaTimeAllocationResponse[];
|
|
15
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ShopSegment } from "../../segment/enum/segment.enum";
|
|
2
|
+
export interface PaGetEmployeesAvailabilityBody {
|
|
3
|
+
date: string;
|
|
4
|
+
days?: number;
|
|
5
|
+
petId: number;
|
|
6
|
+
services: Array<number>;
|
|
7
|
+
segment: ShopSegment;
|
|
8
|
+
intervalMinutes?: number;
|
|
9
|
+
minAdvanceMinutes?: number;
|
|
10
|
+
}
|
|
11
|
+
export interface PaEmployeeAvailabilityResponse {
|
|
12
|
+
id: number;
|
|
13
|
+
name: string;
|
|
14
|
+
serviceCategoryIds: Array<number>;
|
|
15
|
+
firstAvailableDate: string | null;
|
|
16
|
+
}
|
|
17
|
+
export interface PaGetEmployeesAvailabilityResponse {
|
|
18
|
+
data: PaEmployeeAvailabilityResponse[];
|
|
19
|
+
}
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import { HttpClient } from "infra/http/client.http";
|
|
2
|
+
import { PaGetEmployeesAllocationBody, PaTimeAllocationResponse } from "./dto/pa.employee-allocation.dto";
|
|
3
|
+
import { PaEmployeeAvailabilityResponse, PaGetEmployeesAvailabilityBody } from "./dto/pa.employee-availability.dto";
|
|
2
4
|
import { PaEmployeeFilter } from "./dto/pa.employee-filter.dto";
|
|
3
5
|
import { PaEmployeeResponse } from "./dto/pa.get-employee.dto";
|
|
4
6
|
export declare class EmployeeService {
|
|
5
7
|
private readonly api;
|
|
6
8
|
constructor(api: HttpClient);
|
|
7
9
|
getEmployeesByServiceCategory(filter: PaEmployeeFilter, shopId: number): Promise<PaEmployeeResponse[]>;
|
|
10
|
+
getAvailability(body: PaGetEmployeesAvailabilityBody, shopId: number): Promise<PaEmployeeAvailabilityResponse[]>;
|
|
11
|
+
getAllocation(body: PaGetEmployeesAllocationBody, shopId: number): Promise<PaTimeAllocationResponse[]>;
|
|
8
12
|
}
|
|
@@ -16,5 +16,19 @@ class EmployeeService {
|
|
|
16
16
|
}
|
|
17
17
|
return response.data;
|
|
18
18
|
}
|
|
19
|
+
async getAvailability(body, shopId) {
|
|
20
|
+
const response = await this.api.post(`/employee/availability`, body, shopId);
|
|
21
|
+
if (!response || !Array.isArray(response.data)) {
|
|
22
|
+
throw new Error(`Invalid response from /employee/availability: ${JSON.stringify(response)}`);
|
|
23
|
+
}
|
|
24
|
+
return response.data;
|
|
25
|
+
}
|
|
26
|
+
async getAllocation(body, shopId) {
|
|
27
|
+
const response = await this.api.post(`/employee/allocation`, body, shopId);
|
|
28
|
+
if (!response || !Array.isArray(response.data)) {
|
|
29
|
+
throw new Error(`Invalid response from /employee/allocation: ${JSON.stringify(response)}`);
|
|
30
|
+
}
|
|
31
|
+
return response.data;
|
|
32
|
+
}
|
|
19
33
|
}
|
|
20
34
|
exports.EmployeeService = EmployeeService;
|
|
@@ -17,3 +17,5 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
__exportStar(require("./dto/pa.employee-filter.dto"), exports);
|
|
18
18
|
__exportStar(require("./dto/pa.get-employee.dto"), exports);
|
|
19
19
|
__exportStar(require("./dto/pa-timetable.dto"), exports);
|
|
20
|
+
__exportStar(require("./dto/pa.employee-availability.dto"), exports);
|
|
21
|
+
__exportStar(require("./dto/pa.employee-allocation.dto"), exports);
|
|
@@ -46,6 +46,7 @@ export interface PaEditIntegrationShopRequest {
|
|
|
46
46
|
configurableChoices?: any;
|
|
47
47
|
features?: PaIntegrationShopFeatures;
|
|
48
48
|
invoiceArchitecture?: IntegrationInvoiceArchitecture;
|
|
49
|
+
pdvPayment?: boolean;
|
|
49
50
|
}
|
|
50
51
|
export interface PaEditIntegrationShopResponse {
|
|
51
52
|
id: number;
|
|
@@ -60,6 +61,7 @@ export interface PaEditIntegrationShopResponse {
|
|
|
60
61
|
configurableChoices?: any;
|
|
61
62
|
features?: PaIntegrationShopFeatures;
|
|
62
63
|
invoiceArchitecture?: IntegrationInvoiceArchitecture;
|
|
64
|
+
pdvPayment?: boolean;
|
|
63
65
|
shop: {
|
|
64
66
|
id: number;
|
|
65
67
|
};
|
|
@@ -8,7 +8,7 @@ export declare class InvoiceService {
|
|
|
8
8
|
constructor(api: HttpClient);
|
|
9
9
|
editExternId(invoiceId: string, body: PaEditInvoiceExternIdRequest, shopId: number): Promise<PaEditInvoiceExternIdResponse>;
|
|
10
10
|
registerPdvPayment(invoiceId: string, fiscalInvoiceId: string): Promise<PaRegisterInvoicePdvPaymentResponse>;
|
|
11
|
-
registerPdvPartialPayment(invoiceId: string, fiscalInvoiceIds: string[], amount: number): Promise<PaRegisterInvoicePdvPaymentResponse>;
|
|
11
|
+
registerPdvPartialPayment(invoiceId: string, fiscalInvoiceIds: string[], amount: number, externalPaymentId?: string): Promise<PaRegisterInvoicePdvPaymentResponse>;
|
|
12
12
|
registerReceivablePayment(invoiceId: string, fiscalInvoiceId: string, body: PaRegisterInvoiceReceivablePaymentRequest): Promise<PaRegisterInvoiceReceivablePaymentResponse>;
|
|
13
13
|
reverseReceivablePayment(externalId: string, body: PaReverseInvoiceReceivablePaymentRequest): Promise<PaReverseInvoiceReceivablePaymentResponse>;
|
|
14
14
|
}
|
|
@@ -12,8 +12,9 @@ class InvoiceService {
|
|
|
12
12
|
async registerPdvPayment(invoiceId, fiscalInvoiceId) {
|
|
13
13
|
return await this.api.post(`/invoice/${invoiceId}/pdvPay/${fiscalInvoiceId}`, {});
|
|
14
14
|
}
|
|
15
|
-
async registerPdvPartialPayment(invoiceId, fiscalInvoiceIds, amount) {
|
|
16
|
-
|
|
15
|
+
async registerPdvPartialPayment(invoiceId, fiscalInvoiceIds, amount, externalPaymentId) {
|
|
16
|
+
const body = externalPaymentId ? { fiscalInvoiceIds, amount, externalPaymentId } : { fiscalInvoiceIds, amount };
|
|
17
|
+
return await this.api.post(`/invoice/${invoiceId}/pdvPayPartial`, body);
|
|
17
18
|
}
|
|
18
19
|
async registerReceivablePayment(invoiceId, fiscalInvoiceId, body) {
|
|
19
20
|
return await this.api.post(`/invoice/${invoiceId}/receivablePay/${fiscalInvoiceId}`, body);
|