-
Notifications
You must be signed in to change notification settings - Fork 276
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2,501 changed files
with
203,376 additions
and
165,539 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
Copyright (c) 2020-2024 Airbyte, Inc., all rights reserved. | ||
Copyright (c) 2020-2025 Airbyte, Inc., all rights reserved. |
100 changes: 100 additions & 0 deletions
100
airbyte-analytics/src/main/kotlin/io/airbyte/analytics/BillingTrackingHelper.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
package io.airbyte.analytics | ||
|
||
import io.airbyte.config.ScopeType | ||
import jakarta.inject.Singleton | ||
import java.util.UUID | ||
|
||
private const val ACTION_GRACE_PERIOD_STARTED = "grace_period_started" | ||
private const val ACTION_GRACE_PERIOD_ENDED = "grace_period_ended" | ||
private const val ACTION_GRACE_PERIOD_UPDATED = "grace_period_updated" | ||
private const val ACTION_GRACE_PERIOD_CANCELED = "grace_period_canceled" | ||
private const val ACTION_PAYMENT_SETUP_COMPLETED = "payment_setup_completed" | ||
private const val METADATA_GRACE_PERIOD_END_AT_SECONDS = "grace_period_end_at_seconds" | ||
private const val METADATA_REASON = "reason" | ||
private const val METADATA_PAYMENT_PROVIDER_ID = "payment_provider_id" | ||
|
||
/** | ||
* This helper provides convenience wrappers around the tracking client for billing-related events. | ||
*/ | ||
@Singleton | ||
class BillingTrackingHelper( | ||
private val trackingClient: TrackingClient, | ||
) { | ||
fun trackGracePeriodStarted( | ||
organizationId: UUID, | ||
paymentProviderId: String, | ||
gracePeriodEndAtSeconds: Long, | ||
reason: String, | ||
) { | ||
trackingClient.track( | ||
organizationId, | ||
ScopeType.ORGANIZATION, | ||
ACTION_GRACE_PERIOD_STARTED, | ||
mapOf( | ||
METADATA_PAYMENT_PROVIDER_ID to paymentProviderId, | ||
METADATA_GRACE_PERIOD_END_AT_SECONDS to gracePeriodEndAtSeconds.toString(), | ||
METADATA_REASON to reason, | ||
), | ||
) | ||
} | ||
|
||
fun trackGracePeriodEnded( | ||
organizationId: UUID, | ||
paymentProviderId: String, | ||
) { | ||
trackingClient.track( | ||
organizationId, | ||
ScopeType.ORGANIZATION, | ||
ACTION_GRACE_PERIOD_ENDED, | ||
mapOf( | ||
METADATA_PAYMENT_PROVIDER_ID to paymentProviderId, | ||
), | ||
) | ||
} | ||
|
||
fun trackGracePeriodUpdated( | ||
organizationId: UUID, | ||
paymentProviderId: String, | ||
gracePeriodEndAtSeconds: Long, | ||
) { | ||
trackingClient.track( | ||
organizationId, | ||
ScopeType.ORGANIZATION, | ||
ACTION_GRACE_PERIOD_UPDATED, | ||
mapOf( | ||
METADATA_PAYMENT_PROVIDER_ID to paymentProviderId, | ||
METADATA_GRACE_PERIOD_END_AT_SECONDS to gracePeriodEndAtSeconds.toString(), | ||
), | ||
) | ||
} | ||
|
||
fun trackGracePeriodCanceled( | ||
organizationId: UUID, | ||
paymentProviderId: String, | ||
reason: String, | ||
) { | ||
trackingClient.track( | ||
organizationId, | ||
ScopeType.ORGANIZATION, | ||
ACTION_GRACE_PERIOD_CANCELED, | ||
mapOf( | ||
METADATA_PAYMENT_PROVIDER_ID to paymentProviderId, | ||
METADATA_REASON to reason, | ||
), | ||
) | ||
} | ||
|
||
fun trackPaymentSetupCompleted( | ||
organizationId: UUID, | ||
paymentProviderId: String, | ||
) { | ||
trackingClient.track( | ||
organizationId, | ||
ScopeType.ORGANIZATION, | ||
ACTION_PAYMENT_SETUP_COMPLETED, | ||
mapOf( | ||
METADATA_PAYMENT_PROVIDER_ID to paymentProviderId, | ||
), | ||
) | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
airbyte-analytics/src/main/kotlin/io/airbyte/analytics/TrackingClient.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...yte-analytics/src/test/kotlin/io/airbyte/analytics/BlockingShutdownAnalyticsPluginTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
airbyte-analytics/src/test/kotlin/io/airbyte/analytics/DeploymentFetcherTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
airbyte-analytics/src/test/kotlin/io/airbyte/analytics/SegmentAnalyticsClientTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
airbyte-analytics/src/test/kotlin/io/airbyte/analytics/SegmentTrackingClientTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
airbyte-analytics/src/test/kotlin/io/airbyte/analytics/TrackingIdentityFetcherTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
airbyte-api/commons/src/main/kotlin/io/airbyte/api/client/ThrowOn5xxInterceptor.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
airbyte-api/commons/src/main/kotlin/io/airbyte/api/client/UserAgentInterceptor.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
airbyte-api/commons/src/main/kotlin/io/airbyte/api/client/auth/AirbyteApiInterceptor.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
airbyte-api/commons/src/main/kotlin/io/airbyte/api/client/auth/AirbyteAuthHeader.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...te-api/commons/src/main/kotlin/io/airbyte/api/client/auth/AirbyteAuthHeaderInterceptor.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...te-api/commons/src/main/kotlin/io/airbyte/api/client/config/ClientConfigurationSupport.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.