Back to Top

service-database 0.5.0

PHR Database Service

exports.signupUser(first_name, last_name, email, password, confirmPassword, consent, privacy_statement, reCaptchaToken, sendemail)

POST /account/signup User signup (used to creat only UserRole User)

Parameters

Name Type Description
first_name string

First name

last_name string

Last name

email string

Email

password string

Password

confirmPassword string

Confirm Password

consent boolean

Consent

privacy_statement boolean

Privacy statement

reCaptchaToken string

Google reCaptcha Token

sendemail boolean

Sendemail status

Returns

object

Response object with jwt token wirh user data

exports.loginUser(email, password, reCaptchaToken)

POST /account/login User login only by sending auth token in header

Parameters

Name Type Description
email string

Email

password string

Password

reCaptchaToken string

Google reCaptcha token

Returns

obeject

Response object with jwt token

exports.getUsers()

GET /account/auth/user Get User details for teacher,carer and clinican only by sending auth token in header

Returns

arrary

Response array

exports.getUser()

GET /account/user Get current user details only by sending auth token in header

Returns

object

Response object

exports.getUserDetail()

GET /account/userDetail Get epjs user details only by sending auth token in header

Returns

object

Resonse object

exports.getUserByToken(id)

GET /account/getUserByToken Get user detail by id with token only by sending auth token in header

Parameters

Name Type Description
id Integer

UserId

Returns

object

Response object

exports.updateUserData(consent)

PUT /account/userData Update user details only by sending auth token in header

Parameters

Name Type Description
consent String

accepting the consent.

Returns

Object

Response object

exports.updatePrivacy(terms_and_condition, privacy_statement)

GET /account/update/privacy Update privacy details only by sending auth token in header

Parameters

Name Type Description
terms_and_condition boolean

Accept terms_and_condition status

privacy_statement boolean

Accept privacy_statement status

Returns

object

Update status with message

exports.getUserProblem()

GET /account/userProblem Get user probelm and description only by sending auth token in header

Returns

object

Response object

exports.createUser(first_name, last_name, designation, organization, relationship, user_id, date_of_birth, email, password, reCaptchaToken, roles)

POST /account/auth/user Create User only by sending auth token in header

Parameters

Name Type Description
first_name string

First name

last_name string

Last name

designation string

Designation

organization string

Organization

relationship string

Relationship

user_id Integer

User id

date_of_birth date

Date of birth

email string

Email

password string

Password

reCaptchaToken string

Google reCaptcha Token

roles string

User roles

Returns

object

Response object

exports.updatePassword(current_password, new_password, confirm_password)

PUT /account/update/password Update user password only by sending auth token in header

Parameters

Name Type Description
current_password string

Current password

new_password string

New password

confirm_password string

Confirm password

Returns

obeject

Response object

exports.forgotPassword(email)

POST /account/forgot Send forgot password detils through mail only by sending auth token in header

Parameters

Name Type Description
email string

Email

Returns

object

Response object

exports.resetPassword(first_name, last_name, email, sendemail, password, confirm_password, token)

POST /account/reset Reset user password only by sending auth token in header

Parameters

Name Type Description
first_name string

First name

last_name string

Last name

email string

Email

sendemail string

Sendemail status

password string

Password

confirm_password string

Confirm password

token string

Invited token

Returns

object

Response object with jwt token

exports.getUserData()

GET /account/getUserData Get user data for apostrophe authentication only by sending auth token in header

Returns

object

Response object

exports.getNotificationStatus()

GET /account/unsubscribe Get notification status only by sending auth token in header

Returns

object

Response obect

exports.getConsentStatus()

GET /account/consent Get consent status only by sending auth token in header

Returns

object

Response object

exports.unsubscribeEmailFromAccount(userId, notification)

PUT /account/unsubscribe User unsubscribe notification only by sending auth token in header

Parameters

Name Type Description
userId Integer

User Id

notification boolean

Notification status

Returns

object

Response object

exports.updateProfile(first_name, last_name, email, phone_number)

