Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
/pkg/
/spec/reports/
/tmp/
/faithteams-api/*.env

# rspec failure tracking
.rspec_status
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [4.5.0]

### Added

1. Add Bruno API Client (to eventually replace ThunderClient). (IN-2728)

## [4.4.0]

### Changed
Expand Down
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
faithteams-api (4.4.0)
faithteams-api (4.5.0)
activesupport (~> 7.2.2)
http (~> 5.1)
logger (~> 1.6.1)
Expand Down
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,25 @@ Or install it yourself as:

`gem install faithteams`

## VS Code Bruno Extension

We are now using the [Bruno API Client](https://docs.usebruno.com/introduction/what-is-bruno) for developing and testing 2nd party API requests. You can use a desktop app or VS Code extension to use Bruno.

### Desktop App

1. Simply follow these instructions for your desktop app [installation options](https://docs.usebruno.com/get-started/bruno-basics/download).

### VS Code Extension

1. If you don't already have it, install the VS Code Bruno Extension.
1. After opening the extension, click the + button to open a "collection".
1. Find the root level '[second_party]-api' directory. (ie 'faithteams-api')
1. Make a copy of the .env.template file (and make sure to just call it .env) and fill in the necessary values from 1Password.
1. In the left pane, open the ... menu beside faithteams-api and select *settings*.
1. Select your desired environment to use with this collection in the upper right (most likely *FaithTeams*).
1. You should now be ready to make some API calls!
1. See Bruno's [VS Code Extension Documentation](https://docs.usebruno.com/vs-code-extension/overview) for more details.

## Contributing

### How to Contribute
Expand Down
4 changes: 4 additions & 0 deletions faithteams-api/.env.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# API V1 & V2
user_id=
password=
user_credentials=<user_id>:<password>
25 changes: 25 additions & 0 deletions faithteams-api/Authenticate.bru
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
meta {
name: Authenticate
type: http
seq: 1
}

get {
url: https://api.faithteams.com/api/v1/authenticate
body: none
auth: basic
}

auth:basic {
username: {{process.env.user_id}}
password: {{process.env.password}}
}

script:post-response {
let body = res.getBody();
bru.setEnvVar("auth_token", body.data.token);
}

settings {
encodeUrl: true
}
23 changes: 23 additions & 0 deletions faithteams-api/api-v2.faithteams.com/Batch/Batch Create.bru
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
meta {
name: Batch Create
type: http
seq: 3
}

post {
url: https://api-v2.faithteams.com/batches
body: json
auth: inherit
}

body:json {
{
"title":"Tithely 2023-07-19 Bank",
"dtm":"2023-07-19 00:00:00",
"status":"O"
}
}

settings {
encodeUrl: true
}
19 changes: 19 additions & 0 deletions faithteams-api/api-v2.faithteams.com/Batch/Batch Totals.bru
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
meta {
name: Batch Totals
type: http
seq: 4
}

get {
url: https://api-v2.faithteams.com/batches/totals?batchIds={{batch_id}},{{batch_id_2}}
body: none
auth: inherit
}

params:query {
batchIds: {{batch_id}},{{batch_id_2}}
}

settings {
encodeUrl: true
}
27 changes: 27 additions & 0 deletions faithteams-api/api-v2.faithteams.com/Batch/Batch Update.bru
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
meta {
name: Batch Update
type: http
seq: 5
}

put {
url: https://api-v2.faithteams.com/batches/{{batch_id}}
body: json
auth: inherit
}

body:json {
{
"orgId": {{organization_id}},
"status": "D",
"title": "Tithely 2023-07-19 Bank",
"dtm": "2023-07-19 00:00:00",
"updatedDtm": "2023-08-28 23:45:44",
"updatedUser": 27985,
"contributions": []
}
}

settings {
encodeUrl: true
}
15 changes: 15 additions & 0 deletions faithteams-api/api-v2.faithteams.com/Batch/Batch.bru
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
meta {
name: Batch
type: http
seq: 2
}

get {
url: https://api-v2.faithteams.com/batches/{{batch_id}}
body: none
auth: inherit
}

settings {
encodeUrl: true
}
32 changes: 32 additions & 0 deletions faithteams-api/api-v2.faithteams.com/Batch/Batches.bru
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
meta {
name: Batches
type: http
seq: 1
}

get {
url: https://api-v2.faithteams.com/batches?sort=dtm&sortDirection=desc&dtm=2023-08-28
body: none
auth: inherit
}

params:query {
sort: dtm
sortDirection: desc
dtm: 2023-08-28
~status: O
~title: 2023-08-28 Central Campus Tithely Card
~limit:
~start:
~batchIds: 200782
}

script:post-response {
let body = res.getBody();
bru.setEnvVar("batch_id", String(body.data[0].batchId));
bru.setEnvVar("batch_id_2", String(body.data[1].batchId));
}

settings {
encodeUrl: true
}
8 changes: 8 additions & 0 deletions faithteams-api/api-v2.faithteams.com/Batch/folder.bru
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
meta {
name: Batch
seq: 1
}

auth {
mode: inherit
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
meta {
name: Contribution Type
type: http
seq: 2
}

get {
url: https://api-v2.faithteams.com/contributiontypes/{{contribution_type_id}}
body: none
auth: inherit
}

settings {
encodeUrl: true
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
meta {
name: Contribution Types
type: http
seq: 1
}

get {
url: https://api-v2.faithteams.com/contributiontypes
body: none
auth: inherit
}

script:post-response {
let body = res.getBody();
bru.setEnvVar("contribution_type_id", String(body.data[0].contributionTypeId));
}

settings {
encodeUrl: true
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
meta {
name: Contribution Type
seq: 4
}

auth {
mode: inherit
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
meta {
name: Contribution Create
type: http
seq: 3
}

post {
url: https://api-v2.faithteams.com/contributions
body: json
auth: inherit
}

body:json {
[
{
"recordType":"H",
"personId":779137,
"batchId":195770,
"amount":"100.00",
"fee":"2.00",
"netAmount":"98.00",
"contributionTypeId":24,
"status":"A",
"note":"Date: 2023-07-17, Method: card, Memo: for the animals"
},
{
"recordType":"D",
"fundId":7894,
"personId":779137,
"batchId":195770,
"amount":"100.00",
"fee":"2.00",
"netAmount":"98.00"
}
]
}

settings {
encodeUrl: true
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
meta {
name: Contribution
type: http
seq: 2
}

get {
url: https://api-v2.faithteams.com/contributions/{{contribution_parent_id}}
body: none
auth: inherit
}

settings {
encodeUrl: true
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
meta {
name: Contributions
type: http
seq: 1
}

get {
url: https://api-v2.faithteams.com/contributions?startDt=1923-01-01&endDt=2033-01-01&resultType=sum&statuses=A
body: none
auth: inherit
}

params:query {
startDt: 1923-01-01
endDt: 2033-01-01
resultType: sum
statuses: A
~filters: true
~personIds: 769839
~groupBy: personId,fundId
~limit: 500
~sort: dtm
~sortDirection: asc
}

script:post-response {
let body = res.getBody();
bru.setEnvVar("contribution_id", String(body.data[0].contributionId));
bru.setEnvVar("contribution_parent_id", String(body.data[0].parentId));
}

settings {
encodeUrl: true
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
meta {
name: Contribution
seq: 3
}

auth {
mode: inherit
}
15 changes: 15 additions & 0 deletions faithteams-api/api-v2.faithteams.com/Error/Integer Too Big.bru
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
meta {
name: Integer Too Big
type: http
seq: 2
}

get {
url: https://api-v2.faithteams.com/contributiontypes/9999999999999
body: none
auth: inherit
}

settings {
encodeUrl: true
}
15 changes: 15 additions & 0 deletions faithteams-api/api-v2.faithteams.com/Error/Not Found.bru
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
meta {
name: Not Found
type: http
seq: 1
}

get {
url: https://api-v2.faithteams.com/contributiontypes/9999999
body: none
auth: inherit
}

settings {
encodeUrl: true
}
Loading