@mivis/petmart-api 1.2.258 → 1.2.260

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 (3) hide show
  1. package/index.js +1 -1
  2. package/package.json +11 -11
  3. package/type.d.ts +2470 -2346
package/type.d.ts CHANGED
@@ -1,2346 +1,2470 @@
1
- declare namespace Components {
2
- namespace Schemas {
3
- export interface FilterBaseQuery {
4
- skip: string;
5
- limit: string;
6
- }
7
- export interface ITokensResponse {
8
- access_token: string;
9
- refresh_token: string;
10
- }
11
- export interface ILoginRequest {
12
- email: string;
13
- password: string;
14
- type: ELoginTypes;
15
- }
16
- export interface ISignUpRequest {
17
- email: string;
18
- password: string;
19
- }
20
- export interface ILoginResponse extends ITokensResponse {
21
- isSeller: boolean;
22
- user_id: string;
23
- isActivated: boolean;
24
- isExistPassword: boolean;
25
- role: ERoles;
26
- isNewUser: boolean;
27
- }
28
-
29
- export type ISignUpResponse = ITokensResponse;
30
-
31
- export interface IRecoveryRequest {
32
- email: string;
33
- password: string;
34
- }
35
-
36
- export interface IRecoveryResponse {
37
- message: string;
38
- }
39
-
40
- export interface IActivationRequest {
41
- email: string;
42
- activation_code: number;
43
- }
44
-
45
- export interface IActivationResponse {
46
- message: string;
47
- }
48
-
49
- export interface IRefreshRequest {
50
- refreshToken: string;
51
- }
52
-
53
- export type IRefreshResponse = ITokensResponse & { is_activated: boolean };
54
-
55
- export enum ELoginTypes {
56
- SELLER = 'SELLER',
57
- USER = 'USER',
58
- WEB = 'WEB',
59
- }
60
-
61
- export interface ISendEmailRequest {
62
- email: string;
63
- }
64
-
65
- export interface ISendEmailResponse {
66
- message: string;
67
- }
68
-
69
- export interface ISignUpGoogleRequest {
70
- access_token: string;
71
- auth_type: ELoginTypes;
72
- }
73
-
74
- export type ISignUpGoogleResponse = ILoginResponse;
75
-
76
- export interface ISignUpAppleRequest {
77
- code: string;
78
- auth_type: ELoginTypes;
79
- }
80
-
81
- export type ISignUpAppleResponse = ILoginResponse;
82
-
83
- export interface ISignUpVkRequest {
84
- silent_token: string;
85
- uuid: string;
86
- auth_type: ELoginTypes;
87
- }
88
-
89
- export type ISignUpVkResponse = ILoginResponse;
90
-
91
- export enum ERoles {
92
- ADMIN = 'ADMIN',
93
- USER = 'USER',
94
- }
95
-
96
- export interface IActionsProductRequest {
97
- toDelete: string;
98
- toPublish: string;
99
- toCopy: string;
100
- toDraft: string;
101
- toReject: string;
102
- }
103
-
104
- export enum EActions {
105
- DELETE = 'toDelete',
106
- PUBLISH = 'toPublish',
107
- COPY = 'toCopy',
108
- DRAFT = 'toDraft',
109
- REJECT = 'toReject',
110
- }
111
-
112
- export interface IActionsProductResponse {
113
- message: string;
114
- }
115
-
116
- export interface IUser {
117
- _id: string;
118
- tel?: number;
119
- name?: string;
120
- surname?: string;
121
- patronymic?: string;
122
- full_name?: string;
123
- birthday?: Date;
124
- email?: string;
125
- role: ERoles;
126
- vk_id?: number;
127
- expo_push_token?: string;
128
- number: number;
129
- is_activated: boolean;
130
- createdAt: Date;
131
- updatedAt: Date;
132
- }
133
-
134
- export interface IShortUser {
135
- _id: string;
136
- tel?: number;
137
- name?: string;
138
- surname?: string;
139
- patronymic?: string;
140
- full_name?: string;
141
- birthday?: Date;
142
- email?: string;
143
- number: number;
144
- }
145
-
146
- export interface IAdminUserQueryResponse {
147
- users: IShortUser[];
148
- count: number;
149
- }
150
-
151
- export interface IAdminUsersQueryRequest extends FilterBaseQuery {
152
- tel?: string;
153
- full_name?: string;
154
- email?: string;
155
- number?: string;
156
- all_fields?: string;
157
- }
158
-
159
- export interface IAdminCreateUser {
160
- name: string;
161
- surname: string;
162
- patronymic?: string;
163
- email: string;
164
- tel: number;
165
- password: string;
166
- }
167
-
168
- export interface IAdminUpdateUser {
169
- _id: string;
170
- name: string;
171
- surname: string;
172
- patronymic?: string;
173
- tel: number;
174
- email: string;
175
- }
176
-
177
- export interface IActionsUsersRequest {
178
- toDelete: string;
179
- }
180
-
181
- export interface IAddress {
182
- _id: string;
183
- address: string;
184
- floor: number;
185
- intercom?: string;
186
- entrance: number;
187
- index?: number;
188
- flat: number;
189
- createdAt: Date;
190
- updatedAt: Date;
191
- }
192
-
193
- export interface IUserAddress extends IAddress {
194
- user_id: string;
195
- }
196
-
197
- export interface IUpdateUser {
198
- name: string;
199
- surname: string;
200
- patronymic?: string;
201
- tel: number;
202
- email: string;
203
- birthday?: Date;
204
- password?: string;
205
- expo_push_token?: string;
206
- }
207
-
208
- export enum EUserTransactionsType {
209
- PURCHASE = 'PURCHASE',
210
- REFUND = 'REFUND',
211
- }
212
-
213
- export interface ICreateAddress {
214
- user_id: string;
215
- floor: number;
216
- intercom: string;
217
- entrance: number;
218
- index: number;
219
- flat: number;
220
- address: string;
221
- }
222
-
223
- export interface IUpdateAddress {
224
- id: string;
225
- floor: number;
226
- intercom: string;
227
- entrance: number;
228
- index: number;
229
- flat: number;
230
- address: string;
231
- }
232
-
233
- export enum EUnit {
234
- KG = 'KG',
235
- GR = 'GR',
236
- }
237
-
238
- export interface IDimension {
239
- width: number;
240
- height: number;
241
- length: number;
242
- weight: number;
243
- in_stock: number;
244
- unit: EUnit;
245
- }
246
-
247
- export interface ICharacteristic {
248
- name: string;
249
- value: string;
250
- }
251
-
252
- export enum EProductType {
253
- PRODUCT = 'PRODUCT',
254
- VARIATION = 'VARIATION',
255
- }
256
-
257
- export interface IProduct {
258
- _id: string;
259
- type: EProductType;
260
- parent_id?: string | null; // Ссылка на родителя (исключительно для вариаций)
261
- name: string;
262
- status: EProductStatus; // Для вариаций статус всегда PUBLISHED
263
- subCategory_id: string;
264
- category_id: string;
265
- seller_id: string;
266
- vendor_code: string;
267
- price: number;
268
- discount?: number;
269
- tax: number;
270
- dimension: IDimension;
271
- photo: string[];
272
- desc: string;
273
- characteristic: ICharacteristic[];
274
- external_item_id: string | null;
275
- variations?: IProduct[];
276
- purchases_count: number;
277
- number: number;
278
- article: string; // example: 002281
279
- slug: string;
280
- published_at?: Date;
281
- entityAnalytics?: IEntityAnalytics;
282
- low_stock_flag: boolean;
283
- f_price: number | null;
284
- createdAt: Date;
285
- updatedAt: Date;
286
- }
287
-
288
- export interface IProductQueryRequest extends FilterBaseQuery {
289
- category_id?: string;
290
- subCategory_id?: string;
291
- seller_id?: string;
292
- name?: string;
293
- status?: EProductStatus;
294
- all_fields?: string;
295
- type?: EProductType;
296
- isHaveParent?: boolean;
297
- excludeProductId?: string;
298
- }
299
-
300
- export interface IUserProductQueryRequest extends FilterBaseQuery {
301
- user_id?: string;
302
- category_id?: string;
303
- subCategory_id?: string;
304
- seller_id?: string;
305
- name?: string;
306
- priceMin?: string;
307
- priceMax?: string;
308
- colors?: string;
309
- brands?: string;
310
- sizes?: string;
311
- materials?: string;
312
- sortBy?: EProductsSortOptions;
313
- }
314
-
315
- export interface IProductQueryResponse {
316
- products: IProductDraftResponse[];
317
- count: number;
318
- }
319
-
320
- export interface IUserProductQueryResponse {
321
- products: IProductResponse[];
322
- subCategories: ISubCategory[];
323
- }
324
-
325
- export enum EProductStatus {
326
- DRAFT = 'DRAFT',
327
- MODERATION = 'MODERATION',
328
- PUBLISHED = 'PUBLISHED',
329
- REJECTED = 'REJECTED',
330
- ARCHIVED = 'ARCHIVED',
331
- }
332
-
333
- export interface IProductResponse {
334
- _id: string;
335
- name: string;
336
- type: EProductType;
337
- parent_id?: string | null;
338
- status: EProductStatus;
339
- subCategory_id: {
340
- _id: string;
341
- name: string;
342
- category_id: string;
343
- slug: string;
344
- };
345
- category_id: {
346
- _id: string;
347
- photo: string;
348
- name: string;
349
- slug: string;
350
- };
351
- seller_id?: {
352
- _id: string;
353
- shop_details: IShopDetails;
354
- delivery_ways: IDeliveryWays;
355
- slug: string;
356
- };
357
- vendor_code: string;
358
- price: number;
359
- discount?: number;
360
- tax: number;
361
- dimension: IDimension;
362
- photo: string[];
363
- desc: string;
364
- characteristic: ICharacteristic[];
365
- variations?: IProduct[];
366
- purchases_count: number;
367
- number: number;
368
- article: string; // example: 002281
369
- slug: string;
370
- createdAt: Date;
371
- updatedAt: Date;
372
- is_favorite?: boolean;
373
- reviewsData?: IReviewsData;
374
- published_at?: Date;
375
- entityAnalytics?: IEntityAnalytics;
376
- low_stock_flag: boolean;
377
- f_price: number | null;
378
- }
379
-
380
- type OptionalDimension = {
381
- width?: number;
382
- height?: number;
383
- length?: number;
384
- weight?: number;
385
- in_stock: number;
386
- unit?: EUnit;
387
- };
388
-
389
- type TOptionalProperties = Pick<
390
- IProductResponse,
391
- | 'category_id'
392
- | 'subCategory_id'
393
- | 'vendor_code'
394
- | 'desc'
395
- | 'characteristic'
396
- | 'tax'
397
- | 'photo'
398
- | 'price'
399
- > & {
400
- dimension?: OptionalDimension;
401
- };
402
-
403
- type TRemainingProductResponseProperties = Omit<
404
- IProductResponse,
405
- keyof TOptionalProperties
406
- >;
407
-
408
- export interface IProductDraftResponse
409
- extends TRemainingProductResponseProperties,
410
- Partial<TOptionalProperties> {}
411
-
412
- export interface IProductWithReviewResponse {
413
- product: IProductResponse;
414
- reviewsData: IReviewsData;
415
- }
416
-
417
- export interface IAddVariation {
418
- _id: string;
419
- characteristic: ICharacteristic[];
420
- }
421
-
422
- export interface ICreateProduct {
423
- name: string;
424
- status?:
425
- | EProductStatus.DRAFT
426
- | EProductStatus.PUBLISHED
427
- | EProductStatus.REJECTED;
428
- category_id: string;
429
- subCategory_id: string;
430
- vendor_code: string;
431
- price: number;
432
- tax: number;
433
- dimension: IDimension;
434
- photo: File[];
435
- desc: string;
436
- characteristic?: ICharacteristic[];
437
- variations?: IAddVariation[];
438
- }
439
-
440
- export interface ICreateVariation
441
- extends Omit<
442
- ICreateProduct,
443
- | 'status'
444
- | 'category_id'
445
- | 'subCategory_id'
446
- | 'variations'
447
- | 'photo'
448
- | 'desc'
449
- | 'characteristic'
450
- > {
451
- photo?: File[];
452
- desc?: string;
453
- seller_id: string;
454
- }
455
-
456
- export interface IUpdateProduct extends ICreateProduct {
457
- id: string;
458
- type?: EProductType;
459
- toDeletePhotos?: string[];
460
- toDeleteVariations?: string[];
461
- }
462
-
463
- export interface ICreateCart {
464
- product_id: string;
465
- count: number;
466
- price: number;
467
- }
468
-
469
- export interface IDeleteCartRequest {
470
- toDelete?: string;
471
- }
472
-
473
- export interface ICart {
474
- _id: string;
475
- user_id?: string | null;
476
- session_id?: string | null;
477
- product_id: {
478
- _id: string;
479
- name: string;
480
- photo: string[];
481
- dimension: IDimension;
482
- price: number;
483
- slug: string;
484
- category_id: {
485
- _id: string;
486
- name: string;
487
- slug: string;
488
- };
489
- subCategory_id: {
490
- _id: string;
491
- name: string;
492
- slug: string;
493
- };
494
- seller_id: {
495
- _id: string;
496
- shop_details: IShopDetails;
497
- delivery_ways: IDeliveryWays;
498
- shops_info: IShop[];
499
- slug: string;
500
- };
501
- };
502
- count: number;
503
- price: number;
504
- discounted_price: number | null;
505
- createdAt: Date;
506
- updatedAt: Date;
507
- }
508
-
509
- export interface ICreateCartResponse {
510
- message?: string;
511
- cartItem: ICart;
512
- }
513
-
514
- export interface ISetCartItemCountRequest {
515
- count: number;
516
- }
517
-
518
- export interface ICategory {
519
- _id: string;
520
- name: string;
521
- seoInfo?: ISeoInfo;
522
- photo: string;
523
- slug: string;
524
- createdAt: Date;
525
- updatedAt: Date;
526
- }
527
-
528
- export interface ISeoInfo {
529
- title?: string;
530
- desc?: string;
531
- h1?: string;
532
- seoText?: string;
533
- }
534
-
535
- export interface IAdminCategoryQueryRequest {
536
- name?: string;
537
- parsed: string;
538
- }
539
-
540
- export interface IGetCategoryQuery extends FilterBaseQuery {
541
- parsed?: string;
542
- }
543
-
544
- export interface IParsedCategory {
545
- value: string;
546
- title: string;
547
- type: string;
548
- photo: string;
549
- seoInfo?: ISeoInfo;
550
- slug: string;
551
- updatedAt: Date;
552
- children: IParsedSubCategory[];
553
- }
554
-
555
- export interface IParsedSubCategory {
556
- value: string;
557
- title: string;
558
- type: string;
559
- seoInfo?: ISeoInfo;
560
- slug: string;
561
- updatedAt: Date;
562
- status: ESubCategoryStatus;
563
- }
564
-
565
- export type ICategoryQueryResponse = ICategory[] | IParsedCategory[];
566
-
567
- export interface ICreateCategoryRequest {
568
- name: string;
569
- title?: string;
570
- desc?: string;
571
- h1?: string;
572
- seoText?: string;
573
- photo: File;
574
- }
575
-
576
- export interface IUpdateCategoryRequest
577
- extends Partial<ICreateCategoryRequest> {
578
- toDeletePhoto?: string;
579
- }
580
-
581
- export interface ISubCategory {
582
- _id: string;
583
- name: string;
584
- category_id: ICategory;
585
- status: ESubCategoryStatus;
586
- seoInfo?: ISeoInfo;
587
- slug: string;
588
- createdAt: Date;
589
- updatedAt: Date;
590
- }
591
-
592
- export interface IUserSubCategoryResponse {
593
- subCategories: ISubCategory[];
594
- productsCount: number;
595
- }
596
-
597
- export interface ICreateSubCategoryRequest {
598
- name: string;
599
- category_id: string;
600
- title?: string;
601
- desc?: string;
602
- h1?: string;
603
- seoText?: string;
604
- }
605
-
606
- export interface IUpdateSubCategoryRequest
607
- extends Partial<ICreateSubCategoryRequest> {}
608
-
609
- export enum ESubCategoryStatus {
610
- MODERATION = 'MODERATION',
611
- ACTIVE = 'ACTIVE',
612
- ARCHIVED = 'ARCHIVED',
613
- }
614
-
615
- export interface IBankingDetails {
616
- name: string;
617
- INN: string;
618
- BIK: string;
619
- KPP: string;
620
- PC: string;
621
- KC: string;
622
- legal_address: string;
623
- }
624
-
625
- export type ILegalBankingDetails = Omit<
626
- IBankingDetails,
627
- 'KPP' | 'legal_address'
628
- >;
629
- export type IPhysicalBankingDetails = Partial<
630
- Omit<IBankingDetails, 'legal_address'>
631
- > & { INN: string };
632
-
633
- export interface IShopDetails {
634
- shop_name: string;
635
- logo: string;
636
- banner: string;
637
- desc: string;
638
- }
639
-
640
- export interface IDeliveryWays {
641
- pickup: boolean;
642
- // own_delivery: boolean; // Появится в ближайшем будущем
643
- delivery_to_point: boolean;
644
- courier: boolean;
645
- yandex_express: boolean;
646
- }
647
-
648
- export enum ESellerStatus {
649
- WAITING_APPROVE = 'WAITING_APPROVE',
650
- APPROVED = 'APPROVED',
651
- DECLINED = 'DECLINED',
652
- ARCHIVED = 'ARCHIVED',
653
- }
654
-
655
- export interface IUserSellerStatusResponse {
656
- status: ESellerStatus | 'NOT_CREATED';
657
- }
658
-
659
- export interface IBalanceInfo {
660
- balance: number;
661
- total_turnover: number;
662
- withdrawn: number;
663
- }
664
-
665
- export interface IShopAddress {
666
- name: string;
667
- lat: number;
668
- lng: number;
669
- }
670
-
671
- export interface IShopWorkTime {
672
- time: string;
673
- }
674
-
675
- export interface IShop {
676
- _id: string;
677
- name: string;
678
- address: IShopAddress;
679
- nearest_metro_station: string;
680
- work_time?: IShopWorkTime[];
681
- createdAt: Date;
682
- updatedAt: Date;
683
- }
684
-
685
- export interface INearestPointOfCdek {
686
- code: string;
687
- name: string;
688
- location: {
689
- country_code: string;
690
- region_code: number;
691
- region: string;
692
- city_code: number;
693
- city: string;
694
- postal_code: string;
695
- longitude: number;
696
- latitude: number;
697
- address: string;
698
- address_full: string;
699
- };
700
- }
701
-
702
- export interface IMoySklad {
703
- account_id: string | null;
704
- api_token: string | null;
705
- }
706
-
707
- export interface ISeller {
708
- _id: string;
709
- type: ESellerTypes;
710
- user_id: {
711
- _id: string;
712
- tel: number;
713
- name: string;
714
- surname: string;
715
- full_name: string;
716
- patronymic?: string;
717
- email: string;
718
- birthday: Date;
719
- };
720
- shops_info: IShop[];
721
- nearest_point_of_cdek: INearestPointOfCdek;
722
- banking_details: IBankingDetails;
723
- additional_info?: ISellerAdditionalInfo;
724
- company_info?: ISellerCompanyInfo;
725
- shop_details: IShopDetails;
726
- delivery_ways: IDeliveryWays;
727
- balance_info: IBalanceInfo;
728
- moy_sklad?: IMoySklad;
729
- commission: number;
730
- status: ESellerStatus;
731
- telegram_message_id: number | null;
732
- api_token: string | null;
733
- slug: string;
734
- telegram_chat_id: number | null;
735
- telegram_api_token: string;
736
- number: number;
737
- createdAt: Date;
738
- updatedAt: Date;
739
- }
740
-
741
- export interface ISellerShowcaseResponse {
742
- purchasesCount: number;
743
- averageRating: string;
744
- reviewsCount: number;
745
- seller: ISeller;
746
- promoCode: IPromoCode | null;
747
- }
748
-
749
- export interface ISellerSearchQueryRequest {
750
- name?: string;
751
- }
752
-
753
- export interface IAdminSellersQueryRequest extends FilterBaseQuery {
754
- number?: string;
755
- status?: string;
756
- full_name?: string;
757
- shop_name?: string;
758
- tel?: string;
759
- all_fields?: string;
760
- }
761
-
762
- export interface IAdminSellersQueryResponse {
763
- sellers: ISeller[];
764
- count: number;
765
- }
766
-
767
- export interface ISellerInfo {
768
- name: string;
769
- surname: string;
770
- patronymic?: string;
771
- email: string;
772
- tel: number;
773
- type: ESellerTypes;
774
- opt_otch: boolean;
775
- birthday?: string;
776
- }
777
-
778
- export interface ICreateSellerInfo extends ISellerInfo {
779
- password: string;
780
- }
781
-
782
- export type ICreateShopDetails = Omit<IShopDetails, 'logo' | 'banner'>;
783
-
784
- export interface IAdminCreateSellerRequest {
785
- seller_info: ICreateSellerInfo;
786
- banking_details: ILegalBankingDetails;
787
- shop_details: ICreateShopDetails;
788
- logo: File | File[];
789
- banner: File | File[];
790
- }
791
-
792
- export interface ICreateSellerRequest {
793
- type: ESellerTypes;
794
- name: string;
795
- surname: string;
796
- patronymic?: string;
797
- tel: number;
798
- INN: string;
799
- shop_name: string;
800
- send_email?: boolean;
801
- opt_otch: boolean;
802
- }
803
-
804
- export interface IUpdateSellerRequest {
805
- seller_info: Partial<ISellerInfo>;
806
- banking_details: Partial<IBankingDetails>;
807
- shop_details: ICreateShopDetails;
808
- company_info: Partial<ISellerCompanyInfo>;
809
- logo: File | File[] | string;
810
- banner: File | File[] | string;
811
- seller_id: string;
812
- toDeletePhotos?: string[];
813
- passport_details?: string;
814
- passport_photo?: File | File[] | string;
815
- card_number?: string;
816
- }
817
-
818
- export interface IActionsSellersRequest {
819
- toDelete: string;
820
- }
821
-
822
- export interface ICreateSellerShopRequest {
823
- seller_id: string;
824
- name: string;
825
- address: {
826
- name: string;
827
- lat: number;
828
- lng: number;
829
- };
830
- work_time?: IShopWorkTime[];
831
- }
832
-
833
- export interface IAdminUpdateNearestPointOfCdekRequest
834
- extends INearestPointOfCdek {
835
- seller_id: string;
836
- }
837
-
838
- export interface IAdminUpdateDeliveryWaysRequest extends IDeliveryWays {
839
- seller_id: string;
840
- }
841
-
842
- export interface IAdminChangeOrderStatus {
843
- orderId: string;
844
- status: EOrderStatus;
845
- reason_of_cancel?: string;
846
- }
847
-
848
- export interface IAdminDenyItem {
849
- item_id: string;
850
- }
851
-
852
- export interface IAdminRemoveOrderItemRequest {
853
- current_items: IPopulatedOrderItem[];
854
- }
855
-
856
- export interface IAdminOrdersQueryRequest extends FilterBaseQuery {
857
- name?: string;
858
- from?: string;
859
- to?: string;
860
- number?: string;
861
- sum?: 'asc' | 'desc';
862
- status?: EOrderStatus;
863
- tel?: string;
864
- seller_id?: string;
865
- }
866
-
867
- export type IPopulatedOrderSeller = Pick<
868
- ISeller,
869
- '_id' | 'shop_details' | 'user_id' | 'nearest_point_of_cdek' | 'slug'
870
- >;
871
-
872
- export type IPopulatedOrderUser = Pick<
873
- IUser,
874
- | '_id'
875
- | 'name'
876
- | 'full_name'
877
- | 'surname'
878
- | 'patronymic'
879
- | 'tel'
880
- | 'email'
881
- | 'birthday'
882
- >;
883
-
884
- export type TPopulatedProductId = Pick<
885
- IProduct,
886
- '_id' | 'name' | 'vendor_code' | 'photo' | 'discount'
887
- >;
888
-
889
- export interface IPopulatedOrderItem
890
- extends Omit<IOrderItem, 'product_id'> {
891
- product_id: IProductResponse;
892
- }
893
-
894
- export type IPopulatedOrder = Omit<
895
- IOrder,
896
- 'items' | 'seller_id' | 'user_id' | 'shop_id'
897
- > & {
898
- items: IPopulatedOrderItem[];
899
- seller_id?: IPopulatedOrderSeller;
900
- user_id?: IPopulatedOrderUser;
901
- shop_id: IShop;
902
- };
903
-
904
- export interface IAdminGetOrderResponse {
905
- order: IPopulatedOrder;
906
- commission: number;
907
- }
908
-
909
- export interface IAdminOrdersQueryResponse {
910
- orders: IPopulatedOrder[];
911
- count: number;
912
- }
913
-
914
- export interface IAdminDeliveryInfo {
915
- receive_method: ERecieveMethod;
916
- preparation_date: Date;
917
- address?: string;
918
- shop_id?: string;
919
- }
920
-
921
- export interface IAdminCdekInfo {
922
- delivery_sum: number;
923
- tracking: string;
924
- }
925
-
926
- export interface IAdminUpdateOrderRequest {
927
- note?: string;
928
- delivery_info: Partial<IAdminDeliveryInfo>;
929
- cdek_info?: Partial<IAdminCdekInfo>;
930
- invoice?: File;
931
- items: IPopulatedOrderItem[];
932
- }
933
-
934
- export type OrderAddress = Omit<
935
- IAddress,
936
- 'user_id' | '_id' | 'createdAt' | 'updatedAt'
937
- >;
938
-
939
- export enum EOrderStatus {
940
- NOT_PAID = 'NOT_PAID',
941
- ON_CONFIRMATION = 'ON_CONFIRMATION',
942
- CONFIRMED_BY_SELLER = 'CONFIRMED_BY_SELLER',
943
- IN_DELIVERY = 'IN_DELIVERY',
944
- WAITING_IN_POINT = 'WAITING_IN_POINT',
945
- FINISHED = 'FINISHED',
946
- CANCELED = 'CANCELED',
947
- ARCHIVED = 'ARCHIVED',
948
- }
949
-
950
- export interface IDeliveryAddress extends OrderAddress {
951
- lat: number;
952
- lng: number;
953
- }
954
-
955
- export interface IDeliveryInfo {
956
- delivery_sum: number;
957
- address: IDeliveryAddress;
958
- tel: number;
959
- full_name: string;
960
- yandex_uuid?: string;
961
- cdek_barcode?: string;
962
- type?: DeliveryTypes;
963
- yandex_offer?: OfferDto;
964
- comment?: string;
965
- }
966
-
967
- export interface IPVZ {
968
- code: string;
969
- name: string;
970
- location: {
971
- country_code: string;
972
- region_code: number;
973
- region: string;
974
- city_code: number;
975
- city: string;
976
- postal_code: string;
977
- longitude: number;
978
- latitude: number;
979
- address: string;
980
- address_full: string;
981
- };
982
- phones: [
983
- {
984
- number: string;
985
- }
986
- ];
987
- email: string;
988
- delivery_sum: number;
989
- }
990
-
991
- export interface IPickUpPoint {
992
- shop_id: string;
993
- }
994
-
995
- export enum ERecieveMethod {
996
- PICKUP_POINT = 'PICKUP_POINT',
997
- COURIER = 'COURIER',
998
- PVZ = 'PVZ',
999
- EXPRESS = 'EXPRESS',
1000
- }
1001
-
1002
- export enum EOrderItemsStatus {
1003
- AGREED = 'AGREED',
1004
- DENIED = 'DENIED',
1005
- }
1006
-
1007
- export interface IOrderItem {
1008
- _id: string;
1009
- product_id: string;
1010
- count: number;
1011
- price: number; // Сумма за одну единицу товара * количество товаров
1012
- discounted_price: number | null;
1013
- dimension: IDimension; // Габариты за единицу товара
1014
- items_status: EOrderItemsStatus;
1015
- }
1016
-
1017
- export interface ICheckIsAlsoInStock {
1018
- cartItems: ICart[];
1019
- }
1020
-
1021
- export interface ICreateOrder {
1022
- items: Omit<IOrderItem, '_id' | 'items_status'>[];
1023
- receive_method: ERecieveMethod;
1024
- receive_method_data: IDeliveryInfo | IPVZ | IPickUpPoint;
1025
- seller_id: string;
1026
- }
1027
-
1028
- export interface IGetAllOrders {
1029
- user_id: string;
1030
- skip: number;
1031
- limit: number;
1032
- }
1033
-
1034
- export type IPopulatedOrderShop = IShop;
1035
-
1036
- export interface IPopulatedOrderItemApp
1037
- extends Omit<IOrderItem, 'product_id'> {
1038
- product_id: IProductResponse;
1039
- }
1040
-
1041
- export type IPopulatedOrderUserApp = Pick<
1042
- IUser,
1043
- | '_id'
1044
- | 'name'
1045
- | 'full_name'
1046
- | 'surname'
1047
- | 'patronymic'
1048
- | 'tel'
1049
- | 'email'
1050
- | 'birthday'
1051
- >;
1052
-
1053
- export type IPopulatedOrderApp = Omit<
1054
- IOrder,
1055
- 'items' | 'shop_id' | 'user_id'
1056
- > & {
1057
- items: IPopulatedOrderItemApp[];
1058
- user_id: IPopulatedOrderUserApp;
1059
- shop_id: IPopulatedOrderShop;
1060
- };
1061
-
1062
- export enum EReasonOfCancel {
1063
- CHANGED_DELIVERY_DATE = 'Перенесли срок доставки',
1064
- INCORRECT_CREATED_ORDER = 'Хочу изменить заказ и оформить заново',
1065
- FOUND_CHEAPER = 'Нашел дешевле',
1066
- WRONG_ADDRESS = 'Указал неверный адрес',
1067
- OTHER = 'Другое',
1068
- }
1069
-
1070
- export interface ICancelOrderRequest {
1071
- orderId: string;
1072
- reason_of_cancel: EReasonOfCancel;
1073
- }
1074
-
1075
- export interface ICreateMultiOrder {
1076
- orders: ICreateOrder[];
1077
- sum: number;
1078
- tel: number;
1079
- email: string;
1080
- name: string;
1081
- surname: string;
1082
- patronymic?: string;
1083
- }
1084
-
1085
- export interface IDeliveryFullInfo extends IDeliveryInfo {
1086
- tracking: string;
1087
- invoice: string;
1088
- }
1089
-
1090
- export interface IGetCDEKOffices {
1091
- weight_max?: string;
1092
- city: string; // city or city_district from dadata
1093
- }
1094
-
1095
- export interface ICDEKOffice {
1096
- code: string;
1097
- name: string;
1098
- uuid: string;
1099
- address_comment: string;
1100
- nearest_metro_station: string;
1101
- work_time: string;
1102
- phones: [
1103
- {
1104
- number: string;
1105
- }
1106
- ];
1107
- email: string;
1108
- note: string;
1109
- type: string;
1110
- owner_code: string;
1111
- take_only: boolean;
1112
- is_handout: boolean;
1113
- is_reception: boolean;
1114
- is_dressing_room: boolean;
1115
- is_ltl: boolean;
1116
- have_cashless: boolean;
1117
- have_cash: boolean;
1118
- allowed_cod: boolean;
1119
- site: string;
1120
- work_time_list: [
1121
- {
1122
- day: number;
1123
- time: string;
1124
- }
1125
- ];
1126
- weight_min: number;
1127
- weight_max: number;
1128
- location: {
1129
- country_code: string;
1130
- region_code: number;
1131
- region: string;
1132
- city_code: number;
1133
- city: string;
1134
- fias_guid: string;
1135
- postal_code: string;
1136
- longitude: number;
1137
- latitude: number;
1138
- address: string;
1139
- address_full: string;
1140
- };
1141
- fulfillment: boolean;
1142
- }
1143
-
1144
- export interface GetDeliverySum {
1145
- address: string;
1146
- type: ERecieveMethod.COURIER | ERecieveMethod.PVZ;
1147
- items: Omit<IOrderItem, '_id' | 'items_status'>[];
1148
- seller_id: string;
1149
- }
1150
-
1151
- export interface IDeliverySum {
1152
- delivery_sum: number;
1153
- period_min: number;
1154
- period_max: number;
1155
- calendar_min: number;
1156
- calendar_max: number;
1157
- weight_calc: number;
1158
- services: [
1159
- {
1160
- code: string;
1161
- sum: number;
1162
- }
1163
- ];
1164
- total_sum: number;
1165
- currency: string;
1166
- }
1167
-
1168
- export interface IOrder {
1169
- _id: string;
1170
- total_received: number; // Сколько всего заплатил покупатель за этот заказ (сумма товаров + доставки)
1171
- current_commission: number; // Текущая комиссия продавца за заказ (Сумма товаров * комиссию продавца / 100)
1172
- sum: number;
1173
- original_sum: number; // Сумма без учёта скидок
1174
- full_sum: number; // Сумма с учетом доставки и коммиссии сервиса
1175
- weight: number; // Общий вес в граммах
1176
- user_id?: string;
1177
- items: IOrderItem[];
1178
- seller_id?: string;
1179
- receive_method: ERecieveMethod;
1180
- delivery_info?: Partial<IDeliveryFullInfo>;
1181
- shop_id?: string;
1182
- pvz?: Partial<IPVZ>;
1183
- status: EOrderStatus;
1184
- preparation_date?: Date;
1185
- note?: string;
1186
- reason_of_cancel?: string;
1187
- number: number;
1188
- createdAt: Date;
1189
- updatedAt: Date;
1190
- type?: DeliveryTypes;
1191
- yandex_offer?: OfferDto;
1192
- }
1193
-
1194
- export interface IAdminMultiOrderResponse
1195
- extends Omit<IMultiOrder, 'orders'> {
1196
- orders: IPopulatedOrder[];
1197
- }
1198
-
1199
- export interface IMultiOrder {
1200
- _id: string;
1201
- user_id: string;
1202
- sum: number;
1203
- orders: string[];
1204
- payment_id: string | null;
1205
- number: number;
1206
- status: EMultiOrderStatus;
1207
- createdAt: Date;
1208
- updatedAt: Date;
1209
- }
1210
-
1211
- export interface IPaymentCheckResponse {
1212
- id: string;
1213
- status: string;
1214
- amount: {
1215
- value: string;
1216
- currency: string;
1217
- };
1218
- description: string;
1219
- captured_at: string;
1220
- created_at: string;
1221
- metadata: {
1222
- multiOrderId: string;
1223
- multiOrderNumber: string;
1224
- };
1225
- confirmation: IConfirmation;
1226
- purchase_unique: boolean;
1227
- }
1228
-
1229
- export type IConfirmationType = 'embedded' | 'external' | 'qr' | 'redirect';
1230
-
1231
- export interface IConfirmation {
1232
- type: IConfirmationType;
1233
- locale?: string;
1234
- confirmation_token?: string;
1235
- confirmation_data?: string;
1236
- confirmation_url?: string;
1237
- enforce?: boolean;
1238
- return_url?: string;
1239
- }
1240
-
1241
- export interface IPaymentResponse {
1242
- id: string;
1243
- status: string;
1244
- amount: {
1245
- value: string;
1246
- currency: string;
1247
- };
1248
- description: string;
1249
- created_at: string;
1250
- confirmation: IConfirmation;
1251
- metadata: {
1252
- multiOrderId: string;
1253
- multiOrderNumber: string;
1254
- };
1255
- }
1256
-
1257
- export enum EMultiOrderStatus {
1258
- CANCELED = 'CANCELED',
1259
- PAID = 'PAID',
1260
- PENDING = 'PENDING',
1261
- }
1262
-
1263
- export enum EComplaintsReason {
1264
- NOT_MATCH_TO_DESC = 'NOT_MATCH_TO_DESC',
1265
- INCORRECT_PHOTO = 'INCORRECT_PHOTO',
1266
- DAMAGED_GOODS = 'DAMAGED_GOODS',
1267
- POOR_QUALITY = 'POOR_QUALITY',
1268
- FRAUD = 'FRAUD',
1269
- OTHER = 'OTHER',
1270
- }
1271
-
1272
- export interface IComplaints {
1273
- _id: string;
1274
- user_id: string;
1275
- product_id: string;
1276
- text?: string;
1277
- reason: EComplaintsReason;
1278
- }
1279
-
1280
- export interface ICreateComplaints {
1281
- product_id: string;
1282
- text?: string;
1283
- reason: EComplaintsReason;
1284
- }
1285
-
1286
- export enum EReviewEntityType {
1287
- PRODUCT = 'PRODUCT',
1288
- HORSE = 'HORSE',
1289
- SERVICE = 'SERVICE',
1290
- }
1291
-
1292
- export enum ECreatorType {
1293
- SELLER = 'SELLER',
1294
- USER = 'USER',
1295
- }
1296
-
1297
- export interface IReview {
1298
- _id: string;
1299
- user_id?: string;
1300
- entity_id: string;
1301
- entity_type: EReviewEntityType;
1302
- creator_id: string;
1303
- creator_type: ECreatorType;
1304
- rating: number;
1305
- text: string;
1306
- anonymity: boolean;
1307
- }
1308
-
1309
- export interface IReviewsRequest {
1310
- entity_id: string;
1311
- entity_type: EReviewEntityType;
1312
- creator_id: string;
1313
- creator_type: ECreatorType;
1314
- }
1315
-
1316
- export interface IGetReviewsRequest
1317
- extends Partial<FilterBaseQuery & IReviewsRequest> {}
1318
-
1319
- export interface IReviewResponse {
1320
- _id: string;
1321
- user_id: {
1322
- _id: string;
1323
- tel: number;
1324
- name: string;
1325
- birthday: Date;
1326
- email: string;
1327
- full_name: string;
1328
- patronymic: string;
1329
- surname: string;
1330
- };
1331
- entity_id: string; // ID сущности, к которой привязан отзыв (например, Product или Horse)
1332
- entity_type: EReviewEntityType; // Тип сущности (Product, Horse и т.д.)
1333
- creator_id: string; // ID создателя сущности (продавец или пользователь)
1334
- creator_type: ECreatorType; // Тип создателя (SELLER или USER)
1335
- rating: number;
1336
- text?: string;
1337
- anonymity: boolean;
1338
- createdAt: Date;
1339
- updatedAt: Date;
1340
- }
1341
-
1342
- export interface IGetReviewDataRequest extends Partial<IReviewsRequest> {}
1343
-
1344
- export interface IReviewsData {
1345
- count: number;
1346
- averageRating: string;
1347
- sellerName?: string;
1348
- }
1349
-
1350
- export interface ICreateReviewRequest {
1351
- entity_id: string;
1352
- entity_type: EReviewEntityType;
1353
- text?: string;
1354
- anonymity: boolean;
1355
- rating: number;
1356
- }
1357
-
1358
- export interface IDeleteReviewQuery {
1359
- toDelete: string;
1360
- }
1361
-
1362
- export enum ESellerTransactionsType {
1363
- SALE = 'SALE',
1364
- FINE = 'FINE',
1365
- WITHDRAW = 'WITHDRAW',
1366
- REFUND = 'REFUND',
1367
- }
1368
-
1369
- export interface ISellerTransactions {
1370
- _id: string;
1371
- total_received: number; // Сумма которую оплатил покупатель за этот заказ (сумма товаров + сумма доставки)
1372
- type: ESellerTransactionsType;
1373
- sum: number;
1374
- original_sum: number;
1375
- admin_id?: string;
1376
- order_id: string;
1377
- comment?: string;
1378
- commission: number;
1379
- delivery_sum?: number;
1380
- payment_id: string;
1381
- seller_id: string;
1382
- createdAt: Date;
1383
- updatedAt: Date;
1384
- }
1385
-
1386
- export interface ICreateSellerTransactions {
1387
- type: ESellerTransactionsType;
1388
- sum: number;
1389
- comment?: string;
1390
- }
1391
-
1392
- export interface IAdminGetTransactionsRequest extends FilterBaseQuery {
1393
- type?: ESellerTransactionsType;
1394
- sum?: 'asc' | 'desc';
1395
- from?: string;
1396
- to?: string;
1397
- seller_id?: string;
1398
- order_id?: string;
1399
- }
1400
-
1401
- export interface IAdminTransactionsQueryResponse {
1402
- transactions: ISellerTransactions[];
1403
- count: number;
1404
- }
1405
-
1406
- export interface IAdminTopSalesQueryRequest extends FilterBaseQuery {
1407
- seller_id: string;
1408
- }
1409
-
1410
- export interface IAdminTopSalesResponse {
1411
- products: IProduct[];
1412
- count: number;
1413
- }
1414
-
1415
- export interface IAdminChangeCommissionRequest {
1416
- commission: number;
1417
- }
1418
-
1419
- export interface IAdminChangeCommissionResponse {
1420
- commission: number;
1421
- }
1422
-
1423
- export interface IAdminGetChartDataQueryRequest {
1424
- year: string;
1425
- seller_id: string;
1426
- }
1427
-
1428
- export interface IAdminGetChartDataResponse {
1429
- [key: string]: number;
1430
- }
1431
-
1432
- export interface IAdminCreateSellerTransactionRequest {
1433
- type: ESellerTransactionsType;
1434
- sum: number;
1435
- }
1436
-
1437
- export interface IAdminAddCustomRefundTransactionRequest {
1438
- custom_sum: number;
1439
- comment: string;
1440
- }
1441
-
1442
- export enum ENotificationType {
1443
- ORDER = 'ORDER',
1444
- PRODUCT = 'PRODUCT',
1445
- COLLECTION = 'COLLECTION',
1446
- FAVORITES = 'FAVORITES',
1447
- }
1448
-
1449
- export interface IAdminChangeSellerStatusRequest {
1450
- status: ESellerStatus.APPROVED | ESellerStatus.DECLINED;
1451
- }
1452
-
1453
- export enum ESellerTypes {
1454
- PHYSICAL = 'PHYSICAL', // Физическое лицо
1455
- LEGAL = 'LEGAL', // Юридическое лицо
1456
- }
1457
-
1458
- export enum ESellerLegalTypes {
1459
- LEGAL = 'LEGAL',
1460
- INDIVIDUAL = 'INDIVIDUAL',
1461
- }
1462
-
1463
- export enum ESellerLocaleTypes {
1464
- PHYSICAL = 'Физическое лицо',
1465
- LEGAL = 'Юридическое лицо',
1466
- }
1467
-
1468
- export interface IGetInfoOfLegalRequest {
1469
- INN: string;
1470
- }
1471
-
1472
- export interface IСheckCleanOfPassportRequest {
1473
- passport_details: string;
1474
- }
1475
-
1476
- export interface ICleanPassportResponse {
1477
- source: string;
1478
- series: string;
1479
- number: string;
1480
- qc: number; // Check EPassportQc
1481
- }
1482
-
1483
- export enum EPassportQc {
1484
- 'Действующий паспорт' = 0,
1485
- 'Неправильный формат серии или номера' = 1,
1486
- 'Исходное значение пустое' = 2,
1487
- 'Недействительный паспорт' = 10,
1488
- }
1489
-
1490
- export enum ECompanyStatus {
1491
- 'ACTIVE' = 'ACTIVE',
1492
- 'LIQUIDATING' = 'LIQUIDATING',
1493
- 'LIQUIDATED' = 'LIQUIDATED',
1494
- 'BANKRUPT' = 'BANKRUPT',
1495
- 'REORGANIZING' = 'REORGANIZING',
1496
- }
1497
-
1498
- export interface ISuggestion {
1499
- value: string; // Название компании
1500
- unrestricted_value: string;
1501
- data: {
1502
- kpp: string;
1503
- branch_type: string;
1504
- type: ESellerLegalTypes;
1505
- state: {
1506
- status: ECompanyStatus;
1507
- code: null;
1508
- };
1509
- name: {
1510
- full_with_opf: string;
1511
- short_with_opf: string;
1512
- };
1513
- inn: string;
1514
- ogrn: string;
1515
- okpo: string;
1516
- address: {
1517
- value: string;
1518
- };
1519
- };
1520
- }
1521
-
1522
- export interface ICreatePhysicalSellerRequest extends ICreateSellerRequest {
1523
- birthday: string;
1524
- passport_details: string;
1525
- passport_photo: File;
1526
- }
1527
-
1528
- export interface ISellerAdditionalInfo {
1529
- passport_details?: string;
1530
- passport_photo?: string;
1531
- card_number?: string;
1532
- }
1533
-
1534
- export interface ISellerCompanyInfo {
1535
- name: string;
1536
- okpo: string;
1537
- ogrn: string;
1538
- type: ESellerLegalTypes;
1539
- }
1540
-
1541
- export interface IGetInfoOfPhysicRequest {
1542
- name: string;
1543
- surname: string;
1544
- patronymic?: string;
1545
- birthday: Date;
1546
- passport_details: string;
1547
- opt_otch: boolean;
1548
- INN: string;
1549
- }
1550
-
1551
- export interface IGetInfoOfPhysicResponse {
1552
- inn?: string;
1553
- captcha_required: boolean;
1554
- code: string; // 0 - Не найден, 1 - Все окей
1555
- }
1556
-
1557
- export interface ICheckSellerDataForCorrectness {
1558
- name: string;
1559
- surname: string;
1560
- patronymic?: string;
1561
- opt_otch: boolean;
1562
- INN: string;
1563
- birthday: Date;
1564
- passport_details: string;
1565
- }
1566
-
1567
- export enum ECheckSellerDataErrors {
1568
- 'INVALID_PASSPORT' = 'INVALID_PASSPORT',
1569
- 'INCORRECT_INN' = 'INCORRECT_INN',
1570
- 'INN_NOT_FOUND' = 'INN_NOT_FOUND',
1571
- }
1572
-
1573
- export interface IAdminCreatePhysicalSellerRequest
1574
- extends Omit<IAdminCreateSellerRequest, 'banking_details'> {
1575
- banking_details: IPhysicalBankingDetails;
1576
- passport_details: string;
1577
- passport_photo: File | File[];
1578
- card_number?: string;
1579
- }
1580
-
1581
- export interface IUserWithSellerType extends IUser {
1582
- type: EUserSellerType;
1583
- }
1584
-
1585
- export enum EUserSellerType {
1586
- 'PHYSICAL' = 'PHYSICAL',
1587
- 'LEGAL' = 'LEGAL',
1588
- 'NOT_SELLER' = 'NOT_SELLER',
1589
- }
1590
-
1591
- export interface IUpdateMultiOrderStatusRequest {
1592
- _id: string;
1593
- status: EMultiOrderStatus;
1594
- reason_of_cancel: EReasonOfCancel;
1595
- }
1596
-
1597
- export interface IUserRandomProductQueryRequest extends OptionalUserQuery {
1598
- size: string;
1599
- category_id?: string;
1600
- subCategory_id?: string;
1601
- }
1602
-
1603
- export enum ECheckForFillingSellerDataError {
1604
- SHOP_IS_NOT_EXIST = 'SHOP_IS_NOT_EXIST',
1605
- CDEK_POINT_IS_NOT_EXIST = 'CDEK_POINT_IS_NOT_EXIST',
1606
- DELIVERY_WAYS_IS_NOT_EXIST = 'DELIVERY_WAYS_IS_NOT_EXIST',
1607
- SELLER_INFO_IS_NOT_FILLED_OUT = 'SELLER_INFO_IS_NOT_FILLED_OUT',
1608
- BANKING_DETAILS_IS_NOT_FILLED_OUT = 'BANKING_DETAILS_IS_NOT_FILLED_OUT',
1609
- }
1610
-
1611
- export interface IAdminCreateWithdrawalRequest {
1612
- sum: number;
1613
- }
1614
-
1615
- export interface IAddressSuggestionRequest {
1616
- address: string;
1617
- isCityOnly?: 'true' | 'false';
1618
- }
1619
-
1620
- export interface IAddressSuggestion {
1621
- value: string;
1622
- unrestricted_value: string;
1623
- data: {
1624
- city: string;
1625
- city_district: string;
1626
- region_fias_id: string;
1627
- city_fias_id: string;
1628
- city_kladr_id: string;
1629
- fias_id: string;
1630
- fias_code: null;
1631
- fias_level: string;
1632
- kladr_id: string;
1633
- geo_lat: string | null;
1634
- geo_lon: string | null;
1635
- };
1636
- }
1637
-
1638
- export interface IAddressSuggestionResponse {
1639
- suggestions: IAddressSuggestion[];
1640
- }
1641
-
1642
- export interface IBanner {
1643
- _id: string;
1644
- photo: string;
1645
- position: number;
1646
- seller_id: string;
1647
- navigation_path: string | null; // example: "ProductScreen"
1648
- navigation_params: Record<string, any> | null; // example: {product_id: "ObjectId"}
1649
- createdAt: Date;
1650
- updatedAt: Date;
1651
- }
1652
-
1653
- export interface IMoySkladLinkerRequest {
1654
- updateData: {
1655
- linker_id: string;
1656
- category_id: string;
1657
- subCategory_id: string;
1658
- }[];
1659
- }
1660
-
1661
- export interface IMoySkladLinker {
1662
- pathName: string;
1663
- seller_id: string;
1664
- product_ids: string[];
1665
- }
1666
-
1667
- export interface IVersion {
1668
- version: string;
1669
- isForceToUpdate: boolean;
1670
- }
1671
-
1672
- export interface IAppVersion {
1673
- ios: IVersion;
1674
- android: IVersion;
1675
- }
1676
-
1677
- export interface NotificationData {
1678
- body: string;
1679
- data?: InternalPushMessageData | ExternalPushMessageData;
1680
- title: string;
1681
- }
1682
-
1683
- export interface INotification {
1684
- _id: string;
1685
- user_id?: string;
1686
- push_token_id: string;
1687
- message: NotificationData;
1688
- status: ENotificationStatus;
1689
- createdAt: Date;
1690
- }
1691
-
1692
- export enum ENotificationStatus {
1693
- READ = 'READ',
1694
- UNREAD = 'UNREAD',
1695
- }
1696
-
1697
- export interface ISendNotifications {
1698
- to: ENotificationRecipients;
1699
- notificationData: NotificationData;
1700
- }
1701
-
1702
- export enum ENotificationRecipients {
1703
- ALL = 'ALL',
1704
- SELLERS = 'SELLERS',
1705
- USERS = 'USERS',
1706
- }
1707
-
1708
- export interface IHintCharacteristics {
1709
- name: string;
1710
- values: string[];
1711
- }
1712
-
1713
- export interface IPossibleCombinations {
1714
- combinations: ICharacteristic[][];
1715
- characteristics: { name: string; values: string[] }[];
1716
- }
1717
-
1718
- export interface IGetVariationByCharacteristics {
1719
- product_id: string;
1720
- characteristics: ICharacteristic[];
1721
- }
1722
-
1723
- export enum ESex {
1724
- STALLION = 'stallion',
1725
- MARE = 'mare',
1726
- GELDING = 'gelding',
1727
- }
1728
-
1729
- export interface ICompetitionHistory {
1730
- name: string;
1731
- place: string;
1732
- }
1733
-
1734
- export interface ILocation {
1735
- name: string;
1736
- coordinates?: number[]; // [lng, lat]
1737
- lat: number;
1738
- lng: number;
1739
- }
1740
-
1741
- export interface IPreferredCommunication {
1742
- telegram: boolean;
1743
- whatsapp: boolean;
1744
- calls: boolean;
1745
- sms: boolean;
1746
- }
1747
-
1748
- export interface ICommunication {
1749
- tel: number;
1750
- preferredCommunication: IPreferredCommunication;
1751
- }
1752
-
1753
- export interface ICreateHorse {
1754
- name: string;
1755
- sex: ESex;
1756
- breed: string;
1757
- suit: string;
1758
- category: string;
1759
- birthDate: string;
1760
- withersHeight: number;
1761
- price: number;
1762
- location: ILocation;
1763
- images: File | File[];
1764
- video_cover?: File;
1765
- desc?: string;
1766
- reg_number?: string;
1767
- genealogy?: string;
1768
- birthplace?: string;
1769
- documents?: File | File[];
1770
- documentsNames?: string[];
1771
- competition_history?: ICompetitionHistory[];
1772
- communication: ICommunication;
1773
- }
1774
-
1775
- export interface IUpdateHorse extends Partial<ICreateHorse> {
1776
- toRemoveImages?: string[];
1777
- toRemoveVideoCover?: string;
1778
- toRemoveDocuments?: string[]; // Array of documents.fileName
1779
- }
1780
-
1781
- export enum EHorseStatus {
1782
- MODERATION = 'MODERATION',
1783
- PUBLISHED = 'PUBLISHED',
1784
- REJECTED = 'REJECTED',
1785
- ARCHIVED = 'ARCHIVED',
1786
- }
1787
-
1788
- export interface IHorse {
1789
- _id: string;
1790
- user_id: string;
1791
- status: EHorseStatus;
1792
- name: string;
1793
- sex: ESex;
1794
- breed: string;
1795
- suit: string;
1796
- birthDate: Date;
1797
- category: string;
1798
- withersHeight: number;
1799
- price: number;
1800
- location: ILocation;
1801
- images: string[];
1802
- video_cover: string | null;
1803
- desc: string | null;
1804
- reg_number: string | null;
1805
- genealogy: string | null;
1806
- birthplace: string | null;
1807
- documents: IDocument[] | null;
1808
- competition_history: ICompetitionHistory[] | null;
1809
- communication: ICommunication;
1810
- reason_of_cancel?: string;
1811
- distance?: number; // Расстояние пользователя до лошади (если передано гео)
1812
- archived_reason?: string;
1813
- telegram_message_id: string | null;
1814
- slug: string;
1815
- number: number;
1816
- published_at?: Date;
1817
- entityAnalytics?: IEntityAnalytics;
1818
- createdAt: Date;
1819
- updatedAt: Date;
1820
- }
1821
-
1822
- export interface IDocument {
1823
- name: string;
1824
- fileName: string;
1825
- }
1826
-
1827
- export interface IPopulatedHorse
1828
- extends Omit<IHorse, 'user_id' | 'breed' | 'suit' | 'category'> {
1829
- user_id: IPopulatedOrderUserApp;
1830
- breed: IBreed;
1831
- suit: ISuit;
1832
- category: IHorseCategory;
1833
- is_favorite?: boolean;
1834
- }
1835
-
1836
- export interface IBreed {
1837
- _id: string;
1838
- name: string;
1839
- createdAt: Date;
1840
- updatedAt: Date;
1841
- }
1842
-
1843
- export interface ISuit {
1844
- _id: string;
1845
- name: string;
1846
- createdAt: Date;
1847
- updatedAt: Date;
1848
- }
1849
-
1850
- export interface IHorseCategory {
1851
- _id: string;
1852
- name: string;
1853
- createdAt: Date;
1854
- updatedAt: Date;
1855
- }
1856
-
1857
- export interface IHorseFormInformation {
1858
- breeds: IBreed[];
1859
- suits: ISuit[];
1860
- categories: IHorseCategory[];
1861
- }
1862
-
1863
- export enum EViewCountEntityType {
1864
- HORSE = 'HORSE',
1865
- PRODUCT = 'PRODUCT',
1866
- SERVICE = 'SERVICE',
1867
- }
1868
-
1869
- export interface IViewCount {
1870
- entity_type: EViewCountEntityType;
1871
- entity_id: string;
1872
- count: number;
1873
- createdAt: Date;
1874
- updatedAt: Date;
1875
- }
1876
-
1877
- export interface IPopulatedHorseWViewCount extends IPopulatedHorse {
1878
- viewCount: IViewCount;
1879
- }
1880
-
1881
- export interface IGetCombinedHorses {
1882
- user_id?: string; // objectid
1883
- sex?: 'stallion' | 'mare' | 'gelding';
1884
- breed?: string; // objectid
1885
- suit?: string; // objectid
1886
- ageMin?: string;
1887
- ageMax?: string;
1888
- withersHeightMin?: string;
1889
- withersHeightMax?: string;
1890
- priceMin?: string;
1891
- priceMax?: string;
1892
- category?: string; // objectid
1893
- lat?: string; // user lat
1894
- lng?: string; // user lng
1895
- radius?: string;
1896
- }
1897
-
1898
- export interface IReverseGeocodingRequest {
1899
- lat: number;
1900
- lon: number;
1901
- count?: number;
1902
- radius_meters?: number;
1903
- }
1904
-
1905
- export interface IHorseQueryRequest extends FilterBaseQuery {}
1906
-
1907
- export interface IAdminHorsesQueryResponse {
1908
- horses: IPopulatedHorse[];
1909
- count: number;
1910
- }
1911
-
1912
- export interface IActionsHorseRequest {
1913
- toDelete: string;
1914
- }
1915
-
1916
- export interface IAdminChangeHorseStatusRequest {
1917
- status: EHorseStatus;
1918
- reason_of_cancel?: string;
1919
- }
1920
-
1921
- export interface InternalPushMessageData {
1922
- type: ENotificationType;
1923
- typeId: string;
1924
- typeSlug?: string | null;
1925
- }
1926
-
1927
- export interface ExternalPushMessageData {
1928
- url: string;
1929
- }
1930
-
1931
- export interface IGetHorseViewHistory extends FilterBaseQuery {
1932
- lat?: string; // user lat
1933
- lng?: string; // user lng
1934
- }
1935
- export interface IPriceHistorySearch {
1936
- priceMin?: number;
1937
- priceMax?: number;
1938
- }
1939
-
1940
- export enum ECollectionStatus {
1941
- PUBLISHED = 'PUBLISHED',
1942
- ARCHIVED = 'ARCHIVED',
1943
- }
1944
- export interface IPopulatedCollection
1945
- extends Omit<ICollection, 'products'> {
1946
- products: IProductResponse[];
1947
- }
1948
-
1949
- export interface ICollectionQueryRequest {
1950
- title?: string;
1951
- desc?: string;
1952
- slug?: string;
1953
- deeplink?: string;
1954
- photo?: string;
1955
- products?: string;
1956
- status?: string;
1957
- position?: number;
1958
- all_fields?: string;
1959
- is_thematic?: 'true' | 'false';
1960
- skip: string;
1961
- limit: string;
1962
- }
1963
-
1964
- export interface ICreateCollection {
1965
- title: string;
1966
- desc?: string;
1967
- deeplink?: string;
1968
- photo: File;
1969
- products: string[];
1970
- status: ECollectionStatus;
1971
- position: number;
1972
- is_thematic?: 'true' | 'false';
1973
- icon?: File;
1974
- }
1975
-
1976
- export interface IUpdateCollection {
1977
- title?: string;
1978
- desc?: string;
1979
- deeplink?: string;
1980
- photo?: File;
1981
- products?: string[];
1982
- status?: ECollectionStatus;
1983
- position?: number;
1984
- is_thematic?: 'true' | 'false';
1985
- icon?: File;
1986
- }
1987
-
1988
- export interface ICollection {
1989
- _id: string;
1990
- title: string;
1991
- desc?: string;
1992
- slug: string;
1993
- deeplink?: string;
1994
- photo: string;
1995
- products: string[];
1996
- status: ECollectionStatus;
1997
- position: number;
1998
- is_thematic: boolean;
1999
- icon: string | null;
2000
- }
2001
- export interface IPickupPoints {
2002
- lat: string;
2003
-
2004
- lng: string;
2005
- }
2006
-
2007
- export interface ICalculateFastDeliveryPrice {
2008
- lat: string;
2009
-
2010
- lng: string;
2011
-
2012
- items: IOrderItem[];
2013
- }
2014
-
2015
- export interface ItemSizeDto {
2016
- // product.dimension: length, width, height
2017
- length: number;
2018
- width: number;
2019
- height: number;
2020
- }
2021
-
2022
- export interface ItemDto {
2023
- size?: ItemSizeDto;
2024
- weight?: number;
2025
- quantity: number;
2026
- pickup_point: number;
2027
- dropoff_point: number;
2028
- }
2029
-
2030
- export interface RoutePointDto {
2031
- id: number; // 1, 2, 3...
2032
- fullname?: string;
2033
- coordinates: number[]; // 37.617298, 55.755825
2034
- }
2035
-
2036
- export interface DeliveryInterval {
2037
- from: string;
2038
- to: string;
2039
- }
2040
- export interface SameDayData {
2041
- delivery_interval: DeliveryInterval;
2042
- }
2043
- export interface RequirementsDto {
2044
- taxi_classes?: string[];
2045
- cargo_type?: string;
2046
- cargo_loaders?: number;
2047
- pro_courier?: boolean;
2048
- cargo_options?: string[];
2049
- skip_door_to_door?: boolean;
2050
- due?: string;
2051
- same_day_data?: SameDayData;
2052
- delivery_interval: DeliveryInterval;
2053
- }
2054
-
2055
- export interface YandexDeliveryRequestDto {
2056
- items: ItemDto[];
2057
- route_points: RoutePointDto[];
2058
- requirements: RequirementsDto;
2059
- }
2060
- export interface PriceDto {
2061
- total_price: string;
2062
- total_price_with_vat: string;
2063
- surge_ratio: number;
2064
- currency: string;
2065
- }
2066
-
2067
- export interface IntervalDto {
2068
- from: string;
2069
- to: string;
2070
- }
2071
-
2072
- export interface OfferDto {
2073
- price: PriceDto;
2074
- taxi_class: string;
2075
- pickup_interval: IntervalDto;
2076
- delivery_interval: IntervalDto;
2077
- description: string;
2078
- payload: string;
2079
- offer_ttl: string;
2080
- }
2081
-
2082
- export enum EProductsSortOptions {
2083
- NEWEST = 'Новинки',
2084
- POPULAR = 'Популярные',
2085
- CHEAPEST = 'Дешевле',
2086
- EXPENSIVE = 'Дороже',
2087
- }
2088
-
2089
- export interface PriceDto {
2090
- total_price: string;
2091
- total_price_with_vat: string;
2092
- surge_ratio: number;
2093
- currency: string;
2094
- }
2095
-
2096
- export interface IntervalDto {
2097
- from: string;
2098
- to: string;
2099
- }
2100
-
2101
- export interface OfferDto {
2102
- price: PriceDto;
2103
- taxi_class: string;
2104
- pickup_interval: IntervalDto;
2105
- delivery_interval: IntervalDto;
2106
- description: string;
2107
- payload: string;
2108
- offer_ttl: string;
2109
- }
2110
- export enum DeliveryTypes {
2111
- CDEK = 'CDEK',
2112
- YANDEX_EXPRESS = 'YANDEX_EXPRESS',
2113
- }
2114
-
2115
- export interface GetFastDeliveryPriceDto {
2116
- items: IPopulatedOrderItem[];
2117
-
2118
- delivery_info: Partial<IDeliveryFullInfo>;
2119
- }
2120
-
2121
- // Favorites (Избранное) - Начало
2122
-
2123
- export enum EFavoritesEntityType {
2124
- PRODUCT = 'PRODUCT',
2125
- HORSE = 'HORSE',
2126
- SERVICE = 'SERVICE',
2127
- }
2128
-
2129
- export interface IFavorite {
2130
- user_id?: string | null; // ID пользователя, который добавил в избранное
2131
- session_id?: string | null;
2132
- entity_id: string; // ID сущности, к которой привязано избранное (например, Product или Horse)
2133
- entity_type: EFavoritesEntityType; // Тип сущности (PRODUCT, HORSE и т.д.)
2134
- }
2135
-
2136
- export interface IPopulatedFavorite extends Omit<IFavorite, 'entity_id'> {
2137
- _id: string;
2138
- entity_id: IProductResponse | IPopulatedHorse | IPopulatedService; // В зависимости от entity_type присваивать entity_id as IProductResponse или IPopulatedHorse
2139
- }
2140
-
2141
- export enum EFavoriteToggleActions {
2142
- ADDED = 'ADDED', // Добавлен в базу
2143
- REMOVED = 'REMOVED', // Убран из базы
2144
- }
2145
-
2146
- export interface IToggleFavoriteRequest
2147
- extends Omit<IFavorite, 'user_id' | 'session_id'> {}
2148
-
2149
- export interface IGetFavoritesRequest
2150
- extends Omit<IFavorite, 'entity_id' | 'user_id' | 'session_id'> {}
2151
-
2152
- export interface IToggleFavoriteResponse {
2153
- action: EFavoriteToggleActions;
2154
- }
2155
-
2156
- // Favorites (Избранное) - Конец
2157
-
2158
- // Services (Услуги) - Начало
2159
-
2160
- export interface IGetServicesQuery extends FilterBaseQuery {
2161
- creator_id?: string;
2162
- user_id?: string;
2163
- category?: string;
2164
- priceMin?: string;
2165
- priceMax?: string;
2166
- lat?: string; // user lat
2167
- lng?: string; // user lng
2168
- radius?: string;
2169
- }
2170
-
2171
- export interface ICreateService {
2172
- name: string;
2173
- description?: string;
2174
- category: string;
2175
- price: number;
2176
- location: ILocation;
2177
- communication: ICommunication;
2178
- photo: File;
2179
- }
2180
-
2181
- export interface IUpdateService extends Partial<ICreateService> {}
2182
-
2183
- export enum EServiceStatus {
2184
- MODERATION = 'MODERATION',
2185
- PUBLISHED = 'PUBLISHED',
2186
- REJECTED = 'REJECTED',
2187
- ARCHIVED = 'ARCHIVED',
2188
- }
2189
-
2190
- export interface IServiceCategory {
2191
- _id: string;
2192
- name: string;
2193
- photo: string;
2194
- createdAt: Date;
2195
- updatedAt: Date;
2196
- }
2197
-
2198
- export interface IService {
2199
- user_id: string;
2200
- name: string;
2201
- description?: string;
2202
- category: string;
2203
- price: number;
2204
- status: EServiceStatus;
2205
- location: ILocation;
2206
- communication: ICommunication;
2207
- photo: string;
2208
- telegram_message_id: number | null;
2209
- slug: string;
2210
- distance?: number; // Расстояние пользователя до лошади (если передано гео)
2211
- number: number;
2212
- published_at?: Date;
2213
- entityAnalytics?: IEntityAnalytics;
2214
- createdAt: Date;
2215
- updatedAt: Date;
2216
- }
2217
-
2218
- export interface IPopulatedServicesWithReviewDataResponse {
2219
- services: IPopulatedService[];
2220
- reviewsData: IReviewsData;
2221
- }
2222
-
2223
- export interface IPopulatedService
2224
- extends Omit<IService, 'category' | 'user_id'> {
2225
- _id: string;
2226
- category: IServiceCategory;
2227
- user_id: IPopulatedOrderUserApp;
2228
- is_favorite?: boolean;
2229
- reviewsData?: IReviewsData;
2230
- }
2231
-
2232
- export interface IPopulatedServiceWViewCount extends IPopulatedService {
2233
- viewCount: IViewCount;
2234
- }
2235
-
2236
- // Services (Услуги) - Конец
2237
-
2238
- export interface OptionalUserQuery {
2239
- user_id?: string;
2240
- }
2241
-
2242
- export interface OptionalLocationQuery {
2243
- lat?: string;
2244
- lng?: string;
2245
- }
2246
-
2247
- export interface OptionalUserLocationQuery
2248
- extends OptionalUserQuery,
2249
- OptionalLocationQuery {}
2250
-
2251
- export interface CombinedUserLocationFilterQuery
2252
- extends OptionalUserLocationQuery,
2253
- FilterBaseQuery {}
2254
-
2255
- export interface ISavePushToken {
2256
- token: string;
2257
- userId?: string;
2258
- }
2259
-
2260
- export enum EEntityType {
2261
- PRODUCT = 'PRODUCT',
2262
- HORSE = 'HORSE',
2263
- SERVICE = 'SERVICE',
2264
- }
2265
-
2266
- export interface IGetUnreviewedProductsResponse {
2267
- products: IProductResponse[];
2268
- count: number;
2269
- }
2270
-
2271
- export enum EArchivedReason {
2272
- HORSESMART = 'На HorseSmart',
2273
- OTHER_PLATFORM = 'На другой площадке',
2274
- PERSONAL = 'Лично',
2275
- NOT_SOLD = 'Не продал',
2276
- }
2277
-
2278
- export interface IDeleteHorse {
2279
- archived_reason: EArchivedReason;
2280
- }
2281
-
2282
- export interface SellerSlugResponse {
2283
- _id: string;
2284
- slug: string;
2285
- updatedAt: Date;
2286
- }
2287
-
2288
- export interface IEntityAnalytics {
2289
- entity_type: EEntityType;
2290
- entity_id: string;
2291
- views_count: number;
2292
- favorites_count: number;
2293
- purchases_count: number;
2294
- cart_count: number;
2295
- createdAt: Date;
2296
- updatedAt: Date;
2297
- }
2298
-
2299
- export interface ISendOtpRequest {
2300
- email: string;
2301
- }
2302
-
2303
- export interface IVerifyOtpRequest {
2304
- email: string;
2305
- code: number;
2306
- }
2307
-
2308
- export interface IVerifyOtpResponse extends ITokensResponse {
2309
- user_id: string;
2310
- }
2311
-
2312
- export interface ICreateMultiOrderResponse {
2313
- payment: IPaymentResponse;
2314
- tokens?: ITokensResponse;
2315
- }
2316
-
2317
- export interface IPopulatedOrderAppWPaymentId {
2318
- order: IPopulatedOrderApp;
2319
- payment_id: string;
2320
- }
2321
-
2322
- // PromoCode
2323
-
2324
- export interface ICreatePromo {
2325
- discount_percent: number;
2326
- start_date?: string; // default: new Date().toISOString()
2327
- end_date: string;
2328
- }
2329
-
2330
- export interface IApplyPromo {
2331
- code: string;
2332
- }
2333
-
2334
- export interface IPromoCode {
2335
- _id: string;
2336
- seller_id: string; // Привязка к продавцу
2337
- code: string; // Сам промокод, например HSYORK20
2338
- discount_percent: number; // Процент скидки (20 -> 20%)
2339
- start_date: Date; // Дата начала действия промокода
2340
- end_date: Date; // Дата окончания действия промокода
2341
- showcase_url: string; // Ссылка на витрину продавца
2342
- createdAt: Date;
2343
- updatedAt: Date;
2344
- }
2345
- }
2346
- }
1
+ declare namespace Components {
2
+ namespace Schemas {
3
+ export interface FilterBaseQuery {
4
+ skip: string;
5
+ limit: string;
6
+ }
7
+ export interface ITokensResponse {
8
+ access_token: string;
9
+ refresh_token: string;
10
+ }
11
+ export interface ILoginRequest {
12
+ email: string;
13
+ password: string;
14
+ type: ELoginTypes;
15
+ }
16
+ export interface ISignUpRequest {
17
+ email: string;
18
+ password: string;
19
+ }
20
+ export interface ILoginResponse extends ITokensResponse {
21
+ isSeller: boolean;
22
+ user_id: string;
23
+ isActivated: boolean;
24
+ isExistPassword: boolean;
25
+ role: ERoles;
26
+ isNewUser: boolean;
27
+ }
28
+
29
+ export type ISignUpResponse = ITokensResponse;
30
+
31
+ export interface IRecoveryRequest {
32
+ email: string;
33
+ password: string;
34
+ }
35
+
36
+ export interface IRecoveryResponse {
37
+ message: string;
38
+ }
39
+
40
+ export interface IActivationRequest {
41
+ email: string;
42
+ activation_code: number;
43
+ }
44
+
45
+ export interface IActivationResponse {
46
+ message: string;
47
+ }
48
+
49
+ export interface IRefreshRequest {
50
+ refreshToken: string;
51
+ }
52
+
53
+ export type IRefreshResponse = ITokensResponse & { is_activated: boolean };
54
+
55
+ export enum ELoginTypes {
56
+ SELLER = 'SELLER',
57
+ USER = 'USER',
58
+ WEB = 'WEB',
59
+ }
60
+
61
+ export interface ISendEmailRequest {
62
+ email: string;
63
+ }
64
+
65
+ export interface ISendEmailResponse {
66
+ message: string;
67
+ }
68
+
69
+ export interface ISignUpGoogleRequest {
70
+ access_token: string;
71
+ auth_type: ELoginTypes;
72
+ }
73
+
74
+ export type ISignUpGoogleResponse = ILoginResponse;
75
+
76
+ export interface ISignUpAppleRequest {
77
+ code: string;
78
+ auth_type: ELoginTypes;
79
+ }
80
+
81
+ export type ISignUpAppleResponse = ILoginResponse;
82
+
83
+ export interface ISignUpVkRequest {
84
+ silent_token: string;
85
+ uuid: string;
86
+ auth_type: ELoginTypes;
87
+ }
88
+
89
+ export type ISignUpVkResponse = ILoginResponse;
90
+
91
+ export enum ERoles {
92
+ ADMIN = 'ADMIN',
93
+ USER = 'USER',
94
+ }
95
+
96
+ export interface IActionsProductRequest {
97
+ toDelete: string;
98
+ toPublish: string;
99
+ toCopy: string;
100
+ toDraft: string;
101
+ toReject: string;
102
+ }
103
+
104
+ export enum EActions {
105
+ DELETE = 'toDelete',
106
+ PUBLISH = 'toPublish',
107
+ COPY = 'toCopy',
108
+ DRAFT = 'toDraft',
109
+ REJECT = 'toReject',
110
+ }
111
+
112
+ export interface IActionsProductResponse {
113
+ message: string;
114
+ }
115
+
116
+ export interface IUser {
117
+ _id: string;
118
+ tel?: number;
119
+ name?: string;
120
+ surname?: string;
121
+ patronymic?: string;
122
+ full_name?: string;
123
+ birthday?: Date;
124
+ email?: string;
125
+ role: ERoles;
126
+ vk_id?: number;
127
+ expo_push_token?: string;
128
+ number: number;
129
+ is_activated: boolean;
130
+ createdAt: Date;
131
+ updatedAt: Date;
132
+ }
133
+
134
+ export interface IShortUser {
135
+ _id: string;
136
+ tel?: number;
137
+ name?: string;
138
+ surname?: string;
139
+ patronymic?: string;
140
+ full_name?: string;
141
+ birthday?: Date;
142
+ email?: string;
143
+ number: number;
144
+ }
145
+
146
+ export interface IAdminUserQueryResponse {
147
+ users: IShortUser[];
148
+ count: number;
149
+ }
150
+
151
+ export interface IAdminUsersQueryRequest extends FilterBaseQuery {
152
+ tel?: string;
153
+ full_name?: string;
154
+ email?: string;
155
+ number?: string;
156
+ all_fields?: string;
157
+ }
158
+
159
+ export interface IAdminCreateUser {
160
+ name: string;
161
+ surname: string;
162
+ patronymic?: string;
163
+ email: string;
164
+ tel: number;
165
+ password: string;
166
+ }
167
+
168
+ export interface IAdminUpdateUser {
169
+ _id: string;
170
+ name: string;
171
+ surname: string;
172
+ patronymic?: string;
173
+ tel: number;
174
+ email: string;
175
+ }
176
+
177
+ export interface IActionsUsersRequest {
178
+ toDelete: string;
179
+ }
180
+
181
+ export interface IAddress {
182
+ _id: string;
183
+ address: string;
184
+ floor: number;
185
+ intercom?: string;
186
+ entrance: number;
187
+ index?: number;
188
+ flat: number;
189
+ createdAt: Date;
190
+ updatedAt: Date;
191
+ }
192
+
193
+ export interface IUserAddress extends IAddress {
194
+ user_id: string;
195
+ }
196
+
197
+ export interface IUpdateUser {
198
+ name: string;
199
+ surname: string;
200
+ patronymic?: string;
201
+ tel: number;
202
+ email: string;
203
+ birthday?: Date;
204
+ password?: string;
205
+ expo_push_token?: string;
206
+ }
207
+
208
+ export enum EUserTransactionsType {
209
+ PURCHASE = 'PURCHASE',
210
+ REFUND = 'REFUND',
211
+ }
212
+
213
+ export interface ICreateAddress {
214
+ user_id: string;
215
+ floor: number;
216
+ intercom: string;
217
+ entrance: number;
218
+ index: number;
219
+ flat: number;
220
+ address: string;
221
+ }
222
+
223
+ export interface IUpdateAddress {
224
+ id: string;
225
+ floor: number;
226
+ intercom: string;
227
+ entrance: number;
228
+ index: number;
229
+ flat: number;
230
+ address: string;
231
+ }
232
+
233
+ export enum EUnit {
234
+ KG = 'KG',
235
+ GR = 'GR',
236
+ }
237
+
238
+ export interface IDimension {
239
+ width: number;
240
+ height: number;
241
+ length: number;
242
+ weight: number;
243
+ in_stock: number;
244
+ unit: EUnit;
245
+ }
246
+
247
+ export interface ICharacteristic {
248
+ name: string;
249
+ value: string;
250
+ }
251
+
252
+ export enum EProductType {
253
+ PRODUCT = 'PRODUCT',
254
+ VARIATION = 'VARIATION',
255
+ }
256
+
257
+ export interface IProduct {
258
+ _id: string;
259
+ type: EProductType;
260
+ parent_id?: string | null; // Ссылка на родителя (исключительно для вариаций)
261
+ name: string;
262
+ status: EProductStatus; // Для вариаций статус всегда PUBLISHED
263
+ subCategory_id: string;
264
+ category_id: string;
265
+ seller_id: string;
266
+ vendor_code: string;
267
+ price: number;
268
+ discount?: number;
269
+ tax: number;
270
+ dimension: IDimension;
271
+ photo: string[];
272
+ desc: string;
273
+ characteristic: ICharacteristic[];
274
+ external_item_id: string | null;
275
+ variations?: IProduct[];
276
+ purchases_count: number;
277
+ number: number;
278
+ article: string; // example: 002281
279
+ slug: string;
280
+ published_at?: Date;
281
+ entityAnalytics?: IEntityAnalytics;
282
+ low_stock_flag: boolean;
283
+ f_price: number | null;
284
+ createdAt: Date;
285
+ updatedAt: Date;
286
+ }
287
+
288
+ export interface IProductQueryRequest extends FilterBaseQuery {
289
+ category_id?: string;
290
+ subCategory_id?: string;
291
+ seller_id?: string;
292
+ name?: string;
293
+ status?: EProductStatus;
294
+ all_fields?: string;
295
+ type?: EProductType;
296
+ isHaveParent?: boolean;
297
+ excludeProductId?: string;
298
+ }
299
+
300
+ export interface IUserProductQueryRequest extends FilterBaseQuery {
301
+ user_id?: string;
302
+ category_id?: string;
303
+ subCategory_id?: string;
304
+ seller_id?: string;
305
+ name?: string;
306
+ priceMin?: string;
307
+ priceMax?: string;
308
+ colors?: string;
309
+ brands?: string;
310
+ sizes?: string;
311
+ materials?: string;
312
+ sortBy?: EProductsSortOptions;
313
+ }
314
+
315
+ export interface IProductQueryResponse {
316
+ products: IProductDraftResponse[];
317
+ count: number;
318
+ }
319
+
320
+ export interface IUserProductQueryResponse {
321
+ products: IProductResponse[];
322
+ subCategories: ISubCategory[];
323
+ }
324
+
325
+ export enum EProductStatus {
326
+ DRAFT = 'DRAFT',
327
+ MODERATION = 'MODERATION',
328
+ PUBLISHED = 'PUBLISHED',
329
+ REJECTED = 'REJECTED',
330
+ ARCHIVED = 'ARCHIVED',
331
+ }
332
+
333
+ export interface IProductResponse {
334
+ _id: string;
335
+ name: string;
336
+ type: EProductType;
337
+ parent_id?: string | null;
338
+ status: EProductStatus;
339
+ subCategory_id: {
340
+ _id: string;
341
+ name: string;
342
+ category_id: string;
343
+ slug: string;
344
+ };
345
+ category_id: {
346
+ _id: string;
347
+ photo: string;
348
+ name: string;
349
+ slug: string;
350
+ };
351
+ seller_id?: {
352
+ _id: string;
353
+ shop_details: IShopDetails;
354
+ delivery_ways: IDeliveryWays;
355
+ slug: string;
356
+ };
357
+ vendor_code: string;
358
+ price: number;
359
+ discount?: number;
360
+ tax: number;
361
+ dimension: IDimension;
362
+ photo: string[];
363
+ desc: string;
364
+ characteristic: ICharacteristic[];
365
+ variations?: IProduct[];
366
+ purchases_count: number;
367
+ number: number;
368
+ article: string; // example: 002281
369
+ slug: string;
370
+ createdAt: Date;
371
+ updatedAt: Date;
372
+ is_favorite?: boolean;
373
+ reviewsData?: IReviewsData;
374
+ published_at?: Date;
375
+ entityAnalytics?: IEntityAnalytics;
376
+ low_stock_flag: boolean;
377
+ f_price: number | null;
378
+ }
379
+
380
+ type OptionalDimension = {
381
+ width?: number;
382
+ height?: number;
383
+ length?: number;
384
+ weight?: number;
385
+ in_stock: number;
386
+ unit?: EUnit;
387
+ };
388
+
389
+ type TOptionalProperties = Pick<
390
+ IProductResponse,
391
+ | 'category_id'
392
+ | 'subCategory_id'
393
+ | 'vendor_code'
394
+ | 'desc'
395
+ | 'characteristic'
396
+ | 'tax'
397
+ | 'photo'
398
+ | 'price'
399
+ > & {
400
+ dimension?: OptionalDimension;
401
+ };
402
+
403
+ type TRemainingProductResponseProperties = Omit<
404
+ IProductResponse,
405
+ keyof TOptionalProperties
406
+ >;
407
+
408
+ export interface IProductDraftResponse
409
+ extends TRemainingProductResponseProperties,
410
+ Partial<TOptionalProperties> {}
411
+
412
+ export interface IProductWithReviewResponse {
413
+ product: IProductResponse;
414
+ reviewsData: IReviewsData;
415
+ }
416
+
417
+ export interface IAddVariation {
418
+ _id: string;
419
+ characteristic: ICharacteristic[];
420
+ }
421
+
422
+ export interface ICreateProduct {
423
+ name: string;
424
+ status?:
425
+ | EProductStatus.DRAFT
426
+ | EProductStatus.PUBLISHED
427
+ | EProductStatus.REJECTED;
428
+ category_id: string;
429
+ subCategory_id: string;
430
+ vendor_code: string;
431
+ price: number;
432
+ tax: number;
433
+ dimension: IDimension;
434
+ photo: File[];
435
+ desc: string;
436
+ characteristic?: ICharacteristic[];
437
+ variations?: IAddVariation[];
438
+ }
439
+
440
+ export interface ICreateVariation
441
+ extends Omit<
442
+ ICreateProduct,
443
+ | 'status'
444
+ | 'category_id'
445
+ | 'subCategory_id'
446
+ | 'variations'
447
+ | 'photo'
448
+ | 'desc'
449
+ | 'characteristic'
450
+ > {
451
+ photo?: File[];
452
+ desc?: string;
453
+ seller_id: string;
454
+ }
455
+
456
+ export interface IUpdateProduct extends ICreateProduct {
457
+ id: string;
458
+ type?: EProductType;
459
+ toDeletePhotos?: string[];
460
+ toDeleteVariations?: string[];
461
+ }
462
+
463
+ export interface ICreateCart {
464
+ product_id: string;
465
+ count: number;
466
+ price: number;
467
+ }
468
+
469
+ export interface IDeleteCartRequest {
470
+ toDelete?: string;
471
+ }
472
+
473
+ export interface ICart {
474
+ _id: string;
475
+ user_id?: string | null;
476
+ session_id?: string | null;
477
+ product_id: {
478
+ _id: string;
479
+ name: string;
480
+ photo: string[];
481
+ dimension: IDimension;
482
+ price: number;
483
+ slug: string;
484
+ category_id: {
485
+ _id: string;
486
+ name: string;
487
+ slug: string;
488
+ };
489
+ subCategory_id: {
490
+ _id: string;
491
+ name: string;
492
+ slug: string;
493
+ };
494
+ seller_id: {
495
+ _id: string;
496
+ shop_details: IShopDetails;
497
+ delivery_ways: IDeliveryWays;
498
+ shops_info: IShop[];
499
+ slug: string;
500
+ };
501
+ f_price: number | null;
502
+ low_stock_flag: boolean;
503
+ };
504
+ count: number;
505
+ price: number;
506
+ discounted_price: number | null;
507
+ createdAt: Date;
508
+ updatedAt: Date;
509
+ }
510
+
511
+ export interface ICreateCartResponse {
512
+ message?: string;
513
+ cartItem: ICart;
514
+ }
515
+
516
+ export interface ISetCartItemCountRequest {
517
+ count: number;
518
+ }
519
+
520
+ export interface ICategory {
521
+ _id: string;
522
+ name: string;
523
+ seoInfo?: ISeoInfo;
524
+ photo: string;
525
+ slug: string;
526
+ createdAt: Date;
527
+ updatedAt: Date;
528
+ }
529
+
530
+ export interface ISeoInfo {
531
+ title?: string;
532
+ desc?: string;
533
+ h1?: string;
534
+ seoText?: string;
535
+ }
536
+
537
+ export interface IAdminCategoryQueryRequest {
538
+ name?: string;
539
+ parsed: string;
540
+ }
541
+
542
+ export interface IGetCategoryQuery extends FilterBaseQuery {
543
+ parsed?: string;
544
+ }
545
+
546
+ export interface IParsedCategory {
547
+ value: string;
548
+ title: string;
549
+ type: string;
550
+ photo: string;
551
+ seoInfo?: ISeoInfo;
552
+ slug: string;
553
+ updatedAt: Date;
554
+ children: IParsedSubCategory[];
555
+ }
556
+
557
+ export interface IParsedSubCategory {
558
+ value: string;
559
+ title: string;
560
+ type: string;
561
+ seoInfo?: ISeoInfo;
562
+ slug: string;
563
+ updatedAt: Date;
564
+ status: ESubCategoryStatus;
565
+ }
566
+
567
+ export type ICategoryQueryResponse = ICategory[] | IParsedCategory[];
568
+
569
+ export interface ICreateCategoryRequest {
570
+ name: string;
571
+ title?: string;
572
+ desc?: string;
573
+ h1?: string;
574
+ seoText?: string;
575
+ photo: File;
576
+ }
577
+
578
+ export interface IUpdateCategoryRequest
579
+ extends Partial<ICreateCategoryRequest> {
580
+ toDeletePhoto?: string;
581
+ }
582
+
583
+ export interface ISubCategory {
584
+ _id: string;
585
+ name: string;
586
+ category_id: ICategory;
587
+ status: ESubCategoryStatus;
588
+ seoInfo?: ISeoInfo;
589
+ slug: string;
590
+ createdAt: Date;
591
+ updatedAt: Date;
592
+ }
593
+
594
+ export interface IUserSubCategoryResponse {
595
+ subCategories: ISubCategory[];
596
+ productsCount: number;
597
+ }
598
+
599
+ export interface ICreateSubCategoryRequest {
600
+ name: string;
601
+ category_id: string;
602
+ title?: string;
603
+ desc?: string;
604
+ h1?: string;
605
+ seoText?: string;
606
+ suggested_characteristics?: ISuggestedCharacteristic[];
607
+ }
608
+
609
+ export interface ISuggestedCharacteristic {
610
+ name: string;
611
+ values: string[];
612
+ }
613
+
614
+ export interface IUpdateSubCategoryRequest
615
+ extends Partial<ICreateSubCategoryRequest> {}
616
+
617
+ export enum ESubCategoryStatus {
618
+ MODERATION = 'MODERATION',
619
+ ACTIVE = 'ACTIVE',
620
+ ARCHIVED = 'ARCHIVED',
621
+ }
622
+
623
+ export interface IBankingDetails {
624
+ name: string;
625
+ INN: string;
626
+ BIK: string;
627
+ KPP: string;
628
+ PC: string;
629
+ KC: string;
630
+ legal_address: string;
631
+ }
632
+
633
+ export type ILegalBankingDetails = Omit<
634
+ IBankingDetails,
635
+ 'KPP' | 'legal_address'
636
+ >;
637
+ export type IPhysicalBankingDetails = Partial<
638
+ Omit<IBankingDetails, 'legal_address'>
639
+ > & { INN: string };
640
+
641
+ export interface IShopDetails {
642
+ shop_name: string;
643
+ logo: string;
644
+ banner: string;
645
+ desc: string;
646
+ }
647
+
648
+ export interface IDeliveryWays {
649
+ pickup: boolean;
650
+ // own_delivery: boolean; // Появится в ближайшем будущем
651
+ delivery_to_point: boolean;
652
+ courier: boolean;
653
+ yandex_express: boolean;
654
+ }
655
+
656
+ export enum ESellerStatus {
657
+ WAITING_APPROVE = 'WAITING_APPROVE',
658
+ APPROVED = 'APPROVED',
659
+ DECLINED = 'DECLINED',
660
+ ARCHIVED = 'ARCHIVED',
661
+ }
662
+
663
+ export interface IUserSellerStatusResponse {
664
+ status: ESellerStatus | 'NOT_CREATED';
665
+ }
666
+
667
+ export interface IBalanceInfo {
668
+ balance: number;
669
+ total_turnover: number;
670
+ withdrawn: number;
671
+ }
672
+
673
+ export interface IShopAddress {
674
+ name: string;
675
+ lat: number;
676
+ lng: number;
677
+ }
678
+
679
+ export interface IShopWorkTime {
680
+ time: string;
681
+ }
682
+
683
+ export interface IShop {
684
+ _id: string;
685
+ name: string;
686
+ address: IShopAddress;
687
+ nearest_metro_station: string;
688
+ work_time?: IShopWorkTime[];
689
+ createdAt: Date;
690
+ updatedAt: Date;
691
+ }
692
+
693
+ export interface INearestPointOfCdek {
694
+ code: string;
695
+ name: string;
696
+ location: {
697
+ country_code: string;
698
+ region_code: number;
699
+ region: string;
700
+ city_code: number;
701
+ city: string;
702
+ postal_code: string;
703
+ longitude: number;
704
+ latitude: number;
705
+ address: string;
706
+ address_full: string;
707
+ };
708
+ }
709
+
710
+ export interface IMoySklad {
711
+ account_id: string | null;
712
+ api_token: string | null;
713
+ }
714
+
715
+ export interface ISeller {
716
+ _id: string;
717
+ type: ESellerTypes;
718
+ user_id: {
719
+ _id: string;
720
+ tel: number;
721
+ name: string;
722
+ surname: string;
723
+ full_name: string;
724
+ patronymic?: string;
725
+ email: string;
726
+ birthday: Date;
727
+ };
728
+ shops_info: IShop[];
729
+ nearest_point_of_cdek: INearestPointOfCdek;
730
+ banking_details: IBankingDetails;
731
+ additional_info?: ISellerAdditionalInfo;
732
+ company_info?: ISellerCompanyInfo;
733
+ shop_details: IShopDetails;
734
+ delivery_ways: IDeliveryWays;
735
+ balance_info: IBalanceInfo;
736
+ moy_sklad?: IMoySklad;
737
+ commission: number;
738
+ status: ESellerStatus;
739
+ telegram_message_id: number | null;
740
+ api_token: string | null;
741
+ slug: string;
742
+ telegram_chat_id: number | null;
743
+ telegram_api_token: string;
744
+ number: number;
745
+ createdAt: Date;
746
+ updatedAt: Date;
747
+ }
748
+
749
+ export interface ISellerShowcaseResponse {
750
+ purchasesCount: number;
751
+ averageRating: string;
752
+ reviewsCount: number;
753
+ seller: ISeller;
754
+ promoCode: IPromoCode | null;
755
+ }
756
+
757
+ export interface ISellerSearchQueryRequest {
758
+ name?: string;
759
+ }
760
+
761
+ export interface IAdminSellersQueryRequest extends FilterBaseQuery {
762
+ number?: string;
763
+ status?: string;
764
+ full_name?: string;
765
+ shop_name?: string;
766
+ tel?: string;
767
+ all_fields?: string;
768
+ }
769
+
770
+ export interface IAdminSellersQueryResponse {
771
+ sellers: ISeller[];
772
+ count: number;
773
+ }
774
+
775
+ export interface ISellerInfo {
776
+ name: string;
777
+ surname: string;
778
+ patronymic?: string;
779
+ email: string;
780
+ tel: number;
781
+ type: ESellerTypes;
782
+ opt_otch: boolean;
783
+ birthday?: string;
784
+ }
785
+
786
+ export interface ICreateSellerInfo extends ISellerInfo {
787
+ password: string;
788
+ }
789
+
790
+ export type ICreateShopDetails = Omit<IShopDetails, 'logo' | 'banner'>;
791
+
792
+ export interface IAdminCreateSellerRequest {
793
+ seller_info: ICreateSellerInfo;
794
+ banking_details: ILegalBankingDetails;
795
+ shop_details: ICreateShopDetails;
796
+ logo: File | File[];
797
+ banner: File | File[];
798
+ }
799
+
800
+ export interface ICreateSellerRequest {
801
+ type: ESellerTypes;
802
+ name: string;
803
+ surname: string;
804
+ patronymic?: string;
805
+ tel: number;
806
+ INN: string;
807
+ shop_name: string;
808
+ send_email?: boolean;
809
+ opt_otch: boolean;
810
+ }
811
+
812
+ export interface IUpdateSellerRequest {
813
+ seller_info: Partial<ISellerInfo>;
814
+ banking_details: Partial<IBankingDetails>;
815
+ shop_details: ICreateShopDetails;
816
+ company_info: Partial<ISellerCompanyInfo>;
817
+ logo: File | File[] | string;
818
+ banner: File | File[] | string;
819
+ seller_id: string;
820
+ toDeletePhotos?: string[];
821
+ passport_details?: string;
822
+ passport_photo?: File | File[] | string;
823
+ card_number?: string;
824
+ }
825
+
826
+ export interface IActionsSellersRequest {
827
+ toDelete: string;
828
+ }
829
+
830
+ export interface ICreateSellerShopRequest {
831
+ seller_id: string;
832
+ name: string;
833
+ address: {
834
+ name: string;
835
+ lat: number;
836
+ lng: number;
837
+ };
838
+ work_time?: IShopWorkTime[];
839
+ }
840
+
841
+ export interface IAdminUpdateNearestPointOfCdekRequest
842
+ extends INearestPointOfCdek {
843
+ seller_id: string;
844
+ }
845
+
846
+ export interface IAdminUpdateDeliveryWaysRequest extends IDeliveryWays {
847
+ seller_id: string;
848
+ }
849
+
850
+ export interface IAdminChangeOrderStatus {
851
+ orderId: string;
852
+ status: EOrderStatus;
853
+ reason_of_cancel?: string;
854
+ }
855
+
856
+ export interface IAdminDenyItem {
857
+ item_id: string;
858
+ }
859
+
860
+ export interface IAdminRemoveOrderItemRequest {
861
+ current_items: IPopulatedOrderItem[];
862
+ }
863
+
864
+ export interface IAdminOrdersQueryRequest extends FilterBaseQuery {
865
+ name?: string;
866
+ from?: string;
867
+ to?: string;
868
+ number?: string;
869
+ sum?: 'asc' | 'desc';
870
+ status?: EOrderStatus;
871
+ tel?: string;
872
+ seller_id?: string;
873
+ }
874
+
875
+ export type IPopulatedOrderSeller = Pick<
876
+ ISeller,
877
+ '_id' | 'shop_details' | 'user_id' | 'nearest_point_of_cdek' | 'slug'
878
+ >;
879
+
880
+ export type IPopulatedOrderUser = Pick<
881
+ IUser,
882
+ | '_id'
883
+ | 'name'
884
+ | 'full_name'
885
+ | 'surname'
886
+ | 'patronymic'
887
+ | 'tel'
888
+ | 'email'
889
+ | 'birthday'
890
+ >;
891
+
892
+ export type TPopulatedProductId = Pick<
893
+ IProduct,
894
+ '_id' | 'name' | 'vendor_code' | 'photo' | 'discount'
895
+ >;
896
+
897
+ export interface IPopulatedOrderItem
898
+ extends Omit<IOrderItem, 'product_id'> {
899
+ product_id: IProductResponse;
900
+ }
901
+
902
+ export type IPopulatedOrder = Omit<
903
+ IOrder,
904
+ 'items' | 'seller_id' | 'user_id' | 'shop_id'
905
+ > & {
906
+ items: IPopulatedOrderItem[];
907
+ seller_id?: IPopulatedOrderSeller;
908
+ user_id?: IPopulatedOrderUser;
909
+ shop_id: IShop;
910
+ };
911
+
912
+ export interface IAdminGetOrderResponse {
913
+ order: IPopulatedOrder;
914
+ commission: number;
915
+ }
916
+
917
+ export interface IAdminOrdersQueryResponse {
918
+ orders: IPopulatedOrder[];
919
+ count: number;
920
+ }
921
+
922
+ export interface IAdminDeliveryInfo {
923
+ receive_method: ERecieveMethod;
924
+ preparation_date: Date;
925
+ address?: string;
926
+ shop_id?: string;
927
+ }
928
+
929
+ export interface IAdminCdekInfo {
930
+ delivery_sum: number;
931
+ tracking: string;
932
+ }
933
+
934
+ export interface IAdminUpdateOrderRequest {
935
+ note?: string;
936
+ delivery_info: Partial<IAdminDeliveryInfo>;
937
+ cdek_info?: Partial<IAdminCdekInfo>;
938
+ invoice?: File;
939
+ items: IPopulatedOrderItem[];
940
+ }
941
+
942
+ export type OrderAddress = Omit<
943
+ IAddress,
944
+ 'user_id' | '_id' | 'createdAt' | 'updatedAt'
945
+ >;
946
+
947
+ export enum EOrderStatus {
948
+ NOT_PAID = 'NOT_PAID',
949
+ ON_CONFIRMATION = 'ON_CONFIRMATION',
950
+ CONFIRMED_BY_SELLER = 'CONFIRMED_BY_SELLER',
951
+ IN_DELIVERY = 'IN_DELIVERY',
952
+ WAITING_IN_POINT = 'WAITING_IN_POINT',
953
+ FINISHED = 'FINISHED',
954
+ CANCELED = 'CANCELED',
955
+ ARCHIVED = 'ARCHIVED',
956
+ }
957
+
958
+ export interface IDeliveryAddress extends OrderAddress {
959
+ lat: number;
960
+ lng: number;
961
+ }
962
+
963
+ export interface IDeliveryInfo {
964
+ delivery_sum: number;
965
+ address: IDeliveryAddress;
966
+ tel: number;
967
+ full_name: string;
968
+ yandex_uuid?: string;
969
+ cdek_barcode?: string;
970
+ type?: DeliveryTypes;
971
+ yandex_offer?: OfferDto;
972
+ comment?: string;
973
+ }
974
+
975
+ export interface IPVZ {
976
+ code: string;
977
+ name: string;
978
+ location: {
979
+ country_code: string;
980
+ region_code: number;
981
+ region: string;
982
+ city_code: number;
983
+ city: string;
984
+ postal_code: string;
985
+ longitude: number;
986
+ latitude: number;
987
+ address: string;
988
+ address_full: string;
989
+ };
990
+ phones: [
991
+ {
992
+ number: string;
993
+ }
994
+ ];
995
+ email: string;
996
+ delivery_sum: number;
997
+ }
998
+
999
+ export interface IPickUpPoint {
1000
+ shop_id: string;
1001
+ }
1002
+
1003
+ export enum ERecieveMethod {
1004
+ PICKUP_POINT = 'PICKUP_POINT',
1005
+ COURIER = 'COURIER',
1006
+ PVZ = 'PVZ',
1007
+ EXPRESS = 'EXPRESS',
1008
+ }
1009
+
1010
+ export enum EOrderItemsStatus {
1011
+ AGREED = 'AGREED',
1012
+ DENIED = 'DENIED',
1013
+ }
1014
+
1015
+ export interface IOrderItem {
1016
+ _id: string;
1017
+ product_id: string;
1018
+ count: number;
1019
+ price: number; // Сумма за одну единицу товара * количество товаров
1020
+ discounted_price: number | null;
1021
+ dimension: IDimension; // Габариты за единицу товара
1022
+ items_status: EOrderItemsStatus;
1023
+ }
1024
+
1025
+ export interface ICheckIsAlsoInStock {
1026
+ cartItems: ICart[];
1027
+ }
1028
+
1029
+ export interface ICreateOrder {
1030
+ items: Omit<IOrderItem, '_id' | 'items_status'>[];
1031
+ receive_method: ERecieveMethod;
1032
+ receive_method_data: IDeliveryInfo | IPVZ | IPickUpPoint;
1033
+ seller_id: string;
1034
+ }
1035
+
1036
+ export interface IGetAllOrders {
1037
+ user_id: string;
1038
+ skip: number;
1039
+ limit: number;
1040
+ }
1041
+
1042
+ export type IPopulatedOrderShop = IShop;
1043
+
1044
+ export interface IPopulatedOrderItemApp
1045
+ extends Omit<IOrderItem, 'product_id'> {
1046
+ product_id: IProductResponse;
1047
+ }
1048
+
1049
+ export type IPopulatedOrderUserApp = Pick<
1050
+ IUser,
1051
+ | '_id'
1052
+ | 'name'
1053
+ | 'full_name'
1054
+ | 'surname'
1055
+ | 'patronymic'
1056
+ | 'tel'
1057
+ | 'email'
1058
+ | 'birthday'
1059
+ >;
1060
+
1061
+ export type IPopulatedOrderApp = Omit<
1062
+ IOrder,
1063
+ 'items' | 'shop_id' | 'user_id'
1064
+ > & {
1065
+ items: IPopulatedOrderItemApp[];
1066
+ user_id: IPopulatedOrderUserApp;
1067
+ shop_id: IPopulatedOrderShop;
1068
+ };
1069
+
1070
+ export enum EReasonOfCancel {
1071
+ CHANGED_DELIVERY_DATE = 'Перенесли срок доставки',
1072
+ INCORRECT_CREATED_ORDER = 'Хочу изменить заказ и оформить заново',
1073
+ FOUND_CHEAPER = 'Нашел дешевле',
1074
+ WRONG_ADDRESS = 'Указал неверный адрес',
1075
+ OTHER = 'Другое',
1076
+ }
1077
+
1078
+ export interface ICancelOrderRequest {
1079
+ orderId: string;
1080
+ reason_of_cancel: EReasonOfCancel;
1081
+ }
1082
+
1083
+ export interface ICreateMultiOrder {
1084
+ orders: ICreateOrder[];
1085
+ sum: number;
1086
+ tel: number;
1087
+ email: string;
1088
+ name: string;
1089
+ surname: string;
1090
+ patronymic?: string;
1091
+ }
1092
+
1093
+ export interface IDeliveryFullInfo extends IDeliveryInfo {
1094
+ tracking: string;
1095
+ invoice: string;
1096
+ }
1097
+
1098
+ export interface IGetCDEKOffices {
1099
+ weight_max?: string;
1100
+ city: string; // city or city_district from dadata
1101
+ }
1102
+
1103
+ export interface ICDEKOffice {
1104
+ code: string;
1105
+ name: string;
1106
+ uuid: string;
1107
+ address_comment: string;
1108
+ nearest_metro_station: string;
1109
+ work_time: string;
1110
+ phones: [
1111
+ {
1112
+ number: string;
1113
+ }
1114
+ ];
1115
+ email: string;
1116
+ note: string;
1117
+ type: string;
1118
+ owner_code: string;
1119
+ take_only: boolean;
1120
+ is_handout: boolean;
1121
+ is_reception: boolean;
1122
+ is_dressing_room: boolean;
1123
+ is_ltl: boolean;
1124
+ have_cashless: boolean;
1125
+ have_cash: boolean;
1126
+ allowed_cod: boolean;
1127
+ site: string;
1128
+ work_time_list: [
1129
+ {
1130
+ day: number;
1131
+ time: string;
1132
+ }
1133
+ ];
1134
+ weight_min: number;
1135
+ weight_max: number;
1136
+ location: {
1137
+ country_code: string;
1138
+ region_code: number;
1139
+ region: string;
1140
+ city_code: number;
1141
+ city: string;
1142
+ fias_guid: string;
1143
+ postal_code: string;
1144
+ longitude: number;
1145
+ latitude: number;
1146
+ address: string;
1147
+ address_full: string;
1148
+ };
1149
+ fulfillment: boolean;
1150
+ }
1151
+
1152
+ export interface GetDeliverySum {
1153
+ address: string;
1154
+ type: ERecieveMethod.COURIER | ERecieveMethod.PVZ;
1155
+ items: Omit<IOrderItem, '_id' | 'items_status'>[];
1156
+ seller_id: string;
1157
+ }
1158
+
1159
+ export interface IDeliverySum {
1160
+ delivery_sum: number;
1161
+ period_min: number;
1162
+ period_max: number;
1163
+ calendar_min: number;
1164
+ calendar_max: number;
1165
+ weight_calc: number;
1166
+ services: [
1167
+ {
1168
+ code: string;
1169
+ sum: number;
1170
+ }
1171
+ ];
1172
+ total_sum: number;
1173
+ currency: string;
1174
+ }
1175
+
1176
+ export interface IOrder {
1177
+ _id: string;
1178
+ total_received: number; // Сколько всего заплатил покупатель за этот заказ (сумма товаров + доставки)
1179
+ current_commission: number; // Текущая комиссия продавца за заказ (Сумма товаров * комиссию продавца / 100)
1180
+ sum: number;
1181
+ original_sum: number; // Сумма без учёта скидок
1182
+ full_sum: number; // Сумма с учетом доставки и коммиссии сервиса
1183
+ weight: number; // Общий вес в граммах
1184
+ user_id?: string;
1185
+ items: IOrderItem[];
1186
+ seller_id?: string;
1187
+ receive_method: ERecieveMethod;
1188
+ delivery_info?: Partial<IDeliveryFullInfo>;
1189
+ shop_id?: string;
1190
+ pvz?: Partial<IPVZ>;
1191
+ status: EOrderStatus;
1192
+ preparation_date?: Date;
1193
+ note?: string;
1194
+ reason_of_cancel?: string;
1195
+ number: number;
1196
+ createdAt: Date;
1197
+ updatedAt: Date;
1198
+ type?: DeliveryTypes;
1199
+ yandex_offer?: OfferDto;
1200
+ }
1201
+
1202
+ export interface IAdminMultiOrderResponse
1203
+ extends Omit<IMultiOrder, 'orders'> {
1204
+ orders: IPopulatedOrder[];
1205
+ }
1206
+
1207
+ export interface IMultiOrder {
1208
+ _id: string;
1209
+ user_id: string;
1210
+ sum: number;
1211
+ orders: string[];
1212
+ payment_id: string | null;
1213
+ number: number;
1214
+ status: EMultiOrderStatus;
1215
+ createdAt: Date;
1216
+ updatedAt: Date;
1217
+ }
1218
+
1219
+ export interface IPaymentCheckResponse {
1220
+ id: string;
1221
+ status: string;
1222
+ amount: {
1223
+ value: string;
1224
+ currency: string;
1225
+ };
1226
+ description: string;
1227
+ captured_at: string;
1228
+ created_at: string;
1229
+ metadata: {
1230
+ multiOrderId: string;
1231
+ multiOrderNumber: string;
1232
+ };
1233
+ confirmation: IConfirmation;
1234
+ purchase_unique: boolean;
1235
+ }
1236
+
1237
+ export type IConfirmationType = 'embedded' | 'external' | 'qr' | 'redirect';
1238
+
1239
+ export interface IConfirmation {
1240
+ type: IConfirmationType;
1241
+ locale?: string;
1242
+ confirmation_token?: string;
1243
+ confirmation_data?: string;
1244
+ confirmation_url?: string;
1245
+ enforce?: boolean;
1246
+ return_url?: string;
1247
+ }
1248
+
1249
+ export interface IPaymentResponse {
1250
+ id: string;
1251
+ status: string;
1252
+ amount: {
1253
+ value: string;
1254
+ currency: string;
1255
+ };
1256
+ description: string;
1257
+ created_at: string;
1258
+ confirmation: IConfirmation;
1259
+ metadata: {
1260
+ multiOrderId: string;
1261
+ multiOrderNumber: string;
1262
+ };
1263
+ }
1264
+
1265
+ export enum EMultiOrderStatus {
1266
+ CANCELED = 'CANCELED',
1267
+ PAID = 'PAID',
1268
+ PENDING = 'PENDING',
1269
+ }
1270
+
1271
+ export enum EComplaintsReason {
1272
+ NOT_MATCH_TO_DESC = 'NOT_MATCH_TO_DESC',
1273
+ INCORRECT_PHOTO = 'INCORRECT_PHOTO',
1274
+ DAMAGED_GOODS = 'DAMAGED_GOODS',
1275
+ POOR_QUALITY = 'POOR_QUALITY',
1276
+ FRAUD = 'FRAUD',
1277
+ OTHER = 'OTHER',
1278
+ }
1279
+
1280
+ export interface IComplaints {
1281
+ _id: string;
1282
+ user_id: string;
1283
+ product_id: string;
1284
+ text?: string;
1285
+ reason: EComplaintsReason;
1286
+ }
1287
+
1288
+ export interface ICreateComplaints {
1289
+ product_id: string;
1290
+ text?: string;
1291
+ reason: EComplaintsReason;
1292
+ }
1293
+
1294
+ export enum EReviewEntityType {
1295
+ PRODUCT = 'PRODUCT',
1296
+ HORSE = 'HORSE',
1297
+ SERVICE = 'SERVICE',
1298
+ }
1299
+
1300
+ export enum ECreatorType {
1301
+ SELLER = 'SELLER',
1302
+ USER = 'USER',
1303
+ }
1304
+
1305
+ export interface IReview {
1306
+ _id: string;
1307
+ user_id?: string;
1308
+ entity_id: string;
1309
+ entity_type: EReviewEntityType;
1310
+ creator_id: string;
1311
+ creator_type: ECreatorType;
1312
+ rating: number;
1313
+ text: string;
1314
+ anonymity: boolean;
1315
+ }
1316
+
1317
+ export interface IReviewsRequest {
1318
+ entity_id: string;
1319
+ entity_type: EReviewEntityType;
1320
+ creator_id: string;
1321
+ creator_type: ECreatorType;
1322
+ }
1323
+
1324
+ export interface IGetReviewsRequest
1325
+ extends Partial<FilterBaseQuery & IReviewsRequest> {}
1326
+
1327
+ export interface IReviewResponse {
1328
+ _id: string;
1329
+ user_id: {
1330
+ _id: string;
1331
+ tel: number;
1332
+ name: string;
1333
+ birthday: Date;
1334
+ email: string;
1335
+ full_name: string;
1336
+ patronymic: string;
1337
+ surname: string;
1338
+ };
1339
+ entity_id: string; // ID сущности, к которой привязан отзыв (например, Product или Horse)
1340
+ entity_type: EReviewEntityType; // Тип сущности (Product, Horse и т.д.)
1341
+ creator_id: string; // ID создателя сущности (продавец или пользователь)
1342
+ creator_type: ECreatorType; // Тип создателя (SELLER или USER)
1343
+ rating: number;
1344
+ text?: string;
1345
+ anonymity: boolean;
1346
+ createdAt: Date;
1347
+ updatedAt: Date;
1348
+ }
1349
+
1350
+ export interface IGetReviewDataRequest extends Partial<IReviewsRequest> {}
1351
+
1352
+ export interface IReviewsData {
1353
+ count: number;
1354
+ averageRating: string;
1355
+ sellerName?: string;
1356
+ }
1357
+
1358
+ export interface ICreateReviewRequest {
1359
+ entity_id: string;
1360
+ entity_type: EReviewEntityType;
1361
+ text?: string;
1362
+ anonymity: boolean;
1363
+ rating: number;
1364
+ }
1365
+
1366
+ export interface IDeleteReviewQuery {
1367
+ toDelete: string;
1368
+ }
1369
+
1370
+ export enum ESellerTransactionsType {
1371
+ SALE = 'SALE',
1372
+ FINE = 'FINE',
1373
+ WITHDRAW = 'WITHDRAW',
1374
+ REFUND = 'REFUND',
1375
+ }
1376
+
1377
+ export interface ISellerTransactions {
1378
+ _id: string;
1379
+ total_received: number; // Сумма которую оплатил покупатель за этот заказ (сумма товаров + сумма доставки)
1380
+ type: ESellerTransactionsType;
1381
+ sum: number;
1382
+ original_sum: number;
1383
+ admin_id?: string;
1384
+ order_id: string;
1385
+ comment?: string;
1386
+ commission: number;
1387
+ delivery_sum?: number;
1388
+ payment_id: string;
1389
+ seller_id: string;
1390
+ createdAt: Date;
1391
+ updatedAt: Date;
1392
+ }
1393
+
1394
+ export interface ICreateSellerTransactions {
1395
+ type: ESellerTransactionsType;
1396
+ sum: number;
1397
+ comment?: string;
1398
+ }
1399
+
1400
+ export interface IAdminGetTransactionsRequest extends FilterBaseQuery {
1401
+ type?: ESellerTransactionsType;
1402
+ sum?: 'asc' | 'desc';
1403
+ from?: string;
1404
+ to?: string;
1405
+ seller_id?: string;
1406
+ order_id?: string;
1407
+ }
1408
+
1409
+ export interface IAdminTransactionsQueryResponse {
1410
+ transactions: ISellerTransactions[];
1411
+ count: number;
1412
+ }
1413
+
1414
+ export interface IAdminTopSalesQueryRequest extends FilterBaseQuery {
1415
+ seller_id: string;
1416
+ }
1417
+
1418
+ export interface IAdminTopSalesResponse {
1419
+ products: IProduct[];
1420
+ count: number;
1421
+ }
1422
+
1423
+ export interface IAdminChangeCommissionRequest {
1424
+ commission: number;
1425
+ }
1426
+
1427
+ export interface IAdminChangeCommissionResponse {
1428
+ commission: number;
1429
+ }
1430
+
1431
+ export interface IAdminGetChartDataQueryRequest {
1432
+ year: string;
1433
+ seller_id: string;
1434
+ }
1435
+
1436
+ export interface IAdminGetChartDataResponse {
1437
+ [key: string]: number;
1438
+ }
1439
+
1440
+ export interface IAdminCreateSellerTransactionRequest {
1441
+ type: ESellerTransactionsType;
1442
+ sum: number;
1443
+ }
1444
+
1445
+ export interface IAdminAddCustomRefundTransactionRequest {
1446
+ custom_sum: number;
1447
+ comment: string;
1448
+ }
1449
+
1450
+ export enum ENotificationType {
1451
+ ORDER = 'ORDER',
1452
+ PRODUCT = 'PRODUCT',
1453
+ COLLECTION = 'COLLECTION',
1454
+ FAVORITES = 'FAVORITES',
1455
+ }
1456
+
1457
+ export interface IAdminChangeSellerStatusRequest {
1458
+ status: ESellerStatus.APPROVED | ESellerStatus.DECLINED;
1459
+ }
1460
+
1461
+ export enum ESellerTypes {
1462
+ PHYSICAL = 'PHYSICAL', // Физическое лицо
1463
+ LEGAL = 'LEGAL', // Юридическое лицо
1464
+ }
1465
+
1466
+ export enum ESellerLegalTypes {
1467
+ LEGAL = 'LEGAL',
1468
+ INDIVIDUAL = 'INDIVIDUAL',
1469
+ }
1470
+
1471
+ export enum ESellerLocaleTypes {
1472
+ PHYSICAL = 'Физическое лицо',
1473
+ LEGAL = 'Юридическое лицо',
1474
+ }
1475
+
1476
+ export interface IGetInfoOfLegalRequest {
1477
+ INN: string;
1478
+ }
1479
+
1480
+ export interface IСheckCleanOfPassportRequest {
1481
+ passport_details: string;
1482
+ }
1483
+
1484
+ export interface ICleanPassportResponse {
1485
+ source: string;
1486
+ series: string;
1487
+ number: string;
1488
+ qc: number; // Check EPassportQc
1489
+ }
1490
+
1491
+ export enum EPassportQc {
1492
+ 'Действующий паспорт' = 0,
1493
+ 'Неправильный формат серии или номера' = 1,
1494
+ 'Исходное значение пустое' = 2,
1495
+ 'Недействительный паспорт' = 10,
1496
+ }
1497
+
1498
+ export enum ECompanyStatus {
1499
+ 'ACTIVE' = 'ACTIVE',
1500
+ 'LIQUIDATING' = 'LIQUIDATING',
1501
+ 'LIQUIDATED' = 'LIQUIDATED',
1502
+ 'BANKRUPT' = 'BANKRUPT',
1503
+ 'REORGANIZING' = 'REORGANIZING',
1504
+ }
1505
+
1506
+ export interface ISuggestion {
1507
+ value: string; // Название компании
1508
+ unrestricted_value: string;
1509
+ data: {
1510
+ kpp: string;
1511
+ branch_type: string;
1512
+ type: ESellerLegalTypes;
1513
+ state: {
1514
+ status: ECompanyStatus;
1515
+ code: null;
1516
+ };
1517
+ name: {
1518
+ full_with_opf: string;
1519
+ short_with_opf: string;
1520
+ };
1521
+ inn: string;
1522
+ ogrn: string;
1523
+ okpo: string;
1524
+ address: {
1525
+ value: string;
1526
+ };
1527
+ };
1528
+ }
1529
+
1530
+ export interface ICreatePhysicalSellerRequest extends ICreateSellerRequest {
1531
+ birthday: string;
1532
+ passport_details: string;
1533
+ passport_photo: File;
1534
+ }
1535
+
1536
+ export interface ISellerAdditionalInfo {
1537
+ passport_details?: string;
1538
+ passport_photo?: string;
1539
+ card_number?: string;
1540
+ }
1541
+
1542
+ export interface ISellerCompanyInfo {
1543
+ name: string;
1544
+ okpo: string;
1545
+ ogrn: string;
1546
+ type: ESellerLegalTypes;
1547
+ }
1548
+
1549
+ export interface IGetInfoOfPhysicRequest {
1550
+ name: string;
1551
+ surname: string;
1552
+ patronymic?: string;
1553
+ birthday: Date;
1554
+ passport_details: string;
1555
+ opt_otch: boolean;
1556
+ INN: string;
1557
+ }
1558
+
1559
+ export interface IGetInfoOfPhysicResponse {
1560
+ inn?: string;
1561
+ captcha_required: boolean;
1562
+ code: string; // 0 - Не найден, 1 - Все окей
1563
+ }
1564
+
1565
+ export interface ICheckSellerDataForCorrectness {
1566
+ name: string;
1567
+ surname: string;
1568
+ patronymic?: string;
1569
+ opt_otch: boolean;
1570
+ INN: string;
1571
+ birthday: Date;
1572
+ passport_details: string;
1573
+ }
1574
+
1575
+ export enum ECheckSellerDataErrors {
1576
+ 'INVALID_PASSPORT' = 'INVALID_PASSPORT',
1577
+ 'INCORRECT_INN' = 'INCORRECT_INN',
1578
+ 'INN_NOT_FOUND' = 'INN_NOT_FOUND',
1579
+ }
1580
+
1581
+ export interface IAdminCreatePhysicalSellerRequest
1582
+ extends Omit<IAdminCreateSellerRequest, 'banking_details'> {
1583
+ banking_details: IPhysicalBankingDetails;
1584
+ passport_details: string;
1585
+ passport_photo: File | File[];
1586
+ card_number?: string;
1587
+ }
1588
+
1589
+ export interface IUserWithSellerType extends IUser {
1590
+ type: EUserSellerType;
1591
+ }
1592
+
1593
+ export enum EUserSellerType {
1594
+ 'PHYSICAL' = 'PHYSICAL',
1595
+ 'LEGAL' = 'LEGAL',
1596
+ 'NOT_SELLER' = 'NOT_SELLER',
1597
+ }
1598
+
1599
+ export interface IUpdateMultiOrderStatusRequest {
1600
+ _id: string;
1601
+ status: EMultiOrderStatus;
1602
+ reason_of_cancel: EReasonOfCancel;
1603
+ }
1604
+
1605
+ export interface IUserRandomProductQueryRequest extends OptionalUserQuery {
1606
+ size: string;
1607
+ category_id?: string;
1608
+ subCategory_id?: string;
1609
+ }
1610
+
1611
+ export enum ECheckForFillingSellerDataError {
1612
+ SHOP_IS_NOT_EXIST = 'SHOP_IS_NOT_EXIST',
1613
+ CDEK_POINT_IS_NOT_EXIST = 'CDEK_POINT_IS_NOT_EXIST',
1614
+ DELIVERY_WAYS_IS_NOT_EXIST = 'DELIVERY_WAYS_IS_NOT_EXIST',
1615
+ SELLER_INFO_IS_NOT_FILLED_OUT = 'SELLER_INFO_IS_NOT_FILLED_OUT',
1616
+ BANKING_DETAILS_IS_NOT_FILLED_OUT = 'BANKING_DETAILS_IS_NOT_FILLED_OUT',
1617
+ }
1618
+
1619
+ export interface IAdminCreateWithdrawalRequest {
1620
+ sum: number;
1621
+ }
1622
+
1623
+ export interface IAddressSuggestionRequest {
1624
+ address: string;
1625
+ isCityOnly?: 'true' | 'false';
1626
+ }
1627
+
1628
+ export interface IAddressSuggestion {
1629
+ value: string;
1630
+ unrestricted_value: string;
1631
+ data: {
1632
+ city: string;
1633
+ city_district: string;
1634
+ region_fias_id: string;
1635
+ city_fias_id: string;
1636
+ city_kladr_id: string;
1637
+ fias_id: string;
1638
+ fias_code: null;
1639
+ fias_level: string;
1640
+ kladr_id: string;
1641
+ geo_lat: string | null;
1642
+ geo_lon: string | null;
1643
+ };
1644
+ }
1645
+
1646
+ export interface IAddressSuggestionResponse {
1647
+ suggestions: IAddressSuggestion[];
1648
+ }
1649
+
1650
+ export interface IBanner {
1651
+ _id: string;
1652
+ photo: string;
1653
+ position: number;
1654
+ seller_id: string;
1655
+ navigation_path: string | null; // example: "ProductScreen"
1656
+ navigation_params: Record<string, any> | null; // example: {product_id: "ObjectId"}
1657
+ createdAt: Date;
1658
+ updatedAt: Date;
1659
+ }
1660
+
1661
+ export interface IMoySkladLinkerRequest {
1662
+ updateData: {
1663
+ linker_id: string;
1664
+ category_id: string;
1665
+ subCategory_id: string;
1666
+ }[];
1667
+ }
1668
+
1669
+ export interface IMoySkladLinker {
1670
+ pathName: string;
1671
+ seller_id: string;
1672
+ product_ids: string[];
1673
+ }
1674
+
1675
+ export interface IVersion {
1676
+ version: string;
1677
+ isForceToUpdate: boolean;
1678
+ }
1679
+
1680
+ export interface IAppVersion {
1681
+ ios: IVersion;
1682
+ android: IVersion;
1683
+ }
1684
+
1685
+ export interface NotificationData {
1686
+ body: string;
1687
+ data?: InternalPushMessageData | ExternalPushMessageData;
1688
+ title: string;
1689
+ }
1690
+
1691
+ export interface INotification {
1692
+ _id: string;
1693
+ user_id?: string;
1694
+ push_token_id: string;
1695
+ message: NotificationData;
1696
+ status: ENotificationStatus;
1697
+ createdAt: Date;
1698
+ }
1699
+
1700
+ export enum ENotificationStatus {
1701
+ READ = 'READ',
1702
+ UNREAD = 'UNREAD',
1703
+ }
1704
+
1705
+ export interface ISendNotifications {
1706
+ to: ENotificationRecipients;
1707
+ notificationData: NotificationData;
1708
+ }
1709
+
1710
+ export enum ENotificationRecipients {
1711
+ ALL = 'ALL',
1712
+ SELLERS = 'SELLERS',
1713
+ USERS = 'USERS',
1714
+ }
1715
+
1716
+ export interface IHintCharacteristics {
1717
+ name: string;
1718
+ values: string[];
1719
+ }
1720
+
1721
+ export interface IPossibleCombinations {
1722
+ combinations: ICharacteristic[][];
1723
+ characteristics: { name: string; values: string[] }[];
1724
+ }
1725
+
1726
+ export interface IGetVariationByCharacteristics {
1727
+ product_id: string;
1728
+ characteristics: ICharacteristic[];
1729
+ }
1730
+
1731
+ export enum ESex {
1732
+ STALLION = 'stallion',
1733
+ MARE = 'mare',
1734
+ GELDING = 'gelding',
1735
+ }
1736
+
1737
+ export interface ICompetitionHistory {
1738
+ name: string;
1739
+ place: string;
1740
+ }
1741
+
1742
+ export interface ILocation {
1743
+ name: string;
1744
+ coordinates?: number[]; // [lng, lat]
1745
+ lat: number;
1746
+ lng: number;
1747
+ }
1748
+
1749
+ export interface IPreferredCommunication {
1750
+ telegram: boolean;
1751
+ whatsapp: boolean;
1752
+ calls: boolean;
1753
+ sms: boolean;
1754
+ }
1755
+
1756
+ export interface ICommunication {
1757
+ tel: number;
1758
+ preferredCommunication: IPreferredCommunication;
1759
+ }
1760
+
1761
+ export interface ICreateHorse {
1762
+ name: string;
1763
+ sex: ESex;
1764
+ breed: string;
1765
+ suit: string;
1766
+ category: string;
1767
+ birthDate: string;
1768
+ withersHeight: number;
1769
+ price: number;
1770
+ location: ILocation;
1771
+ images: File | File[];
1772
+ video_cover?: File;
1773
+ desc?: string;
1774
+ reg_number?: string;
1775
+ genealogy?: string;
1776
+ birthplace?: string;
1777
+ documents?: File | File[];
1778
+ documentsNames?: string[];
1779
+ competition_history?: ICompetitionHistory[];
1780
+ communication: ICommunication;
1781
+ }
1782
+
1783
+ export interface IUpdateHorse extends Partial<ICreateHorse> {
1784
+ toRemoveImages?: string[];
1785
+ toRemoveVideoCover?: string;
1786
+ toRemoveDocuments?: string[]; // Array of documents.fileName
1787
+ }
1788
+
1789
+ export enum EHorseStatus {
1790
+ MODERATION = 'MODERATION',
1791
+ PUBLISHED = 'PUBLISHED',
1792
+ REJECTED = 'REJECTED',
1793
+ ARCHIVED = 'ARCHIVED',
1794
+ }
1795
+
1796
+ export interface IHorse {
1797
+ _id: string;
1798
+ user_id: string;
1799
+ status: EHorseStatus;
1800
+ name: string;
1801
+ sex: ESex;
1802
+ breed: string;
1803
+ suit: string;
1804
+ birthDate: Date;
1805
+ category: string;
1806
+ withersHeight: number;
1807
+ price: number;
1808
+ location: ILocation;
1809
+ images: string[];
1810
+ video_cover: string | null;
1811
+ desc: string | null;
1812
+ reg_number: string | null;
1813
+ genealogy: string | null;
1814
+ birthplace: string | null;
1815
+ documents: IDocument[] | null;
1816
+ competition_history: ICompetitionHistory[] | null;
1817
+ communication: ICommunication;
1818
+ reason_of_cancel?: string;
1819
+ distance?: number; // Расстояние пользователя до лошади (если передано гео)
1820
+ archived_reason?: string;
1821
+ telegram_message_id: string | null;
1822
+ slug: string;
1823
+ number: number;
1824
+ published_at?: Date;
1825
+ entityAnalytics?: IEntityAnalytics;
1826
+ createdAt: Date;
1827
+ updatedAt: Date;
1828
+ }
1829
+
1830
+ export interface IDocument {
1831
+ name: string;
1832
+ fileName: string;
1833
+ }
1834
+
1835
+ export interface IPopulatedHorse
1836
+ extends Omit<IHorse, 'user_id' | 'breed' | 'suit' | 'category'> {
1837
+ user_id: IPopulatedOrderUserApp;
1838
+ breed: IBreed;
1839
+ suit: ISuit;
1840
+ category: IHorseCategory;
1841
+ is_favorite?: boolean;
1842
+ }
1843
+
1844
+ export interface IBreed {
1845
+ _id: string;
1846
+ name: string;
1847
+ createdAt: Date;
1848
+ updatedAt: Date;
1849
+ }
1850
+
1851
+ export interface ISuit {
1852
+ _id: string;
1853
+ name: string;
1854
+ createdAt: Date;
1855
+ updatedAt: Date;
1856
+ }
1857
+
1858
+ export interface IHorseCategory {
1859
+ _id: string;
1860
+ name: string;
1861
+ createdAt: Date;
1862
+ updatedAt: Date;
1863
+ }
1864
+
1865
+ export interface IHorseFormInformation {
1866
+ breeds: IBreed[];
1867
+ suits: ISuit[];
1868
+ categories: IHorseCategory[];
1869
+ }
1870
+
1871
+ export enum EViewCountEntityType {
1872
+ HORSE = 'HORSE',
1873
+ PRODUCT = 'PRODUCT',
1874
+ SERVICE = 'SERVICE',
1875
+ }
1876
+
1877
+ export interface IViewCount {
1878
+ entity_type: EViewCountEntityType;
1879
+ entity_id: string;
1880
+ count: number;
1881
+ createdAt: Date;
1882
+ updatedAt: Date;
1883
+ }
1884
+
1885
+ export interface IPopulatedHorseWViewCount extends IPopulatedHorse {
1886
+ viewCount: IViewCount;
1887
+ }
1888
+
1889
+ export interface IGetCombinedHorses {
1890
+ user_id?: string; // objectid
1891
+ sex?: 'stallion' | 'mare' | 'gelding';
1892
+ breed?: string; // objectid
1893
+ suit?: string; // objectid
1894
+ ageMin?: string;
1895
+ ageMax?: string;
1896
+ withersHeightMin?: string;
1897
+ withersHeightMax?: string;
1898
+ priceMin?: string;
1899
+ priceMax?: string;
1900
+ category?: string; // objectid
1901
+ lat?: string; // user lat
1902
+ lng?: string; // user lng
1903
+ radius?: string;
1904
+ }
1905
+
1906
+ export interface IReverseGeocodingRequest {
1907
+ lat: number;
1908
+ lon: number;
1909
+ count?: number;
1910
+ radius_meters?: number;
1911
+ }
1912
+
1913
+ export interface IHorseQueryRequest extends FilterBaseQuery {}
1914
+
1915
+ export interface IAdminHorsesQueryResponse {
1916
+ horses: IPopulatedHorse[];
1917
+ count: number;
1918
+ }
1919
+
1920
+ export interface IActionsHorseRequest {
1921
+ toDelete: string;
1922
+ }
1923
+
1924
+ export interface IAdminChangeHorseStatusRequest {
1925
+ status: EHorseStatus;
1926
+ reason_of_cancel?: string;
1927
+ }
1928
+
1929
+ export interface InternalPushMessageData {
1930
+ type: ENotificationType;
1931
+ typeId: string;
1932
+ typeSlug?: string | null;
1933
+ }
1934
+
1935
+ export interface ExternalPushMessageData {
1936
+ url: string;
1937
+ }
1938
+
1939
+ export interface IGetHorseViewHistory extends FilterBaseQuery {
1940
+ lat?: string; // user lat
1941
+ lng?: string; // user lng
1942
+ }
1943
+ export interface IPriceHistorySearch {
1944
+ priceMin?: number;
1945
+ priceMax?: number;
1946
+ }
1947
+
1948
+ export enum ECollectionStatus {
1949
+ PUBLISHED = 'PUBLISHED',
1950
+ ARCHIVED = 'ARCHIVED',
1951
+ }
1952
+ export interface IPopulatedCollection
1953
+ extends Omit<ICollection, 'products'> {
1954
+ products: IProductResponse[];
1955
+ }
1956
+
1957
+ export interface ICollectionQueryRequest {
1958
+ title?: string;
1959
+ desc?: string;
1960
+ slug?: string;
1961
+ deeplink?: string;
1962
+ photo?: string;
1963
+ products?: string;
1964
+ status?: string;
1965
+ position?: number;
1966
+ all_fields?: string;
1967
+ is_thematic?: 'true' | 'false';
1968
+ skip: string;
1969
+ limit: string;
1970
+ }
1971
+
1972
+ export interface ICreateCollection {
1973
+ title: string;
1974
+ desc?: string;
1975
+ deeplink?: string;
1976
+ photo: File;
1977
+ products: string[];
1978
+ status: ECollectionStatus;
1979
+ position: number;
1980
+ is_thematic?: 'true' | 'false';
1981
+ icon?: File;
1982
+ }
1983
+
1984
+ export interface IUpdateCollection {
1985
+ title?: string;
1986
+ desc?: string;
1987
+ deeplink?: string;
1988
+ photo?: File;
1989
+ products?: string[];
1990
+ status?: ECollectionStatus;
1991
+ position?: number;
1992
+ is_thematic?: 'true' | 'false';
1993
+ icon?: File;
1994
+ }
1995
+
1996
+ export interface ICollection {
1997
+ _id: string;
1998
+ title: string;
1999
+ desc?: string;
2000
+ slug: string;
2001
+ deeplink?: string;
2002
+ photo: string;
2003
+ products: string[];
2004
+ status: ECollectionStatus;
2005
+ position: number;
2006
+ is_thematic: boolean;
2007
+ icon: string | null;
2008
+ }
2009
+ export interface IPickupPoints {
2010
+ lat: string;
2011
+
2012
+ lng: string;
2013
+ }
2014
+
2015
+ export interface ICalculateFastDeliveryPrice {
2016
+ lat: string;
2017
+
2018
+ lng: string;
2019
+
2020
+ items: IOrderItem[];
2021
+ }
2022
+
2023
+ export interface ItemSizeDto {
2024
+ // product.dimension: length, width, height
2025
+ length: number;
2026
+ width: number;
2027
+ height: number;
2028
+ }
2029
+
2030
+ export interface ItemDto {
2031
+ size?: ItemSizeDto;
2032
+ weight?: number;
2033
+ quantity: number;
2034
+ pickup_point: number;
2035
+ dropoff_point: number;
2036
+ }
2037
+
2038
+ export interface RoutePointDto {
2039
+ id: number; // 1, 2, 3...
2040
+ fullname?: string;
2041
+ coordinates: number[]; // 37.617298, 55.755825
2042
+ }
2043
+
2044
+ export interface DeliveryInterval {
2045
+ from: string;
2046
+ to: string;
2047
+ }
2048
+ export interface SameDayData {
2049
+ delivery_interval: DeliveryInterval;
2050
+ }
2051
+ export interface RequirementsDto {
2052
+ taxi_classes?: string[];
2053
+ cargo_type?: string;
2054
+ cargo_loaders?: number;
2055
+ pro_courier?: boolean;
2056
+ cargo_options?: string[];
2057
+ skip_door_to_door?: boolean;
2058
+ due?: string;
2059
+ same_day_data?: SameDayData;
2060
+ delivery_interval: DeliveryInterval;
2061
+ }
2062
+
2063
+ export interface YandexDeliveryRequestDto {
2064
+ items: ItemDto[];
2065
+ route_points: RoutePointDto[];
2066
+ requirements: RequirementsDto;
2067
+ }
2068
+ export interface PriceDto {
2069
+ total_price: string;
2070
+ total_price_with_vat: string;
2071
+ surge_ratio: number;
2072
+ currency: string;
2073
+ }
2074
+
2075
+ export interface IntervalDto {
2076
+ from: string;
2077
+ to: string;
2078
+ }
2079
+
2080
+ export interface OfferDto {
2081
+ price: PriceDto;
2082
+ taxi_class: string;
2083
+ pickup_interval: IntervalDto;
2084
+ delivery_interval: IntervalDto;
2085
+ description: string;
2086
+ payload: string;
2087
+ offer_ttl: string;
2088
+ }
2089
+
2090
+ export enum EProductsSortOptions {
2091
+ NEWEST = 'Новинки',
2092
+ POPULAR = 'Популярные',
2093
+ CHEAPEST = 'Дешевле',
2094
+ EXPENSIVE = 'Дороже',
2095
+ }
2096
+
2097
+ export interface PriceDto {
2098
+ total_price: string;
2099
+ total_price_with_vat: string;
2100
+ surge_ratio: number;
2101
+ currency: string;
2102
+ }
2103
+
2104
+ export interface IntervalDto {
2105
+ from: string;
2106
+ to: string;
2107
+ }
2108
+
2109
+ export interface OfferDto {
2110
+ price: PriceDto;
2111
+ taxi_class: string;
2112
+ pickup_interval: IntervalDto;
2113
+ delivery_interval: IntervalDto;
2114
+ description: string;
2115
+ payload: string;
2116
+ offer_ttl: string;
2117
+ }
2118
+ export enum DeliveryTypes {
2119
+ CDEK = 'CDEK',
2120
+ YANDEX_EXPRESS = 'YANDEX_EXPRESS',
2121
+ }
2122
+
2123
+ export interface GetFastDeliveryPriceDto {
2124
+ items: IPopulatedOrderItem[];
2125
+
2126
+ delivery_info: Partial<IDeliveryFullInfo>;
2127
+ }
2128
+
2129
+ // Favorites (Избранное) - Начало
2130
+
2131
+ export enum EFavoritesEntityType {
2132
+ PRODUCT = 'PRODUCT',
2133
+ HORSE = 'HORSE',
2134
+ SERVICE = 'SERVICE',
2135
+ }
2136
+
2137
+ export interface IFavorite {
2138
+ user_id?: string | null; // ID пользователя, который добавил в избранное
2139
+ session_id?: string | null;
2140
+ entity_id: string; // ID сущности, к которой привязано избранное (например, Product или Horse)
2141
+ entity_type: EFavoritesEntityType; // Тип сущности (PRODUCT, HORSE и т.д.)
2142
+ }
2143
+
2144
+ export interface IPopulatedFavorite extends Omit<IFavorite, 'entity_id'> {
2145
+ _id: string;
2146
+ entity_id: IProductResponse | IPopulatedHorse | IPopulatedService; // В зависимости от entity_type присваивать entity_id as IProductResponse или IPopulatedHorse
2147
+ }
2148
+
2149
+ export enum EFavoriteToggleActions {
2150
+ ADDED = 'ADDED', // Добавлен в базу
2151
+ REMOVED = 'REMOVED', // Убран из базы
2152
+ }
2153
+
2154
+ export interface IToggleFavoriteRequest
2155
+ extends Omit<IFavorite, 'user_id' | 'session_id'> {}
2156
+
2157
+ export interface IGetFavoritesRequest
2158
+ extends Omit<IFavorite, 'entity_id' | 'user_id' | 'session_id'> {}
2159
+
2160
+ export interface IToggleFavoriteResponse {
2161
+ action: EFavoriteToggleActions;
2162
+ }
2163
+
2164
+ // Favorites (Избранное) - Конец
2165
+
2166
+ // Services (Услуги) - Начало
2167
+
2168
+ export interface IGetServicesQuery extends FilterBaseQuery {
2169
+ creator_id?: string;
2170
+ user_id?: string;
2171
+ category?: string;
2172
+ priceMin?: string;
2173
+ priceMax?: string;
2174
+ lat?: string; // user lat
2175
+ lng?: string; // user lng
2176
+ radius?: string;
2177
+ }
2178
+
2179
+ export interface ICreateService {
2180
+ name: string;
2181
+ description?: string;
2182
+ category: string;
2183
+ price: number;
2184
+ location: ILocation;
2185
+ communication: ICommunication;
2186
+ photo: File;
2187
+ }
2188
+
2189
+ export interface IUpdateService extends Partial<ICreateService> {}
2190
+
2191
+ export enum EServiceStatus {
2192
+ MODERATION = 'MODERATION',
2193
+ PUBLISHED = 'PUBLISHED',
2194
+ REJECTED = 'REJECTED',
2195
+ ARCHIVED = 'ARCHIVED',
2196
+ }
2197
+
2198
+ export interface IServiceCategory {
2199
+ _id: string;
2200
+ name: string;
2201
+ photo: string;
2202
+ createdAt: Date;
2203
+ updatedAt: Date;
2204
+ }
2205
+
2206
+ export interface IService {
2207
+ user_id: string;
2208
+ name: string;
2209
+ description?: string;
2210
+ category: string;
2211
+ price: number;
2212
+ status: EServiceStatus;
2213
+ location: ILocation;
2214
+ communication: ICommunication;
2215
+ photo: string;
2216
+ telegram_message_id: number | null;
2217
+ slug: string;
2218
+ distance?: number; // Расстояние пользователя до лошади (если передано гео)
2219
+ number: number;
2220
+ published_at?: Date;
2221
+ entityAnalytics?: IEntityAnalytics;
2222
+ createdAt: Date;
2223
+ updatedAt: Date;
2224
+ }
2225
+
2226
+ export interface IPopulatedServicesWithReviewDataResponse {
2227
+ services: IPopulatedService[];
2228
+ reviewsData: IReviewsData;
2229
+ }
2230
+
2231
+ export interface IPopulatedService
2232
+ extends Omit<IService, 'category' | 'user_id'> {
2233
+ _id: string;
2234
+ category: IServiceCategory;
2235
+ user_id: IPopulatedOrderUserApp;
2236
+ is_favorite?: boolean;
2237
+ reviewsData?: IReviewsData;
2238
+ }
2239
+
2240
+ export interface IPopulatedServiceWViewCount extends IPopulatedService {
2241
+ viewCount: IViewCount;
2242
+ }
2243
+
2244
+ // Services (Услуги) - Конец
2245
+
2246
+ export interface OptionalUserQuery {
2247
+ user_id?: string;
2248
+ }
2249
+
2250
+ export interface OptionalLocationQuery {
2251
+ lat?: string;
2252
+ lng?: string;
2253
+ }
2254
+
2255
+ export interface OptionalUserLocationQuery
2256
+ extends OptionalUserQuery,
2257
+ OptionalLocationQuery {}
2258
+
2259
+ export interface CombinedUserLocationFilterQuery
2260
+ extends OptionalUserLocationQuery,
2261
+ FilterBaseQuery {}
2262
+
2263
+ export interface ISavePushToken {
2264
+ token: string;
2265
+ userId?: string;
2266
+ }
2267
+
2268
+ export enum EEntityType {
2269
+ PRODUCT = 'PRODUCT',
2270
+ HORSE = 'HORSE',
2271
+ SERVICE = 'SERVICE',
2272
+ }
2273
+
2274
+ export interface IGetUnreviewedProductsResponse {
2275
+ products: IProductResponse[];
2276
+ count: number;
2277
+ }
2278
+
2279
+ export enum EArchivedReason {
2280
+ HORSESMART = 'На HorseSmart',
2281
+ OTHER_PLATFORM = 'На другой площадке',
2282
+ PERSONAL = 'Лично',
2283
+ NOT_SOLD = 'Не продал',
2284
+ }
2285
+
2286
+ export interface IDeleteHorse {
2287
+ archived_reason: EArchivedReason;
2288
+ }
2289
+
2290
+ export interface SellerSlugResponse {
2291
+ _id: string;
2292
+ slug: string;
2293
+ updatedAt: Date;
2294
+ }
2295
+
2296
+ export interface IEntityAnalytics {
2297
+ entity_type: EEntityType;
2298
+ entity_id: string;
2299
+ views_count: number;
2300
+ favorites_count: number;
2301
+ purchases_count: number;
2302
+ cart_count: number;
2303
+ createdAt: Date;
2304
+ updatedAt: Date;
2305
+ }
2306
+
2307
+ export interface ISendOtpRequest {
2308
+ email: string;
2309
+ }
2310
+
2311
+ export interface IVerifyOtpRequest {
2312
+ email: string;
2313
+ code: number;
2314
+ }
2315
+
2316
+ export interface IVerifyOtpResponse extends ITokensResponse {
2317
+ user_id: string;
2318
+ }
2319
+
2320
+ export interface ICreateMultiOrderResponse {
2321
+ payment: IPaymentResponse;
2322
+ tokens?: ITokensResponse;
2323
+ }
2324
+
2325
+ export interface IPopulatedOrderAppWPaymentId {
2326
+ order: IPopulatedOrderApp;
2327
+ payment_id: string;
2328
+ }
2329
+
2330
+ // PromoCode
2331
+
2332
+ export interface ICreatePromo {
2333
+ discount_percent: number;
2334
+ start_date?: string; // default: new Date().toISOString()
2335
+ end_date: string;
2336
+ }
2337
+
2338
+ export interface IApplyPromo {
2339
+ code: string;
2340
+ }
2341
+
2342
+ export interface IPromoCode {
2343
+ _id: string;
2344
+ seller_id: string; // Привязка к продавцу
2345
+ code: string; // Сам промокод, например HSYORK20
2346
+ discount_percent: number; // Процент скидки (20 -> 20%)
2347
+ start_date: Date; // Дата начала действия промокода
2348
+ end_date: Date; // Дата окончания действия промокода
2349
+ showcase_url: string; // Ссылка на витрину продавца
2350
+ createdAt: Date;
2351
+ updatedAt: Date;
2352
+ }
2353
+
2354
+ /**
2355
+ * Порядок сортировки
2356
+ */
2357
+ export enum SortOrder {
2358
+ ASC = 'asc',
2359
+ DESC = 'desc',
2360
+ }
2361
+
2362
+ /**
2363
+ * Payload для запроса на улучшение описания
2364
+ */
2365
+ export interface EnhanceDescriptionPayload {
2366
+ productId: string;
2367
+ additionalPrompt?: string;
2368
+ }
2369
+
2370
+ /**
2371
+ * Payload для запроса на улучшение характеристик
2372
+ */
2373
+ export interface EnhanceCharacteristicsPayload {
2374
+ productId: string;
2375
+ }
2376
+
2377
+ /**
2378
+ * Payload для запроса на улучшение изображения
2379
+ */
2380
+ export interface EnhanceImagePayload {
2381
+ productId: string;
2382
+ type?: string;
2383
+ additionalPrompt?: string;
2384
+ }
2385
+
2386
+ /**
2387
+ * Bulk payload для массового улучшения
2388
+ */
2389
+ export interface EnhanceBulkPayload {
2390
+ productIds: string[];
2391
+ description: boolean;
2392
+ characteristics: boolean;
2393
+ image: boolean;
2394
+ }
2395
+
2396
+ /**
2397
+ * Интерфейс для ответа со списком улучшений
2398
+ */
2399
+ export interface EnhancementListResponse {
2400
+ items: EnhancementResponse[];
2401
+ pagination: {
2402
+ totalItems: number;
2403
+ itemsPerPage: number;
2404
+ totalPages: number;
2405
+ currentPage: number;
2406
+ sortBy: string;
2407
+ sortOrder: SortOrder;
2408
+ };
2409
+ }
2410
+
2411
+ /**
2412
+ * Базовый интерфейс улучшения
2413
+ */
2414
+ export interface EnhancementResponse {
2415
+ _id: string;
2416
+ productId: string;
2417
+ old_desc: string;
2418
+ ai_characteristics_variants: EnhancementCharacteristicsResponse[];
2419
+ ai_description_variants: EnhancementDescriptionResponse[];
2420
+ ai_image_variants: EnhancementImageResponse[];
2421
+ createdAt: Date;
2422
+ updatedAt: Date;
2423
+ }
2424
+
2425
+ export interface EnhancementDescriptionResponse {
2426
+ _id: string;
2427
+ productId: string;
2428
+ new_desc: string;
2429
+ status: string;
2430
+ additionalPrompt?: string;
2431
+ createdAt: Date;
2432
+ updatedAt: Date;
2433
+ }
2434
+
2435
+ export interface EnhancementCharacteristicsResponse {
2436
+ _id: string;
2437
+ productId: string;
2438
+ characteristics: ICharacteristic[];
2439
+ status: string;
2440
+ createdAt: Date;
2441
+ updatedAt: Date;
2442
+ }
2443
+
2444
+ export interface EnhancementImageResponse {
2445
+ _id: string;
2446
+ productId: string;
2447
+ image: string;
2448
+ type: EEnhancementImageType;
2449
+ status: string;
2450
+ createdAt: Date;
2451
+ updatedAt: Date;
2452
+ }
2453
+
2454
+ export enum EEnhancementImageType {
2455
+ BACKGROUND = 'background',
2456
+ FULL = 'full',
2457
+ INFOGRAPHIC = 'infographic',
2458
+ }
2459
+
2460
+ /**
2461
+ * Общий интерфейс для пагинации
2462
+ */
2463
+ export interface PaginateDto {
2464
+ page?: number;
2465
+ limit?: number;
2466
+ sortBy?: string;
2467
+ sortOrder?: SortOrder;
2468
+ }
2469
+ }
2470
+ }