Skip to content

Instantly share code, notes, and snippets.

@fostergn
Last active January 24, 2023 07:27
Show Gist options
  • Save fostergn/09fbb6fe879a49e1917fa0b75ed9e162 to your computer and use it in GitHub Desktop.
Save fostergn/09fbb6fe879a49e1917fa0b75ed9e162 to your computer and use it in GitHub Desktop.
Ticket Breakdown

Overview

These tickets could be more granular, but I combined implementation details and acceptance criteria into a single set of bullet point items. Depending on the needs of the engineer it would be easy to accompany with more detailed instruction, or a loom walkthrough / kickoff.

Table of Contents

Database migration and ORM model
Update CSV Output
Update getShiftsByFacility
CRUD API Endpoint
Add form field in UI

Database Migration and Agents Model

Migrate database agents table to include new text column custom_facility_agent_id and update ORM model in API to reflect the changes.

Estimate

2-5 hours

Acceptance Criteria

  • Add a text column custom_facility_agent_id to agents table for all environments (dev, staging, prod)
  • Commit migration file and run (/migrations/[date-time]-create-agents.js)
  • Update agents ORM model in API (/models/agents.js)

Update CSV Output

Render custom_facility_agent_id in CSV

Estimate

1-3 hours

Acceptance criteria

  • CSV includes custom_facility_agent_id when exists on agent
  • CSV agent metadata structure is name, id, phone, email, custom facility agent id
  • Integration test coverage includes case for custom_facility_agent_id existing and is null.

Update getShiftsByFacility

Include new custom_facility_agent_id field in agent metadata when fetching shifts by facility.

Estimate

1-3 hours

Acceptance criteria

  • Make sure that the agent metadata returned from getShiftsByFacility() includes custom_facility_agent_id
  • Test coverage includes unit tests for new column existing and null

CRUD API Endpoint

Update API endpoints api.app.io/:facility_id/:agent_id

Estimate

3-5 hours

Acceptance criteria

  • Include custom_facility_agent_id in CRUD API endpoints
  • Add validation to endpoint (alphanumeric, nullable)
  • Add functional tests for endpoints (create, read, update, and delete)

Add form field in UI

Update UI on app.io/:facility_id/:agent_id to text field to add or update the custom facility id for an agent.

Estimate

2-4 hours

Acceptance criteria

  • Include custom_facility_agent_id form field that accepts alphanumeric characters (using text component)
  • Form label will include (optional)
  • Input will show "please only use alphanumeric characters" if input contains any unaccepted character types.
  • Form will show "toast" error component if the input is invalid
  • Add cypress tests for smoketest, submitting the form, and invalid chars
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment