gminaker / databases

0 stars 0 forks source link

Cannot Purchase items #23

Closed thpierce closed 9 years ago

thpierce commented 9 years ago

After adding to cart, can't purchase Also should check vals, credentials, or whatever Display receipt and credit card authentication stuff

gminaker commented 9 years ago

Ok, we are at the point now where the expected date is null; @mikegfink can you look at this? I don't understand your code.

mikegfink commented 9 years ago

It's still giving errors, but it's moved off of the expected date stuff.. I don't know what's happening in the rest. I get Undefined index cart: in ..... as my error along with cannot update a child row because foreight key constraint fails. @gminaker

gminaker commented 9 years ago

can you push your code, and I'll pickup?

mikegfink commented 9 years ago

I pushed as soon as i changed it. hopefully you picked it up.

thpierce commented 9 years ago

Just tested, still not working:

Error: Cannot add or update a child row: a foreign key constraint fails (test.purchase, CONSTRAINT purchase_ibfk_1 FOREIGN KEY (p_cid) REFERENCES customer (cid)) at line number 145 Error: This transaction was rolled back

Input: untitled

thpierce commented 9 years ago

Also, why is title all weird? And company.

mikegfink commented 9 years ago

Other than the title column not being wide enough, it works for me.... check the database settings?

mikegfink commented 9 years ago

That's an issue with your user database I think. Try adding yourself as a user and try again. ie logout login and/or register

mikegfink commented 9 years ago

This should be working. It works on my computer.

Someone please close when you believe it works on yours.

thpierce commented 9 years ago

Works but 2 issues:

Not updating stock (another ticket) Not setting expected date correctly

mikegfink commented 9 years ago

In what way is it not setting the expected correctly?

thpierce commented 9 years ago

Hang on, might have been a problem on my end

thpierce commented 9 years ago

Nope. I might be misunderstanding your code, but I don' think it's doing what it's supposed to. We should just count all deliveries that have not been delivered, divide that by 5, round and add that number to today's date to get the right output. In your version, its keeping something stored, and so if I do a bunch of deliveries, and then make a new purchase (with no outstanding purchases) it still expects a delivery date in the future (not today/tomorrow). I'm going to change it.

thpierce commented 9 years ago

Done

mikegfink commented 9 years ago

That’s fine with me. As an explanation: mine was an appropriate interpretation, and other groups used it as well. As an expected delivery date it was just taking the latest expected delivery and assuming we can’t deliver before then. Because if every delivery was done according to the same system, by induction we couldn’t expect to deliver anything earlier than the latest expected date.

From: thpierce [mailto:notifications@github.com] Sent: November-26-14 6:37 PM To: gminaker/databases Cc: Mike Fink Subject: Re: [databases] Cannot Purchase items (#23)

Nope. I might be misunderstanding your code, but I don' think it's doing what it's supposed to. We should just count all deliveries that have not been delivered, divide that by 5, round and add that number to today's date to get the right output. In your version, its keeping something stored, and so if I do a bunch of deliveries, and then make a new purchase (with no outstanding purchases) it still expects a delivery date in the future (not today/tomorrow). I'm going to change it.

— Reply to this email directly or view it on GitHub https://github.com/gminaker/databases/issues/23#issuecomment-64739081 .Image removed by sender.