-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
31 changed files
with
391 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
src/Altinn.Notifications.Persistence/Migration/v0.26/01-alter-tables.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
-- Modify table emailnotifications: Remove the recipientid column | ||
ALTER TABLE notifications.emailnotifications | ||
DROP COLUMN IF EXISTS recipientid; | ||
|
||
-- Modify table smsnotifications: Add new columns recipientorgno and recipientnin | ||
ALTER TABLE notifications.emailnotifications | ||
ADD COLUMN IF NOT EXISTS recipientorgno text, | ||
ADD COLUMN IF NOT EXISTS recipientnin text; | ||
|
||
|
||
-- Modify table smsnotifications: Remove the recipientid column | ||
ALTER TABLE notifications.smsnotifications | ||
DROP COLUMN IF EXISTS recipientid; | ||
|
||
-- Modify table smsnotifications: Add new columns recipientorgno and recipientnin | ||
ALTER TABLE notifications.smsnotifications | ||
ADD COLUMN IF NOT EXISTS recipientorgno text, | ||
ADD COLUMN IF NOT EXISTS recipientnin text; |
3 changes: 3 additions & 0 deletions
3
src/Altinn.Notifications.Persistence/Migration/v0.26/02-alter-types.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
ALTER TYPE public.emailnotificationresulttype ADD VALUE IF NOT EXISTS 'Failed_RecipientReserved'; | ||
|
||
ALTER TYPE public.smsnotificationresulttype ADD VALUE IF NOT EXISTS 'Failed_Recipientreserved'; |
92 changes: 92 additions & 0 deletions
92
src/Altinn.Notifications.Persistence/Migration/v0.26/03-alter-procedures.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
drop procedure if exists notifications.insertemailnotification( | ||
IN _orderid uuid, | ||
IN _alternateid uuid, | ||
IN _recipientid text, | ||
IN _toaddress text, | ||
IN _result text, | ||
IN _resulttime timestamp with time zone, | ||
IN _expirytime timestamp with time zone); | ||
|
||
drop procedure if exists notifications.insertsmsnotification( | ||
IN _orderid uuid, | ||
IN _alternateid uuid, | ||
IN _recipientid text, | ||
IN _mobilenumber text, | ||
IN _result text, | ||
IN _resulttime timestamp with time zone, | ||
IN _expirytime timestamp with time zone); | ||
|
||
|
||
CREATE OR REPLACE PROCEDURE notifications.insertemailnotification( | ||
_orderid uuid, | ||
_alternateid uuid, | ||
_recipientorgno TEXT, | ||
_recipientnin TEXT, | ||
_toaddress TEXT, | ||
_result text, | ||
_resulttime timestamptz, | ||
_expirytime timestamptz) | ||
LANGUAGE 'plpgsql' | ||
AS $BODY$ | ||
DECLARE | ||
__orderid BIGINT := (SELECT _id from notifications.orders | ||
where alternateid = _orderid); | ||
BEGIN | ||
|
||
INSERT INTO notifications.emailnotifications( | ||
_orderid, | ||
alternateid, | ||
recipientorgno, | ||
recipientnin, | ||
toaddress, result, | ||
resulttime, | ||
expirytime) | ||
VALUES ( | ||
__orderid, | ||
_alternateid, | ||
_recipientorgno, | ||
_recipientnin, | ||
_toaddress, | ||
_result::emailnotificationresulttype, | ||
_resulttime, | ||
_expirytime); | ||
END; | ||
$BODY$; | ||
|
||
|
||
CREATE OR REPLACE PROCEDURE notifications.insertsmsnotification( | ||
_orderid uuid, | ||
_alternateid uuid, | ||
_recipientorgno TEXT, | ||
_recipientnin TEXT, | ||
_mobilenumber TEXT, | ||
_result text, | ||
_resulttime timestamptz, | ||
_expirytime timestamptz) | ||
LANGUAGE 'plpgsql' | ||
AS $BODY$ | ||
DECLARE | ||
__orderid BIGINT := (SELECT _id from notifications.orders | ||
where alternateid = _orderid); | ||
BEGIN | ||
|
||
INSERT INTO notifications.smsnotifications( | ||
_orderid, | ||
alternateid, | ||
recipientorgno, | ||
recipientnin, | ||
mobilenumber, | ||
result, | ||
resulttime, | ||
expirytime) | ||
VALUES ( | ||
__orderid, | ||
_alternateid, | ||
_recipientorgno, | ||
_recipientnin, | ||
_mobilenumber, | ||
_result::smsnotificationresulttype, | ||
_resulttime, | ||
_expirytime); | ||
END; | ||
$BODY$; |
Oops, something went wrong.