effective_orders 1.2.11 → 1.2.12

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 43a710a5c4a31ef68141048fcc2dd99b1e241ed3
4
- data.tar.gz: 53da095a630facee479bc8a8080ba9e3749b1dc3
3
+ metadata.gz: 6171edb7decb2419e845db8af7b83851a284a8f8
4
+ data.tar.gz: 2d4a15554d343111758486fc031159b8e2c83ff0
5
5
  SHA512:
6
- metadata.gz: de093b596e5cff158e1a0403689599c9356b3102aba444753a65ad09a6e654ff572bb4b0724cc3c4a8902450979129dd29451441cd5a10e65445c59b9f7ee090
7
- data.tar.gz: f48ea9915bf999f2c85e628f40387c00b18e69ede559c9bf975231fa7d0dd8fd46d633dc16e4ebaf7bdbd8334675fc154a6af2ff5e70c053b881b80b9da567b4
6
+ metadata.gz: 877e43822891f56644670344377ed7fa76e45fcf3b9bccab2e4170bbf814b971929e30c3fba978cca691d77236530c388fd880220df520bbc4c075e4b4d0634c
7
+ data.tar.gz: 306ce59d6f08dd5d8cd5faf3d765709c1ddd094d7b54d40965ea734da4561e509e1248d333e0e3f06074faa29655d57a32e1998ce6949d6c0219466e47498c69
@@ -190,9 +190,8 @@ module Effective
190
190
  self.purchased_at ||= Time.zone.now
191
191
  self.payment = payment_details.kind_of?(Hash) ? payment_details : {:details => (payment_details || 'none').to_s}
192
192
 
193
- order_items.each { |item| item.purchasable.purchased!(self, item) }
194
-
195
193
  self.save!(:validate => opts[:validate])
194
+ order_items.each { |item| item.purchasable.purchased!(self, item) }
196
195
 
197
196
  if EffectiveOrders.mailer[:send_order_receipt_to_admin] && opts[:email]
198
197
  if Rails.env.production?
@@ -1,3 +1,3 @@
1
1
  module EffectiveOrders
2
- VERSION = '1.2.11'.freeze
2
+ VERSION = '1.2.12'.freeze
3
3
  end
@@ -28,7 +28,7 @@ EffectiveOrders.setup do |config|
28
28
  #
29
29
  # Or disable the check completely:
30
30
  # config.authorization_method = false
31
- config.authorization_method = Proc.new { |controller, action, resource| can?(action, resource) } # CanCan gem
31
+ config.authorization_method = Proc.new { |controller, action, resource| true }
32
32
 
33
33
  # Register Effective::Order with ActiveAdmin if ActiveAdmin is present
34
34
  config.use_active_admin = true
@@ -8,9 +8,10 @@ describe Effective::OrdersController do
8
8
  before { StripeMock.start }
9
9
  after { StripeMock.stop }
10
10
 
11
+ let(:stripe_helper) { StripeMock.create_test_helper }
11
12
  let(:order) { FactoryGirl.create(:order) }
12
13
  let(:buyer) { Effective::Customer.for_user(order.user) }
13
- let(:token) { 'tok_123456789' }
14
+ let(:token) { stripe_helper.generate_card_token }
14
15
  let(:stripe_charge_params) do
15
16
  {:effective_stripe_charge => {'effective_order_id' => order.to_param, 'token' => token}}
16
17
  end
@@ -92,7 +93,7 @@ describe Effective::OrdersController do
92
93
  let(:order) { FactoryGirl.create(:order_with_subscription) }
93
94
  let(:buyer) { Effective::Customer.for_user(order.user) }
94
95
  let(:subscription) { order.order_items[1].purchasable }
95
- let(:token) { 'tok_123456789' }
96
+ let(:token) { stripe_helper.generate_card_token }
96
97
  let(:stripe_charge_params) do
97
98
  {:effective_stripe_charge => {'effective_order_id' => order.to_param, 'token' => token}}
98
99
  end
@@ -117,7 +118,7 @@ describe Effective::OrdersController do
117
118
  post :stripe_charge, stripe_charge_params
118
119
 
119
120
  assigns(:order).payment[:subscriptions]["#{subscription.stripe_plan_id}"]['object'].should eq 'subscription'
