Skip to content

Commit 0eb2f38

Browse files
authored
Merge pull request #155 from bitholla/testnet
HollaEx Kit v1.5.0 Release
2 parents 140a9e5 + 16580b6 commit 0eb2f38

File tree

107 files changed

+6411
-23593
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

107 files changed

+6411
-23593
lines changed

Dockerfile

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
FROM bitholla/hollaex-core:1.22.0
2-
3-
RUN apt-get update && apt-get install -y git
1+
FROM bitholla/hollaex-core:1.23.1
42

53
COPY ./mail /app/mail
64

@@ -12,8 +10,6 @@ COPY ./db/seeders /app/db/seeders
1210

1311
COPY ./db/models /app/db/models
1412

15-
EXPOSE 10011
16-
1713
RUN npm install -g nodemon --loglevel=error && \
1814
cd plugins && npm install --loglevel=error && \
1915
for d in ./*/ ; do (cd "$d" && npm install --loglevel=error); done && \
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
'use strict';
2+
3+
const TABLE = 'Deposits';
4+
const COLUMN1 = 'processing';
5+
const COLUMN2 = 'waiting';
6+
7+
module.exports = {
8+
up: (queryInterface, Sequelize) => {
9+
return queryInterface
10+
.addColumn(TABLE, COLUMN1, {
11+
type: Sequelize.BOOLEAN,
12+
defaultValue: false
13+
})
14+
.then(() => {
15+
return queryInterface.addColumn(TABLE, COLUMN2, {
16+
type: Sequelize.BOOLEAN,
17+
defaultValue: false
18+
});
19+
});
20+
},
21+
down: (queryInterface) => {
22+
return queryInterface.removeColumn(TABLE, COLUMN1)
23+
.then(() => queryInterface.removeColumn(TABLE, COLUMN2));
24+
}
25+
};
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
'use strict';
2+
3+
const TABLE = 'Announcements';
4+
5+
module.exports = {
6+
up: (queryInterface, Sequelize) => {
7+
return queryInterface.createTable(
8+
TABLE,
9+
{
10+
id: {
11+
allowNull: false,
12+
autoIncrement: true,
13+
primaryKey: true,
14+
type: Sequelize.INTEGER
15+
},
16+
created_by: {
17+
type: Sequelize.INTEGER,
18+
onDelete: 'CASCADE',
19+
allowNull: false,
20+
references: {
21+
model: 'Users',
22+
key: 'id'
23+
}
24+
},
25+
title: {
26+
type: Sequelize.STRING,
27+
allowNull: false
28+
},
29+
message: {
30+
type: Sequelize.TEXT,
31+
allowNull: false
32+
},
33+
type: {
34+
type: Sequelize.STRING,
35+
allowNull: false,
36+
defaultValue: 'info'
37+
},
38+
created_at: {
39+
allowNull: false,
40+
type: Sequelize.DATE,
41+
defaultValue: Sequelize.literal('NOW()')
42+
},
43+
updated_at: {
44+
allowNull: false,
45+
type: Sequelize.DATE,
46+
defaultValue: Sequelize.literal('NOW()')
47+
}
48+
},
49+
{
50+
timestamps: true,
51+
underscored: true
52+
}
53+
);
54+
},
55+
down: (queryInterface) => queryInterface.dropTable(TABLE)
56+
};
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
'use strict';
2+
3+
const TABLE = 'Users';
4+
const COLUMN1 = 'affiliation_rate';
5+
const COLUMN2 = 'discount';
6+
7+
module.exports = {
8+
up: (queryInterface, Sequelize) => {
9+
return queryInterface.addColumn(
10+
TABLE,
11+
COLUMN1,
12+
{
13+
type: Sequelize.DOUBLE,
14+
defaultValue: 0,
15+
})
16+
.then(() => {
17+
return queryInterface.addColumn(
18+
TABLE,
19+
COLUMN2,
20+
{
21+
type: Sequelize.DOUBLE,
22+
defaultValue: 0,
23+
});
24+
});
25+
},
26+
down: (queryInterface) => {
27+
return queryInterface.removeColumn(TABLE, COLUMN1)
28+
.then(() => {
29+
return queryInterface.removeColumn(TABLE, COLUMN2);
30+
});
31+
},
32+
};

db/models/affiliation.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,5 +42,21 @@ module.exports = function(sequelize, DataTypes) {
4242
underscored: true
4343
}
4444
);
45+
46+
Affiliation.associate = (models) => {
47+
Affiliation.belongsTo(models.User, {
48+
as: 'user',
49+
foreignKey: 'user_id',
50+
targetKey: 'id',
51+
onDelete: 'CASCADE',
52+
});
53+
Affiliation.belongsTo(models.User, {
54+
as: 'referer',
55+
foreignKey: 'referer_id',
56+
targetKey: 'id',
57+
onDelete: 'CASCADE',
58+
});
59+
};
60+
4561
return Affiliation;
4662
};

db/models/announcement.js

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
module.exports = function(sequelize, DataTypes) {
2+
const Announcement = sequelize.define(
3+
'Announcement',
4+
{
5+
id: {
6+
allowNull: false,
7+
autoIncrement: true,
8+
primaryKey: true,
9+
type: DataTypes.INTEGER
10+
},
11+
created_by: {
12+
type: DataTypes.INTEGER,
13+
onDelete: 'CASCADE',
14+
allowNull: false,
15+
references: {
16+
model: 'Users',
17+
key: 'id'
18+
}
19+
},
20+
title: {
21+
type: DataTypes.STRING,
22+
allowNull: false
23+
},
24+
message: {
25+
type: DataTypes.TEXT,
26+
allowNull: false
27+
},
28+
type: {
29+
type: DataTypes.STRING,
30+
allowNull: false,
31+
defaultValue: 'info'
32+
}
33+
},
34+
{
35+
timestamps: true,
36+
underscored: true
37+
}
38+
);
39+
return Announcement;
40+
};

db/models/deposit.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,14 @@ module.exports = function(sequelize, DataTypes) {
3333
type: DataTypes.BOOLEAN,
3434
defaultValue: false
3535
},
36+
processing: {
37+
type: DataTypes.BOOLEAN,
38+
defaultValue: false
39+
},
40+
waiting: {
41+
type: DataTypes.BOOLEAN,
42+
defaultValue: false
43+
},
3644
description: {
3745
type: DataTypes.STRING,
3846
defaultValue: ''

db/models/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ model = sequelize.import('status', require('./status'));
5050
db[model.name] = model;
5151
model = sequelize.import('fee', require('./fee'));
5252
db[model.name] = model;
53+
model = sequelize.import('announcement', require('./announcement'));
54+
db[model.name] = model;
5355

5456
Object.keys(db).forEach(function(modelName) {
5557
if ('associate' in db[modelName]) {

db/models/user.js

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,14 @@ module.exports = function(sequelize, DataTypes) {
157157
custom_fee: {
158158
type: DataTypes.BOOLEAN,
159159
defaultValue: false
160+
},
161+
affiliation_rate: {
162+
type: DataTypes.DOUBLE,
163+
defaultValue: 0
164+
},
165+
discount: {
166+
type: DataTypes.DOUBLE,
167+
defaultValue: 0
160168
}
161169
},
162170
{
@@ -198,7 +206,12 @@ module.exports = function(sequelize, DataTypes) {
198206
});
199207
User.hasMany(models.OtpCode);
200208
User.hasMany(models.Login);
201-
User.hasMany(models.Affiliation);
209+
User.hasMany(models.Affiliation, {
210+
foreignKey: 'user_id'
211+
});
212+
User.hasMany(models.Affiliation, {
213+
foreignKey: 'referer_id'
214+
});
202215
User.hasMany(models.Order);
203216
User.hasMany(models.Trade, {
204217
foreignKey: 'maker_id'

db/seeders/20190825120350-add-status.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ const {
3030
SNS_SECRETACCESSKEY,
3131
VAULT_KEY,
3232
VAULT_SECRET,
33+
ZENDESK_HOST,
34+
ZENDESK_KEY,
3335
FRESHDESK_HOST,
3436
FRESHDESK_KEY,
3537
FRESHDESK_AUTH,
@@ -46,6 +48,7 @@ const status = [{
4648
constants: JSON.stringify({
4749
api_name: API_NAME || '',
4850
description: '',
51+
color: {},
4952
title: '',
5053
links: {
5154
twitter: '',
@@ -113,7 +116,8 @@ const status = [{
113116
name: VAULT_NAME || '',
114117
key: VAULT_KEY,
115118
secret: VAULT_SECRET,
116-
connected_coins: []
119+
connected_coins: [],
120+
cron_task_interval: 15
117121
},
118122
plugins: {
119123
s3: {
@@ -136,6 +140,10 @@ const status = [{
136140
host: FRESHDESK_HOST || '',
137141
key: FRESHDESK_KEY || '',
138142
auth: FRESHDESK_AUTH || ''
143+
},
144+
zendesk: {
145+
host: ZENDESK_HOST || '',
146+
key: ZENDESK_KEY || ''
139147
}
140148
}
141149
}

0 commit comments

Comments
 (0)