Definition of consumer

A Company "X" booked a flat with say Builder Y Pvt Ltd. After some time I paid company "X" who was investor and got the flat endorsed in my name. Thereafter all the documentation was done by name. I made payment to builder as per Construction linked plan. After around 2-3 years the flat got registered in my name. Now that flat has been registered there is dispute on some extra payment (increased area which is not registered) charged by the builder to me illegally , regarding which I have filed a case on consumer forum. The case is going on from last 3-4 years and now builder says I am not a consumer since I bought the flat in re-sale from a company X, and definition of consumer neither applies of company X which booked the flat initially nor on me who later bought it from him and got endorsed in my name. My Question: Please suggest as per law am I the consumer in the above scenario. It may be noted that company X was an investor and it paid only the booking amount to builder. Thererafter all payments to builder has been made by me and all documentation such as allotment , posession, registry ie between me and builder.