Skip to content

Commit

Permalink
Refactored Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
jongravois committed Dec 5, 2014
0 parents commit 2c3c8dd
Show file tree
Hide file tree
Showing 1,105 changed files with 218,364 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text=auto
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/bootstrap/compiled.php
/vendor
composer.phar
composer.lock
.env.*.php
.env.php
.DS_Store
Thumbs.db
5 changes: 5 additions & 0 deletions .idea/encodings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

40 changes: 40 additions & 0 deletions .idea/lenda.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions .idea/scopes/scope_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

801 changes: 801 additions & 0 deletions .idea/workspace.xml

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Contribution Guidelines

Please submit all issues and pull requests to the [laravel/framework](http://github.com/laravel/framework) repository!
65 changes: 65 additions & 0 deletions app/Acme/Seeder/BaseSeeder.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
<?php namespace Acme\Seeder;

use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB;

class BaseSeeder extends Seeder
{

/**
* DB table name
*
* @var string
*/
protected $table;

/**
* CSV filename
*
* @var string
*/
protected $filename;

/**
* Run DB seed
*/
public function run()
{
DB::table($this->table)->truncate();
$seedData = $this->seedFromCSV($this->filename, ',');
DB::table($this->table)->insert($seedData);
}

/**
* Collect data from a given CSV file and return as array
*
* @param $filename
* @param string $deliminator
* @return array|bool
*/
private function seedFromCSV($filename, $deliminator = ",")
{
if(!file_exists($filename) || !is_readable($filename))
{
return FALSE;
}

$header = NULL;
$data = array();

if(($handle = fopen($filename, 'r')) !== FALSE)
{
while(($row = fgetcsv($handle, 1000, $deliminator)) !== FALSE)
{
if(!$header) {
$header = $row;
} else {
$data[] = array_combine($header, $row);
}
}
fclose($handle);
}

return $data;
}
}
31 changes: 31 additions & 0 deletions app/Acme/Transformers/AdmingraderTransformer.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php namespace Acme\Transformers;

class AdmingraderTransformer extends Transformer{

public function transform($arr)
{
//return $arr;
return [
'id' => $arr['id'],
'grade' => $arr['grade'],
'debt2asset' => (double) $arr['debt2asset'],
'current_ratio' => (double) $arr['current_ratio'],
'working_capital' => (double) $arr['working_capital'],
'borrowing_capacity' => (double) $arr['borrowing_capacity'],
'years_farming' => (double) $arr['years_farming'],
'credit_score' => (double) $arr['credit_score'],
'cpa_financials' => (boolean) $arr['cpa_financials'],
'bankruptcy' => (boolean) $arr['bankruptcy'],
'judgement' => (boolean) $arr['judgement'],
'all_max_loan' => (double) $arr['all_max_loan'],
'ag_pro_max_loan' => (double) $arr['ag_pro_max_loan'],
'capital_bridge_max_loan' => (double)
$arr['capital_bridge_max_loan'],
'ag_vest_max_loan' => (double) $arr['ag_vest_max_loan'],
'ag_pro_max_rate' => (double) $arr['ag_pro_max_rate'],
'capital_bridge_max_rate' => (double)
$arr['capital_bridge_max_rate'],
'ag_vest_max_rate' => (double) $arr['ag_vest_max_rate']
];
}
}
21 changes: 21 additions & 0 deletions app/Acme/Transformers/AgencyTransformer.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php namespace Acme\Transformers;

class AgencyTransformer extends Transformer{

public function transform($arr)
{
//return $arr;
return [
'id' => $arr['id'],
'agency' => $arr['agency'],
'name' => $arr['name'],
'address' => $arr['address'],
'city' => $arr['city'],
'state_id' => $arr['state_id'],
'state' => $arr['state'],
'zip' => $arr['zip'],
'phone' => $arr['phone'],
'email' => $arr['email']
];
}
}
36 changes: 36 additions & 0 deletions app/Acme/Transformers/ApplicantTransformer.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?php namespace Acme\Transformers;

use Carbon\Carbon;

class ApplicantTransformer extends Transformer{

public function transform($arr)
{
$dobby = $arr['dob'];
//return $arr;
return [
'id' => $arr['id'],
'applicant' => $arr['applicant'],
'grade' => $arr['grade'],
'entity_id' => $arr['entity_id'],
'entity' => $arr['entitytype']['entitytype'],
'loc_id' => $arr['location']['id'],
'location' => $arr['location']['location'],
'loc_abr' => $arr['location']['loc_abr'],
'ssn' => $arr['ssn'],
'email' => $arr['email'],
'phone' => $arr['phone'],
'address' => $arr['address'],
'city' => $arr['city'],
'state_id' => $arr['state_id'],
'state' => $arr['state']['state'],
'state_abr' => $arr['state']['abr'],
'zip' => $arr['zip'],
'dob' => $dobby->format('m/d/Y'),
'spouse' => $arr['spouse'],
'spouse_ssn' => $arr['spouse_ssn'],
'spouse_phone' => $arr['spouse_phone'],
'spouse_email' => $arr['spouse_email']
];
}
}
18 changes: 18 additions & 0 deletions app/Acme/Transformers/CommentTransformer.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php namespace Acme\Transformers;

class CommentTransformer extends Transformer{

public function transform($arr)
{
//return $arr;
return [
'loan_id' => $arr['loan_id'],
'type' => $arr['type'],
'user_id' => $arr['user_id'],
'user' => $arr['user']['username'],
'dtCom' => $arr['created_at']->format('m/d/Y'),
'comment' => $arr['comment'],
'responses' => $arr['responses']
];
}
}
24 changes: 24 additions & 0 deletions app/Acme/Transformers/CommitteeTransformer.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php namespace Acme\Transformers;

class CommitteeTransformer extends Transformer{

public function transform($arr)
{
//return $arr;
return [
'id' => (integer) $arr['id'],
'loan_id' => (integer) $arr['loan_id'],
'user_id' => (integer) $arr['user_id'],
'username' => $arr['user']['username'],
'role_id' => (integer) $arr['role_id'],
'role' => $arr['role']['role'],
'vote_status_id' => (integer) $arr['vote_status_id'],
'vote_status' => $arr['vote_status']['status'],
'vote_id' => (integer) $arr['vote_id'],
'vote' => $arr['vote']['vote'],
'vote_request_date' => $arr['vote_request_date'],
'vote_received_date' => $arr['vote_received_date']
];
}

}
12 changes: 12 additions & 0 deletions app/Acme/Transformers/ConditionsTransformer.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php namespace Acme\Transformers;

class ConditionsTransformer extends Transformer{

public function transform($arr)
{
return [
'id' => $arr['id'],
'condition' => $arr['condition']
];
}
}
24 changes: 24 additions & 0 deletions app/Acme/Transformers/CorporationTransformer.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php namespace Acme\Transformers;

class CorporationTransformer extends Transformer{

public function transform($arr)
{
//return $arr;
return [
'id' => $arr['id'],
'corporation' => $arr['corporation'],
'ssn' => $arr['ssn'],
'address' => $arr['address'],
'city' => $arr['city'],
'state_id' => $arr['state_id'],
'zip' => $arr['zip'],
'email' => $arr['email'],
'phone' => $arr['phone'],
'description' => $arr['description'],
'president' => $arr['president'],
'vicepresident' => $arr['vicepresident'],
'secretarytreasurer' => $arr['secretarytreasurer']
];
}
}
Loading

0 comments on commit 2c3c8dd

Please sign in to comment.