From dce3ad94d31bfec185be4520bb6265e961bd095c Mon Sep 17 00:00:00 2001 From: marcos314 Date: Wed, 19 Jul 2023 11:38:51 -0300 Subject: [PATCH 1/2] feat(tap-suiteql): Create new stream billingaccount and add new columns to SubscriptionPriceInterval stream --- README.md | 1 + tap_suiteql/streams.py | 12 ++++++++++++ tap_suiteql/tap.py | 2 ++ 3 files changed, 15 insertions(+) diff --git a/README.md b/README.md index 9103568..a6569cd 100644 --- a/README.md +++ b/README.md @@ -120,6 +120,7 @@ We extract the following entities with its respective method * MonthlyRecurringRevenue -> static * Charge -> dynamically * CustomRecordGpyChangeOrderClassific -> dynamically +* BilligAccount -> dynamically ### SDK Dev Guide diff --git a/tap_suiteql/streams.py b/tap_suiteql/streams.py index 3b2c9dc..3f97268 100644 --- a/tap_suiteql/streams.py +++ b/tap_suiteql/streams.py @@ -67,6 +67,9 @@ class SubscriptionPriceIntervalStream(suiteqlStream): th.Property("startoffsetvalue", th.StringType), th.Property("status", th.StringType), th.Property("subscription", th.StringType), + th.Property("discount", th.StringType), + th.Property("discountamount", th.StringType), + th.Property("discountpercent", th.StringType), ).to_dict() @@ -293,3 +296,12 @@ class CustomRecordGpyChangeOrderClassificStream(suiteqlStream): primary_keys = ["id"] skip_attributes = ["links"] replication_key = "lastmodified" + + +class BilligAccountStream(suiteqlStream): + name = "billingaccount" + path = "/query/v1/suiteql" + metadata_path = "/record/v1/metadata-catalog/billingaccount" + primary_keys = ["id"] + skip_attributes = ["links"] + replication_key = "lastmodifieddate" diff --git a/tap_suiteql/tap.py b/tap_suiteql/tap.py index 1245b99..1755cea 100644 --- a/tap_suiteql/tap.py +++ b/tap_suiteql/tap.py @@ -25,6 +25,7 @@ SubscriptionPlanStream, SubscriptionPriceIntervalStream, SubscriptionStream, + BilligAccountStream, ) STREAM_TYPES = { @@ -44,6 +45,7 @@ "SubscriptionChangeOrder": SubscriptionChangeOrderStream, "Item": ItemStream, "MonthlyRecurringRevenue": MonthlyRecurringRevenueStream, + "BilligAccount": BilligAccountStream, } From af0af9879a36ecfb7dc382da01c8541bb95ecf34 Mon Sep 17 00:00:00 2001 From: marcos314 Date: Wed, 19 Jul 2023 11:43:41 -0300 Subject: [PATCH 2/2] fix(tap-suiteql): Adjust order of imports --- tap_suiteql/tap.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tap_suiteql/tap.py b/tap_suiteql/tap.py index 1755cea..caa1a9b 100644 --- a/tap_suiteql/tap.py +++ b/tap_suiteql/tap.py @@ -9,6 +9,7 @@ from tap_suiteql.query_builder import QueryBuilder # JSON schema typing helpers from tap_suiteql.schema_builder import SchemaBuilder from tap_suiteql.streams import ( + BilligAccountStream, ChangeOrderLineStream, ChargeStream, CustomerPaymentStream, @@ -25,7 +26,6 @@ SubscriptionPlanStream, SubscriptionPriceIntervalStream, SubscriptionStream, - BilligAccountStream, ) STREAM_TYPES = {