gemgento 2.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (429) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +6 -0
  3. data/.rspec +2 -0
  4. data/Gemfile +8 -0
  5. data/README.md +9 -0
  6. data/Rakefile +21 -0
  7. data/app/adapters/gemgento/magento/address_adapter.rb +37 -0
  8. data/app/adapters/gemgento/magento/customer_adapter.rb +24 -0
  9. data/app/adapters/gemgento/magento/line_item_adapter.rb +41 -0
  10. data/app/adapters/gemgento/magento/order_adapter.rb +97 -0
  11. data/app/adapters/gemgento/magento/order_status_adapter.rb +24 -0
  12. data/app/adapters/gemgento/magento/payment_adapter.rb +38 -0
  13. data/app/adapters/gemgento/magento/product_adapater.rb +24 -0
  14. data/app/adapters/gemgento/magento/quote_adapter.rb +17 -0
  15. data/app/adapters/gemgento/magento/shipment_adapter.rb +74 -0
  16. data/app/adapters/gemgento/magento/shipment_item_adapter.rb +39 -0
  17. data/app/adapters/gemgento/magento/shipment_track_adapter.rb +31 -0
  18. data/app/adapters/gemgento/magento_adapter.rb +17 -0
  19. data/app/assets/fonts/FuturaStd-Bold.otf +0 -0
  20. data/app/assets/fonts/FuturaStd-Book.otf +0 -0
  21. data/app/assets/fonts/FuturaStd-Light.otf +0 -0
  22. data/app/assets/fonts/FuturaStd-Medium.otf +0 -0
  23. data/app/assets/fonts/Verlag-Black.otf +0 -0
  24. data/app/assets/fonts/Verlag-BlackItalic.otf +0 -0
  25. data/app/assets/fonts/Verlag-Bold.otf +0 -0
  26. data/app/assets/fonts/Verlag-BoldItalic.otf +0 -0
  27. data/app/assets/fonts/Verlag-Book.otf +0 -0
  28. data/app/assets/fonts/Verlag-BookItalic-2.otf +0 -0
  29. data/app/assets/fonts/Verlag-BookItalic-3.otf +0 -0
  30. data/app/assets/fonts/Verlag-BookItalic.otf +0 -0
  31. data/app/assets/fonts/Verlag-Light.otf +0 -0
  32. data/app/assets/fonts/Verlag-LightItalic.otf +0 -0
  33. data/app/assets/fonts/Verlag-XLight.otf +0 -0
  34. data/app/assets/fonts/Verlag-XLightItalic.otf +0 -0
  35. data/app/assets/images/about_store.jpg +0 -0
  36. data/app/assets/images/gemgento-icon-bolt.png +0 -0
  37. data/app/assets/javascripts/gemgento/active_admin.js.coffee +42 -0
  38. data/app/assets/javascripts/gemgento/checkout/address.coffee +23 -0
  39. data/app/assets/javascripts/gemgento/gemgento.js +1 -0
  40. data/app/assets/javascripts/gemgento/global.js.coffee +31 -0
  41. data/app/assets/stylesheets/gemgento/active_admin.css.scss +549 -0
  42. data/app/assets/stylesheets/gemgento/default-views/_address.scss +11 -0
  43. data/app/assets/stylesheets/gemgento/default-views/_category.scss +54 -0
  44. data/app/assets/stylesheets/gemgento/default-views/_checkout.scss +28 -0
  45. data/app/assets/stylesheets/gemgento/default-views/_footer.scss +13 -0
  46. data/app/assets/stylesheets/gemgento/default-views/_form.scss +127 -0
  47. data/app/assets/stylesheets/gemgento/default-views/_header.scss +32 -0
  48. data/app/assets/stylesheets/gemgento/default-views/_layout.css.scss +157 -0
  49. data/app/assets/stylesheets/gemgento/default-views/_pages.css.scss +83 -0
  50. data/app/assets/stylesheets/gemgento/default-views/_product.scss +57 -0
  51. data/app/assets/stylesheets/gemgento/default-views/_shopping_bag.scss +87 -0
  52. data/app/assets/stylesheets/gemgento/default-views/_subheader.css.scss +30 -0
  53. data/app/assets/stylesheets/gemgento/default-views/application.css.scss +1 -0
  54. data/app/controllers/concerns/gemgento/api/v1/base.rb +15 -0
  55. data/app/controllers/concerns/gemgento/api/v1/product_filters.rb +33 -0
  56. data/app/controllers/gemgento/addresses_controller.rb +14 -0
  57. data/app/controllers/gemgento/api/v1/categories_controller.rb +13 -0
  58. data/app/controllers/gemgento/api/v1/products_controller.rb +23 -0
  59. data/app/controllers/gemgento/api/v1/search_controller.rb +14 -0
  60. data/app/controllers/gemgento/application_controller.rb +5 -0
  61. data/app/controllers/gemgento/cart_controller.rb +99 -0
  62. data/app/controllers/gemgento/categories_controller.rb +37 -0
  63. data/app/controllers/gemgento/checkout/address_controller.rb +48 -0
  64. data/app/controllers/gemgento/checkout/confirm_controller.rb +72 -0
  65. data/app/controllers/gemgento/checkout/coupons_controller.rb +42 -0
  66. data/app/controllers/gemgento/checkout/gift_card_controller.rb +39 -0
  67. data/app/controllers/gemgento/checkout/gift_controller.rb +32 -0
  68. data/app/controllers/gemgento/checkout/login_controller.rb +123 -0
  69. data/app/controllers/gemgento/checkout/payment_controller.rb +70 -0
  70. data/app/controllers/gemgento/checkout/paypal_controller.rb +23 -0
  71. data/app/controllers/gemgento/checkout/shipping_controller.rb +46 -0
  72. data/app/controllers/gemgento/checkout/shipping_payment_controller.rb +58 -0
  73. data/app/controllers/gemgento/checkout/thank_you_controller.rb +45 -0
  74. data/app/controllers/gemgento/checkout_controller.rb +120 -0
  75. data/app/controllers/gemgento/countries_controller.rb +17 -0
  76. data/app/controllers/gemgento/errors_controller.rb +7 -0
  77. data/app/controllers/gemgento/footer_items_controller.rb +16 -0
  78. data/app/controllers/gemgento/home_controller.rb +7 -0
  79. data/app/controllers/gemgento/magento/addresses_controller.rb +61 -0
  80. data/app/controllers/gemgento/magento/base_controller.rb +18 -0
  81. data/app/controllers/gemgento/magento/categories_controller.rb +103 -0
  82. data/app/controllers/gemgento/magento/email/sales/credit_memos_controller.rb +21 -0
  83. data/app/controllers/gemgento/magento/email/sales/invoices_controller.rb +21 -0
  84. data/app/controllers/gemgento/magento/email/sales/orders_controller.rb +20 -0
  85. data/app/controllers/gemgento/magento/email/sales/shipments_controller.rb +25 -0
  86. data/app/controllers/gemgento/magento/emails_controller.rb +11 -0
  87. data/app/controllers/gemgento/magento/inventory_controller.rb +30 -0
  88. data/app/controllers/gemgento/magento/orders_controller.rb +12 -0
  89. data/app/controllers/gemgento/magento/price_rules_controller.rb +22 -0
  90. data/app/controllers/gemgento/magento/product_attribute_sets_controller.rb +37 -0
  91. data/app/controllers/gemgento/magento/product_attributes_controller.rb +70 -0
  92. data/app/controllers/gemgento/magento/products_controller.rb +240 -0
  93. data/app/controllers/gemgento/magento/recurring_profiles_controller.rb +42 -0
  94. data/app/controllers/gemgento/magento/stores_controller.rb +21 -0
  95. data/app/controllers/gemgento/magento/user_groups_controller.rb +23 -0
  96. data/app/controllers/gemgento/magento/users_controller.rb +63 -0
  97. data/app/controllers/gemgento/order_export_controller.rb +21 -0
  98. data/app/controllers/gemgento/orders_controller.rb +12 -0
  99. data/app/controllers/gemgento/products_controller.rb +12 -0
  100. data/app/controllers/gemgento/regions_controller.rb +18 -0
  101. data/app/controllers/gemgento/search_controller.rb +16 -0
  102. data/app/controllers/gemgento/shipments_controller.rb +5 -0
  103. data/app/controllers/gemgento/stock_notifications_controller.rb +22 -0
  104. data/app/controllers/gemgento/subscribers_controller.rb +35 -0
  105. data/app/controllers/gemgento/sync_controller.rb +50 -0
  106. data/app/controllers/gemgento/user/addresses_controller.rb +79 -0
  107. data/app/controllers/gemgento/user/base_controller.rb +14 -0
  108. data/app/controllers/gemgento/user/home_controller.rb +9 -0
  109. data/app/controllers/gemgento/user/orders_controller.rb +17 -0
  110. data/app/controllers/gemgento/user/passwords_controller.rb +18 -0
  111. data/app/controllers/gemgento/user/recurring_profiles_controller.rb +31 -0
  112. data/app/controllers/gemgento/user/registration_session_controller.rb +103 -0
  113. data/app/controllers/gemgento/user/registrations_controller.rb +28 -0
  114. data/app/controllers/gemgento/user/saved_credit_cards_controller.rb +56 -0
  115. data/app/controllers/gemgento/user/sessions_controller.rb +50 -0
  116. data/app/controllers/gemgento/user/wishlist_items_controller.rb +55 -0
  117. data/app/controllers/gemgento/users_controller.rb +36 -0
  118. data/app/helpers/gemgento/application_helper.rb +125 -0
  119. data/app/helpers/gemgento/categories_helper.rb +39 -0
  120. data/app/helpers/gemgento/checkout/payment_helper.rb +5 -0
  121. data/app/helpers/gemgento/products_helper.rb +23 -0
  122. data/app/jobs/gemgento/import_job.rb +12 -0
  123. data/app/mailers/gemgento/sales_mailer.rb +80 -0
  124. data/app/models/admin_user.rb +7 -0
  125. data/app/models/concerns/gemgento/product_touches.rb +26 -0
  126. data/app/models/gemgento.rb +5 -0
  127. data/app/models/gemgento/adapter/sellect/customer.rb +34 -0
  128. data/app/models/gemgento/adapter/sellect/order.rb +378 -0
  129. data/app/models/gemgento/adapter/sellect/product.rb +250 -0
  130. data/app/models/gemgento/adapter/sellect_adapter.rb +16 -0
  131. data/app/models/gemgento/adapter/shopify/address.rb +40 -0
  132. data/app/models/gemgento/adapter/shopify/category.rb +51 -0
  133. data/app/models/gemgento/adapter/shopify/customer.rb +66 -0
  134. data/app/models/gemgento/adapter/shopify/order.rb +334 -0
  135. data/app/models/gemgento/adapter/shopify/product.rb +377 -0
  136. data/app/models/gemgento/adapter/shopify/product_category_position.rb +58 -0
  137. data/app/models/gemgento/adapter/shopify_adapter.rb +63 -0
  138. data/app/models/gemgento/address.rb +206 -0
  139. data/app/models/gemgento/api_job.rb +68 -0
  140. data/app/models/gemgento/asset.rb +185 -0
  141. data/app/models/gemgento/asset_file.rb +57 -0
  142. data/app/models/gemgento/asset_type.rb +8 -0
  143. data/app/models/gemgento/bundle.rb +5 -0
  144. data/app/models/gemgento/bundle/item.rb +17 -0
  145. data/app/models/gemgento/bundle/option.rb +20 -0
  146. data/app/models/gemgento/category.rb +235 -0
  147. data/app/models/gemgento/country.rb +21 -0
  148. data/app/models/gemgento/gift_message.rb +8 -0
  149. data/app/models/gemgento/image_import.rb +141 -0
  150. data/app/models/gemgento/import.rb +125 -0
  151. data/app/models/gemgento/inventory.rb +60 -0
  152. data/app/models/gemgento/inventory_import.rb +51 -0
  153. data/app/models/gemgento/line_item.rb +142 -0
  154. data/app/models/gemgento/line_item_option.rb +10 -0
  155. data/app/models/gemgento/magento_db.rb +35 -0
  156. data/app/models/gemgento/magento_response.rb +10 -0
  157. data/app/models/gemgento/order.rb +56 -0
  158. data/app/models/gemgento/order_status.rb +7 -0
  159. data/app/models/gemgento/payment.rb +50 -0
  160. data/app/models/gemgento/price_rule.rb +258 -0
  161. data/app/models/gemgento/price_tier.rb +36 -0
  162. data/app/models/gemgento/product.rb +607 -0
  163. data/app/models/gemgento/product_attribute.rb +48 -0
  164. data/app/models/gemgento/product_attribute_option.rb +39 -0
  165. data/app/models/gemgento/product_attribute_set.rb +22 -0
  166. data/app/models/gemgento/product_attribute_value.rb +26 -0
  167. data/app/models/gemgento/product_category.rb +34 -0
  168. data/app/models/gemgento/product_import.rb +359 -0
  169. data/app/models/gemgento/quote.rb +586 -0
  170. data/app/models/gemgento/recurring_profile.rb +28 -0
  171. data/app/models/gemgento/region.rb +14 -0
  172. data/app/models/gemgento/relation.rb +10 -0
  173. data/app/models/gemgento/relation_type.rb +7 -0
  174. data/app/models/gemgento/saved_credit_card.rb +45 -0
  175. data/app/models/gemgento/search.rb +14 -0
  176. data/app/models/gemgento/session.rb +49 -0
  177. data/app/models/gemgento/shipment.rb +38 -0
  178. data/app/models/gemgento/shipment_comment.rb +19 -0
  179. data/app/models/gemgento/shipment_item.rb +11 -0
  180. data/app/models/gemgento/shipment_track.rb +21 -0
  181. data/app/models/gemgento/stock_notification.rb +17 -0
  182. data/app/models/gemgento/store.rb +31 -0
  183. data/app/models/gemgento/store_tag.rb +8 -0
  184. data/app/models/gemgento/subscriber.rb +30 -0
  185. data/app/models/gemgento/swatch.rb +9 -0
  186. data/app/models/gemgento/sync.rb +134 -0
  187. data/app/models/gemgento/tag.rb +64 -0
  188. data/app/models/gemgento/user.rb +161 -0
  189. data/app/models/gemgento/user_group.rb +13 -0
  190. data/app/models/gemgento/wishlist_item.rb +11 -0
  191. data/app/services/gemgento/magento_api.rb +173 -0
  192. data/app/services/gemgento/price.rb +67 -0
  193. data/app/validators/gemgento/credit_card_validator.rb +50 -0
  194. data/app/validators/gemgento/image_import_validator.rb +100 -0
  195. data/app/validators/gemgento/inventory_import_validator.rb +73 -0
  196. data/app/validators/gemgento/inventory_validator.rb +14 -0
  197. data/app/validators/gemgento/product_import_validator.rb +163 -0
  198. data/app/views/admin/product_positions/_index.html.haml +14 -0
  199. data/app/views/devise/registrations/edit.haml +37 -0
  200. data/app/views/gemgento/addresses/_address.json.jbuilder +6 -0
  201. data/app/views/gemgento/addresses/region_options.html.haml +1 -0
  202. data/app/views/gemgento/api/v1/categories/_category.json.jbuilder +52 -0
  203. data/app/views/gemgento/api/v1/categories/index.json.jbuilder +8 -0
  204. data/app/views/gemgento/api/v1/categories/show.json.jbuilder +7 -0
  205. data/app/views/gemgento/api/v1/products/_attributes.json.jbuilder +9 -0
  206. data/app/views/gemgento/api/v1/products/_product.json.jbuilder +18 -0
  207. data/app/views/gemgento/api/v1/products/_relationships.json.jbuilder +48 -0
  208. data/app/views/gemgento/api/v1/products/index.json.jbuilder +8 -0
  209. data/app/views/gemgento/api/v1/products/show.json.jbuilder +7 -0
  210. data/app/views/gemgento/api/v1/search/index.json.jbuilder +8 -0
  211. data/app/views/gemgento/api/v1/search/show.json.jbuilder +8 -0
  212. data/app/views/gemgento/assets/_asset.json.jbuilder +13 -0
  213. data/app/views/gemgento/cart/show.html.haml +67 -0
  214. data/app/views/gemgento/categories/_category.json.jbuilder +9 -0
  215. data/app/views/gemgento/categories/_product_tile.html.haml +16 -0
  216. data/app/views/gemgento/categories/index.html.haml +10 -0
  217. data/app/views/gemgento/categories/index.json.jbuilder +1 -0
  218. data/app/views/gemgento/categories/show.html.haml +16 -0
  219. data/app/views/gemgento/categories/show.json.jbuilder +1 -0
  220. data/app/views/gemgento/checkout/_checkout_header.html.haml +17 -0
  221. data/app/views/gemgento/checkout/address/error.js.erb +1 -0
  222. data/app/views/gemgento/checkout/address/show.html.haml +88 -0
  223. data/app/views/gemgento/checkout/address/success.js.erb +1 -0
  224. data/app/views/gemgento/checkout/confirm/error.js.erb +0 -0
  225. data/app/views/gemgento/checkout/confirm/show.html.haml +60 -0
  226. data/app/views/gemgento/checkout/confirm/success.js.erb +1 -0
  227. data/app/views/gemgento/checkout/login/login_fail.js.erb +1 -0
  228. data/app/views/gemgento/checkout/login/login_guest_fail.js.erb +1 -0
  229. data/app/views/gemgento/checkout/login/login_guest_success.js.erb +1 -0
  230. data/app/views/gemgento/checkout/login/login_success.js.erb +1 -0
  231. data/app/views/gemgento/checkout/login/registration_fail.js.erb +1 -0
  232. data/app/views/gemgento/checkout/login/registration_success.js.erb +1 -0
  233. data/app/views/gemgento/checkout/login/show.html.haml +50 -0
  234. data/app/views/gemgento/checkout/payment/error.js.erb +1 -0
  235. data/app/views/gemgento/checkout/payment/show.html.haml +56 -0
  236. data/app/views/gemgento/checkout/payment/success.js.erb +1 -0
  237. data/app/views/gemgento/checkout/shipping/error.js.erb +0 -0
  238. data/app/views/gemgento/checkout/shipping/show.html.haml +26 -0
  239. data/app/views/gemgento/checkout/shipping/success.js.erb +1 -0
  240. data/app/views/gemgento/checkout/shipping_payment/show.haml +52 -0
  241. data/app/views/gemgento/checkout/thank_you/show.html.haml +6 -0
  242. data/app/views/gemgento/countries/_country.json.jbuilder +4 -0
  243. data/app/views/gemgento/countries/index.json.jbuilder +3 -0
  244. data/app/views/gemgento/countries/show.json.jbuilder +1 -0
  245. data/app/views/gemgento/home/index.html.haml +1 -0
  246. data/app/views/gemgento/order/add_item.js.erb +0 -0
  247. data/app/views/gemgento/order/no_inventory.js.erb +1 -0
  248. data/app/views/gemgento/order/remove_item.js.erb +0 -0
  249. data/app/views/gemgento/order/update_item.js.erb +0 -0
  250. data/app/views/gemgento/order_export/index.html.haml +2 -0
  251. data/app/views/gemgento/order_items/_order_item.json.jbuilder +7 -0
  252. data/app/views/gemgento/orders/_order.json.jbuilder +29 -0
  253. data/app/views/gemgento/products/_product.json.jbuilder +40 -0
  254. data/app/views/gemgento/products/index.html.haml +19 -0
  255. data/app/views/gemgento/products/show.html.haml +67 -0
  256. data/app/views/gemgento/products/show.json.jbuilder +1 -0
  257. data/app/views/gemgento/sales_mailer/credit_memo_email.html.haml +1 -0
  258. data/app/views/gemgento/sales_mailer/invoice_email.html.haml +1 -0
  259. data/app/views/gemgento/sales_mailer/order_email.html.haml +1 -0
  260. data/app/views/gemgento/sales_mailer/shipment_email.html.haml +1 -0
  261. data/app/views/gemgento/search/index.html.haml +8 -0
  262. data/app/views/gemgento/shared/_asset.json.jbuilder +35 -0
  263. data/app/views/gemgento/shared/_asset_file.json.jbuilder +19 -0
  264. data/app/views/gemgento/shared/_asset_type.json.jbuilder +13 -0
  265. data/app/views/gemgento/shared/_error_messages.haml +7 -0
  266. data/app/views/gemgento/shared/_flash_messages.haml +4 -0
  267. data/app/views/gemgento/shared/_footer.haml +7 -0
  268. data/app/views/gemgento/shared/_header.haml +23 -0
  269. data/app/views/gemgento/shared/_mini_bag.haml +36 -0
  270. data/app/views/gemgento/shared/_product_image.haml +8 -0
  271. data/app/views/gemgento/shipments/_shipment.json.jbuilder +12 -0
  272. data/app/views/gemgento/subscribers/create.js.erb +2 -0
  273. data/app/views/gemgento/subscribers/errors.js.erb +1 -0
  274. data/app/views/gemgento/user/_user.json.jbuilder +2 -0
  275. data/app/views/gemgento/user/addresses/_form.haml +39 -0
  276. data/app/views/gemgento/user/addresses/errors.js.erb +1 -0
  277. data/app/views/gemgento/user/addresses/index.haml +33 -0
  278. data/app/views/gemgento/user/addresses/new.haml +11 -0
  279. data/app/views/gemgento/user/addresses/success.js.erb +1 -0
  280. data/app/views/gemgento/user/confirmations/new.haml +9 -0
  281. data/app/views/gemgento/user/home/index.haml +8 -0
  282. data/app/views/gemgento/user/mailer/confirmation_instructions.html.erb +5 -0
  283. data/app/views/gemgento/user/mailer/reset_password_instructions.html.erb +8 -0
  284. data/app/views/gemgento/user/mailer/unlock_instructions.html.erb +7 -0
  285. data/app/views/gemgento/user/orders/index.html.haml +29 -0
  286. data/app/views/gemgento/user/orders/show.html.haml +87 -0
  287. data/app/views/gemgento/user/passwords/edit.html.erb +18 -0
  288. data/app/views/gemgento/user/passwords/new.html.haml +21 -0
  289. data/app/views/gemgento/user/registration_session/new.haml +67 -0
  290. data/app/views/gemgento/user/registrations/new.html.haml +28 -0
  291. data/app/views/gemgento/user/saved_credit_cards/_form.haml +69 -0
  292. data/app/views/gemgento/user/saved_credit_cards/index.haml +25 -0
  293. data/app/views/gemgento/user/saved_credit_cards/new.haml +13 -0
  294. data/app/views/gemgento/user/sessions/new.html.haml +29 -0
  295. data/app/views/gemgento/user/shared/_links.erb +25 -0
  296. data/app/views/gemgento/user/shared/_user_header.haml +8 -0
  297. data/app/views/gemgento/user/wishlist_items/index.html.haml +20 -0
  298. data/app/views/kaminari/_first_page.html.haml +9 -0
  299. data/app/views/kaminari/_gap.html.haml +8 -0
  300. data/app/views/kaminari/_last_page.html.haml +9 -0
  301. data/app/views/kaminari/_next_page.html.haml +9 -0
  302. data/app/views/kaminari/_page.html.haml +10 -0
  303. data/app/views/kaminari/_paginator.html.haml +18 -0
  304. data/app/views/kaminari/_prev_page.html.haml +9 -0
  305. data/app/views/layouts/_footer.html.haml +5 -0
  306. data/app/views/layouts/_header.html.haml +39 -0
  307. data/app/views/layouts/gemgento.html.haml +22 -0
  308. data/app/workers/gemgento/apply_price_rule.rb +24 -0
  309. data/app/workers/gemgento/cart/add_item_worker.rb +23 -0
  310. data/app/workers/gemgento/cart/update_item_worker.rb +18 -0
  311. data/bin/rails +12 -0
  312. data/config/gemgento_config.yml +12 -0
  313. data/config/initializers/active_admin.rb +14 -0
  314. data/config/initializers/active_touch.rb +3 -0
  315. data/config/initializers/assets.rb +1 -0
  316. data/config/initializers/boolean_typecasting.rb +37 -0
  317. data/config/initializers/devise.rb +49 -0
  318. data/config/initializers/gemgento_config.rb +67 -0
  319. data/config/initializers/mime_types.rb +4 -0
  320. data/config/initializers/state_machine.rb +7 -0
  321. data/config/locales/en.yml +24 -0
  322. data/config/routes.rb +138 -0
  323. data/db/migrate/20151201231300_add_validation_indexes_to_gemgento_products.rb +22 -0
  324. data/db/migrate/20160122174450_gemgento2.rb +969 -0
  325. data/db/migrate/20160217142910_create_gemgento_imports.rb +15 -0
  326. data/db/migrate/20160219235858_add_timestamps_to_gemgento_asset_files.rb +6 -0
  327. data/gemgento.gemspec +44 -0
  328. data/lib/devise/models/validatable.rb +76 -0
  329. data/lib/gemgento.rb +24 -0
  330. data/lib/gemgento/admin/admin_user.rb +29 -0
  331. data/lib/gemgento/admin/api_jobs.rb +30 -0
  332. data/lib/gemgento/admin/image_import.rb +87 -0
  333. data/lib/gemgento/admin/inventory_import.rb +81 -0
  334. data/lib/gemgento/admin/product_import.rb +138 -0
  335. data/lib/gemgento/admin/product_positions.rb +49 -0
  336. data/lib/gemgento/admin/stores.rb +33 -0
  337. data/lib/gemgento/admin/subscribers.rb +31 -0
  338. data/lib/gemgento/admin/syncs.rb +26 -0
  339. data/lib/gemgento/api/soap/authnetcim/payment.rb +127 -0
  340. data/lib/gemgento/api/soap/catalog/category.rb +237 -0
  341. data/lib/gemgento/api/soap/catalog/product.rb +481 -0
  342. data/lib/gemgento/api/soap/catalog/product_attribute.rb +147 -0
  343. data/lib/gemgento/api/soap/catalog/product_attribute_media.rb +202 -0
  344. data/lib/gemgento/api/soap/catalog/product_attribute_set.rb +80 -0
  345. data/lib/gemgento/api/soap/catalog/product_tag.rb +146 -0
  346. data/lib/gemgento/api/soap/catalog/product_tier_price.rb +21 -0
  347. data/lib/gemgento/api/soap/catalog/search.rb +27 -0
  348. data/lib/gemgento/api/soap/catalog_inventory/stock_item.rb +87 -0
  349. data/lib/gemgento/api/soap/catalog_rule/rule.rb +54 -0
  350. data/lib/gemgento/api/soap/checkout/cart.rb +85 -0
  351. data/lib/gemgento/api/soap/checkout/coupon.rb +37 -0
  352. data/lib/gemgento/api/soap/checkout/customer.rb +87 -0
  353. data/lib/gemgento/api/soap/checkout/payment.rb +59 -0
  354. data/lib/gemgento/api/soap/checkout/product.rb +138 -0
  355. data/lib/gemgento/api/soap/checkout/shipping.rb +37 -0
  356. data/lib/gemgento/api/soap/customer/address.rb +143 -0
  357. data/lib/gemgento/api/soap/customer/customer.rb +200 -0
  358. data/lib/gemgento/api/soap/directory/country.rb +49 -0
  359. data/lib/gemgento/api/soap/directory/region.rb +50 -0
  360. data/lib/gemgento/api/soap/enterprise_gift_message/gift_message.rb +26 -0
  361. data/lib/gemgento/api/soap/gift_card.rb +35 -0
  362. data/lib/gemgento/api/soap/globalcollect/saved_cc.rb +58 -0
  363. data/lib/gemgento/api/soap/miscellaneous/store.rb +47 -0
  364. data/lib/gemgento/api/soap/sales/order.rb +249 -0
  365. data/lib/gemgento/api/soap/sales/order_shipment.rb +122 -0
  366. data/lib/gemgento/api/soap/sales/recurring_profile.rb +88 -0
  367. data/lib/gemgento/api/soap/stock_notification.rb +27 -0
  368. data/lib/gemgento/engine.rb +61 -0
  369. data/lib/gemgento/version.rb +3 -0
  370. data/lib/generators/gemgento/assets_generator.rb +11 -0
  371. data/lib/generators/gemgento/install_generator.rb +34 -0
  372. data/lib/generators/gemgento/templates/active_admin.css.scss +1 -0
  373. data/lib/generators/gemgento/templates/active_admin.js.coffee +1 -0
  374. data/lib/generators/gemgento/templates/active_admin.rb +3 -0
  375. data/lib/generators/gemgento/views_generator.rb +10 -0
  376. data/spec/dummy/README.rdoc +28 -0
  377. data/spec/dummy/Rakefile +6 -0
  378. data/spec/dummy/app/assets/images/.keep +0 -0
  379. data/spec/dummy/app/assets/javascripts/application.js +13 -0
  380. data/spec/dummy/app/assets/stylesheets/application.css +15 -0
  381. data/spec/dummy/app/controllers/application_controller.rb +5 -0
  382. data/spec/dummy/app/controllers/concerns/.keep +0 -0
  383. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  384. data/spec/dummy/app/mailers/.keep +0 -0
  385. data/spec/dummy/app/models/.keep +0 -0
  386. data/spec/dummy/app/models/concerns/.keep +0 -0
  387. data/spec/dummy/app/views/layouts/application.html.erb +14 -0
  388. data/spec/dummy/bin/bundle +3 -0
  389. data/spec/dummy/bin/rails +4 -0
  390. data/spec/dummy/bin/rake +4 -0
  391. data/spec/dummy/bin/setup +29 -0
  392. data/spec/dummy/config.ru +4 -0
  393. data/spec/dummy/config/application.rb +32 -0
  394. data/spec/dummy/config/boot.rb +5 -0
  395. data/spec/dummy/config/database.yml +20 -0
  396. data/spec/dummy/config/environment.rb +5 -0
  397. data/spec/dummy/config/environments/development.rb +41 -0
  398. data/spec/dummy/config/environments/production.rb +79 -0
  399. data/spec/dummy/config/environments/test.rb +42 -0
  400. data/spec/dummy/config/gemgento_config.yml +22 -0
  401. data/spec/dummy/config/initializers/assets.rb +11 -0
  402. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  403. data/spec/dummy/config/initializers/cookies_serializer.rb +3 -0
  404. data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  405. data/spec/dummy/config/initializers/inflections.rb +16 -0
  406. data/spec/dummy/config/initializers/mime_types.rb +4 -0
  407. data/spec/dummy/config/initializers/session_store.rb +3 -0
  408. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
  409. data/spec/dummy/config/locales/en.yml +23 -0
  410. data/spec/dummy/config/routes.rb +4 -0
  411. data/spec/dummy/config/secrets.yml +22 -0
  412. data/spec/dummy/lib/assets/.keep +0 -0
  413. data/spec/dummy/public/404.html +67 -0
  414. data/spec/dummy/public/422.html +67 -0
  415. data/spec/dummy/public/500.html +66 -0
  416. data/spec/dummy/public/favicon.ico +0 -0
  417. data/spec/factories/gemgento/price_tiers.rb +8 -0
  418. data/spec/factories/gemgento/product_attribute_sets.rb +22 -0
  419. data/spec/factories/gemgento/product_attributes.rb +5 -0
  420. data/spec/factories/gemgento/products.rb +14 -0
  421. data/spec/factories/gemgento/stores.rb +12 -0
  422. data/spec/factories/gemgento/user_groups.rb +6 -0
  423. data/spec/factories/gemgento/users.rb +13 -0
  424. data/spec/factories/gemgento_imports.rb +12 -0
  425. data/spec/model/gemgento/price_tier_spec.rb +45 -0
  426. data/spec/rails_helper.rb +55 -0
  427. data/spec/services/gemgento/price_spec.rb +152 -0
  428. data/spec/spec_helper.rb +87 -0
  429. metadata +919 -0
