fix the n3 build, add template framework
add record enum and flags
fix all flag and enum