瀏覽代碼

feat: plaid refresh transactions

3.x
wallo 1 年之前
父節點
當前提交
94bedf5c0b

+ 8
- 4
app/Jobs/ProcessTransactionImport.php 查看文件

72
             $allTransactions = [...$allTransactions, ...$transactionsResponse->transactions];
72
             $allTransactions = [...$allTransactions, ...$transactionsResponse->transactions];
73
         }
73
         }
74
 
74
 
75
-        if (count($allTransactions) > 0) {
76
-            $postedTransactions = array_filter($allTransactions, static fn ($transaction) => $transaction->pending === false);
75
+        $existingTransactionIds = $this->bankAccount->transactions->pluck('plaid_transaction_id')->toArray();
76
+        $newTransactions = array_filter($allTransactions, static function ($transaction) use ($existingTransactionIds) {
77
+            return ! in_array($transaction->transaction_id, $existingTransactionIds) && $transaction->pending === false;
78
+        });
79
+
80
+        if (count($newTransactions) > 0) {
77
             $currentBalance = $transactionsResponse->accounts[0]->balances->current;
81
             $currentBalance = $transactionsResponse->accounts[0]->balances->current;
78
 
82
 
79
-            $transactionService->createStartingBalanceIfNeeded($this->company, $this->account, $this->bankAccount, $postedTransactions, $currentBalance, $startDate);
80
-            $transactionService->storeTransactions($this->company, $this->bankAccount, $postedTransactions);
83
+            $transactionService->createStartingBalanceIfNeeded($this->company, $this->account, $this->bankAccount, $newTransactions, $currentBalance, $startDate);
84
+            $transactionService->storeTransactions($this->company, $this->bankAccount, $newTransactions);
81
 
85
 
82
             $this->connectedBankAccount->update([
86
             $this->connectedBankAccount->update([
83
                 'last_imported_at' => Carbon::now(),
87
                 'last_imported_at' => Carbon::now(),

+ 42
- 6
app/Livewire/Company/Service/ConnectedAccount/ListInstitutions.php 查看文件

103
                     ->required()
103
                     ->required()
104
                     ->placeholder('Select a start date for importing transactions.'),
104
                     ->placeholder('Select a start date for importing transactions.'),
105
             ])
105
             ])
106
-            ->action(function (array $arguments, array $data, ConnectedBankAccount $connectedBankAccount) {
106
+            ->action(function (array $data, ConnectedBankAccount $connectedBankAccount) {
107
                 $selectedBankAccountId = $data['bank_account_id'] ?? $connectedBankAccount->bank_account_id;
107
                 $selectedBankAccountId = $data['bank_account_id'] ?? $connectedBankAccount->bank_account_id;
108
                 $startDate = $data['start_date'];
108
                 $startDate = $data['start_date'];
109
                 $company = $this->user->currentCompany;
109
                 $company = $this->user->currentCompany;
150
 
150
 
151
                 if ($connectedBankAccount) {
151
                 if ($connectedBankAccount) {
152
                     $connectedBankAccount->update([
152
                     $connectedBankAccount->update([
153
-                        'import_transactions' => ! $connectedBankAccount->import_transactions,
153
+                        'import_transactions' => false,
154
                     ]);
154
                     ]);
155
                 }
155
                 }
156
 
156
 
158
             });
158
             });
159
     }
159
     }
160
 
160
 
161
+    public function refreshTransactions(): Action
162
+    {
163
+        return Action::make('refreshTransactions')
164
+            ->iconButton()
165
+            ->icon('heroicon-o-arrow-path')
166
+            ->color('primary')
167
+            ->record(fn (array $arguments) => Institution::find($arguments['institution']))
168
+            ->modalWidth(fn () => $this->modalWidth)
169
+            ->modalFooterActionsAlignment(fn () => $this->modalWidth === 'screen' ? Alignment::Center : Alignment::Start)
170
+            ->stickyModalHeader()
171
+            ->stickyModalFooter()
172
+            ->modalHeading('Refresh Transactions')
173
+            ->modalSubmitActionLabel('Refresh')
174
+            ->modalCancelActionLabel('Cancel')
175
+            ->form([
176
+                Placeholder::make('modalDetails')
177
+                    ->hiddenLabel()
178
+                    ->content(static fn (Institution $institution): View => view(
179
+                        'components.actions.refresh-transactions-modal',
180
+                        compact('institution')
181
+                    )),
182
+                Checkbox::make('confirm')
183
+                    ->label('Yes, I want to refresh transactions.')
184
+                    ->markAsRequired(false)
185
+                    ->required(),
186
+            ])
187
+            ->action(function (Institution $institution) {
188
+                $connectedBankAccounts = $institution->getEnabledConnectedBankAccounts();
189
+
190
+                foreach ($connectedBankAccounts as $connectedBankAccount) {
191
+                    $access_token = $connectedBankAccount->access_token;
192
+
193
+                    $this->plaidService->refreshTransactions($access_token);
194
+                }
195
+
196
+                unset($this->connectedInstitutions);
197
+            });
198
+    }
199
+
161
     public function deleteBankConnection(): Action
200
     public function deleteBankConnection(): Action
162
     {
201
     {
163
         return Action::make('deleteBankConnection')
202
         return Action::make('deleteBankConnection')
171
             ->stickyModalFooter()
210
             ->stickyModalFooter()
172
             ->record(fn (array $arguments) => Institution::find($arguments['institution']))
211
             ->record(fn (array $arguments) => Institution::find($arguments['institution']))
173
             ->form([
212
             ->form([
174
-                Placeholder::make('accounts')
213
+                Placeholder::make('modalDetails')
175
                     ->hiddenLabel()
214
                     ->hiddenLabel()
176
                     ->content(static fn (Institution $institution): View => view(
215
                     ->content(static fn (Institution $institution): View => view(
177
                         'components.actions.delete-bank-connection-modal',
216
                         'components.actions.delete-bank-connection-modal',
178
                         compact('institution')
217
                         compact('institution')
179
                     )),
218
                     )),
180
-                Placeholder::make('info')
181
-                    ->hiddenLabel()
182
-                    ->content('Deleting this bank connection will stop the import of transactions for all accounts associated with this bank. Existing transactions will remain unchanged.'),
183
                 Checkbox::make('confirm')
219
                 Checkbox::make('confirm')
184
                     ->label('Yes, I want to delete this bank connection.')
220
                     ->label('Yes, I want to delete this bank connection.')
185
                     ->markAsRequired(false)
221
                     ->markAsRequired(false)

+ 6
- 0
app/Models/Banking/Institution.php 查看文件

3
 namespace App\Models\Banking;
3
 namespace App\Models\Banking;
4
 
4
 
5
 use Illuminate\Database\Eloquent\Casts\Attribute;
5
 use Illuminate\Database\Eloquent\Casts\Attribute;
6
+use Illuminate\Database\Eloquent\Collection;
6
 use Illuminate\Database\Eloquent\Factories\HasFactory;
7
 use Illuminate\Database\Eloquent\Factories\HasFactory;
7
 use Illuminate\Database\Eloquent\Model;
8
 use Illuminate\Database\Eloquent\Model;
8
 use Illuminate\Database\Eloquent\Relations\HasMany;
9
 use Illuminate\Database\Eloquent\Relations\HasMany;
35
         return $this->hasMany(BankAccount::class, 'institution_id');
36
         return $this->hasMany(BankAccount::class, 'institution_id');
36
     }
37
     }
37
 
38
 
39
+    public function getEnabledConnectedBankAccounts(): Collection
40
+    {
41
+        return $this->connectedBankAccounts()->where('import_transactions', true)->get();
42
+    }
43
+
38
     public function connectedBankAccounts(): HasMany
44
     public function connectedBankAccounts(): HasMany
39
     {
45
     {
40
         return $this->hasMany(ConnectedBankAccount::class, 'institution_id');
46
         return $this->hasMany(ConnectedBankAccount::class, 'institution_id');

+ 7
- 0
app/Services/PlaidService.php 查看文件

258
 
258
 
259
         return $this->sendRequest('sandbox/item/fire_webhook', $data);
259
         return $this->sendRequest('sandbox/item/fire_webhook', $data);
260
     }
260
     }
261
+
262
+    public function refreshTransactions(string $access_token): object
263
+    {
264
+        $data = compact('access_token');
265
+
266
+        return $this->sendRequest('transactions/refresh', $data);
267
+    }
261
 }
268
 }

+ 12
- 12
composer.lock 查看文件

1790
         },
1790
         },
