indiehd / velkart

An extensible shopping cart, order management, and payment processing system built upon clean-coding principles and designed for Laravel.
GNU Affero General Public License v3.0
1 stars 4 forks source link

Consider removing foreign key from Order to Cart #44

Open cbj4074 opened 3 years ago

cbj4074 commented 3 years ago

If "garbage collection" is to be applied to Carts, a foreign key from the Order would prevent Cart deletion.

The more I think about this, the more I can't see any value in this relationship. If the intention is, in effect, to "copy" the items from a Cart instance into the OrderProduct pivot table during checkout (i.e., at the instant at which payment is processed successfully), then the Cart has no further value, and hence, this relationship is unnecessary.