PUT /account/update/profile Update user profile only by sending auth token in header

Parameters

Name Type Description
first_name string

First name

last_name string

Last name

email string

Email

phone_number string

Phone number

Returns

object

Response object

exports.updateProblemName(problem_name, problem_description)

PUT /account/update/problemName Update probelm name and description

Parameters

Name Type Description
problem_name string

Problem name

problem_description string

Problem description

Returns

object

Response object

exports.updateConsent(consent)

PUT /account/update/consent Update consent only by sending auth token in header

Parameters

Name Type Description
consent boolean

Consent status

Returns

object

Response object

exports.logoutUser()

PUT /account/logout User logout

Returns

object

Response object

exports.uploadProfileImg(id, useravathar)

PUT /problem/{id} Update user profile picture

Parameters

Name Type Description
id Integer

(Required) Numeric ID of the user.

useravathar String

Image of the user.

Returns

Object

Response object

exports.verification(id, signup_token)

GET /account Verify the user account

Parameters

Name Type Description
id Integer

Numeric ID of the user

signup_token String

Sign up token of the user

Returns

Object

Response object

exports.getdiary(id)

GET /diary/{id}Get user diary details

Parameters

Name Type Description
id Integer

(Required) id of the diary.

Returns

Object

Resonse object

exports.insertDiary(content)

POST /diary Save user diary details

Parameters

Name Type Description
content String

(Required) content field of the diary.

Returns

Object

Resonse object

exports.updateDiary(id, content)

PUT /diary/{id} Update user diary details

Parameters

Name Type Description
id Integer

(Required) id of the diary.

content String

(Required) content field of the diary.

Returns

Object

Resonse object

exports.getCircle()

GET /circle Get circle details

Returns

Object

Resonse object

exports.getCircleById(id)

GET /circle/{id} Get user circle details

Parameters

Name Type Description
id Integer

(Required) id of the circle.

Returns

Object

Resonse object

exports.getsharedCircleById(id)

GET /circle/{id} Get shared circle details of user by id

Parameters

Name Type Description
id Integer

Numeric ID of the circle.

Returns

Object

Resonse object

exports.getCircleReceived()

GET /circle/received Get circle received details

Returns

Object

Resonse object

exports.getCircleSend()

GET /circle/send Send circle details

Returns

Object

Resonse object

exports.createCircle(from_id, to_id, first_name, last_name, mode, status, rejected_by, contact_by)

POST /circle Save user circle details

Parameters

Name Type Description
from_id Integer

Form Id.

to_id Integer

To Id.

first_name String

First Name.

last_name String

Last Name.

mode String

Mode.

status String

Status.

rejected_by String

Rejected by.

contact_by String

Contact by.

Returns

Object

Resonse object

exports.resendInvite(id, circle_id, to_id)

GET /circle/resend/{id} Get shared circle details

Parameters

Name Type Description
id Integer

id of the circle.

circle_id Integer

circle id.

to_id String

To id.

Returns

Object

Resonse object

exports.updateUserCircle()

PUT /circle/updatePassword Update user circle password

Returns

Object

Resonse object

exports.getCircleReceived()

GET /circle/received Receiving circle details

Returns

Object

exports.updateCircle(id, from_id, to_id, first_name, last_name, mode, status, rejected_by, rejected_by)

PUT /circle/{id} Update circle detials by id

Parameters

Name Type Description
id Integer

id of the circle.

from_id Integer

Form Id.

to_id Integer

To Id.

first_name String

First Name.

last_name String

Last Name.

mode String

Mode.

status String

Status.

rejected_by String

Rejected by.

rejected_by String

Contact by.

Returns

Object

Resonse object

exports.deleteCircle(id)

DELETE /circle/{id} Delete circle details by id

Parameters

Name Type Description
id Integer

id of the circle.

Returns

Object

Resonse object

exports.getCoping()

GET /coping/{id} Get coping details or details by id

Returns

array

Resonse array

exports.createCoping(content, description, archieved)

