Skip to content

Commit

Permalink
Data mapper subscription phase and price order item stripe object add…
Browse files Browse the repository at this point in the history
…itions (#581)

* added `price order item` and `subscription phase` sections to mapper

* removed `activeSection` tracked var for each stripe object and moved to a getter

* clean up based on TODO comments

* updated formatted fields test class to match new parsed phase object

* updates based on PR comments

* last updates based on pr comments

* moved metadatafields string to const per PR comment

* added `price order item` and `subscription phase` sections to mapper

* removed `activeSection` tracked var for each stripe object and moved to a getter

* clean up based on TODO comments

* updates based on PR comments

* duplication fix
  • Loading branch information
arnoldezeolisa authored Sep 20, 2022
1 parent b2f46ff commit e13aff9
Show file tree
Hide file tree
Showing 4 changed files with 192 additions and 262 deletions.
3 changes: 3 additions & 0 deletions sfdx/force-app/main/default/classes/setupAssistant.cls
Original file line number Diff line number Diff line change
Expand Up @@ -227,8 +227,11 @@ public with sharing class setupAssistant {
rd.put('formattedStripeCustomerFields', (List<Object>)responseBody.get('formattedStripeCustomerFields'));
rd.put('formattedStripeProductItemFields', (List<Object>)responseBody.get('formattedStripeProductItemFields'));
rd.put('formattedStripeSubscriptionFields', (List<Object>)responseBody.get('formattedStripeSubscriptionFields'));
rd.put('formattedStripeSubscriptionSchedulePhaseFields', (List<Object>)responseBody.get('formattedStripeSubscriptionSchedulePhaseFields'));
rd.put('formattedStripeSubscriptionItemFields', (List<Object>)responseBody.get('formattedStripeSubscriptionItemFields'));
rd.put('formattedStripePriceFields', (List<Object>)responseBody.get('formattedStripePriceFields'));
rd.put('formattedStripePriceOrderItemFields', (List<Object>)responseBody.get('formattedStripePriceFields'));

} else {
errorLogger.create('getFormattedStripeObjectFields', String.valueOf(response.getStatusCode()), (String)response.getStatus(), 'Failed to get mapping configuration from ruby service.');
}
Expand Down
3 changes: 3 additions & 0 deletions sfdx/force-app/main/default/classes/test_setupAssistant.cls
Original file line number Diff line number Diff line change
Expand Up @@ -293,12 +293,14 @@ public with sharing class test_setupAssistant {
List<Object> testCustomerFields = (List<Object>)resultsMap.get('formattedStripeCustomerFields');
List<Object> testProductFields = (List<Object>)resultsMap.get('formattedStripeProductItemFields');
List<Object> testSubscriptionFields = (List<Object>)resultsMap.get('formattedStripeSubscriptionFields');
List<Object> testSubscriptionPhaseFields = (List<Object>)resultsMap.get('formattedStripeSubscriptionSchedulePhaseFields');
List<Object> testSubscriptionItemFields = (List<Object>)resultsMap.get('formattedStripeSubscriptionItemFields');
List<Object> testPriceFields = (List<Object>)resultsMap.get('formattedStripePriceFields');

System.assertEquals(5, testCustomerFields.size());
System.assertEquals(5, testProductFields.size());
System.assertEquals(5, testSubscriptionFields.size());
System.assertEquals(5, testSubscriptionPhaseFields.size());
System.assertEquals(5, testSubscriptionItemFields.size());
System.assertEquals(5, testPriceFields.size());
}
Expand Down Expand Up @@ -642,6 +644,7 @@ public with sharing class test_setupAssistant {
responseBody.put('formattedStripeProductItemFields', (Object)testFormattedFieldsList);
responseBody.put('formattedStripeSubscriptionFields', (Object)testFormattedFieldsList);
responseBody.put('formattedStripeSubscriptionItemFields', (Object)testFormattedFieldsList);
responseBody.put('formattedStripeSubscriptionSchedulePhaseFields', (Object)testFormattedFieldsList);
responseBody.put('formattedStripePriceFields', (Object)testFormattedFieldsList);
res.setBody(Json.serialize(responseBody));
res.setStatusCode(200);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@
<lightning-vertical-navigation selected-item={activeObject} onselect={changeActiveObject} >
<lightning-vertical-navigation-section label="Stripe Objects">
<lightning-vertical-navigation-item label="Customer" name="customer"></lightning-vertical-navigation-item>
<lightning-vertical-navigation-item label="Subscription" name="subscription"></lightning-vertical-navigation-item>
<lightning-vertical-navigation-item label="Subscription Item" name="subscription-item"></lightning-vertical-navigation-item>
<lightning-vertical-navigation-item label="Subscription Schedule" name="subscriptionSchedule"></lightning-vertical-navigation-item>
<lightning-vertical-navigation-item label="Subscription Phase" name="subscriptionPhase"></lightning-vertical-navigation-item>
<lightning-vertical-navigation-item label="Subscription Item" name="subscriptionItem"></lightning-vertical-navigation-item>
<lightning-vertical-navigation-item label="Product" name="product"></lightning-vertical-navigation-item>
<lightning-vertical-navigation-item label="Price" name="price"></lightning-vertical-navigation-item>
<lightning-vertical-navigation-item label="Price Order Line" name="priceOrderItem"></lightning-vertical-navigation-item>
</lightning-vertical-navigation-section>
</lightning-vertical-navigation>
</div>
Expand Down
Loading

0 comments on commit e13aff9

Please sign in to comment.