-
Notifications
You must be signed in to change notification settings - Fork 25
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
Migrate Addresses #653
base: master
Are you sure you want to change the base?
Migrate Addresses #653
Conversation
operations/addresses.md
Outdated
} | ||
``` | ||
|
||
| Property | Type | Contract | Description | | ||
| :-- | :-- | :-- | :-- | | ||
| `Addresses` | array of [Account address](#account-address) | required | The collection of Account addresses, containing address and account information. | | ||
| `Cursor` | string | required | Unique identifier of the last and hence oldest address item returned. This can be used in [Limitation](../guidelines/pagination.md#limitation) in a subsequent request to fetch the next batch of older Account address. | | ||
| `Addresses` | array of [Account address](addresses.md#account-address) | optional | The collection of Account addresses, containing address and account information. | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| `Addresses` | array of [Account address](addresses.md#account-address) | optional | The collection of Account addresses, containing address and account information. | | |
| `Addresses` | array of [Account address](addresses.md#account-address) | required | The collection of Account addresses, containing address and account information. | |
I would leave this required there, because it's returned every time.
operations/addresses.md
Outdated
| `City` | string | optional, max length 255 characters | The city. | | ||
| `PostalCode` | string | optional, max length 255 characters | Postal code. | | ||
| `CountryCode` | string | optional, max length 3 characters | ISO 3166-1 code of the [Country](countries.md#country). | | ||
| `CountrySubdivisionCode` | string | optional, max length 3 characters | ISO 3166-2 code of the administrative division, e.g. DE-BW. | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| `CountrySubdivisionCode` | string | optional, max length 3 characters | ISO 3166-2 code of the administrative division, e.g. DE-BW. | | |
| `CountrySubdivisionCode` | string | optional, max length 8 characters | ISO 3166-2 code of the administrative division, e.g. DE-BW. | |
It's 8 characters, not 3 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So in case of ISO 3166-2 you have 2 characters for country code, hyphen, and 3 characters for subdivision, so 6 characters in total.
However, I would consider dropping the MaxLength constraint altogether, the format of the field is defined by ISO standard and that can change.
operations/addresses.md
Outdated
| `Line2` | string | optional, max length 255 characters | Second line of the address. | | ||
| `City` | string | optional, max length 255 characters | The city. | | ||
| `PostalCode` | string | optional, max length 255 characters | Postal code. | | ||
| `CountryCode` | string | optional, max length 3 characters | ISO 3166-1 code of the [Country](countries.md#country). | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| `CountryCode` | string | optional, max length 3 characters | ISO 3166-1 code of the [Country](countries.md#country). | | |
| `CountryCode` | string | optional, max length 8 characters | ISO 3166-1 code of the [Country](countries.md#country). | |
It's 8 characters, not 3 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sure about that, @VBuben? To my knowledge ISO 3166-1 codes are up to 3 characters depending on whether you use alpha-2 or alpha-3 variant.
However, I would consider dropping the MaxLength constraint altogether, the format of the field is defined by ISO standard and that can change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm no expert, but according to Wikipedia there are three variants Alpha-2, Alpha-3 and Numeric, which are 2, 3 and 3 characters respectively. We should say which one we are using. I assume it's the most common Alpha-2, because the example is "CZ".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We use alpha-2 as is described in https://mews-systems.gitbook.io/connector-api/operations/countries section. Might be good to link to it from here. One more reason to do that is that we might not support all countries that are supported by the standard. That is definitely true for country subdivisions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah yes @jonas-paul, either link to it or better to just use the same description.
operations/addresses.md
Outdated
} | ||
``` | ||
|
||
| Property | Type | Contract | Description | | ||
| :-- | :-- | :-- | :-- | | ||
| `Addresses` | array of [Account address](#account-address) | required | Created addresses. | | ||
| `Addresses` | array of [Account address](addresses.md#account-address) | optional | The collection of Account addresses, containing address and account information. | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| `Addresses` | array of [Account address](addresses.md#account-address) | optional | The collection of Account addresses, containing address and account information. | | |
| `Addresses` | array of [Account address](addresses.md#account-address) | required | The collection of Account addresses, containing address and account information. | |
I would keep required here as well because in all cases you will get the collection.
operations/addresses.md
Outdated
} | ||
``` | ||
|
||
| Property | Type | Contract | Description | | ||
| :-- | :-- | :-- | :-- | | ||
| `Addresses` | array of [Account address](#account-address) | required | Created addresses. | | ||
| `Addresses` | array of [Account address](addresses.md#account-address) | optional | The collection of Account addresses, containing address and account information. | | ||
| `Cursor` | string | optional | Unique identifier of the last and hence oldest address item returned. This can be used in [Limitation](../guidelines/pagination.md#limitation) in a subsequent request to fetch the next batch of older Account address. | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's fix this, addresses/add
should not have Cursor
, because you don't iterate trough records, you are creating them 🚀.
| `PostalCode` | [String update value](_objects.md#string-update-value) | optional | Postal code. | | ||
| `CountryCode` | [String update value](_objects.md#string-update-value) | optional | ISO 3166-1 code of the [Country](countries.md#country). | | ||
| `CountrySubdivisionCode` | [String update value](_objects.md#string-update-value) | optional | ISO 3166-2 code of the administrative division, e.g. `DE-BW`. | | ||
| `Line1` | [String update value](_objects.md#string-update-value) | optional, max length 255 characters | First line of the address. | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| `Line1` | [String update value](_objects.md#string-update-value) | optional, max length 255 characters | First line of the address. | | |
| `Line1` | [String update value](_objects.md#string-update-value) | optional, max length 1023 characters | First line of the address. | |
It seems like everywhere it's 1023
operations/addresses.md
Outdated
| `PostalCode` | [String update value](_objects.md#string-update-value) | optional, max length 255 characters | Postal code. | | ||
| `CountryCode` | [String update value](_objects.md#string-update-value) | optional, max length 8 characters | ISO 3166-1 code of the Country. | | ||
| `CountrySubdivisionCode` | [String update value](_objects.md#string-update-value) | optional, max length 8 characters | ISO 3166-2 code of the administrative division, e.g. DE-BW. | | ||
| ~~`AccountId`~~ | ~~string~~ | ~~required~~ | **Deprecated!** The value is ignored.| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand why this value was not deleted, since the usage of it was removed 🤯
I think we can just remove it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, or hide it with InternalImplementation for starters.
operations/addresses.md
Outdated
} | ||
``` | ||
|
||
| Property | Type | Contract | Description | | ||
| :-- | :-- | :-- | :-- | | ||
| `Addresses` | array of [Account address](#account-address) | required | Updated addresses. | | ||
| `Addresses` | array of [Account address](addresses.md#account-address) | optional | The collection of Account addresses, containing address and account information. | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| `Addresses` | array of [Account address](addresses.md#account-address) | optional | The collection of Account addresses, containing address and account information. | | |
| `Addresses` | array of [Account address](addresses.md#account-address) | require | The collection of Account addresses, containing address and account information. | |
Same here as on comments above.
operations/addresses.md
Outdated
| `Line2` | string | optional, max length 255 characters | Second line of the address. | | ||
| `City` | string | optional, max length 255 characters | The city. | | ||
| `PostalCode` | string | optional, max length 255 characters | Postal code. | | ||
| `CountryCode` | string | optional, max length 3 characters | ISO 3166-1 code of the [Country](countries.md#country). | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sure about that, @VBuben? To my knowledge ISO 3166-1 codes are up to 3 characters depending on whether you use alpha-2 or alpha-3 variant.
However, I would consider dropping the MaxLength constraint altogether, the format of the field is defined by ISO standard and that can change.
operations/addresses.md
Outdated
| `City` | string | optional, max length 255 characters | The city. | | ||
| `PostalCode` | string | optional, max length 255 characters | Postal code. | | ||
| `CountryCode` | string | optional, max length 3 characters | ISO 3166-1 code of the [Country](countries.md#country). | | ||
| `CountrySubdivisionCode` | string | optional, max length 3 characters | ISO 3166-2 code of the administrative division, e.g. DE-BW. | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So in case of ISO 3166-2 you have 2 characters for country code, hyphen, and 3 characters for subdivision, so 6 characters in total.
However, I would consider dropping the MaxLength constraint altogether, the format of the field is defined by ISO standard and that can change.
operations/addresses.md
Outdated
| `CountryCode` | string | optional, max length 8 characters | ISO 3166-1 code of the Country. | | ||
| `CountrySubdivisionCode` | string | optional, max length 8 characters | ISO 3166-2 code of the administrative division, e.g. DE-BW. | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comments as above apply here.
operations/addresses.md
Outdated
| `PostalCode` | [String update value](_objects.md#string-update-value) | optional, max length 255 characters | Postal code. | | ||
| `CountryCode` | [String update value](_objects.md#string-update-value) | optional, max length 8 characters | ISO 3166-1 code of the Country. | | ||
| `CountrySubdivisionCode` | [String update value](_objects.md#string-update-value) | optional, max length 8 characters | ISO 3166-2 code of the administrative division, e.g. DE-BW. | | ||
| ~~`AccountId`~~ | ~~string~~ | ~~required~~ | **Deprecated!** The value is ignored.| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, or hide it with InternalImplementation for starters.
…rameters CountryCode and CountrySubDivision, make Addressresult.Addresses required)
operations/addresses.md
Outdated
| `Line2` | string | optional, max length 255 characters | Second line of the address. | | ||
| `City` | string | optional, max length 255 characters | The city. | | ||
| `PostalCode` | string | optional, max length 255 characters | Postal code. | | ||
| `CountryCode` | string | optional, max length 3 characters | ISO 3166-1 code of the [Country](countries.md#country). | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm no expert, but according to Wikipedia there are three variants Alpha-2, Alpha-3 and Numeric, which are 2, 3 and 3 characters respectively. We should say which one we are using. I assume it's the most common Alpha-2, because the example is "CZ".
file: _objects.md | ||
file: vouchers.md |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a bug in generator, unit behaves strangely since it's a named type but doesn't have any properties, so for some reason the generator always overrides it. 🤔
@@ -77,7 +77,7 @@ Note this operation uses [Pagination](../guidelines/pagination.md) and supports | |||
| Property | Type | Contract | Description | | |||
| :-- | :-- | :-- | :-- | | |||
| `Addresses` | array of [Account address](addresses.md#account-address) | required | The collection of Account addresses, containing address and account information. | | |||
| `Cursor` | string | optional | Unique identifier of the last and hence oldest address item returned. This can be used in [Limitation](../guidelines/pagination.md#limitation) in a subsequent request to fetch the next batch of older Account address. | | |||
| `Cursor` | string | required | Unique identifier of the last and hence oldest address item returned. This can be used in Limitation in a subsequent request to fetch the next batch of older Account address. | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
issue: Cursor should not be required, no idea how this got here. 🤔
Summary
Follow style guide
https://mews.atlassian.net/browse/CON-2195 Migrate Addresses
Check during review