Skip to content

Commit 3c35c46

Browse files
Merge pull request #3 from topcoder-platform/feature-search-skills-financial
Search, Skills, and Financials
2 parents 5c6392e + a6fbe16 commit 3c35c46

31 files changed

+3634
-425
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ The following parameters can be set in config files or in env variables:
4444
- EMAIL_VERIFY_AGREE_URL: email verify agree URL, the <emailVerifyToken> will be replaced with generated verify token
4545
- EMAIL_VERIFY_DISAGREE_URL: email verify disagree URL
4646
- SCOPES: the configurable M2M token scopes, refer `config/default.js` for more details
47-
47+
- SEARCH_MEMBERS_ADMIN_ONLY_FIELDS: only admin and M2M can view these fields for search members API
4848

4949
Set the following environment variables used by bus API to get TC M2M token (use 'set' insted of 'export' for Windows OS):
5050
```
@@ -54,7 +54,7 @@ export AUTH0_URL=https://topcoder-dev.auth0.com/oauth/token
5454
export AUTH0_AUDIENCE=https://m2m.topcoder-dev.com/
5555
```
5656

57-
Also properly configure AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_REGION, ATTACHMENT_S3_BUCKET, IS_LOCAL_DB config parameters.
57+
Also properly configure AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_REGION, PHOTO_S3_BUCKET, IS_LOCAL_DB config parameters.
5858

5959
Test configuration is at `config/test.js`. You don't need to change them.
6060
The following test parameters can be set in config file or in env variables:
@@ -88,7 +88,7 @@ It starts Elasticsearch, DynamoDB and S3 compatible server.
8888
3. Initialize/Clear database: `npm run init-db`
8989
4. Create Elasticsearch index: `npm run init-es`, or to re-create index: `npm run init-es force`
9090
5. Seed/Insert data to ES and DB: `npm run seed-data`
91-
6. View DB table data: `npm run view-db-data <ModelName>`, ModelName can be `Member`, `MemberDistributionStats`, `MemberHistoryStats` or `MemberStats`
91+
6. View DB table data: `npm run view-db-data <ModelName>`, ModelName can be `Member`, `MemberDistributionStats`, `MemberHistoryStats`, `MemberStats`, `MemberSkill` or `MemberFinancial`
9292
7. View ES data: `npm run view-es-data`
9393

9494
## Local Deployment
@@ -169,6 +169,6 @@ Refer to the verification document `Verification.md`
169169
because there is seed-data script to setup data to test the members API,
170170
the tests also have setup data properly
171171
- the tests use mock S3 service, so you may use the provided mock AWS credential for tests,
172-
but Postman tests require using real AWS S3, you need to follow README.md to create S3 bucket and provide your own AWS credential
172+
but Postman tests require using real AWS S3, you need to follow above to create S3 bucket and provide your own AWS credential
173173
so that the upload photo API works
174174

Verification.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
- run the Postman tests
88

99
## DynamoDB Verification
10-
Run command `npm run view-db-data <ModelName>` to view table data, ModelName can be `Member`, `MemberDistributionStats`, `MemberHistoryStats` or `MemberStats`
10+
Run command `npm run view-db-data <ModelName>` to view table data, ModelName can be `Member`, `MemberDistributionStats`, `MemberHistoryStats`, `MemberStats`, `MemberSkill` or `MemberFinancial`
1111

1212
## S3 Verification
1313

app-bootstrap.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,7 @@
22
* App bootstrap
33
*/
44
global.Promise = require('bluebird')
5+
const Joi = require('joi')
6+
7+
Joi.page = () => Joi.number().integer().min(1).default(1)
8+
Joi.perPage = () => Joi.number().integer().min(1).max(100).default(20)

config/default.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,5 +62,8 @@ module.exports = {
6262
UPDATE: process.env.SCOPE_MEMBERS_UPDATE || 'update:members',
6363
ALL: process.env.SCOPE_MEMBERS_ALL || 'all:members'
6464
}
65-
}
65+
},
66+
// only admin and M2M can view these fields for search members API
67+
SEARCH_MEMBERS_ADMIN_ONLY_FIELDS: process.env.SEARCH_MEMBERS_ADMIN_ONLY_FIELDS
68+
? process.env.SEARCH_MEMBERS_ADMIN_ONLY_FIELDS.split(',') : ['firstName', 'lastName']
6669
}

0 commit comments

Comments
 (0)