Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
hive
hive-dapps
Commits
fac733e7
Commit
fac733e7
authored
Aug 25, 2021
by
therealwolf
💯
Browse files
hived
parent
67598a2e
Changes
1
Hide whitespace changes
Inline
Side-by-side
backend/src/models/app.model.ts
View file @
fac733e7
import
*
as
mongoose
from
'
mongoose
'
import
*
as
moment
from
'
moment
'
export
type
AccountType
=
'
main
'
|
'
transfer
'
|
'
meta
'
|
'
curation
'
|
'
benefactor
'
import
*
as
mongoose
from
"
mongoose
"
;
import
*
as
moment
from
"
moment
"
;
export
type
AccountType
=
|
"
main
"
|
"
transfer
"
|
"
meta
"
|
"
curation
"
|
"
benefactor
"
;
export
type
AppType
=
'
app
'
|
'
dapp
'
|
'
interface
'
export
type
AppType
=
"
app
"
|
"
dapp
"
|
"
interface
"
;
const
schema
=
new
mongoose
.
Schema
({
approved
:
{
type
:
Boolean
,
default
:
false
,
required
:
true
},
hived
:
{
type
:
Boolean
,
default
:
true
,
required
:
true
},
approved
:
{
type
:
Boolean
,
default
:
true
,
required
:
true
},
display_name
:
{
type
:
String
,
required
:
true
},
name
:
{
type
:
String
,
required
:
true
,
unique
:
true
},
main_account
:
String
,
accounts
:
[
{
_id
:
false
,
_id
:
false
,
id
:
Number
,
name
:
String
,
benefactor
:
{
type
:
Boolean
,
default
:
false
},
...
...
@@ -23,8 +29,8 @@ const schema = new mongoose.Schema({
delegation
:
{
type
:
Boolean
,
default
:
false
},
posting
:
{
type
:
Boolean
,
default
:
false
},
logo
:
{
type
:
Boolean
,
default
:
false
},
account_types
:
Array
}
account_types
:
Array
,
}
,
],
app_type
:
{
type
:
String
,
required
:
true
},
short_description
:
{
type
:
String
,
required
:
false
},
...
...
@@ -35,12 +41,12 @@ const schema = new mongoose.Schema({
social
:
{
type
:
Object
,
default
:
{
github
:
''
,
discord
:
''
,
twitter
:
''
,
medium
:
''
,
reddit
:
''
}
github
:
""
,
discord
:
""
,
twitter
:
""
,
medium
:
""
,
reddit
:
""
,
}
,
},
status
:
String
,
category
:
{
type
:
String
,
required
:
true
},
...
...
@@ -49,10 +55,13 @@ const schema = new mongoose.Schema({
isFeatured
:
{
type
:
Boolean
,
default
:
false
},
hivepower
:
{
effective
:
{
type
:
Number
,
default
:
0
},
own
:
{
type
:
Number
,
default
:
0
}
own
:
{
type
:
Number
,
default
:
0
}
,
},
last_update
:
Date
,
last_update_data
:
{
type
:
String
,
default
:
moment
.
utc
().
subtract
(
62
,
'
days
'
).
toISOString
()
},
last_update_data
:
{
type
:
String
,
default
:
moment
.
utc
().
subtract
(
62
,
"
days
"
).
toISOString
(),
},
createdAt
:
{
type
:
Date
,
required
:
true
,
default
:
Date
.
now
},
rank
:
{
last_day
:
{
type
:
Number
,
default
:
0
},
...
...
@@ -60,7 +69,7 @@ const schema = new mongoose.Schema({
last_week
:
{
type
:
Number
,
default
:
0
},
before_last_week
:
{
type
:
Number
,
default
:
0
},
last_month
:
{
type
:
Number
,
default
:
0
},
before_last_month
:
{
type
:
Number
,
default
:
0
}
before_last_month
:
{
type
:
Number
,
default
:
0
}
,
},
dau
:
{
last_day
:
{
type
:
Number
,
default
:
0
},
...
...
@@ -72,7 +81,7 @@ const schema = new mongoose.Schema({
last_month
:
{
type
:
Number
,
default
:
0
},
before_last_month
:
{
type
:
Number
,
default
:
0
},
change_last_month
:
{
type
:
Number
,
default
:
0
},
last_month_array
:
[]
last_month_array
:
[]
,
},
volume
:
{
hbd
:
{
...
...
@@ -85,7 +94,7 @@ const schema = new mongoose.Schema({
last_month
:
{
type
:
Number
,
default
:
0
},
before_last_month
:
{
type
:
Number
,
default
:
0
},
change_last_month
:
{
type
:
Number
,
default
:
0
},
last_month_array
:
[]
last_month_array
:
[]
,
},
hive
:
{
last_day
:
{
type
:
Number
,
default
:
0
},
...
...
@@ -97,7 +106,7 @@ const schema = new mongoose.Schema({
last_month
:
{
type
:
Number
,
default
:
0
},
before_last_month
:
{
type
:
Number
,
default
:
0
},
change_last_month
:
{
type
:
Number
,
default
:
0
},
last_month_array
:
[]
last_month_array
:
[]
,
},
all
:
{
last_day
:
{
type
:
Number
,
default
:
0
},
...
...
@@ -109,8 +118,8 @@ const schema = new mongoose.Schema({
last_month
:
{
type
:
Number
,
default
:
0
},
before_last_month
:
{
type
:
Number
,
default
:
0
},
change_last_month
:
{
type
:
Number
,
default
:
0
},
last_month_array
:
[]
}
last_month_array
:
[]
,
}
,
},
tx
:
{
last_day
:
{
type
:
Number
,
default
:
0
},
...
...
@@ -122,7 +131,7 @@ const schema = new mongoose.Schema({
last_month
:
{
type
:
Number
,
default
:
0
},
before_last_month
:
{
type
:
Number
,
default
:
0
},
change_last_month
:
{
type
:
Number
,
default
:
0
},
last_month_array
:
[]
last_month_array
:
[]
,
},
rewards
:
{
hbd
:
{
...
...
@@ -135,7 +144,7 @@ const schema = new mongoose.Schema({
last_month
:
{
type
:
Number
,
default
:
0
},
before_last_month
:
{
type
:
Number
,
default
:
0
},
change_last_month
:
{
type
:
Number
,
default
:
0
},
last_month_array
:
[]
last_month_array
:
[]
,
},
hive
:
{
last_day
:
{
type
:
Number
,
default
:
0
},
...
...
@@ -147,7 +156,7 @@ const schema = new mongoose.Schema({
last_month
:
{
type
:
Number
,
default
:
0
},
before_last_month
:
{
type
:
Number
,
default
:
0
},
change_last_month
:
{
type
:
Number
,
default
:
0
},
last_month_array
:
[]
last_month_array
:
[]
,
},
all
:
{
last_day
:
{
type
:
Number
,
default
:
0
},
...
...
@@ -159,9 +168,9 @@ const schema = new mongoose.Schema({
last_month
:
{
type
:
Number
,
default
:
0
},
before_last_month
:
{
type
:
Number
,
default
:
0
},
change_last_month
:
{
type
:
Number
,
default
:
0
},
last_month_array
:
[]
}
last_month_array
:
[]
,
}
,
},
})
})
;
export
const
App
=
mongoose
.
model
(
'
app
'
,
schema
)
\ No newline at end of file
export
const
App
=
mongoose
.
model
(
"
app
"
,
schema
);
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment