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.
- package/es/components/order/pay/index.js +3 -3
- package/es/components/sysAccount/survey/index.js +1 -1
- package/es/entities/ApAccount.js +1 -1
- package/es/oak-app-domain/ActionAuth/Storage.js +0 -1
- package/es/oak-app-domain/Application/_baseSchema.d.ts +0 -5
- package/es/oak-app-domain/ArticleMenu/Storage.js +3 -0
- package/es/oak-app-domain/ArticleMenu/_baseSchema.d.ts +5 -1
- package/es/oak-app-domain/ArticleMenu/locales/zh_CN.json +2 -1
- package/es/oak-app-domain/ChangePasswordTemp/Storage.js +6 -0
- package/es/oak-app-domain/ChangePasswordTemp/_baseSchema.d.ts +9 -1
- package/es/oak-app-domain/ChangePasswordTemp/locales/zh_CN.json +2 -0
- package/es/oak-app-domain/EntityDict.d.ts +18 -2
- package/es/oak-app-domain/ExtraFile/Storage.js +1 -1
- package/es/oak-app-domain/ExtraFile/Style.js +1 -0
- package/es/oak-app-domain/ExtraFile/_baseSchema.d.ts +2 -2
- package/es/oak-app-domain/ExtraFile/locales/zh_CN.json +2 -1
- package/es/oak-app-domain/I18n/Storage.js +0 -1
- package/es/oak-app-domain/Passport/_baseSchema.d.ts +11 -3
- package/es/oak-app-domain/Path/Storage.js +0 -2
- package/es/oak-app-domain/Path/_baseSchema.d.ts +1 -1
- package/es/oak-app-domain/RelationAuth/Storage.js +0 -1
- package/es/oak-app-domain/System/Storage.js +1 -2
- package/es/triggers/refund.js +69 -63
- package/es/utils/payClazz/AliPay/AliPay.js +4 -4
- package/es/utils/shipClazz/WechatMpShip/WechatMpShip.debug.js +3 -3
- package/lib/entities/ApAccount.js +1 -1
- package/lib/oak-app-domain/ActionAuth/Storage.js +0 -1
- package/lib/oak-app-domain/Application/_baseSchema.d.ts +0 -5
- package/lib/oak-app-domain/ArticleMenu/Storage.js +3 -0
- package/lib/oak-app-domain/ArticleMenu/_baseSchema.d.ts +5 -1
- package/lib/oak-app-domain/ArticleMenu/locales/zh_CN.json +2 -1
- package/lib/oak-app-domain/ChangePasswordTemp/Storage.js +6 -0
- package/lib/oak-app-domain/ChangePasswordTemp/_baseSchema.d.ts +9 -1
- package/lib/oak-app-domain/ChangePasswordTemp/locales/zh_CN.json +2 -0
- package/lib/oak-app-domain/EntityDict.d.ts +18 -2
- package/lib/oak-app-domain/ExtraFile/Storage.js +1 -1
- package/lib/oak-app-domain/ExtraFile/Style.js +1 -0
- package/lib/oak-app-domain/ExtraFile/_baseSchema.d.ts +2 -2
- package/lib/oak-app-domain/ExtraFile/locales/zh_CN.json +2 -1
- package/lib/oak-app-domain/I18n/Storage.js +0 -1
- package/lib/oak-app-domain/Passport/_baseSchema.d.ts +11 -3
- package/lib/oak-app-domain/Path/Storage.js +0 -2
- package/lib/oak-app-domain/Path/_baseSchema.d.ts +1 -1
- package/lib/oak-app-domain/RelationAuth/Storage.js +0 -1
- package/lib/oak-app-domain/System/Storage.js +1 -2
- package/lib/triggers/refund.js +69 -63
- package/lib/triggers/withdraw.d.ts +1 -1
- package/lib/utils/payClazz/AliPay/AliPay.js +4 -4
- package/lib/utils/shipClazz/WechatMpShip/WechatMpShip.debug.js +3 -3
- 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 }) {
|
package/es/entities/ApAccount.js
CHANGED
|
@@ -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;
|
|
@@ -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>;
|
|
@@ -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>>;
|
|
@@ -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,
|
|
@@ -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;
|
|
@@ -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<{
|
|
@@ -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
|
|
8
|
+
recursive?: Boolean | null;
|
|
9
9
|
sourceEntity: String<32>;
|
|
10
10
|
desc?: String<256> | null;
|
|
11
11
|
} & {
|
package/es/triggers/refund.js
CHANGED
|
@@ -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 (
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
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
|
-
|
|
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
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
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
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
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: {
|