@up-im/medotvet_sdk 0.0.9 → 0.0.11

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/README.md CHANGED
@@ -63,6 +63,7 @@ const client = createClient({
63
63
  - `getInstruction()` — шаги "Как получить деньги", до 100 элементов.
64
64
  - `getBanks({ page, searchTitle? })` — банки для выплат.
65
65
  - `getSpecializationList({ page, searchTitle? })` — справочник специализаций.
66
+ - `getWorkplaceTypeList({ page, searchTitle? })` — справочник типов учреждений.
66
67
  - `getCityList({ page, searchTitle? })` — города с пагинацией.
67
68
  - `getCityOne({ id })` — один город.
68
69
  - `getBannerRand({ type, signal? })` — баннер по типу (требует токен).
@@ -168,7 +169,7 @@ interface iUser {
168
169
  middlename: string
169
170
  photo: string
170
171
  city: iCity | null
171
- specialization: number[] | null // специализации врача
172
+ specialization: iSpecialization[] | null // специализации врача
172
173
  birthdate: string | null
173
174
  workplace_type: number | null // тип учреждения (ID)
174
175
  workplace_name: string | null // название учреждения
@@ -361,4 +362,20 @@ interface iEnv {
361
362
  root_catalog_id: number
362
363
  payout_min_price: number
363
364
  }
365
+ ```
366
+
367
+ ### iSpecialization
368
+ ```ts
369
+ interface iSpecialization {
370
+ id: number
371
+ title: string
372
+ }
373
+ ```
374
+
375
+ ### iWorkplaceType
376
+ ```ts
377
+ interface iWorkplaceType {
378
+ id: number
379
+ title: string
380
+ }
364
381
  ```
@@ -14,6 +14,7 @@ import { iStories } from "../interfaces/iStories";
14
14
  import { iEnv } from "../interfaces/iEnv";
15
15
  import { iIntro } from "../interfaces/iIntro";
16
16
  import { iAppStore } from "../interfaces/iAppStore";
17
+ import { iWorkplaceType } from "../interfaces/iWorkplaceType";
17
18
  export declare class ApiContent extends ApiAbstract {
18
19
  /**
19
20
  * получение настроек, включая размер реферальных вознаграждений
@@ -117,6 +118,17 @@ export declare class ApiContent extends ApiAbstract {
117
118
  [key: string]: unknown;
118
119
  } | undefined>>;
119
120
  /**
121
+ * получение списка типов учреждений
122
+ * @param {number} props.page - страница. Отсчет страниц с первой, чтобы не было путаницы
123
+ * @param {string} props.searchTitle - поисковая строка по началу названия
124
+ */
125
+ getWorkplaceTypeList({ page, searchTitle }: {
126
+ page: number;
127
+ searchTitle?: string;
128
+ }): Promise<iPagingItems<iWorkplaceType, {
129
+ [key: string]: unknown;
130
+ } | undefined>>;
131
+ /**
120
132
  * получение одного города
121
133
  */
122
134
  getCityOne({ id }: {
@@ -162,6 +162,26 @@ class ApiContent extends abstract_1.ApiAbstract {
162
162
  });
163
163
  }
164
164
  /**
165
+ * получение списка типов учреждений
166
+ * @param {number} props.page - страница. Отсчет страниц с первой, чтобы не было путаницы
167
+ * @param {string} props.searchTitle - поисковая строка по началу названия
168
+ */
169
+ async getWorkplaceTypeList({ page, searchTitle }) {
170
+ const filters = {};
171
+ if (searchTitle?.length)
172
+ filters.title = [searchTitle + "%"];
173
+ return await this.fetcher({
174
+ route: (0, apiRoute_1.apiRouteList)({
175
+ nodeCode: "workplace_type",
176
+ select: ["id", "title"],
177
+ sorters: ["sorter asc", "title asc"],
178
+ perPage: 20,
179
+ filters,
180
+ page
181
+ })
182
+ });
183
+ }
184
+ /**
165
185
  * получение одного города
166
186
  */
167
187
  async getCityOne({ id }) {
@@ -1,5 +1,6 @@
1
1
  import { DiplomaStatusValue } from "./diplomaStatus";
2
2
  import { iCity } from "./iCity";
3
+ import { iSpecialization } from "./iSpecialization";
3
4
  import { iUserData } from "./iUserData";
4
5
  import { UserRole, UserRoleKeys } from "./userRole";
5
6
  export interface iUser {
@@ -22,7 +23,7 @@ export interface iUser {
22
23
  soc_vk_id: number | null;
23
24
  soc_vk_username: string;
24
25
  city: iCity | null;
25
- specialization: number[] | null;
26
+ specialization: iSpecialization[] | null;
26
27
  birthdate: string | null;
27
28
  workplace_type: number | null;
28
29
  workplace_name: string | null;
@@ -0,0 +1,4 @@
1
+ export interface iWorkplaceType {
2
+ id: number;
3
+ title: string;
4
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@up-im/medotvet_sdk",
3
- "version": "0.0.9",
3
+ "version": "0.0.11",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -18,6 +18,7 @@ import { iEnv } from "../interfaces/iEnv"
18
18
  import { iIntro } from "../interfaces/iIntro"
19
19
  import { iAppStore } from "../interfaces/iAppStore"
20
20
  import { iSpecialization } from "../interfaces/iSpecialization"
21
+ import { iWorkplaceType } from "../interfaces/iWorkplaceType"
21
22
 
22
23
  export class ApiContent extends ApiAbstract {
23
24
  /**
@@ -181,6 +182,25 @@ export class ApiContent extends ApiAbstract {
181
182
  })
182
183
  }
183
184
  /**
185
+ * получение списка типов учреждений
186
+ * @param {number} props.page - страница. Отсчет страниц с первой, чтобы не было путаницы
187
+ * @param {string} props.searchTitle - поисковая строка по началу названия
188
+ */
189
+ async getWorkplaceTypeList({ page, searchTitle }: { page: number, searchTitle?: string }) {
190
+ const filters: iFilter<iWorkplaceType> = {}
191
+ if (searchTitle?.length) filters.title = [searchTitle + "%"]
192
+ return await this.fetcher<iPagingItems<iWorkplaceType>>({
193
+ route: apiRouteList({
194
+ nodeCode: "workplace_type",
195
+ select: ["id", "title"],
196
+ sorters: ["sorter asc", "title asc"],
197
+ perPage: 20,
198
+ filters,
199
+ page
200
+ })
201
+ })
202
+ }
203
+ /**
184
204
  * получение одного города
185
205
  */
186
206
  async getCityOne({ id }: { id: number }) {
@@ -1,5 +1,6 @@
1
1
  import { DiplomaStatusValue } from "./diplomaStatus"
2
2
  import { iCity } from "./iCity"
3
+ import { iSpecialization } from "./iSpecialization"
3
4
  import { iUserData } from "./iUserData"
4
5
  import { UserRole, UserRoleKeys } from "./userRole"
5
6
 
@@ -24,7 +25,7 @@ export interface iUser {
24
25
  soc_vk_username: string
25
26
 
26
27
  city: iCity | null
27
- specialization: number[] | null // специализации врача (Medotvet)
28
+ specialization: iSpecialization[] | null // специализации врача (Medotvet)
28
29
  birthdate: string | null // дата рождения (Medotvet)
29
30
  workplace_type: number | null // тип учреждения (ID) (Medotvet)
30
31
  workplace_name: string | null // название учреждения (Medotvet)
@@ -0,0 +1,4 @@
1
+ export interface iWorkplaceType {
2
+ id: number
3
+ title: string
4
+ }