@mivis/petmart-api 1.2.291 → 1.2.293

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