1. DB Schema

Agenda

{
    agendaid: Number,         // agenda id 
    creator: String,          // agenda creator
    status: Number,           // agenda status.  AgendaStatus { 0:NONE, 1:NOTICE, 2:VOTING, 3:WAITING_EXEC, 4:EXECUTED, 5:ENDED }
	  result: Number,           // agenda result. AgendaResult { 0:PENDING, 1:ACCEPT, 2:REJECT, 3:DISMISS}
    group: Number,               // unused.  
    executed: Boolean ,          // true: executed, false: not executed. 
    executor: String ,           // executor   
    tCreationDate: Number,       // agenda created time   
    tNoticeEndTime:  Number,     // agenda notice end time 
    tVotingStartTime: Number,    // Voting start time,  
	  tVotingEndTime:  Number,     // Voting end time,
    tExecTime:  Number,          // Agenda execution time,
    countAbstainVotes:  Number,  // The number of votes abstained 
    countYesVotes:  Number,      // The number of votes to agree (YES)  
    countNoVotes:  Number,       // The number of votes to disagree (NO) , 
    target: [String],            // Agenda execution contract address  
    voters: [String],            // voters ( candidate address => if kind==layer2, layer2 address , else if kind== candidate, candidateContract address  )   
    chainId: Number,             // chainId mainnet:1, rinkeby: 4 
    blockNumber: Number,         // blockNumber when agenda create   
    transactionHash: String,     // tx when agenda create   
		executedTransactionHash: String,     // tx when executing agenda
		statusUpdateBlock: Number,   // blockNumber when changing status latestly  
		resultUpdateBlock: Number,   // blockNumber when changing result latestly  
    createdTime: Number,         //  
    updated: Number ,            //  
}

Agendavote

{
    agendaid: Number,    // agenda id
    voter: String,       // voter's candidateContract Address 
    hasVoted: Boolean,   // true
    vote: Number,        // Voting information { ABSTAIN:0, YES: 1, NO: 2, MAX:3 }
    comment : String,    // comment 
    createdTime: Number, 
    updated: Number ,
}

Agendacontent

{
    agendaid: Number,   // agenda id 
    creator: String,    // agenda creator
    tx: String,         // tx when agenda create  
    contents: String,   // agenda contents 
    del : Boolean, 
    chainId : Number,   // ChianId mainnet:1, rinkeby: 4 
    createdTime: Number,
    updated: Number ,
}

Layer2coinage

{
    layer2: String,              // Layer2 address
    operator: String,            // opserator  address  
    coinageAddress: String,      // coinage address 
    operatorAmount: Number,      // operator balance  
    coinageTotalSupply: Number,  // coinage totalsupply 
    totTotalSupply: Number,      // tot totalsupply 
	  chainId: Number,             // chainId mainnet:1, rinkeby: 4 
    blockNumber: Number,         // Block number at the time of aggregation
    transactionHash: String,     // Transaction hash at the time of aggregation
    createdTime: Number,
    updated: Number ,
}

Layer2 ( Operator )

{
    layer2: String,               // layer2 address : if it is dao, candidateContract address is recorded.
		candidateContract: String,    // candidateContract address  
    operator: String,             // operator address: if it is dao, it's candidate(EOA)  
    kind: String,                 // if it is dao-> candidate  , tokamak staking layer2 -> layer2  
    name: String,                 // name 
    website: String,              // website 
    description: String,          //  description 
		memberJoinedTime: Number,     // memberJoinedTime
	  indexMembers: Number,         // indexMembers
    rewardPeriod: Number,         // Member activity period
    claimedTimestamp: Number,      // Member activity fee paid time 
    chainId: Number,              // chainId mainnet:1, rinkeby: 4 
    blockNumber: Number,          // Block number at the time of adding the information, 
    transactionHash: String,      // Transaction hash at the time of adding the information
    updateCoinageBlock:Number,    // Block number at the time of the most recent Layer2coinage field update  
    updateCoinageTime: Number,    // Time of the most recent Layer2coinage field update time 
    updateCoinageTotal:Number,    // Total amount of coinage at the time of the most recent Layer2coinage field update
    createdTime: Number,    
    updated: Number ,
}

DAO Candidate

{
    candidate: String,            // EOA for dao, CA (layer2 address) for layer2  
		candidateContract: String,    // candidateContract  address 
    kind: String,                 // Layer 2 type, dao-> candidate, existing layer2 -> layer2  
    name: String,                 //   
    website: String,              //   
    description: String,          //   
    chainId: Number,              //   mainnet:1, rinkeby: 4 
    blockNumber: Number,          // Block number at the time of adding the information, 
    transactionHash: String,      // Transaction hash at the time of adding the information
    updateCoinageBlock:Number,    // Block number at the time of the most recent Layer2coinage field update    
    updateCoinageTime: Number,    // Time of the most recent Layer2coinage field update time  
    updateCoinageTotal:Number,    // Total amount of coinage at the time of the most recent Layer2coinage field update
}