The legacy terms processor code is provided under legacy-terms-processor folder
To verify the process from end to end (Terms API -> Kafka -> Processor -> Informix), follow the instructions below
-------------- Start dependencies Informix + Kafka + Postgres -------------- Follow instructions below to start all the dependencies:
cd legacy-terms-processor/dependencies-docker
- update env.sh to match your environment and run
source env.sh
- run
docker-compose up
This will start the following services: Informix database, Zookeeper, Kafka and Postgres database
--------------------- Start the processor ---------------- To start the processor, follow the instructions below:
cd legacy-terms-processor/docker
- run
docker-compose up
---------------------- tc-bus-api setup ----------------- To setup tc-bus-api, follow the instructions below (tested with Node 8.2.1):
-
git clone [email protected]:topcoder-platform/tc-bus-api.git
-
cd tc-bus-api
-
npm install
-
To bypass token validation locally update node_modules/tc-core-library-js/lib/auth/verifier.js manually and add this to line 23: callback(undefined, decodedToken.payload); return;
-
Set the next env mandatory environment variables:
export KAFKA_URL=localhost:9092
export JWT_TOKEN_SECRET=secret
export VALID_ISSUERS="[\"https:\/\/topcoder-newauth.auth0.com\/\",\"https:\/\/api.topcoder-dev.com\"]"
PORT=8002 npm start
------------------ Start terms-service -------------- To start the terms api follow instructions below: terms-service git repo is located at : https://github.com/topcoder-platform/terms-service
cd terms-service
- rename env.sh.sample to env.sh, update it and run
source env.sh
- run
export BUSAPI_URL=http://localhost:8002/v5
to configure the terms api to use the bus api setup locally - run
npm run init-db
- run
npm run test-data
- run
npm start
------------------- Postman Verification -------------- Open postman and load the collection/environment provided under submission/postman and run the provided tests from top to bottom.
For terms of use tests, you can check Informix database before and after each test using the SQL statements below:
select * from common_oltp:terms_of_use;
select * from common_oltp:terms_of_use_docusign_template_xref;
The output of the SQL statement above will be similar to: https://gyazo.com/44aeb617550a39d429f12bcc9bbc1fc8
Run the 'create terms of use success' test and check the following:
- terms-api output: https://gyazo.com/db7ad9cc1f1be1e0deda03f033013d67
- processor output: https://gyazo.com/aaa21cd466f70b6d522d328322488d15
- Informix database: https://gyazo.com/380e2dc43c81909d28b555060d691783
For agree terms of use, check the content of this table 'common_oltp:user_terms_of_use_xref' before and after the test:
select * from common_oltp:user_terms_of_use_xref
For resource terms of use, the following Informix table content can be checked 'common_oltp:project_role_terms_of_use_xref'