spree_order_reporting 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (362) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +26 -0
  3. data/README.md +100 -0
  4. data/Rakefile +38 -0
  5. data/app/assets/javascripts/spree/backend/order_reporting.js +2 -0
  6. data/app/assets/javascripts/spree/frontend/order_reporting.js +2 -0
  7. data/app/assets/stylesheets/spree/backend/order_reporting.css +4 -0
  8. data/app/assets/stylesheets/spree/frontend/order_reporting.css +4 -0
  9. data/app/jobs/order_reporting/recurring_report_delayed_job.rb +11 -0
  10. data/config/locales/en.yml +5 -0
  11. data/config/routes.rb +3 -0
  12. data/lib/generators/order_reporting/install/install_generator.rb +30 -0
  13. data/lib/order_reporting.rb +27 -0
  14. data/lib/order_reporting/engine.rb +20 -0
  15. data/lib/order_reporting/factories.rb +6 -0
  16. data/lib/order_reporting/queries/latest_orders_query.rb +7 -0
  17. data/lib/order_reporting/report.rb +25 -0
  18. data/lib/order_reporting/schedulers/delayed_job_scheduler.rb +8 -0
  19. data/lib/order_reporting/version.rb +3 -0
  20. data/lib/solidus_order_reporting.rb +2 -0
  21. data/lib/spree_order_reporting.rb +2 -0
  22. data/spec/dummy/README.rdoc +28 -0
  23. data/spec/dummy/Rakefile +6 -0
  24. data/spec/dummy/app/assets/stylesheets/application.css +15 -0
  25. data/spec/dummy/app/controllers/application_controller.rb +5 -0
  26. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  27. data/spec/dummy/app/views/layouts/application.html.erb +14 -0
  28. data/spec/dummy/bin/bundle +3 -0
  29. data/spec/dummy/bin/delayed_job +5 -0
  30. data/spec/dummy/bin/rails +4 -0
  31. data/spec/dummy/bin/rake +4 -0
  32. data/spec/dummy/bin/setup +29 -0
  33. data/spec/dummy/config.ru +4 -0
  34. data/spec/dummy/config/application.rb +59 -0
  35. data/spec/dummy/config/boot.rb +6 -0
  36. data/spec/dummy/config/database.yml +12 -0
  37. data/spec/dummy/config/environment.rb +5 -0
  38. data/spec/dummy/config/environments/development.rb +41 -0
  39. data/spec/dummy/config/environments/production.rb +79 -0
  40. data/spec/dummy/config/environments/test.rb +34 -0
  41. data/spec/dummy/config/initializers/assets.rb +11 -0
  42. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  43. data/spec/dummy/config/initializers/cookies_serializer.rb +3 -0
  44. data/spec/dummy/config/initializers/custom_user.rb +1 -0
  45. data/spec/dummy/config/initializers/devise.rb +3 -0
  46. data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  47. data/spec/dummy/config/initializers/inflections.rb +16 -0
  48. data/spec/dummy/config/initializers/mime_types.rb +4 -0
  49. data/spec/dummy/config/initializers/session_store.rb +3 -0
  50. data/spec/dummy/config/initializers/spree.rb +57 -0
  51. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
  52. data/spec/dummy/config/locales/en.yml +23 -0
  53. data/spec/dummy/config/routes.rb +9 -0
  54. data/spec/dummy/config/secrets.yml +22 -0
  55. data/spec/dummy/db/migrate/20160706112305_spree_one_two.spree.rb +482 -0
  56. data/spec/dummy/db/migrate/20160706112306_spree_promo_one_two.spree.rb +46 -0
  57. data/spec/dummy/db/migrate/20160706112307_add_tax_rate_label.spree.rb +6 -0
  58. data/spec/dummy/db/migrate/20160706112308_add_toggle_tax_rate_display.spree.rb +6 -0
  59. data/spec/dummy/db/migrate/20160706112309_remove_unused_preference_columns.spree.rb +9 -0
  60. data/spec/dummy/db/migrate/20160706112310_add_lock_version_to_variant.spree.rb +6 -0
  61. data/spec/dummy/db/migrate/20160706112311_add_states_required_to_countries.spree.rb +6 -0
  62. data/spec/dummy/db/migrate/20160706112312_add_on_demand_to_product_and_variant.spree.rb +7 -0
  63. data/spec/dummy/db/migrate/20160706112313_remove_not_null_constraint_from_products_on_hand.spree.rb +12 -0
  64. data/spec/dummy/db/migrate/20160706112314_split_prices_from_variants.spree.rb +32 -0
  65. data/spec/dummy/db/migrate/20160706112315_remove_not_null_from_spree_prices_amount.spree.rb +10 -0
  66. data/spec/dummy/db/migrate/20160706112316_add_currency_to_line_items.spree.rb +6 -0
  67. data/spec/dummy/db/migrate/20160706112317_add_currency_to_orders.spree.rb +6 -0
  68. data/spec/dummy/db/migrate/20160706112318_add_cost_currency_to_variants.spree.rb +6 -0
  69. data/spec/dummy/db/migrate/20160706112319_remove_display_on_from_payment_methods.spree.rb +6 -0
  70. data/spec/dummy/db/migrate/20160706112320_add_position_to_taxonomies.spree.rb +6 -0
  71. data/spec/dummy/db/migrate/20160706112321_add_last_ip_to_spree_orders.spree.rb +6 -0
  72. data/spec/dummy/db/migrate/20160706112322_add_state_to_spree_adjustments.spree.rb +7 -0
  73. data/spec/dummy/db/migrate/20160706112323_add_display_on_to_spree_payment_methods.spree.rb +10 -0
  74. data/spec/dummy/db/migrate/20160706112324_add_position_to_product_properties.spree.rb +7 -0
  75. data/spec/dummy/db/migrate/20160706112325_add_identifier_to_spree_payments.spree.rb +6 -0
  76. data/spec/dummy/db/migrate/20160706112326_add_order_id_index_to_payments.spree.rb +10 -0
  77. data/spec/dummy/db/migrate/20160706112327_add_primary_to_spree_products_taxons.spree.rb +6 -0
  78. data/spec/dummy/db/migrate/20160706112328_create_spree_stock_items.spree.rb +15 -0
  79. data/spec/dummy/db/migrate/20160706112329_create_spree_stock_locations.spree.rb +12 -0
  80. data/spec/dummy/db/migrate/20160706112330_create_default_stock.spree.rb +35 -0
  81. data/spec/dummy/db/migrate/20160706112331_add_order_id_index_to_shipments.spree.rb +6 -0
  82. data/spec/dummy/db/migrate/20160706112332_change_meta_description_on_spree_products_to_text.spree.rb +6 -0
  83. data/spec/dummy/db/migrate/20160706112333_add_stock_location_id_to_spree_shipments.spree.rb +6 -0
  84. data/spec/dummy/db/migrate/20160706112334_add_pending_to_inventory_unit.spree.rb +7 -0
  85. data/spec/dummy/db/migrate/20160706112335_remove_on_demand_from_product_and_variant.spree.rb +7 -0
  86. data/spec/dummy/db/migrate/20160706112336_create_shipping_method_zone.spree.rb +22 -0
  87. data/spec/dummy/db/migrate/20160706112337_remove_shipping_category_id_from_shipping_method.spree.rb +6 -0
  88. data/spec/dummy/db/migrate/20160706112338_create_shipping_method_categories.spree.rb +14 -0
  89. data/spec/dummy/db/migrate/20160706112339_add_tracking_url_to_spree_shipping_methods.spree.rb +6 -0
  90. data/spec/dummy/db/migrate/20160706112340_create_spree_shipping_rates.spree.rb +25 -0
  91. data/spec/dummy/db/migrate/20160706112341_remove_category_match_attributes_from_shipping_method.spree.rb +8 -0
  92. data/spec/dummy/db/migrate/20160706112342_create_stock_movements.spree.rb +13 -0
  93. data/spec/dummy/db/migrate/20160706112343_add_address_fields_to_stock_location.spree.rb +23 -0
  94. data/spec/dummy/db/migrate/20160706112344_add_active_field_to_stock_locations.spree.rb +6 -0
  95. data/spec/dummy/db/migrate/20160706112345_add_backorderable_to_stock_item.spree.rb +6 -0
  96. data/spec/dummy/db/migrate/20160706112346_add_default_quantity_to_stock_movement.spree.rb +6 -0
  97. data/spec/dummy/db/migrate/20160706112347_add_source_and_destination_to_stock_movements.spree.rb +9 -0
  98. data/spec/dummy/db/migrate/20160706112348_change_orders_total_precision.spree.rb +9 -0
  99. data/spec/dummy/db/migrate/20160706112349_change_spree_payments_amount_precision.spree.rb +8 -0
  100. data/spec/dummy/db/migrate/20160706112350_change_spree_return_authorization_amount_precision.spree.rb +8 -0
  101. data/spec/dummy/db/migrate/20160706112351_change_adjustments_amount_precision.spree.rb +8 -0
  102. data/spec/dummy/db/migrate/20160706112352_add_originator_to_stock_movement.spree.rb +8 -0
  103. data/spec/dummy/db/migrate/20160706112353_drop_source_and_destination_from_stock_movement.spree.rb +16 -0
  104. data/spec/dummy/db/migrate/20160706112354_migrate_inventory_unit_sold_to_on_hand.spree.rb +10 -0
  105. data/spec/dummy/db/migrate/20160706112355_add_stock_location_to_rma.spree.rb +6 -0
  106. data/spec/dummy/db/migrate/20160706112356_update_shipment_state_for_canceled_orders.spree.rb +16 -0
  107. data/spec/dummy/db/migrate/20160706112357_add_seo_metas_to_taxons.spree.rb +10 -0
  108. data/spec/dummy/db/migrate/20160706112358_remove_stock_item_and_variant_lock.spree.rb +15 -0
  109. data/spec/dummy/db/migrate/20160706112359_add_name_to_spree_credit_cards.spree.rb +6 -0
  110. data/spec/dummy/db/migrate/20160706112360_update_name_fields_on_spree_credit_cards.spree.rb +14 -0
  111. data/spec/dummy/db/migrate/20160706112361_add_index_to_source_columns_on_adjustments.spree.rb +6 -0
  112. data/spec/dummy/db/migrate/20160706112362_update_adjustment_states.spree.rb +17 -0
  113. data/spec/dummy/db/migrate/20160706112363_add_shipping_rates_to_shipments.spree.rb +16 -0
  114. data/spec/dummy/db/migrate/20160706112364_create_spree_stock_transfers.spree.rb +15 -0
  115. data/spec/dummy/db/migrate/20160706112365_drop_products_count_on_hand.spree.rb +6 -0
  116. data/spec/dummy/db/migrate/20160706112366_set_default_shipping_rate_cost.spree.rb +6 -0
  117. data/spec/dummy/db/migrate/20160706112367_add_number_to_stock_transfer.spree.rb +24 -0
  118. data/spec/dummy/db/migrate/20160706112368_add_sku_index_to_spree_variants.spree.rb +6 -0
  119. data/spec/dummy/db/migrate/20160706112369_add_backorderable_default_to_spree_stock_location.spree.rb +6 -0
  120. data/spec/dummy/db/migrate/20160706112370_add_propage_all_variants_to_spree_stock_location.spree.rb +6 -0
  121. data/spec/dummy/db/migrate/20160706112371_rename_shipping_methods_zones_to_spree_shipping_methods_zones.spree.rb +6 -0
  122. data/spec/dummy/db/migrate/20160706112372_add_user_id_index_to_spree_orders.spree.rb +6 -0
  123. data/spec/dummy/db/migrate/20160706112373_add_updated_at_to_spree_countries.spree.rb +10 -0
  124. data/spec/dummy/db/migrate/20160706112374_add_updated_at_to_spree_states.spree.rb +10 -0
  125. data/spec/dummy/db/migrate/20160706112375_add_cvv_result_code_and_cvv_result_message_to_spree_payments.spree.rb +7 -0
  126. data/spec/dummy/db/migrate/20160706112376_add_unique_index_to_permalink_on_spree_products.spree.rb +6 -0
  127. data/spec/dummy/db/migrate/20160706112377_add_unique_index_to_orders_shipments_and_stock_transfers.spree.rb +8 -0
  128. data/spec/dummy/db/migrate/20160706112378_add_deleted_at_to_spree_tax_rates.spree.rb +6 -0
  129. data/spec/dummy/db/migrate/20160706112379_remove_lock_version_from_inventory_units.spree.rb +7 -0
  130. data/spec/dummy/db/migrate/20160706112380_add_cost_price_to_line_item.spree.rb +6 -0
  131. data/spec/dummy/db/migrate/20160706112381_set_backorderable_to_default_to_false.spree.rb +7 -0
  132. data/spec/dummy/db/migrate/20160706112382_add_created_by_id_to_spree_orders.spree.rb +6 -0
  133. data/spec/dummy/db/migrate/20160706112383_index_completed_at_on_spree_orders.spree.rb +6 -0
  134. data/spec/dummy/db/migrate/20160706112384_add_tax_category_id_to_spree_line_items.spree.rb +6 -0
  135. data/spec/dummy/db/migrate/20160706112385_migrate_tax_categories_to_line_items.spree.rb +11 -0
  136. data/spec/dummy/db/migrate/20160706112386_drop_spree_mail_methods.spree.rb +13 -0
  137. data/spec/dummy/db/migrate/20160706112387_set_default_stock_location_on_shipments.spree.rb +9 -0
  138. data/spec/dummy/db/migrate/20160706112388_upgrade_adjustments.spree.rb +41 -0
  139. data/spec/dummy/db/migrate/20160706112389_rename_adjustment_fields.spree.rb +15 -0
  140. data/spec/dummy/db/migrate/20160706112390_add_admin_name_column_to_spree_shipping_methods.spree.rb +6 -0
  141. data/spec/dummy/db/migrate/20160706112391_add_admin_name_column_to_spree_stock_locations.spree.rb +6 -0
  142. data/spec/dummy/db/migrate/20160706112392_add_shipment_total_to_spree_orders.spree.rb +6 -0
  143. data/spec/dummy/db/migrate/20160706112393_expand_order_number_size.spree.rb +10 -0
  144. data/spec/dummy/db/migrate/20160706112394_rename_activators_to_promotions.spree.rb +6 -0
  145. data/spec/dummy/db/migrate/20160706112395_add_adjustment_total_to_line_items.spree.rb +6 -0
  146. data/spec/dummy/db/migrate/20160706112396_add_adjustment_total_to_shipments.spree.rb +6 -0
  147. data/spec/dummy/db/migrate/20160706112397_add_depth_to_spree_taxons.spree.rb +17 -0
  148. data/spec/dummy/db/migrate/20160706112398_add_tax_total_to_line_items_shipments_and_orders.spree.rb +9 -0
  149. data/spec/dummy/db/migrate/20160706112399_add_shipping_category_to_shipping_methods_and_products.spree.rb +16 -0
  150. data/spec/dummy/db/migrate/20160706112400_migrate_old_shipping_calculators.spree.rb +20 -0
  151. data/spec/dummy/db/migrate/20160706112401_add_code_to_spree_promotion_rules.spree.rb +6 -0
  152. data/spec/dummy/db/migrate/20160706112402_change_states_required_for_countries.spree.rb +10 -0
  153. data/spec/dummy/db/migrate/20160706112403_add_deleted_at_to_spree_stock_items.spree.rb +6 -0
  154. data/spec/dummy/db/migrate/20160706112404_remove_promotions_event_name_field.spree.rb +6 -0
  155. data/spec/dummy/db/migrate/20160706112405_add_promo_total_to_line_items_and_shipments_and_orders.spree.rb +8 -0
  156. data/spec/dummy/db/migrate/20160706112406_remove_unused_credit_card_fields.spree.rb +17 -0
  157. data/spec/dummy/db/migrate/20160706112407_add_track_inventory_to_variant.spree.rb +6 -0
  158. data/spec/dummy/db/migrate/20160706112408_add_tax_category_to_variants.spree.rb +7 -0
  159. data/spec/dummy/db/migrate/20160706112409_add_channel_to_spree_orders.spree.rb +6 -0
  160. data/spec/dummy/db/migrate/20160706112410_add_included_to_adjustments.spree.rb +6 -0
  161. data/spec/dummy/db/migrate/20160706112411_rename_tax_total_fields.spree.rb +12 -0
  162. data/spec/dummy/db/migrate/20160706112412_add_line_item_id_to_spree_inventory_units.spree.rb +22 -0
  163. data/spec/dummy/db/migrate/20160706112413_add_updated_at_to_variants.spree.rb +6 -0
  164. data/spec/dummy/db/migrate/20160706112414_add_position_to_classifications.spree.rb +6 -0
  165. data/spec/dummy/db/migrate/20160706112415_create_spree_orders_promotions.spree.rb +9 -0
  166. data/spec/dummy/db/migrate/20160706112416_unique_shipping_method_categories.spree.rb +25 -0
  167. data/spec/dummy/db/migrate/20160706112417_add_item_count_to_spree_orders.spree.rb +6 -0
  168. data/spec/dummy/db/migrate/20160706112418_remove_value_type_from_spree_preferences.spree.rb +9 -0
  169. data/spec/dummy/db/migrate/20160706112419_rename_permalink_to_slug_for_products.spree.rb +6 -0
  170. data/spec/dummy/db/migrate/20160706112420_add_index_to_variant_id_and_currency_on_prices.spree.rb +6 -0
  171. data/spec/dummy/db/migrate/20160706112421_rename_activator_id_in_rules_and_actions_to_promotion_id.spree.rb +7 -0
  172. data/spec/dummy/db/migrate/20160706112422_add_deleted_at_to_spree_prices.spree.rb +6 -0
  173. data/spec/dummy/db/migrate/20160706112423_add_approver_id_and_approved_at_to_orders.spree.rb +7 -0
  174. data/spec/dummy/db/migrate/20160706112424_add_confirmation_delivered_to_spree_orders.spree.rb +6 -0
  175. data/spec/dummy/db/migrate/20160706112425_add_auto_capture_to_payment_methods.spree.rb +6 -0
  176. data/spec/dummy/db/migrate/20160706112426_create_spree_payment_capture_events.spree.rb +13 -0
  177. data/spec/dummy/db/migrate/20160706112427_add_uncaptured_amount_to_payments.spree.rb +6 -0
  178. data/spec/dummy/db/migrate/20160706112428_default_variant_weight_to_zero.spree.rb +12 -0
  179. data/spec/dummy/db/migrate/20160706112429_add_tax_category_id_to_shipping_methods.spree.rb +6 -0
  180. data/spec/dummy/db/migrate/20160706112430_add_tax_rate_id_to_shipping_rates.spree.rb +6 -0
  181. data/spec/dummy/db/migrate/20160706112431_add_pre_tax_amount_to_line_items_and_shipments.spree.rb +7 -0
  182. data/spec/dummy/db/migrate/20160706112432_add_more_indexes.spree.rb +14 -0
  183. data/spec/dummy/db/migrate/20160706112433_add_considered_risky_to_orders.spree.rb +6 -0
  184. data/spec/dummy/db/migrate/20160706112434_add_preference_store_to_everything.spree.rb +9 -0
  185. data/spec/dummy/db/migrate/20160706112435_add_user_id_to_spree_credit_cards.spree.rb +14 -0
  186. data/spec/dummy/db/migrate/20160706112436_migrate_old_preferences.spree.rb +52 -0
  187. data/spec/dummy/db/migrate/20160706112437_create_spree_stores.spree.rb +26 -0
  188. data/spec/dummy/db/migrate/20160706112438_create_store_from_preferences.spree.rb +34 -0
  189. data/spec/dummy/db/migrate/20160706112439_add_timestamps_to_spree_assets.spree.rb +7 -0
  190. data/spec/dummy/db/migrate/20160706112440_create_spree_taxons_promotion_rules.spree.rb +9 -0
  191. data/spec/dummy/db/migrate/20160706112441_add_additional_store_fields.spree.rb +9 -0
  192. data/spec/dummy/db/migrate/20160706112442_add_many_missing_indexes.spree.rb +20 -0
  193. data/spec/dummy/db/migrate/20160706112443_correct_some_polymorphic_index_and_add_more_missing.spree.rb +66 -0
  194. data/spec/dummy/db/migrate/20160706112444_add_user_id_created_by_id_index_to_order.spree.rb +6 -0
  195. data/spec/dummy/db/migrate/20160706112445_change_spree_price_amount_precision.spree.rb +9 -0
  196. data/spec/dummy/db/migrate/20160706112446_add_token_to_spree_orders.spree.rb +6 -0
  197. data/spec/dummy/db/migrate/20160706112447_move_order_token_from_tokenized_permission.spree.rb +30 -0
  198. data/spec/dummy/db/migrate/20160706112448_set_shipment_total_for_users_upgrading.spree.rb +11 -0
  199. data/spec/dummy/db/migrate/20160706112449_drop_credit_card_first_name_and_last_name.spree.rb +7 -0
  200. data/spec/dummy/db/migrate/20160706112450_add_deleted_at_to_spree_promotion_actions.spree.rb +7 -0
  201. data/spec/dummy/db/migrate/20160706112451_remove_uncaptured_amount_from_spree_payments.spree.rb +6 -0
  202. data/spec/dummy/db/migrate/20160706112452_create_spree_refunds.spree.rb +13 -0
  203. data/spec/dummy/db/migrate/20160706112453_create_spree_return_authorization_inventory_unit.spree.rb +13 -0
  204. data/spec/dummy/db/migrate/20160706112454_rename_return_authorization_inventory_unit_to_return_items.spree.rb +6 -0
  205. data/spec/dummy/db/migrate/20160706112455_create_order_mutex.spree.rb +12 -0
  206. data/spec/dummy/db/migrate/20160706112456_backfill_line_item_pre_tax_amount.spree.rb +11 -0
  207. data/spec/dummy/db/migrate/20160706112457_recreate_spree_return_authorizations.spree.rb +56 -0
  208. data/spec/dummy/db/migrate/20160706112458_add_amount_fields_to_return_items.spree.rb +8 -0
  209. data/spec/dummy/db/migrate/20160706112459_drop_return_authorization_amount.spree.rb +6 -0
  210. data/spec/dummy/db/migrate/20160706112460_create_spree_return_authorization_reasons.spree.rb +33 -0
  211. data/spec/dummy/db/migrate/20160706112461_create_spree_refund_reasons.spree.rb +15 -0
  212. data/spec/dummy/db/migrate/20160706112462_rename_return_authorization_reason.spree.rb +6 -0
  213. data/spec/dummy/db/migrate/20160706112463_create_spree_promotion_categories.spree.rb +12 -0
  214. data/spec/dummy/db/migrate/20160706112464_drop_received_at_on_return_items.spree.rb +10 -0
  215. data/spec/dummy/db/migrate/20160706112465_add_reception_and_acceptance_status_to_return_items.spree.rb +7 -0
  216. data/spec/dummy/db/migrate/20160706112466_create_default_refund_reason.spree.rb +10 -0
  217. data/spec/dummy/db/migrate/20160706112467_add_default_to_spree_stock_locations.spree.rb +8 -0
  218. data/spec/dummy/db/migrate/20160706112468_create_spree_customer_returns.spree.rb +10 -0
  219. data/spec/dummy/db/migrate/20160706112469_add_customer_return_id_to_return_item.spree.rb +7 -0
  220. data/spec/dummy/db/migrate/20160706112470_create_friendly_id_slugs.spree.rb +16 -0
  221. data/spec/dummy/db/migrate/20160706112471_rename_spree_refund_return_authorization_id.spree.rb +6 -0
  222. data/spec/dummy/db/migrate/20160706112472_increase_return_item_pre_tax_amount_precision.spree.rb +14 -0
  223. data/spec/dummy/db/migrate/20160706112473_copy_product_slugs_to_slug_history.spree.rb +16 -0
  224. data/spec/dummy/db/migrate/20160706112474_create_spree_reimbursements.spree.rb +22 -0
  225. data/spec/dummy/db/migrate/20160706112475_add_promotionable_to_spree_products.spree.rb +6 -0
  226. data/spec/dummy/db/migrate/20160706112476_add_exchange_inventory_unit_foreign_keys.spree.rb +8 -0
  227. data/spec/dummy/db/migrate/20160706112477_add_acceptance_status_errors_to_return_item.spree.rb +6 -0
  228. data/spec/dummy/db/migrate/20160706112478_create_spree_reimbursement_types.spree.rb +21 -0
  229. data/spec/dummy/db/migrate/20160706112479_add_default_to_shipment_cost.spree.rb +11 -0
  230. data/spec/dummy/db/migrate/20160706112480_add_default_to_spree_credit_cards.spree.rb +6 -0
  231. data/spec/dummy/db/migrate/20160706112481_make_existing_credit_cards_default.spree.rb +11 -0
  232. data/spec/dummy/db/migrate/20160706112482_add_type_to_reimbursement_type.spree.rb +10 -0
  233. data/spec/dummy/db/migrate/20160706112483_create_spree_reimbursement_credits.spree.rb +11 -0
  234. data/spec/dummy/db/migrate/20160706112484_add_meta_title_to_spree_products.spree.rb +8 -0
  235. data/spec/dummy/db/migrate/20160706112485_add_code_to_spree_tax_categories.spree.rb +6 -0
  236. data/spec/dummy/db/migrate/20160706112486_default_pre_tax_amount_should_be_zero.spree.rb +7 -0
  237. data/spec/dummy/db/migrate/20160706112487_add_code_to_spree_shipping_methods.spree.rb +6 -0
  238. data/spec/dummy/db/migrate/20160706112488_add_cancel_audit_fields_to_spree_orders.spree.rb +7 -0
  239. data/spec/dummy/db/migrate/20160706112489_add_store_id_to_orders.spree.rb +13 -0
  240. data/spec/dummy/db/migrate/20160706112490_create_spree_taxons_prototypes.spree.rb +9 -0
  241. data/spec/dummy/db/migrate/20160706112491_add_counter_cache_from_spree_variants_to_spree_stock_items.spree.rb +9 -0
  242. data/spec/dummy/db/migrate/20160706112492_fix_adjustment_order_presence.spree.rb +14 -0
  243. data/spec/dummy/db/migrate/20160706112493_update_classifications_positions.spree.rb +10 -0
  244. data/spec/dummy/db/migrate/20160706112494_add_guest_token_index_to_spree_orders.spree.rb +6 -0
  245. data/spec/dummy/db/migrate/20160706112495_remove_extra_products_slug_index.spree.rb +6 -0
  246. data/spec/dummy/db/migrate/20160706112496_update_product_slug_index.spree.rb +9 -0
  247. data/spec/dummy/db/migrate/20160706112497_add_default_column_to_price.spree.rb +6 -0
  248. data/spec/dummy/db/migrate/20160706112498_add_position_to_stock_location.spree.rb +6 -0
  249. data/spec/dummy/db/migrate/20160706112499_create_spree_promotion_codes.spree.rb +14 -0
  250. data/spec/dummy/db/migrate/20160706112500_create_adjustment_promotion_code_association.spree.rb +7 -0
  251. data/spec/dummy/db/migrate/20160706112501_remove_environment_from_payment_method.spree.rb +7 -0
  252. data/spec/dummy/db/migrate/20160706112502_add_restock_inventory_to_stock_location.spree.rb +6 -0
  253. data/spec/dummy/db/migrate/20160706112503_add_code_to_spree_promotion_categories.spree.rb +6 -0
  254. data/spec/dummy/db/migrate/20160706112504_create_order_stock_locations.spree.rb +13 -0
  255. data/spec/dummy/db/migrate/20160706112505_remove_environment_from_tracker.spree.rb +7 -0
  256. data/spec/dummy/db/migrate/20160706112506_add_fulfillable_to_stock_location.spree.rb +6 -0
  257. data/spec/dummy/db/migrate/20160706112507_add_code_to_refund_reason.spree.rb +6 -0
  258. data/spec/dummy/db/migrate/20160706112508_add_promotion_code_id_to_orders_promotions.spree.rb +8 -0
  259. data/spec/dummy/db/migrate/20160706112509_add_approver_name_to_spree_orders.spree.rb +6 -0
  260. data/spec/dummy/db/migrate/20160706112510_move_promotion_code_to_promotion_code_value.spree.rb +66 -0
  261. data/spec/dummy/db/migrate/20160706112511_downcase_promotion_codes_values.spree.rb +12 -0
  262. data/spec/dummy/db/migrate/20160706112512_add_order_ids_to_adjustments_where_missing.spree.rb +10 -0
  263. data/spec/dummy/db/migrate/20160706112513_add_per_code_usage_limit_to_promotions.spree.rb +6 -0
  264. data/spec/dummy/db/migrate/20160706112514_remove_usage_limit_from_promotion_codes.spree.rb +6 -0
  265. data/spec/dummy/db/migrate/20160706112515_add_timestamps_to_order_promotions.spree.rb +7 -0
  266. data/spec/dummy/db/migrate/20160706112516_create_spree_cartons.spree.rb +25 -0
  267. data/spec/dummy/db/migrate/20160706112517_add_timestamps_to_spree_roles_users.spree.rb +8 -0
  268. data/spec/dummy/db/migrate/20160706112518_remove_considered_risky_from_spree_orders.spree.rb +6 -0
  269. data/spec/dummy/db/migrate/20160706112519_add_index_to_inventory_units_carton_id.spree.rb +6 -0
  270. data/spec/dummy/db/migrate/20160706112520_add_imported_from_shipment_id_to_cartons.spree.rb +9 -0
  271. data/spec/dummy/db/migrate/20160706112521_copy_shipped_shipments_to_cartons.spree.rb +14 -0
  272. data/spec/dummy/db/migrate/20160706112522_create_spree_user_stock_locations.spree.rb +11 -0
  273. data/spec/dummy/db/migrate/20160706112523_add_stock_location_code.spree.rb +6 -0
  274. data/spec/dummy/db/migrate/20160706112524_create_unit_cancels.spree.rb +11 -0
  275. data/spec/dummy/db/migrate/20160706112525_add_fields_to_stock_transfer.spree.rb +13 -0
  276. data/spec/dummy/db/migrate/20160706112526_create_transfer_items.spree.rb +15 -0
  277. data/spec/dummy/db/migrate/20160706112527_drop_stock_transfer_type.spree.rb +11 -0
  278. data/spec/dummy/db/migrate/20160706112528_add_stock_transfer_finalized_at.spree.rb +9 -0
  279. data/spec/dummy/db/migrate/20160706112529_rename_stock_transfer_reference.spree.rb +6 -0
  280. data/spec/dummy/db/migrate/20160706112530_create_line_item_actions.spree.rb +11 -0
  281. data/spec/dummy/db/migrate/20160706112531_create_spree_store_credit_categories.spree.rb +11 -0
  282. data/spec/dummy/db/migrate/20160706112532_create_spree_store_credits.spree.rb +20 -0
  283. data/spec/dummy/db/migrate/20160706112533_create_spree_store_credit_events.spree.rb +18 -0
  284. data/spec/dummy/db/migrate/20160706112534_create_spree_store_credit_payment_method.spree.rb +22 -0
  285. data/spec/dummy/db/migrate/20160706112535_create_store_credit_types.spree.rb +18 -0
  286. data/spec/dummy/db/migrate/20160706112536_create_store_credit_reimbursement_type.spree.rb +6 -0
  287. data/spec/dummy/db/migrate/20160706112537_add_resellable_to_return_items.spree.rb +6 -0
  288. data/spec/dummy/db/migrate/20160706112538_add_invalidated_at_to_spree_store_credits.spree.rb +6 -0
  289. data/spec/dummy/db/migrate/20160706112539_migrate_deleted_store_credits_to_invalidated.spree.rb +14 -0
  290. data/spec/dummy/db/migrate/20160706112540_add_check_stock_on_transfer.spree.rb +6 -0
  291. data/spec/dummy/db/migrate/20160706112541_fix_adjustment_order_id.spree.rb +81 -0
  292. data/spec/dummy/db/migrate/20160706112542_delete_inventory_units_without_shipment.spree.rb +26 -0
  293. data/spec/dummy/db/migrate/20160706112543_add_deleted_at_to_stock_transfers.spree.rb +6 -0
  294. data/spec/dummy/db/migrate/20160706112544_add_deleted_at_to_transfer_items.spree.rb +6 -0
  295. data/spec/dummy/db/migrate/20160706112545_increase_scale_on_pre_tax_amounts.spree.rb +27 -0
  296. data/spec/dummy/db/migrate/20160706112546_add_preferences_to_promotion_actions.spree.rb +6 -0
  297. data/spec/dummy/db/migrate/20160706112547_add_id_to_spree_option_values_variants.spree.rb +6 -0
  298. data/spec/dummy/db/migrate/20160706112548_add_frontend_viewable_to_spree_orders.spree.rb +6 -0
  299. data/spec/dummy/db/migrate/20160706112549_remove_spree_configurations.spree.rb +16 -0
  300. data/spec/dummy/db/migrate/20160706112550_add_preference_source_to_spree_payment_methods.spree.rb +6 -0
  301. data/spec/dummy/db/migrate/20160706112551_remove_credit_card_address_id.spree.rb +8 -0
  302. data/spec/dummy/db/migrate/20160706112552_create_spree_store_credit_update_reasons.spree.rb +9 -0
  303. data/spec/dummy/db/migrate/20160706112553_create_adjustment_reason.spree.rb +19 -0
  304. data/spec/dummy/db/migrate/20160706112554_add_update_reason_to_store_credit_events.spree.rb +6 -0
  305. data/spec/dummy/db/migrate/20160706112555_add_return_authorization_reason_id_to_return_items.spree.rb +8 -0
  306. data/spec/dummy/db/migrate/20160706112556_seed_store_credit_update_reasons.spree.rb +10 -0
  307. data/spec/dummy/db/migrate/20160706112557_remove_shipping_method_id_from_spree_orders.spree.rb +10 -0
  308. data/spec/dummy/db/migrate/20160706112558_remove_counter_cache_from_spree_variants_to_spree_stock_items.spree.rb +11 -0
  309. data/spec/dummy/db/migrate/20160706112559_add_address_id_to_credit_card.spree.rb +6 -0
  310. data/spec/dummy/db/migrate/20160706112560_copy_order_bill_address_to_credit_card.spree.rb +13 -0
  311. data/spec/dummy/db/migrate/20160706112561_remove_unnecessary_indexes.spree.rb +65 -0
  312. data/spec/dummy/db/migrate/20160706112562_remove_state_lock_version_from_order.spree.rb +12 -0
  313. data/spec/dummy/db/migrate/20160706112563_add_spree_user_addresses.spree.rb +17 -0
  314. data/spec/dummy/db/migrate/20160706112564_add_id_and_timestamp_to_promotion_rule_user.spree.rb +14 -0
  315. data/spec/dummy/db/migrate/20160706112565_remove_mandatory_from_adjustments.spree.rb +6 -0
  316. data/spec/dummy/db/migrate/20160706112566_add_finalized_to_spree_adjustments.spree.rb +12 -0
  317. data/spec/dummy/db/migrate/20160706112567_add_store_payment_methods.spree.rb +11 -0
  318. data/spec/dummy/db/migrate/20160706112568_convert_habtm_to_hmt_for_shipping_methods_zones.spree.rb +18 -0
  319. data/spec/dummy/db/migrate/20160706112569_convert_habtm_to_hmt_for_products_promotion_rules.spree.rb +18 -0
  320. data/spec/dummy/db/migrate/20160706112570_drop_spree_gateways.spree.rb +21 -0
  321. data/spec/dummy/db/migrate/20160706112571_convert_habtm_to_hmt_for_taxon_prototypes.spree.rb +16 -0
  322. data/spec/dummy/db/migrate/20160706112572_create_variant_properties_and_rules.spree.rb +29 -0
  323. data/spec/dummy/db/migrate/20160706112573_add_foreign_keys_for_taxons_prototypes.spree.rb +7 -0
  324. data/spec/dummy/db/migrate/20160706112574_remove_token_permissions_table.spree.rb +17 -0
  325. data/spec/dummy/db/migrate/20160706112575_rename_identifier_to_number_for_payment.spree.rb +8 -0
  326. data/spec/dummy/db/migrate/20160706112576_add_foreign_keys_for_product_promotion_rules.spree.rb +10 -0
  327. data/spec/dummy/db/migrate/20160706112577_add_sale_to_spree_promotions.spree.rb +7 -0
  328. data/spec/dummy/db/migrate/20160706112578_convert_sale_promotions.spree.rb +29 -0
  329. data/spec/dummy/db/migrate/20160706112579_convert_habtm_to_hmt_for_properties_prototypes.spree.rb +18 -0
  330. data/spec/dummy/db/migrate/20160706112580_convert_habtm_to_hmt_for_option_type_prototypes.spree.rb +18 -0
  331. data/spec/dummy/db/migrate/20160706112581_convert_habtm_to_hmt_for_taxons_promotion_rules.spree.rb +16 -0
  332. data/spec/dummy/db/migrate/20160706112582_add_stock_item_unique_index.spree.rb +10 -0
  333. data/spec/dummy/db/migrate/20160706112583_add_api_key_to_spree_users.spree_api.rb +8 -0
  334. data/spec/dummy/db/migrate/20160706112584_resize_api_key_field.spree_api.rb +8 -0
  335. data/spec/dummy/db/migrate/20160706112585_rename_api_key_to_spree_api_key.spree_api.rb +8 -0
  336. data/spec/dummy/db/migrate/20160706112586_add_index_to_user_spree_api_key.spree_api.rb +8 -0
  337. data/spec/dummy/db/migrate/20160706112587_create_users.solidus_auth.rb +30 -0
  338. data/spec/dummy/db/migrate/20160706112588_rename_columns_for_devise.solidus_auth.rb +38 -0
  339. data/spec/dummy/db/migrate/20160706112589_convert_user_remember_field.solidus_auth.rb +12 -0
  340. data/spec/dummy/db/migrate/20160706112590_add_reset_password_sent_at_to_spree_users.solidus_auth.rb +9 -0
  341. data/spec/dummy/db/migrate/20160706112591_make_users_email_index_unique.solidus_auth.rb +10 -0
  342. data/spec/dummy/db/migrate/20160706112592_add_deleted_at_to_users.solidus_auth.rb +7 -0
  343. data/spec/dummy/db/migrate/20160706112593_add_confirmable_to_users.solidus_auth.rb +8 -0
  344. data/spec/dummy/db/migrate/20160706112594_create_delayed_jobs.rb +22 -0
  345. data/spec/dummy/db/schema.rb +1206 -0
  346. data/spec/dummy/db/seeds.rb +11 -0
  347. data/spec/dummy/db/spree_test.sqlite3 +0 -0
  348. data/spec/dummy/log/test.log +15214 -0
  349. data/spec/dummy/public/404.html +67 -0
  350. data/spec/dummy/public/422.html +67 -0
  351. data/spec/dummy/public/500.html +66 -0
  352. data/spec/dummy/public/favicon.ico +0 -0
  353. data/spec/dummy/tmp/cache/F65/550/spree%2Fauth_configuration%2Fconfirmable +1 -0
  354. data/spec/dummy/vendor/assets/javascripts/spree/backend/all.js +10 -0
  355. data/spec/dummy/vendor/assets/javascripts/spree/frontend/all.js +10 -0
  356. data/spec/dummy/vendor/assets/stylesheets/spree/backend/all.css +9 -0
  357. data/spec/dummy/vendor/assets/stylesheets/spree/frontend/all.css +9 -0
  358. data/spec/features/recurring_reports_spec.rb +23 -0
  359. data/spec/features/specifying_criteria_spec.rb +21 -0
  360. data/spec/spec_helper.rb +88 -0
  361. data/spec/unit/lib/order_reporting/delayed_job_scheduler_spec.rb +18 -0
  362. metadata +925 -0
