Skip to content

Commit

Permalink
feat: consider subscription_status for sync validity and trial handli…
Browse files Browse the repository at this point in the history
…ng (#14789)

Co-authored-by: Joey Marshment-Howell <[email protected]>
Co-authored-by: josephkmh <[email protected]>
  • Loading branch information
3 people committed Dec 17, 2024
1 parent c8a0419 commit 235018e
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 22 deletions.
23 changes: 12 additions & 11 deletions airbyte-api/problems-api/src/main/openapi/api-problems.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -732,7 +732,7 @@ components:
title:
type: string
default: A subscription is required for this operation to succeed.
BillingInsufficientPaymentStatusProblemResponse:
BillingInvalidStatusProblemResponse:
x-implements: io.airbyte.api.problems.ProblemResponse
type: object
allOf:
Expand All @@ -749,7 +749,7 @@ components:
type: string
default: The payment status of the associated Organization is insufficient.
data:
$ref: "#/components/schemas/BillingInsufficientPaymentStatusProblemData"
$ref: "#/components/schemas/BillingInvalidStatusProblemData"
BillingInsufficientCreditBalanceProblemResponse:
x-implements: io.airbyte.api.problems.ProblemResponse
type: object
Expand Down Expand Up @@ -991,18 +991,13 @@ components:
type: integer
message:
type: string
BillingInsufficientPaymentStatusProblemData:
BillingInvalidStatusProblemData:
type: object
required:
- requiredStatuses
- currentStatus
properties:
validPaymentStatuses:
type: array
items:
$ref: "#/components/schemas/PaymentStatusEnum"
currentPaymentStatus:
invalidPaymentStatus:
$ref: "#/components/schemas/PaymentStatusEnum"
invalidSubscriptionStatus:
$ref: "#/components/schemas/SubscriptionStatusEnum"
PaymentStatusEnum:
type: string
enum:
Expand All @@ -1012,6 +1007,12 @@ components:
- disabled
- locked
- manual
SubscriptionStatusEnum:
type: string
enum:
- pre_subscription
- subscribed
- unsubscribed
BillingInsufficientCreditBalanceProblemData:
type: object
required:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,10 +159,8 @@ open class OrganizationServiceImpl(
logger.info {
"Organization $organizationId successfully updated from $currentSubscriptionStatus to ${orgPaymentConfig.subscriptionStatus}"
}
// TODO uncomment this once subscription support is finalized - we do not want to shut down connections until
// sync validation takes subscription status into account.
// disableAllConnections(organizationId, ConnectionAutoDisabledReason.UNSUBSCRIBED)
// logger.info { "Successfully disabled all syncs for unsubscribed organization $organizationId" }
disableAllConnections(organizationId, ConnectionAutoDisabledReason.UNSUBSCRIBED)
logger.info { "Successfully disabled all syncs for unsubscribed organization $organizationId" }
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -248,13 +248,12 @@ class OrganizationServiceTest {
slotConfig.captured.subscriptionStatus shouldBe SubscriptionStatus.UNSUBSCRIBED
verify { organizationPaymentConfigRepository.savePaymentConfig(orgPaymentConfig) }

// TODO uncomment this once connection disabling is enabled
// verify {
// connectionService.disableConnections(
// setOf(connectionId1, connectionId2),
// ConnectionAutoDisabledReason.UNSUBSCRIBED,
// )
// }
verify {
connectionService.disableConnections(
setOf(connectionId1, connectionId2),
ConnectionAutoDisabledReason.UNSUBSCRIBED,
)
}
}
}
}

0 comments on commit 235018e

Please sign in to comment.