fix format + fix employee creation

This commit is contained in:
Dennis Eichhorn 2019-09-28 23:11:30 +02:00
parent 6b3c2751b6
commit 7608536e84

View File

@ -641,22 +641,22 @@ $module = $app->moduleManager->get('Organization');
TestUtils::setMember($module, 'app', $app); TestUtils::setMember($module, 'app', $app);
$departments = [ $departments = [
['name' => 'Management', 'parent' => null], ['name' => 'Management', 'parent' => null],
['name' => 'R&D', 'parent' => 'Management'], ['name' => 'R&D', 'parent' => 'Management'],
['name' => 'Sales', 'parent' => 'Management'], ['name' => 'Sales', 'parent' => 'Management'],
['name' => 'Service', 'parent' => 'Management'], ['name' => 'Service', 'parent' => 'Management'],
['name' => 'Support', 'parent' => 'Management'], ['name' => 'Support', 'parent' => 'Management'],
['name' => 'Purchase', 'parent' => 'Management'], ['name' => 'Purchase', 'parent' => 'Management'],
['name' => 'Warehouse', 'parent' => 'Purchase'], ['name' => 'Warehouse', 'parent' => 'Purchase'],
['name' => 'Secretariat', 'parent' => 'Management'], ['name' => 'Secretariat', 'parent' => 'Management'],
['name' => 'Registration', 'parent' => 'Management'], ['name' => 'Registration', 'parent' => 'Management'],
['name' => 'HR', 'parent' => 'Management'], ['name' => 'HR', 'parent' => 'Management'],
['name' => 'Purchasing', 'parent' => 'Management'], ['name' => 'Purchasing', 'parent' => 'Management'],
['name' => 'QA', 'parent' => 'Management'], ['name' => 'QA', 'parent' => 'Management'],
['name' => 'QM', 'parent' => 'Management'], ['name' => 'QM', 'parent' => 'Management'],
['name' => 'Finance', 'parent' => 'Management'], ['name' => 'Finance', 'parent' => 'Management'],
['name' => 'Marketing', 'parent' => 'Management'], ['name' => 'Marketing', 'parent' => 'Management'],
['name' => 'IT', 'parent' => 'Management'], ['name' => 'IT', 'parent' => 'Management'],
]; ];
$departmentIds = []; $departmentIds = [];
@ -681,36 +681,36 @@ $module = $app->moduleManager->get('Organization');
TestUtils::setMember($module, 'app', $app); TestUtils::setMember($module, 'app', $app);
$positions = [ $positions = [
['name' => 'Chairman', 'department' => 'Management', 'parent' => null], ['name' => 'Chairman', 'department' => 'Management', 'parent' => null],
['name' => 'CEO', 'department' => 'Management', 'parent' => 'Chairman'], ['name' => 'CEO', 'department' => 'Management', 'parent' => 'Chairman'],
['name' => 'Executive Member', 'department' => null, 'parent' => 'Chairman'], ['name' => 'Executive Member', 'department' => null, 'parent' => 'Chairman'],
['name' => 'COO', 'department' => 'Management', 'parent' => 'CEO'], ['name' => 'COO', 'department' => 'Management', 'parent' => 'CEO'],
['name' => 'CTO', 'department' => 'R&D', 'parent' => 'CEO'], ['name' => 'CTO', 'department' => 'R&D', 'parent' => 'CEO'],
['name' => 'R&D Employee', 'department' => 'R&D', 'parent' => 'CTO'], ['name' => 'R&D Employee', 'department' => 'R&D', 'parent' => 'CTO'],
['name' => 'CFO', 'department' => 'Finance', 'parent' => 'CEO'], ['name' => 'CFO', 'department' => 'Finance', 'parent' => 'CEO'],
['name' => 'Accountant', 'department' => 'Finance', 'parent' => 'CFO'], ['name' => 'Accountant', 'department' => 'Finance', 'parent' => 'CFO'],
['name' => 'CSO', 'department' => 'Sales', 'parent' => 'CEO'], ['name' => 'CSO', 'department' => 'Sales', 'parent' => 'CEO'],
['name' => 'Export Controle Officer', 'department' => 'Sales', 'parent' => 'CEO'], ['name' => 'Export Controle Officer', 'department' => 'Sales', 'parent' => 'CEO'],
['name' => 'Back Office Sales', 'department' => 'Sales', 'parent' => 'CSO'], ['name' => 'Back Office Sales', 'department' => 'Sales', 'parent' => 'CSO'],
['name' => 'Head of Secretariat', 'department' => 'Secretariat', 'parent' => 'CEO'], ['name' => 'Head of Secretariat', 'department' => 'Secretariat', 'parent' => 'CEO'],
['name' => 'Secretary', 'department' => 'Secretariat', 'parent' => 'Head of Secretariat'], ['name' => 'Secretary', 'department' => 'Secretariat', 'parent' => 'Head of Secretariat'],
['name' => 'Head of Service', 'department' => 'Service', 'parent' => 'CEO'], ['name' => 'Head of Service', 'department' => 'Service', 'parent' => 'CEO'],
['name' => 'Service Employee', 'department' => 'Service', 'parent' => 'Head of Service'], ['name' => 'Service Employee', 'department' => 'Service', 'parent' => 'Head of Service'],
['name' => 'Head of Support', 'department' => 'Support', 'parent' => 'CEO'], ['name' => 'Head of Support', 'department' => 'Support', 'parent' => 'CEO'],
['name' => 'Support Employee', 'department' => 'Support', 'parent' => 'Head of Support'], ['name' => 'Support Employee', 'department' => 'Support', 'parent' => 'Head of Support'],
['name' => 'Head of Warehouse', 'department' => 'Warehouse', 'parent' => 'Head of Production'], ['name' => 'Head of Warehouse', 'department' => 'Warehouse', 'parent' => 'Head of Production'],
['name' => 'Warehouse Employee', 'department' => 'Warehouse', 'parent' => 'Head of Warehouse'], ['name' => 'Warehouse Employee', 'department' => 'Warehouse', 'parent' => 'Head of Warehouse'],
['name' => 'Head of Purchasing', 'department' => 'Purchasing', 'parent' => 'CEO'], ['name' => 'Head of Purchasing', 'department' => 'Purchasing', 'parent' => 'CEO'],
['name' => 'Back Office Purchasing', 'department' => 'Purchasing', 'parent' => 'Head of Purchasing'], ['name' => 'Back Office Purchasing', 'department' => 'Purchasing', 'parent' => 'Head of Purchasing'],
['name' => 'Head of QM', 'department' => 'QM', 'parent' => 'CEO'], ['name' => 'Head of QM', 'department' => 'QM', 'parent' => 'CEO'],
['name' => 'QM Employee', 'department' => 'QM', 'parent' => 'Head of QM'], ['name' => 'QM Employee', 'department' => 'QM', 'parent' => 'Head of QM'],
['name' => 'Head of QA', 'department' => 'QA', 'parent' => 'CEO'], ['name' => 'Head of QA', 'department' => 'QA', 'parent' => 'CEO'],
['name' => 'QA Employee', 'department' => 'QA', 'parent' => 'Head of QA'], ['name' => 'QA Employee', 'department' => 'QA', 'parent' => 'Head of QA'],
['name' => 'Head of HR', 'department' => 'HR', 'parent' => 'CEO'], ['name' => 'Head of HR', 'department' => 'HR', 'parent' => 'CEO'],
['name' => 'HR Employee', 'department' => 'HR', 'parent' => 'Head of HR'], ['name' => 'HR Employee', 'department' => 'HR', 'parent' => 'Head of HR'],
['name' => 'Head of IT', 'department' => 'IT', 'parent' => 'CEO'], ['name' => 'Head of IT', 'department' => 'IT', 'parent' => 'CEO'],
['name' => 'IT Employee', 'department' => 'IT', 'parent' => 'Head of IT'], ['name' => 'IT Employee', 'department' => 'IT', 'parent' => 'Head of IT'],
['name' => 'Trainee', 'department' => 'HR', 'parent' => 'Head of HR'], ['name' => 'Trainee', 'department' => 'HR', 'parent' => 'Head of HR'],
]; ];
$departments = DepartmentMapper::getAll(); $departments = DepartmentMapper::getAll();
@ -747,7 +747,7 @@ $accounts = [
'pass' => 'deichhorn', 'pass' => 'deichhorn',
'name1' => 'Dennis', 'name1' => 'Dennis',
'name2' => 'Eichhorn', 'name2' => 'Eichhorn',
'email' => 'dennis.eichhorn@gdfmbh.com', 'email' => 'd.eichhorn@schuetz-dental.de',
'groups' => ['Executive', 'Finance', 'Controlling', 'Employee', 'beta_tester'], 'groups' => ['Executive', 'Finance', 'Controlling', 'Employee', 'beta_tester'],
], ],
]; ];
@ -858,9 +858,9 @@ $response = new Response();
$request = new Request(new Http('')); $request = new Request(new Http(''));
$request->getHeader()->setAccount(2); $request->getHeader()->setAccount(2);
$request->setData('account', 2); $request->setData('accounts', 2);
$module->apiEmployeeFromAccountCreate($request, $response); $module->apiEmployeeCreate($request, $response);
$request->setData('employee', 1); $request->setData('employee', 1);
$request->setData('start', '2015-07-01'); $request->setData('start', '2015-07-01');