Br Validation Plugin

  • Tags : cpf, cnpj, cep
  • Latest : 0.3
  • Last Updated: 26 July 2013
  • Grails version : 1.1.1 > *
4 votes
Dependency :
compile ":br-validation:0.3"

Documentation Source Issues

Summary

Implements gorm validation to same documents (CPF and CNPJ) and codes formats (CEP) used in Brazil

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) } }

class Person { String name String cpfCnpj

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