openspp@2.0.2
- addToGroup(group_id, individual_id, role)
- createGroup(data, callback)
- createIndividual(data, callback)
- enroll(spp_id, program_id)
- getArea(spp_id, callback)
- getEnrolledPrograms(spp_id, callback)
- getGroup(spp_id, callback)
- getGroupMembers(spp_id, [options], callback)
- getIndividual(spp_id, callback)
- getProgram(program_id, callback)
- getPrograms([options], callback)
- getServicePoint(spp_id, callback)
- removeFromGroup(group_id, individual_id)
- searchArea(domain, [options], callback)
- searchGroup(domain, [options], callback)
- searchIndividual(domain, [options], callback)
- searchServicePoint(domain, [options], callback)
- unenroll(spp_id, program_id)
- updateGroup(group_id, data)
- updateIndividual(individual_id, data)
This adaptor exports the following from common:
- dataPath()
- dataValue()
- dateFns
- each()
- field()
- fields()
- fn()
- fnIf()
- http
- lastReferenceValue()
- merge()
- sourceValue()
Functions
addToGroup
addToGroup(group_id, individual_id, role) ⇒ Operation
add individual to group in OpenSPP
Param | Type | Description |
---|---|---|
group_id | string | group registrant id |
individual_id | string | individual registrant id |
role | string | individual role in group |
Example: create a new head for group
addToGroup("GRP_B2BRHJN2", "IND_8DUQL4M4", "Head")
Example: create a new ordinary member for group
addToGroup("GRP_B2BRHJN2", "IND_8DUQL4M4")
Example: create a new member with new role for group
addToGroup("GRP_B2BRHJN2", "IND_8DUQL4M4", "new-role-name")
createGroup
createGroup(data, callback) ⇒ Operation
create new group for OpenSPP
Param | Type | Description |
---|---|---|
data | object | registrant create data |
callback | function | An optional callback function |
Example
createGroup({ name: "Group 1" })
createIndividual
createIndividual(data, callback) ⇒ Operation
create new individual for OpenSPP
Param | Type | Description |
---|---|---|
data | object | registrant create data |
callback | function | An optional callback function |
Example
createIndividual({ name: "Individual 1" })
enroll
enroll(spp_id, program_id)
enroll registrant to program in OpenSPP
Param | Type | Description |
---|---|---|
spp_id | string | spp_id of group / individual wanted to enroll |
program_id | string | program_id of program |
Example
enroll("IND_Q4VGGZPF", "PROG_2023_00000001")
getArea
getArea(spp_id, callback) ⇒ Operation
get area by id in OpenSPP
Param | Type | Description |
---|---|---|
spp_id | string | spp_id of area |
callback | function | An optional callback function |
Example
getArea("LOC_7M92NLDH")
getEnrolledPrograms
getEnrolledPrograms(spp_id, callback) ⇒ Operation
get programs list for specific registrant from OpenSPP
Param | Type | Description |
---|---|---|
spp_id | string | spp_id of group / individual wanted to search |
callback | function | An optional callback function |
Example
getEnrolledPrograms("IND_Q4VGGZPF")
getGroup
getGroup(spp_id, callback) ⇒ Operation
get group information from OpenSPP
Param | Type | Description |
---|---|---|
spp_id | string | The spp_id of the group |
callback | function | An optional callback function |
Example
getGroup("GRP_Q4VGGZPF")
getGroupMembers
getGroupMembers(spp_id, [options], callback) ⇒ Operation
get group members information from OpenSPP
Param | Type | Default | Description |
---|---|---|---|
spp_id | string | The name of the group | |
[options] | object | {} | Searching options, eg: limit for limiting number of records returning, order for searching order, offset for skipping records |
callback | function | An optional callback function |
Example
getGroupMembers("GRP_Q4VGGZPF")
getIndividual
getIndividual(spp_id, callback) ⇒ Operation
get individual information from OpenSPP
Param | Type | Description |
---|---|---|
spp_id | string | The spp_id of the individual |
callback | function | An optional callback function |
Example
getIndividual("IND_Q4VGGZPF")
getProgram
getProgram(program_id, callback) ⇒ Operation
get program information from OpenSPP
Param | Type | Description |
---|---|---|
program_id | string | searching domain |
callback | function | An optional callback function |
Example
getProgram("PROG_2023_00000001")
getPrograms
getPrograms([options], callback) ⇒ Operation
get programs list from OpenSPP
Param | Type | Default | Description |
---|---|---|---|
[options] | number | {} | offset from start |
callback | function | An optional callback function |
Example
getPrograms(100)
getServicePoint
getServicePoint(spp_id, callback) ⇒ Operation
get service points information from OpenSPP
Param | Type | Description |
---|---|---|
spp_id | string | The spp_id of the agent |
callback | function | An optional callback function |
Example
getServicePoint("SVP_8P4KP4RT")
removeFromGroup
removeFromGroup(group_id, individual_id) ⇒ Operation
remove individual from group in OpenSPP
Param | Type | Description |
---|---|---|
group_id | string | group registrant id |
individual_id | string | individual registrant id |
Example
removeFromGroup("GRP_B2BRHJN2", "IND_8DUQL4M4")
searchArea
searchArea(domain, [options], callback) ⇒ Operation
searching for service point in OpenSPP
Param | Type | Default | Description |
---|---|---|---|
domain | Array | searching domain | |
[options] | object | {} | Searching options, eg: limit for limiting number of records returning, order for searching order, offset for skipping records |
callback | function | An optional callback function |
Example: search without offset
searchArea([["code", "=", "10732"]])
Example: search with offset
searchArea([["kind", "=", 1]], { offset: 10 }})
searchGroup
searchGroup(domain, [options], callback) ⇒ Operation
get groups from OpenSPP
Param | Type | Default | Description |
---|---|---|---|
domain | Array | searching domain | |
[options] | object | {} | Searching options, eg: limit for limiting number of records returning, order for ordering search, offset for skipping records |
callback | function | An optional callback function |
Example: search group by domain
searchGroup([["spp_id", "=", "GRP_Q4VGGZPF"]])
Example: search group by domain with offset
searchGroup([["spp_id", "ilike", "GRP"]], { offset: 100 }})
Example: search group by complex domain for more accuracy
searchGroup([["address", "!=", false], ["phone", "!=", false]])
searchIndividual
searchIndividual(domain, [options], callback) ⇒ Operation
get individuals from OpenSPP
Param | Type | Default | Description |
---|---|---|---|
domain | Array | searching domain | |
[options] | object | {} | Searching options, eg: limit for limiting number of records returning, order for searching order, offset for skipping records |
callback | function | An optional callback function |
Example: search individual by domain
searchIndividual([["spp_id", "=", "IND_Q4VGGZPF"]])
Example: search individual by domain with offset
searchIndividual([["spp_id", "ilike", "IND"]], { offset: 100 })
Example: search individual by complex domain for more accuracy
searchIndividual([["address", "!=", false], ["birthdate", "=", false]])
searchServicePoint
searchServicePoint(domain, [options], callback) ⇒ Operation
searching for service point in OpenSPP
Param | Type | Default | Description |
---|---|---|---|
domain | Array | searching domain | |
[options] | object | {} | Searching options, eg: limit for limiting number of records returning, order for searching order, offset for skipping records |
callback | function | An optional callback function |
Example: search without offset
searchServicePoint([["name", "ilike", "agent 1"]])
Example: search with offset
searchServicePoint([["name", "ilike", "agent 1"]], { offset: 100 })
unenroll
unenroll(spp_id, program_id)
unenroll registrant from program in OpenSPP
Param | Type | Description |
---|---|---|
spp_id | string | spp_id of group / individual wanted to unenroll |
program_id | string | program_id of program |
Example
unenroll("IND_Q4VGGZPF", "PROG_2023_00000001")
updateGroup
updateGroup(group_id, data) ⇒ Operation
update group for OpenSPP
Param | Type | Description |
---|---|---|
group_id | string | group registrant id |
data | object | registrant update data |
Example
updateGroup("GRP_B2BRHJN2", { name: "Group 1" })
updateIndividual
updateIndividual(individual_id, data) ⇒ Operation
update individual for OpenSPP
Param | Type | Description |
---|---|---|
individual_id | string | individual registrant id |
data | object | registrant update data |
Example
updateIndividual("IND_8DUQL4M4", { name: "Individual 1" })