@up-im/medotvet_sdk 0.0.1
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/.cursor/rules/apcheki_sdk.mdc +90 -0
- package/README.md +136 -0
- package/dist/api/abstract.d.ts +21 -0
- package/dist/api/abstract.js +125 -0
- package/dist/api/bookmarks.d.ts +28 -0
- package/dist/api/bookmarks.js +121 -0
- package/dist/api/chat.d.ts +30 -0
- package/dist/api/chat.js +118 -0
- package/dist/api/content.d.ts +154 -0
- package/dist/api/content.js +237 -0
- package/dist/api/geoIp.d.ts +8 -0
- package/dist/api/geoIp.js +14 -0
- package/dist/api/index.d.ts +27 -0
- package/dist/api/index.js +31 -0
- package/dist/api/payment.d.ts +54 -0
- package/dist/api/payment.js +90 -0
- package/dist/api/promocode.d.ts +9 -0
- package/dist/api/promocode.js +22 -0
- package/dist/api/push.d.ts +54 -0
- package/dist/api/push.js +99 -0
- package/dist/api/receipt.d.ts +34 -0
- package/dist/api/receipt.js +60 -0
- package/dist/api/stat.d.ts +21 -0
- package/dist/api/stat.js +75 -0
- package/dist/api/survey.d.ts +82 -0
- package/dist/api/survey.js +122 -0
- package/dist/api/user.d.ts +80 -0
- package/dist/api/user.js +167 -0
- package/dist/eventBus/abstract.d.ts +4 -0
- package/dist/eventBus/abstract.js +29 -0
- package/dist/eventBus/userLogin.d.ts +5 -0
- package/dist/eventBus/userLogin.js +11 -0
- package/dist/eventBus/userLogout.d.ts +4 -0
- package/dist/eventBus/userLogout.js +11 -0
- package/dist/http/apiError.d.ts +4 -0
- package/dist/http/apiError.js +10 -0
- package/dist/http/apiRoute.d.ts +98 -0
- package/dist/http/apiRoute.js +197 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +7 -0
- package/dist/interfaces/BannerType.d.ts +5 -0
- package/dist/interfaces/BannerType.js +7 -0
- package/dist/interfaces/apiStatEvents.d.ts +1 -0
- package/dist/interfaces/apiStatEvents.js +18 -0
- package/dist/interfaces/diplomaStatus.d.ts +8 -0
- package/dist/interfaces/diplomaStatus.js +9 -0
- package/dist/interfaces/iAppStore.d.ts +1 -0
- package/dist/interfaces/iAppStore.js +2 -0
- package/dist/interfaces/iAppVersionCheck.d.ts +5 -0
- package/dist/interfaces/iAppVersionCheck.js +2 -0
- package/dist/interfaces/iArticle.d.ts +15 -0
- package/dist/interfaces/iArticle.js +2 -0
- package/dist/interfaces/iBalance.d.ts +6 -0
- package/dist/interfaces/iBalance.js +2 -0
- package/dist/interfaces/iBank.d.ts +4 -0
- package/dist/interfaces/iBank.js +2 -0
- package/dist/interfaces/iBanner.d.ts +6 -0
- package/dist/interfaces/iBanner.js +2 -0
- package/dist/interfaces/iBookmark.d.ts +3 -0
- package/dist/interfaces/iBookmark.js +2 -0
- package/dist/interfaces/iBrand.d.ts +6 -0
- package/dist/interfaces/iBrand.js +2 -0
- package/dist/interfaces/iCatalog.d.ts +50 -0
- package/dist/interfaces/iCatalog.js +2 -0
- package/dist/interfaces/iCatalogNode.d.ts +3 -0
- package/dist/interfaces/iCatalogNode.js +2 -0
- package/dist/interfaces/iCatalogPreview.d.ts +17 -0
- package/dist/interfaces/iCatalogPreview.js +2 -0
- package/dist/interfaces/iCity.d.ts +4 -0
- package/dist/interfaces/iCity.js +2 -0
- package/dist/interfaces/iContentItem.d.ts +7 -0
- package/dist/interfaces/iContentItem.js +2 -0
- package/dist/interfaces/iEnv.d.ts +6 -0
- package/dist/interfaces/iEnv.js +2 -0
- package/dist/interfaces/iFilter.d.ts +11 -0
- package/dist/interfaces/iFilter.js +2 -0
- package/dist/interfaces/iGetNodeListProps.d.ts +8 -0
- package/dist/interfaces/iGetNodeListProps.js +2 -0
- package/dist/interfaces/iInstruction.d.ts +6 -0
- package/dist/interfaces/iInstruction.js +2 -0
- package/dist/interfaces/iIntro.d.ts +6 -0
- package/dist/interfaces/iIntro.js +2 -0
- package/dist/interfaces/iMessage.d.ts +25 -0
- package/dist/interfaces/iMessage.js +2 -0
- package/dist/interfaces/iNode.d.ts +26 -0
- package/dist/interfaces/iNode.js +2 -0
- package/dist/interfaces/iNodeTree.d.ts +14 -0
- package/dist/interfaces/iNodeTree.js +2 -0
- package/dist/interfaces/iPagingItems.d.ts +9 -0
- package/dist/interfaces/iPagingItems.js +2 -0
- package/dist/interfaces/iPayment.d.ts +20 -0
- package/dist/interfaces/iPayment.js +2 -0
- package/dist/interfaces/iPush.d.ts +14 -0
- package/dist/interfaces/iPush.js +2 -0
- package/dist/interfaces/iQuestion.d.ts +7 -0
- package/dist/interfaces/iQuestion.js +2 -0
- package/dist/interfaces/iReceipt.d.ts +20 -0
- package/dist/interfaces/iReceipt.js +2 -0
- package/dist/interfaces/iReceiptAddProps.d.ts +8 -0
- package/dist/interfaces/iReceiptAddProps.js +2 -0
- package/dist/interfaces/iReceiptProduct.d.ts +7 -0
- package/dist/interfaces/iReceiptProduct.js +2 -0
- package/dist/interfaces/iSearchParams.d.ts +11 -0
- package/dist/interfaces/iSearchParams.js +2 -0
- package/dist/interfaces/iShop.d.ts +6 -0
- package/dist/interfaces/iShop.js +2 -0
- package/dist/interfaces/iShopAddress.d.ts +5 -0
- package/dist/interfaces/iShopAddress.js +2 -0
- package/dist/interfaces/iSorter.d.ts +7 -0
- package/dist/interfaces/iSorter.js +2 -0
- package/dist/interfaces/iSpecialization.d.ts +4 -0
- package/dist/interfaces/iSpecialization.js +2 -0
- package/dist/interfaces/iStatView.d.ts +4 -0
- package/dist/interfaces/iStatView.js +2 -0
- package/dist/interfaces/iStorage.d.ts +5 -0
- package/dist/interfaces/iStorage.js +2 -0
- package/dist/interfaces/iStories.d.ts +13 -0
- package/dist/interfaces/iStories.js +2 -0
- package/dist/interfaces/iSubstance.d.ts +4 -0
- package/dist/interfaces/iSubstance.js +2 -0
- package/dist/interfaces/iSurvey.d.ts +36 -0
- package/dist/interfaces/iSurvey.js +2 -0
- package/dist/interfaces/iSurveyQuestion.d.ts +11 -0
- package/dist/interfaces/iSurveyQuestion.js +2 -0
- package/dist/interfaces/iSymptoms.d.ts +4 -0
- package/dist/interfaces/iSymptoms.js +2 -0
- package/dist/interfaces/iTestQuestion.d.ts +20 -0
- package/dist/interfaces/iTestQuestion.js +2 -0
- package/dist/interfaces/iTestResult.d.ts +17 -0
- package/dist/interfaces/iTestResult.js +2 -0
- package/dist/interfaces/iText.d.ts +3 -0
- package/dist/interfaces/iText.js +2 -0
- package/dist/interfaces/iUser.d.ts +35 -0
- package/dist/interfaces/iUser.js +2 -0
- package/dist/interfaces/iUserData.d.ts +10 -0
- package/dist/interfaces/iUserData.js +2 -0
- package/dist/interfaces/iUserEditProps.d.ts +20 -0
- package/dist/interfaces/iUserEditProps.js +2 -0
- package/dist/interfaces/iUserStat.d.ts +7 -0
- package/dist/interfaces/iUserStat.js +2 -0
- package/dist/interfaces/iUserSurvey.d.ts +21 -0
- package/dist/interfaces/iUserSurvey.js +11 -0
- package/dist/interfaces/iUserTokens.d.ts +4 -0
- package/dist/interfaces/iUserTokens.js +2 -0
- package/dist/interfaces/intRange.d.ts +3 -0
- package/dist/interfaces/intRange.js +2 -0
- package/dist/interfaces/itemType.d.ts +9 -0
- package/dist/interfaces/itemType.js +11 -0
- package/dist/interfaces/paymentStatus.d.ts +7 -0
- package/dist/interfaces/paymentStatus.js +9 -0
- package/dist/interfaces/paymentType.d.ts +5 -0
- package/dist/interfaces/paymentType.js +7 -0
- package/dist/interfaces/payoutType.d.ts +5 -0
- package/dist/interfaces/payoutType.js +7 -0
- package/dist/interfaces/pushStatus.d.ts +6 -0
- package/dist/interfaces/pushStatus.js +8 -0
- package/dist/interfaces/receiptStatus.d.ts +7 -0
- package/dist/interfaces/receiptStatus.js +9 -0
- package/dist/interfaces/testStatus.d.ts +6 -0
- package/dist/interfaces/testStatus.js +7 -0
- package/dist/interfaces/userRole.d.ts +6 -0
- package/dist/interfaces/userRole.js +14 -0
- package/dist/interfaces/userStatEvent.d.ts +5 -0
- package/dist/interfaces/userStatEvent.js +7 -0
- package/dist/interfaces/viewEventType.d.ts +13 -0
- package/dist/interfaces/viewEventType.js +19 -0
- package/dist/service/webSocketClient.d.ts +21 -0
- package/dist/service/webSocketClient.js +87 -0
- package/dist/storage/default.d.ts +2 -0
- package/dist/storage/default.js +8 -0
- package/dist/storage/user.d.ts +21 -0
- package/dist/storage/user.js +107 -0
- package/dist/utils/queryString.d.ts +3 -0
- package/dist/utils/queryString.js +21 -0
- package/package.json +31 -0
- package/src/api/abstract.ts +136 -0
- package/src/api/bookmarks.ts +109 -0
- package/src/api/chat.ts +127 -0
- package/src/api/content.ts +258 -0
- package/src/api/geoIp.ts +12 -0
- package/src/api/index.ts +38 -0
- package/src/api/payment.ts +105 -0
- package/src/api/promocode.ts +18 -0
- package/src/api/push.ts +102 -0
- package/src/api/stat.ts +74 -0
- package/src/api/survey.ts +164 -0
- package/src/api/user.ts +176 -0
- package/src/eventBus/abstract.ts +33 -0
- package/src/eventBus/userLogin.ts +13 -0
- package/src/eventBus/userLogout.ts +12 -0
- package/src/http/apiError.ts +9 -0
- package/src/http/apiRoute.ts +234 -0
- package/src/index.ts +2 -0
- package/src/interfaces/BannerType.ts +6 -0
- package/src/interfaces/apiStatEvents.ts +18 -0
- package/src/interfaces/diplomaStatus.ts +10 -0
- package/src/interfaces/iAppStore.ts +1 -0
- package/src/interfaces/iArticle.ts +12 -0
- package/src/interfaces/iBalance.ts +6 -0
- package/src/interfaces/iBank.ts +4 -0
- package/src/interfaces/iBanner.ts +6 -0
- package/src/interfaces/iBookmark.ts +3 -0
- package/src/interfaces/iCity.ts +4 -0
- package/src/interfaces/iContentItem.ts +6 -0
- package/src/interfaces/iEnv.ts +6 -0
- package/src/interfaces/iFilter.ts +16 -0
- package/src/interfaces/iGetNodeListProps.ts +9 -0
- package/src/interfaces/iInstruction.ts +6 -0
- package/src/interfaces/iIntro.ts +6 -0
- package/src/interfaces/iMessage.ts +25 -0
- package/src/interfaces/iNode.ts +24 -0
- package/src/interfaces/iNodeTree.ts +14 -0
- package/src/interfaces/iPagingItems.ts +8 -0
- package/src/interfaces/iPayment.ts +28 -0
- package/src/interfaces/iPush.ts +15 -0
- package/src/interfaces/iQuestion.ts +4 -0
- package/src/interfaces/iSearchParams.ts +12 -0
- package/src/interfaces/iSorter.ts +10 -0
- package/src/interfaces/iSpecialization.ts +4 -0
- package/src/interfaces/iStatView.ts +4 -0
- package/src/interfaces/iStorage.ts +5 -0
- package/src/interfaces/iStories.ts +10 -0
- package/src/interfaces/iSubstance.ts +4 -0
- package/src/interfaces/iSurvey.ts +38 -0
- package/src/interfaces/iSurveyQuestion.ts +15 -0
- package/src/interfaces/iSymptoms.ts +4 -0
- package/src/interfaces/iTestQuestion.ts +21 -0
- package/src/interfaces/iTestResult.ts +20 -0
- package/src/interfaces/iText.ts +3 -0
- package/src/interfaces/iUser.ts +37 -0
- package/src/interfaces/iUserData.ts +10 -0
- package/src/interfaces/iUserEditProps.ts +16 -0
- package/src/interfaces/iUserStat.ts +8 -0
- package/src/interfaces/iUserSurvey.ts +23 -0
- package/src/interfaces/iUserTokens.ts +4 -0
- package/src/interfaces/intRange.ts +5 -0
- package/src/interfaces/itemType.ts +10 -0
- package/src/interfaces/paymentStatus.ts +8 -0
- package/src/interfaces/paymentType.ts +6 -0
- package/src/interfaces/payoutType.ts +6 -0
- package/src/interfaces/pushStatus.ts +7 -0
- package/src/interfaces/testStatus.ts +8 -0
- package/src/interfaces/userRole.ts +13 -0
- package/src/interfaces/userStatEvent.ts +6 -0
- package/src/interfaces/viewEventType.ts +17 -0
- package/src/service/webSocketClient.ts +94 -0
- package/src/storage/default.ts +7 -0
- package/src/storage/user.ts +109 -0
- package/src/utils/queryString.ts +22 -0
- package/tsconfig.json +27 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type iAppStore = "App Store" | "Google Play" | "RuStore" | "AppGallery"
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export type iFilterValue = (string | number)[]
|
|
2
|
+
|
|
3
|
+
type ExcludeMethods<T> =
|
|
4
|
+
{ [K in keyof T as (T[K] extends Function ? never : K)]: T[K] }
|
|
5
|
+
|
|
6
|
+
type iFilterKey<TKey> =
|
|
7
|
+
TKey |
|
|
8
|
+
(TKey extends string ? `!${TKey}` : never) |
|
|
9
|
+
(TKey extends string ? `>${TKey}` : never) |
|
|
10
|
+
(TKey extends string ? `<${TKey}` : never) |
|
|
11
|
+
(TKey extends string ? `*${TKey}` : never)
|
|
12
|
+
|
|
13
|
+
export type iFilter<T> = {//может содержать один вложенный фильтр для фильтрации по другой таблице
|
|
14
|
+
[key in iFilterKey<keyof ExcludeMethods<T>>]?: iFilterValue |
|
|
15
|
+
{ [key in iFilterKey<keyof ExcludeMethods<T>>]?: iFilterValue }[]
|
|
16
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { iFilter } from "./iFilter"
|
|
2
|
+
|
|
3
|
+
export interface iGetNodeListProps<T> {
|
|
4
|
+
page?: number,
|
|
5
|
+
filters?: iFilter<T>,
|
|
6
|
+
sorter?: string | string[]
|
|
7
|
+
perPage?: number
|
|
8
|
+
setParams?: boolean // устанавливать ли переменную paramsDisplay с доп полями раздела или нет
|
|
9
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export interface iMessageView {
|
|
2
|
+
route: "/view"
|
|
3
|
+
message_id: number
|
|
4
|
+
}
|
|
5
|
+
export interface iMessageError {
|
|
6
|
+
route: "/error"
|
|
7
|
+
text: string
|
|
8
|
+
}
|
|
9
|
+
export interface iMessageOutgoing {
|
|
10
|
+
route: "/message"
|
|
11
|
+
text: string
|
|
12
|
+
file: string | undefined
|
|
13
|
+
}
|
|
14
|
+
export interface iMessageIncome extends iMessageOutgoing {
|
|
15
|
+
id: number
|
|
16
|
+
date: Date
|
|
17
|
+
from_user_id: number
|
|
18
|
+
from_user_name: string
|
|
19
|
+
view: 0 | 1
|
|
20
|
+
}
|
|
21
|
+
export interface iMessageUnread {
|
|
22
|
+
route: "/unread"
|
|
23
|
+
unread: number
|
|
24
|
+
}
|
|
25
|
+
export type iMessage = iMessageIncome | iMessageUnread | iMessageView | iMessageError
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export interface iNode<ParamsT = { [key: string]: unknown } | undefined> {
|
|
2
|
+
id: number
|
|
3
|
+
pub_date: string
|
|
4
|
+
type: string
|
|
5
|
+
parent: number
|
|
6
|
+
code: string
|
|
7
|
+
title: string
|
|
8
|
+
h1?:string
|
|
9
|
+
menutitle: string;
|
|
10
|
+
sorter: number
|
|
11
|
+
image: string
|
|
12
|
+
icon: string
|
|
13
|
+
redirect: string
|
|
14
|
+
meta_title: string
|
|
15
|
+
meta_keywords: string
|
|
16
|
+
meta_description: string
|
|
17
|
+
meta_title_element_tpl: string
|
|
18
|
+
meta_keywords_element_tpl: string
|
|
19
|
+
meta_description_element_tpl: string
|
|
20
|
+
no_search: boolean
|
|
21
|
+
no_menu: boolean
|
|
22
|
+
public: boolean
|
|
23
|
+
paramsDisplay: ParamsT
|
|
24
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { PaymentStatus, PaymentStatusKeys } from "./paymentStatus";
|
|
2
|
+
import { PaymentType, PaymentTypeKeys } from "./paymentType";
|
|
3
|
+
import { PayoutType, PayoutTypeKeys } from "./payoutType";
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
export interface iPayment {
|
|
7
|
+
id: number
|
|
8
|
+
reg_date: string//дата создания
|
|
9
|
+
status: typeof PaymentStatus[PaymentStatusKeys]
|
|
10
|
+
pay_type: typeof PaymentType[PaymentTypeKeys]//тип операции, начисление или выплата
|
|
11
|
+
title: string//краткое описание для вывода пользователю
|
|
12
|
+
|
|
13
|
+
//начисление
|
|
14
|
+
receipt: number | null//чек
|
|
15
|
+
receipt_product: number | null//товар чека
|
|
16
|
+
catalog: number | null//id товара каталога
|
|
17
|
+
sku: number | null//id акции
|
|
18
|
+
shop: number | null//id аптеки
|
|
19
|
+
cashback_level: 0 | 1 | 2 | 3//уровень кэшбека по которому произошло начисление
|
|
20
|
+
max_cashback_level: null | 0 | 1 | 2 | 3 //макс. возможный уровень кэшбека по акции, поле есть только у начислений в чеках
|
|
21
|
+
|
|
22
|
+
//списание
|
|
23
|
+
payout_type: typeof PayoutType[PayoutTypeKeys] | null //способ выплаты
|
|
24
|
+
last_error: string//текст ошибки выплаты
|
|
25
|
+
|
|
26
|
+
//размер
|
|
27
|
+
price: number //если больше 0 начисление, меньше 0 списание
|
|
28
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { PushStatus, PushStatusKeys } from "./pushStatus"
|
|
2
|
+
|
|
3
|
+
export interface iPush {
|
|
4
|
+
id: number
|
|
5
|
+
reg_date: string
|
|
6
|
+
send_date: string | null
|
|
7
|
+
user: number
|
|
8
|
+
status: typeof PushStatus[PushStatusKeys]
|
|
9
|
+
mailing: number | null
|
|
10
|
+
priority: number
|
|
11
|
+
title: string
|
|
12
|
+
text: string
|
|
13
|
+
route: string
|
|
14
|
+
view: boolean
|
|
15
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { iFilter } from "./iFilter"
|
|
2
|
+
import { iSorter } from "./iSorter"
|
|
3
|
+
|
|
4
|
+
export type iSearchParams<Data extends object, Keys extends keyof Data> = {
|
|
5
|
+
nodeCode?: string | undefined
|
|
6
|
+
select: Keys[],
|
|
7
|
+
page?: number
|
|
8
|
+
filters?: iFilter<Data>,
|
|
9
|
+
sorters?: iSorter<Data>
|
|
10
|
+
perPage?: number
|
|
11
|
+
subNodes?: boolean
|
|
12
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type iSorterValue = string
|
|
2
|
+
|
|
3
|
+
type ExcludeMethods<T> =
|
|
4
|
+
{ [K in keyof T as (T[K] extends Function ? never : K)]: T[K] }
|
|
5
|
+
|
|
6
|
+
type iSorterKey<TKey> =
|
|
7
|
+
(TKey extends string ? `${TKey} asc` : never) |
|
|
8
|
+
(TKey extends string ? `${TKey} desc` : never)
|
|
9
|
+
|
|
10
|
+
export type iSorter<T> = (iSorterKey<keyof ExcludeMethods<T>>)[]
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { iSurveyQuestion } from "./iSurveyQuestion"
|
|
2
|
+
|
|
3
|
+
// Тип для данных из связующих таблиц multiselectExtTable
|
|
4
|
+
interface iRefItem {
|
|
5
|
+
id: number
|
|
6
|
+
title: string
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export interface iSurvey {
|
|
10
|
+
id: number
|
|
11
|
+
node: number
|
|
12
|
+
title: string
|
|
13
|
+
partner: number | null
|
|
14
|
+
budget: number
|
|
15
|
+
budget_min: number
|
|
16
|
+
date_start: string | null
|
|
17
|
+
date_end: string | null
|
|
18
|
+
reward_base: number
|
|
19
|
+
reward_max: number
|
|
20
|
+
questions: iSurveyQuestion[] | null
|
|
21
|
+
slots: number
|
|
22
|
+
slots_taken?: number // Из VIEW survey_slots_taken
|
|
23
|
+
specialization: iRefItem[] | null // Специализации врачей
|
|
24
|
+
city: iRefItem[] | null // Только эти города
|
|
25
|
+
city_not: iRefItem[] | null // Кроме этих городов
|
|
26
|
+
region: iRefItem[] | null // Только эти регионы
|
|
27
|
+
region_not: iRefItem[] | null // Кроме этих регионов
|
|
28
|
+
promo_title: string
|
|
29
|
+
promo_subtitle: string
|
|
30
|
+
promo_image: string
|
|
31
|
+
promo_text: string
|
|
32
|
+
promo_disclaimer: string
|
|
33
|
+
text: string
|
|
34
|
+
text_full: string
|
|
35
|
+
public: boolean
|
|
36
|
+
priority?: number // Приоритет для спецразмещения (1-4)
|
|
37
|
+
payment_total?: number // Из VIEW payment_survey_sum
|
|
38
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export type tSurveyNextStep = number | "default" | "terminate"
|
|
2
|
+
|
|
3
|
+
export type tSurveyQuestionType = "single" | "multiple" | "text"
|
|
4
|
+
|
|
5
|
+
export interface iSurveyAnswer {
|
|
6
|
+
title: string
|
|
7
|
+
next_step: tSurveyNextStep
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface iSurveyQuestion {
|
|
11
|
+
title: string
|
|
12
|
+
type: tSurveyQuestionType
|
|
13
|
+
answers: iSurveyAnswer[]
|
|
14
|
+
}
|
|
15
|
+
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Вопрос теста для пользователя (без правильных ответов)
|
|
3
|
+
*/
|
|
4
|
+
export interface iTestQuestionForUser {
|
|
5
|
+
specialization: number
|
|
6
|
+
questionIndex: number // индекс вопроса в массиве questions специализации
|
|
7
|
+
question: string
|
|
8
|
+
answers: { title: string }[]
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Ответ пользователя на вопрос
|
|
13
|
+
*/
|
|
14
|
+
export interface iTestUserAnswer {
|
|
15
|
+
specialization: number
|
|
16
|
+
questionIndex: number // индекс вопроса в массиве questions специализации
|
|
17
|
+
answer_indices: number[] // индексы выбранных ответов
|
|
18
|
+
answer_time?: number // время ответа в секундах
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export interface iTestResult {
|
|
2
|
+
id: number
|
|
3
|
+
user: number | null
|
|
4
|
+
test_date: Date | null
|
|
5
|
+
specialization: number | null
|
|
6
|
+
question_index: number | null // индекс вопроса в массиве questions специализации
|
|
7
|
+
question_text: string
|
|
8
|
+
user_answer: number[]
|
|
9
|
+
is_correct: boolean
|
|
10
|
+
answer_time: number
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface iTestResultBySpecialization {
|
|
14
|
+
[specializationId: number]: {
|
|
15
|
+
correct: number
|
|
16
|
+
total: number
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { iCity } from "./iCity"
|
|
2
|
+
import { iUserData } from "./iUserData"
|
|
3
|
+
import { UserRole, UserRoleKeys } from "./userRole"
|
|
4
|
+
|
|
5
|
+
export interface iUser {
|
|
6
|
+
id: number
|
|
7
|
+
register_date: string | null
|
|
8
|
+
register_date_original: string | null
|
|
9
|
+
role: typeof UserRole[UserRoleKeys]
|
|
10
|
+
phone: string | null
|
|
11
|
+
phone_confirm: boolean
|
|
12
|
+
email: string | null
|
|
13
|
+
email_confirm: boolean
|
|
14
|
+
firstname: string
|
|
15
|
+
lastname: string
|
|
16
|
+
middlename: string
|
|
17
|
+
photo: string
|
|
18
|
+
password?: string
|
|
19
|
+
isSubscribe?: boolean
|
|
20
|
+
soc_tg_id: number | null
|
|
21
|
+
soc_tg_username: string
|
|
22
|
+
soc_vk_id: number | null
|
|
23
|
+
soc_vk_username: string
|
|
24
|
+
|
|
25
|
+
city: iCity | null
|
|
26
|
+
specialization: number[] | null // специализации врача (Medotvet)
|
|
27
|
+
birthdate: string | null // дата рождения (Medotvet)
|
|
28
|
+
workplace_type: number | null // тип учреждения (ID) (Medotvet)
|
|
29
|
+
workplace_name: string | null // название учреждения (Medotvet)
|
|
30
|
+
diploma_status: number | null // 0-не загружен, 1-на проверке, 2-подтвержден, 3-отклонен (Medotvet)
|
|
31
|
+
diploma_files: string[] | null // массив путей к файлам диплома (Medotvet)
|
|
32
|
+
diploma_reject_reason: string | null // причина отклонения диплома (Medotvet)
|
|
33
|
+
test_status: number | null // 0-не пройден, 1-пройден (Medotvet)
|
|
34
|
+
ref: iUserData | null // друг, если не пустой то ввести промокод нельзя
|
|
35
|
+
my_ref_code: string | null
|
|
36
|
+
agreement: boolean | null
|
|
37
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
interface iUserEditPropsBase {
|
|
2
|
+
email?: string;
|
|
3
|
+
city?: number; // id города
|
|
4
|
+
email_code?: string; // код отправленный на email
|
|
5
|
+
agreement?: boolean; // согласие с пользовательским соглашением
|
|
6
|
+
birthdate?: string | null; // дата рождения (формат YYYY-MM-DD)
|
|
7
|
+
specialization?: number[] | null; // специализации врача (массив ID)
|
|
8
|
+
workplace_type?: number | null; // тип учреждения (ID)
|
|
9
|
+
workplace_name?: string | null; // название учреждения
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
// Логика: либо все три имени заданы, либо ни одно
|
|
13
|
+
export type iUserEditProps = iUserEditPropsBase & (
|
|
14
|
+
| { firstname: string; lastname: string; middlename: string } // Все три имени присутствуют
|
|
15
|
+
| { firstname?: never; lastname?: never; middlename?: never } // Ни одно не задано
|
|
16
|
+
);
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export enum UserSurveyStatus {
|
|
2
|
+
queue = 0, // в очереди (создан, но не начат)
|
|
3
|
+
in_progress = 1, // в процессе прохождения
|
|
4
|
+
success = 2, // успешно завершен
|
|
5
|
+
cancelled = 3, // отменен пользователем
|
|
6
|
+
timeout = 4 // таймаут (не завершен за 1 час)
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export type UserSurveyStatusKeys = keyof typeof UserSurveyStatus
|
|
10
|
+
|
|
11
|
+
export interface iUserSurvey {
|
|
12
|
+
id: number
|
|
13
|
+
reg_date: string
|
|
14
|
+
user: number
|
|
15
|
+
survey: number
|
|
16
|
+
status: typeof UserSurveyStatus[UserSurveyStatusKeys]
|
|
17
|
+
date_start: string | null
|
|
18
|
+
date_end: string | null
|
|
19
|
+
timeout_at: string | null
|
|
20
|
+
survey_title?: string // Для отображения в истории
|
|
21
|
+
reward_base?: number // Для отображения в истории
|
|
22
|
+
reward_max?: number // Для отображения в истории
|
|
23
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export const UserRole = {
|
|
2
|
+
NONE: 0,
|
|
3
|
+
ADMIN: 1000,
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
export type UserRoleKeys = keyof typeof UserRole;
|
|
7
|
+
|
|
8
|
+
export function getUserRoleTitle(role?: typeof UserRole[UserRoleKeys]) {
|
|
9
|
+
switch (role) {
|
|
10
|
+
case UserRole.ADMIN: return "Админ"
|
|
11
|
+
default: return ""
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export const ViewEventType = {
|
|
2
|
+
//базовый тип
|
|
3
|
+
VIEW: 1,
|
|
4
|
+
//Акция
|
|
5
|
+
FAVORITE: 2,
|
|
6
|
+
PROMO_BLOCK: 3,
|
|
7
|
+
PRESENTATION_CLICK: 4,
|
|
8
|
+
PRESENTATION_SUCCESS: 5,
|
|
9
|
+
QUESTIONS_CLICK: 6,
|
|
10
|
+
QUESTIONS_SUCCESS: 7,
|
|
11
|
+
//Блог
|
|
12
|
+
SKU_BTN: 8,
|
|
13
|
+
READ: 9,
|
|
14
|
+
//Баннеры
|
|
15
|
+
CLICK: 10,
|
|
16
|
+
}
|
|
17
|
+
export type ViewEventTypeKeys = keyof typeof ViewEventType;
|