kylekthompson-shoppe 1.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -0
- data/README.md +55 -0
- data/Rakefile +36 -0
- data/app/assets/images/shoppe/chosen-sprite.png +0 -0
- data/app/assets/images/shoppe/chosen-sprite@2x.png +0 -0
- data/app/assets/images/shoppe/document.svg +1 -0
- data/app/assets/images/shoppe/icons/bag.svg +1 -0
- data/app/assets/images/shoppe/icons/balance.svg +1 -0
- data/app/assets/images/shoppe/icons/box.svg +1 -0
- data/app/assets/images/shoppe/icons/building.svg +1 -0
- data/app/assets/images/shoppe/icons/chart.svg +1 -0
- data/app/assets/images/shoppe/icons/chat.svg +1 -0
- data/app/assets/images/shoppe/icons/checkbox.svg +1 -0
- data/app/assets/images/shoppe/icons/checkbox2.svg +1 -0
- data/app/assets/images/shoppe/icons/cloud.svg +1 -0
- data/app/assets/images/shoppe/icons/cone.svg +1 -0
- data/app/assets/images/shoppe/icons/credit_card.svg +1 -0
- data/app/assets/images/shoppe/icons/currency.svg +1 -0
- data/app/assets/images/shoppe/icons/edit.svg +14 -0
- data/app/assets/images/shoppe/icons/flowchart.svg +1 -0
- data/app/assets/images/shoppe/icons/gift.svg +1 -0
- data/app/assets/images/shoppe/icons/globe.svg +1 -0
- data/app/assets/images/shoppe/icons/id.svg +1 -0
- data/app/assets/images/shoppe/icons/id2.svg +1 -0
- data/app/assets/images/shoppe/icons/locked.svg +1 -0
- data/app/assets/images/shoppe/icons/report.svg +1 -0
- data/app/assets/images/shoppe/icons/search.svg +1 -0
- data/app/assets/images/shoppe/icons/support.svg +1 -0
- data/app/assets/images/shoppe/icons/tags.svg +1 -0
- data/app/assets/images/shoppe/icons/toolbox.svg +1 -0
- data/app/assets/images/shoppe/icons/unlocked.svg +1 -0
- data/app/assets/images/shoppe/icons/wallet.svg +1 -0
- data/app/assets/images/shoppe/logo.svg +47 -0
- data/app/assets/images/shoppe/move.svg +1 -0
- data/app/assets/images/shoppe/shoppe.svg +25 -0
- data/app/assets/images/shoppe/square.svg +9 -0
- data/app/assets/images/shoppe/statuses/accepted.svg +14 -0
- data/app/assets/images/shoppe/statuses/paid.svg +16 -0
- data/app/assets/images/shoppe/statuses/received.svg +15 -0
- data/app/assets/images/shoppe/statuses/rejected.svg +14 -0
- data/app/assets/images/shoppe/statuses/shipped.svg +14 -0
- data/app/assets/images/shoppe/table-tear-off.png +0 -0
- data/app/assets/javascripts/shoppe/application.coffee +123 -0
- data/app/assets/javascripts/shoppe/chosen.jquery.js +1166 -0
- data/app/assets/javascripts/shoppe/jquery_ui.js +6 -0
- data/app/assets/javascripts/shoppe/mousetrap.js +9 -0
- data/app/assets/javascripts/shoppe/order_form.coffee +47 -0
- data/app/assets/stylesheets/shoppe/application.scss +601 -0
- data/app/assets/stylesheets/shoppe/chosen.scss +424 -0
- data/app/assets/stylesheets/shoppe/dialog.scss +25 -0
- data/app/assets/stylesheets/shoppe/elements.scss +79 -0
- data/app/assets/stylesheets/shoppe/printable.scss +67 -0
- data/app/assets/stylesheets/shoppe/reset.scss +93 -0
- data/app/assets/stylesheets/shoppe/sub.scss +106 -0
- data/app/assets/stylesheets/shoppe/variables.scss +1 -0
- data/app/controllers/shoppe/addresses_controller.rb +47 -0
- data/app/controllers/shoppe/application_controller.rb +46 -0
- data/app/controllers/shoppe/attachments_controller.rb +14 -0
- data/app/controllers/shoppe/countries_controller.rb +47 -0
- data/app/controllers/shoppe/customers_controller.rb +55 -0
- data/app/controllers/shoppe/dashboard_controller.rb +9 -0
- data/app/controllers/shoppe/delivery_service_prices_controller.rb +45 -0
- data/app/controllers/shoppe/delivery_services_controller.rb +47 -0
- data/app/controllers/shoppe/orders_controller.rb +119 -0
- data/app/controllers/shoppe/payments_controller.rb +33 -0
- data/app/controllers/shoppe/product_categories_controller.rb +47 -0
- data/app/controllers/shoppe/product_category_localisations_controller.rb +58 -0
- data/app/controllers/shoppe/product_localisations_controller.rb +58 -0
- data/app/controllers/shoppe/products_controller.rb +58 -0
- data/app/controllers/shoppe/sessions_controller.rb +34 -0
- data/app/controllers/shoppe/settings_controller.rb +16 -0
- data/app/controllers/shoppe/stock_level_adjustments_controller.rb +40 -0
- data/app/controllers/shoppe/tax_rates_controller.rb +49 -0
- data/app/controllers/shoppe/users_controller.rb +53 -0
- data/app/controllers/shoppe/variants_controller.rb +50 -0
- data/app/helpers/shoppe/application_helper.rb +60 -0
- data/app/helpers/shoppe/product_category_helper.rb +36 -0
- data/app/mailers/shoppe/order_mailer.rb +25 -0
- data/app/mailers/shoppe/user_mailer.rb +10 -0
- data/app/models/shoppe/address.rb +44 -0
- data/app/models/shoppe/country.rb +27 -0
- data/app/models/shoppe/customer.rb +41 -0
- data/app/models/shoppe/delivery_service.rb +33 -0
- data/app/models/shoppe/delivery_service_price.rb +31 -0
- data/app/models/shoppe/order.rb +100 -0
- data/app/models/shoppe/order/actions.rb +94 -0
- data/app/models/shoppe/order/billing.rb +105 -0
- data/app/models/shoppe/order/delivery.rb +229 -0
- data/app/models/shoppe/order/states.rb +69 -0
- data/app/models/shoppe/order_item.rb +239 -0
- data/app/models/shoppe/payment.rb +86 -0
- data/app/models/shoppe/product.rb +189 -0
- data/app/models/shoppe/product/product_attributes.rb +20 -0
- data/app/models/shoppe/product/variants.rb +51 -0
- data/app/models/shoppe/product_attribute.rb +66 -0
- data/app/models/shoppe/product_categorization.rb +14 -0
- data/app/models/shoppe/product_category.rb +75 -0
- data/app/models/shoppe/setting.rb +68 -0
- data/app/models/shoppe/stock_level_adjustment.rb +19 -0
- data/app/models/shoppe/tax_rate.rb +46 -0
- data/app/models/shoppe/user.rb +49 -0
- data/app/validators/permalink_validator.rb +7 -0
- data/app/views/layouts/shoppe/application.html.haml +34 -0
- data/app/views/layouts/shoppe/printable.html.haml +11 -0
- data/app/views/layouts/shoppe/sub.html.haml +10 -0
- data/app/views/shoppe/addresses/_form.html.haml +33 -0
- data/app/views/shoppe/addresses/edit.html.haml +5 -0
- data/app/views/shoppe/addresses/new.html.haml +5 -0
- data/app/views/shoppe/countries/_form.html.haml +35 -0
- data/app/views/shoppe/countries/edit.html.haml +6 -0
- data/app/views/shoppe/countries/index.html.haml +25 -0
- data/app/views/shoppe/countries/new.html.haml +7 -0
- data/app/views/shoppe/customers/_addresses.html.haml +20 -0
- data/app/views/shoppe/customers/_form.html.haml +30 -0
- data/app/views/shoppe/customers/_search_form.html.haml +13 -0
- data/app/views/shoppe/customers/edit.html.haml +5 -0
- data/app/views/shoppe/customers/index.html.haml +32 -0
- data/app/views/shoppe/customers/new.html.haml +5 -0
- data/app/views/shoppe/customers/show.html.haml +53 -0
- data/app/views/shoppe/delivery_service_prices/_form.html.haml +44 -0
- data/app/views/shoppe/delivery_service_prices/edit.html.haml +6 -0
- data/app/views/shoppe/delivery_service_prices/index.html.haml +23 -0
- data/app/views/shoppe/delivery_service_prices/new.html.haml +6 -0
- data/app/views/shoppe/delivery_services/_form.html.haml +38 -0
- data/app/views/shoppe/delivery_services/edit.html.haml +9 -0
- data/app/views/shoppe/delivery_services/index.html.haml +27 -0
- data/app/views/shoppe/delivery_services/new.html.haml +6 -0
- data/app/views/shoppe/order_mailer/accepted.text.erb +12 -0
- data/app/views/shoppe/order_mailer/received.text.erb +9 -0
- data/app/views/shoppe/order_mailer/rejected.text.erb +10 -0
- data/app/views/shoppe/order_mailer/shipped.text.erb +16 -0
- data/app/views/shoppe/orders/_form.html.haml +58 -0
- data/app/views/shoppe/orders/_order_details.html.haml +57 -0
- data/app/views/shoppe/orders/_order_items.html.haml +38 -0
- data/app/views/shoppe/orders/_order_items_form.html.haml +61 -0
- data/app/views/shoppe/orders/_payments_form.html.haml +15 -0
- data/app/views/shoppe/orders/_payments_table.html.haml +37 -0
- data/app/views/shoppe/orders/_search_form.html.haml +24 -0
- data/app/views/shoppe/orders/_status_bar.html.haml +35 -0
- data/app/views/shoppe/orders/despatch_note.html.haml +45 -0
- data/app/views/shoppe/orders/edit.html.haml +21 -0
- data/app/views/shoppe/orders/index.html.haml +39 -0
- data/app/views/shoppe/orders/new.html.haml +14 -0
- data/app/views/shoppe/orders/show.html.haml +25 -0
- data/app/views/shoppe/payments/refund.html.haml +13 -0
- data/app/views/shoppe/product_categories/_form.html.haml +50 -0
- data/app/views/shoppe/product_categories/edit.html.haml +8 -0
- data/app/views/shoppe/product_categories/index.html.haml +27 -0
- data/app/views/shoppe/product_categories/new.html.haml +6 -0
- data/app/views/shoppe/product_category_localisations/form.html.haml +29 -0
- data/app/views/shoppe/product_category_localisations/index.html.haml +26 -0
- data/app/views/shoppe/product_localisations/form.html.haml +32 -0
- data/app/views/shoppe/product_localisations/index.html.haml +26 -0
- data/app/views/shoppe/products/_form.html.haml +118 -0
- data/app/views/shoppe/products/_table.html.haml +42 -0
- data/app/views/shoppe/products/edit.html.haml +9 -0
- data/app/views/shoppe/products/import.html.haml +67 -0
- data/app/views/shoppe/products/index.html.haml +9 -0
- data/app/views/shoppe/products/new.html.haml +7 -0
- data/app/views/shoppe/sessions/new.html.haml +12 -0
- data/app/views/shoppe/sessions/reset.html.haml +12 -0
- data/app/views/shoppe/settings/edit.html.haml +19 -0
- data/app/views/shoppe/shared/error.html.haml +6 -0
- data/app/views/shoppe/stock_level_adjustments/index.html.haml +40 -0
- data/app/views/shoppe/tax_rates/form.html.haml +28 -0
- data/app/views/shoppe/tax_rates/index.html.haml +17 -0
- data/app/views/shoppe/user_mailer/new_password.text.erb +9 -0
- data/app/views/shoppe/users/_form.html.haml +27 -0
- data/app/views/shoppe/users/edit.html.haml +5 -0
- data/app/views/shoppe/users/index.html.haml +17 -0
- data/app/views/shoppe/users/new.html.haml +7 -0
- data/app/views/shoppe/variants/form.html.haml +68 -0
- data/app/views/shoppe/variants/index.html.haml +33 -0
- data/config/locales/de.yml +653 -0
- data/config/locales/en.yml +744 -0
- data/config/locales/es.yml +653 -0
- data/config/locales/pl.yml +662 -0
- data/config/locales/pt-BR.yml +655 -0
- data/config/routes.rb +53 -0
- data/db/countries.txt +252 -0
- data/db/migrate/20130926094549_create_shoppe_initial_schema.rb +175 -0
- data/db/migrate/20131024201501_add_address_type_to_shoppe_tax_rates.rb +5 -0
- data/db/migrate/20131024204815_create_shoppe_payments.rb +32 -0
- data/db/migrate/20131102143930_remove_default_on_order_item_weight.rb +9 -0
- data/db/migrate/20141013192427_create_shoppe_customers.rb +14 -0
- data/db/migrate/20141026175622_add_indexes_to_shoppe_order_items.rb +6 -0
- data/db/migrate/20141026175943_add_indexes_to_shoppe_orders.rb +7 -0
- data/db/migrate/20141026180333_add_indexes_to_shoppe_payments.rb +6 -0
- data/db/migrate/20141026180835_add_indexes_to_shoppe_product_attributes.rb +7 -0
- data/db/migrate/20141026180952_add_indexes_to_shoppe_product_categories.rb +5 -0
- data/db/migrate/20141026181040_add_indexes_to_shoppe_products.rb +8 -0
- data/db/migrate/20141026181312_add_indexes_to_shoppe_settings.rb +5 -0
- data/db/migrate/20141026181354_add_indexes_to_shoppe_stock_level_adjustments.rb +6 -0
- data/db/migrate/20141026181559_add_indexes_to_shoppe_users.rb +5 -0
- data/db/migrate/20141026181716_add_indexes_to_shoppe_delivery_services.rb +9 -0
- data/db/migrate/20141026181717_allow_multiple_shoppe_products_per_shoppe_product_category.rb +46 -0
- data/db/migrate/20141026181718_add_nested_to_product_categories.rb +30 -0
- data/db/migrate/20141027215005_create_shoppe_addresses.rb +17 -0
- data/db/migrate/20150315215633_add_customer_to_shoppe_orders.rb +5 -0
- data/db/migrate/20150513171350_create_shoppe_product_category_translation_table.rb +17 -0
- data/db/migrate/20150519173350_create_shoppe_product_translation_table.rb +18 -0
- data/db/schema.rb +308 -0
- data/db/seeds.rb +137 -0
- data/db/seeds_data/poe400.jpg +0 -0
- data/db/seeds_data/snom-870-blk.jpg +0 -0
- data/db/seeds_data/snom-870-grey.jpg +0 -0
- data/db/seeds_data/snom-mm2.jpg +0 -0
- data/db/seeds_data/spa303.jpg +0 -0
- data/db/seeds_data/t18p.jpg +0 -0
- data/db/seeds_data/t20p.jpg +0 -0
- data/db/seeds_data/t22p.jpg +0 -0
- data/db/seeds_data/t26p.jpg +0 -0
- data/db/seeds_data/t41pn.jpg +0 -0
- data/db/seeds_data/t46gn.jpg +0 -0
- data/db/seeds_data/w52p.jpg +0 -0
- data/db/seeds_data/yhs32.jpg +0 -0
- data/lib/shoppe.rb +60 -0
- data/lib/shoppe/associated_countries.rb +20 -0
- data/lib/shoppe/country_importer.rb +15 -0
- data/lib/shoppe/default_navigation.rb +21 -0
- data/lib/shoppe/engine.rb +55 -0
- data/lib/shoppe/error.rb +21 -0
- data/lib/shoppe/errors/inappropriate_delivery_service.rb +6 -0
- data/lib/shoppe/errors/insufficient_stock_to_fulfil.rb +15 -0
- data/lib/shoppe/errors/invalid_configuration.rb +6 -0
- data/lib/shoppe/errors/not_enough_stock.rb +15 -0
- data/lib/shoppe/errors/payment_declined.rb +6 -0
- data/lib/shoppe/errors/refund_failed.rb +6 -0
- data/lib/shoppe/errors/unorderable_item.rb +6 -0
- data/lib/shoppe/navigation_manager.rb +81 -0
- data/lib/shoppe/orderable_item.rb +39 -0
- data/lib/shoppe/settings.rb +26 -0
- data/lib/shoppe/settings_loader.rb +16 -0
- data/lib/shoppe/setup_generator.rb +10 -0
- data/lib/shoppe/version.rb +3 -0
- data/lib/shoppe/view_helpers.rb +16 -0
- data/lib/tasks/shoppe.rake +29 -0
- metadata +662 -0
data/config/routes.rb
ADDED
@@ -0,0 +1,53 @@
|
|
1
|
+
Shoppe::Engine.routes.draw do
|
2
|
+
|
3
|
+
get 'attachment/:id/:filename.:extension' => 'attachments#show'
|
4
|
+
|
5
|
+
resources :customers do
|
6
|
+
post :search, :on => :collection
|
7
|
+
resources :addresses
|
8
|
+
end
|
9
|
+
|
10
|
+
resources :product_categories do
|
11
|
+
resources :localisations, controller: "product_category_localisations"
|
12
|
+
end
|
13
|
+
resources :products do
|
14
|
+
resources :variants
|
15
|
+
resources :localisations, controller: "product_localisations"
|
16
|
+
collection do
|
17
|
+
get :import
|
18
|
+
post :import
|
19
|
+
end
|
20
|
+
end
|
21
|
+
resources :orders do
|
22
|
+
collection do
|
23
|
+
post :search
|
24
|
+
end
|
25
|
+
member do
|
26
|
+
post :accept
|
27
|
+
post :reject
|
28
|
+
post :ship
|
29
|
+
get :despatch_note
|
30
|
+
end
|
31
|
+
resources :payments, :only => [:create, :destroy] do
|
32
|
+
match :refund, :on => :member, :via => [:get, :post]
|
33
|
+
end
|
34
|
+
end
|
35
|
+
resources :stock_level_adjustments, :only => [:index, :create]
|
36
|
+
resources :delivery_services do
|
37
|
+
resources :delivery_service_prices
|
38
|
+
end
|
39
|
+
resources :tax_rates
|
40
|
+
resources :users
|
41
|
+
resources :countries
|
42
|
+
resources :attachments, :only => :destroy
|
43
|
+
|
44
|
+
get 'settings'=> 'settings#edit'
|
45
|
+
post 'settings' => 'settings#update'
|
46
|
+
|
47
|
+
get 'login' => 'sessions#new'
|
48
|
+
post 'login' => 'sessions#create'
|
49
|
+
match 'login/reset' => 'sessions#reset', :via => [:get, :post]
|
50
|
+
|
51
|
+
delete 'logout' => 'sessions#destroy'
|
52
|
+
root :to => 'dashboard#home'
|
53
|
+
end
|
data/db/countries.txt
ADDED
@@ -0,0 +1,252 @@
|
|
1
|
+
AD AND Andorra EU .ad EUR
|
2
|
+
AE ARE United Arab Emirates AS .ae AED
|
3
|
+
AF AFG Afghanistan AS .af AFN
|
4
|
+
AG ATG Antigua and Barbuda NA .ag XCD
|
5
|
+
AI AIA Anguilla NA .ai XCD
|
6
|
+
AL ALB Albania EU .al ALL
|
7
|
+
AM ARM Armenia AS .am AMD
|
8
|
+
AO AGO Angola AF .ao AOA
|
9
|
+
AQ ATA Antarctica AN .aq
|
10
|
+
AR ARG Argentina SA .ar ARS
|
11
|
+
AS ASM American Samoa OC .as USD
|
12
|
+
AT AUT Austria EU .at EUR
|
13
|
+
AU AUS Australia OC .au AUD
|
14
|
+
AW ABW Aruba NA .aw AWG
|
15
|
+
AX ALA Aland Islands EU .ax EUR
|
16
|
+
AZ AZE Azerbaijan AS .az AZN
|
17
|
+
BA BIH Bosnia and Herzegovina EU .ba BAM
|
18
|
+
BB BRB Barbados NA .bb BBD
|
19
|
+
BD BGD Bangladesh AS .bd BDT
|
20
|
+
BE BEL Belgium EU .be EUR
|
21
|
+
BF BFA Burkina Faso AF .bf XOF
|
22
|
+
BG BGR Bulgaria EU .bg BGN
|
23
|
+
BH BHR Bahrain AS .bh BHD
|
24
|
+
BI BDI Burundi AF .bi BIF
|
25
|
+
BJ BEN Benin AF .bj XOF
|
26
|
+
BL BLM Saint Barthelemy NA .gp EUR
|
27
|
+
BM BMU Bermuda NA .bm BMD
|
28
|
+
BN BRN Brunei AS .bn BND
|
29
|
+
BO BOL Bolivia SA .bo BOB
|
30
|
+
BQ BES Bonaire, Saint Eustatius and Saba NA .bq USD
|
31
|
+
BR BRA Brazil SA .br BRL
|
32
|
+
BS BHS Bahamas NA .bs BSD
|
33
|
+
BT BTN Bhutan AS .bt BTN
|
34
|
+
BV BVT Bouvet Island AN .bv NOK
|
35
|
+
BW BWA Botswana AF .bw BWP
|
36
|
+
BY BLR Belarus EU .by BYR
|
37
|
+
BZ BLZ Belize NA .bz BZD
|
38
|
+
CA CAN Canada NA .ca CAD
|
39
|
+
CC CCK Cocos Islands AS .cc AUD
|
40
|
+
CD COD Democratic Republic of the Congo AF .cd CDF
|
41
|
+
CF CAF Central African Republic AF .cf XAF
|
42
|
+
CG COG Republic of the Congo AF .cg XAF
|
43
|
+
CH CHE Switzerland EU .ch CHF
|
44
|
+
CI CIV Ivory Coast AF .ci XOF
|
45
|
+
CK COK Cook Islands OC .ck NZD
|
46
|
+
CL CHL Chile SA .cl CLP
|
47
|
+
CM CMR Cameroon AF .cm XAF
|
48
|
+
CN CHN China AS .cn CNY
|
49
|
+
CO COL Colombia SA .co COP
|
50
|
+
CR CRI Costa Rica NA .cr CRC
|
51
|
+
CU CUB Cuba NA .cu CUP
|
52
|
+
CV CPV Cape Verde AF .cv CVE
|
53
|
+
CW CUW Curacao NA .cw ANG
|
54
|
+
CX CXR Christmas Island AS .cx AUD
|
55
|
+
CY CYP Cyprus EU .cy EUR
|
56
|
+
CZ CZE Czech Republic EU .cz CZK
|
57
|
+
DE DEU Germany EU .de EUR
|
58
|
+
DJ DJI Djibouti AF .dj DJF
|
59
|
+
DK DNK Denmark EU .dk DKK
|
60
|
+
DM DMA Dominica NA .dm XCD
|
61
|
+
DO DOM Dominican Republic NA .do DOP
|
62
|
+
DZ DZA Algeria AF .dz DZD
|
63
|
+
EC ECU Ecuador SA .ec USD
|
64
|
+
EE EST Estonia EU .ee EUR
|
65
|
+
EG EGY Egypt AF .eg EGP
|
66
|
+
EH ESH Western Sahara AF .eh MAD
|
67
|
+
ER ERI Eritrea AF .er ERN
|
68
|
+
ES ESP Spain EU .es EUR
|
69
|
+
ET ETH Ethiopia AF .et ETB
|
70
|
+
FI FIN Finland EU .fi EUR
|
71
|
+
FJ FJI Fiji OC .fj FJD
|
72
|
+
FK FLK Falkland Islands SA .fk FKP
|
73
|
+
FM FSM Micronesia OC .fm USD
|
74
|
+
FO FRO Faroe Islands EU .fo DKK
|
75
|
+
FR FRA France EU .fr EUR
|
76
|
+
GA GAB Gabon AF .ga XAF
|
77
|
+
GB GBR United Kingdom EU .uk GBP
|
78
|
+
GD GRD Grenada NA .gd XCD
|
79
|
+
GE GEO Georgia AS .ge GEL
|
80
|
+
GF GUF French Guiana SA .gf EUR
|
81
|
+
GG GGY Guernsey EU .gg GBP
|
82
|
+
GH GHA Ghana AF .gh GHS
|
83
|
+
GI GIB Gibraltar EU .gi GIP
|
84
|
+
GL GRL Greenland NA .gl DKK
|
85
|
+
GM GMB Gambia AF .gm GMD
|
86
|
+
GN GIN Guinea AF .gn GNF
|
87
|
+
GP GLP Guadeloupe NA .gp EUR
|
88
|
+
GQ GNQ Equatorial Guinea AF .gq XAF
|
89
|
+
GR GRC Greece EU .gr EUR
|
90
|
+
GS SGS South Georgia and the South Sandwich Islands AN .gs GBP
|
91
|
+
GT GTM Guatemala NA .gt GTQ
|
92
|
+
GU GUM Guam OC .gu USD
|
93
|
+
GW GNB Guinea-Bissau AF .gw XOF
|
94
|
+
GY GUY Guyana SA .gy GYD
|
95
|
+
HK HKG Hong Kong AS .hk HKD
|
96
|
+
HM HMD Heard Island and McDonald Islands AN .hm AUD
|
97
|
+
HN HND Honduras NA .hn HNL
|
98
|
+
HR HRV Croatia EU .hr HRK
|
99
|
+
HT HTI Haiti NA .ht HTG
|
100
|
+
HU HUN Hungary EU .hu HUF
|
101
|
+
ID IDN Indonesia AS .id IDR
|
102
|
+
IE IRL Ireland EU .ie EUR
|
103
|
+
IL ISR Israel AS .il ILS
|
104
|
+
IM IMN Isle of Man EU .im GBP
|
105
|
+
IN IND India AS .in INR
|
106
|
+
IO IOT British Indian Ocean Territory AS .io USD
|
107
|
+
IQ IRQ Iraq AS .iq IQD
|
108
|
+
IR IRN Iran AS .ir IRR
|
109
|
+
IS ISL Iceland EU .is ISK
|
110
|
+
IT ITA Italy EU .it EUR
|
111
|
+
JE JEY Jersey EU .je GBP
|
112
|
+
JM JAM Jamaica NA .jm JMD
|
113
|
+
JO JOR Jordan AS .jo JOD
|
114
|
+
JP JPN Japan AS .jp JPY
|
115
|
+
KE KEN Kenya AF .ke KES
|
116
|
+
KG KGZ Kyrgyzstan AS .kg KGS
|
117
|
+
KH KHM Cambodia AS .kh KHR
|
118
|
+
KI KIR Kiribati OC .ki AUD
|
119
|
+
KM COM Comoros AF .km KMF
|
120
|
+
KN KNA Saint Kitts and Nevis NA .kn XCD
|
121
|
+
KP PRK North Korea AS .kp KPW
|
122
|
+
KR KOR South Korea AS .kr KRW
|
123
|
+
XK XKX Kosovo EU EUR
|
124
|
+
KW KWT Kuwait AS .kw KWD
|
125
|
+
KY CYM Cayman Islands NA .ky KYD
|
126
|
+
KZ KAZ Kazakhstan AS .kz KZT
|
127
|
+
LA LAO Laos AS .la LAK
|
128
|
+
LB LBN Lebanon AS .lb LBP
|
129
|
+
LC LCA Saint Lucia NA .lc XCD
|
130
|
+
LI LIE Liechtenstein EU .li CHF
|
131
|
+
LK LKA Sri Lanka AS .lk LKR
|
132
|
+
LR LBR Liberia AF .lr LRD
|
133
|
+
LS LSO Lesotho AF .ls LSL
|
134
|
+
LT LTU Lithuania EU .lt LTL
|
135
|
+
LU LUX Luxembourg EU .lu EUR
|
136
|
+
LV LVA Latvia EU .lv LVL
|
137
|
+
LY LBY Libya AF .ly LYD
|
138
|
+
MA MAR Morocco AF .ma MAD
|
139
|
+
MC MCO Monaco EU .mc EUR
|
140
|
+
MD MDA Moldova EU .md MDL
|
141
|
+
ME MNE Montenegro EU .me EUR
|
142
|
+
MF MAF Saint Martin NA .gp EUR
|
143
|
+
MG MDG Madagascar AF .mg MGA
|
144
|
+
MH MHL Marshall Islands OC .mh USD
|
145
|
+
MK MKD Macedonia EU .mk MKD
|
146
|
+
ML MLI Mali AF .ml XOF
|
147
|
+
MM MMR Myanmar AS .mm MMK
|
148
|
+
MN MNG Mongolia AS .mn MNT
|
149
|
+
MO MAC Macao AS .mo MOP
|
150
|
+
MP MNP Northern Mariana Islands OC .mp USD
|
151
|
+
MQ MTQ Martinique NA .mq EUR
|
152
|
+
MR MRT Mauritania AF .mr MRO
|
153
|
+
MS MSR Montserrat NA .ms XCD
|
154
|
+
MT MLT Malta EU .mt EUR
|
155
|
+
MU MUS Mauritius AF .mu MUR
|
156
|
+
MV MDV Maldives AS .mv MVR
|
157
|
+
MW MWI Malawi AF .mw MWK
|
158
|
+
MX MEX Mexico NA .mx MXN
|
159
|
+
MY MYS Malaysia AS .my MYR
|
160
|
+
MZ MOZ Mozambique AF .mz MZN
|
161
|
+
NA NAM Namibia AF .na NAD
|
162
|
+
NC NCL New Caledonia OC .nc XPF
|
163
|
+
NE NER Niger AF .ne XOF
|
164
|
+
NF NFK Norfolk Island OC .nf AUD
|
165
|
+
NG NGA Nigeria AF .ng NGN
|
166
|
+
NI NIC Nicaragua NA .ni NIO
|
167
|
+
NL NLD Netherlands EU .nl EUR
|
168
|
+
NO NOR Norway EU .no NOK
|
169
|
+
NP NPL Nepal AS .np NPR
|
170
|
+
NR NRU Nauru OC .nr AUD
|
171
|
+
NU NIU Niue OC .nu NZD
|
172
|
+
NZ NZL New Zealand OC .nz NZD
|
173
|
+
OM OMN Oman AS .om OMR
|
174
|
+
PA PAN Panama NA .pa PAB
|
175
|
+
PE PER Peru SA .pe PEN
|
176
|
+
PF PYF French Polynesia OC .pf XPF
|
177
|
+
PG PNG Papua New Guinea OC .pg PGK
|
178
|
+
PH PHL Philippines AS .ph PHP
|
179
|
+
PK PAK Pakistan AS .pk PKR
|
180
|
+
PL POL Poland EU .pl PLN
|
181
|
+
PM SPM Saint Pierre and Miquelon NA .pm EUR
|
182
|
+
PN PCN Pitcairn OC .pn NZD
|
183
|
+
PR PRI Puerto Rico NA .pr USD
|
184
|
+
PS PSE Palestinian Territory AS .ps ILS
|
185
|
+
PT PRT Portugal EU .pt EUR
|
186
|
+
PW PLW Palau OC .pw USD
|
187
|
+
PY PRY Paraguay SA .py PYG
|
188
|
+
QA QAT Qatar AS .qa QAR
|
189
|
+
RE REU Reunion AF .re EUR
|
190
|
+
RO ROU Romania EU .ro RON
|
191
|
+
RS SRB Serbia EU .rs RSD
|
192
|
+
RU RUS Russia EU .ru RUB
|
193
|
+
RW RWA Rwanda AF .rw RWF
|
194
|
+
SA SAU Saudi Arabia AS .sa SAR
|
195
|
+
SB SLB Solomon Islands OC .sb SBD
|
196
|
+
SC SYC Seychelles AF .sc SCR
|
197
|
+
SD SDN Sudan AF .sd SDG
|
198
|
+
SS SSD South Sudan AF SSP
|
199
|
+
SE SWE Sweden EU .se SEK
|
200
|
+
SG SGP Singapore AS .sg SGD
|
201
|
+
SH SHN Saint Helena AF .sh SHP
|
202
|
+
SI SVN Slovenia EU .si EUR
|
203
|
+
SJ SJM Svalbard and Jan Mayen EU .sj NOK
|
204
|
+
SK SVK Slovakia EU .sk EUR
|
205
|
+
SL SLE Sierra Leone AF .sl SLL
|
206
|
+
SM SMR San Marino EU .sm EUR
|
207
|
+
SN SEN Senegal AF .sn XOF
|
208
|
+
SO SOM Somalia AF .so SOS
|
209
|
+
SR SUR Suriname SA .sr SRD
|
210
|
+
ST STP Sao Tome and Principe AF .st STD
|
211
|
+
SV SLV El Salvador NA .sv USD
|
212
|
+
SX SXM Sint Maarten NA .sx ANG
|
213
|
+
SY SYR Syria AS .sy SYP
|
214
|
+
SZ SWZ Swaziland AF .sz SZL
|
215
|
+
TC TCA Turks and Caicos Islands NA .tc USD
|
216
|
+
TD TCD Chad AF .td XAF
|
217
|
+
TF ATF French Southern Territories AN .tf EUR
|
218
|
+
TG TGO Togo AF .tg XOF
|
219
|
+
TH THA Thailand AS .th THB
|
220
|
+
TJ TJK Tajikistan AS .tj TJS
|
221
|
+
TK TKL Tokelau OC .tk NZD
|
222
|
+
TL TLS East Timor OC .tl USD
|
223
|
+
TM TKM Turkmenistan AS .tm TMT
|
224
|
+
TN TUN Tunisia AF .tn TND
|
225
|
+
TO TON Tonga OC .to TOP
|
226
|
+
TR TUR Turkey AS .tr TRY
|
227
|
+
TT TTO Trinidad and Tobago NA .tt TTD
|
228
|
+
TV TUV Tuvalu OC .tv AUD
|
229
|
+
TW TWN Taiwan AS .tw TWD
|
230
|
+
TZ TZA Tanzania AF .tz TZS
|
231
|
+
UA UKR Ukraine EU .ua UAH
|
232
|
+
UG UGA Uganda AF .ug UGX
|
233
|
+
UM UMI United States Minor Outlying Islands OC .um USD
|
234
|
+
US USA United States NA .us USD
|
235
|
+
UY URY Uruguay SA .uy UYU
|
236
|
+
UZ UZB Uzbekistan AS .uz UZS
|
237
|
+
VA VAT Vatican EU .va EUR
|
238
|
+
VC VCT Saint Vincent and the Grenadines NA .vc XCD
|
239
|
+
VE VEN Venezuela SA .ve VEF
|
240
|
+
VG VGB British Virgin Islands NA .vg USD
|
241
|
+
VI VIR U.S. Virgin Islands NA .vi USD
|
242
|
+
VN VNM Vietnam AS .vn VND
|
243
|
+
VU VUT Vanuatu OC .vu VUV
|
244
|
+
WF WLF Wallis and Futuna OC .wf XPF
|
245
|
+
WS WSM Samoa OC .ws WST
|
246
|
+
YE YEM Yemen AS .ye YER
|
247
|
+
YT MYT Mayotte AF .yt EUR
|
248
|
+
ZA ZAF South Africa AF .za ZAR
|
249
|
+
ZM ZMB Zambia AF .zm ZMK
|
250
|
+
ZW ZWE Zimbabwe AF .zw ZWL
|
251
|
+
CS SCG Serbia and Montenegro EU .cs RSD
|
252
|
+
AN ANT Netherlands Antilles NA .an ANG
|
@@ -0,0 +1,175 @@
|
|
1
|
+
class CreateShoppeInitialSchema < ActiveRecord::Migration
|
2
|
+
def up
|
3
|
+
create_table "shoppe_countries" do |t|
|
4
|
+
t.string "name"
|
5
|
+
t.string "code2"
|
6
|
+
t.string "code3"
|
7
|
+
t.string "continent"
|
8
|
+
t.string "tld"
|
9
|
+
t.string "currency"
|
10
|
+
t.boolean "eu_member", default: false
|
11
|
+
end
|
12
|
+
|
13
|
+
create_table "shoppe_delivery_service_prices" do |t|
|
14
|
+
t.integer "delivery_service_id"
|
15
|
+
t.string "code"
|
16
|
+
t.decimal "price", precision: 8, scale: 2
|
17
|
+
t.decimal "cost_price", precision: 8, scale: 2
|
18
|
+
t.integer "tax_rate_id"
|
19
|
+
t.decimal "min_weight", precision: 8, scale: 2
|
20
|
+
t.decimal "max_weight", precision: 8, scale: 2
|
21
|
+
t.datetime "created_at"
|
22
|
+
t.datetime "updated_at"
|
23
|
+
t.text "country_ids"
|
24
|
+
end
|
25
|
+
|
26
|
+
create_table "shoppe_delivery_services" do |t|
|
27
|
+
t.string "name"
|
28
|
+
t.string "code"
|
29
|
+
t.boolean "default", default: false
|
30
|
+
t.boolean "active", default: true
|
31
|
+
t.datetime "created_at"
|
32
|
+
t.datetime "updated_at"
|
33
|
+
t.string "courier"
|
34
|
+
t.string "tracking_url"
|
35
|
+
end
|
36
|
+
|
37
|
+
create_table "shoppe_order_items" do |t|
|
38
|
+
t.integer "order_id"
|
39
|
+
t.integer "ordered_item_id"
|
40
|
+
t.string "ordered_item_type"
|
41
|
+
t.integer "quantity", default: 1
|
42
|
+
t.decimal "unit_price", precision: 8, scale: 2
|
43
|
+
t.decimal "unit_cost_price", precision: 8, scale: 2
|
44
|
+
t.decimal "tax_amount", precision: 8, scale: 2
|
45
|
+
t.decimal "tax_rate", precision: 8, scale: 2
|
46
|
+
t.decimal "weight", precision: 8, scale: 3, default: 0.0
|
47
|
+
t.datetime "created_at"
|
48
|
+
t.datetime "updated_at"
|
49
|
+
end
|
50
|
+
|
51
|
+
create_table "shoppe_orders" do |t|
|
52
|
+
t.string "token"
|
53
|
+
t.string "first_name"
|
54
|
+
t.string "last_name"
|
55
|
+
t.string "company"
|
56
|
+
t.string "billing_address1"
|
57
|
+
t.string "billing_address2"
|
58
|
+
t.string "billing_address3"
|
59
|
+
t.string "billing_address4"
|
60
|
+
t.string "billing_postcode"
|
61
|
+
t.integer "billing_country_id"
|
62
|
+
t.string "email_address"
|
63
|
+
t.string "phone_number"
|
64
|
+
t.string "status"
|
65
|
+
t.datetime "received_at"
|
66
|
+
t.datetime "accepted_at"
|
67
|
+
t.datetime "shipped_at"
|
68
|
+
t.datetime "created_at"
|
69
|
+
t.datetime "updated_at"
|
70
|
+
t.integer "delivery_service_id"
|
71
|
+
t.decimal "delivery_price", precision: 8, scale: 2
|
72
|
+
t.decimal "delivery_cost_price", precision: 8, scale: 2
|
73
|
+
t.decimal "delivery_tax_rate", precision: 8, scale: 2
|
74
|
+
t.decimal "delivery_tax_amount", precision: 8, scale: 2
|
75
|
+
t.datetime "paid_at"
|
76
|
+
t.integer "accepted_by"
|
77
|
+
t.integer "shipped_by"
|
78
|
+
t.string "consignment_number"
|
79
|
+
t.datetime "rejected_at"
|
80
|
+
t.integer "rejected_by"
|
81
|
+
t.string "ip_address"
|
82
|
+
t.string "payment_reference"
|
83
|
+
t.string "payment_method"
|
84
|
+
t.text "notes"
|
85
|
+
t.boolean "separate_delivery_address", default: false
|
86
|
+
t.string "delivery_name"
|
87
|
+
t.string "delivery_address1"
|
88
|
+
t.string "delivery_address2"
|
89
|
+
t.string "delivery_address3"
|
90
|
+
t.string "delivery_address4"
|
91
|
+
t.string "delivery_postcode"
|
92
|
+
t.integer "delivery_country_id"
|
93
|
+
end
|
94
|
+
|
95
|
+
create_table "shoppe_product_attributes" do |t|
|
96
|
+
t.integer "product_id"
|
97
|
+
t.string "key"
|
98
|
+
t.string "value"
|
99
|
+
t.integer "position", default: 1
|
100
|
+
t.boolean "searchable", default: true
|
101
|
+
t.datetime "created_at"
|
102
|
+
t.datetime "updated_at"
|
103
|
+
t.boolean "public", default: true
|
104
|
+
end
|
105
|
+
|
106
|
+
create_table "shoppe_product_categories" do |t|
|
107
|
+
t.string "name"
|
108
|
+
t.string "permalink"
|
109
|
+
t.text "description"
|
110
|
+
t.datetime "created_at"
|
111
|
+
t.datetime "updated_at"
|
112
|
+
end
|
113
|
+
|
114
|
+
create_table "shoppe_products" do |t|
|
115
|
+
t.integer "parent_id"
|
116
|
+
t.integer "product_category_id"
|
117
|
+
t.string "name"
|
118
|
+
t.string "sku"
|
119
|
+
t.string "permalink"
|
120
|
+
t.text "description"
|
121
|
+
t.text "short_description"
|
122
|
+
t.boolean "active", default: true
|
123
|
+
t.decimal "weight", precision: 8, scale: 3, default: 0.0
|
124
|
+
t.decimal "price", precision: 8, scale: 2, default: 0.0
|
125
|
+
t.decimal "cost_price", precision: 8, scale: 2, default: 0.0
|
126
|
+
t.integer "tax_rate_id"
|
127
|
+
t.datetime "created_at"
|
128
|
+
t.datetime "updated_at"
|
129
|
+
t.boolean "featured", default: false
|
130
|
+
t.text "in_the_box"
|
131
|
+
t.boolean "stock_control", default: true
|
132
|
+
t.boolean "default", default: false
|
133
|
+
end
|
134
|
+
|
135
|
+
create_table "shoppe_settings" do |t|
|
136
|
+
t.string "key"
|
137
|
+
t.string "value"
|
138
|
+
t.string "value_type"
|
139
|
+
end
|
140
|
+
|
141
|
+
create_table "shoppe_stock_level_adjustments" do |t|
|
142
|
+
t.integer "item_id"
|
143
|
+
t.string "item_type"
|
144
|
+
t.string "description"
|
145
|
+
t.integer "adjustment", default: 0
|
146
|
+
t.string "parent_type"
|
147
|
+
t.integer "parent_id"
|
148
|
+
t.datetime "created_at"
|
149
|
+
t.datetime "updated_at"
|
150
|
+
end
|
151
|
+
|
152
|
+
create_table "shoppe_tax_rates" do |t|
|
153
|
+
t.string "name"
|
154
|
+
t.decimal "rate", precision: 8, scale: 2
|
155
|
+
t.datetime "created_at"
|
156
|
+
t.datetime "updated_at"
|
157
|
+
t.text "country_ids"
|
158
|
+
end
|
159
|
+
|
160
|
+
create_table "shoppe_users" do |t|
|
161
|
+
t.string "first_name"
|
162
|
+
t.string "last_name"
|
163
|
+
t.string "email_address"
|
164
|
+
t.string "password_digest"
|
165
|
+
t.datetime "created_at"
|
166
|
+
t.datetime "updated_at"
|
167
|
+
end
|
168
|
+
end
|
169
|
+
|
170
|
+
def down
|
171
|
+
[:users, :tax_rates, :stock_level_adjustments, :settings, :products, :product_categories, :product_attributes, :orders, :order_items, :delivery_services, :delivery_service_prices, :countries].each do |table|
|
172
|
+
drop_table "shoppe_#{table}"
|
173
|
+
end
|
174
|
+
end
|
175
|
+
end
|