community-organization-oper.../packages/api
Yohann Paris 404cfbbcaf Add an `userActiveEngagements` endpoints to GraphQL 2022-05-27 12:15:01 -04:00
..
config Change the limit to the main config file 2022-05-26 15:33:22 -04:00
migrations lint fixes 2022-03-07 13:57:01 -08:00
scripts replace bcrypt with bcrypt.js 2022-03-04 12:31:20 -08:00
src Add an `userActiveEngagements` endpoints to GraphQL 2022-05-27 12:15:01 -04:00
.gitignore add API automigrate 2021-09-29 11:52:49 -07:00
README.md
babel.config.js use custom babel stack in api 2021-10-29 17:02:59 -07:00
createSeedData.ts replace bcrypt with bcrypt.js 2022-03-04 12:31:20 -08:00
docker-compose.yml update docker-compose settings 2021-12-06 11:14:08 -08:00
jest.config.js
jest.setup.js get api tests running with decorator syntax 2021-10-29 16:21:33 -07:00
migrateMongo.ts update migration scripts to import reflect-metadata 2021-11-01 09:46:58 -07:00
nodemon.json
package.json add development config to API; streamline configs 2022-03-11 12:11:40 -08:00
tsconfig.json get api tests running with decorator syntax 2021-10-29 16:21:33 -07:00
writeDeployPackage.ts add app endpoint for viewing version 2021-10-26 11:46:01 -07:00

README.md

Project Greenlight REST API

Endpoints

/api/orgs

  • Organizations are CBOs

/api/orgs/{id}

  • Unassigned org?

/api/orgs/{id}/contacts

  • View queue of contacts for this org

/api/users

  • Users are Navigators, Admins, members of CBOs

/api/users/{id}

/api/users/{id}/contacts

  • view queue of contacts for this user

/api/contacts?status=<unassigned> (basic intake form)

  • Contacts are client dossiers, their public info, audit log

/api/contacts/{id}

/api/contacts/{id}/assignments

  • active assignments with a non-closed status
  • Assign to Organization Inbox (multi-assign possible)
    • Assign to Individual in Org (multi-assign possible)

/api/contacts/{id}/comments

  • text comments regarding a contact

/api/contacts/{id}/engagements

  • Record of engagements with CBOs and an individual contact, created from assignments when complete
    • Date, name of CBO, other fields may/may not be accessible per engagement

Data Models

Contact

{
	"id": "<generated_id>",
	"data": {
		// Basic contact info - look up contact schema
		"first_name": "..",
		"last_name": "..",
		"contacts": [
			{ "phone": ".." },
			{ "instagram": ".." },
			{ "whatsapp": ".." }
		],
		"addresses": [
			{
				// address data
			}
		]
	},
	"additional_data": {
		"<org_id>": {
			// data hash - encrypted, differential access to view
		}
	},
	"engagements": ["engagement_url"]
}

Comment

{
	"id": "<generated_id>",
	"data": {
		"author": "user id",
		"timestamp": "<ISO 8601 timestamp>",
		"text": "this guy was a jerk"
	}
}

Engagement

{
	"id": "<generated_id>",
	"data": {
		// mandatory data
		"start_timestamp": "<ISO 8601 timestamp>",
		"end_timestamp": "<ISO 8601 timestamp>",
		"comments": "this guy was a jerk"
	},
	"additional_data": {
		// CBO DATA fields
		"shot_brand": "moderna"
	}
}

Organization

{
	"id": "<generated_id",
	"data": {
		"name": "Cureamericas"
	}
}