Skip to content

Commit

Permalink
Fix breaking GQL changes
Browse files Browse the repository at this point in the history
  • Loading branch information
StylianosGakis committed Oct 12, 2023
1 parent 17b06ff commit 6480006
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,7 @@ fragment ContractFragment on Contract {
masterInceptionDate
terminationDate
exposureDisplayName
supportsAddressChange
upcomingRenewal {
renewalDate
}
supportsMoving
currentAgreement {
...AgreementFragment
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ query GetUpcomingRenewalReminder {
displayName
}
}
upcomingRenewal {
renewalDate
draftCertificateUrl
upcomingChangedAgreement {
activeFrom
certificateUrl
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
mutation MemberDeviceRegister($token: String!) {
memberDeviceRegister(input: {type: "ANDROID", token: $token})
memberDeviceRegister(input: {platform: ANDROID, token: $token})
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ private fun ContractFragment.toContract(isTerminated: Boolean = false): Insuranc
displayName = currentAgreement.productVariant.displayName,
exposureDisplayName = exposureDisplayName,
inceptionDate = masterInceptionDate,
renewalDate = upcomingRenewal.renewalDate,
renewalDate = upcomingChangedAgreement?.activeFrom,
terminationDate = terminationDate,
currentAgreement = Agreement(
activeFrom = currentAgreement.activeFrom,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,12 @@ internal class GetUpcomingRenewalRemindersUseCaseImpl(
.activeContracts

val upcomingRenewals: NonEmptyList<UpcomingRenewal>? = contracts
.map { contract ->
.mapNotNull { contract ->
val upcomingChangedAgreement = contract.upcomingChangedAgreement ?: return@mapNotNull null
UpcomingRenewal(
contract.currentAgreement.productVariant.displayName,
contract.upcomingRenewal.renewalDate,
contract.upcomingRenewal.draftCertificateUrl,
upcomingChangedAgreement.activeFrom,
upcomingChangedAgreement.certificateUrl,
)
}
.filter { upcomingRenewal ->
Expand Down

0 comments on commit 6480006

Please sign in to comment.