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