Skip to content

Commit 1a149e5

Browse files
fix: [GTM-1239]: Subscription MAUs and Number of Developers Reversed (#34269)
* [GTM-1192]: Use ModuleType for subscription price endpoint * [GTM-1239]: Subscription number of developers and MAUs reversed
1 parent 526486b commit 1a149e5

File tree

4 files changed

+13
-11
lines changed

4 files changed

+13
-11
lines changed

925-subscription-service/src/main/java/io/harness/subscription/resource/SubscriptionResource.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ public class SubscriptionResource {
9999
public ResponseDTO<PriceCollectionDTO>
100100
retrieveProductPrices(@Parameter(required = true, description = ACCOUNT_PARAM_MESSAGE) @NotNull @QueryParam(
101101
NGCommonEntityConstants.ACCOUNT_KEY) @AccountIdentifier String accountIdentifier,
102-
@Parameter(required = true, description = "Module Type") @NotNull @QueryParam("moduleType") String moduleType) {
102+
@Parameter(required = true, description = "Module Type") @NotNull @QueryParam("moduleType") ModuleType moduleType) {
103103
return ResponseDTO.newResponse(subscriptionService.listPrices(accountIdentifier, moduleType));
104104
}
105105

925-subscription-service/src/main/java/io/harness/subscription/services/SubscriptionService.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
import java.util.List;
2121

2222
public interface SubscriptionService {
23-
PriceCollectionDTO listPrices(String accountIdentifier, String module);
23+
PriceCollectionDTO listPrices(String accountIdentifier, ModuleType moduleType);
2424
InvoiceDetailDTO previewInvoice(String accountIdentifier, SubscriptionDTO subscriptionDTO);
2525

2626
SubscriptionDetailDTO createSubscription(String accountIdentifier, SubscriptionDTO subscriptionDTO);
@@ -35,7 +35,6 @@ SubscriptionDetailDTO updateSubscription(
3535
CustomerDetailDTO createStripeCustomer(String accountIdentifier, CustomerDTO customerDTO);
3636
CustomerDetailDTO updateStripeCustomer(String accountIdentifier, String customerId, CustomerDTO customerDTO);
3737
CustomerDetailDTO getStripeCustomer(String accountIdentifier, String customerId);
38-
// List<CustomerDetailDTO> listStripeCustomers(String accountIdentifier);
3938

4039
PaymentMethodCollectionDTO listPaymentMethods(String accountIdentifier, String customerId);
4140

925-subscription-service/src/main/java/io/harness/subscription/services/impl/SubscriptionServiceImpl.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,12 @@ public SubscriptionServiceImpl(StripeHelper stripeHelper, StripeCustomerReposito
7070
}
7171

7272
@Override
73-
public PriceCollectionDTO listPrices(String accountIdentifier, String module) {
73+
public PriceCollectionDTO listPrices(String accountIdentifier, ModuleType module) {
7474
isSelfServiceEnable(accountIdentifier);
7575

7676
List<String> prices;
7777

78-
switch (module) {
78+
switch (module.toString()) {
7979
case "CI":
8080
prices = Arrays.asList(Prices.CI_PRICES);
8181
break;
@@ -145,12 +145,12 @@ public InvoiceDetailDTO createFfSubscription(String accountIdentifier, FfSubscri
145145

146146
val developerPriceId = stripeHelper.getPrice(
147147
Prices.getLookupKey("FF", subscriptionDTO.getEdition(), "DEVELOPERS", subscriptionDTO.getPaymentFreq()));
148-
subscriptionItems.add(new ItemParams(developerPriceId.getId(), (long) subscriptionDTO.getNumberOfMau(),
148+
subscriptionItems.add(new ItemParams(developerPriceId.getId(), (long) subscriptionDTO.getNumberOfDevelopers(),
149149
Prices.getLookupKey("FF", subscriptionDTO.getEdition(), "DEVELOPERS", subscriptionDTO.getPaymentFreq())));
150150

151151
val mauPriceId = stripeHelper.getPrice(
152152
Prices.getLookupKey("FF", subscriptionDTO.getEdition(), "MAU", subscriptionDTO.getPaymentFreq()));
153-
subscriptionItems.add(new ItemParams(mauPriceId.getId(), (long) subscriptionDTO.getNumberOfDevelopers(),
153+
subscriptionItems.add(new ItemParams(mauPriceId.getId(), (long) subscriptionDTO.getNumberOfMau(),
154154
Prices.getLookupKey("FF", subscriptionDTO.getEdition(), "MAU", subscriptionDTO.getPaymentFreq())));
155155

156156
if (subscriptionDTO.isPremiumSupport()) {

950-subscription-beans/src/main/java/io/harness/subscription/constant/Prices.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,17 @@
88
package io.harness.subscription.constant;
99

1010
public class Prices {
11+
public static final String PREMIUM_SUPPORT = "PREMIUM_SUPPORT";
1112
public static final String[] CD_PRICES = new String[] {"CD_ENTERPRISE_SERVICE_MONTHLY",
12-
"CD_ENTERPRISE_SERVICE_YEARLY", "CD_ENTERPRISE_PREMIUM_SUPPORT_MONTHLY", "CD_ENTERPRISE_PREMIUM_SUPPORT_YEARLY"};
13+
"CD_ENTERPRISE_SERVICE_YEARLY", "CD_ENTERPRISE_PREMIUM_SUPPORT_MONTHLY", "CD_ENTERPRISE_PREMIUM_SUPPORT_YEARLY",
14+
PREMIUM_SUPPORT};
1315
public static final String[] CI_PRICES = new String[] {"CI_ENTERPRISE_DEVELOPERS_MONTHLY",
14-
"CI_ENTERPRISE_DEVELOPERS_YEARLY", "CI_TEAM_DEVELOPERS_MONTHLY", "CI_TEAM_DEVELOPERS_YEARLY"};
16+
"CI_ENTERPRISE_DEVELOPERS_YEARLY", "CI_TEAM_DEVELOPERS_MONTHLY", "CI_TEAM_DEVELOPERS_YEARLY",
17+
PREMIUM_SUPPORT};
1518
public static final String[] FF_PRICES = new String[] {"FF_ENTERPRISE_DEVELOPERS_MONTHLY",
1619
"FF_ENTERPRISE_DEVELOPERS_YEARLY", "FF_TEAM_DEVELOPERS_MONTHLY", "FF_TEAM_DEVELOPERS_YEARLY",
17-
"FF_ENTERPRISE_MAU_MONTHLY", "FF_ENTERPRISE_MAU_YEARLY", "FF_TEAM_MAU_MONTHLY", "FF_TEAM_MAU_YEARLY"};
18-
public static final String PREMIUM_SUPPORT = "PREMIUM_SUPPORT";
20+
"FF_ENTERPRISE_MAU_MONTHLY", "FF_ENTERPRISE_MAU_YEARLY", "FF_TEAM_MAU_MONTHLY", "FF_TEAM_MAU_YEARLY",
21+
PREMIUM_SUPPORT};
1922
public static String getLookupKey(String module, String edition, String product, String paymentFrequency) {
2023
return module.toUpperCase().trim() + "_" + edition.toUpperCase().trim() + "_" + product.toUpperCase().trim() + "_"
2124
+ paymentFrequency.toUpperCase().trim();

0 commit comments

Comments
 (0)