实体新增settlementPlan,调整order、settlement
This commit is contained in:
parent
c4823623ce
commit
5fbbc377c4
|
|
@ -16,13 +16,14 @@ export interface Schema extends EntityShape {
|
||||||
price: Price;
|
price: Price;
|
||||||
paid: Price;
|
paid: Price;
|
||||||
refunded: Price;
|
refunded: Price;
|
||||||
|
settled: Price;
|
||||||
|
settlePlanned: Price;
|
||||||
title: String<32>;
|
title: String<32>;
|
||||||
desc: Text;
|
desc: Text;
|
||||||
timeoutAt?: Datetime;
|
timeoutAt?: Datetime;
|
||||||
creator: User;
|
creator: User;
|
||||||
entity: String<32>;
|
entity: String<32>;
|
||||||
entityId: String<64>;
|
entityId: String<64>;
|
||||||
settled: Boolean;
|
|
||||||
allowPartialPay?: Boolean;
|
allowPartialPay?: Boolean;
|
||||||
system: System;
|
system: System;
|
||||||
address?: Address;
|
address?: Address;
|
||||||
|
|
@ -50,7 +51,7 @@ export const IActionDef: ActionDef<IAction, IState> = {
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
export type Action = IAction | 'settle';
|
export type Action = IAction;
|
||||||
|
|
||||||
export const entityDesc: EntityDesc<Schema, Action, '', {
|
export const entityDesc: EntityDesc<Schema, Action, '', {
|
||||||
iState: IState,
|
iState: IState,
|
||||||
|
|
@ -91,6 +92,8 @@ export const entityDesc: EntityDesc<Schema, Action, '', {
|
||||||
price: '订单金额',
|
price: '订单金额',
|
||||||
paid: '已支付金额',
|
paid: '已支付金额',
|
||||||
refunded: '已退款金额',
|
refunded: '已退款金额',
|
||||||
|
settled: '已结算金额',
|
||||||
|
settlePlanned: '已计划结算金额',
|
||||||
iState: '订单状态',
|
iState: '订单状态',
|
||||||
title: '订单标题',
|
title: '订单标题',
|
||||||
desc: "订单描述",
|
desc: "订单描述",
|
||||||
|
|
@ -99,7 +102,6 @@ export const entityDesc: EntityDesc<Schema, Action, '', {
|
||||||
creator: '创建者',
|
creator: '创建者',
|
||||||
entity: '关联对象',
|
entity: '关联对象',
|
||||||
entityId: '关联对象Id',
|
entityId: '关联对象Id',
|
||||||
settled: '是否结算',
|
|
||||||
opers: '相关帐户操作',
|
opers: '相关帐户操作',
|
||||||
system: '所属系统',
|
system: '所属系统',
|
||||||
address: '收货地址',
|
address: '收货地址',
|
||||||
|
|
@ -116,7 +118,6 @@ export const entityDesc: EntityDesc<Schema, Action, '', {
|
||||||
refundAll: '完全退款',
|
refundAll: '完全退款',
|
||||||
refundNone: '退款失败',
|
refundNone: '退款失败',
|
||||||
refundPartially: '部分退款',
|
refundPartially: '部分退款',
|
||||||
settle: '结算',
|
|
||||||
},
|
},
|
||||||
v: {
|
v: {
|
||||||
iState: {
|
iState: {
|
||||||
|
|
@ -145,7 +146,6 @@ export const entityDesc: EntityDesc<Schema, Action, '', {
|
||||||
refundAll: '',
|
refundAll: '',
|
||||||
refundNone: '',
|
refundNone: '',
|
||||||
refundPartially: '',
|
refundPartially: '',
|
||||||
settle: '',
|
|
||||||
|
|
||||||
},
|
},
|
||||||
color: {
|
color: {
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,66 @@
|
||||||
|
import {
|
||||||
|
Price,
|
||||||
|
Datetime,
|
||||||
|
} from 'oak-domain/lib/types/DataType';
|
||||||
|
import { EntityShape } from 'oak-domain/lib/types/Entity';
|
||||||
|
import { EntityDesc, ActionDef } from 'oak-domain/lib/types';
|
||||||
|
import { Schema as Order } from './Order';
|
||||||
|
|
||||||
|
export interface Schema extends EntityShape {
|
||||||
|
when?: Datetime;
|
||||||
|
order: Order;
|
||||||
|
price: Price;
|
||||||
|
};
|
||||||
|
|
||||||
|
type IState = 'unsettled' | 'settled' | 'closed';
|
||||||
|
type IAction = 'settle' | 'close';
|
||||||
|
|
||||||
|
export const IActionDef: ActionDef<IAction, IState> = {
|
||||||
|
stm: {
|
||||||
|
settle: ['unsettled', 'settled'],
|
||||||
|
close: ['unsettled', 'closed'],
|
||||||
|
},
|
||||||
|
is: 'unsettled',
|
||||||
|
};
|
||||||
|
|
||||||
|
type Action = IAction
|
||||||
|
|
||||||
|
export const entityDesc: EntityDesc<Schema, Action, '', {
|
||||||
|
iState: IState,
|
||||||
|
}> = {
|
||||||
|
locales: {
|
||||||
|
zh_CN: {
|
||||||
|
name: '结算计划',
|
||||||
|
attr: {
|
||||||
|
when: '结算时间',
|
||||||
|
order: '订单',
|
||||||
|
price: '结算金额',
|
||||||
|
iState: '结算计划状态',
|
||||||
|
},
|
||||||
|
action: {
|
||||||
|
settle: '结算',
|
||||||
|
close: '关闭',
|
||||||
|
},
|
||||||
|
v: {
|
||||||
|
iState: {
|
||||||
|
unsettled: '未结算',
|
||||||
|
settled: '已结算',
|
||||||
|
closed: '已关闭',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
style: {
|
||||||
|
icon: {
|
||||||
|
settle: '',
|
||||||
|
close: '',
|
||||||
|
},
|
||||||
|
color: {
|
||||||
|
iState: {
|
||||||
|
unsettled: '#52BE80',
|
||||||
|
settled: '#2E86C1',
|
||||||
|
closed: '#8C949C'
|
||||||
|
},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
@ -1,34 +1,31 @@
|
||||||
import {
|
import {
|
||||||
String,
|
|
||||||
Text,
|
|
||||||
Price,
|
Price,
|
||||||
Boolean,
|
|
||||||
Datetime,
|
|
||||||
} from 'oak-domain/lib/types/DataType';
|
} from 'oak-domain/lib/types/DataType';
|
||||||
import { EntityShape } from 'oak-domain/lib/types/Entity';
|
import { EntityShape } from 'oak-domain/lib/types/Entity';
|
||||||
import { EntityDesc, ActionDef } from 'oak-domain/lib/types';
|
import { EntityDesc, ActionDef } from 'oak-domain/lib/types';
|
||||||
import { Schema as Account } from './Account';
|
import { Schema as Account } from './Account';
|
||||||
import { Schema as Order } from './Order';
|
import { Schema as SettlePlan } from './SettlePlan';
|
||||||
import { Schema as AccountOper } from './AccountOper';
|
import { Schema as AccountOper } from './AccountOper';
|
||||||
|
|
||||||
export interface Schema extends EntityShape {
|
export interface Schema extends EntityShape {
|
||||||
account: Account;
|
account: Account;
|
||||||
|
plan: SettlePlan;
|
||||||
price: Price;
|
price: Price;
|
||||||
order: Order;
|
|
||||||
opers?: AccountOper[];
|
opers?: AccountOper[];
|
||||||
};
|
};
|
||||||
|
|
||||||
type IState = 'unsettled' | 'settled';
|
type IState = 'unsettled' | 'settled' | 'closed';
|
||||||
type IAction = 'settle';
|
type IAction = 'settle' | 'close';
|
||||||
|
|
||||||
export const IActionDef: ActionDef<IAction, IState> = {
|
export const IActionDef: ActionDef<IAction, IState> = {
|
||||||
stm: {
|
stm: {
|
||||||
settle: ['unsettled', 'settled'],
|
settle: ['unsettled', 'settled'],
|
||||||
|
close: ['unsettled', 'closed'],
|
||||||
},
|
},
|
||||||
is: 'unsettled',
|
is: 'unsettled',
|
||||||
};
|
};
|
||||||
|
|
||||||
type Action = IAction | 'preSettle' | 'refund' | 'refundFailure';
|
type Action = IAction | 'refund' | 'refundFailure';
|
||||||
|
|
||||||
export const entityDesc: EntityDesc<Schema, Action, '', {
|
export const entityDesc: EntityDesc<Schema, Action, '', {
|
||||||
iState: IState,
|
iState: IState,
|
||||||
|
|
@ -38,14 +35,14 @@ export const entityDesc: EntityDesc<Schema, Action, '', {
|
||||||
name: '结算明细',
|
name: '结算明细',
|
||||||
attr: {
|
attr: {
|
||||||
account: '帐号',
|
account: '帐号',
|
||||||
|
plan: '结算计划',
|
||||||
price: '变化金额',
|
price: '变化金额',
|
||||||
order: '订单',
|
|
||||||
iState: '结算状态',
|
iState: '结算状态',
|
||||||
opers: '相关帐户操作',
|
opers: '相关帐户操作',
|
||||||
},
|
},
|
||||||
action: {
|
action: {
|
||||||
preSettle: '预结算',
|
|
||||||
settle: '结算',
|
settle: '结算',
|
||||||
|
close: '关闭',
|
||||||
refund: '退款',
|
refund: '退款',
|
||||||
refundFailure: '退款失败',
|
refundFailure: '退款失败',
|
||||||
},
|
},
|
||||||
|
|
@ -53,9 +50,9 @@ export const entityDesc: EntityDesc<Schema, Action, '', {
|
||||||
iState: {
|
iState: {
|
||||||
unsettled: '未结算',
|
unsettled: '未结算',
|
||||||
settled: '已结算',
|
settled: '已结算',
|
||||||
|
closed: '已关闭',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
style: {
|
style: {
|
||||||
|
|
@ -68,6 +65,7 @@ export const entityDesc: EntityDesc<Schema, Action, '', {
|
||||||
iState: {
|
iState: {
|
||||||
unsettled: '#52BE80',
|
unsettled: '#52BE80',
|
||||||
settled: '#2E86C1',
|
settled: '#2E86C1',
|
||||||
|
closed: '#8C949C'
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue