Forum OpenACS Q&A: Response to Auctions on OpenACS4 ?

Collapse
Posted by Kjell Wooding on
I've replied to some interested parties via email, but
I thought I'd echo those responses here in case others are interested.

I can't post any code from our last effort, as I no longer work
at the company that owns it. I can, however, share some general design tips:

The trick I found was to rely almost exclusively on triggers to do the dirty work. In other words, place an "autobid" trigger on INSERT on the auction_bid table which handled the tricky bits of increasing the current winning bid based on existing criteria

It's actually not all that tricky, when you think of the problem that way. Whenever a bid is inserted, there are only ever two competing bids. the old winning bid, and the new one. When the bid is inserted, figure out the lesser of: the lesser of the maximum bids, plus the auction bid increment, or the greater of the maximum bids (if the winning max bid is less than one bid increment greater than the other players' maximum bid)

Hope that helps...