-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/db structure #4
base: master
Are you sure you want to change the base?
Conversation
…/accounting into feature/service-refactor
…/accounting into feature/service-refactor
…/accounting into feature/service-refactor
…/accounting into feature/service-refactor
LICENSE.txt
Outdated
@@ -1,6 +1,6 @@ | |||
The MIT License (MIT) | |||
|
|||
Copyright (c) <Scott Laurent> | |||
Copyright (c) <Neptune Software> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copyright (c) 2020 Neptune Software
CHANGELOG.md
Outdated
## 2020-03-18 | ||
### Added | ||
- Author names | ||
### Changed | ||
- Namespaces refactored | ||
- ModelTraits folder's name to Traits |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not necessary lines.
CHANGELOG.md
Outdated
### Added | ||
- Interfaces | ||
- Service layer | ||
- php.yml |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GitHub Actions for build status and auto unit testing.
composer.json
Outdated
"name": "Neptune Software", | ||
"email": "info@neptunyazilim.com" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
real authors are coders :)
@@ -7,9 +7,7 @@ | |||
convertNoticesToExceptions="true" | |||
convertWarningsToExceptions="true" | |||
processIsolation="false" | |||
stopOnFailure="false" | |||
syntaxCheck="false" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why we disabled syntaxCheck?
/** | ||
* @var string | ||
*/ | ||
protected $table = 'accounting_journals'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
table names could be configurable in another branch
/** | ||
* @throws DebitsAndCreditsDoNotEqual | ||
*/ | ||
private function verifyTransactionCreditsEqualDebits() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this method is not defined in the interface
@@ -76,7 +76,7 @@ public function testJournalObjectReferences() | |||
|
|||
$account = $this->createFakeAccount(); | |||
$account->initJournal(); | |||
$account_journal = Account::find(1)->journal; | |||
$account_journal = Account::all()->first()->journal; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just a note (no change required):
Account::inRandomOrder()->first
tests/Models/CompanyJournal.php
Outdated
static::creating(function ($model) { | ||
/** | ||
* @var \Illuminate\Database\Eloquent\Model $model | ||
*/ | ||
if (!$model->getKey()) { | ||
$model->{$model->getKeyName()} = Str::uuid()->toString(); | ||
} | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this could be a tiny trait
for all models. this code block repeats itself more than +3 times.
@@ -13,7 +13,7 @@ class CreateAccountingLedgersTable extends Migration | |||
public function up() | |||
{ | |||
Schema::create('accounting_ledgers', function (Blueprint $table) { | |||
$table->increments('id'); | |||
$table->uuid('id')->primary(); | |||
$table->string('name'); | |||
$table->enum('type', ['asset', 'liability', 'equity', 'income', 'expense']); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
enum is hard to maintain. keep the type control in the code. for example: policies or validation.
changed ids from integer to uuid