#25-cleanup-&-enhancements #31

Merged
jkeffects merged 7 commits from #25-cleanup-&-enhancements into main 2025-01-05 15:12:11 +00:00
30 changed files with 104 additions and 116 deletions
Showing only changes of commit 91217d1e6e - Show all commits

View file

@ -7,7 +7,7 @@ import { CreateCalendarCommand, DeleteCalendarCommand, UpdateCalendarCommand } f
export default abstract class CalendarCommandHandler { export default abstract class CalendarCommandHandler {
/** /**
* @description create calendar * @description create calendar
* @param CreateCalendarCommand * @param {CreateCalendarCommand} createCalendar
* @returns {Promise<number>} * @returns {Promise<number>}
*/ */
static async create(createCalendar: CreateCalendarCommand): Promise<number> { static async create(createCalendar: CreateCalendarCommand): Promise<number> {
@ -39,7 +39,7 @@ export default abstract class CalendarCommandHandler {
/** /**
* @description update calendar * @description update calendar
* @param UpdateCalendarCommand * @param {UpdateCalendarCommand} updateCalendar
* @returns {Promise<void>} * @returns {Promise<void>}
*/ */
static async update(updateCalendar: UpdateCalendarCommand): Promise<void> { static async update(updateCalendar: UpdateCalendarCommand): Promise<void> {
@ -78,7 +78,7 @@ export default abstract class CalendarCommandHandler {
/** /**
* @description delete calendar * @description delete calendar
* @param DeleteCalendarCommand * @param {DeleteCalendarCommand} deleteCalendar
* @returns {Promise<void>} * @returns {Promise<void>}
*/ */
static async delete(deleteCalendar: DeleteCalendarCommand): Promise<void> { static async delete(deleteCalendar: DeleteCalendarCommand): Promise<void> {

View file

@ -1,7 +1,5 @@
import { dataSource } from "../../../data-source"; import { dataSource } from "../../../data-source";
import { communication } from "../../../entity/club/member/communication"; 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 InternalException from "../../../exceptions/internalException";
import { import {
CreateCommunicationCommand, CreateCommunicationCommand,
@ -12,7 +10,7 @@ import {
export default abstract class CommunicationCommandHandler { export default abstract class CommunicationCommandHandler {
/** /**
* @description create communication * @description create communication
* @param CreateCommunicationCommand * @param {CreateCommunicationCommand} createCommunication
* @returns {Promise<number>} * @returns {Promise<number>}
*/ */
static async create(createCommunication: CreateCommunicationCommand): Promise<number> { static async create(createCommunication: CreateCommunicationCommand): Promise<number> {
@ -44,7 +42,7 @@ export default abstract class CommunicationCommandHandler {
/** /**
* @description update communication * @description update communication
* @param UpdateCommunicationCommand * @param {UpdateCommunicationCommand} updateCommunication
* @returns {Promise<void>} * @returns {Promise<void>}
*/ */
static async update(updateCommunication: UpdateCommunicationCommand): Promise<void> { static async update(updateCommunication: UpdateCommunicationCommand): Promise<void> {
@ -73,7 +71,7 @@ export default abstract class CommunicationCommandHandler {
/** /**
* @description delete communication * @description delete communication
* @param DeleteCommunicationCommand * @param {DeleteCommunicationCommand} deleteCommunication
* @returns {Promise<void>} * @returns {Promise<void>}
*/ */
static async delete(deleteCommunication: DeleteCommunicationCommand): Promise<void> { static async delete(deleteCommunication: DeleteCommunicationCommand): Promise<void> {

View file

@ -1,6 +1,4 @@
import { dataSource } from "../../../data-source"; 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 { memberAwards } from "../../../entity/club/member/memberAwards";
import InternalException from "../../../exceptions/internalException"; import InternalException from "../../../exceptions/internalException";
import { CreateMemberAwardCommand, DeleteMemberAwardCommand, UpdateMemberAwardCommand } from "./memberAwardCommand"; import { CreateMemberAwardCommand, DeleteMemberAwardCommand, UpdateMemberAwardCommand } from "./memberAwardCommand";
@ -8,7 +6,7 @@ import { CreateMemberAwardCommand, DeleteMemberAwardCommand, UpdateMemberAwardCo
export default abstract class MemberAwardCommandHandler { export default abstract class MemberAwardCommandHandler {
/** /**
* @description create memberAward * @description create memberAward
* @param CreateMemberAwardCommand * @param {CreateMemberAwardCommand} createMemberAward
* @returns {Promise<number>} * @returns {Promise<number>}
*/ */
static async create(createMemberAward: CreateMemberAwardCommand): Promise<number> { static async create(createMemberAward: CreateMemberAwardCommand): Promise<number> {
@ -34,7 +32,7 @@ export default abstract class MemberAwardCommandHandler {
/** /**
* @description update memberAward * @description update memberAward
* @param UpdateMemberAwardCommand * @param {UpdateMemberAwardCommand} updateMemberAward
* @returns {Promise<void>} * @returns {Promise<void>}
*/ */
static async update(updateMemberAward: UpdateMemberAwardCommand): Promise<void> { static async update(updateMemberAward: UpdateMemberAwardCommand): Promise<void> {
@ -58,16 +56,16 @@ export default abstract class MemberAwardCommandHandler {
/** /**
* @description delete memberAward * @description delete memberAward
* @param DeleteMemberAwardCommand * @param {DeleteMemberAwardCommand} deleteMemberAward
* @returns {Promise<void>} * @returns {Promise<void>}
*/ */
static async delete(deletMemberAward: DeleteMemberAwardCommand): Promise<void> { static async delete(deleteMemberAward: DeleteMemberAwardCommand): Promise<void> {
return await dataSource return await dataSource
.createQueryBuilder() .createQueryBuilder()
.delete() .delete()
.from(memberAwards) .from(memberAwards)
.where("id = :id", { id: deletMemberAward.id }) .where("id = :id", { id: deleteMemberAward.id })
.andWhere("memberId = :memberId", { memberId: deletMemberAward.memberId }) .andWhere("memberId = :memberId", { memberId: deleteMemberAward.memberId })
.execute() .execute()
.then(() => {}) .then(() => {})
.catch((err) => { .catch((err) => {

View file

@ -2,7 +2,6 @@ import { dataSource } from "../../../data-source";
import { communication } from "../../../entity/club/member/communication"; import { communication } from "../../../entity/club/member/communication";
import { member } from "../../../entity/club/member/member"; import { member } from "../../../entity/club/member/member";
import InternalException from "../../../exceptions/internalException"; import InternalException from "../../../exceptions/internalException";
import CommunicationService from "../../../service/club/member/communicationService";
import { import {
CreateMemberCommand, CreateMemberCommand,
DeleteMemberCommand, DeleteMemberCommand,
@ -13,7 +12,7 @@ import {
export default abstract class MemberCommandHandler { export default abstract class MemberCommandHandler {
/** /**
* @description create member * @description create member
* @param CreateMemberCommand * @param {CreateMemberCommand} createMember
* @returns {Promise<number>} * @returns {Promise<number>}
*/ */
static async create(createMember: CreateMemberCommand): Promise<number> { static async create(createMember: CreateMemberCommand): Promise<number> {
@ -40,7 +39,7 @@ export default abstract class MemberCommandHandler {
/** /**
* @description update member * @description update member
* @param UpdateMemberCommand * @param {UpdateMemberCommand} updateMember
* @returns {Promise<void>} * @returns {Promise<void>}
*/ */
static async update(updateMember: UpdateMemberCommand): Promise<void> { static async update(updateMember: UpdateMemberCommand): Promise<void> {
@ -66,7 +65,7 @@ export default abstract class MemberCommandHandler {
/** /**
* @description update member newsletter * @description update member newsletter
* @param UpdateMemberCommand * @param {UpdateMemberCommand} updateMember
* @returns {Promise<void>} * @returns {Promise<void>}
*/ */
static async updateNewsletter(updateMember: UpdateMemberNewsletterCommand): Promise<void> { static async updateNewsletter(updateMember: UpdateMemberNewsletterCommand): Promise<void> {
@ -91,7 +90,7 @@ export default abstract class MemberCommandHandler {
/** /**
* @description update member newsletter to unset * @description update member newsletter to unset
* @param memberId string * @param {number} memberId
* @returns {Promise<void>} * @returns {Promise<void>}
*/ */
static async unsetNewsletter(memberId: number): Promise<void> { static async unsetNewsletter(memberId: number): Promise<void> {
@ -111,7 +110,7 @@ export default abstract class MemberCommandHandler {
/** /**
* @description delete member * @description delete member
* @param DeleteMemberCommand * @param {DeleteMemberCommand} deleteMember
* @returns {Promise<void>} * @returns {Promise<void>}
*/ */
static async delete(deleteMember: DeleteMemberCommand): Promise<void> { static async delete(deleteMember: DeleteMemberCommand): Promise<void> {

View file

@ -1,6 +1,4 @@
import { dataSource } from "../../../data-source"; 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 { memberExecutivePositions } from "../../../entity/club/member/memberExecutivePositions";
import InternalException from "../../../exceptions/internalException"; import InternalException from "../../../exceptions/internalException";
import { import {
@ -12,7 +10,7 @@ import {
export default abstract class MemberExecutivePositionCommandHandler { export default abstract class MemberExecutivePositionCommandHandler {
/** /**
* @description create memberExecutivePosition * @description create memberExecutivePosition
* @param CreateMemberExecutivePositionCommand * @param {CreateMemberExecutivePositionCommand} createMemberExecutivePosition
* @returns {Promise<number>} * @returns {Promise<number>}
*/ */
static async create(createMemberExecutivePosition: CreateMemberExecutivePositionCommand): Promise<number> { static async create(createMemberExecutivePosition: CreateMemberExecutivePositionCommand): Promise<number> {
@ -38,7 +36,7 @@ export default abstract class MemberExecutivePositionCommandHandler {
/** /**
* @description update memberExecutivePosition * @description update memberExecutivePosition
* @param UpdateMemberExecutivePositionCommand * @param {UpdateMemberExecutivePositionCommand} updateMemberExecutivePosition
* @returns {Promise<void>} * @returns {Promise<void>}
*/ */
static async update(updateMemberExecutivePosition: UpdateMemberExecutivePositionCommand): Promise<void> { static async update(updateMemberExecutivePosition: UpdateMemberExecutivePositionCommand): Promise<void> {
@ -62,16 +60,16 @@ export default abstract class MemberExecutivePositionCommandHandler {
/** /**
* @description delete memberExecutivePosition * @description delete memberExecutivePosition
* @param DeleteMemberExecutivePositionCommand * @param {DeleteMemberExecutivePositionCommand} deleteMemberExecutivePosition
* @returns {Promise<void>} * @returns {Promise<void>}
*/ */
static async delete(deletMemberExecutivePosition: DeleteMemberExecutivePositionCommand): Promise<void> { static async delete(deleteMemberExecutivePosition: DeleteMemberExecutivePositionCommand): Promise<void> {
return await dataSource return await dataSource
.createQueryBuilder() .createQueryBuilder()
.delete() .delete()
.from(memberExecutivePositions) .from(memberExecutivePositions)
.where("id = :id", { id: deletMemberExecutivePosition.id }) .where("id = :id", { id: deleteMemberExecutivePosition.id })
.andWhere("memberId = :memberId", { memberId: deletMemberExecutivePosition.memberId }) .andWhere("memberId = :memberId", { memberId: deleteMemberExecutivePosition.memberId })
.execute() .execute()
.then(() => {}) .then(() => {})
.catch((err) => { .catch((err) => {

View file

@ -1,5 +1,4 @@
import { dataSource } from "../../../data-source"; import { dataSource } from "../../../data-source";
import { qualification } from "../../../entity/settings/qualification";
import { memberQualifications } from "../../../entity/club/member/memberQualifications"; import { memberQualifications } from "../../../entity/club/member/memberQualifications";
import InternalException from "../../../exceptions/internalException"; import InternalException from "../../../exceptions/internalException";
import { import {
@ -7,12 +6,11 @@ import {
DeleteMemberQualificationCommand, DeleteMemberQualificationCommand,
UpdateMemberQualificationCommand, UpdateMemberQualificationCommand,
} from "./memberQualificationCommand"; } from "./memberQualificationCommand";
import { member } from "../../../entity/club/member/member";
export default abstract class MemberQualificationCommandHandler { export default abstract class MemberQualificationCommandHandler {
/** /**
* @description create memberQualification * @description create memberQualification
* @param CreateMemberQualificationCommand * @param {CreateMemberQualificationCommand} createMemberQualification
* @returns {Promise<number>} * @returns {Promise<number>}
*/ */
static async create(createMemberQualification: CreateMemberQualificationCommand): Promise<number> { static async create(createMemberQualification: CreateMemberQualificationCommand): Promise<number> {
@ -37,7 +35,7 @@ export default abstract class MemberQualificationCommandHandler {
/** /**
* @description update memberQualification * @description update memberQualification
* @param UpdateMemberQualificationCommand * @param {UpdateMemberQualificationCommand} updateMemberQualification
* @returns {Promise<void>} * @returns {Promise<void>}
*/ */
static async update(updateMemberQualification: UpdateMemberQualificationCommand): Promise<void> { static async update(updateMemberQualification: UpdateMemberQualificationCommand): Promise<void> {
@ -62,16 +60,16 @@ export default abstract class MemberQualificationCommandHandler {
/** /**
* @description delete memberQualification * @description delete memberQualification
* @param DeleteMemberQualificationCommand * @param {DeleteMemberQualificationCommand} deleteMemberQualification
* @returns {Promise<void>} * @returns {Promise<void>}
*/ */
static async delete(deletMemberQualification: DeleteMemberQualificationCommand): Promise<void> { static async delete(deleteMemberQualification: DeleteMemberQualificationCommand): Promise<void> {
return await dataSource return await dataSource
.createQueryBuilder() .createQueryBuilder()
.delete() .delete()
.from(memberQualifications) .from(memberQualifications)
.where("id = :id", { id: deletMemberQualification.id }) .where("id = :id", { id: deleteMemberQualification.id })
.andWhere("memberId = :memberId", { memberId: deletMemberQualification.memberId }) .andWhere("memberId = :memberId", { memberId: deleteMemberQualification.memberId })
.execute() .execute()
.then(() => {}) .then(() => {})
.catch((err) => { .catch((err) => {

View file

@ -1,7 +1,5 @@
import { dataSource } from "../../../data-source"; import { dataSource } from "../../../data-source";
import { member } from "../../../entity/club/member/member";
import { membership } from "../../../entity/club/member/membership"; import { membership } from "../../../entity/club/member/membership";
import { membershipStatus } from "../../../entity/settings/membershipStatus";
import InternalException from "../../../exceptions/internalException"; import InternalException from "../../../exceptions/internalException";
import { CreateMembershipCommand, DeleteMembershipCommand, UpdateMembershipCommand } from "./membershipCommand"; import { CreateMembershipCommand, DeleteMembershipCommand, UpdateMembershipCommand } from "./membershipCommand";

View file

@ -6,7 +6,7 @@ import { CreateNewsletterCommand, SendNewsletterCommand, SynchronizeNewsletterCo
export default abstract class NewsletterCommandHandler { export default abstract class NewsletterCommandHandler {
/** /**
* @description create newsletter * @description create newsletter
* @param CreateNewsletterCommand * @param {CreateNewsletterCommand} createNewsletter
* @returns {Promise<number>} * @returns {Promise<number>}
*/ */
static async create(createNewsletter: CreateNewsletterCommand): Promise<number> { static async create(createNewsletter: CreateNewsletterCommand): Promise<number> {
@ -28,7 +28,7 @@ export default abstract class NewsletterCommandHandler {
/** /**
* @description sync newsletter * @description sync newsletter
* @param SynchronizeNewsletterCommand * @param {SynchronizeNewsletterCommand} syncNewsletter
* @returns {Promise<void>} * @returns {Promise<void>}
*/ */
static async sync(syncNewsletter: SynchronizeNewsletterCommand): Promise<void> { static async sync(syncNewsletter: SynchronizeNewsletterCommand): Promise<void> {
@ -53,7 +53,7 @@ export default abstract class NewsletterCommandHandler {
/** /**
* @description send newsletter * @description send newsletter
* @param SendNewsletterCommand * @param {SendNewsletterCommand} syncNewsletter
* @returns {Promise<void>} * @returns {Promise<void>}
*/ */
static async send(syncNewsletter: SendNewsletterCommand): Promise<void> { static async send(syncNewsletter: SendNewsletterCommand): Promise<void> {

View file

@ -6,7 +6,7 @@ import { SynchronizeProtocolAgendaCommand } from "./protocolAgendaCommand";
export default abstract class ProtocolAgendaCommandHandler { export default abstract class ProtocolAgendaCommandHandler {
/** /**
* @description create protocolAgenda * @description create protocolAgenda
* @param {number} * @param {number} protocolId
* @returns {Promise<number>} * @returns {Promise<number>}
*/ */
static async create(protocolId: number): Promise<number> { static async create(protocolId: number): Promise<number> {
@ -30,7 +30,7 @@ export default abstract class ProtocolAgendaCommandHandler {
/** /**
* @description sync protocolAgenda * @description sync protocolAgenda
* @param {Array<SynchronizeProtocolAgendaCommand>} * @param {Array<SynchronizeProtocolAgendaCommand>} syncProtocolAgenda
* @returns {Promise<void>} * @returns {Promise<void>}
*/ */
static async sync(syncProtocolAgenda: Array<SynchronizeProtocolAgendaCommand>): Promise<void> { static async sync(syncProtocolAgenda: Array<SynchronizeProtocolAgendaCommand>): Promise<void> {

View file

@ -6,7 +6,7 @@ import { CreateProtocolCommand, SynchronizeProtocolCommand } from "./protocolCom
export default abstract class ProtocolCommandHandler { export default abstract class ProtocolCommandHandler {
/** /**
* @description create protocol * @description create protocol
* @param CreateProtocolCommand * @param {CreateProtocolCommand} createProtocol
* @returns {Promise<number>} * @returns {Promise<number>}
*/ */
static async create(createProtocol: CreateProtocolCommand): Promise<number> { static async create(createProtocol: CreateProtocolCommand): Promise<number> {
@ -29,7 +29,7 @@ export default abstract class ProtocolCommandHandler {
/** /**
* @description sync protocol * @description sync protocol
* @param SynchronizeProtocolCommand * @param {SynchronizeProtocolCommand} syncProtocol
* @returns {Promise<void>} * @returns {Promise<void>}
*/ */
static async sync(syncProtocol: SynchronizeProtocolCommand): Promise<void> { static async sync(syncProtocol: SynchronizeProtocolCommand): Promise<void> {

View file

@ -6,7 +6,7 @@ import { SynchronizeProtocolDecisionCommand } from "./protocolDecisionCommand";
export default abstract class ProtocolDecisionCommandHandler { export default abstract class ProtocolDecisionCommandHandler {
/** /**
* @description create protocolDecision * @description create protocolDecision
* @param {number} * @param {number} protocolId
* @returns {Promise<number>} * @returns {Promise<number>}
*/ */
static async create(protocolId: number): Promise<number> { static async create(protocolId: number): Promise<number> {
@ -29,7 +29,7 @@ export default abstract class ProtocolDecisionCommandHandler {
} }
/** /**
* @description sync protocolDecision * @description sync protocolDecision
* @param {Array<SynchronizeProtocolDecisionCommand>} * @param {Array<SynchronizeProtocolDecisionCommand>} syncProtocolDecisions
* @returns {Promise<void>} * @returns {Promise<void>}
*/ */
static async sync(syncProtocolDecisions: Array<SynchronizeProtocolDecisionCommand>): Promise<void> { static async sync(syncProtocolDecisions: Array<SynchronizeProtocolDecisionCommand>): Promise<void> {

View file

@ -8,7 +8,7 @@ import { ProtocolPresenceCommand, SynchronizeProtocolPresenceCommand } from "./p
export default abstract class ProtocolPresenceCommandHandler { export default abstract class ProtocolPresenceCommandHandler {
/** /**
* @description sync protocolPresence * @description sync protocolPresence
* @param {SynchronizeProtocolPresenceCommand} * @param {SynchronizeProtocolPresenceCommand} syncProtocolPresences
* @returns {Promise<void>} * @returns {Promise<void>}
*/ */
static async sync(syncProtocolPresences: SynchronizeProtocolPresenceCommand): Promise<void> { static async sync(syncProtocolPresences: SynchronizeProtocolPresenceCommand): Promise<void> {

View file

@ -6,7 +6,7 @@ import { CreateProtocolPrintoutCommand } from "./protocolPrintoutCommand";
export default abstract class ProtocolPrintoutCommandHandler { export default abstract class ProtocolPrintoutCommandHandler {
/** /**
* @description create protocolPrintout * @description create protocolPrintout
* @param {number} * @param {CreateProtocolPrintoutCommand} printout
* @returns {Promise<number>} * @returns {Promise<number>}
*/ */
static async create(printout: CreateProtocolPrintoutCommand): Promise<number> { static async create(printout: CreateProtocolPrintoutCommand): Promise<number> {

View file

@ -6,7 +6,7 @@ import { SynchronizeProtocolVotingCommand } from "./protocolVotingCommand";
export default abstract class ProtocolVotingCommandHandler { export default abstract class ProtocolVotingCommandHandler {
/** /**
* @description create protocolVoting * @description create protocolVoting
* @param {number} * @param {number} protocolId
* @returns {Promise<number>} * @returns {Promise<number>}
*/ */
static async create(protocolId: number): Promise<number> { static async create(protocolId: number): Promise<number> {
@ -29,7 +29,7 @@ export default abstract class ProtocolVotingCommandHandler {
} }
/** /**
* @description sync protocolVoting * @description sync protocolVoting
* @param {Array<SynchronizeProtocolVotingCommand>} * @param {Array<SynchronizeProtocolVotingCommand>} syncProtocolVotings
* @returns {Promise<void>} * @returns {Promise<void>}
*/ */
static async sync(syncProtocolVotings: Array<SynchronizeProtocolVotingCommand>): Promise<void> { static async sync(syncProtocolVotings: Array<SynchronizeProtocolVotingCommand>): Promise<void> {

View file

@ -12,7 +12,7 @@ import ms from "ms";
export default abstract class RefreshCommandHandler { export default abstract class RefreshCommandHandler {
/** /**
* @description create and save refreshToken to user * @description create and save refreshToken to user
* @param CreateRefreshCommand * @param {CreateRefreshCommand} createRefresh
* @returns {Promise<string>} * @returns {Promise<string>}
*/ */
static async create(createRefresh: CreateRefreshCommand): Promise<string> { static async create(createRefresh: CreateRefreshCommand): Promise<string> {
@ -42,7 +42,7 @@ export default abstract class RefreshCommandHandler {
/** /**
* @description delete refresh by user and token * @description delete refresh by user and token
* @param DeleteRefreshCommand * @param {DeleteRefreshCommand} deleteRefresh
* @returns {Promise<any>} * @returns {Promise<any>}
*/ */
static async deleteByToken(deleteRefresh: DeleteRefreshCommand): Promise<any> { static async deleteByToken(deleteRefresh: DeleteRefreshCommand): Promise<any> {

View file

@ -7,7 +7,7 @@ import { CreateResetCommand, DeleteResetCommand } from "./resetCommand";
export default abstract class ResetCommandHandler { export default abstract class ResetCommandHandler {
/** /**
* @description create user * @description create user
* @param CreateResetCommand * @param {CreateResetCommand} createReset
* @returns {Promise<string>} * @returns {Promise<string>}
*/ */
static async create(createReset: CreateResetCommand): Promise<string> { static async create(createReset: CreateResetCommand): Promise<string> {
@ -35,7 +35,7 @@ export default abstract class ResetCommandHandler {
/** /**
* @description delete reset by mail and token * @description delete reset by mail and token
* @param DeleteRefreshCommand * @param {DeleteRefreshCommand} deleteReset
* @returns {Promise<any>} * @returns {Promise<any>}
*/ */
static async deleteByTokenAndMail(deleteReset: DeleteResetCommand): Promise<any> { static async deleteByTokenAndMail(deleteReset: DeleteResetCommand): Promise<any> {

View file

@ -6,7 +6,7 @@ import { CreateAwardCommand, DeleteAwardCommand, UpdateAwardCommand } from "./aw
export default abstract class AwardCommandHandler { export default abstract class AwardCommandHandler {
/** /**
* @description create award * @description create award
* @param CreateAwardCommand * @param {CreateAwardCommand} createAward
* @returns {Promise<number>} * @returns {Promise<number>}
*/ */
static async create(createAward: CreateAwardCommand): Promise<number> { static async create(createAward: CreateAwardCommand): Promise<number> {
@ -28,7 +28,7 @@ export default abstract class AwardCommandHandler {
/** /**
* @description update award * @description update award
* @param UpdateAwardCommand * @param {UpdateAwardCommand} updateAward
* @returns {Promise<void>} * @returns {Promise<void>}
*/ */
static async update(updateAward: UpdateAwardCommand): Promise<void> { static async update(updateAward: UpdateAwardCommand): Promise<void> {
@ -48,15 +48,15 @@ export default abstract class AwardCommandHandler {
/** /**
* @description delete award * @description delete award
* @param DeleteAwardCommand * @param {DeleteAwardCommand} deleteAward
* @returns {Promise<void>} * @returns {Promise<void>}
*/ */
static async delete(deletAward: DeleteAwardCommand): Promise<void> { static async delete(deleteAward: DeleteAwardCommand): Promise<void> {
return await dataSource return await dataSource
.createQueryBuilder() .createQueryBuilder()
.delete() .delete()
.from(award) .from(award)
.where("id = :id", { id: deletAward.id }) .where("id = :id", { id: deleteAward.id })
.execute() .execute()
.then(() => {}) .then(() => {})
.catch((err) => { .catch((err) => {

View file

@ -6,7 +6,7 @@ import { CreateCalendarTypeCommand, DeleteCalendarTypeCommand, UpdateCalendarTyp
export default abstract class CalendarTypeCommandHandler { export default abstract class CalendarTypeCommandHandler {
/** /**
* @description create calendarType * @description create calendarType
* @param CreateCalendarTypeCommand * @param {CreateCalendarTypeCommand} createCalendarType
* @returns {Promise<number>} * @returns {Promise<number>}
*/ */
static async create(createCalendarType: CreateCalendarTypeCommand): Promise<number> { static async create(createCalendarType: CreateCalendarTypeCommand): Promise<number> {
@ -31,7 +31,7 @@ export default abstract class CalendarTypeCommandHandler {
/** /**
* @description update calendarType * @description update calendarType
* @param UpdateCalendarTypeCommand * @param {UpdateCalendarTypeCommand} updateCalendarType
* @returns {Promise<void>} * @returns {Promise<void>}
*/ */
static async update(updateCalendarType: UpdateCalendarTypeCommand): Promise<void> { static async update(updateCalendarType: UpdateCalendarTypeCommand): Promise<void> {
@ -54,7 +54,7 @@ export default abstract class CalendarTypeCommandHandler {
/** /**
* @description delete calendarType * @description delete calendarType
* @param DeleteCalendarTypeCommand * @param {DeleteCalendarTypeCommand} deleteCalendarType
* @returns {Promise<void>} * @returns {Promise<void>}
*/ */
static async delete(deleteCalendarType: DeleteCalendarTypeCommand): Promise<void> { static async delete(deleteCalendarType: DeleteCalendarTypeCommand): Promise<void> {

View file

@ -10,7 +10,7 @@ import {
export default abstract class CommunicationTypeCommandHandler { export default abstract class CommunicationTypeCommandHandler {
/** /**
* @description create communicationType * @description create communicationType
* @param CreateCommunicationTypeCommand * @param {CreateCommunicationTypeCommand} createCommunicationType
* @returns {Promise<number>} * @returns {Promise<number>}
*/ */
static async create(createCommunicationType: CreateCommunicationTypeCommand): Promise<number> { static async create(createCommunicationType: CreateCommunicationTypeCommand): Promise<number> {
@ -33,7 +33,7 @@ export default abstract class CommunicationTypeCommandHandler {
/** /**
* @description update communicationType * @description update communicationType
* @param UpdateCommunicationTypeCommand * @param {UpdateCommunicationTypeCommand} updateCommunicationType
* @returns {Promise<void>} * @returns {Promise<void>}
*/ */
static async update(updateCommunicationType: UpdateCommunicationTypeCommand): Promise<void> { static async update(updateCommunicationType: UpdateCommunicationTypeCommand): Promise<void> {
@ -54,15 +54,15 @@ export default abstract class CommunicationTypeCommandHandler {
/** /**
* @description delete communicationType * @description delete communicationType
* @param DeleteCommunicationTypeCommand * @param {DeleteCommunicationTypeCommand} deleteCommunicationType
* @returns {Promise<void>} * @returns {Promise<void>}
*/ */
static async delete(deletCommunicationType: DeleteCommunicationTypeCommand): Promise<void> { static async delete(deleteCommunicationType: DeleteCommunicationTypeCommand): Promise<void> {
return await dataSource return await dataSource
.createQueryBuilder() .createQueryBuilder()
.delete() .delete()
.from(communicationType) .from(communicationType)
.where("id = :id", { id: deletCommunicationType.id }) .where("id = :id", { id: deleteCommunicationType.id })
.execute() .execute()
.then(() => {}) .then(() => {})
.catch((err) => { .catch((err) => {

View file

@ -10,7 +10,7 @@ import {
export default abstract class ExecutivePositionCommandHandler { export default abstract class ExecutivePositionCommandHandler {
/** /**
* @description create executivePosition * @description create executivePosition
* @param CreateExecutivePositionCommand * @param {CreateExecutivePositionCommand} createExecutivePosition
* @returns {Promise<number>} * @returns {Promise<number>}
*/ */
static async create(createExecutivePosition: CreateExecutivePositionCommand): Promise<number> { static async create(createExecutivePosition: CreateExecutivePositionCommand): Promise<number> {
@ -32,7 +32,7 @@ export default abstract class ExecutivePositionCommandHandler {
/** /**
* @description update executivePosition * @description update executivePosition
* @param UpdateExecutivePositionCommand * @param {UpdateExecutivePositionCommand} updateExecutivePosition
* @returns {Promise<void>} * @returns {Promise<void>}
*/ */
static async update(updateExecutivePosition: UpdateExecutivePositionCommand): Promise<void> { static async update(updateExecutivePosition: UpdateExecutivePositionCommand): Promise<void> {
@ -52,15 +52,15 @@ export default abstract class ExecutivePositionCommandHandler {
/** /**
* @description delete executivePosition * @description delete executivePosition
* @param DeleteExecutivePositionCommand * @param {DeleteExecutivePositionCommand} deleteExecutivePosition
* @returns {Promise<void>} * @returns {Promise<void>}
*/ */
static async delete(deletExecutivePosition: DeleteExecutivePositionCommand): Promise<void> { static async delete(deleteExecutivePosition: DeleteExecutivePositionCommand): Promise<void> {
return await dataSource return await dataSource
.createQueryBuilder() .createQueryBuilder()
.delete() .delete()
.from(executivePosition) .from(executivePosition)
.where("id = :id", { id: deletExecutivePosition.id }) .where("id = :id", { id: deleteExecutivePosition.id })
.execute() .execute()
.then(() => {}) .then(() => {})
.catch((err) => { .catch((err) => {

View file

@ -10,7 +10,7 @@ import {
export default abstract class MembershipStatusCommandHandler { export default abstract class MembershipStatusCommandHandler {
/** /**
* @description create membershipStatus * @description create membershipStatus
* @param CreateMembershipStatusCommand * @param {CreateMembershipStatusCommand} createMembershipStatus
* @returns {Promise<number>} * @returns {Promise<number>}
*/ */
static async create(createMembershipStatus: CreateMembershipStatusCommand): Promise<number> { static async create(createMembershipStatus: CreateMembershipStatusCommand): Promise<number> {
@ -32,7 +32,7 @@ export default abstract class MembershipStatusCommandHandler {
/** /**
* @description update membershipStatus * @description update membershipStatus
* @param UpdateMembershipStatusCommand * @param {UpdateMembershipStatusCommand} updateMembershipStatus
* @returns {Promise<void>} * @returns {Promise<void>}
*/ */
static async update(updateMembershipStatus: UpdateMembershipStatusCommand): Promise<void> { static async update(updateMembershipStatus: UpdateMembershipStatusCommand): Promise<void> {
@ -52,15 +52,15 @@ export default abstract class MembershipStatusCommandHandler {
/** /**
* @description delete membershipStatus * @description delete membershipStatus
* @param DeleteMembershipStatusCommand * @param {DeleteMembershipStatusCommand} deleteMembershipStatus
* @returns {Promise<void>} * @returns {Promise<void>}
*/ */
static async delete(deletMembershipStatus: DeleteMembershipStatusCommand): Promise<void> { static async delete(deleteMembershipStatus: DeleteMembershipStatusCommand): Promise<void> {
return await dataSource return await dataSource
.createQueryBuilder() .createQueryBuilder()
.delete() .delete()
.from(membershipStatus) .from(membershipStatus)
.where("id = :id", { id: deletMembershipStatus.id }) .where("id = :id", { id: deleteMembershipStatus.id })
.execute() .execute()
.then(() => {}) .then(() => {})
.catch((err) => { .catch((err) => {

View file

@ -6,7 +6,7 @@ import { DeleteNewsletterConfigCommand, SetNewsletterConfigCommand } from "./new
export default abstract class NewsletterConfigCommandHandler { export default abstract class NewsletterConfigCommandHandler {
/** /**
* @description set newsletterConfig * @description set newsletterConfig
* @param SetNewsletterConfigCommand * @param {SetNewsletterConfigCommand} setNewsletterConfig
* @returns {Promise<number>} * @returns {Promise<number>}
*/ */
static async set(setNewsletterConfig: SetNewsletterConfigCommand): Promise<number> { static async set(setNewsletterConfig: SetNewsletterConfigCommand): Promise<number> {
@ -29,7 +29,7 @@ export default abstract class NewsletterConfigCommandHandler {
} }
/** /**
* @description delete newsletterConfig * @description delete newsletterConfig
* @param number * @param {DeleteNewsletterConfigCommand} deleteNewsletterConfig
* @returns {Promise<void>} * @returns {Promise<void>}
*/ */
static async delete(deleteNewsletterConfig: DeleteNewsletterConfigCommand): Promise<void> { static async delete(deleteNewsletterConfig: DeleteNewsletterConfigCommand): Promise<void> {

View file

@ -10,7 +10,7 @@ import {
export default abstract class QualificationCommandHandler { export default abstract class QualificationCommandHandler {
/** /**
* @description create qualification * @description create qualification
* @param CreateQualificationCommand * @param {CreateQualificationCommand} createQualification
* @returns {Promise<number>} * @returns {Promise<number>}
*/ */
static async create(createQualification: CreateQualificationCommand): Promise<number> { static async create(createQualification: CreateQualificationCommand): Promise<number> {
@ -33,7 +33,7 @@ export default abstract class QualificationCommandHandler {
/** /**
* @description update qualification * @description update qualification
* @param UpdateQualificationCommand * @param {UpdateQualificationCommand} updateQualification
* @returns {Promise<void>} * @returns {Promise<void>}
*/ */
static async update(updateQualification: UpdateQualificationCommand): Promise<void> { static async update(updateQualification: UpdateQualificationCommand): Promise<void> {
@ -54,15 +54,15 @@ export default abstract class QualificationCommandHandler {
/** /**
* @description delete qualification * @description delete qualification
* @param DeleteQualificationCommand * @param {DeleteQualificationCommand} deleteQualification
* @returns {Promise<void>} * @returns {Promise<void>}
*/ */
static async delete(deletQualification: DeleteQualificationCommand): Promise<void> { static async delete(deleteQualification: DeleteQualificationCommand): Promise<void> {
return await dataSource return await dataSource
.createQueryBuilder() .createQueryBuilder()
.delete() .delete()
.from(qualification) .from(qualification)
.where("id = :id", { id: deletQualification.id }) .where("id = :id", { id: deleteQualification.id })
.execute() .execute()
.then(() => {}) .then(() => {})
.catch((err) => { .catch((err) => {

View file

@ -6,7 +6,7 @@ import { CreateQueryStoreCommand, DeleteQueryStoreCommand, UpdateQueryStoreComma
export default abstract class QueryStoreCommandHandler { export default abstract class QueryStoreCommandHandler {
/** /**
* @description create queryStore * @description create queryStore
* @param CreateQueryStoreCommand * @param {CreateQueryStoreCommand} createQueryStore
* @returns {Promise<number>} * @returns {Promise<number>}
*/ */
static async create(createQueryStore: CreateQueryStoreCommand): Promise<number> { static async create(createQueryStore: CreateQueryStoreCommand): Promise<number> {
@ -30,7 +30,7 @@ export default abstract class QueryStoreCommandHandler {
/** /**
* @description update queryStore * @description update queryStore
* @param UpdateQueryStoreCommand * @param {UpdateQueryStoreCommand} updateQueryStore
* @returns {Promise<void>} * @returns {Promise<void>}
*/ */
static async update(updateQueryStore: UpdateQueryStoreCommand): Promise<void> { static async update(updateQueryStore: UpdateQueryStoreCommand): Promise<void> {
@ -51,15 +51,15 @@ export default abstract class QueryStoreCommandHandler {
/** /**
* @description delete queryStore * @description delete queryStore
* @param DeleteQueryStoreCommand * @param {DeleteQueryStoreCommand} deleteQueryStore
* @returns {Promise<void>} * @returns {Promise<void>}
*/ */
static async delete(deletQueryStore: DeleteQueryStoreCommand): Promise<void> { static async delete(deleteQueryStore: DeleteQueryStoreCommand): Promise<void> {
return await dataSource return await dataSource
.createQueryBuilder() .createQueryBuilder()
.delete() .delete()
.from(query) .from(query)
.where("id = :id", { id: deletQueryStore.id }) .where("id = :id", { id: deleteQueryStore.id })
.execute() .execute()
.then(() => {}) .then(() => {})
.catch((err) => { .catch((err) => {

View file

@ -6,7 +6,7 @@ import { CreateTemplateCommand, DeleteTemplateCommand, UpdateTemplateCommand } f
export default abstract class TemplateCommandHandler { export default abstract class TemplateCommandHandler {
/** /**
* @description create template * @description create template
* @param CreateTemplateCommand * @param {CreateTemplateCommand} createTemplate
* @returns {Promise<number>} * @returns {Promise<number>}
*/ */
static async create(createTemplate: CreateTemplateCommand): Promise<number> { static async create(createTemplate: CreateTemplateCommand): Promise<number> {
@ -29,7 +29,7 @@ export default abstract class TemplateCommandHandler {
/** /**
* @description update template * @description update template
* @param UpdateTemplateCommand * @param {UpdateTemplateCommand} updateTemplate
* @returns {Promise<void>} * @returns {Promise<void>}
*/ */
static async update(updateTemplate: UpdateTemplateCommand): Promise<void> { static async update(updateTemplate: UpdateTemplateCommand): Promise<void> {
@ -52,15 +52,15 @@ export default abstract class TemplateCommandHandler {
/** /**
* @description delete template * @description delete template
* @param DeleteTemplateCommand * @param {DeleteTemplateCommand} deleteTemplate
* @returns {Promise<void>} * @returns {Promise<void>}
*/ */
static async delete(deletTemplate: DeleteTemplateCommand): Promise<void> { static async delete(deleteTemplate: DeleteTemplateCommand): Promise<void> {
return await dataSource return await dataSource
.createQueryBuilder() .createQueryBuilder()
.delete() .delete()
.from(template) .from(template)
.where("id = :id", { id: deletTemplate.id }) .where("id = :id", { id: deleteTemplate.id })
.execute() .execute()
.then(() => {}) .then(() => {})
.catch((err) => { .catch((err) => {

View file

@ -6,7 +6,7 @@ import { UpdateTemplateUsageCommand } from "./templateUsageCommand";
export default abstract class TemplateUsageCommandHandler { export default abstract class TemplateUsageCommandHandler {
/** /**
* @description update templateUsage * @description update templateUsage
* @param UpdateTemplateUsageCommand * @param {UpdateTemplateUsageCommand} updateTemplateUsage
* @returns {Promise<void>} * @returns {Promise<void>}
*/ */
static async update(updateTemplateUsage: UpdateTemplateUsageCommand): Promise<void> { static async update(updateTemplateUsage: UpdateTemplateUsageCommand): Promise<void> {

View file

@ -6,7 +6,7 @@ import { CreateRoleCommand, DeleteRoleCommand, UpdateRoleCommand } from "./roleC
export default abstract class RoleCommandHandler { export default abstract class RoleCommandHandler {
/** /**
* @description create role * @description create role
* @param CreateRoleCommand * @param {CreateRoleCommand} createRole
* @returns {Promise<number>} * @returns {Promise<number>}
*/ */
static async create(createRole: CreateRoleCommand): Promise<number> { static async create(createRole: CreateRoleCommand): Promise<number> {
@ -28,7 +28,7 @@ export default abstract class RoleCommandHandler {
/** /**
* @description update role * @description update role
* @param UpdateRoleCommand * @param {UpdateRoleCommand} updateRole
* @returns {Promise<void>} * @returns {Promise<void>}
*/ */
static async update(updateRole: UpdateRoleCommand): Promise<void> { static async update(updateRole: UpdateRoleCommand): Promise<void> {
@ -48,7 +48,7 @@ export default abstract class RoleCommandHandler {
/** /**
* @description delete role * @description delete role
* @param DeleteRoleCommand * @param {DeleteRoleCommand} deleteRole
* @returns {Promise<void>} * @returns {Promise<void>}
*/ */
static async delete(deleteRole: DeleteRoleCommand): Promise<void> { static async delete(deleteRole: DeleteRoleCommand): Promise<void> {

View file

@ -10,13 +10,12 @@ import {
} from "./rolePermissionCommand"; } from "./rolePermissionCommand";
import PermissionHelper from "../../../helpers/permissionHelper"; import PermissionHelper from "../../../helpers/permissionHelper";
import RolePermissionService from "../../../service/user/rolePermissionService"; import RolePermissionService from "../../../service/user/rolePermissionService";
import { role } from "../../../entity/user/role";
import { PermissionString } from "../../../type/permissionTypes"; import { PermissionString } from "../../../type/permissionTypes";
export default abstract class RolePermissionCommandHandler { export default abstract class RolePermissionCommandHandler {
/** /**
* @description update role permissions * @description update role permissions
* @param UpdateRolePermissionsCommand * @param {UpdateRolePermissionsCommand} updateRolePermissions
* @returns {Promise<void>} * @returns {Promise<void>}
*/ */
static async updatePermissions(updateRolePermissions: UpdateRolePermissionsCommand): Promise<void> { static async updatePermissions(updateRolePermissions: UpdateRolePermissionsCommand): Promise<void> {
@ -75,7 +74,7 @@ export default abstract class RolePermissionCommandHandler {
/** /**
* @description grant permission to user * @description grant permission to user
* @param CreateRolePermissionCommand * @param {CreateRolePermissionCommand} createPermission
* @returns {Promise<number>} * @returns {Promise<number>}
*/ */
static async create(createPermission: CreateRolePermissionCommand): Promise<number> { static async create(createPermission: CreateRolePermissionCommand): Promise<number> {
@ -98,7 +97,7 @@ export default abstract class RolePermissionCommandHandler {
/** /**
* @description remove permission from role * @description remove permission from role
* @param DeleteRolePermissionCommand * @param {DeleteRolePermissionCommand} deletePermission
* @returns {Promise<any>} * @returns {Promise<any>}
*/ */
static async delete(deletePermission: DeleteRolePermissionCommand): Promise<any> { static async delete(deletePermission: DeleteRolePermissionCommand): Promise<any> {
@ -109,7 +108,7 @@ export default abstract class RolePermissionCommandHandler {
.where("roleId = :id", { id: deletePermission.roleId }) .where("roleId = :id", { id: deletePermission.roleId })
.andWhere("permission = :permission", { permission: deletePermission.permission }) .andWhere("permission = :permission", { permission: deletePermission.permission })
.execute() .execute()
.then((res) => {}) .then(() => {})
.catch((err) => { .catch((err) => {
throw new InternalException("failed role permission removal", err); throw new InternalException("failed role permission removal", err);
}); });

View file

@ -15,7 +15,7 @@ import UserService from "../../../service/user/userService";
export default abstract class UserCommandHandler { export default abstract class UserCommandHandler {
/** /**
* @description create user * @description create user
* @param CreateUserCommand * @param {CreateUserCommand} createUser
* @returns {Promise<number>} * @returns {Promise<number>}
*/ */
static async create(createUser: CreateUserCommand): Promise<number> { static async create(createUser: CreateUserCommand): Promise<number> {
@ -42,7 +42,7 @@ export default abstract class UserCommandHandler {
/** /**
* @description update user * @description update user
* @param UpdateUserCommand * @param {UpdateUserCommand} updateUser
* @returns {Promise<void>} * @returns {Promise<void>}
*/ */
static async update(updateUser: UpdateUserCommand): Promise<void> { static async update(updateUser: UpdateUserCommand): Promise<void> {
@ -65,7 +65,7 @@ export default abstract class UserCommandHandler {
/** /**
* @description update user * @description update user
* @param UpdateUserSecretCommand * @param {UpdateUserSecretCommand} updateUser
* @returns {Promise<void>} * @returns {Promise<void>}
*/ */
static async updateSecret(updateUser: UpdateUserSecretCommand): Promise<void> { static async updateSecret(updateUser: UpdateUserSecretCommand): Promise<void> {
@ -85,7 +85,7 @@ export default abstract class UserCommandHandler {
/** /**
* @description update user roles * @description update user roles
* @param UpdateUserRolesCommand * @param {UpdateUserRolesCommand} updateUserRoles
* @returns {Promise<void>} * @returns {Promise<void>}
*/ */
static async updateRoles(updateUserRoles: UpdateUserRolesCommand): Promise<void> { static async updateRoles(updateUserRoles: UpdateUserRolesCommand): Promise<void> {
@ -119,13 +119,13 @@ export default abstract class UserCommandHandler {
/** /**
* @description transfer ownership * @description transfer ownership
* @param TransferUserOwnerCommand * @param {TransferUserOwnerCommand} transferOwnership
* @returns {Promise<void>} * @returns {Promise<void>}
*/ */
static async transferOwnership(transferOwnership: TransferUserOwnerCommand): Promise<void> { static async transferOwnership(transferOwnership: TransferUserOwnerCommand): Promise<void> {
return await dataSource.manager return await dataSource.manager
.transaction(async (manager) => { .transaction(async (manager) => {
manager await manager
.createQueryBuilder() .createQueryBuilder()
.update(user) .update(user)
.set({ .set({
@ -134,7 +134,7 @@ export default abstract class UserCommandHandler {
.where("id = :id", { id: transferOwnership.fromId }) .where("id = :id", { id: transferOwnership.fromId })
.execute(); .execute();
manager await manager
.createQueryBuilder() .createQueryBuilder()
.update(user) .update(user)
.set({ .set({

View file

@ -15,7 +15,7 @@ import { PermissionString } from "../../../type/permissionTypes";
export default abstract class UserPermissionCommandHandler { export default abstract class UserPermissionCommandHandler {
/** /**
* @description update user permissions * @description update user permissions
* @param UpdateUserPermissionsCommand * @param {UpdateUserPermissionsCommand} updateUserPermissions
* @returns {Promise<void>} * @returns {Promise<void>}
*/ */
static async updatePermissions(updateUserPermissions: UpdateUserPermissionsCommand): Promise<void> { static async updatePermissions(updateUserPermissions: UpdateUserPermissionsCommand): Promise<void> {
@ -75,7 +75,7 @@ export default abstract class UserPermissionCommandHandler {
/** /**
* @description grant permission to user * @description grant permission to user
* @param CreateUserPermissionCommand * @param {CreateUserPermissionCommand} createPermission
* @returns {Promise<number>} * @returns {Promise<number>}
*/ */
static async create(createPermission: CreateUserPermissionCommand): Promise<number> { static async create(createPermission: CreateUserPermissionCommand): Promise<number> {
@ -98,7 +98,7 @@ export default abstract class UserPermissionCommandHandler {
/** /**
* @description remove permission to user * @description remove permission to user
* @param DeleteUserPermissionCommand * @param {DeleteUserPermissionCommand} deletePermission
* @returns {Promise<any>} * @returns {Promise<any>}
*/ */
static async delete(deletePermission: DeleteUserPermissionCommand): Promise<any> { static async delete(deletePermission: DeleteUserPermissionCommand): Promise<any> {