diff --git a/.env.example b/.env.example index 09cbb3e17..f9918e3ca 100644 --- a/.env.example +++ b/.env.example @@ -7,21 +7,15 @@ AUTHORIZED_PANEL_LOCAL='http://localhost:3001' AUTHORIZED_DOCS_LOCAL='http://127.0.0.0:8002' - - -AUTHORIZED_DAPP_PRODUCTION='' - ALCHEMY_KEY_SEPOLIA= ALCHEMY_KEY_MAIN= -ALCHEMY_SEPOLIA="https://eth-sepolia.g.alchemy.com/v2/" NFT_STORAGE_KEY= - -DB_FLASK_HOST=localhost -DB_FLASK_USER=nest -DB_FLASK_PASS= -DB_FLASK_NAME=say +DB_FLASK_HOST= +DB_FLASK_USER= +DB_FLASK_PASS= +DB_FLASK_NAME= DOMAIN_LOCAL=api.sayapp.company DOMAIN_STAGING=api.s.sayapp.company @@ -32,6 +26,22 @@ NEST_SERVER_DEV=localhost:8002 NEST_SERVER_STAGING=s.nest.saydao.org NEST_SERVER_PROD=nest.saydao.org +# email +MAIL_HOST= +MAIL_FROM= +MAIL_PASSWORD= +SAY_ADMIN_EMAIL= + +# sms +SMS_FROM= +SAY_ADMIN_SMS= +SMS_USER= +SMS_PASSWORD= + +# end points +INFURA_KEY= +ALCHEMY_KEY= +QUICK_NODE_KEY= +GET_BLOCK_KEY= -DB_HOST= diff --git a/src/features/children/children.service.ts b/src/features/children/children.service.ts index 0691c2166..73aeae749 100644 --- a/src/features/children/children.service.ts +++ b/src/features/children/children.service.ts @@ -392,6 +392,7 @@ export class ChildrenService { async getPreChildrenNames(): Promise { return await this.preRegisterChildrenRepository .createQueryBuilder('child') + .where('child.status != :status', { status: PreRegisterStatusEnum.CONFIRMED }) .select(['child.sayName']) .getMany(); } diff --git a/src/features/schedule/schedule.service.ts b/src/features/schedule/schedule.service.ts index 0ed63bb43..f30135615 100644 --- a/src/features/schedule/schedule.service.ts +++ b/src/features/schedule/schedule.service.ts @@ -125,10 +125,10 @@ export class ScheduleService { } } - // @Cron('00 13 * * Thu', { - // name: 'MonthlyCampaigns try At 13:00 on Thursday.', // we try every week and only send to those who did not receive (because their child have no needs, etc.) - // timeZone: 'Asia/Tehran', - // }) + @Cron('00 13 * * Thu', { + name: 'MonthlyCampaigns try At 13:00 on Thursday.', // we try every week and only send to those who did not receive (because their child have no needs, etc.) + timeZone: 'Asia/Tehran', + }) @Timeout(5000) async handleSummaryMailCron() { // const farsiDay = persianDay(new Date()) @@ -136,10 +136,10 @@ export class ScheduleService { // this.logger.warn(`We are near the end of this month let's skip one more week`); // return // } - // if (process.env.NODE_ENV === 'production') { + if (process.env.NODE_ENV === 'production') { this.logger.debug('Sending user Campaigns at 02:00 PM, only on Sunday'); // await this.campaignService.sendUserMonthlyCampaigns(); - // } + } } @Cron('30 8 * * Mon', { @@ -149,7 +149,7 @@ export class ScheduleService { async handleReminderMailCron() { if (process.env.NODE_ENV === 'production') { this.logger.debug('Sending Reminder to Social workers'); - // await this.campaignService.sendSwChildNoNeedReminder(); + await this.campaignService.sendSwChildNoNeedReminder(); } } } diff --git a/src/features/user/user.controller.ts b/src/features/user/user.controller.ts index 007ef28f1..8d262a842 100644 --- a/src/features/user/user.controller.ts +++ b/src/features/user/user.controller.ts @@ -416,4 +416,17 @@ export class UserController { theUser.contributions.forEach((c) => list.push(c.id)); return await this.userService.deleteOneContributor(theUser.id, list); } + + @Get('/temp') + async getAvailableContributions(@Req() req: Request) { + const users = await this.userService.getUsers(); + for await(const user of users){ + await this.userService.temp(user.id) + } + + + } + + + } diff --git a/src/features/user/user.service.ts b/src/features/user/user.service.ts index 0c4f55c25..c2dce9804 100644 --- a/src/features/user/user.service.ts +++ b/src/features/user/user.service.ts @@ -24,7 +24,7 @@ export class UserService { private flaskSocialWorkerRepository: Repository, @InjectRepository(User, 'flaskPostgres') private flaskUserRepository: Repository, - ) {} + ) { } getFlaskSwIds(): Promise { return this.flaskSocialWorkerRepository.find({ @@ -287,4 +287,14 @@ export class UserService { } return from(this.allUserRepository.delete(userId)); } + + + async temp( + userId: string, + ): Promise { + return this.allUserRepository.update(userId, { + monthlyCampaign: true, + }); + } + }