From 91217d1e6ed62f428a8527cbcb05cf8f5df9ac4f Mon Sep 17 00:00:00 2001 From: Julian Krauser Date: Sun, 5 Jan 2025 14:29:31 +0100 Subject: [PATCH] refactoring commands & jsdoc --- .../club/calendar/calendarCommandHandler.ts | 6 +++--- .../club/member/communicationCommandHandler.ts | 8 +++----- .../club/member/memberAwardCommandHandler.ts | 14 ++++++-------- src/command/club/member/memberCommandHandler.ts | 11 +++++------ .../memberExecutivePositionCommandHandler.ts | 14 ++++++-------- .../member/memberQualificationCommandHandler.ts | 14 ++++++-------- .../club/member/membershipCommandHandler.ts | 2 -- .../club/newsletter/newsletterCommandHandler.ts | 6 +++--- .../club/protocol/protocolAgendaCommandHandler.ts | 4 ++-- .../club/protocol/protocolCommandHandler.ts | 4 ++-- .../protocol/protocolDecisionCommandHandler.ts | 4 ++-- .../protocol/protocolPresenceCommandHandler.ts | 2 +- .../protocol/protocolPrintoutCommandHandler.ts | 2 +- .../club/protocol/protocolVotingCommandHandler.ts | 4 ++-- src/command/refreshCommandHandler.ts | 4 ++-- src/command/resetCommandHandler.ts | 4 ++-- src/command/settings/award/awardCommandHandler.ts | 10 +++++----- .../calendarType/calendarTypeCommandHandler.ts | 6 +++--- .../communicationTypeCommandHandler.ts | 10 +++++----- .../executivePositionCommandHandler.ts | 10 +++++----- .../membershipStatusCommandHandler.ts | 10 +++++----- .../newsletterConfigCommandHandler.ts | 4 ++-- .../qualification/qualificationCommandHandler.ts | 10 +++++----- .../queryStore/queryStoreCommandHandler.ts | 10 +++++----- .../settings/template/templateCommandHandler.ts | 10 +++++----- .../templateUsage/templateUsageCommandHandler.ts | 2 +- src/command/user/role/roleCommandHandler.ts | 6 +++--- .../user/role/rolePermissionCommandHandler.ts | 9 ++++----- src/command/user/user/userCommandHandler.ts | 14 +++++++------- .../user/user/userPermissionCommandHandler.ts | 6 +++--- 30 files changed, 104 insertions(+), 116 deletions(-) diff --git a/src/command/club/calendar/calendarCommandHandler.ts b/src/command/club/calendar/calendarCommandHandler.ts index bb86f35..5cd89b6 100644 --- a/src/command/club/calendar/calendarCommandHandler.ts +++ b/src/command/club/calendar/calendarCommandHandler.ts @@ -7,7 +7,7 @@ import { CreateCalendarCommand, DeleteCalendarCommand, UpdateCalendarCommand } f export default abstract class CalendarCommandHandler { /** * @description create calendar - * @param CreateCalendarCommand + * @param {CreateCalendarCommand} createCalendar * @returns {Promise} */ static async create(createCalendar: CreateCalendarCommand): Promise { @@ -39,7 +39,7 @@ export default abstract class CalendarCommandHandler { /** * @description update calendar - * @param UpdateCalendarCommand + * @param {UpdateCalendarCommand} updateCalendar * @returns {Promise} */ static async update(updateCalendar: UpdateCalendarCommand): Promise { @@ -78,7 +78,7 @@ export default abstract class CalendarCommandHandler { /** * @description delete calendar - * @param DeleteCalendarCommand + * @param {DeleteCalendarCommand} deleteCalendar * @returns {Promise} */ static async delete(deleteCalendar: DeleteCalendarCommand): Promise { diff --git a/src/command/club/member/communicationCommandHandler.ts b/src/command/club/member/communicationCommandHandler.ts index c5359dc..ad6341c 100644 --- a/src/command/club/member/communicationCommandHandler.ts +++ b/src/command/club/member/communicationCommandHandler.ts @@ -1,7 +1,5 @@ import { dataSource } from "../../../data-source"; import { communication } from "../../../entity/club/member/communication"; -import { communicationType } from "../../../entity/settings/communicationType"; -import { user } from "../../../entity/user/user"; import InternalException from "../../../exceptions/internalException"; import { CreateCommunicationCommand, @@ -12,7 +10,7 @@ import { export default abstract class CommunicationCommandHandler { /** * @description create communication - * @param CreateCommunicationCommand + * @param {CreateCommunicationCommand} createCommunication * @returns {Promise} */ static async create(createCommunication: CreateCommunicationCommand): Promise { @@ -44,7 +42,7 @@ export default abstract class CommunicationCommandHandler { /** * @description update communication - * @param UpdateCommunicationCommand + * @param {UpdateCommunicationCommand} updateCommunication * @returns {Promise} */ static async update(updateCommunication: UpdateCommunicationCommand): Promise { @@ -73,7 +71,7 @@ export default abstract class CommunicationCommandHandler { /** * @description delete communication - * @param DeleteCommunicationCommand + * @param {DeleteCommunicationCommand} deleteCommunication * @returns {Promise} */ static async delete(deleteCommunication: DeleteCommunicationCommand): Promise { diff --git a/src/command/club/member/memberAwardCommandHandler.ts b/src/command/club/member/memberAwardCommandHandler.ts index 054699f..0a02e01 100644 --- a/src/command/club/member/memberAwardCommandHandler.ts +++ b/src/command/club/member/memberAwardCommandHandler.ts @@ -1,6 +1,4 @@ import { dataSource } from "../../../data-source"; -import { award } from "../../../entity/settings/award"; -import { member } from "../../../entity/club/member/member"; import { memberAwards } from "../../../entity/club/member/memberAwards"; import InternalException from "../../../exceptions/internalException"; import { CreateMemberAwardCommand, DeleteMemberAwardCommand, UpdateMemberAwardCommand } from "./memberAwardCommand"; @@ -8,7 +6,7 @@ import { CreateMemberAwardCommand, DeleteMemberAwardCommand, UpdateMemberAwardCo export default abstract class MemberAwardCommandHandler { /** * @description create memberAward - * @param CreateMemberAwardCommand + * @param {CreateMemberAwardCommand} createMemberAward * @returns {Promise} */ static async create(createMemberAward: CreateMemberAwardCommand): Promise { @@ -34,7 +32,7 @@ export default abstract class MemberAwardCommandHandler { /** * @description update memberAward - * @param UpdateMemberAwardCommand + * @param {UpdateMemberAwardCommand} updateMemberAward * @returns {Promise} */ static async update(updateMemberAward: UpdateMemberAwardCommand): Promise { @@ -58,16 +56,16 @@ export default abstract class MemberAwardCommandHandler { /** * @description delete memberAward - * @param DeleteMemberAwardCommand + * @param {DeleteMemberAwardCommand} deleteMemberAward * @returns {Promise} */ - static async delete(deletMemberAward: DeleteMemberAwardCommand): Promise { + static async delete(deleteMemberAward: DeleteMemberAwardCommand): Promise { return await dataSource .createQueryBuilder() .delete() .from(memberAwards) - .where("id = :id", { id: deletMemberAward.id }) - .andWhere("memberId = :memberId", { memberId: deletMemberAward.memberId }) + .where("id = :id", { id: deleteMemberAward.id }) + .andWhere("memberId = :memberId", { memberId: deleteMemberAward.memberId }) .execute() .then(() => {}) .catch((err) => { diff --git a/src/command/club/member/memberCommandHandler.ts b/src/command/club/member/memberCommandHandler.ts index 07e0e3b..8d8e65b 100644 --- a/src/command/club/member/memberCommandHandler.ts +++ b/src/command/club/member/memberCommandHandler.ts @@ -2,7 +2,6 @@ import { dataSource } from "../../../data-source"; import { communication } from "../../../entity/club/member/communication"; import { member } from "../../../entity/club/member/member"; import InternalException from "../../../exceptions/internalException"; -import CommunicationService from "../../../service/club/member/communicationService"; import { CreateMemberCommand, DeleteMemberCommand, @@ -13,7 +12,7 @@ import { export default abstract class MemberCommandHandler { /** * @description create member - * @param CreateMemberCommand + * @param {CreateMemberCommand} createMember * @returns {Promise} */ static async create(createMember: CreateMemberCommand): Promise { @@ -40,7 +39,7 @@ export default abstract class MemberCommandHandler { /** * @description update member - * @param UpdateMemberCommand + * @param {UpdateMemberCommand} updateMember * @returns {Promise} */ static async update(updateMember: UpdateMemberCommand): Promise { @@ -66,7 +65,7 @@ export default abstract class MemberCommandHandler { /** * @description update member newsletter - * @param UpdateMemberCommand + * @param {UpdateMemberCommand} updateMember * @returns {Promise} */ static async updateNewsletter(updateMember: UpdateMemberNewsletterCommand): Promise { @@ -91,7 +90,7 @@ export default abstract class MemberCommandHandler { /** * @description update member newsletter to unset - * @param memberId string + * @param {number} memberId * @returns {Promise} */ static async unsetNewsletter(memberId: number): Promise { @@ -111,7 +110,7 @@ export default abstract class MemberCommandHandler { /** * @description delete member - * @param DeleteMemberCommand + * @param {DeleteMemberCommand} deleteMember * @returns {Promise} */ static async delete(deleteMember: DeleteMemberCommand): Promise { diff --git a/src/command/club/member/memberExecutivePositionCommandHandler.ts b/src/command/club/member/memberExecutivePositionCommandHandler.ts index daf9f30..f683541 100644 --- a/src/command/club/member/memberExecutivePositionCommandHandler.ts +++ b/src/command/club/member/memberExecutivePositionCommandHandler.ts @@ -1,6 +1,4 @@ import { dataSource } from "../../../data-source"; -import { executivePosition } from "../../../entity/settings/executivePosition"; -import { member } from "../../../entity/club/member/member"; import { memberExecutivePositions } from "../../../entity/club/member/memberExecutivePositions"; import InternalException from "../../../exceptions/internalException"; import { @@ -12,7 +10,7 @@ import { export default abstract class MemberExecutivePositionCommandHandler { /** * @description create memberExecutivePosition - * @param CreateMemberExecutivePositionCommand + * @param {CreateMemberExecutivePositionCommand} createMemberExecutivePosition * @returns {Promise} */ static async create(createMemberExecutivePosition: CreateMemberExecutivePositionCommand): Promise { @@ -38,7 +36,7 @@ export default abstract class MemberExecutivePositionCommandHandler { /** * @description update memberExecutivePosition - * @param UpdateMemberExecutivePositionCommand + * @param {UpdateMemberExecutivePositionCommand} updateMemberExecutivePosition * @returns {Promise} */ static async update(updateMemberExecutivePosition: UpdateMemberExecutivePositionCommand): Promise { @@ -62,16 +60,16 @@ export default abstract class MemberExecutivePositionCommandHandler { /** * @description delete memberExecutivePosition - * @param DeleteMemberExecutivePositionCommand + * @param {DeleteMemberExecutivePositionCommand} deleteMemberExecutivePosition * @returns {Promise} */ - static async delete(deletMemberExecutivePosition: DeleteMemberExecutivePositionCommand): Promise { + static async delete(deleteMemberExecutivePosition: DeleteMemberExecutivePositionCommand): Promise { return await dataSource .createQueryBuilder() .delete() .from(memberExecutivePositions) - .where("id = :id", { id: deletMemberExecutivePosition.id }) - .andWhere("memberId = :memberId", { memberId: deletMemberExecutivePosition.memberId }) + .where("id = :id", { id: deleteMemberExecutivePosition.id }) + .andWhere("memberId = :memberId", { memberId: deleteMemberExecutivePosition.memberId }) .execute() .then(() => {}) .catch((err) => { diff --git a/src/command/club/member/memberQualificationCommandHandler.ts b/src/command/club/member/memberQualificationCommandHandler.ts index c27dad0..351cfb6 100644 --- a/src/command/club/member/memberQualificationCommandHandler.ts +++ b/src/command/club/member/memberQualificationCommandHandler.ts @@ -1,5 +1,4 @@ import { dataSource } from "../../../data-source"; -import { qualification } from "../../../entity/settings/qualification"; import { memberQualifications } from "../../../entity/club/member/memberQualifications"; import InternalException from "../../../exceptions/internalException"; import { @@ -7,12 +6,11 @@ import { DeleteMemberQualificationCommand, UpdateMemberQualificationCommand, } from "./memberQualificationCommand"; -import { member } from "../../../entity/club/member/member"; export default abstract class MemberQualificationCommandHandler { /** * @description create memberQualification - * @param CreateMemberQualificationCommand + * @param {CreateMemberQualificationCommand} createMemberQualification * @returns {Promise} */ static async create(createMemberQualification: CreateMemberQualificationCommand): Promise { @@ -37,7 +35,7 @@ export default abstract class MemberQualificationCommandHandler { /** * @description update memberQualification - * @param UpdateMemberQualificationCommand + * @param {UpdateMemberQualificationCommand} updateMemberQualification * @returns {Promise} */ static async update(updateMemberQualification: UpdateMemberQualificationCommand): Promise { @@ -62,16 +60,16 @@ export default abstract class MemberQualificationCommandHandler { /** * @description delete memberQualification - * @param DeleteMemberQualificationCommand + * @param {DeleteMemberQualificationCommand} deleteMemberQualification * @returns {Promise} */ - static async delete(deletMemberQualification: DeleteMemberQualificationCommand): Promise { + static async delete(deleteMemberQualification: DeleteMemberQualificationCommand): Promise { return await dataSource .createQueryBuilder() .delete() .from(memberQualifications) - .where("id = :id", { id: deletMemberQualification.id }) - .andWhere("memberId = :memberId", { memberId: deletMemberQualification.memberId }) + .where("id = :id", { id: deleteMemberQualification.id }) + .andWhere("memberId = :memberId", { memberId: deleteMemberQualification.memberId }) .execute() .then(() => {}) .catch((err) => { diff --git a/src/command/club/member/membershipCommandHandler.ts b/src/command/club/member/membershipCommandHandler.ts index 4c81f6a..602d6d7 100644 --- a/src/command/club/member/membershipCommandHandler.ts +++ b/src/command/club/member/membershipCommandHandler.ts @@ -1,7 +1,5 @@ import { dataSource } from "../../../data-source"; -import { member } from "../../../entity/club/member/member"; import { membership } from "../../../entity/club/member/membership"; -import { membershipStatus } from "../../../entity/settings/membershipStatus"; import InternalException from "../../../exceptions/internalException"; import { CreateMembershipCommand, DeleteMembershipCommand, UpdateMembershipCommand } from "./membershipCommand"; diff --git a/src/command/club/newsletter/newsletterCommandHandler.ts b/src/command/club/newsletter/newsletterCommandHandler.ts index add0a98..38c156b 100644 --- a/src/command/club/newsletter/newsletterCommandHandler.ts +++ b/src/command/club/newsletter/newsletterCommandHandler.ts @@ -6,7 +6,7 @@ import { CreateNewsletterCommand, SendNewsletterCommand, SynchronizeNewsletterCo export default abstract class NewsletterCommandHandler { /** * @description create newsletter - * @param CreateNewsletterCommand + * @param {CreateNewsletterCommand} createNewsletter * @returns {Promise} */ static async create(createNewsletter: CreateNewsletterCommand): Promise { @@ -28,7 +28,7 @@ export default abstract class NewsletterCommandHandler { /** * @description sync newsletter - * @param SynchronizeNewsletterCommand + * @param {SynchronizeNewsletterCommand} syncNewsletter * @returns {Promise} */ static async sync(syncNewsletter: SynchronizeNewsletterCommand): Promise { @@ -53,7 +53,7 @@ export default abstract class NewsletterCommandHandler { /** * @description send newsletter - * @param SendNewsletterCommand + * @param {SendNewsletterCommand} syncNewsletter * @returns {Promise} */ static async send(syncNewsletter: SendNewsletterCommand): Promise { diff --git a/src/command/club/protocol/protocolAgendaCommandHandler.ts b/src/command/club/protocol/protocolAgendaCommandHandler.ts index 4a0e594..0c74179 100644 --- a/src/command/club/protocol/protocolAgendaCommandHandler.ts +++ b/src/command/club/protocol/protocolAgendaCommandHandler.ts @@ -6,7 +6,7 @@ import { SynchronizeProtocolAgendaCommand } from "./protocolAgendaCommand"; export default abstract class ProtocolAgendaCommandHandler { /** * @description create protocolAgenda - * @param {number} + * @param {number} protocolId * @returns {Promise} */ static async create(protocolId: number): Promise { @@ -30,7 +30,7 @@ export default abstract class ProtocolAgendaCommandHandler { /** * @description sync protocolAgenda - * @param {Array} + * @param {Array} syncProtocolAgenda * @returns {Promise} */ static async sync(syncProtocolAgenda: Array): Promise { diff --git a/src/command/club/protocol/protocolCommandHandler.ts b/src/command/club/protocol/protocolCommandHandler.ts index 8c65024..95e5017 100644 --- a/src/command/club/protocol/protocolCommandHandler.ts +++ b/src/command/club/protocol/protocolCommandHandler.ts @@ -6,7 +6,7 @@ import { CreateProtocolCommand, SynchronizeProtocolCommand } from "./protocolCom export default abstract class ProtocolCommandHandler { /** * @description create protocol - * @param CreateProtocolCommand + * @param {CreateProtocolCommand} createProtocol * @returns {Promise} */ static async create(createProtocol: CreateProtocolCommand): Promise { @@ -29,7 +29,7 @@ export default abstract class ProtocolCommandHandler { /** * @description sync protocol - * @param SynchronizeProtocolCommand + * @param {SynchronizeProtocolCommand} syncProtocol * @returns {Promise} */ static async sync(syncProtocol: SynchronizeProtocolCommand): Promise { diff --git a/src/command/club/protocol/protocolDecisionCommandHandler.ts b/src/command/club/protocol/protocolDecisionCommandHandler.ts index f41178a..19aba38 100644 --- a/src/command/club/protocol/protocolDecisionCommandHandler.ts +++ b/src/command/club/protocol/protocolDecisionCommandHandler.ts @@ -6,7 +6,7 @@ import { SynchronizeProtocolDecisionCommand } from "./protocolDecisionCommand"; export default abstract class ProtocolDecisionCommandHandler { /** * @description create protocolDecision - * @param {number} + * @param {number} protocolId * @returns {Promise} */ static async create(protocolId: number): Promise { @@ -29,7 +29,7 @@ export default abstract class ProtocolDecisionCommandHandler { } /** * @description sync protocolDecision - * @param {Array} + * @param {Array} syncProtocolDecisions * @returns {Promise} */ static async sync(syncProtocolDecisions: Array): Promise { diff --git a/src/command/club/protocol/protocolPresenceCommandHandler.ts b/src/command/club/protocol/protocolPresenceCommandHandler.ts index 360337a..abdb82b 100644 --- a/src/command/club/protocol/protocolPresenceCommandHandler.ts +++ b/src/command/club/protocol/protocolPresenceCommandHandler.ts @@ -8,7 +8,7 @@ import { ProtocolPresenceCommand, SynchronizeProtocolPresenceCommand } from "./p export default abstract class ProtocolPresenceCommandHandler { /** * @description sync protocolPresence - * @param {SynchronizeProtocolPresenceCommand} + * @param {SynchronizeProtocolPresenceCommand} syncProtocolPresences * @returns {Promise} */ static async sync(syncProtocolPresences: SynchronizeProtocolPresenceCommand): Promise { diff --git a/src/command/club/protocol/protocolPrintoutCommandHandler.ts b/src/command/club/protocol/protocolPrintoutCommandHandler.ts index 22f292d..9ceabea 100644 --- a/src/command/club/protocol/protocolPrintoutCommandHandler.ts +++ b/src/command/club/protocol/protocolPrintoutCommandHandler.ts @@ -6,7 +6,7 @@ import { CreateProtocolPrintoutCommand } from "./protocolPrintoutCommand"; export default abstract class ProtocolPrintoutCommandHandler { /** * @description create protocolPrintout - * @param {number} + * @param {CreateProtocolPrintoutCommand} printout * @returns {Promise} */ static async create(printout: CreateProtocolPrintoutCommand): Promise { diff --git a/src/command/club/protocol/protocolVotingCommandHandler.ts b/src/command/club/protocol/protocolVotingCommandHandler.ts index e276183..6b8834d 100644 --- a/src/command/club/protocol/protocolVotingCommandHandler.ts +++ b/src/command/club/protocol/protocolVotingCommandHandler.ts @@ -6,7 +6,7 @@ import { SynchronizeProtocolVotingCommand } from "./protocolVotingCommand"; export default abstract class ProtocolVotingCommandHandler { /** * @description create protocolVoting - * @param {number} + * @param {number} protocolId * @returns {Promise} */ static async create(protocolId: number): Promise { @@ -29,7 +29,7 @@ export default abstract class ProtocolVotingCommandHandler { } /** * @description sync protocolVoting - * @param {Array} + * @param {Array} syncProtocolVotings * @returns {Promise} */ static async sync(syncProtocolVotings: Array): Promise { diff --git a/src/command/refreshCommandHandler.ts b/src/command/refreshCommandHandler.ts index e8e2c83..86841ad 100644 --- a/src/command/refreshCommandHandler.ts +++ b/src/command/refreshCommandHandler.ts @@ -12,7 +12,7 @@ import ms from "ms"; export default abstract class RefreshCommandHandler { /** * @description create and save refreshToken to user - * @param CreateRefreshCommand + * @param {CreateRefreshCommand} createRefresh * @returns {Promise} */ static async create(createRefresh: CreateRefreshCommand): Promise { @@ -42,7 +42,7 @@ export default abstract class RefreshCommandHandler { /** * @description delete refresh by user and token - * @param DeleteRefreshCommand + * @param {DeleteRefreshCommand} deleteRefresh * @returns {Promise} */ static async deleteByToken(deleteRefresh: DeleteRefreshCommand): Promise { diff --git a/src/command/resetCommandHandler.ts b/src/command/resetCommandHandler.ts index 6ef1d00..9c75aba 100644 --- a/src/command/resetCommandHandler.ts +++ b/src/command/resetCommandHandler.ts @@ -7,7 +7,7 @@ import { CreateResetCommand, DeleteResetCommand } from "./resetCommand"; export default abstract class ResetCommandHandler { /** * @description create user - * @param CreateResetCommand + * @param {CreateResetCommand} createReset * @returns {Promise} */ static async create(createReset: CreateResetCommand): Promise { @@ -35,7 +35,7 @@ export default abstract class ResetCommandHandler { /** * @description delete reset by mail and token - * @param DeleteRefreshCommand + * @param {DeleteRefreshCommand} deleteReset * @returns {Promise} */ static async deleteByTokenAndMail(deleteReset: DeleteResetCommand): Promise { diff --git a/src/command/settings/award/awardCommandHandler.ts b/src/command/settings/award/awardCommandHandler.ts index b7c6f99..af0000f 100644 --- a/src/command/settings/award/awardCommandHandler.ts +++ b/src/command/settings/award/awardCommandHandler.ts @@ -6,7 +6,7 @@ import { CreateAwardCommand, DeleteAwardCommand, UpdateAwardCommand } from "./aw export default abstract class AwardCommandHandler { /** * @description create award - * @param CreateAwardCommand + * @param {CreateAwardCommand} createAward * @returns {Promise} */ static async create(createAward: CreateAwardCommand): Promise { @@ -28,7 +28,7 @@ export default abstract class AwardCommandHandler { /** * @description update award - * @param UpdateAwardCommand + * @param {UpdateAwardCommand} updateAward * @returns {Promise} */ static async update(updateAward: UpdateAwardCommand): Promise { @@ -48,15 +48,15 @@ export default abstract class AwardCommandHandler { /** * @description delete award - * @param DeleteAwardCommand + * @param {DeleteAwardCommand} deleteAward * @returns {Promise} */ - static async delete(deletAward: DeleteAwardCommand): Promise { + static async delete(deleteAward: DeleteAwardCommand): Promise { return await dataSource .createQueryBuilder() .delete() .from(award) - .where("id = :id", { id: deletAward.id }) + .where("id = :id", { id: deleteAward.id }) .execute() .then(() => {}) .catch((err) => { diff --git a/src/command/settings/calendarType/calendarTypeCommandHandler.ts b/src/command/settings/calendarType/calendarTypeCommandHandler.ts index 54105be..bc20d6a 100644 --- a/src/command/settings/calendarType/calendarTypeCommandHandler.ts +++ b/src/command/settings/calendarType/calendarTypeCommandHandler.ts @@ -6,7 +6,7 @@ import { CreateCalendarTypeCommand, DeleteCalendarTypeCommand, UpdateCalendarTyp export default abstract class CalendarTypeCommandHandler { /** * @description create calendarType - * @param CreateCalendarTypeCommand + * @param {CreateCalendarTypeCommand} createCalendarType * @returns {Promise} */ static async create(createCalendarType: CreateCalendarTypeCommand): Promise { @@ -31,7 +31,7 @@ export default abstract class CalendarTypeCommandHandler { /** * @description update calendarType - * @param UpdateCalendarTypeCommand + * @param {UpdateCalendarTypeCommand} updateCalendarType * @returns {Promise} */ static async update(updateCalendarType: UpdateCalendarTypeCommand): Promise { @@ -54,7 +54,7 @@ export default abstract class CalendarTypeCommandHandler { /** * @description delete calendarType - * @param DeleteCalendarTypeCommand + * @param {DeleteCalendarTypeCommand} deleteCalendarType * @returns {Promise} */ static async delete(deleteCalendarType: DeleteCalendarTypeCommand): Promise { diff --git a/src/command/settings/communicationType/communicationTypeCommandHandler.ts b/src/command/settings/communicationType/communicationTypeCommandHandler.ts index 3bdbe47..04c7f10 100644 --- a/src/command/settings/communicationType/communicationTypeCommandHandler.ts +++ b/src/command/settings/communicationType/communicationTypeCommandHandler.ts @@ -10,7 +10,7 @@ import { export default abstract class CommunicationTypeCommandHandler { /** * @description create communicationType - * @param CreateCommunicationTypeCommand + * @param {CreateCommunicationTypeCommand} createCommunicationType * @returns {Promise} */ static async create(createCommunicationType: CreateCommunicationTypeCommand): Promise { @@ -33,7 +33,7 @@ export default abstract class CommunicationTypeCommandHandler { /** * @description update communicationType - * @param UpdateCommunicationTypeCommand + * @param {UpdateCommunicationTypeCommand} updateCommunicationType * @returns {Promise} */ static async update(updateCommunicationType: UpdateCommunicationTypeCommand): Promise { @@ -54,15 +54,15 @@ export default abstract class CommunicationTypeCommandHandler { /** * @description delete communicationType - * @param DeleteCommunicationTypeCommand + * @param {DeleteCommunicationTypeCommand} deleteCommunicationType * @returns {Promise} */ - static async delete(deletCommunicationType: DeleteCommunicationTypeCommand): Promise { + static async delete(deleteCommunicationType: DeleteCommunicationTypeCommand): Promise { return await dataSource .createQueryBuilder() .delete() .from(communicationType) - .where("id = :id", { id: deletCommunicationType.id }) + .where("id = :id", { id: deleteCommunicationType.id }) .execute() .then(() => {}) .catch((err) => { diff --git a/src/command/settings/executivePosition/executivePositionCommandHandler.ts b/src/command/settings/executivePosition/executivePositionCommandHandler.ts index ae5d2f1..d1be38d 100644 --- a/src/command/settings/executivePosition/executivePositionCommandHandler.ts +++ b/src/command/settings/executivePosition/executivePositionCommandHandler.ts @@ -10,7 +10,7 @@ import { export default abstract class ExecutivePositionCommandHandler { /** * @description create executivePosition - * @param CreateExecutivePositionCommand + * @param {CreateExecutivePositionCommand} createExecutivePosition * @returns {Promise} */ static async create(createExecutivePosition: CreateExecutivePositionCommand): Promise { @@ -32,7 +32,7 @@ export default abstract class ExecutivePositionCommandHandler { /** * @description update executivePosition - * @param UpdateExecutivePositionCommand + * @param {UpdateExecutivePositionCommand} updateExecutivePosition * @returns {Promise} */ static async update(updateExecutivePosition: UpdateExecutivePositionCommand): Promise { @@ -52,15 +52,15 @@ export default abstract class ExecutivePositionCommandHandler { /** * @description delete executivePosition - * @param DeleteExecutivePositionCommand + * @param {DeleteExecutivePositionCommand} deleteExecutivePosition * @returns {Promise} */ - static async delete(deletExecutivePosition: DeleteExecutivePositionCommand): Promise { + static async delete(deleteExecutivePosition: DeleteExecutivePositionCommand): Promise { return await dataSource .createQueryBuilder() .delete() .from(executivePosition) - .where("id = :id", { id: deletExecutivePosition.id }) + .where("id = :id", { id: deleteExecutivePosition.id }) .execute() .then(() => {}) .catch((err) => { diff --git a/src/command/settings/membershipStatus/membershipStatusCommandHandler.ts b/src/command/settings/membershipStatus/membershipStatusCommandHandler.ts index 1a87815..bc9f30f 100644 --- a/src/command/settings/membershipStatus/membershipStatusCommandHandler.ts +++ b/src/command/settings/membershipStatus/membershipStatusCommandHandler.ts @@ -10,7 +10,7 @@ import { export default abstract class MembershipStatusCommandHandler { /** * @description create membershipStatus - * @param CreateMembershipStatusCommand + * @param {CreateMembershipStatusCommand} createMembershipStatus * @returns {Promise} */ static async create(createMembershipStatus: CreateMembershipStatusCommand): Promise { @@ -32,7 +32,7 @@ export default abstract class MembershipStatusCommandHandler { /** * @description update membershipStatus - * @param UpdateMembershipStatusCommand + * @param {UpdateMembershipStatusCommand} updateMembershipStatus * @returns {Promise} */ static async update(updateMembershipStatus: UpdateMembershipStatusCommand): Promise { @@ -52,15 +52,15 @@ export default abstract class MembershipStatusCommandHandler { /** * @description delete membershipStatus - * @param DeleteMembershipStatusCommand + * @param {DeleteMembershipStatusCommand} deleteMembershipStatus * @returns {Promise} */ - static async delete(deletMembershipStatus: DeleteMembershipStatusCommand): Promise { + static async delete(deleteMembershipStatus: DeleteMembershipStatusCommand): Promise { return await dataSource .createQueryBuilder() .delete() .from(membershipStatus) - .where("id = :id", { id: deletMembershipStatus.id }) + .where("id = :id", { id: deleteMembershipStatus.id }) .execute() .then(() => {}) .catch((err) => { diff --git a/src/command/settings/newsletterConfig/newsletterConfigCommandHandler.ts b/src/command/settings/newsletterConfig/newsletterConfigCommandHandler.ts index 11a2a4f..56b41bd 100644 --- a/src/command/settings/newsletterConfig/newsletterConfigCommandHandler.ts +++ b/src/command/settings/newsletterConfig/newsletterConfigCommandHandler.ts @@ -6,7 +6,7 @@ import { DeleteNewsletterConfigCommand, SetNewsletterConfigCommand } from "./new export default abstract class NewsletterConfigCommandHandler { /** * @description set newsletterConfig - * @param SetNewsletterConfigCommand + * @param {SetNewsletterConfigCommand} setNewsletterConfig * @returns {Promise} */ static async set(setNewsletterConfig: SetNewsletterConfigCommand): Promise { @@ -29,7 +29,7 @@ export default abstract class NewsletterConfigCommandHandler { } /** * @description delete newsletterConfig - * @param number + * @param {DeleteNewsletterConfigCommand} deleteNewsletterConfig * @returns {Promise} */ static async delete(deleteNewsletterConfig: DeleteNewsletterConfigCommand): Promise { diff --git a/src/command/settings/qualification/qualificationCommandHandler.ts b/src/command/settings/qualification/qualificationCommandHandler.ts index adbee0e..0abd401 100644 --- a/src/command/settings/qualification/qualificationCommandHandler.ts +++ b/src/command/settings/qualification/qualificationCommandHandler.ts @@ -10,7 +10,7 @@ import { export default abstract class QualificationCommandHandler { /** * @description create qualification - * @param CreateQualificationCommand + * @param {CreateQualificationCommand} createQualification * @returns {Promise} */ static async create(createQualification: CreateQualificationCommand): Promise { @@ -33,7 +33,7 @@ export default abstract class QualificationCommandHandler { /** * @description update qualification - * @param UpdateQualificationCommand + * @param {UpdateQualificationCommand} updateQualification * @returns {Promise} */ static async update(updateQualification: UpdateQualificationCommand): Promise { @@ -54,15 +54,15 @@ export default abstract class QualificationCommandHandler { /** * @description delete qualification - * @param DeleteQualificationCommand + * @param {DeleteQualificationCommand} deleteQualification * @returns {Promise} */ - static async delete(deletQualification: DeleteQualificationCommand): Promise { + static async delete(deleteQualification: DeleteQualificationCommand): Promise { return await dataSource .createQueryBuilder() .delete() .from(qualification) - .where("id = :id", { id: deletQualification.id }) + .where("id = :id", { id: deleteQualification.id }) .execute() .then(() => {}) .catch((err) => { diff --git a/src/command/settings/queryStore/queryStoreCommandHandler.ts b/src/command/settings/queryStore/queryStoreCommandHandler.ts index 1ab28df..3776b5e 100644 --- a/src/command/settings/queryStore/queryStoreCommandHandler.ts +++ b/src/command/settings/queryStore/queryStoreCommandHandler.ts @@ -6,7 +6,7 @@ import { CreateQueryStoreCommand, DeleteQueryStoreCommand, UpdateQueryStoreComma export default abstract class QueryStoreCommandHandler { /** * @description create queryStore - * @param CreateQueryStoreCommand + * @param {CreateQueryStoreCommand} createQueryStore * @returns {Promise} */ static async create(createQueryStore: CreateQueryStoreCommand): Promise { @@ -30,7 +30,7 @@ export default abstract class QueryStoreCommandHandler { /** * @description update queryStore - * @param UpdateQueryStoreCommand + * @param {UpdateQueryStoreCommand} updateQueryStore * @returns {Promise} */ static async update(updateQueryStore: UpdateQueryStoreCommand): Promise { @@ -51,15 +51,15 @@ export default abstract class QueryStoreCommandHandler { /** * @description delete queryStore - * @param DeleteQueryStoreCommand + * @param {DeleteQueryStoreCommand} deleteQueryStore * @returns {Promise} */ - static async delete(deletQueryStore: DeleteQueryStoreCommand): Promise { + static async delete(deleteQueryStore: DeleteQueryStoreCommand): Promise { return await dataSource .createQueryBuilder() .delete() .from(query) - .where("id = :id", { id: deletQueryStore.id }) + .where("id = :id", { id: deleteQueryStore.id }) .execute() .then(() => {}) .catch((err) => { diff --git a/src/command/settings/template/templateCommandHandler.ts b/src/command/settings/template/templateCommandHandler.ts index 863b17b..54ea6f7 100644 --- a/src/command/settings/template/templateCommandHandler.ts +++ b/src/command/settings/template/templateCommandHandler.ts @@ -6,7 +6,7 @@ import { CreateTemplateCommand, DeleteTemplateCommand, UpdateTemplateCommand } f export default abstract class TemplateCommandHandler { /** * @description create template - * @param CreateTemplateCommand + * @param {CreateTemplateCommand} createTemplate * @returns {Promise} */ static async create(createTemplate: CreateTemplateCommand): Promise { @@ -29,7 +29,7 @@ export default abstract class TemplateCommandHandler { /** * @description update template - * @param UpdateTemplateCommand + * @param {UpdateTemplateCommand} updateTemplate * @returns {Promise} */ static async update(updateTemplate: UpdateTemplateCommand): Promise { @@ -52,15 +52,15 @@ export default abstract class TemplateCommandHandler { /** * @description delete template - * @param DeleteTemplateCommand + * @param {DeleteTemplateCommand} deleteTemplate * @returns {Promise} */ - static async delete(deletTemplate: DeleteTemplateCommand): Promise { + static async delete(deleteTemplate: DeleteTemplateCommand): Promise { return await dataSource .createQueryBuilder() .delete() .from(template) - .where("id = :id", { id: deletTemplate.id }) + .where("id = :id", { id: deleteTemplate.id }) .execute() .then(() => {}) .catch((err) => { diff --git a/src/command/settings/templateUsage/templateUsageCommandHandler.ts b/src/command/settings/templateUsage/templateUsageCommandHandler.ts index a605ba9..06c46c9 100644 --- a/src/command/settings/templateUsage/templateUsageCommandHandler.ts +++ b/src/command/settings/templateUsage/templateUsageCommandHandler.ts @@ -6,7 +6,7 @@ import { UpdateTemplateUsageCommand } from "./templateUsageCommand"; export default abstract class TemplateUsageCommandHandler { /** * @description update templateUsage - * @param UpdateTemplateUsageCommand + * @param {UpdateTemplateUsageCommand} updateTemplateUsage * @returns {Promise} */ static async update(updateTemplateUsage: UpdateTemplateUsageCommand): Promise { diff --git a/src/command/user/role/roleCommandHandler.ts b/src/command/user/role/roleCommandHandler.ts index 9c29cb5..739d8b9 100644 --- a/src/command/user/role/roleCommandHandler.ts +++ b/src/command/user/role/roleCommandHandler.ts @@ -6,7 +6,7 @@ import { CreateRoleCommand, DeleteRoleCommand, UpdateRoleCommand } from "./roleC export default abstract class RoleCommandHandler { /** * @description create role - * @param CreateRoleCommand + * @param {CreateRoleCommand} createRole * @returns {Promise} */ static async create(createRole: CreateRoleCommand): Promise { @@ -28,7 +28,7 @@ export default abstract class RoleCommandHandler { /** * @description update role - * @param UpdateRoleCommand + * @param {UpdateRoleCommand} updateRole * @returns {Promise} */ static async update(updateRole: UpdateRoleCommand): Promise { @@ -48,7 +48,7 @@ export default abstract class RoleCommandHandler { /** * @description delete role - * @param DeleteRoleCommand + * @param {DeleteRoleCommand} deleteRole * @returns {Promise} */ static async delete(deleteRole: DeleteRoleCommand): Promise { diff --git a/src/command/user/role/rolePermissionCommandHandler.ts b/src/command/user/role/rolePermissionCommandHandler.ts index cd830ae..a9a0b1f 100644 --- a/src/command/user/role/rolePermissionCommandHandler.ts +++ b/src/command/user/role/rolePermissionCommandHandler.ts @@ -10,13 +10,12 @@ import { } from "./rolePermissionCommand"; import PermissionHelper from "../../../helpers/permissionHelper"; import RolePermissionService from "../../../service/user/rolePermissionService"; -import { role } from "../../../entity/user/role"; import { PermissionString } from "../../../type/permissionTypes"; export default abstract class RolePermissionCommandHandler { /** * @description update role permissions - * @param UpdateRolePermissionsCommand + * @param {UpdateRolePermissionsCommand} updateRolePermissions * @returns {Promise} */ static async updatePermissions(updateRolePermissions: UpdateRolePermissionsCommand): Promise { @@ -75,7 +74,7 @@ export default abstract class RolePermissionCommandHandler { /** * @description grant permission to user - * @param CreateRolePermissionCommand + * @param {CreateRolePermissionCommand} createPermission * @returns {Promise} */ static async create(createPermission: CreateRolePermissionCommand): Promise { @@ -98,7 +97,7 @@ export default abstract class RolePermissionCommandHandler { /** * @description remove permission from role - * @param DeleteRolePermissionCommand + * @param {DeleteRolePermissionCommand} deletePermission * @returns {Promise} */ static async delete(deletePermission: DeleteRolePermissionCommand): Promise { @@ -109,7 +108,7 @@ export default abstract class RolePermissionCommandHandler { .where("roleId = :id", { id: deletePermission.roleId }) .andWhere("permission = :permission", { permission: deletePermission.permission }) .execute() - .then((res) => {}) + .then(() => {}) .catch((err) => { throw new InternalException("failed role permission removal", err); }); diff --git a/src/command/user/user/userCommandHandler.ts b/src/command/user/user/userCommandHandler.ts index 9946e2a..affab87 100644 --- a/src/command/user/user/userCommandHandler.ts +++ b/src/command/user/user/userCommandHandler.ts @@ -15,7 +15,7 @@ import UserService from "../../../service/user/userService"; export default abstract class UserCommandHandler { /** * @description create user - * @param CreateUserCommand + * @param {CreateUserCommand} createUser * @returns {Promise} */ static async create(createUser: CreateUserCommand): Promise { @@ -42,7 +42,7 @@ export default abstract class UserCommandHandler { /** * @description update user - * @param UpdateUserCommand + * @param {UpdateUserCommand} updateUser * @returns {Promise} */ static async update(updateUser: UpdateUserCommand): Promise { @@ -65,7 +65,7 @@ export default abstract class UserCommandHandler { /** * @description update user - * @param UpdateUserSecretCommand + * @param {UpdateUserSecretCommand} updateUser * @returns {Promise} */ static async updateSecret(updateUser: UpdateUserSecretCommand): Promise { @@ -85,7 +85,7 @@ export default abstract class UserCommandHandler { /** * @description update user roles - * @param UpdateUserRolesCommand + * @param {UpdateUserRolesCommand} updateUserRoles * @returns {Promise} */ static async updateRoles(updateUserRoles: UpdateUserRolesCommand): Promise { @@ -119,13 +119,13 @@ export default abstract class UserCommandHandler { /** * @description transfer ownership - * @param TransferUserOwnerCommand + * @param {TransferUserOwnerCommand} transferOwnership * @returns {Promise} */ static async transferOwnership(transferOwnership: TransferUserOwnerCommand): Promise { return await dataSource.manager .transaction(async (manager) => { - manager + await manager .createQueryBuilder() .update(user) .set({ @@ -134,7 +134,7 @@ export default abstract class UserCommandHandler { .where("id = :id", { id: transferOwnership.fromId }) .execute(); - manager + await manager .createQueryBuilder() .update(user) .set({ diff --git a/src/command/user/user/userPermissionCommandHandler.ts b/src/command/user/user/userPermissionCommandHandler.ts index f810273..75c1142 100644 --- a/src/command/user/user/userPermissionCommandHandler.ts +++ b/src/command/user/user/userPermissionCommandHandler.ts @@ -15,7 +15,7 @@ import { PermissionString } from "../../../type/permissionTypes"; export default abstract class UserPermissionCommandHandler { /** * @description update user permissions - * @param UpdateUserPermissionsCommand + * @param {UpdateUserPermissionsCommand} updateUserPermissions * @returns {Promise} */ static async updatePermissions(updateUserPermissions: UpdateUserPermissionsCommand): Promise { @@ -75,7 +75,7 @@ export default abstract class UserPermissionCommandHandler { /** * @description grant permission to user - * @param CreateUserPermissionCommand + * @param {CreateUserPermissionCommand} createPermission * @returns {Promise} */ static async create(createPermission: CreateUserPermissionCommand): Promise { @@ -98,7 +98,7 @@ export default abstract class UserPermissionCommandHandler { /** * @description remove permission to user - * @param DeleteUserPermissionCommand + * @param {DeleteUserPermissionCommand} deletePermission * @returns {Promise} */ static async delete(deletePermission: DeleteUserPermissionCommand): Promise {