mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
remove route for testing move
This commit is contained in:
parent
89734c680c
commit
3e39dd9a1e
@ -71,49 +71,6 @@ class HouseholdMemberController extends ApiController
|
||||
return $this->json($editor->getHousehold(), Response::HTTP_OK, [], ["groups" => ["read"]]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route(
|
||||
* "/api/1.0/person/household/members/move/test.{_format}",
|
||||
* name="chill_api_person_household_members_move_test"
|
||||
* )
|
||||
*/
|
||||
public function test(Request $request, $_format): Response
|
||||
{
|
||||
try {
|
||||
$editor = $this->getSerializer()
|
||||
->deserialize($request->getContent(), MembersEditor::class,
|
||||
$_format, ['groups' => [ "read" ]]);
|
||||
} catch (Exception\InvalidArgumentException | Exception\UnexpectedValueException $e) {
|
||||
throw new BadRequestException("Deserialization error: {$e->getMessage()}", 45896, $e);
|
||||
}
|
||||
// TODO ACL
|
||||
//
|
||||
// TODO validation
|
||||
// temporary, to have at least one problem for testing purpose
|
||||
/*$violations = [
|
||||
new \Symfony\Component\Validator\ConstraintViolation(
|
||||
"This is a fake message",
|
||||
null,
|
||||
[],
|
||||
$editor->getHousehold(),
|
||||
'household.members.startDate',
|
||||
new \DateTime('10 years ago')
|
||||
),
|
||||
new \Symfony\Component\Validator\ConstraintViolation(
|
||||
"This is another fake message",
|
||||
null,
|
||||
[],
|
||||
$editor->getHousehold(),
|
||||
'household.members.endDate',
|
||||
new \DateTime('10 years ago')
|
||||
)
|
||||
];
|
||||
$violationsList = new \Symfony\Component\Validator\ConstraintViolationList($violations);
|
||||
*/
|
||||
|
||||
return $this->json($editor->getHousehold(), Response::HTTP_OK, ["groups" => ["read"]]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route(
|
||||
* "/{_locale}/person/household/members/editor",
|
||||
|
@ -869,45 +869,3 @@ paths:
|
||||
400:
|
||||
description: "transition cannot be applyed"
|
||||
|
||||
/1.0/person/household/members/move/test.json:
|
||||
post:
|
||||
tags:
|
||||
- household
|
||||
summary: test the move of one or more person, without persisting changes in database
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
concerned:
|
||||
type: array
|
||||
items:
|
||||
type: object
|
||||
properties:
|
||||
person:
|
||||
$ref: '#/components/schemas/PersonById'
|
||||
start_date:
|
||||
$ref: '#/components/schemas/Date'
|
||||
position:
|
||||
$ref: '#/components/schemas/HouseholdPosition'
|
||||
holder:
|
||||
type: boolean
|
||||
comment:
|
||||
type: string
|
||||
destination:
|
||||
oneOf:
|
||||
- $ref: '#/components/schemas/Household'
|
||||
responses:
|
||||
401:
|
||||
description: "Unauthorized"
|
||||
404:
|
||||
description: "Not found"
|
||||
200:
|
||||
description: "OK"
|
||||
422:
|
||||
description: "Unprocessable entity (validation errors)"
|
||||
400:
|
||||
description: "transition cannot be applyed"
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user