Skip to content

Commit

Permalink
XW-55 - Fix: update account categories (#86)
Browse files Browse the repository at this point in the history
* XW-55 - Fix: update categories for accounts and fix edit account option

* XW-55 - update backend validation for unique name

* XW-55 Fix: remove color field from add and edit account modal

* XW-55 - Fix: layout of accounts page
  • Loading branch information
faizahmed1234 authored Sep 3, 2024
1 parent 00bbe16 commit 45d6956
Show file tree
Hide file tree
Showing 6 changed files with 339 additions and 344 deletions.
4 changes: 2 additions & 2 deletions app/Http/Controllers/AccountController.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public function index()
public function store(Request $request)
{
$validatedData = $request->validate([
'name' => 'required|string|max:35',
'name' => 'required|string|max:35|unique:accounts,name',
'type' => 'required|in:' . implode(',', array_keys(config('custom.account_types'))),
'balance' => 'required|numeric|min:0',
'currency' => 'required|in:' . implode(',', array_keys(config('custom.currencies'))),
Expand Down Expand Up @@ -86,7 +86,7 @@ public function show(Account $account)
public function update(Request $request, $id)
{
$validatedData = $request->validate([
'name' => 'required|string|max:35',
'name' => 'required|string|max:35|unique:accounts,name,' . $id,
'type' => 'required|in:' . implode(',', array_keys(config('custom.account_types'))),
'balance' => 'required|numeric|min:0',
'currency' => 'required|in:' . implode(',', array_keys(config('custom.currencies'))),
Expand Down
20 changes: 17 additions & 3 deletions config/custom.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,23 @@

return [
'account_types' => [
1 => 'Cash',
2 => 'General',
3 => 'Current Account',
1 => [
'name' => 'Cash',
'icon' => 'fa-solid fa-coins',
],
2 => [
'name' => 'Credit Card',
'icon' => 'fa-solid fa-credit-card',
],
3 => [
'name' => 'Bank',
'icon' => 'fa-solid fa-landmark',
],
4 => [
'name' => 'Mobile Payment',
'icon' => 'fa-solid fa-mobile-screen-button',
],
// Add more types here as needed
],
'currencies' => [
'PKR' => 'PKR',
Expand Down
11 changes: 10 additions & 1 deletion public/assets/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,13 @@
cursor: pointer;
}

/* Transaction */
/* Transaction */


/* Accounts */

.account-item{
cursor: pointer;
}

/* Accounts */
Loading

0 comments on commit 45d6956

Please sign in to comment.