@@ -0,0 +1,23 @@
1
+ # Files in the config/locales directory are used for internationalization
2
+ # and are automatically loaded by Rails. If you want to use locales other
3
+ # than English, add the necessary files in this directory.
4
+ #
5
+ # To use the locales, use `I18n.t`:
6
+ #
7
+ # I18n.t 'hello'
8
+ #
9
+ # In views, this is aliased to just `t`:
10
+ #
11
+ # <%= t('hello') %>
12
+ #
13
+ # To use a different locale, set it with `I18n.locale`:
14
+ #
15
+ # I18n.locale = :es
16
+ #
17
+ # This would use the information in config/locales/es.yml.
18
+ #
19
+ # To learn more, please read the Rails Internationalization guide
20
+ # available at http://guides.rubyonrails.org/i18n.html.
21
+
22
+ en:
23
+ hello: "Hello world"
@@ -0,0 +1,9 @@
1
+ Rails.application.routes.draw do
2
+
3
+ # This line mounts Spree's routes at the root of your application.
4
+ # This means, any requests to URLs such as /products, will go to Spree::ProductsController.
5
+ # If you would like to change where this engine is mounted, simply change the :at option to something different.
6
+ #
7
+ # We ask that you don't use the :as option here, as Spree relies on it being the default of "spree"
8
+ mount Spree::Core::Engine, :at => '/'
9
+ end
@@ -0,0 +1,22 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Your secret key is used for verifying the integrity of signed cookies.
4
+ # If you change this key, all old signed cookies will become invalid!
5
+
6
+ # Make sure the secret is at least 30 characters and all random,
7
+ # no regular words or you'll be exposed to dictionary attacks.
8
+ # You can use `rake secret` to generate a secure secret key.
9
+
10
+ # Make sure the secrets in this file are kept private
11
+ # if you're sharing your code publicly.
12
+
13
+ development:
14
+ secret_key_base: d035333035559176f19ea4b73d6300420a1314e9bb84868fc42c17c87a5e4a6b0c9ad67afe3d95866511e4c04cae1e048412ab159c85d43fec8b889aaab4b35c
15
+
16
+ test:
17
+ secret_key_base: 7c2bd69c514180f27e641cea1e0bc00f0f47b6c37c0040c8884442b4ff5479572a2fc052b930a415201515668af2511584abd2cef57b2b217bde03e37dae29f5
18
+
19
+ # Do not keep production secrets in the repository,
20
+ # instead read values from the environment.
21
+ production:
22
+ secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
@@ -0,0 +1,482 @@
1
+ # This migration comes from spree (originally 20120831092320)
2
+ class SpreeOneTwo < ActiveRecord::Migration
3
+ def up
4
+ # This migration is just a compressed version of all the previous
5
+ # migrations for spree_core. Do not run it if one of the core tables
6
+ # already exists. Assume the best.
7
+ return if table_exists?(:spree_addresses)
8
+
9
+
10
+ create_table :spree_activators do |t|
11
+ t.string :description
12
+ t.datetime :expires_at
13
+ t.datetime :starts_at
14
+ t.string :name
15
+ t.string :event_name
16
+ t.string :type
17
+ t.integer :usage_limit
18
+ t.string :match_policy, :default => 'all'
19
+ t.string :code
20
+ t.boolean :advertise, :default => false
21
+ t.string :path
22
+ t.timestamps null: true
23
+ end
24
+
25
+ create_table :spree_addresses do |t|
26
+ t.string :firstname
27
+ t.string :lastname
28
+ t.string :address1
29
+ t.string :address2
30
+ t.string :city
31
+ t.string :zipcode
32
+ t.string :phone
33
+ t.string :state_name
34
+ t.string :alternative_phone
35
+ t.string :company
36
+ t.references :state
37
+ t.references :country
38
+ t.timestamps null: true
39
+ end
40
+
41
+ add_index :spree_addresses, [:firstname], :name => 'index_addresses_on_firstname'
42
+ add_index :spree_addresses, [:lastname], :name => 'index_addresses_on_lastname'
43
+
44
+ create_table :spree_adjustments do |t|
45
+ t.references :source, :polymorphic => true
46
+ t.references :adjustable, :polymorphic => true
47
+ t.references :originator, :polymorphic => true
48
+ t.decimal :amount, :precision => 8, :scale => 2
49
+ t.string :label
50
+ t.boolean :mandatory
51
+ t.boolean :locked
52
+ t.boolean :eligible, :default => true
53
+ t.timestamps null: true
54
+ end
55
+
56
+ add_index :spree_adjustments, [:adjustable_id], :name => 'index_adjustments_on_order_id'
57
+
58
+ create_table :spree_assets do |t|
59
+ t.references :viewable, :polymorphic => true
60
+ t.integer :attachment_width
61
+ t.integer :attachment_height
62
+ t.integer :attachment_file_size
63
+ t.integer :position
64
+ t.string :attachment_content_type
65
+ t.string :attachment_file_name
66
+ t.string :type, :limit => 75
67
+ t.datetime :attachment_updated_at
68
+ t.text :alt
69
+ end
70
+
71
+ add_index :spree_assets, [:viewable_id], :name => 'index_assets_on_viewable_id'
72
+ add_index :spree_assets, [:viewable_type, :type], :name => 'index_assets_on_viewable_type_and_type'
73
+
74
+ create_table :spree_calculators do |t|
75
+ t.string :type
76
+ t.references :calculable, :polymorphic => true
77
+ t.timestamps null: true
78
+ end
79
+
80
+ create_table :spree_configurations do |t|
81
+ t.string :name
82
+ t.string :type, :limit => 50
83
+ t.timestamps null: true
84
+ end
85
+
86
+ add_index :spree_configurations, [:name, :type], :name => 'index_spree_configurations_on_name_and_type'
87
+
88
+ create_table :spree_countries do |t|
89
+ t.string :iso_name
90
+ t.string :iso
91
+ t.string :iso3
92
+ t.string :name
93
+ t.integer :numcode
94
+ end
95
+
96
+ create_table :spree_credit_cards do |t|
97
+ t.string :month
98
+ t.string :year
99
+ t.string :cc_type
100
+ t.string :last_digits
101
+ t.string :first_name
102
+ t.string :last_name
103
+ t.string :start_month
104
+ t.string :start_year
105
+ t.string :issue_number
106
+ t.references :address
107
+ t.string :gateway_customer_profile_id
108
+ t.string :gateway_payment_profile_id
109
+ t.timestamps null: true
110
+ end
111
+
112
+ create_table :spree_gateways do |t|
113
+ t.string :type
114
+ t.string :name
115
+ t.text :description
116
+ t.boolean :active, :default => true
117
+ t.string :environment, :default => 'development'
118
+ t.string :server, :default => 'test'
119
+ t.boolean :test_mode, :default => true
120
+ t.timestamps null: true
121
+ end
122
+
123
+ create_table :spree_inventory_units do |t|
124
+ t.integer :lock_version, :default => 0
125
+ t.string :state
126
+ t.references :variant
127
+ t.references :order
128
+ t.references :shipment
129
+ t.references :return_authorization
130
+ t.timestamps null: true
131
+ end
132
+
133
+ add_index :spree_inventory_units, [:order_id], :name => 'index_inventory_units_on_order_id'
134
+ add_index :spree_inventory_units, [:shipment_id], :name => 'index_inventory_units_on_shipment_id'
135
+ add_index :spree_inventory_units, [:variant_id], :name => 'index_inventory_units_on_variant_id'
136
+
137
+ create_table :spree_line_items do |t|
138
+ t.references :variant
139
+ t.references :order
140
+ t.integer :quantity, :null => false
141
+ t.decimal :price, :precision => 8, :scale => 2, :null => false
142
+ t.timestamps null: true
143
+ end
144
+
145
+ add_index :spree_line_items, [:order_id], :name => 'index_spree_line_items_on_order_id'
146
+ add_index :spree_line_items, [:variant_id], :name => 'index_spree_line_items_on_variant_id'
147
+
148
+ create_table :spree_log_entries do |t|
149
+ t.references :source, :polymorphic => true
150
+ t.text :details
151
+ t.timestamps null: true
152
+ end
153
+
154
+ create_table :spree_mail_methods do |t|
155
+ t.string :environment
156
+ t.boolean :active, :default => true
157
+ t.timestamps null: true
158
+ end
159
+
160
+ create_table :spree_option_types do |t|
161
+ t.string :name, :limit => 100
162
+ t.string :presentation, :limit => 100
163
+ t.integer :position, :default => 0, :null => false
164
+ t.timestamps null: true
165
+ end
166
+
167
+ create_table :spree_option_types_prototypes, :id => false do |t|
168
+ t.references :prototype
169
+ t.references :option_type
170
+ end
171
+
172
+ create_table :spree_option_values do |t|
173
+ t.integer :position
174
+ t.string :name
175
+ t.string :presentation
176
+ t.references :option_type
177
+ t.timestamps null: true
178
+ end
179
+
180
+ create_table :spree_option_values_variants, :id => false do |t|
181
+ t.references :variant
182
+ t.references :option_value
183
+ end
184
+
185
+ add_index :spree_option_values_variants, [:variant_id, :option_value_id], :name => 'index_option_values_variants_on_variant_id_and_option_value_id'
186
+ add_index :spree_option_values_variants, [:variant_id], :name => 'index_spree_option_values_variants_on_variant_id'
187
+
188
+ create_table :spree_orders do |t|
189
+ t.string :number, :limit => 15
190
+ t.decimal :item_total, :precision => 8, :scale => 2, :default => 0.0, :null => false
191
+ t.decimal :total, :precision => 8, :scale => 2, :default => 0.0, :null => false
192
+ t.string :state
193
+ t.decimal :adjustment_total, :precision => 8, :scale => 2, :default => 0.0, :null => false
194
+ t.references :user
195
+ t.datetime :completed_at
196
+ t.references :bill_address
197
+ t.references :ship_address
198
+ t.decimal :payment_total, :precision => 8, :scale => 2, :default => 0.0
199
+ t.references :shipping_method
200
+ t.string :shipment_state
201
+ t.string :payment_state
202
+ t.string :email
203
+ t.text :special_instructions
204
+ t.timestamps null: true
205
+ end
206
+
207
+ add_index :spree_orders, [:number], :name => 'index_spree_orders_on_number'
208
+
209
+ create_table :spree_payment_methods do |t|
210
+ t.string :type
211
+ t.string :name
212
+ t.text :description
213
+ t.boolean :active, :default => true
214
+ t.string :environment, :default => 'development'
215
+ t.datetime :deleted_at
216
+ t.string :display_on
217
+ t.timestamps null: true
218
+ end
219
+
220
+ create_table :spree_payments do |t|
221
+ t.decimal :amount, :precision => 8, :scale => 2, :default => 0.0, :null => false
222
+ t.references :order
223
+ t.references :source, :polymorphic => true
224
+ t.references :payment_method
225
+ t.string :state
226
+ t.string :response_code
227
+ t.string :avs_response
228
+ t.timestamps null: true
229
+ end
230
+
231
+ create_table :spree_preferences do |t|
232
+ t.string :name, :limit => 100
233
+ t.references :owner, :polymorphic => true
234
+ t.text :value
235
+ t.string :key
236
+ t.string :value_type
237
+ t.timestamps null: true
238
+ end
239
+
240
+ add_index :spree_preferences, [:key], :name => 'index_spree_preferences_on_key', :unique => true
241
+
242
+ create_table :spree_product_option_types do |t|
243
+ t.integer :position
244
+ t.references :product
245
+ t.references :option_type
246
+ t.timestamps null: true
247
+ end
248
+
249
+ create_table :spree_product_properties do |t|
250
+ t.string :value
251
+ t.references :product
252
+ t.references :property
253
+ t.timestamps null: true
254
+ end
255
+
256
+ add_index :spree_product_properties, [:product_id], :name => 'index_product_properties_on_product_id'
257
+
258
+ create_table :spree_products do |t|
259
+ t.string :name, :default => '', :null => false
260
+ t.text :description
261
+ t.datetime :available_on
262
+ t.datetime :deleted_at
263
+ t.string :permalink
264
+ t.string :meta_description
265
+ t.string :meta_keywords
266
+ t.references :tax_category
267
+ t.references :shipping_category
268
+ t.integer :count_on_hand, :default => 0, :null => false
269
+ t.timestamps null: true
270
+ end
271
+
272
+ add_index :spree_products, [:available_on], :name => 'index_spree_products_on_available_on'
273
+ add_index :spree_products, [:deleted_at], :name => 'index_spree_products_on_deleted_at'
274
+ add_index :spree_products, [:name], :name => 'index_spree_products_on_name'
275
+ add_index :spree_products, [:permalink], :name => 'index_spree_products_on_permalink'
276
+
277
+ create_table :spree_products_taxons, :id => false do |t|
278
+ t.references :product
279
+ t.references :taxon
280
+ end
281
+
282
+ add_index :spree_products_taxons, [:product_id], :name => 'index_spree_products_taxons_on_product_id'
283
+ add_index :spree_products_taxons, [:taxon_id], :name => 'index_spree_products_taxons_on_taxon_id'
284
+
285
+ create_table :spree_properties do |t|
286
+ t.string :name
287
+ t.string :presentation, :null => false
288
+ t.timestamps null: true
289
+ end
290
+
291
+ create_table :spree_properties_prototypes, :id => false do |t|
292
+ t.references :prototype
293
+ t.references :property
294
+ end
295
+
296
+ create_table :spree_prototypes do |t|
297
+ t.string :name
298
+ t.timestamps null: true
299
+ end
300
+
301
+ create_table :spree_return_authorizations do |t|
302
+ t.string :number
303
+ t.string :state
304
+ t.decimal :amount, :precision => 8, :scale => 2, :default => 0.0, :null => false
305
+ t.references :order
306
+ t.text :reason
307
+ t.timestamps null: true
308
+ end
309
+
310
+ create_table :spree_roles do |t|
311
+ t.string :name
312
+ end
313
+
314
+ create_table :spree_roles_users, :id => false do |t|
315
+ t.references :role
316
+ t.references :user
317
+ end
318
+
319
+ add_index :spree_roles_users, [:role_id], :name => 'index_spree_roles_users_on_role_id'
320
+ add_index :spree_roles_users, [:user_id], :name => 'index_spree_roles_users_on_user_id'
321
+
322
+ create_table :spree_shipments do |t|
323
+ t.string :tracking
324
+ t.string :number
325
+ t.decimal :cost, :precision => 8, :scale => 2
326
+ t.datetime :shipped_at
327
+ t.references :order
328
+ t.references :shipping_method
329
+ t.references :address
330
+ t.string :state
331
+ t.timestamps null: true
332
+ end
333
+
334
+ add_index :spree_shipments, [:number], :name => 'index_shipments_on_number'
335
+
336
+ create_table :spree_shipping_categories do |t|
337
+ t.string :name
338
+ t.timestamps null: true
339
+ end
340
+
341
+ create_table :spree_shipping_methods do |t|
342
+ t.string :name
343
+ t.references :zone
344
+ t.string :display_on
345
+ t.references :shipping_category
346
+ t.boolean :match_none
347
+ t.boolean :match_all
348
+ t.boolean :match_one
349
+ t.datetime :deleted_at
350
+ t.timestamps null: true
351
+ end
352
+
353
+ create_table :spree_state_changes do |t|
354
+ t.string :name
355
+ t.string :previous_state
356
+ t.references :stateful
357
+ t.references :user
358
+ t.string :stateful_type
359
+ t.string :next_state
360
+ t.timestamps null: true
361
+ end
362
+
363
+ create_table :spree_states do |t|
364
+ t.string :name
365
+ t.string :abbr
366
+ t.references :country
367
+ end
368
+
369
+ create_table :spree_tax_categories do |t|
370
+ t.string :name
371
+ t.string :description
372
+ t.boolean :is_default, :default => false
373
+ t.datetime :deleted_at
374
+ t.timestamps null: true
375
+ end
376
+
377
+ create_table :spree_tax_rates do |t|
378
+ t.decimal :amount, :precision => 8, :scale => 5
379
+ t.references :zone
380
+ t.references :tax_category
381
+ t.boolean :included_in_price, :default => false
382
+ t.timestamps null: true
383
+ end
384
+
385
+ create_table :spree_taxonomies do |t|
386
+ t.string :name, :null => false
387
+ t.timestamps null: true
388
+ end
389
+
390
+ create_table :spree_taxons do |t|
391
+ t.references :parent
392
+ t.integer :position, :default => 0
393
+ t.string :name, :null => false
394
+ t.string :permalink
395
+ t.references :taxonomy
396
+ t.integer :lft
397
+ t.integer :rgt
398
+ t.string :icon_file_name
399
+ t.string :icon_content_type
400
+ t.integer :icon_file_size
401
+ t.datetime :icon_updated_at
402
+ t.text :description
403
+ t.timestamps null: true
404
+ end
405
+
406
+ add_index :spree_taxons, [:parent_id], :name => 'index_taxons_on_parent_id'
407
+ add_index :spree_taxons, [:permalink], :name => 'index_taxons_on_permalink'
408
+ add_index :spree_taxons, [:taxonomy_id], :name => 'index_taxons_on_taxonomy_id'
409
+
410
+ create_table :spree_tokenized_permissions, :force => true do |t|
411
+ t.references :permissable, :polymorphic => true
412
+ t.string :token
413
+ t.timestamps null: true
414
+ end
415
+
416
+ add_index :spree_tokenized_permissions, [:permissable_id, :permissable_type], :name => 'index_tokenized_name_and_type'
417
+
418
+ create_table :spree_trackers do |t|
419
+ t.string :environment
420
+ t.string :analytics_id
421
+ t.boolean :active, :default => true
422
+ t.timestamps null: true
423
+ end
424
+
425
+ create_table :spree_users do |t|
426
+ t.string :encrypted_password, :limit => 128
427
+ t.string :password_salt, :limit => 128
428
+ t.string :email
429
+ t.string :remember_token
430
+ t.string :persistence_token
431
+ t.string :reset_password_token
432
+ t.string :perishable_token
433
+ t.integer :sign_in_count, :default => 0, :null => false
434
+ t.integer :failed_attempts, :default => 0, :null => false
435
+ t.datetime :last_request_at
436
+ t.datetime :current_sign_in_at
437
+ t.datetime :last_sign_in_at
438
+ t.string :current_sign_in_ip
439
+ t.string :last_sign_in_ip
440
+ t.string :login
441
+ t.references :ship_address
442
+ t.references :bill_address
443
+ t.string :authentication_token
444
+ t.string :unlock_token
445
+ t.datetime :locked_at
446
+ t.datetime :remember_created_at
447
+ t.datetime :reset_password_sent_at
448
+ t.timestamps null: true
449
+ end
450
+
451
+ create_table :spree_variants do |t|
452
+ t.string :sku, :default => '', :null => false
453
+ t.decimal :price, :precision => 8, :scale => 2, :null => false
454
+ t.decimal :weight, :precision => 8, :scale => 2
455
+ t.decimal :height, :precision => 8, :scale => 2
456
+ t.decimal :width, :precision => 8, :scale => 2
457
+ t.decimal :depth, :precision => 8, :scale => 2
458
+ t.datetime :deleted_at
459
+ t.boolean :is_master, :default => false
460
+ t.references :product
461
+ t.integer :count_on_hand, :default => 0, :null => false
462
+ t.decimal :cost_price, :precision => 8, :scale => 2
463
+ t.integer :position
464
+ end
465
+
466
+ add_index :spree_variants, [:product_id], :name => 'index_spree_variants_on_product_id'
467
+
468
+ create_table :spree_zone_members do |t|
469
+ t.references :zoneable, :polymorphic => true
470
+ t.references :zone
471
+ t.timestamps null: true
472
+ end
473
+
474
+ create_table :spree_zones do |t|
475
+ t.string :name
476
+ t.string :description
477
+ t.boolean :default_tax, :default => false
478
+ t.integer :zone_members_count, :default => 0
479
+ t.timestamps null: true
480
+ end
481
+ end
482
+ end