Skip to content

Extract the stream view mapper into one place #158

Description

@Glittersup

Summary

The conversion from a stored stream to the API view shape appears in more than one route. Duplicating it means a new field can be added in one response and forgotten in another.

Acceptance criteria

  • The mapping from stored stream to API view lives in one function.
  • All routes returning a stream use it.
  • The responses are unchanged.

Getting started

Fork this repository, clone your fork, and add this repo as upstream:

git clone https://github.com/<your-username>/tricklepay-backend.git
cd tricklepay-backend
git remote add upstream https://github.com/TricklePay/tricklepay-backend.git

Create a branch for this issue:

git checkout -b refactor/issue-158

Suggested commit message:

refactor: extract the stream view mapper

Run npm run typecheck, npm test, and npm run build before opening a pull request and linking this issue.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    cleanupCode tidying with no behaviour changegood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions