olimart/koopon_now — Issue #18: Deal validation
Author: olimart
Created: 2012-02-05 00:20:34+00:00
State: open

Pls add the following validations. By the way we're now using twitter bootstrap which comes with lots of controls built-in so you might want to check what you can reuse. http://twitter.github.com/bootstrap/

* Deal model
* validate has at least one location selected
* Fix deal frequency method
* validate discount against Setting.min_discount & Setting.min_price
* validate koopon_revenues against Setting.min_koopon_share (percentage by the way)
* No edit possible for merchant when active but admins can (maybe easier to remove edit link)
* validate discount is less than retail_price

* Deal#form
* Add JS next to merchant revenues when user types in merchant_revenues it should show "Koopon share: $$" where of course $$ = discount - merchant_revenues (must update on change). Maybe show warning if Koopon share does not validate against Setting.min_koopon_share (we can discuss that part as I don't know what's the time involved)
* Show warning if Discount does not validate against Setting.min_discount (we can discuss that part as I don't know what's the time involved)
* We need JS magic for schedule:
* If repetition it's all good
* If no repetition we need to remove repeat_until and show end_date (just need end_date field no need for 'I stop it').