Added billable flag to projects

This commit is contained in:
Constantin Graf
2024-06-04 14:35:02 +02:00
committed by Constantin Graf
parent 20f9b344f6
commit 86555664c5
10 changed files with 106 additions and 19 deletions

View File

@@ -41,6 +41,7 @@ class ClockifyProjectsImporter extends DefaultImporter
], [
'client_id' => $clientId,
'color' => $this->colorService->getRandomColor(),
'is_billable' => $record['Billability'] === 'Yes',
'billable_rate' => $billableRateKey !== null && $record[$billableRateKey] !== '' ? (int) (((float) $record[$billableRateKey]) * 100) : null,
]);
}

View File

@@ -96,6 +96,10 @@ abstract class DefaultImporter implements ImporterContract
'required',
'max:255',
],
'is_billable' => [
'required',
'boolean',
],
'billable_rate' => [
'nullable',
'integer',

View File

@@ -121,6 +121,7 @@ class TogglDataImporter extends DefaultImporter
], [
'client_id' => $clientId,
'color' => $project->color,
'is_billable' => $project->rate !== null,
'billable_rate' => $project->rate !== null ? (int) ($project->rate * 100) : null,
], (string) $project->id);