oak-pay-business 3.4.1 → 3.4.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.
Files changed (51) hide show
  1. package/es/checkers/settlePlan.js +4 -4
  2. package/es/components/AbstractComponents.d.ts +19 -9
  3. package/es/components/pay/detail/index.d.ts +1 -1
  4. package/es/oak-app-domain/ActionDefDict.d.ts +2 -2
  5. package/es/oak-app-domain/ActionDefDict.js +2 -2
  6. package/es/oak-app-domain/Application/_baseSchema.d.ts +10 -15
  7. package/es/oak-app-domain/EntityDict.d.ts +50 -50
  8. package/es/oak-app-domain/Notification/Storage.js +4 -2
  9. package/es/oak-app-domain/Notification/Style.js +8 -8
  10. package/es/oak-app-domain/Notification/_baseSchema.d.ts +2 -3
  11. package/es/oak-app-domain/Notification/locales/zh_CN.json +0 -8
  12. package/es/oak-app-domain/Storage.js +2 -2
  13. package/es/oak-app-domain/StyleDict.js +2 -2
  14. package/es/oak-app-domain/System/_baseSchema.d.ts +2 -2
  15. package/es/oak-app-domain/UserEntityGrant/Storage.js +1 -1
  16. package/es/oak-app-domain/WechatLogin/Storage.js +1 -1
  17. package/es/oak-app-domain/WechatQrCode/Storage.js +1 -1
  18. package/es/utils/payClazz/AliPay/AliPay.js +6 -0
  19. package/es/utils/payClazz/WechatPay/index.d.ts +1 -1
  20. package/es/utils/payClazz/index.js +1 -1
  21. package/es/utils/shipClazz/WechatMpShip/index.d.ts +2 -2
  22. package/lib/aspects/withdraw.js +1 -2
  23. package/lib/checkers/abstractChecker.js +2 -2
  24. package/lib/checkers/settlePlan.js +4 -4
  25. package/lib/hooks/useFeatures.js +1 -1
  26. package/lib/oak-app-domain/ActionDefDict.d.ts +2 -2
  27. package/lib/oak-app-domain/Application/_baseSchema.d.ts +10 -15
  28. package/lib/oak-app-domain/EntityDict.d.ts +50 -50
  29. package/lib/oak-app-domain/Notification/Storage.js +4 -2
  30. package/lib/oak-app-domain/Notification/Style.js +8 -8
  31. package/lib/oak-app-domain/Notification/_baseSchema.d.ts +2 -3
  32. package/lib/oak-app-domain/Notification/locales/zh_CN.json +0 -8
  33. package/lib/oak-app-domain/System/Storage.js +2 -1
  34. package/lib/oak-app-domain/System/_baseSchema.d.ts +2 -2
  35. package/lib/oak-app-domain/UserEntityGrant/Storage.js +1 -1
  36. package/lib/oak-app-domain/WechatLogin/Storage.js +1 -1
  37. package/lib/oak-app-domain/WechatQrCode/Storage.js +1 -1
  38. package/lib/triggers/withdraw.js +1 -2
  39. package/lib/types/DependentExceptions.js +1 -1
  40. package/lib/utils/apProduct.js +1 -2
  41. package/lib/utils/application.js +2 -2
  42. package/lib/utils/pay.js +4 -4
  43. package/lib/utils/payClazz/AliPay/AliPay.debug.js +1 -2
  44. package/lib/utils/payClazz/AliPay/AliPay.js +6 -0
  45. package/lib/utils/payClazz/WechatPay/WechatPay.debug.js +1 -2
  46. package/lib/utils/payClazz/index.js +1 -1
  47. package/lib/utils/ship.js +7 -7
  48. package/lib/utils/shipClazz/index.js +3 -4
  49. package/lib/utils/wpProduct.js +1 -2
  50. package/lib/utils/wpProductFrontend.js +2 -3
  51. package/package.json +4 -4
@@ -58,12 +58,12 @@ const checkers = [
58
58
  });
59
59
  };
60
60
  if (data instanceof Array) {
61
- for (const d of data) {
62
- checkfn(d);
63
- }
61
+ return pipeline(...data.map((ele) => {
62
+ return () => checkfn(ele);
63
+ }));
64
64
  }
65
65
  else {
66
- checkfn(data);
66
+ return checkfn(data);
67
67
  }
68
68
  }
69
69
  },
@@ -18,11 +18,16 @@ declare const List: <T extends keyof EntityDict>(props: ReactComponentProps<Enti
18
18
  data: RowWithActions<EntityDict, T>[];
19
19
  loading: boolean;
20
20
  tablePagination?: React.ReactNode;
21
- rowSelection?: any;
21
+ rowSelection?: import("antd/es/table/interface").TableRowSelection<RowWithActions<EntityDict, T>> | undefined;
22
22
  hideHeader?: boolean | undefined;
23
23
  disableSerialNumber?: boolean | undefined;
24
- size?: "small" | "large" | "middle" | undefined;
25
- scroll?: any;
24
+ size?: "small" | "middle" | "large" | undefined;
25
+ scroll?: ({
26
+ x?: string | number | true | undefined;
27
+ y?: string | number | undefined;
28
+ } & {
29
+ scrollToFirstRowOnChange?: boolean | undefined;
30
+ }) | undefined;
26
31
  empty?: React.ReactNode;
27
32
  opWidth?: number | undefined;
28
33
  ellipsis?: boolean | undefined;
@@ -41,29 +46,34 @@ declare const ListPro: <T extends keyof EntityDict>(props: {
41
46
  data: RowWithActions<EntityDict, T>[];
42
47
  loading?: boolean | undefined;
43
48
  tablePagination?: any;
44
- rowSelection?: any;
49
+ rowSelection?: import("antd/es/table/interface").TableRowSelection<RowWithActions<EntityDict, T>> | undefined;
45
50
  disableSerialNumber?: boolean | undefined;
46
- size?: "small" | "large" | "middle" | undefined;
47
- scroll?: any;
51
+ size?: "small" | "middle" | "large" | undefined;
52
+ scroll?: ({
53
+ x?: string | number | true | undefined;
54
+ y?: string | number | undefined;
55
+ } & {
56
+ scrollToFirstRowOnChange?: boolean | undefined;
57
+ }) | undefined;
48
58
  empty?: any;
49
59
  opWidth?: number | undefined;
50
60
  oakPath?: string | undefined;
51
61
  }) => React.ReactElement;
52
62
  declare const Detail: <T extends keyof EntityDict>(props: ReactComponentProps<EntityDict, T, false, {
53
- column?: number | Record<Breakpoint, number> | undefined;
63
+ column?: number | Record<import("antd").Breakpoint, number> | undefined;
54
64
  entity: T;
55
65
  attributes: OakAbsAttrDef[];
56
66
  data: Partial<EntityDict[T]["Schema"]>;
57
67
  title?: string | undefined;
58
68
  bordered?: boolean | undefined;
59
- layout?: "horizontal" | "vertical" | undefined;
69
+ layout?: "vertical" | "horizontal" | undefined;
60
70
  }>) => React.ReactElement;
61
71
  declare const Upsert: <T extends keyof EntityDict>(props: ReactComponentProps<EntityDict, T, false, {
62
72
  helps: Record<string, string>;
63
73
  entity: T;
64
74
  attributes: OakAbsAttrUpsertDef<EntityDict, T, string | number>[];
65
75
  data: EntityDict[T]["Schema"];
66
- layout: "horizontal" | "vertical";
76
+ layout: "vertical" | "horizontal";
67
77
  mode: "default" | "card";
68
78
  }>) => React.ReactElement;
69
79
  export { FilterPanel, List, ListPro, Detail, Upsert, ReactComponentProps, ColumnProps, RowWithActions, OakExtraActionProps, OakAbsAttrDef, onActionFnDef, };
@@ -9,7 +9,7 @@ declare const _default: (props: import("oak-frontend-base").ReactComponentProps<
9
9
  goBackable: boolean;
10
10
  disableAutoPay: boolean;
11
11
  closeWhenFailure: boolean;
12
- mode: "backend" | "frontend";
12
+ mode: "frontend" | "backend";
13
13
  autoSuccessAt: boolean;
14
14
  disableClose: boolean;
15
15
  }>) => React.ReactElement;
