Skip to content

Commit 5d77a1e

Browse files
authored
Merge pull request #3 from stevenfrog/stats-and-history-apis
add stats and history endpoints
2 parents ecc2bc7 + e70c080 commit 5d77a1e

File tree

11 files changed

+2465
-51
lines changed

11 files changed

+2465
-51
lines changed

ReadMe.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ The following parameters can be set in config files or in env variables:
8686
- BUSAPI_URL: Bus API URL
8787
- KAFKA_ERROR_TOPIC: Kafka error topic used by bus API wrapper
8888
- GROUPS_API_URL: Groups API URL
89-
- AMAZON.AWS_ACCESS_KEY_ID: The Amazon certificate key to use when connecting.
89+
- AMAZON.AWS_ACCESS_KEY_ID: The Amazon certificate key to use when connecting.
9090
- AMAZON.AWS_SECRET_ACCESS_KEY: The Amazon certificate access key to use when connecting.
9191
- AMAZON.AWS.SESSION_TOKEN: The user session token, used when developing locally against the TC dev AWS services
9292
- AMAZON.AWS_REGION: The Amazon certificate region to use when connecting.
@@ -167,7 +167,7 @@ These commands will set auth0 and event bus api to local mock server.
167167
## Tests
168168

169169

170-
Make sure you have followed above steps to
170+
Make sure you have followed above steps to
171171
- setup db and config db url
172172
- setup local mock api and set local configs
173173
- it will really call service and mock api

app-bootstrap.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ Joi.page = () => Joi.number().integer().min(1).default(1)
88
Joi.perPage = () => Joi.number().integer().min(1).max(100).default(50)
99
Joi.size = () => Joi.number().integer().min(1).max(1000).default(500)
1010
Joi.sort = () => Joi.string().default('asc')
11+
Joi.positive = () => Joi.number().integer().min(0)

docs/Member API.postman_collection.json

Lines changed: 591 additions & 10 deletions
Large diffs are not rendered by default.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/*
2+
Warnings:
3+
4+
- You are about to drop the column `subTrackId` on the `memberDataScienceHistoryStats` table. All the data in the column will be lost.
5+
6+
*/
7+
-- AlterTable
8+
ALTER TABLE "memberDataScienceHistoryStats" DROP COLUMN "subTrackId";
9+
10+
-- AlterTable
11+
ALTER TABLE "memberMaxRating" ALTER COLUMN "track" DROP NOT NULL,
12+
ALTER COLUMN "subTrack" DROP NOT NULL;

