cpf-and-cnpj

  • ๋ธŒ๋ผ์งˆ์—์„œ ๋ฐœ๊ธ‰๋˜๋Š” ์„ธ๊ธˆ ๊ด€๋ จ ์‹๋ณ„์ž

  • CPF๋Š” ๊ฐœ์ธ, CNPJ๋Š” ํšŒ์‚ฌ์—๊ฒŒ ๋ฐœ๊ธ‰๋จ.

  • ๋‘ ์ข…๋ฅ˜๋Š” ํฌ๋ฉง์ด ๋‹ค๋ฅด๊ธฐ ๋•Œ๋ฌธ์— ์œ ์˜ํ•  ํ•„์š”๊ฐ€ ์žˆ์„ ๋“ฏ.

  • ์™œ ํ•„์š”ํ•œ๊ฐ€?

    • A CPF is essential to be able to do almost anything in Brazil

    • ๊ฑฐ์˜ ๋ชจ๋“  ๊ณต์ , ์‚ฌ์  ์—…๋ฌด๋ฅผ ํ•  ๋•Œ ํ•„์š”ํ•œ ์‹๋ณ„์ž ์ธ๋“ฏ.

In Hibernate

  • ์ด์— ํ•ด๋‹นํ•˜๋Š” Validator ๋กœ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋Š” annotation ์ด ์ด๋ฏธ ์กด์žฌํ•œ๋‹ค!

  • ๋˜ํ•œ Hibernate ์—์„œ CPFValidator, CNPJValidator ๊ฐ€ ๊ตฌํ˜„๋˜์–ด์žˆ๋Š” ๊ฑธ๋กœ ๋ณด์•„, ์œ„ ์–ด๋…ธํ…Œ์ด์…˜์— ์กด์žฌํ•˜๋Š” Pattern์„ ํ†ตํ•œ ๊ฒ€์ฆ์„ ์ œ์™ธํ•œ ์ถ”๊ฐ€์ ์ธ validation์ด ์žˆ๋Š” ๊ฑธ๋กœ ์—ฌ๊ฒจ์ง„๋‹ค.

    • https://docs.jboss.org/hibernate/stable/validator/api/org/hibernate/validator/internal/constraintvalidators/hv/br/CPFValidator.html

์ฐธ๊ณ 

  • https://wise.com/gb/blog/cpf-cnpj-meaning-brazil

  • https://docs.swissuplabs.com/m2/extensions/firecheckout/brazil/cpf-cnpj/

  • https://www.4devs.com.br/gerador_de_cpf

Last updated