@@ -4,9 +4,13 @@ import org.joda.time.DateTime
4
4
import play .api .libs .functional .syntax ._
5
5
import play .api .libs .json ._
6
6
7
- case class PullRequest (id : Long , title : String , description : String , author : String ,
7
+ case class PullRequest (id : Long , title : String , description : String ,
8
+ authorUsername : String , authorAvatar : String ,
8
9
state : String , created_on : DateTime , updated_on : DateTime ,
9
- destBranch : String , destCommit : String )
10
+ sourceRepository : String , sourceBranch : String , sourceCommit : String ,
11
+ destRepository : String , destBranch : String , destCommit : String ) {
12
+ val url : String = s " https://bitbucket.org/ $destRepository/pull-request/ $id"
13
+ }
10
14
11
15
object PullRequest {
12
16
val dateFormat = " yyyy-MM-dd'T'HH:mm:ss.SSSSSSZZ"
@@ -17,9 +21,14 @@ object PullRequest {
17
21
(__ \ " title" ).read[String ] and
18
22
(__ \ " description" ).read[String ] and
19
23
(__ \ " author" \ " username" ).read[String ] and
24
+ (__ \ " author" \ " links" \ " avatar" ).read[String ] and
20
25
(__ \ " state" ).read[String ] and
21
26
(__ \ " created_on" ).read[DateTime ] and
22
27
(__ \ " updated_on" ).read[DateTime ] and
28
+ (__ \ " source" \ " repository" \ " full_name" ).read[String ] and
29
+ (__ \ " source" \ " branch" \ " name" ).read[String ] and
30
+ (__ \ " source" \ " commit" \ " hash" ).read[String ] and
31
+ (__ \ " destination" \ " repository" \ " full_name" ).read[String ] and
23
32
(__ \ " destination" \ " branch" \ " name" ).read[String ] and
24
33
(__ \ " destination" \ " commit" \ " hash" ).read[String ]
25
34
)(PullRequest .apply _)
0 commit comments