mirror of
https://github.com/stronk-dev/LivepeerEvents.git
synced 2025-07-05 02:35:09 +02:00
Backend rework complete
This commit is contained in:
parent
c821dbee8e
commit
95be1e5614
@ -11,8 +11,7 @@ const ActivateEventSchema = new mongoose.Schema({
|
||||
},
|
||||
round: {
|
||||
type: Number,
|
||||
required: false,
|
||||
default: true
|
||||
required: true
|
||||
},
|
||||
transactionHash: {
|
||||
type: String,
|
||||
|
@ -7,7 +7,7 @@ const StakeEventSchema = new mongoose.Schema({
|
||||
},
|
||||
from: {
|
||||
type: String,
|
||||
required: true
|
||||
required: false
|
||||
},
|
||||
to: {
|
||||
type: String,
|
||||
|
@ -10,7 +10,7 @@ const TransferEventSchema = new mongoose.Schema({
|
||||
required: true
|
||||
},
|
||||
amount: {
|
||||
type: number,
|
||||
type: Number,
|
||||
required: true
|
||||
},
|
||||
transactionHash: {
|
||||
|
@ -1,6 +1,6 @@
|
||||
import mongoose from 'mongoose';
|
||||
|
||||
const WithdrawEventSchema = new mongoose.Schema({
|
||||
const WithdrawFeesEventSchema = new mongoose.Schema({
|
||||
address: {
|
||||
type: String,
|
||||
required: true
|
||||
@ -23,5 +23,5 @@ const WithdrawEventSchema = new mongoose.Schema({
|
||||
}
|
||||
}, { timestamps: false });
|
||||
|
||||
const WithdrawEvent = mongoose.model('WithdrawEvent', WithdrawEventSchema);
|
||||
export default WithdrawEvent;
|
||||
const WithdrawFeesEvent = mongoose.model('WithdrawFeesEvent', WithdrawFeesEventSchema);
|
||||
export default WithdrawFeesEvent;
|
@ -1,6 +1,6 @@
|
||||
import mongoose from 'mongoose';
|
||||
|
||||
const WithdrawEventSchema = new mongoose.Schema({
|
||||
const WithdrawStakeEventSchema = new mongoose.Schema({
|
||||
address: {
|
||||
type: String,
|
||||
required: true
|
||||
@ -27,5 +27,5 @@ const WithdrawEventSchema = new mongoose.Schema({
|
||||
}
|
||||
}, { timestamps: false });
|
||||
|
||||
const WithdrawEvent = mongoose.model('WithdrawEvent', WithdrawEventSchema);
|
||||
export default WithdrawEvent;
|
||||
const WithdrawStakeEvent = mongoose.model('WithdrawStakeEvent', WithdrawStakeEventSchema);
|
||||
export default WithdrawStakeEvent;
|
@ -1,5 +1,54 @@
|
||||
import mongoose from 'mongoose';
|
||||
|
||||
const WinningTicketSchema = new mongoose.Schema({
|
||||
address: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
sum: {
|
||||
type: Number,
|
||||
required: true
|
||||
},
|
||||
count: {
|
||||
type: Number,
|
||||
required: true
|
||||
},
|
||||
});
|
||||
|
||||
const OrchCommissionSchema = new mongoose.Schema({
|
||||
address: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
feeCommission: {
|
||||
type: Number,
|
||||
required: true
|
||||
},
|
||||
rewardCommission: {
|
||||
type: Number,
|
||||
required: true
|
||||
},
|
||||
timestamp: {
|
||||
type: Number,
|
||||
required: true
|
||||
}
|
||||
});
|
||||
|
||||
const OrchStakeSchema = new mongoose.Schema({
|
||||
address: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
totalStake: {
|
||||
type: Number,
|
||||
required: true
|
||||
},
|
||||
timestamp: {
|
||||
type: Number,
|
||||
required: true
|
||||
}
|
||||
});
|
||||
|
||||
const MonthlyStatSchema = new mongoose.Schema({
|
||||
// Static props
|
||||
year: {
|
||||
@ -123,12 +172,12 @@ const MonthlyStatSchema = new mongoose.Schema({
|
||||
default: 0
|
||||
},
|
||||
winningTicketsReceived: {
|
||||
type: [Object],
|
||||
type: [WinningTicketSchema],
|
||||
required: false,
|
||||
default: []
|
||||
},
|
||||
winningTicketsSent: {
|
||||
type: [Object],
|
||||
type: [WinningTicketSchema],
|
||||
required: false,
|
||||
default: []
|
||||
},
|
||||
@ -144,18 +193,18 @@ const MonthlyStatSchema = new mongoose.Schema({
|
||||
default: 0
|
||||
},
|
||||
winningTicketsRedeemed: {
|
||||
type: [Object],
|
||||
type: [WinningTicketSchema],
|
||||
required: false,
|
||||
default: []
|
||||
},
|
||||
// History for theGraph current data for that month
|
||||
latestCommission: {
|
||||
type: [Object],
|
||||
type: [OrchCommissionSchema],
|
||||
required: false,
|
||||
default: null
|
||||
},
|
||||
latestTotalStake: {
|
||||
type: [Object],
|
||||
type: [OrchStakeSchema],
|
||||
required: false,
|
||||
default: null
|
||||
},
|
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user