Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#IP-292] Add override on isEmailEnabled value for old profiles #137

Merged
merged 10 commits into from
Jul 5, 2021

Conversation

AleDore
Copy link
Contributor

@AleDore AleDore commented Jul 2, 2021

List of Changes

  • Add EMAIL_MODE_SWITCH_LIMIT_DATE env property
  • Update StoreMessageContentActivity in order to override isEmailEnabled based on profile' s timestamp check
  • Upgrade io-functions-commons version
  • Add unit test on StoreMessageContentActivity
  • Tests refactor related to io-functions-commons upgrade

Motivation and Context

We want that an organization can't reach on email channel a citizen with an old profile, or even if his profile has not been recently upserted (after EMAIL_MODE_SWITCH_LIMIT_DATE)

How Has This Been Tested?

Screenshots (if appropriate):

Types of changes

  • Chore (nothing changes by a user perspective)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

@pagopa-github-bot
Copy link
Contributor

pagopa-github-bot commented Jul 2, 2021

Warnings
⚠️

Please include a Pivotal story at the beginning of the PR title (see below).

Example of PR titles that include pivotal stories:

  • single story: [#123456] my PR title
  • multiple stories: [#123456,#123457,#123458] my PR title

New dependencies added: date-fns.

date-fns

Author: Unknown

Description: Modern JavaScript date utility library

Homepage: https://github.com/date-fns/date-fns#readme

Createdover 6 years ago
Last Updated12 days ago
LicenseMIT
Maintainers2
Releases168
Direct Dependencies
README

date-fns

date-fns provides the most comprehensive, yet simple and consistent toolset
for manipulating JavaScript dates in a browser & Node.js.


It's like Lodash for dates

  • It has 200+ functions for all occasions.
  • Modular: Pick what you need. Works with webpack, Browserify, or Rollup and also supports tree-shaking.
  • Native dates: Uses existing native type. It doesn't extend core objects for safety's sake.
  • Immutable & Pure: Built using pure functions and always returns a new date instance.
  • TypeScript & Flow: Supports both Flow and TypeScript
  • I18n: Dozens of locales. Include only what you need.
  • and many more benefits
import { compareAsc, format } from 'date-fns'

format(new Date(2014, 1, 11), 'yyyy-MM-dd')
//=> '2014-02-11'

const dates = [
  new Date(1995, 6, 2),
  new Date(1987, 1, 11),
  new Date(1989, 6, 10),
]
dates.sort(compareAsc)
//=> [
//   Wed Feb 11 1987 00:00:00,
//   Mon Jul 10 1989 00:00:00,
//   Sun Jul 02 1995 00:00:00
// ]

The library is available as an npm package.
To install the package run:

npm install date-fns --save
# or with yarn
yarn add date-fns

Docs

See date-fns.org for more details, API,
and other docs.


License

MIT © Sasha Koss

Generated by 🚫 dangerJS

StoreMessageContentActivity/handler.ts Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
utils/config.ts Outdated Show resolved Hide resolved
yarn.lock Show resolved Hide resolved
taskEither.of(
some({
...aRetrievedProfile,
blockedInboxOrChannels: { agid: BlockedInboxOrChannelEnum.INBOX }
Copy link
Contributor

Choose a reason for hiding this comment

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

use anonymous service ID, and i think that the value should be an array

Suggested change
blockedInboxOrChannels: { agid: BlockedInboxOrChannelEnum.INBOX }
blockedInboxOrChannels: { myServiceId: [BlockedInboxOrChannelEnum.INBOX] }

Copy link
Contributor

@BurnedMarshal BurnedMarshal left a comment

Choose a reason for hiding this comment

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

LGTM

@AleDore AleDore merged commit 8b2d911 into master Jul 5, 2021
@AleDore AleDore deleted the IP-292_create_message_check_on_is_emanil_enabled branch July 5, 2021 12:03
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