Skip to content

Commit b5b0934

Browse files
Resolve conflicts
2 parents 8a81f6e + 3c35c46 commit b5b0934

32 files changed

+6012
-429
lines changed

README.md

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

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

59-
Also properly configure AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_REGION, ATTACHMENT_S3_BUCKET, IS_LOCAL_DB config parameters.
59+
Also properly configure AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_REGION, PHOTO_S3_BUCKET, IS_LOCAL_DB config parameters.
6060

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

9696
## Local Deployment
@@ -167,6 +167,12 @@ Refer to the verification document `Verification.md`
167167
## Notes
168168

169169
- all JWT tokens provided in Postman environment file and tests are created in `https://jwt.io` with secret `mysecret`
170+
- you don't need to setup the (https://github.com/topcoder-platform/member-processor-es),
171+
because there is seed-data script to setup data to test the members API,
172+
the tests also have setup data properly
173+
- the tests use mock S3 service, so you may use the provided mock AWS credential for tests,
174+
but Postman tests require using real AWS S3, you need to follow above to create S3 bucket and provide your own AWS credential
175+
so that the upload photo API works
170176

171177
- you don't need to setup the (https://github.com/topcoder-platform/member-processor-es),
172178
because there is seed-data script to setup data to test the members API,

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`, `MemberTrait`
10+
Run command `npm run view-db-data <ModelName>` to view table data, ModelName can be `Member`, `MemberTrait`, `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
@@ -66,5 +66,8 @@ module.exports = {
6666
UPDATE: process.env.SCOPE_MEMBERS_UPDATE || 'update:members',
6767
ALL: process.env.SCOPE_MEMBERS_ALL || 'all:members'
6868
}
69-
}
69+
},
70+
// only admin and M2M can view these fields for search members API
71+
SEARCH_MEMBERS_ADMIN_ONLY_FIELDS: process.env.SEARCH_MEMBERS_ADMIN_ONLY_FIELDS
72+
? process.env.SEARCH_MEMBERS_ADMIN_ONLY_FIELDS.split(',') : ['firstName', 'lastName']
7073
}

0 commit comments

Comments
 (0)