forked from MyZubster-Ecosystem/myzubster
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbountyConfigModel.js
More file actions
55 lines (52 loc) 路 925 Bytes
/
Copy pathbountyConfigModel.js
File metadata and controls
55 lines (52 loc) 路 925 Bytes
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
const mongoose = require('mongoose');
const bountyConfigSchema = new mongoose.Schema({
issueNumber: {
type: Number,
required: true,
unique: true,
index: true
},
repository: {
type: String,
required: true
},
rewardAmount: {
type: Number,
required: true,
default: 10
},
currency: {
type: String,
default: 'MYZ'
},
status: {
type: String,
enum: ['open', 'claimed', 'completed', 'paid'],
default: 'open'
},
claimedBy: {
type: String,
default: null
},
prNumber: {
type: Number,
default: null
},
paidAt: {
type: Date,
default: null
},
createdAt: {
type: Date,
default: Date.now
},
updatedAt: {
type: Date,
default: Date.now
}
});
bountyConfigSchema.pre('save', function(next) {
this.updatedAt = Date.now();
next();
});
module.exports = mongoose.model('BountyConfig', bountyConfigSchema);