Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

syntaxerron's avatar

Travel and Expense Management Database Schema

I am currently developing a system that tracks employees' travel expenses, the company wants to include place of origin and destination under transportation category. Where do you think I should add these fields? Should I add these under expenses table and only visible when the user selects transportation category? This is the Database Schema

They follow this kind of format on their manual process: Expense Report Format

Sample Data for Category: Transportation, Meals & Lodging, Delivery Expense

Sample Data for Subcategory: Bus (Transportation category), Airplane (Transportation category), Breakfast (Meals & Lodging category), Lunch (Meals & Lodging category)

0 likes
2 replies
bobbybouwmann's avatar
Level 88

I would probably add the fields in the first place to the same table and make them nullable. Only if you start the additional fields for multiple declaration types you should consider refactoring it.

If you decide to do it right away, I would probably create a polymorphic relationship to create the different kinds of expenses that you can store.

In most cases, start with the simplest approach ;) Keeping it simple will benefit you in most cases in the long run.

1 like

Please or to participate in this conversation.