PMCORE-3971 (apply changes from feature branch/PMCORE-3871 that were reverted to avoid conflicts) 3.8.x: Solve the conflicts to merge this epic into develop
This commit is contained in:
@@ -1,197 +1,250 @@
|
||||
<?php
|
||||
|
||||
use Faker\Generator as Faker;
|
||||
namespace Database\Factories;
|
||||
|
||||
$factory->define(\ProcessMaker\Model\Delegation::class, function(Faker $faker) {
|
||||
$user = factory(\ProcessMaker\Model\User::class)->create();
|
||||
$process = factory(\ProcessMaker\Model\Process::class)->create();
|
||||
$task = factory(\ProcessMaker\Model\Task::class)->create([
|
||||
'PRO_UID' => $process->PRO_UID,
|
||||
'PRO_ID' => $process->PRO_ID
|
||||
]);
|
||||
$application = factory(\ProcessMaker\Model\Application::class)->create([
|
||||
'PRO_UID' => $process->PRO_UID,
|
||||
'APP_INIT_USER' => $user->USR_UID,
|
||||
'APP_CUR_USER' => $user->USR_UID
|
||||
]);
|
||||
// Return with default values
|
||||
return [
|
||||
'DELEGATION_ID' => $faker->unique()->numberBetween(5000),
|
||||
'APP_UID' => $application->APP_UID,
|
||||
'DEL_INDEX' => 1,
|
||||
'APP_NUMBER' => $application->APP_NUMBER,
|
||||
'DEL_PREVIOUS' => 0,
|
||||
'PRO_UID' => $process->PRO_UID,
|
||||
'TAS_UID' => $task->TAS_UID,
|
||||
'USR_UID' => $user->USR_UID,
|
||||
'DEL_TYPE' => 'NORMAL',
|
||||
'DEL_THREAD' => 1,
|
||||
'DEL_THREAD_STATUS' => 'OPEN',
|
||||
'DEL_THREAD_STATUS_ID' => 1,
|
||||
'DEL_PRIORITY' => 3,
|
||||
'DEL_DELEGATE_DATE' => $faker->dateTime(),
|
||||
'DEL_INIT_DATE' => $faker->dateTime(),
|
||||
'DEL_TASK_DUE_DATE' => $faker->dateTime(),
|
||||
'DEL_RISK_DATE' => $faker->dateTime(),
|
||||
'DEL_LAST_INDEX' => 0,
|
||||
'USR_ID' => $user->USR_ID,
|
||||
'PRO_ID' => $process->PRO_ID,
|
||||
'TAS_ID' => $task->TAS_ID,
|
||||
'DEL_DATA' => '',
|
||||
'DEL_TITLE' => $faker->word()
|
||||
];
|
||||
});
|
||||
use App\Factories\Factory;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
// Create a delegation with the foreign keys
|
||||
$factory->state(\ProcessMaker\Model\Delegation::class, 'foreign_keys', function (Faker $faker) {
|
||||
// Create values in the foreign key relations
|
||||
$user = factory(\ProcessMaker\Model\User::class)->create();
|
||||
$category = factory(\ProcessMaker\Model\ProcessCategory::class)->create();
|
||||
$process = factory(\ProcessMaker\Model\Process::class)->create([
|
||||
'PRO_CATEGORY' => $category->CATEGORY_UID,
|
||||
'CATEGORY_ID' => $category->CATEGORY_ID
|
||||
]);
|
||||
$task = factory(\ProcessMaker\Model\Task::class)->create([
|
||||
'PRO_UID' => $process->PRO_UID,
|
||||
'PRO_ID' => $process->PRO_ID
|
||||
]);
|
||||
$application = factory(\ProcessMaker\Model\Application::class)->create([
|
||||
'PRO_UID' => $process->PRO_UID,
|
||||
'APP_INIT_USER' => $user->USR_UID,
|
||||
'APP_CUR_USER' => $user->USR_UID
|
||||
]);
|
||||
class DelegationFactory extends Factory
|
||||
{
|
||||
|
||||
$delegateDate = $faker->dateTime();
|
||||
$initDate = $faker->dateTimeInInterval($delegateDate, '+30 minutes');
|
||||
$riskDate = $faker->dateTimeInInterval($initDate, '+1 day');
|
||||
$taskDueDate = $faker->dateTimeInInterval($riskDate, '+2 day');
|
||||
$index = $faker->unique()->numberBetween(2000);
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function definition()
|
||||
{
|
||||
$user = \ProcessMaker\Model\User::factory()->create();
|
||||
$process = \ProcessMaker\Model\Process::factory()->create();
|
||||
$task = \ProcessMaker\Model\Task::factory()->create([
|
||||
'PRO_UID' => $process->PRO_UID,
|
||||
'PRO_ID' => $process->PRO_ID
|
||||
]);
|
||||
$application = \ProcessMaker\Model\Application::factory()->create([
|
||||
'PRO_UID' => $process->PRO_UID,
|
||||
'APP_INIT_USER' => $user->USR_UID,
|
||||
'APP_CUR_USER' => $user->USR_UID
|
||||
]);
|
||||
// Return with default values
|
||||
return [
|
||||
'DELEGATION_ID' => $this->faker->unique()->numberBetween(5000),
|
||||
'APP_UID' => $application->APP_UID,
|
||||
'DEL_INDEX' => 1,
|
||||
'APP_NUMBER' => $application->APP_NUMBER,
|
||||
'DEL_PREVIOUS' => 0,
|
||||
'PRO_UID' => $process->PRO_UID,
|
||||
'TAS_UID' => $task->TAS_UID,
|
||||
'USR_UID' => $user->USR_UID,
|
||||
'DEL_TYPE' => 'NORMAL',
|
||||
'DEL_THREAD' => 1,
|
||||
'DEL_THREAD_STATUS' => 'OPEN',
|
||||
'DEL_THREAD_STATUS_ID' => 1,
|
||||
'DEL_PRIORITY' => 3,
|
||||
'DEL_DELEGATE_DATE' => $this->faker->dateTime(),
|
||||
'DEL_INIT_DATE' => $this->faker->dateTime(),
|
||||
'DEL_TASK_DUE_DATE' => $this->faker->dateTime(),
|
||||
'DEL_RISK_DATE' => $this->faker->dateTime(),
|
||||
'DEL_LAST_INDEX' => 0,
|
||||
'USR_ID' => $user->USR_ID,
|
||||
'PRO_ID' => $process->PRO_ID,
|
||||
'TAS_ID' => $task->TAS_ID,
|
||||
'DEL_DATA' => '',
|
||||
'DEL_TITLE' => $this->faker->word()
|
||||
];
|
||||
}
|
||||
|
||||
// Return with default values
|
||||
return [
|
||||
'DELEGATION_ID' => $faker->unique()->numberBetween(5000),
|
||||
'APP_UID' => $application->APP_UID,
|
||||
'DEL_INDEX' => $index,
|
||||
'APP_NUMBER' => $application->APP_NUMBER,
|
||||
'DEL_PREVIOUS' => $index - 1,
|
||||
'PRO_UID' => $process->PRO_UID,
|
||||
'TAS_UID' => $task->TAS_UID,
|
||||
'USR_UID' => $user->USR_UID,
|
||||
'DEL_TYPE' => 'NORMAL',
|
||||
'DEL_THREAD' => 1,
|
||||
'DEL_THREAD_STATUS' => 'OPEN',
|
||||
'DEL_THREAD_STATUS_ID' => 1,
|
||||
'DEL_PRIORITY' => 3,
|
||||
'DEL_DELEGATE_DATE' => $delegateDate,
|
||||
'DEL_INIT_DATE' => $initDate,
|
||||
'DEL_TASK_DUE_DATE' => $taskDueDate,
|
||||
'DEL_RISK_DATE' => $riskDate,
|
||||
'DEL_LAST_INDEX' => 1,
|
||||
'USR_ID' => $user->USR_ID,
|
||||
'PRO_ID' => $process->PRO_ID,
|
||||
'TAS_ID' => $task->TAS_ID,
|
||||
'DEL_DATA' => '',
|
||||
'DEL_TITLE' => $faker->word()
|
||||
];
|
||||
});
|
||||
/**
|
||||
* Create a delegation with the foreign keys
|
||||
* @return type
|
||||
*/
|
||||
public function foreign_keys()
|
||||
{
|
||||
$state = function (array $attributes) {
|
||||
// Create values in the foreign key relations
|
||||
$user = \ProcessMaker\Model\User::factory()->create();
|
||||
$category = \ProcessMaker\Model\ProcessCategory::factory()->create();
|
||||
$process = \ProcessMaker\Model\Process::factory()->create([
|
||||
'PRO_CATEGORY' => $category->CATEGORY_UID,
|
||||
'CATEGORY_ID' => $category->CATEGORY_ID
|
||||
]);
|
||||
$task = \ProcessMaker\Model\Task::factory()->create([
|
||||
'PRO_UID' => $process->PRO_UID,
|
||||
'PRO_ID' => $process->PRO_ID
|
||||
]);
|
||||
$application = \ProcessMaker\Model\Application::factory()->create([
|
||||
'PRO_UID' => $process->PRO_UID,
|
||||
'APP_INIT_USER' => $user->USR_UID,
|
||||
'APP_CUR_USER' => $user->USR_UID
|
||||
]);
|
||||
|
||||
// Create a delegation with the foreign keys
|
||||
$factory->state(\ProcessMaker\Model\Delegation::class, 'web_entry', function (Faker $faker) {
|
||||
// Create values in the foreign key relations
|
||||
$user = factory(\ProcessMaker\Model\User::class)->create();
|
||||
$category = factory(\ProcessMaker\Model\ProcessCategory::class)->create();
|
||||
$process = factory(\ProcessMaker\Model\Process::class)->create([
|
||||
'PRO_CATEGORY' => $category->CATEGORY_UID,
|
||||
'CATEGORY_ID' => $category->CATEGORY_ID
|
||||
]);
|
||||
$task = factory(\ProcessMaker\Model\Task::class)->create([
|
||||
'PRO_UID' => $process->PRO_UID,
|
||||
'PRO_ID' => $process->PRO_ID
|
||||
]);
|
||||
$application = factory(\ProcessMaker\Model\Application::class)->states('web_entry')->create([
|
||||
'PRO_UID' => $process->PRO_UID,
|
||||
'APP_INIT_USER' => $user->USR_UID,
|
||||
'APP_CUR_USER' => $user->USR_UID
|
||||
]);
|
||||
$delegateDate = $this->faker->dateTime();
|
||||
$initDate = $this->faker->dateTimeInInterval($delegateDate, '+30 minutes');
|
||||
$riskDate = $this->faker->dateTimeInInterval($initDate, '+1 day');
|
||||
$taskDueDate = $this->faker->dateTimeInInterval($riskDate, '+2 day');
|
||||
$index = $this->faker->unique()->numberBetween(2000);
|
||||
|
||||
// Return with default values
|
||||
return [
|
||||
'DELEGATION_ID' => $faker->unique()->numberBetween(5000),
|
||||
'APP_UID' => $application->APP_UID,
|
||||
'DEL_INDEX' => 1,
|
||||
'APP_NUMBER' => $application->APP_NUMBER,
|
||||
'DEL_PREVIOUS' => 0,
|
||||
'PRO_UID' => $process->PRO_UID,
|
||||
'TAS_UID' => $task->TAS_UID,
|
||||
'USR_UID' => $user->USR_UID,
|
||||
'DEL_TYPE' => 'NORMAL',
|
||||
'DEL_THREAD' => 1,
|
||||
'DEL_THREAD_STATUS' => 'OPEN',
|
||||
'DEL_THREAD_STATUS_ID' => 1,
|
||||
'DEL_PRIORITY' => 3,
|
||||
'DEL_DELEGATE_DATE' => $faker->dateTime(),
|
||||
'DEL_INIT_DATE' => $faker->dateTime(),
|
||||
'DEL_TASK_DUE_DATE' => $faker->dateTime(),
|
||||
'DEL_RISK_DATE' => $faker->dateTime(),
|
||||
'USR_ID' => $user->USR_ID,
|
||||
'PRO_ID' => $process->PRO_ID,
|
||||
'TAS_ID' => $task->TAS_ID,
|
||||
'DEL_DATA' => '',
|
||||
'DEL_TITLE' => $faker->word()
|
||||
];
|
||||
});
|
||||
// Return with default values
|
||||
return [
|
||||
'DELEGATION_ID' => $this->faker->unique()->numberBetween(5000),
|
||||
'APP_UID' => $application->APP_UID,
|
||||
'DEL_INDEX' => $index,
|
||||
'APP_NUMBER' => $application->APP_NUMBER,
|
||||
'DEL_PREVIOUS' => $index - 1,
|
||||
'PRO_UID' => $process->PRO_UID,
|
||||
'TAS_UID' => $task->TAS_UID,
|
||||
'USR_UID' => $user->USR_UID,
|
||||
'DEL_TYPE' => 'NORMAL',
|
||||
'DEL_THREAD' => 1,
|
||||
'DEL_THREAD_STATUS' => 'OPEN',
|
||||
'DEL_THREAD_STATUS_ID' => 1,
|
||||
'DEL_PRIORITY' => 3,
|
||||
'DEL_DELEGATE_DATE' => $delegateDate,
|
||||
'DEL_INIT_DATE' => $initDate,
|
||||
'DEL_TASK_DUE_DATE' => $taskDueDate,
|
||||
'DEL_RISK_DATE' => $riskDate,
|
||||
'DEL_LAST_INDEX' => 1,
|
||||
'USR_ID' => $user->USR_ID,
|
||||
'PRO_ID' => $process->PRO_ID,
|
||||
'TAS_ID' => $task->TAS_ID,
|
||||
'DEL_DATA' => '',
|
||||
'DEL_TITLE' => $this->faker->word()
|
||||
];
|
||||
};
|
||||
return $this->state($state);
|
||||
}
|
||||
|
||||
// Create a open delegation
|
||||
$factory->state(\ProcessMaker\Model\Delegation::class, 'open', function (Faker $faker) {
|
||||
// Create dates with sense
|
||||
$delegateDate = $faker->dateTime();
|
||||
$initDate = $faker->dateTimeInInterval($delegateDate, '+30 minutes');
|
||||
$riskDate = $faker->dateTimeInInterval($initDate, '+1 day');
|
||||
$taskDueDate = $faker->dateTimeInInterval($riskDate, '+2 day');
|
||||
/**
|
||||
* Create a delegation with the foreign keys
|
||||
* @return type
|
||||
*/
|
||||
public function web_entry()
|
||||
{
|
||||
$state = function (array $attributes) {
|
||||
// Create values in the foreign key relations
|
||||
$user = \ProcessMaker\Model\User::factory()->create();
|
||||
$category = \ProcessMaker\Model\ProcessCategory::factory()->create();
|
||||
$process = \ProcessMaker\Model\Process::factory()->create([
|
||||
'PRO_CATEGORY' => $category->CATEGORY_UID,
|
||||
'CATEGORY_ID' => $category->CATEGORY_ID
|
||||
]);
|
||||
$task = \ProcessMaker\Model\Task::factory()->create([
|
||||
'PRO_UID' => $process->PRO_UID,
|
||||
'PRO_ID' => $process->PRO_ID
|
||||
]);
|
||||
$application = \ProcessMaker\Model\Application::factory()->web_entry()->create([
|
||||
'PRO_UID' => $process->PRO_UID,
|
||||
'APP_INIT_USER' => $user->USR_UID,
|
||||
'APP_CUR_USER' => $user->USR_UID
|
||||
]);
|
||||
|
||||
return [
|
||||
'DEL_THREAD_STATUS' => 'OPEN',
|
||||
'DEL_THREAD_STATUS_ID' => 1,
|
||||
'DEL_DELEGATE_DATE' => $delegateDate,
|
||||
'DEL_INIT_DATE' => $initDate,
|
||||
'DEL_RISK_DATE' => $riskDate,
|
||||
'DEL_TASK_DUE_DATE' => $taskDueDate,
|
||||
'DEL_FINISH_DATE' => null
|
||||
];
|
||||
});
|
||||
// Return with default values
|
||||
return [
|
||||
'DELEGATION_ID' => $this->faker->unique()->numberBetween(5000),
|
||||
'APP_UID' => $application->APP_UID,
|
||||
'DEL_INDEX' => 1,
|
||||
'APP_NUMBER' => $application->APP_NUMBER,
|
||||
'DEL_PREVIOUS' => 0,
|
||||
'PRO_UID' => $process->PRO_UID,
|
||||
'TAS_UID' => $task->TAS_UID,
|
||||
'USR_UID' => $user->USR_UID,
|
||||
'DEL_TYPE' => 'NORMAL',
|
||||
'DEL_THREAD' => 1,
|
||||
'DEL_THREAD_STATUS' => 'OPEN',
|
||||
'DEL_THREAD_STATUS_ID' => 1,
|
||||
'DEL_PRIORITY' => 3,
|
||||
'DEL_DELEGATE_DATE' => $this->faker->dateTime(),
|
||||
'DEL_INIT_DATE' => $this->faker->dateTime(),
|
||||
'DEL_TASK_DUE_DATE' => $this->faker->dateTime(),
|
||||
'DEL_RISK_DATE' => $this->faker->dateTime(),
|
||||
'USR_ID' => $user->USR_ID,
|
||||
'PRO_ID' => $process->PRO_ID,
|
||||
'TAS_ID' => $task->TAS_ID,
|
||||
'DEL_DATA' => '',
|
||||
'DEL_TITLE' => $this->faker->word()
|
||||
];
|
||||
};
|
||||
return $this->state($state);
|
||||
}
|
||||
|
||||
// Create a closed delegation
|
||||
$factory->state(\ProcessMaker\Model\Delegation::class, 'closed', function (Faker $faker) {
|
||||
// Create dates with sense
|
||||
$delegateDate = $faker->dateTime();
|
||||
$initDate = $faker->dateTimeInInterval($delegateDate, '+30 minutes');
|
||||
$riskDate = $faker->dateTimeInInterval($initDate, '+1 day');
|
||||
$taskDueDate = $faker->dateTimeInInterval($riskDate, '+2 day');
|
||||
$finishDate = $faker->dateTimeInInterval($initDate, '+10 days');
|
||||
/**
|
||||
* Create a open delegation
|
||||
* @return type
|
||||
*/
|
||||
public function open()
|
||||
{
|
||||
$state = function (array $attributes) {
|
||||
// Create dates with sense
|
||||
$delegateDate = $this->faker->dateTime();
|
||||
$initDate = $this->faker->dateTimeInInterval($delegateDate, '+30 minutes');
|
||||
$riskDate = $this->faker->dateTimeInInterval($initDate, '+1 day');
|
||||
$taskDueDate = $this->faker->dateTimeInInterval($riskDate, '+2 day');
|
||||
|
||||
return [
|
||||
'DEL_THREAD_STATUS' => 'CLOSED',
|
||||
'DEL_DELEGATE_DATE' => $delegateDate,
|
||||
'DEL_INIT_DATE' => $initDate,
|
||||
'DEL_RISK_DATE' => $riskDate,
|
||||
'DEL_TASK_DUE_DATE' => $taskDueDate,
|
||||
'DEL_FINISH_DATE' => $finishDate
|
||||
];
|
||||
});
|
||||
return [
|
||||
'DEL_THREAD_STATUS' => 'OPEN',
|
||||
'DEL_THREAD_STATUS_ID' => 1,
|
||||
'DEL_DELEGATE_DATE' => $delegateDate,
|
||||
'DEL_INIT_DATE' => $initDate,
|
||||
'DEL_RISK_DATE' => $riskDate,
|
||||
'DEL_TASK_DUE_DATE' => $taskDueDate,
|
||||
'DEL_FINISH_DATE' => null
|
||||
];
|
||||
};
|
||||
return $this->state($state);
|
||||
}
|
||||
|
||||
// Create a last delegation
|
||||
$factory->state(\ProcessMaker\Model\Delegation::class, 'last_thread', function (Faker $faker) {
|
||||
/**
|
||||
* Create a closed delegation
|
||||
* @return type
|
||||
*/
|
||||
public function closed()
|
||||
{
|
||||
$state = function (array $attributes) {
|
||||
// Create dates with sense
|
||||
$delegateDate = $this->faker->dateTime();
|
||||
$initDate = $this->faker->dateTimeInInterval($delegateDate, '+30 minutes');
|
||||
$riskDate = $this->faker->dateTimeInInterval($initDate, '+1 day');
|
||||
$taskDueDate = $this->faker->dateTimeInInterval($riskDate, '+2 day');
|
||||
$finishDate = $this->faker->dateTimeInInterval($initDate, '+10 days');
|
||||
|
||||
return [
|
||||
'DEL_LAST_INDEX' => 1,
|
||||
];
|
||||
});
|
||||
return [
|
||||
'DEL_THREAD_STATUS' => 'CLOSED',
|
||||
'DEL_DELEGATE_DATE' => $delegateDate,
|
||||
'DEL_INIT_DATE' => $initDate,
|
||||
'DEL_RISK_DATE' => $riskDate,
|
||||
'DEL_TASK_DUE_DATE' => $taskDueDate,
|
||||
'DEL_FINISH_DATE' => $finishDate
|
||||
];
|
||||
};
|
||||
return $this->state($state);
|
||||
}
|
||||
|
||||
// Create a first delegation
|
||||
$factory->state(\ProcessMaker\Model\Delegation::class, 'first_thread', function (Faker $faker) {
|
||||
/**
|
||||
* Create a last delegation
|
||||
* @return type
|
||||
*/
|
||||
public function last_thread()
|
||||
{
|
||||
$state = function (array $attributes) {
|
||||
return [
|
||||
'DEL_LAST_INDEX' => 1,
|
||||
];
|
||||
};
|
||||
return $this->state($state);
|
||||
}
|
||||
|
||||
return [
|
||||
'DEL_INDEX' => 1,
|
||||
'DEL_PREVIOUS' => 0,
|
||||
];
|
||||
});
|
||||
/**
|
||||
* Create a first delegation
|
||||
* @return type
|
||||
*/
|
||||
public function first_thread()
|
||||
{
|
||||
$state = function (array $attributes) {
|
||||
return [
|
||||
'DEL_INDEX' => 1,
|
||||
'DEL_PREVIOUS' => 0,
|
||||
];
|
||||
};
|
||||
return $this->state($state);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,34 +1,46 @@
|
||||
<?php
|
||||
/**
|
||||
* Model factory for web entries
|
||||
*/
|
||||
use Faker\Generator as Faker;
|
||||
|
||||
$factory->define(\ProcessMaker\Model\WebEntry::class, function(Faker $faker) {
|
||||
return [
|
||||
'WE_UID' => G::generateUniqueID(),
|
||||
'PRO_UID' => G::generateUniqueID(),
|
||||
'TAS_UID' => G::generateUniqueID(),
|
||||
'DYN_UID' => G::generateUniqueID(),
|
||||
'USR_UID' => G::generateUniqueID(),
|
||||
'WE_METHOD' => $faker->randomElement(['WS', 'HTML']),
|
||||
'WE_INPUT_DOCUMENT_ACCESS' => $faker->randomElement([0, 1]),
|
||||
'WE_DATA' => G::generateUniqueID() . '.php',
|
||||
'WE_CREATE_USR_UID' => G::generateUniqueID(),
|
||||
'WE_UPDATE_USR_UID' => G::generateUniqueID(),
|
||||
'WE_CREATE_DATE' => $faker->date('Y-m-d H:i:s', 'now'),
|
||||
'WE_UPDATE_DATE' => $faker->date('Y-m-d H:i:s', 'now'),
|
||||
'WE_TYPE' => $faker->randomElement(['SINGLE', 'MULTIPLE']),
|
||||
'WE_CUSTOM_TITLE' => $faker->words(5, true),
|
||||
'WE_AUTHENTICATION' => $faker->randomElement(['LOGIN_REQUIRED', 'ANONYMOUS']),
|
||||
'WE_HIDE_INFORMATION_BAR' => $faker->randomElement(['0', '1']),
|
||||
'WE_HIDE_ACTIVE_SESSION_WARNING' => $faker->randomElement(['0', '1']),
|
||||
'WE_CALLBACK' => $faker->randomElement(['PROCESSMAKER', 'CUSTOM', 'CUSTOM_CLEAR']),
|
||||
'WE_CALLBACK_URL' => $faker->url,
|
||||
'WE_LINK_GENERATION' => $faker->randomElement(['DEFAULT', 'ADVANCED']),
|
||||
'WE_LINK_SKIN' => 'classic',
|
||||
'WE_LINK_LANGUAGE' => 'en',
|
||||
'WE_LINK_DOMAIN' => $faker->domainName,
|
||||
'WE_SHOW_IN_NEW_CASE' => $faker->randomElement(['0', '1'])
|
||||
];
|
||||
});
|
||||
namespace Database\Factories;
|
||||
|
||||
use App\Factories\Factory;
|
||||
use G;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class WebEntryFactory extends Factory
|
||||
{
|
||||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function definition()
|
||||
{
|
||||
return [
|
||||
'WE_UID' => G::generateUniqueID(),
|
||||
'PRO_UID' => G::generateUniqueID(),
|
||||
'TAS_UID' => G::generateUniqueID(),
|
||||
'DYN_UID' => G::generateUniqueID(),
|
||||
'USR_UID' => G::generateUniqueID(),
|
||||
'WE_METHOD' => $this->faker->randomElement(['WS', 'HTML']),
|
||||
'WE_INPUT_DOCUMENT_ACCESS' => $this->faker->randomElement([0, 1]),
|
||||
'WE_DATA' => G::generateUniqueID() . '.php',
|
||||
'WE_CREATE_USR_UID' => G::generateUniqueID(),
|
||||
'WE_UPDATE_USR_UID' => G::generateUniqueID(),
|
||||
'WE_CREATE_DATE' => $this->faker->date('Y-m-d H:i:s', 'now'),
|
||||
'WE_UPDATE_DATE' => $this->faker->date('Y-m-d H:i:s', 'now'),
|
||||
'WE_TYPE' => $this->faker->randomElement(['SINGLE', 'MULTIPLE']),
|
||||
'WE_CUSTOM_TITLE' => $this->faker->words(5, true),
|
||||
'WE_AUTHENTICATION' => $this->faker->randomElement(['LOGIN_REQUIRED', 'ANONYMOUS']),
|
||||
'WE_HIDE_INFORMATION_BAR' => $this->faker->randomElement(['0', '1']),
|
||||
'WE_HIDE_ACTIVE_SESSION_WARNING' => $this->faker->randomElement(['0', '1']),
|
||||
'WE_CALLBACK' => $this->faker->randomElement(['PROCESSMAKER', 'CUSTOM', 'CUSTOM_CLEAR']),
|
||||
'WE_CALLBACK_URL' => $this->faker->url,
|
||||
'WE_LINK_GENERATION' => $this->faker->randomElement(['DEFAULT', 'ADVANCED']),
|
||||
'WE_LINK_SKIN' => 'classic',
|
||||
'WE_LINK_LANGUAGE' => 'en',
|
||||
'WE_LINK_DOMAIN' => $this->faker->domainName,
|
||||
'WE_SHOW_IN_NEW_CASE' => $this->faker->randomElement(['0', '1'])
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user