120
- assigns(:order).payment[:subscriptions]["#{subscription.stripe_plan_id}"]['plan'].should eq subscription.stripe_plan_id
121
+ assigns(:order).payment[:subscriptions]["#{subscription.stripe_plan_id}"]['plan']['id'].should eq subscription.stripe_plan_id
121
122
  subscription.reload.stripe_subscription_id.present?.should eq true
122
123
  subscription.reload.stripe_coupon_id.present?.should eq true
123
124
 
@@ -1,22 +1,211 @@
1
1
  # EffectiveOrders Rails Engine
2
2
 
3
3
  EffectiveOrders.setup do |config|
4
+ # Configure Database Tables
5
+ config.orders_table_name = :orders
6
+ config.order_items_table_name = :order_items
7
+ config.carts_table_name = :carts
8
+ config.cart_items_table_name = :cart_items
9
+ config.customers_table_name = :customers
10
+ config.subscriptions_table_name = :subscriptions
11
+
4
12
  # Authorization Method
5
- config.authorization_method = Proc.new { |controller, action, resource| true } # Allow anyone do anything, Can stub this if testing
13
+ #
14
+ # This method is called by all controller actions with the appropriate action and resource
15
+ # If the method returns false, an Effective::AccessDenied Error will be raised (see README.md for complete info)
16
+ #
17
+ # Use via Proc (and with CanCan):
18
+ # config.authorization_method = Proc.new { |controller, action, resource| can?(action, resource) }
19
+ #
20
+ # Use via custom method:
21
+ # config.authorization_method = :my_authorization_method
22
+ #
23
+ # And then in your application_controller.rb:
24
+ #
25
+ # def my_authorization_method(action, resource)
26
+ # current_user.is?(:admin)
27
+ # end
28
+ #
29
+ # Or disable the check completely:
30
+ # config.authorization_method = false
31
+ config.authorization_method = Proc.new { |controller, action, resource| true }
32
+
33
+ # Register Effective::Order with ActiveAdmin if ActiveAdmin is present
34
+ config.use_active_admin = true
35
+
36
+ # Use effective_obfuscation gem to change order.id into a seemingly random 10-digit number
37
+ config.obfuscate_order_ids = true
6
38
 
39
+ # Silence the price deprecation warnings
40
+ config.silence_deprecation_warnings = false
41
+
42
+ # Require these addresses when creating a new Order. Works with effective_addresses gem
7
43
  config.require_billing_address = true
8
44
  config.require_shipping_address = true
9
45
 
10
- config.stripe_enabled = true
11
- config.stripe_subscriptions_enabled = true
12
-
46
+ # If set, the orders#new screen will render effective/orders/user_fields partial and capture this User Info
47
+ # The partial can be overridden to customize the form, but the following fields are also fed into strong_paramters
13
48
  config.collect_user_fields = [:first_name, :last_name]
49
+ #config.collect_user_fields = [:salutation, :first_name, :last_name] # Must be valid fields on the User object
14
50
 
51
+ # Don't validate_associated :user when saving an Order
52
+ config.skip_user_validation = false
53
+
54
+ # Tax Calculation Method
55
+ config.tax_rate_method = Proc.new { |acts_as_purchasable| 0.05 } # Regardless of the object, charge 5% tax (GST)
56
+
57
+ # Minimum Charge
58
+ # Prevent orders less than this value from being purchased
59
+ # Stripe doesn't allow orders less than $0.50
60
+ # Set to nil for no minimum charge
61
+ # Default value is 50 cents, or $0.50
15
62
  config.minimum_charge = 50
63
+
64
+ # Free Orders
65
+ # Allow orders with a total of 0.00 to be purchased (regardless of the minimum charge setting)
66
+ # When enabled, the checkout process will skip the paypal/stripe/purchasing step
67
+ # and just display the 'Thank You' after checkout is clicked
16
68
  config.allow_free_orders = true
17
69
 
