Campos por tabla:
Los caracteres resaltados simbolizan preguntas que se deben realizar
Process:
Schema::create('processes', function (Blueprint $table) {
$table->id();
$table->foreignId('branch_id')->nullable()->constrained();
$table->foreignId('dependency_id')->nullable()->constrained();
$table->string('code')->unique()->nullable(); // this code can be generated by the
system or by the user?
$table->string('name');
$table->string('description')->nullable();
$table->string('status')->default('active');
$table->foreignId('created_by')->nullable()->constrained('users');
$table->foreignId('updated_by')->nullable()->constrained('users');
$table->timestamps();
$table->softDeletes();
//indexes
$table->index(['name', 'branch_id', 'dependency_id']);
});
Process_steps:
Schema::create('process_steps', function (Blueprint $table) {
$table->id();
$table->foreignId('process_id')->constrained();
$table->string('code')->nullable()->unique(); // Is this code generated by the system or
by the user?
$table->foreignId('name');
$table->string('description')->nullable();
$table->integer('duration'); // Duration in days, hours?
$table->string('duration_type')->default('Habil'); // what is the default value? //
Duration type, e.g., 'Habil', 'Calendario'?
$table->string('status')->default('active');
$table->foreignId('created_by')->nullable()->constrained('users');
$table->foreignId('updated_by')->nullable()->constrained('users');
$table->timestamps();
$table->softDeletes();
//indexes
$table->index(['process_id', 'name']);
});
Process_Activities:
Schema::create('process_activities', function (Blueprint $table) {
$table->id();
$table->foreignId('process_step_id')->constrained();
$table->string('name');
$table->string('description')->nullable();
$table->string('duration')->nullable();
$table->integer('order')->nullable();
$table->integer('days_green')->nullable();
$table->integer('days_yellow')->nullable();
$table->integer('days_red')->nullable();
$table->string('duration_type')->nullable()->default('Habil'); // what is the default
value? // Duration type, e.g., 'Habil', 'Calendario'?
$table->string('status')->default('active');
$table->foreignId('created_by')->nullable()->constrained('users');
$table->foreignId('updated_by')->nullable()->constrained('users');
$table->timestamps();
$table->softDeletes();
});