Members
(constant) async :*
This class is used for Platform datatype and is NOT used for churches anymore. Churches, Orgs, Comunnities are stored in Moment. see moment.js
Type:
- *
- Source:
Methods
adopt(data, user) → {Promise.<(string|void)>}
A relationship or journey adopting a Plan. It will copy all the schedules and populate the content calendars accordingly
Parameters:
| Name | Type | Description |
|---|---|---|
data |
||
user |
- Source:
Returns:
updated by Calvin Ho on 2/23/20
- Type
- Promise.<(string|void)>
checkSubscriptionAllowance(req, res) → {string}
Parameters:
| Name | Type | Description | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
req |
Properties
|
||||||||||
res |
- Source:
Returns:
- Type
- string
confirmTempUser(url, callback)
Transfer a temporary user from the temporary collection to the persistent user collection, removing the URL assigned to it.
Parameters:
| Name | Type | Description |
|---|---|---|
url |
string | the randomly generated URL assigned to a unique email |
callback |
function | the callback function |
- Source:
hasAdminAccess(req, res, next) → {Promise.<void>}
Parameters:
| Name | Type | Description |
|---|---|---|
req |
||
res |
||
next |
||
req.params.communityId: |
Church object of interest |
|
req.query.version: |
version number updated on 4/14/2020 by Calvin Ho |
- Source:
Returns:
- Type
- Promise.<void>
healthScoreMetrics()
retrieve the latest app usage date of a user / activity.
Parameters:
| Name | Type | Description |
|---|---|---|
req.user: |
user calling method. |
|
req.query.type: |
user / activity. |
|
req.query.activity: |
activity id. |
|
req.query.user: |
user id - currently the user is not required and all users of an activity are returned. |
- Source:
Example
- retrieve the health score of the restvo team activity
https://server2.dev.restvo.com/api/systemlog/healthscoremetrics?type=user&user=5e78cabb085b2f2c11cbf79b&activity=5e883c05d34c524758d12148
healthScoreMetrics()
retrieve the latest app usage date of a user / activity.
Parameters:
| Name | Type | Description |
|---|---|---|
req.user: |
user calling method. |
|
req.query.type: |
user / activity. |
|
req.query.activity: |
activity id. |
|
req.query.user: |
user id - currently the user is not required and all users of an activity are returned. |
- Source:
Example
- retrieve the health score of the restvo team activity
https://server2.dev.restvo.com/api/systemlog/healthscoremetrics?type=user&user=5e78cabb085b2f2c11cbf79b&activity=5e883c05d34c524758d12148
loadChurchAppUsers(res, next) → {Promise.<void>}
Load All App Users
Parameters:
| Name | Type | Description |
|---|---|---|
req.params.church: |
the Restvo object id |
|
req.query.searchKeyword: |
the search string |
|
req.query.pageNum: |
the page number for paging |
|
res |
||
next |
- Source:
Returns:
- Type
- Promise.<void>
Example
used in createchat.page.js and pickpeople-popover.page.js for retrieving users in Restvo
loadCommunityParticipants(req, res) → {Object}
retrieve all participant IDs of relationships within a Community
Parameters:
| Name | Type | Description |
|---|---|---|
req |
||
res |
- Source:
Returns:
returns an object with property community_participants which contains an array of participant IDs
- Type
- Object
Example
https://app.restvo.com/api/payment/loadcommunityparticipants/5dd63a26969bb024311d82bd
{
"community_participants": [
"5dc0ecaf8d035854261c990a",
"596d4fbfdd53ac40156db4d5",
"5df5339669f2546c0a26a570",
"5bec6e17fe4c444d57952784",
"5dd8cfc73950367b39f8e125"
]
}
updated by Calvin Ho on 4/11/2020
loadMetrics() → {Promise.<void>}
retrieves the system logs based on filtering parameters
Parameters:
| Name | Type | Description |
|---|---|---|
req.query.topic |
the topic of system log |
|
req.query.type |
the type of metrics (activity or user) |
|
req.query.durationUnit |
the unit of the duration |
|
req.query.user |
user id |
|
req.query.activity |
activity id can be either a parent program ID or an activity ID |
|
req.query.durationValue |
the value of the duration |
|
req.query.timeMeasurement |
how the systemlogs will be grouped |
|
req.query.activity: |
parent program ID |
|
req.query.activity: |
relationship ID https://server2.restvo.com/api/systemlogs/testmetrics?durationUnit=day&activity=5d5785b462489003817fee1&type=activity&durationValue=3&timeMeasurement=day |
- Source:
Returns:
- Type
- Promise.<void>
Examples
1 - retrieve a particular user's metrics
https://server.restvo.com/api/systemlog/loadmetrics?durationUnit=day&type=user&durationValue=3&timeMeasurement=day&activity=5e883c05d34c524758d12148
2 - retrieve the metrics of individual user loading relationships within a parent program
https://server.restvo.com/api/systemlog/loadmetrics?durationUnit=day&type=activity&durationValue=5&timeMeasurement=day&activity=5d5785b462489003817fee18&topic=Load Activity
3 - retrieve the metrics of individual user loading a relationship
loadRelationshipContentCalendars(req, res, next) → {Promise.<*>}
load relationship content calendars
Parameters:
| Name | Type | Description | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
req |
Properties
|
||||||||||
res |
|||||||||||
next |
|||||||||||
req.params.relationshipId |
- Source:
Returns:
- Type
- Promise.<*>
Examples
admin needs a way to view content calendars in a Relationship that is administered by his organization or program
unauthenticated user can also view content calendars if the Activity has allowed it
logActivity(query, log_object) → {Promise.<void>}
Log Various User Activities
Parameters:
| Name | Type | Description |
|---|---|---|
query |
any | { topic: String, user: Object ID } |
log_object |
any | { activity: Object ID, categories: [Object ID] } |
- Source:
Returns:
- Type
- Promise.<void>
Example
Log a user sending a chat message
log_object = { topic: 'Send Message', user: ObjectId('1234588182988'), categories: [ ObjectId('4234588182988') ]}
logActivityAPI() → {json|Promise.<void>}
API middleware to log Web App User Activity
Parameters:
| Name | Type | Description |
|---|---|---|
req.body.topic |
any | type of system log |
req.body.activityId |
any | activity id |
req.body.categories |
any | activity's categories |
req.user._id |
any | user id |
- Source:
Returns:
-
JSON object of the logActivity status
- Type
- json
-
- Type
- Promise.<void>
logAppUsage() → {Promise.<void>}
API Middleware to Log Web App and Mobile App Usage
Parameters:
| Name | Type | Description |
|---|---|---|
req.query.version |
any | version of logAppUsage |
req.body.topic |
any | app usage topic |
req.body.churches |
any | user's churches |
req.body.time |
any | time of app usage |
req.user._id |
any | user id |
- Source:
Returns:
- Type
- Promise.<void>
newConversation(req, res, next) → {Promise.<*>}
Create new Connect Conversation. It will first check if the conversation already exists
Parameters:
| Name | Type | Description | ||||||
|---|---|---|---|---|---|---|---|---|
req |
Properties
|
|||||||
res |
||||||||
next |
Returns:
- Type
- Promise.<*>
resendVerificationEmail(email, callback)
Resend the verification email to the user given only their email.
Parameters:
| Name | Type | Description |
|---|---|---|
email |
object | the user's email address |
callback |
function | the callback function |
- Source:
touchSchedule(req, res, next) → {Promise.<void>}
in Manage Plan or Relationship view, provides methods to create, update, delete a schedule
Parameters:
| Name | Type | Description | ||||||
|---|---|---|---|---|---|---|---|---|
req |
Properties
|
|||||||
res |
||||||||
next |
- Source:
Returns:
- Type
- Promise.<void>
translateCustomerId(orgId) → {string}
translate orgId into stripe customer id, depending on prod/dev environments
Parameters:
| Name | Type | Description |
|---|---|---|
orgId |
- Source:
Returns:
updated by Calvin Ho on 4/12/2020
- Type
- string