@@ -73,10 +73,10 @@ export declare const actionDefDict: {
73
73
  refund: {
74
74
  iState: import("oak-domain/lib/types").ActionDef<string, string>;
75
75
  };
76
- settlement: {
76
+ settlePlan: {
77
77
  iState: import("oak-domain/lib/types").ActionDef<string, string>;
78
78
  };
79
- settlePlan: {
79
+ settlement: {
80
80
  iState: import("oak-domain/lib/types").ActionDef<string, string>;
81
81
  };
82
82
  ship: {
@@ -27,8 +27,8 @@ import { actionDefDict as offlineAccount } from "./OfflineAccount/Action";
27
27
  import { actionDefDict as order } from "./Order/Action";
28
28
  import { actionDefDict as pay } from "./Pay/Action";
29
29
  import { actionDefDict as refund } from "./Refund/Action";
30
- import { actionDefDict as settlement } from "./Settlement/Action";
31
30
  import { actionDefDict as settlePlan } from "./SettlePlan/Action";
31
+ import { actionDefDict as settlement } from "./Settlement/Action";
32
32
  import { actionDefDict as ship } from "./Ship/Action";
33
33
  import { actionDefDict as user } from "./User/Action";
34
34
  import { actionDefDict as withdraw } from "./Withdraw/Action";
@@ -66,8 +66,8 @@ export const actionDefDict = {
66
66
  order,
67
67
  pay,
68
68
  refund,
69
- settlement,
70
69
  settlePlan,
70
+ settlement,
71
71
  ship,
72
72
  user,
73
73
  withdraw,
@@ -6,6 +6,12 @@ import { String, Text } from "oak-domain/lib/types/DataType";
6
6
  import { Style } from "oak-general-business/lib/types/Style";
7
7
  export type CosOrigin = "qiniu" | "wechat" | "ctyun" | "aliyun" | "tencent" | "local" | "unknown" | "s3";
8
8
  export type AppType = "web" | "wechatMp" | "wechatPublic" | "native";
9
+ export type Location = {
10
+ protocol: "http:" | "https:";
11
+ hostname: string;
12
+ port: string;
13
+ scanPage?: string | "wechatQrCode/scan";
14
+ };
9
15
  export type WechatMpConfig = {
10
16
  type: "wechatMp";
11
17
  appId: string;
@@ -20,6 +26,7 @@ export type WechatMpConfig = {
20
26
  mode: "clear" | "compatible" | "safe";
21
27
  dataFormat: "json" | "xml";
22
28
  };
29
+ location: Location;
23
30
  cos?: {
24
31
  defaultOrigin: CosOrigin;
25
32
  };
@@ -36,11 +43,7 @@ export type WebConfig = {
36
43
  appId: string;
37
44
  appSecret: string;
38
45
  };
39
- location: {
40
- protocol: "http:" | "https:";
41
- hostname: string;
42
- port: string;
43
- };
46
+ location: Location;
44
47
  cos?: {
45
48
  defaultOrigin: CosOrigin;
46
49
  };
@@ -61,11 +64,7 @@ export type WechatPublicConfig = {
61
64
  appId: string;
62
65
  originalId: string;
63
66
  };
64
- location: {
65
- protocol: "http:" | "https:";
66
- hostname: string;
67
- port: string;
68
- };
67
+ location: Location;
69
68
  cos?: {
70
69
  defaultOrigin: CosOrigin;
71
70
  };
@@ -77,11 +76,7 @@ export type NativeConfig = {
77
76
  appSecret: string;
78
77
  domain?: string;
79
78
  };
80
- location: {
81
- protocol: "http:" | "https:";
82
- hostname: string;
83
- port: string;
84
- };
79
+ location: Location;
85
80
  cos?: {
86
81
  defaultOrigin: CosOrigin;
87
82
  };
@@ -78,8 +78,8 @@ import * as BaseOfflineAccount from "./OfflineAccount/_baseSchema";
78
78
  import * as BaseOrder from "./Order/_baseSchema";
79
79
  import * as BasePay from "./Pay/_baseSchema";
80
80
  import * as BaseRefund from "./Refund/_baseSchema";
81
- import * as BaseSettlement from "./Settlement/_baseSchema";
82
81
  import * as BaseSettlePlan from "./SettlePlan/_baseSchema";
82
+ import * as BaseSettlement from "./Settlement/_baseSchema";
83
83
  import * as BaseShip from "./Ship/_baseSchema";
84
84
  import * as BaseShipCompany from "./ShipCompany/_baseSchema";
85
85
  import * as BaseShipOrder from "./ShipOrder/_baseSchema";
@@ -5249,6 +5249,54 @@ export type Refund = {
5249
5249
  Remove: OakOperation<"remove", Refund["RemoveOperationData"], Refund["Filter"], Refund["Sorter"]>;
5250
5250
  Operation: Refund["Create"] | Refund["Update"] | Refund["Remove"];
5251
5251
  };
5252
+ export type SettlePlan = {
5253
+ OpSchema: BaseSettlePlan.OpSchema;
5254
+ Action: BaseSettlePlan.OpAction;
5255
+ Schema: BaseSettlePlan.OpSchema & {
5256
+ order: Order["Schema"];
5257
+ settlement$plan?: Array<Omit<Settlement["Schema"], "plan">>;
5258
+ settlement$plan$$aggr?: AggregationResult<Omit<Settlement["Schema"], "plan">>;
5259
+ };
5260
+ Projection: BaseSettlePlan.OpProjection & {
5261
+ order?: Order["Projection"];
5262
+ settlement$plan?: OakSelection<"select", Omit<Settlement["Projection"], "settlePlan">, Omit<Settlement["Filter"], "settlePlan">, Settlement["Sorter"]> & {
5263
+ $entity: "settlement";
5264
+ };
5265
+ settlement$plan$$aggr?: DeduceAggregation<Omit<Settlement["Projection"], "settlePlan">, Omit<Settlement["Filter"], "settlePlan">, Settlement["Sorter"]> & {
5266
+ $entity: "settlement";
5267
+ };
5268
+ };
5269
+ FilterUnit: BaseSettlePlan.OpFilter & {
5270
+ order: MakeFilter<Order["FilterUnit"]>;
5271
+ settlement$plan: MakeFilter<Omit<Settlement["FilterUnit"], "plan">> & SubQueryPredicateMetadata;
5272
+ };
5273
+ Filter: MakeFilter<SettlePlan["FilterUnit"]>;
5274
+ SortAttr: Partial<BaseSettlePlan.OpSortAttr | {
5275
+ order: Order["SortAttr"];
5276
+ }>;
5277
+ SortNode: {
5278
+ $attr: SettlePlan["SortAttr"];
5279
+ $direction?: "asc" | "desc";
5280
+ };
5281
+ Sorter: SettlePlan["SortNode"][];
5282
+ Selection: OakSelection<"select", SettlePlan["Projection"], SettlePlan["Filter"], SettlePlan["Sorter"]>;
5283
+ Aggregation: DeduceAggregation<SettlePlan["Projection"], SettlePlan["Filter"], SettlePlan["Sorter"]>;
5284
+ CreateOperationData: FormCreateData<BaseSettlePlan.OpSchema & {
5285
+ order?: OakOperation<"create", Order["CreateOperationData"]> | OakOperation<BaseOrder.OpUpdateAction, Order["UpdateOperationData"], Order["Filter"]>;
5286
+ settlement$plan?: (OakOperation<"create", Omit<Settlement["CreateOperationData"], "plan"> | Omit<Settlement["CreateOperationData"], "plan">[]> | OakOperation<BaseSettlement.OpUpdateAction, Omit<Settlement["UpdateOperationData"], "plan">, Settlement["Filter"]>)[];
5287
+ }>;
5288
+ CreateSingle: OakOperation<"create", SettlePlan["CreateOperationData"]>;
5289
+ CreateMulti: OakOperation<"create", Array<SettlePlan["CreateOperationData"]>>;
5290
+ Create: SettlePlan["CreateSingle"] | SettlePlan["CreateMulti"];
5291
+ UpdateOperationData: FormUpdateData<BaseSettlePlan.OpSchema & {
5292
+ order?: OakOperation<"create", Order["CreateOperationData"]> | OakOperation<BaseOrder.OpUpdateAction, Order["UpdateOperationData"], Order["Filter"]> | OakOperation<"remove", Order["RemoveOperationData"], Order["Filter"]>;
5293
+ settlement$plan?: (OakOperation<"create", Omit<Settlement["CreateOperationData"], "plan"> | Omit<Settlement["CreateOperationData"], "plan">[]> | OakOperation<BaseSettlement.OpUpdateAction, Omit<Settlement["UpdateOperationData"], "plan">, Settlement["Filter"]> | OakOperation<"remove", Settlement["RemoveOperationData"], Settlement["Filter"]>)[];
5294
+ }>;
5295
+ Update: OakOperation<BaseSettlePlan.OpUpdateAction, SettlePlan["UpdateOperationData"], SettlePlan["Filter"], SettlePlan["Sorter"]>;
5296
+ RemoveOperationData: {};
5297
+ Remove: OakOperation<"remove", SettlePlan["RemoveOperationData"], SettlePlan["Filter"], SettlePlan["Sorter"]>;
5298
+ Operation: SettlePlan["Create"] | SettlePlan["Update"] | SettlePlan["Remove"];
5299
+ };
5252
5300
  export type Settlement = {
5253
5301
  OpSchema: BaseSettlement.OpSchema;
5254
5302
  Action: BaseSettlement.OpAction;
@@ -5303,54 +5351,6 @@ export type Settlement = {
5303
5351
  Remove: OakOperation<"remove", Settlement["RemoveOperationData"], Settlement["Filter"], Settlement["Sorter"]>;
5304
5352
  Operation: Settlement["Create"] | Settlement["Update"] | Settlement["Remove"];
5305
5353
  };
5306
- export type SettlePlan = {
5307
- OpSchema: BaseSettlePlan.OpSchema;
5308
- Action: BaseSettlePlan.OpAction;
5309
- Schema: BaseSettlePlan.OpSchema & {
5310
- order: Order["Schema"];
5311
- settlement$plan?: Array<Omit<Settlement["Schema"], "plan">>;
5312
- settlement$plan$$aggr?: AggregationResult<Omit<Settlement["Schema"], "plan">>;
5313
- };
5314
- Projection: BaseSettlePlan.OpProjection & {
5315
- order?: Order["Projection"];
5316
- settlement$plan?: OakSelection<"select", Omit<Settlement["Projection"], "settlePlan">, Omit<Settlement["Filter"], "settlePlan">, Settlement["Sorter"]> & {
5317
- $entity: "settlement";
5318
- };
5319
- settlement$plan$$aggr?: DeduceAggregation<Omit<Settlement["Projection"], "settlePlan">, Omit<Settlement["Filter"], "settlePlan">, Settlement["Sorter"]> & {
5320
- $entity: "settlement";
5321
- };
5322
- };
5323
- FilterUnit: BaseSettlePlan.OpFilter & {
5324
- order: MakeFilter<Order["FilterUnit"]>;
5325
- settlement$plan: MakeFilter<Omit<Settlement["FilterUnit"], "plan">> & SubQueryPredicateMetadata;
5326
- };
5327
- Filter: MakeFilter<SettlePlan["FilterUnit"]>;
5328
- SortAttr: Partial<BaseSettlePlan.OpSortAttr | {
5329
- order: Order["SortAttr"];
5330
- }>;
5331
- SortNode: {
5332
- $attr: SettlePlan["SortAttr"];
5333
- $direction?: "asc" | "desc";
5334
- };
5335
- Sorter: SettlePlan["SortNode"][];
5336
- Selection: OakSelection<"select", SettlePlan["Projection"], SettlePlan["Filter"], SettlePlan["Sorter"]>;
5337
- Aggregation: DeduceAggregation<SettlePlan["Projection"], SettlePlan["Filter"], SettlePlan["Sorter"]>;
5338
- CreateOperationData: FormCreateData<BaseSettlePlan.OpSchema & {
5339
- order?: OakOperation<"create", Order["CreateOperationData"]> | OakOperation<BaseOrder.OpUpdateAction, Order["UpdateOperationData"], Order["Filter"]>;
5340
- settlement$plan?: (OakOperation<"create", Omit<Settlement["CreateOperationData"], "plan"> | Omit<Settlement["CreateOperationData"], "plan">[]> | OakOperation<BaseSettlement.OpUpdateAction, Omit<Settlement["UpdateOperationData"], "plan">, Settlement["Filter"]>)[];
5341
- }>;
5342
- CreateSingle: OakOperation<"create", SettlePlan["CreateOperationData"]>;
5343
- CreateMulti: OakOperation<"create", Array<SettlePlan["CreateOperationData"]>>;
5344
- Create: SettlePlan["CreateSingle"] | SettlePlan["CreateMulti"];
5345
- UpdateOperationData: FormUpdateData<BaseSettlePlan.OpSchema & {
5346
- order?: OakOperation<"create", Order["CreateOperationData"]> | OakOperation<BaseOrder.OpUpdateAction, Order["UpdateOperationData"], Order["Filter"]> | OakOperation<"remove", Order["RemoveOperationData"], Order["Filter"]>;
5347
- settlement$plan?: (OakOperation<"create", Omit<Settlement["CreateOperationData"], "plan"> | Omit<Settlement["CreateOperationData"], "plan">[]> | OakOperation<BaseSettlement.OpUpdateAction, Omit<Settlement["UpdateOperationData"], "plan">, Settlement["Filter"]> | OakOperation<"remove", Settlement["RemoveOperationData"], Settlement["Filter"]>)[];
5348
- }>;
5349
- Update: OakOperation<BaseSettlePlan.OpUpdateAction, SettlePlan["UpdateOperationData"], SettlePlan["Filter"], SettlePlan["Sorter"]>;
5350
- RemoveOperationData: {};
5351
- Remove: OakOperation<"remove", SettlePlan["RemoveOperationData"], SettlePlan["Filter"], SettlePlan["Sorter"]>;
5352
- Operation: SettlePlan["Create"] | SettlePlan["Update"] | SettlePlan["Remove"];
5353
- };
5354
5354
  export type Ship = {
5355
5355
  OpSchema: BaseShip.OpSchema;
5356
5356
  Action: BaseShip.OpAction;
@@ -6343,8 +6343,8 @@ export type EntityDict = {
6343
6343
  order: Order;
6344
6344
  pay: Pay;
6345
6345
  refund: Refund;
6346
- settlement: Settlement;
6347
6346
  settlePlan: SettlePlan;
6347
+ settlement: Settlement;
6348
6348
  ship: Ship;
6349
6349
  shipCompany: ShipCompany;
6350
6350
  shipOrder: ShipOrder;
@@ -3,8 +3,10 @@ export const desc = {
3
3
  attributes: {
4
4
  channel: {
5
5
  notNull: true,
6
- type: "enum",
7
- enumeration: ["wechatPublic", "jPush", "jim", "wechatMp", "sms", "email"]
6
+ type: "varchar",
7
+ params: {
8
+ length: 32
9
+ }
8
10
  },
9
11
  applicationId: {
10
12
  type: "ref",
@@ -9,13 +9,13 @@ export const style = {
9
9
  success: '#008000',
10
10
  failure: '#9A9A9A',
11
11
  },
12
- channel: {
13
- wechatMp: '#008000',
14
- jPush: '#0000FF',
15
- jim: '#0000FF',
16
- wechatPublic: '#008000',
17
- sms: '#000000',
18
- email: '#000000',
19
- },
12
+ // channel: {
13
+ // wechatMp: '#008000',
14
+ // jPush: '#0000FF',
15
+ // jim: '#0000FF',
16
+ // wechatPublic: '#008000',
17
+ // sms: '#000000',
18
+ // email: '#000000',
19
+ // },
20
20
  }
21
21
  };
@@ -2,10 +2,9 @@ import { ForeignKey } from "oak-domain/lib/types/DataType";
2
2
  import { Q_DateValue, Q_NumberValue, Q_StringValue, Q_EnumValue, NodeId, ExprOp, ExpressionKey } from "oak-domain/lib/types/Demand";
3
3
  import { MakeAction as OakMakeAction, EntityShape } from "oak-domain/lib/types/Entity";
4
4
  import { Action, ParticularAction, IState } from "./Action";
5
- import { Channel } from "oak-general-business/lib/types/Message";
6
5
  import { String } from "oak-domain/lib/types/DataType";
7
6
  export type OpSchema = EntityShape & {
8
- channel: Channel;
7
+ channel: String<32>;
9
8
  applicationId?: ForeignKey<"application"> | null;
10
9
  data?: Object | null;
11
10
  messageSystemId: ForeignKey<"messageSystem">;
@@ -22,7 +21,7 @@ export type OpFilter = {
22
21
  $$createAt$$: Q_DateValue;
23
22
  $$seq$$: Q_NumberValue;
24
23
  $$updateAt$$: Q_DateValue;
25
- channel: Q_EnumValue<Channel>;
24
+ channel: Q_StringValue;
26
25
  applicationId: Q_StringValue;
27
26
  data: Object;
28
27
  messageSystemId: Q_StringValue;
@@ -19,14 +19,6 @@
19
19
  "sending": "发送中",
20
20
  "success": "发送成功",
21
21
  "failure": "发送失败"
22
- },
23
- "channel": {
24
- "wechatPublic": "公众号",
25
- "jPush": "极光推送",
26
- "jim": "极光消息",
27
- "wechatMp": "小程序",
28
- "sms": "短信",
29
- "email": "邮箱"
30
22
  }
31
23
  }
32
24
  }
@@ -76,8 +76,8 @@ import { desc as offlineAccountDesc } from "./OfflineAccount/Storage";
76
76
  import { desc as orderDesc } from "./Order/Storage";
77
77
  import { desc as payDesc } from "./Pay/Storage";
78
78
  import { desc as refundDesc } from "./Refund/Storage";
79
- import { desc as settlementDesc } from "./Settlement/Storage";
80
79
  import { desc as settlePlanDesc } from "./SettlePlan/Storage";
80
+ import { desc as settlementDesc } from "./Settlement/Storage";
81
81
  import { desc as shipDesc } from "./Ship/Storage";
82
82
  import { desc as shipCompanyDesc } from "./ShipCompany/Storage";
83
83
  import { desc as shipOrderDesc } from "./ShipOrder/Storage";
@@ -172,8 +172,8 @@ export const storageSchema = {
172
172
  order: orderDesc,
173
173
  pay: payDesc,
174
174
  refund: refundDesc,
175
- settlement: settlementDesc,
176
175
  settlePlan: settlePlanDesc,
176
+ settlement: settlementDesc,
177
177
  ship: shipDesc,
178
178
  shipCompany: shipCompanyDesc,
179
179
  shipOrder: shipOrderDesc,
@@ -39,8 +39,8 @@ import { style as offlineAccount } from "./OfflineAccount/Style";
39
39
  import { style as order } from "./Order/Style";
40
40
  import { style as pay } from "./Pay/Style";
41
41
  import { style as refund } from "./Refund/Style";
42
- import { style as settlement } from "./Settlement/Style";
43
42
  import { style as settlePlan } from "./SettlePlan/Style";
43
+ import { style as settlement } from "./Settlement/Style";
44
44
  import { style as ship } from "./Ship/Style";
45
45
  import { style as sysAccountOper } from "./SysAccountOper/Style";
46
46
  import { style as user } from "./User/Style";
@@ -92,8 +92,8 @@ export const styleDict = {
92
92
  order,
93
93
  pay,
94
94
  refund,
95
- settlement,
96
95
  settlePlan,
96
+ settlement,
97
97
  ship,
98
98
  sysAccountOper,
99
99
  user,
@@ -3,8 +3,8 @@ import { Q_DateValue, Q_BooleanValue, Q_NumberValue, Q_StringValue, NodeId, Expr
3
3
  import { MakeAction as OakMakeAction, EntityShape } from "oak-domain/lib/types/Entity";
4
4
  import { GenericAction } from "oak-domain/lib/actions/action";
5
5
  import { String, Text, Boolean } from "oak-domain/lib/types/DataType";
6
- import { Config } from "oak-general-business/lib/types/Config";
7
- import { Style } from "oak-general-business/lib/types/Style";
6
+ import { Config } from "../../../../oak-general-business/lib/types/Config";
7
+ import { Style } from "../../../../oak-general-business/lib/types/Style";
8
8
  type PayConfig = {
9
9
  withdrawLoss: {
10
10
  conservative: boolean;
@@ -59,7 +59,7 @@ export const desc = {
59
59
  qrCodeType: {
60
60
  notNull: true,
61
61
  type: "enum",
62
- enumeration: ["wechatPublic", "wechatMpDomainUrl", "wechatMpWxaCode", "wechatPublicForMp", "webForWechatPublic"]
62
+ enumeration: ["wechatMpDomainUrl", "wechatMpWxaCode", "wechatPublic", "wechatPublicForMp", "webForWechatPublic"]
63
63
  },
64
64
  expiresAt: {
65
65
  type: "datetime"
@@ -20,7 +20,7 @@ export const desc = {
20
20
  qrCodeType: {
21
21
  notNull: true,
22
22
  type: "enum",
23
- enumeration: ["wechatPublic", "wechatMpDomainUrl", "wechatMpWxaCode", "wechatPublicForMp", "webForWechatPublic"]
23
+ enumeration: ["wechatMpDomainUrl", "wechatMpWxaCode", "wechatPublic", "wechatPublicForMp", "webForWechatPublic"]
24
24
  },
25
25
  expiresAt: {
26
26
  type: "datetime"
@@ -19,7 +19,7 @@ export const desc = {
19
19
  type: {
20
20
  notNull: true,
21
21
  type: "enum",
22
- enumeration: ["wechatPublic", "wechatMpDomainUrl", "wechatMpWxaCode", "wechatPublicForMp", "webForWechatPublic"]
22
+ enumeration: ["wechatMpDomainUrl", "wechatMpWxaCode", "wechatPublic", "wechatPublicForMp", "webForWechatPublic"]
23
23
  },
24
24
  allowShare: {
25
25
  notNull: true,
@@ -273,6 +273,12 @@ export default class AliPay extends AliPayDebug {
273
273
  async close(pay) {
274
274
  const outTradeNo = compressTo32(pay.id);
275
275
  try {
276
+ const [iState, updateData] = await this.getState(pay);
277
+ // 电脑网站支付时 设置超时后,支付宝交易订单会出现超时关闭 需查询当前的状态
278
+ // 如果支付宝查询接口返回状态为closed,则订单已关闭,不需要执行关闭接口
279
+ if (iState === 'closed') {
280
+ return;
281
+ }
276
282
  const result = await this.alipaySdk.curl('POST', '/v3/alipay/trade/close', {
277
283
  body: {
278
284
  out_trade_no: outTradeNo,
@@ -1,4 +1,4 @@
1
1
  import WechatPay from './WechatPay';
2
2
  import WechatPayDebug from './WechatPay.debug';
3
- declare const _default: typeof WechatPayDebug | typeof WechatPay;
3
+ declare const _default: typeof WechatPay | typeof WechatPayDebug;
4
4
  export default _default;
@@ -82,7 +82,7 @@ const PayClazzEntityDict = {
82
82
  switch (type) {
83
83
  case 'web': {
84
84
  const { wechatPay } = config;
85
- assert(wechatPay);
85
+ assert(wechatPay, 'web类型的application未配置wechatPay');
86
86
  const appId = wechatPay.appId;
87
87
  return new WechatPay(wpProduct, appId);
88
88
  }
@@ -1,3 +1,3 @@
1
- import WechatMpShipDebug from './WechatMpShip.debug';
2
- declare const _default: typeof WechatMpShipDebug;
1
+ import WechatMpShip from './WechatMpShip';
2
+ declare const _default: typeof WechatMpShip;
3
3
  export default _default;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getWithdrawCreateData = void 0;
3
+ exports.getWithdrawCreateData = getWithdrawCreateData;
4
4
  const tslib_1 = require("tslib");
5
5
  const types_1 = require("oak-domain/lib/types");
6
6
  const uuid_1 = require("oak-domain/lib/utils/uuid");
@@ -211,4 +211,3 @@ async function getWithdrawCreateData(params, context) {
211
211
  data.loss = totalLoss;
212
212
  return data;
213
213
  }
214
- exports.getWithdrawCreateData = getWithdrawCreateData;
@@ -1,12 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.accountEntities = exports.registerAccountEntity = void 0;
3
+ exports.accountEntities = void 0;
4
+ exports.registerAccountEntity = registerAccountEntity;
4
5
  const uuid_1 = require("oak-domain/lib/utils/uuid");
5
6
  // 当注入一个新的account entity时,将withdrawChannel的删除与之相关联
6
7
  function registerAccountEntity(entity) {
7
8
  exports.accountEntities.push(entity);
8
9
  }
9
- exports.registerAccountEntity = registerAccountEntity;
10
10
  exports.accountEntities = ['offlineAccount'];
11
11
  const triggers = [
12
12
  ...exports.accountEntities.filter(ele => !!ele).map((entity) => [
@@ -60,12 +60,12 @@ const checkers = [
60
60
  });
61
61
  };
62
62
  if (data instanceof Array) {
63
- for (const d of data) {
64
- checkfn(d);
65
- }
63
+ return (0, executor_1.pipeline)(...data.map((ele) => {
64
+ return () => checkfn(ele);
65
+ }));
66
66
  }
67
67
  else {
68
- checkfn(data);
68
+ return checkfn(data);
69
69
  }
70
70
  }
71
71
  },
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = useFeatures;
3
4
  const web_1 = require("oak-frontend-base/es/platforms/web");
4
5
  // react 独有
5
6
  // 这里因为开发时要引用src,而AFD定义中引用lib,所以有编译的warning. by Xc
@@ -7,5 +8,4 @@ function useFeatures() {
7
8
  // @ts-ignore
8
9
  return (0, web_1.useFeatures)();
9
10
  }
10
- exports.default = useFeatures;
11
11
  ;
@@ -73,10 +73,10 @@ export declare const actionDefDict: {
73
73
  refund: {
74
74
  iState: import("oak-domain/lib/types").ActionDef<string, string>;
75
75
  };
76
- settlement: {
76
+ settlePlan: {
77
77
  iState: import("oak-domain/lib/types").ActionDef<string, string>;
78
78
  };
79
- settlePlan: {
79
+ settlement: {
80
80
  iState: import("oak-domain/lib/types").ActionDef<string, string>;
81
81
  };
82
82
  ship: {
@@ -6,6 +6,12 @@ import { String, Text } from "oak-domain/lib/types/DataType";
6
6
  import { Style } from "oak-general-business/lib/types/Style";
7
7
  export type CosOrigin = "qiniu" | "wechat" | "ctyun" | "aliyun" | "tencent" | "local" | "unknown" | "s3";
8
8
  export type AppType = "web" | "wechatMp" | "wechatPublic" | "native";
9
+ export type Location = {
10
+ protocol: "http:" | "https:";
11
+ hostname: string;
12
+ port: string;
13
+ scanPage?: string | "wechatQrCode/scan";
14
+ };
9
15
  export type WechatMpConfig = {
10
16
  type: "wechatMp";
11
17
  appId: string;
@@ -20,6 +26,7 @@ export type WechatMpConfig = {
20
26
  mode: "clear" | "compatible" | "safe";
21
27
  dataFormat: "json" | "xml";
22
28
  };
29
+ location: Location;
23
30
  cos?: {
24
31
  defaultOrigin: CosOrigin;
25
32
  };
@@ -36,11 +43,7 @@ export type WebConfig = {
36
43
  appId: string;
37
44
  appSecret: string;
38
45
  };
39
- location: {
40
- protocol: "http:" | "https:";
41
- hostname: string;
42
- port: string;
43
- };
46
+ location: Location;
44
47
  cos?: {
45
48
  defaultOrigin: CosOrigin;
46
49
  };
@@ -61,11 +64,7 @@ export type WechatPublicConfig = {
61
64
  appId: string;
62
65
  originalId: string;
63
66
  };
64
- location: {
65
- protocol: "http:" | "https:";
66
- hostname: string;
67
- port: string;
68
- };
67
+ location: Location;
69
68
  cos?: {
70
69
  defaultOrigin: CosOrigin;
71
70
  };
@@ -77,11 +76,7 @@ export type NativeConfig = {
77
76
  appSecret: string;
78
77
  domain?: string;
79
78
  };
80
- location: {
81
- protocol: "http:" | "https:";
82
- hostname: string;
83
- port: string;
84
- };
79
+ location: Location;
85
80
  cos?: {
86
81
  defaultOrigin: CosOrigin;
87
82
  };
@@ -78,8 +78,8 @@ import * as BaseOfflineAccount from "./OfflineAccount/_baseSchema";
78
78
  import * as BaseOrder from "./Order/_baseSchema";
79
79
  import * as BasePay from "./Pay/_baseSchema";
80
80
  import * as BaseRefund from "./Refund/_baseSchema";
81
- import * as BaseSettlement from "./Settlement/_baseSchema";
82
81
  import * as BaseSettlePlan from "./SettlePlan/_baseSchema";
82
+ import * as BaseSettlement from "./Settlement/_baseSchema";
83
83
  import * as BaseShip from "./Ship/_baseSchema";
84
84
  import * as BaseShipCompany from "./ShipCompany/_baseSchema";
85
85
  import * as BaseShipOrder from "./ShipOrder/_baseSchema";
@@ -5249,6 +5249,54 @@ export type Refund = {
5249
5249
  Remove: OakOperation<"remove", Refund["RemoveOperationData"], Refund["Filter"], Refund["Sorter"]>;
5250
5250
  Operation: Refund["Create"] | Refund["Update"] | Refund["Remove"];
5251
5251
  };
5252
+ export type SettlePlan = {
5253
+ OpSchema: BaseSettlePlan.OpSchema;
5254
+ Action: BaseSettlePlan.OpAction;
5255
+ Schema: BaseSettlePlan.OpSchema & {
5256
+ order: Order["Schema"];
5257
+ settlement$plan?: Array<Omit<Settlement["Schema"], "plan">>;
5258
+ settlement$plan$$aggr?: AggregationResult<Omit<Settlement["Schema"], "plan">>;
5259
+ };
5260
+ Projection: BaseSettlePlan.OpProjection & {
5261
+ order?: Order["Projection"];
5262
+ settlement$plan?: OakSelection<"select", Omit<Settlement["Projection"], "settlePlan">, Omit<Settlement["Filter"], "settlePlan">, Settlement["Sorter"]> & {
5263
+ $entity: "settlement";
5264
+ };
5265
+ settlement$plan$$aggr?: DeduceAggregation<Omit<Settlement["Projection"], "settlePlan">, Omit<Settlement["Filter"], "settlePlan">, Settlement["Sorter"]> & {
5266
+ $entity: "settlement";
5267
+ };
5268
+ };
5269
+ FilterUnit: BaseSettlePlan.OpFilter & {
5270
+ order: MakeFilter<Order["FilterUnit"]>;
5271
+ settlement$plan: MakeFilter<Omit<Settlement["FilterUnit"], "plan">> & SubQueryPredicateMetadata;
5272
+ };
5273
+ Filter: MakeFilter<SettlePlan["FilterUnit"]>;
5274
+ SortAttr: Partial<BaseSettlePlan.OpSortAttr | {
5275
+ order: Order["SortAttr"];
5276
+ }>;
5277
+ SortNode: {
5278
+ $attr: SettlePlan["SortAttr"];
5279
+ $direction?: "asc" | "desc";
5280
+ };
5281
+ Sorter: SettlePlan["SortNode"][];
5282
+ Selection: OakSelection<"select", SettlePlan["Projection"], SettlePlan["Filter"], SettlePlan["Sorter"]>;
5283
+ Aggregation: DeduceAggregation<SettlePlan["Projection"], SettlePlan["Filter"], SettlePlan["Sorter"]>;
5284
+ CreateOperationData: FormCreateData<BaseSettlePlan.OpSchema & {
5285
+ order?: OakOperation<"create", Order["CreateOperationData"]> | OakOperation<BaseOrder.OpUpdateAction, Order["UpdateOperationData"], Order["Filter"]>;
5286
+ settlement$plan?: (OakOperation<"create", Omit<Settlement["CreateOperationData"], "plan"> | Omit<Settlement["CreateOperationData"], "plan">[]> | OakOperation<BaseSettlement.OpUpdateAction, Omit<Settlement["UpdateOperationData"], "plan">, Settlement["Filter"]>)[];
5287
+ }>;
5288
+ CreateSingle: OakOperation<"create", SettlePlan["CreateOperationData"]>;
5289
+ CreateMulti: OakOperation<"create", Array<SettlePlan["CreateOperationData"]>>;
5290
+ Create: SettlePlan["CreateSingle"] | SettlePlan["CreateMulti"];
5291
+ UpdateOperationData: FormUpdateData<BaseSettlePlan.OpSchema & {
5292
+ order?: OakOperation<"create", Order["CreateOperationData"]> | OakOperation<BaseOrder.OpUpdateAction, Order["UpdateOperationData"], Order["Filter"]> | OakOperation<"remove", Order["RemoveOperationData"], Order["Filter"]>;
5293
+ settlement$plan?: (OakOperation<"create", Omit<Settlement["CreateOperationData"], "plan"> | Omit<Settlement["CreateOperationData"], "plan">[]> | OakOperation<BaseSettlement.OpUpdateAction, Omit<Settlement["UpdateOperationData"], "plan">, Settlement["Filter"]> | OakOperation<"remove", Settlement["RemoveOperationData"], Settlement["Filter"]>)[];
5294
+ }>;
5295
+ Update: OakOperation<BaseSettlePlan.OpUpdateAction, SettlePlan["UpdateOperationData"], SettlePlan["Filter"], SettlePlan["Sorter"]>;
5296
+ RemoveOperationData: {};
5297
+ Remove: OakOperation<"remove", SettlePlan["RemoveOperationData"], SettlePlan["Filter"], SettlePlan["Sorter"]>;
5298
+ Operation: SettlePlan["Create"] | SettlePlan["Update"] | SettlePlan["Remove"];
5299
+ };
5252
5300
  export type Settlement = {
5253
5301
  OpSchema: BaseSettlement.OpSchema;
5254
5302
  Action: BaseSettlement.OpAction;
@@ -5303,54 +5351,6 @@ export type Settlement = {
5303
5351
  Remove: OakOperation<"remove", Settlement["RemoveOperationData"], Settlement["Filter"], Settlement["Sorter"]>;
5304
5352
  Operation: Settlement["Create"] | Settlement["Update"] | Settlement["Remove"];
5305
5353
  };
5306
- export type SettlePlan = {
5307
- OpSchema: BaseSettlePlan.OpSchema;
5308
- Action: BaseSettlePlan.OpAction;
5309
- Schema: BaseSettlePlan.OpSchema & {
5310
- order: Order["Schema"];
5311
- settlement$plan?: Array<Omit<Settlement["Schema"], "plan">>;
5312
- settlement$plan$$aggr?: AggregationResult<Omit<Settlement["Schema"], "plan">>;
5313
- };
5314
- Projection: BaseSettlePlan.OpProjection & {
5315
- order?: Order["Projection"];
5316
- settlement$plan?: OakSelection<"select", Omit<Settlement["Projection"], "settlePlan">, Omit<Settlement["Filter"], "settlePlan">, Settlement["Sorter"]> & {
5317
- $entity: "settlement";
5318
- };
5319
- settlement$plan$$aggr?: DeduceAggregation<Omit<Settlement["Projection"], "settlePlan">, Omit<Settlement["Filter"], "settlePlan">, Settlement["Sorter"]> & {
5320
- $entity: "settlement";
5321
- };
5322
- };
5323
- FilterUnit: BaseSettlePlan.OpFilter & {
5324
- order: MakeFilter<Order["FilterUnit"]>;
5325
- settlement$plan: MakeFilter<Omit<Settlement["FilterUnit"], "plan">> & SubQueryPredicateMetadata;
5326
- };
5327
- Filter: MakeFilter<SettlePlan["FilterUnit"]>;
5328
- SortAttr: Partial<BaseSettlePlan.OpSortAttr | {
5329
- order: Order["SortAttr"];
5330
- }>;
5331
- SortNode: {
5332
- $attr: SettlePlan["SortAttr"];
5333
- $direction?: "asc" | "desc";
5334
- };
5335
- Sorter: SettlePlan["SortNode"][];
5336
- Selection: OakSelection<"select", SettlePlan["Projection"], SettlePlan["Filter"], SettlePlan["Sorter"]>;
5337
- Aggregation: DeduceAggregation<SettlePlan["Projection"], SettlePlan["Filter"], SettlePlan["Sorter"]>;
5338
- CreateOperationData: FormCreateData<BaseSettlePlan.OpSchema & {
5339
- order?: OakOperation<"create", Order["CreateOperationData"]> | OakOperation<BaseOrder.OpUpdateAction, Order["UpdateOperationData"], Order["Filter"]>;
5340
- settlement$plan?: (OakOperation<"create", Omit<Settlement["CreateOperationData"], "plan"> | Omit<Settlement["CreateOperationData"], "plan">[]> | OakOperation<BaseSettlement.OpUpdateAction, Omit<Settlement["UpdateOperationData"], "plan">, Settlement["Filter"]>)[];
5341
- }>;
5342
- CreateSingle: OakOperation<"create", SettlePlan["CreateOperationData"]>;
5343
- CreateMulti: OakOperation<"create", Array<SettlePlan["CreateOperationData"]>>;
5344
- Create: SettlePlan["CreateSingle"] | SettlePlan["CreateMulti"];
5345
- UpdateOperationData: FormUpdateData<BaseSettlePlan.OpSchema & {
5346
- order?: OakOperation<"create", Order["CreateOperationData"]> | OakOperation<BaseOrder.OpUpdateAction, Order["UpdateOperationData"], Order["Filter"]> | OakOperation<"remove", Order["RemoveOperationData"], Order["Filter"]>;
5347
- settlement$plan?: (OakOperation<"create", Omit<Settlement["CreateOperationData"], "plan"> | Omit<Settlement["CreateOperationData"], "plan">[]> | OakOperation<BaseSettlement.OpUpdateAction, Omit<Settlement["UpdateOperationData"], "plan">, Settlement["Filter"]> | OakOperation<"remove", Settlement["RemoveOperationData"], Settlement["Filter"]>)[];
5348
- }>;
5349
- Update: OakOperation<BaseSettlePlan.OpUpdateAction, SettlePlan["UpdateOperationData"], SettlePlan["Filter"], SettlePlan["Sorter"]>;
5350
- RemoveOperationData: {};
5351
- Remove: OakOperation<"remove", SettlePlan["RemoveOperationData"], SettlePlan["Filter"], SettlePlan["Sorter"]>;
5352
- Operation: SettlePlan["Create"] | SettlePlan["Update"] | SettlePlan["Remove"];
5353
- };
5354
5354
  export type Ship = {
5355
5355
  OpSchema: BaseShip.OpSchema;
5356
5356
  Action: BaseShip.OpAction;
@@ -6343,8 +6343,8 @@ export type EntityDict = {
6343
6343
  order: Order;
6344
6344
  pay: Pay;
6345
6345
  refund: Refund;
6346
- settlement: Settlement;
6347
6346
  settlePlan: SettlePlan;
6347
+ settlement: Settlement;
6348
6348
  ship: Ship;
6349
6349
  shipCompany: ShipCompany;
6350
6350
  shipOrder: ShipOrder;
@@ -6,8 +6,10 @@ exports.desc = {
6
6
  attributes: {
7
7
  channel: {
8
8
  notNull: true,
9
- type: "enum",
10
- enumeration: ["wechatPublic", "jPush", "jim", "wechatMp", "sms", "email"]
9
+ type: "varchar",
10
+ params: {
11
+ length: 32
12
+ }
11
13
  },
12
14
  applicationId: {
13
15
  type: "ref",
@@ -12,13 +12,13 @@ exports.style = {
12
12
  success: '#008000',
13
13
  failure: '#9A9A9A',
14
14
  },
15
- channel: {
16
- wechatMp: '#008000',
17
- jPush: '#0000FF',
18
- jim: '#0000FF',
19
- wechatPublic: '#008000',
20
- sms: '#000000',
21
- email: '#000000',
22
- },
15
+ // channel: {
16
+ // wechatMp: '#008000',
17
+ // jPush: '#0000FF',
18
+ // jim: '#0000FF',
19
+ // wechatPublic: '#008000',
20
+ // sms: '#000000',
21
+ // email: '#000000',
22
+ // },
23
23
  }
24
24
  };
@@ -2,10 +2,9 @@ import { ForeignKey } from "oak-domain/lib/types/DataType";
2
2
  import { Q_DateValue, Q_NumberValue, Q_StringValue, Q_EnumValue, NodeId, ExprOp, ExpressionKey } from "oak-domain/lib/types/Demand";
3
3
  import { MakeAction as OakMakeAction, EntityShape } from "oak-domain/lib/types/Entity";
4
4
  import { Action, ParticularAction, IState } from "./Action";
5
- import { Channel } from "oak-general-business/lib/types/Message";
6
5
  import { String } from "oak-domain/lib/types/DataType";
7
6
  export type OpSchema = EntityShape & {
8
- channel: Channel;
7
+ channel: String<32>;
9
8
  applicationId?: ForeignKey<"application"> | null;
10
9
  data?: Object | null;
11
10
  messageSystemId: ForeignKey<"messageSystem">;
@@ -22,7 +21,7 @@ export type OpFilter = {
22
21
  $$createAt$$: Q_DateValue;
23
22
  $$seq$$: Q_NumberValue;
24
23
  $$updateAt$$: Q_DateValue;
25
- channel: Q_EnumValue<Channel>;
24
+ channel: Q_StringValue;
26
25
  applicationId: Q_StringValue;
27
26
  data: Object;
28
27
  messageSystemId: Q_StringValue;
@@ -19,14 +19,6 @@
19
19
  "sending": "发送中",
20
20
  "success": "发送成功",
21
21
  "failure": "发送失败"
22
- },
23
- "channel": {
24
- "wechatPublic": "公众号",
25
- "jPush": "极光推送",
26
- "jim": "极光消息",
27
- "wechatMp": "小程序",
28
- "sms": "短信",
29
- "email": "邮箱"
30
22
  }
31
23
  }
32
24
  }
@@ -22,7 +22,8 @@ exports.desc = {
22
22
  type: "ref",
23
23
  ref: "platform"
24
24
  },
25
- folder: {
25
+ folder // 提现的loss在用户提现时计算
26
+ : {
26
27
  type: "varchar",
27
28
  params: {
28
29
  length: 16
@@ -3,8 +3,8 @@ import { Q_DateValue, Q_BooleanValue, Q_NumberValue, Q_StringValue, NodeId, Expr
3
3
  import { MakeAction as OakMakeAction, EntityShape } from "oak-domain/lib/types/Entity";
4
4
  import { GenericAction } from "oak-domain/lib/actions/action";
5
5
  import { String, Text, Boolean } from "oak-domain/lib/types/DataType";
6
- import { Config } from "oak-general-business/lib/types/Config";
7
- import { Style } from "oak-general-business/lib/types/Style";
6
+ import { Config } from "../../../../oak-general-business/lib/types/Config";
7
+ import { Style } from "../../../../oak-general-business/lib/types/Style";
8
8
  type PayConfig = {
9
9
  withdrawLoss: {
10
10
  conservative: boolean;
@@ -62,7 +62,7 @@ exports.desc = {
62
62
  qrCodeType: {
63
63
  notNull: true,
64
64
  type: "enum",
65
- enumeration: ["wechatPublic", "wechatMpDomainUrl", "wechatMpWxaCode", "wechatPublicForMp", "webForWechatPublic"]
65
+ enumeration: ["wechatMpDomainUrl", "wechatMpWxaCode", "wechatPublic", "wechatPublicForMp", "webForWechatPublic"]
66
66
  },
67
67
  expiresAt: {
68
68
  type: "datetime"
@@ -23,7 +23,7 @@ exports.desc = {
23
23
  qrCodeType: {
24
24
  notNull: true,
25
25
  type: "enum",
26
- enumeration: ["wechatPublic", "wechatMpDomainUrl", "wechatMpWxaCode", "wechatPublicForMp", "webForWechatPublic"]
26
+ enumeration: ["wechatMpDomainUrl", "wechatMpWxaCode", "wechatPublic", "wechatPublicForMp", "webForWechatPublic"]
27
27
  },
28
28
  expiresAt: {
29
29
  type: "datetime"
@@ -22,7 +22,7 @@ exports.desc = {
22
22
  type: {
23
23
  notNull: true,
24
24
  type: "enum",
25
- enumeration: ["wechatPublic", "wechatMpDomainUrl", "wechatMpWxaCode", "wechatPublicForMp", "webForWechatPublic"]
25
+ enumeration: ["wechatMpDomainUrl", "wechatMpWxaCode", "wechatPublic", "wechatPublicForMp", "webForWechatPublic"]
26
26
  },
27
27
  allowShare: {
28
28
  notNull: true,
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.updateWithdrawState = void 0;
3
+ exports.updateWithdrawState = updateWithdrawState;
4
4
  const tslib_1 = require("tslib");
5
5
  const uuid_1 = require("oak-domain/lib/utils/uuid");
6
6
  const assert_1 = tslib_1.__importDefault(require("assert"));
@@ -98,7 +98,6 @@ async function updateWithdrawState(context, id) {
98
98
  }, {});
99
99
  return 1;
100
100
  }
101
- exports.updateWithdrawState = updateWithdrawState;
102
101
  const triggers = [
103
102
  {
104
103
  name: '当withdraw创建时,如果是走退款渠道,则创建出相应的refunds,同时更改account中的数值',
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = makeException;
3
4
  const Exception_1 = require("oak-domain/lib/types/Exception");
4
5
  const oak_general_business_1 = require("oak-general-business");
5
6
  function makeException(data) {
6
7
  const e = (0, Exception_1.makeException)(data) || (0, oak_general_business_1.makeException)(data);
7
8
  return e;
8
9
  }
9
- exports.default = makeException;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getAppTypeFromProductType = void 0;
3
+ exports.getAppTypeFromProductType = getAppTypeFromProductType;
4
4
  function getAppTypeFromProductType(type) {
5
5
  switch (type) {
6
6
  case 'app': {
@@ -26,4 +26,3 @@ function getAppTypeFromProductType(type) {
26
26
  }
27
27
  }
28
28
  }
29
- exports.getAppTypeFromProductType = getAppTypeFromProductType;
@@ -1,12 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.mergedProjection = exports.applicationProjection = exports.registerApplicationProjection = void 0;
3
+ exports.mergedProjection = exports.applicationProjection = void 0;
4
+ exports.registerApplicationProjection = registerApplicationProjection;
4
5
  const Projection_1 = require("oak-general-business/lib/types/Projection");
5
6
  const lodash_1 = require("oak-domain/lib/utils/lodash");
6
7
  function registerApplicationProjection(projection) {
7
8
  (0, lodash_1.merge)(exports.applicationProjection, projection);
8
9
  }
9
- exports.registerApplicationProjection = registerApplicationProjection;
10
10
  exports.applicationProjection = {
11
11
  wpProduct$application: {
12
12
  $entity: 'wpProduct',
package/lib/utils/pay.js CHANGED
@@ -1,6 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.refreshPayState = exports.refundNotify = exports.payNotify = exports.fullPayProjection = void 0;
3
+ exports.fullPayProjection = void 0;
4
+ exports.payNotify = payNotify;
5
+ exports.refundNotify = refundNotify;
6
+ exports.refreshPayState = refreshPayState;
4
7
  const tslib_1 = require("tslib");
5
8
  const payClazz_1 = require("./payClazz");
6
9
  const assert_1 = tslib_1.__importDefault(require("assert"));
@@ -90,7 +93,6 @@ async function payNotify(context, body, payId, headers) {
90
93
  }
91
94
  return;
92
95
  }
93
- exports.payNotify = payNotify;
94
96
  async function refundNotify(context, body, refundId, headers) {
95
97
  const [refund] = await context.select('refund', {
96
98
  data: {
@@ -143,7 +145,6 @@ async function refundNotify(context, body, refundId, headers) {
143
145
  }, {});
144
146
  }
145
147
  }
146
- exports.refundNotify = refundNotify;
147
148
  /**
148
149
  * 刷新paying状态的pay的真实支付状态
149
150
  * @param pay
@@ -213,4 +214,3 @@ async function refreshPayState(pay, context) {
213
214
  }, {});
214
215
  }
215
216
  }
216
- exports.refreshPayState = refreshPayState;
@@ -1,13 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.registerGetPayStateResult = void 0;
3
+ exports.registerGetPayStateResult = registerGetPayStateResult;
4
4
  const tslib_1 = require("tslib");
5
5
  const assert_1 = tslib_1.__importDefault(require("assert"));
6
6
  let _PAY_STATE = '';
7
7
  function registerGetPayStateResult(payState) {
8
8
  _PAY_STATE = payState;
9
9
  }
10
- exports.registerGetPayStateResult = registerGetPayStateResult;
11
10
  class AliPay {
12
11
  apProduct;
13
12
  constructor(apProduct) {
@@ -276,6 +276,12 @@ class AliPay extends AliPay_debug_1.default {
276
276
  async close(pay) {
277
277
  const outTradeNo = (0, uuid_1.compressTo32)(pay.id);
278
278
  try {
279
+ const [iState, updateData] = await this.getState(pay);
280
+ // 电脑网站支付时 设置超时后,支付宝交易订单会出现超时关闭 需查询当前的状态
281
+ // 如果支付宝查询接口返回状态为closed,则订单已关闭,不需要执行关闭接口
282
+ if (iState === 'closed') {
283
+ return;
284
+ }
279
285
  const result = await this.alipaySdk.curl('POST', '/v3/alipay/trade/close', {
280
286
  body: {
281
287
  out_trade_no: outTradeNo,
@@ -1,13 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.registerGetPayStateResult = void 0;
3
+ exports.registerGetPayStateResult = registerGetPayStateResult;
4
4
  const tslib_1 = require("tslib");
5
5
  const assert_1 = tslib_1.__importDefault(require("assert"));
6
6
  let _PAY_STATE = '';
7
7
  function registerGetPayStateResult(payState) {
8
8
  _PAY_STATE = payState;
9
9
  }
10
- exports.registerGetPayStateResult = registerGetPayStateResult;
11
10
  class WechatPay {
12
11
  wpProduct;
13
12
  constructor(wpProduct) {
@@ -86,7 +86,7 @@ const PayClazzEntityDict = {
86
86
  switch (type) {
87
87
  case 'web': {
88
88
  const { wechatPay } = config;
89
- (0, assert_1.default)(wechatPay);
89
+ (0, assert_1.default)(wechatPay, 'web类型的application未配置wechatPay');
90
90
  const appId = wechatPay.appId;
91
91
  return new WechatPay_1.default(wpProduct, appId);
92
92
  }
package/lib/utils/ship.js CHANGED
@@ -1,12 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.shipProjection = void 0;
4
- exports.maskPhone = maskPhone;
5
- exports.uploadShippingInfo = uploadShippingInfo;
6
- exports.getOrderShipState = getOrderShipState;
7
- exports.refreshMpOrderShipState = refreshMpOrderShipState;
8
- exports.refreshShipState = refreshShipState;
9
- exports.notifyConfirmReceive = notifyConfirmReceive;
3
+ exports.notifyConfirmReceive = exports.refreshShipState = exports.refreshMpOrderShipState = exports.getOrderShipState = exports.uploadShippingInfo = exports.maskPhone = exports.shipProjection = void 0;
10
4
  const oak_app_domain_1 = require("../oak-app-domain");
11
5
  const oak_external_sdk_1 = require("oak-external-sdk");
12
6
  const assert_1 = require("oak-domain/lib/utils/assert");
@@ -138,6 +132,7 @@ function maskPhone(phone) {
138
132
  const end = phone.slice(-4);
139
133
  return start + '****' + end;
140
134
  }
135
+ exports.maskPhone = maskPhone;
141
136
  /**
142
137
  * 小程序发货信息录入
143
138
  * @param shipInfo
@@ -258,6 +253,7 @@ async function uploadShippingInfo(shipId, context) {
258
253
  }
259
254
  }
260
255
  }
256
+ exports.uploadShippingInfo = uploadShippingInfo;
261
257
  /**
262
258
  * 获取小程序订单状态
263
259
  * @param context
@@ -338,6 +334,7 @@ async function getOrderShipState(context, shipId) {
338
334
  }
339
335
  }
340
336
  }
337
+ exports.getOrderShipState = getOrderShipState;
341
338
  /**
342
339
  * 刷新小程序订单状态(自动确认收货)
343
340
  * @param context
@@ -382,6 +379,7 @@ async function refreshMpOrderShipState(shipId, context) {
382
379
  }
383
380
  }
384
381
  }
382
+ exports.refreshMpOrderShipState = refreshMpOrderShipState;
385
383
  /**
386
384
  * 刷新ship的物流状态
387
385
  * @param ship
@@ -452,6 +450,7 @@ async function refreshShipState(shipId, context) {
452
450
  }
453
451
  }
454
452
  }
453
+ exports.refreshShipState = refreshShipState;
455
454
  /**
456
455
  * 小程序确认收货提醒
457
456
  */
@@ -518,3 +517,4 @@ async function notifyConfirmReceive(shipId, context) {
518
517
  }
519
518
  }
520
519
  }
520
+ exports.notifyConfirmReceive = notifyConfirmReceive;
@@ -1,6 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getShipEntity = exports.getShipClazz = exports.registerShipClazzEntity = void 0;
3
+ exports.registerShipClazzEntity = registerShipClazzEntity;
4
+ exports.getShipClazz = getShipClazz;
5
+ exports.getShipEntity = getShipEntity;
4
6
  const tslib_1 = require("tslib");
5
7
  const assert_1 = tslib_1.__importDefault(require("assert"));
6
8
  let MODULE_USED = false;
@@ -15,7 +17,6 @@ function registerShipClazzEntity(entity, clazzConstructor, schema) {
15
17
  (0, assert_1.default)(attributes.disabled && attributes.disabled.type === 'boolean');
16
18
  ShipClazzEntityDict[entity] = clazzConstructor;
17
19
  }
18
- exports.registerShipClazzEntity = registerShipClazzEntity;
19
20
  async function getShipClazz(entity, entityId, context) {
20
21
  if (!MODULE_USED) {
21
22
  MODULE_USED = true;
@@ -28,7 +29,6 @@ async function getShipClazz(entity, entityId, context) {
28
29
  ShipClazzDict[key] = clazz;
29
30
  return clazz;
30
31
  }
31
- exports.getShipClazz = getShipClazz;
32
32
  /**
33
33
  * 创建ship时,根据系统物流的配置去对接对应的物流系统
34
34
  * @param shipId
@@ -82,4 +82,3 @@ async function getShipEntity(shipServiceId, orderIds, context) {
82
82
  return [entity, entityId];
83
83
  }
84
84
  }
85
- exports.getShipEntity = getShipEntity;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getAppTypeFromProductType = void 0;
3
+ exports.getAppTypeFromProductType = getAppTypeFromProductType;
4
4
  function getAppTypeFromProductType(type) {
5
5
  switch (type) {
6
6
  case 'app': {
@@ -20,4 +20,3 @@ function getAppTypeFromProductType(type) {
20
20
  }
21
21
  }
22
22
  }
23
- exports.getAppTypeFromProductType = getAppTypeFromProductType;
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.canStartPay = exports.getWpProductTypeFromEnv = void 0;
3
+ exports.getWpProductTypeFromEnv = getWpProductTypeFromEnv;
4
+ exports.canStartPay = canStartPay;
4
5
  const utils_1 = require("oak-frontend-base/es/utils/utils");
5
6
  function getWpProductTypeFromEnv() {
6
7
  switch (process.env.OAK_PLATFORM) {
@@ -23,7 +24,6 @@ function getWpProductTypeFromEnv() {
23
24
  }
24
25
  return [];
25
26
  }
26
- exports.getWpProductTypeFromEnv = getWpProductTypeFromEnv;
27
27
  function canStartPay(pay, features) {
28
28
  const { applicationId, wpProduct } = pay;
29
29
  if (features.application.getApplicationId() !== applicationId) {
@@ -32,4 +32,3 @@ function canStartPay(pay, features) {
32
32
  const types = getWpProductTypeFromEnv();
33
33
  return types.includes(wpProduct.type) && wpProduct.type !== 'native';
34
34
  }
35
- exports.canStartPay = canStartPay;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oak-pay-business",
3
- "version": "3.4.1",
3
+ "version": "3.4.3",
4
4
  "description": "",
5
5
  "files": [
6
6
  "lib/**/*",
@@ -31,10 +31,10 @@
31
31
  "alipay-sdk": "^4.14.0",
32
32
  "classnames": "^2.3.1",
33
33
  "dayjs": "^1.11.5",
34
- "oak-domain": "^5.1.29",
34
+ "oak-domain": "^5.1.32",
35
35
  "oak-external-sdk": "^2.3.11",
36
- "oak-frontend-base": "^5.3.40",
37
- "oak-general-business": "~5.10.1",
36
+ "oak-frontend-base": "^5.3.43",
37
+ "oak-general-business": "~5.10.8",
38
38
  "react-markdown": "^9.0.3",
39
39
  "wechat-pay-nodejs": "^0.2.3"
40
40
  },