1791
         {
1791
         {
1792
             "name": "dompdf/dompdf",
1792
             "name": "dompdf/dompdf",
1793
-            "version": "v2.0.5",
1793
+            "version": "v2.0.7",
1794
             "source": {
1794
             "source": {
1795
                 "type": "git",
1795
                 "type": "git",
1796
                 "url": "https://github.com/dompdf/dompdf.git",
1796
                 "url": "https://github.com/dompdf/dompdf.git",
1797
-                "reference": "502e966a0da0446dd6712ee4f678dc4736181fcb"
1797
+                "reference": "ab0123052b42ad0867348f25df8c228f1ece8f14"
1798
             },
1798
             },
1799
             "dist": {
1799
             "dist": {
1800
                 "type": "zip",
1800
                 "type": "zip",
1801
-                "url": "https://api.github.com/repos/dompdf/dompdf/zipball/502e966a0da0446dd6712ee4f678dc4736181fcb",
1802
-                "reference": "502e966a0da0446dd6712ee4f678dc4736181fcb",
1801
+                "url": "https://api.github.com/repos/dompdf/dompdf/zipball/ab0123052b42ad0867348f25df8c228f1ece8f14",
1802
+                "reference": "ab0123052b42ad0867348f25df8c228f1ece8f14",
1803
                 "shasum": ""
1803
                 "shasum": ""
1804
             },
1804
             },
1805
             "require": {
1805
             "require": {
1846
             "homepage": "https://github.com/dompdf/dompdf",
1846
             "homepage": "https://github.com/dompdf/dompdf",
1847
             "support": {
1847
             "support": {
1848
                 "issues": "https://github.com/dompdf/dompdf/issues",
1848
                 "issues": "https://github.com/dompdf/dompdf/issues",
1849
-                "source": "https://github.com/dompdf/dompdf/tree/v2.0.5"
1849
+                "source": "https://github.com/dompdf/dompdf/tree/v2.0.7"
1850
             },
1850
             },
1851
-            "time": "2024-04-11T11:59:08+00:00"
1851
+            "time": "2024-04-15T12:40:33+00:00"
1852
         },
1852
         },
1853
         {
1853
         {
1854
             "name": "dragonmantank/cron-expression",
1854
             "name": "dragonmantank/cron-expression",
5317
         },
5317
         },
5318
         {
5318
         {
5319
             "name": "phenx/php-svg-lib",
5319
             "name": "phenx/php-svg-lib",
5320
-            "version": "0.5.3",
5320
+            "version": "0.5.4",
5321
             "source": {
5321
             "source": {
5322
                 "type": "git",
5322
                 "type": "git",
5323
                 "url": "https://github.com/dompdf/php-svg-lib.git",
5323
                 "url": "https://github.com/dompdf/php-svg-lib.git",
5324
-                "reference": "0e46722c154726a5f9ac218197ccc28adba16fcf"
5324
+                "reference": "46b25da81613a9cf43c83b2a8c2c1bdab27df691"
5325
             },
5325
             },
5326
             "dist": {
5326
             "dist": {
5327
                 "type": "zip",
5327
                 "type": "zip",
5328
-                "url": "https://api.github.com/repos/dompdf/php-svg-lib/zipball/0e46722c154726a5f9ac218197ccc28adba16fcf",
5329
-                "reference": "0e46722c154726a5f9ac218197ccc28adba16fcf",
5328
+                "url": "https://api.github.com/repos/dompdf/php-svg-lib/zipball/46b25da81613a9cf43c83b2a8c2c1bdab27df691",
5329
+                "reference": "46b25da81613a9cf43c83b2a8c2c1bdab27df691",
5330
                 "shasum": ""
5330
                 "shasum": ""
5331
             },
5331
             },
5332
             "require": {
5332
             "require": {
5357
             "homepage": "https://github.com/PhenX/php-svg-lib",
5357
             "homepage": "https://github.com/PhenX/php-svg-lib",
5358
             "support": {
5358
             "support": {
5359
                 "issues": "https://github.com/dompdf/php-svg-lib/issues",
5359
                 "issues": "https://github.com/dompdf/php-svg-lib/issues",
5360
-                "source": "https://github.com/dompdf/php-svg-lib/tree/0.5.3"
5360
+                "source": "https://github.com/dompdf/php-svg-lib/tree/0.5.4"
5361
             },
5361
             },
5362
-            "time": "2024-02-23T20:39:24+00:00"
5362
+            "time": "2024-04-08T12:52:34+00:00"
5363
         },
5363
         },
5364
         {
5364
         {
5365
             "name": "phpoption/phpoption",
5365
             "name": "phpoption/phpoption",

+ 80
- 66
package-lock.json 查看文件

507
             }
507
             }
508
         },
508
         },
509
         "node_modules/@rollup/rollup-android-arm-eabi": {
509
         "node_modules/@rollup/rollup-android-arm-eabi": {
510
-            "version": "4.14.2",
511
-            "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.14.2.tgz",
512
-            "integrity": "sha512-ahxSgCkAEk+P/AVO0vYr7DxOD3CwAQrT0Go9BJyGQ9Ef0QxVOfjDZMiF4Y2s3mLyPrjonchIMH/tbWHucJMykQ==",
510
+            "version": "4.14.3",
511
+            "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.14.3.tgz",
512
+            "integrity": "sha512-X9alQ3XM6I9IlSlmC8ddAvMSyG1WuHk5oUnXGw+yUBs3BFoTizmG1La/Gr8fVJvDWAq+zlYTZ9DBgrlKRVY06g==",
513
             "cpu": [
513
             "cpu": [
514
                 "arm"
514
                 "arm"
515
             ],
515
             ],
520
             ]
520
             ]
521
         },
521
         },
