oak-pay-business 3.1.5 → 3.3.1

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 (50) hide show
  1. package/es/components/order/pay/index.js +3 -3
  2. package/es/components/sysAccount/survey/index.js +1 -1
  3. package/es/entities/ApAccount.js +1 -1
  4. package/es/oak-app-domain/ActionAuth/Storage.js +0 -1
  5. package/es/oak-app-domain/Application/_baseSchema.d.ts +0 -5
  6. package/es/oak-app-domain/ArticleMenu/Storage.js +3 -0
  7. package/es/oak-app-domain/ArticleMenu/_baseSchema.d.ts +5 -1
  8. package/es/oak-app-domain/ArticleMenu/locales/zh_CN.json +2 -1
  9. package/es/oak-app-domain/ChangePasswordTemp/Storage.js +6 -0
  10. package/es/oak-app-domain/ChangePasswordTemp/_baseSchema.d.ts +9 -1
  11. package/es/oak-app-domain/ChangePasswordTemp/locales/zh_CN.json +2 -0
  12. package/es/oak-app-domain/EntityDict.d.ts +18 -2
  13. package/es/oak-app-domain/ExtraFile/Storage.js +1 -1
  14. package/es/oak-app-domain/ExtraFile/Style.js +1 -0
  15. package/es/oak-app-domain/ExtraFile/_baseSchema.d.ts +2 -2
  16. package/es/oak-app-domain/ExtraFile/locales/zh_CN.json +2 -1
  17. package/es/oak-app-domain/I18n/Storage.js +0 -1
  18. package/es/oak-app-domain/Passport/_baseSchema.d.ts +11 -3
  19. package/es/oak-app-domain/Path/Storage.js +0 -2
  20. package/es/oak-app-domain/Path/_baseSchema.d.ts +1 -1
  21. package/es/oak-app-domain/RelationAuth/Storage.js +0 -1
  22. package/es/oak-app-domain/System/Storage.js +1 -2
  23. package/es/triggers/refund.js +69 -63
  24. package/es/utils/payClazz/AliPay/AliPay.js +4 -4
  25. package/es/utils/shipClazz/WechatMpShip/WechatMpShip.debug.js +3 -3
  26. package/lib/entities/ApAccount.js +1 -1
  27. package/lib/oak-app-domain/ActionAuth/Storage.js +0 -1
  28. package/lib/oak-app-domain/Application/_baseSchema.d.ts +0 -5
  29. package/lib/oak-app-domain/ArticleMenu/Storage.js +3 -0
  30. package/lib/oak-app-domain/ArticleMenu/_baseSchema.d.ts +5 -1
  31. package/lib/oak-app-domain/ArticleMenu/locales/zh_CN.json +2 -1
  32. package/lib/oak-app-domain/ChangePasswordTemp/Storage.js +6 -0
  33. package/lib/oak-app-domain/ChangePasswordTemp/_baseSchema.d.ts +9 -1
  34. package/lib/oak-app-domain/ChangePasswordTemp/locales/zh_CN.json +2 -0
  35. package/lib/oak-app-domain/EntityDict.d.ts +18 -2
  36. package/lib/oak-app-domain/ExtraFile/Storage.js +1 -1
  37. package/lib/oak-app-domain/ExtraFile/Style.js +1 -0
  38. package/lib/oak-app-domain/ExtraFile/_baseSchema.d.ts +2 -2
  39. package/lib/oak-app-domain/ExtraFile/locales/zh_CN.json +2 -1
  40. package/lib/oak-app-domain/I18n/Storage.js +0 -1
  41. package/lib/oak-app-domain/Passport/_baseSchema.d.ts +11 -3
  42. package/lib/oak-app-domain/Path/Storage.js +0 -2
  43. package/lib/oak-app-domain/Path/_baseSchema.d.ts +1 -1
  44. package/lib/oak-app-domain/RelationAuth/Storage.js +0 -1
  45. package/lib/oak-app-domain/System/Storage.js +1 -2
  46. package/lib/triggers/refund.js +69 -63
  47. package/lib/triggers/withdraw.d.ts +1 -1
  48. package/lib/utils/payClazz/AliPay/AliPay.js +4 -4
  49. package/lib/utils/shipClazz/WechatMpShip/WechatMpShip.debug.js +3 -3
  50. package/package.json +5 -5
@@ -24,10 +24,10 @@ export default OakComponent({
24
24
  },
25
25
  isList: false,
26
26
  properties: {
27
- accountId: '',
28
- accountAvailMax: 0,
27
+ accountId: '', // 是否可以使用帐户中的余额抵扣
28
+ accountAvailMax: 0, // 本次交易可以使用的帐户中的Avail max值,调用者自己保证此数值的一致性,不要扣成负数
29
29
  onSetPays: (pays) => undefined,
30
- accountTips: '',
30
+ accountTips: '', // 使用余额支付的提示说明
31
31
  autoStartPay: false,
32
32
  },
33
33
  formData({ data }) {
@@ -156,7 +156,7 @@ export default OakComponent({
156
156
  },
157
157
  },
158
158
  filter: {
159
- settled: 0,
159
+ settled: 0, //todo 部分settle的order是否需要统计在内
160
160
  price: {
161
161
  $gt: 0,
162
162
  },
@@ -30,7 +30,7 @@ export const entityDesc = {
30
30
  keyType: '指定应用私钥类型',
31
31
  gateway: "支付宝网关地址",
32
32
  wsServiceUrl: 'websocket服务地址',
33
- timeout: "网关超时时间",
33
+ timeout: "网关超时时间", //(单位毫秒),默认值是 5000
34
34
  needEncrypt: "是否需要AES加解密",
35
35
  encryptKey: 'AES密钥', //调用AES加解密相关接口时需要
36
36
  },
@@ -15,7 +15,6 @@ export const desc = {
15
15
  type: "object"
16
16
  }
17
17
  },
18
- static: true,
19
18
  actionType: "crud",
20
19
  actions,
21
20
  indexes: [
@@ -4,7 +4,6 @@ import { MakeAction as OakMakeAction, EntityShape } from "oak-domain/lib/types/E
4
4
  import { GenericAction } from "oak-domain/lib/actions/action";
5
5
  import { String, Text } from "oak-domain/lib/types/DataType";
6
6
  import { Style } from "oak-general-business/lib/types/Style";
7
- export type Passport = "email" | "mobile" | "wechat" | "wechatPublic" | "wechatNative";
8
7
  export type AppType = "web" | "wechatMp" | "wechatPublic" | "native";
9
8
  export type WechatMpConfig = {
10
9
  type: "wechatMp";
@@ -19,7 +18,6 @@ export type WechatMpConfig = {
19
18
  mode: "clear" | "compatible" | "safe";
20
19
  dataFormat: "json" | "xml";
21
20
  };
22
- passport?: Passport[];
23
21
  };
24
22
  export type WebConfig = {
25
23
  type: "web";
@@ -33,7 +31,6 @@ export type WebConfig = {
33
31
  appId: string;
34
32
  appSecret: string;
35
33
  };
36
- passport?: Passport[];
37
34
  location: {
38
35
  protocol: "http:" | "https:";
39
36
  hostname: string;
@@ -56,7 +53,6 @@ export type WechatPublicConfig = {
56
53
  appId: string;
57
54
  originalId: string;
58
55
  };
59
- passport?: Passport[];
60
56
  location: {
61
57
  protocol: "http:" | "https:";
62
58
  hostname: string;
@@ -65,7 +61,6 @@ export type WechatPublicConfig = {
65
61
  };
66
62
  export type NativeConfig = {
67
63
  type: "native";
68
- passport?: Passport[];
69
64
  wechatNative?: {
70
65
  appId: string;
71
66
  appSecret: string;
@@ -32,6 +32,9 @@ export const desc = {
32
32
  params: {
33
33
  length: 64
34
34
  }
35
+ },
36
+ latestAt: {
37
+ type: "datetime"
35
38
  }
36
39
  },
37
40
  actionType: "crud",
@@ -2,7 +2,7 @@ import { ForeignKey } from "oak-domain/lib/types/DataType";
2
2
  import { Q_DateValue, Q_BooleanValue, Q_NumberValue, Q_StringValue, 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 { GenericAction } from "oak-domain/lib/actions/action";
5
- import { String, Boolean } from "oak-domain/lib/types/DataType";
5
+ import { String, Boolean, Datetime } from "oak-domain/lib/types/DataType";
6
6
  export type OpSchema = EntityShape & {
7
7
  name: String<32>;
8
8
  isArticle: Boolean;
@@ -10,6 +10,7 @@ export type OpSchema = EntityShape & {
10
10
  isLeaf?: Boolean | null;
11
11
  entity: String<32>;
12
12
  entityId: String<64>;
13
+ latestAt?: Datetime | null;
13
14
  } & {
14
15
  [A in ExpressionKey]?: any;
15
16
  };
@@ -25,6 +26,7 @@ export type OpFilter = {
25
26
  isLeaf: Q_BooleanValue;
26
27
  entity: Q_StringValue;
27
28
  entityId: Q_StringValue;
29
+ latestAt: Q_DateValue;
28
30
  } & ExprOp<OpAttr | string>;
29
31
  export type OpProjection = {
30
32
  "#id"?: NodeId;
@@ -39,6 +41,7 @@ export type OpProjection = {
39
41
  isLeaf?: number;
40
42
  entity?: number;
41
43
  entityId?: number;
44
+ latestAt?: number;
42
45
  } & Partial<ExprOp<OpAttr | string>>;
43
46
  export type OpSortAttr = Partial<{
44
47
  id: number;
@@ -51,6 +54,7 @@ export type OpSortAttr = Partial<{
51
54
  isLeaf: number;
52
55
  entity: number;
53
56
  entityId: number;
57
+ latestAt: number;
54
58
  [k: string]: any;
55
59
  } | ExprOp<OpAttr | string>>;
56
60
  export type OpAction = OakMakeAction<GenericAction | string>;
@@ -7,6 +7,7 @@
7
7
  "entity": "对象",
8
8
  "entityId": "对象Id",
9
9
  "isLeaf": "结点下是否存在叶子结点",
10
- "files": "文件"
10
+ "files": "文件",
11
+ "latestAt": "最近编辑"
11
12
  }
12
13
  }
@@ -18,6 +18,12 @@ export const desc = {
18
18
  length: 32
19
19
  }
20
20
  },
21
+ prevPasswordSha1: {
22
+ type: "text"
23
+ },
24
+ newPasswordSha1: {
25
+ type: "text"
26
+ },
21
27
  result: {
22
28
  notNull: true,
23
29
  type: "enum",
@@ -2,11 +2,13 @@ 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 { GenericAction } from "oak-domain/lib/actions/action";
5
- import { String } from "oak-domain/lib/types/DataType";
5
+ import { String, Text } from "oak-domain/lib/types/DataType";
6
6
  export type OpSchema = EntityShape & {
7
7
  userId: ForeignKey<"user">;
8
8
  prevPassword?: String<32> | null;
9
9
  newPassword?: String<32> | null;
10
+ prevPasswordSha1?: Text | null;
11
+ newPasswordSha1?: Text | null;
10
12
  result: "success" | "fail";
11
13
  } & {
12
14
  [A in ExpressionKey]?: any;
@@ -20,6 +22,8 @@ export type OpFilter = {
20
22
  userId: Q_StringValue;
21
23
  prevPassword: Q_StringValue;
22
24
  newPassword: Q_StringValue;
25
+ prevPasswordSha1: Q_StringValue;
26
+ newPasswordSha1: Q_StringValue;
23
27
  result: Q_EnumValue<"success" | "fail">;
24
28
  } & ExprOp<OpAttr | string>;
25
29
  export type OpProjection = {
@@ -32,6 +36,8 @@ export type OpProjection = {
32
36
  userId?: number;
33
37
  prevPassword?: number;
34
38
  newPassword?: number;
39
+ prevPasswordSha1?: number;
40
+ newPasswordSha1?: number;
35
41
  result?: number;
36
42
  } & Partial<ExprOp<OpAttr | string>>;
37
43
  export type OpSortAttr = Partial<{
@@ -42,6 +48,8 @@ export type OpSortAttr = Partial<{
42
48
  userId: number;
43
49
  prevPassword: number;
44
50
  newPassword: number;
51
+ prevPasswordSha1: number;
52
+ newPasswordSha1: number;
45
53
  result: number;
46
54
  [k: string]: any;
47
55
  } | ExprOp<OpAttr | string>>;
@@ -4,6 +4,8 @@
4
4
  "user": "用户",
5
5
  "prevPassword": "原密码",
6
6
  "newPassword": "新密码",
7
+ "prevPasswordSha1": "原sha1加密密码",
8
+ "newPasswordSha1": "新sha1加密密码",
7
9
  "result": "修改结果"
8
10
  },
9
11
  "v": {
@@ -117,12 +117,14 @@ export type ActionAuth = {
117
117
  Aggregation: DeduceAggregation<ActionAuth["Projection"], ActionAuth["Filter"], ActionAuth["Sorter"]>;
118
118
  CreateOperationData: FormCreateData<BaseActionAuth.OpSchema & {
119
119
  relation?: OakOperation<"create", Relation["CreateOperationData"]> | OakOperation<BaseRelation.OpUpdateAction, Relation["UpdateOperationData"], Relation["Filter"]>;
120
+ path?: OakOperation<"create", Path["CreateOperationData"]> | OakOperation<BasePath.OpUpdateAction, Path["UpdateOperationData"], Path["Filter"]>;
120
121
  }>;
121
122
  CreateSingle: OakOperation<"create", ActionAuth["CreateOperationData"]>;
122
123
  CreateMulti: OakOperation<"create", Array<ActionAuth["CreateOperationData"]>>;
123
124
  Create: ActionAuth["CreateSingle"] | ActionAuth["CreateMulti"];
124
125
  UpdateOperationData: FormUpdateData<BaseActionAuth.OpSchema & {
125
126
  relation?: OakOperation<"create", Relation["CreateOperationData"]> | OakOperation<BaseRelation.OpUpdateAction, Relation["UpdateOperationData"], Relation["Filter"]> | OakOperation<"remove", Relation["RemoveOperationData"], Relation["Filter"]>;
127
+ path?: OakOperation<"create", Path["CreateOperationData"]> | OakOperation<BasePath.OpUpdateAction, Path["UpdateOperationData"], Path["Filter"]> | OakOperation<"remove", Path["RemoveOperationData"], Path["Filter"]>;
126
128
  }>;
127
129
  Update: OakOperation<BaseActionAuth.OpUpdateAction, ActionAuth["UpdateOperationData"], ActionAuth["Filter"], ActionAuth["Sorter"]>;
128
130
  RemoveOperationData: {};
@@ -400,11 +402,17 @@ export type Path = {
400
402
  Sorter: Path["SortNode"][];
401
403
  Selection: OakSelection<"select", Path["Projection"], Path["Filter"], Path["Sorter"]>;
402
404
  Aggregation: DeduceAggregation<Path["Projection"], Path["Filter"], Path["Sorter"]>;
403
- CreateOperationData: FormCreateData<BasePath.OpSchema>;
405
+ CreateOperationData: FormCreateData<BasePath.OpSchema & {
406
+ actionAuth$path?: (OakOperation<"create", Omit<ActionAuth["CreateOperationData"], "path"> | Omit<ActionAuth["CreateOperationData"], "path">[]> | OakOperation<BaseActionAuth.OpUpdateAction, Omit<ActionAuth["UpdateOperationData"], "path">, ActionAuth["Filter"]>)[];
407
+ relationAuth$path?: (OakOperation<"create", Omit<RelationAuth["CreateOperationData"], "path"> | Omit<RelationAuth["CreateOperationData"], "path">[]> | OakOperation<BaseRelationAuth.OpUpdateAction, Omit<RelationAuth["UpdateOperationData"], "path">, RelationAuth["Filter"]>)[];
408
+ }>;
404
409
  CreateSingle: OakOperation<"create", Path["CreateOperationData"]>;
405
410
  CreateMulti: OakOperation<"create", Array<Path["CreateOperationData"]>>;
406
411
  Create: Path["CreateSingle"] | Path["CreateMulti"];
407
- UpdateOperationData: FormUpdateData<BasePath.OpSchema>;
412
+ UpdateOperationData: FormUpdateData<BasePath.OpSchema & {
413
+ actionAuth$path?: (OakOperation<"create", Omit<ActionAuth["CreateOperationData"], "path"> | Omit<ActionAuth["CreateOperationData"], "path">[]> | OakOperation<BaseActionAuth.OpUpdateAction, Omit<ActionAuth["UpdateOperationData"], "path">, ActionAuth["Filter"]> | OakOperation<"remove", ActionAuth["RemoveOperationData"], ActionAuth["Filter"]>)[];
414
+ relationAuth$path?: (OakOperation<"create", Omit<RelationAuth["CreateOperationData"], "path"> | Omit<RelationAuth["CreateOperationData"], "path">[]> | OakOperation<BaseRelationAuth.OpUpdateAction, Omit<RelationAuth["UpdateOperationData"], "path">, RelationAuth["Filter"]> | OakOperation<"remove", RelationAuth["RemoveOperationData"], RelationAuth["Filter"]>)[];
415
+ }>;
408
416
  Update: OakOperation<BasePath.OpUpdateAction, Path["UpdateOperationData"], Path["Filter"], Path["Sorter"]>;
409
417
  RemoveOperationData: {};
410
418
  Remove: OakOperation<"remove", Path["RemoveOperationData"], Path["Filter"], Path["Sorter"]>;
@@ -490,6 +498,9 @@ export type Relation = {
490
498
  platform?: OakOperation<"create", Platform["CreateOperationData"]> | OakOperation<BasePlatform.OpUpdateAction, Platform["UpdateOperationData"], Platform["Filter"]>;
491
499
  session?: OakOperation<"create", Session["CreateOperationData"]> | OakOperation<BaseSession.OpUpdateAction, Session["UpdateOperationData"], Session["Filter"]>;
492
500
  toDo?: OakOperation<"create", ToDo["CreateOperationData"]> | OakOperation<BaseToDo.OpUpdateAction, ToDo["UpdateOperationData"], ToDo["Filter"]>;
501
+ actionAuth$relation?: (OakOperation<"create", Omit<ActionAuth["CreateOperationData"], "relation"> | Omit<ActionAuth["CreateOperationData"], "relation">[]> | OakOperation<BaseActionAuth.OpUpdateAction, Omit<ActionAuth["UpdateOperationData"], "relation">, ActionAuth["Filter"]>)[];
502
+ relationAuth$sourceRelation?: (OakOperation<"create", Omit<RelationAuth["CreateOperationData"], "sourceRelation"> | Omit<RelationAuth["CreateOperationData"], "sourceRelation">[]> | OakOperation<BaseRelationAuth.OpUpdateAction, Omit<RelationAuth["UpdateOperationData"], "sourceRelation">, RelationAuth["Filter"]>)[];
503
+ relationAuth$destRelation?: (OakOperation<"create", Omit<RelationAuth["CreateOperationData"], "destRelation"> | Omit<RelationAuth["CreateOperationData"], "destRelation">[]> | OakOperation<BaseRelationAuth.OpUpdateAction, Omit<RelationAuth["UpdateOperationData"], "destRelation">, RelationAuth["Filter"]>)[];
493
504
  userEntityClaim$relation?: (OakOperation<"create", Omit<UserEntityClaim["CreateOperationData"], "relation"> | Omit<UserEntityClaim["CreateOperationData"], "relation">[]> | OakOperation<BaseUserEntityClaim.OpUpdateAction, Omit<UserEntityClaim["UpdateOperationData"], "relation">, UserEntityClaim["Filter"]>)[];
494
505
  userRelation$relation?: (OakOperation<"create", Omit<UserRelation["CreateOperationData"], "relation"> | Omit<UserRelation["CreateOperationData"], "relation">[]> | OakOperation<BaseUserRelation.OpUpdateAction, Omit<UserRelation["UpdateOperationData"], "relation">, UserRelation["Filter"]>)[];
495
506
  }>;
@@ -500,6 +511,9 @@ export type Relation = {
500
511
  platform?: OakOperation<"create", Platform["CreateOperationData"]> | OakOperation<BasePlatform.OpUpdateAction, Platform["UpdateOperationData"], Platform["Filter"]> | OakOperation<"remove", Platform["RemoveOperationData"], Platform["Filter"]>;
501
512
  session?: OakOperation<"create", Session["CreateOperationData"]> | OakOperation<BaseSession.OpUpdateAction, Session["UpdateOperationData"], Session["Filter"]> | OakOperation<"remove", Session["RemoveOperationData"], Session["Filter"]>;
502
513
  toDo?: OakOperation<"create", ToDo["CreateOperationData"]> | OakOperation<BaseToDo.OpUpdateAction, ToDo["UpdateOperationData"], ToDo["Filter"]> | OakOperation<"remove", ToDo["RemoveOperationData"], ToDo["Filter"]>;
514
+ actionAuth$relation?: (OakOperation<"create", Omit<ActionAuth["CreateOperationData"], "relation"> | Omit<ActionAuth["CreateOperationData"], "relation">[]> | OakOperation<BaseActionAuth.OpUpdateAction, Omit<ActionAuth["UpdateOperationData"], "relation">, ActionAuth["Filter"]> | OakOperation<"remove", ActionAuth["RemoveOperationData"], ActionAuth["Filter"]>)[];
515
+ relationAuth$sourceRelation?: (OakOperation<"create", Omit<RelationAuth["CreateOperationData"], "sourceRelation"> | Omit<RelationAuth["CreateOperationData"], "sourceRelation">[]> | OakOperation<BaseRelationAuth.OpUpdateAction, Omit<RelationAuth["UpdateOperationData"], "sourceRelation">, RelationAuth["Filter"]> | OakOperation<"remove", RelationAuth["RemoveOperationData"], RelationAuth["Filter"]>)[];
516
+ relationAuth$destRelation?: (OakOperation<"create", Omit<RelationAuth["CreateOperationData"], "destRelation"> | Omit<RelationAuth["CreateOperationData"], "destRelation">[]> | OakOperation<BaseRelationAuth.OpUpdateAction, Omit<RelationAuth["UpdateOperationData"], "destRelation">, RelationAuth["Filter"]> | OakOperation<"remove", RelationAuth["RemoveOperationData"], RelationAuth["Filter"]>)[];
503
517
  userEntityClaim$relation?: (OakOperation<"create", Omit<UserEntityClaim["CreateOperationData"], "relation"> | Omit<UserEntityClaim["CreateOperationData"], "relation">[]> | OakOperation<BaseUserEntityClaim.OpUpdateAction, Omit<UserEntityClaim["UpdateOperationData"], "relation">, UserEntityClaim["Filter"]> | OakOperation<"remove", UserEntityClaim["RemoveOperationData"], UserEntityClaim["Filter"]>)[];
504
518
  userRelation$relation?: (OakOperation<"create", Omit<UserRelation["CreateOperationData"], "relation"> | Omit<UserRelation["CreateOperationData"], "relation">[]> | OakOperation<BaseUserRelation.OpUpdateAction, Omit<UserRelation["UpdateOperationData"], "relation">, UserRelation["Filter"]> | OakOperation<"remove", UserRelation["RemoveOperationData"], UserRelation["Filter"]>)[];
505
519
  }>;
@@ -541,6 +555,7 @@ export type RelationAuth = {
541
555
  Aggregation: DeduceAggregation<RelationAuth["Projection"], RelationAuth["Filter"], RelationAuth["Sorter"]>;
542
556
  CreateOperationData: FormCreateData<BaseRelationAuth.OpSchema & {
543
557
  sourceRelation?: OakOperation<"create", Relation["CreateOperationData"]> | OakOperation<BaseRelation.OpUpdateAction, Relation["UpdateOperationData"], Relation["Filter"]>;
558
+ path?: OakOperation<"create", Path["CreateOperationData"]> | OakOperation<BasePath.OpUpdateAction, Path["UpdateOperationData"], Path["Filter"]>;
544
559
  destRelation?: OakOperation<"create", Relation["CreateOperationData"]> | OakOperation<BaseRelation.OpUpdateAction, Relation["UpdateOperationData"], Relation["Filter"]>;
545
560
  }>;
546
561
  CreateSingle: OakOperation<"create", RelationAuth["CreateOperationData"]>;
@@ -548,6 +563,7 @@ export type RelationAuth = {
548
563
  Create: RelationAuth["CreateSingle"] | RelationAuth["CreateMulti"];
549
564
  UpdateOperationData: FormUpdateData<BaseRelationAuth.OpSchema & {
550
565
  sourceRelation?: OakOperation<"create", Relation["CreateOperationData"]> | OakOperation<BaseRelation.OpUpdateAction, Relation["UpdateOperationData"], Relation["Filter"]> | OakOperation<"remove", Relation["RemoveOperationData"], Relation["Filter"]>;
566
+ path?: OakOperation<"create", Path["CreateOperationData"]> | OakOperation<BasePath.OpUpdateAction, Path["UpdateOperationData"], Path["Filter"]> | OakOperation<"remove", Path["RemoveOperationData"], Path["Filter"]>;
551
567
  destRelation?: OakOperation<"create", Relation["CreateOperationData"]> | OakOperation<BaseRelation.OpUpdateAction, Relation["UpdateOperationData"], Relation["Filter"]> | OakOperation<"remove", Relation["RemoveOperationData"], Relation["Filter"]>;
552
568
  }>;
553
569
  Update: OakOperation<BaseRelationAuth.OpUpdateAction, RelationAuth["UpdateOperationData"], RelationAuth["Filter"], RelationAuth["Sorter"]>;
@@ -4,7 +4,7 @@ export const desc = {
4
4
  origin: {
5
5
  notNull: true,
6
6
  type: "enum",
7
- enumeration: ["qiniu", "wechat", "ctyun", "aliyun", "tencent", "local", "unknown"]
7
+ enumeration: ["qiniu", "wechat", "ctyun", "aliyun", "tencent", "local", "unknown", "s3"]
8
8
  },
9
9
  type: {
10
10
  notNull: true,
@@ -1,6 +1,7 @@
1
1
  export const style = {
2
2
  color: {
3
3
  origin: {
4
+ s3: '#FFA500',
4
5
  qiniu: '#37caff',
5
6
  wechat: '#2aae67',
6
7
  ctyun: '#ff0000',
@@ -4,7 +4,7 @@ import { MakeAction as OakMakeAction, EntityShape } from "oak-domain/lib/types/E
4
4
  import { GenericAction } from "oak-domain/lib/actions/action";
5
5
  import { String, Text, Int, Float, Boolean } from "oak-domain/lib/types/DataType";
6
6
  export type OpSchema = EntityShape & {
7
- origin: "qiniu" | "wechat" | "ctyun" | "aliyun" | "tencent" | "local" | "unknown";
7
+ origin: "qiniu" | "wechat" | "ctyun" | "aliyun" | "tencent" | "local" | "unknown" | "s3";
8
8
  type: "image" | "video" | "audio" | "file";
9
9
  bucket?: String<32> | null;
10
10
  objectId?: String<64> | null;
@@ -33,7 +33,7 @@ export type OpFilter = {
33
33
  $$createAt$$: Q_DateValue;
34
34
  $$seq$$: Q_NumberValue;
35
35
  $$updateAt$$: Q_DateValue;
36
- origin: Q_EnumValue<"qiniu" | "wechat" | "ctyun" | "aliyun" | "tencent" | "local" | "unknown">;
36
+ origin: Q_EnumValue<"qiniu" | "wechat" | "ctyun" | "aliyun" | "tencent" | "local" | "unknown" | "s3">;
37
37
  type: Q_EnumValue<"image" | "video" | "audio" | "file">;
38
38
  bucket: Q_StringValue;
39
39
  objectId: Q_StringValue;
@@ -30,7 +30,8 @@
30
30
  "aliyun": "阿里云",
31
31
  "tencent": "腾讯云",
32
32
  "local": "本地",
33
- "unknown": "未知"
33
+ "unknown": "未知",
34
+ "s3": "S3"
34
35
  },
35
36
  "type": {
36
37
  "image": "图像",
@@ -34,7 +34,6 @@ export const desc = {
34
34
  type: "object"
35
35
  }
36
36
  },
37
- static: true,
38
37
  actionType: "crud",
39
38
  actions,
40
39
  indexes: [
@@ -27,10 +27,18 @@ export type PfwConfig = {
27
27
  export type MfwConfig = {
28
28
  appId: string;
29
29
  };
30
+ export type PwdConfig = {
31
+ mode: "all" | "plain" | "sha1";
32
+ min: number;
33
+ max: number;
34
+ verify?: boolean;
35
+ regexs?: string[];
36
+ tip?: string;
37
+ };
30
38
  export type OpSchema = EntityShape & {
31
39
  systemId: ForeignKey<"system">;
32
40
  type: Type;
33
- config?: (SmsConfig | EmailConfig | PfwConfig | MfwConfig) | null;
41
+ config?: (SmsConfig | EmailConfig | PfwConfig | MfwConfig | PwdConfig) | null;
34
42
  enabled: Boolean;
35
43
  } & {
36
44
  [A in ExpressionKey]?: any;
@@ -43,7 +51,7 @@ export type OpFilter = {
43
51
  $$updateAt$$: Q_DateValue;
44
52
  systemId: Q_StringValue;
45
53
  type: Q_EnumValue<Type>;
46
- config: JsonFilter<SmsConfig | EmailConfig | PfwConfig | MfwConfig>;
54
+ config: JsonFilter<SmsConfig | EmailConfig | PfwConfig | MfwConfig | PwdConfig>;
47
55
  enabled: Q_BooleanValue;
48
56
  } & ExprOp<OpAttr | string>;
49
57
  export type OpProjection = {
@@ -55,7 +63,7 @@ export type OpProjection = {
55
63
  $$seq$$?: number;
56
64
  systemId?: number;
57
65
  type?: number;
58
- config?: number | JsonProjection<SmsConfig | EmailConfig | PfwConfig | MfwConfig>;
66
+ config?: number | JsonProjection<SmsConfig | EmailConfig | PfwConfig | MfwConfig | PwdConfig>;
59
67
  enabled?: number;
60
68
  } & Partial<ExprOp<OpAttr | string>>;
61
69
  export type OpSortAttr = Partial<{
@@ -16,7 +16,6 @@ export const desc = {
16
16
  }
17
17
  },
18
18
  recursive: {
19
- notNull: true,
20
19
  type: "boolean"
21
20
  },
22
21
  sourceEntity: {
@@ -33,7 +32,6 @@ export const desc = {
33
32
  }
34
33
  }
35
34
  },
36
- static: true,
37
35
  actionType: "crud",
38
36
  actions,
39
37
  indexes: [
@@ -5,7 +5,7 @@ import { String, Boolean } from "oak-domain/lib/types/DataType";
5
5
  export type OpSchema = EntityShape & {
6
6
  destEntity: String<32>;
7
7
  value: String<256>;
8
- recursive: Boolean;
8
+ recursive?: Boolean | null;
9
9
  sourceEntity: String<32>;
10
10
  desc?: String<256> | null;
11
11
  } & {
@@ -17,7 +17,6 @@ export const desc = {
17
17
  ref: "relation"
18
18
  }
19
19
  },
20
- static: true,
21
20
  actionType: "crud",
22
21
  actions,
23
22
  indexes: [
@@ -19,8 +19,7 @@ export const desc = {
19
19
  type: "ref",
20
20
  ref: "platform"
21
21
  },
22
- folder // 提现的loss在用户提现时计算
23
- : {
22
+ folder: {
24
23
  type: "varchar",
25
24
  params: {
26
25
  length: 16
@@ -25,6 +25,7 @@ async function startRefunding(context, data) {
25
25
  },
26
26
  order: {
27
27
  id: 1,
28
+ price: 1,
28
29
  paid: 1,
29
30
  refunded: 1,
30
31
  settled: 1,
@@ -112,50 +113,14 @@ async function startRefunding(context, data) {
112
113
  }
113
114
  }, { forUpdate: true });
114
115
  const { accountOper$entity: opers, } = data;
115
- // 对opers检查
116
- if (order.settled === (order.paid - order.refunded)) {
117
- // 已全部结算
118
- // 已全部结算的订单由refund传入的opers决定退款,检查opers的金额总和等于refund的金额
119
- let amount = 0;
120
- // 有明确的来源account
121
- assert(opers && opers instanceof Array, '已结算的订单退款一定要有相应的account来源');
122
- opers.forEach(({ action, data }) => {
123
- assert(action === 'create');
124
- const { type, totalPlus, availPlus, accountId } = data;
125
- assert(type === 'refund');
126
- assert(totalPlus === availPlus);
127
- const settlement = settledSettlements?.find((ele) => ele?.accountId === accountId);
128
- assert(!!settlement, '请从订单分账的相关账户中选择订单退款的account来源');
129
- amount += -totalPlus;
130
- });
131
- assert(amount === data.price);
132
- //将order的settled更新
133
- const newSettled = order.settled - data.price;
134
- await context.operate('order', {
135
- id: await generateNewIdAsync(),
136
- action: 'update',
137
- data: {
138
- settled: newSettled,
139
- },
140
- filter: {
141
- id: order.id,
142
- }
143
- }, {});
144
- }
145
- else if (order.settled === 0) {
146
- //未结算
147
- //未结算的订单无opers
148
- assert(!(opers && opers.length > 0));
149
- }
150
- else {
151
- //部分结算
152
- /**
153
- * 部分结算的订单:
154
- * 1. opers的金额总和 <= 订单已结算金额
155
- * 2. opers的金额总和 + unsettled的金额 >= 退款金额
156
- */
157
- let opersPrice = 0;
158
- if (opers && opers.length > 0) {
116
+ // 对opers检查 退款0元无需检查
117
+ if (!(data.price === 0 && order.price === 0 && pay.paid === 0)) {
118
+ if (order.settled === (order.paid - order.refunded)) {
119
+ // 已全部结算
120
+ // 已全部结算的订单由refund传入的opers决定退款,检查opers的金额总和等于refund的金额
121
+ let amount = 0;
122
+ // 有明确的来源account
123
+ assert(opers && opers instanceof Array, '已结算的订单退款一定要有相应的account来源');
159
124
  opers.forEach(({ action, data }) => {
160
125
  assert(action === 'create');
161
126
  const { type, totalPlus, availPlus, accountId } = data;
@@ -163,29 +128,70 @@ async function startRefunding(context, data) {
163
128
  assert(totalPlus === availPlus);
164
129
  const settlement = settledSettlements?.find((ele) => ele?.accountId === accountId);
165
130
  assert(!!settlement, '请从订单分账的相关账户中选择订单退款的account来源');
166
- opersPrice += -totalPlus;
131
+ amount += -totalPlus;
167
132
  });
133
+ assert(amount === data.price);
134
+ //将order的settled更新
135
+ const newSettled = order.settled - data.price;
136
+ await context.operate('order', {
137
+ id: await generateNewIdAsync(),
138
+ action: 'update',
139
+ data: {
140
+ settled: newSettled,
141
+ },
142
+ filter: {
143
+ id: order.id,
144
+ }
145
+ }, {});
168
146
  }
169
- const { paid, refunded, settled, settlePlan$order: settlePlans } = order;
170
- const orderUnsettledPrice = paid - refunded - settled;
171
- if (opersPrice > settled) {
172
- throw new refundOpersExceed(opersPrice - settled);
173
- }
174
- if (opersPrice < data.price - orderUnsettledPrice) {
175
- throw new refundOpersNotEnough(opersPrice - (data.price - orderUnsettledPrice));
147
+ else if (order.settled === 0) {
148
+ //未结算
149
+ //未结算的订单无opers
150
+ assert(!(opers && opers.length > 0));
176
151
  }
177
- //将order的settled更新
178
- const newSettled = order.settled - opersPrice;
179
- await context.operate('order', {
180
- id: await generateNewIdAsync(),
181
- action: 'update',
182
- data: {
183
- settled: newSettled,
184
- },
185
- filter: {
186
- id: order.id,
152
+ else {
153
+ //部分结算
154
+ /**
155
+ * 部分结算的订单:
156
+ * 1. opers的金额总和 <= 订单已结算金额
157
+ * 2. opers的金额总和 + unsettled的金额 >= 退款金额
158
+ */
159
+ let opersPrice = 0;
160
+ if (opers && opers.length > 0) {
161
+ opers.forEach(({ action, data }) => {
162
+ assert(action === 'create');
163
+ const { type, totalPlus, availPlus, accountId } = data;
164
+ assert(type === 'refund');
165
+ assert(totalPlus === availPlus);
166
+ const settlement = settledSettlements?.find((ele) => ele?.accountId === accountId);
167
+ assert(!!settlement, '请从订单分账的相关账户中选择订单退款的account来源');
168
+ opersPrice += -totalPlus;
169
+ });
187
170
  }
188
- }, {});
171
+ const { paid, refunded, settled, settlePlan$order: settlePlans } = order;
172
+ const orderUnsettledPrice = paid - refunded - settled;
173
+ if (opersPrice > settled) {
174
+ throw new refundOpersExceed(opersPrice - settled);
175
+ }
176
+ if (opersPrice < data.price - orderUnsettledPrice) {
177
+ throw new refundOpersNotEnough(opersPrice - (data.price - orderUnsettledPrice));
178
+ }
179
+ //将order的settled更新
180
+ const newSettled = order.settled - opersPrice;
181
+ await context.operate('order', {
182
+ id: await generateNewIdAsync(),
183
+ action: 'update',
184
+ data: {
185
+ settled: newSettled,
186
+ },
187
+ filter: {
188
+ id: order.id,
189
+ }
190
+ }, {});
191
+ }
192
+ }
193
+ else {
194
+ assert(order.price === 0 && data.price === 0, '0元订单,退款金额不可大于订单金额');
189
195
  }
190
196
  }
191
197
  data.pay = {
@@ -190,10 +190,10 @@ export default class AliPay extends AliPayDebug {
190
190
  const qrCodeWidth = this.apProduct.config?.qrCodeWidth || 100;
191
191
  const params = {
192
192
  bizContent: {
193
- subject: pay.order?.desc || (pay.orderId ? '订单支付' : '帐户充值'),
194
- out_trade_no: out_trade_no,
195
- total_amount: totalAmount,
196
- product_code: 'FAST_INSTANT_TRADE_PAY',
193
+ subject: pay.order?.desc || (pay.orderId ? '订单支付' : '帐户充值'), // 订单标题
194
+ out_trade_no: out_trade_no, // 商户订单号,64个字符以内、可包含字母、数字、下划线;需保证在商户端不重复
195
+ total_amount: totalAmount, // 订单总金额,单位为元
196
+ product_code: 'FAST_INSTANT_TRADE_PAY', // 销售产品码,商家和支付宝签约的产品码
197
197
  notify_url: payNotifyUrl,
198
198
  qr_pay_mode: qrPayMode,
199
199
  qrcode_width: qrCodeWidth,
@@ -157,9 +157,9 @@ export default class WechatMpShipDebug {
157
157
  name: from.name,
158
158
  mobile: from.phone,
159
159
  // country: from!.area!.parent!.parent!.name!, //国家
160
- province: from.area.parent.parent.name,
161
- city: from.area.parent.name,
162
- area: from.area.name,
160
+ province: from.area.parent.parent.name, //省份
161
+ city: from.area.parent.name, //市
162
+ area: from.area.name, // 区
163
163
  address: from.detail, //详细地址
164
164
  },
165
165
  receiver: {
@@ -33,7 +33,7 @@ exports.entityDesc = {
33
33
  keyType: '指定应用私钥类型',
34
34
  gateway: "支付宝网关地址",
35
35
  wsServiceUrl: 'websocket服务地址',
36
- timeout: "网关超时时间",
36
+ timeout: "网关超时时间", //(单位毫秒),默认值是 5000
37
37
  needEncrypt: "是否需要AES加解密",
38
38
  encryptKey: 'AES密钥', //调用AES加解密相关接口时需要
39
39
  },