#25-cleanup-&-enhancements #31

Merged
jkeffects merged 7 commits from #25-cleanup-&-enhancements into main 2025-01-05 15:12:11 +00:00
260 changed files with 1231 additions and 1002 deletions

View file

@ -2,5 +2,5 @@
node_modules/ node_modules/
dist/ dist/
.git/ .git/
export/ files/
.env .env

2
.gitignore vendored
View file

@ -130,6 +130,6 @@ dist
.yarn/install-state.gz .yarn/install-state.gz
.pnp.* .pnp.*
export files
.idea .idea

View file

@ -39,7 +39,7 @@ services:
- CLUB_NAME=<tobemodified> - CLUB_NAME=<tobemodified>
- CLUB_WEBSITE=<tobemodified> - CLUB_WEBSITE=<tobemodified>
volumes: volumes:
- <volume|local path>:/app/export - <volume|local path>:/app/files
networks: networks:
- ff_internal - ff_internal
depends_on: depends_on:

View file

@ -1,13 +1,13 @@
import { dataSource } from "../data-source"; import { dataSource } from "../../../data-source";
import { calendar } from "../entity/calendar"; import { calendar } from "../../../entity/club/calendar";
import { calendarType } from "../entity/calendarType"; import { calendarType } from "../../../entity/settings/calendarType";
import InternalException from "../exceptions/internalException"; import InternalException from "../../../exceptions/internalException";
import { CreateCalendarCommand, DeleteCalendarCommand, UpdateCalendarCommand } from "./calendarCommand"; import { CreateCalendarCommand, DeleteCalendarCommand, UpdateCalendarCommand } from "./calendarCommand";
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,8 +1,6 @@
import { dataSource } from "../data-source"; import { dataSource } from "../../../data-source";
import { communication } from "../entity/communication"; import { communication } from "../../../entity/club/member/communication";
import { communicationType } from "../entity/communicationType"; import InternalException from "../../../exceptions/internalException";
import { user } from "../entity/user";
import InternalException from "../exceptions/internalException";
import { import {
CreateCommunicationCommand, CreateCommunicationCommand,
DeleteCommunicationCommand, DeleteCommunicationCommand,
@ -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,14 +1,12 @@
import { dataSource } from "../data-source"; import { dataSource } from "../../../data-source";
import { award } from "../entity/award"; import { memberAwards } from "../../../entity/club/member/memberAwards";
import { member } from "../entity/member"; import InternalException from "../../../exceptions/internalException";
import { memberAwards } from "../entity/memberAwards";
import InternalException from "../exceptions/internalException";
import { CreateMemberAwardCommand, DeleteMemberAwardCommand, UpdateMemberAwardCommand } from "./memberAwardCommand"; import { CreateMemberAwardCommand, DeleteMemberAwardCommand, UpdateMemberAwardCommand } from "./memberAwardCommand";
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

@ -1,4 +1,4 @@
import { Salutation } from "../enums/salutation"; import { Salutation } from "../../../enums/salutation";
export interface CreateMemberCommand { export interface CreateMemberCommand {
salutation: Salutation; salutation: Salutation;

View file

@ -1,8 +1,7 @@
import { dataSource } from "../data-source"; import { dataSource } from "../../../data-source";
import { communication } from "../entity/communication"; import { communication } from "../../../entity/club/member/communication";
import { member } from "../entity/member"; import { member } from "../../../entity/club/member/member";
import InternalException from "../exceptions/internalException"; import InternalException from "../../../exceptions/internalException";
import CommunicationService from "../service/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,8 +1,6 @@
import { dataSource } from "../data-source"; import { dataSource } from "../../../data-source";
import { executivePosition } from "../entity/executivePosition"; import { memberExecutivePositions } from "../../../entity/club/member/memberExecutivePositions";
import { member } from "../entity/member"; import InternalException from "../../../exceptions/internalException";
import { memberExecutivePositions } from "../entity/memberExecutivePositions";
import InternalException from "../exceptions/internalException";
import { import {
CreateMemberExecutivePositionCommand, CreateMemberExecutivePositionCommand,
DeleteMemberExecutivePositionCommand, DeleteMemberExecutivePositionCommand,
@ -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,18 +1,16 @@
import { dataSource } from "../data-source"; import { dataSource } from "../../../data-source";
import { qualification } from "../entity/qualification"; import { memberQualifications } from "../../../entity/club/member/memberQualifications";
import { memberQualifications } from "../entity/memberQualifications"; import InternalException from "../../../exceptions/internalException";
import InternalException from "../exceptions/internalException";
import { import {
CreateMemberQualificationCommand, CreateMemberQualificationCommand,
DeleteMemberQualificationCommand, DeleteMemberQualificationCommand,
UpdateMemberQualificationCommand, UpdateMemberQualificationCommand,
} from "./memberQualificationCommand"; } from "./memberQualificationCommand";
import { member } from "../entity/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,8 +1,6 @@
import { dataSource } from "../data-source"; import { dataSource } from "../../../data-source";
import { member } from "../entity/member"; import { membership } from "../../../entity/club/member/membership";
import { membership } from "../entity/membership"; import InternalException from "../../../exceptions/internalException";
import { membershipStatus } from "../entity/membershipStatus";
import InternalException from "../exceptions/internalException";
import { CreateMembershipCommand, DeleteMembershipCommand, UpdateMembershipCommand } from "./membershipCommand"; import { CreateMembershipCommand, DeleteMembershipCommand, UpdateMembershipCommand } from "./membershipCommand";
export default abstract class MembershipCommandHandler { export default abstract class MembershipCommandHandler {
@ -33,7 +31,7 @@ export default abstract class MembershipCommandHandler {
.createQueryBuilder() .createQueryBuilder()
.update(membership) .update(membership)
.set({ .set({
end: createMembership.start, end: new Date(createMembership.start).setDate(new Date(createMembership.start).getDate() - 1),
terminationReason: "beendet durch neuen Eintrag.", terminationReason: "beendet durch neuen Eintrag.",
}) })
.where("end IS NULL") .where("end IS NULL")

View file

@ -1,12 +1,12 @@
import { dataSource } from "../data-source"; import { dataSource } from "../../../data-source";
import { newsletter } from "../entity/newsletter"; import { newsletter } from "../../../entity/club/newsletter/newsletter";
import InternalException from "../exceptions/internalException"; import InternalException from "../../../exceptions/internalException";
import { CreateNewsletterCommand, SendNewsletterCommand, SynchronizeNewsletterCommand } from "./newsletterCommand"; import { CreateNewsletterCommand, SendNewsletterCommand, SynchronizeNewsletterCommand } from "./newsletterCommand";
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

@ -1,9 +1,9 @@
import { DeleteResult, EntityManager, InsertResult, UpdateResult } from "typeorm"; import { DeleteResult, EntityManager, InsertResult, UpdateResult } from "typeorm";
import { dataSource } from "../data-source"; import { dataSource } from "../../../data-source";
import InternalException from "../exceptions/internalException"; import InternalException from "../../../exceptions/internalException";
import NewsletterDatesService from "../service/newsletterDatesService"; import NewsletterDatesService from "../../../service/club/newsletter/newsletterDatesService";
import { NewsletterDateCommand, SynchronizeNewsletterDatesCommand } from "./newsletterDatesCommand"; import { NewsletterDateCommand, SynchronizeNewsletterDatesCommand } from "./newsletterDatesCommand";
import { newsletterDates } from "../entity/newsletterDates"; import { newsletterDates } from "../../../entity/club/newsletter/newsletterDates";
export default abstract class NewsletterDatesCommandHandler { export default abstract class NewsletterDatesCommandHandler {
/** /**

View file

@ -1,9 +1,9 @@
import { DeleteResult, EntityManager, InsertResult, UpdateResult } from "typeorm"; import { DeleteResult, EntityManager, InsertResult, UpdateResult } from "typeorm";
import { dataSource } from "../data-source"; import { dataSource } from "../../../data-source";
import InternalException from "../exceptions/internalException"; import InternalException from "../../../exceptions/internalException";
import NewsletterRecipientsService from "../service/newsletterRecipientsService"; import NewsletterRecipientsService from "../../../service/club/newsletter/newsletterRecipientsService";
import { SynchronizeNewsletterRecipientsCommand } from "./newsletterRecipientsCommand"; import { SynchronizeNewsletterRecipientsCommand } from "./newsletterRecipientsCommand";
import { newsletterRecipients } from "../entity/newsletterRecipients"; import { newsletterRecipients } from "../../../entity/club/newsletter/newsletterRecipients";
export default abstract class NewsletterRecipientsCommandHandler { export default abstract class NewsletterRecipientsCommandHandler {
/** /**

View file

@ -1,12 +1,12 @@
import { dataSource } from "../data-source"; import { dataSource } from "../../../data-source";
import { protocolAgenda } from "../entity/protocolAgenda"; import { protocolAgenda } from "../../../entity/club/protocol/protocolAgenda";
import InternalException from "../exceptions/internalException"; import InternalException from "../../../exceptions/internalException";
import { SynchronizeProtocolAgendaCommand } from "./protocolAgendaCommand"; 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

@ -1,12 +1,12 @@
import { dataSource } from "../data-source"; import { dataSource } from "../../../data-source";
import { protocol } from "../entity/protocol"; import { protocol } from "../../../entity/club/protocol/protocol";
import InternalException from "../exceptions/internalException"; import InternalException from "../../../exceptions/internalException";
import { CreateProtocolCommand, SynchronizeProtocolCommand } from "./protocolCommand"; import { CreateProtocolCommand, SynchronizeProtocolCommand } from "./protocolCommand";
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

@ -1,12 +1,12 @@
import { dataSource } from "../data-source"; import { dataSource } from "../../../data-source";
import { protocolDecision } from "../entity/protocolDecision"; import { protocolDecision } from "../../../entity/club/protocol/protocolDecision";
import InternalException from "../exceptions/internalException"; import InternalException from "../../../exceptions/internalException";
import { SynchronizeProtocolDecisionCommand } from "./protocolDecisionCommand"; 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

@ -0,0 +1,9 @@
export interface SynchronizeProtocolPresenceCommand {
members: Array<ProtocolPresenceCommand>;
protocolId: number;
}
export interface ProtocolPresenceCommand {
memberId: number;
absent: boolean;
}

View file

@ -0,0 +1,96 @@
import { DeleteResult, EntityManager, InsertResult, UpdateResult } from "typeorm";
import { dataSource } from "../../../data-source";
import { protocolPresence } from "../../../entity/club/protocol/protocolPresence";
import InternalException from "../../../exceptions/internalException";
import ProtocolPresenceService from "../../../service/club/protocol/protocolPrecenseService";
import { ProtocolPresenceCommand, SynchronizeProtocolPresenceCommand } from "./protocolPresenceCommand";
export default abstract class ProtocolPresenceCommandHandler {
/**
* @description sync protocolPresence
* @param {SynchronizeProtocolPresenceCommand} syncProtocolPresences
* @returns {Promise<void>}
*/
static async sync(syncProtocolPresences: SynchronizeProtocolPresenceCommand): Promise<void> {
let currentPresence = await ProtocolPresenceService.getAll(syncProtocolPresences.protocolId);
return await dataSource.manager
.transaction(async (manager) => {
let newMembers = syncProtocolPresences.members.filter(
(r) => !currentPresence.some((cp) => cp.memberId == r.memberId)
);
let removeMembers = currentPresence.filter(
(r) => !syncProtocolPresences.members.some((cp) => cp.memberId == r.memberId)
);
let keptMembers = syncProtocolPresences.members.filter(
(m) =>
currentPresence.some((cd) => cd.memberId == m.memberId) &&
!removeMembers.some((cd) => cd.memberId == m.memberId)
);
if (newMembers.length != 0) {
await this.syncPresenceAdd(manager, syncProtocolPresences.protocolId, newMembers);
}
if (removeMembers.length != 0) {
await this.syncPresenceRemove(manager, syncProtocolPresences.protocolId, removeMembers);
}
for (const member of keptMembers) {
await this.syncPresenceUpdate(manager, syncProtocolPresences.protocolId, member);
}
})
.then(() => {})
.catch((err) => {
throw new InternalException("Failed saving protocol presence", err);
});
}
private static async syncPresenceAdd(
manager: EntityManager,
protocolId: number,
memberIds: Array<ProtocolPresenceCommand>
): Promise<InsertResult> {
return await manager
.createQueryBuilder()
.insert()
.into(protocolPresence)
.values(
memberIds.map((m) => ({
...m,
protocolId,
}))
)
.execute();
}
private static async syncPresenceUpdate(
manager: EntityManager,
protocolId: number,
member: ProtocolPresenceCommand
): Promise<UpdateResult> {
return await manager
.createQueryBuilder()
.update(protocolPresence)
.set({
absent: member.absent,
})
.where("memberId = :memberId", { memberId: member.memberId })
.andWhere("protocolId = :protocolId", { protocolId })
.execute();
}
private static async syncPresenceRemove(
manager: EntityManager,
protocolId: number,
members: Array<ProtocolPresenceCommand>
): Promise<DeleteResult> {
return await manager
.createQueryBuilder()
.delete()
.from(protocolPresence)
.where("memberId IN (:...ids)", { ids: members.map((m) => m.memberId) })
.andWhere("protocolId = :protocolId", { protocolId })
.execute();
}
}

View file

@ -1,12 +1,12 @@
import { dataSource } from "../data-source"; import { dataSource } from "../../../data-source";
import { protocolPrintout } from "../entity/protocolPrintout"; import { protocolPrintout } from "../../../entity/club/protocol/protocolPrintout";
import InternalException from "../exceptions/internalException"; import InternalException from "../../../exceptions/internalException";
import { CreateProtocolPrintoutCommand } from "./protocolPrintoutCommand"; 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

@ -1,12 +1,12 @@
import { dataSource } from "../data-source"; import { dataSource } from "../../../data-source";
import { protocolVoting } from "../entity/protocolVoting"; import { protocolVoting } from "../../../entity/club/protocol/protocolVoting";
import InternalException from "../exceptions/internalException"; import InternalException from "../../../exceptions/internalException";
import { SynchronizeProtocolVotingCommand } from "./protocolVotingCommand"; 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

@ -1,4 +0,0 @@
export interface SynchronizeProtocolPresenceCommand {
memberIds: Array<number>;
protocolId: number;
}

View file

@ -1,69 +0,0 @@
import { DeleteResult, EntityManager, InsertResult } from "typeorm";
import { dataSource } from "../data-source";
import { protocolPresence } from "../entity/protocolPresence";
import InternalException from "../exceptions/internalException";
import ProtocolPresenceService from "../service/protocolPrecenseService";
import { SynchronizeProtocolPresenceCommand } from "./protocolPresenceCommand";
export default abstract class ProtocolPresenceCommandHandler {
/**
* @description sync protocolPresence
* @param {SynchronizeProtocolPresenceCommand}
* @returns {Promise<void>}
*/
static async sync(syncProtocolPresences: SynchronizeProtocolPresenceCommand): Promise<void> {
let currentPresence = (await ProtocolPresenceService.getAll(syncProtocolPresences.protocolId)).map(
(r) => r.memberId
);
return await dataSource.manager
.transaction(async (manager) => {
let newMembers = syncProtocolPresences.memberIds.filter((r) => !currentPresence.includes(r));
let removeMembers = currentPresence.filter((r) => !syncProtocolPresences.memberIds.includes(r));
if (newMembers.length != 0) {
await this.syncPresenceAdd(manager, syncProtocolPresences.protocolId, newMembers);
}
if (removeMembers.length != 0) {
await this.syncPresenceRemove(manager, syncProtocolPresences.protocolId, removeMembers);
}
})
.then(() => {})
.catch((err) => {
throw new InternalException("Failed saving protocol presence", err);
});
}
private static async syncPresenceAdd(
manager: EntityManager,
protocolId: number,
memberIds: Array<number>
): Promise<InsertResult> {
return await manager
.createQueryBuilder()
.insert()
.into(protocolPresence)
.values(
memberIds.map((m) => ({
protocolId,
memberId: m,
}))
)
.execute();
}
private static async syncPresenceRemove(
manager: EntityManager,
protocolId: number,
memberIds: Array<number>
): Promise<DeleteResult> {
return await manager
.createQueryBuilder()
.delete()
.from(protocolPresence)
.where("memberId IN (:...ids)", { ids: memberIds })
.andWhere("protocolId = :protocolId", { protocolId })
.execute();
}
}

View file

@ -4,7 +4,7 @@ import { REFRESH_EXPIRATION } from "../env.defaults";
import InternalException from "../exceptions/internalException"; import InternalException from "../exceptions/internalException";
import { JWTHelper } from "../helpers/jwtHelper"; import { JWTHelper } from "../helpers/jwtHelper";
import { StringHelper } from "../helpers/stringHelper"; import { StringHelper } from "../helpers/stringHelper";
import UserService from "../service/userService"; import UserService from "../service/user/userService";
import { JWTRefresh } from "../type/jwtTypes"; import { JWTRefresh } from "../type/jwtTypes";
import { CreateRefreshCommand, DeleteRefreshCommand } from "./refreshCommand"; import { CreateRefreshCommand, DeleteRefreshCommand } from "./refreshCommand";
import ms from "ms"; import ms from "ms";
@ -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

@ -1,12 +1,12 @@
import { dataSource } from "../data-source"; import { dataSource } from "../../../data-source";
import { award } from "../entity/award"; import { award } from "../../../entity/settings/award";
import InternalException from "../exceptions/internalException"; import InternalException from "../../../exceptions/internalException";
import { CreateAwardCommand, DeleteAwardCommand, UpdateAwardCommand } from "./awardCommand"; import { CreateAwardCommand, DeleteAwardCommand, UpdateAwardCommand } from "./awardCommand";
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

@ -1,12 +1,12 @@
import { dataSource } from "../data-source"; import { dataSource } from "../../../data-source";
import { calendarType } from "../entity/calendarType"; import { calendarType } from "../../../entity/settings/calendarType";
import InternalException from "../exceptions/internalException"; import InternalException from "../../../exceptions/internalException";
import { CreateCalendarTypeCommand, DeleteCalendarTypeCommand, UpdateCalendarTypeCommand } from "./calendarTypeCommand"; import { CreateCalendarTypeCommand, DeleteCalendarTypeCommand, UpdateCalendarTypeCommand } from "./calendarTypeCommand";
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

@ -1,4 +1,4 @@
import { CommunicationFieldType } from "../type/fieldTypes"; import { CommunicationFieldType } from "../../../type/fieldTypes";
export interface CreateCommunicationTypeCommand { export interface CreateCommunicationTypeCommand {
type: string; type: string;

View file

@ -1,6 +1,6 @@
import { dataSource } from "../data-source"; import { dataSource } from "../../../data-source";
import { communicationType } from "../entity/communicationType"; import { communicationType } from "../../../entity/settings/communicationType";
import InternalException from "../exceptions/internalException"; import InternalException from "../../../exceptions/internalException";
import { import {
CreateCommunicationTypeCommand, CreateCommunicationTypeCommand,
DeleteCommunicationTypeCommand, DeleteCommunicationTypeCommand,
@ -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

@ -1,6 +1,6 @@
import { dataSource } from "../data-source"; import { dataSource } from "../../../data-source";
import { executivePosition } from "../entity/executivePosition"; import { executivePosition } from "../../../entity/settings/executivePosition";
import InternalException from "../exceptions/internalException"; import InternalException from "../../../exceptions/internalException";
import { import {
CreateExecutivePositionCommand, CreateExecutivePositionCommand,
DeleteExecutivePositionCommand, DeleteExecutivePositionCommand,
@ -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

@ -1,6 +1,6 @@
import { dataSource } from "../data-source"; import { dataSource } from "../../../data-source";
import { membershipStatus } from "../entity/membershipStatus"; import { membershipStatus } from "../../../entity/settings/membershipStatus";
import InternalException from "../exceptions/internalException"; import InternalException from "../../../exceptions/internalException";
import { import {
CreateMembershipStatusCommand, CreateMembershipStatusCommand,
DeleteMembershipStatusCommand, DeleteMembershipStatusCommand,
@ -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

@ -1,4 +1,4 @@
import { NewsletterConfigType } from "../enums/newsletterConfigType"; import { NewsletterConfigType } from "../../../enums/newsletterConfigType";
export interface SetNewsletterConfigCommand { export interface SetNewsletterConfigCommand {
comTypeId: number; comTypeId: number;

View file

@ -1,12 +1,12 @@
import { dataSource } from "../data-source"; import { dataSource } from "../../../data-source";
import { newsletterConfig } from "../entity/newsletterConfig"; import { newsletterConfig } from "../../../entity/settings/newsletterConfig";
import InternalException from "../exceptions/internalException"; import InternalException from "../../../exceptions/internalException";
import { DeleteNewsletterConfigCommand, SetNewsletterConfigCommand } from "./newsletterConfigCommand"; import { DeleteNewsletterConfigCommand, SetNewsletterConfigCommand } from "./newsletterConfigCommand";
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

@ -1,6 +1,6 @@
import { dataSource } from "../data-source"; import { dataSource } from "../../../data-source";
import { qualification } from "../entity/qualification"; import { qualification } from "../../../entity/settings/qualification";
import InternalException from "../exceptions/internalException"; import InternalException from "../../../exceptions/internalException";
import { import {
CreateQualificationCommand, CreateQualificationCommand,
DeleteQualificationCommand, DeleteQualificationCommand,
@ -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

@ -1,4 +1,4 @@
import { DynamicQueryStructure } from "../type/dynamicQueries"; import { DynamicQueryStructure } from "../../../type/dynamicQueries";
export interface CreateQueryStoreCommand { export interface CreateQueryStoreCommand {
title: string; title: string;

View file

@ -1,12 +1,12 @@
import { dataSource } from "../data-source"; import { dataSource } from "../../../data-source";
import { query } from "../entity/query"; import { query } from "../../../entity/settings/query";
import InternalException from "../exceptions/internalException"; import InternalException from "../../../exceptions/internalException";
import { CreateQueryStoreCommand, DeleteQueryStoreCommand, UpdateQueryStoreCommand } from "./queryStoreCommand"; import { CreateQueryStoreCommand, DeleteQueryStoreCommand, UpdateQueryStoreCommand } from "./queryStoreCommand";
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

@ -1,12 +1,12 @@
import { dataSource } from "../data-source"; import { dataSource } from "../../../data-source";
import { template } from "../entity/template"; import { template } from "../../../entity/settings/template";
import InternalException from "../exceptions/internalException"; import InternalException from "../../../exceptions/internalException";
import { CreateTemplateCommand, DeleteTemplateCommand, UpdateTemplateCommand } from "./templateCommand"; import { CreateTemplateCommand, DeleteTemplateCommand, UpdateTemplateCommand } from "./templateCommand";
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

@ -1,12 +1,12 @@
import { dataSource } from "../data-source"; import { dataSource } from "../../../data-source";
import { templateUsage } from "../entity/templateUsage"; import { templateUsage } from "../../../entity/settings/templateUsage";
import InternalException from "../exceptions/internalException"; import InternalException from "../../../exceptions/internalException";
import { UpdateTemplateUsageCommand } from "./templateUsageCommand"; 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

@ -1,12 +1,12 @@
import { dataSource } from "../data-source"; import { dataSource } from "../../../data-source";
import { role } from "../entity/role"; import { role } from "../../../entity/user/role";
import InternalException from "../exceptions/internalException"; import InternalException from "../../../exceptions/internalException";
import { CreateRoleCommand, DeleteRoleCommand, UpdateRoleCommand } from "./roleCommand"; import { CreateRoleCommand, DeleteRoleCommand, UpdateRoleCommand } from "./roleCommand";
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

@ -1,4 +1,4 @@
import { PermissionString } from "../type/permissionTypes"; import { PermissionString } from "../../../type/permissionTypes";
export interface CreateRolePermissionCommand { export interface CreateRolePermissionCommand {
permission: PermissionString; permission: PermissionString;

View file

@ -1,22 +1,21 @@
import { DeleteResult, EntityManager, InsertResult } from "typeorm"; import { DeleteResult, EntityManager, InsertResult } from "typeorm";
import { dataSource } from "../data-source"; import { dataSource } from "../../../data-source";
import { rolePermission } from "../entity/role_permission"; import { rolePermission } from "../../../entity/user/role_permission";
import InternalException from "../exceptions/internalException"; import InternalException from "../../../exceptions/internalException";
import RoleService from "../service/roleService"; import RoleService from "../../../service/user/roleService";
import { import {
CreateRolePermissionCommand, CreateRolePermissionCommand,
DeleteRolePermissionCommand, DeleteRolePermissionCommand,
UpdateRolePermissionsCommand, UpdateRolePermissionsCommand,
} from "./rolePermissionCommand"; } from "./rolePermissionCommand";
import PermissionHelper from "../helpers/permissionHelper"; import PermissionHelper from "../../../helpers/permissionHelper";
import RolePermissionService from "../service/rolePermissionService"; import RolePermissionService from "../../../service/user/rolePermissionService";
import { role } from "../entity/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

@ -1,7 +1,7 @@
import { dataSource } from "../data-source"; import { dataSource } from "../../../data-source";
import { invite } from "../entity/invite"; import { invite } from "../../../entity/user/invite";
import InternalException from "../exceptions/internalException"; import InternalException from "../../../exceptions/internalException";
import { StringHelper } from "../helpers/stringHelper"; import { StringHelper } from "../../../helpers/stringHelper";
import { CreateInviteCommand, DeleteInviteCommand } from "./inviteCommand"; import { CreateInviteCommand, DeleteInviteCommand } from "./inviteCommand";
export default abstract class InviteCommandHandler { export default abstract class InviteCommandHandler {

View file

@ -1,7 +1,7 @@
import { EntityManager } from "typeorm"; import { EntityManager } from "typeorm";
import { dataSource } from "../data-source"; import { dataSource } from "../../../data-source";
import { user } from "../entity/user"; import { user } from "../../../entity/user/user";
import InternalException from "../exceptions/internalException"; import InternalException from "../../../exceptions/internalException";
import { import {
CreateUserCommand, CreateUserCommand,
DeleteUserCommand, DeleteUserCommand,
@ -10,12 +10,12 @@ import {
UpdateUserRolesCommand, UpdateUserRolesCommand,
UpdateUserSecretCommand, UpdateUserSecretCommand,
} from "./userCommand"; } from "./userCommand";
import UserService from "../service/userService"; 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

@ -1,4 +1,4 @@
import { PermissionString } from "../type/permissionTypes"; import { PermissionString } from "../../../type/permissionTypes";
export interface CreateUserPermissionCommand { export interface CreateUserPermissionCommand {
permission: PermissionString; permission: PermissionString;

View file

@ -1,21 +1,21 @@
import { DeleteResult, EntityManager, InsertResult } from "typeorm"; import { DeleteResult, EntityManager, InsertResult } from "typeorm";
import { dataSource } from "../data-source"; import { dataSource } from "../../../data-source";
import { user } from "../entity/user"; import { user } from "../../../entity/user/user";
import { userPermission } from "../entity/user_permission"; import { userPermission } from "../../../entity/user/user_permission";
import InternalException from "../exceptions/internalException"; import InternalException from "../../../exceptions/internalException";
import { import {
CreateUserPermissionCommand, CreateUserPermissionCommand,
DeleteUserPermissionCommand, DeleteUserPermissionCommand,
UpdateUserPermissionsCommand, UpdateUserPermissionsCommand,
} from "./userPermissionCommand"; } from "./userPermissionCommand";
import UserPermissionService from "../service/userPermissionService"; import UserPermissionService from "../../../service/user/userPermissionService";
import PermissionHelper from "../helpers/permissionHelper"; import PermissionHelper from "../../../helpers/permissionHelper";
import { PermissionString } from "../type/permissionTypes"; 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> {

View file

@ -1,16 +1,16 @@
import { Request, Response } from "express"; import { Request, Response } from "express";
import CalendarService from "../../service/calendarService"; import CalendarService from "../../../service/club/calendarService";
import CalendarFactory from "../../factory/admin/calendar"; import CalendarFactory from "../../../factory/admin/club/calendar";
import CalendarTypeService from "../../service/calendarTypeService"; import CalendarTypeService from "../../../service/settings/calendarTypeService";
import CalendarTypeFactory from "../../factory/admin/calendarType"; import CalendarTypeFactory from "../../../factory/admin/settings/calendarType";
import { CreateCalendarCommand, DeleteCalendarCommand, UpdateCalendarCommand } from "../../command/calendarCommand"; import { CreateCalendarCommand, DeleteCalendarCommand, UpdateCalendarCommand } from "../../../command/club/calendar/calendarCommand";
import CalendarCommandHandler from "../../command/calendarCommandHandler"; import CalendarCommandHandler from "../../../command/club/calendar/calendarCommandHandler";
import { import {
CreateCalendarTypeCommand, CreateCalendarTypeCommand,
DeleteCalendarTypeCommand, DeleteCalendarTypeCommand,
UpdateCalendarTypeCommand, UpdateCalendarTypeCommand,
} from "../../command/calendarTypeCommand"; } from "../../../command/settings/calendarType/calendarTypeCommand";
import CalendarTypeCommandHandler from "../../command/calendarTypeCommandHandler"; import CalendarTypeCommandHandler from "../../../command/settings/calendarType/calendarTypeCommandHandler";
/** /**
* @description get all calendar items * @description get all calendar items

View file

@ -1,53 +1,55 @@
import { Request, Response } from "express"; import { Request, Response } from "express";
import MemberService from "../../service/memberService"; import MemberService from "../../../service/club/member/memberService";
import MemberFactory from "../../factory/admin/member"; import MemberFactory from "../../../factory/admin/club/member/member";
import MembershipService from "../../service/membershipService"; import MembershipService from "../../../service/club/member/membershipService";
import MembershipFactory from "../../factory/admin/membership"; import MembershipFactory from "../../../factory/admin/club/member/membership";
import MemberAwardService from "../../service/memberAwardService"; import MemberAwardService from "../../../service/club/member/memberAwardService";
import MemberAwardFactory from "../../factory/admin/memberAward"; import MemberAwardFactory from "../../../factory/admin/club/member/memberAward";
import MemberQualificationService from "../../service/memberQualificationService"; import MemberQualificationService from "../../../service/club/member/memberQualificationService";
import MemberQualificationFactory from "../../factory/admin/memberQualification"; import MemberQualificationFactory from "../../../factory/admin/club/member/memberQualification";
import MemberExecutivePositionService from "../../service/memberExecutivePositionService"; import MemberExecutivePositionService from "../../../service/club/member/memberExecutivePositionService";
import MemberExecutivePositionFactory from "../../factory/admin/memberExecutivePosition"; import MemberExecutivePositionFactory from "../../../factory/admin/club/member/memberExecutivePosition";
import CommunicationService from "../../service/communicationService"; import CommunicationService from "../../../service/club/member/communicationService";
import CommunicationFactory from "../../factory/admin/communication"; import CommunicationFactory from "../../../factory/admin/club/member/communication";
import { import {
CreateMemberCommand, CreateMemberCommand,
DeleteMemberCommand, DeleteMemberCommand,
UpdateMemberCommand, UpdateMemberCommand,
UpdateMemberNewsletterCommand, UpdateMemberNewsletterCommand,
} from "../../command/memberCommand"; } from "../../../command/club/member/memberCommand";
import MemberCommandHandler from "../../command/memberCommandHandler"; import MemberCommandHandler from "../../../command/club/member/memberCommandHandler";
import { import {
CreateMembershipCommand, CreateMembershipCommand,
DeleteMembershipCommand, DeleteMembershipCommand,
UpdateMembershipCommand, UpdateMembershipCommand,
} from "../../command/membershipCommand"; } from "../../../command/club/member/membershipCommand";
import MembershipCommandHandler from "../../command/membershipCommandHandler"; import MembershipCommandHandler from "../../../command/club/member/membershipCommandHandler";
import { import {
CreateMemberAwardCommand, CreateMemberAwardCommand,
DeleteMemberAwardCommand, DeleteMemberAwardCommand,
UpdateMemberAwardCommand, UpdateMemberAwardCommand,
} from "../../command/memberAwardCommand"; } from "../../../command/club/member/memberAwardCommand";
import MemberAwardCommandHandler from "../../command/memberAwardCommandHandler"; import MemberAwardCommandHandler from "../../../command/club/member/memberAwardCommandHandler";
import { import {
CreateMemberExecutivePositionCommand, CreateMemberExecutivePositionCommand,
DeleteMemberExecutivePositionCommand, DeleteMemberExecutivePositionCommand,
UpdateMemberExecutivePositionCommand, UpdateMemberExecutivePositionCommand,
} from "../../command/memberExecutivePositionCommand"; } from "../../../command/club/member/memberExecutivePositionCommand";
import MemberExecutivePositionCommandHandler from "../../command/memberExecutivePositionCommandHandler"; import MemberExecutivePositionCommandHandler from "../../../command/club/member/memberExecutivePositionCommandHandler";
import { import {
CreateMemberQualificationCommand, CreateMemberQualificationCommand,
DeleteMemberQualificationCommand, DeleteMemberQualificationCommand,
UpdateMemberQualificationCommand, UpdateMemberQualificationCommand,
} from "../../command/memberQualificationCommand"; } from "../../../command/club/member/memberQualificationCommand";
import MemberQualificationCommandHandler from "../../command/memberQualificationCommandHandler"; import MemberQualificationCommandHandler from "../../../command/club/member/memberQualificationCommandHandler";
import { import {
CreateCommunicationCommand, CreateCommunicationCommand,
DeleteCommunicationCommand, DeleteCommunicationCommand,
UpdateCommunicationCommand, UpdateCommunicationCommand,
} from "../../command/communicationCommand"; } from "../../../command/club/member/communicationCommand";
import CommunicationCommandHandler from "../../command/communicationCommandHandler"; import CommunicationCommandHandler from "../../../command/club/member/communicationCommandHandler";
import {PdfExport} from "../../../helpers/pdfExport";
import {PermissionModule} from "../../../type/permissionTypes";
/** /**
* @description get all members * @description get all members
@ -218,6 +220,33 @@ export async function getCommunicationByMemberAndRecord(req: Request, res: Respo
res.json(CommunicationFactory.mapToSingle(communication)); res.json(CommunicationFactory.mapToSingle(communication));
} }
/**
* @description create member printout list
* @param req {Request} Express req object
* @param res {Response} Express res object
* @returns {Promise<*>}
*/
export async function createMemberPrintoutList(req: Request, res: Response): Promise<any> {
let members = await MemberService.getByRunningMembership()
let pdf = await PdfExport.renderFile({
title: "Mitgliederliste",
template: "member.list",
saveToDisk: false,
data: {
member: members
},
});
let pdfbuffer = Buffer.from(pdf);
res.setHeader("Content-Type", "application/pdf");
res.setHeader("Content-Length", pdfbuffer.byteLength);
res.setHeader("Content-Disposition", "inline; filename=preview.pdf");
res.send(pdfbuffer);
}
/** /**
* @description create member * @description create member
* @param req {Request} Express req object * @param req {Request} Express req object

View file

@ -1,24 +1,24 @@
import { Request, Response } from "express"; import { Request, Response } from "express";
import NewsletterService from "../../service/newsletterService"; import NewsletterService from "../../../service/club/newsletter/newsletterService";
import NewsletterFactory from "../../factory/admin/newsletter"; import NewsletterFactory from "../../../factory/admin/club/newsletter/newsletter";
import NewsletterDatesService from "../../service/newsletterDatesService"; import NewsletterDatesService from "../../../service/club/newsletter/newsletterDatesService";
import NewsletterDatesFactory from "../../factory/admin/newsletterDates"; import NewsletterDatesFactory from "../../../factory/admin/club/newsletter/newsletterDates";
import NewsletterRecipientsService from "../../service/newsletterRecipientsService"; import NewsletterRecipientsService from "../../../service/club/newsletter/newsletterRecipientsService";
import NewsletterRecipientsFactory from "../../factory/admin/newsletterRecipients"; import NewsletterRecipientsFactory from "../../../factory/admin/club/newsletter/newsletterRecipients";
import { FileSystemHelper } from "../../helpers/fileSystemHelper"; import { FileSystemHelper } from "../../../helpers/fileSystemHelper";
import { CreateNewsletterCommand, SynchronizeNewsletterCommand } from "../../command/newsletterCommand"; import { CreateNewsletterCommand, SynchronizeNewsletterCommand } from "../../../command/club/newsletter/newsletterCommand";
import NewsletterCommandHandler from "../../command/newsletterCommandHandler"; import NewsletterCommandHandler from "../../../command/club/newsletter/newsletterCommandHandler";
import { SynchronizeNewsletterDatesCommand } from "../../command/newsletterDatesCommand"; import { SynchronizeNewsletterDatesCommand } from "../../../command/club/newsletter/newsletterDatesCommand";
import NewsletterDatesCommandHandler from "../../command/newsletterDatesCommandHandler"; import NewsletterDatesCommandHandler from "../../../command/club/newsletter/newsletterDatesCommandHandler";
import { SynchronizeNewsletterRecipientsCommand } from "../../command/newsletterRecipientsCommand"; import { SynchronizeNewsletterRecipientsCommand } from "../../../command/club/newsletter/newsletterRecipientsCommand";
import NewsletterRecipientsCommandHandler from "../../command/newsletterRecipientsCommandHandler"; import NewsletterRecipientsCommandHandler from "../../../command/club/newsletter/newsletterRecipientsCommandHandler";
import { NewsletterDatesViewModel } from "../../viewmodel/admin/newsletterDates.models"; import { NewsletterDatesViewModel } from "../../../viewmodel/admin/club/newsletter/newsletterDates.models";
import { PdfExport } from "../../helpers/pdfExport"; import { PdfExport } from "../../../helpers/pdfExport";
import UserService from "../../service/userService"; import UserService from "../../../service/user/userService";
import { TemplateHelper } from "../../helpers/templateHelper"; import { TemplateHelper } from "../../../helpers/templateHelper";
import MailHelper from "../../helpers/mailHelper"; import MailHelper from "../../../helpers/mailHelper";
import { NewsletterEventType, NewsletterHelper } from "../../helpers/newsletterHelper"; import { NewsletterEventType, NewsletterHelper } from "../../../helpers/newsletterHelper";
import { Salutation } from "../../enums/salutation"; import { Salutation } from "../../../enums/salutation";
/** /**
* @description get all newsletters * @description get all newsletters

View file

@ -1,33 +1,34 @@
import { Request, Response } from "express"; import { Request, Response } from "express";
import ProtocolService from "../../service/protocolService"; import ProtocolService from "../../../service/club/protocol/protocolService";
import ProtocolFactory from "../../factory/admin/protocol"; import ProtocolFactory from "../../../factory/admin/club/protocol/protocol";
import ProtocolAgendaService from "../../service/protocolAgendaService"; import ProtocolAgendaService from "../../../service/club/protocol/protocolAgendaService";
import ProtocolAgendaFactory from "../../factory/admin/protocolAgenda"; import ProtocolAgendaFactory from "../../../factory/admin/club/protocol/protocolAgenda";
import ProtocolDecisionService from "../../service/protocolDecisionService"; import ProtocolDecisionService from "../../../service/club/protocol/protocolDecisionService";
import ProtocolDecisionFactory from "../../factory/admin/protocolDecision"; import ProtocolDecisionFactory from "../../../factory/admin/club/protocol/protocolDecision";
import ProtocolPresenceService from "../../service/protocolPrecenseService"; import ProtocolPresenceService from "../../../service/club/protocol/protocolPrecenseService";
import ProtocolPresenceFactory from "../../factory/admin/protocolPresence"; import ProtocolPresenceFactory from "../../../factory/admin/club/protocol/protocolPresence";
import ProtocolVotingService from "../../service/protocolVotingService"; import ProtocolVotingService from "../../../service/club/protocol/protocolVotingService";
import ProtocolVotingFactory from "../../factory/admin/protocolVoting"; import ProtocolVotingFactory from "../../../factory/admin/club/protocol/protocolVoting";
import { CreateProtocolCommand, SynchronizeProtocolCommand } from "../../command/protocolCommand"; import { CreateProtocolCommand, SynchronizeProtocolCommand } from "../../../command/club/protocol/protocolCommand";
import ProtocolCommandHandler from "../../command/protocolCommandHandler"; import ProtocolCommandHandler from "../../../command/club/protocol/protocolCommandHandler";
import { SynchronizeProtocolAgendaCommand } from "../../command/protocolAgendaCommand"; import { SynchronizeProtocolAgendaCommand } from "../../../command/club/protocol/protocolAgendaCommand";
import ProtocolAgendaCommandHandler from "../../command/protocolAgendaCommandHandler"; import ProtocolAgendaCommandHandler from "../../../command/club/protocol/protocolAgendaCommandHandler";
import { ProtocolAgendaViewModel } from "../../viewmodel/admin/protocolAgenda.models"; import { ProtocolAgendaViewModel } from "../../../viewmodel/admin/club/protocol/protocolAgenda.models";
import ProtocolDecisionCommandHandler from "../../command/protocolDecisionCommandHandler"; import ProtocolDecisionCommandHandler from "../../../command/club/protocol/protocolDecisionCommandHandler";
import { ProtocolDecisionViewModel } from "../../viewmodel/admin/protocolDecision.models"; import { ProtocolDecisionViewModel } from "../../../viewmodel/admin/club/protocol/protocolDecision.models";
import ProtocolPresenceCommandHandler from "../../command/protocolPresenceCommandHandler"; import ProtocolPresenceCommandHandler from "../../../command/club/protocol/protocolPresenceCommandHandler";
import { SynchronizeProtocolPresenceCommand } from "../../command/protocolPresenceCommand"; import { SynchronizeProtocolPresenceCommand } from "../../../command/club/protocol/protocolPresenceCommand";
import { SynchronizeProtocolDecisionCommand } from "../../command/protocolDecisionCommand"; import { SynchronizeProtocolDecisionCommand } from "../../../command/club/protocol/protocolDecisionCommand";
import { SynchronizeProtocolVotingCommand } from "../../command/protocolVotingCommand"; import { SynchronizeProtocolVotingCommand } from "../../../command/club/protocol/protocolVotingCommand";
import { ProtocolVotingViewModel } from "../../viewmodel/admin/protocolVoting.models"; import { ProtocolVotingViewModel } from "../../../viewmodel/admin/club/protocol/protocolVoting.models";
import ProtocolVotingCommandHandler from "../../command/protocolVotingCommandHandler"; import ProtocolVotingCommandHandler from "../../../command/club/protocol/protocolVotingCommandHandler";
import { PdfExport } from "../../helpers/pdfExport"; import { PdfExport } from "../../../helpers/pdfExport";
import ProtocolPrintoutService from "../../service/protocolPrintoutService"; import ProtocolPrintoutService from "../../../service/club/protocol/protocolPrintoutService";
import ProtocolPrintoutFactory from "../../factory/admin/protocolPrintout"; import ProtocolPrintoutFactory from "../../../factory/admin/club/protocol/protocolPrintout";
import { CreateProtocolPrintoutCommand } from "../../command/protocolPrintoutCommand"; import { CreateProtocolPrintoutCommand } from "../../../command/club/protocol/protocolPrintoutCommand";
import ProtocolPrintoutCommandHandler from "../../command/protocolPrintoutCommandHandler"; import ProtocolPrintoutCommandHandler from "../../../command/club/protocol/protocolPrintoutCommandHandler";
import { FileSystemHelper } from "../../helpers/fileSystemHelper"; import { FileSystemHelper } from "../../../helpers/fileSystemHelper";
import { ProtocolPresenceViewModel } from "../../../viewmodel/admin/club/protocol/protocolPresence.models";
/** /**
* @description get all protocols * @description get all protocols
@ -143,7 +144,9 @@ export async function getProtocolPrintoutByIdAndPrint(req: Request, res: Respons
let printout = await ProtocolPrintoutService.getById(printoutId, protocolId); let printout = await ProtocolPrintoutService.getById(printoutId, protocolId);
res.sendFile(process.cwd() + `/export/${printout.filename}.pdf`, { let filepath = FileSystemHelper.formatPath("protocol", printout.filename);
res.sendFile(filepath, {
headers: { headers: {
"Content-Type": "application/pdf", "Content-Type": "application/pdf",
}, },
@ -226,7 +229,7 @@ export async function createProtocolPrintoutById(req: Request, res: Response): P
let votings = await ProtocolVotingService.getAll(protocolId); let votings = await ProtocolVotingService.getAll(protocolId);
let iteration = await ProtocolPrintoutService.getCount(protocolId); let iteration = await ProtocolPrintoutService.getCount(protocolId);
let title = `Sitzungsprotokoll - ${new Date(protocol.date).toLocaleDateString("de-DE", { let title = `${protocol.title} - ${new Date(protocol.date).toLocaleDateString("de-DE", {
day: "2-digit", day: "2-digit",
month: "long", month: "long",
year: "numeric", year: "numeric",
@ -256,7 +259,8 @@ export async function createProtocolPrintoutById(req: Request, res: Response): P
end: protocol.endtime, end: protocol.endtime,
agenda, agenda,
decisions, decisions,
presence: presence.map((p) => p.member), presence: presence.filter((p) => !p.absent).map((p) => p.member),
absent: presence.filter((p) => p.absent).map((p) => p.member),
votings, votings,
}, },
}); });
@ -264,7 +268,7 @@ export async function createProtocolPrintoutById(req: Request, res: Response): P
let printout: CreateProtocolPrintoutCommand = { let printout: CreateProtocolPrintoutCommand = {
title, title,
iteration: iteration + 1, iteration: iteration + 1,
filename: FileSystemHelper.normalizePath("protocol", filename), filename: `${filename}.pdf`,
protocolId, protocolId,
}; };
await ProtocolPrintoutCommandHandler.create(printout); await ProtocolPrintoutCommandHandler.create(printout);
@ -379,10 +383,13 @@ export async function synchronizeProtocolVotingsById(req: Request, res: Response
*/ */
export async function synchronizeProtocolPrecenseById(req: Request, res: Response): Promise<any> { export async function synchronizeProtocolPrecenseById(req: Request, res: Response): Promise<any> {
let protocolId = parseInt(req.params.protocolId); let protocolId = parseInt(req.params.protocolId);
let presence = req.body.presence as Array<number>; let presence = req.body.presence as Array<ProtocolPresenceViewModel>;
let syncPresence: SynchronizeProtocolPresenceCommand = { let syncPresence: SynchronizeProtocolPresenceCommand = {
memberIds: presence, members: presence.map((p) => ({
memberId: p.memberId,
absent: p.absent,
})),
protocolId, protocolId,
}; };
await ProtocolPresenceCommandHandler.sync(syncPresence); await ProtocolPresenceCommandHandler.sync(syncPresence);

View file

@ -0,0 +1,44 @@
import { Request, Response } from "express";
import DynamicQueryBuilder from "../../../helpers/dynamicQueryBuilder";
import { dataSource } from "../../../data-source";
/**
* @description get all table metas
* @param req {Request} Express req object
* @param res {Response} Express res object
* @returns {Promise<*>}
*/
export async function getAllTableMeta(req: Request, res: Response): Promise<any> {
let tableMetas = DynamicQueryBuilder.getAllTableMeta();
res.json(tableMetas);
}
/**
* @description get meta by tablename
* @param req {Request} Express req object
* @param res {Response} Express res object
* @returns {Promise<*>}
*/
export async function getTableMetaByTablename(req: Request, res: Response): Promise<any> {
const tablename = req.params.tablename;
let tableMeta = DynamicQueryBuilder.getTableMeta(tablename);
res.json(tableMeta);
}
/**
* @description execute Query
* @param req {Request} Express req object
* @param res {Response} Express res object
* @returns {Promise<*>}
*/
export async function executeQuery(req: Request, res: Response): Promise<any> {
let offset = parseInt((req.query.offset as string) ?? "0");
let count = parseInt((req.query.count as string) ?? "25");
const query = req.body.query;
let result = await DynamicQueryBuilder.executeQuery(query, offset, count);
res.json(result);
}

View file

@ -1,108 +0,0 @@
import { Request, Response } from "express";
import DynamicQueryBuilder from "../../helpers/dynamicQueryBuilder";
import { dataSource } from "../../data-source";
/**
* @description get all table metas
* @param req {Request} Express req object
* @param res {Response} Express res object
* @returns {Promise<*>}
*/
export async function getAllTableMeta(req: Request, res: Response): Promise<any> {
let tableMetas = DynamicQueryBuilder.getAllTableMeta();
res.json(tableMetas);
}
/**
* @description get meta by tablename
* @param req {Request} Express req object
* @param res {Response} Express res object
* @returns {Promise<*>}
*/
export async function getTableMetaByTablename(req: Request, res: Response): Promise<any> {
const tablename = req.params.tablename;
let tableMeta = DynamicQueryBuilder.getTableMeta(tablename);
res.json(tableMeta);
}
/**
* @description execute Query
* @param req {Request} Express req object
* @param res {Response} Express res object
* @returns {Promise<*>}
*/
export async function executeQuery(req: Request, res: Response): Promise<any> {
let offset = parseInt((req.query.offset as string) ?? "0");
let count = parseInt((req.query.count as string) ?? "25");
const query = req.body.query;
if (typeof query == "string") {
const upperQuery = query.trim().toUpperCase();
if (!upperQuery.startsWith("SELECT") || /INSERT|UPDATE|DELETE|ALTER|DROP|CREATE|TRUNCATE/.test(upperQuery)) {
return res.json({
stats: "error",
sql: query,
code: "UNALLOWED",
msg: "Not allowed to change rows",
});
}
try {
let data: Array<any> = [];
const result = await dataSource
.transaction(async (manager) => {
data = await manager.query(query);
throw new Error("AllwaysRollbackQuery");
})
.catch((error) => {
if (error.message === "AllwaysRollbackQuery") {
return {
stats: "success",
rows: data,
total: data.length,
offset: offset,
count: count,
};
} else {
return {
stats: "error",
sql: error.sql,
code: error.code,
msg: error.sqlMessage,
};
}
});
res.send(result);
} catch (error) {
res.json({
stats: "error",
sql: error.sql,
code: error.code,
msg: error.sqlMessage,
});
}
} else {
try {
let [rows, total] = await DynamicQueryBuilder.buildQuery(query, offset, count).getManyAndCount();
res.json({
stats: "success",
rows: DynamicQueryBuilder.flattenQueryResult(rows),
total: total,
offset: offset,
count: count,
});
} catch (error) {
res.json({
stats: "error",
sql: error.sql,
code: error.code,
msg: error.sqlMessage,
});
}
}
}

View file

@ -1,8 +1,8 @@
import { Request, Response } from "express"; import { Request, Response } from "express";
import AwardService from "../../service/awardService"; import AwardService from "../../../service/settings/awardService";
import AwardFactory from "../../factory/admin/award"; import AwardFactory from "../../../factory/admin/settings/award";
import { CreateAwardCommand, DeleteAwardCommand, UpdateAwardCommand } from "../../command/awardCommand"; import { CreateAwardCommand, DeleteAwardCommand, UpdateAwardCommand } from "../../../command/settings/award/awardCommand";
import AwardCommandHandler from "../../command/awardCommandHandler"; import AwardCommandHandler from "../../../command/settings/award/awardCommandHandler";
/** /**
* @description get all awards * @description get all awards

View file

@ -1,13 +1,13 @@
import { Request, Response } from "express"; import { Request, Response } from "express";
import CommunicationTypeService from "../../service/communicationTypeService"; import CommunicationTypeService from "../../../service/settings/communicationTypeService";
import CommunicationTypeFactory from "../../factory/admin/communicationType"; import CommunicationTypeFactory from "../../../factory/admin/settings/communicationType";
import CommunicationService from "../../service/communicationService"; import CommunicationService from "../../../service/club/member/communicationService";
import { import {
CreateCommunicationTypeCommand, CreateCommunicationTypeCommand,
DeleteCommunicationTypeCommand, DeleteCommunicationTypeCommand,
UpdateCommunicationTypeCommand, UpdateCommunicationTypeCommand,
} from "../../command/communicationTypeCommand"; } from "../../../command/settings/communicationType/communicationTypeCommand";
import CommunicationTypeCommandHandler from "../../command/communicationTypeCommandHandler"; import CommunicationTypeCommandHandler from "../../../command/settings/communicationType/communicationTypeCommandHandler";
/** /**
* @description get all communicationTypes * @description get all communicationTypes

View file

@ -1,12 +1,12 @@
import { Request, Response } from "express"; import { Request, Response } from "express";
import ExecutivePositionService from "../../service/executivePositionService"; import ExecutivePositionService from "../../../service/settings/executivePositionService";
import ExecutivePositionFactory from "../../factory/admin/executivePosition"; import ExecutivePositionFactory from "../../../factory/admin/settings/executivePosition";
import { import {
CreateExecutivePositionCommand, CreateExecutivePositionCommand,
DeleteExecutivePositionCommand, DeleteExecutivePositionCommand,
UpdateExecutivePositionCommand, UpdateExecutivePositionCommand,
} from "../../command/executivePositionCommand"; } from "../../../command/settings/executivePosition/executivePositionCommand";
import ExecutivePositionCommandHandler from "../../command/executivePositionCommandHandler"; import ExecutivePositionCommandHandler from "../../../command/settings/executivePosition/executivePositionCommandHandler";
/** /**
* @description get all executivePositions * @description get all executivePositions

View file

@ -1,12 +1,12 @@
import { Request, Response } from "express"; import { Request, Response } from "express";
import MembershipStatusService from "../../service/membershipStatusService"; import MembershipStatusService from "../../../service/settings/membershipStatusService";
import MembershipStatusFactory from "../../factory/admin/membershipStatus"; import MembershipStatusFactory from "../../../factory/admin/settings/membershipStatus";
import { import {
CreateMembershipStatusCommand, CreateMembershipStatusCommand,
DeleteMembershipStatusCommand, DeleteMembershipStatusCommand,
UpdateMembershipStatusCommand, UpdateMembershipStatusCommand,
} from "../../command/membershipStatusCommand"; } from "../../../command/settings/membershipStatus/membershipStatusCommand";
import MembershipStatusCommandHandler from "../../command/membershipStatusCommandHandler"; import MembershipStatusCommandHandler from "../../../command/settings/membershipStatus/membershipStatusCommandHandler";
/** /**
* @description get all membershipStatus * @description get all membershipStatus

View file

@ -1,8 +1,8 @@
import { Request, Response } from "express"; import { Request, Response } from "express";
import NewsletterConfigService from "../../service/newsletterConfigService"; import NewsletterConfigService from "../../../service/settings/newsletterConfigService";
import NewsletterConfigFactory from "../../factory/admin/newsletterConfig"; import NewsletterConfigFactory from "../../../factory/admin/settings/newsletterConfig";
import NewsletterConfigCommandHandler from "../../command/newsletterConfigCommandHandler"; import NewsletterConfigCommandHandler from "../../../command/settings/newsletterConfig/newsletterConfigCommandHandler";
import { DeleteNewsletterConfigCommand, SetNewsletterConfigCommand } from "../../command/newsletterConfigCommand"; import { DeleteNewsletterConfigCommand, SetNewsletterConfigCommand } from "../../../command/settings/newsletterConfig/newsletterConfigCommand";
/** /**
* @description get all newsletterConfigs * @description get all newsletterConfigs

View file

@ -1,12 +1,12 @@
import { Request, Response } from "express"; import { Request, Response } from "express";
import QualificationService from "../../service/qualification"; import QualificationService from "../../../service/settings/qualification";
import QualificationFactory from "../../factory/admin/qualification"; import QualificationFactory from "../../../factory/admin/settings/qualification";
import { import {
CreateQualificationCommand, CreateQualificationCommand,
DeleteQualificationCommand, DeleteQualificationCommand,
UpdateQualificationCommand, UpdateQualificationCommand,
} from "../../command/qualificationCommand"; } from "../../../command/settings/qualification/qualificationCommand";
import QualificationCommandHandler from "../../command/qualificationCommandHandler"; import QualificationCommandHandler from "../../../command/settings/qualification/qualificationCommandHandler";
/** /**
* @description get all qualifications * @description get all qualifications

View file

@ -1,12 +1,12 @@
import { Request, Response } from "express"; import { Request, Response } from "express";
import QueryStoreFactory from "../../factory/admin/queryStore"; import QueryStoreFactory from "../../../factory/admin/settings/queryStore";
import QueryStoreService from "../../service/queryStoreService"; import QueryStoreService from "../../../service/settings/queryStoreService";
import { import {
CreateQueryStoreCommand, CreateQueryStoreCommand,
DeleteQueryStoreCommand, DeleteQueryStoreCommand,
UpdateQueryStoreCommand, UpdateQueryStoreCommand,
} from "../../command/queryStoreCommand"; } from "../../../command/settings/queryStore/queryStoreCommand";
import QueryStoreCommandHandler from "../../command/queryStoreCommandHandler"; import QueryStoreCommandHandler from "../../../command/settings/queryStore/queryStoreCommandHandler";
/** /**
* @description get all queryStores * @description get all queryStores

View file

@ -1,8 +1,8 @@
import { Request, Response } from "express"; import { Request, Response } from "express";
import TemplateService from "../../service/templateService"; import TemplateService from "../../../service/settings/templateService";
import TemplateFactory from "../../factory/admin/template"; import TemplateFactory from "../../../factory/admin/settings/template";
import { CreateTemplateCommand, DeleteTemplateCommand, UpdateTemplateCommand } from "../../command/templateCommand"; import { CreateTemplateCommand, DeleteTemplateCommand, UpdateTemplateCommand } from "../../../command/settings/template/templateCommand";
import TemplateCommandHandler from "../../command/templateCommandHandler"; import TemplateCommandHandler from "../../../command/settings/template/templateCommandHandler";
/** /**
* @description get all templates * @description get all templates

View file

@ -1,13 +1,13 @@
import { Request, Response } from "express"; import { Request, Response } from "express";
import TemplateUsageService from "../../service/templateUsageService"; import TemplateUsageService from "../../../service/settings/templateUsageService";
import TemplateUsageFactory from "../../factory/admin/templateUsage"; import TemplateUsageFactory from "../../../factory/admin/settings/templateUsage";
import { UpdateTemplateUsageCommand } from "../../command/templateUsageCommand"; import { UpdateTemplateUsageCommand } from "../../../command/settings/templateUsage/templateUsageCommand";
import TemplateUsageCommandHandler from "../../command/templateUsageCommandHandler"; import TemplateUsageCommandHandler from "../../../command/settings/templateUsage/templateUsageCommandHandler";
import PermissionHelper from "../../helpers/permissionHelper"; import PermissionHelper from "../../../helpers/permissionHelper";
import ForbiddenRequestException from "../../exceptions/forbiddenRequestException"; import ForbiddenRequestException from "../../../exceptions/forbiddenRequestException";
import { PermissionModule } from "../../type/permissionTypes"; import { PermissionModule } from "../../../type/permissionTypes";
import { PdfExport } from "../../helpers/pdfExport"; import { PdfExport } from "../../../helpers/pdfExport";
import { DemoDataHelper } from "../../helpers/demoDataHelper"; import { DemoDataHelper } from "../../../helpers/demoDataHelper";
/** /**
* @description get all templateUsages * @description get all templateUsages
@ -21,8 +21,8 @@ export async function getAllTemplateUsages(req: Request, res: Response): Promise
if (!req.isOwner) { if (!req.isOwner) {
templateUsages = templateUsages.filter((tu) => { templateUsages = templateUsages.filter((tu) => {
return ( return (
PermissionHelper.can(req.permissions, "update", "settings", tu.scope) || PermissionHelper.can(req.permissions, "update", "settings", tu.scope.split(".")[0] as PermissionModule) ||
PermissionHelper.can(req.permissions, "update", "club", tu.scope) PermissionHelper.can(req.permissions, "update", "club", tu.scope.split(".")[0] as PermissionModule)
); );
}); });
} }

View file

@ -1,12 +1,12 @@
import { Request, Response } from "express"; import { Request, Response } from "express";
import RoleService from "../../service/roleService"; import RoleService from "../../../service/user/roleService";
import RoleFactory from "../../factory/admin/role"; import RoleFactory from "../../../factory/admin/user/role";
import RolePermissionService from "../../service/rolePermissionService"; import RolePermissionService from "../../../service/user/rolePermissionService";
import PermissionHelper from "../../helpers/permissionHelper"; import PermissionHelper from "../../../helpers/permissionHelper";
import { CreateRoleCommand, DeleteRoleCommand, UpdateRoleCommand } from "../../command/roleCommand"; import { CreateRoleCommand, DeleteRoleCommand, UpdateRoleCommand } from "../../../command/user/role/roleCommand";
import RoleCommandHandler from "../../command/roleCommandHandler"; import RoleCommandHandler from "../../../command/user/role/roleCommandHandler";
import { UpdateRolePermissionsCommand } from "../../command/rolePermissionCommand"; import { UpdateRolePermissionsCommand } from "../../../command/user/role/rolePermissionCommand";
import RolePermissionCommandHandler from "../../command/rolePermissionCommandHandler"; import RolePermissionCommandHandler from "../../../command/user/role/rolePermissionCommandHandler";
/** /**
* @description get All roles * @description get All roles

View file

@ -1,15 +1,15 @@
import { Request, Response } from "express"; import { Request, Response } from "express";
import UserService from "../../service/userService"; import UserService from "../../../service/user/userService";
import UserFactory from "../../factory/admin/user"; import UserFactory from "../../../factory/admin/user/user";
import UserPermissionService from "../../service/userPermissionService"; import UserPermissionService from "../../../service/user/userPermissionService";
import PermissionHelper from "../../helpers/permissionHelper"; import PermissionHelper from "../../../helpers/permissionHelper";
import RoleFactory from "../../factory/admin/role"; import RoleFactory from "../../../factory/admin/user/role";
import { DeleteUserCommand, UpdateUserCommand, UpdateUserRolesCommand } from "../../command/userCommand"; import { DeleteUserCommand, UpdateUserCommand, UpdateUserRolesCommand } from "../../../command/user/user/userCommand";
import UserCommandHandler from "../../command/userCommandHandler"; import UserCommandHandler from "../../../command/user/user/userCommandHandler";
import MailHelper from "../../helpers/mailHelper"; import MailHelper from "../../../helpers/mailHelper";
import { CLUB_NAME } from "../../env.defaults"; import { CLUB_NAME } from "../../../env.defaults";
import { UpdateUserPermissionsCommand } from "../../command/userPermissionCommand"; import { UpdateUserPermissionsCommand } from "../../../command/user/user/userPermissionCommand";
import UserPermissionCommandHandler from "../../command/userPermissionCommandHandler"; import UserPermissionCommandHandler from "../../../command/user/user/userPermissionCommandHandler";
/** /**
* @description get All users * @description get All users

View file

@ -4,13 +4,13 @@ import { JWTToken } from "../type/jwtTypes";
import InternalException from "../exceptions/internalException"; import InternalException from "../exceptions/internalException";
import RefreshCommandHandler from "../command/refreshCommandHandler"; import RefreshCommandHandler from "../command/refreshCommandHandler";
import { CreateRefreshCommand, DeleteRefreshCommand } from "../command/refreshCommand"; import { CreateRefreshCommand, DeleteRefreshCommand } from "../command/refreshCommand";
import UserService from "../service/userService"; import UserService from "../service/user/userService";
import speakeasy from "speakeasy"; import speakeasy from "speakeasy";
import UnauthorizedRequestException from "../exceptions/unauthorizedRequestException"; import UnauthorizedRequestException from "../exceptions/unauthorizedRequestException";
import RefreshService from "../service/refreshService"; import RefreshService from "../service/refreshService";
import UserPermissionService from "../service/userPermissionService"; import UserPermissionService from "../service/user/userPermissionService";
import PermissionHelper from "../helpers/permissionHelper"; import PermissionHelper from "../helpers/permissionHelper";
import RolePermissionService from "../service/rolePermissionService"; import RolePermissionService from "../service/user/rolePermissionService";
/** /**
* @description Check authentication status by token * @description Check authentication status by token

View file

@ -7,18 +7,18 @@ import { CreateRefreshCommand } from "../command/refreshCommand";
import speakeasy from "speakeasy"; import speakeasy from "speakeasy";
import UnauthorizedRequestException from "../exceptions/unauthorizedRequestException"; import UnauthorizedRequestException from "../exceptions/unauthorizedRequestException";
import QRCode from "qrcode"; import QRCode from "qrcode";
import { CreateUserCommand } from "../command/userCommand"; import { CreateUserCommand } from "../command/user/user/userCommand";
import UserCommandHandler from "../command/userCommandHandler"; import UserCommandHandler from "../command/user/user/userCommandHandler";
import { CreateInviteCommand, DeleteInviteCommand } from "../command/inviteCommand"; import { CreateInviteCommand, DeleteInviteCommand } from "../command/user/user/inviteCommand";
import InviteCommandHandler from "../command/inviteCommandHandler"; import InviteCommandHandler from "../command/user/user/inviteCommandHandler";
import MailHelper from "../helpers/mailHelper"; import MailHelper from "../helpers/mailHelper";
import InviteService from "../service/inviteService"; import InviteService from "../service/user/inviteService";
import UserService from "../service/userService"; import UserService from "../service/user/userService";
import CustomRequestException from "../exceptions/customRequestException"; import CustomRequestException from "../exceptions/customRequestException";
import { CLUB_NAME } from "../env.defaults"; import { CLUB_NAME } from "../env.defaults";
import { CreateUserPermissionCommand } from "../command/userPermissionCommand"; import { CreateUserPermissionCommand } from "../command/user/user/userPermissionCommand";
import UserPermissionCommandHandler from "../command/userPermissionCommandHandler"; import UserPermissionCommandHandler from "../command/user/user/userPermissionCommandHandler";
import InviteFactory from "../factory/admin/invite"; import InviteFactory from "../factory/admin/user/invite";
/** /**
* @description get all invites * @description get all invites

View file

@ -1,11 +1,11 @@
import { Request, Response } from "express"; import { Request, Response } from "express";
import CalendarService from "../service/calendarService"; import CalendarService from "../service/club/calendarService";
import CalendarTypeService from "../service/calendarTypeService"; import CalendarTypeService from "../service/settings/calendarTypeService";
import { calendar } from "../entity/calendar"; import { calendar } from "../entity/club/calendar";
import { createEvents } from "ics"; import { createEvents } from "ics";
import moment from "moment"; import moment from "moment";
import InternalException from "../exceptions/internalException"; import InternalException from "../exceptions/internalException";
import CalendarFactory from "../factory/admin/calendar"; import CalendarFactory from "../factory/admin/club/calendar";
import { CalendarHelper } from "../helpers/calendarHelper"; import { CalendarHelper } from "../helpers/calendarHelper";
/** /**

View file

@ -11,13 +11,13 @@ import { CreateResetCommand, DeleteResetCommand } from "../command/resetCommand"
import ResetCommandHandler from "../command/resetCommandHandler"; import ResetCommandHandler from "../command/resetCommandHandler";
import MailHelper from "../helpers/mailHelper"; import MailHelper from "../helpers/mailHelper";
import ResetService from "../service/resetService"; import ResetService from "../service/resetService";
import UserService from "../service/userService"; import UserService from "../service/user/userService";
import { CLUB_NAME } from "../env.defaults"; import { CLUB_NAME } from "../env.defaults";
import PermissionHelper from "../helpers/permissionHelper"; import PermissionHelper from "../helpers/permissionHelper";
import RolePermissionService from "../service/rolePermissionService"; import RolePermissionService from "../service/user/rolePermissionService";
import UserPermissionService from "../service/userPermissionService"; import UserPermissionService from "../service/user/userPermissionService";
import { UpdateUserSecretCommand } from "../command/userCommand"; import { UpdateUserSecretCommand } from "../command/user/user/userCommand";
import UserCommandHandler from "../command/userCommandHandler"; import UserCommandHandler from "../command/user/user/userCommandHandler";
/** /**
* @description request totp reset * @description request totp reset

View file

@ -3,10 +3,10 @@ import speakeasy from "speakeasy";
import QRCode from "qrcode"; import QRCode from "qrcode";
import InternalException from "../exceptions/internalException"; import InternalException from "../exceptions/internalException";
import { CLUB_NAME } from "../env.defaults"; import { CLUB_NAME } from "../env.defaults";
import UserService from "../service/userService"; import UserService from "../service/user/userService";
import UserFactory from "../factory/admin/user"; import UserFactory from "../factory/admin/user/user";
import { TransferUserOwnerCommand, UpdateUserCommand } from "../command/userCommand"; import { TransferUserOwnerCommand, UpdateUserCommand } from "../command/user/user/userCommand";
import UserCommandHandler from "../command/userCommandHandler"; import UserCommandHandler from "../command/user/user/userCommandHandler";
import ForbiddenRequestException from "../exceptions/forbiddenRequestException"; import ForbiddenRequestException from "../exceptions/forbiddenRequestException";
/** /**

View file

@ -3,18 +3,18 @@ import "reflect-metadata";
import { DataSource } from "typeorm"; import { DataSource } from "typeorm";
import { DB_HOST, DB_USERNAME, DB_PASSWORD, DB_NAME, DB_TYPE } from "./env.defaults"; import { DB_HOST, DB_USERNAME, DB_PASSWORD, DB_NAME, DB_TYPE } from "./env.defaults";
import { user } from "./entity/user"; import { user } from "./entity/user/user";
import { refresh } from "./entity/refresh"; import { refresh } from "./entity/refresh";
import { invite } from "./entity/invite"; import { invite } from "./entity/user/invite";
import { userPermission } from "./entity/user_permission"; import { userPermission } from "./entity/user/user_permission";
import { role } from "./entity/role"; import { role } from "./entity/user/role";
import { rolePermission } from "./entity/role_permission"; import { rolePermission } from "./entity/user/role_permission";
import { award } from "./entity/award"; import { award } from "./entity/settings/award";
import { communication } from "./entity/communication"; import { communication } from "./entity/club/member/communication";
import { communicationType } from "./entity/communicationType"; import { communicationType } from "./entity/settings/communicationType";
import { executivePosition } from "./entity/executivePosition"; import { executivePosition } from "./entity/settings/executivePosition";
import { membershipStatus } from "./entity/membershipStatus"; import { membershipStatus } from "./entity/settings/membershipStatus";
import { qualification } from "./entity/qualification"; import { qualification } from "./entity/settings/qualification";
import { Initial1724317398939 } from "./migrations/1724317398939-initial"; import { Initial1724317398939 } from "./migrations/1724317398939-initial";
import { RefreshPrimaryChange1724573307851 } from "./migrations/1724573307851-refreshPrimaryChange"; import { RefreshPrimaryChange1724573307851 } from "./migrations/1724573307851-refreshPrimaryChange";
@ -22,48 +22,50 @@ import { Invite1724579024939 } from "./migrations/1724579024939-invite";
import { Permissions1724661484664 } from "./migrations/1724661484664-permissions"; import { Permissions1724661484664 } from "./migrations/1724661484664-permissions";
import { RolePermission1724771491085 } from "./migrations/1724771491085-role_permission"; import { RolePermission1724771491085 } from "./migrations/1724771491085-role_permission";
import { MemberBaseData1725435669492 } from "./migrations/1725435669492-member_base_data"; import { MemberBaseData1725435669492 } from "./migrations/1725435669492-member_base_data";
import { member } from "./entity/member"; import { member } from "./entity/club/member/member";
import { memberAwards } from "./entity/memberAwards"; import { memberAwards } from "./entity/club/member/memberAwards";
import { memberExecutivePositions } from "./entity/memberExecutivePositions"; import { memberExecutivePositions } from "./entity/club/member/memberExecutivePositions";
import { memberQualifications } from "./entity/memberQualifications"; import { memberQualifications } from "./entity/club/member/memberQualifications";
import { membership } from "./entity/membership"; import { membership } from "./entity/club/member/membership";
import { Memberdata1726301836849 } from "./migrations/1726301836849-memberdata"; import { Memberdata1726301836849 } from "./migrations/1726301836849-memberdata";
import { CommunicationFields1727439800630 } from "./migrations/1727439800630-communicationFields"; import { CommunicationFields1727439800630 } from "./migrations/1727439800630-communicationFields";
import { Ownership1728313041449 } from "./migrations/1728313041449-ownership"; import { Ownership1728313041449 } from "./migrations/1728313041449-ownership";
import { protocol } from "./entity/protocol"; import { protocol } from "./entity/club/protocol/protocol";
import { protocolAgenda } from "./entity/protocolAgenda"; import { protocolAgenda } from "./entity/club/protocol/protocolAgenda";
import { protocolDecision } from "./entity/protocolDecision"; import { protocolDecision } from "./entity/club/protocol/protocolDecision";
import { protocolPresence } from "./entity/protocolPresence"; import { protocolPresence } from "./entity/club/protocol/protocolPresence";
import { protocolVoting } from "./entity/protocolVoting"; import { protocolVoting } from "./entity/club/protocol/protocolVoting";
import { protocolPrintout } from "./entity/protocolPrintout"; import { protocolPrintout } from "./entity/club/protocol/protocolPrintout";
import { Protocol1729347911107 } from "./migrations/1729347911107-protocol"; import { Protocol1729347911107 } from "./migrations/1729347911107-protocol";
import { calendar } from "./entity/calendar"; import { calendar } from "./entity/club/calendar";
import { calendarType } from "./entity/calendarType"; import { calendarType } from "./entity/settings/calendarType";
import { Calendar1729947763295 } from "./migrations/1729947763295-calendar"; import { Calendar1729947763295 } from "./migrations/1729947763295-calendar";
import { reset } from "./entity/reset"; import { reset } from "./entity/reset";
import { ResetToken1732358596823 } from "./migrations/1732358596823-resetToken"; import { ResetToken1732358596823 } from "./migrations/1732358596823-resetToken";
import { SMSAlarming1732696919191 } from "./migrations/1732696919191-SMSAlarming"; import { SMSAlarming1732696919191 } from "./migrations/1732696919191-SMSAlarming";
import { SecuringCalendarType1733249553766 } from "./migrations/1733249553766-securingCalendarType"; import { SecuringCalendarType1733249553766 } from "./migrations/1733249553766-securingCalendarType";
import { query } from "./entity/query"; import { query } from "./entity/settings/query";
import { QueryStore1734187754677 } from "./migrations/1734187754677-queryStore"; import { QueryStore1734187754677 } from "./migrations/1734187754677-queryStore";
import { memberView } from "./views/memberView"; import { memberView } from "./views/memberView";
import { memberExecutivePositionsView } from "./views/memberExecutivePositionView"; import { memberExecutivePositionsView } from "./views/memberExecutivePositionView";
import { memberQualificationsView } from "./views/memberQualificationsView"; import { memberQualificationsView } from "./views/memberQualificationsView";
import { membershipView } from "./views/membershipsView"; import { membershipView } from "./views/membershipsView";
import { MemberDataViews1734520998539 } from "./migrations/1734520998539-memberDataViews"; import { MemberDataViews1734520998539 } from "./migrations/1734520998539-memberDataViews";
import { template } from "./entity/template"; import { template } from "./entity/settings/template";
import { Template1734854680201 } from "./migrations/1734854680201-template"; import { Template1734854680201 } from "./migrations/1734854680201-template";
import { templateUsage } from "./entity/templateUsage"; import { templateUsage } from "./entity/settings/templateUsage";
import { TemplateUsage1734949173739 } from "./migrations/1734949173739-templateUsage"; import { TemplateUsage1734949173739 } from "./migrations/1734949173739-templateUsage";
import { newsletter } from "./entity/newsletter"; import { newsletter } from "./entity/club/newsletter/newsletter";
import { newsletterDates } from "./entity/newsletterDates"; import { newsletterDates } from "./entity/club/newsletter/newsletterDates";
import { newsletterRecipients } from "./entity/newsletterRecipients"; import { newsletterRecipients } from "./entity/club/newsletter/newsletterRecipients";
import { Newsletter1735118780511 } from "./migrations/1735118780511-newsletter"; import { Newsletter1735118780511 } from "./migrations/1735118780511-newsletter";
import { newsletterConfig } from "./entity/newsletterConfig"; import { newsletterConfig } from "./entity/settings/newsletterConfig";
import { NewsletterConfig1735207446910 } from "./migrations/1735207446910-newsletterConfig"; import { NewsletterConfig1735207446910 } from "./migrations/1735207446910-newsletterConfig";
import { TemplateMargins1735733514043 } from "./migrations/1735733514043-templateMargins";
import { InternalId1735822722235 } from "./migrations/1735822722235-internalId"; import { InternalId1735822722235 } from "./migrations/1735822722235-internalId";
import { PostalCode1735927918979 } from "./migrations/1735927918979-postalCode"; import { PostalCode1735927918979 } from "./migrations/1735927918979-postalCode";
import { ProtocolAbsent1736072179716 } from "./migrations/1736072179716-protocolAbsent";
import { Memberlist1736079005086 } from "./migrations/1736079005086-memberlist";
import { ExtendViewValues1736084198860 } from "./migrations/1736084198860-extendViewValues";
const dataSource = new DataSource({ const dataSource = new DataSource({
type: DB_TYPE as any, type: DB_TYPE as any,
@ -135,9 +137,11 @@ const dataSource = new DataSource({
TemplateUsage1734949173739, TemplateUsage1734949173739,
Newsletter1735118780511, Newsletter1735118780511,
NewsletterConfig1735207446910, NewsletterConfig1735207446910,
TemplateMargins1735733514043,
InternalId1735822722235, InternalId1735822722235,
PostalCode1735927918979, PostalCode1735927918979,
ProtocolAbsent1736072179716,
Memberlist1736079005086,
ExtendViewValues1736084198860,
], ],
migrationsRun: true, migrationsRun: true,
migrationsTransactionMode: "each", migrationsTransactionMode: "each",

View file

@ -0,0 +1,13 @@
import { member } from "../entity/club/member/member";
import { protocolAgenda } from "../entity/club/protocol/protocolAgenda";
import { protocolDecision } from "../entity/club/protocol/protocolDecision";
import { protocolVoting } from "../entity/club/protocol/protocolVoting";
export const memberlistDemoData: { member: Array<Partial<member>> } = {
member: [
{
firstname: "Julian",
lastname: "Krauser",
},
]
}

View file

@ -1,5 +1,5 @@
import { calendar } from "../entity/calendar"; import { calendar } from "../entity/club/calendar";
import { member } from "../entity/member"; import { member } from "../entity/club/member/member";
import { Salutation } from "../enums/salutation"; import { Salutation } from "../enums/salutation";
export const newsletterDemoData: { export const newsletterDemoData: {

View file

@ -1,7 +1,7 @@
import { member } from "../entity/member"; import { member } from "../entity/club/member/member";
import { protocolAgenda } from "../entity/protocolAgenda"; import { protocolAgenda } from "../entity/club/protocol/protocolAgenda";
import { protocolDecision } from "../entity/protocolDecision"; import { protocolDecision } from "../entity/club/protocol/protocolDecision";
import { protocolVoting } from "../entity/protocolVoting"; import { protocolVoting } from "../entity/club/protocol/protocolVoting";
export const protocolDemoData: { export const protocolDemoData: {
title: string; title: string;
@ -13,6 +13,7 @@ export const protocolDemoData: {
agenda: Array<Partial<protocolAgenda>>; agenda: Array<Partial<protocolAgenda>>;
decisions: Array<Partial<protocolDecision>>; decisions: Array<Partial<protocolDecision>>;
presence: Array<Partial<member>>; presence: Array<Partial<member>>;
absent: Array<Partial<member>>;
votings: Array<Partial<protocolVoting>>; votings: Array<Partial<protocolVoting>>;
} = { } = {
title: "Beispiel Protokoll Daten", title: "Beispiel Protokoll Daten",
@ -44,6 +45,7 @@ export const protocolDemoData: {
lastname: "Krauser", lastname: "Krauser",
}, },
], ],
absent: [],
votings: [ votings: [
{ {
topic: "Abstimmung xy", topic: "Abstimmung xy",

View file

@ -9,7 +9,7 @@ import {
AfterUpdate, AfterUpdate,
BeforeUpdate, BeforeUpdate,
} from "typeorm"; } from "typeorm";
import { calendarType } from "./calendarType"; import { calendarType } from "../settings/calendarType";
@Entity() @Entity()
export class calendar { export class calendar {

View file

@ -1,6 +1,6 @@
import { Column, Entity, ManyToOne, PrimaryColumn } from "typeorm"; import { Column, Entity, ManyToOne, PrimaryColumn } from "typeorm";
import { member } from "./member"; import { member } from "./member";
import { communicationType } from "./communicationType"; import { communicationType } from "../../settings/communicationType";
@Entity() @Entity()
export class communication { export class communication {

View file

@ -1,11 +1,11 @@
import { Column, Entity, JoinColumn, ManyToOne, OneToMany, OneToOne, PrimaryColumn } from "typeorm"; import { Column, Entity, JoinColumn, ManyToOne, OneToMany, OneToOne, PrimaryColumn } from "typeorm";
import { Salutation } from "../enums/salutation"; import { Salutation } from "../../../enums/salutation";
import { membership } from "./membership"; import { membership } from "./membership";
import { memberAwards } from "./memberAwards"; import { memberAwards } from "./memberAwards";
import { memberQualifications } from "./memberQualifications"; import { memberQualifications } from "./memberQualifications";
import { memberExecutivePositions } from "./memberExecutivePositions"; import { memberExecutivePositions } from "./memberExecutivePositions";
import { communication } from "./communication"; import { communication } from "./communication";
import { CommunicationViewModel } from "../viewmodel/admin/communication.models"; import { CommunicationViewModel } from "../../../viewmodel/admin/club/member/communication.models";
@Entity() @Entity()
export class member { export class member {

View file

@ -1,6 +1,6 @@
import { Column, Entity, ManyToOne, PrimaryColumn } from "typeorm"; import { Column, Entity, ManyToOne, PrimaryColumn } from "typeorm";
import { member } from "./member"; import { member } from "./member";
import { award } from "./award"; import { award } from "../../settings/award";
@Entity() @Entity()
export class memberAwards { export class memberAwards {

View file

@ -1,6 +1,6 @@
import { Column, Entity, ManyToOne, PrimaryColumn } from "typeorm"; import { Column, Entity, ManyToOne, PrimaryColumn } from "typeorm";
import { member } from "./member"; import { member } from "./member";
import { executivePosition } from "./executivePosition"; import { executivePosition } from "../../settings/executivePosition";
@Entity() @Entity()
export class memberExecutivePositions { export class memberExecutivePositions {

Some files were not shown because too many files have changed in this diff Show more