522
         "node_modules/@rollup/rollup-android-arm64": {
522
         "node_modules/@rollup/rollup-android-arm64": {
523
-            "version": "4.14.2",
524
-            "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.14.2.tgz",
525
-            "integrity": "sha512-lAarIdxZWbFSHFSDao9+I/F5jDaKyCqAPMq5HqnfpBw8dKDiCaaqM0lq5h1pQTLeIqueeay4PieGR5jGZMWprw==",
523
+            "version": "4.14.3",
524
+            "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.14.3.tgz",
525
+            "integrity": "sha512-eQK5JIi+POhFpzk+LnjKIy4Ks+pwJ+NXmPxOCSvOKSNRPONzKuUvWE+P9JxGZVxrtzm6BAYMaL50FFuPe0oWMQ==",
526
             "cpu": [
526
             "cpu": [
527
                 "arm64"
527
                 "arm64"
528
             ],
528
             ],
533
             ]
533
             ]
534
         },
534
         },
535
         "node_modules/@rollup/rollup-darwin-arm64": {
535
         "node_modules/@rollup/rollup-darwin-arm64": {
536
-            "version": "4.14.2",
537
-            "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.14.2.tgz",
538
-            "integrity": "sha512-SWsr8zEUk82KSqquIMgZEg2GE5mCSfr9sE/thDROkX6pb3QQWPp8Vw8zOq2GyxZ2t0XoSIUlvHDkrf5Gmf7x3Q==",
536
+            "version": "4.14.3",
537
+            "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.14.3.tgz",
538
+            "integrity": "sha512-Od4vE6f6CTT53yM1jgcLqNfItTsLt5zE46fdPaEmeFHvPs5SjZYlLpHrSiHEKR1+HdRfxuzXHjDOIxQyC3ptBA==",
539
             "cpu": [
539
             "cpu": [
540
                 "arm64"
540
                 "arm64"
541
             ],
541
             ],
546
             ]
546
             ]
547
         },
547
         },
548
         "node_modules/@rollup/rollup-darwin-x64": {
548
         "node_modules/@rollup/rollup-darwin-x64": {
549
-            "version": "4.14.2",
550
-            "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.14.2.tgz",
551
-            "integrity": "sha512-o/HAIrQq0jIxJAhgtIvV5FWviYK4WB0WwV91SLUnsliw1lSAoLsmgEEgRWzDguAFeUEUUoIWXiJrPqU7vGiVkA==",
549
+            "version": "4.14.3",
550
+            "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.14.3.tgz",
551
+            "integrity": "sha512-0IMAO21axJeNIrvS9lSe/PGthc8ZUS+zC53O0VhF5gMxfmcKAP4ESkKOCwEi6u2asUrt4mQv2rjY8QseIEb1aw==",
552
             "cpu": [
552
             "cpu": [
553
                 "x64"
553
                 "x64"
554
             ],
554
             ],
559
             ]
559
             ]
560
         },
560
         },
561
         "node_modules/@rollup/rollup-linux-arm-gnueabihf": {
561
         "node_modules/@rollup/rollup-linux-arm-gnueabihf": {
562
-            "version": "4.14.2",
563
-            "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.14.2.tgz",
564
-            "integrity": "sha512-nwlJ65UY9eGq91cBi6VyDfArUJSKOYt5dJQBq8xyLhvS23qO+4Nr/RreibFHjP6t+5ap2ohZrUJcHv5zk5ju/g==",
562
+            "version": "4.14.3",
563
+            "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.14.3.tgz",
564
+            "integrity": "sha512-ge2DC7tHRHa3caVEoSbPRJpq7azhG+xYsd6u2MEnJ6XzPSzQsTKyXvh6iWjXRf7Rt9ykIUWHtl0Uz3T6yXPpKw==",
565
+            "cpu": [
566
+                "arm"
567
+            ],
568
+            "dev": true,
569
+            "optional": true,
570
+            "os": [
571
+                "linux"
572
+            ]
573
+        },
574
+        "node_modules/@rollup/rollup-linux-arm-musleabihf": {
575
+            "version": "4.14.3",
576
+            "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.14.3.tgz",
577
+            "integrity": "sha512-ljcuiDI4V3ySuc7eSk4lQ9wU8J8r8KrOUvB2U+TtK0TiW6OFDmJ+DdIjjwZHIw9CNxzbmXY39wwpzYuFDwNXuw==",
565
             "cpu": [
578
             "cpu": [
566
                 "arm"
579
                 "arm"
567
             ],
580
             ],
572
             ]
585
             ]
573
         },
586
         },
