Skip to content

add stats and history endpoints #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions ReadMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ The following parameters can be set in config files or in env variables:
- BUSAPI_URL: Bus API URL
- KAFKA_ERROR_TOPIC: Kafka error topic used by bus API wrapper
- GROUPS_API_URL: Groups API URL
- AMAZON.AWS_ACCESS_KEY_ID: The Amazon certificate key to use when connecting.
- AMAZON.AWS_ACCESS_KEY_ID: The Amazon certificate key to use when connecting.
- AMAZON.AWS_SECRET_ACCESS_KEY: The Amazon certificate access key to use when connecting.
- AMAZON.AWS.SESSION_TOKEN: The user session token, used when developing locally against the TC dev AWS services
- AMAZON.AWS_REGION: The Amazon certificate region to use when connecting.
Expand Down Expand Up @@ -167,7 +167,7 @@ These commands will set auth0 and event bus api to local mock server.
## Tests


Make sure you have followed above steps to
Make sure you have followed above steps to
- setup db and config db url
- setup local mock api and set local configs
- it will really call service and mock api
Expand Down
1 change: 1 addition & 0 deletions app-bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ Joi.page = () => Joi.number().integer().min(1).default(1)
Joi.perPage = () => Joi.number().integer().min(1).max(100).default(50)
Joi.size = () => Joi.number().integer().min(1).max(1000).default(500)
Joi.sort = () => Joi.string().default('asc')
Joi.positive = () => Joi.number().integer().min(0)
601 changes: 591 additions & 10 deletions docs/Member API.postman_collection.json

Large diffs are not rendered by default.

12 changes: 12 additions & 0 deletions prisma/migrations/20250719113542_init2/migration.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/*
Warnings:

- You are about to drop the column `subTrackId` on the `memberDataScienceHistoryStats` table. All the data in the column will be lost.

*/
-- AlterTable
ALTER TABLE "memberDataScienceHistoryStats" DROP COLUMN "subTrackId";

-- AlterTable
ALTER TABLE "memberMaxRating" ALTER COLUMN "track" DROP NOT NULL,
ALTER COLUMN "subTrack" DROP NOT NULL;
41 changes: 20 additions & 21 deletions prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ model member {

model memberAddress {
id BigInt @id @default(autoincrement())
userId BigInt
userId BigInt
streetAddr1 String?
streetAddr2 String?
city String?
Expand All @@ -94,8 +94,8 @@ model memberMaxRating {
id BigInt @id @default(autoincrement())
userId BigInt
rating Int
track String
subTrack String
track String?
subTrack String?
ratingColor String

createdAt DateTime @default(now())
Expand Down Expand Up @@ -156,7 +156,7 @@ model distributionStats {
ratingRange3700To3799 Int
ratingRange3800To3899 Int
ratingRange3900To3999 Int


createdAt DateTime @default(now())
createdBy String
Expand Down Expand Up @@ -216,7 +216,7 @@ model memberDevelopHistoryStats {
createdBy String
updatedAt DateTime? @updatedAt
updatedBy String?

@@index([historyStatsId])
}

Expand All @@ -231,25 +231,24 @@ model memberDataScienceHistoryStats {
placement Int
percentile Float
subTrack String
subTrackId Int

historyStats memberHistoryStats @relation(fields: [historyStatsId], references: [id], onDelete: Cascade)

createdAt DateTime @default(now())
createdBy String
updatedAt DateTime? @updatedAt
updatedBy String?

@@index([historyStatsId])
}

model memberStats {
id BigInt @id @default(autoincrement())
userId BigInt

memberRatingId BigInt?
maxRating memberMaxRating? @relation(fields: [memberRatingId], references: [id], onDelete: NoAction)

challenges Int?
wins Int?
develop memberDevelopStats?
Expand Down Expand Up @@ -367,7 +366,7 @@ model memberDevelopStatsItem {

model memberDesignStats {
id BigInt @id @default(autoincrement())
memberStatsId BigInt
memberStatsId BigInt
challenges BigInt?
wins BigInt?
mostRecentSubmission DateTime?
Expand Down Expand Up @@ -441,7 +440,7 @@ model memberDataScienceStats {

model memberSrmStats {
id BigInt @id @default(autoincrement())
dataScienceStatsId BigInt
dataScienceStatsId BigInt

challenges BigInt?
wins BigInt?
Expand Down Expand Up @@ -591,7 +590,7 @@ enum DeviceType {
model memberTraitDevice {
id BigInt @id @default(autoincrement())

memberTraitId BigInt
memberTraitId BigInt

deviceType DeviceType
manufacturer String
Expand Down Expand Up @@ -619,7 +618,7 @@ enum SoftwareType {
model memberTraitSoftware {
id BigInt @id @default(autoincrement())

memberTraitId BigInt
memberTraitId BigInt

softwareType SoftwareType
name String
Expand All @@ -645,7 +644,7 @@ enum ServiceProviderType {
model memberTraitServiceProvider {
id BigInt @id @default(autoincrement())

memberTraitId BigInt
memberTraitId BigInt

type ServiceProviderType
name String
Expand Down Expand Up @@ -676,7 +675,7 @@ enum WorkIndustryType {
model memberTraitWork {
id BigInt @id @default(autoincrement())

memberTraitId BigInt
memberTraitId BigInt

industry WorkIndustryType?
companyName String
Expand All @@ -698,7 +697,7 @@ model memberTraitWork {
model memberTraitEducation {
id BigInt @id @default(autoincrement())

memberTraitId BigInt
memberTraitId BigInt

collegeName String
degree String
Expand All @@ -717,7 +716,7 @@ model memberTraitEducation {
model memberTraitBasicInfo {
id BigInt @id @default(autoincrement())

memberTraitId BigInt
memberTraitId BigInt

userId BigInt
country String
Expand All @@ -743,7 +742,7 @@ model memberTraitBasicInfo {
model memberTraitLanguage {
id BigInt @id @default(autoincrement())

memberTraitId BigInt
memberTraitId BigInt

language String
spokenLevel String?
Expand All @@ -763,7 +762,7 @@ model memberTraitLanguage {
model memberTraitOnboardChecklist {
id BigInt @id @default(autoincrement())

memberTraitId BigInt
memberTraitId BigInt

listItemType String // Like 'profile_completed'
date DateTime
Expand All @@ -784,7 +783,7 @@ model memberTraitOnboardChecklist {
model memberTraitPersonalization {
id BigInt @id @default(autoincrement())

memberTraitId BigInt
memberTraitId BigInt

key String?
value Json?
Expand All @@ -802,7 +801,7 @@ model memberTraitPersonalization {
model memberTraitCommunity {
id BigInt @id @default(autoincrement())

memberTraitId BigInt
memberTraitId BigInt

communityName String
status Boolean
Expand Down
Loading