mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
misc fixes for Thirdparty / addPerson
* set default values for ThirdParty in ThirdParty.vue * set correct value for binding with phone (telephone instead of phonenumber) * add validation on ThirdParty/denomination: at least two characters, no Null value
This commit is contained in:
parent
99afd2e830
commit
caaebd593b
@ -139,12 +139,10 @@ class Address
|
|||||||
private $point;
|
private $point;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var PostalCode
|
|
||||||
*
|
|
||||||
* @ORM\ManyToOne(targetEntity="Chill\MainBundle\Entity\PostalCode")
|
* @ORM\ManyToOne(targetEntity="Chill\MainBundle\Entity\PostalCode")
|
||||||
* @Groups({"write"})
|
* @Groups({"write"})
|
||||||
*/
|
*/
|
||||||
private $postcode;
|
private ?PostalCode $postcode;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string|null
|
* @var string|null
|
||||||
|
@ -78,7 +78,7 @@ export default {
|
|||||||
case 'thirdparty':
|
case 'thirdparty':
|
||||||
let data = this.$refs.castThirdparty.$data.thirdparty;
|
let data = this.$refs.castThirdparty.$data.thirdparty;
|
||||||
data.name = data.text;
|
data.name = data.text;
|
||||||
if (data.address !== undefined) {
|
if (data.address !== null) {
|
||||||
data.address = { id: data.address.address_id }
|
data.address = { id: data.address.address_id }
|
||||||
} else {
|
} else {
|
||||||
data.address = null;
|
data.address = null;
|
||||||
|
@ -165,13 +165,6 @@ paths:
|
|||||||
200:
|
200:
|
||||||
description: "OK"
|
description: "OK"
|
||||||
/1.0/main/address.json:
|
/1.0/main/address.json:
|
||||||
get:
|
|
||||||
tags:
|
|
||||||
- address
|
|
||||||
summary: Return a list of all Chill addresses
|
|
||||||
responses:
|
|
||||||
200:
|
|
||||||
description: "ok"
|
|
||||||
post:
|
post:
|
||||||
tags:
|
tags:
|
||||||
- address
|
- address
|
||||||
@ -222,10 +215,44 @@ paths:
|
|||||||
description: "Unprocessable entity (validation errors)"
|
description: "Unprocessable entity (validation errors)"
|
||||||
400:
|
400:
|
||||||
description: "transition cannot be applyed"
|
description: "transition cannot be applyed"
|
||||||
|
/1.0/main/address/{id}.json:
|
||||||
|
get:
|
||||||
|
tags:
|
||||||
|
- address
|
||||||
|
summary: Return an address by id
|
||||||
|
parameters:
|
||||||
|
- name: id
|
||||||
|
in: path
|
||||||
|
required: true
|
||||||
|
description: The address id
|
||||||
|
schema:
|
||||||
|
type: integer
|
||||||
|
format: integer
|
||||||
|
minimum: 1
|
||||||
|
responses:
|
||||||
|
200:
|
||||||
|
description: "ok"
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/Address'
|
||||||
|
404:
|
||||||
|
description: "not found"
|
||||||
|
401:
|
||||||
|
description: "Unauthorized"
|
||||||
patch:
|
patch:
|
||||||
tags:
|
tags:
|
||||||
- address
|
- address
|
||||||
summary: patch an address
|
summary: patch an address
|
||||||
|
parameters:
|
||||||
|
- name: id
|
||||||
|
in: path
|
||||||
|
required: true
|
||||||
|
description: The address id
|
||||||
|
schema:
|
||||||
|
type: integer
|
||||||
|
format: integer
|
||||||
|
minimum: 1
|
||||||
requestBody:
|
requestBody:
|
||||||
required: true
|
required: true
|
||||||
content:
|
content:
|
||||||
@ -277,31 +304,6 @@ paths:
|
|||||||
400:
|
400:
|
||||||
description: "transition cannot be applyed"
|
description: "transition cannot be applyed"
|
||||||
|
|
||||||
/1.0/main/address/{id}.json:
|
|
||||||
get:
|
|
||||||
tags:
|
|
||||||
- address
|
|
||||||
summary: Return an address by id
|
|
||||||
parameters:
|
|
||||||
- name: id
|
|
||||||
in: path
|
|
||||||
required: true
|
|
||||||
description: The address id
|
|
||||||
schema:
|
|
||||||
type: integer
|
|
||||||
format: integer
|
|
||||||
minimum: 1
|
|
||||||
responses:
|
|
||||||
200:
|
|
||||||
description: "ok"
|
|
||||||
content:
|
|
||||||
application/json:
|
|
||||||
schema:
|
|
||||||
$ref: '#/components/schemas/Address'
|
|
||||||
404:
|
|
||||||
description: "not found"
|
|
||||||
401:
|
|
||||||
description: "Unauthorized"
|
|
||||||
|
|
||||||
/1.0/main/address/{id}/duplicate.json:
|
/1.0/main/address/{id}/duplicate.json:
|
||||||
post:
|
post:
|
||||||
|
@ -179,6 +179,8 @@ class ThirdParty implements TrackCreationInterface, TrackUpdateInterface
|
|||||||
* @var string
|
* @var string
|
||||||
* @ORM\Column(name="name", type="string", length=255)
|
* @ORM\Column(name="name", type="string", length=255)
|
||||||
* @Assert\Length(min="2")
|
* @Assert\Length(min="2")
|
||||||
|
* @Assert\NotNull
|
||||||
|
* @Assert\NotBlank
|
||||||
* @Groups({"read", "write", "docgen:read", "docgen:read:3party:parent"})
|
* @Groups({"read", "write", "docgen:read", "docgen:read:3party:parent"})
|
||||||
*/
|
*/
|
||||||
private ?string $name = '';
|
private ?string $name = '';
|
||||||
|
@ -92,7 +92,7 @@
|
|||||||
<div class="input-group mb-3">
|
<div class="input-group mb-3">
|
||||||
<span class="input-group-text" id="phonenumber"><i class="fa fa-fw fa-phone"></i></span>
|
<span class="input-group-text" id="phonenumber"><i class="fa fa-fw fa-phone"></i></span>
|
||||||
<input class="form-control form-control-lg"
|
<input class="form-control form-control-lg"
|
||||||
v-model="thirdparty.phonenumber"
|
v-model="thirdparty.telephone"
|
||||||
v-bind:placeholder="$t('thirdparty.phonenumber')"
|
v-bind:placeholder="$t('thirdparty.phonenumber')"
|
||||||
v-bind:aria-label="$t('thirdparty.phonenumber')"
|
v-bind:aria-label="$t('thirdparty.phonenumber')"
|
||||||
aria-describedby="phonenumber" />
|
aria-describedby="phonenumber" />
|
||||||
@ -120,6 +120,11 @@ export default {
|
|||||||
//context: {}, <--
|
//context: {}, <--
|
||||||
thirdparty: {
|
thirdparty: {
|
||||||
type: 'thirdparty',
|
type: 'thirdparty',
|
||||||
|
address: null,
|
||||||
|
kind: 'company',
|
||||||
|
name: '',
|
||||||
|
telephone: '',
|
||||||
|
|
||||||
},
|
},
|
||||||
addAddress: {
|
addAddress: {
|
||||||
options: {
|
options: {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user