574
         "node_modules/@rollup/rollup-linux-arm64-gnu": {
587
         "node_modules/@rollup/rollup-linux-arm64-gnu": {
575
-            "version": "4.14.2",
576
-            "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.14.2.tgz",
577
-            "integrity": "sha512-Pg5TxxO2IVlMj79+c/9G0LREC9SY3HM+pfAwX7zj5/cAuwrbfj2Wv9JbMHIdPCfQpYsI4g9mE+2Bw/3aeSs2rQ==",
588
+            "version": "4.14.3",
589
+            "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.14.3.tgz",
590
+            "integrity": "sha512-Eci2us9VTHm1eSyn5/eEpaC7eP/mp5n46gTRB3Aar3BgSvDQGJZuicyq6TsH4HngNBgVqC5sDYxOzTExSU+NjA==",
578
             "cpu": [
591
             "cpu": [
579
                 "arm64"
592
                 "arm64"
580
             ],
593
             ],
585
             ]
598
             ]
586
         },
599
         },
587
         "node_modules/@rollup/rollup-linux-arm64-musl": {
600
         "node_modules/@rollup/rollup-linux-arm64-musl": {
588
-            "version": "4.14.2",
589
-            "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.14.2.tgz",
590
-            "integrity": "sha512-cAOTjGNm84gc6tS02D1EXtG7tDRsVSDTBVXOLbj31DkwfZwgTPYZ6aafSU7rD/4R2a34JOwlF9fQayuTSkoclA==",
601
+            "version": "4.14.3",
602
+            "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.14.3.tgz",
603
+            "integrity": "sha512-UrBoMLCq4E92/LCqlh+blpqMz5h1tJttPIniwUgOFJyjWI1qrtrDhhpHPuFxULlUmjFHfloWdixtDhSxJt5iKw==",
591
             "cpu": [
604
             "cpu": [
592
                 "arm64"
605
                 "arm64"
593
             ],
606
             ],
598
             ]
611
             ]
599
         },
612
         },
600
         "node_modules/@rollup/rollup-linux-powerpc64le-gnu": {
613
         "node_modules/@rollup/rollup-linux-powerpc64le-gnu": {
601
-            "version": "4.14.2",
602
-            "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.14.2.tgz",
603
-            "integrity": "sha512-4RyT6v1kXb7C0fn6zV33rvaX05P0zHoNzaXI/5oFHklfKm602j+N4mn2YvoezQViRLPnxP8M1NaY4s/5kXO5cw==",
614
+            "version": "4.14.3",
615
+            "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.14.3.tgz",
616
+            "integrity": "sha512-5aRjvsS8q1nWN8AoRfrq5+9IflC3P1leMoy4r2WjXyFqf3qcqsxRCfxtZIV58tCxd+Yv7WELPcO9mY9aeQyAmw==",
604
             "cpu": [
617
             "cpu": [
605
                 "ppc64"
618
                 "ppc64"
606
             ],
619
             ],
611
             ]
624
             ]
612
         },
625
         },
613
         "node_modules/@rollup/rollup-linux-riscv64-gnu": {
626
         "node_modules/@rollup/rollup-linux-riscv64-gnu": {
614
-            "version": "4.14.2",
615
-            "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.14.2.tgz",
616
-            "integrity": "sha512-KNUH6jC/vRGAKSorySTyc/yRYlCwN/5pnMjXylfBniwtJx5O7X17KG/0efj8XM3TZU7raYRXJFFReOzNmL1n1w==",
627
+            "version": "4.14.3",
628
+            "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.14.3.tgz",
629
+            "integrity": "sha512-sk/Qh1j2/RJSX7FhEpJn8n0ndxy/uf0kI/9Zc4b1ELhqULVdTfN6HL31CDaTChiBAOgLcsJ1sgVZjWv8XNEsAQ==",
617
             "cpu": [
630
             "cpu": [
618
                 "riscv64"
631
                 "riscv64"
619
             ],
632
             ],
624
             ]
637
             ]
625
         },
638
         },
626
         "node_modules/@rollup/rollup-linux-s390x-gnu": {
639
         "node_modules/@rollup/rollup-linux-s390x-gnu": {
627
-            "version": "4.14.2",
628
-            "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.14.2.tgz",
629
-            "integrity": "sha512-xPV4y73IBEXToNPa3h5lbgXOi/v0NcvKxU0xejiFw6DtIYQqOTMhZ2DN18/HrrP0PmiL3rGtRG9gz1QE8vFKXQ==",
640
+            "version": "4.14.3",
641
+            "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.14.3.tgz",
642
+            "integrity": "sha512-jOO/PEaDitOmY9TgkxF/TQIjXySQe5KVYB57H/8LRP/ux0ZoO8cSHCX17asMSv3ruwslXW/TLBcxyaUzGRHcqg==",
630
             "cpu": [
643
             "cpu": [
631
                 "s390x"
644
                 "s390x"
632
             ],
645
             ],
637
             ]
650
             ]
638
         },
651
         },
639
         "node_modules/@rollup/rollup-linux-x64-gnu": {
652
         "node_modules/@rollup/rollup-linux-x64-gnu": {
640
-            "version": "4.14.2",
641
-            "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.14.2.tgz",
642
-            "integrity": "sha512-QBhtr07iFGmF9egrPOWyO5wciwgtzKkYPNLVCFZTmr4TWmY0oY2Dm/bmhHjKRwZoGiaKdNcKhFtUMBKvlchH+Q==",
653
+            "version": "4.14.3",
654
+            "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.14.3.tgz",
655
+            "integrity": "sha512-8ybV4Xjy59xLMyWo3GCfEGqtKV5M5gCSrZlxkPGvEPCGDLNla7v48S662HSGwRd6/2cSneMQWiv+QzcttLrrOA==",
643
             "cpu": [
656
             "cpu": [
644
                 "x64"
657
                 "x64"
645
             ],
658
             ],
650
             ]
663
             ]
651
         },
664
         },
652
         "node_modules/@rollup/rollup-linux-x64-musl": {
665
         "node_modules/@rollup/rollup-linux-x64-musl": {
653
-            "version": "4.14.2",
654
-            "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.14.2.tgz",
655
-            "integrity": "sha512-8zfsQRQGH23O6qazZSFY5jP5gt4cFvRuKTpuBsC1ZnSWxV8ZKQpPqOZIUtdfMOugCcBvFGRa1pDC/tkf19EgBw==",
666
+            "version": "4.14.3",
667
+            "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.14.3.tgz",
668
+            "integrity": "sha512-s+xf1I46trOY10OqAtZ5Rm6lzHre/UiLA1J2uOhCFXWkbZrJRkYBPO6FhvGfHmdtQ3Bx793MNa7LvoWFAm93bg==",
656
             "cpu": [
669
             "cpu": [
657
                 "x64"
670
                 "x64"
658
             ],
671
             ],
663
             ]
676
             ]
664
         },
677
         },
665
         "node_modules/@rollup/rollup-win32-arm64-msvc": {
678
         "node_modules/@rollup/rollup-win32-arm64-msvc": {
666
-            "version": "4.14.2",
667
-            "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.14.2.tgz",
668
-            "integrity": "sha512-H4s8UjgkPnlChl6JF5empNvFHp77Jx+Wfy2EtmYPe9G22XV+PMuCinZVHurNe8ggtwoaohxARJZbaH/3xjB/FA==",
679
+            "version": "4.14.3",
680
+            "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.14.3.tgz",
681
+            "integrity": "sha512-+4h2WrGOYsOumDQ5S2sYNyhVfrue+9tc9XcLWLh+Kw3UOxAvrfOrSMFon60KspcDdytkNDh7K2Vs6eMaYImAZg==",
669
             "cpu": [
682
             "cpu": [
670
                 "arm64"
683
                 "arm64"
671
             ],
684
             ],
676
             ]
689
             ]
677
         },
690
         },
678
         "node_modules/@rollup/rollup-win32-ia32-msvc": {
691
         "node_modules/@rollup/rollup-win32-ia32-msvc": {
679
-            "version": "4.14.2",
680
-            "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.14.2.tgz",
681
-            "integrity": "sha512-djqpAjm/i8erWYF0K6UY4kRO3X5+T4TypIqw60Q8MTqSBaQNpNXDhxdjpZ3ikgb+wn99svA7jxcXpiyg9MUsdw==",
692
+            "version": "4.14.3",
693
+            "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.14.3.tgz",
694
+            "integrity": "sha512-T1l7y/bCeL/kUwh9OD4PQT4aM7Bq43vX05htPJJ46RTI4r5KNt6qJRzAfNfM+OYMNEVBWQzR2Gyk+FXLZfogGw==",
682
             "cpu": [
695
             "cpu": [
683
                 "ia32"
696
                 "ia32"
684
             ],
697
             ],
689
             ]
702
             ]
690
         },
703
         },
691
         "node_modules/@rollup/rollup-win32-x64-msvc": {
704
         "node_modules/@rollup/rollup-win32-x64-msvc": {
692
-            "version": "4.14.2",
693
-            "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.14.2.tgz",
694
-            "integrity": "sha512-teAqzLT0yTYZa8ZP7zhFKEx4cotS8Tkk5XiqNMJhD4CpaWB1BHARE4Qy+RzwnXvSAYv+Q3jAqCVBS+PS+Yee8Q==",
705
+            "version": "4.14.3",
706
+            "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.14.3.tgz",
707
+            "integrity": "sha512-/BypzV0H1y1HzgYpxqRaXGBRqfodgoBBCcsrujT6QRcakDQdfU+Lq9PENPh5jB4I44YWq+0C2eHsHya+nZY1sA==",
695
             "cpu": [
708
             "cpu": [
696
                 "x64"
709
                 "x64"
697
             ],
710
             ],
918
             }
931
             }
