How to extrude a profile to the edges of an ExtrudeGeometry

I am trying to create an extruded geometry and then add a profile to some of its edges.

So far the only way I can come up with is to create the initial extruded geometry which is white in the images and then extrude a separate profile around the outside which is the beige section of the images.

This works ok when the material is a solid colour but when I map a texture things look a little weird.

Can anyone point to a way in which I could create the part as one?

Thank You!