prisma/schema.prisma

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ model member {
7272

7373
model memberAddress {
7474
id BigInt @id @default(autoincrement())
75-
userId BigInt
75+
userId BigInt
7676
streetAddr1 String?
7777
streetAddr2 String?
7878
city String?
@@ -94,8 +94,8 @@ model memberMaxRating {
9494
id BigInt @id @default(autoincrement())
9595
userId BigInt
9696
rating Int
97-
track String
98-
subTrack String
97+
track String?
98+
subTrack String?
9999
ratingColor String
100100
101101
createdAt DateTime @default(now())
@@ -156,7 +156,7 @@ model distributionStats {
156156
ratingRange3700To3799 Int
157157
ratingRange3800To3899 Int
158158
ratingRange3900To3999 Int
159-
159+
160160
161161
createdAt DateTime @default(now())
162162
createdBy String
@@ -216,7 +216,7 @@ model memberDevelopHistoryStats {
216216
createdBy String
217217
updatedAt DateTime? @updatedAt
218218
updatedBy String?
219-
219+
220220
@@index([historyStatsId])
221221
}
222222

@@ -231,25 +231,24 @@ model memberDataScienceHistoryStats {
231231
placement Int
232232
percentile Float
233233
subTrack String
234-
subTrackId Int
235234
236235
historyStats memberHistoryStats @relation(fields: [historyStatsId], references: [id], onDelete: Cascade)
237236
238237
createdAt DateTime @default(now())
239238
createdBy String
240239
updatedAt DateTime? @updatedAt
241240
updatedBy String?
242-
241+
243242
@@index([historyStatsId])
244243
}
245244

246245
model memberStats {
247246
id BigInt @id @default(autoincrement())
248247
userId BigInt
249-
248+
250249
memberRatingId BigInt?
251250
maxRating memberMaxRating? @relation(fields: [memberRatingId], references: [id], onDelete: NoAction)
252-
251+
253252
challenges Int?
254253
wins Int?
255254
develop memberDevelopStats?
@@ -367,7 +366,7 @@ model memberDevelopStatsItem {
367366

368367
model memberDesignStats {
369368
id BigInt @id @default(autoincrement())
370-
memberStatsId BigInt
369+
memberStatsId BigInt
371370
challenges BigInt?
372371
wins BigInt?
373372
mostRecentSubmission DateTime?
@@ -441,7 +440,7 @@ model memberDataScienceStats {
441440

442441
model memberSrmStats {
443442
id BigInt @id @default(autoincrement())
444-
dataScienceStatsId BigInt
443+
dataScienceStatsId BigInt
445444
446445
challenges BigInt?
447446
wins BigInt?
@@ -591,7 +590,7 @@ enum DeviceType {
591590
model memberTraitDevice {
592591
id BigInt @id @default(autoincrement())
593592
594-
memberTraitId BigInt
593+
memberTraitId BigInt
595594
596595
deviceType DeviceType
597596
manufacturer String
@@ -619,7 +618,7 @@ enum SoftwareType {
619618
model memberTraitSoftware {
620619
id BigInt @id @default(autoincrement())
621620
622-
memberTraitId BigInt
621+
memberTraitId BigInt
623622
624623
softwareType SoftwareType
625624
name String
@@ -645,7 +644,7 @@ enum ServiceProviderType {
645644
model memberTraitServiceProvider {
646645
id BigInt @id @default(autoincrement())
647646
648-
memberTraitId BigInt
647+
memberTraitId BigInt
649648
650649
type ServiceProviderType
651650
name String
@@ -676,7 +675,7 @@ enum WorkIndustryType {
676675
model memberTraitWork {
677676
id BigInt @id @default(autoincrement())
678677
679-
memberTraitId BigInt
678+
memberTraitId BigInt
680679
681680
industry WorkIndustryType?
682681
companyName String
@@ -698,7 +697,7 @@ model memberTraitWork {
698697
model memberTraitEducation {
699698
id BigInt @id @default(autoincrement())
700699
701-
memberTraitId BigInt
700+
memberTraitId BigInt
702701
703702
collegeName String
704703
degree String
@@ -717,7 +716,7 @@ model memberTraitEducation {
717716
model memberTraitBasicInfo {
718717
id BigInt @id @default(autoincrement())
719718
720-
memberTraitId BigInt
719+
memberTraitId BigInt
721720
722721
userId BigInt
723722
country String
@@ -743,7 +742,7 @@ model memberTraitBasicInfo {
743742
model memberTraitLanguage {
744743
id BigInt @id @default(autoincrement())
745744
746-
memberTraitId BigInt
745+
memberTraitId BigInt
747746
748747
language String
749748
spokenLevel String?
@@ -763,7 +762,7 @@ model memberTraitLanguage {
763762
model memberTraitOnboardChecklist {
764763
id BigInt @id @default(autoincrement())
765764
766-
memberTraitId BigInt
765+
memberTraitId BigInt
767766
768767
listItemType String // Like 'profile_completed'
769768
date DateTime
@@ -784,7 +783,7 @@ model memberTraitOnboardChecklist {
784783
model memberTraitPersonalization {
785784
id BigInt @id @default(autoincrement())
786785
787-
memberTraitId BigInt
786+
memberTraitId BigInt
788787
789788
key String?
790789
value Json?
@@ -802,7 +801,7 @@ model memberTraitPersonalization {
802801
model memberTraitCommunity {
803802
id BigInt @id @default(autoincrement())
804803
805-
memberTraitId BigInt
804+
memberTraitId BigInt
806805
807806
communityName String
808807
status Boolean

0 commit comments

Comments
 (0)