I'm currently developing an Ecommerce application and am trying to figure out how best to add a 'guest checkout' feature. The 3 main models that I am wrestling with to add this feature are Address, User, and Order. An Address needs a User, and an Order needs both an Address and a User.
For our guest checkout we don't want to force someone to create an account but with the current schema, that won't work.
The only two options I can think of right now are:
- Create a guest account in the Users table and every guest checkout will create a new Order and Address tied to that.
- Make the Address and Order FK constraint on the User be optional.
Has anyone had experience with this or can think of a better option?