Add couchbase with modifications, formalize broadcaster and make testable and some other stuff

This commit is contained in:
2014-03-06 18:08:39 +01:00
parent 3f117c76b0
commit 0e7a39b819
28 changed files with 456 additions and 35 deletions
+29
View File
@@ -137,6 +137,35 @@ class Supplier
def week_starts_on_monday?
true
end
def increment_orders_in_process_count!
Qwaiter::Counter.incr "supplier:#{id}:orders_in_process"
end
def increment_orders_delivered_count!
Qwaiter::Counter.incr "supplier:#{id}:orders_delivered"
end
def decrement_orders_in_process_count!
Qwaiter::Counter.decr "supplier:#{id}:orders_in_process"
end
def decrement_orders_delivered_count!
Qwaiter::Counter.decr "supplier:#{id}:orders_delivered"
end
def orders_in_process_count
Qwaiter::Counter.get "supplier:#{id}:orders_in_process"
end
def orders_delivered_count
Qwaiter::Counter.get "supplier:#{id}:orders_delivered"
end
def active_order_count
orders_in_process_count + orders_delivered_count
end
private
def add_section_on_create