919
         },
932
         },
920
         "node_modules/caniuse-lite": {
933
         "node_modules/caniuse-lite": {
921
-            "version": "1.0.30001609",
922
-            "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001609.tgz",
923
-            "integrity": "sha512-JFPQs34lHKx1B5t1EpQpWH4c+29zIyn/haGsbpfq3suuV9v56enjFt23zqijxGTMwy1p/4H2tjnQMY+p1WoAyA==",
934
+            "version": "1.0.30001610",
935
+            "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001610.tgz",
936
+            "integrity": "sha512-QFutAY4NgaelojVMjY63o6XlZyORPaLfyMnsl3HgnWdJUcX6K0oaJymHjH8PT5Gk7sTm8rvC/c5COUQKXqmOMA==",
924
             "dev": true,
937
             "dev": true,
925
             "funding": [
938
             "funding": [
926
                 {
939
                 {
1997
             }
2010
             }
1998
         },
2011
         },
1999
         "node_modules/rollup": {
2012
         "node_modules/rollup": {
2000
-            "version": "4.14.2",
2001
-            "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.14.2.tgz",
2002
-            "integrity": "sha512-WkeoTWvuBoFjFAhsEOHKRoZ3r9GfTyhh7Vff1zwebEFLEFjT1lG3784xEgKiTa7E+e70vsC81roVL2MP4tgEEQ==",
2013
+            "version": "4.14.3",
2014
+            "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.14.3.tgz",
2015
+            "integrity": "sha512-ag5tTQKYsj1bhrFC9+OEWqb5O6VYgtQDO9hPDBMmIbePwhfSr+ExlcU741t8Dhw5DkPCQf6noz0jb36D6W9/hw==",
2003
             "dev": true,
2016
             "dev": true,
2004
             "dependencies": {
2017
             "dependencies": {
2005
                 "@types/estree": "1.0.5"
2018
                 "@types/estree": "1.0.5"
2012
                 "npm": ">=8.0.0"
2025
                 "npm": ">=8.0.0"
2013
             },
2026
             },
2014
             "optionalDependencies": {
2027
             "optionalDependencies": {
2015
-                "@rollup/rollup-android-arm-eabi": "4.14.2",
2016
-                "@rollup/rollup-android-arm64": "4.14.2",
2017
-                "@rollup/rollup-darwin-arm64": "4.14.2",
2018
-                "@rollup/rollup-darwin-x64": "4.14.2",
2019
-                "@rollup/rollup-linux-arm-gnueabihf": "4.14.2",
2020
-                "@rollup/rollup-linux-arm64-gnu": "4.14.2",
2021
-                "@rollup/rollup-linux-arm64-musl": "4.14.2",
2022
-                "@rollup/rollup-linux-powerpc64le-gnu": "4.14.2",
2023
-                "@rollup/rollup-linux-riscv64-gnu": "4.14.2",
2024
-                "@rollup/rollup-linux-s390x-gnu": "4.14.2",
2025
-                "@rollup/rollup-linux-x64-gnu": "4.14.2",
2026
-                "@rollup/rollup-linux-x64-musl": "4.14.2",
2027
-                "@rollup/rollup-win32-arm64-msvc": "4.14.2",
2028
-                "@rollup/rollup-win32-ia32-msvc": "4.14.2",
2029
-                "@rollup/rollup-win32-x64-msvc": "4.14.2",
2028
+                "@rollup/rollup-android-arm-eabi": "4.14.3",
2029
+                "@rollup/rollup-android-arm64": "4.14.3",
2030
+                "@rollup/rollup-darwin-arm64": "4.14.3",
2031
+                "@rollup/rollup-darwin-x64": "4.14.3",
2032
+                "@rollup/rollup-linux-arm-gnueabihf": "4.14.3",
2033
+                "@rollup/rollup-linux-arm-musleabihf": "4.14.3",
2034
+                "@rollup/rollup-linux-arm64-gnu": "4.14.3",
2035
+                "@rollup/rollup-linux-arm64-musl": "4.14.3",
2036
+                "@rollup/rollup-linux-powerpc64le-gnu": "4.14.3",
2037
+                "@rollup/rollup-linux-riscv64-gnu": "4.14.3",
2038
+                "@rollup/rollup-linux-s390x-gnu": "4.14.3",
2039
+                "@rollup/rollup-linux-x64-gnu": "4.14.3",
2040
+                "@rollup/rollup-linux-x64-musl": "4.14.3",
2041
+                "@rollup/rollup-win32-arm64-msvc": "4.14.3",
2042
+                "@rollup/rollup-win32-ia32-msvc": "4.14.3",
2043
+                "@rollup/rollup-win32-x64-msvc": "4.14.3",
2030
                 "fsevents": "~2.3.2"
2044
                 "fsevents": "~2.3.2"
2031
             }
2045
             }
2032
         },
2046
         },

+ 0
- 4
resources/css/filament/company/theme.css 查看文件

123
     padding-right: 3rem;
123
     padding-right: 3rem;
124
 }
124
 }
