Skip to content

Commit

Permalink
Deactivate doc #1874 (#1878)
Browse files Browse the repository at this point in the history
* Add documentation for Family Deactivate/Activate feature

* Added  Section "How do I deactivate a Family? "
* Added  Section "How do I Activate a Deactivated Family?"

* Update API docs

Update API docs for Families Route to include
/api/families/:familyId/activate/:status
  • Loading branch information
simonkp authored and DawoudIO committed Feb 10, 2017
1 parent 53c8728 commit 31d1093
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 24 deletions.
50 changes: 26 additions & 24 deletions docs/API/Endpoint Reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ ChurchCRM leverages Slim 2.6.2 to provide REST access to the data elements.
* [GET] /api/families/search/:query
* Returns a list of the families who's name matches the :query parameter
* [GET] /api/families/lastedited
* Returns a the last 10 updated families
* Returns a the last 10 updated families
* [POST] /api/families/:familyId/activate/:status
* Update the family status to activated or deactivated with :familyId and :status true/false. Pass true to activate and false to deactivate.

## Groups
* [POST] /api/groups
Expand All @@ -26,50 +28,50 @@ ChurchCRM leverages Slim 2.6.2 to provide REST access to the data elements.
}
```
* if ```isSundaySchool``` is specified, the group will be marked as a Sunday School class, and the ```Teacher``` and ```Student``` roles will be created.

* [POST] /api/groups/:groupID/removeuser/:userID
* Removes the user with ID :userID from group with ID :groupID

* [POST] /api/groups/:groupID/adduser/:userID
* Adds the user with ID :userID to the group with ID :groupID

* [DELETE] /api/groups/:groupID
* Deletes the group with ID :groupID

* [GET] /api/groups/:groupID
* Returns a JSON objecte representing the group with ID :groupID

* [POST] /api/groups/:groupID/roles/:roleID
* Alters the role with ID :roleID for group with ID :groupID/adduser/
* Requires JSON with either "groupRoleName", or "groupRoleOrder" properties set

* [DELETE] /api/groups/:groupID/roles/:roleID
* Deletes the specified roleID in the group

* [POST] /api/groups/:groupID/defaultRole
* Sets the default role fo the group with ID :groupID
* Sets the default role fo the group with ID :groupID
* Requres JSON in the POST body with the "roleID" property set

* [POST] /api/groups/:groupID/roles/
* Creates a new group role for group with ID :groupID
* requires JSON in the POST body with roleName set to the new role's name
* [POST] /api/groups/:groupID/userRole/:userID

* [POST] /api/groups/:groupID/userRole/:userID
* Sets the role of a user in a group
* requires JSON in the POST body with roleID set to the ID of the user's role in the specified group
* [POST] /api/:groupID/setGroupSpecificPropertyStatus
* requires JSON property GroupSpecificPropertyStatus either true or false





## Deposits
* [GET] /
* Returns all deposits

* [POST] /
* Creates a new deposit
* Requires JSON body with properties: depositType, depositComment, depositDate

* [GET] /:id
* Returns the deposit with the selected ID

Expand All @@ -79,39 +81,39 @@ ChurchCRM leverages Slim 2.6.2 to provide REST access to the data elements.

* [GET] /:id/ofx
* Returns an OFX file representing the requested deposit

* [GET] /:id/pdf
* Returns a PDF file representing the requested deposit

* [GET] /:id/csv
* Returns a CSV file representing the requested deposit

* [DELETE] /:id
* Deletes the selected deposit

* [GET] /:id/payments
* Returns all payments associated with the supplied deposit ID

## Payments
* [GET] /
* Returns all payments
* [POST] /

* [POST] /
* Posts a new payment. Validates the input

* [GET] /:id
* Gets the specified payment by ID

* [GET] /byFamily/:familyID(/:fyid)
* Gets all payments be family, and optionally by the fiscal year ID

* [DELETE] /:groupKey
* Deleted the payment with the specified GroupKey
* Deleted the payment with the specified GroupKey

## Search
* [GET] /api/search/:query
* a search query. Returns all instances of Persons, Families, Groups, Deposits, Checks, Payments that match the search query


## Events
No API Calls yet for Events
Expand Down
24 changes: 24 additions & 0 deletions docs/user-guide/families.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,30 @@ There are two ways to view a family:
3. Confirm the deletion

## How do I deactivate a Family?

1. Search/Filter for the desired family, and bring up the Family View.

2. Select _"Deactivate this family"_
> If this link doesn't appear, then either you don't have permissions to Edit records, or the Family is already deactivated.
3. Confirm the deactivation

4. Once the page refreshes, You will see a banner on top with message "This family is deactivated."

## How do I Activate a Deactivated Family?

1. Search for the desired family, and bring up the Family View.

2. If the family is deactivated, you will see a banner on top with message "This family is deactivated."

3. Select _"Activate this family"_
> If this link doesn't appear, then either you don't have permissions to Edit records, or the Family is already Active.
3. Confirm the Activation

4. Once the page refreshes, the banner on top with message "This family is deactivated" will disappear and the family is active now.

## How do I assign a Property to a Family?

See the [Properties](Properties.md) help topic.
Expand Down
4 changes: 4 additions & 0 deletions src/api/routes/families.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@
return $response;
});

/**
* Update the family status to activated or deactivated with :familyId and :status true/false.
* Pass true to activate and false to deactivate. *
*/
$this->post('/{familyId:[0-9]+}/activate/{status}', function ($request, $response, $args) {
$familyId = $args["familyId"];
$newStatus = $args["status"];
Expand Down

0 comments on commit 31d1093

Please sign in to comment.