Model design help!

Kindly remove this post if this isn't in the right sub (: (Is this the right sub for questions like this?)

I have a situation where a "guest " (as G) and a "user" (as U) can book flights. The model U contains field fora profile with personal details and payment details. Guest, however doesn't have this model. Instead, in the `booking` model has guest's personal fields and payment fields in it, as well as the computed display fields which are computed as follows:
If account_type == guest, copy guest's input in `booking` model to the display fields (also in `booking`)
If account_type == user, copy user's profile details in `user` model the display fields (in `booking`).

Is this the right way to do it? If not then how?

submitted by /u/CocoTennisBall
[link] [comments]

from Software Development – methodologies, techniques, and tools. Covering Agile, RUP, Waterfall + more! https://ift.tt/3fiGysR

Leave a comment

Design a site like this with WordPress.com
Get started
search previous next tag category expand menu location phone mail time cart zoom edit close