@cinerino/sdk 15.0.0-alpha.13 → 15.0.0-alpha.15

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.
@@ -1,12 +1,6 @@
1
- import { IAcceptedOffer, IOrderAsSearchResult, IOrderAsSearchWithUnwindAcceptedOffersResult, IReturner, ISearchOrdersOptions, IUpdateChangeableAttributesParams } from '../chevreConsole/order/factory';
1
+ import { IAcceptedOffer, IOrderAsSearchResult, IOrderAsSearchWithUnwindAcceptedOffersResult, IReturner, IFindParams, IProjection, IUpdateChangeableAttributesParams } from '../chevreConsole/order/factory';
2
2
  import { factory } from '../factory';
3
- import { ISearchResult, Service } from '../service';
4
- type IKeyOfProjection = keyof factory.order.IOrder | '_id';
5
- /**
6
- * 注文検索時projection
7
- * 0->1(2024-07-29~)
8
- */
9
- type IProjection = Partial<Record<IKeyOfProjection, 1>>;
3
+ import { Service } from '../service';
10
4
  /**
11
5
  * 注文サービス
12
6
  */
@@ -18,20 +12,7 @@ export declare class OrderService extends Service {
18
12
  /**
19
13
  * 注文を検索する
20
14
  */
21
- search(params: Omit<factory.order.ISearchConditions, 'project' | 'provider'> & {
22
- $projection?: IProjection;
23
- $projectDisabled?: '1';
24
- } & ISearchOrdersOptions & {
25
- /**
26
- * min: 1
27
- * max: 20
28
- */
29
- limit: number;
30
- /**
31
- * min: 1
32
- */
33
- page: number;
34
- }): Promise<ISearchResult<IOrderAsSearchResult[] | IOrderAsSearchWithUnwindAcceptedOffersResult[]>>;
15
+ findOrders(params: IFindParams): Promise<IOrderAsSearchResult[] | IOrderAsSearchWithUnwindAcceptedOffersResult[]>;
35
16
  /**
36
17
  * 注文取得
37
18
  */
@@ -66,4 +47,3 @@ export declare class OrderService extends Service {
66
47
  page?: number;
67
48
  }): Promise<IAcceptedOffer[]>;
68
49
  }
