@tec.pet/tecpet-sdk 0.0.206 → 0.0.207
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/petPlan/dto/pa.get-pet-plans.dto.d.ts +10 -0
- package/dist/domain/petPlan/index.d.ts +1 -0
- package/dist/domain/petPlan/index.js +1 -0
- package/dist/domain/petPlan/petPlan.service.d.ts +11 -0
- package/dist/domain/petPlan/petPlan.service.js +18 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +3 -0
- package/package.json +1 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ShopSegment } from '../../segment/enum/segment.enum';
|
|
2
|
+
import { IPaginationGeneric, IPaginationResponse } from '../../types/pagination.types';
|
|
2
3
|
export interface PaPetPlanPlanResponse {
|
|
3
4
|
id: number;
|
|
4
5
|
name: string;
|
|
@@ -48,7 +49,16 @@ export interface PaPetPlanResponse {
|
|
|
48
49
|
partialPrice: number;
|
|
49
50
|
invoices?: Array<PaPetPlanInvoiceResponse>;
|
|
50
51
|
}
|
|
52
|
+
export interface PaGetPetPlansQuery extends IPaginationGeneric {
|
|
53
|
+
clientId?: number;
|
|
54
|
+
petId?: number;
|
|
55
|
+
/** Status efetivo do plano (derivado das faturas). */
|
|
56
|
+
status?: PetPlanStatus[];
|
|
57
|
+
/** Apenas planos com `endDate` de hoje em diante. */
|
|
58
|
+
vigente?: boolean;
|
|
59
|
+
}
|
|
51
60
|
export interface PaGetPetPlansResponse {
|
|
52
61
|
list: Array<PaPetPlanResponse>;
|
|
53
62
|
count: number;
|
|
63
|
+
pagination?: IPaginationResponse;
|
|
54
64
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { HttpClient } from "../../infra/http/client.http";
|
|
2
|
+
import { PaGetPetPlansQuery, PaPetPlanResponse } from "./dto/pa.get-pet-plans.dto";
|
|
3
|
+
export declare class PetPlanService {
|
|
4
|
+
private readonly api;
|
|
5
|
+
constructor(api: HttpClient);
|
|
6
|
+
/**
|
|
7
|
+
* Lista os planos do pet na loja. Cada plano traz só a fatura atual, com o
|
|
8
|
+
* controle de uso (`quantity`/`used`) de cada serviço.
|
|
9
|
+
*/
|
|
10
|
+
list(query: PaGetPetPlansQuery, shopId: number): Promise<Array<PaPetPlanResponse>>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PetPlanService = void 0;
|
|
4
|
+
class PetPlanService {
|
|
5
|
+
api;
|
|
6
|
+
constructor(api) {
|
|
7
|
+
this.api = api;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Lista os planos do pet na loja. Cada plano traz só a fatura atual, com o
|
|
11
|
+
* controle de uso (`quantity`/`used`) de cada serviço.
|
|
12
|
+
*/
|
|
13
|
+
async list(query, shopId) {
|
|
14
|
+
const response = await this.api.get(`/pet-plan`, query, shopId);
|
|
15
|
+
return response?.list ?? [];
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
exports.PetPlanService = PetPlanService;
|
package/dist/index.d.ts
CHANGED
|
@@ -26,6 +26,7 @@ import { ServiceCapacityService } from "./domain/serviceCapacity/serviceCapacity
|
|
|
26
26
|
import { WhatsappEventService } from "./domain/whatsappEvent/whatsappEvent.service";
|
|
27
27
|
import { AISettingsService } from "./domain/aiSettings/aiSettings.service";
|
|
28
28
|
import { CampaignService } from "./domain/campaign/campaign.service";
|
|
29
|
+
import { PetPlanService } from "./domain/petPlan/petPlan.service";
|
|
29
30
|
export declare class TecpetSDK {
|
|
30
31
|
private api;
|
|
31
32
|
client: ClientService;
|
|
@@ -56,6 +57,7 @@ export declare class TecpetSDK {
|
|
|
56
57
|
whatsappEvent: WhatsappEventService;
|
|
57
58
|
aiSettings: AISettingsService;
|
|
58
59
|
campaign: CampaignService;
|
|
60
|
+
petPlan: PetPlanService;
|
|
59
61
|
constructor(baseURL: string, apiKey?: string);
|
|
60
62
|
}
|
|
61
63
|
export * from './domain/availableTimes';
|
package/dist/index.js
CHANGED
|
@@ -44,6 +44,7 @@ const serviceCapacity_service_1 = require("./domain/serviceCapacity/serviceCapac
|
|
|
44
44
|
const whatsappEvent_service_1 = require("./domain/whatsappEvent/whatsappEvent.service");
|
|
45
45
|
const aiSettings_service_1 = require("./domain/aiSettings/aiSettings.service");
|
|
46
46
|
const campaign_service_1 = require("./domain/campaign/campaign.service");
|
|
47
|
+
const petPlan_service_1 = require("./domain/petPlan/petPlan.service");
|
|
47
48
|
class TecpetSDK {
|
|
48
49
|
api;
|
|
49
50
|
client;
|
|
@@ -74,6 +75,7 @@ class TecpetSDK {
|
|
|
74
75
|
whatsappEvent;
|
|
75
76
|
aiSettings;
|
|
76
77
|
campaign;
|
|
78
|
+
petPlan;
|
|
77
79
|
constructor(baseURL, apiKey) {
|
|
78
80
|
this.api = new client_http_1.HttpClient(baseURL, apiKey);
|
|
79
81
|
this.client = new client_service_1.ClientService(this.api);
|
|
@@ -104,6 +106,7 @@ class TecpetSDK {
|
|
|
104
106
|
this.whatsappEvent = new whatsappEvent_service_1.WhatsappEventService(this.api);
|
|
105
107
|
this.aiSettings = new aiSettings_service_1.AISettingsService(this.api);
|
|
106
108
|
this.campaign = new campaign_service_1.CampaignService(this.api);
|
|
109
|
+
this.petPlan = new petPlan_service_1.PetPlanService(this.api);
|
|
107
110
|
}
|
|
108
111
|
}
|
|
109
112
|
exports.TecpetSDK = TecpetSDK;
|