@hed-hog/contact 0.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/contact.module.d.ts +3 -0
- package/dist/contact.module.d.ts.map +1 -0
- package/dist/contact.module.js +61 -0
- package/dist/contact.module.js.map +1 -0
- package/dist/contact.service.d.ts +28 -0
- package/dist/contact.service.d.ts.map +1 -0
- package/dist/contact.service.js +212 -0
- package/dist/contact.service.js.map +1 -0
- package/dist/emails/index.d.ts +3 -0
- package/dist/emails/index.d.ts.map +1 -0
- package/dist/emails/index.js +19 -0
- package/dist/emails/index.js.map +1 -0
- package/dist/emails/lib.d.ts +3 -0
- package/dist/emails/lib.d.ts.map +1 -0
- package/dist/emails/lib.js +18 -0
- package/dist/emails/lib.js.map +1 -0
- package/dist/emails/templates.d.ts +13 -0
- package/dist/emails/templates.d.ts.map +1 -0
- package/dist/emails/templates.js +37 -0
- package/dist/emails/templates.js.map +1 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +27 -0
- package/dist/index.js.map +1 -0
- package/dist/person/dto/create.dto.d.ts +7 -0
- package/dist/person/dto/create.dto.d.ts.map +1 -0
- package/dist/person/dto/create.dto.js +35 -0
- package/dist/person/dto/create.dto.js.map +1 -0
- package/dist/person/dto/update.dto.d.ts +6 -0
- package/dist/person/dto/update.dto.d.ts.map +1 -0
- package/dist/person/dto/update.dto.js +9 -0
- package/dist/person/dto/update.dto.js.map +1 -0
- package/dist/person/person-address/dto/create.dto.d.ts +14 -0
- package/dist/person/person-address/dto/create.dto.d.ts.map +1 -0
- package/dist/person/person-address/dto/create.dto.js +65 -0
- package/dist/person/person-address/dto/create.dto.js.map +1 -0
- package/dist/person/person-address/dto/update.dto.d.ts +6 -0
- package/dist/person/person-address/dto/update.dto.d.ts.map +1 -0
- package/dist/person/person-address/dto/update.dto.js +9 -0
- package/dist/person/person-address/dto/update.dto.js.map +1 -0
- package/dist/person/person-address/person-address.controller.d.ts +14 -0
- package/dist/person/person-address/person-address.controller.d.ts.map +1 -0
- package/dist/person/person-address/person-address.controller.js +92 -0
- package/dist/person/person-address/person-address.controller.js.map +1 -0
- package/dist/person/person-address/person-address.service.d.ts +16 -0
- package/dist/person/person-address/person-address.service.d.ts.map +1 -0
- package/dist/person/person-address/person-address.service.js +71 -0
- package/dist/person/person-address/person-address.service.js.map +1 -0
- package/dist/person/person-contact/dto/create.dto.d.ts +6 -0
- package/dist/person/person-contact/dto/create.dto.d.ts.map +1 -0
- package/dist/person/person-contact/dto/create.dto.js +30 -0
- package/dist/person/person-contact/dto/create.dto.js.map +1 -0
- package/dist/person/person-contact/dto/update.dto.d.ts +6 -0
- package/dist/person/person-contact/dto/update.dto.d.ts.map +1 -0
- package/dist/person/person-contact/dto/update.dto.js +9 -0
- package/dist/person/person-contact/dto/update.dto.js.map +1 -0
- package/dist/person/person-contact/person-contact.controller.d.ts +14 -0
- package/dist/person/person-contact/person-contact.controller.d.ts.map +1 -0
- package/dist/person/person-contact/person-contact.controller.js +92 -0
- package/dist/person/person-contact/person-contact.controller.js.map +1 -0
- package/dist/person/person-contact/person-contact.service.d.ts +16 -0
- package/dist/person/person-contact/person-contact.service.d.ts.map +1 -0
- package/dist/person/person-contact/person-contact.service.js +71 -0
- package/dist/person/person-contact/person-contact.service.js.map +1 -0
- package/dist/person/person-custom/dto/create.dto.d.ts +6 -0
- package/dist/person/person-custom/dto/create.dto.d.ts.map +1 -0
- package/dist/person/person-custom/dto/create.dto.js +27 -0
- package/dist/person/person-custom/dto/create.dto.js.map +1 -0
- package/dist/person/person-custom/dto/update.dto.d.ts +6 -0
- package/dist/person/person-custom/dto/update.dto.d.ts.map +1 -0
- package/dist/person/person-custom/dto/update.dto.js +9 -0
- package/dist/person/person-custom/dto/update.dto.js.map +1 -0
- package/dist/person/person-custom/person-custom.controller.d.ts +13 -0
- package/dist/person/person-custom/person-custom.controller.d.ts.map +1 -0
- package/dist/person/person-custom/person-custom.controller.js +83 -0
- package/dist/person/person-custom/person-custom.controller.js.map +1 -0
- package/dist/person/person-custom/person-custom.service.d.ts +20 -0
- package/dist/person/person-custom/person-custom.service.d.ts.map +1 -0
- package/dist/person/person-custom/person-custom.service.js +71 -0
- package/dist/person/person-custom/person-custom.service.js.map +1 -0
- package/dist/person/person-document/dto/create.dto.d.ts +9 -0
- package/dist/person/person-document/dto/create.dto.d.ts.map +1 -0
- package/dist/person/person-document/dto/create.dto.js +44 -0
- package/dist/person/person-document/dto/create.dto.js.map +1 -0
- package/dist/person/person-document/dto/update.dto.d.ts +6 -0
- package/dist/person/person-document/dto/update.dto.d.ts.map +1 -0
- package/dist/person/person-document/dto/update.dto.js +9 -0
- package/dist/person/person-document/dto/update.dto.js.map +1 -0
- package/dist/person/person-document/person-document.controller.d.ts +14 -0
- package/dist/person/person-document/person-document.controller.d.ts.map +1 -0
- package/dist/person/person-document/person-document.controller.js +92 -0
- package/dist/person/person-document/person-document.controller.js.map +1 -0
- package/dist/person/person-document/person-document.service.d.ts +16 -0
- package/dist/person/person-document/person-document.service.d.ts.map +1 -0
- package/dist/person/person-document/person-document.service.js +71 -0
- package/dist/person/person-document/person-document.service.js.map +1 -0
- package/dist/person/person-user/dto/create.dto.d.ts +4 -0
- package/dist/person/person-user/dto/create.dto.d.ts.map +1 -0
- package/dist/person/person-user/dto/create.dto.js +21 -0
- package/dist/person/person-user/dto/create.dto.js.map +1 -0
- package/dist/person/person-user/dto/update.dto.d.ts +6 -0
- package/dist/person/person-user/dto/update.dto.d.ts.map +1 -0
- package/dist/person/person-user/dto/update.dto.js +9 -0
- package/dist/person/person-user/dto/update.dto.js.map +1 -0
- package/dist/person/person-user/person-user.controller.d.ts +14 -0
- package/dist/person/person-user/person-user.controller.d.ts.map +1 -0
- package/dist/person/person-user/person-user.controller.js +92 -0
- package/dist/person/person-user/person-user.controller.js.map +1 -0
- package/dist/person/person-user/person-user.service.d.ts +16 -0
- package/dist/person/person-user/person-user.service.d.ts.map +1 -0
- package/dist/person/person-user/person-user.service.js +71 -0
- package/dist/person/person-user/person-user.service.js.map +1 -0
- package/dist/person/person-value/dto/create.dto.d.ts +4 -0
- package/dist/person/person-value/dto/create.dto.d.ts.map +1 -0
- package/dist/person/person-value/dto/create.dto.js +21 -0
- package/dist/person/person-value/dto/create.dto.js.map +1 -0
- package/dist/person/person-value/dto/update.dto.d.ts +6 -0
- package/dist/person/person-value/dto/update.dto.d.ts.map +1 -0
- package/dist/person/person-value/dto/update.dto.js +9 -0
- package/dist/person/person-value/dto/update.dto.js.map +1 -0
- package/dist/person/person-value/person-value.controller.d.ts +14 -0
- package/dist/person/person-value/person-value.controller.d.ts.map +1 -0
- package/dist/person/person-value/person-value.controller.js +92 -0
- package/dist/person/person-value/person-value.controller.js.map +1 -0
- package/dist/person/person-value/person-value.service.d.ts +16 -0
- package/dist/person/person-value/person-value.service.d.ts.map +1 -0
- package/dist/person/person-value/person-value.service.js +71 -0
- package/dist/person/person-value/person-value.service.js.map +1 -0
- package/dist/person/person.controller.d.ts +14 -0
- package/dist/person/person.controller.d.ts.map +1 -0
- package/dist/person/person.controller.js +89 -0
- package/dist/person/person.controller.js.map +1 -0
- package/dist/person/person.module.d.ts +3 -0
- package/dist/person/person.module.d.ts.map +1 -0
- package/dist/person/person.module.js +59 -0
- package/dist/person/person.module.js.map +1 -0
- package/dist/person/person.service.d.ts +19 -0
- package/dist/person/person.service.d.ts.map +1 -0
- package/dist/person/person.service.js +78 -0
- package/dist/person/person.service.js.map +1 -0
- package/dist/person-address-type/dto/create.dto.d.ts +5 -0
- package/dist/person-address-type/dto/create.dto.d.ts.map +1 -0
- package/dist/person-address-type/dto/create.dto.js +22 -0
- package/dist/person-address-type/dto/create.dto.js.map +1 -0
- package/dist/person-address-type/dto/update.dto.d.ts +6 -0
- package/dist/person-address-type/dto/update.dto.d.ts.map +1 -0
- package/dist/person-address-type/dto/update.dto.js +9 -0
- package/dist/person-address-type/dto/update.dto.js.map +1 -0
- package/dist/person-address-type/person-address-type.controller.d.ts +14 -0
- package/dist/person-address-type/person-address-type.controller.d.ts.map +1 -0
- package/dist/person-address-type/person-address-type.controller.js +91 -0
- package/dist/person-address-type/person-address-type.controller.js.map +1 -0
- package/dist/person-address-type/person-address-type.enum.d.ts +10 -0
- package/dist/person-address-type/person-address-type.enum.d.ts.map +1 -0
- package/dist/person-address-type/person-address-type.enum.js +14 -0
- package/dist/person-address-type/person-address-type.enum.js.map +1 -0
- package/dist/person-address-type/person-address-type.module.d.ts +3 -0
- package/dist/person-address-type/person-address-type.module.d.ts.map +1 -0
- package/dist/person-address-type/person-address-type.module.js +31 -0
- package/dist/person-address-type/person-address-type.module.js.map +1 -0
- package/dist/person-address-type/person-address-type.service.d.ts +23 -0
- package/dist/person-address-type/person-address-type.service.d.ts.map +1 -0
- package/dist/person-address-type/person-address-type.service.js +62 -0
- package/dist/person-address-type/person-address-type.service.js.map +1 -0
- package/dist/person-contact-type/dto/create.dto.d.ts +5 -0
- package/dist/person-contact-type/dto/create.dto.d.ts.map +1 -0
- package/dist/person-contact-type/dto/create.dto.js +22 -0
- package/dist/person-contact-type/dto/create.dto.js.map +1 -0
- package/dist/person-contact-type/dto/update.dto.d.ts +6 -0
- package/dist/person-contact-type/dto/update.dto.d.ts.map +1 -0
- package/dist/person-contact-type/dto/update.dto.js +9 -0
- package/dist/person-contact-type/dto/update.dto.js.map +1 -0
- package/dist/person-contact-type/person-contact-type.controller.d.ts +14 -0
- package/dist/person-contact-type/person-contact-type.controller.d.ts.map +1 -0
- package/dist/person-contact-type/person-contact-type.controller.js +91 -0
- package/dist/person-contact-type/person-contact-type.controller.js.map +1 -0
- package/dist/person-contact-type/person-contact-type.enum.d.ts +8 -0
- package/dist/person-contact-type/person-contact-type.enum.d.ts.map +1 -0
- package/dist/person-contact-type/person-contact-type.enum.js +12 -0
- package/dist/person-contact-type/person-contact-type.enum.js.map +1 -0
- package/dist/person-contact-type/person-contact-type.module.d.ts +3 -0
- package/dist/person-contact-type/person-contact-type.module.d.ts.map +1 -0
- package/dist/person-contact-type/person-contact-type.module.js +31 -0
- package/dist/person-contact-type/person-contact-type.module.js.map +1 -0
- package/dist/person-contact-type/person-contact-type.service.d.ts +23 -0
- package/dist/person-contact-type/person-contact-type.service.d.ts.map +1 -0
- package/dist/person-contact-type/person-contact-type.service.js +62 -0
- package/dist/person-contact-type/person-contact-type.service.js.map +1 -0
- package/dist/person-custom-type/dto/create.dto.d.ts +5 -0
- package/dist/person-custom-type/dto/create.dto.d.ts.map +1 -0
- package/dist/person-custom-type/dto/create.dto.js +22 -0
- package/dist/person-custom-type/dto/create.dto.js.map +1 -0
- package/dist/person-custom-type/dto/update.dto.d.ts +6 -0
- package/dist/person-custom-type/dto/update.dto.d.ts.map +1 -0
- package/dist/person-custom-type/dto/update.dto.js +9 -0
- package/dist/person-custom-type/dto/update.dto.js.map +1 -0
- package/dist/person-custom-type/person-custom-type.controller.d.ts +14 -0
- package/dist/person-custom-type/person-custom-type.controller.d.ts.map +1 -0
- package/dist/person-custom-type/person-custom-type.controller.js +91 -0
- package/dist/person-custom-type/person-custom-type.controller.js.map +1 -0
- package/dist/person-custom-type/person-custom-type.module.d.ts +3 -0
- package/dist/person-custom-type/person-custom-type.module.d.ts.map +1 -0
- package/dist/person-custom-type/person-custom-type.module.js +31 -0
- package/dist/person-custom-type/person-custom-type.module.js.map +1 -0
- package/dist/person-custom-type/person-custom-type.service.d.ts +23 -0
- package/dist/person-custom-type/person-custom-type.service.d.ts.map +1 -0
- package/dist/person-custom-type/person-custom-type.service.js +62 -0
- package/dist/person-custom-type/person-custom-type.service.js.map +1 -0
- package/dist/person-document-type/dto/create.dto.d.ts +6 -0
- package/dist/person-document-type/dto/create.dto.d.ts.map +1 -0
- package/dist/person-document-type/dto/create.dto.js +26 -0
- package/dist/person-document-type/dto/create.dto.js.map +1 -0
- package/dist/person-document-type/dto/update.dto.d.ts +6 -0
- package/dist/person-document-type/dto/update.dto.d.ts.map +1 -0
- package/dist/person-document-type/dto/update.dto.js +9 -0
- package/dist/person-document-type/dto/update.dto.js.map +1 -0
- package/dist/person-document-type/person-document-type.controller.d.ts +14 -0
- package/dist/person-document-type/person-document-type.controller.d.ts.map +1 -0
- package/dist/person-document-type/person-document-type.controller.js +91 -0
- package/dist/person-document-type/person-document-type.controller.js.map +1 -0
- package/dist/person-document-type/person-document-type.enum.d.ts +8 -0
- package/dist/person-document-type/person-document-type.enum.d.ts.map +1 -0
- package/dist/person-document-type/person-document-type.enum.js +12 -0
- package/dist/person-document-type/person-document-type.enum.js.map +1 -0
- package/dist/person-document-type/person-document-type.module.d.ts +3 -0
- package/dist/person-document-type/person-document-type.module.d.ts.map +1 -0
- package/dist/person-document-type/person-document-type.module.js +31 -0
- package/dist/person-document-type/person-document-type.module.js.map +1 -0
- package/dist/person-document-type/person-document-type.service.d.ts +23 -0
- package/dist/person-document-type/person-document-type.service.d.ts.map +1 -0
- package/dist/person-document-type/person-document-type.service.js +62 -0
- package/dist/person-document-type/person-document-type.service.js.map +1 -0
- package/dist/person-type/dto/create.dto.d.ts +5 -0
- package/dist/person-type/dto/create.dto.d.ts.map +1 -0
- package/dist/person-type/dto/create.dto.js +22 -0
- package/dist/person-type/dto/create.dto.js.map +1 -0
- package/dist/person-type/dto/update.dto.d.ts +6 -0
- package/dist/person-type/dto/update.dto.d.ts.map +1 -0
- package/dist/person-type/dto/update.dto.js +9 -0
- package/dist/person-type/dto/update.dto.js.map +1 -0
- package/dist/person-type/person-type.controller.d.ts +14 -0
- package/dist/person-type/person-type.controller.d.ts.map +1 -0
- package/dist/person-type/person-type.controller.js +91 -0
- package/dist/person-type/person-type.controller.js.map +1 -0
- package/dist/person-type/person-type.enum.d.ts +6 -0
- package/dist/person-type/person-type.enum.d.ts.map +1 -0
- package/dist/person-type/person-type.enum.js +10 -0
- package/dist/person-type/person-type.enum.js.map +1 -0
- package/dist/person-type/person-type.module.d.ts +3 -0
- package/dist/person-type/person-type.module.d.ts.map +1 -0
- package/dist/person-type/person-type.module.js +31 -0
- package/dist/person-type/person-type.module.js.map +1 -0
- package/dist/person-type/person-type.service.d.ts +23 -0
- package/dist/person-type/person-type.service.d.ts.map +1 -0
- package/dist/person-type/person-type.service.js +62 -0
- package/dist/person-type/person-type.service.js.map +1 -0
- package/hedhog/data/menu.yaml +87 -0
- package/hedhog/data/person_address_type.yaml +28 -0
- package/hedhog/data/person_contact_type.yaml +20 -0
- package/hedhog/data/person_document_type.yaml +35 -0
- package/hedhog/data/person_type.yaml +12 -0
- package/hedhog/data/route.yaml +213 -0
- package/hedhog/data/screen.yaml +96 -0
- package/hedhog/table/person.yaml +38 -0
- package/hedhog/table/person_address.yaml +85 -0
- package/hedhog/table/person_address_type.yaml +14 -0
- package/hedhog/table/person_contact.yaml +34 -0
- package/hedhog/table/person_contact_type.yaml +14 -0
- package/hedhog/table/person_custom.yaml +30 -0
- package/hedhog/table/person_custom_type.yaml +14 -0
- package/hedhog/table/person_document.yaml +55 -0
- package/hedhog/table/person_document_type.yaml +23 -0
- package/hedhog/table/person_type.yaml +15 -0
- package/hedhog/table/person_user.yaml +18 -0
- package/hedhog/table/person_value.yaml +16 -0
- package/package.json +40 -0
- package/src/contact.module.ts +50 -0
- package/src/contact.service.ts +228 -0
- package/src/emails/index.ts +2 -0
- package/src/emails/lib.ts +17 -0
- package/src/emails/templates.ts +41 -0
- package/src/index.ts +18 -0
- package/src/person/dto/create.dto.ts +17 -0
- package/src/person/dto/update.dto.ts +4 -0
- package/src/person/person-address/dto/create.dto.ts +40 -0
- package/src/person/person-address/dto/update.dto.ts +4 -0
- package/src/person/person-address/person-address.controller.ts +68 -0
- package/src/person/person-address/person-address.service.ts +80 -0
- package/src/person/person-contact/dto/create.dto.ts +13 -0
- package/src/person/person-contact/dto/update.dto.ts +4 -0
- package/src/person/person-contact/person-contact.controller.ts +68 -0
- package/src/person/person-contact/person-contact.service.ts +79 -0
- package/src/person/person-custom/dto/create.dto.ts +11 -0
- package/src/person/person-custom/dto/update.dto.ts +4 -0
- package/src/person/person-custom/person-custom.controller.ts +62 -0
- package/src/person/person-custom/person-custom.service.ts +88 -0
- package/src/person/person-document/dto/create.dto.ts +24 -0
- package/src/person/person-document/dto/update.dto.ts +4 -0
- package/src/person/person-document/person-document.controller.ts +68 -0
- package/src/person/person-document/person-document.service.ts +79 -0
- package/src/person/person-user/dto/create.dto.ts +6 -0
- package/src/person/person-user/dto/update.dto.ts +4 -0
- package/src/person/person-user/person-user.controller.ts +68 -0
- package/src/person/person-user/person-user.service.ts +79 -0
- package/src/person/person-value/dto/create.dto.ts +6 -0
- package/src/person/person-value/dto/update.dto.ts +4 -0
- package/src/person/person-value/person-value.controller.ts +68 -0
- package/src/person/person-value/person-value.service.ts +79 -0
- package/src/person/person.controller.ts +55 -0
- package/src/person/person.module.ts +45 -0
- package/src/person/person.service.ts +83 -0
- package/src/person-address-type/dto/create.dto.ts +7 -0
- package/src/person-address-type/dto/update.dto.ts +4 -0
- package/src/person-address-type/person-address-type.controller.ts +55 -0
- package/src/person-address-type/person-address-type.enum.ts +15 -0
- package/src/person-address-type/person-address-type.module.ts +18 -0
- package/src/person-address-type/person-address-type.service.ts +72 -0
- package/src/person-contact-type/dto/create.dto.ts +7 -0
- package/src/person-contact-type/dto/update.dto.ts +4 -0
- package/src/person-contact-type/person-contact-type.controller.ts +55 -0
- package/src/person-contact-type/person-contact-type.enum.ts +11 -0
- package/src/person-contact-type/person-contact-type.module.ts +18 -0
- package/src/person-contact-type/person-contact-type.service.ts +72 -0
- package/src/person-custom-type/dto/create.dto.ts +7 -0
- package/src/person-custom-type/dto/update.dto.ts +4 -0
- package/src/person-custom-type/person-custom-type.controller.ts +55 -0
- package/src/person-custom-type/person-custom-type.module.ts +18 -0
- package/src/person-custom-type/person-custom-type.service.ts +72 -0
- package/src/person-document-type/dto/create.dto.ts +10 -0
- package/src/person-document-type/dto/update.dto.ts +4 -0
- package/src/person-document-type/person-document-type.controller.ts +55 -0
- package/src/person-document-type/person-document-type.enum.ts +11 -0
- package/src/person-document-type/person-document-type.module.ts +18 -0
- package/src/person-document-type/person-document-type.service.ts +72 -0
- package/src/person-type/dto/create.dto.ts +7 -0
- package/src/person-type/dto/update.dto.ts +4 -0
- package/src/person-type/person-type.controller.ts +55 -0
- package/src/person-type/person-type.enum.ts +7 -0
- package/src/person-type/person-type.module.ts +18 -0
- package/src/person-type/person-type.service.ts +72 -0
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export const defaults = {
|
|
2
|
+
header: (title: string) => `
|
|
3
|
+
<div style="text-align: center; margin-bottom: 30px;">
|
|
4
|
+
<img style="margin-bottom: 16px" src="https://coinbitclub.vip/_next/image?url=%2F_next%2Fstatic%2Fmedia%2Fcoinbitclub-logo.b29de722.png&w=640&q=75" alt="Coinbitclub Logo" />
|
|
5
|
+
<h1 style="color: #2c3e50; font-size: 26px; margin: 0;">${title}</h1>
|
|
6
|
+
</div>
|
|
7
|
+
`,
|
|
8
|
+
default_body: (
|
|
9
|
+
content: string[],
|
|
10
|
+
) => `<body style="font-family: Arial, sans-serif; background-color: #eef2f7; color: #333; margin: 0; padding: 1px;">
|
|
11
|
+
<div style="max-width: 600px; margin: 40px auto; background-color: #ffffff; border: 1px solid #dcdfe6; border-radius: 10px; padding: 40px; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);">
|
|
12
|
+
${content.join('')}
|
|
13
|
+
</div>
|
|
14
|
+
</body>`,
|
|
15
|
+
footer: () => `
|
|
16
|
+
<div style="text-align: center; font-size: 13px; color: #95a5a6; margin-top: 40px; border-top: 1px solid #ecf0f1; padding-top: 20px;">
|
|
17
|
+
<p>Este email foi enviado automaticamente. Por favor, não responda.</p>
|
|
18
|
+
</div>
|
|
19
|
+
`,
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export type CreatePersonUserlessType = {
|
|
23
|
+
name: string;
|
|
24
|
+
url: string;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export const bodies = {
|
|
28
|
+
create_person_userless: ({ name, url }: CreatePersonUserlessType) => `
|
|
29
|
+
<div style="line-height: 1.8; font-size: 16px; color: #555; text-align: justify;">
|
|
30
|
+
<p>Olá ${name},</p>
|
|
31
|
+
<p>Use o link abaixo para criar a sua conta:</p>
|
|
32
|
+
</div>
|
|
33
|
+
<div style="text-align: center; margin: 30px 0;">
|
|
34
|
+
<a href="${url}" style="display: inline-block; padding: 15px 30px; background-color: #3498db; color: #ffffff; text-decoration: none; font-size: 16px; font-weight: bold; border-radius: 8px; box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);">Criar Conta</a>
|
|
35
|
+
</div>
|
|
36
|
+
<div style="font-size: 14px; line-height: 1.7; color: #666;">
|
|
37
|
+
<p>Por razões de segurança, evite compartilhar suas informações de login ou clicar em links suspeitos.</p>
|
|
38
|
+
<p>Agradecemos por escolher nossa plataforma!</p>
|
|
39
|
+
</div>
|
|
40
|
+
`,
|
|
41
|
+
};
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export * from "./contact.module";
|
|
2
|
+
export * from "./contact.service";
|
|
3
|
+
|
|
4
|
+
export * from "./person-address-type/person-address-type.enum";
|
|
5
|
+
|
|
6
|
+
export * from "./person-contact-type/person-contact-type.enum";
|
|
7
|
+
|
|
8
|
+
export * from "./person-document-type/person-document-type.enum";
|
|
9
|
+
|
|
10
|
+
export * from "./person-type/person-type.enum";
|
|
11
|
+
|
|
12
|
+
export * from "./person-address-type/person-address-type.enum";
|
|
13
|
+
|
|
14
|
+
export * from "./person-contact-type/person-contact-type.enum";
|
|
15
|
+
|
|
16
|
+
export * from "./person-document-type/person-document-type.enum";
|
|
17
|
+
|
|
18
|
+
export * from "./person-type/person-type.enum";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { IsString, IsNumber, IsOptional } from 'class-validator';
|
|
2
|
+
|
|
3
|
+
export class CreateDTO {
|
|
4
|
+
@IsString()
|
|
5
|
+
name: string;
|
|
6
|
+
|
|
7
|
+
@IsOptional()
|
|
8
|
+
@IsNumber()
|
|
9
|
+
photo_id?: number;
|
|
10
|
+
|
|
11
|
+
@IsNumber()
|
|
12
|
+
type_id: number;
|
|
13
|
+
|
|
14
|
+
@IsOptional()
|
|
15
|
+
@IsString()
|
|
16
|
+
birth_at?: string;
|
|
17
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { IsNumber, IsBoolean, IsString, IsOptional } from 'class-validator';
|
|
2
|
+
|
|
3
|
+
export class CreateDTO {
|
|
4
|
+
@IsNumber()
|
|
5
|
+
country_id: number;
|
|
6
|
+
|
|
7
|
+
@IsNumber()
|
|
8
|
+
type_id: number;
|
|
9
|
+
|
|
10
|
+
@IsOptional()
|
|
11
|
+
@IsBoolean()
|
|
12
|
+
primary?: boolean;
|
|
13
|
+
|
|
14
|
+
@IsString()
|
|
15
|
+
street: string;
|
|
16
|
+
|
|
17
|
+
@IsOptional()
|
|
18
|
+
@IsString()
|
|
19
|
+
number?: string;
|
|
20
|
+
|
|
21
|
+
@IsOptional()
|
|
22
|
+
@IsString()
|
|
23
|
+
complement?: string;
|
|
24
|
+
|
|
25
|
+
@IsString()
|
|
26
|
+
district: string;
|
|
27
|
+
|
|
28
|
+
@IsString()
|
|
29
|
+
city: string;
|
|
30
|
+
|
|
31
|
+
@IsString()
|
|
32
|
+
state: string;
|
|
33
|
+
|
|
34
|
+
@IsString()
|
|
35
|
+
postal_code: string;
|
|
36
|
+
|
|
37
|
+
@IsOptional()
|
|
38
|
+
@IsString()
|
|
39
|
+
reference?: string;
|
|
40
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { Pagination } from '@hed-hog/api-pagination';
|
|
2
|
+
import { Role } from '@hed-hog/api';
|
|
3
|
+
import {
|
|
4
|
+
Body,
|
|
5
|
+
Controller,
|
|
6
|
+
Delete,
|
|
7
|
+
Get,
|
|
8
|
+
Param,
|
|
9
|
+
ParseIntPipe,
|
|
10
|
+
Patch,
|
|
11
|
+
Post,
|
|
12
|
+
Inject,
|
|
13
|
+
forwardRef
|
|
14
|
+
} from '@nestjs/common';
|
|
15
|
+
import { PersonAddressService } from './person-address.service';
|
|
16
|
+
import { CreateDTO } from './dto/create.dto';
|
|
17
|
+
import { UpdateDTO } from './dto/update.dto';
|
|
18
|
+
import { DeleteDTO } from '@hed-hog/api';
|
|
19
|
+
|
|
20
|
+
@Role()
|
|
21
|
+
@Controller('person/:personId/person-address')
|
|
22
|
+
export class PersonAddressController {
|
|
23
|
+
constructor(
|
|
24
|
+
@Inject(forwardRef(() => PersonAddressService))
|
|
25
|
+
private readonly personAddressService: PersonAddressService
|
|
26
|
+
) {}
|
|
27
|
+
|
|
28
|
+
@Post()
|
|
29
|
+
create(
|
|
30
|
+
@Param('personId', ParseIntPipe) personId: number,
|
|
31
|
+
@Body() data: CreateDTO
|
|
32
|
+
) {
|
|
33
|
+
return this.personAddressService.create(personId, data);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
@Get()
|
|
37
|
+
list(
|
|
38
|
+
@Param('personId', ParseIntPipe) personId: number,
|
|
39
|
+
@Pagination() paginationParams
|
|
40
|
+
) {
|
|
41
|
+
return this.personAddressService.list(paginationParams, personId);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
@Get(':id')
|
|
45
|
+
get(
|
|
46
|
+
@Param('personId', ParseIntPipe) personId: number,
|
|
47
|
+
@Param('id', ParseIntPipe) id: number
|
|
48
|
+
) {
|
|
49
|
+
return this.personAddressService.get(personId, id);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
@Patch(':id')
|
|
53
|
+
update(
|
|
54
|
+
@Param('personId', ParseIntPipe) personId: number,
|
|
55
|
+
@Param('id', ParseIntPipe) id: number,
|
|
56
|
+
@Body() data: UpdateDTO
|
|
57
|
+
) {
|
|
58
|
+
return this.personAddressService.update(personId, id, data);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
@Delete()
|
|
62
|
+
delete(
|
|
63
|
+
@Param('personId', ParseIntPipe) personId: number,
|
|
64
|
+
@Body() { ids }: DeleteDTO
|
|
65
|
+
) {
|
|
66
|
+
return this.personAddressService.delete(personId, { ids });
|
|
67
|
+
}
|
|
68
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { PaginationService, PaginationDTO } from '@hed-hog/api-pagination';
|
|
2
|
+
import { PrismaService } from '@hed-hog/api-prisma';
|
|
3
|
+
import {
|
|
4
|
+
Injectable,
|
|
5
|
+
NotFoundException,
|
|
6
|
+
BadRequestException
|
|
7
|
+
} from '@nestjs/common';
|
|
8
|
+
import { CreateDTO } from './dto/create.dto';
|
|
9
|
+
import { UpdateDTO } from './dto/update.dto';
|
|
10
|
+
import { DeleteDTO } from '@hed-hog/api';
|
|
11
|
+
|
|
12
|
+
@Injectable()
|
|
13
|
+
export class PersonAddressService {
|
|
14
|
+
constructor(
|
|
15
|
+
private readonly prismaService: PrismaService,
|
|
16
|
+
private readonly paginationService: PaginationService
|
|
17
|
+
) {}
|
|
18
|
+
|
|
19
|
+
async create(personId: number, data: CreateDTO) {
|
|
20
|
+
return this.prismaService.person_address.create({
|
|
21
|
+
data: {
|
|
22
|
+
person_id: personId,
|
|
23
|
+
...data
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
async get(personId: number, id: number) {
|
|
29
|
+
return this.prismaService.person_address.findFirst({
|
|
30
|
+
where: {
|
|
31
|
+
person_id: personId,
|
|
32
|
+
id: id
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
async list(paginationParams: PaginationDTO, personId?: number) {
|
|
38
|
+
const where: any = {};
|
|
39
|
+
if (personId !== undefined) where.person_id = personId;
|
|
40
|
+
|
|
41
|
+
return this.paginationService.paginate(
|
|
42
|
+
this.prismaService.person_address,
|
|
43
|
+
{
|
|
44
|
+
fields:
|
|
45
|
+
'primary,street,number,complement,district,city,state,postal_code,reference',
|
|
46
|
+
...paginationParams
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
where
|
|
50
|
+
}
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
async update(personId: number, id: number, data: UpdateDTO) {
|
|
55
|
+
return this.prismaService.person_address.updateMany({
|
|
56
|
+
where: {
|
|
57
|
+
person_id: personId,
|
|
58
|
+
id: id
|
|
59
|
+
},
|
|
60
|
+
data
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
async delete(personId: number, { ids }: DeleteDTO) {
|
|
65
|
+
if (ids == undefined || ids == null) {
|
|
66
|
+
throw new BadRequestException(
|
|
67
|
+
'You must select at least one item to delete.'
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
return this.prismaService.person_address.deleteMany({
|
|
72
|
+
where: {
|
|
73
|
+
person_id: personId,
|
|
74
|
+
id: {
|
|
75
|
+
in: ids
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { Pagination } from '@hed-hog/api-pagination';
|
|
2
|
+
import { Role } from '@hed-hog/api';
|
|
3
|
+
import {
|
|
4
|
+
Body,
|
|
5
|
+
Controller,
|
|
6
|
+
Delete,
|
|
7
|
+
Get,
|
|
8
|
+
Param,
|
|
9
|
+
ParseIntPipe,
|
|
10
|
+
Patch,
|
|
11
|
+
Post,
|
|
12
|
+
Inject,
|
|
13
|
+
forwardRef
|
|
14
|
+
} from '@nestjs/common';
|
|
15
|
+
import { PersonContactService } from './person-contact.service';
|
|
16
|
+
import { CreateDTO } from './dto/create.dto';
|
|
17
|
+
import { UpdateDTO } from './dto/update.dto';
|
|
18
|
+
import { DeleteDTO } from '@hed-hog/api';
|
|
19
|
+
|
|
20
|
+
@Role()
|
|
21
|
+
@Controller('person/:personId/person-contact')
|
|
22
|
+
export class PersonContactController {
|
|
23
|
+
constructor(
|
|
24
|
+
@Inject(forwardRef(() => PersonContactService))
|
|
25
|
+
private readonly personContactService: PersonContactService
|
|
26
|
+
) {}
|
|
27
|
+
|
|
28
|
+
@Post()
|
|
29
|
+
create(
|
|
30
|
+
@Param('personId', ParseIntPipe) personId: number,
|
|
31
|
+
@Body() data: CreateDTO
|
|
32
|
+
) {
|
|
33
|
+
return this.personContactService.create(personId, data);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
@Get()
|
|
37
|
+
list(
|
|
38
|
+
@Param('personId', ParseIntPipe) personId: number,
|
|
39
|
+
@Pagination() paginationParams
|
|
40
|
+
) {
|
|
41
|
+
return this.personContactService.list(paginationParams, personId);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
@Get(':id')
|
|
45
|
+
get(
|
|
46
|
+
@Param('personId', ParseIntPipe) personId: number,
|
|
47
|
+
@Param('id', ParseIntPipe) id: number
|
|
48
|
+
) {
|
|
49
|
+
return this.personContactService.get(personId, id);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
@Patch(':id')
|
|
53
|
+
update(
|
|
54
|
+
@Param('personId', ParseIntPipe) personId: number,
|
|
55
|
+
@Param('id', ParseIntPipe) id: number,
|
|
56
|
+
@Body() data: UpdateDTO
|
|
57
|
+
) {
|
|
58
|
+
return this.personContactService.update(personId, id, data);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
@Delete()
|
|
62
|
+
delete(
|
|
63
|
+
@Param('personId', ParseIntPipe) personId: number,
|
|
64
|
+
@Body() { ids }: DeleteDTO
|
|
65
|
+
) {
|
|
66
|
+
return this.personContactService.delete(personId, { ids });
|
|
67
|
+
}
|
|
68
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { PaginationService, PaginationDTO } from '@hed-hog/api-pagination';
|
|
2
|
+
import { PrismaService } from '@hed-hog/api-prisma';
|
|
3
|
+
import {
|
|
4
|
+
Injectable,
|
|
5
|
+
NotFoundException,
|
|
6
|
+
BadRequestException
|
|
7
|
+
} from '@nestjs/common';
|
|
8
|
+
import { CreateDTO } from './dto/create.dto';
|
|
9
|
+
import { UpdateDTO } from './dto/update.dto';
|
|
10
|
+
import { DeleteDTO } from '@hed-hog/api';
|
|
11
|
+
|
|
12
|
+
@Injectable()
|
|
13
|
+
export class PersonContactService {
|
|
14
|
+
constructor(
|
|
15
|
+
private readonly prismaService: PrismaService,
|
|
16
|
+
private readonly paginationService: PaginationService
|
|
17
|
+
) {}
|
|
18
|
+
|
|
19
|
+
async create(personId: number, data: CreateDTO) {
|
|
20
|
+
return this.prismaService.person_contact.create({
|
|
21
|
+
data: {
|
|
22
|
+
person_id: personId,
|
|
23
|
+
...data
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
async get(personId: number, id: number) {
|
|
29
|
+
return this.prismaService.person_contact.findFirst({
|
|
30
|
+
where: {
|
|
31
|
+
person_id: personId,
|
|
32
|
+
id: id
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
async list(paginationParams: PaginationDTO, personId?: number) {
|
|
38
|
+
const where: any = {};
|
|
39
|
+
if (personId !== undefined) where.person_id = personId;
|
|
40
|
+
|
|
41
|
+
return this.paginationService.paginate(
|
|
42
|
+
this.prismaService.person_contact,
|
|
43
|
+
{
|
|
44
|
+
fields: 'primary,value',
|
|
45
|
+
...paginationParams
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
where
|
|
49
|
+
}
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
async update(personId: number, id: number, data: UpdateDTO) {
|
|
54
|
+
return this.prismaService.person_contact.updateMany({
|
|
55
|
+
where: {
|
|
56
|
+
person_id: personId,
|
|
57
|
+
id: id
|
|
58
|
+
},
|
|
59
|
+
data
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
async delete(personId: number, { ids }: DeleteDTO) {
|
|
64
|
+
if (ids == undefined || ids == null) {
|
|
65
|
+
throw new BadRequestException(
|
|
66
|
+
'You must select at least one item to delete.'
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
return this.prismaService.person_contact.deleteMany({
|
|
71
|
+
where: {
|
|
72
|
+
person_id: personId,
|
|
73
|
+
id: {
|
|
74
|
+
in: ids
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { IsNumber, IsString, IsOptional } from 'class-validator';
|
|
2
|
+
import { WithLocaleDTO } from '@hed-hog/api-locale';
|
|
3
|
+
|
|
4
|
+
export class CreateDTO extends WithLocaleDTO {
|
|
5
|
+
@IsNumber()
|
|
6
|
+
type_id: number;
|
|
7
|
+
|
|
8
|
+
@IsOptional()
|
|
9
|
+
@IsString()
|
|
10
|
+
value?: string;
|
|
11
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { Pagination } from '@hed-hog/api-pagination';
|
|
2
|
+
import { Role } from '@hed-hog/api';
|
|
3
|
+
import {
|
|
4
|
+
Body,
|
|
5
|
+
Controller,
|
|
6
|
+
Delete,
|
|
7
|
+
Get,
|
|
8
|
+
Param,
|
|
9
|
+
ParseIntPipe,
|
|
10
|
+
Patch,
|
|
11
|
+
Post,
|
|
12
|
+
Inject,
|
|
13
|
+
forwardRef
|
|
14
|
+
} from '@nestjs/common';
|
|
15
|
+
import { PersonCustomService } from './person-custom.service';
|
|
16
|
+
import { CreateDTO } from './dto/create.dto';
|
|
17
|
+
import { UpdateDTO } from './dto/update.dto';
|
|
18
|
+
import { DeleteDTO } from '@hed-hog/api';
|
|
19
|
+
import { Locale } from '@hed-hog/api-locale';
|
|
20
|
+
|
|
21
|
+
@Role()
|
|
22
|
+
@Controller('person/:personId/person-custom')
|
|
23
|
+
export class PersonCustomController {
|
|
24
|
+
constructor(
|
|
25
|
+
@Inject(forwardRef(() => PersonCustomService))
|
|
26
|
+
private readonly personCustomService: PersonCustomService
|
|
27
|
+
) {}
|
|
28
|
+
|
|
29
|
+
@Post()
|
|
30
|
+
create(
|
|
31
|
+
@Param('personId', ParseIntPipe) personId: number,
|
|
32
|
+
@Body() data: CreateDTO
|
|
33
|
+
) {
|
|
34
|
+
return this.personCustomService.create(personId, data);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
@Get()
|
|
38
|
+
list(
|
|
39
|
+
@Locale() locale,
|
|
40
|
+
@Param('personId', ParseIntPipe) personId: number,
|
|
41
|
+
@Pagination() paginationParams
|
|
42
|
+
) {
|
|
43
|
+
return this.personCustomService.list(locale, personId, paginationParams);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
@Patch(':id')
|
|
47
|
+
update(
|
|
48
|
+
@Param('personId', ParseIntPipe) personId: number,
|
|
49
|
+
@Param('id', ParseIntPipe) id: number,
|
|
50
|
+
@Body() data: UpdateDTO
|
|
51
|
+
) {
|
|
52
|
+
return this.personCustomService.update(personId, id, data);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
@Delete()
|
|
56
|
+
delete(
|
|
57
|
+
@Param('personId', ParseIntPipe) personId: number,
|
|
58
|
+
@Body() { ids }: DeleteDTO
|
|
59
|
+
) {
|
|
60
|
+
return this.personCustomService.delete(personId, { ids });
|
|
61
|
+
}
|
|
62
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { DeleteDTO } from '@hed-hog/api';
|
|
2
|
+
import { LocaleService } from '@hed-hog/api-locale';
|
|
3
|
+
import { PaginationDTO, PaginationService } from '@hed-hog/api-pagination';
|
|
4
|
+
import { PrismaService } from '@hed-hog/api-prisma';
|
|
5
|
+
import {
|
|
6
|
+
BadRequestException,
|
|
7
|
+
forwardRef,
|
|
8
|
+
Inject,
|
|
9
|
+
Injectable
|
|
10
|
+
} from '@nestjs/common';
|
|
11
|
+
import { CreateDTO } from './dto/create.dto';
|
|
12
|
+
import { UpdateDTO } from './dto/update.dto';
|
|
13
|
+
|
|
14
|
+
@Injectable()
|
|
15
|
+
export class PersonCustomService {
|
|
16
|
+
private readonly modelName = 'person_custom';
|
|
17
|
+
private readonly foreignKey = 'custom_id';
|
|
18
|
+
|
|
19
|
+
constructor(
|
|
20
|
+
@Inject(forwardRef(() => PrismaService))
|
|
21
|
+
private readonly prismaService: PrismaService,
|
|
22
|
+
@Inject(forwardRef(() => PaginationService))
|
|
23
|
+
private readonly paginationService: PaginationService,
|
|
24
|
+
@Inject(forwardRef(() => LocaleService))
|
|
25
|
+
private readonly localeService: LocaleService
|
|
26
|
+
) {}
|
|
27
|
+
|
|
28
|
+
async list(
|
|
29
|
+
locale: string,
|
|
30
|
+
personId: number,
|
|
31
|
+
paginationParams: PaginationDTO
|
|
32
|
+
) {
|
|
33
|
+
const where: any = {};
|
|
34
|
+
if (personId !== undefined) where.person_id = personId;
|
|
35
|
+
|
|
36
|
+
return this.localeService.listModelWithLocale(
|
|
37
|
+
locale,
|
|
38
|
+
this.modelName,
|
|
39
|
+
paginationParams,
|
|
40
|
+
{
|
|
41
|
+
person_id: personId
|
|
42
|
+
}
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
async get(id: number) {
|
|
47
|
+
return this.localeService.getModelWithLocale(this.modelName, id);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
async create(personId: number, data: CreateDTO) {
|
|
51
|
+
(data as any).person_id = personId;
|
|
52
|
+
|
|
53
|
+
return this.localeService.createModelWithLocale(
|
|
54
|
+
this.modelName,
|
|
55
|
+
this.foreignKey,
|
|
56
|
+
data
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
async update(id: number, personId: number, data: UpdateDTO) {
|
|
61
|
+
return this.localeService.updateModelWithLocale(
|
|
62
|
+
this.modelName,
|
|
63
|
+
this.foreignKey,
|
|
64
|
+
id,
|
|
65
|
+
data,
|
|
66
|
+
{
|
|
67
|
+
person_id: personId
|
|
68
|
+
}
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
async delete(personId: number, { ids }: DeleteDTO) {
|
|
73
|
+
if (ids == undefined || ids == null) {
|
|
74
|
+
throw new BadRequestException(
|
|
75
|
+
'You must select at least one item to delete.'
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
return this.prismaService.person_custom.deleteMany({
|
|
80
|
+
where: {
|
|
81
|
+
person_id: personId,
|
|
82
|
+
id: {
|
|
83
|
+
in: ids
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { IsNumber, IsBoolean, IsString, IsOptional } from 'class-validator';
|
|
2
|
+
|
|
3
|
+
export class CreateDTO {
|
|
4
|
+
@IsNumber()
|
|
5
|
+
type_id: number;
|
|
6
|
+
|
|
7
|
+
@IsNumber()
|
|
8
|
+
country_id: number;
|
|
9
|
+
|
|
10
|
+
@IsOptional()
|
|
11
|
+
@IsBoolean()
|
|
12
|
+
primary?: boolean;
|
|
13
|
+
|
|
14
|
+
@IsString()
|
|
15
|
+
value: string;
|
|
16
|
+
|
|
17
|
+
@IsOptional()
|
|
18
|
+
@IsString()
|
|
19
|
+
issued_at?: string;
|
|
20
|
+
|
|
21
|
+
@IsOptional()
|
|
22
|
+
@IsString()
|
|
23
|
+
expiry_at?: string;
|
|
24
|
+
}
|