moneyhub / moneyhub-api-client

Node.JS Client for the Moneyhub API
10 stars 7 forks source link

WellKnownConnection AccountTypes Missing "Cash" #59

Closed ThatOneAwkwardGuy closed 1 year ago

ThatOneAwkwardGuy commented 1 year ago

Hi, it appears that the AccountTypes string union is missing the value "cash".

interface AccountType {
    beta: boolean;
    name: "cash:current" | "savings" | "card" | "investment" | "loan" | "mortgage:repayment" | "mortgage:interestOnly" | "pension" | "pension:definedBenefit" | "pension:definedContribution" | "asset" | "properties:residential" | "properties:buyToLet" | "crypto";
}

If you go here: https://admin-portal-api.moneyhub.co.uk/providers?countries=GB you'll see that Monzo, for example, has an account type that is just "cash"

lsparey commented 1 year ago

This should match the type coming from the accounts endpoint https://api.moneyhub.co.uk/docs/#/accounts/get_accounts which includes the account subtype

ThatOneAwkwardGuy commented 1 year ago

sorry im slightly confused.

The listConnections function returns the type WellKnownConnection[]. WellKnownConnection uses the AccountType type to define the accountTypes attribute

export interface WellKnownConnection {
    id: string;
    name: string;
    type: ConnectionType;
    country: string;
    parentRef: string;
    bankRef: string;
    isBeta: boolean;
    accountTypes: AccountType[];
    iconUrl: string;
    userTypes: UserType[];
    payments: Payments[];
    status: {
        sync: Status;
        auth: Status;
    };
}

Are you saying that the type is correct but the data returned is wrong?

lsparey commented 1 year ago

I see what you mean now. It looks like that's not quite the right type for the WellKnownConnection endpoint accountTypes