Skip to content
This repository has been archived by the owner on Nov 5, 2020. It is now read-only.

telemark/avtale-logg

Repository files navigation

Build Status js-standard-style

avtale-logg

Log for avtale status

API

All API calls needs an Authorization header with valid jwt

$ http GET https://logs.service.io/agreements/5ac770926ae9e948ebc0bb47 'Authorization: Bearer <INSERT TOKEN>'

PUT /agreements

Add a new agreement

$ http PUT https://logs.service.io/agreements userid=12345 agreementId=98765 'Authorization: Bearer <INSERT TOKEN>'

GET /agreements/:id

Get a specific agreement

$ http GET https://logs.service.io/agreements/5ac770926ae9e948ebc0bb47 'Authorization: Bearer <INSERT TOKEN>'

GET /agreements/parts/:partId

Get all parts for an agreement using the partId

$ http GET https://logs.service.io/agreements/parts/42405aab-466e-4459-ac17-7f2c96f4ec19 'Authorization: Bearer <INSERT TOKEN>'

POST /agreements/:id

Updates agreement

$ http POST https://logs.service.io/agreements/5ac770926ae9e948ebc0bb47 status=signed 'Authorization: Bearer <INSERT TOKEN>'

POST /agreements/search

Search agreements

$ http POST https://logs.service.io/agreements/search status=signed 'Authorization: Bearer <INSERT TOKEN>'

GET /stats/total

Get total amount of agreements

$ http GET https://logs.service.io/stats/total

Filter by agreementType

$ http GET https://logs.service.io/stats/total?agreementType=elevpc

GET /stats/total/:status

Get total amount of agreements with a given status

$ http GET https://logs.service.io/stats/total/signed

Filter by agreementType

$ http GET https://logs.service.io/stats/total/signed?agreementType=elevpc

GET /stats/status

Get total amount of different agreement statuses

$ http GET https://logs.service.io/stats/status

Filter by agreementType

$ http GET https://logs.service.io/stats/status?agreementType=elevpc

GET /stats/types

Get total amount of different agreement types

$ http GET https://logs.service.io/stats/types

Filter by agreementType

$ http GET https://logs.service.io/stats/types?agreementType=elevpc

GET /stats/read

Get total amount of different read statuses

$ http GET https://logs.service.io/stats/read

Filter by agreementType

$ http GET https://logs.service.io/stats/read?agreementType=elevpc

GET /stats/agreements

Get total amount of different signed statuses grouped by agreementIds

$ http GET https://logs.service.io/stats/agreements

Filter by agreementType

$ http GET https://logs.service.io/stats/agreements?agreementType=elevpc

Deployment - ZEIT/Now

Change content of now.json to match your environment.

Deploy service.

$ npm run deploy

Related

License

MIT