/// <exception cref="ConnectionStringNotFoundException">Login connection string is not found</exception>
        /// <exception cref="DatabaseException">Error is occurred while saving data to database</exception>
        public async Task RecordMessagingEvent(string trackingId, bool isSuccessful, string code, string details = null, string payloadJson = null)
        {
            var loginDbConnectionString = await _csProvider.GetLoginDb();

            if (string.IsNullOrEmpty(loginDbConnectionString))
            {
                throw new ConnectionStringNotFoundException("Login connection string is not found");
            }

            await Exec(loginDbConnectionString, "sc_orchestration_record_messaging_event", p =>
            {
                p.AddWithValue("@tracking_id", trackingId);
                p.AddWithValue("@is_successful", isSuccessful);
                p.AddWithValue("@code", code);
                if (!string.IsNullOrEmpty(details))
                {
                    p.AddWithValue("@description", details);
                }
                if (!string.IsNullOrEmpty(payloadJson))
                {
                    p.AddWithValue("@payload", payloadJson);
                }
            });
        }