Skip to content

incorrect typedef for account.create profile #119

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
90 changes: 87 additions & 3 deletions lib/accounts.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { check, checkString } from "./helpers/checks.js";
import { Err } from "./helpers/errors.js";

import { Address } from "./address.js";
import { Err } from "./helpers/errors.js";

/** @external Promise */

Expand Down Expand Up @@ -91,7 +92,7 @@ import { Address } from "./address.js";
/**
* @typedef AccountCreate
* @property {"individual"|"business"} accountType - Type of entity represented by this account
* @property {Profile} profile - Details for individual or business
* @property {ProfileCreate} profile - Details for individual or business
* @property {object} metadata - Arbitrary key-value pairs
* @property {TermsOfServiceToken|null} termsOfService - An encrypted value used to record acceptance of Moov's Terms of Service
* @property {string} foreignID - Optional identification or alias
Expand Down Expand Up @@ -258,6 +259,43 @@ import { Address } from "./address.js";
* @tag Accounts
*/

/**
* Profile for a Moov acocunt. May be business or individual.
* @typedef ProfileCreate
* @property {BusinessProfileCreate} business - A business account
* @property {IndividualProfileCreate} individual - An individual account
* @tag Accounts
*/

/**
* Describes a business account.
* @typedef BusinessProfileCreate
* @property {string} legalBusinessName - Business's legal name
* @property {string} doingBusinessAs - Business's trade name (if different than the legal name)
* @property {"soleProprietorship"|"unincorporatedAssociation"|"trust"|"publicCorporation"|"privateCorporation"|"privateCorporation"|"llc"|"partnership"|"unincorporatedNonProfit"|"incorporatedNonProfit"} businessType - The legal registered type of the business
* @property {Address} address - Business's address
* @property {Phone} phone - Business's phone number
* @property {string} email - Business's email
* @property {string} website - Business's website
* @property {string} description - Description of the business
* @property {TaxID} taxID - An EIN (employer identification number) for the business. For sole proprietors, an SSN can be used as the EIN.
* @property {IndustryCodes} industryCodes - Business's industry code (for example, `mcc`)
* @property {PrimaryRegulator} [primaryRegulator] - If the business is a financial institution, this field describes its primary regulator. (for example, `OCC`)
* @tag Accounts
*/

/**
* Describes the individual associated with a non-business account.
* @typedef IndividualProfileCreate
* @property {Name} name - Individual's name
* @property {Phone} phone - Individual's phone number
* @property {string} email - Individual's email address
* @property {Address} address - Individual's address
* @property {IndividualBirthDate} birthDate - Individual's birth date
* @property {IndividualGovernmentID} governmentID - Government-issued ID for the business
* @tag Accounts
*/

/**
* @typedef Phone
* @property {string} number - Phone number
Expand All @@ -274,6 +312,52 @@ import { Address } from "./address.js";
* @tag Accounts
*/

/**
* Primary regulators for a financial institution.
* @typedef {"OCC"|"FDIC"|"NCUA"|"FRB"} PrimaryRegulator
* @tag Accounts
*/

/**
* Describes a business account's tax identification number.
* @typedef TaxID
* @property {EIN} ein - Business's EIN (Employer Identification Number)
* @tag Accounts
*/

/**
* Describes a business account's tax identification number.
* @typedef EIN
* @property {string} number - EIN (Employer Identification Number)
* @tag Accounts
*/

/**
* Describes a Individual's birth date.
* @typedef IndividualBirthDate
* @property {number} day - 1 or 2 digit day of birth
* @property {number} month - 1 or 2 digit month of birth
* @property {number} year - 4 digit year of birth
*
* @tag Accounts
*/

/**
* Describes a Individual's government ID.
* @typedef IndividualGovernmentID
* @property {GovernmentID} ssn - Individual's Social Security Number
* @property {GovernmentID} itin - Individual's International Taxpayer Identification Number
* @tag Accounts
*/

/**
* Describes a Government ID number.
* @typedef GovernmentID
* @property {string} full - Full government ID number
* @property {string} lastFour - Last four digits of government ID number
* @tag Accounts
*/

/**
* Describes an individual who represents a business account.
* @typedef Representative
Expand Down Expand Up @@ -378,7 +462,7 @@ export class Accounts {
/**
* Retrieves details for the list of accounts.
* The `ACCOUNTS_READ` scope enum is required when making a request from the browser.
*
*
* @param {string} accountID - Account to query
* @param {AccountListCriteria} criteria - Optional criteria to limit the list returned.
* @returns {Promise<Account[]>}
Expand Down