Skip to content
Merged
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
177 changes: 176 additions & 1 deletion docs/Member API.postman_collection.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"info": {
"_postman_id": "6b1e570c-0cc5-4836-a38e-f1031dd7e14e",
"_postman_id": "f145acb8-7605-4f62-8b70-e54daccc574f",
"name": "Member API",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
"_exporter_id": "23458"
Expand Down Expand Up @@ -1502,6 +1502,181 @@
"response": []
}
]
},
{
"name": "Migrate Verify",
"item": [
{
"name": "Search Member",
"request": {
"auth": {
"type": "noauth"
},
"method": "GET",
"header": [],
"url": {
"raw": "http://localhost:3000/v6/members?perPage=20&page=1",
"protocol": "http",
"host": [
"localhost"
],
"port": "3000",
"path": [
"v6",
"members"
],
"query": [
{
"key": "handle",
"value": "phead",
"disabled": true
},
{
"key": "perPage",
"value": "20"
},
{
"key": "page",
"value": "1"
}
]
}
},
"response": []
},
{
"name": "Get Member",
"request": {
"auth": {
"type": "noauth"
},
"method": "GET",
"header": [],
"url": {
"raw": "http://localhost:3000/v6/members/phead",
"protocol": "http",
"host": [
"localhost"
],
"port": "3000",
"path": [
"v6",
"members",
"phead"
]
}
},
"response": []
},
{
"name": "Get Member Traits",
"request": {
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJyb2xlcyI6WyJUb3Bjb2RlciBVc2VyIiwiQ29ubmVjdCBTdXBwb3J0IiwiYWRtaW5pc3RyYXRvciIsInRlc3RSb2xlIiwiYWFhIiwidG9ueV90ZXN0XzEiLCJDb25uZWN0IE1hbmFnZXIiLCJDb25uZWN0IEFkbWluIiwiY29waWxvdCIsIkNvbm5lY3QgQ29waWxvdCBNYW5hZ2VyIl0sImlzcyI6Imh0dHBzOi8vYXBpLnRvcGNvZGVyLWRldi5jb20iLCJoYW5kbGUiOiJUb255SiIsImV4cCI6MTk4MDk5Mjc4OCwidXNlcklkIjoiODU0Nzg5OSIsImlhdCI6MTU0OTc5MTYxMSwiZW1haWwiOiJ0amVmdHMrZml4QHRvcGNvZGVyLmNvbSIsImp0aSI6ImY5NGQxZTI2LTNkMGUtNDZjYS04MTE1LTg3NTQ1NDRhMDhmMSJ9.q_Db9Gw8bn54xlythrZZUrJQyak-XrdOwPsj6ddgZ4M",
"type": "string"
}
]
},
"method": "GET",
"header": [],
"url": {
"raw": "http://localhost:3000/v6/members/phead/traits",
"protocol": "http",
"host": [
"localhost"
],
"port": "3000",
"path": [
"v6",
"members",
"phead",
"traits"
]
}
},
"response": []
},
{
"name": "Get Stats",
"request": {
"auth": {
"type": "noauth"
},
"method": "GET",
"header": [],
"url": {
"raw": "http://localhost:3000/v6/members/phead/stats",
"protocol": "http",
"host": [
"localhost"
],
"port": "3000",
"path": [
"v6",
"members",
"phead",
"stats"
]
}
},
"response": []
},
{
"name": "Get History Stats",
"request": {
"auth": {
"type": "noauth"
},
"method": "GET",
"header": [],
"url": {
"raw": "http://localhost:3000/v6/members/phead/stats/history",
"protocol": "http",
"host": [
"localhost"
],
"port": "3000",
"path": [
"v6",
"members",
"phead",
"stats",
"history"
]
}
},
"response": []
},
{
"name": "Get Skills",
"request": {
"auth": {
"type": "noauth"
},
"method": "GET",
"header": [],
"url": {
"raw": "http://localhost:3000/v6/members/phead/skills",
"protocol": "http",
"host": [
"localhost"
],
"port": "3000",
"path": [
"v6",
"members",
"phead",
"skills"
]
}
},
"response": []
}
]
}
]
}
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
"seed-data": "node src/scripts/seed-data.js",
"reset-db": "prisma migrate reset",
"test": "mocha -t 20000 test/unit/*.test.js --exit",
"test:cov": "nyc --reporter=html --reporter=text npm test"
"test:cov": "nyc --reporter=html --reporter=text npm test",
"migrate-dynamo-data": "node src/scripts/migrate-dynamo-data.js"
},
"author": "TCSCODER",
"license": "none",
Expand Down
12 changes: 12 additions & 0 deletions prisma/migrations/20250802022415_migrate_change/migration.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
-- AlterEnum
ALTER TYPE "DeviceType" ADD VALUE 'Other';

-- AlterTable
ALTER TABLE "member" ADD COLUMN "country" TEXT;

-- AlterTable
ALTER TABLE "memberTraitDevice" ADD COLUMN "osLanguage" TEXT,
ADD COLUMN "osVersion" TEXT;

-- AlterTable
ALTER TABLE "memberTraitOnboardChecklist" ADD COLUMN "skip" BOOLEAN;
6 changes: 6 additions & 0 deletions prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ model member {
newEmailVerifyToken String?
newEmailVerifyTokenDate DateTime?
addresses memberAddress[]

country String?
homeCountryCode String?
competitionCountryCode String?
photoURL String?
Expand Down Expand Up @@ -585,6 +587,7 @@ enum DeviceType {
Smartphone
Tablet
Wearable
Other
}

model memberTraitDevice {
Expand All @@ -596,6 +599,8 @@ model memberTraitDevice {
manufacturer String
model String
operatingSystem String
osVersion String?
osLanguage String?

memberTraits memberTraits @relation(fields: [memberTraitId], references: [id], onDelete: Cascade)

Expand Down Expand Up @@ -768,6 +773,7 @@ model memberTraitOnboardChecklist {
date DateTime
message String
status String
skip Boolean?
metadata Json?

memberTraits memberTraits @relation(fields: [memberTraitId], references: [id], onDelete: Cascade)
Expand Down
1 change: 1 addition & 0 deletions src/scripts/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
module.exports = {
apiUrl: 'https://api.topcoder-dev.com/v5/members',
fileLocation: '../member_data',
migrateLocation: '../migrate-data',
handleList: [
// data science
'ACRush',
Expand Down
Loading