sms alarming flag
This commit is contained in:
parent
1d73a15227
commit
5c68f0c54f
14 changed files with 90 additions and 3 deletions
|
@ -1,5 +1,6 @@
|
|||
export interface CreateCommunicationCommand {
|
||||
preferred: boolean;
|
||||
isSMSAlarming: boolean;
|
||||
mobile: string;
|
||||
email: string;
|
||||
city: string;
|
||||
|
@ -13,6 +14,7 @@ export interface CreateCommunicationCommand {
|
|||
export interface UpdateCommunicationCommand {
|
||||
id: number;
|
||||
preferred: boolean;
|
||||
isSMSAlarming: boolean;
|
||||
mobile: string;
|
||||
email: string;
|
||||
city: string;
|
||||
|
|
|
@ -22,6 +22,7 @@ export default abstract class CommunicationCommandHandler {
|
|||
.into(communication)
|
||||
.values({
|
||||
preferred: createCommunication.preferred,
|
||||
isSMSAlarming: createCommunication.isSMSAlarming,
|
||||
mobile: createCommunication.mobile,
|
||||
email: createCommunication.email,
|
||||
city: createCommunication.city,
|
||||
|
@ -59,6 +60,7 @@ export default abstract class CommunicationCommandHandler {
|
|||
.update(communication)
|
||||
.set({
|
||||
preferred: updateCommunication.preferred,
|
||||
isSMSAlarming: updateCommunication.isSMSAlarming,
|
||||
mobile: updateCommunication.mobile,
|
||||
email: updateCommunication.email,
|
||||
city: updateCommunication.city,
|
||||
|
|
|
@ -68,7 +68,6 @@ export default abstract class MemberCommandHandler {
|
|||
* @returns {Promise<void>}
|
||||
*/
|
||||
static async updateNewsletter(updateMember: UpdateMemberNewsletterCommand): Promise<void> {
|
||||
console.log(updateMember);
|
||||
return await dataSource
|
||||
.createQueryBuilder()
|
||||
.update(member)
|
||||
|
@ -88,6 +87,26 @@ export default abstract class MemberCommandHandler {
|
|||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @description update member newsletter to unset
|
||||
* @param memberId string
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
static async unsetNewsletter(memberId: number): Promise<void> {
|
||||
return await dataSource
|
||||
.createQueryBuilder()
|
||||
.update(member)
|
||||
.set({
|
||||
sendNewsletter: null,
|
||||
})
|
||||
.where("id = :id", { id: memberId })
|
||||
.execute()
|
||||
.then(() => {})
|
||||
.catch((err) => {
|
||||
throw new InternalException("Failed updating member", err);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @description delete member
|
||||
* @param DeleteMemberCommand
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue