Commit cf1f9603 authored by beardedwarrior's avatar beardedwarrior

included states in to pulling mrs and front matter

parent ea25ce73
......@@ -42,12 +42,17 @@ class fetchMergeRequests extends Command
$projects = $connection->mergeRequests('all');
foreach ($projects as $project) {
$state = 'OPENED';
if (strpos($project->title, '[IDEA]') !== false) {
$state = 'IDEA';
}
$title = str_replace('[IDEA]','',$project->title);
// create requests that are still pending
$project = Project::firstOrNew([
'merge_request_id' => $project->id,
],[
'title' => $title,
'state' => $state,
'title' => trim($title),
'gitlab_state' => $project->state,
'gitlab_username' => $project->author->username,
'gitlab_url' => $project->web_url,
......@@ -55,4 +60,10 @@ class fetchMergeRequests extends Command
$project->save();
}
}
// fetch the idea
// check for merged merges.
// if proposal merged search for its md file
//issue payment_id and payment page
//
}
......@@ -37,7 +37,6 @@ class ProcessProposals extends Command
*/
public function handle()
{
$projects = Project::whereNull('filename');
$details = [];
$files = Storage::files('ffs-proposals');
foreach ($files as $file) {
......@@ -45,9 +44,12 @@ class ProcessProposals extends Command
$detail['name'] = $file;
$detail['values'] = $this->getAmountFromText($file);
$details[] = $detail['values']['title'];
$project = $projects->where('title', $detail['values']['title'])->first();
$project = Project::where('title', $detail['values']['title'])->first();
if ($project) {
$project->filename = $file;
if ($project->state === 'IDEA') {
$project->state = 'FUNDING-REQUIRED';
}
$project->target_amount = $detail['values']['amount'];
$project->save();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment