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

Multiple group_code #13

Open
slavomir-sidor opened this issue Nov 21, 2022 · 1 comment
Open

Multiple group_code #13

slavomir-sidor opened this issue Nov 21, 2022 · 1 comment

Comments

@slavomir-sidor
Copy link

slavomir-sidor commented Nov 21, 2022

Steps required to reproduce the problem

  1. Standard requests for CNS services allow company request multiple groups,
  2. CNS Client allows you to configure and require just one group_code, and must be set.
    3.Makes NotificationServiceInterface unusable in one application with multiple groups
  3. Even When I override the service, the bundle configuration interface, do not allow me to add, any other group configuration,

Expected Result

I expect group_code to be an array and operation send(NotificationInterface $notification) on NotificationServiceInterface , to be extended with second parameter $group, which is specified in config as array and would be value only from this config variable otherwise exception will be thrown, send(NotificationInterface $notification, string $group).
Second parameter will service know, thru which group notification will be sent.

Actual Result

  • not implementable

May we discuss solution and create a pull request, thanks a lot!
Slavomir

@slavomir-sidor slavomir-sidor changed the title Multiple Multiple group_code Nov 21, 2022
@slavomir-sidor
Copy link
Author

slavomir-sidor commented Nov 21, 2022

I have maybe better solution :

  • make the cns_client configuration as array of current settings:
    instead of
cns_client:
  base_url: '%env(CNS_BASE_URL)%'
  system_key: '%env(string:CNS_CLIENT_SYSTEM_KEY)%'
  system_password: '%env(string:CNS_CLIENT_SYSTEM_PASSWORD)%'
  group_code: '%env(string:CNS_CLIENT_GROUP_CODE_DUMMY)%'

to something as doctrine connections as an array:

cns_client:
  default:
     base_url: '%env(CNS_BASE_URL)%'
     system_key: '%env(string:CNS_CLIENT_SYSTEM_KEY)%'
     system_password: '%env(string:CNS_CLIENT_SYSTEM_PASSWORD)%'
     group_code: 'dummy'
  another:
     base_url: '%env(CNS_BASE_URL)%'
     system_key: '%env(string:CNS_CLIENT_SYSTEM_KEY)%'
     system_password: '%env(string:CNS_CLIENT_SYSTEM_PASSWORD)%'
     group_code: 'dummy-2'

and specify in send operation of NotificationServiceInterface , thru wich configuration you want to sent message
->send(NotificationInterface $notification, string $connection='default')

What do you think?

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

No branches or pull requests

1 participant