Skip to content

Conversation

@Yannick1712
Copy link
Member

Release Checklist

Pre-Release

  • Check migrations
    • No database related infos (sqldb-xxx)
    • Impact on GS (new/removed columns)
  • Check for linter errors (in PR)
  • Test basic user operations (on DFX services)
    • Login/logout
    • Buy/sell payment request
    • KYC page

Post-Release

  • Test basic user operations
  • Monitor application insights log

@github-actions
Copy link

❌ ESLint: 2 errors, 3 warnings

Comment on lines +40 to +58
await this.sendAutoResponse(
SupportMessageTranslationKey.SEPA_STANDARD,
issues.filter((i) => {
const day = i.created.getDay();
const hour = i.created.getHours();

return (day === 2 && hour >= 14) || (day > 2 && day < 5) || (day === 5 && hour < 14);
}),
);

await this.sendAutoResponse(
SupportMessageTranslationKey.SEPA_WEEKEND,
issues.filter((i) => {
const day = i.created.getDay();
const hour = i.created.getHours();

return (day === 2 && hour < 14) || (day > 5 && day < 2) || (day === 5 && hour >= 14);
}),
);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would do the filtering only once. A new util method:

  static partition<T>(list: T[], accessor: (item: T) => boolean): [T[], T[]] {
    const truthy: T[] = [];
    const falsy: T[] = [];

    for (const item of list) {
      (accessor(item) ? truthy : falsy).push(item);
    }

    return [truthy, falsy];
  }

and then

const [standard, weekend] = Util.partition(issues, (i) => {
        const day = i.created.getDay();
        const hour = i.created.getHours();

        return (day === 2 && hour >= 14) || (day > 2 && day < 5) || (day === 5 && hour < 14);
});

await this.sendAutoResponse(SupportMessageTranslationKey.SEPA_STANDARD, standard);
await this.sendAutoResponse(SupportMessageTranslationKey. SEPA_WEEKEND, weekend);

Comment on lines 90 to 92
SUPPORT_BOT = 'SupportBot',
SUPPORT_BOT_SEPA = 'SupportBotSepa',
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use a setting entry instead

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants