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

162 lines
3.5 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"
},
entity: {
notNull: true,
type: "varchar",
params: {
length: 32
},
ref: ["account", "apProduct", "offlineAccount", "wpProduct"]
},
entityId: {
notNull: true,
type: "varchar",
params: {
length: 64
}
},
timeoutAt: {
type: "datetime"
},
successAt: {
type: "datetime"
},
forbidRefundAt: {
type: "datetime"
},
refundable: {
notNull: true,
type: "boolean"
},
depositId: {
type: "ref",
ref: "deposit"
},
orderId: {
type: "ref",
ref: "order"
},
externalId: {
type: "varchar",
params: {
length: 80
}
},
meta: {
notNull: true,
type: "object"
},
applicationId: {
notNull: true,
type: "ref",
ref: "application"
},
creatorId: {
notNull: true,
type: "ref",
ref: "user"
},
phantom1: {
type: "varchar",
params: {
length: 32
}
},
phantom2: {
type: "varchar",
params: {
length: 32
}
},
phantom3: {
type: "int",
params: {
width: 4,
signed: true
}
},
phantom4: {
type: "int",
params: {
width: 8,
signed: true
}
},
phantom5: {
type: "object"
},
autoStart: {
type: "boolean"
},
iState: {
notNull: true,
type: "enum",
enumeration: ["unpaid", "paying", "paid", "closed", "refunding", "partiallyRefunded", "refunded"]
}
},
actionType: "crud",
actions,
indexes: [
//索引
{
name: 'index_iState',
attributes: [
{
name: 'iState',
},
],
},
{
name: 'index_externalId_entity_entityId',
attributes: [
{
name: 'externalId',
},
{
name: 'entity',
},
{
name: 'entityId',
}
],
config: {
unique: true,
}
},
{
name: 'refundable_gap',
attributes: [
{
name: 'refundable',
},
{
name: "depositId",
},
{
name: "orderId",
},
{
name: '$$deleteAt$$',
},
{
name: 'forbidRefundAt',
direction: 'ASC',
},
],
}
]
};