125
 
125
 
126
-.connected-account-header .fi-icon-btn.fi-ac-icon-btn-action {
127
-    @apply text-primary-500 hover:text-danger-600 focus-visible:text-danger-600 focus-visible:ring-danger-500 dark:text-primary-400 dark:hover:text-danger-300 dark:focus-visible:text-danger-300 dark:focus-visible:ring-danger-500;
128
-}
129
-
130
 .fi-ta-empty-state-icon-ctn {
126
 .fi-ta-empty-state-icon-ctn {
131
     @apply bg-platinum;
127
     @apply bg-platinum;
132
 }
128
 }

+ 2
- 1
resources/views/components/actions/delete-bank-connection-modal.blade.php 查看文件

1
 <span>Are you sure you want to delete your {{ $institution->name }} connection? Deleting this bank connection will remove the following connected accounts:</span>
1
 <span>Are you sure you want to delete your {{ $institution->name }} connection? Deleting this bank connection will remove the following connected accounts:</span>
2
-<ul class="list-disc list-inside p-2">
2
+<ul class="list-disc list-inside p-4">
3
     @foreach($institution->connectedBankAccounts as $connectedBankAccount)
3
     @foreach($institution->connectedBankAccounts as $connectedBankAccount)
4
         <li>{{ $connectedBankAccount->name }}</li>
4
         <li>{{ $connectedBankAccount->name }}</li>
5
     @endforeach
5
     @endforeach
6
 </ul>
6
 </ul>
7
+<span>Deleting this bank connection will stop the import of transactions for all accounts associated with this bank. Existing transactions will remain unchanged.</span>

+ 8
- 0
resources/views/components/actions/refresh-transactions-modal.blade.php 查看文件

1
+<span>Are you sure you want to refresh transactions for the following connected accounts at {{ $institution->name }}?</span>
2
+<ul class="list-disc list-inside p-4">
3
+    @foreach($institution->getEnabledConnectedBankAccounts() as $connectedBankAccount)
4
+        <li>{{ $connectedBankAccount->name }}</li>
5
+    @endforeach
6
+</ul>
7
+<span>Refreshing transactions will update all listed accounts with the latest transactions from the bank. This may take a few moments.</span>
8
+

+ 13
- 4
resources/views/livewire/company/service/connected-account/list-institutions.blade.php 查看文件

26
                         @endif
26
                         @endif
27
                     </div>
27
                     </div>
28
 
28
 
29
+                    {{-- Refresh Transactions --}}
30
+                    @if($institution->getEnabledConnectedBankAccounts()->isNotEmpty())
31
+                        {{ ($this->refreshTransactions)(['institution' => $institution->id]) }}
32
+                    @endif
33
+
34
+                    {{-- Delete Institution --}}
29
                     {{ ($this->deleteBankConnection)(['institution' => $institution->id]) }}
35
                     {{ ($this->deleteBankConnection)(['institution' => $institution->id]) }}
30
                 </header>
36
                 </header>
31
 
37
 
95
     {{-- Initialize Plaid Link --}}
101
     {{-- Initialize Plaid Link --}}
96
     @script
102
     @script
97
     <script>
103
     <script>
104
+        const mobileSize = window.matchMedia("(max-width: 480px)");
105
+
98
         let data = Alpine.reactive({ windowWidth: 'max-w-2xl' });
106
         let data = Alpine.reactive({ windowWidth: 'max-w-2xl' });
99
 
107
 
100
-        Alpine.effect(() => {
101
-            $wire.$set('modalWidth', data.windowWidth);
108
+        // Add a media query change listener
109
+        mobileSize.addEventListener('change', (e) => {
110
+            data.windowWidth = e.matches ? 'screen' : 'max-w-2xl';
102
         });
111
         });
103
 
112
 
104
-        window.addEventListener('resize', () => {
105
-            data.windowWidth = window.innerWidth <= 480 ? 'screen' : 'max-w-2xl';
113
+        Alpine.effect(() => {
114
+            $wire.$set('modalWidth', data.windowWidth);
106
         });
115
         });
107
 
116
 
108
         $wire.on('initializeLink', token => {
117
         $wire.on('initializeLink', token => {

Loading…
取消
儲存