@escapenavigator/types 1.10.122 → 1.10.124

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.
@@ -35,6 +35,7 @@ declare class Slot {
35
35
  tariff: OpenapiTariffRO;
36
36
  }
37
37
  export declare class OpenapiOrderRO extends QuestroomRow {
38
+ id: number;
38
39
  createdAt: Date;
39
40
  code: string;
40
41
  language?: Languages;
@@ -106,6 +106,10 @@ __decorate([
106
106
  class OpenapiOrderRO extends openapi_questroom_ro_1.QuestroomRow {
107
107
  }
108
108
  exports.OpenapiOrderRO = OpenapiOrderRO;
109
+ __decorate([
110
+ (0, class_transformer_1.Expose)(),
111
+ __metadata("design:type", Number)
112
+ ], OpenapiOrderRO.prototype, "id", void 0);
109
113
  __decorate([
110
114
  (0, class_transformer_1.Expose)(),
111
115
  __metadata("design:type", Date)
@@ -1,7 +1,7 @@
1
1
  import { LocationRO } from '../location/location.ro';
2
2
  import { ProfileRO } from '../profile/profile.ro';
3
- import { QuestroomLightLocale as QuestroomLocale } from './questroom-light.ro';
4
3
  import { QuestroomRO } from './questroom.ro';
4
+ import { QuestroomLightLocale as QuestroomLocale } from './questroom-light.ro';
5
5
  declare class City {
6
6
  title: string;
7
7
  }
@@ -18,7 +18,6 @@ export declare class QuestroomAdminRO extends QuestroomRO {
18
18
  questroomAwards: AwardRO[];
19
19
  minPrice: number;
20
20
  maxPrice: number;
21
- oldData: string;
22
21
  top: boolean;
23
22
  verified: boolean;
24
23
  location: LocationAdminRO;
@@ -14,8 +14,8 @@ exports.QuestroomAdminRO = exports.LocationAdminRO = void 0;
14
14
  const class_transformer_1 = require("class-transformer");
15
15
  const location_ro_1 = require("../location/location.ro");
16
16
  const profile_ro_1 = require("../profile/profile.ro");
17
- const questroom_light_ro_1 = require("./questroom-light.ro");
18
17
  const questroom_ro_1 = require("./questroom.ro");
18
+ const questroom_light_ro_1 = require("./questroom-light.ro");
19
19
  class City {
20
20
  }
21
21
  __decorate([
@@ -64,10 +64,6 @@ __decorate([
64
64
  (0, class_transformer_1.Expose)(),
65
65
  __metadata("design:type", Number)
66
66
  ], QuestroomAdminRO.prototype, "maxPrice", void 0);
67
- __decorate([
68
- (0, class_transformer_1.Expose)(),
69
- __metadata("design:type", String)
70
- ], QuestroomAdminRO.prototype, "oldData", void 0);
71
67
  __decorate([
72
68
  (0, class_transformer_1.Expose)(),
73
69
  __metadata("design:type", Boolean)
@@ -0,0 +1,23 @@
1
+ import { QuestroomLightLocale, QuestroomLightMode } from './questroom-light.ro';
2
+ /**
3
+ * Lazy-payload `modes` + `locales` для одного квеста.
4
+ *
5
+ * Возвращается из `GET /questrooms/extras` единым массивом
6
+ * `QuestroomExtrasRO[]` для всего scope (current profile / scope.questroomsIds)
7
+ * и кэшируется на фронте в `questroom-extras-slice`.
8
+ *
9
+ * Зачем отдельный endpoint:
10
+ * - `QuestroomLightRO` (bootstrap) после Phase 3 не несёт `modes`/`locales` —
11
+ * три `OneToMany` сняты с `eager: true` ради `getSlots` `findByIds` и
12
+ * самого bootstrap'а. См. `docs/optimization/15-questroom-eager-removal.md`.
13
+ * - Горячие модалки (`order`, `order-new`, `email-example`) читают только
14
+ * `modes`/`locales` — full `QuestroomRO` им избыточен. Один общий
15
+ * запрос дешевле, чем N запросов `useGetOne(id)` при каждом открытии.
16
+ *
17
+ * Payload: ~700 байт на квест × до 50 квестов = ~35 КБ на сессию.
18
+ */
19
+ export declare class QuestroomExtrasRO {
20
+ questroomId: number;
21
+ modes: QuestroomLightMode[];
22
+ locales: QuestroomLightLocale[];
23
+ }
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.QuestroomExtrasRO = void 0;
13
+ /* eslint-disable max-classes-per-file */
14
+ const class_transformer_1 = require("class-transformer");
15
+ const questroom_light_ro_1 = require("./questroom-light.ro");
16
+ /**
17
+ * Lazy-payload `modes` + `locales` для одного квеста.
18
+ *
19
+ * Возвращается из `GET /questrooms/extras` единым массивом
20
+ * `QuestroomExtrasRO[]` для всего scope (current profile / scope.questroomsIds)
21
+ * и кэшируется на фронте в `questroom-extras-slice`.
22
+ *
23
+ * Зачем отдельный endpoint:
24
+ * - `QuestroomLightRO` (bootstrap) после Phase 3 не несёт `modes`/`locales` —
25
+ * три `OneToMany` сняты с `eager: true` ради `getSlots` `findByIds` и
26
+ * самого bootstrap'а. См. `docs/optimization/15-questroom-eager-removal.md`.
27
+ * - Горячие модалки (`order`, `order-new`, `email-example`) читают только
28
+ * `modes`/`locales` — full `QuestroomRO` им избыточен. Один общий
29
+ * запрос дешевле, чем N запросов `useGetOne(id)` при каждом открытии.
30
+ *
31
+ * Payload: ~700 байт на квест × до 50 квестов = ~35 КБ на сессию.
32
+ */
33
+ class QuestroomExtrasRO {
34
+ }
35
+ exports.QuestroomExtrasRO = QuestroomExtrasRO;
36
+ __decorate([
37
+ (0, class_transformer_1.Expose)(),
38
+ __metadata("design:type", Number)
39
+ ], QuestroomExtrasRO.prototype, "questroomId", void 0);
40
+ __decorate([
41
+ (0, class_transformer_1.Expose)(),
42
+ (0, class_transformer_1.Type)(() => questroom_light_ro_1.QuestroomLightMode),
43
+ __metadata("design:type", Array)
44
+ ], QuestroomExtrasRO.prototype, "modes", void 0);
45
+ __decorate([
46
+ (0, class_transformer_1.Expose)(),
47
+ (0, class_transformer_1.Type)(() => questroom_light_ro_1.QuestroomLightLocale),
48
+ __metadata("design:type", Array)
49
+ ], QuestroomExtrasRO.prototype, "locales", void 0);
@@ -31,10 +31,16 @@ export declare class QuestroomLightMode {
31
31
  * - `disabledLanguages`, `alternativeScenarioIds`,
32
32
  * `requiredPositionsIds`
33
33
  * - `profileId` (нигде в app-сторе не читается)
34
+ * - `locales`, `modes` — три eager-OneToMany на `QuestroomEntity`
35
+ * давали ×3 JOIN'а на каждый bootstrap и при `findByIds` в
36
+ * `getSlots` (см. `docs/optimization/14-questroom-eager-removal.md`).
37
+ * Модалки (order-new ModeSelector, email-example, questroom
38
+ * localization, questroom modes editor) подтягивают полный
39
+ * `QuestroomRO` через `useGetOne(id, questroomsApi.getOne)`.
34
40
  *
35
- * Остальное (включая `photos`, `legend`, `importantInfo`, `modes`,
36
- * `actors` и т.д.) используется в verify-company onboarding,
37
- * order-new, calendar и settings — поэтому остаётся в light.
41
+ * Остальное (`photos`, `legend`, `importantInfo`, `actors` и т.д.)
42
+ * используется в verify-company onboarding, calendar и settings —
43
+ * поэтому остаётся в light.
38
44
  */
39
45
  export declare class QuestroomLightRO extends RO {
40
46
  deletedAt?: Date;
@@ -42,17 +48,10 @@ export declare class QuestroomLightRO extends RO {
42
48
  locationId: number;
43
49
  type: QuestroomTypeEnum;
44
50
  difficult: number;
45
- locales: QuestroomLightLocale[];
46
- modes: QuestroomLightMode[];
47
51
  fear: number;
48
52
  minAge: number;
49
53
  time: number;
50
54
  templateId: number;
51
- /**
52
- * Type of the linked SlotTemplate (`fixed` or `flex`). Denormalized from
53
- * `SlotTemplate.type` so consumers (calendar, schedule editor) can branch
54
- * on the schedule kind without an extra fetch.
55
- */
56
55
  templateType?: SlotTemplateType;
57
56
  ticketSystem: boolean;
58
57
  resourceUnitsTotal: number;
@@ -72,10 +72,16 @@ __decorate([
72
72
  * - `disabledLanguages`, `alternativeScenarioIds`,
73
73
  * `requiredPositionsIds`
74
74
  * - `profileId` (нигде в app-сторе не читается)
75
+ * - `locales`, `modes` — три eager-OneToMany на `QuestroomEntity`
76
+ * давали ×3 JOIN'а на каждый bootstrap и при `findByIds` в
77
+ * `getSlots` (см. `docs/optimization/14-questroom-eager-removal.md`).
78
+ * Модалки (order-new ModeSelector, email-example, questroom
79
+ * localization, questroom modes editor) подтягивают полный
80
+ * `QuestroomRO` через `useGetOne(id, questroomsApi.getOne)`.
75
81
  *
76
- * Остальное (включая `photos`, `legend`, `importantInfo`, `modes`,
77
- * `actors` и т.д.) используется в verify-company onboarding,
78
- * order-new, calendar и settings — поэтому остаётся в light.
82
+ * Остальное (`photos`, `legend`, `importantInfo`, `actors` и т.д.)
83
+ * используется в verify-company onboarding, calendar и settings —
84
+ * поэтому остаётся в light.
79
85
  */
80
86
  class QuestroomLightRO extends ro_class_1.RO {
81
87
  }
@@ -100,16 +106,6 @@ __decorate([
100
106
  (0, class_transformer_1.Expose)(),
101
107
  __metadata("design:type", Number)
102
108
  ], QuestroomLightRO.prototype, "difficult", void 0);
103
- __decorate([
104
- (0, class_transformer_1.Expose)(),
105
- (0, class_transformer_1.Type)(() => QuestroomLightLocale),
106
- __metadata("design:type", Array)
107
- ], QuestroomLightRO.prototype, "locales", void 0);
108
- __decorate([
109
- (0, class_transformer_1.Expose)(),
110
- (0, class_transformer_1.Type)(() => QuestroomLightMode),
111
- __metadata("design:type", Array)
112
- ], QuestroomLightRO.prototype, "modes", void 0);
113
109
  __decorate([
114
110
  (0, class_transformer_1.Expose)(),
115
111
  __metadata("design:type", Number)
@@ -1,8 +1,18 @@
1
1
  import { Languages } from '../shared/enum/languages.enum';
2
2
  import { QuestroomLightLocale, QuestroomLightMode, QuestroomLightRO } from './questroom-light.ro';
3
- export { QuestroomLightLocale as QuestroomLocale };
4
- export { QuestroomLightMode as QuestroomMode };
3
+ export { QuestroomLightLocale as QuestroomLocale, QuestroomLightMode as QuestroomMode };
4
+ /**
5
+ * Полный quest RO. Возвращается из `GET /questrooms/:id`. Содержит
6
+ * `locales` и `modes`, которые НЕ грузятся в `QuestroomLightRO` ради
7
+ * экономии на bootstrap и `getSlots` `findByIds` (см.
8
+ * `QuestroomEntity` — все три OneToMany сняты с `eager: true`).
9
+ *
10
+ * Модалки на app фронте подтягивают полный объект через
11
+ * `useGetOne(id, questroomsApi.getOne)`.
12
+ */
5
13
  export declare class QuestroomRO extends QuestroomLightRO {
14
+ locales: QuestroomLightLocale[];
15
+ modes: QuestroomLightMode[];
6
16
  profileId: number;
7
17
  requiredPositionsIds: number[];
8
18
  alternativeScenarioIds: number[];
@@ -15,9 +15,28 @@ const class_transformer_1 = require("class-transformer");
15
15
  const questroom_light_ro_1 = require("./questroom-light.ro");
16
16
  Object.defineProperty(exports, "QuestroomLocale", { enumerable: true, get: function () { return questroom_light_ro_1.QuestroomLightLocale; } });
17
17
  Object.defineProperty(exports, "QuestroomMode", { enumerable: true, get: function () { return questroom_light_ro_1.QuestroomLightMode; } });
18
+ /**
19
+ * Полный quest RO. Возвращается из `GET /questrooms/:id`. Содержит
20
+ * `locales` и `modes`, которые НЕ грузятся в `QuestroomLightRO` ради
21
+ * экономии на bootstrap и `getSlots` `findByIds` (см.
22
+ * `QuestroomEntity` — все три OneToMany сняты с `eager: true`).
23
+ *
24
+ * Модалки на app фронте подтягивают полный объект через
25
+ * `useGetOne(id, questroomsApi.getOne)`.
26
+ */
18
27
  class QuestroomRO extends questroom_light_ro_1.QuestroomLightRO {
19
28
  }
20
29
  exports.QuestroomRO = QuestroomRO;
30
+ __decorate([
31
+ (0, class_transformer_1.Expose)(),
32
+ (0, class_transformer_1.Type)(() => questroom_light_ro_1.QuestroomLightLocale),
33
+ __metadata("design:type", Array)
34
+ ], QuestroomRO.prototype, "locales", void 0);
35
+ __decorate([
36
+ (0, class_transformer_1.Expose)(),
37
+ (0, class_transformer_1.Type)(() => questroom_light_ro_1.QuestroomLightMode),
38
+ __metadata("design:type", Array)
39
+ ], QuestroomRO.prototype, "modes", void 0);
21
40
  __decorate([
22
41
  (0, class_transformer_1.Expose)(),
23
42
  __metadata("design:type", Number)
@@ -11,10 +11,9 @@
11
11
  *
12
12
  * Семантика финансовых полей:
13
13
  * - gross — стоимость по прайсу (SUM(total)). Не выручка.
14
- * - cash — реально полученные деньги (SUM(cashReceived)). Это «выручка».
14
+ * - cash — нетто-выручка: SUM(cashReceived), возвраты уже учтены в транзакциях со знаком.
15
15
  * - discount — сумма ручных скидок (SUM(discountTotal)).
16
16
  * - promocode — сумма промокодов (SUM(promocodeTotal)).
17
- * - refunded — реально возвращённые клиенту деньги (SUM(refundedAmount)).
18
17
  * - nominalSold — суммарный номинал когорты (SUM(nominal)).
19
18
  * - nominalRedeemed — сколько из этого номинала уже потрачено в заказах
20
19
  * (SUM(usedAmount)).
@@ -29,13 +28,11 @@ export type CertificatesOverview = {
29
28
  annulledCount: number;
30
29
  /** Сколько из когорты уже полностью погашено (fullyUsedAt IS NOT NULL). */
31
30
  fullyUsedCount: number;
32
- /** Сколько ушло в подарок (isGift = true) среди soldCount. */
33
- giftCount: number;
34
31
  gross: number;
32
+ /** Нетто-выручка: SUM(cashReceived), возвраты уже внутри. */
35
33
  cash: number;
36
34
  discount: number;
37
35
  promocode: number;
38
- refunded: number;
39
36
  /** Средний чек по cash: cash / soldCount, 0 если нет продаж. */
40
37
  avgCheck: number;
41
38
  /** Суммарный номинал по когорте: SUM(nominal). */
@@ -53,17 +50,19 @@ export type CertificatesDynamicRow = {
53
50
  cash: number;
54
51
  discount: number;
55
52
  promocode: number;
56
- refunded: number;
57
53
  };
58
- export type CertificatesByTemplateRow = {
59
- certificateId: number | null;
60
- designId: number | null;
61
- nominalId: number | null;
54
+ /** Топ дизайнов по snapshot `designTitle` (fallback — title v1-шаблона). */
55
+ export type CertificatesByDesignTitleRow = {
62
56
  title: string;
63
57
  soldCount: number;
64
- cash: number;
65
- avgCheck: number;
66
58
  };
59
+ /** Топ номиналов по полю `nominal` (размер в мин. единицах валюты). */
60
+ export type CertificatesByNominalRow = {
61
+ nominal: number;
62
+ soldCount: number;
63
+ };
64
+ /** @deprecated Используйте CertificatesByDesignTitleRow */
65
+ export type CertificatesByTemplateRow = CertificatesByDesignTitleRow;
67
66
  export type CertificatesBySourceRow = {
68
67
  source: string;
69
68
  soldCount: number;
@@ -131,7 +130,10 @@ export type CertificatesRedemptionVelocity = {
131
130
  export type CertificatesReportRO = {
132
131
  overview: CertificatesOverview;
133
132
  dynamic: CertificatesDynamicRow[];
134
- byTemplate: CertificatesByTemplateRow[];
133
+ /** Топ-3 по названию дизайна (`designTitle`). */
134
+ byDesignTitle: CertificatesByDesignTitleRow[];
135
+ /** Топ-3 по размеру номинала (`nominal`). */
136
+ byNominal: CertificatesByNominalRow[];
135
137
  bySource: CertificatesBySourceRow[];
136
138
  byDelivery: CertificatesByDeliveryRow[];
137
139
  byUtm: CertificatesByUtmRow[];
@@ -5,8 +5,21 @@ export declare enum PeriodType {
5
5
  QUARTER = "quarter",
6
6
  YEAR = "year"
7
7
  }
8
+ /**
9
+ * Запрос статистических отчётов.
10
+ *
11
+ * Период задаётся диапазоном дней `dateFrom..dateTo` (включительно), оба —
12
+ * `YYYY-MM-DD`. Это единый контракт для всех вкладок (Месяц/Квартал/Год/
13
+ * Произвольный период): фронт раскрывает выбранный шаг до конкретных
14
+ * границ диапазона и шлёт их сюда. Никакого округления до месяцев —
15
+ * операционные отчёты (orders/certificates/promocodes) фильтруют по
16
+ * `createdAt`/`paidAt` напрямую. Бухгалтерские отчёты (P&L/Cash Flow)
17
+ * внутри сервиса разворачивают диапазон в список месяцев под денорм-
18
+ * колонки `paymentPeriod`/`period` (см. TransactionService).
19
+ */
8
20
  export declare class DashboardQueryDto {
9
- periods: string[];
21
+ dateFrom: string;
22
+ dateTo: string;
10
23
  locationId?: number;
11
24
  questroomId?: number;
12
25
  utmSource?: string;
@@ -17,13 +17,31 @@ var PeriodType;
17
17
  PeriodType["QUARTER"] = "quarter";
18
18
  PeriodType["YEAR"] = "year";
19
19
  })(PeriodType || (exports.PeriodType = PeriodType = {}));
20
+ /**
21
+ * Запрос статистических отчётов.
22
+ *
23
+ * Период задаётся диапазоном дней `dateFrom..dateTo` (включительно), оба —
24
+ * `YYYY-MM-DD`. Это единый контракт для всех вкладок (Месяц/Квартал/Год/
25
+ * Произвольный период): фронт раскрывает выбранный шаг до конкретных
26
+ * границ диапазона и шлёт их сюда. Никакого округления до месяцев —
27
+ * операционные отчёты (orders/certificates/promocodes) фильтруют по
28
+ * `createdAt`/`paidAt` напрямую. Бухгалтерские отчёты (P&L/Cash Flow)
29
+ * внутри сервиса разворачивают диапазон в список месяцев под денорм-
30
+ * колонки `paymentPeriod`/`period` (см. TransactionService).
31
+ */
20
32
  class DashboardQueryDto {
21
33
  }
22
34
  exports.DashboardQueryDto = DashboardQueryDto;
23
35
  __decorate([
24
- (0, class_validator_1.IsArray)(),
25
- __metadata("design:type", Array)
26
- ], DashboardQueryDto.prototype, "periods", void 0);
36
+ (0, class_validator_1.IsString)(),
37
+ (0, class_validator_1.Matches)(/^\d{4}-\d{2}-\d{2}$/),
38
+ __metadata("design:type", String)
39
+ ], DashboardQueryDto.prototype, "dateFrom", void 0);
40
+ __decorate([
41
+ (0, class_validator_1.IsString)(),
42
+ (0, class_validator_1.Matches)(/^\d{4}-\d{2}-\d{2}$/),
43
+ __metadata("design:type", String)
44
+ ], DashboardQueryDto.prototype, "dateTo", void 0);
27
45
  __decorate([
28
46
  (0, class_validator_1.IsOptional)(),
29
47
  (0, class_validator_1.IsOptional)(),