69
- export {};
@@ -22,18 +22,14 @@ class OrderService extends service_1.Service {
22
22
  /**
23
23
  * 注文を検索する
24
24
  */
25
- async search(params) {
25
+ async findOrders(params) {
26
26
  return this.fetch({
27
27
  uri: '/orders',
28
28
  method: 'GET',
29
29
  qs: params,
30
30
  expectedStatusCodes: [http_status_1.status.OK]
31
31
  })
32
- .then(async (response) => {
33
- return {
34
- data: await response.json()
35
- };
36
- });
32
+ .then(async (response) => response.json());
37
33
  }
38
34
  /**
39
35
  * 注文取得
@@ -7,7 +7,7 @@ export interface IUseActionResult {
7
7
  /**
8
8
  * 予約検索条件
9
9
  */
10
- type IFindParams = Pick<factory.reservation.eventReservation.ISearchConditions, 'typeOf' | 'bookingFrom' | 'bookingThrough' | 'ids' | 'reservationNumbers' | 'reservationStatuses' | 'attended' | 'checkedIn'> & {
10
+ type IFindParams = Pick<factory.reservation.eventReservation.ISearchConditions, 'bookingFrom' | 'bookingThrough' | 'ids' | 'reservationNumbers' | 'reservationStatuses' | 'attended' | 'checkedIn'> & {
11
11
  additionalTicketText?: string;
12
12
  broker?: {
13
13
  id?: string;
@@ -25,6 +25,7 @@ type IFindParams = Pick<factory.reservation.eventReservation.ISearchConditions,
25
25
  };
26
26
  };
27
27
  reservationFor?: Pick<factory.reservation.eventReservation.IReservationForSearchConditions, 'startFrom' | 'startThrough' | 'ids'> & {
28
+ id?: string;
28
29
  location?: {
29
30
  branchCodes?: string[];
30
31
  };
@@ -1,4 +1,10 @@
1
1
  import { factory } from '../../factory';
2
+ type IKeyOfProjection = keyof factory.order.IOrder | '_id';
3
+ /**
4
+ * 注文検索時projection
5
+ * 0->1(2024-07-29~)
6
+ */
7
+ export type IProjection = Partial<Record<IKeyOfProjection, 1>>;
2
8
  /**
3
9
  * オファー展開の検索結果としての注文
4
10
  */
@@ -15,6 +21,23 @@ export interface ISearchOrdersOptions {
15
21
  */
16
22
  $unwindAcceptedOffers?: '1';
17
23
  }
24
+ /**
25
+ * 管理者による注文検索条件
26
+ */
27
+ export type IFindParams = Pick<factory.order.ISearchConditions, 'acceptedOffers' | 'broker' | 'confirmationNumbers' | 'customer' | 'identifier' | 'name' | 'orderDate' | 'orderNumbers' | 'orderStatuses' | 'orderedItem' | 'paymentMethods' | 'sort' | 'price' | 'seller'> & {
28
+ $projection?: IProjection;
29
+ $projectDisabled?: '1';
30
+ } & ISearchOrdersOptions & {
31
+ /**
32
+ * min: 1
33
+ * max: 20
34
+ */
35
+ limit: number;
36
+ /**
37
+ * min: 1
38
+ */
39
+ page: number;
40
+ };
18
41
  export type IAcceptedOffer = factory.order.IAcceptedOffer;
19
42
  export type IReturner = Pick<factory.iam.IMemberOfRole, 'typeOf' | 'id' | 'name'>;
20
43
  export type IExternalOrder = Pick<factory.order.IOrder, 'project' | 'typeOf' | 'seller' | 'customer' | 'confirmationNumber' | 'orderNumber' | 'price' | 'priceCurrency' | 'orderDate' | 'name' | 'orderStatus' | 'orderedItem' | 'paymentMethods'>;
@@ -26,3 +49,4 @@ export interface IUpdateChangeableAttributesParams {
26
49
  */
27
50
  name?: string;
28
51
  }
52
+ export {};
@@ -1,7 +1,7 @@
1
1
  import { factory } from '../../factory';
2
- import { ISearchResult, Service } from '../../service';
3
- import { IOrderAsFindByConfirmationNumberResult, ISearchOrdersOptions } from '../../chevreAsset/order/factory';
4
- import { IOrderAsSearchResult, IOrderAsSearchWithUnwindAcceptedOffersResult, IReturner, IUpdateChangeableAttributesParams } from '../../chevreConsole/order/factory';
2
+ import { Service } from '../../service';
3
+ import { IOrderAsFindByConfirmationNumberResult } from '../../chevreAsset/order/factory';
4
+ import { IFindParams, IOrderAsSearchResult, IOrderAsSearchWithUnwindAcceptedOffersResult, IReturner, IUpdateChangeableAttributesParams } from '../../chevreConsole/order/factory';
5
5
  /**
6
6
  * 注文管理サービス
7
7
  */
@@ -18,17 +18,7 @@ export declare class OrderService extends Service {
18
18
  /**
19
19
  * 注文を検索する
20
20
  */
21
- search(params: Omit<factory.order.ISearchConditions, 'project' | 'provider'> & Pick<ISearchOrdersOptions, '$unwindAcceptedOffers'> & {
22
- /**
23
- * min: 1
24
- * max: 20
25
- */
26
- limit: number;
27
- /**
28
- * min: 1
29
- */
30
- page: number;
31
- }): Promise<ISearchResult<IOrderAsSearchWithUnwindAcceptedOffersResult[] | Omit<IOrderAsSearchResult, 'identifier' | 'url' | 'additionalProperty'>[]>>;
21
+ findOrders(params: Pick<IFindParams, '$unwindAcceptedOffers' | 'acceptedOffers' | 'confirmationNumbers' | 'customer' | 'name' | 'orderDate' | 'orderNumbers' | 'orderStatuses' | 'paymentMethods' | 'limit' | 'page' | 'sort'>): Promise<IOrderAsSearchWithUnwindAcceptedOffersResult[] | IOrderAsSearchResult[]>;
32
22
  /**
33
23
  * 返品者検索
34
24
  */
@@ -26,7 +26,20 @@ class OrderService extends service_1.Service {
26
26
  /**
27
27
  * 注文を検索する
28
28
  */
29
- async search(params) {
29
+ async findOrders(params
30
+ // & Pick<ISearchOrdersOptions, '$unwindAcceptedOffers'>
31
+ // & {
32
+ // /**
33
+ // * min: 1
34
+ // * max: 20
35
+ // */
36
+ // limit: number;
37
+ // /**
38
+ // * min: 1
39
+ // */
40
+ // page: number;
41
+ // }
42
+ ) {
30
43
  const { auth, endpoint, project, seller } = this.options;
31
44
  const chevreAdmin = await (0, index_1.loadChevreAdmin)({ auth, endpoint });
32
45
  // const { project, ...validQueries } = req.query;
@@ -48,13 +61,12 @@ class OrderService extends service_1.Service {
48
61
  project,
49
62
  seller: { id: (typeof seller?.id === 'string') ? seller.id : '' }
50
63
  });
51
- const { data } = await orderService.search({
64
+ return orderService.findOrders({
52
65
  ...params,
53
66
  limit,
54
67
  page
55
68
  // $projection: DEFAULT_PROJECTION
56
69
  });
57
- return { data };
58
70
  }
59
71
  /**
60
72
  * 返品者検索
@@ -4,7 +4,7 @@ import { Service } from '../../service';
4
4
  /**
5
5
  * 予約検索条件
6
6
  */
7
- type IFindParams = Pick<factory.reservation.eventReservation.ISearchConditions, 'typeOf' | 'bookingFrom' | 'bookingThrough' | 'ids' | 'reservationNumbers' | 'reservationStatuses'> & {
7
+ type IFindParams = Pick<factory.reservation.eventReservation.ISearchConditions, 'bookingFrom' | 'bookingThrough' | 'ids' | 'reservationNumbers' | 'reservationStatuses'> & {
8
8
  underName?: {
9
9
  email?: {
10
10
  $regex?: string;
@@ -18,6 +18,7 @@ type IFindParams = Pick<factory.reservation.eventReservation.ISearchConditions,
18
18
  };
19
19
  };
20
20
  reservationFor?: Pick<factory.reservation.eventReservation.IReservationForSearchConditions, 'startFrom' | 'startThrough' | 'ids'> & {
21
+ id?: string;
21
22
  location?: {
22
23
  branchCodes?: string[];
23
24
  };
@@ -45,7 +45,7 @@ class ReservationService extends service_1.Service {
45
45
  // factory.reservationStatusType.ReservationConfirmed
46
46
  // ]
47
47
  // },
48
- typeOf: factory_1.factory.reservationType.EventReservation
48
+ // typeOf: factory.reservationType.EventReservation
49
49
  });
50
50
  }
51
51
  /**