Skip to content

Commit

Permalink
mass confirm fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ehsan-g committed Jul 22, 2024
1 parent 0819a3c commit 60fc6bf
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/features/campaign/campaign.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ export class CampaignService {
await this.smsRest.send(
process.env.SAY_ADMIN_SMS,
from,
'just sent the arrival updates!',
'سلام، یادآوری به مددکاران انجام شد.',
);
sleep(2000);
}
Expand Down
6 changes: 3 additions & 3 deletions src/features/schedule/schedule.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,8 @@ export class ScheduleService {
}

// ERROR [Scheduler] ServerError: Can't send mail - all recipients were rejected: 550 <[email protected]> No such user here
@Cron('00 10 * * Wed', {
name: 'MonthlyCampaigns try At 10:00 on Wednsday.', // we try every week and only send to those who did not receive (because their child have no needs, etc.)
@Cron('00 10 * * Thu', {
name: 'MonthlyCampaigns try At 10:00 on Thursdays.', // we try every week and only send to those who did not receive (because their child have no needs, etc.)
timeZone: 'Asia/Tehran',
})
async handleMonthlyCampaignsCron() {
Expand All @@ -145,7 +145,7 @@ export class ScheduleService {
this.logger.debug(
'Sending user Campaigns at 01:00 PM, only on Thursdays',
);
await this.campaignService.sendUserMonthlyCampaigns();
// await this.campaignService.sendUserMonthlyCampaigns();
}
}

Expand Down
13 changes: 9 additions & 4 deletions src/utils/needConfirm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -407,20 +407,25 @@ export function checkNeed(need: Need, duplicate: Need) {
),
);
if (
!duplicate.title || duplicate.title.length < 1||
!duplicate.title ||
duplicate.title.length < 1 ||
(duplicate.title && titleResult > SIMILAR_TXT_PERCENTAGE)
) {
TT = true;
} else {
TT = false;
msg = 'title is not correct';
msg = 'title is not That similar';
}
} else if (type === NeedTypeEnum.SERVICE) {
if (!duplicate.title || duplicate.title.length < 1) {
if (
!duplicate.name_translations ||
!duplicate.name_translations.fa ||
duplicate.name_translations.fa.length < 1
) {
TT = true;
} else {
TT = false;
msg = 'title is not correct';
msg = 'title is not That similar';
}
}

Expand Down

0 comments on commit 60fc6bf

Please sign in to comment.