Bladeren bron

ensure accurate seeder data

3.x
Andrew Wallo 1 jaar geleden
bovenliggende
commit
880c00f498
2 gewijzigde bestanden met toevoegingen van 79 en 81 verwijderingen
  1. 71
    71
      composer.lock
  2. 8
    10
      database/factories/Accounting/TransactionFactory.php

+ 71
- 71
composer.lock Bestand weergeven

@@ -77,16 +77,16 @@
77 77
         },
78 78
         {
79 79
             "name": "andrewdwallo/filament-companies",
80
-            "version": "v4.0.3",
80
+            "version": "v4.0.4",
81 81
             "source": {
82 82
                 "type": "git",
83 83
                 "url": "https://github.com/andrewdwallo/filament-companies.git",
84
-                "reference": "47d74b9930b7f55d3c70bafbe5351b450ed5292a"
84
+                "reference": "1436e287c02497b016ce129462dbc3c2baea6084"
85 85
             },
86 86
             "dist": {
87 87
                 "type": "zip",
88
-                "url": "https://api.github.com/repos/andrewdwallo/filament-companies/zipball/47d74b9930b7f55d3c70bafbe5351b450ed5292a",
89
-                "reference": "47d74b9930b7f55d3c70bafbe5351b450ed5292a",
88
+                "url": "https://api.github.com/repos/andrewdwallo/filament-companies/zipball/1436e287c02497b016ce129462dbc3c2baea6084",
89
+                "reference": "1436e287c02497b016ce129462dbc3c2baea6084",
90 90
                 "shasum": ""
91 91
             },
92 92
             "require": {
@@ -150,9 +150,9 @@
150 150
             ],
151 151
             "support": {
152 152
                 "issues": "https://github.com/andrewdwallo/filament-companies/issues",
153
-                "source": "https://github.com/andrewdwallo/filament-companies/tree/v4.0.3"
153
+                "source": "https://github.com/andrewdwallo/filament-companies/tree/v4.0.4"
154 154
             },
155
-            "time": "2024-07-05T19:09:23+00:00"
155
+            "time": "2024-07-18T14:56:20+00:00"
156 156
         },
157 157
         {
158 158
             "name": "andrewdwallo/filament-selectify",
@@ -368,16 +368,16 @@
368 368
         },
369 369
         {
370 370
             "name": "awcodes/filament-table-repeater",
371
-            "version": "v3.0.4",
371
+            "version": "v3.0.5",
372 372
             "source": {
373 373
                 "type": "git",
374 374
                 "url": "https://github.com/awcodes/filament-table-repeater.git",
375
-                "reference": "01288f0d8c9323f147a6aac7f1fb6c2c4b8b880b"
375
+                "reference": "5140e21290a99dea460cec85f1ef015aedbbcf57"
376 376
             },
377 377
             "dist": {
378 378
                 "type": "zip",
379
-                "url": "https://api.github.com/repos/awcodes/filament-table-repeater/zipball/01288f0d8c9323f147a6aac7f1fb6c2c4b8b880b",
380
-                "reference": "01288f0d8c9323f147a6aac7f1fb6c2c4b8b880b",
379
+                "url": "https://api.github.com/repos/awcodes/filament-table-repeater/zipball/5140e21290a99dea460cec85f1ef015aedbbcf57",
380
+                "reference": "5140e21290a99dea460cec85f1ef015aedbbcf57",
381 381
                 "shasum": ""
382 382
             },
383 383
             "require": {
@@ -431,7 +431,7 @@
431 431
             ],
432 432
             "support": {
433 433
                 "issues": "https://github.com/awcodes/filament-table-repeater/issues",
434
-                "source": "https://github.com/awcodes/filament-table-repeater/tree/v3.0.4"
434
+                "source": "https://github.com/awcodes/filament-table-repeater/tree/v3.0.5"
435 435
             },
436 436
             "funding": [
437 437
                 {
@@ -439,7 +439,7 @@
439 439
                     "type": "github"
440 440
                 }
441 441
             ],
442
-            "time": "2024-05-13T12:44:06+00:00"
442
+            "time": "2024-07-18T16:02:26+00:00"
443 443
         },
444 444
         {
445 445
             "name": "aws/aws-crt-php",
@@ -1924,7 +1924,7 @@
1924 1924
         },
1925 1925
         {
1926 1926
             "name": "filament/actions",
1927
-            "version": "v3.2.94",
1927
+            "version": "v3.2.95",
1928 1928
             "source": {
1929 1929
                 "type": "git",
1930 1930
                 "url": "https://github.com/filamentphp/actions.git",
@@ -1977,16 +1977,16 @@
1977 1977
         },
1978 1978
         {
1979 1979
             "name": "filament/filament",
1980
-            "version": "v3.2.94",
1980
+            "version": "v3.2.95",
1981 1981
             "source": {
1982 1982
                 "type": "git",
1983 1983
                 "url": "https://github.com/filamentphp/panels.git",
1984
-                "reference": "595f8d6655cced7f335e0d93b471d3078548b694"
1984
+                "reference": "076acbf82a9299ffbff7edd6a59a3b721b7876f4"
1985 1985
             },
1986 1986
             "dist": {
1987 1987
                 "type": "zip",
1988
-                "url": "https://api.github.com/repos/filamentphp/panels/zipball/595f8d6655cced7f335e0d93b471d3078548b694",
1989
-                "reference": "595f8d6655cced7f335e0d93b471d3078548b694",
1988
+                "url": "https://api.github.com/repos/filamentphp/panels/zipball/076acbf82a9299ffbff7edd6a59a3b721b7876f4",
1989
+                "reference": "076acbf82a9299ffbff7edd6a59a3b721b7876f4",
1990 1990
                 "shasum": ""
1991 1991
             },
1992 1992
             "require": {
@@ -2038,20 +2038,20 @@
2038 2038
                 "issues": "https://github.com/filamentphp/filament/issues",
2039 2039
                 "source": "https://github.com/filamentphp/filament"
2040 2040
             },
2041
-            "time": "2024-07-17T10:40:56+00:00"
2041
+            "time": "2024-07-18T10:43:09+00:00"
2042 2042
         },
2043 2043
         {
2044 2044
             "name": "filament/forms",
2045
-            "version": "v3.2.94",
2045
+            "version": "v3.2.95",
2046 2046
             "source": {
2047 2047
                 "type": "git",
2048 2048
                 "url": "https://github.com/filamentphp/forms.git",
2049
-                "reference": "2e847a113511ecdd33eb3f818341dcbb95185b74"
2049
+                "reference": "eb03e5ea7e91e9b6bab5a7a05846a9b510eb43f3"
2050 2050
             },
2051 2051
             "dist": {
2052 2052
                 "type": "zip",
2053
-                "url": "https://api.github.com/repos/filamentphp/forms/zipball/2e847a113511ecdd33eb3f818341dcbb95185b74",
2054
-                "reference": "2e847a113511ecdd33eb3f818341dcbb95185b74",
2053
+                "url": "https://api.github.com/repos/filamentphp/forms/zipball/eb03e5ea7e91e9b6bab5a7a05846a9b510eb43f3",
2054
+                "reference": "eb03e5ea7e91e9b6bab5a7a05846a9b510eb43f3",
2055 2055
                 "shasum": ""
2056 2056
             },
2057 2057
             "require": {
@@ -2094,20 +2094,20 @@
2094 2094
                 "issues": "https://github.com/filamentphp/filament/issues",
2095 2095
                 "source": "https://github.com/filamentphp/filament"
2096 2096
             },
2097
-            "time": "2024-07-17T10:40:55+00:00"
2097
+            "time": "2024-07-18T10:43:03+00:00"
2098 2098
         },
2099 2099
         {
2100 2100
             "name": "filament/infolists",
2101
-            "version": "v3.2.94",
2101
+            "version": "v3.2.95",
2102 2102
             "source": {
2103 2103
                 "type": "git",
2104 2104
                 "url": "https://github.com/filamentphp/infolists.git",
2105
-                "reference": "e1e89abbd70d1192b5b414fd0107023907e72b2b"
2105
+                "reference": "0edfac1491954078668bfc25f7c373ecc71bf27b"
2106 2106
             },
2107 2107
             "dist": {
2108 2108
                 "type": "zip",
2109
-                "url": "https://api.github.com/repos/filamentphp/infolists/zipball/e1e89abbd70d1192b5b414fd0107023907e72b2b",
2110
-                "reference": "e1e89abbd70d1192b5b414fd0107023907e72b2b",
2109
+                "url": "https://api.github.com/repos/filamentphp/infolists/zipball/0edfac1491954078668bfc25f7c373ecc71bf27b",
2110
+                "reference": "0edfac1491954078668bfc25f7c373ecc71bf27b",
2111 2111
                 "shasum": ""
2112 2112
             },
2113 2113
             "require": {
@@ -2145,11 +2145,11 @@
2145 2145
                 "issues": "https://github.com/filamentphp/filament/issues",
2146 2146
                 "source": "https://github.com/filamentphp/filament"
2147 2147
             },
2148
-            "time": "2024-07-10T17:10:54+00:00"
2148
+            "time": "2024-07-18T10:43:04+00:00"
2149 2149
         },
2150 2150
         {
2151 2151
             "name": "filament/notifications",
2152
-            "version": "v3.2.94",
2152
+            "version": "v3.2.95",
2153 2153
             "source": {
2154 2154
                 "type": "git",
2155 2155
                 "url": "https://github.com/filamentphp/notifications.git",
@@ -2201,16 +2201,16 @@
2201 2201
         },
2202 2202
         {
2203 2203
             "name": "filament/support",
2204
-            "version": "v3.2.94",
2204
+            "version": "v3.2.95",
2205 2205
             "source": {
2206 2206
                 "type": "git",
2207 2207
                 "url": "https://github.com/filamentphp/support.git",
2208
-                "reference": "118843099abbdc3fea21f417a02e89b50c807329"
2208
+                "reference": "cb0ba7fea69d80c2612f22a3cdf29a81722e5fcb"
2209 2209
             },
2210 2210
             "dist": {
2211 2211
                 "type": "zip",
2212
-                "url": "https://api.github.com/repos/filamentphp/support/zipball/118843099abbdc3fea21f417a02e89b50c807329",
2213
-                "reference": "118843099abbdc3fea21f417a02e89b50c807329",
2212
+                "url": "https://api.github.com/repos/filamentphp/support/zipball/cb0ba7fea69d80c2612f22a3cdf29a81722e5fcb",
2213
+                "reference": "cb0ba7fea69d80c2612f22a3cdf29a81722e5fcb",
2214 2214
                 "shasum": ""
2215 2215
             },
2216 2216
             "require": {
@@ -2255,20 +2255,20 @@
2255 2255
                 "issues": "https://github.com/filamentphp/filament/issues",
2256 2256
                 "source": "https://github.com/filamentphp/filament"
2257 2257
             },
2258
-            "time": "2024-07-17T10:41:07+00:00"
2258
+            "time": "2024-07-18T10:43:21+00:00"
2259 2259
         },
2260 2260
         {
2261 2261
             "name": "filament/tables",
2262
-            "version": "v3.2.94",
2262
+            "version": "v3.2.95",
2263 2263
             "source": {
2264 2264
                 "type": "git",
2265 2265
                 "url": "https://github.com/filamentphp/tables.git",
2266
-                "reference": "3bb38bba13f1329433fa71fb0c3e51ee2664a816"
2266
+                "reference": "bee1dea00c0d7fdd1681a8d5991e5a28bc267838"
2267 2267
             },
2268 2268
             "dist": {
2269 2269
                 "type": "zip",
2270
-                "url": "https://api.github.com/repos/filamentphp/tables/zipball/3bb38bba13f1329433fa71fb0c3e51ee2664a816",
2271
-                "reference": "3bb38bba13f1329433fa71fb0c3e51ee2664a816",
2270
+                "url": "https://api.github.com/repos/filamentphp/tables/zipball/bee1dea00c0d7fdd1681a8d5991e5a28bc267838",
2271
+                "reference": "bee1dea00c0d7fdd1681a8d5991e5a28bc267838",
2272 2272
                 "shasum": ""
2273 2273
             },
2274 2274
             "require": {
@@ -2308,11 +2308,11 @@
2308 2308
                 "issues": "https://github.com/filamentphp/filament/issues",
2309 2309
                 "source": "https://github.com/filamentphp/filament"
2310 2310
             },
2311
-            "time": "2024-07-17T10:41:11+00:00"
2311
+            "time": "2024-07-18T10:43:23+00:00"
2312 2312
         },
2313 2313
         {
2314 2314
             "name": "filament/widgets",
2315
-            "version": "v3.2.94",
2315
+            "version": "v3.2.95",
2316 2316
             "source": {
2317 2317
                 "type": "git",
2318 2318
                 "url": "https://github.com/filamentphp/widgets.git",
@@ -2627,22 +2627,22 @@
2627 2627
         },
2628 2628
         {
2629 2629
             "name": "guzzlehttp/guzzle",
2630
-            "version": "7.8.1",
2630
+            "version": "7.9.0",
2631 2631
             "source": {
2632 2632
                 "type": "git",
2633 2633
                 "url": "https://github.com/guzzle/guzzle.git",
2634
-                "reference": "41042bc7ab002487b876a0683fc8dce04ddce104"
2634
+                "reference": "84ac2b2afc44e40d3e8e658a45d68d6d20437612"
2635 2635
             },
2636 2636
             "dist": {
2637 2637
                 "type": "zip",
2638
-                "url": "https://api.github.com/repos/guzzle/guzzle/zipball/41042bc7ab002487b876a0683fc8dce04ddce104",
2639
-                "reference": "41042bc7ab002487b876a0683fc8dce04ddce104",
2638
+                "url": "https://api.github.com/repos/guzzle/guzzle/zipball/84ac2b2afc44e40d3e8e658a45d68d6d20437612",
2639
+                "reference": "84ac2b2afc44e40d3e8e658a45d68d6d20437612",
2640 2640
                 "shasum": ""
2641 2641
             },
2642 2642
             "require": {
2643 2643
                 "ext-json": "*",
2644
-                "guzzlehttp/promises": "^1.5.3 || ^2.0.1",
2645
-                "guzzlehttp/psr7": "^1.9.1 || ^2.5.1",
2644
+                "guzzlehttp/promises": "^1.5.3 || ^2.0.3",
2645
+                "guzzlehttp/psr7": "^2.7.0",
2646 2646
                 "php": "^7.2.5 || ^8.0",
2647 2647
                 "psr/http-client": "^1.0",
2648 2648
                 "symfony/deprecation-contracts": "^2.2 || ^3.0"
@@ -2653,9 +2653,9 @@
2653 2653
             "require-dev": {
2654 2654
                 "bamarni/composer-bin-plugin": "^1.8.2",
2655 2655
                 "ext-curl": "*",
2656
-                "php-http/client-integration-tests": "dev-master#2c025848417c1135031fdf9c728ee53d0a7ceaee as 3.0.999",
2656
+                "guzzle/client-integration-tests": "3.0.2",
2657 2657
                 "php-http/message-factory": "^1.1",
2658
-                "phpunit/phpunit": "^8.5.36 || ^9.6.15",
2658
+                "phpunit/phpunit": "^8.5.39 || ^9.6.20",
2659 2659
                 "psr/log": "^1.1 || ^2.0 || ^3.0"
2660 2660
             },
2661 2661
             "suggest": {
@@ -2733,7 +2733,7 @@
2733 2733
             ],
2734 2734
             "support": {
2735 2735
                 "issues": "https://github.com/guzzle/guzzle/issues",
2736
-                "source": "https://github.com/guzzle/guzzle/tree/7.8.1"
2736
+                "source": "https://github.com/guzzle/guzzle/tree/7.9.0"
2737 2737
             },
2738 2738
             "funding": [
2739 2739
                 {
@@ -2749,20 +2749,20 @@
2749 2749
                     "type": "tidelift"
2750 2750
                 }
2751 2751
             ],
2752
-            "time": "2023-12-03T20:35:24+00:00"
2752
+            "time": "2024-07-18T11:52:56+00:00"
2753 2753
         },
2754 2754
         {
2755 2755
             "name": "guzzlehttp/promises",
2756
-            "version": "2.0.2",
2756
+            "version": "2.0.3",
2757 2757
             "source": {
2758 2758
                 "type": "git",
2759 2759
                 "url": "https://github.com/guzzle/promises.git",
2760
-                "reference": "bbff78d96034045e58e13dedd6ad91b5d1253223"
2760
+                "reference": "6ea8dd08867a2a42619d65c3deb2c0fcbf81c8f8"
2761 2761
             },
2762 2762
             "dist": {
2763 2763
                 "type": "zip",
2764
-                "url": "https://api.github.com/repos/guzzle/promises/zipball/bbff78d96034045e58e13dedd6ad91b5d1253223",
2765
-                "reference": "bbff78d96034045e58e13dedd6ad91b5d1253223",
2764
+                "url": "https://api.github.com/repos/guzzle/promises/zipball/6ea8dd08867a2a42619d65c3deb2c0fcbf81c8f8",
2765
+                "reference": "6ea8dd08867a2a42619d65c3deb2c0fcbf81c8f8",
2766 2766
                 "shasum": ""
2767 2767
             },
2768 2768
             "require": {
@@ -2770,7 +2770,7 @@
2770 2770
             },
2771 2771
             "require-dev": {
2772 2772
                 "bamarni/composer-bin-plugin": "^1.8.2",
2773
-                "phpunit/phpunit": "^8.5.36 || ^9.6.15"
2773
+                "phpunit/phpunit": "^8.5.39 || ^9.6.20"
2774 2774
             },
2775 2775
             "type": "library",
2776 2776
             "extra": {
@@ -2816,7 +2816,7 @@
2816 2816
             ],
2817 2817
             "support": {
2818 2818
                 "issues": "https://github.com/guzzle/promises/issues",
2819
-                "source": "https://github.com/guzzle/promises/tree/2.0.2"
2819
+                "source": "https://github.com/guzzle/promises/tree/2.0.3"
2820 2820
             },
2821 2821
             "funding": [
2822 2822
                 {
@@ -2832,20 +2832,20 @@
2832 2832
                     "type": "tidelift"
2833 2833
                 }
2834 2834
             ],
2835
-            "time": "2023-12-03T20:19:20+00:00"
2835
+            "time": "2024-07-18T10:29:17+00:00"
2836 2836
         },
2837 2837
         {
2838 2838
             "name": "guzzlehttp/psr7",
2839
-            "version": "2.6.2",
2839
+            "version": "2.7.0",
2840 2840
             "source": {
2841 2841
                 "type": "git",
2842 2842
                 "url": "https://github.com/guzzle/psr7.git",
2843
-                "reference": "45b30f99ac27b5ca93cb4831afe16285f57b8221"
2843
+                "reference": "a70f5c95fb43bc83f07c9c948baa0dc1829bf201"
2844 2844
             },
2845 2845
             "dist": {
2846 2846
                 "type": "zip",
2847
-                "url": "https://api.github.com/repos/guzzle/psr7/zipball/45b30f99ac27b5ca93cb4831afe16285f57b8221",
2848
-                "reference": "45b30f99ac27b5ca93cb4831afe16285f57b8221",
2847
+                "url": "https://api.github.com/repos/guzzle/psr7/zipball/a70f5c95fb43bc83f07c9c948baa0dc1829bf201",
2848
+                "reference": "a70f5c95fb43bc83f07c9c948baa0dc1829bf201",
2849 2849
                 "shasum": ""
2850 2850
             },
2851 2851
             "require": {
@@ -2860,8 +2860,8 @@
2860 2860
             },
2861 2861
             "require-dev": {
2862 2862
                 "bamarni/composer-bin-plugin": "^1.8.2",
2863
-                "http-interop/http-factory-tests": "^0.9",
2864
-                "phpunit/phpunit": "^8.5.36 || ^9.6.15"
2863
+                "http-interop/http-factory-tests": "0.9.0",
2864
+                "phpunit/phpunit": "^8.5.39 || ^9.6.20"
2865 2865
             },
2866 2866
             "suggest": {
2867 2867
                 "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses"
@@ -2932,7 +2932,7 @@
2932 2932
             ],
2933 2933
             "support": {
2934 2934
                 "issues": "https://github.com/guzzle/psr7/issues",
2935
-                "source": "https://github.com/guzzle/psr7/tree/2.6.2"
2935
+                "source": "https://github.com/guzzle/psr7/tree/2.7.0"
2936 2936
             },
2937 2937
             "funding": [
2938 2938
                 {
@@ -2948,7 +2948,7 @@
2948 2948
                     "type": "tidelift"
2949 2949
                 }
2950 2950
             ],
2951
-            "time": "2023-12-03T20:05:35+00:00"
2951
+            "time": "2024-07-18T11:15:46+00:00"
2952 2952
         },
2953 2953
         {
2954 2954
             "name": "guzzlehttp/uri-template",
@@ -10667,16 +10667,16 @@
10667 10667
         },
10668 10668
         {
10669 10669
             "name": "phpunit/phpunit",
10670
-            "version": "10.5.27",
10670
+            "version": "10.5.28",
10671 10671
             "source": {
10672 10672
                 "type": "git",
10673 10673
                 "url": "https://github.com/sebastianbergmann/phpunit.git",
10674
-                "reference": "2425f713b2a5350568ccb1a2d3984841a23e83c5"
10674
+                "reference": "ff7fb85cdf88131b83e721fb2a327b664dbed275"
10675 10675
             },
10676 10676
             "dist": {
10677 10677
                 "type": "zip",
10678
-                "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/2425f713b2a5350568ccb1a2d3984841a23e83c5",
10679
-                "reference": "2425f713b2a5350568ccb1a2d3984841a23e83c5",
10678
+                "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/ff7fb85cdf88131b83e721fb2a327b664dbed275",
10679
+                "reference": "ff7fb85cdf88131b83e721fb2a327b664dbed275",
10680 10680
                 "shasum": ""
10681 10681
             },
10682 10682
             "require": {
@@ -10748,7 +10748,7 @@
10748 10748
             "support": {
10749 10749
                 "issues": "https://github.com/sebastianbergmann/phpunit/issues",
10750 10750
                 "security": "https://github.com/sebastianbergmann/phpunit/security/policy",
10751
-                "source": "https://github.com/sebastianbergmann/phpunit/tree/10.5.27"
10751
+                "source": "https://github.com/sebastianbergmann/phpunit/tree/10.5.28"
10752 10752
             },
10753 10753
             "funding": [
10754 10754
                 {
@@ -10764,7 +10764,7 @@
10764 10764
                     "type": "tidelift"
10765 10765
                 }
10766 10766
             ],
10767
-            "time": "2024-07-10T11:48:06+00:00"
10767
+            "time": "2024-07-18T14:54:16+00:00"
10768 10768
         },
10769 10769
         {
10770 10770
             "name": "rector/rector",

+ 8
- 10
database/factories/Accounting/TransactionFactory.php Bestand weergeven

@@ -2,6 +2,8 @@
2 2
 
3 3
 namespace Database\Factories\Accounting;
4 4
 
5
+use App\Enums\Accounting\JournalEntryType;
6
+use App\Enums\Accounting\TransactionType;
5 7
 use App\Models\Accounting\Account;
6 8
 use App\Models\Accounting\Transaction;
7 9
 use App\Models\Banking\BankAccount;
@@ -29,13 +31,10 @@ class TransactionFactory extends Factory
29 31
             'company_id' => 1,
30 32
             'bank_account_id' => 1,
31 33
             'account_id' => $this->faker->numberBetween(2, 30),
32
-            'type' => $this->faker->randomElement(['deposit', 'withdrawal', 'journal']),
33
-            'payment_channel' => $this->faker->randomElement(['online', 'in store', 'other']),
34
+            'type' => $this->faker->randomElement([TransactionType::Deposit, TransactionType::Withdrawal]),
34 35
             'description' => $this->faker->sentence,
35 36
             'notes' => $this->faker->paragraph,
36
-            'reference' => $this->faker->word,
37 37
             'amount' => $this->faker->numberBetween(100, 5000),
38
-            'pending' => $this->faker->boolean,
39 38
             'reviewed' => $this->faker->boolean,
40 39
             'posted_at' => $this->faker->dateTimeBetween('-2 years'),
41 40
             'created_by' => 1,
@@ -59,7 +58,7 @@ class TransactionFactory extends Factory
59 58
             $debitAccount->journalEntries()->create([
60 59
                 'company_id' => $transaction->company_id,
61 60
                 'transaction_id' => $transaction->id,
62
-                'type' => 'debit',
61
+                'type' => JournalEntryType::Debit,
63 62
                 'amount' => $transaction->amount,
64 63
                 'description' => $transaction->description,
65 64
                 'created_by' => $transaction->created_by,
@@ -69,7 +68,7 @@ class TransactionFactory extends Factory
69 68
             $creditAccount->journalEntries()->create([
70 69
                 'company_id' => $transaction->company_id,
71 70
                 'transaction_id' => $transaction->id,
72
-                'type' => 'credit',
71
+                'type' => JournalEntryType::Credit,
73 72
                 'amount' => $transaction->amount,
74 73
                 'description' => $transaction->description,
75 74
                 'created_by' => $transaction->created_by,
@@ -81,12 +80,11 @@ class TransactionFactory extends Factory
81 80
     public function forCompanyAndBankAccount(Company $company, BankAccount $bankAccount): static
82 81
     {
83 82
         return $this->state(function (array $attributes) use ($bankAccount, $company) {
84
-            $type = $this->faker->randomElement(['deposit', 'withdrawal', 'journal']);
83
+            $type = $this->faker->randomElement([TransactionType::Deposit, TransactionType::Withdrawal]);
85 84
 
86 85
             $associatedAccountTypes = match ($type) {
87
-                'deposit' => ['asset', 'liability', 'equity', 'revenue'],
88
-                'withdrawal' => ['asset', 'liability', 'equity', 'expense'],
89
-                default => ['asset', 'liability', 'equity', 'revenue', 'expense'],
86
+                TransactionType::Deposit => ['asset', 'liability', 'equity', 'revenue'],
87
+                TransactionType::Withdrawal => ['asset', 'liability', 'equity', 'expense'],
90 88
             };
91 89
 
92 90
             $accountIdForBankAccount = $bankAccount->account->id;

Laden…
Annuleren
Opslaan