
--SessionId created from one IP do not accept from another IP
--Check for duplicate partner sessionId(User wise unique)
CREATE TABLE TBL_REMIT_INBOUND_LOG
(
	RowId BIGINT NOT NULL IDENTITY(1, 1) PRIMARY KEY
	, SessionIdentifier VARCHAR(40) NULL
	, ProcessIdentifier VARCHAR(40) NULL
	, RequestedBy VARCHAR(80) NOT NULL
	, RequestedDate DATETIME DEFAULT(GETDATE()) NOT NULL
	, MethodName VARCHAR(50) NOT NULL
	, IpAddress VARCHAR(20) NOT NULL
	, PartnerSessionId VARCHAR(40) NULL
	, RequestJson NVARCHAR(MAX) NOT NULL
	, ResponseJson NVARCHAR(MAX) NULL
	, ResponseCode VARCHAR(5) NULL
	, ResponseMessage NVARCHAR(500) NULL
);

CREATE TABLE TBL_USER_SESSION
(
	RowId BIGINT NOT NULL IDENTITY(1, 1)
	, UserId INT NOT NULL
	, SessionIdentifier VARCHAR(40) NOT NULL
	, IpAddress VARCHAR(20) NOT NULL
	, CreatedDate DATETIME DEFAULT(GETDATE()) NOT NULL
	, ExpiryDate DATETIME NOT NULL
	, IsExpired BIT NOT NULL DEFAULT(0)
);


select dbo.decryptDb(pwd),* from applicationUsers 

SELECT GETDATE()


SELECT * FROM TBL_REMIT_INBOUND_LOG
SELECT * FROM TBL_USER_SESSION
select * from logdb.dbo.TBL_REMIT_INBOUND_LOG where processidentifier='880dd244-1709-46a0-8499-6d6631d88bed'



EXEC PROC_REMIT_INBOUND_LOGS @Flag = 'U-LOG' @ResponseCode= '101', @ResponseMessage = 'Password can not be empty.', @RowId = '4'


