credit.js
1.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
/**
* Created by Tommy Huang on 18/04/29.
*/
const sequelize = require('./db').db
const Sequelize = require('sequelize')
const Credit = sequelize.define('credit', {
id: {
type: Sequelize.STRING,
primaryKey: true
},
userId: {
field: 'user_id',
type: Sequelize.STRING,
allowNull: false,
},
name: {
type: Sequelize.STRING,
allowNull: false,
},
idNo: {
field: 'id_no',
type: Sequelize.STRING,
allowNull: false
},
phone: {
type: Sequelize.STRING,
allowNull: false
},
wechatAccount: {
field: 'wechat_account',
type: Sequelize.STRING,
allowNull: false
},
area: {
type: Sequelize.STRING,
allowNull: false
},
address: {
type: Sequelize.STRING,
allowNull: false
},
contactA: {
field: 'contact_a',
type: Sequelize.STRING,
allowNull: false,
},
contactARole: {
field: 'contact_a_role',
type: Sequelize.STRING,
allowNull: false,
},
contactAPhone: {
field: 'contact_a_phone',
type: Sequelize.STRING,
allowNull: false,
},
contactB: {
field: 'contact_b',
type: Sequelize.STRING,
allowNull: false,
},
contactBRole: {
field: 'contact_b_role',
type: Sequelize.STRING,
allowNull: false,
},
contactBPhone: {
field: 'contact_b_phone',
type: Sequelize.STRING,
allowNull: false,
},
baseCreatedTime: {
type: Sequelize.TIME,
field: 'base_created_time',
allowNull: false
},
contactATime: {
field: 'contact_a_time',
type: Sequelize.INTEGER,
allowNull: false,
},
contactBTime: {
field: 'contact_b_time',
type: Sequelize.INTEGER,
allowNull: false,
},
contactAAmount: {
field: 'contact_a_amount',
type: Sequelize.INTEGER,
allowNull: false,
},
contactBAmount: {
field: 'contact_b_amount',
type: Sequelize.INTEGER,
allowNull: false,
},
}, {
timestamp: true,
createdAt: 'created_at',
updatedAt: 'updated_at',
})
module.exports = Credit