Skip to content
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

Open
wants to merge 24 commits into
base: master
Choose a base branch
from
Open

Feature/db structure #4

wants to merge 24 commits into from

Conversation

ugurdnlr
Copy link

changed ids from integer to uuid

LICENSE.txt Outdated
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) <Scott Laurent>
Copyright (c) <Neptune Software>

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
Comment on lines 10 to 15
## 2020-03-18
### Added
- Author names
### Changed
- Namespaces refactored
- ModelTraits folder's name to Traits

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

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
Comment on lines 8 to 9
"name": "Neptune Software",
"email": "info@neptunyazilim.com"

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"

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';

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()

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;

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

Comment on lines 27 to 34
static::creating(function ($model) {
/**
* @var \Illuminate\Database\Eloquent\Model $model
*/
if (!$model->getKey()) {
$model->{$model->getKeyName()} = Str::uuid()->toString();
}
});

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']);

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants