-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypes.graphql
More file actions
196 lines (151 loc) · 5.61 KB
/
types.graphql
File metadata and controls
196 lines (151 loc) · 5.61 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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
# The following types define the data model of the example service
# based on which the GraphQL API is generated
type Location @model {
id: ID! @isUnique # read-only (managed by Graphcool)
createdAt: DateTime! # read-only (managed by Graphcool)
updatedAt: DateTime! # read-only (managed by Graphcool)
createdBy: Company! @relation(name: "CompanyLocations")
longitude: Float!
latitude: Float!
address: String
storesAttached: [Store!]! @relation(name: "LocationsStore")
}
type Store @model {
id: ID! @isUnique # read-only (managed by Graphcool)
createdAt: DateTime! # read-only (managed by Graphcool)
updatedAt: DateTime! # read-only (managed by Graphcool)
createdBy: Company! @relation(name: "CompanyStores")
name: String!
description: String
locations: [Location!]! @relation(name: "LocationsStore")
sectorsAttached: [Sector!]! @relation(name: "SectorStores")
postsAssigned: [Post!]! @relation(name: "PostStore")
}
type Sector @model {
id: ID! @isUnique # read-only (managed by Graphcool)
createdAt: DateTime! # read-only (managed by Graphcool)
updatedAt: DateTime! # read-only (managed by Graphcool)
createdBy: Company! @relation(name: "CompanySectors")
name: String!
tags: [String!]
stores: [Store!]! @relation(name: "SectorStores")
postsAssigned: [Post!]! @relation(name: "PostSectors")
}
type User @model {
id: ID! @isUnique # read-only (managed by Graphcool)
createdAt: DateTime! # read-only (managed by Graphcool)
updatedAt: DateTime! # read-only (managed by Graphcool)
group: String
fullName: String!
age: Int
gender: String
loginType: String
email: String! @isUnique
username: String! @isUnique
password: String!
facebookAccount: String @isUnique
myPromotions: [Post!]! @relation(name: "PromotionsLikeByUsers")
companiesFollowing: [Company!]! @relation(name: "CompanyFollowers")
}
type CompanyCategory @model {
id: ID! @isUnique # read-only (managed by Graphcool)
createdAt: DateTime! # read-only (managed by Graphcool)
updatedAt: DateTime! # read-only (managed by Graphcool)
name: String!
alias: String
tags: [String!]
companiesAttached: [Company!]! @relation(name: "CompanyCategories")
}
type Plan @model {
id: ID! @isUnique # read-only (managed by Graphcool)
createdAt: DateTime! # read-only (managed by Graphcool)
updatedAt: DateTime! # read-only (managed by Graphcool)
type: String!
duration: Int!
subscribedCompanies: [Company!]! @relation(name: "CompanyPlan")
}
type LegalAddress @model {
id: ID! @isUnique # read-only (managed by Graphcool)
createdAt: DateTime! # read-only (managed by Graphcool)
updatedAt: DateTime! # read-only (managed by Graphcool)
country: String!
region: String!
province: String
city: String!
address: String!
zip: String
postalCode: String
companyAttached: Company! @relation(name: "CompanyLegalAddress")
}
type Company @model {
id: ID! @isUnique # read-only (managed by Graphcool)
createdAt: DateTime! # read-only (managed by Graphcool)
updatedAt: DateTime! # read-only (managed by Graphcool)
ruc: String! @isUnique
socialReason: String! @isUnique
commercialName: String!
optionalName: String
categories: [CompanyCategory!]! @relation(name: "CompanyCategories")
postCount: Int @defaultValue(value: 0)
activePlan: Plan! @relation(name: "CompanyPlan")
locations: [Location!]! @relation(name: "CompanyLocations")
stores: [Store!]! @relation(name: "CompanyStores")
sectors: [Sector!]! @relation(name: "CompanySectors")
posts: [Post!]! @relation(name: "CompanyPosts")
legalAddress: LegalAddress! @relation(name: "CompanyLegalAddress")
logoImage: String!
@defaultValue(
value: "http://13.90.253.208:9300/api/v1/i/milkyway/default.png"
) # @migrationValue(value: "http://13.90.253.208:9300/api/v1/i/milkyway/default.png")
email: String! @isUnique
password: String!
termsConditions: String! @migrationValue(value: "blblblbl...")
staticPhone: String!
movilPhone: String!
followers: [User!]! @relation(name: "CompanyFollowers")
}
type KindOfPublic @model {
id: ID! @isUnique # read-only (managed by Graphcool)
createdAt: DateTime! # read-only (managed by Graphcool)
updatedAt: DateTime! # read-only (managed by Graphcool)
minAge: Int! @defaultValue(value: 0)
maxAge: Int! @defaultValue(value: 100)
gender: String! @defaultValue(value: "all")
availableDays: String! @defaultValue(value: "L,M,X,J,V,S,D") # L,M,X,J,V,S,D
lowerHour: String! @defaultValue(value: "00:00") # HH:MM
upperHour: String! @defaultValue(value: "23:59") # HH:MM
postAttached: Post @relation(name: "PublicForPost")
}
type Post @model {
id: ID! @isUnique # read-only (managed by Graphcool)
createdAt: DateTime! # read-only (managed by Graphcool)
updatedAt: DateTime! # read-only (managed by Graphcool)
expireAt: DateTime
isActive: Boolean # @migrationValue(value: true)
by: Company! @relation(name: "CompanyPosts")
title: String! @defaultValue(value: "Untitle Post")
type: String
image: String
description: String
address: String
shows: Int! @defaultValue(value: 0)
targetPublic: KindOfPublic! @relation(name: "PublicForPost")
tags: String! #@migrationValue(value: "")
locationBySectors: [Sector!]! @relation(name: "PostSectors")
locationByStores: [Store!]! @relation(name: "PostStore")
usersLiked: [User!]! @relation(name: "PromotionsLikeByUsers")
stock: Int! @defaultValue(value: 0)
}
# added by email-password template: (please uncomment)
# type User @model {
# # Required system field:
# id: ID! @isUnique # read-only (managed by Graphcool)
#
# # Optional system fields (remove if not needed):
# createdAt: DateTime! # read-only (managed by Graphcool)
# updatedAt: DateTime! # read-only (managed by Graphcool)
#
# email: String! @isUnique
# password: String!
# }
#