70
+ # Allow Pretend Purchase in Production
71
+ # WARNING: Setting this option to true will allow users to purchase! an Order without entering a credit card
72
+ # WARNING: When true, users can purchase! anything without paying money
73
+ #
74
+ # This should basically always be false, but sometimes you want to make a Beta/Demo site
75
+ # where users may test the purchase workflow without actually paying money
76
+ #
77
+ # When true, there will be a 'Process Order' button on the Checkout screen.
78
+ # Clicking this button will mark an Order purchased and redirect the user to the
79
+ # Thank You page just as if they had successfully Checked Out through a payment processor
80
+ config.allow_pretend_purchase_in_production = false
81
+ config.allow_pretend_purchase_in_production_message = '* payment information is not required to process this order at this time.'
82
+
83
+ # Show/hide the 'Order History' button on the 'Cart Page'
84
+ config.show_order_history_button = true
85
+
86
+ # Layout Settings
87
+ # Configure the Layout per controller, or all at once
88
+
89
+ # config.layout = 'application' # All EffectiveOrders controllers will use this layout
90
+ config.layout = {
91
+ :carts => 'application',
92
+ :orders => 'application',
93
+ :subscriptions => 'application',
94
+ :admin_customers => 'application',
95
+ :admin_orders => 'application'
96
+ }
97
+
98
+ # SimpleForm Options
99
+ # This Hash of options will be passed into any simple_form_for() calls
100
+ config.simple_form_options = {}
101
+
102
+ # config.simple_form_options = {
103
+ # :html => {:class => 'form-horizontal'},
104
+ # :wrapper => :horizontal_form,
105
+ # :wrapper_mappings => {
106
+ # :boolean => :horizontal_boolean,
107
+ # :check_boxes => :horizontal_radio_and_checkboxes,
108
+ # :radio_buttons => :horizontal_radio_and_checkboxes
109
+ # }
110
+ # }
111
+
112
+ # Mailer Settings
113
+ # effective_orders will send out receipts to the buyer, seller and admins.
114
+ # For all the emails, the same :subject_prefix will be prefixed. Leave as nil / empty string if you don't want any prefix
115
+ #
116
+ # The subject_for_admin_receipt, subject_for_buyer_receipt and subject_for_seller_receipt can be one of:
117
+ # - nil / empty string to use the built in defaults
118
+ # - A string with the full subject line for this email
119
+ # - A Proc to create the subject line based on the email
120
+ # In all three of these cases, the subject_prefix will still be used.
121
+
122
+ # The Procs are the same for admin & buyer receipt, the seller Proc is different
123
+ # :subject_for_admin_receipt => Proc.new { |order| "Order #{order.to_param} has been purchased"}
124
+ # :subject_for_buyer_receipt => Proc.new { |order| "Order #{order.to_param} has been purchased"}
125
+ # :subject_for_seller_receipt => Proc.new { |order, order_items, seller| "Order #{order.to_param} has been purchased"}
126
+
127
+ config.mailer = {
128
+ :send_order_receipt_to_admin => true,
129
+ :send_order_receipt_to_buyer => true,
130
+ :send_order_receipt_to_seller => true, # Only applies to StripeConnect
131
+ :admin_email => 'admin@example.com',
132
+ :default_from => 'info@example.com',
133
+ :subject_prefix => '[example]',
134
+ :subject_for_admin_receipt => '',
135
+ :subject_for_buyer_receipt => '',
136
+ :subject_for_seller_receipt => ''
137
+ }
138
+
139
+ # Moneris configuration
18
140
  config.moneris_enabled = true
141
+
142
+ if Rails.env.production?
143
+ config.moneris = {
144
+ :ps_store_id => '',
145
+ :hpp_key => '',
146
+ :hpp_url => 'https://www3.moneris.com/HPPDP/index.php',
147
+ :verify_url => 'https://www3.moneris.com/HPPDP/verifyTxn.php'
148
+ }
149
+ else
150
+ config.moneris = {
151
+ :ps_store_id => '',
152
+ :hpp_key => '',
153
+ :hpp_url => 'https://esqa.moneris.com/HPPDP/index.php',
154
+ :verify_url => 'https://esqa.moneris.com/HPPDP/verifyTxn.php'
155
+ }
156
+ end
157
+
158
+ # Paypal configuration
19
159
  config.paypal_enabled = true
20
160
 
