@be-link/pos-cli-nodejs 1.0.51-beta.1 → 1.0.51-beta.3

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@be-link/pos-cli-nodejs",
3
- "version": "1.0.51-beta.1",
3
+ "version": "1.0.51-beta.3",
4
4
  "description": "正向订单服务Nodejs客户端",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -42,13 +42,15 @@
42
42
  "ts-node": "^10.9.2",
43
43
  "typedoc": "0.25.2",
44
44
  "typedoc-plugin-missing-exports": "2.1.0",
45
- "typescript": "5.2.2"
45
+ "typescript": "5.2.2",
46
+ "@types/lodash": "4.14.202"
46
47
  },
47
48
  "dependencies": {
48
49
  "axios": "0.27.2",
49
50
  "axios-retry": "^4.0.0",
50
51
  "uuid": "^9.0.1",
51
- "vitality-meta": "1.0.165",
52
- "@be-link/cs-cli-nodejs": "0.1.1"
52
+ "vitality-meta": "1.0.178",
53
+ "@be-link/cs-cli-nodejs": "0.1.1",
54
+ "lodash": "4.17.21"
53
55
  }
54
56
  }
@@ -5,12 +5,12 @@ declare class QueryByCommodityService extends BaseService implements Service.Que
5
5
  protected prefixUrl: string;
6
6
  queryTopSaleItem(request: Service.Request.queryTopSaleItem): Promise<Service.Response.queryTopSaleItem[]>;
7
7
  querySaleItem(request: Service.Request.querySaleItem): Promise<Service.Response.querySaleItem[]>;
8
- queryOrderInDepartureDate<K extends (keyof DTO.QueryDataBlockTypeMap)[]>(request: Service.Request.queryOrderInDepartureDate<K>): Promise<DTO.QueryDataRes<K>[]>;
9
- queryOrderBySkuIdList<K extends (keyof DTO.QueryDataBlockTypeMap)[]>(request: Service.Request.queryOrderBySkuIdList<K>): Promise<DTO.QueryDataRes<K>[]>;
8
+ queryOrderInDepartureDate<K extends (keyof DTO.QueryDataBlockTypeMap)[]>(request: Service.Request.queryOrderInDepartureDate<K>): Promise<DTO.QueryDataResProxy<K>[]>;
9
+ queryOrderBySkuIdList<K extends (keyof DTO.QueryDataBlockTypeMap)[]>(request: Service.Request.queryOrderBySkuIdList<K>): Promise<DTO.QueryDataResProxy<K>[]>;
10
10
  queryItineraryList(request: Service.Request.queryItineraryList): Promise<Service.Response.queryItineraryList[]>;
11
11
  getItineraryCount(request: Service.Request.getItineraryCount): Promise<number>;
12
12
  queryPartyOrderInfo(request: Service.Request.queryPartyOrderInfo): Promise<Service.Response.queryPartyOrderInfo[]>;
13
- queryPartyOrderDetail<K extends (keyof DTO.QueryDataBlockTypeMap)[]>(request: Service.Request.IQueryPartyOrderDetail<K>): Promise<DTO.QueryDataRes<K>[]>;
13
+ queryPartyOrderDetail<K extends (keyof DTO.QueryDataBlockTypeMap)[]>(request: Service.Request.IQueryPartyOrderDetail<K>): Promise<DTO.QueryDataResProxy<K>[]>;
14
14
  getPartyOrderCount(request: Service.Request.getPartyOrderCount): Promise<number>;
15
15
  queryPeriodTradeOrderList(request: Service.Request.queryPeriodTradeOrderList): Promise<Service.Response.queryPeriodTradeOrderList[]>;
16
16
  queryPeriodTradeOrderOperatorList(request: Service.Request.queryPeriodTradeOrderOperatorList): Promise<Service.Response.queryPeriodTradeOrderOperatorList[]>;
@@ -5,6 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const service_1 = __importDefault(require("../service"));
7
7
  const http_1 = require("../../http");
8
+ const posProxy_1 = __importDefault(require("../../../utils/posProxy"));
8
9
  class QueryByCommodityService extends service_1.default {
9
10
  constructor() {
10
11
  super(...arguments);
@@ -16,11 +17,13 @@ class QueryByCommodityService extends service_1.default {
16
17
  querySaleItem(request) {
17
18
  return (0, http_1.callApi)(this.getApiUrl(this.querySaleItem), request);
18
19
  }
19
- queryOrderInDepartureDate(request) {
20
- return (0, http_1.callApi)(this.getApiUrl(this.queryOrderInDepartureDate), request);
20
+ async queryOrderInDepartureDate(request) {
21
+ const result = await (0, http_1.callApi)(this.getApiUrl(this.queryOrderInDepartureDate), request);
22
+ return result.map(item => posProxy_1.default.createProxy(item));
21
23
  }
22
- queryOrderBySkuIdList(request) {
23
- return (0, http_1.callApi)(this.getApiUrl(this.queryOrderBySkuIdList), request);
24
+ async queryOrderBySkuIdList(request) {
25
+ const result = await (0, http_1.callApi)(this.getApiUrl(this.queryOrderBySkuIdList), request);
26
+ return result.map(item => posProxy_1.default.createProxy(item));
24
27
  }
25
28
  queryItineraryList(request) {
26
29
  return (0, http_1.callApi)(this.getApiUrl(this.queryItineraryList), request);
@@ -31,8 +34,9 @@ class QueryByCommodityService extends service_1.default {
31
34
  queryPartyOrderInfo(request) {
32
35
  return (0, http_1.callApi)(this.getApiUrl(this.queryPartyOrderInfo), request);
33
36
  }
34
- queryPartyOrderDetail(request) {
35
- return (0, http_1.callApi)(this.getApiUrl(this.queryPartyOrderDetail), request);
37
+ async queryPartyOrderDetail(request) {
38
+ const result = await (0, http_1.callApi)(this.getApiUrl(this.queryPartyOrderDetail), request);
39
+ return result.map(item => posProxy_1.default.createProxy(item));
36
40
  }
37
41
  getPartyOrderCount(request) {
38
42
  return (0, http_1.callApi)(this.getApiUrl(this.getPartyOrderCount), request);
@@ -4,7 +4,7 @@ import * as DTO from '../../../types';
4
4
  declare class QueryByStoreService extends BaseService implements Service.QueryByStoreController {
5
5
  protected prefixUrl: string;
6
6
  queryRejectReasons(request: Service.Request.queryRejectReasons): Promise<Service.Response.queryRejectReasons>;
7
- queryOrderList<K extends (keyof DTO.QueryDataBlockTypeMap)[]>(request: Service.Request.queryStoreOrderList<K>): Promise<DTO.QueryDataRes<K>[]>;
7
+ queryOrderList<K extends (keyof DTO.QueryDataBlockTypeMap)[]>(request: Service.Request.queryStoreOrderList<K>): Promise<DTO.QueryDataResProxy<K>[]>;
8
8
  getOrderCount(request: Service.Request.getStoreOrderCount): Promise<number>;
9
9
  }
10
10
  declare const queryByStoreService: QueryByStoreService;
@@ -5,6 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const service_1 = __importDefault(require("../service"));
7
7
  const http_1 = require("../../http");
8
+ const posProxy_1 = __importDefault(require("../../../utils/posProxy"));
8
9
  class QueryByStoreService extends service_1.default {
9
10
  constructor() {
10
11
  super(...arguments);
@@ -13,8 +14,9 @@ class QueryByStoreService extends service_1.default {
13
14
  queryRejectReasons(request) {
14
15
  return (0, http_1.callApi)(this.getApiUrl(this.queryRejectReasons), request);
15
16
  }
16
- queryOrderList(request) {
17
- return (0, http_1.callApi)(this.getApiUrl(this.queryOrderList), request);
17
+ async queryOrderList(request) {
18
+ const result = await (0, http_1.callApi)(this.getApiUrl(this.queryOrderList), request);
19
+ return result.map(item => posProxy_1.default.createProxy(item));
18
20
  }
19
21
  getOrderCount(request) {
20
22
  return (0, http_1.callApi)(this.getApiUrl(this.getOrderCount), request);
@@ -4,9 +4,9 @@ import * as DTO from '../../../types';
4
4
  declare class QueryBySupplierService extends BaseService implements Service.QueryBySupplierController {
5
5
  protected prefixUrl: string;
6
6
  queryRejectReasons(request: Service.Request.queryRejectReasons): Promise<Service.Response.queryRejectReasons>;
7
- queryOrderList<K extends (keyof DTO.QueryDataBlockTypeMap)[]>(request: Service.Request.querySupplierOrderList<K>): Promise<DTO.QueryDataRes<K>[]>;
7
+ queryOrderList<K extends (keyof DTO.QueryDataBlockTypeMap)[]>(request: Service.Request.querySupplierOrderList<K>): Promise<DTO.QueryDataResProxy<K>[]>;
8
8
  getOrderCount(request: Service.Request.getSupplierOrderCount): Promise<number>;
9
- queryOrderForStatistics<K extends (keyof DTO.QueryDataBlockTypeMap)[]>(request: Service.Request.IQueryOrderForStatisticsForSupplier<K>): Promise<DTO.QueryDataRes<K>[]>;
9
+ queryOrderForStatistics<K extends (keyof DTO.QueryDataBlockTypeMap)[]>(request: Service.Request.IQueryOrderForStatisticsForSupplier<K>): Promise<DTO.QueryDataResProxy<K>[]>;
10
10
  mgetOrderQuantity(request: Service.Request.mgetOrderQuantity): Promise<Record<string, number>>;
11
11
  queryDepartureGroupList(request: Service.Request.queryDepartureGroupList): Promise<Service.Response.queryDepartureGroupList[]>;
12
12
  getDepartureGroupCount(request: Service.Request.getDepartureGroupCount): Promise<number>;
@@ -5,6 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const service_1 = __importDefault(require("../service"));
7
7
  const http_1 = require("../../http");
8
+ const posProxy_1 = __importDefault(require("../../../utils/posProxy"));
8
9
  class QueryBySupplierService extends service_1.default {
9
10
  constructor() {
10
11
  super(...arguments);
@@ -13,14 +14,16 @@ class QueryBySupplierService extends service_1.default {
13
14
  queryRejectReasons(request) {
14
15
  return (0, http_1.callApi)(this.getApiUrl(this.queryRejectReasons), request);
15
16
  }
16
- queryOrderList(request) {
17
- return (0, http_1.callApi)(this.getApiUrl(this.queryOrderList), request);
17
+ async queryOrderList(request) {
18
+ const result = await (0, http_1.callApi)(this.getApiUrl(this.queryOrderList), request);
19
+ return result.map(item => posProxy_1.default.createProxy(item));
18
20
  }
19
21
  getOrderCount(request) {
20
22
  return (0, http_1.callApi)(this.getApiUrl(this.getOrderCount), request);
21
23
  }
22
- queryOrderForStatistics(request) {
23
- return (0, http_1.callApi)(this.getApiUrl(this.queryOrderForStatistics), request);
24
+ async queryOrderForStatistics(request) {
25
+ const result = await (0, http_1.callApi)(this.getApiUrl(this.queryOrderForStatistics), request);
26
+ return result.map(item => posProxy_1.default.createProxy(item));
24
27
  }
25
28
  mgetOrderQuantity(request) {
26
29
  return (0, http_1.callApi)(this.getApiUrl(this.mgetOrderQuantity), request);
@@ -911,12 +911,12 @@ export declare namespace Service {
911
911
  * 根据订单id查询订单
912
912
  * @path /query/user/get-order-by-id
913
913
  */
914
- getOrderById<K extends (keyof DTO.QueryDataBlockTypeMap)[]>(request: Request.getOrderById<K>): Promise<DTO.QueryDataRes<K>>;
914
+ getOrderById<K extends (keyof DTO.QueryDataBlockTypeMap)[]>(request: Request.getOrderById<K>): Promise<DTO.QueryDataResProxy<K>>;
915
915
  /**
916
916
  * 根据订单id列表查询订单
917
917
  * @path /query/user/query-order-by-id-list
918
918
  */
919
- queryOrderByIdList<K extends (keyof DTO.QueryDataBlockTypeMap)[]>(request: Request.queryOrderByIdList<K>): Promise<DTO.QueryDataRes<K>[]>;
919
+ queryOrderByIdList<K extends (keyof DTO.QueryDataBlockTypeMap)[]>(request: Request.queryOrderByIdList<K>): Promise<DTO.QueryDataResProxy<K>[]>;
920
920
  /**
921
921
  * 查询用户订单数量
922
922
  * @returns 订单数量
@@ -932,12 +932,12 @@ export declare namespace Service {
932
932
  * 查询用户订单
933
933
  * @path /query/user/query-user-order
934
934
  */
935
- queryUserOrder<K extends (keyof DTO.QueryDataBlockTypeMap)[]>(request: Request.queryUserOrder<K>): Promise<DTO.QueryDataRes<K>[]>;
935
+ queryUserOrder<K extends (keyof DTO.QueryDataBlockTypeMap)[]>(request: Request.queryUserOrder<K>): Promise<DTO.QueryDataResProxy<K>[]>;
936
936
  /**
937
937
  * 查询主单关联的子单列表
938
938
  * @path /query/user/query-sub-order
939
939
  */
940
- querySubOrderList<K extends (keyof DTO.QueryDataBlockTypeMap)[]>(request: Request.querySubOrderList<K>): Promise<DTO.QueryDataRes<K>[]>;
940
+ querySubOrderList<K extends (keyof DTO.QueryDataBlockTypeMap)[]>(request: Request.querySubOrderList<K>): Promise<DTO.QueryDataResProxy<K>[]>;
941
941
  /**
942
942
  * 计算用户消费信息,查丛库
943
943
  * @returns 消费金额
@@ -962,7 +962,7 @@ export declare namespace Service {
962
962
  * 查询门店订单列表
963
963
  * @path /query/store/query-order-list
964
964
  */
965
- queryOrderList<K extends (keyof DTO.QueryDataBlockTypeMap)[]>(request: Request.queryStoreOrderList<K>): Promise<DTO.QueryDataRes<K>[]>;
965
+ queryOrderList<K extends (keyof DTO.QueryDataBlockTypeMap)[]>(request: Request.queryStoreOrderList<K>): Promise<DTO.QueryDataResProxy<K>[]>;
966
966
  /**
967
967
  * 查询订单数量
968
968
  * @returns 订单数量
@@ -981,7 +981,7 @@ export declare namespace Service {
981
981
  * 查询门店订单列表
982
982
  * @path /query/supplier/query-order-list
983
983
  */
984
- queryOrderList<K extends (keyof DTO.QueryDataBlockTypeMap)[]>(request: Request.querySupplierOrderList<K>): Promise<DTO.QueryDataRes<K>[]>;
984
+ queryOrderList<K extends (keyof DTO.QueryDataBlockTypeMap)[]>(request: Request.querySupplierOrderList<K>): Promise<DTO.QueryDataResProxy<K>[]>;
985
985
  /**
986
986
  * 查询订单数量
987
987
  * @returns 订单数量
@@ -997,7 +997,7 @@ export declare namespace Service {
997
997
  * 数据统计
998
998
  * @path /query/supplier/query-order-for-statistics
999
999
  */
1000
- queryOrderForStatistics<K extends (keyof DTO.QueryDataBlockTypeMap)[]>(request: Request.IQueryOrderForStatisticsForSupplier<K>): Promise<DTO.QueryDataRes<K>[]>;
1000
+ queryOrderForStatistics<K extends (keyof DTO.QueryDataBlockTypeMap)[]>(request: Request.IQueryOrderForStatisticsForSupplier<K>): Promise<DTO.QueryDataResProxy<K>[]>;
1001
1001
  /**
1002
1002
  * 获取订单份数
1003
1003
  * @path /query/supplier/mget-order-quantity
@@ -1021,7 +1021,7 @@ export declare namespace Service {
1021
1021
  * 查询订单列表
1022
1022
  * @path /query/web/query-order-list
1023
1023
  */
1024
- queryOrderList<K extends (keyof DTO.QueryDataBlockTypeMap)[]>(request: Request.queryOrderList<K>): Promise<DTO.QueryDataRes<K>[]>;
1024
+ queryOrderList<K extends (keyof DTO.QueryDataBlockTypeMap)[]>(request: Request.queryOrderList<K>): Promise<DTO.QueryDataResProxy<K>[]>;
1025
1025
  /**
1026
1026
  * 查询订单数量
1027
1027
  * @returns 订单数量
@@ -1037,7 +1037,7 @@ export declare namespace Service {
1037
1037
  * 查询订单列表(统计类场景专用), 返回所有满足条件的订单数据, 不支持分页和排序
1038
1038
  * @path /query/web/query-order-for-statistics
1039
1039
  */
1040
- queryOrderForStatistics<K extends (keyof DTO.QueryDataBlockTypeMap)[]>(request: Request.IQueryOrderForStatistics<K>): Promise<DTO.QueryDataRes<K>[]>;
1040
+ queryOrderForStatistics<K extends (keyof DTO.QueryDataBlockTypeMap)[]>(request: Request.IQueryOrderForStatistics<K>): Promise<DTO.QueryDataResProxy<K>[]>;
1041
1041
  }
1042
1042
  /** 商品维度查询 */
1043
1043
  interface QueryByCommodityController {
@@ -1056,12 +1056,12 @@ export declare namespace Service {
1056
1056
  * @returns 订单Id列表
1057
1057
  * @path /query/commodity/query-order-in-departure-date
1058
1058
  */
1059
- queryOrderInDepartureDate<K extends (keyof DTO.QueryDataBlockTypeMap)[]>(request: Request.queryOrderInDepartureDate<K>): Promise<DTO.QueryDataRes<K>[]>;
1059
+ queryOrderInDepartureDate<K extends (keyof DTO.QueryDataBlockTypeMap)[]>(request: Request.queryOrderInDepartureDate<K>): Promise<DTO.QueryDataResProxy<K>[]>;
1060
1060
  /**
1061
1061
  * 根据skuId列表查询订单
1062
1062
  * @path /query/commodity/query-order-by-sku-id-list
1063
1063
  */
1064
- queryOrderBySkuIdList<K extends (keyof DTO.QueryDataBlockTypeMap)[]>(request: Request.queryOrderBySkuIdList<K>): Promise<DTO.QueryDataRes<K>[]>;
1064
+ queryOrderBySkuIdList<K extends (keyof DTO.QueryDataBlockTypeMap)[]>(request: Request.queryOrderBySkuIdList<K>): Promise<DTO.QueryDataResProxy<K>[]>;
1065
1065
  /**
1066
1066
  * 获取行程单列表,按照履约时间升序
1067
1067
  * @path /query/commodity/query-itinerary-list
@@ -1088,7 +1088,7 @@ export declare namespace Service {
1088
1088
  * 查询聚会单详情
1089
1089
  * @path /query/commodity/query-party-order-detail
1090
1090
  */
1091
- queryPartyOrderDetail<K extends (keyof DTO.QueryDataBlockTypeMap)[]>(request: Request.IQueryPartyOrderDetail<K>): Promise<DTO.QueryDataRes<K>[]>;
1091
+ queryPartyOrderDetail<K extends (keyof DTO.QueryDataBlockTypeMap)[]>(request: Request.IQueryPartyOrderDetail<K>): Promise<DTO.QueryDataResProxy<K>[]>;
1092
1092
  /**
1093
1093
  * 查询某个时间段内下单情况
1094
1094
  * @path /query/commodity/query-order-by-time-range
@@ -7,12 +7,12 @@ declare class QueryByUserService extends BaseService implements Service.QueryByU
7
7
  listOrderInvoice(request: Service.Request.getOrderInvoiceRequest): Promise<DTO.IPositiveOrderInvoice[]>;
8
8
  getOrderInvoiceByOrderId(request: any): Promise<DTO.IPositiveOrderInvoice>;
9
9
  getOrderInvoiceByInvoiceId(request: any): Promise<DTO.IPositiveOrderInvoice>;
10
- getOrderById<K extends (keyof DTO.QueryDataBlockTypeMap)[]>(request: Service.Request.getOrderById<K>): Promise<DTO.QueryDataRes<K>>;
11
- queryOrderByIdList<K extends (keyof DTO.QueryDataBlockTypeMap)[]>(request: Service.Request.queryOrderByIdList<K>): Promise<DTO.QueryDataRes<K>[]>;
12
- queryUserOrder<K extends (keyof DTO.QueryDataBlockTypeMap)[]>(request: Service.Request.queryUserOrder<K>): Promise<DTO.QueryDataRes<K>[]>;
10
+ getOrderById<K extends (keyof DTO.QueryDataBlockTypeMap)[]>(request: Service.Request.getOrderById<K>): Promise<DTO.QueryDataResProxy<K>>;
11
+ queryOrderByIdList<K extends (keyof DTO.QueryDataBlockTypeMap)[]>(request: Service.Request.queryOrderByIdList<K>): Promise<DTO.QueryDataResProxy<K>[]>;
12
+ queryUserOrder<K extends (keyof DTO.QueryDataBlockTypeMap)[]>(request: Service.Request.queryUserOrder<K>): Promise<DTO.QueryDataResProxy<K>[]>;
13
13
  getUserOrderCount(request: Service.Request.getUserOrderCount): Promise<number>;
14
14
  mgetUserOrderCountList(request: Service.Request.mgetUserOrderCountList): Promise<Service.Response.mgetUserOrderCountList>;
15
- querySubOrderList<K extends (keyof DTO.QueryDataBlockTypeMap)[]>(request: Service.Request.querySubOrderList<K>): Promise<DTO.QueryDataRes<K>[]>;
15
+ querySubOrderList<K extends (keyof DTO.QueryDataBlockTypeMap)[]>(request: Service.Request.querySubOrderList<K>): Promise<DTO.QueryDataResProxy<K>[]>;
16
16
  calculateUserConsumeInfo(request: Service.Request.calculateUserConsumeInfo): Promise<Service.Response.calculateUserConsumeInfo>;
17
17
  queryUnionIdListByTimeRange(request: Service.Request.queryUnionIdListByTimeRange): Promise<string[]>;
18
18
  queryOrderMergeRecordByOrderId(request: Service.Request.queryOrderMergeRecordByOrderId): Promise<Service.Response.queryOrderMergeRecordByOrderId[]>;
@@ -5,6 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const service_1 = __importDefault(require("../service"));
7
7
  const http_1 = require("../../http");
8
+ const posProxy_1 = __importDefault(require("../../../utils/posProxy"));
8
9
  class QueryByUserService extends service_1.default {
9
10
  constructor() {
10
11
  super(...arguments);
@@ -22,23 +23,27 @@ class QueryByUserService extends service_1.default {
22
23
  getOrderInvoiceByInvoiceId(request) {
23
24
  return (0, http_1.callApi)(this.getApiUrl(this.getOrderInvoiceByInvoiceId), request);
24
25
  }
25
- getOrderById(request) {
26
- return (0, http_1.callApi)(this.getApiUrl(this.getOrderById), request);
26
+ async getOrderById(request) {
27
+ const result = await (0, http_1.callApi)(this.getApiUrl(this.getOrderById), request);
28
+ return posProxy_1.default.createProxy(result);
27
29
  }
28
- queryOrderByIdList(request) {
29
- return (0, http_1.callApi)(this.getApiUrl(this.queryOrderByIdList), request);
30
+ async queryOrderByIdList(request) {
31
+ const result = await (0, http_1.callApi)(this.getApiUrl(this.queryOrderByIdList), request);
32
+ return result.map(item => posProxy_1.default.createProxy(item));
30
33
  }
31
- queryUserOrder(request) {
32
- return (0, http_1.callApi)(this.getApiUrl(this.queryUserOrder), request);
34
+ async queryUserOrder(request) {
35
+ const result = await (0, http_1.callApi)(this.getApiUrl(this.queryUserOrder), request);
36
+ return result.map(item => posProxy_1.default.createProxy(item));
33
37
  }
34
38
  getUserOrderCount(request) {
35
39
  return (0, http_1.callApi)(this.getApiUrl(this.getUserOrderCount), request);
36
40
  }
37
- mgetUserOrderCountList(request) {
41
+ async mgetUserOrderCountList(request) {
38
42
  return (0, http_1.callApi)(this.getApiUrl(this.mgetUserOrderCountList), request);
39
43
  }
40
- querySubOrderList(request) {
41
- return (0, http_1.callApi)(this.getApiUrl(this.querySubOrderList), request);
44
+ async querySubOrderList(request) {
45
+ const result = await (0, http_1.callApi)(this.getApiUrl(this.querySubOrderList), request);
46
+ return result.map(item => posProxy_1.default.createProxy(item));
42
47
  }
43
48
  calculateUserConsumeInfo(request) {
44
49
  return (0, http_1.callApi)(this.getApiUrl(this.calculateUserConsumeInfo), request);
@@ -3,10 +3,10 @@ import { Service } from './types';
3
3
  import * as DTO from '../../../types';
4
4
  declare class QueryByWebService extends BaseService implements Service.QueryByWebController {
5
5
  protected prefixUrl: string;
6
- queryOrderList<K extends (keyof DTO.QueryDataBlockTypeMap)[]>(request: Service.Request.queryOrderList<K>): Promise<DTO.QueryDataRes<K>[]>;
6
+ queryOrderList<K extends (keyof DTO.QueryDataBlockTypeMap)[]>(request: Service.Request.queryOrderList<K>): Promise<DTO.QueryDataResProxy<K>[]>;
7
7
  getOrderCount(request: Service.Request.getOrderCount): Promise<number>;
8
8
  queryOrderOperateRecord(request: Service.Request.IQueryOrderOperateRecord): Promise<DTO.IOrderOperatorRecord[]>;
9
- queryOrderForStatistics<K extends (keyof DTO.QueryDataBlockTypeMap)[]>(request: Service.Request.IQueryOrderForStatistics<K>): Promise<DTO.QueryDataRes<K>[]>;
9
+ queryOrderForStatistics<K extends (keyof DTO.QueryDataBlockTypeMap)[]>(request: Service.Request.IQueryOrderForStatistics<K>): Promise<DTO.QueryDataResProxy<K>[]>;
10
10
  }
11
11
  declare const queryByWebService: QueryByWebService;
12
12
  export default queryByWebService;
@@ -5,13 +5,15 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const service_1 = __importDefault(require("../service"));
7
7
  const http_1 = require("../../http");
8
+ const posProxy_1 = __importDefault(require("../../../utils/posProxy"));
8
9
  class QueryByWebService extends service_1.default {
9
10
  constructor() {
10
11
  super(...arguments);
11
12
  this.prefixUrl = '/query/web';
12
13
  }
13
- queryOrderList(request) {
14
- return (0, http_1.callApi)(this.getApiUrl(this.queryOrderList), request);
14
+ async queryOrderList(request) {
15
+ const result = await (0, http_1.callApi)(this.getApiUrl(this.queryOrderList), request);
16
+ return result.map(item => posProxy_1.default.createProxy(item));
15
17
  }
16
18
  getOrderCount(request) {
17
19
  return (0, http_1.callApi)(this.getApiUrl(this.getOrderCount), request);
@@ -19,8 +21,9 @@ class QueryByWebService extends service_1.default {
19
21
  queryOrderOperateRecord(request) {
20
22
  return (0, http_1.callApi)(this.getApiUrl(this.queryOrderOperateRecord), request);
21
23
  }
22
- queryOrderForStatistics(request) {
23
- return (0, http_1.callApi)(this.getApiUrl(this.queryOrderForStatistics), request);
24
+ async queryOrderForStatistics(request) {
25
+ const result = await (0, http_1.callApi)(this.getApiUrl(this.queryOrderForStatistics), request);
26
+ return result.map(item => posProxy_1.default.createProxy(item));
24
27
  }
25
28
  }
26
29
  const queryByWebService = new QueryByWebService();
package/types.d.ts CHANGED
@@ -3,6 +3,10 @@ import * as commodityConstants from 'vitality-meta/enums/commodity';
3
3
  import * as CSDto from '@be-link/cs-cli-nodejs/types';
4
4
  import * as ServiceVenueDto from '@be-link/cs-cli-nodejs/cs/modules/serviceVenue/types';
5
5
  import { CommonSaleStatus } from 'vitality-meta/enums/commodity';
6
+ import { ItemInfoProxy } from './utils/posProxy/itemInfoProxy';
7
+ import { SkuInfoProxy } from './utils/posProxy/skuInfoProxy';
8
+ import { VenueInfoProxy } from './utils/posProxy/venueInfoProxy';
9
+ import { ComboInfoProxy } from './utils/posProxy/comboInfoProxy';
6
10
  /**
7
11
  * 订单正向结构
8
12
  */
@@ -951,7 +955,7 @@ export interface IRawOrderStructure {
951
955
  skuInfoList?: (IPositiveSkuInfoV2 | IPositiveShuttleBusSkuInfo)[];
952
956
  comboInfoList?: IPositiveOrderComboInfo[];
953
957
  roomInfoList?: IPositiveRoomInfo[];
954
- venueInfo?: IPositiveVenueInfo;
958
+ venueInfo?: IPositiveVenueInfo[];
955
959
  feeDetailInfoList?: IPositiveFeeDetailInfo[];
956
960
  paymentInfo?: IPositivePaymentInfo[];
957
961
  promotionInfo?: IPositivePromotionInfo[];
@@ -1093,9 +1097,9 @@ export interface QueryDataBlockTypeMap {
1093
1097
  /** 标记信息 */
1094
1098
  attributes: IPositiveAttributes;
1095
1099
  /** 商品快照信息 */
1096
- itemInfo: (IPositiveItemInfo & {
1100
+ itemInfo: ((IPositiveItemInfo & {
1097
1101
  storeInfo: IStore;
1098
- })[];
1102
+ }) | IPositiveItemInfoV2)[];
1099
1103
  /** sku快照信息 */
1100
1104
  skuInfo: (IPositiveSkuInfo | IPositiveShuttleBusSkuInfo | IPositiveSkuInfoV2)[];
1101
1105
  /** 套餐快照信息 */
@@ -1103,9 +1107,33 @@ export interface QueryDataBlockTypeMap {
1103
1107
  /** 房型快照信息 */
1104
1108
  roomInfo: IPositiveRoomInfo[];
1105
1109
  /** 场所快照信息 */
1106
- venueInfo: IPositiveVenueInfo;
1110
+ venueInfo: IPositiveVenueInfo[];
1111
+ /** 费用明细信息 */
1112
+ feeDetailInfo: IPositiveFeeDetailInfo[];
1113
+ /** 支付信息 */
1114
+ paymentInfo: IPositivePaymentInfo[];
1115
+ /** 营销信息 */
1116
+ promotionInfo: IPositivePromotionInfo[];
1117
+ }
1118
+ export interface QueryDataBlockTypeProxyMap {
1119
+ /** 订单Id */
1120
+ _id: string;
1121
+ /** 主要信息 */
1122
+ basicInfo: IPositiveOrder;
1123
+ /** 标记信息 */
1124
+ attributes: IPositiveAttributes;
1125
+ /** 商品快照信息 */
1126
+ itemInfo: ItemInfoProxy[];
1127
+ /** sku快照信息 */
1128
+ skuInfo: SkuInfoProxy[];
1129
+ /** 套餐快照信息 */
1130
+ comboInfo: ComboInfoProxy[];
1131
+ /** 房型快照信息 */
1132
+ roomInfo: IPositiveRoomInfo[];
1133
+ /** 场所快照信息 */
1134
+ venueInfo: VenueInfoProxy[];
1107
1135
  /** 费用明细信息 */
1108
- feeDetailInfoList: IPositiveFeeDetailInfo[];
1136
+ feeDetailInfo: IPositiveFeeDetailInfo[];
1109
1137
  /** 支付信息 */
1110
1138
  paymentInfo: IPositivePaymentInfo[];
1111
1139
  /** 营销信息 */
@@ -1166,5 +1194,8 @@ export interface IPositiveOrderInvoice {
1166
1194
  }
1167
1195
  /** 订单查询结果 */
1168
1196
  export type QueryDataRes<K extends (keyof QueryDataBlockTypeMap)[]> = {
1169
- [key in K[number]]: QueryDataBlockTypeMap[key];
1197
+ [key in K[number]]?: QueryDataBlockTypeMap[key];
1198
+ };
1199
+ export type QueryDataResProxy<K extends (keyof QueryDataBlockTypeProxyMap)[]> = {
1200
+ [key in K[number]]?: QueryDataBlockTypeProxyMap[key];
1170
1201
  };
@@ -0,0 +1,19 @@
1
+ import { PosDto } from '../..';
2
+ export declare abstract class ComboInfoProxy {
3
+ abstract get raw(): PosDto.IPositiveOrderComboInfo | PosDto.IPositiveSkuInfo;
4
+ abstract get name(): string | undefined;
5
+ }
6
+ declare class ComboInfoProxyV1 extends ComboInfoProxy {
7
+ private readonly orderComboInfo;
8
+ constructor(orderComboInfo: PosDto.IPositiveSkuInfo);
9
+ get raw(): PosDto.IPositiveSkuInfo;
10
+ get name(): string | undefined;
11
+ }
12
+ declare class ComboInfoProxyV2 extends ComboInfoProxy {
13
+ private readonly orderComboInfo;
14
+ constructor(orderComboInfo: PosDto.IPositiveOrderComboInfo);
15
+ get raw(): PosDto.IPositiveOrderComboInfo;
16
+ get name(): string;
17
+ }
18
+ export declare function createComboInfoProxy(orderComboInfo: PosDto.IPositiveOrderComboInfo | PosDto.IPositiveSkuInfo, version: 'V1' | 'V2'): ComboInfoProxyV1 | ComboInfoProxyV2;
19
+ export {};
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createComboInfoProxy = exports.ComboInfoProxy = void 0;
4
+ class ComboInfoProxy {
5
+ }
6
+ exports.ComboInfoProxy = ComboInfoProxy;
7
+ class ComboInfoProxyV1 extends ComboInfoProxy {
8
+ constructor(orderComboInfo) {
9
+ super();
10
+ this.orderComboInfo = orderComboInfo;
11
+ }
12
+ // share
13
+ get raw() { return this.orderComboInfo; }
14
+ get name() { return this.orderComboInfo.combo; }
15
+ }
16
+ class ComboInfoProxyV2 extends ComboInfoProxy {
17
+ constructor(orderComboInfo) {
18
+ super();
19
+ this.orderComboInfo = orderComboInfo;
20
+ }
21
+ // share
22
+ get raw() { return this.orderComboInfo; }
23
+ get name() { return this.orderComboInfo.comboInfo.name; }
24
+ }
25
+ function createComboInfoProxy(orderComboInfo, version) {
26
+ if (version === 'V2')
27
+ return new ComboInfoProxyV2(orderComboInfo);
28
+ return new ComboInfoProxyV1(orderComboInfo);
29
+ }
30
+ exports.createComboInfoProxy = createComboInfoProxy;
@@ -0,0 +1,5 @@
1
+ import { PosDto } from '../..';
2
+ declare class PosProxyFactory {
3
+ static createProxy(order: PosDto.QueryDataRes<(keyof PosDto.QueryDataBlockTypeMap)[]>): PosDto.QueryDataResProxy<(keyof PosDto.QueryDataBlockTypeProxyMap)[]>;
4
+ }
5
+ export default PosProxyFactory;
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const pos_1 = require("vitality-meta/enums/pos");
4
+ const comboInfoProxy_1 = require("./comboInfoProxy");
5
+ const itemInfoProxy_1 = require("./itemInfoProxy");
6
+ const skuInfoProxy_1 = require("./skuInfoProxy");
7
+ const venueInfoProxy_1 = require("./venueInfoProxy");
8
+ class PosProxyFactory {
9
+ static createProxy(order) {
10
+ const version = order.attributes.isMigratedItemOrder ? 'V2' : 'V1';
11
+ let itemInfoProxy = undefined;
12
+ let skuInfoProxy = undefined;
13
+ let comboInfoProxy = undefined;
14
+ let venueInfoProxy = undefined;
15
+ if (order.itemInfo) {
16
+ itemInfoProxy = order.itemInfo.map(item => (0, itemInfoProxy_1.createItemInfoProxy)(item, version));
17
+ if (version === 'V1')
18
+ venueInfoProxy = order.itemInfo.map(item => (0, venueInfoProxy_1.createVenueInfoProxy)(item.storeInfo, version));
19
+ }
20
+ if (order.skuInfo) {
21
+ skuInfoProxy = order.skuInfo.map(sku => (0, skuInfoProxy_1.createSkuInfoProxy)(sku, version, sku.type));
22
+ if (version === 'V1')
23
+ comboInfoProxy = order.skuInfo.filter(sku => sku.type === pos_1.SkuTypeEnum.ITEM).map(sku => (0, comboInfoProxy_1.createComboInfoProxy)(sku, version));
24
+ }
25
+ if (order.comboInfo) {
26
+ comboInfoProxy = order.comboInfo.map(combo => (0, comboInfoProxy_1.createComboInfoProxy)(combo, version));
27
+ }
28
+ if (order.venueInfo) {
29
+ venueInfoProxy = order.venueInfo.map(venue => (0, venueInfoProxy_1.createVenueInfoProxy)(venue, version));
30
+ }
31
+ return {
32
+ ...order,
33
+ itemInfo: itemInfoProxy,
34
+ skuInfo: skuInfoProxy,
35
+ comboInfo: comboInfoProxy,
36
+ venueInfo: venueInfoProxy,
37
+ };
38
+ }
39
+ }
40
+ exports.default = PosProxyFactory;
@@ -0,0 +1,129 @@
1
+ import { PosDto } from '../..';
2
+ export declare abstract class ItemInfoProxy {
3
+ abstract get raw(): PosDto.IPositiveItemInfo | PosDto.IPositiveItemInfoV2;
4
+ abstract get id(): string;
5
+ abstract get name(): string;
6
+ abstract get headPic(): string;
7
+ abstract get headPics(): string[];
8
+ abstract get invoiceBase(): string | undefined;
9
+ abstract get categoryOne(): string;
10
+ abstract get categoryTwo(): string;
11
+ abstract get isSelfLead(): number;
12
+ abstract get canUpdateMealInfo(): number | boolean;
13
+ abstract get storeId(): string | undefined;
14
+ abstract get venueId(): string | undefined;
15
+ abstract get contractType(): string | undefined;
16
+ abstract get cooperator(): string | undefined;
17
+ abstract get tourWholesaler(): string | undefined;
18
+ abstract get domesticTourOperator(): string | undefined;
19
+ abstract get tourPrincipal(): string | undefined | null;
20
+ abstract get periodStartTime(): number | undefined;
21
+ abstract get periodEndTime(): number | undefined;
22
+ abstract get voucherInfo(): Record<string, any> | undefined;
23
+ abstract get hotelSupplier(): string | undefined;
24
+ abstract get farmHouseSupplier(): string | undefined;
25
+ abstract get bookingDays(): number | undefined;
26
+ abstract get shuttleBusAdjustmentInfo(): PosDto.IPositiveItemInfo['shuttleBusAdjustmentInfo'];
27
+ abstract get shuttleBusSupplierIds(): string[] | undefined;
28
+ abstract get belinkOwner(): string | undefined;
29
+ abstract get shuttleBusSettlementPrice(): number | undefined;
30
+ abstract get minMarketPrice(): number | undefined;
31
+ abstract get minPrice(): number | undefined;
32
+ abstract get basicInfo(): PosDto.IPositiveItemInfoV2['basicInfo'] | undefined;
33
+ abstract get attributes(): PosDto.IPositiveItemInfoV2['attributes'] | undefined;
34
+ abstract get hotelItemInfo(): PosDto.IPositiveItemInfoV2['hotelItemInfo'] | undefined;
35
+ abstract get creditInfo(): PosDto.IPositiveItemInfoV2['creditInfo'] | undefined;
36
+ }
37
+ declare class ItemInfoProxyV1 extends ItemInfoProxy {
38
+ private readonly itemInfo;
39
+ constructor(itemInfo: PosDto.IPositiveItemInfo);
40
+ get raw(): PosDto.IPositiveItemInfo;
41
+ get id(): string;
42
+ get name(): string;
43
+ get headPic(): string;
44
+ get headPics(): string[];
45
+ get invoiceBase(): any;
46
+ get categoryOne(): string;
47
+ get categoryTwo(): string;
48
+ get isSelfLead(): number;
49
+ get canUpdateMealInfo(): number | boolean;
50
+ get storeId(): string | undefined;
51
+ get venueId(): string | undefined;
52
+ get contractType(): import("vitality-meta/enums/commodity").TourContractTypeEnum;
53
+ get cooperator(): string;
54
+ get tourWholesaler(): any;
55
+ get domesticTourOperator(): string;
56
+ get tourPrincipal(): string | null;
57
+ get tourBeginPlace(): string;
58
+ get tourDays(): number;
59
+ get periodStartTime(): number | undefined;
60
+ get periodEndTime(): number | undefined;
61
+ get voucherInfo(): {
62
+ [key: string]: any;
63
+ } | undefined;
64
+ get hotelSupplier(): string | undefined;
65
+ get farmHouseSupplier(): string | undefined;
66
+ get bookingDays(): number | undefined;
67
+ get shuttleBusAdjustmentInfo(): {
68
+ master: {
69
+ _id: string;
70
+ salePrice: number;
71
+ settlementPrice: number;
72
+ };
73
+ slave: {
74
+ _id: string;
75
+ salePrice: number;
76
+ settlementPrice: number;
77
+ };
78
+ } | undefined;
79
+ get shuttleBusSupplierIds(): string[];
80
+ get belinkOwner(): string | undefined;
81
+ get shuttleBusSettlementPrice(): number;
82
+ get minMarketPrice(): number;
83
+ get minPrice(): number;
84
+ get basicInfo(): undefined;
85
+ get attributes(): undefined;
86
+ get hotelItemInfo(): undefined;
87
+ get creditInfo(): undefined;
88
+ }
89
+ declare class ItemInfoProxyV2 extends ItemInfoProxy {
90
+ private readonly itemInfo;
91
+ constructor(itemInfo: PosDto.IPositiveItemInfoV2);
92
+ get raw(): PosDto.IPositiveItemInfoV2;
93
+ get id(): string;
94
+ get name(): string;
95
+ get headPic(): string;
96
+ get headPics(): string[];
97
+ get invoiceBase(): string;
98
+ get categoryOne(): string;
99
+ get categoryTwo(): string;
100
+ get isSelfLead(): number;
101
+ get canUpdateMealInfo(): number;
102
+ get storeId(): string;
103
+ get venueId(): string;
104
+ get contractType(): undefined;
105
+ get cooperator(): undefined;
106
+ get tourWholesaler(): undefined;
107
+ get domesticTourOperator(): undefined;
108
+ get tourPrincipal(): undefined;
109
+ get tourBeginPlace(): undefined;
110
+ get tourDays(): undefined;
111
+ get periodStartTime(): undefined;
112
+ get periodEndTime(): undefined;
113
+ get voucherInfo(): undefined;
114
+ get hotelSupplier(): undefined;
115
+ get farmHouseSupplier(): undefined;
116
+ get bookingDays(): undefined;
117
+ get shuttleBusAdjustmentInfo(): undefined;
118
+ get shuttleBusSupplierIds(): undefined;
119
+ get belinkOwner(): undefined;
120
+ get shuttleBusSettlementPrice(): undefined;
121
+ get minMarketPrice(): undefined;
122
+ get minPrice(): undefined;
123
+ get basicInfo(): import("@be-link/cs-cli-nodejs/types").IItemBasicInfo;
124
+ get attributes(): import("@be-link/cs-cli-nodejs/types").IItemAttributes;
125
+ get hotelItemInfo(): import("@be-link/cs-cli-nodejs/types").IHotelItemInfo | undefined;
126
+ get creditInfo(): PosDto.CreditInfo;
127
+ }
128
+ export declare function createItemInfoProxy<T extends 'V1' | 'V2'>(itemInfo: T extends 'V1' ? PosDto.IPositiveItemInfo : PosDto.IPositiveItemInfoV2, version: T): ItemInfoProxyV1 | ItemInfoProxyV2;
129
+ export {};
@@ -0,0 +1,105 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createItemInfoProxy = exports.ItemInfoProxy = void 0;
4
+ class ItemInfoProxy {
5
+ }
6
+ exports.ItemInfoProxy = ItemInfoProxy;
7
+ class ItemInfoProxyV1 extends ItemInfoProxy {
8
+ constructor(itemInfo) {
9
+ super();
10
+ this.itemInfo = itemInfo;
11
+ }
12
+ // share
13
+ get raw() { return this.itemInfo; }
14
+ get id() { return this.itemInfo._id; }
15
+ get name() { return this.itemInfo.name; }
16
+ get headPic() { return this.itemInfo.headPics[0]; }
17
+ get headPics() { return this.itemInfo.headPics; }
18
+ // @ts-ignore
19
+ get invoiceBase() { return this.itemInfo.invoiceBase; }
20
+ get categoryOne() { return this.itemInfo.categoryOne; }
21
+ get categoryTwo() { return this.itemInfo.categoryTwo; }
22
+ get isSelfLead() { return this.itemInfo.isSelfLead; }
23
+ get canUpdateMealInfo() { return this.itemInfo.canUpdateMealInfo; }
24
+ get storeId() { return this.itemInfo.storeId; }
25
+ get venueId() { return this.itemInfo.storeId; }
26
+ // 旅游,待定
27
+ get contractType() { return this.itemInfo.contractType; }
28
+ get cooperator() { return this.itemInfo.cooperator; }
29
+ get tourWholesaler() { return this.itemInfo.tourWholesaler; }
30
+ get domesticTourOperator() { return this.itemInfo.domesticTourOperator; }
31
+ get tourPrincipal() { return this.itemInfo.tourPrincipal; }
32
+ get tourBeginPlace() { return this.itemInfo.tourBeginPlace; }
33
+ get tourDays() { return this.itemInfo.tourDays; }
34
+ // 虚拟商品,待定
35
+ get periodStartTime() { return this.itemInfo.periodStartTime; }
36
+ get periodEndTime() { return this.itemInfo.periodEndTime; }
37
+ get voucherInfo() { return this.itemInfo.voucherInfo; }
38
+ // uniq V1
39
+ get hotelSupplier() { return this.itemInfo.hotelSupplier; }
40
+ get farmHouseSupplier() { return this.itemInfo.farmHouseSupplier; }
41
+ get bookingDays() { return this.itemInfo.bookingDays; }
42
+ get shuttleBusAdjustmentInfo() { return this.itemInfo.shuttleBusAdjustmentInfo; }
43
+ get shuttleBusSupplierIds() { return this.itemInfo.shuttleBusSupplierIds; }
44
+ get belinkOwner() { return this.itemInfo.belinkOwner; }
45
+ get shuttleBusSettlementPrice() { return this.itemInfo.shuttleBusSettlementPrice; }
46
+ get minMarketPrice() { return this.itemInfo.minMarketPrice; }
47
+ get minPrice() { return this.itemInfo.minPrice; }
48
+ // uniq V2
49
+ get basicInfo() { return undefined; }
50
+ get attributes() { return undefined; }
51
+ get hotelItemInfo() { return undefined; }
52
+ get creditInfo() { return undefined; }
53
+ }
54
+ class ItemInfoProxyV2 extends ItemInfoProxy {
55
+ constructor(itemInfo) {
56
+ super();
57
+ this.itemInfo = itemInfo;
58
+ }
59
+ // share
60
+ get raw() { return this.itemInfo; }
61
+ get id() { return this.itemInfo._id; }
62
+ get name() { return this.itemInfo.name; }
63
+ get headPic() { return this.itemInfo.basicInfo.headPics[0]; }
64
+ get headPics() { return this.itemInfo.basicInfo.headPics; }
65
+ get invoiceBase() { return this.itemInfo.basicInfo.invoiceInfo.party; }
66
+ get categoryOne() { return this.itemInfo.basicInfo.categoryOne; }
67
+ get categoryTwo() { return this.itemInfo.basicInfo.categoryTwo; }
68
+ get isSelfLead() { return this.itemInfo.attributes.isSelfLead; }
69
+ get canUpdateMealInfo() { return this.itemInfo.attributes.canModifyMeal; }
70
+ get storeId() { return this.itemInfo.basicInfo.venueId; }
71
+ get venueId() { return this.itemInfo.basicInfo.venueId; }
72
+ // 旅游,待定
73
+ get contractType() { return undefined; }
74
+ get cooperator() { return undefined; }
75
+ get tourWholesaler() { return undefined; }
76
+ get domesticTourOperator() { return undefined; }
77
+ get tourPrincipal() { return undefined; }
78
+ get tourBeginPlace() { return undefined; }
79
+ get tourDays() { return undefined; }
80
+ // 虚拟商品,待定
81
+ get periodStartTime() { return undefined; }
82
+ get periodEndTime() { return undefined; }
83
+ get voucherInfo() { return undefined; }
84
+ // uniq V1
85
+ get hotelSupplier() { return undefined; }
86
+ get farmHouseSupplier() { return undefined; }
87
+ get bookingDays() { return undefined; }
88
+ get shuttleBusAdjustmentInfo() { return undefined; }
89
+ get shuttleBusSupplierIds() { return undefined; }
90
+ get belinkOwner() { return undefined; }
91
+ get shuttleBusSettlementPrice() { return undefined; }
92
+ get minMarketPrice() { return undefined; }
93
+ get minPrice() { return undefined; }
94
+ // uniq V2
95
+ get basicInfo() { return this.itemInfo.basicInfo; }
96
+ get attributes() { return this.itemInfo.attributes; }
97
+ get hotelItemInfo() { return this.itemInfo.hotelItemInfo; }
98
+ get creditInfo() { return this.itemInfo.creditInfo; }
99
+ }
100
+ function createItemInfoProxy(itemInfo, version) {
101
+ if (version === 'V2')
102
+ return new ItemInfoProxyV2(itemInfo);
103
+ return new ItemInfoProxyV1(itemInfo);
104
+ }
105
+ exports.createItemInfoProxy = createItemInfoProxy;
@@ -0,0 +1,70 @@
1
+ import { SkuTypeEnum } from 'vitality-meta/enums/pos';
2
+ import { PosDto } from '../..';
3
+ export declare abstract class SkuInfoProxy {
4
+ abstract get raw(): PosDto.IPositiveSkuInfoV2 | PosDto.IPositiveShuttleBusSkuInfo | PosDto.IPositiveSkuInfo;
5
+ abstract get id(): string | undefined;
6
+ abstract get salePrice(): number;
7
+ abstract get memberPrice(): number | undefined;
8
+ abstract get memberPriceLimitTimes(): number | undefined;
9
+ abstract get settlementPrice(): number;
10
+ abstract get quantity(): number;
11
+ abstract get remainingQuantity(): number;
12
+ abstract get applicablePeople(): string | undefined;
13
+ abstract get singleRoomPrice(): number | undefined;
14
+ abstract get singleRoomSettlementPrice(): number | undefined;
15
+ }
16
+ declare class SkuInfoProxyV1 extends SkuInfoProxy {
17
+ private readonly orderSkuInfo;
18
+ constructor(orderSkuInfo: PosDto.IPositiveSkuInfo);
19
+ get raw(): PosDto.IPositiveSkuInfo;
20
+ get id(): string;
21
+ get categoryOne(): string;
22
+ get categoryTwo(): string;
23
+ get salePrice(): number;
24
+ get memberPrice(): number | undefined;
25
+ get memberPriceLimitTimes(): number | undefined;
26
+ get settlementPrice(): number;
27
+ get quantity(): number;
28
+ get remainingQuantity(): number;
29
+ get departureDate(): number;
30
+ get costDays(): number | undefined;
31
+ get applicablePeople(): import("vitality-meta/enums/pos").ApplicablePeopleEnum;
32
+ get singleRoomPrice(): undefined;
33
+ get singleRoomSettlementPrice(): undefined;
34
+ }
35
+ declare class SkuInfoProxyV2 extends SkuInfoProxy {
36
+ private readonly orderSkuInfo;
37
+ constructor(orderSkuInfo: PosDto.IPositiveSkuInfoV2);
38
+ get raw(): PosDto.IPositiveSkuInfoV2;
39
+ get id(): string;
40
+ get categoryOne(): string;
41
+ get categoryTwo(): string;
42
+ get salePrice(): number;
43
+ get memberPrice(): number;
44
+ get memberPriceLimitTimes(): number;
45
+ get settlementPrice(): number;
46
+ get quantity(): number;
47
+ get remainingQuantity(): number;
48
+ get applicablePeople(): undefined;
49
+ get singleRoomPrice(): number;
50
+ get singleRoomSettlementPrice(): number;
51
+ }
52
+ declare class ShuttleBusSkuInfoProxyV2 extends SkuInfoProxy {
53
+ private readonly orderSkuInfo;
54
+ constructor(orderSkuInfo: PosDto.IPositiveShuttleBusSkuInfo);
55
+ get raw(): PosDto.IPositiveShuttleBusSkuInfo;
56
+ get id(): undefined;
57
+ get categoryOne(): undefined;
58
+ get categoryTwo(): undefined;
59
+ get salePrice(): number;
60
+ get memberPrice(): undefined;
61
+ get memberPriceLimitTimes(): undefined;
62
+ get settlementPrice(): number;
63
+ get quantity(): number;
64
+ get remainingQuantity(): number;
65
+ get applicablePeople(): undefined;
66
+ get singleRoomPrice(): undefined;
67
+ get singleRoomSettlementPrice(): undefined;
68
+ }
69
+ export declare function createSkuInfoProxy(orderSkuInfo: PosDto.IPositiveSkuInfo | PosDto.IPositiveSkuInfoV2 | PosDto.IPositiveShuttleBusSkuInfo, version: 'V1' | 'V2', type: SkuTypeEnum): SkuInfoProxyV1 | SkuInfoProxyV2 | ShuttleBusSkuInfoProxyV2;
70
+ export {};
@@ -0,0 +1,83 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createSkuInfoProxy = exports.SkuInfoProxy = void 0;
4
+ const pos_1 = require("vitality-meta/enums/pos");
5
+ class SkuInfoProxy {
6
+ }
7
+ exports.SkuInfoProxy = SkuInfoProxy;
8
+ class SkuInfoProxyV1 extends SkuInfoProxy {
9
+ constructor(orderSkuInfo) {
10
+ super();
11
+ this.orderSkuInfo = orderSkuInfo;
12
+ }
13
+ // share
14
+ get raw() { return this.orderSkuInfo; }
15
+ get id() { return this.orderSkuInfo._id; }
16
+ get categoryOne() { return this.orderSkuInfo.categoryOne; }
17
+ get categoryTwo() { return this.orderSkuInfo.categoryTwo; }
18
+ get salePrice() { return this.orderSkuInfo.salePrice; }
19
+ get memberPrice() { return this.orderSkuInfo.memberPrice; }
20
+ get memberPriceLimitTimes() { return this.orderSkuInfo.memberPriceLimitTimes; }
21
+ get settlementPrice() { return this.orderSkuInfo.settlementPrice; }
22
+ get quantity() { return this.orderSkuInfo.quantity; }
23
+ get remainingQuantity() { return this.orderSkuInfo.remainQuantity; }
24
+ get departureDate() { return this.orderSkuInfo.departureDate; }
25
+ get costDays() { return this.orderSkuInfo.costDays; }
26
+ // uniq V1
27
+ get applicablePeople() { return this.orderSkuInfo.applicablePeople; }
28
+ // uniq V2
29
+ get singleRoomPrice() { return undefined; }
30
+ get singleRoomSettlementPrice() { return undefined; }
31
+ }
32
+ class SkuInfoProxyV2 extends SkuInfoProxy {
33
+ constructor(orderSkuInfo) {
34
+ super();
35
+ this.orderSkuInfo = orderSkuInfo;
36
+ }
37
+ // share
38
+ get raw() { return this.orderSkuInfo; }
39
+ get id() { return this.orderSkuInfo._id; }
40
+ get categoryOne() { return this.orderSkuInfo.categoryOne; }
41
+ get categoryTwo() { return this.orderSkuInfo.categoryTwo; }
42
+ get salePrice() { return this.orderSkuInfo.salePrice; }
43
+ get memberPrice() { return this.orderSkuInfo.memberPrice; }
44
+ get memberPriceLimitTimes() { return this.orderSkuInfo.memberPriceLimitCnt; }
45
+ get settlementPrice() { return this.orderSkuInfo.settlementPrice; }
46
+ get quantity() { return this.orderSkuInfo.quantity; }
47
+ get remainingQuantity() { return this.orderSkuInfo.remainQuantity; }
48
+ // uniq V1
49
+ get applicablePeople() { return undefined; }
50
+ // uniq item V2
51
+ get singleRoomPrice() { return this.orderSkuInfo.singleRoomPrice; }
52
+ get singleRoomSettlementPrice() { return this.orderSkuInfo.singleRoomSettlementPrice; }
53
+ }
54
+ class ShuttleBusSkuInfoProxyV2 extends SkuInfoProxy {
55
+ constructor(orderSkuInfo) {
56
+ super();
57
+ this.orderSkuInfo = orderSkuInfo;
58
+ }
59
+ // share
60
+ get raw() { return this.orderSkuInfo; }
61
+ get id() { return undefined; }
62
+ get categoryOne() { return undefined; }
63
+ get categoryTwo() { return undefined; }
64
+ get salePrice() { return this.orderSkuInfo.relationInfo.salePrice; }
65
+ get memberPrice() { return undefined; }
66
+ get memberPriceLimitTimes() { return undefined; }
67
+ get settlementPrice() { return this.orderSkuInfo.relationInfo.settlementPrice; }
68
+ get quantity() { return this.orderSkuInfo.quantity; }
69
+ get remainingQuantity() { return this.orderSkuInfo.remainQuantity; }
70
+ // uniq V1
71
+ get applicablePeople() { return undefined; }
72
+ // uniq V2
73
+ get singleRoomPrice() { return undefined; }
74
+ get singleRoomSettlementPrice() { return undefined; }
75
+ }
76
+ function createSkuInfoProxy(orderSkuInfo, version, type) {
77
+ if (version === 'V1')
78
+ return new SkuInfoProxyV1(orderSkuInfo);
79
+ if (type === pos_1.SkuTypeEnum.ITEM)
80
+ return new SkuInfoProxyV2(orderSkuInfo);
81
+ return new ShuttleBusSkuInfoProxyV2(orderSkuInfo);
82
+ }
83
+ exports.createSkuInfoProxy = createSkuInfoProxy;
@@ -0,0 +1,22 @@
1
+ import { PosDto } from '../..';
2
+ export declare abstract class VenueInfoProxy {
3
+ abstract get raw(): PosDto.IStore | PosDto.IPositiveVenueInfo;
4
+ abstract get id(): string;
5
+ abstract get name(): string;
6
+ }
7
+ declare class VenueInfoProxyV1 extends VenueInfoProxy {
8
+ private readonly orderVenueInfo;
9
+ constructor(orderVenueInfo: PosDto.IStore);
10
+ get raw(): PosDto.IStore;
11
+ get id(): string;
12
+ get name(): string;
13
+ }
14
+ declare class VenueInfoProxyV2 extends VenueInfoProxy {
15
+ private readonly orderVenueInfo;
16
+ constructor(orderVenueInfo: PosDto.IPositiveVenueInfo);
17
+ get raw(): PosDto.IPositiveVenueInfo;
18
+ get id(): string;
19
+ get name(): string;
20
+ }
21
+ export declare function createVenueInfoProxy(orderVenueInfo: PosDto.IStore | PosDto.IPositiveVenueInfo, version: 'V1' | 'V2'): VenueInfoProxyV1 | VenueInfoProxyV2;
22
+ export {};
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createVenueInfoProxy = exports.VenueInfoProxy = void 0;
4
+ class VenueInfoProxy {
5
+ }
6
+ exports.VenueInfoProxy = VenueInfoProxy;
7
+ class VenueInfoProxyV1 extends VenueInfoProxy {
8
+ constructor(orderVenueInfo) {
9
+ super();
10
+ this.orderVenueInfo = orderVenueInfo;
11
+ }
12
+ get raw() { return this.orderVenueInfo; }
13
+ get id() { return this.orderVenueInfo._id; }
14
+ get name() { return this.orderVenueInfo.name; }
15
+ }
16
+ class VenueInfoProxyV2 extends VenueInfoProxy {
17
+ constructor(orderVenueInfo) {
18
+ super();
19
+ this.orderVenueInfo = orderVenueInfo;
20
+ }
21
+ get raw() { return this.orderVenueInfo; }
22
+ get id() { return this.orderVenueInfo.id; }
23
+ get name() { return this.orderVenueInfo.venueInfo.name; }
24
+ }
25
+ function createVenueInfoProxy(orderVenueInfo, version) {
26
+ if (version === 'V2')
27
+ return new VenueInfoProxyV2(orderVenueInfo);
28
+ return new VenueInfoProxyV1(orderVenueInfo);
29
+ }
30
+ exports.createVenueInfoProxy = createVenueInfoProxy;