oak-pay-business/es/oak-app-domain/Order/Storage.js

110 lines
2.4 KiB
JavaScript

import { actions } from "./Action";
export const desc = {
attributes: {
price: {
notNull: true,
type: "money"
},
paid: {
notNull: true,
type: "money"
},
refunded: {
notNull: true,
type: "money"
},
settled: {
notNull: true,
type: "money"
},
settlePlanned: {
notNull: true,
type: "money"
},
title: {
notNull: true,
type: "varchar",
params: {
length: 32
}
},
desc: {
notNull: true,
type: "text"
},
timeoutAt: {
type: "datetime"
},
creatorId: {
notNull: true,
type: "ref",
ref: "user"
},
entity: {
notNull: true,
type: "varchar",
params: {
length: 32
}
},
entityId: {
notNull: true,
type: "varchar",
params: {
length: 64
}
},
allowPartialPay: {
type: "boolean"
},
systemId: {
notNull: true,
type: "ref",
ref: "system"
},
addressId: {
type: "ref",
ref: "address"
},
payAt: {
type: "datetime"
},
iState: {
notNull: true,
type: "enum",
enumeration: ["unpaid", "timeout", "cancelled", "paying", "partiallyPaid", "paid", "refunding", "partiallyRefunded", "refunded"]
}
},
actionType: "crud",
actions,
indexes: [
//索引
{
name: 'index_iState',
attributes: [
{
name: 'iState',
},
],
},
{
name: 'index_settled_price',
attributes: [
{
name: "systemId",
},
{
name: 'settled',
},
{
name: '$$deleteAt$$',
},
{
name: 'price',
direction: 'DESC',
}
]
}
]
};