-
Notifications
You must be signed in to change notification settings - Fork 402
/
reward.go
64 lines (60 loc) · 1.93 KB
/
reward.go
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
// Copyright (C) 2019 Storj Labs, Inc.
// See LICENSE for copying information.
package consoleql
import (
"github.com/graphql-go/graphql"
)
const (
// RewardType is a graphql type for reward.
RewardType = "reward"
// FieldAwardCreditInCent is a field name for award credit amount for referrers.
FieldAwardCreditInCent = "awardCreditInCent"
// FieldInviteeCreditInCents is a field name for credit amount rewarded to invitees.
FieldInviteeCreditInCents = "inviteeCreditInCents"
// FieldRedeemableCap is a field name for the total redeemable amount of the reward offer.
FieldRedeemableCap = "redeemableCap"
// FieldAwardCreditDurationDays is a field name for the valid time frame of current award credit.
FieldAwardCreditDurationDays = "awardCreditDurationDays"
// FieldInviteeCreditDurationDays is a field name for the valid time frame of current invitee credit.
FieldInviteeCreditDurationDays = "inviteeCreditDurationDays"
// FieldExpiresAt is a field name for the expiration time of a reward offer.
FieldExpiresAt = "expiresAt"
// FieldType is a field name for the type of reward offers.
FieldType = "type"
// FieldStatus is a field name for the status of reward offers.
FieldStatus = "status"
)
func graphqlReward() *graphql.Object {
return graphql.NewObject(graphql.ObjectConfig{
Name: RewardType,
Fields: graphql.Fields{
FieldID: &graphql.Field{
Type: graphql.Int,
},
FieldAwardCreditInCent: &graphql.Field{
Type: graphql.Int,
},
FieldInviteeCreditInCents: &graphql.Field{
Type: graphql.Int,
},
FieldRedeemableCap: &graphql.Field{
Type: graphql.Int,
},
FieldAwardCreditDurationDays: &graphql.Field{
Type: graphql.Int,
},
FieldInviteeCreditDurationDays: &graphql.Field{
Type: graphql.Int,
},
FieldType: &graphql.Field{
Type: graphql.Int,
},
FieldStatus: &graphql.Field{
Type: graphql.Int,
},
FieldExpiresAt: &graphql.Field{
Type: graphql.String,
},
},
})
}