MentorsWithoutBorders / mwb-connect-backend

Apache License 2.0
3 stars 3 forks source link

issue #48 Part 1– Returns information about the centers of organizations #26

Closed paschalidi closed 1 year ago

paschalidi commented 1 year ago

Part 1 of https://github.com/MentorsWithoutBorders/mwb-partners-admin/issues/48

Description

The goal of this is to return the centers and their information for either a specific partner/organization or all of the organizations. The user can filter by date, passing the query params fromDate, toDate.

To test this locally I would suggest to add some rows in the organizations_centers table, here is what I have added

INSERT INTO "public"."organizations_centres" ("id", "name", "address", "organization_id") VALUES
('00a6fa25-df29-4701-9077-557932591764', 'FundLife Center', '123 Rizal Avenue, Barangay 678, Manila, Metro Manila, 1003, Philippines', 'd0b45a28-3640-4867-ad68-faf1c09b3983'),
('00a6fa25-df29-4701-9077-557932591768', 'Education for All Children Center', '678 Moi Avenue, Nairobi Central, Nairobi, 00100, Kenya', '82360ca6-ce95-45f6-a0e3-1c846ee5616b'),
('00a6fa25-df29-4701-9077-557932591767', 'Toptal Center', 'Kurfürstendamm 123, Charlottenburg, 10711 Berlin, Germany', 'd4a4f7c2-3257-40c3-8ea7-771a83355990'),
('00a6fa25-df29-4701-9077-557932591769', 'Anchor of Hope Center', '12 Independence Avenue, Osu, Accra, Greater Accra Region, Ghana', 'ca920041-e697-4588-a47b-1bdb2cd60528'),
('00a6fa25-df29-4701-9077-557932591780', 'Literacy Center', 'C-1/2, Rajpath Area, Connaught Place, New Delhi, Delhi 110001, India', '572f4822-bccd-4b44-b48b-1b958bf1e052') ;

To test it now on postman I would try the following endpoints:

{{url}}/partners/dashboard/organization-centers-with-students?fromDate=2023-8-19%2010:00:00%2B0
{{url}}/partners/ca920041-e697-4588-a47b-1bdb2cd60528/dashboard/organization-centers-with-students?fromDate=2023-08-19%2010:00:00%2B0

where url is localhost:4000/api/v1/ for me

Next steps

On the part 2 of this ticket I will add an endpoint which will return the information of all the students of a specific organization with The following details will be provided for each student in the response: