Skip to content
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

address typings improvements #385

Merged
merged 1 commit into from
Dec 18, 2023
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion typings/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ declare namespace MangoPay {
}

class Address extends EntityBase<address.AddressData> {
constructor(data: Partial<address.AddressData>);
constructor(data: Partial<address.AddressData> | address.CreateAddress);
}

interface Address extends address.AddressData {
Expand Down
26 changes: 1 addition & 25 deletions typings/mangopay2-nodejs-sdk-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,6 @@ const legalUser = new api.models.UserLegal({
PostalCode: "20007",
Country: "US"
}),
LegalRepresentativeAddress: new api.models.Address({
AddressLine1: "4101 Reservoir Rd NW",
AddressLine2: "",
City: "Washington",
Region: "District of Columbia",
PostalCode: "20007",
Country: "US"
}),
LegalRepresentativeBirthday: 1300186358,
LegalRepresentativeNationality: "FR",
LegalRepresentativeCountryOfResidence: "FR",
Expand Down Expand Up @@ -179,15 +171,7 @@ const userLegalPayer = new api.models.UserLegalPayer({
LegalPersonType: "BUSINESS",
LegalRepresentativeFirstName: "Mango",
LegalRepresentativeLastName: "Pay",
LegalRepresentativeEmail: "[email protected]",
LegalRepresentativeAddress: new api.models.Address({
AddressLine1: "4101 Reservoir Rd NW",
AddressLine2: "",
City: "Washington",
Region: "District of Columbia",
PostalCode: "20007",
Country: "US"
})
LegalRepresentativeEmail: "[email protected]"
});

api.Users.create(userLegalPayer,
Expand All @@ -212,14 +196,6 @@ const userLegalOwner = new api.models.UserLegalOwner({
PostalCode: "20007",
Country: "US"
}),
LegalRepresentativeAddress: new api.models.Address({
AddressLine1: "4101 Reservoir Rd NW",
AddressLine2: "",
City: "Washington",
Region: "District of Columbia",
PostalCode: "20007",
Country: "US"
}),
LegalRepresentativeBirthday: 1300186358,
LegalRepresentativeNationality: "FR",
LegalRepresentativeCountryOfResidence: "FR",
Expand Down
2 changes: 1 addition & 1 deletion typings/models.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export namespace Models {
}

class Address extends EntityBase<address.AddressData> {
constructor(data: Partial<address.AddressData>);
constructor(data: Partial<address.AddressData> | address.CreateAddress);
}

class BankAccountDetails {
Expand Down
4 changes: 2 additions & 2 deletions typings/models/address.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { CountryISO } from "../types";
import { Models } from "../models";

export namespace address {
type AddressType = string | AddressData | Models.Address;
type AddressType = string | AddressData | Models.Address | CreateAddress;

interface AddressData {
/**
Expand Down Expand Up @@ -55,7 +55,7 @@ export namespace address {
/**
* The region of the address - this is optional except if the Country is US, CA or MX
*/
Region: string;
Region?: string;

/**
* The postal code of the address - can be alphanumeric, dashes or spaces
Expand Down
3 changes: 0 additions & 3 deletions typings/models/user.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ export namespace user {
| "LegalRepresentativeNationality"
| "LegalRepresentativeFirstName"
| "LegalRepresentativeLastName"
| "LegalRepresentativeAddress"
| "Email";

type RequiredUserNaturalData =
Expand Down Expand Up @@ -68,7 +67,6 @@ export namespace user {
type RequiredUserLegalPayerData =
| "LegalPersonType"
| "Name"
| "LegalRepresentativeAddress"
| "LegalRepresentativeFirstName"
| "LegalRepresentativeLastName"
| "Email";
Expand All @@ -77,7 +75,6 @@ export namespace user {
| "HeadquartersAddress"
| "LegalPersonType"
| "Name"
| "LegalRepresentativeAddress"
| "LegalRepresentativeBirthday"
| "LegalRepresentativeCountryOfResidence"
| "LegalRepresentativeNationality"
Expand Down
Loading