-
-
Save avkos/fc438a21e7d140e35cdcdd06cf0950c3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as dynamoose from 'dynamoose' | |
import {Document} from "dynamoose/dist/Document"; | |
import config from '../../config' | |
export class HoldDocument extends Document { | |
id?: string | |
type?: string | |
symbol?: string | |
status?: string | |
data?: string | |
avgPrice?: number | |
avgPriceProfit?: number | |
orderId?: string | |
qty?: number | |
createdAt?: Date | |
} | |
export default dynamoose.model<HoldDocument>(config.tables.hold, { | |
id: { | |
type: String, | |
hashKey: true | |
}, | |
type: { | |
type: String, | |
index: { | |
name: "type", | |
global: true | |
} | |
}, | |
symbol: { | |
type: String, | |
index: { | |
name: "symbol", | |
global: true | |
} | |
}, | |
status: { | |
type: String, | |
index: { | |
name: "status", | |
global: true | |
} | |
}, | |
data: String, | |
avgPrice: Number, | |
avgPriceProfit: Number, | |
orderId: String, | |
qty: Number, | |
createdAt: Date, | |
}, { | |
// @ts-ignore-next-line | |
saveUnknown: false | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as dynamoose from 'dynamoose' | |
import config from '../../config' | |
import {Document} from "dynamoose/dist/Document"; | |
export class SettingDocument extends Document { | |
id?: string | |
type?: string | |
symbol?: string | |
status?: string | |
data?: string | |
createdAt?: Date | |
} | |
export default dynamoose.model<SettingDocument>(config.tables.setting, { | |
id: { | |
type: String, | |
hashKey: true | |
}, | |
type: { | |
type: String, | |
index: { | |
name: "type", | |
global: true | |
} | |
}, | |
symbol: { | |
type: String, | |
index: { | |
name: "symbol", | |
global: true | |
} | |
}, | |
data: String, | |
createdAt: Date, | |
}, { | |
// @ts-ignore-next-line | |
saveUnknown: false, | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as dynamoose from 'dynamoose' | |
import config from '../../config' | |
import {Document} from "dynamoose/dist/Document"; | |
export class StrategyDocument extends Document { | |
id?: string | |
type?: string | |
symbol?: string | |
status?: string | |
profit?: number | |
data?: string | |
createdAt?: Date | |
holdId?: string | |
unHoldPrice?: number | |
} | |
export default dynamoose.model<StrategyDocument>(config.tables.strategy, { | |
id: { | |
type: String, | |
hashKey: true | |
}, | |
type: { | |
type: String, | |
index: { | |
name: "type", | |
global: true | |
} | |
}, | |
symbol: { | |
type: String, | |
index: { | |
name: "symbol", | |
global: true | |
} | |
}, | |
status: { | |
type: String, | |
index: { | |
name: "status", | |
global: true | |
} | |
}, | |
profit: Number, | |
data: String, | |
createdAt: Date, | |
holdId: { | |
type: String, | |
index: { | |
name: "holdId", | |
global: true | |
} | |
}, | |
unHoldPrice: Number, | |
}, { | |
// @ts-ignore-next-line | |
saveUnknown: false, | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment