possible to add a contact to a thirdparty

This commit is contained in:
2022-01-19 10:57:31 +01:00
parent 8fa2f0e7ad
commit 20d22b726c
5 changed files with 22 additions and 15 deletions

View File

@@ -126,7 +126,7 @@ class ThirdParty implements TrackCreationInterface, TrackUpdateInterface
* @var Civility
* @ORM\ManyToOne(targetEntity=Civility::class)
* ORM\JoinColumn(name="civility", referencedColumnName="id", nullable=true)
* @Groups({"docgen:read", "docgen:read:3party:parent"})
* @Groups({"read", "write", "docgen:read", "docgen:read:3party:parent"})
* @Context(normalizationContext={"groups": "docgen:read"}, groups={"docgen:read:3party:parent"})
*/
private ?Civility $civility = null;
@@ -199,7 +199,7 @@ class ThirdParty implements TrackCreationInterface, TrackUpdateInterface
*
* @ORM\ManyToOne(targetEntity="Chill\ThirdPartyBundle\Entity\ThirdParty", inversedBy="children")
* @ORM\JoinColumn(name="parent_id", referencedColumnName="id")
* @Groups({"docgen:read"})
* @Groups({"read", "write", "docgen:read"})
* @Context(normalizationContext={"groups": "docgen:read:3party:parent"}, groups={"docgen:read"})
*/
private ?ThirdParty $parent = null;
@@ -210,7 +210,7 @@ class ThirdParty implements TrackCreationInterface, TrackUpdateInterface
* @var ThirdPartyProfession
* @ORM\ManyToOne(targetEntity="Chill\ThirdPartyBundle\Entity\ThirdPartyProfession")
* ORM\JoinColumn(name="profession", referencedColumnName="id", nullable=true)
* @Groups({"docgen:read", "docgen:read:3party:parent"})
* @Groups({"read", "write", "docgen:read", "docgen:read:3party:parent"})
* @Context(normalizationContext={"groups": "docgen:read"}, groups={"docgen:read:3party:parent"})
*/
private ?ThirdPartyProfession $profession = null;

View File

@@ -31,7 +31,7 @@ class ThirdPartyProfession
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
* @Serializer\Groups({"docgen:read", "read"})
* @Serializer\Groups({"docgen:read", "read", "write"})
*/
private ?int $id = null;

View File

@@ -48,7 +48,6 @@
</div>
</div>
<div v-else>
<!-- <p>Contact de&nbsp;:</p> -->
<third-party-render-box
:thirdparty="thirdparty"
:options="{
@@ -66,12 +65,8 @@
</div>
<div v-if="parent">
<!-- <div class="input-group mb-3">
<input type="hidden" name="parent_id" v-model="thirdparty.parent" :value="parent.id" />
</div> -->
<div id="child-info">
<div class="input-group mb-3">
<!-- <span class="input-group-text" id="comment"><i class="fa fa-fw fa-briefcase"></i></span> -->
<select class="form-select form-select-lg" id="profession"
v-model="thirdparty.civility">
<option selected disabled >{{ $t('thirdparty.civility') }}</option>
@@ -79,7 +74,6 @@
</select>
</div>
<div class="input-group mb-3">
<!-- <span class="input-group-text" id="comment"><i class="fa fa-fw fa-user-circle-o"></i></span> -->
<select class="form-select form-select-lg" id="civility"
v-model="thirdparty.profession">
<option selected disabled >{{ $t('thirdparty.profession') }}</option>
@@ -230,7 +224,7 @@ export default {
})
.catch((error) => {
console.log(error)
// this.$toast.open({message: error.body})
this.$toast.open({message: error.body})
})
},
loadProfessions() {
@@ -241,7 +235,7 @@ export default {
})
.catch((error) => {
console.log(error)
// this.$toast.open({message: error.body})
this.$toast.open({message: error.body})
})
},
submitAddress(payload) {

View File

@@ -45,6 +45,7 @@ class ThirdPartyNormalizer implements NormalizerAwareInterface, NormalizerInterf
'isChild' => $thirdParty->isChild(),
'parent' => $this->normalizer->normalize($thirdParty->getParent(), $format, $context),
'civility' => $this->normalizer->normalize($thirdParty->getCivility(), $format, $context),
'profession' => $this->normalizer->normalize($thirdParty->getProfession(), $format, $context),
'contactDataAnonymous' => $thirdParty->isContactDataAnonymous(),
];
}