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

View file

@ -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<number>}
*/
static async create(createCommunication: CreateCommunicationCommand): Promise<number> {
@ -44,7 +42,7 @@ export default abstract class CommunicationCommandHandler {
/**
* @description update communication
* @param UpdateCommunicationCommand
* @param {UpdateCommunicationCommand} updateCommunication
* @returns {Promise<void>}
*/
static async update(updateCommunication: UpdateCommunicationCommand): Promise<void> {
@ -73,7 +71,7 @@ export default abstract class CommunicationCommandHandler {
/**
* @description delete communication
* @param DeleteCommunicationCommand
* @param {DeleteCommunicationCommand} deleteCommunication
* @returns {Promise<void>}
*/
static async delete(deleteCommunication: DeleteCommunicationCommand): Promise<void> {

View file

@ -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<number>}
*/
static async create(createMemberAward: CreateMemberAwardCommand): Promise<number> {
@ -34,7 +32,7 @@ export default abstract class MemberAwardCommandHandler {
/**
* @description update memberAward
* @param UpdateMemberAwardCommand
* @param {UpdateMemberAwardCommand} updateMemberAward
* @returns {Promise<void>}
*/
static async update(updateMemberAward: UpdateMemberAwardCommand): Promise<void> {
@ -58,16 +56,16 @@ export default abstract class MemberAwardCommandHandler {
/**
* @description delete memberAward
* @param DeleteMemberAwardCommand
* @param {DeleteMemberAwardCommand} deleteMemberAward
* @returns {Promise<void>}
*/
static async delete(deletMemberAward: DeleteMemberAwardCommand): Promise<void> {
static async delete(deleteMemberAward: DeleteMemberAwardCommand): Promise<void> {
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) => {

View file

@ -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<number>}
*/
static async create(createMember: CreateMemberCommand): Promise<number> {
@ -40,7 +39,7 @@ export default abstract class MemberCommandHandler {
/**
* @description update member
* @param UpdateMemberCommand
* @param {UpdateMemberCommand} updateMember
* @returns {Promise<void>}
*/
static async update(updateMember: UpdateMemberCommand): Promise<void> {
@ -66,7 +65,7 @@ export default abstract class MemberCommandHandler {
/**
* @description update member newsletter
* @param UpdateMemberCommand
* @param {UpdateMemberCommand} updateMember
* @returns {Promise<void>}
*/
static async updateNewsletter(updateMember: UpdateMemberNewsletterCommand): Promise<void> {
@ -91,7 +90,7 @@ export default abstract class MemberCommandHandler {
/**
* @description update member newsletter to unset
* @param memberId string
* @param {number} memberId
* @returns {Promise<void>}
*/
static async unsetNewsletter(memberId: number): Promise<void> {
@ -111,7 +110,7 @@ export default abstract class MemberCommandHandler {
/**
* @description delete member
* @param DeleteMemberCommand
* @param {DeleteMemberCommand} deleteMember
* @returns {Promise<void>}
*/
static async delete(deleteMember: DeleteMemberCommand): Promise<void> {

View file

@ -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<number>}
*/
static async create(createMemberExecutivePosition: CreateMemberExecutivePositionCommand): Promise<number> {
@ -38,7 +36,7 @@ export default abstract class MemberExecutivePositionCommandHandler {
/**
* @description update memberExecutivePosition
* @param UpdateMemberExecutivePositionCommand
* @param {UpdateMemberExecutivePositionCommand} updateMemberExecutivePosition
* @returns {Promise<void>}
*/
static async update(updateMemberExecutivePosition: UpdateMemberExecutivePositionCommand): Promise<void> {
@ -62,16 +60,16 @@ export default abstract class MemberExecutivePositionCommandHandler {
/**
* @description delete memberExecutivePosition
* @param DeleteMemberExecutivePositionCommand
* @param {DeleteMemberExecutivePositionCommand} deleteMemberExecutivePosition
* @returns {Promise<void>}
*/
static async delete(deletMemberExecutivePosition: DeleteMemberExecutivePositionCommand): Promise<void> {
static async delete(deleteMemberExecutivePosition: DeleteMemberExecutivePositionCommand): Promise<void> {
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) => {

View file

@ -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<number>}
*/
static async create(createMemberQualification: CreateMemberQualificationCommand): Promise<number> {
@ -37,7 +35,7 @@ export default abstract class MemberQualificationCommandHandler {
/**
* @description update memberQualification
* @param UpdateMemberQualificationCommand
* @param {UpdateMemberQualificationCommand} updateMemberQualification
* @returns {Promise<void>}
*/
static async update(updateMemberQualification: UpdateMemberQualificationCommand): Promise<void> {
@ -62,16 +60,16 @@ export default abstract class MemberQualificationCommandHandler {
/**
* @description delete memberQualification
* @param DeleteMemberQualificationCommand
* @param {DeleteMemberQualificationCommand} deleteMemberQualification
* @returns {Promise<void>}
*/
static async delete(deletMemberQualification: DeleteMemberQualificationCommand): Promise<void> {
static async delete(deleteMemberQualification: DeleteMemberQualificationCommand): Promise<void> {
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) => {

View file

@ -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";

View file

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

View file

@ -6,7 +6,7 @@ import { SynchronizeProtocolAgendaCommand } from "./protocolAgendaCommand";
export default abstract class ProtocolAgendaCommandHandler {
/**
* @description create protocolAgenda
* @param {number}
* @param {number} protocolId
* @returns {Promise<number>}
*/
static async create(protocolId: number): Promise<number> {
@ -30,7 +30,7 @@ export default abstract class ProtocolAgendaCommandHandler {
/**
* @description sync protocolAgenda
* @param {Array<SynchronizeProtocolAgendaCommand>}
* @param {Array<SynchronizeProtocolAgendaCommand>} syncProtocolAgenda
* @returns {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 {
/**
* @description create protocol
* @param CreateProtocolCommand
* @param {CreateProtocolCommand} createProtocol
* @returns {Promise<number>}
*/
static async create(createProtocol: CreateProtocolCommand): Promise<number> {
@ -29,7 +29,7 @@ export default abstract class ProtocolCommandHandler {
/**
* @description sync protocol
* @param SynchronizeProtocolCommand
* @param {SynchronizeProtocolCommand} syncProtocol
* @returns {Promise<void>}
*/
static async sync(syncProtocol: SynchronizeProtocolCommand): Promise<void> {

View file

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

View file

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

View file

@ -6,7 +6,7 @@ import { SynchronizeProtocolVotingCommand } from "./protocolVotingCommand";
export default abstract class ProtocolVotingCommandHandler {
/**
* @description create protocolVoting
* @param {number}
* @param {number} protocolId
* @returns {Promise<number>}
*/
static async create(protocolId: number): Promise<number> {
@ -29,7 +29,7 @@ export default abstract class ProtocolVotingCommandHandler {
}
/**
* @description sync protocolVoting
* @param {Array<SynchronizeProtocolVotingCommand>}
* @param {Array<SynchronizeProtocolVotingCommand>} syncProtocolVotings
* @returns {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 {
/**
* @description create and save refreshToken to user
* @param CreateRefreshCommand
* @param {CreateRefreshCommand} createRefresh
* @returns {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
* @param DeleteRefreshCommand
* @param {DeleteRefreshCommand} deleteRefresh
* @returns {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 {
/**
* @description create user
* @param CreateResetCommand
* @param {CreateResetCommand} createReset
* @returns {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
* @param DeleteRefreshCommand
* @param {DeleteRefreshCommand} deleteReset
* @returns {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 {
/**
* @description create award
* @param CreateAwardCommand
* @param {CreateAwardCommand} createAward
* @returns {Promise<number>}
*/
static async create(createAward: CreateAwardCommand): Promise<number> {
@ -28,7 +28,7 @@ export default abstract class AwardCommandHandler {
/**
* @description update award
* @param UpdateAwardCommand
* @param {UpdateAwardCommand} updateAward
* @returns {Promise<void>}
*/
static async update(updateAward: UpdateAwardCommand): Promise<void> {
@ -48,15 +48,15 @@ export default abstract class AwardCommandHandler {
/**
* @description delete award
* @param DeleteAwardCommand
* @param {DeleteAwardCommand} deleteAward
* @returns {Promise<void>}
*/
static async delete(deletAward: DeleteAwardCommand): Promise<void> {
static async delete(deleteAward: DeleteAwardCommand): Promise<void> {
return await dataSource
.createQueryBuilder()
.delete()
.from(award)
.where("id = :id", { id: deletAward.id })
.where("id = :id", { id: deleteAward.id })
.execute()
.then(() => {})
.catch((err) => {

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -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<void>}
*/
static async updatePermissions(updateRolePermissions: UpdateRolePermissionsCommand): Promise<void> {
@ -75,7 +74,7 @@ export default abstract class RolePermissionCommandHandler {
/**
* @description grant permission to user
* @param CreateRolePermissionCommand
* @param {CreateRolePermissionCommand} createPermission
* @returns {Promise<number>}
*/
static async create(createPermission: CreateRolePermissionCommand): Promise<number> {
@ -98,7 +97,7 @@ export default abstract class RolePermissionCommandHandler {
/**
* @description remove permission from role
* @param DeleteRolePermissionCommand
* @param {DeleteRolePermissionCommand} deletePermission
* @returns {Promise<any>}
*/
static async delete(deletePermission: DeleteRolePermissionCommand): Promise<any> {
@ -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);
});

View file

@ -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<number>}
*/
static async create(createUser: CreateUserCommand): Promise<number> {
@ -42,7 +42,7 @@ export default abstract class UserCommandHandler {
/**
* @description update user
* @param UpdateUserCommand
* @param {UpdateUserCommand} updateUser
* @returns {Promise<void>}
*/
static async update(updateUser: UpdateUserCommand): Promise<void> {
@ -65,7 +65,7 @@ export default abstract class UserCommandHandler {
/**
* @description update user
* @param UpdateUserSecretCommand
* @param {UpdateUserSecretCommand} updateUser
* @returns {Promise<void>}
*/
static async updateSecret(updateUser: UpdateUserSecretCommand): Promise<void> {
@ -85,7 +85,7 @@ export default abstract class UserCommandHandler {
/**
* @description update user roles
* @param UpdateUserRolesCommand
* @param {UpdateUserRolesCommand} updateUserRoles
* @returns {Promise<void>}
*/
static async updateRoles(updateUserRoles: UpdateUserRolesCommand): Promise<void> {
@ -119,13 +119,13 @@ export default abstract class UserCommandHandler {
/**
* @description transfer ownership
* @param TransferUserOwnerCommand
* @param {TransferUserOwnerCommand} transferOwnership
* @returns {Promise<void>}
*/
static async transferOwnership(transferOwnership: TransferUserOwnerCommand): Promise<void> {
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({

View file

@ -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<void>}
*/
static async updatePermissions(updateUserPermissions: UpdateUserPermissionsCommand): Promise<void> {
@ -75,7 +75,7 @@ export default abstract class UserPermissionCommandHandler {
/**
* @description grant permission to user
* @param CreateUserPermissionCommand
* @param {CreateUserPermissionCommand} createPermission
* @returns {Promise<number>}
*/
static async create(createPermission: CreateUserPermissionCommand): Promise<number> {
@ -98,7 +98,7 @@ export default abstract class UserPermissionCommandHandler {
/**
* @description remove permission to user
* @param DeleteUserPermissionCommand
* @param {DeleteUserPermissionCommand} deletePermission
* @returns {Promise<any>}
*/
static async delete(deletePermission: DeleteUserPermissionCommand): Promise<any> {