Issue 70: Country list should be redefined and repopulated
Status:  Fixed
Owner: ----
Closed:  Aug 2008
Reported by edmundo...@gmail.com, Mar 30, 2008
Here I will not post a patch as I don't have sure what is better or more
correct, but I found some errors in the country list, and as I understood
its not populated exactly with countries but with "Fedex destinations"

In first place I think its a little difficult to define what a country is,
a good resource is wikipedia, http://en.wikipedia.org/wiki/List_of_countries

Some problems found:

Records:
Azores is not a country.
What is Ascension?
U.S.S.R, no comments :)
British Forces Post Office?
Czech Republic two times.
A lot of destinations with the number_of_orders already filled where it
should be zero.

Some of these are not visible because the code filters records that doesn't
have a "fedex_code".

Table structure:
Theres no such a thing as "fedex_code", these are IATA country codes.
What is a ufsi_code?

Anyway I think it should be discussed before be fixed.

Regards.
Mar 30, 2008
#1 edmundo...@gmail.com
Ok. About the fedex code. The ISO home page says that: "Federal Express uses IATA
country codes, which are those of ISO 3166-1, to help their customers track shipments
they made with FedEx."

So, we can follow an ISO standard :)

Follows a link to the official ISO list of country codes.
http://www.iso.org/iso/country_codes/iso_3166_code_lists.htm


Apr 9, 2008
Project Member #2 subim...@gmail.com
:)

'ufsi_code' was originally used to interface with a fulfillment house. This can be dropped.

I'm all for moving towards the ISO country code list. Patch away and I'll get it rolling.
Status: Accepted
Labels: -Priority-Medium Priority-Low
Apr 9, 2008
#3 edmundo...@gmail.com
ok. But this one I will need to make a migration, I will see how the rest of the
issues behaves before change this.
Apr 20, 2008
#4 edmundo...@gmail.com
Here it goes, a patch to the country list.

I don't like the way _address.rhtml is being used by more than one controller,
normally those partials go into the shared folder. Anyway I didn't changed its place.

Take a look how it was done.

I added a rank column to be able to put desired countries at the top of the select
list, I added a boolean is_obsolete column too to distinguish obsolete contries.

The checkout action will use the list without the obsolete values, so it doens't
allow those values to be chosen. But those values can be associated with old orders
or even the home country, so the preferences and orders actions from the
administrative interface uses a complete list including obsolete values.

To new deployed systems the two lists will be the same, anyway I think really should
exist the possibility to obsolete some things and hold them to have history, a good
example is exactly the country list, it will ever change.

Removed the columns ufsi_code and number_of_orders that aren't used (number_of_orders
is calculated using a select count statement, its not maintained in this column).

Follows a migration too.
country_list.patch
53.7 KB   View   Download
002_update_countries.rb
11.3 KB   View   Download
Aug 11, 2008
Project Member #5 subim...@gmail.com
Patch looks good in the code, but running it I get a "malformed patch" error.

Anyone know how to fix this, or perhaps can you reapply your changes to the trunk?
Labels: -Priority-Low Priority-Medium
Aug 14, 2008
#6 edmundo...@gmail.com
The only problem that I found is that I patched the fixture file including a
number_of_orders field (but this field, the rake task delete), I get rid of those
lines in the attached file.

(Then the same thing must be done with the fixture used in tests), then it depends if
you have already patched  issue 8  or not, just get rif of the "number_of_orders: 0" lines.

For me the patch apply clean in r116.
country_list_v2.patch
51.8 KB   View   Download

0 bytes   Download
Aug 14, 2008
#7 edmundo...@gmail.com
Here goes another patch for a little problem visible using tests, I missed a place
referencing the old fedex_code field.
dont_reference_fedex_code.patch
783 bytes   View   Download
Aug 15, 2008
Project Member #8 subim...@gmail.com
Thanks, fixed in r120

Had to manually patch the test fixture a little, but no big deal.
Status: Fixed