diff --git a/src/controller/admin/memberController.ts b/src/controller/admin/memberController.ts index 61c1385..efc5011 100644 --- a/src/controller/admin/memberController.ts +++ b/src/controller/admin/memberController.ts @@ -1,6 +1,16 @@ import { Request, Response } from "express"; import MemberService from "../../service/memberService"; import MemberFactory from "../../factory/admin/member"; +import MembershipService from "../../service/membershipService"; +import MembershipFactory from "../../factory/admin/membership"; +import MemberAwardService from "../../service/memberAwardService"; +import MemberAwardFactory from "../../factory/admin/memberAward"; +import MemberQualificationService from "../../service/memberQualificationService"; +import MemberQualificationFactory from "../../factory/admin/memberQualification"; +import MemberExecutivePositionService from "../../service/memberExecutivePositionService"; +import MemberExecutivePositionFactory from "../../factory/admin/memberExecutivePosition"; +import CommunicationService from "../../service/communicationService"; +import CommunicationFactory from "../../factory/admin/communication"; /** * @description get all members @@ -35,8 +45,9 @@ export async function getMemberById(req: Request, res: Response): Promise { */ export async function getMembershipsByMember(req: Request, res: Response): Promise { const memberId = parseInt(req.params.memberId); + let memberships = await MembershipService.getAll(memberId); - res.json([]); + res.json(MembershipFactory.mapToBase(memberships)); } /** @@ -47,8 +58,9 @@ export async function getMembershipsByMember(req: Request, res: Response): Promi */ export async function getAwardsByMember(req: Request, res: Response): Promise { const memberId = parseInt(req.params.memberId); + let awards = await MemberAwardService.getAll(memberId); - res.json([]); + res.json(MemberAwardFactory.mapToBase(awards)); } /** @@ -59,8 +71,9 @@ export async function getAwardsByMember(req: Request, res: Response): Promise { const memberId = parseInt(req.params.memberId); + let qualifications = await MemberQualificationService.getAll(memberId); - res.json([]); + res.json(MemberQualificationFactory.mapToBase(qualifications)); } /** @@ -71,8 +84,9 @@ export async function getQualificationsByMember(req: Request, res: Response): Pr */ export async function getExecutivePositionsByMember(req: Request, res: Response): Promise { const memberId = parseInt(req.params.memberId); + let positions = await MemberExecutivePositionService.getAll(memberId); - res.json([]); + res.json(MemberExecutivePositionFactory.mapToBase(positions)); } /** @@ -83,8 +97,9 @@ export async function getExecutivePositionsByMember(req: Request, res: Response) */ export async function getCommunicationsByMember(req: Request, res: Response): Promise { const memberId = parseInt(req.params.memberId); + let communications = await CommunicationService.getAll(memberId); - res.json([]); + res.json(CommunicationFactory.mapToBase(communications)); } /** diff --git a/src/service/membershipService.ts b/src/service/membershipService.ts index e98de73..0debf30 100644 --- a/src/service/membershipService.ts +++ b/src/service/membershipService.ts @@ -2,7 +2,7 @@ import { dataSource } from "../data-source"; import { membership } from "../entity/membership"; import InternalException from "../exceptions/internalException"; -export default abstract class Membershipervice { +export default abstract class MembershipService { /** * @description get all by member id * @param {number} memberId