Skip to content

Implement getCompany(<companyId>) endpoint on the backend #14

@izzyconner

Description

@izzyconner

Implement a new Company module, with CompanyController and CompanyService classes similar to what can be found for the UserModule. Create an endpoint that, given a company ID, gets the company data and all the user data or at least user IDs for that company.

Currently, there is a BreaktimeCompanyToUsers table in DynamoDB. In the backend code, there is a method called GetCompanyData in apps/backend/src/dynamodb.ts:88 that can read the data from this table and return it formatted as CompanySchema found in apps/backend/src/db/schemas/CompanyUsers.ts.

There should be a getCompany(<companyId>) endpoint on the backend that will return the data from this table for a given company.

The schema for a company and the data that is returned by this endpoint should be:

CompanyId: string,
CompanyName: string,
AssociateIds: string[],
SupervisorIds: string[]

If there is no company that can be found from the given companyId, the endpoint should return an error, like a 404 Not Found.

As a stretch goal, the endpoint should retrieve the UserData for each associate and supervisor (this can be done by utilizing the existing methods in UserService and combine that data in the response, so the return schema looks like:

CompanyId: string,
CompanyName: string,
AssociateIds: UserModel[],
SupervisorIds: UserModel[]

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions