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

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.3",
3
+ "version": "1.0.51-beta.5",
4
4
  "description": "正向订单服务Nodejs客户端",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/types.d.ts CHANGED
@@ -450,6 +450,7 @@ export interface IPositiveSkuInfoV2 {
450
450
  export interface IPositiveShuttleBusSkuInfo {
451
451
  itemId: string;
452
452
  quantity: number;
453
+ departureDate: number;
453
454
  relationInfo: {
454
455
  id: string;
455
456
  createdAt: number;
@@ -477,7 +478,9 @@ export type IPositiveOrderComboInfo = {
477
478
  createdAt: number;
478
479
  updatedAt: number;
479
480
  orderId: string;
480
- comboInfo: CSDto.IItemCombo | CSDto.IItemComboShortcut;
481
+ comboInfo: CSDto.IItemCombo & {
482
+ nightNum: number;
483
+ } | CSDto.IItemComboShortcut;
481
484
  comboId: string;
482
485
  type: PosConstants.ComboTypeEnum;
483
486
  };
@@ -2,18 +2,24 @@ import { PosDto } from '../..';
2
2
  export declare abstract class ComboInfoProxy {
3
3
  abstract get raw(): PosDto.IPositiveOrderComboInfo | PosDto.IPositiveSkuInfo;
4
4
  abstract get name(): string | undefined;
5
+ abstract get costDays(): number | undefined;
6
+ abstract get nightNum(): number | undefined;
5
7
  }
6
8
  declare class ComboInfoProxyV1 extends ComboInfoProxy {
7
9
  private readonly orderComboInfo;
8
10
  constructor(orderComboInfo: PosDto.IPositiveSkuInfo);
9
11
  get raw(): PosDto.IPositiveSkuInfo;
10
12
  get name(): string | undefined;
13
+ get costDays(): number | undefined;
14
+ get nightNum(): number | undefined;
11
15
  }
12
16
  declare class ComboInfoProxyV2 extends ComboInfoProxy {
13
17
  private readonly orderComboInfo;
14
18
  constructor(orderComboInfo: PosDto.IPositiveOrderComboInfo);
15
19
  get raw(): PosDto.IPositiveOrderComboInfo;
16
20
  get name(): string;
21
+ get costDays(): number;
22
+ get nightNum(): number;
17
23
  }
18
24
  export declare function createComboInfoProxy(orderComboInfo: PosDto.IPositiveOrderComboInfo | PosDto.IPositiveSkuInfo, version: 'V1' | 'V2'): ComboInfoProxyV1 | ComboInfoProxyV2;
19
25
  export {};
@@ -12,6 +12,8 @@ class ComboInfoProxyV1 extends ComboInfoProxy {
12
12
  // share
13
13
  get raw() { return this.orderComboInfo; }
14
14
  get name() { return this.orderComboInfo.combo; }
15
+ get costDays() { return this.orderComboInfo.costDays; }
16
+ get nightNum() { return this.orderComboInfo.costDays ? this.orderComboInfo.costDays - 1 : undefined; }
15
17
  }
16
18
  class ComboInfoProxyV2 extends ComboInfoProxy {
17
19
  constructor(orderComboInfo) {
@@ -21,6 +23,8 @@ class ComboInfoProxyV2 extends ComboInfoProxy {
21
23
  // share
22
24
  get raw() { return this.orderComboInfo; }
23
25
  get name() { return this.orderComboInfo.comboInfo.name; }
26
+ get costDays() { return this.orderComboInfo.comboInfo.nightNum + 1; }
27
+ get nightNum() { return this.orderComboInfo.comboInfo.nightNum; }
24
28
  }
25
29
  function createComboInfoProxy(orderComboInfo, version) {
26
30
  if (version === 'V2')
@@ -1,6 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const pos_1 = require("vitality-meta/enums/pos");
4
3
  const comboInfoProxy_1 = require("./comboInfoProxy");
5
4
  const itemInfoProxy_1 = require("./itemInfoProxy");
6
5
  const skuInfoProxy_1 = require("./skuInfoProxy");
@@ -20,7 +19,7 @@ class PosProxyFactory {
20
19
  if (order.skuInfo) {
21
20
  skuInfoProxy = order.skuInfo.map(sku => (0, skuInfoProxy_1.createSkuInfoProxy)(sku, version, sku.type));
22
21
  if (version === 'V1')
23
- comboInfoProxy = order.skuInfo.filter(sku => sku.type === pos_1.SkuTypeEnum.ITEM).map(sku => (0, comboInfoProxy_1.createComboInfoProxy)(sku, version));
22
+ comboInfoProxy = [(0, comboInfoProxy_1.createComboInfoProxy)(order.skuInfo[0], version)];
24
23
  }
25
24
  if (order.comboInfo) {
26
25
  comboInfoProxy = order.comboInfo.map(combo => (0, comboInfoProxy_1.createComboInfoProxy)(combo, version));
@@ -9,6 +9,7 @@ export declare abstract class SkuInfoProxy {
9
9
  abstract get settlementPrice(): number;
10
10
  abstract get quantity(): number;
11
11
  abstract get remainingQuantity(): number;
12
+ abstract get departureDate(): number;
12
13
  abstract get applicablePeople(): string | undefined;
13
14
  abstract get singleRoomPrice(): number | undefined;
14
15
  abstract get singleRoomSettlementPrice(): number | undefined;
@@ -45,6 +46,7 @@ declare class SkuInfoProxyV2 extends SkuInfoProxy {
45
46
  get settlementPrice(): number;
46
47
  get quantity(): number;
47
48
  get remainingQuantity(): number;
49
+ get departureDate(): number;
48
50
  get applicablePeople(): undefined;
49
51
  get singleRoomPrice(): number;
50
52
  get singleRoomSettlementPrice(): number;
@@ -62,6 +64,7 @@ declare class ShuttleBusSkuInfoProxyV2 extends SkuInfoProxy {
62
64
  get settlementPrice(): number;
63
65
  get quantity(): number;
64
66
  get remainingQuantity(): number;
67
+ get departureDate(): number;
65
68
  get applicablePeople(): undefined;
66
69
  get singleRoomPrice(): undefined;
67
70
  get singleRoomSettlementPrice(): undefined;
@@ -45,6 +45,7 @@ class SkuInfoProxyV2 extends SkuInfoProxy {
45
45
  get settlementPrice() { return this.orderSkuInfo.settlementPrice; }
46
46
  get quantity() { return this.orderSkuInfo.quantity; }
47
47
  get remainingQuantity() { return this.orderSkuInfo.remainQuantity; }
48
+ get departureDate() { return this.orderSkuInfo.departureDate; }
48
49
  // uniq V1
49
50
  get applicablePeople() { return undefined; }
50
51
  // uniq item V2
@@ -67,6 +68,7 @@ class ShuttleBusSkuInfoProxyV2 extends SkuInfoProxy {
67
68
  get settlementPrice() { return this.orderSkuInfo.relationInfo.settlementPrice; }
68
69
  get quantity() { return this.orderSkuInfo.quantity; }
69
70
  get remainingQuantity() { return this.orderSkuInfo.remainQuantity; }
71
+ get departureDate() { return this.orderSkuInfo.departureDate; }
70
72
  // uniq V1
71
73
  get applicablePeople() { return undefined; }
72
74
  // uniq V2