Skip to content

Commit

Permalink
fix!: inconsistent pluralisation on type prefixes (#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeymike authored Aug 9, 2024
1 parent 8ceeeb9 commit 247873e
Show file tree
Hide file tree
Showing 22 changed files with 463 additions and 398 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

Check our main [developer changelog](https://developer.paddle.com/?utm_source=dx&utm_medium=paddle-go-sdk) for information about changes to the Paddle Billing platform, the Paddle API, and other developer tools.

## 0.7.0 - 2024-08-09

### Changed

- Consistency to naming where some occurrences of pluralised prefixes where the pattern is to be singular see [UPGRADING](./UPGRADING.md) for details
- Post consistency fixes to some type names that conflicted, see [UPGRADING](./UPGRADING.md) for details

## 0.6.0 - 2024-08-07

### Changed
Expand Down
94 changes: 94 additions & 0 deletions UPGRADING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,100 @@

All breaking changes prior to v1 will be documented in this file to assist with upgrading.

## v0.7.0

1. This release brings consistency to naming. We had some occurrences of pluralised prefixes where the pattern is to be singular.

As these are changing type definitions you will need to refactor the usage of these types accordingly:

| Previous Type | New Type |
|----------------------------------------------------|---------------------------------------------------|
| `BusinessesContacts` | `BusinessContacts` |
| `NotificationsEvent` | `NotificationEvent` |
| `GenericNotificationsEvent` | `GenericNotificationEvent` |
| `ReportsStatus` | `ReportStatus` |
| `ReportsType` | `ReportType` |
| `ReportsFiltersName` | `ReportFiltersName` |
| `ReportsFiltersOperator` | `ReportFiltersOperator` |
| `ReportsFilters` | `ReportFilters` |
| `ReportTypeAdjustments` | `AdjustmentsReportType` |
| `FilterNameAdjustments` | `AdjustmentsReportFilterName` |
| `ReportFiltersAdjustments` | `AdjustmentsReportFilters` |
| `ReportTypeTransactions` | `TransactionsReportType` |
| `FilterNameTransactions` | `TransactionsReportFilterName` |
| `ReportFiltersTransactions` | `TransactionsReportFilters` |
| `ReportTypeProductsPrices` | `ProductsPricesReportType` |
| `FilterNameProductPrices` | `ProductPricesReportFilterName` |
| `ReportFiltersProductPrices` | `ProductPricesReportFilters` |
| `ReportTypeDiscounts` | `DiscountsReportType` |
| `FilterNameDiscounts` | `DiscountsReportFilterName` |
| `ReportFiltersDiscounts` | `DiscountsReportFilters` |
| `SubscriptionsTransactionLineItemPreview` | `SubscriptionTransactionLineItemPreview` |
| `SubscriptionsTaxRatesUsed` | `TaxRatesUsed` |
| `SubscriptionsAdjustmentItem` | `SubscriptionsAdjustmentItem` |
| `SubscriptionsUpdateCatalogItem` | `SubscriptionUpdateCatalogItem` |
| `SubscriptionsCatalogItem` | `SubscriptionCatalogItem` |
| `SubscriptionsNonCatalogPriceForAnExistingProduct` | `SubscriptionNonCatalogPriceForAnExistingProduct` |
| `SubscriptionsNonCatalogPriceAndProduct` | `SubscriptionNonCatalogPriceAndProduct` |
| `AdjustmentsTotalsBreakdown` | `AdjustmentTotalsBreakdown` |
| `AdjustmentsTotals` | `TransactionAdjustmentTotals` |
| `TransactionsCatalogItem` | `TransactionCatalogItem` |
| `TransactionsNonCatalogPriceForAnExistingProduct` | `TransactionNonCatalogPriceForAnExistingProduct` |
| `TransactionsNonCatalogPriceAndProduct` | `TransactionNonCatalogPriceAndProduct` |
| `TransactionsTransactionsCheckout` | `TransactionCheckout` |


Some types were enumerations using constants and therefore the following constants are renamed too, below is a note of the prefix changes:

| Previous Constant Prefix | New Constant Prefix |
|----------------------------|---------------------------------|
| `ReportsStatus` | `ReportStatus` |
| `ReportsType` | `ReportType` |
| `ReportsFiltersName` | `ReportFiltersName` |
| `ReportsFiltersOperator` | `ReportFiltersOperator` |
| `ReportTypeAdjustments` | `AdjustmentsReportType` |
| `FilterNameAdjustments` | `AdjustmentsReportFilterName` |
| `ReportTypeTransactions` | `TransactionsReportType` |
| `FilterNameTransactions` | `TransactionsReportFilterName` |
| `ReportTypeProductsPrices` | `ProductsPricesReportType` |
| `FilterNameProductPrices` | `ProductPricesReportFilterName` |
| `ReportTypeDiscounts` | `DiscountsReportType` |
| `FilterNameDiscounts` | `DiscountsReportFilterName` |


Some types were used as part of a union and therefore the following functions are renamed too:

| Previous Function | New Function |
|---------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------|
| `NewCreateSubscriptionChargeItemsSubscriptionsCatalogItem` | `NewCreateSubscriptionChargeItemsSubscriptionCatalogItem` |
| `NewCreateSubscriptionChargeItemsSubscriptionsNonCatalogPriceForAnExistingProduct` | `NewCreateSubscriptionChargeItemsSubscriptionNonCatalogPriceForAnExistingProduct` |
| `NewCreateSubscriptionChargeItemsSubscriptionsNonCatalogPriceAndProduct` | `NewCreateSubscriptionChargeItemsSubscriptionNonCatalogPriceAndProduct` |
| `NewPreviewSubscriptionChargeItemsSubscriptionsCatalogItem` | `NewPreviewSubscriptionChargeItemsSubscriptionCatalogItem` |
| `NewPreviewSubscriptionChargeItemsSubscriptionsNonCatalogPriceForAnExistingProduct` | `NewPreviewSubscriptionChargeItemsSubscriptionNonCatalogPriceForAnExistingProduct` |
| `NewPreviewSubscriptionChargeItemsSubscriptionsNonCatalogPriceAndProduct` | `NewPreviewSubscriptionChargeItemsSubscriptionNonCatalogPriceAndProduct` |
| `NewTransactionPreviewByAddressItemsTransactionsCatalogItem` | `NewTransactionPreviewByAddressItemsTransactionCatalogItem` |
| `NewTransactionPreviewByAddressItemsTransactionsNonCatalogPriceForAnExistingProduct` | `NewTransactionPreviewByAddressItemsTransactionNonCatalogPriceForAnExistingProduct` |
| `NewTransactionPreviewByAddressItemsTransactionsNonCatalogPriceAndProduct` | `NewTransactionPreviewByAddressItemsTransactionNonCatalogPriceAndProduct` |
| `NewTransactionPreviewByIPItemsTransactionsCatalogItem` | `NewTransactionPreviewByIPItemsTransactionCatalogItem` |
| `NewTransactionPreviewByIPItemsTransactionsNonCatalogPriceForAnExistingProduct` | `NewTransactionPreviewByIPItemsTransactionNonCatalogPriceForAnExistingProduct` |
| `NewTransactionPreviewByIPItemsTransactionsNonCatalogPriceAndProduct` | `NewTransactionPreviewByIPItemsTransactionNonCatalogPriceAndProduct` |
| `NewTransactionPreviewByCustomerItemsTransactionsCatalogItem` | `NewTransactionPreviewByCustomerItemsTransactionCatalogItem` |
| `NewTransactionPreviewByCustomerItemsTransactionsNonCatalogPriceForAnExistingProduct` | `NewTransactionPreviewByCustomerItemsTransactionNonCatalogPriceForAnExistingProduct` |
| `NewTransactionPreviewByCustomerItemsTransactionsNonCatalogPriceAndProduct` | `NewTransactionPreviewByCustomerItemsTransactionNonCatalogPriceAndProduct` |


2.The consistency change of pluralised prefixes highlighted conflicting type names for `SubscriptionDiscount` and `Checkout`.

This has resulted in some type changes

| Previous Type | New Type |
|-------------------------|-------------------------------------|
| `SubscriptionDiscount` | `SubscriptionDiscountTimePeriod` |
| `SubscriptionsDiscount` | `SubscriptionDiscountEffectiveFrom` |
| `Checkout` | `TransactionCheckout` |
| `TransactionsCheckout` | `TransactionCheckout` |


## v0.6.0

1. This update makes a significant change to the way the SDK works with the [Reports API](https://developer.paddle.com/api-reference/reports/overview)
Expand Down
8 changes: 4 additions & 4 deletions businesses.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion internal/client/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v0.6.0
0.7.0
6 changes: 3 additions & 3 deletions notifications.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pkg/paddleerr/paddleerr.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions pkg/paddlenotification/addresses.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pkg/paddlenotification/adjustments.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions pkg/paddlenotification/businesses.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions pkg/paddlenotification/customers.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions pkg/paddlenotification/discounts.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions pkg/paddlenotification/notification.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pkg/paddlenotification/payouts.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions pkg/paddlenotification/prices.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions pkg/paddlenotification/products.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 247873e

Please sign in to comment.