21
- config.silence_deprecation_warnings = true
161
+ if Rails.env.production?
162
+ config.paypal = {
163
+ :seller_email => '',
164
+ :secret => '',
165
+ :cert_id => '',
166
+ :paypal_url => 'https://www.paypal.com/cgi-bin/webscr',
167
+ :currency => 'CAD',
168
+ :paypal_cert => "#{Rails.root}/config/paypalcerts/production/paypal_cert.pem",
169
+ :app_cert => "#{Rails.root}/config/paypalcerts/production/app_cert.pem",
170
+ :app_key => "#{Rails.root}/config/paypalcerts/production/app_key.pem"
171
+ }
172
+ else
173
+ config.paypal = {
174
+ :seller_email => '',
175
+ :secret => '',
176
+ :cert_id => '',
177
+ :paypal_url => 'https://www.sandbox.paypal.com/cgi-bin/webscr',
178
+ :currency => 'CAD',
179
+ :paypal_cert => "#{Rails.root}/config/paypalcerts/#{Rails.env}/paypal_cert.pem",
180
+ :app_cert => "#{Rails.root}/config/paypalcerts/#{Rails.env}/app_cert.pem",
181
+ :app_key => "#{Rails.root}/config/paypalcerts/#{Rails.env}/app_key.pem"
182
+ }
183
+ end
184
+
185
+ # Stripe configuration
186
+ config.stripe_enabled = true
187
+ config.stripe_subscriptions_enabled = true # https://stripe.com/docs/subscriptions
188
+ config.stripe_connect_enabled = false # https://stripe.com/docs/connect
189
+ config.stripe_connect_application_fee_method = Proc.new { |order_item| order_item.total * 0.10 } # 10 percent
190
+
191
+ if Rails.env.production?
192
+ config.stripe = {
193
+ :secret_key => '',
194
+ :publishable_key => '',
195
+ :currency => 'usd',
196
+ :site_title => 'My Site',
197
+ :site_image => '', # A relative URL pointing to a square image of your brand or product. The recommended minimum size is 128x128px.
198
+ :connect_client_id => ''
199
+ }
200
+ else
201
+ config.stripe = {
202
+ :secret_key => '',
203
+ :publishable_key => '',
204
+ :currency => 'usd',
205
+ :site_title => 'My Development Site', # Displayed on the Embedded Stripe Form
206
+ :site_image => '', # A relative URL pointing to a square image of your brand or product. The recommended minimum size is 128x128px.
207
+ :connect_client_id => ''
208
+ }
209
+ end
210
+
22
211
  end
@@ -1,354 +1,124 @@
1
- BLAHBLAH
2
- BLAHBLAH
3
-  (1.1ms) CREATE TABLE "addresses" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "addressable_type" varchar(255), "addressable_id" integer, "category" varchar(64), "full_name" varchar(255), "address1" varchar(255), "address2" varchar(255), "city" varchar(255), "state_code" varchar(255), "country_code" varchar(255), "postal_code" varchar(255), "updated_at" datetime, "created_at" datetime) 
4
-  (0.1ms) select sqlite_version(*)
5
-  (0.7ms) CREATE INDEX "index_addresses_on_addressable_id" ON "addresses" ("addressable_id")
6
-  (0.1ms) SELECT sql
7
- FROM sqlite_master
8
- WHERE name='index_addresses_on_addressable_id' AND type='index'
9
- UNION ALL
10
- SELECT sql
11
- FROM sqlite_temp_master
12
- WHERE name='index_addresses_on_addressable_id' AND type='index'
13
-
14
-  (0.8ms) CREATE INDEX "index_addresses_on_addressable_type_and_addressable_id" ON "addresses" ("addressable_type", "addressable_id")
15
-  (0.8ms) CREATE TABLE "cart_items" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "cart_id" integer, "purchasable_type" varchar(255), "purchasable_id" integer, "quantity" integer, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
16
-  (0.9ms) CREATE INDEX "index_cart_items_on_cart_id" ON "cart_items" ("cart_id")
17
-  (0.1ms) SELECT sql
18
- FROM sqlite_master
19
- WHERE name='index_cart_items_on_cart_id' AND type='index'
20
- UNION ALL
21
- SELECT sql
22
- FROM sqlite_temp_master
23
- WHERE name='index_cart_items_on_cart_id' AND type='index'
24
-
25
-  (0.7ms) CREATE INDEX "index_cart_items_on_purchasable_id" ON "cart_items" ("purchasable_id")
26
-  (0.1ms) SELECT sql
27
- FROM sqlite_master
28
- WHERE name='index_cart_items_on_purchasable_id' AND type='index'
29
- UNION ALL
30
- SELECT sql
31
- FROM sqlite_temp_master
32
- WHERE name='index_cart_items_on_purchasable_id' AND type='index'
33
-
34
-  (0.1ms)  SELECT sql
35
- FROM sqlite_master
36
- WHERE name='index_cart_items_on_cart_id' AND type='index'
37
- UNION ALL
38
- SELECT sql
39
- FROM sqlite_temp_master
40
- WHERE name='index_cart_items_on_cart_id' AND type='index'
41
- 
42
-  (0.9ms) CREATE INDEX "index_cart_items_on_purchasable_type_and_purchasable_id" ON "cart_items" ("purchasable_type", "purchasable_id")
43
-  (0.7ms) CREATE TABLE "carts" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_id" integer, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) 
44
-  (0.8ms) CREATE INDEX "index_carts_on_user_id" ON "carts" ("user_id")
45
-  (0.7ms) CREATE TABLE "customers" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_id" integer, "stripe_customer_id" varchar(255), "stripe_active_card" varchar(255), "stripe_connect_access_token" varchar(255), "created_at" datetime, "updated_at" datetime) 
46
-  (0.9ms) CREATE TABLE "order_items" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "order_id" integer, "seller_id" integer, "purchasable_type" varchar(255), "purchasable_id" integer, "title" varchar(255), "quantity" integer, "price" decimal(8,2) DEFAULT 0.0, "tax_exempt" boolean, "tax_rate" decimal(5,3) DEFAULT 0.0, "quickbooks_item_name" varchar(255), "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
47
-  (0.9ms) CREATE INDEX "index_order_items_on_order_id" ON "order_items" ("order_id")
48
-  (0.1ms) SELECT sql
49
- FROM sqlite_master
50
- WHERE name='index_order_items_on_order_id' AND type='index'
51
- UNION ALL
52
- SELECT sql
53
- FROM sqlite_temp_master
54
- WHERE name='index_order_items_on_order_id' AND type='index'
55
-
56
-  (0.9ms) CREATE INDEX "index_order_items_on_purchasable_id" ON "order_items" ("purchasable_id")
57
-  (0.2ms) SELECT sql
58
- FROM sqlite_master
59
- WHERE name='index_order_items_on_purchasable_id' AND type='index'
60
- UNION ALL
61
- SELECT sql
62
- FROM sqlite_temp_master
63
- WHERE name='index_order_items_on_purchasable_id' AND type='index'
64
-
65
-  (0.1ms)  SELECT sql
66
- FROM sqlite_master
67
- WHERE name='index_order_items_on_order_id' AND type='index'
68
- UNION ALL
69
- SELECT sql
70
- FROM sqlite_temp_master
71
- WHERE name='index_order_items_on_order_id' AND type='index'
72
- 
73
-  (0.7ms) CREATE INDEX "index_order_items_on_purchasable_type_and_purchasable_id" ON "order_items" ("purchasable_type", "purchasable_id")
74
-  (0.9ms) CREATE TABLE "orders" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_id" integer, "purchase_state" varchar(255), "purchased_at" datetime, "payment" text, "details" text, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) 
75
-  (1.0ms) CREATE INDEX "index_orders_on_user_id" ON "orders" ("user_id")
76
-  (0.7ms) CREATE TABLE "products" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "title" varchar(255), "price" decimal(8,2) DEFAULT 0.0, "tax_exempt" boolean, "quickbooks_item_name" varchar(255), "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) 
77
-  (0.9ms) CREATE TABLE "subscriptions" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "customer_id" integer, "stripe_plan_id" varchar(255), "stripe_subscription_id" varchar(255), "stripe_coupon_id" varchar(255), "title" varchar(255), "price" decimal(8,2) DEFAULT 0.0, "created_at" datetime, "updated_at" datetime)
78
-  (0.9ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "encrypted_password" varchar(255), "reset_password_token" varchar(255), "reset_password_sent_at" datetime, "remember_created_at" datetime, "confirmation_sent_at" datetime, "confirmed_at" datetime, "confirmation_token" varchar(255), "unconfirmed_email" varchar(255), "sign_in_count" integer DEFAULT 0, "current_sign_in_at" datetime, "last_sign_in_at" datetime, "current_sign_in_ip" varchar(255), "last_sign_in_ip" varchar(255), "email" varchar(255), "roles_mask" integer DEFAULT 0, "archived" boolean DEFAULT 'f', "updated_at" datetime, "created_at" datetime) 
79
-  (1.1ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
80
-  (0.8ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
81
-  (0.1ms) SELECT version FROM "schema_migrations"
82
-  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('4')
1
+  (0.5ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
83
2
   (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
84
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
85
-  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
86
3
   (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
87
4
   (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
88
5
   (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
89
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
90
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
91
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
92
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
93
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
94
-  (0.3ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
95
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
96
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
97
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
98
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
99
-  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
100
6
   (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
7
+  (0.3ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
101
8
   (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
102
9
   (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
103
10
   (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
104
11
   (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
105
12
   (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
106
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
107
13
   (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
108
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
109
14
   (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
110
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
111
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
112
15
   (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
113
16
   (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
114
17
   (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
115
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
116
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
117
-  (0.3ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
118
-  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
119
-  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
120
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
121
18
   (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
19
+  (0.3ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
122
20
   (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
123
21
   (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
124
22
   (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
125
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
126
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
127
-  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
128
23
   (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
129
24
   (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
130
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
131
-  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
132
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
133
25
   (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
134
26
   (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
135
27
   (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
136
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
137
28
   (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
138
29
   (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
139
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
140
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
141
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
142
30
   (0.3ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
143
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
144
31
   (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
145
32
   (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
146
33
   (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
147
34
   (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
148
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
149
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
150
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
151
35
   (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
152
36
   (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
153
37
   (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
154
-  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
155
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
156
38
   (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
157
39
   (0.3ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
158
40
   (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
159
-  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
160
-  (0.3ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
161
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
162
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
163
-  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
164
-  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
165
-  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
166
-  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
167
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
168
-  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
169
-  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
170
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
171
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
172
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
173
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
174
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
175
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
176
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
177
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
178
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
179
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
180
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
181
41
   (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
182
42
   (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
183
43
   (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
184
44
   (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
185
45
   (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
186
46
   (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
187
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
188
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
189
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
190
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
191
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
192
47
   (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
193
48
   (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
194
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
195
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
196
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
197
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
198
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
199
49
   (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
200
50
   (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
201
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
202
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
203
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
204
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
205
-  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
206
51
   (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
207
52
   (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
208
53
   (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
209
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
54
+  (0.3ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
210
55
   (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
211
56
   (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
212
57
   (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
213
58
   (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
214
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
215
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
216
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
217
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
59
+  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
218
60
   (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
219
61
   (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
220
62
   (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
221
63
   (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
222
64
   (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
223
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
224
-  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
225
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
226
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
227
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
228
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
229
65
   (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
230
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
231
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
232
66
   (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
233
67
   (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
234
68
   (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
235
69
   (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
236
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
237
-  (0.3ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
238
-  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
239
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
70
+  (0.5ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
240
71
   (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
241
72
   (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
242
73
   (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
243
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
244
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
245
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
246
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
247
74
   (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
248
75
   (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
249
76
   (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
250
77
   (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
251
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
252
78
   (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
253
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
254
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
255
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
256
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
257
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
258
79
   (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
259
80
   (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
260
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
261
81
   (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
262
82
   (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
263
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
264
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
265
83
   (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
266
84
   (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
267
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
268
85
   (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
269
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
270
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
271
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
272
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
273
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
274
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
275
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
276
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
277
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
278
86
   (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
279
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
280
87
   (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
281
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
282
88
   (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
283
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
284
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
285
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
286
-  (0.4ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
287
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
288
89
   (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
289
90
   (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
290
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
91
+  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
291
92
   (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
292
93
   (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
293
94
   (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
294
95
   (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
295
96
   (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
296
97
   (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
297
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
298
98
   (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
299
-  (0.3ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
300
99
   (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
301
-  (0.3ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
302
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
303
100
   (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
304
101
   (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
305
102
   (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
306
-  (0.3ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
307
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
308
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
309
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
310
103
   (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
311
104
   (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
312
105
   (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
313
106
   (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
314
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
315
107
   (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
316
108
   (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
317
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
318
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
109
+  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
319
110
   (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
320
111
   (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
321
112
   (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
322
113
   (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
323
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
324
114
   (0.3ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
325
-  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
326
-  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
327
115
   (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
328
116
   (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
329
117
   (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
330
118
   (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
331
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
332
-  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
333
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
334
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
335
-  (0.6ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
336
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
337
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
338
119
   (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
339
120
   (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
340
121
   (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
341
122
   (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
342
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
343
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
344
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
345
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
346
123
   (0.3ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
347
124
   (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
348
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
349
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
350
-  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
351
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
352
-  (0.2ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
353
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"
354
-  (0.1ms) SELECT MAX("orders"."id") AS max_id FROM "orders"