POST /coping Save user coping details

Parameters

Name Type Description
content string

Content

description string

Description

archieved boolean

Archieved

Returns

object

Resonse object

exports.updateCoping(user_id, content, description, archieved)

PUT /coping/{id} Update coping details

Parameters

Name Type Description
user_id string

User Id

content string

Coping Title

description string

Description

archieved boolean

Archieved status

Returns

object

Resonse object

exports.deleteCoping(id)

DELETE /coping/{id} Delete coping details by id

Parameters

Name Type Description
id string

Coping Id

Returns

object

Resonse object

exports.getAllGoals()

GET /goal Get user goal details

Returns

Object

Resonse object

exports.editGoals(inputs)

GET /goal/{id} Edit particular user goal by id

Parameters

Name Type Description
inputs id

(Required) Numeric ID of the goal.

Returns

Object

Resonse object

exports.saveGoals(name, important, achieved, notes)

POST /goal Save user goal details

Parameters

Name Type Description
name String

The name of the goal.

important Boolean

User make it as important.

achieved Boolean

user make it as achieved.

notes String

User notes.

Returns

Object

Resonse object

exports.updateGoals(id, name, important, achieved, notes)

PUT /goal/{id} Update user goal details

Parameters

Name Type Description
id Integer

Numeric ID of the goal.

name String

The name of the goal.

important Boolean

User make it as important.

achieved Boolean

user make it as achieved.

notes String

User notes.

Returns

Object

Response obect

exports.deleteGoals(id)

DELETE /goal/{id} Delete goal details by id

Parameters

Name Type Description
id Integer

(Required) Numeric ID of the goal.

Returns

Object

Response object

for()

{ "id": 64, "date_time": "2020-05-11T02:00:00.000Z", "status": "completed", "step_details": { "goal_step_id": 15, "step_name": "Watch master chef", "goal_details": { "goal_id": 16, "goal_name": "Learning to cook" } } }

    {
      goal_id: 16,
      goal_name: 'foo',
      steps: [
        { entry_id: 64 ,step_id: 15, step_name: 'bar', status: 'active', date_time: '' }
      ]
    }

Returns

Void

exports.getMoodtracker()

GET /mood Get user mood details

Returns

Object

Response object

exports.insertMoodtracker(user_id, date, mood)

POST /mood Save user mood details

Parameters

Name Type Description
user_id Integer

(Required) User id.

date Date

(Required) Mood date.

mood String

User mood notes.

Returns

Object

Response object

exports.checkProblem()

GET /problem/checkProblem Get user problem details

Returns

Object

Response object

exports.getProblem(id)

Get problem by id GET /problem/{id} Get problem by id

Parameters

Name Type Description
id Integer

Numeric ID of the problem

Returns

Object

Response object

exports.createProblem(rate, note)

POST /problem Save user problem details

Parameters

Name Type Description
rate String

Rate the problem.

note String

Note the problem.

Returns

Object

Response object

exports.updateProblem(id, rate, note)

PUT /problem/{id} Update user problem details

Parameters

Name Type Description
id Integer

(Required) Numeric ID of the problem.

rate String

(Required) Rate the problem.

note String

Note the problem.

Returns

Object

Response object

exports.deleteProblem(id)

DELETE /problem/{id} Delete problem details by id

Parameters

Name Type Description
id Integer

(Required) Numeric ID of the problem.

Returns

Object

Response object

exports.checkSleep()

GET /sleep/checkSleep Check user sleep details

Returns

Object

Response object

exports.getSleeptracker(id)

GET /sleep/{id} Get all sleep trakcer details or details by id

Parameters

Name Type Description
id Integer

(Required) Numeric ID of the sleep tracker.

Returns

Object

Response object

exports.insertSleeptracker(hours_slept, wakeup_count, notes)

POST /sleep Save user sleep tracker details

Parameters

Name Type Description
hours_slept String

(Required) number of hours slept.

wakeup_count String

(Required) wake up hours count.

notes String

User notes.

Returns

Object

Response object