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

Migrate Addresses #653

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open

Migrate Addresses #653

wants to merge 8 commits into from

Conversation

RobBeck1
Copy link
Contributor

Summary

Follow style guide

https://mews.atlassian.net/browse/CON-2195 Migrate Addresses

Check during review

  • The changelog and potentially a deprecation entries are in place.
    • The changelog timestamp is date of merge to develop.
  • JSON example extended.
    • New properties are added to the correct place in the JSON.
  • New properties in the table are added to the correct place.
  • Correct formatting:
    • Spacing is consistent between titles, sections, tables, ...
    • Correct JSON format - indentation.
  • DateTime properties should always be defined in ISO format.

@RobBeck1 RobBeck1 added Generator Pull requests related to reference documentation generator con.connectivity labels Sep 16, 2024
@RobBeck1 RobBeck1 self-assigned this Sep 16, 2024
@RobBeck1 RobBeck1 requested review from a team as code owners September 16, 2024 14:32
}
```

| 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. |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
| `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.

| `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. |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
| `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 👍

Copy link
Member

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.

| `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). |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
| `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 👍

Copy link
Member

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.

Copy link
Contributor

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".

Copy link
Contributor

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.

Copy link
Contributor

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.

}
```

| 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. |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
| `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.

}
```

| 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. |
Copy link
Contributor

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. |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
| `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

| `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.|
Copy link
Contributor

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.

Copy link
Member

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.

}
```

| 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. |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
| `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.

| `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). |
Copy link
Member

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.

| `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. |
Copy link
Member

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.

Comment on lines 148 to 149
| `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. |
Copy link
Member

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.

| `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.|
Copy link
Member

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)
| `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). |
Copy link
Contributor

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did this change?

Copy link
Member

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. |
Copy link
Member

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. 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
con.connectivity Generator Pull requests related to reference documentation generator
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants