Too Long; Didn't Read
Golang: Declarative Validation Made Similar to Ruby on Rails in a similar way to Active Record validations. The 'People' table has a One To Many relationship with 'Addresses' table. For private individuals, 'cpf' is required; for legal entities, 'cnpj' must be a valid one. For addresses, 'treet', 'city' and 'phone' are required fields; 'name' must have at least one address. For people, 'cnnj' should be not possible to have both CPf and cnnj fulfilled.
Share Your Thoughts