From 912c6793fd1bb480140829e6bc905bf6b3a96073 Mon Sep 17 00:00:00 2001 From: Camille <25295489+Campalo@users.noreply.github.com> Date: Wed, 13 Sep 2023 09:30:29 +0200 Subject: [PATCH] Dev-78 Remove planCopy from subscriptionPlans (#408) * Remove copy properties from SubscriptionPlans query * Increase version and update changelog * Revert renaming subtitle --- CHANGELOG.md | 4 ++ lib/graphql/schema.flow.js | 96 +++++++++++++++++------------- lib/graphql/schema.ts | 93 +++++++++++++++++------------ lib/graphql/subscription.ts | 10 ---- package.json | 2 +- tests/graphql/subscription.spec.ts | 13 ---- 6 files changed, 113 insertions(+), 105 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f93938a7..1ce45049 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +## [0.50.0] - 2023-09-12 +## Removed +- Removed `title, description, button, featuresToggleLabel, FeaturesGroups` from the `subscriptionPlans` query + ## [0.49.0] - 2023-01-31 ## Added - Updated types in schema diff --git a/lib/graphql/schema.flow.js b/lib/graphql/schema.flow.js index ad80bf6d..c2c4cf25 100644 --- a/lib/graphql/schema.flow.js +++ b/lib/graphql/schema.flow.js @@ -186,6 +186,14 @@ export const ActionReasonValues = Object.freeze({ export type ActionReason = $Values; +export type AddressInput = {| + city: $ElementType, + country: $ElementType, + postCode: $ElementType, + streetName: $ElementType, + streetNumber: $ElementType, +|}; + export type Asset = {| __typename?: 'Asset', assetableId: $ElementType, @@ -292,6 +300,14 @@ export type BusinessAddress = {| street: $ElementType, |}; +export type BusinessAddressInput = {| + city: $ElementType, + country: $ElementType, + postCode: $ElementType, + streetName: $ElementType, + streetNumber: $ElementType, +|}; + export type BusinessAssetForm = {| assetClass: $ElementType, assetType: AssetType, @@ -603,9 +619,10 @@ export const CompanyTypeValues = Object.freeze({ export type CompanyType = $Values; export type ConfirmChangeRequestArgs = {| + authorizationToken?: ?$ElementType, changeRequestId: $ElementType, deviceId: $ElementType, - signature: $ElementType, + signature?: ?$ElementType, |}; export type ConfirmChangeRequestResponse = {| @@ -1366,8 +1383,6 @@ export type Mutation = {| /** Send Lead data to designated Zap to redirect lead to Agreas */ agerasLeadRedirect: MutationResult, approveDeclaration: DeclarationApproval, - /** Assign a secret coupon code to the user who is rejected from kontax onboarding */ - assignKontaxCouponCodeToDeclinedUser: MutationResult, authorizeChangeRequest: AuthorizeChangeRequestResponse, /** Cancel an existing Timed Order or Standing Order */ cancelTransfer: ConfirmationRequestOrTransfer, @@ -1383,8 +1398,6 @@ export type Mutation = {| changeCardPINWithChangeRequest: ConfirmationRequest, /** Block or unblock or close a card */ changeCardStatus: Card, - /** Clear preselected plan */ - clearPreselectedPlan: MutationResult, /** Confirm a Standing Order cancellation */ confirmCancelTransfer: Transfer, /** Confirms adding card to Apple/Google Pay wallet */ @@ -1515,7 +1528,7 @@ export type Mutation = {| updateOverdraft?: ?Overdraft, updateReview: MutationResult, /** Update user fields on solaris */ - updateSolarisUser: AuthorizeChangeRequestResponse, + updateSolarisUser: UserOrAuthResponse, /** Update user's subscription plan */ updateSubscriptionPlan: UpdateSubscriptionPlanResult, /** Updates user's taxNumber */ @@ -1651,9 +1664,10 @@ export type MutationConfirmChangeCardPinArgs = {| export type MutationConfirmChangeRequestArgs = {| + authorizationToken?: ?$ElementType, changeRequestId: $ElementType, deviceId: $ElementType, - signature: $ElementType, + signature?: ?$ElementType, |}; @@ -2053,6 +2067,7 @@ export type MutationUpdateReviewArgs = {| export type MutationUpdateSolarisUserArgs = {| + deliveryMethod?: ?DeliveryMethod, deviceId: $ElementType, payload: UpdateSolarisUserInput, |}; @@ -2156,44 +2171,13 @@ export type MutationResult = {| /** NACE codes */ export type NaceCode = {| __typename?: 'NACECode', - code: NaceCodeEnum, + code: $ElementType, deDescription: $ElementType, enDescription: $ElementType, + id: $ElementType, + priority: $ElementType, |}; -export const NaceCodeEnumValues = Object.freeze({ - A: 'A', - C: 'C', - F: 'F', - G: 'G', - H: 'H', - I: 'I', - J: 'J', - J_62_01: 'J_62_01', - K: 'K', - L: 'L', - M_69: 'M_69', - M_70_1: 'M_70_1', - M_70_2: 'M_70_2', - M_71: 'M_71', - M_72: 'M_72', - M_73: 'M_73', - M_74_1: 'M_74_1', - M_74_9: 'M_74_9', - N_79: 'N_79', - N_81: 'N_81', - N_82: 'N_82', - O: 'O', - P: 'P', - Q: 'Q', - R: 'R', - R_90: 'R_90', - S: 'S' -}); - - -export type NaceCodeEnum = $Values; - export const NationalityValues = Object.freeze({ Ad: 'AD', Ae: 'AE', @@ -2575,6 +2559,7 @@ export const PurchaseTypeValues = Object.freeze({ Accounting: 'ACCOUNTING', Basic: 'BASIC', BasicInitial: 'BASIC_INITIAL', + BizTax: 'BIZ_TAX', Bookkeeping: 'BOOKKEEPING', Card: 'CARD', Kontax: 'KONTAX', @@ -2613,7 +2598,7 @@ export type PushProvisioningOutput = {| export type Query = {| __typename?: 'Query', - /** Get all existing DATEV Exports */ + /** Get all existing DATEV Exports requested by the user */ datevExports: Array, draftTransactions: Array, /** Get all released generic features, that are needed before user creation */ @@ -3784,7 +3769,16 @@ export type UpdateDraftTransactionInput = {| |}; export type UpdateSolarisUserInput = {| + address?: ?AddressInput, amlConfirmed?: ?$ElementType, + businessAddress?: ?BusinessAddressInput, + businessPurpose?: ?$ElementType, + businessTradingName?: ?$ElementType, + email?: ?$ElementType, + expectedMonthlyRevenueCents?: ?$ElementType, + naceCode?: ?$ElementType, + naceCodeId?: ?$ElementType, + websiteSocialMedia?: ?$ElementType, |}; export type UpdateSubscriptionPlanResult = {| @@ -3862,6 +3856,7 @@ export type User = {| banners?: ?Array, birthDate?: ?$ElementType, birthPlace?: ?$ElementType, + businessAddress?: ?UserBusinessAddress, /** User's business addresses */ businessAddresses: Array, /** Return a business asset by id */ @@ -3893,6 +3888,7 @@ export type User = {| emailDocument: EmailDocument, emailDocuments: Array, euerDeclaration?: ?TaxDeclaration, + expectedMonthlyRevenueCents?: ?$ElementType, /** Active user features */ features: Array<$ElementType>, fibuFinalCheckTasks?: ?Array, @@ -3931,6 +3927,7 @@ export type User = {| missingBusinessTaxNumberNote?: ?$ElementType, missingPersonalTaxNumberNote?: ?$ElementType, mobileNumber?: ?$ElementType, + naceCodeId?: ?$ElementType, nationality?: ?Nationality, /** All push-notification types and their state */ notifications: Array, @@ -3984,6 +3981,7 @@ export type User = {| vatNumber?: ?$ElementType, vatPaymentFrequency?: ?PaymentFrequency, vatRate?: ?UserVatRate, + websiteSocialMedia?: ?$ElementType, workAsHandyman?: ?$ElementType, |}; @@ -4102,6 +4100,16 @@ export type UserVatAnnualDeclarationArgs = {| year: $ElementType, |}; +/** Business Address of a User */ +export type UserBusinessAddress = {| + __typename?: 'UserBusinessAddress', + city: $ElementType, + country: $ElementType, + id: $ElementType, + postCode: $ElementType, + street: $ElementType, +|}; + export const UserConfirmationValues = Object.freeze({ AdvisorDocumentsUploaded: 'ADVISOR_DOCUMENTS_UPLOADED', ManualDocumentsUploaded: 'MANUAL_DOCUMENTS_UPLOADED', @@ -4193,6 +4201,8 @@ export type UserMetadata = {| taxAdvisoryTermsVersionAccepted: $ElementType, |}; +export type UserOrAuthResponse = AuthorizeThroughDeviceSigningOrMobileNumberResponse | User; + export type UserProductInput = {| description?: ?$ElementType, id?: ?$ElementType, @@ -4280,6 +4290,8 @@ export type UserUpdateInput = {| /** Indicates user has accepted Kontist direct debit mandate */ directDebitMandateAccepted?: ?$ElementType, economicSector?: ?$ElementType, + /** Expected monthly revenue in euro cents */ + expectedMonthlyRevenueCents?: ?$ElementType, firstName?: ?$ElementType, gender?: ?Gender, hasEmployees?: ?$ElementType, diff --git a/lib/graphql/schema.ts b/lib/graphql/schema.ts index c1c6e70a..bb9240b3 100644 --- a/lib/graphql/schema.ts +++ b/lib/graphql/schema.ts @@ -183,6 +183,14 @@ export enum ActionReason { WrongTaxrateAncillaryService = 'WRONG_TAXRATE_ANCILLARY_SERVICE' } +export type AddressInput = { + city: Scalars['String']; + country: Scalars['String']; + postCode: Scalars['String']; + streetName: Scalars['String']; + streetNumber: Scalars['String']; +}; + export type Asset = { __typename?: 'Asset'; assetableId: Scalars['ID']; @@ -277,6 +285,14 @@ export type BusinessAddress = { street: Scalars['String']; }; +export type BusinessAddressInput = { + city: Scalars['String']; + country: Scalars['String']; + postCode: Scalars['String']; + streetName: Scalars['String']; + streetNumber: Scalars['String']; +}; + export type BusinessAssetForm = { assetClass: Scalars['String']; assetType: AssetType; @@ -567,9 +583,10 @@ export enum CompanyType { } export type ConfirmChangeRequestArgs = { + authorizationToken?: InputMaybe; changeRequestId: Scalars['String']; deviceId: Scalars['String']; - signature: Scalars['String']; + signature?: InputMaybe; }; export type ConfirmChangeRequestResponse = { @@ -1261,8 +1278,6 @@ export type Mutation = { /** Send Lead data to designated Zap to redirect lead to Agreas */ agerasLeadRedirect: MutationResult; approveDeclaration: DeclarationApproval; - /** Assign a secret coupon code to the user who is rejected from kontax onboarding */ - assignKontaxCouponCodeToDeclinedUser: MutationResult; authorizeChangeRequest: AuthorizeChangeRequestResponse; /** Cancel an existing Timed Order or Standing Order */ cancelTransfer: ConfirmationRequestOrTransfer; @@ -1281,8 +1296,6 @@ export type Mutation = { changeCardPINWithChangeRequest: ConfirmationRequest; /** Block or unblock or close a card */ changeCardStatus: Card; - /** Clear preselected plan */ - clearPreselectedPlan: MutationResult; /** Confirm a Standing Order cancellation */ confirmCancelTransfer: Transfer; /** Confirms adding card to Apple/Google Pay wallet */ @@ -1413,7 +1426,7 @@ export type Mutation = { updateOverdraft?: Maybe; updateReview: MutationResult; /** Update user fields on solaris */ - updateSolarisUser: AuthorizeChangeRequestResponse; + updateSolarisUser: UserOrAuthResponse; /** Update user's subscription plan */ updateSubscriptionPlan: UpdateSubscriptionPlanResult; /** Updates user's taxNumber */ @@ -1549,9 +1562,10 @@ export type MutationConfirmChangeCardPinArgs = { export type MutationConfirmChangeRequestArgs = { + authorizationToken?: InputMaybe; changeRequestId: Scalars['String']; deviceId: Scalars['String']; - signature: Scalars['String']; + signature?: InputMaybe; }; @@ -1951,6 +1965,7 @@ export type MutationUpdateReviewArgs = { export type MutationUpdateSolarisUserArgs = { + deliveryMethod?: InputMaybe; deviceId: Scalars['String']; payload: UpdateSolarisUserInput; }; @@ -2054,41 +2069,13 @@ export type MutationResult = { /** NACE codes */ export type NaceCode = { __typename?: 'NACECode'; - code: NaceCodeEnum; + code: Scalars['String']; deDescription: Scalars['String']; enDescription: Scalars['String']; + id: Scalars['Float']; + priority: Scalars['Boolean']; }; -export enum NaceCodeEnum { - A = 'A', - C = 'C', - F = 'F', - G = 'G', - H = 'H', - I = 'I', - J = 'J', - J_62_01 = 'J_62_01', - K = 'K', - L = 'L', - M_69 = 'M_69', - M_70_1 = 'M_70_1', - M_70_2 = 'M_70_2', - M_71 = 'M_71', - M_72 = 'M_72', - M_73 = 'M_73', - M_74_1 = 'M_74_1', - M_74_9 = 'M_74_9', - N_79 = 'N_79', - N_81 = 'N_81', - N_82 = 'N_82', - O = 'O', - P = 'P', - Q = 'Q', - R = 'R', - R_90 = 'R_90', - S = 'S' -} - export enum Nationality { Ad = 'AD', Ae = 'AE', @@ -2449,6 +2436,7 @@ export enum PurchaseType { Accounting = 'ACCOUNTING', Basic = 'BASIC', BasicInitial = 'BASIC_INITIAL', + BizTax = 'BIZ_TAX', Bookkeeping = 'BOOKKEEPING', Card = 'CARD', Kontax = 'KONTAX', @@ -2484,7 +2472,7 @@ export type PushProvisioningOutput = { export type Query = { __typename?: 'Query'; - /** Get all existing DATEV Exports */ + /** Get all existing DATEV Exports requested by the user */ datevExports: Array; draftTransactions: Array; /** Get all released generic features, that are needed before user creation */ @@ -3559,7 +3547,16 @@ export type UpdateDraftTransactionInput = { }; export type UpdateSolarisUserInput = { + address?: InputMaybe; amlConfirmed?: InputMaybe; + businessAddress?: InputMaybe; + businessPurpose?: InputMaybe; + businessTradingName?: InputMaybe; + email?: InputMaybe; + expectedMonthlyRevenueCents?: InputMaybe; + naceCode?: InputMaybe; + naceCodeId?: InputMaybe; + websiteSocialMedia?: InputMaybe; }; export type UpdateSubscriptionPlanResult = { @@ -3637,6 +3634,7 @@ export type User = { banners?: Maybe>; birthDate?: Maybe; birthPlace?: Maybe; + businessAddress?: Maybe; /** User's business addresses */ businessAddresses: Array; /** Return a business asset by id */ @@ -3670,6 +3668,7 @@ export type User = { emailDocument: EmailDocument; emailDocuments: Array; euerDeclaration?: Maybe; + expectedMonthlyRevenueCents?: Maybe; /** Active user features */ features: Array; fibuFinalCheckTasks?: Maybe>; @@ -3714,6 +3713,7 @@ export type User = { missingBusinessTaxNumberNote?: Maybe; missingPersonalTaxNumberNote?: Maybe; mobileNumber?: Maybe; + naceCodeId?: Maybe; nationality?: Maybe; /** All push-notification types and their state */ notifications: Array; @@ -3778,6 +3778,7 @@ export type User = { vatPaymentFrequency?: Maybe; /** @deprecated This field will be removed in an upcoming release and should now be queried from "viewer.taxDetails.vatRate" */ vatRate?: Maybe; + websiteSocialMedia?: Maybe; workAsHandyman?: Maybe; }; @@ -3896,6 +3897,16 @@ export type UserVatAnnualDeclarationArgs = { year: Scalars['Int']; }; +/** Business Address of a User */ +export type UserBusinessAddress = { + __typename?: 'UserBusinessAddress'; + city: Scalars['String']; + country: Scalars['String']; + id: Scalars['ID']; + postCode: Scalars['String']; + street: Scalars['String']; +}; + export enum UserConfirmation { AdvisorDocumentsUploaded = 'ADVISOR_DOCUMENTS_UPLOADED', ManualDocumentsUploaded = 'MANUAL_DOCUMENTS_UPLOADED', @@ -3981,6 +3992,8 @@ export type UserMetadata = { taxAdvisoryTermsVersionAccepted: Scalars['Boolean']; }; +export type UserOrAuthResponse = AuthorizeThroughDeviceSigningOrMobileNumberResponse | User; + export type UserProductInput = { description?: InputMaybe; id?: InputMaybe; @@ -4066,6 +4079,8 @@ export type UserUpdateInput = { /** Indicates user has accepted Kontist direct debit mandate */ directDebitMandateAccepted?: InputMaybe; economicSector?: InputMaybe; + /** Expected monthly revenue in euro cents */ + expectedMonthlyRevenueCents?: InputMaybe; firstName?: InputMaybe; gender?: InputMaybe; hasEmployees?: InputMaybe; diff --git a/lib/graphql/subscription.ts b/lib/graphql/subscription.ts index 6cd3352a..eca989b5 100644 --- a/lib/graphql/subscription.ts +++ b/lib/graphql/subscription.ts @@ -28,17 +28,7 @@ const FETCH_PLANS = `query fetchPlans ($couponCode: String) { couponValidFor plans { type - title - description subtitle - button - featuresToggleLabel - featureGroups { - title - features { - title - } - } fee { amount discountAmount diff --git a/package.json b/package.json index 538b789b..bdd6f643 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "kontist", - "version": "0.49.49", + "version": "0.50.0", "description": "Kontist client SDK", "main": "dist/lib/index.js", "types": "dist/lib/index.d.ts", diff --git a/tests/graphql/subscription.spec.ts b/tests/graphql/subscription.spec.ts index 7b9d7cc4..68706a4f 100644 --- a/tests/graphql/subscription.spec.ts +++ b/tests/graphql/subscription.spec.ts @@ -40,20 +40,7 @@ describe("Subscription", () => { const plans = [ { type: "BASIC", - title: "Free", - description: "All-round business banking with virtual card", subtitle: "/ month plus VAT for the first year, then much more expensive", - button: "Open Free", - featuresToggleLabel: "All Kontist Free features", - featureGroups: [ - { - title: null, - features: [ - { title: "Unlimited SEPA transfers" }, - { title: "Virtual Card" }, - ], - }, - ], fee: { amount: 0, fullAmount: null,