migrate to gtea from bistbucket
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Accounting\Http\Requests\Account;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class AccountStoreRequest extends FormRequest
|
||||
{
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'name' => 'required|string|max:255',
|
||||
'code' => ['nullable', 'string', 'max:50'],
|
||||
'type' => 'required|in:asset,liability,equity,income,expense',
|
||||
'opening_balance' => 'nullable|numeric|min:0',
|
||||
'current_balance' => 'nullable|numeric|min:0',
|
||||
'status' => 'nullable|in:0,1',
|
||||
];
|
||||
}
|
||||
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Accounting\Http\Requests\Account;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class AccountUpdateRequest extends FormRequest
|
||||
{
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'name' => 'required|string|max:255',
|
||||
'code' => ['nullable', 'string', 'max:50'],
|
||||
'type' => 'required|in:asset,liability,equity,income,expense',
|
||||
'opening_balance' => 'nullable|numeric|min:0',
|
||||
'current_balance' => 'nullable|numeric|min:0',
|
||||
'status' => 'nullable|in:0,1',
|
||||
];
|
||||
}
|
||||
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Accounting\Http\Requests\Deposit;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class DepositStoreRequest extends FormRequest
|
||||
{
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'fund_id' => 'required|exists:funds,id',
|
||||
'account_id' => 'nullable|exists:accounts,id',
|
||||
'amount' => 'required|numeric|min:0.01',
|
||||
'transaction_date' => 'required|date',
|
||||
'received_from' => 'nullable|string|max:255',
|
||||
'note' => 'nullable|string',
|
||||
'created_by' => 'nullable|exists:users,id',
|
||||
'status' => 'nullable|in:0,1',
|
||||
];
|
||||
}
|
||||
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Accounting\Http\Requests\Deposit;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class DepositUpdateRequest extends FormRequest
|
||||
{
|
||||
public function rules(): array
|
||||
{
|
||||
$depositId = $this->route('deposit');
|
||||
|
||||
return [
|
||||
'fund_id' => 'required|exists:funds,id',
|
||||
'account_id' => 'nullable|exists:accounts,id',
|
||||
'amount' => 'required|numeric|min:0.01',
|
||||
'transaction_date' => 'required|date',
|
||||
'received_from' => 'nullable|string|max:255',
|
||||
'note' => 'nullable|string',
|
||||
'created_by' => 'nullable|exists:users,id',
|
||||
'status' => 'nullable|in:0,1',
|
||||
];
|
||||
}
|
||||
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Accounting\Http\Requests\DepositCategory;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class DepositCategoryStoreRequest extends FormRequest
|
||||
{
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'name' => 'required|string|max:255',
|
||||
'status' => 'nullable|in:0,1',
|
||||
];
|
||||
}
|
||||
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Accounting\Http\Requests\DepositCategory;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class DepositCategoryUpdateRequest extends FormRequest
|
||||
{
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'name' => 'required|string|max:255',
|
||||
'status' => 'nullable|in:0,1',
|
||||
];
|
||||
}
|
||||
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Accounting\Http\Requests\Expense;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class ExpenseStoreRequest extends FormRequest
|
||||
{
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'account_id' => 'required|exists:accounts,id',
|
||||
'expense_category_id' => 'nullable|exists:expense_categories,id',
|
||||
'amount' => 'required|numeric|min:0.01',
|
||||
'transaction_date' => 'required|date',
|
||||
'details' => 'nullable|string',
|
||||
'created_by' => 'nullable|exists:users,id',
|
||||
'status' => 'nullable|in:0,1',
|
||||
];
|
||||
}
|
||||
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Accounting\Http\Requests\Expense;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class ExpenseUpdateRequest extends FormRequest
|
||||
{
|
||||
public function rules(): array
|
||||
{
|
||||
$expenseId = $this->route('expense');
|
||||
|
||||
return [
|
||||
'account_id' => 'required|exists:accounts,id',
|
||||
'expense_category_id' => 'nullable|exists:expense_categories,id',
|
||||
'amount' => 'required|numeric|min:0.01',
|
||||
'transaction_date' => 'required|date',
|
||||
'details' => 'nullable|string',
|
||||
'created_by' => 'nullable|exists:users,id',
|
||||
'status' => 'nullable|in:0,1',
|
||||
];
|
||||
}
|
||||
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Accounting\Http\Requests\ExpenseCategory;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class ExpenseCategoryStoreRequest extends FormRequest
|
||||
{
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'name' => 'required|string|max:255',
|
||||
'status' => 'nullable|in:0,1',
|
||||
];
|
||||
}
|
||||
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Accounting\Http\Requests\ExpenseCategory;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class ExpenseCategoryUpdateRequest extends FormRequest
|
||||
{
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'name' => 'required|string|max:255',
|
||||
'status' => 'nullable|in:0,1',
|
||||
];
|
||||
}
|
||||
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Accounting\Http\Requests\Fund;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class FundStoreRequest extends FormRequest
|
||||
{
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'name' => 'required|string|max:255',
|
||||
'code' => ['nullable', 'string', 'max:50'],
|
||||
'type' => 'required|in:asset,liability,equity,income,expense',
|
||||
'opening_balance' => 'nullable|numeric|min:0',
|
||||
'current_balance' => 'nullable|numeric|min:0',
|
||||
'is_default' => 'boolean',
|
||||
'status' => 'nullable|in:0,1',
|
||||
];
|
||||
}
|
||||
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Accounting\Http\Requests\Fund;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class FundUpdateRequest extends FormRequest
|
||||
{
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'name' => 'required|string|max:255',
|
||||
'code' => ['nullable', 'string', 'max:50'],
|
||||
'type' => 'required|in:asset,liability,equity,income,expense',
|
||||
'opening_balance' => 'nullable|numeric|min:0',
|
||||
'current_balance' => 'nullable|numeric|min:0',
|
||||
'is_default' => 'boolean',
|
||||
'status' => 'nullable|in:0,1',
|
||||
];
|
||||
}
|
||||
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Accounting\Http\Requests\FundTransfer;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class FundTransferStoreRequest extends FormRequest
|
||||
{
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'from_fund_id' => 'required|exists:funds,id',
|
||||
'to_fund_id' => 'required|exists:funds,id|different:from_fund_id',
|
||||
'amount' => 'required|numeric|min:0.01',
|
||||
'transfer_date' => 'required|date',
|
||||
'note' => 'nullable|string',
|
||||
'created_by' => 'nullable|exists:users,id',
|
||||
'status' => 'nullable|in:0,1',
|
||||
];
|
||||
}
|
||||
|
||||
public function messages(): array
|
||||
{
|
||||
return [
|
||||
'to_fund_id.different' => 'Destination fund must be different from source fund.',
|
||||
];
|
||||
}
|
||||
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Accounting\Http\Requests\FundTransfer;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class FundTransferUpdateRequest extends FormRequest
|
||||
{
|
||||
public function rules(): array
|
||||
{
|
||||
$transferId = $this->route('fund_transfer');
|
||||
|
||||
return [
|
||||
'from_fund_id' => 'required|exists:funds,id',
|
||||
'to_fund_id' => 'required|exists:funds,id|different:from_fund_id',
|
||||
'amount' => 'required|numeric|min:0.01',
|
||||
'transfer_date' => 'required|date',
|
||||
'note' => 'nullable|string',
|
||||
'created_by' => 'nullable|exists:users,id',
|
||||
'status' => 'nullable|in:0,1',
|
||||
];
|
||||
}
|
||||
|
||||
public function messages(): array
|
||||
{
|
||||
return [
|
||||
'to_fund_id.different' => 'Destination fund must be different from source fund.',
|
||||
];
|
||||
}
|
||||
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Accounting\Http\Requests\Tip;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class TipStoreRequest extends FormRequest
|
||||
{
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'waiter_id' => 'required|exists:users,id',
|
||||
'order_id' => 'nullable|exists:orders,id',
|
||||
'amount' => 'required|numeric|min:0.01',
|
||||
'collected_at' => 'nullable|date',
|
||||
'status' => 'nullable|in:0,1',
|
||||
];
|
||||
}
|
||||
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Accounting\Http\Requests\Tip;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class TipUpdateRequest extends FormRequest
|
||||
{
|
||||
public function rules(): array
|
||||
{
|
||||
$tipId = $this->route('tip');
|
||||
|
||||
return [
|
||||
'waiter_id' => 'required|exists:users,id',
|
||||
'order_id' => 'nullable|exists:orders,id',
|
||||
'amount' => 'required|numeric|min:0.01',
|
||||
'collected_at' => 'nullable|date',
|
||||
'status' => 'nullable|in:0,1',
|
||||
];
|
||||
}
|
||||
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Accounting\Http\Requests\TipDistribution;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class TipDistributionStoreRequest extends FormRequest
|
||||
{
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'waiter_id' => 'required|exists:users,id',
|
||||
'account_id' => 'required|exists:accounts,id',
|
||||
'amount' => 'required|numeric|min:0.01',
|
||||
'distributed_at' => 'nullable|date',
|
||||
'created_by' => 'nullable|exists:users,id',
|
||||
'status' => 'nullable|in:0,1',
|
||||
];
|
||||
}
|
||||
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Accounting\Http\Requests\TipDistribution;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class TipDistributionUpdateRequest extends FormRequest
|
||||
{
|
||||
public function rules(): array
|
||||
{
|
||||
$distributionId = $this->route('tip_distribution');
|
||||
|
||||
return [
|
||||
'waiter_id' => 'required|exists:users,id',
|
||||
'account_id' => 'required|exists:accounts,id',
|
||||
'amount' => 'required|numeric|min:0.01',
|
||||
'distributed_at' => 'nullable|date',
|
||||
'created_by' => 'nullable|exists:users,id',
|
||||
'status' => 'nullable|in:0,1',
|
||||
];
|
||||
}
|
||||
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user