|
|
@@ -40,6 +40,7 @@ use Mpdf\Mpdf;
|
|
|
* @property string $dts_created
|
|
|
* @property string $dts_updated
|
|
|
* @property string $dts_assigned
|
|
|
+ * @property string $dts_rejected
|
|
|
* @property string $dts_verified
|
|
|
*/
|
|
|
|
|
|
@@ -47,7 +48,20 @@ class Test extends Model {
|
|
|
|
|
|
protected static $table = "test";
|
|
|
protected static $id_field = "id";
|
|
|
- protected static $fillable_fields = ["project_id", "location_id", "tester_id", "status", "status_tester_invoice", "customer_fee", "test_fee", "test_time", "test_travel_cost", "test_travel_cost_description", "shop_left", "shop_right", "attire", "challenge_stage", "challenge_description", "challenger_name", "challenger_description", "challenger_gender", "challenger_eye_contact", "additional_notes", "dts_due", "dts_start", "dts_end", "dts_tester_invoice_generated", "dts_tester_invoice_paid", "verifier_id", "verifier_notes", "pass", "retest", "void", "void_notes", "dts_created", "dts_updated", "dts_assigned", "dts_verified"];
|
|
|
+ protected static $fillable_fields = [
|
|
|
+ "project_id", "location_id", "tester_id",
|
|
|
+ "status", "status_tester_invoice",
|
|
|
+ "customer_fee", "test_fee", "test_time", "test_travel_cost", "test_travel_cost_description",
|
|
|
+ "shop_left", "shop_right", "attire",
|
|
|
+ "challenge_stage",
|
|
|
+ "challenge_description", "challenger_name", "challenger_description", "challenger_gender", "challenger_eye_contact",
|
|
|
+ "additional_notes",
|
|
|
+ "dts_due", "dts_start", "dts_end", "dts_tester_invoice_generated", "dts_tester_invoice_paid",
|
|
|
+ "verifier_id", "verifier_notes",
|
|
|
+ "pass", "retest", "void", "void_notes",
|
|
|
+ "dts_created", "dts_updated",
|
|
|
+ "dts_assigned", "dts_rejected", "dts_verified"
|
|
|
+ ];
|
|
|
|
|
|
public const TEST_FIELDS = ["shop_left", "shop_right", "attire", "challenge_stage", "challenge_description", "challenger_name", "challenger_description", "challenger_gender", "challenger_eye_contact", "additional_notes"];
|
|
|
|
|
|
@@ -416,6 +430,7 @@ class Test extends Model {
|
|
|
$this->tester_id = null;
|
|
|
$this->dts_due = null;
|
|
|
$this->dts_assigned = null;
|
|
|
+ $this->dts_rejected = Util::getDateTime();
|
|
|
$this->dts_updated = Util::getDateTime();
|
|
|
$this->commit();
|
|
|
|
|
|
@@ -596,6 +611,7 @@ class Test extends Model {
|
|
|
public function assignTester(User $tester): bool {
|
|
|
$this->tester_id = $tester->id;
|
|
|
$this->dts_assigned = Util::getDateTime();
|
|
|
+ $this->dts_rejected = null;
|
|
|
// TODO: Notify tester
|
|
|
|
|
|
return $this->commit();
|
|
|
@@ -631,6 +647,7 @@ class Test extends Model {
|
|
|
$this->tester_id = null;
|
|
|
$this->dts_due = null;
|
|
|
$this->dts_assigned = null;
|
|
|
+ $this->dts_rejected = null;
|
|
|
return $this->commit();
|
|
|
}
|
|
|
|
|
|
@@ -886,4 +903,12 @@ class Test extends Model {
|
|
|
return $this->getProject()->getTemplate()->getTesterInvoiceCosts($this->getValues(true));
|
|
|
}
|
|
|
|
|
|
+ public function getDateTimeRejected(): ?CarbonImmutable {
|
|
|
+ if(!$this->dts_rejected) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+
|
|
|
+ return CarbonImmutable::parse($this->dts_rejected, "UTC");
|
|
|
+ }
|
|
|
+
|
|
|
}
|