@@ -0,0 +1,22 @@
1
+ class AddValidationIndexesToGemgentoProducts < ActiveRecord::Migration
2
+ def change
3
+ add_index :gemgento_products, :magento_id, unique: true
4
+ add_index :gemgento_products, [:sku, :deleted_at], unique: true
5
+ end
6
+
7
+ def migrate(direction)
8
+ if direction == :up
9
+ # remove duplicates on magento_id
10
+ products = Gemgento::Product.order(:deleted_at)
11
+ grouped = products.group_by{ |model| model.magento_id }
12
+
13
+ grouped.values.each do |duplicates|
14
+ next if duplicates.size == 1
15
+ original = duplicates.shift
16
+ duplicates.each { |dup| dup.destroy }
17
+ end
18
+ end
19
+
20
+ super
21
+ end
22
+ end
@@ -0,0 +1,969 @@
1
+ class Gemgento2 < ActiveRecord::Migration
2
+
3
+ def change
4
+ create_table "active_admin_comments", force: :cascade do |t|
5
+ t.string "namespace", limit: 255
6
+ t.text "body", limit: 65535
7
+ t.string "resource_id", limit: 255, null: false
8
+ t.string "resource_type", limit: 255, null: false
9
+ t.integer "author_id", limit: 4
10
+ t.string "author_type", limit: 255
11
+ t.datetime "created_at"
12
+ t.datetime "updated_at"
13
+ end
14
+
15
+ add_index "active_admin_comments", ["author_type", "author_id"], name: "index_active_admin_comments_on_author_type_and_author_id", using: :btree
16
+ add_index "active_admin_comments", ["namespace"], name: "index_active_admin_comments_on_namespace", using: :btree
17
+ add_index "active_admin_comments", ["resource_type", "resource_id"], name: "index_active_admin_comments_on_resource_type_and_resource_id", using: :btree
18
+
19
+ create_table "admin_users", force: :cascade do |t|
20
+ t.string "email", limit: 255, default: "", null: false
21
+ t.string "encrypted_password", limit: 255, default: "", null: false
22
+ t.string "reset_password_token", limit: 255
23
+ t.datetime "reset_password_sent_at"
24
+ t.datetime "remember_created_at"
25
+ t.integer "sign_in_count", limit: 4, default: 0, null: false
26
+ t.datetime "current_sign_in_at"
27
+ t.datetime "last_sign_in_at"
28
+ t.string "current_sign_in_ip", limit: 255
29
+ t.string "last_sign_in_ip", limit: 255
30
+ t.datetime "created_at"
31
+ t.datetime "updated_at"
32
+ end
33
+
34
+ add_index "admin_users", ["email"], name: "index_admin_users_on_email", unique: true, using: :btree
35
+ add_index "admin_users", ["reset_password_token"], name: "index_admin_users_on_reset_password_token", unique: true, using: :btree
36
+
37
+ create_table "gemgento_addresses", force: :cascade do |t|
38
+ t.string "addressable_type", limit: 255
39
+ t.integer "addressable_id", limit: 4
40
+ t.integer "magento_id", limit: 4
41
+ t.string "increment_id", limit: 255
42
+ t.string "city", limit: 255
43
+ t.string "company", limit: 255
44
+ t.integer "country_id", limit: 4
45
+ t.string "fax", limit: 255
46
+ t.string "first_name", limit: 255
47
+ t.string "middle_name", limit: 255
48
+ t.string "last_name", limit: 255
49
+ t.string "postcode", limit: 255
50
+ t.string "prefix", limit: 255
51
+ t.string "suffix", limit: 255
52
+ t.string "region_name", limit: 255
53
+ t.integer "region_id", limit: 4
54
+ t.string "street", limit: 255
55
+ t.string "telephone", limit: 255
56
+ t.boolean "sync_needed", default: true, null: false
57
+ t.datetime "created_at"
58
+ t.datetime "updated_at"
59
+ t.boolean "is_billing", default: false
60
+ t.boolean "is_shipping", default: false
61
+ end
62
+
63
+ add_index "gemgento_addresses", ["addressable_type", "addressable_id"], name: "index_gemgento_addresses_on_addressable_type_and_addressable_id", using: :btree
64
+
65
+ create_table "gemgento_api_jobs", force: :cascade do |t|
66
+ t.integer "source_id", limit: 4
67
+ t.string "kind", limit: 255
68
+ t.string "state", limit: 255
69
+ t.string "source_type", limit: 255
70
+ t.string "request_url", limit: 255
71
+ t.text "request", limit: 4294967295
72
+ t.text "response", limit: 4294967295
73
+ t.boolean "locked"
74
+ t.text "request_body", limit: 4294967295
75
+ t.string "request_status", limit: 255
76
+ t.string "response_status", limit: 255
77
+ t.string "type", limit: 255
78
+ t.datetime "created_at"
79
+ t.datetime "updated_at"
80
+ end
81
+
82
+ create_table "gemgento_asset_files", force: :cascade do |t|
83
+ t.string "file_file_name", limit: 255
84
+ t.string "file_content_type", limit: 255
85
+ t.integer "file_file_size", limit: 4
86
+ t.datetime "file_updated_at"
87
+ t.text "file_meta", limit: 65535
88
+ end
89
+
90
+ create_table "gemgento_asset_types", force: :cascade do |t|
91
+ t.integer "product_attribute_set_id", limit: 4
92
+ t.string "code", limit: 255
93
+ t.string "scope", limit: 255
94
+ t.datetime "created_at", null: false
95
+ t.datetime "updated_at", null: false
96
+ end
97
+
98
+ create_table "gemgento_assets", force: :cascade do |t|
99
+ t.integer "product_id", limit: 4
100
+ t.string "url", limit: 255
101
+ t.integer "position", limit: 4
102
+ t.datetime "created_at", null: false
103
+ t.datetime "updated_at", null: false
104
+ t.string "file", limit: 255
105
+ t.string "label", limit: 255
106
+ t.boolean "sync_needed", default: true, null: false
107
+ t.integer "store_id", limit: 4
108
+ t.integer "asset_file_id", limit: 4
109
+ end
110
+
111
+ add_index "gemgento_assets", ["product_id"], name: "index_gemgento_assets_on_product_id", using: :btree
112
+ add_index "gemgento_assets", ["store_id"], name: "index_gemgento_assets_on_store_id", using: :btree
113
+
114
+ create_table "gemgento_assets_asset_types", id: false, force: :cascade do |t|
115
+ t.integer "asset_id", limit: 4, default: 0, null: false
116
+ t.integer "asset_type_id", limit: 4, default: 0, null: false
117
+ end
118
+
119
+ create_table "gemgento_attribute_set_attributes", id: false, force: :cascade do |t|
120
+ t.integer "product_attribute_set_id", limit: 4, default: 0, null: false
121
+ t.integer "product_attribute_id", limit: 4, default: 0, null: false
122
+ end
123
+
124
+ add_index "gemgento_attribute_set_attributes", ["product_attribute_id"], name: "attribute_set_product_attributes_index", using: :btree
125
+ add_index "gemgento_attribute_set_attributes", ["product_attribute_set_id", "product_attribute_id"], name: "attribute_set_attributes_index", unique: true, using: :btree
126
+
127
+ create_table "gemgento_bundle_items", force: :cascade do |t|
128
+ t.integer "bundle_option_id", limit: 4
129
+ t.integer "product_id", limit: 4
130
+ t.integer "magento_id", limit: 4
131
+ t.integer "price_type", limit: 4
132
+ t.float "price_value", limit: 24
133
+ t.float "default_quantity", limit: 24
134
+ t.boolean "is_user_defined_quantity", default: true
135
+ t.integer "position", limit: 4
136
+ t.boolean "is_default"
137
+ t.datetime "created_at"
138
+ t.datetime "updated_at"
139
+ end
140
+
141
+ add_index "gemgento_bundle_items", ["bundle_option_id"], name: "index_gemgento_bundle_items_on_bundle_option_id", using: :btree
142
+ add_index "gemgento_bundle_items", ["product_id"], name: "index_gemgento_bundle_items_on_product_id", using: :btree
143
+
144
+ create_table "gemgento_bundle_options", force: :cascade do |t|
145
+ t.integer "product_id", limit: 4
146
+ t.integer "magento_id", limit: 4
147
+ t.string "name", limit: 255
148
+ t.integer "input_type", limit: 4
149
+ t.boolean "is_required", default: true
150
+ t.integer "position", limit: 4
151
+ t.datetime "created_at"
152
+ t.datetime "updated_at"
153
+ end
154
+
155
+ add_index "gemgento_bundle_options", ["product_id"], name: "index_gemgento_bundle_options_on_product_id", using: :btree
156
+
157
+ create_table "gemgento_categories", force: :cascade do |t|
158
+ t.integer "magento_id", limit: 4
159
+ t.string "name", limit: 255
160
+ t.string "url_key", limit: 255
161
+ t.integer "parent_id", limit: 4
162
+ t.integer "position", limit: 4
163
+ t.boolean "is_active"
164
+ t.datetime "created_at", null: false
165
+ t.datetime "updated_at", null: false
166
+ t.text "all_children", limit: 65535
167
+ t.integer "children_count", limit: 4
168
+ t.boolean "include_in_menu", default: true, null: false
169
+ t.string "image_file_name", limit: 255
170
+ t.string "image_content_type", limit: 255
171
+ t.integer "image_file_size", limit: 4
172
+ t.datetime "image_updated_at"
173
+ t.datetime "deleted_at"
174
+ t.text "image_meta", limit: 65535
175
+ end
176
+
177
+ add_index "gemgento_categories", ["magento_id"], name: "index_gemgento_categories_on_magento_id", unique: true, using: :btree
178
+
179
+ create_table "gemgento_categories_stores", force: :cascade do |t|
180
+ t.integer "category_id", limit: 4
181
+ t.integer "store_id", limit: 4
182
+ end
183
+
184
+ add_index "gemgento_categories_stores", ["category_id", "store_id"], name: "categories_index", unique: true, using: :btree
185
+ add_index "gemgento_categories_stores", ["store_id"], name: "category_store_index", using: :btree
186
+
187
+ create_table "gemgento_configurable_attributes", id: false, force: :cascade do |t|
188
+ t.integer "product_id", limit: 4, default: 0, null: false
189
+ t.integer "product_attribute_id", limit: 4, default: 0, null: false
190
+ end
191
+
192
+ add_index "gemgento_configurable_attributes", ["product_attribute_id"], name: "configurable_attribute_product_attribute_index", using: :btree
193
+ add_index "gemgento_configurable_attributes", ["product_id", "product_attribute_id"], name: "configurable_attributes_index", unique: true, using: :btree
194
+
195
+ create_table "gemgento_configurable_simple_relations", id: false, force: :cascade do |t|
196
+ t.integer "configurable_product_id", limit: 4, default: 0, null: false
197
+ t.integer "simple_product_id", limit: 4, default: 0, null: false
198
+ end
199
+
200
+ add_index "gemgento_configurable_simple_relations", ["configurable_product_id", "simple_product_id"], name: "configurable_simple_index", unique: true, using: :btree
201
+
202
+ create_table "gemgento_countries", force: :cascade do |t|
203
+ t.string "magento_id", limit: 255, null: false
204
+ t.string "iso2_code", limit: 255
205
+ t.string "iso3_code", limit: 255
206
+ t.string "name", limit: 255
207
+ t.datetime "created_at"
208
+ t.datetime "updated_at"
209
+ end
210
+
211
+ create_table "gemgento_gift_messages", force: :cascade do |t|
212
+ t.integer "magento_id", limit: 4
213
+ t.string "to", limit: 255
214
+ t.string "from", limit: 255
215
+ t.text "message", limit: 65535
216
+ end
217
+
218
+ create_table "gemgento_image_imports", force: :cascade do |t|
219
+ t.text "import_errors", limit: 65535
220
+ t.string "spreadsheet_file_name", limit: 255
221
+ t.string "spreadsheet_content_type", limit: 255
222
+ t.integer "spreadsheet_file_size", limit: 4
223
+ t.datetime "spreadsheet_updated_at"
224
+ t.boolean "destroy_existing", default: false
225
+ t.integer "store_id", limit: 4
226
+ t.integer "count_created", limit: 4
227
+ t.integer "count_updated", limit: 4
228
+ t.string "image_path", limit: 255
229
+ t.text "image_labels", limit: 65535
230
+ t.text "image_file_extensions", limit: 65535
231
+ t.text "image_types", limit: 65535
232
+ t.datetime "created_at"
233
+ t.datetime "updated_at"
234
+ t.boolean "is_active", default: false
235
+ end
236
+
237
+ create_table "gemgento_inventories", force: :cascade do |t|
238
+ t.integer "product_id", limit: 4, null: false
239
+ t.integer "quantity", limit: 4, default: 0, null: false
240
+ t.boolean "is_in_stock", default: false, null: false
241
+ t.boolean "sync_needed", default: true, null: false
242
+ t.datetime "created_at"
243
+ t.datetime "updated_at"
244
+ t.integer "store_id", limit: 4
245
+ t.boolean "use_default_website_stock", default: true
246
+ t.integer "backorders", limit: 4, default: 0, null: false
247
+ t.boolean "use_config_backorders", default: true, null: false
248
+ t.integer "min_qty", limit: 4, default: 0, null: false
249
+ t.boolean "use_config_min_qty", default: true, null: false
250
+ t.boolean "manage_stock", default: true
251
+ end
252
+
253
+ add_index "gemgento_inventories", ["product_id", "store_id"], name: "inventories_index", unique: true, using: :btree
254
+ add_index "gemgento_inventories", ["store_id"], name: "inventory_store_index", using: :btree
255
+
256
+ create_table "gemgento_inventory_imports", force: :cascade do |t|
257
+ t.string "spreadsheet_file_name", limit: 255
258
+ t.string "spreadsheet_content_type", limit: 255
259
+ t.integer "spreadsheet_file_size", limit: 4
260
+ t.datetime "spreadsheet_updated_at"
261
+ t.text "import_errors", limit: 65535
262
+ t.boolean "is_active", default: true
263
+ end
264
+
265
+ create_table "gemgento_line_item_options", force: :cascade do |t|
266
+ t.integer "line_item_id", limit: 4
267
+ t.integer "bundle_item_id", limit: 4
268
+ t.float "quantity", limit: 24
269
+ end
270
+
271
+ add_index "gemgento_line_item_options", ["bundle_item_id"], name: "index_gemgento_line_item_options_on_bundle_item_id", using: :btree
272
+ add_index "gemgento_line_item_options", ["line_item_id"], name: "index_gemgento_line_item_options_on_line_item_id", using: :btree
273
+
274
+ create_table "gemgento_line_items", force: :cascade do |t|
275
+ t.integer "magento_id", limit: 4
276
+ t.string "itemizable_type", limit: 255, default: "Gemgento::Order"
277
+ t.integer "itemizable_id", limit: 4
278
+ t.integer "quote_item_id", limit: 4
279
+ t.integer "product_id", limit: 4
280
+ t.string "product_type", limit: 255
281
+ t.text "product_options", limit: 65535
282
+ t.decimal "weight", precision: 12, scale: 4
283
+ t.boolean "is_virtual"
284
+ t.string "sku", limit: 255
285
+ t.string "name", limit: 255
286
+ t.string "applied_rule_ids", limit: 255
287
+ t.boolean "free_shipping"
288
+ t.boolean "is_qty_decimal"
289
+ t.boolean "no_discount"
290
+ t.decimal "qty_canceled", precision: 12, scale: 4
291
+ t.decimal "qty_invoiced", precision: 12, scale: 4
292
+ t.decimal "qty_ordered", precision: 12, scale: 4
293
+ t.decimal "qty_refunded", precision: 12, scale: 4
294
+ t.decimal "qty_shipped", precision: 12, scale: 4
295
+ t.decimal "cost", precision: 12, scale: 4
296
+ t.decimal "price", precision: 12, scale: 4
297
+ t.decimal "base_price", precision: 12, scale: 4
298
+ t.decimal "original_price", precision: 12, scale: 4
299
+ t.decimal "base_original_price", precision: 12, scale: 4
300
+ t.decimal "tax_percent", precision: 12, scale: 4
301
+ t.decimal "tax_amount", precision: 12, scale: 4
302
+ t.decimal "base_tax_amount", precision: 12, scale: 4
303
+ t.decimal "tax_invoiced", precision: 12, scale: 4
304
+ t.decimal "base_tax_invoiced", precision: 12, scale: 4
305
+ t.decimal "discount_percent", precision: 12, scale: 4
306
+ t.decimal "discount_amount", precision: 12, scale: 4
307
+ t.decimal "base_discount_amount", precision: 12, scale: 4
308
+ t.decimal "discount_invoiced", precision: 12, scale: 4
309
+ t.decimal "base_discount_invoiced", precision: 12, scale: 4
310
+ t.decimal "amount_refunded", precision: 12, scale: 4
311
+ t.decimal "base_amount_refunded", precision: 12, scale: 4
312
+ t.decimal "row_total", precision: 12, scale: 4
313
+ t.decimal "base_row_total", precision: 12, scale: 4
314
+ t.decimal "row_invoiced", precision: 12, scale: 4
315
+ t.decimal "base_row_invoiced", precision: 12, scale: 4
316
+ t.decimal "row_weight", precision: 12, scale: 4
317
+ t.string "gift_message_id", limit: 255
318
+ t.string "gift_message", limit: 255
319
+ t.string "gift_message_available", limit: 255
320
+ t.decimal "base_tax_before_discount", precision: 12, scale: 4
321
+ t.decimal "tax_before_discount", precision: 12, scale: 4
322
+ t.decimal "weee_tax_applied", precision: 12, scale: 4
323
+ t.decimal "weee_tax_applied_amount", precision: 12, scale: 4
324
+ t.decimal "weee_tax_applied_row_amount", precision: 12, scale: 4
325
+ t.decimal "base_weee_tax_applied_amount", precision: 12, scale: 4
326
+ t.decimal "base_weee_tax_applied_row_amount", precision: 12, scale: 4
327
+ t.decimal "weee_tax_disposition", precision: 12, scale: 4
328
+ t.decimal "weee_tax_row_disposition", precision: 12, scale: 4
329
+ t.decimal "base_weee_tax_disposition", precision: 12, scale: 4
330
+ t.decimal "base_weee_tax_row_disposition", precision: 12, scale: 4
331
+ t.datetime "created_at"
332
+ t.datetime "updated_at"
333
+ t.text "options", limit: 65535
334
+ end
335
+
336
+ add_index "gemgento_line_items", ["itemizable_id"], name: "order_items_index", using: :btree
337
+ add_index "gemgento_line_items", ["itemizable_type", "itemizable_id"], name: "index_gemgento_line_items_on_itemizable_type_and_itemizable_id", using: :btree
338
+ add_index "gemgento_line_items", ["magento_id", "itemizable_type"], name: "index_gemgento_line_items_on_magento_id_and_itemizable_type", unique: true, using: :btree
339
+
340
+ create_table "gemgento_magento_responses", force: :cascade do |t|
341
+ t.text "request", limit: 65535
342
+ t.text "body", limit: 16777215
343
+ t.datetime "created_at"
344
+ t.datetime "updated_at"
345
+ t.boolean "success", default: true, null: false
346
+ end
347
+
348
+ create_table "gemgento_order_statuses", force: :cascade do |t|
349
+ t.integer "order_id", limit: 4, null: false
350
+ t.integer "increment_id", limit: 4
351
+ t.boolean "is_active", default: true
352
+ t.integer "is_customer_notified", limit: 4, default: 1
353
+ t.string "status", limit: 255
354
+ t.string "comment", limit: 255
355
+ t.datetime "created_at"
356
+ t.datetime "updated_at"
357
+ end
358
+
359
+ add_index "gemgento_order_statuses", ["order_id"], name: "order_statuses_index", using: :btree
360
+
361
+ create_table "gemgento_orders", force: :cascade do |t|
362
+ t.integer "magento_id", limit: 4
363
+ t.integer "store_id", limit: 4, null: false
364
+ t.integer "user_id", limit: 4
365
+ t.decimal "tax_amount", precision: 12, scale: 4
366
+ t.decimal "shipping_amount", precision: 12, scale: 4
367
+ t.decimal "discount_amount", precision: 12, scale: 4
368
+ t.decimal "subtotal", precision: 12, scale: 4
369
+ t.decimal "grand_total", precision: 12, scale: 4
370
+ t.decimal "total_paid", precision: 12, scale: 4
371
+ t.decimal "total_refunded", precision: 12, scale: 4
372
+ t.decimal "total_qty_ordered", precision: 12, scale: 4
373
+ t.decimal "total_canceled", precision: 12, scale: 4
374
+ t.decimal "total_invoiced", precision: 12, scale: 4
375
+ t.decimal "total_online_refunded", precision: 12, scale: 4
376
+ t.decimal "total_offline_refunded", precision: 12, scale: 4
377
+ t.decimal "base_tax_amount", precision: 12, scale: 4
378
+ t.decimal "base_shipping_amount", precision: 12, scale: 4
379
+ t.decimal "base_discount_amount", precision: 12, scale: 4
380
+ t.decimal "base_subtotal", precision: 12, scale: 4
381
+ t.decimal "base_grand_total", precision: 12, scale: 4
382
+ t.decimal "base_total_paid", precision: 12, scale: 4
383
+ t.decimal "base_total_refunded", precision: 12, scale: 4
384
+ t.decimal "base_total_qty_ordered", precision: 12, scale: 4
385
+ t.decimal "base_total_canceled", precision: 12, scale: 4
386
+ t.decimal "base_total_invoiced", precision: 12, scale: 4
387
+ t.decimal "base_total_online_refunded", precision: 12, scale: 4
388
+ t.decimal "base_total_offline_refunded", precision: 12, scale: 4
389
+ t.integer "billing_address_id", limit: 4
390
+ t.string "billing_first_name", limit: 255
391
+ t.string "billing_last_name", limit: 255
392
+ t.integer "shipping_address_id", limit: 4
393
+ t.string "shipping_first_name", limit: 255
394
+ t.string "shipping_last_name", limit: 255
395
+ t.string "billing_name", limit: 255
396
+ t.string "shipping_name", limit: 255
397
+ t.string "store_to_base_rate", limit: 255
398
+ t.string "store_to_order_rate", limit: 255
399
+ t.string "base_to_global_rate", limit: 255
400
+ t.string "base_to_order_rate", limit: 255
401
+ t.decimal "weight", precision: 12, scale: 4
402
+ t.string "store_name", limit: 255
403
+ t.string "remote_ip", limit: 255
404
+ t.string "status", limit: 255
405
+ t.string "state", limit: 255
406
+ t.string "applied_rule_ids", limit: 255
407
+ t.string "global_currency_code", limit: 255
408
+ t.string "base_currency_code", limit: 255
409
+ t.string "store_currency_code", limit: 255
410
+ t.string "order_currency_code", limit: 255
411
+ t.string "shipping_method", limit: 255
412
+ t.string "shipping_description", limit: 255
413
+ t.string "customer_email", limit: 255
414
+ t.string "customer_firstname", limit: 255
415
+ t.string "customer_lastname", limit: 255
416
+ t.boolean "is_virtual"
417
+ t.integer "user_group_id", limit: 4
418
+ t.string "customer_note_notify", limit: 255
419
+ t.boolean "customer_is_guest"
420
+ t.boolean "email_sent"
421
+ t.string "increment_id", limit: 255
422
+ t.string "gift_message_id", limit: 255
423
+ t.string "gift_message", limit: 255
424
+ t.datetime "created_at"
425
+ t.datetime "updated_at"
426
+ t.datetime "placed_at"
427
+ t.integer "quote_id", limit: 4
428
+ t.decimal "base_giftvoucher_discount_for_shipping", precision: 10
429
+ t.decimal "giftvoucher_discount_for_shipping", precision: 10
430
+ t.decimal "base_giftcredit_discount_for_shipping", precision: 10
431
+ t.decimal "giftcredit_discount_for_shipping", precision: 10
432
+ t.decimal "base_gift_voucher_discount", precision: 10
433
+ t.decimal "gift_voucher_discount", precision: 10
434
+ t.decimal "base_use_gift_credit_amount", precision: 10
435
+ t.decimal "use_gift_credit_amount", precision: 10
436
+ t.decimal "giftvoucher_base_hidden_tax_amount", precision: 10
437
+ t.decimal "giftvoucher_hidden_tax_amount", precision: 10
438
+ t.decimal "giftcredit_base_hidden_tax_amount", precision: 10
439
+ t.decimal "giftcredit_hidden_tax_amount", precision: 10
440
+ t.decimal "giftcredit_base_shipping_hidden_tax_amount", precision: 10
441
+ t.decimal "giftcredit_shipping_hidden_tax_amount", precision: 10
442
+ end
443
+
444
+ add_index "gemgento_orders", ["increment_id"], name: "index_gemgento_orders_on_increment_id", unique: true, using: :btree
445
+ add_index "gemgento_orders", ["magento_id"], name: "index_gemgento_orders_on_magento_id", unique: true, using: :btree
446
+ add_index "gemgento_orders", ["quote_id"], name: "index_gemgento_orders_on_quote_id", using: :btree
447
+
448
+ create_table "gemgento_orders_recurring_profiles", id: false, force: :cascade do |t|
449
+ t.integer "order_id", limit: 4
450
+ t.integer "recurring_profile_id", limit: 4
451
+ end
452
+
453
+ add_index "gemgento_orders_recurring_profiles", ["order_id", "recurring_profile_id"], name: "order_recurring_profile_index", using: :btree
454
+ add_index "gemgento_orders_recurring_profiles", ["recurring_profile_id"], name: "recurring_profile_index", using: :btree
455
+
456
+ create_table "gemgento_payments", force: :cascade do |t|
457
+ t.integer "magento_id", limit: 4
458
+ t.string "payable_type", limit: 255, default: "Gemgento::Order"
459
+ t.integer "payable_id", limit: 4, null: false
460
+ t.integer "increment_id", limit: 4
461
+ t.boolean "is_active", default: true
462
+ t.decimal "amount_ordered", precision: 12, scale: 4
463
+ t.decimal "shipping_amount", precision: 12, scale: 4
464
+ t.decimal "base_amount_ordered", precision: 12, scale: 4
465
+ t.decimal "base_shipping_amount", precision: 12, scale: 4
466
+ t.string "method", limit: 255
467
+ t.string "po_number", limit: 255
468
+ t.string "cc_type", limit: 255
469
+ t.string "cc_number_enc", limit: 255
470
+ t.string "cc_last4", limit: 255
471
+ t.string "cc_owner", limit: 255
472
+ t.string "cc_exp_month", limit: 255
473
+ t.string "cc_exp_year", limit: 255
474
+ t.string "cc_ss_start_month", limit: 255
475
+ t.string "cc_ss_start_year", limit: 255
476
+ t.datetime "created_at"
477
+ t.datetime "updated_at"
478
+ end
479
+
480
+ add_index "gemgento_payments", ["payable_id"], name: "order_payments_index", using: :btree
481
+ add_index "gemgento_payments", ["payable_type", "payable_id"], name: "index_gemgento_payments_on_payable_type_and_payable_id", using: :btree
482
+
483
+ create_table "gemgento_price_rules", force: :cascade do |t|
484
+ t.integer "magento_id", limit: 4
485
+ t.string "name", limit: 255
486
+ t.text "description", limit: 65535
487
+ t.datetime "from_date"
488
+ t.datetime "to_date"
489
+ t.boolean "is_active", default: false, null: false
490
+ t.boolean "stop_rules_processing", default: true, null: false
491
+ t.integer "sort_order", limit: 4
492
+ t.string "simple_action", limit: 255
493
+ t.decimal "discount_amount", precision: 10
494
+ t.boolean "sub_is_enable", default: false, null: false
495
+ t.string "sub_simple_action", limit: 255
496
+ t.decimal "sub_discount_amount", precision: 10
497
+ t.text "conditions", limit: 65535
498
+ end
499
+
500
+ create_table "gemgento_price_rules_stores", id: false, force: :cascade do |t|
501
+ t.integer "price_rule_id", limit: 4
502
+ t.integer "store_id", limit: 4
503
+ end
504
+
505
+ add_index "gemgento_price_rules_stores", ["price_rule_id", "store_id"], name: "index_gemgento_price_rules_stores_on_price_rule_id_and_store_id", using: :btree
506
+ add_index "gemgento_price_rules_stores", ["store_id"], name: "index_gemgento_price_rules_stores_on_store_id", using: :btree
507
+
508
+ create_table "gemgento_price_rules_user_groups", force: :cascade do |t|
509
+ t.integer "price_rule_id", limit: 4
510
+ t.integer "user_group_id", limit: 4
511
+ end
512
+
513
+ add_index "gemgento_price_rules_user_groups", ["price_rule_id", "user_group_id"], name: "price_rule_user_group_index", using: :btree
514
+ add_index "gemgento_price_rules_user_groups", ["user_group_id"], name: "user_group_index", using: :btree
515
+
516
+ create_table "gemgento_price_tiers", force: :cascade do |t|
517
+ t.integer "product_id", limit: 4
518
+ t.integer "store_id", limit: 4
519
+ t.integer "user_group_id", limit: 4
520
+ t.decimal "quantity", precision: 5, scale: 2
521
+ t.decimal "price", precision: 5, scale: 2
522
+ end
523
+
524
+ add_index "gemgento_price_tiers", ["product_id"], name: "index_gemgento_price_tiers_on_product_id", using: :btree
525
+ add_index "gemgento_price_tiers", ["store_id"], name: "index_gemgento_price_tiers_on_store_id", using: :btree
526
+ add_index "gemgento_price_tiers", ["user_group_id"], name: "index_gemgento_price_tiers_on_user_group_id", using: :btree
527
+
528
+ create_table "gemgento_product_attribute_options", force: :cascade do |t|
529
+ t.integer "product_attribute_id", limit: 4
530
+ t.string "label", limit: 255
531
+ t.string "value", limit: 255
532
+ t.boolean "sync_needed", default: true, null: false
533
+ t.datetime "created_at", null: false
534
+ t.datetime "updated_at", null: false
535
+ t.integer "order", limit: 4
536
+ t.integer "store_id", limit: 4
537
+ end
538
+
539
+ add_index "gemgento_product_attribute_options", ["product_attribute_id", "store_id"], name: "attribute_options_index", using: :btree
540
+ add_index "gemgento_product_attribute_options", ["store_id"], name: "product_attribute_option_store_index", using: :btree
541
+
542
+ create_table "gemgento_product_attribute_sets", force: :cascade do |t|
543
+ t.integer "magento_id", limit: 4
544
+ t.string "name", limit: 255
545
+ t.datetime "created_at", null: false
546
+ t.datetime "updated_at", null: false
547
+ t.boolean "sync_needed", default: true, null: false
548
+ t.datetime "deleted_at"
549
+ end
550
+
551
+ create_table "gemgento_product_attribute_values", force: :cascade do |t|
552
+ t.integer "product_id", limit: 4
553
+ t.integer "product_attribute_id", limit: 4
554
+ t.text "value", limit: 65535
555
+ t.datetime "created_at", null: false
556
+ t.datetime "updated_at", null: false
557
+ t.integer "store_id", limit: 4
558
+ end
559
+
560
+ add_index "gemgento_product_attribute_values", ["product_attribute_id"], name: "product_attribute_values_product_attribute_index", using: :btree
561
+ add_index "gemgento_product_attribute_values", ["product_id"], name: "product_attribute_values_index", using: :btree
562
+
563
+ create_table "gemgento_product_attributes", force: :cascade do |t|
564
+ t.integer "magento_id", limit: 4
565
+ t.string "code", limit: 255
566
+ t.string "frontend_input", limit: 255
567
+ t.string "scope", limit: 255
568
+ t.boolean "is_unique"
569
+ t.boolean "is_required"
570
+ t.boolean "is_configurable"
571
+ t.boolean "is_searchable"
572
+ t.boolean "is_visible_in_advanced_search"
573
+ t.boolean "is_comparable"
574
+ t.boolean "is_used_for_promo_rules"
575
+ t.boolean "is_visible_on_front"
576
+ t.boolean "used_in_product_listing"
577
+ t.boolean "sync_needed", default: true, null: false
578
+ t.datetime "created_at", null: false
579
+ t.datetime "updated_at", null: false
580
+ t.text "default_value", limit: 65535
581
+ t.datetime "deleted_at"
582
+ end
583
+
584
+ create_table "gemgento_product_categories", force: :cascade do |t|
585
+ t.integer "category_id", limit: 4
586
+ t.integer "product_id", limit: 4
587
+ t.integer "position", limit: 4, default: 0, null: false
588
+ t.datetime "created_at"
589
+ t.datetime "updated_at"
590
+ t.integer "store_id", limit: 4
591
+ end
592
+
593
+ add_index "gemgento_product_categories", ["category_id"], name: "product_categories_category_index", using: :btree
594
+ add_index "gemgento_product_categories", ["product_id", "category_id", "store_id"], name: "uniqueness_constraint", unique: true, using: :btree
595
+ add_index "gemgento_product_categories", ["product_id"], name: "product_categories_product_index", using: :btree
596
+
597
+ create_table "gemgento_product_imports", force: :cascade do |t|
598
+ t.text "import_errors", limit: 65535
599
+ t.datetime "created_at"
600
+ t.datetime "updated_at"
601
+ t.string "spreadsheet_file_name", limit: 255
602
+ t.string "spreadsheet_content_type", limit: 255
603
+ t.integer "spreadsheet_file_size", limit: 4
604
+ t.datetime "spreadsheet_updated_at"
605
+ t.boolean "include_images"
606
+ t.string "image_path", limit: 255
607
+ t.text "image_labels", limit: 65535
608
+ t.integer "store_id", limit: 4
609
+ t.integer "root_category_id", limit: 4
610
+ t.integer "product_attribute_set_id", limit: 4
611
+ t.integer "count_created", limit: 4
612
+ t.integer "count_updated", limit: 4
613
+ t.integer "simple_product_visibility", limit: 4
614
+ t.integer "configurable_product_visibility", limit: 4
615
+ t.text "image_file_extensions", limit: 65535
616
+ t.text "image_types", limit: 65535
617
+ t.boolean "set_default_inventory_values", default: false
618
+ end
619
+
620
+ create_table "gemgento_product_imports_configurable_attributes", id: false, force: :cascade do |t|
621
+ t.integer "product_import_id", limit: 4, default: 0, null: false
622
+ t.integer "product_attribute_id", limit: 4, default: 0, null: false
623
+ end
624
+
625
+ create_table "gemgento_products", force: :cascade do |t|
626
+ t.integer "magento_id", limit: 4
627
+ t.string "magento_type", limit: 255
628
+ t.datetime "created_at", null: false
629
+ t.datetime "updated_at", null: false
630
+ t.string "sku", limit: 255
631
+ t.string "product_attribute_set_id", limit: 255
632
+ t.boolean "status", default: true
633
+ t.integer "visibility", limit: 4, default: 4
634
+ t.datetime "deleted_at"
635
+ t.datetime "cache_expires_at"
636
+ end
637
+
638
+ create_table "gemgento_products_tags", id: false, force: :cascade do |t|
639
+ t.integer "product_id", limit: 4
640
+ t.integer "tag_id", limit: 4
641
+ end
642
+
643
+ add_index "gemgento_products_tags", ["product_id", "tag_id"], name: "index_gemgento_products_tags_on_product_id_and_tag_id", using: :btree
644
+ add_index "gemgento_products_tags", ["tag_id"], name: "index_gemgento_products_tags_on_tag_id", using: :btree
645
+
646
+ create_table "gemgento_quotes", force: :cascade do |t|
647
+ t.integer "magento_id", limit: 4
648
+ t.integer "store_id", limit: 4
649
+ t.integer "user_id", limit: 4
650
+ t.integer "user_group_id", limit: 4
651
+ t.datetime "converted_at"
652
+ t.datetime "created_at"
653
+ t.datetime "updated_at"
654
+ t.boolean "is_active", default: true
655
+ t.boolean "is_virtual", default: false
656
+ t.boolean "is_multi_shipping", default: false
657
+ t.string "original_order_id", limit: 255
658
+ t.decimal "store_to_base_rate", precision: 12, scale: 4, default: 1.0
659
+ t.decimal "store_to_quote_rate", precision: 12, scale: 4, default: 1.0
660
+ t.string "base_currency_code", limit: 255
661
+ t.string "store_currency_code", limit: 255
662
+ t.string "quote_currency_code", limit: 255
663
+ t.decimal "grand_total", precision: 12, scale: 4
664
+ t.decimal "base_grand_total", precision: 12, scale: 4
665
+ t.string "checkout_method", limit: 255
666
+ t.string "customer_email", limit: 255
667
+ t.string "customer_prefix", limit: 255
668
+ t.string "customer_first_name", limit: 255
669
+ t.string "customer_middle_name", limit: 255
670
+ t.string "customer_last_name", limit: 255
671
+ t.string "customer_suffix", limit: 255
672
+ t.text "customer_note", limit: 65535
673
+ t.boolean "customer_note_notify", default: false
674
+ t.boolean "customer_is_guest", default: false
675
+ t.string "applied_rule_ids", limit: 255
676
+ t.string "reserved_order_id", limit: 255
677
+ t.string "password_hash", limit: 255
678
+ t.string "coupon_code", limit: 255
679
+ t.string "global_currency_code", limit: 255
680
+ t.decimal "base_to_global_rate", precision: 12, scale: 4, default: 1.0
681
+ t.decimal "base_to_order_rate", precision: 12, scale: 4, default: 1.0
682
+ t.string "customer_taxvat", limit: 255
683
+ t.string "customer_gender", limit: 255
684
+ t.decimal "subtotal", precision: 12, scale: 4
685
+ t.decimal "base_subtotal", precision: 12, scale: 4
686
+ t.decimal "base_subtotal_with_discount", precision: 12, scale: 4
687
+ t.string "shipping_method", limit: 255
688
+ t.text "ext_shipping_info", limit: 65535
689
+ t.decimal "shipping_amount", precision: 12, scale: 4
690
+ t.integer "gift_message_id", limit: 4
691
+ t.text "gift_message", limit: 65535
692
+ t.decimal "customer_balance_amount_used", precision: 12, scale: 4
693
+ t.decimal "base_customer_balance_amount_used", precision: 12, scale: 4
694
+ t.boolean "use_customer_balance", default: false
695
+ t.decimal "gift_cards_amount", precision: 12, scale: 4
696
+ t.decimal "base_gift_cards_amount", precision: 12, scale: 4
697
+ t.boolean "use_reward_points", default: false
698
+ t.decimal "reward_points_balance", precision: 12, scale: 4
699
+ t.decimal "reward_currency_amount", precision: 12, scale: 4
700
+ t.decimal "base_reward_currency_amount", precision: 12, scale: 4
701
+ t.text "coupon_codes", limit: 65535
702
+ t.text "gift_card_codes", limit: 65535
703
+ end
704
+
705
+ create_table "gemgento_recurring_profiles", force: :cascade do |t|
706
+ t.integer "magento_id", limit: 4
707
+ t.string "state", limit: 255
708
+ t.integer "user_id", limit: 4
709
+ t.integer "store_id", limit: 4
710
+ t.string "method_code", limit: 255
711
+ t.integer "reference_id", limit: 4
712
+ t.string "subscriber_name", limit: 255
713
+ t.datetime "start_datetime"
714
+ t.string "internal_reference_id", limit: 255
715
+ t.string "schedule_description", limit: 255
716
+ t.string "period_unit", limit: 255
717
+ t.integer "period_frequency", limit: 4
718
+ t.decimal "billing_amount", precision: 8, scale: 2
719
+ t.string "currency_code", limit: 255
720
+ t.decimal "shipping_amount", precision: 8, scale: 2
721
+ t.decimal "tax_amount", precision: 8, scale: 2
722
+ t.text "order_info", limit: 65535
723
+ t.text "order_item_info", limit: 65535
724
+ t.text "billing_address_info", limit: 65535
725
+ t.text "shipping_address_info", limit: 65535
726
+ t.text "profile_vendor_info", limit: 65535
727
+ t.text "additional_info", limit: 65535
728
+ end
729
+
730
+ add_index "gemgento_recurring_profiles", ["store_id"], name: "index_gemgento_recurring_profiles_on_store_id", using: :btree
731
+ add_index "gemgento_recurring_profiles", ["user_id"], name: "index_gemgento_recurring_profiles_on_user_id", using: :btree
732
+
733
+ create_table "gemgento_regions", force: :cascade do |t|
734
+ t.integer "magento_id", limit: 4, null: false
735
+ t.string "code", limit: 255
736
+ t.string "name", limit: 255
737
+ t.integer "country_id", limit: 4
738
+ t.datetime "created_at"
739
+ t.datetime "updated_at"
740
+ end
741
+
742
+ create_table "gemgento_relation_types", force: :cascade do |t|
743
+ t.string "name", limit: 255
744
+ t.text "description", limit: 65535
745
+ t.string "applies_to", limit: 255
746
+ t.datetime "created_at", null: false
747
+ t.datetime "updated_at", null: false
748
+ end
749
+
750
+ create_table "gemgento_relations", force: :cascade do |t|
751
+ t.integer "relation_type_id", limit: 4
752
+ t.integer "relatable_id", limit: 4
753
+ t.string "relatable_type", limit: 255
754
+ t.integer "related_to_id", limit: 4
755
+ t.string "related_to_type", limit: 255
756
+ t.datetime "created_at", null: false
757
+ t.datetime "updated_at", null: false
758
+ end
759
+
760
+ create_table "gemgento_saved_credit_cards", force: :cascade do |t|
761
+ t.integer "magento_id", limit: 4
762
+ t.integer "user_id", limit: 4
763
+ t.string "token", limit: 255
764
+ t.string "cc_number", limit: 255
765
+ t.integer "exp_month", limit: 4
766
+ t.integer "exp_year", limit: 4
767
+ t.string "cc_type", limit: 255
768
+ t.datetime "created_at"
769
+ t.datetime "updated_at"
770
+ t.boolean "is_in_use", default: false
771
+ end
772
+
773
+ create_table "gemgento_sessions", force: :cascade do |t|
774
+ t.string "session_id", limit: 255
775
+ t.datetime "created_at", null: false
776
+ t.datetime "updated_at", null: false
777
+ end
778
+
779
+ create_table "gemgento_shipment_comments", force: :cascade do |t|
780
+ t.integer "shipment_id", limit: 4
781
+ t.text "comment", limit: 65535
782
+ t.boolean "is_customer_notified"
783
+ t.integer "magento_id", limit: 4
784
+ t.datetime "created_at"
785
+ t.datetime "updated_at"
786
+ end
787
+
788
+ create_table "gemgento_shipment_items", force: :cascade do |t|
789
+ t.integer "shipment_id", limit: 4
790
+ t.string "sku", limit: 255
791
+ t.string "name", limit: 255
792
+ t.integer "line_item_id", limit: 4
793
+ t.integer "product_id", limit: 4
794
+ t.float "weight", limit: 24
795
+ t.float "price", limit: 24
796
+ t.float "qty", limit: 24
797
+ t.integer "magento_id", limit: 4
798
+ t.decimal "quantity", precision: 10, default: 0, null: false
799
+ end
800
+
801
+ add_index "gemgento_shipment_items", ["shipment_id"], name: "shipment_items_shipment_id", using: :btree
802
+
803
+ create_table "gemgento_shipment_tracks", force: :cascade do |t|
804
+ t.integer "shipment_id", limit: 4
805
+ t.string "carrier_code", limit: 255
806
+ t.string "title", limit: 255
807
+ t.string "number", limit: 255
808
+ t.integer "order_id", limit: 4
809
+ t.integer "magento_id", limit: 4
810
+ end
811
+
812
+ add_index "gemgento_shipment_tracks", ["shipment_id"], name: "shipment_tracks_shipment_index", using: :btree
813
+
814
+ create_table "gemgento_shipments", force: :cascade do |t|
815
+ t.integer "magento_id", limit: 4
816
+ t.integer "order_id", limit: 4
817
+ t.string "increment_id", limit: 255
818
+ t.integer "store_id", limit: 4
819
+ t.integer "shipping_address_id", limit: 4
820
+ t.float "total_qty", limit: 24
821
+ t.datetime "created_at"
822
+ t.datetime "updated_at"
823
+ end
824
+
825
+ add_index "gemgento_shipments", ["order_id"], name: "shipments_order_index", using: :btree
826
+
827
+ create_table "gemgento_shopify_adapters", force: :cascade do |t|
828
+ t.integer "gemgento_model_id", limit: 4
829
+ t.string "gemgento_model_type", limit: 255
830
+ t.string "shopify_model_type", limit: 255
831
+ t.integer "shopify_model_id", limit: 4
832
+ t.datetime "created_at"
833
+ t.datetime "updated_at"
834
+ end
835
+
836
+ add_index "gemgento_shopify_adapters", ["gemgento_model_id", "gemgento_model_type"], name: "gemgento_model_index", using: :btree
837
+ add_index "gemgento_shopify_adapters", ["shopify_model_id", "shopify_model_type"], name: "shopify_model_index", using: :btree
838
+
839
+ create_table "gemgento_stock_notifications", force: :cascade do |t|
840
+ t.integer "product_id", limit: 4
841
+ t.string "product_name", limit: 255
842
+ t.string "product_url", limit: 255
843
+ t.string "name", limit: 255
844
+ t.string "email", limit: 255
845
+ t.string "phone", limit: 255
846
+ t.datetime "created_at"
847
+ t.datetime "updated_at"
848
+ end
849
+
850
+ create_table "gemgento_store_tags", force: :cascade do |t|
851
+ t.integer "store_id", limit: 4
852
+ t.integer "tag_id", limit: 4
853
+ t.integer "base_popularity", limit: 4, default: 0
854
+ end
855
+
856
+ add_index "gemgento_store_tags", ["store_id"], name: "index_gemgento_store_tags_on_store_id", using: :btree
857
+ add_index "gemgento_store_tags", ["tag_id"], name: "index_gemgento_store_tags_on_tag_id", using: :btree
858
+
859
+ create_table "gemgento_stores", force: :cascade do |t|
860
+ t.integer "magento_id", limit: 4, null: false
861
+ t.string "code", limit: 255
862
+ t.integer "group_id", limit: 4
863
+ t.string "name", limit: 255
864
+ t.integer "sort_order", limit: 4
865
+ t.boolean "is_active", default: true, null: false
866
+ t.datetime "created_at"
867
+ t.datetime "updated_at"
868
+ t.integer "website_id", limit: 4
869
+ t.string "currency_code", limit: 255, default: "usd"
870
+ end
871
+
872
+ add_index "gemgento_stores", ["magento_id"], name: "index_gemgento_stores_on_magento_id", unique: true, using: :btree
873
+
874
+ create_table "gemgento_stores_products", force: :cascade do |t|
875
+ t.integer "product_id", limit: 4
876
+ t.integer "store_id", limit: 4
877
+ end
878
+
879
+ add_index "gemgento_stores_products", ["product_id", "store_id"], name: "stores_products_index", unique: true, using: :btree
880
+ add_index "gemgento_stores_products", ["store_id"], name: "store_product_store_index", using: :btree
881
+
882
+ create_table "gemgento_stores_users", force: :cascade do |t|
883
+ t.integer "store_id", limit: 4
884
+ t.integer "user_id", limit: 4
885
+ end
886
+
887
+ create_table "gemgento_subscribers", force: :cascade do |t|
888
+ t.string "first_name", limit: 255
889
+ t.string "last_name", limit: 255
890
+ t.string "email", limit: 255
891
+ t.integer "country_id", limit: 4
892
+ t.string "city", limit: 255
893
+ t.datetime "created_at"
894
+ t.datetime "updated_at"
895
+ end
896
+
897
+ create_table "gemgento_syncs", force: :cascade do |t|
898
+ t.string "subject", limit: 255
899
+ t.datetime "created_at"
900
+ t.datetime "updated_at"
901
+ t.boolean "is_complete", default: false
902
+ end
903
+
904
+ create_table "gemgento_tags", force: :cascade do |t|
905
+ t.integer "magento_id", limit: 4
906
+ t.string "name", limit: 255
907
+ t.string "status", limit: 255, default: "0"
908
+ t.boolean "sync_needed", default: false
909
+ end
910
+
911
+ create_table "gemgento_user_groups", force: :cascade do |t|
912
+ t.integer "magento_id", limit: 4
913
+ t.string "code", limit: 255
914
+ t.datetime "created_at", null: false
915
+ t.datetime "updated_at", null: false
916
+ end
917
+
918
+ create_table "gemgento_users", force: :cascade do |t|
919
+ t.integer "magento_id", limit: 4
920
+ t.string "created_in", limit: 255
921
+ t.string "email", limit: 255, default: "", null: false
922
+ t.string "first_name", limit: 255
923
+ t.string "last_name", limit: 255
924
+ t.string "middle_name", limit: 255
925
+ t.integer "user_group_id", limit: 4
926
+ t.string "prefix", limit: 255
927
+ t.string "suffix", limit: 255
928
+ t.date "dob"
929
+ t.string "taxvat", limit: 255
930
+ t.boolean "confirmation"
931
+ t.string "magento_password", limit: 255
932
+ t.datetime "created_at"
933
+ t.datetime "updated_at"
934
+ t.integer "increment_id", limit: 4
935
+ t.string "encrypted_password", limit: 255, default: "", null: false
936
+ t.string "reset_password_token", limit: 255
937
+ t.datetime "reset_password_sent_at"
938
+ t.datetime "remember_created_at"
939
+ t.integer "sign_in_count", limit: 4, default: 0
940
+ t.datetime "current_sign_in_at"
941
+ t.datetime "last_sign_in_at"
942
+ t.string "current_sign_in_ip", limit: 255
943
+ t.string "last_sign_in_ip", limit: 255
944
+ t.string "unencrypted_password", limit: 255
945
+ t.string "type", limit: 255
946
+ t.string "gender", limit: 255
947
+ t.datetime "deleted_at"
948
+ end
949
+
950
+ add_index "gemgento_users", ["email", "deleted_at"], name: "users_email_deleted_index", unique: true, using: :btree
951
+ add_index "gemgento_users", ["magento_id"], name: "index_gemgento_users_on_magento_id", unique: true, using: :btree
952
+ add_index "gemgento_users", ["reset_password_token"], name: "index_gemgento_users_on_reset_password_token", unique: true, using: :btree
953
+
954
+ create_table "gemgento_wishlist_items", force: :cascade do |t|
955
+ t.integer "product_id", limit: 4
956
+ t.integer "user_id", limit: 4
957
+ t.datetime "created_at"
958
+ t.datetime "updated_at"
959
+ end
960
+ end
961
+
962
+ def migrate(direction)
963
+ if direction == :up
964
+ super unless ActiveRecord::Base.connection.table_exists?('gemgento_stores')
965
+ else
966
+ super
967
+ end
968
+ end
969
+ end