Problem
Right now, we pass in both the github api payload as well as a GithubComment into the changeset builder.
In reality, all we need is the GithubComment, since it contains the exact information we need to create a Comment.
- modify
Adapters.Comment.to_comment/1 to accept a GithubComment struct (we can use Map.from_struct/1 and MapUtils.keys_to_string/1 for adapting it
- modify
IssueComment.ChangesetBuilder.build_changeset/4 into build_changeset/3 by removing the payload attribute
This would simplify the code, and potentially allow us to decouple further in the future.
Problem
Right now, we pass in both the github api payload as well as a
GithubCommentinto the changeset builder.In reality, all we need is the
GithubComment, since it contains the exact information we need to create aComment.Adapters.Comment.to_comment/1to accept aGithubCommentstruct (we can useMap.from_struct/1andMapUtils.keys_to_string/1for adapting itIssueComment.ChangesetBuilder.build_changeset/4intobuild_changeset/3by removing thepayloadattributeThis would simplify the code, and potentially allow us to decouple further in the future.