Br Validation

  • Tags : cpf, cnpj, cep
  • Latest : 0.1
  • Last Updated: 12 December 2009
  • Grails version : 1.1.1 > *
  • Authors : Oscar Konno Sampaio
3 votes
Dependency :
compile ":br-validation:0.1"

Documentation

Summary

Installation

grails install-plugin br-validation

Description

Description

This plugin implements constraints, to be used in domain classes, that make validation of brazilians documents and units.

Validations

Version 0.1
  • CPF - validate the format ###.###.###-## and the verifier digit
  • CNPJ - format (##.###.###/####-##) and digit
  • CEP - format (#####-###)

Usage

class Person {
     String name
     String cpf
     String address
     String postalCode

static constraints = { cpf(cpf:true) postalCode(cep:true) } }

class Organization { String name String cnpf

static constraints = { cnpj(cnpj:true) } }