rails_trade 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE +165 -0
- data/README.md +47 -0
- data/Rakefile +37 -0
- data/app/assets/config/rails_trade_manifest.js +1 -0
- data/app/assets/javascripts/controllers/rails_trade_admin/buyers/index.js +15 -0
- data/app/assets/javascripts/controllers/rails_trade_admin/buyers/overdue.js +15 -0
- data/app/assets/javascripts/controllers/rails_trade_admin/cart_items/create.js +3 -0
- data/app/assets/javascripts/controllers/rails_trade_admin/cart_items/index.js +80 -0
- data/app/assets/javascripts/controllers/rails_trade_admin/cart_items/only.js +45 -0
- data/app/assets/javascripts/controllers/rails_trade_admin/orders/new.js +29 -0
- data/app/assets/javascripts/controllers/rails_trade_admin/payment_methods/edit.js +1 -0
- data/app/assets/javascripts/controllers/rails_trade_admin/payment_methods/index.js +1 -0
- data/app/assets/javascripts/controllers/rails_trade_admin/payment_methods/new.js +1 -0
- data/app/assets/javascripts/controllers/rails_trade_admin/payment_methods/unverified.js +1 -0
- data/app/assets/javascripts/controllers/rails_trade_admin/payments/index.js +0 -0
- data/app/assets/javascripts/controllers/rails_trade_admin/payments/new.js +1 -0
- data/app/assets/javascripts/controllers/rails_trade_admin/promote_buyers/edit.js +31 -0
- data/app/assets/javascripts/controllers/rails_trade_admin/promote_buyers/new.js +31 -0
- data/app/assets/javascripts/controllers/rails_trade_admin/promote_goods/index.js +1 -0
- data/app/assets/javascripts/controllers/rails_trade_admin/promotes/edit.js +2 -0
- data/app/assets/javascripts/controllers/rails_trade_admin/promotes/index.js +1 -0
- data/app/assets/javascripts/controllers/rails_trade_admin/promotes/new.js +2 -0
- data/app/assets/javascripts/controllers/rails_trade_admin/serves/edit.js +2 -0
- data/app/assets/javascripts/controllers/rails_trade_admin/serves/index.js +1 -0
- data/app/assets/javascripts/controllers/rails_trade_admin/serves/new.js +4 -0
- data/app/assets/javascripts/controllers/rails_trade_my/cart_items/create.js +3 -0
- data/app/assets/javascripts/controllers/rails_trade_my/cart_items/index.js +65 -0
- data/app/controllers/areas_controller.rb +18 -0
- data/app/controllers/buyers_controller.rb +8 -0
- data/app/controllers/concerns/controller_order_types.rb +92 -0
- data/app/controllers/goods_controller.rb +90 -0
- data/app/controllers/payments_controller.rb +50 -0
- data/app/controllers/providers_controller.rb +8 -0
- data/app/controllers/the_trade_admin/addresses_controller.rb +75 -0
- data/app/controllers/the_trade_admin/areas_controller.rb +50 -0
- data/app/controllers/the_trade_admin/base_controller.rb +5 -0
- data/app/controllers/the_trade_admin/buyers_controller.rb +37 -0
- data/app/controllers/the_trade_admin/cart_item_serves_controller.rb +63 -0
- data/app/controllers/the_trade_admin/cart_items_controller.rb +123 -0
- data/app/controllers/the_trade_admin/order_payments_controller.rb +52 -0
- data/app/controllers/the_trade_admin/orders_controller.rb +103 -0
- data/app/controllers/the_trade_admin/payment_methods_controller.rb +111 -0
- data/app/controllers/the_trade_admin/payment_orders_controller.rb +56 -0
- data/app/controllers/the_trade_admin/payment_references_controller.rb +54 -0
- data/app/controllers/the_trade_admin/payment_strategies_controller.rb +50 -0
- data/app/controllers/the_trade_admin/payments_controller.rb +89 -0
- data/app/controllers/the_trade_admin/produces_controller.rb +66 -0
- data/app/controllers/the_trade_admin/promote_buyers_controller.rb +39 -0
- data/app/controllers/the_trade_admin/promote_charges_controller.rb +62 -0
- data/app/controllers/the_trade_admin/promote_goods_controller.rb +50 -0
- data/app/controllers/the_trade_admin/promotes_controller.rb +105 -0
- data/app/controllers/the_trade_admin/providers_controller.rb +121 -0
- data/app/controllers/the_trade_admin/refunds_controller.rb +60 -0
- data/app/controllers/the_trade_admin/serve_charges_controller.rb +67 -0
- data/app/controllers/the_trade_admin/serves_controller.rb +107 -0
- data/app/controllers/the_trade_my/addresses_controller.rb +50 -0
- data/app/controllers/the_trade_my/base_controller.rb +13 -0
- data/app/controllers/the_trade_my/buyers_controller.rb +35 -0
- data/app/controllers/the_trade_my/cart_items_controller.rb +71 -0
- data/app/controllers/the_trade_my/order_items_controller.rb +49 -0
- data/app/controllers/the_trade_my/orders_controller.rb +161 -0
- data/app/controllers/the_trade_my/payment_methods_controller.rb +76 -0
- data/app/controllers/the_trade_my/providers_controller.rb +44 -0
- data/app/models/rails_trade/address.rb +14 -0
- data/app/models/rails_trade/area.rb +65 -0
- data/app/models/rails_trade/cart_item.rb +185 -0
- data/app/models/rails_trade/cart_item_serve.rb +16 -0
- data/app/models/rails_trade/concerns/good_able.rb +63 -0
- data/app/models/rails_trade/concerns/order_able.rb +48 -0
- data/app/models/rails_trade/concerns/promote_fee.rb +54 -0
- data/app/models/rails_trade/concerns/serve_fee.rb +41 -0
- data/app/models/rails_trade/concerns/summary_service.rb +67 -0
- data/app/models/rails_trade/concerns/the_payment.rb +88 -0
- data/app/models/rails_trade/concerns/the_refund.rb +36 -0
- data/app/models/rails_trade/concerns/the_trade_buyer.rb +50 -0
- data/app/models/rails_trade/concerns/the_trade_user.rb +23 -0
- data/app/models/rails_trade/good_partner.rb +8 -0
- data/app/models/rails_trade/good_produce.rb +14 -0
- data/app/models/rails_trade/order.rb +111 -0
- data/app/models/rails_trade/order_item.rb +88 -0
- data/app/models/rails_trade/order_promote.rb +23 -0
- data/app/models/rails_trade/order_serve.rb +23 -0
- data/app/models/rails_trade/order_shipment.rb +10 -0
- data/app/models/rails_trade/payment.rb +135 -0
- data/app/models/rails_trade/payment_interface/payment_interface_base.rb +8 -0
- data/app/models/rails_trade/payment_interface/the_alipay.rb +49 -0
- data/app/models/rails_trade/payment_interface/the_paypal.rb +103 -0
- data/app/models/rails_trade/payment_interface/the_stripe.rb +73 -0
- data/app/models/rails_trade/payment_interface/the_wxpay.rb +56 -0
- data/app/models/rails_trade/payment_method.rb +57 -0
- data/app/models/rails_trade/payment_methods/alipay_method.rb +7 -0
- data/app/models/rails_trade/payment_methods/bank_method.rb +7 -0
- data/app/models/rails_trade/payment_methods/stripe_method.rb +57 -0
- data/app/models/rails_trade/payment_order.rb +75 -0
- data/app/models/rails_trade/payment_reference.rb +15 -0
- data/app/models/rails_trade/payment_strategy.rb +16 -0
- data/app/models/rails_trade/payments/alipay_payment.rb +12 -0
- data/app/models/rails_trade/payments/bank_payment.rb +15 -0
- data/app/models/rails_trade/payments/hand_payment.rb +13 -0
- data/app/models/rails_trade/payments/paypal_payment.rb +8 -0
- data/app/models/rails_trade/payments/stripe_payment.rb +7 -0
- data/app/models/rails_trade/payments/wxpay_payment.rb +14 -0
- data/app/models/rails_trade/produce.rb +18 -0
- data/app/models/rails_trade/promote.rb +40 -0
- data/app/models/rails_trade/promote_buyer.rb +9 -0
- data/app/models/rails_trade/promote_charge.rb +17 -0
- data/app/models/rails_trade/promote_charges/single_promote_charge.rb +7 -0
- data/app/models/rails_trade/promote_charges/total_promote_charge.rb +7 -0
- data/app/models/rails_trade/promote_good.rb +9 -0
- data/app/models/rails_trade/promotes/amount_promote.rb +4 -0
- data/app/models/rails_trade/promotes/number_promote.rb +4 -0
- data/app/models/rails_trade/provider.rb +25 -0
- data/app/models/rails_trade/refund.rb +63 -0
- data/app/models/rails_trade/refunds/alipay_refund.rb +33 -0
- data/app/models/rails_trade/refunds/bank_refund.rb +5 -0
- data/app/models/rails_trade/refunds/hand_refund.rb +5 -0
- data/app/models/rails_trade/refunds/paypal_refund.rb +32 -0
- data/app/models/rails_trade/refunds/stripe_refund.rb +26 -0
- data/app/models/rails_trade/refunds/wxpay_refund.rb +40 -0
- data/app/models/rails_trade/serve.rb +44 -0
- data/app/models/rails_trade/serve_charge.rb +37 -0
- data/app/models/rails_trade/serve_charges/single_serve_charge.rb +7 -0
- data/app/models/rails_trade/serve_charges/total_serve_charge.rb +7 -0
- data/app/models/rails_trade/serve_good.rb +9 -0
- data/app/models/rails_trade/serves/number_serve.rb +4 -0
- data/app/models/rails_trade/serves/quantity_serve.rb +4 -0
- data/app/models/rails_trade/shipment.rb +8 -0
- data/app/views/buyers/_show.html.erb +7 -0
- data/app/views/buyers/show.js.erb +1 -0
- data/app/views/goods/_choose.html.erb +36 -0
- data/app/views/goods/_good.html.erb +17 -0
- data/app/views/goods/_good_item.html.erb +17 -0
- data/app/views/goods/_nav.html.erb +18 -0
- data/app/views/goods/_search.html.erb +6 -0
- data/app/views/goods/index.html.erb +34 -0
- data/app/views/goods/index/_product.html.erb +14 -0
- data/app/views/goods/item.html.erb +47 -0
- data/app/views/goods/produce.html.erb +48 -0
- data/app/views/goods/show.html.erb +2 -0
- data/app/views/goods/show/_basic.html.erb +23 -0
- data/app/views/goods/show/_carousel.html.erb +35 -0
- data/app/views/goods/show/_items.html.erb +32 -0
- data/app/views/goods/show/_sales.html.erb +17 -0
- data/app/views/goods/show/_side.html.erb +19 -0
- data/app/views/goods/taxon/_breadcrumb.html.erb +8 -0
- data/app/views/goods/taxon/_nav.html.erb +19 -0
- data/app/views/goods/taxon/_nav_.html.erb +18 -0
- data/app/views/goods/taxon/_nav_last.html.erb +19 -0
- data/app/views/layouts/rails_trade_admin/base.html.erb +25 -0
- data/app/views/layouts/rails_trade_my/base.html.erb +28 -0
- data/app/views/rails_trade_admin/addresses/_address.html.erb +24 -0
- data/app/views/rails_trade_admin/addresses/_edit.html.erb +13 -0
- data/app/views/rails_trade_admin/addresses/_form.html.erb +23 -0
- data/app/views/rails_trade_admin/addresses/_new.html.erb +13 -0
- data/app/views/rails_trade_admin/addresses/create.js.erb +2 -0
- data/app/views/rails_trade_admin/addresses/destroy.js.erb +1 -0
- data/app/views/rails_trade_admin/addresses/edit.js.erb +39 -0
- data/app/views/rails_trade_admin/addresses/index.html.erb +41 -0
- data/app/views/rails_trade_admin/addresses/new.js.erb +52 -0
- data/app/views/rails_trade_admin/addresses/show.html.erb +4 -0
- data/app/views/rails_trade_admin/addresses/update.js.erb +2 -0
- data/app/views/rails_trade_admin/areas/_form.html.erb +9 -0
- data/app/views/rails_trade_admin/areas/edit.html.erb +16 -0
- data/app/views/rails_trade_admin/areas/index.html.erb +43 -0
- data/app/views/rails_trade_admin/areas/new.html.erb +11 -0
- data/app/views/rails_trade_admin/areas/show.html.erb +1 -0
- data/app/views/rails_trade_admin/base/_nav.html.erb +24 -0
- data/app/views/rails_trade_admin/base/_nav_bar.html.erb +23 -0
- data/app/views/rails_trade_admin/base/_nav_payment.html.erb +25 -0
- data/app/views/rails_trade_admin/buyers/_form.html.erb +17 -0
- data/app/views/rails_trade_admin/buyers/_menu.html.erb +5 -0
- data/app/views/rails_trade_admin/buyers/_search_form.html.erb +11 -0
- data/app/views/rails_trade_admin/buyers/edit.html.erb +6 -0
- data/app/views/rails_trade_admin/buyers/index.html.erb +46 -0
- data/app/views/rails_trade_admin/buyers/new.html.erb +5 -0
- data/app/views/rails_trade_admin/buyers/orders.html.erb +134 -0
- data/app/views/rails_trade_admin/buyers/overdue.html.erb +49 -0
- data/app/views/rails_trade_admin/buyers/show.html.erb +4 -0
- data/app/views/rails_trade_admin/cart_item_serves/_check.html.erb +12 -0
- data/app/views/rails_trade_admin/cart_item_serves/_index.html.erb +37 -0
- data/app/views/rails_trade_admin/cart_item_serves/_new.html.erb +14 -0
- data/app/views/rails_trade_admin/cart_item_serves/_serve.html.erb +16 -0
- data/app/views/rails_trade_admin/cart_item_serves/_single.html.erb +10 -0
- data/app/views/rails_trade_admin/cart_item_serves/_single_table.html.erb +29 -0
- data/app/views/rails_trade_admin/cart_item_serves/_total.html.erb +10 -0
- data/app/views/rails_trade_admin/cart_item_serves/_total_table.html.erb +26 -0
- data/app/views/rails_trade_admin/cart_item_serves/add.js.erb +47 -0
- data/app/views/rails_trade_admin/cart_item_serves/create.js.erb +3 -0
- data/app/views/rails_trade_admin/cart_item_serves/destroy.js.erb +50 -0
- data/app/views/rails_trade_admin/cart_item_serves/index.js.erb +50 -0
- data/app/views/rails_trade_admin/cart_item_serves/new.js.erb +5 -0
- data/app/views/rails_trade_admin/cart_item_serves/single.js.erb +55 -0
- data/app/views/rails_trade_admin/cart_item_serves/total.js.erb +55 -0
- data/app/views/rails_trade_admin/cart_items/_additions.html.erb +20 -0
- data/app/views/rails_trade_admin/cart_items/_filter.html.erb +15 -0
- data/app/views/rails_trade_admin/cart_items/_good_price.html.erb +10 -0
- data/app/views/rails_trade_admin/cart_items/_order_price.html.erb +27 -0
- data/app/views/rails_trade_admin/cart_items/_retail_price.html.erb +4 -0
- data/app/views/rails_trade_admin/cart_items/_single_price.html.erb +28 -0
- data/app/views/rails_trade_admin/cart_items/_total_price.html.erb +9 -0
- data/app/views/rails_trade_admin/cart_items/destroy.js.erb +1 -0
- data/app/views/rails_trade_admin/cart_items/error.html.erb +3 -0
- data/app/views/rails_trade_admin/cart_items/index.html.erb +104 -0
- data/app/views/rails_trade_admin/cart_items/only.html.erb +72 -0
- data/app/views/rails_trade_admin/cart_items/total.js.erb +11 -0
- data/app/views/rails_trade_admin/cart_items/update.js.erb +11 -0
- data/app/views/rails_trade_admin/goods/_form.html.erb +7 -0
- data/app/views/rails_trade_admin/goods/_item.html.erb +6 -0
- data/app/views/rails_trade_admin/goods/_new.html.erb +11 -0
- data/app/views/rails_trade_admin/goods/_show.html.erb +24 -0
- data/app/views/rails_trade_admin/goods/_show_tr.html.erb +24 -0
- data/app/views/rails_trade_admin/goods/create.js.erb +2 -0
- data/app/views/rails_trade_admin/goods/destroy.js.erb +1 -0
- data/app/views/rails_trade_admin/goods/edit.html.erb +16 -0
- data/app/views/rails_trade_admin/goods/edit.js.erb +8 -0
- data/app/views/rails_trade_admin/goods/edit_items.html.erb +43 -0
- data/app/views/rails_trade_admin/goods/edit_pic.html.erb +32 -0
- data/app/views/rails_trade_admin/goods/edit_promote.html.erb +64 -0
- data/app/views/rails_trade_admin/goods/index.html.erb +32 -0
- data/app/views/rails_trade_admin/goods/new.html.erb +14 -0
- data/app/views/rails_trade_admin/goods/new.js.erb +8 -0
- data/app/views/rails_trade_admin/goods/show.js.erb +5 -0
- data/app/views/rails_trade_admin/goods/update.js.erb +2 -0
- data/app/views/rails_trade_admin/order_payments/_index.html.erb +44 -0
- data/app/views/rails_trade_admin/order_payments/_new.html.erb +44 -0
- data/app/views/rails_trade_admin/order_payments/_payment_orders.html.erb +17 -0
- data/app/views/rails_trade_admin/order_payments/_payments.html.erb +19 -0
- data/app/views/rails_trade_admin/order_payments/create.js.erb +2 -0
- data/app/views/rails_trade_admin/order_payments/create_fail.js.erb +1 -0
- data/app/views/rails_trade_admin/order_payments/destroy.js.erb +2 -0
- data/app/views/rails_trade_admin/order_payments/index.js.erb +8 -0
- data/app/views/rails_trade_admin/order_payments/new.js.erb +8 -0
- data/app/views/rails_trade_admin/orders/_addresses.html.erb +36 -0
- data/app/views/rails_trade_admin/orders/_filter.html.erb +20 -0
- data/app/views/rails_trade_admin/orders/_form.html.erb +17 -0
- data/app/views/rails_trade_admin/orders/_invoice_addresses.html.erb +36 -0
- data/app/views/rails_trade_admin/orders/_item.html.erb +10 -0
- data/app/views/rails_trade_admin/orders/_new_items.html.erb +70 -0
- data/app/views/rails_trade_admin/orders/_search_form.html.erb +7 -0
- data/app/views/rails_trade_admin/orders/edit.html.erb +1 -0
- data/app/views/rails_trade_admin/orders/index.html.erb +61 -0
- data/app/views/rails_trade_admin/orders/new.html.erb +23 -0
- data/app/views/rails_trade_admin/orders/payments.html.erb +50 -0
- data/app/views/rails_trade_admin/orders/refresh.js.erb +7 -0
- data/app/views/rails_trade_admin/orders/show.html.erb +89 -0
- data/app/views/rails_trade_admin/payment_methods/_edit.html.erb +6 -0
- data/app/views/rails_trade_admin/payment_methods/_form.html.erb +5 -0
- data/app/views/rails_trade_admin/payment_methods/_index_layout.html.erb +15 -0
- data/app/views/rails_trade_admin/payment_methods/_new.html.erb +13 -0
- data/app/views/rails_trade_admin/payment_methods/_payment_method.html.erb +25 -0
- data/app/views/rails_trade_admin/payment_methods/_search_form.html.erb +22 -0
- data/app/views/rails_trade_admin/payment_methods/create.js.erb +2 -0
- data/app/views/rails_trade_admin/payment_methods/destroy.js.erb +1 -0
- data/app/views/rails_trade_admin/payment_methods/edit.html.erb +15 -0
- data/app/views/rails_trade_admin/payment_methods/edit.js.erb +8 -0
- data/app/views/rails_trade_admin/payment_methods/index.html.erb +23 -0
- data/app/views/rails_trade_admin/payment_methods/mine.html.erb +23 -0
- data/app/views/rails_trade_admin/payment_methods/new.html.erb +15 -0
- data/app/views/rails_trade_admin/payment_methods/new.js.erb +7 -0
- data/app/views/rails_trade_admin/payment_methods/unverified.html.erb +60 -0
- data/app/views/rails_trade_admin/payment_methods/update.js.erb +2 -0
- data/app/views/rails_trade_admin/payment_orders/_index.html.erb +31 -0
- data/app/views/rails_trade_admin/payment_orders/_new.html.erb +24 -0
- data/app/views/rails_trade_admin/payment_orders/_orders.html.erb +27 -0
- data/app/views/rails_trade_admin/payment_orders/cancel.js.erb +2 -0
- data/app/views/rails_trade_admin/payment_orders/create.js.erb +2 -0
- data/app/views/rails_trade_admin/payment_orders/create_fail.js.erb +1 -0
- data/app/views/rails_trade_admin/payment_orders/new.js.erb +6 -0
- data/app/views/rails_trade_admin/payment_orders/raise_fail.js.erb +1 -0
- data/app/views/rails_trade_admin/payment_orders/update.js.erb +2 -0
- data/app/views/rails_trade_admin/payment_orders/update_fail.js.erb +2 -0
- data/app/views/rails_trade_admin/payment_references/_form.html.erb +20 -0
- data/app/views/rails_trade_admin/payment_references/_new.html.erb +11 -0
- data/app/views/rails_trade_admin/payment_references/destroy.js.erb +1 -0
- data/app/views/rails_trade_admin/payment_references/edit.html.erb +6 -0
- data/app/views/rails_trade_admin/payment_references/index.html.erb +25 -0
- data/app/views/rails_trade_admin/payment_references/new.js.erb +8 -0
- data/app/views/rails_trade_admin/payment_references/show.html.erb +4 -0
- data/app/views/rails_trade_admin/payment_strategies/_form.html.erb +5 -0
- data/app/views/rails_trade_admin/payment_strategies/edit.html.erb +13 -0
- data/app/views/rails_trade_admin/payment_strategies/index.html.erb +37 -0
- data/app/views/rails_trade_admin/payment_strategies/new.html.erb +13 -0
- data/app/views/rails_trade_admin/payments/_form.html.erb +12 -0
- data/app/views/rails_trade_admin/payments/_item.html.erb +49 -0
- data/app/views/rails_trade_admin/payments/_search_form.html.erb +15 -0
- data/app/views/rails_trade_admin/payments/analyze.js.erb +12 -0
- data/app/views/rails_trade_admin/payments/dashboard.html.erb +4 -0
- data/app/views/rails_trade_admin/payments/edit.html.erb +15 -0
- data/app/views/rails_trade_admin/payments/index.html.erb +60 -0
- data/app/views/rails_trade_admin/payments/new.html.erb +17 -0
- data/app/views/rails_trade_admin/payments/show.html.erb +4 -0
- data/app/views/rails_trade_admin/promote_buyers/_form.html.erb +6 -0
- data/app/views/rails_trade_admin/promote_buyers/_promote_buyer.json.jbuilder +2 -0
- data/app/views/rails_trade_admin/promote_buyers/edit.html.erb +14 -0
- data/app/views/rails_trade_admin/promote_buyers/index.html.erb +42 -0
- data/app/views/rails_trade_admin/promote_buyers/index.json.jbuilder +1 -0
- data/app/views/rails_trade_admin/promote_buyers/new.html.erb +13 -0
- data/app/views/rails_trade_admin/promote_buyers/show.html.erb +0 -0
- data/app/views/rails_trade_admin/promote_buyers/show.json.jbuilder +1 -0
- data/app/views/rails_trade_admin/promote_charges/_edit.html.erb +13 -0
- data/app/views/rails_trade_admin/promote_charges/_form.html.erb +6 -0
- data/app/views/rails_trade_admin/promote_charges/_new.html.erb +13 -0
- data/app/views/rails_trade_admin/promote_charges/_search_form.html.erb +9 -0
- data/app/views/rails_trade_admin/promote_charges/edit.js.erb +8 -0
- data/app/views/rails_trade_admin/promote_charges/index.html.erb +49 -0
- data/app/views/rails_trade_admin/promote_charges/new.js.erb +8 -0
- data/app/views/rails_trade_admin/promote_goods/_form.html.erb +4 -0
- data/app/views/rails_trade_admin/promote_goods/_promote_good.json.jbuilder +2 -0
- data/app/views/rails_trade_admin/promote_goods/edit.html.erb +14 -0
- data/app/views/rails_trade_admin/promote_goods/index.html.erb +37 -0
- data/app/views/rails_trade_admin/promote_goods/index.json.jbuilder +1 -0
- data/app/views/rails_trade_admin/promote_goods/new.html.erb +13 -0
- data/app/views/rails_trade_admin/promote_goods/show.html.erb +0 -0
- data/app/views/rails_trade_admin/promote_goods/show.json.jbuilder +1 -0
- data/app/views/rails_trade_admin/promotes/_form.html.erb +9 -0
- data/app/views/rails_trade_admin/promotes/edit.html.erb +9 -0
- data/app/views/rails_trade_admin/promotes/index.html.erb +65 -0
- data/app/views/rails_trade_admin/promotes/new.html.erb +9 -0
- data/app/views/rails_trade_admin/promotes/show.html.erb +4 -0
- data/app/views/rails_trade_admin/providers/_form.html.erb +6 -0
- data/app/views/rails_trade_admin/providers/_product.html.erb +12 -0
- data/app/views/rails_trade_admin/providers/_side.html.erb +8 -0
- data/app/views/rails_trade_admin/providers/area.html.erb +1 -0
- data/app/views/rails_trade_admin/providers/channel.html.erb +46 -0
- data/app/views/rails_trade_admin/providers/edit.html.erb +16 -0
- data/app/views/rails_trade_admin/providers/index.html.erb +27 -0
- data/app/views/rails_trade_admin/providers/new.html.erb +21 -0
- data/app/views/rails_trade_admin/providers/posts.html.erb +41 -0
- data/app/views/rails_trade_admin/providers/products.html.erb +23 -0
- data/app/views/rails_trade_admin/providers/show.html.erb +60 -0
- data/app/views/rails_trade_admin/refunds/_form.html.erb +17 -0
- data/app/views/rails_trade_admin/refunds/_logs_table.html.erb +33 -0
- data/app/views/rails_trade_admin/refunds/_new.html.erb +18 -0
- data/app/views/rails_trade_admin/refunds/_search_form.html.erb +13 -0
- data/app/views/rails_trade_admin/refunds/edit.html.erb +6 -0
- data/app/views/rails_trade_admin/refunds/index.html.erb +57 -0
- data/app/views/rails_trade_admin/refunds/logs.js.erb +8 -0
- data/app/views/rails_trade_admin/refunds/new.html.erb +5 -0
- data/app/views/rails_trade_admin/refunds/new.js.erb +8 -0
- data/app/views/rails_trade_admin/refunds/show.html.erb +4 -0
- data/app/views/rails_trade_admin/serve_charges/_edit.html.erb +13 -0
- data/app/views/rails_trade_admin/serve_charges/_form.html.erb +10 -0
- data/app/views/rails_trade_admin/serve_charges/_new.html.erb +13 -0
- data/app/views/rails_trade_admin/serve_charges/_search_form.html.erb +10 -0
- data/app/views/rails_trade_admin/serve_charges/edit.js.erb +7 -0
- data/app/views/rails_trade_admin/serve_charges/index.html.erb +56 -0
- data/app/views/rails_trade_admin/serve_charges/new.js.erb +8 -0
- data/app/views/rails_trade_admin/serves/_form.html.erb +9 -0
- data/app/views/rails_trade_admin/serves/edit.html.erb +9 -0
- data/app/views/rails_trade_admin/serves/index.html.erb +80 -0
- data/app/views/rails_trade_admin/serves/new.html.erb +9 -0
- data/app/views/rails_trade_my/addresses/_edit.html.erb +31 -0
- data/app/views/rails_trade_my/addresses/_form.html.erb +23 -0
- data/app/views/rails_trade_my/addresses/_new.html.erb +11 -0
- data/app/views/rails_trade_my/addresses/create.js.erb +2 -0
- data/app/views/rails_trade_my/addresses/destroy.js.erb +1 -0
- data/app/views/rails_trade_my/addresses/edit.js.erb +39 -0
- data/app/views/rails_trade_my/addresses/index.html.erb +44 -0
- data/app/views/rails_trade_my/addresses/new.js.erb +39 -0
- data/app/views/rails_trade_my/addresses/show.html.erb +4 -0
- data/app/views/rails_trade_my/addresses/update.js.erb +2 -0
- data/app/views/rails_trade_my/base/_nav.html.erb +22 -0
- data/app/views/rails_trade_my/buyers/_form.html.erb +5 -0
- data/app/views/rails_trade_my/buyers/edit.html.erb +2 -0
- data/app/views/rails_trade_my/buyers/show.html.erb +21 -0
- data/app/views/rails_trade_my/cart_items/_additions.html.erb +22 -0
- data/app/views/rails_trade_my/cart_items/_single_price.html.erb +6 -0
- data/app/views/rails_trade_my/cart_items/_total_price.html.erb +8 -0
- data/app/views/rails_trade_my/cart_items/destroy.js.erb +1 -0
- data/app/views/rails_trade_my/cart_items/index.html.erb +69 -0
- data/app/views/rails_trade_my/cart_items/total.js.erb +11 -0
- data/app/views/rails_trade_my/cart_items/update.js.erb +8 -0
- data/app/views/rails_trade_my/my/index.html.erb +17 -0
- data/app/views/rails_trade_my/order_items/_form.html.erb +17 -0
- data/app/views/rails_trade_my/order_items/edit.html.erb +6 -0
- data/app/views/rails_trade_my/order_items/index.html.erb +25 -0
- data/app/views/rails_trade_my/order_items/new.html.erb +5 -0
- data/app/views/rails_trade_my/order_items/show.html.erb +8 -0
- data/app/views/rails_trade_my/orders/_date_form.html.erb +23 -0
- data/app/views/rails_trade_my/orders/_edit.html.erb +10 -0
- data/app/views/rails_trade_my/orders/_edit_payment_type.html.erb +13 -0
- data/app/views/rails_trade_my/orders/_form.html.erb +4 -0
- data/app/views/rails_trade_my/orders/destroy.js.erb +1 -0
- data/app/views/rails_trade_my/orders/edit.js.erb +4 -0
- data/app/views/rails_trade_my/orders/edit_payment_type.js.erb +6 -0
- data/app/views/rails_trade_my/orders/fail.html.erb +11 -0
- data/app/views/rails_trade_my/orders/index.html.erb +55 -0
- data/app/views/rails_trade_my/orders/index.json.jbuilder +9 -0
- data/app/views/rails_trade_my/orders/new.html.erb +41 -0
- data/app/views/rails_trade_my/orders/refresh.js.erb +7 -0
- data/app/views/rails_trade_my/orders/show.html.erb +103 -0
- data/app/views/rails_trade_my/orders/success.html.erb +12 -0
- data/app/views/rails_trade_my/orders/update.js.erb +3 -0
- data/app/views/rails_trade_my/orders/update_payment_type.js.erb +3 -0
- data/app/views/rails_trade_my/orders/wxpay_pay.js.erb +16 -0
- data/app/views/rails_trade_my/orders/wxpay_pay_err.js.erb +5 -0
- data/app/views/rails_trade_my/payment_methods/_edit.html.erb +13 -0
- data/app/views/rails_trade_my/payment_methods/_form.html.erb +5 -0
- data/app/views/rails_trade_my/payment_methods/_index.html.erb +25 -0
- data/app/views/rails_trade_my/payment_methods/_item.html.erb +10 -0
- data/app/views/rails_trade_my/payment_methods/_new.html.erb +13 -0
- data/app/views/rails_trade_my/payment_methods/create.js.erb +3 -0
- data/app/views/rails_trade_my/payment_methods/destroy.js.erb +1 -0
- data/app/views/rails_trade_my/payment_methods/edit.js.erb +8 -0
- data/app/views/rails_trade_my/payment_methods/index.html.erb +1 -0
- data/app/views/rails_trade_my/payment_methods/index.js.erb +1 -0
- data/app/views/rails_trade_my/payment_methods/new.js.erb +8 -0
- data/app/views/rails_trade_my/payment_methods/show.html.erb +4 -0
- data/app/views/rails_trade_my/payment_methods/update.js.erb +2 -0
- data/app/views/rails_trade_my/providers/_form.html.erb +5 -0
- data/app/views/rails_trade_my/providers/_provider.html.erb +20 -0
- data/app/views/rails_trade_my/providers/edit.html.erb +2 -0
- data/app/views/rails_trade_my/providers/index.html.erb +12 -0
- data/app/views/rails_trade_my/providers/new.html.erb +10 -0
- data/app/views/rails_trade_my/providers/show.html.erb +13 -0
- data/app/views/rails_trade_my/users/_form.html.erb +17 -0
- data/app/views/rails_trade_my/users/edit.html.erb +44 -0
- data/app/views/rails_trade_my/users/show.html.erb +18 -0
- data/config/locales/en.yml +85 -0
- data/config/locales/zh.yml +75 -0
- data/config/routes.rb +118 -0
- data/db/migrate/20150514135720_create_providers.rb +59 -0
- data/db/migrate/20170601014520_create_payments.rb +52 -0
- data/db/migrate/20170602061859_create_payment_references.rb +12 -0
- data/db/migrate/20170702234123_create_orders.rb +56 -0
- data/db/migrate/20170714080032_create_payment_strategies.rb +77 -0
- data/db/migrate/20171115063702_create_promote_buyers.rb +31 -0
- data/db/schema.rb +94 -0
- data/lib/rails_trade.rb +22 -0
- data/lib/rails_trade/config.rb +12 -0
- data/lib/rails_trade/engine.rb +30 -0
- data/lib/rails_trade/version.rb +3 -0
- data/lib/tasks/the_trade_tasks.rake +4 -0
- metadata +491 -0
@@ -0,0 +1,59 @@
|
|
1
|
+
class CreateProviders < ActiveRecord::Migration[5.1]
|
2
|
+
def change
|
3
|
+
|
4
|
+
create_table :providers do |t|
|
5
|
+
t.references :area
|
6
|
+
t.string :type
|
7
|
+
t.string :name
|
8
|
+
t.string :service_tel
|
9
|
+
t.string :service_qq
|
10
|
+
t.string :address
|
11
|
+
t.timestamps
|
12
|
+
end
|
13
|
+
|
14
|
+
create_table :goods do |t|
|
15
|
+
t.string :sku, index: true
|
16
|
+
t.string :name
|
17
|
+
t.decimal :quantity
|
18
|
+
t.string :unit
|
19
|
+
t.decimal :price
|
20
|
+
t.integer :sales_count
|
21
|
+
t.boolean :published, default: true
|
22
|
+
t.references :promote
|
23
|
+
t.timestamps
|
24
|
+
end
|
25
|
+
|
26
|
+
create_table :cart_items do |t|
|
27
|
+
t.references :user
|
28
|
+
t.references :buyer
|
29
|
+
t.references :good, polymorphic: true
|
30
|
+
t.string :session_id, limit: 128
|
31
|
+
t.string :status
|
32
|
+
t.integer :quantity
|
33
|
+
t.string :extra, limit: 1024
|
34
|
+
t.boolean :checked, default: false
|
35
|
+
t.boolean :myself
|
36
|
+
t.boolean :archived, default: false
|
37
|
+
t.timestamps
|
38
|
+
end
|
39
|
+
|
40
|
+
create_table :areas do |t|
|
41
|
+
t.string :nation, default: ''
|
42
|
+
t.string :province, default: ''
|
43
|
+
t.string :city, default: ''
|
44
|
+
t.string :district, default: ''
|
45
|
+
t.boolean :published, default: true
|
46
|
+
t.boolean :popular, default: false
|
47
|
+
t.timestamps
|
48
|
+
end
|
49
|
+
|
50
|
+
create_table :addresses do |t|
|
51
|
+
t.references :area
|
52
|
+
t.references :user
|
53
|
+
t.references :buyer
|
54
|
+
t.string :kind
|
55
|
+
t.timestamps
|
56
|
+
end
|
57
|
+
|
58
|
+
end
|
59
|
+
end
|
@@ -0,0 +1,52 @@
|
|
1
|
+
class CreatePayments < ActiveRecord::Migration[5.1]
|
2
|
+
def change
|
3
|
+
|
4
|
+
create_table :payments do |t|
|
5
|
+
t.column :type, :string, limit: 255
|
6
|
+
t.column :total_amount, :decimal, precision: 10, scale: 2
|
7
|
+
t.column :fee_amount, :decimal, precision: 10, scale: 2
|
8
|
+
t.column :income_amount, :decimal, precision: 10, scale: 2
|
9
|
+
t.column :checked_amount, :decimal, precision: 10, scale: 2, default: 0
|
10
|
+
t.column :adjust_amount, :decimal, precision: 10, scale: 2, default: 0
|
11
|
+
t.column :payment_uuid, :string, limit: 255
|
12
|
+
t.column :notify_type, :string, limit: 255
|
13
|
+
t.column :notified_at, :datetime
|
14
|
+
t.column :pay_status, :string, limit: 255
|
15
|
+
t.column :sign, :string, limit: 255
|
16
|
+
t.column :seller_identifier, :string, limit: 255
|
17
|
+
t.column :buyer_name, :string, limit: 255
|
18
|
+
t.column :buyer_identifier, :string, limit: 255
|
19
|
+
t.column :buyer_bank, :string
|
20
|
+
t.column :user_id, :integer, limit: 4
|
21
|
+
t.column :currency, :string, limit: 255
|
22
|
+
t.column :state, :integer, limit: 4, default: 0
|
23
|
+
t.string :comment
|
24
|
+
t.references :payment_method
|
25
|
+
t.references :creator
|
26
|
+
t.boolean :verified, default: true
|
27
|
+
t.timestamps
|
28
|
+
end
|
29
|
+
|
30
|
+
create_table :payment_orders do |t|
|
31
|
+
t.references :payment
|
32
|
+
t.references :order
|
33
|
+
t.decimal :order_amount, precision: 10, scale: 2
|
34
|
+
t.decimal :check_amount, precision: 10, scale: 2
|
35
|
+
t.integer :state, default: 0
|
36
|
+
t.timestamps
|
37
|
+
end
|
38
|
+
|
39
|
+
create_table :payment_methods do |t|
|
40
|
+
t.string :type
|
41
|
+
t.string :account_name
|
42
|
+
t.string :account_num
|
43
|
+
t.string :bank
|
44
|
+
t.text :extra
|
45
|
+
t.boolean :verified
|
46
|
+
t.boolean :myself
|
47
|
+
t.references :creator
|
48
|
+
t.timestamps
|
49
|
+
end
|
50
|
+
|
51
|
+
end
|
52
|
+
end
|
@@ -0,0 +1,56 @@
|
|
1
|
+
class CreateOrders < ActiveRecord::Migration[5.1]
|
2
|
+
def change
|
3
|
+
|
4
|
+
create_table :orders do |t|
|
5
|
+
t.references :user
|
6
|
+
t.references :buyer
|
7
|
+
t.references :payment_strategy
|
8
|
+
t.string :uuid, null: false
|
9
|
+
t.integer :state, default: 0
|
10
|
+
t.decimal :amount, precision: 10, scale: 2
|
11
|
+
t.decimal :received_amount, precision: 10, scale: 2, default: 0
|
12
|
+
t.decimal :subtotal, precision: 10, scale: 2
|
13
|
+
t.decimal :pure_serve_sum, precision: 10, scale: 2
|
14
|
+
t.decimal :pure_promote_sum, precision: 10, scale: 2
|
15
|
+
t.decimal :serve_sum, precision: 10, scale: 2
|
16
|
+
t.decimal :promote_sum, precision: 10, scale: 2
|
17
|
+
t.string :currency
|
18
|
+
t.integer :payment_id
|
19
|
+
t.string :payment_type
|
20
|
+
t.integer :payment_status
|
21
|
+
t.boolean :myself
|
22
|
+
t.string :note, limit: 4096
|
23
|
+
t.timestamps
|
24
|
+
end
|
25
|
+
|
26
|
+
create_table :order_items do |t|
|
27
|
+
t.references :order
|
28
|
+
t.references :cart_item
|
29
|
+
t.references :good, polymorphic: true
|
30
|
+
t.integer :quantity
|
31
|
+
t.integer :number
|
32
|
+
t.decimal :pure_price, precision: 10, scale: 2
|
33
|
+
t.decimal :promote_sum, precision: 10, scale: 2
|
34
|
+
t.decimal :serve_sum, precision: 10, scale: 2
|
35
|
+
t.decimal :amount, precision: 10, scale: 2
|
36
|
+
t.timestamps
|
37
|
+
end
|
38
|
+
|
39
|
+
create_table :refunds do |t|
|
40
|
+
t.references :order
|
41
|
+
t.references :payment
|
42
|
+
t.references :operator
|
43
|
+
t.string :type
|
44
|
+
t.decimal :total_amount, precision: 10, scale: 2
|
45
|
+
t.string :buyer_identifier
|
46
|
+
t.string :comment, limit: 512
|
47
|
+
t.integer :state, default: 0
|
48
|
+
t.datetime :refunded_at
|
49
|
+
t.string :reason, limit: 512
|
50
|
+
t.string :currency
|
51
|
+
t.string :refund_uuid
|
52
|
+
t.timestamps
|
53
|
+
end
|
54
|
+
|
55
|
+
end
|
56
|
+
end
|
@@ -0,0 +1,77 @@
|
|
1
|
+
class CreatePaymentStrategies < ActiveRecord::Migration[5.1]
|
2
|
+
def change
|
3
|
+
|
4
|
+
create_table :payment_strategies do |t|
|
5
|
+
t.string :name
|
6
|
+
t.string :strategy
|
7
|
+
t.integer :period, default: 0
|
8
|
+
t.timestamps
|
9
|
+
end
|
10
|
+
|
11
|
+
create_table :promotes do |t|
|
12
|
+
t.string :type
|
13
|
+
t.string :unit
|
14
|
+
t.string :name
|
15
|
+
t.datetime :start_at
|
16
|
+
t.datetime :finish_at
|
17
|
+
t.string :scope
|
18
|
+
t.boolean :verified, default: false
|
19
|
+
t.boolean :overall, default: false
|
20
|
+
t.boolean :contain_max, default: false
|
21
|
+
t.integer :sequence, default: 1
|
22
|
+
t.timestamps
|
23
|
+
end
|
24
|
+
|
25
|
+
create_table :promote_charges do |t|
|
26
|
+
t.references :promote
|
27
|
+
t.decimal :min, precision: 10, scale: 2, default: 0
|
28
|
+
t.decimal :max, precision: 10, scale: 2, default: 99999999.99
|
29
|
+
t.decimal :price, precision: 10, scale: 2
|
30
|
+
t.string :type
|
31
|
+
t.timestamps
|
32
|
+
end
|
33
|
+
|
34
|
+
create_table :order_promotes do |t|
|
35
|
+
t.references :order, null: false
|
36
|
+
t.references :order_item
|
37
|
+
t.references :promote
|
38
|
+
t.references :promote_charge
|
39
|
+
t.decimal :amount, precision: 10, scale: 2
|
40
|
+
t.timestamps
|
41
|
+
end
|
42
|
+
|
43
|
+
create_table :serves do |t|
|
44
|
+
t.string :type
|
45
|
+
t.string :unit
|
46
|
+
t.string :name
|
47
|
+
t.string :scope
|
48
|
+
t.string :extra
|
49
|
+
t.boolean :verified, default: false
|
50
|
+
t.boolean :overall, default: true
|
51
|
+
t.boolean :contain_max, default: false
|
52
|
+
t.boolean :default, default: false
|
53
|
+
t.references :deal, polymorphic: true
|
54
|
+
t.timestamps
|
55
|
+
end
|
56
|
+
|
57
|
+
create_table :serve_charges do |t|
|
58
|
+
t.references :serve
|
59
|
+
t.decimal :min, precision: 10, scale: 2, default: 0
|
60
|
+
t.decimal :max, precision: 10, scale: 2, default: 99999999.99
|
61
|
+
t.decimal :price, precision: 10, scale: 2
|
62
|
+
t.decimal :base_price, precision: 10, scale: 2, default: 0
|
63
|
+
t.string :type
|
64
|
+
t.timestamps
|
65
|
+
end
|
66
|
+
|
67
|
+
create_table :order_serves do |t|
|
68
|
+
t.references :order, null: false
|
69
|
+
t.references :order_item
|
70
|
+
t.references :serve
|
71
|
+
t.references :serve_charge
|
72
|
+
t.decimal :amount, precision: 10, scale: 2
|
73
|
+
t.timestamps
|
74
|
+
end
|
75
|
+
|
76
|
+
end
|
77
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
class CreatePromoteBuyers < ActiveRecord::Migration[5.1]
|
2
|
+
def change
|
3
|
+
|
4
|
+
create_table :promote_buyers do |t|
|
5
|
+
t.references :buyer
|
6
|
+
t.references :promote
|
7
|
+
t.timestamps
|
8
|
+
end
|
9
|
+
|
10
|
+
create_table :promote_goods do |t|
|
11
|
+
t.references :good, polymorphic: true
|
12
|
+
t.references :promote
|
13
|
+
t.timestamps
|
14
|
+
end
|
15
|
+
|
16
|
+
create_table :serve_goods do |t|
|
17
|
+
t.references :good, polymorphic: true
|
18
|
+
t.references :serve
|
19
|
+
t.timestamps
|
20
|
+
end
|
21
|
+
|
22
|
+
create_table :cart_item_serves do |t|
|
23
|
+
t.references :cart_item
|
24
|
+
t.references :serve
|
25
|
+
t.string :scope
|
26
|
+
t.decimal :price, precision: 10, scale: 2
|
27
|
+
t.timestamps
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
31
|
+
end
|
data/db/schema.rb
ADDED
@@ -0,0 +1,94 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
# This file is auto-generated from the current state of the database. Instead
|
3
|
+
# of editing this file, please use the migrations feature of Active Record to
|
4
|
+
# incrementally modify your database, and then regenerate this schema definition.
|
5
|
+
#
|
6
|
+
# Note that this schema.rb definition is the authoritative source for your
|
7
|
+
# database schema. If you need to create the application database on another
|
8
|
+
# system, you should be using db:schema:load, not running all the migrations
|
9
|
+
# from scratch. The latter is a flawed and unsustainable approach (the more migrations
|
10
|
+
# you'll amass, the slower it'll run and the greater likelihood for issues).
|
11
|
+
#
|
12
|
+
# It's strongly recommended that you check this file into your version control system.
|
13
|
+
|
14
|
+
ActiveRecord::Schema.define(version: 20150130123018) do
|
15
|
+
|
16
|
+
|
17
|
+
create_table "areas", force: :cascade do |t|
|
18
|
+
t.string "name", limit: 255, null: false
|
19
|
+
t.string "province", limit: 255
|
20
|
+
t.string "city", limit: 255
|
21
|
+
t.string "district", limit: 255
|
22
|
+
t.integer "parent_id", limit: 4
|
23
|
+
end
|
24
|
+
|
25
|
+
create_table "contributions", force: :cascade do |t|
|
26
|
+
t.integer "user_id", limit: 4
|
27
|
+
t.integer "contribute_id", limit: 4
|
28
|
+
t.string "contribute_type", limit: 255
|
29
|
+
end
|
30
|
+
|
31
|
+
create_table "item_children", force: :cascade do |t|
|
32
|
+
t.integer "item_id", limit: 4
|
33
|
+
t.integer "child_id", limit: 4
|
34
|
+
t.integer "position", limit: 4, default: 0
|
35
|
+
end
|
36
|
+
|
37
|
+
create_table "item_parents", force: :cascade do |t|
|
38
|
+
t.integer "item_id", limit: 4
|
39
|
+
t.integer "parent_id", limit: 4
|
40
|
+
t.integer "position", limit: 4, default: 0
|
41
|
+
end
|
42
|
+
|
43
|
+
create_table "items", force: :cascade do |t|
|
44
|
+
t.string "name", limit: 255
|
45
|
+
t.string "picture", limit: 255
|
46
|
+
t.integer "list_id", limit: 4
|
47
|
+
t.string "list_name", limit: 255
|
48
|
+
t.text "content", limit: 65535
|
49
|
+
t.string "type", limit: 255
|
50
|
+
t.integer "status", limit: 4, default: 0
|
51
|
+
t.integer "node_type", limit: 4
|
52
|
+
t.integer "children_count", limit: 4, default: 0
|
53
|
+
t.datetime "updated_at"
|
54
|
+
end
|
55
|
+
|
56
|
+
create_table "lists", force: :cascade do |t|
|
57
|
+
t.string "name", limit: 255
|
58
|
+
t.integer "items_count", limit: 4, default: 0
|
59
|
+
t.integer "position", limit: 4, default: 0
|
60
|
+
t.integer "kind", limit: 4
|
61
|
+
end
|
62
|
+
|
63
|
+
create_table "photos", force: :cascade do |t|
|
64
|
+
t.string "title", limit: 255
|
65
|
+
t.string "description", limit: 255
|
66
|
+
t.string "photo", limit: 255
|
67
|
+
t.integer "imageable_id", limit: 4
|
68
|
+
t.string "imageable_type", limit: 255
|
69
|
+
t.integer "position", limit: 4, default: 0
|
70
|
+
t.datetime "created_at", null: false
|
71
|
+
t.datetime "updated_at", null: false
|
72
|
+
end
|
73
|
+
|
74
|
+
create_table "shipments", force: :cascade do |t|
|
75
|
+
t.integer "user_id", limit: 4
|
76
|
+
t.integer "area_id", limit: 4
|
77
|
+
t.string "address", limit: 255
|
78
|
+
end
|
79
|
+
|
80
|
+
create_table "stars", force: :cascade do |t|
|
81
|
+
t.integer "user_id", limit: 4
|
82
|
+
t.integer "lovable_id", limit: 4
|
83
|
+
t.string "lovable_type", limit: 255
|
84
|
+
t.datetime "created_at"
|
85
|
+
t.datetime "updated_at"
|
86
|
+
end
|
87
|
+
|
88
|
+
create_table "user_promotes", force: :cascade do |t|
|
89
|
+
t.integer "user_id", limit: 4
|
90
|
+
t.integer "promote_id", limit: 4
|
91
|
+
end
|
92
|
+
|
93
|
+
|
94
|
+
end
|
data/lib/rails_trade.rb
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
require 'rails_trade/engine'
|
2
|
+
require 'rails_trade/config'
|
3
|
+
|
4
|
+
module RailsTrade
|
5
|
+
|
6
|
+
def self.buyer_class
|
7
|
+
@buyer_class
|
8
|
+
end
|
9
|
+
|
10
|
+
def self.buyer_class=(buyer)
|
11
|
+
if @buyer_class&.name == buyer.name
|
12
|
+
return
|
13
|
+
elsif buyer.ancestors.include?(ActiveRecord::Base)
|
14
|
+
@buyer_class = buyer
|
15
|
+
elsif buyer.is_a?(Class)
|
16
|
+
raise 'You can not include RailsTradeBuyer more than once'
|
17
|
+
else
|
18
|
+
raise 'You must assign an ActiveRecord class'
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
require 'active_support/configurable'
|
2
|
+
|
3
|
+
module RailsTrade
|
4
|
+
include ActiveSupport::Configurable
|
5
|
+
|
6
|
+
configure do |config|
|
7
|
+
config.admin_class = 'Admin::BaseController'
|
8
|
+
config.my_class = 'My::BaseController'
|
9
|
+
config.disabled_models = []
|
10
|
+
end
|
11
|
+
|
12
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
require 'monetize'
|
2
|
+
module RailsTrade
|
3
|
+
class Engine < ::Rails::Engine
|
4
|
+
|
5
|
+
config.autoload_paths += Dir[
|
6
|
+
"#{config.root}/app/models/rails_trade",
|
7
|
+
]
|
8
|
+
|
9
|
+
config.eager_load_paths += Dir[
|
10
|
+
"#{config.root}/app/models/rails_trade/concerns",
|
11
|
+
"#{config.root}/app/models/rails_trade/payment_interface",
|
12
|
+
"#{config.root}/app/models/rails_trade/payments",
|
13
|
+
"#{config.root}/app/models/rails_trade/payment_methods",
|
14
|
+
"#{config.root}/app/models/rails_trade/refunds",
|
15
|
+
"#{config.root}/app/models/rails_trade/promotes",
|
16
|
+
"#{config.root}/app/models/rails_trade/serves",
|
17
|
+
"#{config.root}/app/models/rails_trade/promote_charges",
|
18
|
+
"#{config.root}/app/models/rails_trade/serve_charges"
|
19
|
+
]
|
20
|
+
|
21
|
+
initializer 'rails_trade.assets.precompile' do |app|
|
22
|
+
app.config.assets.precompile += ['rails_trade_manifest.js']
|
23
|
+
end
|
24
|
+
|
25
|
+
ActiveSupport::Inflector.inflections(:en) do |inflect|
|
26
|
+
inflect.irregular 'serve', 'serves'
|
27
|
+
end
|
28
|
+
|
29
|
+
end
|
30
|
+
end
|