I am working in a project that contains a table name service_type(id,service_name,default_days are the columns of this table) and another table has consignment which contains a lot of columns. But the relation between service_type table to consignment table is one to many. So, consignment table holds the reference of the service_id.So to create a consignment I need to select a service which gives me an Id and I send this Id to the request object of the consignment. But in the consignment for the different service the ui should render differently. For example, I have Economy, Super Economy or Point To Point Services. So, for point to point service in the consignment a page hidden field should be visible and for other it should not. But if I write the logic like below then it will become hardcode. And if any one from the admin changes the service_type in future from point to point to some other name then this piece of code won't work. Then how should I configure the project data so that I can avoid this kind of hardcoding scenerio.
{serviceType.toLowerCase()==='point to point' ? 'The field should be visible': 'Should Not Be visible'}
strong text