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

Views of all alert not send by email #15

Closed
pferrariuy opened this issue May 26, 2024 · 1 comment
Closed

Views of all alert not send by email #15

pferrariuy opened this issue May 26, 2024 · 1 comment
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@pferrariuy
Copy link
Collaborator

Feature Request

Description

Create 2 view to retrieve all the alerts that are enabled and ready to be send my email:

  • vw_cli_gen_alert_to_send_by_email
  • vw_cli_loc_alert_to_send_by_email

Use Case

Views will be use by: Renovus-Tech/solarec-java#45

Expected Behavior

  • Client is enabled to send alerts by email
  • Location / Generator is enabled to send alerts by email
  • Alert has not been send by email before
  • The alert must by seend to all users (with access to the client + location / generator) that are enabled to receive alerts by email
@pferrariuy pferrariuy added enhancement New feature or request good first issue Good for newcomers labels May 26, 2024
@pferrariuy pferrariuy self-assigned this May 26, 2024
@pferrariuy
Copy link
Collaborator Author

Flags taken according to definition in: Renovus-Tech/solarec-java#45

CREATE VIEW vw_cli_gen_alert_to_send_by_email AS
select
 cga.*,
 g.loc_id,
 g.gen_name,
 g.gen_code,
 l.loc_name,
 l.loc_code,
 c.cli_name
from
client c
join location l on c.cli_id_auto = l.cli_id
join generator g on g.cli_id = l.cli_id and g.loc_id = l.loc_id_auto
join cli_gen_alert cga on l.cli_id = cga.cli_id and g.gen_id_auto = cga.gen_id
where c.cli_flags ilike '__1%' and g.gen_flags ilike '_1%' and cga.cli_gen_alert_flags ilike '_0%';--


CREATE VIEW vw_cli_loc_alert_to_send_by_email AS 
select
 cla.*,
 l.loc_name,
 l.loc_code,
 c.cli_name
from
client c
join location l on c.cli_id_auto = l.cli_id
join cli_loc_alert cla on l.cli_id = cla.cli_id and l.loc_id_auto = cla.loc_id
where c.cli_flags ilike '__1%' and l.loc_flags ilike '_1%' and cla.cli_loc_alert_flags ilike '_0%';--

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant