@tec.pet/tecpet-sdk 0.0.36 → 0.0.37

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.
Files changed (94) hide show
  1. package/dist/domain/breed/breed.service.js +0 -2
  2. package/dist/domain/client/client.service.js +3 -6
  3. package/package.json +4 -1
  4. package/.github/workflows/main.yml +0 -152
  5. package/changelog.md +0 -2
  6. package/jest.config.js +0 -14
  7. package/src/domain/availableTimes/availableTimes.service.ts +0 -23
  8. package/src/domain/availableTimes/dto/pa.get-available-time.dto.ts +0 -5
  9. package/src/domain/availableTimes/dto/pa.get-available-times.dto.ts +0 -9
  10. package/src/domain/availableTimes/index.ts +0 -3
  11. package/src/domain/billingMethod/billingMethod.service.ts +0 -20
  12. package/src/domain/billingMethod/dto/pa.get-billing-methods.dto.ts +0 -22
  13. package/src/domain/billingMethod/enum/billing-method-type.enum.ts +0 -14
  14. package/src/domain/billingMethod/index.ts +0 -3
  15. package/src/domain/booking/booking.service.ts +0 -35
  16. package/src/domain/booking/dto/pa.change-booking-status.dto.ts +0 -13
  17. package/src/domain/booking/dto/pa.create-booking.dto.ts +0 -13
  18. package/src/domain/booking/dto/pa.get-booking.dto.ts +0 -19
  19. package/src/domain/booking/dto/pa.get-bookings.dto.ts +0 -11
  20. package/src/domain/booking/index.ts +0 -3
  21. package/src/domain/breed/breed.service.ts +0 -23
  22. package/src/domain/breed/dto/pa.get-breed.dto.ts +0 -11
  23. package/src/domain/breed/dto/pa.get-breeds.dto.ts +0 -8
  24. package/src/domain/breed/index.ts +0 -3
  25. package/src/domain/chatbot/chatbotService.ts +0 -49
  26. package/src/domain/chatbot/dto/chatbot-settings.json.ts +0 -254
  27. package/src/domain/chatbot/dto/get-chatbot-formatted-messages.dto.ts +0 -20
  28. package/src/domain/chatbot/dto/pa.change-notification-status.dto.ts +0 -19
  29. package/src/domain/chatbot/dto/pa.handle-button-action.dto.ts +0 -13
  30. package/src/domain/chatbot/enum/chatbotActionEnums/chatbot-action-mode-type.enum.ts +0 -5
  31. package/src/domain/chatbot/enum/chatbotActionEnums/chatbot-action-schedule-permission.enum.ts +0 -5
  32. package/src/domain/chatbot/enum/chatbotActionEnums/chatbot-action-type.enum.ts +0 -9
  33. package/src/domain/chatbot/enum/chatbotActionEnums/media-type.enum.ts +0 -5
  34. package/src/domain/chatbot/enum/chatbotBehaviorEnums/chatbot-behavior-type.enum.ts +0 -4
  35. package/src/domain/chatbot/enum/chatbotBehaviorEnums/chatbot-inactive-employee-action.enum.ts +0 -4
  36. package/src/domain/chatbot/enum/chatbotBehaviorEnums/chatbot-timeout-action.enum.ts +0 -5
  37. package/src/domain/chatbot/enum/chatbotFluxEnums/chatbot-flux-type.enum.ts +0 -10
  38. package/src/domain/chatbot/enum/chatbotGuidanceEnums/chatbot-action-button-type.enum.ts +0 -12
  39. package/src/domain/chatbot/enum/chatbotInfoCollectionEnums/chatbot-info-collection-subtype.enum.ts +0 -32
  40. package/src/domain/chatbot/enum/chatbotInfoCollectionEnums/chatbot-info-collection-type.enum.ts +0 -12
  41. package/src/domain/chatbot/enum/chatbotInfoCollectionEnums/chatbot-price-display-mode.enum.ts +0 -5
  42. package/src/domain/chatbot/enum/chatbotInfoCollectionEnums/chatbot-size_display-mode.enum.ts +0 -5
  43. package/src/domain/chatbot/enum/chatbotInfoCollectionEnums/chatbot-time-display-mode.enum.ts +0 -5
  44. package/src/domain/chatbot/enum/chatbotInfoCollectionEnums/chatbot-time-selection-behavior.enum.ts +0 -4
  45. package/src/domain/chatbot/enum/chatbotSendingInfoItemEnums/chatbot-sending-info-item-type.enum.ts +0 -7
  46. package/src/domain/chatbot/enum/chatbotSettingsEnums/chatbot-ai-voice.enum.ts +0 -4
  47. package/src/domain/chatbot/enum/chatbotSettingsEnums/chatbot-channel-type.enum.ts +0 -3
  48. package/src/domain/chatbot/enum/chatbotSettingsEnums/chatbot-mode.enum.ts +0 -5
  49. package/src/domain/chatbot/enum/chatbotSettingsEnums/chatbot-platform-type.enum.ts +0 -4
  50. package/src/domain/chatbot/enum/chatbotSettingsEnums/chatbot-settings-ai-personality.enum.ts +0 -10
  51. package/src/domain/chatbot/enum/chatbotTriggerEnums/chatbot-trigger-pattern-type.enum.ts +0 -4
  52. package/src/domain/chatbot/index.ts +0 -10
  53. package/src/domain/client/client.service.ts +0 -40
  54. package/src/domain/client/dto/pa.create-client.dto.ts +0 -11
  55. package/src/domain/client/dto/pa.edit-client.dto.ts +0 -11
  56. package/src/domain/client/dto/pa.get-client-summary.dto.ts +0 -11
  57. package/src/domain/client/dto/pa.get-client.dto.ts +0 -20
  58. package/src/domain/client/dto/pa.get-clients.dto.ts +0 -11
  59. package/src/domain/client/index.ts +0 -5
  60. package/src/domain/combo/combo.service.ts +0 -20
  61. package/src/domain/combo/dto/pa.get-combo-pricing.dto.ts +0 -13
  62. package/src/domain/combo/index.ts +0 -2
  63. package/src/domain/employee/dto/pa.employee-filter.dto.ts +0 -4
  64. package/src/domain/employee/dto/pa.get-employee.dto.ts +0 -18
  65. package/src/domain/employee/employee.service.ts +0 -19
  66. package/src/domain/employee/index.ts +0 -3
  67. package/src/domain/pet/dto/pa.create-pet.dto.ts +0 -13
  68. package/src/domain/pet/dto/pa.edit-pet.dto.ts +0 -15
  69. package/src/domain/pet/dto/pa.get-pet-activity.dto.ts +0 -5
  70. package/src/domain/pet/dto/pa.get-pet.dto.ts +0 -23
  71. package/src/domain/pet/dto/pa.get-pets.dto.ts +0 -8
  72. package/src/domain/pet/index.ts +0 -5
  73. package/src/domain/pet/pet.service.ts +0 -36
  74. package/src/domain/segment/enum/segment.enum.ts +0 -6
  75. package/src/domain/service/dto/pa.get-service-pricing.dto.ts +0 -35
  76. package/src/domain/service/index.ts +0 -2
  77. package/src/domain/service/service.service.ts +0 -20
  78. package/src/domain/shop/dto/pa.get-shop-configurations.dto.ts +0 -92
  79. package/src/domain/shop/index.ts +0 -6
  80. package/src/domain/shop/shop.service.ts +0 -15
  81. package/src/domain/specie/dto/pa.get-specie.dto.ts +0 -7
  82. package/src/domain/specie/dto/pa.get-species.dto.ts +0 -7
  83. package/src/domain/specie/enum/specie-type.enum.ts +0 -21
  84. package/src/domain/specie/index.ts +0 -5
  85. package/src/domain/specie/specie.service.ts +0 -18
  86. package/src/domain/token/dto/pa.extract-token.dto.ts +0 -4
  87. package/src/domain/token/index.ts +0 -1
  88. package/src/domain/token/token.service.ts +0 -15
  89. package/src/domain/types/pagination.types.ts +0 -10
  90. package/src/index.ts +0 -66
  91. package/src/infra/http/client.http.ts +0 -91
  92. package/src/infra/logger/logger.interface.ts +0 -7
  93. package/src/infra/logger/stdout.logger.ts +0 -85
  94. package/tsconfig.json +0 -17
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.BreedService = void 0;
4
- const stdout_logger_1 = require("../../infra/logger/stdout.logger");
5
4
  class BreedService {
6
5
  api;
7
6
  constructor(api) {
@@ -13,7 +12,6 @@ class BreedService {
13
12
  delete params.name;
14
13
  }
15
14
  const response = await this.api.get(`/breed`, params, shopId);
16
- stdout_logger_1.logger.debug(BreedService.name, JSON.stringify(response, null, 2));
17
15
  if (response?.data?.length) {
18
16
  return response.data;
19
17
  }
@@ -15,16 +15,13 @@ class ClientService {
15
15
  return response.data[0];
16
16
  }
17
17
  async edit(clientId, body, shopId) {
18
- const response = await this.api.put(`/client/${clientId}`, body, shopId);
19
- return response;
18
+ return await this.api.put(`/client/${clientId}`, body, shopId);
20
19
  }
21
20
  async create(body, shopId) {
22
- const response = await this.api.post(`/client`, body, shopId);
23
- return response;
21
+ return await this.api.post(`/client`, body, shopId);
24
22
  }
25
23
  async summary(clientId, shopId) {
26
- const response = await this.api.get(`/client/${clientId}/summary`, {}, shopId);
27
- return response;
24
+ return await this.api.get(`/client/${clientId}/summary`, {}, shopId);
28
25
  }
29
26
  }
30
27
  exports.ClientService = ClientService;
package/package.json CHANGED
@@ -1,12 +1,15 @@
1
1
  {
2
2
  "name": "@tec.pet/tecpet-sdk",
3
- "version": "0.0.36",
3
+ "version": "0.0.37",
4
4
  "description": "TecPet SDK for integration with TecPet services",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "exports": {
8
8
  ".": "./dist/index.js"
9
9
  },
10
+ "files": [
11
+ "dist"
12
+ ],
10
13
  "repository": {
11
14
  "type": "git",
12
15
  "url": "git+https://github.com/tecpet/tecpet-sdk.git"
@@ -1,152 +0,0 @@
1
- name: Publicar Release Automática
2
-
3
- on:
4
- push:
5
- branches:
6
- - main
7
-
8
- jobs:
9
- release:
10
- name: Criar nova versão e release
11
- runs-on: ubuntu-latest
12
-
13
- steps:
14
- - name: 🔄 Checkout do repositório
15
- uses: actions/checkout@v4
16
- with:
17
- fetch-depth: 0
18
-
19
- - name: 🔧 Usar Node.js 23
20
- uses: actions/setup-node@v4
21
- with:
22
- node-version: 23
23
-
24
- - name: 📦 Cache de dependências Yarn
25
- uses: actions/cache@v4
26
- with:
27
- path: |
28
- node_modules
29
- ~/.cache/yarn
30
- key: yarn-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
31
- restore-keys: |
32
- yarn-${{ runner.os }}-
33
-
34
- - name: 🚨 Fallback para npm registry
35
- run: yarn config set registry https://registry.npmjs.org
36
-
37
- - name: 🧪 Instalar dependências
38
- run: yarn install --frozen-lockfile
39
-
40
- - name: 🏗️ Build do projeto
41
- run: yarn build
42
-
43
- - name: 🧠 Configurar Git
44
- run: |
45
- git config user.name "github-actions[bot]"
46
- git config user.email "github-actions[bot]@users.noreply.github.com"
47
-
48
- - name: 🔍 Verificar se há mudanças desde a última tag
49
- id: check-changes
50
- run: |
51
- LAST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "")
52
- if [ -n "$LAST_TAG" ]; then
53
- CHANGES=$(git log "$LAST_TAG"..HEAD --oneline | wc -l)
54
- if [ "$CHANGES" -eq 0 ]; then
55
- echo "No changes since last tag. Skipping release."
56
- echo "skip=true" >> $GITHUB_OUTPUT
57
- exit 0
58
- fi
59
- fi
60
- echo "skip=false" >> $GITHUB_OUTPUT
61
-
62
- - name: 🆙 Incrementar versão (patch)
63
- if: steps.check-changes.outputs.skip == 'false'
64
- run: |
65
- yarn version --patch --no-git-tag-version
66
- VERSION=$(node -p "require('./package.json').version")
67
- echo "NEW_VERSION=$VERSION" >> $GITHUB_ENV
68
- echo "Nova versão: $VERSION"
69
-
70
- - name: 📜 Gerar changelog com commits desde última tag
71
- if: steps.check-changes.outputs.skip == 'false'
72
- id: changelog
73
- run: |
74
- LAST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "")
75
- echo "📦 Última tag: $LAST_TAG"
76
-
77
- if [ -z "$LAST_TAG" ]; then
78
- echo "🎉 Release inicial" > changelog.md
79
- git log --pretty=format:"- %s (%h)" --no-merges >> changelog.md
80
- else
81
- echo "🚀 Alterações desde $LAST_TAG:" > changelog.md
82
- git log "$LAST_TAG"..HEAD --pretty=format:"- %s (%h)" --no-merges >> changelog.md
83
- fi
84
-
85
- # Verificar se há conteúdo no changelog
86
- if [ ! -s changelog.md ]; then
87
- echo "- Melhorias e correções diversas" > changelog.md
88
- fi
89
-
90
- - name: 🏷️ Commit e criar tag (sem dist)
91
- if: steps.check-changes.outputs.skip == 'false'
92
- run: |
93
- # Apenas adicionar package.json (sem dist)
94
- git add package.json
95
- git commit -m "chore: release v$NEW_VERSION"
96
- TAG_NAME="v$NEW_VERSION"
97
-
98
- # Verificar se a tag já existe e deletá-la se necessário
99
- if git tag -l | grep -q "^$TAG_NAME$"; then
100
- echo "⚠️ Tag $TAG_NAME já existe. Deletando tag local..."
101
- git tag -d "$TAG_NAME"
102
-
103
- # Verificar se existe no remoto e deletar se necessário
104
- if git ls-remote --tags origin | grep -q "refs/tags/$TAG_NAME$"; then
105
- echo "⚠️ Tag $TAG_NAME existe no remoto. Deletando..."
106
- git push origin :refs/tags/"$TAG_NAME"
107
- fi
108
- fi
109
-
110
- git tag "$TAG_NAME"
111
- echo "TAG_NAME=$TAG_NAME" >> $GITHUB_ENV
112
- echo "✅ Tag $TAG_NAME criada (sem dist)"
113
-
114
- # Push da branch e tags
115
- git push origin main --follow-tags
116
- echo "✅ Tag $TAG_NAME enviada para o remoto"
117
-
118
- - name: 📦 Configurar autenticação NPM
119
- if: steps.check-changes.outputs.skip == 'false'
120
- run: |
121
- echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > .npmrc
122
- echo "registry=https://registry.npmjs.org/" >> .npmrc
123
-
124
- - name: 🚀 Publicar no NPM
125
- if: steps.check-changes.outputs.skip == 'false'
126
- run: |
127
- # Verificar se dist existe após build
128
- if [ ! -d "dist" ]; then
129
- echo "❌ Diretório dist não encontrado!"
130
- exit 1
131
- fi
132
-
133
- echo "📁 Conteúdo do dist:"
134
- ls -la dist/
135
-
136
- # Publicar no NPM público
137
- npm publish
138
- echo "✅ Package publicado no NPM: @tec.pet/tecpet-sdk@$NEW_VERSION"
139
- echo "📦 Instalar com: npm install @tec.pet/tecpet-sdk"
140
- echo "🌍 Disponível publicamente no NPM"
141
-
142
- - name: 🚀 Criar release no GitHub
143
- if: steps.check-changes.outputs.skip == 'false'
144
- uses: softprops/action-gh-release@v2
145
- with:
146
- tag_name: ${{ env.TAG_NAME }}
147
- name: 🎉 Release ${{ env.TAG_NAME }}
148
- body_path: changelog.md
149
- draft: false
150
- prerelease: false
151
- env:
152
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
package/changelog.md DELETED
@@ -1,2 +0,0 @@
1
- 🚀 Alterações desde v0.0.35:
2
- - tp-889: Add new dtos to employee (c7b0e6a)
package/jest.config.js DELETED
@@ -1,14 +0,0 @@
1
- module.exports = {
2
- preset: 'ts-jest',
3
- testEnvironment: 'node',
4
- moduleFileExtensions: ['ts', 'tsx', 'js'],
5
- transform: {
6
- '^.+\\.(ts|tsx)$': 'ts-jest',
7
- },
8
- moduleNameMapper: {
9
- "^@tecpet-sdk/(.*)$": "<rootDir>/src/$1",
10
- },
11
- transformIgnorePatterns: [
12
- '/node_modules/(?!chalk).+\\.js$',
13
- ],
14
- };
@@ -1,23 +0,0 @@
1
- import { HttpClient } from "infra/http/client.http";
2
- import { PaGetAvailableTimesResponse } from "./dto/pa.get-available-time.dto";
3
- import { PaGetAvailableTimesTimesBody } from "./dto/pa.get-available-times.dto";
4
-
5
- export class AvailableTimesService {
6
- constructor(private readonly api: HttpClient) {
7
- }
8
-
9
- async list(body: PaGetAvailableTimesTimesBody, shopId: number): Promise<Array<PaGetAvailableTimesResponse>> {
10
- try {
11
- const response = await this.api.post<Array<PaGetAvailableTimesResponse>>(`/availableTimes`, body, shopId)
12
- if (response && response?.length) {
13
- return response;
14
- }
15
- return [];
16
- } catch (error: any) {
17
- if (error.message.includes('CLOSED_DAY')) {
18
- return []
19
- }
20
- throw error
21
- }
22
- }
23
- }
@@ -1,5 +0,0 @@
1
- export interface PaGetAvailableTimesResponse {
2
- id: string;
3
- start: string;
4
- stop: string;
5
- }
@@ -1,9 +0,0 @@
1
- import {ShopSegment} from "../../segment/enum/segment.enum";
2
-
3
- export interface PaGetAvailableTimesTimesBody {
4
- date?: string;
5
- petId: number;
6
- services: Array<number>;
7
- combos: Array<number>;
8
- segment: ShopSegment;
9
- }
@@ -1,3 +0,0 @@
1
- export * from './dto/pa.get-available-time.dto';
2
- export * from './dto/pa.get-available-times.dto';
3
-
@@ -1,20 +0,0 @@
1
- import { HttpClient } from "infra/http/client.http";
2
- import { logger } from "../../infra/logger/stdout.logger";
3
- import { ShopSegment } from "../segment/enum/segment.enum";
4
- import { PaBillingResponse, PaGetBillingMethodResponse } from "./dto/pa.get-billing-methods.dto";
5
-
6
- export class BillingMethodService {
7
- constructor(private readonly api: HttpClient) {
8
- }
9
-
10
- async list(segmentType: ShopSegment, shopId: number): Promise<Array<PaBillingResponse>> {
11
- const response = await this.api.get<PaGetBillingMethodResponse>(`/billingMethod`, {
12
- segmentType,
13
- }, shopId)
14
- if (response && response.data?.length) {
15
- logger.debug(BillingMethodService.name, JSON.stringify(response, null, 2));
16
- return response.data;
17
- }
18
- return [];
19
- }
20
- }
@@ -1,22 +0,0 @@
1
- import {IPaginationResponse} from "../../types/pagination.types";
2
- import {BillingMethodType} from "../enum/billing-method-type.enum";
3
- import {ShopSegment} from "../../segment/enum/segment.enum";
4
-
5
- export interface BillingItem {
6
- tag: string;
7
- name: string;
8
- min: number;
9
- max: number;
10
- }
11
-
12
- export interface PaBillingResponse {
13
- name: string;
14
- tag: BillingMethodType;
15
- billingItems: BillingItem[];
16
- segmentType: ShopSegment;
17
- }
18
-
19
- export interface PaGetBillingMethodResponse {
20
- data: PaBillingResponse[];
21
- pagination: IPaginationResponse;
22
- }
@@ -1,14 +0,0 @@
1
- export enum BillingMethodType {
2
- SIZE = 'SIZE',
3
- HAIR = 'HAIR',
4
- }
5
-
6
- export enum BillingItemType {
7
- MICRO = "MICRO",
8
- SMALL = "SMALL",
9
- MEDIUM = "MEDIUM",
10
- BIG = "BIG",
11
- SUPERBIG = "SUPERBIG",
12
- SHORT = "SHORT",
13
- LONG = "LONG",
14
- }
@@ -1,3 +0,0 @@
1
- export * from './dto/pa.get-billing-methods.dto';
2
- export * from './enum/billing-method-type.enum';
3
-
@@ -1,35 +0,0 @@
1
- import { HttpClient } from "infra/http/client.http";
2
- import { PaChangeBookingStatusInput, PaChangeBookingStatusResponse } from "./dto/pa.change-booking-status.dto";
3
- import { PaCreateBookingInput } from "./dto/pa.create-booking.dto";
4
- import { PaGetBookingResponse } from "./dto/pa.get-booking.dto";
5
- import { PaGetBookingsQuery, PaGetBookingsResponse } from "./dto/pa.get-bookings.dto";
6
-
7
- export class BookingService {
8
- constructor(private readonly api: HttpClient) {
9
- }
10
-
11
- async list(query: PaGetBookingsQuery, shopId: number): Promise<Array<PaGetBookingResponse>> {
12
- const response = await this.api.get<PaGetBookingsResponse>(`/booking`, query, shopId)
13
- if (response && response.data?.length > 0) {
14
- return response.data;
15
- }
16
- return [];
17
- }
18
-
19
- async create(body: PaCreateBookingInput, shopId: number): Promise<PaGetBookingResponse> {
20
- const response = await this.api.post<PaGetBookingResponse>(`/booking`, body, shopId)
21
- return response;
22
-
23
- }
24
-
25
- async changeStatus(bookingId: number, body: PaChangeBookingStatusInput, shopId: number): Promise<PaChangeBookingStatusResponse> {
26
- const response = await this.api.put<PaChangeBookingStatusResponse>(`/booking/${bookingId}/changeStatus`, body, shopId)
27
- return response;
28
-
29
- }
30
-
31
- async get(bookingId: number, shopId: number): Promise<PaGetBookingResponse> {
32
- const response = await this.api.get<PaGetBookingResponse>(`/booking/${bookingId}`, {}, shopId)
33
- return response;
34
- }
35
- }
@@ -1,13 +0,0 @@
1
- export enum BookingStatus {
2
- CONFIRMED = 'CONFIRMED',
3
- REMOVED = 'REMOVED',
4
- }
5
-
6
- export interface PaChangeBookingStatusInput {
7
- status: BookingStatus;
8
- }
9
-
10
- export interface PaChangeBookingStatusResponse {
11
- success: boolean;
12
- message: string;
13
- }
@@ -1,13 +0,0 @@
1
- import { PaEmployeeIndication } from "../../employee";
2
- import { ShopSegment } from "../../segment/enum/segment.enum";
3
-
4
- export interface PaCreateBookingInput {
5
- date?: string;
6
- timeId: string;
7
- petId?: number;
8
- servicesId: Array<number>;
9
- combosId: Array<number>;
10
- segment: ShopSegment;
11
- employeeIndication?: Array<PaEmployeeIndication>;
12
-
13
- }
@@ -1,19 +0,0 @@
1
- export enum Status {
2
- SCHEDULED = 'SCHEDULED',
3
- CONFIRMED = 'CONFIRMED',
4
- RECEIVED = 'RECEIVED',
5
- IN_SERVICE = 'IN_SERVICE',
6
- DONE = 'DONE',
7
- DELIVERED = 'DELIVERED',
8
- REMOVED = 'REMOVED',
9
- }
10
-
11
- export interface PaGetBookingResponse {
12
- id: number;
13
- start: string;
14
- stop: string;
15
- status: Status;
16
- date: string;
17
- petName: string;
18
- services: Array<{id: number, name: string}>;
19
- }
@@ -1,11 +0,0 @@
1
- import {IPaginationGeneric, IPaginationResponse} from "../../types/pagination.types";
2
- import {PaGetBookingResponse} from "./pa.get-booking.dto";
3
-
4
- export interface PaGetBookingsQuery extends IPaginationGeneric {
5
- clientId: string;
6
- }
7
-
8
- export interface PaGetBookingsResponse {
9
- data: PaGetBookingResponse[];
10
- pagination: IPaginationResponse;
11
- }
@@ -1,3 +0,0 @@
1
- export * from './dto/pa.change-booking-status.dto';
2
- export * from './dto/pa.create-booking.dto';
3
-
@@ -1,23 +0,0 @@
1
- import { HttpClient } from "infra/http/client.http";
2
- import { PaBreedResponse } from "./dto/pa.get-breed.dto";
3
- import { PaGetBreedsResponse } from "./dto/pa.get-breeds.dto";
4
- import { logger } from "../../infra/logger/stdout.logger";
5
-
6
- export class BreedService {
7
- constructor(private readonly api: HttpClient) {
8
- }
9
-
10
- async list(specieId: string, name?: string, shopId?: number): Promise<Array<PaBreedResponse>> {
11
- const params = { specieId, name };
12
- if (!name) {
13
- delete params.name;
14
- }
15
- const response = await this.api.get<PaGetBreedsResponse>(`/breed`, params, shopId)
16
- logger.debug(BreedService.name, JSON.stringify(response, null, 2));
17
-
18
- if (response?.data?.length) {
19
- return response.data;
20
- }
21
- return [];
22
- }
23
- }
@@ -1,11 +0,0 @@
1
- import {BillingItemType} from "../../billingMethod/enum/billing-method-type.enum";
2
- import {SpecieType} from "../../specie/enum/specie-type.enum";
3
-
4
- export interface PaBreedResponse {
5
- id: number;
6
- name: string;
7
- specie: SpecieType;
8
- specieId: string;
9
- hair: BillingItemType;
10
- size: BillingItemType;
11
- }
@@ -1,8 +0,0 @@
1
- import {IPaginationResponse} from "../../types/pagination.types";
2
- import {PaBreedResponse} from "./pa.get-breed.dto";
3
-
4
-
5
- export interface PaGetBreedsResponse {
6
- data: PaBreedResponse[];
7
- pagination: IPaginationResponse;
8
- }
@@ -1,3 +0,0 @@
1
- export * from './dto/pa.get-breed.dto';
2
- export * from './dto/pa.get-breeds.dto';
3
-
@@ -1,49 +0,0 @@
1
- import { HttpClient } from "infra/http/client.http";
2
- import { PaChatbotSettingsResponse } from "./dto/chatbot-settings.json";
3
- import {
4
- GetChatbotFormattedMessagesInput,
5
- PaGetChatbotFormattedMessagesResponse
6
- } from "./dto/get-chatbot-formatted-messages.dto";
7
- import {
8
- PaChangeNotificationStatusInput,
9
- PaChangeNotificationStatusResponse
10
- } from "./dto/pa.change-notification-status.dto";
11
- import { PaHandleButtonActionInput, PaHandleButtonActionResponse } from "./dto/pa.handle-button-action.dto";
12
- import { ChatbotPlatformTypeEnum } from "./enum/chatbotSettingsEnums/chatbot-platform-type.enum";
13
-
14
- export class ChatbotService {
15
- constructor(private readonly api: HttpClient) {
16
- }
17
-
18
- async getByShop(shopId: number): Promise<PaChatbotSettingsResponse> {
19
- const response = await this.api.get<PaChatbotSettingsResponse>(`/chatbot/settings`, {}, shopId)
20
- return response;
21
-
22
- }
23
-
24
- async getByPlatform(platformType: ChatbotPlatformTypeEnum, platformId: string): Promise<PaChatbotSettingsResponse> {
25
- const response = await this.api.get<PaChatbotSettingsResponse>(`/chatbot/settings`, {platformType, platformId})
26
- return response;
27
- }
28
-
29
- async getFormattedMessage(body: GetChatbotFormattedMessagesInput, shopId: number): Promise<Array<PaGetChatbotFormattedMessagesResponse>> {
30
- const response = await this.api.post<Array<PaGetChatbotFormattedMessagesResponse>>(`/chatbot/formattedMessages`, body, shopId)
31
- if (response) {
32
- return response;
33
- }
34
- return [];
35
- }
36
-
37
- async changeNotificationStatus(notificationId: number, body: PaChangeNotificationStatusInput, shopId: number): Promise<PaChangeNotificationStatusResponse> {
38
- const response = await this.api.put<PaChangeNotificationStatusResponse>(`/chatbot/notification/${notificationId}/changeStatus`, body, shopId)
39
- return response;
40
-
41
-
42
- }
43
-
44
- async handleButtonAction(body: PaHandleButtonActionInput, shopId: number): Promise<PaHandleButtonActionResponse> {
45
- const response = await this.api.post<PaHandleButtonActionResponse>(`/chatbot/handleButtonAction`, body, shopId)
46
- return response;
47
-
48
- }
49
- }