Dia-Dev-Design / Dia-Dev-Design/shearly-next

Create Basic CRUD Routes for Transaction

Open
#46 0 comments 0 reactions 1 assignee Claimed by @alextor2625 View on GitHub
enhancement
Dominant language
TypeScript
Stars
0
Forks
1
PR merge metrics
No merged PRs in 30d

Description

Create routes for Transaction that allow for the following:

- Create:
- Location → "shearly-next/app/api/transaction/create/route.ts".
- Method → POST
- Goal → Given a body with dateTime, appointmentId, clientId, discount, subtotal, tax, total do the following:
- Verifies if if contains a proper dateTime.
- Verifies if a client with clientId exists.
- Verifies if an appointment with appointmentId exists.
- Finally, if everything is correct, create the transaction.

- Find All:
- Location → "shearly-next/app/api/transaction/find/route.ts".
- Method → GET
- Goal → Must be able to get all Transactions from database.

- Find By Id:
- Location → "shearly-next/app/api/transaction/find/[id]/route.ts".
- Method → GET
- Goal → Must be able to get a single Transaction by ID.

- Edit:
- Location → "shearly-next/app/api/transaction/edit/[id]/route.ts"
- Method → PUT
- Goal → Must allow to edit any property of a Transaction except Client and Appointment.

- Delete:
- Location → "shearly-next/app/api/transaction/delete/[id]/route.ts"
- Method → DELETE
- Goal → Must be able to delete a Transaction given an id.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.