Skip to content

Commit

Permalink
add post campaign fields to project mutation fragments and app models (
Browse files Browse the repository at this point in the history
  • Loading branch information
mtgriego authored Mar 4, 2024
1 parent 2e0818f commit 78f81ff
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
4 changes: 4 additions & 0 deletions app/src/main/graphql/fragments.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ fragment projectCard on Project {
state
stateChangedAt
url
isInPostCampaignPledgingPhase
postCampaignPledgingEnabled
}

# Fragment used to load all the Project information on Project Page
Expand Down Expand Up @@ -146,6 +148,8 @@ fragment fullProject on Project {
... environmentalCommitment
}
watchesCount
isInPostCampaignPledgingPhase
postCampaignPledgingEnabled
}

fragment backing on Backing {
Expand Down
18 changes: 14 additions & 4 deletions app/src/main/java/com/kickstarter/models/Project.kt
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@ class Project private constructor(
private val risks: String?,
private val story: String?,
private val isFlagged: Boolean?,
private val watchesCount: Int
private val watchesCount: Int,
private val isInPostCampaignPledgingPhase: Boolean? = null,
private val postCampaignPledgingEnabled: Boolean? = null
) : Parcelable, Relay {
fun availableCardTypes() = this.availableCardTypes
fun backersCount() = this.backersCount
Expand Down Expand Up @@ -121,6 +123,8 @@ class Project private constructor(
fun story() = this.story
fun isFlagged() = this.isFlagged
fun watchesCount() = this.watchesCount
fun isInPostCampaignPledgingPhase() = this.isInPostCampaignPledgingPhase
fun postCampaignPledgingEnabled() = this.postCampaignPledgingEnabled

@Parcelize
data class Builder(
Expand Down Expand Up @@ -178,7 +182,9 @@ class Project private constructor(
private var risks: String? = "",
private var story: String? = "",
private var isFlagged: Boolean? = null,
private var watchesCount: Int = 0
private var watchesCount: Int = 0,
private var isInPostCampaignPledgingPhase: Boolean? = null,
private var postCampaignPledgingEnabled: Boolean? = null
) : Parcelable {
fun availableCardTypes(availableCardTypes: List<String>?) = apply { this.availableCardTypes = availableCardTypes }
fun backersCount(backersCount: Int?) = apply { this.backersCount = backersCount ?: 0 }
Expand Down Expand Up @@ -288,7 +294,9 @@ class Project private constructor(
risks = risks,
story = story,
isFlagged = isFlagged,
watchesCount = watchesCount
watchesCount = watchesCount,
isInPostCampaignPledgingPhase = isInPostCampaignPledgingPhase,
postCampaignPledgingEnabled = postCampaignPledgingEnabled
)
}

Expand Down Expand Up @@ -346,7 +354,9 @@ class Project private constructor(
risks = risks,
story = story,
isFlagged = isFlagged,
watchesCount = watchesCount
watchesCount = watchesCount,
isInPostCampaignPledgingPhase = isInPostCampaignPledgingPhase,
postCampaignPledgingEnabled = postCampaignPledgingEnabled
)

@kotlin.annotation.Retention(AnnotationRetention.SOURCE)
Expand Down

0 comments on commit 78f81ff

Please sign in to comment.