mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal.git
synced 2026-08-19 12:34:18 +00:00
Compare commits
938 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 68c5208316 | |||
| 5ca007ab28 | |||
| f190997634 | |||
| 5dd8a70677 | |||
| 9dbb6a8b49 | |||
| 812da07f63 | |||
| 130aa78dfe | |||
| f820ba578f | |||
| 961f8acf65 | |||
| 9a2a5d797c | |||
| 743662af9e | |||
| 1ba98379bf | |||
| 0f18556667 | |||
| 27b4dee1e3 | |||
| 3e982f5351 | |||
| b17fe23652 | |||
| 191bd161f3 | |||
| 6b8a61877e | |||
| 9730fa79e4 | |||
| 009c064002 | |||
| 6be228e7fd | |||
| fd52aa6b01 | |||
| de4c09fb07 | |||
| adb81ebfe9 | |||
| 8d11ff6b7f | |||
| 76cc4296a3 | |||
| 90f485f84b | |||
| 1cc3581800 | |||
| 7dfa7b0220 | |||
| 27204bca13 | |||
| b735462321 | |||
| 8b2ef2acd4 | |||
| f5f278fb77 | |||
| 8afa6a496e | |||
| 03a7ed5785 | |||
| efe5ccecea | |||
| 7faeec6ef7 | |||
| 20e7e19bc6 | |||
| 151447c573 | |||
| a21614ba32 | |||
| d99cb103ce | |||
| 4c92ac5a83 | |||
| 1c291134a1 | |||
| 66576b6eea | |||
| 7be3614f96 | |||
| 9a1b33a413 | |||
| 70ad358e5d | |||
| c8249b9276 | |||
| 0484eabb0e | |||
| 7a5cf5f2ce | |||
| 49a31a743c | |||
| f3d6521e2c | |||
| f7a9358202 | |||
| db499bfecf | |||
| 0538653bca | |||
| 9147a4cfec | |||
| a20f4ed9be | |||
| d542a20f76 | |||
| 6d20c8d49e | |||
| f02220fda8 | |||
| 2bf511a1cb | |||
| 4242777e7d | |||
| 65bd979b31 | |||
| e0213108d2 | |||
| 71f50b646b | |||
| 2a662b42e0 | |||
| 024e0d666a | |||
| 37119344f3 | |||
| 37cb4fca18 | |||
| 37e8bf4d9a | |||
| 0df85daf2e | |||
| 650cfba74a | |||
| 7f94148ed9 | |||
| 539da4f551 | |||
| 7c8f5fe791 | |||
| 60c083a9cf | |||
| 5b32fe9d6f | |||
| d315880067 | |||
| 9cd2051cac | |||
| 8c3e8fdeaf | |||
| c31e7aaf37 | |||
| 5b6f419d9e | |||
| c7f00a7ce2 | |||
| 35932e5351 | |||
| 012b88ee37 | |||
| 88869dcadb | |||
| df1d80756a | |||
| 066f5f52d5 | |||
| 4d76ffd545 | |||
| 58f62de2e8 | |||
| 773b30d224 | |||
| 74811f177c | |||
| 82de9ae6f9 | |||
| 6cb27096f7 | |||
| 10660b8350 | |||
| 5c42d383d0 | |||
| d3966e8b28 | |||
| 6a4570442a | |||
| 300f7b6642 | |||
| c28ee64878 | |||
| ce6b47763c | |||
| 881dd71ef0 | |||
| beec9aef24 | |||
| fcd6f2d6a8 | |||
| ae15575b0a | |||
| 4a66578380 | |||
| ffbf6b0f9c | |||
| 1e4d2c8031 | |||
| 2122d18be5 | |||
| 0e9ef67121 | |||
| c2511e2467 | |||
| e663165654 | |||
| e80e52d04e | |||
| eed5559cbf | |||
| 7fdb579ab8 | |||
| 6c5c5a9d34 | |||
| 1d45a7aadf | |||
| 81474625eb | |||
| 769becfc16 | |||
| 6ee296ef06 | |||
| e0e6e53e63 | |||
| 9a90e8cf80 | |||
| 4db8b24b22 | |||
| d5e008d4f3 | |||
| 7a6655c3d9 | |||
| 7fbee7b047 | |||
| 2edd44a218 | |||
| a8d86eebd6 | |||
| 6f2b374cbd | |||
| 3fb7befd62 | |||
| 8607caa84f | |||
| 47d564ec09 | |||
| 8031db446e | |||
| 62177bd3d0 | |||
| 76512b107b | |||
| b8f284c2c0 | |||
| 5db1579c36 | |||
| 7615c3ef3e | |||
| d8f1262ec2 | |||
| 5b8893068c | |||
| 1810809113 | |||
| 9d4daeeb46 | |||
| 84e23ec80f | |||
| 5b2e3a1828 | |||
| c52b577c19 | |||
| 8f6443d536 | |||
| 5414be594d | |||
| 0625c37cdc | |||
| bdc45282a4 | |||
| a716a7a38b | |||
| b3d904f3c8 | |||
| d8f3f50bb0 | |||
| 6d26f690c0 | |||
| f061b5eb86 | |||
| e83e8aa5c8 | |||
| b6e4bbd94c | |||
| ca8e69b17a | |||
| d99566a431 | |||
| 6ce38e5751 | |||
| 8564667c62 | |||
| 7da665ca5b | |||
| 2cee63789b | |||
| 8fbd377965 | |||
| 11ac78881c | |||
| cc49336a4d | |||
| 1380d99109 | |||
| 42e6e82df8 | |||
| 7cac5b937f | |||
| 812f16a191 | |||
| 1073b6484c | |||
| 549bf98725 | |||
| e3afc2b008 | |||
| d0decc6c7b | |||
| 312b467564 | |||
| 7adf03cf06 | |||
| 018c3eb755 | |||
| b8707fbb0d | |||
| 134e0d86ea | |||
| 3d70a42758 | |||
| 9ef56454a0 | |||
| ea1c447fa1 | |||
| 79679fe2e0 | |||
| 5c1a4536f6 | |||
| 345c8d24ca | |||
| d986787c4c | |||
| 3281625e92 | |||
| 71e9a479d9 | |||
| 5fef38a04b | |||
| bf22b86a02 | |||
| 3b0738219f | |||
| 18434903ac | |||
| c2d51fc502 | |||
| be0d10416b | |||
| 9cc80e6965 | |||
| 9991524a2e | |||
| 7808d0d5ae | |||
| 3d7d571370 | |||
| 955b454630 | |||
| f45ea797d6 | |||
| efd734bbdb | |||
| 0c849ee302 | |||
| 9c9d4fe594 | |||
| 167216c26f | |||
| d97796d885 | |||
| 2bd66f6786 | |||
| c64f6f5da5 | |||
| da7843c5df | |||
| 2463e419c8 | |||
| 2cbee23234 | |||
| dca9682c59 | |||
| b417ba074e | |||
| 5767ab1853 | |||
| a7aad5373b | |||
| cad314d6a7 | |||
| 137dfe0669 | |||
| 52b839c741 | |||
| d8ee9f1e67 | |||
| 620b9651a3 | |||
| c37ed89a73 | |||
| f56548efa7 | |||
| 679bb9978a | |||
| 2c6b8ac7ea | |||
| 9b7a5a6f1e | |||
| fbf5fb290e | |||
| 63902e9266 | |||
| 1a318ead7e | |||
| bd8b212f6f | |||
| 59fbdfa789 | |||
| 2bd96075cc | |||
| c046a533d8 | |||
| 8e6c70c67b | |||
| 878e69fdb0 | |||
| e047632de0 | |||
| 8d75da288a | |||
| ab5a94cbc0 | |||
| 17d8c82cff | |||
| 8f80c7ac8c | |||
| 9c09b1e01d | |||
| 6911eba119 | |||
| c564a8ed70 | |||
| 273f81f9a8 | |||
| ba1b287cbb | |||
| 40d133aaab | |||
| d52a52241c | |||
| df9468d568 | |||
| 6d12f2d239 | |||
| fe18d8bf5a | |||
| 3913d3c738 | |||
| be9df4afe3 | |||
| 82512bf4f6 | |||
| a9d4f3c839 | |||
| 218f0f8bca | |||
| 79db1dedc9 | |||
| 2aabd07ec4 | |||
| 1d2eac806e | |||
| 8d0fba2d21 | |||
| b4c239f8a9 | |||
| b3e8e5ea54 | |||
| ed4ec29d63 | |||
| ba5fd5f92d | |||
| e6028701db | |||
| fb2ca65168 | |||
| 8ab9a0ba2d | |||
| 78ac0dbd8f | |||
| e9c3af51c4 | |||
| d6cfd85aa2 | |||
| 844527417a | |||
| f725933f7e | |||
| d5a5f9e730 | |||
| 62f892dfd1 | |||
| 82f5d4c2bc | |||
| a1eebe7f65 | |||
| 18bd36217b | |||
| 772fd583b5 | |||
| 57812656fd | |||
| 3933728a19 | |||
| 8ce8ed813a | |||
| 50b2f00bdc | |||
| 54c23c9f38 | |||
| 15570de9fb | |||
| b21cdba5ae | |||
| fe8395b250 | |||
| 61f01ed39b | |||
| 6e2b2e5f65 | |||
| b4b509b0d1 | |||
| 6bafc49a22 | |||
| 4e4bf96a07 | |||
| 2e9c3000a6 | |||
| 3e4d52d2ff | |||
| f25f5ebb41 | |||
| 404758c851 | |||
| f6d00383cb | |||
| 33dfdde9a0 | |||
| 9b1a5b633c | |||
| b0cd0cca4d | |||
| c0e60e5d3b | |||
| d093b774c2 | |||
| 3fa4b498e9 | |||
| ccd06ff740 | |||
| c209f6e4ed | |||
| f4d8ece23f | |||
| 215e4c72d3 | |||
| 386f5740f4 | |||
| 78c43fd7a4 | |||
| d076892176 | |||
| 06b9695528 | |||
| 0a54f46b91 | |||
| 83b3d0c725 | |||
| de7331547c | |||
| 4daaac476d | |||
| fbf036d4b8 | |||
| 055e720e9f | |||
| 5a0b2d5a86 | |||
| 8f6f9893bb | |||
| 3255020f11 | |||
| 8c16277c6c | |||
| 87aeb0ae59 | |||
| 76b14cd667 | |||
| 6affa86c92 | |||
| a8c4661b2d | |||
| acb42ef3ab | |||
| 21f1a14e6f | |||
| d5a9e3923e | |||
| 7416aa00ac | |||
| 437765bdbb | |||
| 9c7ed93a54 | |||
| a3b08a7c11 | |||
| e3bc918bd8 | |||
| a23a632b87 | |||
| 651092aa65 | |||
| fe79d5bcef | |||
| 6ea7517187 | |||
| 4e68eefe4d | |||
| 48fc02f2d2 | |||
| 942c94c821 | |||
| bfb76bc512 | |||
| 8e3cdef4e1 | |||
| c798d96238 | |||
| 64d1b91fa3 | |||
| 2ff63c8d0d | |||
| b57a7cb2bb | |||
| bf5c5574d6 | |||
| 74a1f2af4c | |||
| 95d230d64f | |||
| 88564c661f | |||
| 6ce7f7dc91 | |||
| b91a8635d5 | |||
| 236b3769f8 | |||
| 3c4a19d4be | |||
| 269fbcbd66 | |||
| 603a67c770 | |||
| bb0832b8b0 | |||
| 8276fef3e1 | |||
| aa4fcae07e | |||
| 05adf091a8 | |||
| b5e5e88a6a | |||
| 32bad3bf07 | |||
| 1508fb5f1a | |||
| 70a2bdec48 | |||
| f5df0c9f1f | |||
| e50bab014d | |||
| 1933787fc3 | |||
| 5535f13aff | |||
| 3a2131a04d | |||
| c8e8c9cb0e | |||
| 0e617f5ce2 | |||
| ccb77ce56c | |||
| 8f8c3ca660 | |||
| 922718f7c2 | |||
| 54e6041fe5 | |||
| 141f1ed9d5 | |||
| 61d7ad22e7 | |||
| 798bf4e70e | |||
| aa833f7a9f | |||
| 8dd3fbf97a | |||
| 63e1b767fc | |||
| 60ff1c5130 | |||
| 22aac2df04 | |||
| 33d65be53b | |||
| d2f6f4e8a1 | |||
| 299c384cb2 | |||
| be171f550b | |||
| 8295b80f73 | |||
| 67969c63d3 | |||
| 2074c8661a | |||
| 9518928b7d | |||
| 634a39b1ea | |||
| 5808fd0b2f | |||
| d7ce1df29b | |||
| eac3f31351 | |||
| 95a9cba32d | |||
| 26812f723a | |||
| 0734447937 | |||
| e3f57fffd6 | |||
| b4bc441a5b | |||
| d678440032 | |||
| 4f95520826 | |||
| 33a271a54c | |||
| 3e3728a089 | |||
| dc8a1b0325 | |||
| 4a6e5f7130 | |||
| 6b78ca3d46 | |||
| 38612253d0 | |||
| 2fccdf4f7e | |||
| 56d48598df | |||
| 4f77da822b | |||
| cf6fd2dad9 | |||
| 6cb1ec82f3 | |||
| 733b9cdfcc | |||
| 4a2860449f | |||
| 6fbea32761 | |||
| 50624b3d75 | |||
| dddbeb2ebd | |||
| 22714a2763 | |||
| bc2c9610ee | |||
| 3dc234321c | |||
| 4a65031aa3 | |||
| 4dd30b29c0 | |||
| ac6211cf5f | |||
| 65a622cd7b | |||
| bba600725e | |||
| 4fa80a2a88 | |||
| 64f52f2c11 | |||
| 72c1b2fb2e | |||
| b4f5328a21 | |||
| 7aee324294 | |||
| 7930e45393 | |||
| 052dc4e5a0 | |||
| 32bd000195 | |||
| 29477c179e | |||
| d5265c1254 | |||
| f44497e50c | |||
| 450d2c15f9 | |||
| 7b6ed51ce8 | |||
| 30d99b8d79 | |||
| 7b0e271459 | |||
| e6db981d5e | |||
| d4e008380b | |||
| bb08f5d872 | |||
| 5b45d42aaa | |||
| f1c7323a1d | |||
| e8a17af3a6 | |||
| c67ca30100 | |||
| 21ec1a582a | |||
| 0b8aea4b60 | |||
| 92cf194c07 | |||
| 74ec1c949b | |||
| 497666e582 | |||
| 7953de1f7d | |||
| dcca295c52 | |||
| 283be0b8a4 | |||
| 3ac466f412 | |||
| 87ffaa5b0d | |||
| b5122e97c1 | |||
| 940341a2be | |||
| a956d4ac4c | |||
| 4892555211 | |||
| a95f62b59a | |||
| 821291f16f | |||
| 0a7d93b034 | |||
| 2a9478f89a | |||
| 58a4dabf09 | |||
| 033b6a4c26 | |||
| 712d122d4a | |||
| e5498cffb8 | |||
| fc1f9f9f7e | |||
| 077e719e69 | |||
| 1f1fb7d79a | |||
| d0e2e17169 | |||
| bd8e30493f | |||
| ff790885ab | |||
| 7fc4324645 | |||
| 69a898f7ee | |||
| abad3cd591 | |||
| 0e6d1b7633 | |||
| 91576d9f7b | |||
| 1606bc7426 | |||
| 1f8351486f | |||
| 9299c11131 | |||
| 91b00baa07 | |||
| 7d3e0c486f | |||
| 87cf25a2f3 | |||
| c3c9421e19 | |||
| e21804ceca | |||
| d4ba2a2c43 | |||
| 38cdd37aea | |||
| 5f6670ad91 | |||
| 5799da5ae1 | |||
| cd05d1bed3 | |||
| 5753c63248 | |||
| c01d5c993c | |||
| 2c24c469f5 | |||
| a18377df9f | |||
| a99d19721c | |||
| 753141ea81 | |||
| 8a421e845e | |||
| b26ed17008 | |||
| 24fb998e4d | |||
| 8459a784d0 | |||
| c71827662c | |||
| 3d98495f89 | |||
| cb8a61947a | |||
| 9b22be40b9 | |||
| c3b6247330 | |||
| 0bb65a4061 | |||
| cf9352487f | |||
| 726f17aefe | |||
| 42de5881ee | |||
| 9fba6c9580 | |||
| 0c1d88a2df | |||
| dbfeaf2783 | |||
| b06dc438f5 | |||
| ccde9763f7 | |||
| 19be4b2a05 | |||
| f4cdc301d7 | |||
| 46d6e09fff | |||
| 7d79abd023 | |||
| 4a4c6d6e99 | |||
| bdadd18a17 | |||
| 03d5c29ae1 | |||
| 99db37a67c | |||
| a2f110b491 | |||
| 997c14d00e | |||
| aacd953a82 | |||
| 08aa383b91 | |||
| d20cc1bc7b | |||
| c4bbff232d | |||
| b0a96441c4 | |||
| 3e888c7c08 | |||
| dc484becc8 | |||
| eda8b7eeba | |||
| 71313491fe | |||
| 0a42bc525a | |||
| a6860de6f7 | |||
| 01051dbdd4 | |||
| f0813b03c8 | |||
| ba86c2e903 | |||
| eb1d5423d8 | |||
| da2ff03c94 | |||
| 259eca063f | |||
| a9f63ce137 | |||
| b83f62b703 | |||
| 428bf85043 | |||
| ec8e2de45e | |||
| 15f463c556 | |||
| 14e3c4fac0 | |||
| f2833be359 | |||
| 927f0f5980 | |||
| 430fe0456b | |||
| 5a07ec7bba | |||
| 9cb7d992ab | |||
| e14aa4f9eb | |||
| 040588c8ba | |||
| 02c0cc2d63 | |||
| c75866f958 | |||
| 9288f1e9f2 | |||
| eb68f1c394 | |||
| 5790f5a7a3 | |||
| 34b692fb4d | |||
| ee3de039fb | |||
| f293a975ed | |||
| d4f02cdafe | |||
| 5d8d57e399 | |||
| 608c9284dd | |||
| 3a97b5e26d | |||
| cca188eefd | |||
| 5401b38638 | |||
| 5bf7acad6b | |||
| d61d58a51a | |||
| 8b7d2041ed | |||
| 4d7e9dcd66 | |||
| 6647ad6ffc | |||
| 8795e116f0 | |||
| 0927bf4f00 | |||
| c8ca6d7f6f | |||
| 2a25eb18ae | |||
| ea569b437b | |||
| 0386c224b1 | |||
| 457952cd44 | |||
| c19c44bfbe | |||
| fed40d8384 | |||
| 49b5d142d9 | |||
| cd36f5b435 | |||
| 7170719203 | |||
| f6bc88f553 | |||
| 10c13446df | |||
| e18ff9215a | |||
| 4456ddcb6b | |||
| c0fc26bd0a | |||
| 639b0ffe4a | |||
| c0ff60c5e7 | |||
| 2b6727cadc | |||
| 4adc3a65be | |||
| 53b8764a61 | |||
| 2d3d0f3a58 | |||
| a2e65a2ba5 | |||
| 01db290102 | |||
| 18e31994c0 | |||
| 0bf1ffbd7a | |||
| 5fe17db78a | |||
| 252c9c915e | |||
| 2a6858d243 | |||
| 00f6e95bae | |||
| ab48489b6e | |||
| 146aab2978 | |||
| 2b529fa986 | |||
| cc9c4600f2 | |||
| cdc6ee1839 | |||
| 537a6b0b33 | |||
| f7a22c2977 | |||
| 33341feb0e | |||
| bdae6643c9 | |||
| 91fa3e08cd | |||
| 5d6c86d651 | |||
| 44e124dfa3 | |||
| 2c4a2ea942 | |||
| a6d032050c | |||
| ef7cc68121 | |||
| 57ec8c2b36 | |||
| 92d5ae0c76 | |||
| 1d6cd2a104 | |||
| 9516721ff5 | |||
| 7f8597a79e | |||
| 9782ac6fda | |||
| d259df9796 | |||
| b117730619 | |||
| 2f8502c92e | |||
| e933470c17 | |||
| cc5fc19f24 | |||
| d93ee2462c | |||
| 5279cc11c4 | |||
| a8cac0a121 | |||
| 53d3afff72 | |||
| 78b36dab9d | |||
| 40e6eee6d9 | |||
| 28dd444c0a | |||
| b2dea50fc0 | |||
| 0f04cec170 | |||
| 58efaddf7d | |||
| 9882e5e75d | |||
| 11a5757303 | |||
| 3c6d1ec03b | |||
| 2e871cd42f | |||
| 643a903351 | |||
| b01159e47a | |||
| b8474a2aff | |||
| cf1e1b7cd4 | |||
| 7234ebe67a | |||
| 7658b8f72f | |||
| 2cce3597f6 | |||
| 8027bffdd8 | |||
| 78ea976c72 | |||
| 3d0bdd70d5 | |||
| ae03b75699 | |||
| 1dab162293 | |||
| 8df0b60c6a | |||
| db457fc63e | |||
| 9557496794 | |||
| 638c4b233f | |||
| 108481f85a | |||
| 2b068d16cf | |||
| 573a60c790 | |||
| 9f7a40e0f8 | |||
| 1073fbfa4d | |||
| 9c499b3874 | |||
| b7c6c13bde | |||
| 01d666d92a | |||
| 774f4f8d63 | |||
| cfb5b32419 | |||
| 65d3af39ea | |||
| 0c0d5a1707 | |||
| 2023df9442 | |||
| c9935bfac7 | |||
| 389fae377b | |||
| 64bccf7bad | |||
| 0e816337fc | |||
| b3973b52d1 | |||
| 694876c31f | |||
| 499782bbec | |||
| f3eca3dd89 | |||
| 9c4c472a40 | |||
| a67afdc0ff | |||
| b30cdaba84 | |||
| 9ac0ca45be | |||
| 3fe98b24a4 | |||
| 7e7e43ee9c | |||
| 39892a0938 | |||
| 0ffe81d1cf | |||
| 5fd6e6a528 | |||
| 09ede52ecf | |||
| e5d6f3f581 | |||
| aa65b333c8 | |||
| 656c50e047 | |||
| 275157b243 | |||
| 0c9ffd2bf7 | |||
| d4dcae155d | |||
| bad8cadb3a | |||
| 3af32cc6e7 | |||
| 34bab6a45c | |||
| dd1eae1ea2 | |||
| 195e899751 | |||
| b46bfb38bf | |||
| 19c4ee4fda | |||
| 6710a2caf2 | |||
| 5491047fe1 | |||
| b2e4e67085 | |||
| 13f13c7a0e | |||
| ffa63f611b | |||
| 82675ab80c | |||
| aac04c4135 | |||
| 49989fd154 | |||
| 56dca799f8 | |||
| 42d8f811c6 | |||
| 030136fd03 | |||
| c8b6e271e3 | |||
| 151f9dc7bc | |||
| d41889f84a | |||
| 6a20acbb40 | |||
| f93997b858 | |||
| 6fbc23d7c4 | |||
| e0a264d58f | |||
| fec20b0947 | |||
| 0bf61d93c5 | |||
| bea24fb48e | |||
| ccdc0b4b0f | |||
| c402f672c3 | |||
| 8fe1f3261f | |||
| 17a4522f50 | |||
| dfedb99c13 | |||
| 669cac9bd4 | |||
| d7625aece7 | |||
| a36c5c3063 | |||
| 493bb3512c | |||
| 073b69608a | |||
| f0d8b18715 | |||
| 29ad0a0464 | |||
| 5eca74579d | |||
| 84010579f2 | |||
| 8a36fb05b5 | |||
| bd7014fd7a | |||
| 9806543d07 | |||
| d63decd446 | |||
| c05c0a83b4 | |||
| 05102576d8 | |||
| 88a6e546a8 | |||
| a14d9dbe27 | |||
| 63316212ec | |||
| 746d4254c5 | |||
| d81b07f758 | |||
| eb2d17b73f | |||
| 6a621029e6 | |||
| 06e36bb754 | |||
| cef88f8274 | |||
| fd75da5778 | |||
| b593605c72 | |||
| 8d75012390 | |||
| 2d98757c1c | |||
| b329f232f2 | |||
| 713922d2ee | |||
| 74d11f8305 | |||
| ea920717a1 | |||
| e1b49f6be0 | |||
| 1be405ca93 | |||
| e63e3e707f | |||
| aeaec32dcb | |||
| b000c25e66 | |||
| d78b83054e | |||
| 808f327318 | |||
| 849b69b31a | |||
| bd849d3b70 | |||
| 8cb21fc4f1 | |||
| 21485c7db7 | |||
| 4628b14a0b | |||
| f176c82980 | |||
| 4cf6825e42 | |||
| 32a7228370 | |||
| a4d98aa31a | |||
| f779e563a6 | |||
| e7e2b1eac2 | |||
| 5410fefc1f | |||
| b514ea15a1 | |||
| 93f3a6343a | |||
| 7c66eb657e | |||
| 96ccdcd3da | |||
| f37cae406a | |||
| be87fc6b1c | |||
| 6c64195a73 | |||
| 431c2829fe | |||
| 0a3f09032e | |||
| 867e2455b3 | |||
| b74257477b | |||
| 3f3d2d1177 | |||
| 706e9552a5 | |||
| dbeb4f9f04 | |||
| f23db32429 | |||
| 40fb3f986e | |||
| 1e2faa0872 | |||
| 17698c276f | |||
| 2fa2d444a4 | |||
| 484ca246b0 | |||
| ea1d32ee01 | |||
| 874dc2942a | |||
| 185245f3eb | |||
| 3b2e2216c1 | |||
| 68dad00c2d | |||
| 1bcc345293 | |||
| d6d11cb7d0 | |||
| 670de560ed | |||
| 50042aae4e | |||
| 7480f54f84 | |||
| e986247efb | |||
| 81b0efea1c | |||
| 82fc7b4455 | |||
| 1d8d98e4d7 | |||
| 29547b2915 | |||
| ae74e72a96 | |||
| b90918c465 | |||
| d7f08fd9e5 | |||
| c4a1cd4ab4 | |||
| d563fa3cb2 | |||
| 13835b43c1 | |||
| 39de1fbdf0 | |||
| f7c2b7d5e9 | |||
| 80bd8668c1 | |||
| e8367c18bf | |||
| b08c1159f3 | |||
| 3fa9d532f8 | |||
| 914ad2a8f1 | |||
| f96fcdbcb4 | |||
| a3ff963cc9 | |||
| 8355c81f20 | |||
| 9265cd494a | |||
| 83bd2a06a0 | |||
| 600fe91da0 | |||
| 496fc09f03 | |||
| 4cb7a09ea4 | |||
| b3850f1b6e | |||
| 9f57335363 | |||
| 5f53f7110c | |||
| ab4a83dc50 | |||
| 3b3d8f011f | |||
| 09c099d0a4 | |||
| fc479b4420 | |||
| 7f80d2d9c5 | |||
| 0de92ded68 | |||
| dbf537e050 | |||
| 916b0c3051 | |||
| 28e3e15b16 | |||
| 59a75cbb79 | |||
| 0b1fd84b49 | |||
| 3b454890d8 | |||
| 1784dd9003 | |||
| f56cb39822 | |||
| a7c03d7fb2 | |||
| eb9f77f620 | |||
| 849935aee3 | |||
| bfdf96b4a1 | |||
| 894248e33c | |||
| cee24a8bf9 | |||
| 09553025dc | |||
| 52934899e8 | |||
| c607eb8895 | |||
| ac1d63a2cb | |||
| 4ce92aca27 | |||
| ddcc55ed5c | |||
| 35ebb9aed9 | |||
| b8b72ff2d4 | |||
| cfa277bbb0 | |||
| 4470a685af | |||
| 640fa3b738 | |||
| 359eba36e3 | |||
| 8a99ceda4c | |||
| c81863811e | |||
| bbf61b757d | |||
| f05bd50991 | |||
| 4504bf5eb0 | |||
| 9ecf0e5c9e | |||
| 2c5b9e55c5 | |||
| 9b61470d95 | |||
| ac3f4ce71f | |||
| 1c9ce1510d | |||
| 318995e42b | |||
| 5a3e015b6d | |||
| 3021ed49cd | |||
| 45151688c9 | |||
| 97dc8d7b68 | |||
| bfa5cee44e | |||
| 6ad2427989 | |||
| 783b7d2b91 | |||
| e8f5a803a6 | |||
| 6e3286c29a | |||
| 6d029e3fde | |||
| 3ab0224094 | |||
| b0d40591b8 | |||
| 5e2b011aca | |||
| 1facf73c05 | |||
| 9882f6f634 | |||
| 69c26af01b | |||
| 2ae3ac1c59 | |||
| 52acd4c69d | |||
| c80c59aadf | |||
| 921f500fcd | |||
| 3880dbd616 | |||
| add6de3410 | |||
| 12da4b4e60 | |||
| 0ab6d2f38e | |||
| c0368bfd19 | |||
| eab11fa7f2 | |||
| 328d61d044 | |||
| ce76544ac1 | |||
| 1d49d25f98 | |||
| 570b6e53cc | |||
| 7b6da3d13a | |||
| 28aabea1cf | |||
| a840c8b172 | |||
| 2bff13537d | |||
| b4477c5925 | |||
| ede9712513 | |||
| 7157ce169a | |||
| 937b70530c | |||
| 96796850b6 | |||
| bb79903eb9 | |||
| c7644b5f25 | |||
| 9f601a2ce1 | |||
| ffef6356f9 | |||
| fe458f78a1 | |||
| 826d7288a0 | |||
| 4cf18d42ed | |||
| 1f11ad0a09 | |||
| c95b82520a | |||
| 7435ad9c4a | |||
| f06019d2b5 | |||
| 52d9a6de14 | |||
| 50c4ff7388 | |||
| a50a0961bf | |||
| 5208c654ad | |||
| 883afbe04f | |||
| 16c45a36d2 |
+11
-1
@@ -39,7 +39,7 @@ MAIL_FROM_NAME="${APP_NAME}"
|
||||
AWS_ACCESS_KEY_ID=
|
||||
AWS_SECRET_ACCESS_KEY=
|
||||
AWS_DEFAULT_REGION=us-east-1
|
||||
AWS_BUCKET=
|
||||
AWS_BUCKET=shipping-portal-localhost
|
||||
AWS_USE_PATH_STYLE_ENDPOINT=false
|
||||
|
||||
PUSHER_APP_ID=
|
||||
@@ -60,6 +60,16 @@ PERFEXCRM_BASE_URL=""
|
||||
PERFEXCRM_API_KEY=""
|
||||
PERFEXCRM_IS_ENABLED="false"
|
||||
|
||||
VAPOR_ENV=local
|
||||
LARAVEL_VAPOR_ENABLED=false
|
||||
COMMANDS_V2_ENABLED=false
|
||||
|
||||
STORAGE_FEE_LAUNCH_DATE="2023-12-11 00:00:00"
|
||||
SST_START_DATE="2024-04-01 00:00:00"
|
||||
|
||||
E_INVOICE_START_DATE="2025-07-01 00:00:00"
|
||||
MAINTENANCE_MESSAGE_TITLE="We'll be back online on 00:00 1/7/2025"
|
||||
MAINTENANCE_MESSAGE="Sorry for the inconvenience but we're performing some maintenance at the moment."
|
||||
|
||||
OPENAI_API_KEY=""
|
||||
ANTHROPIC_API_KEY=""
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
APP_NAME=Laravel
|
||||
APP_ENV=testing
|
||||
|
||||
APP_KEY=base64:I9qXyDlm7GVu/e47+YGzLB00fA/FMA2/hMPEhqu8pUQ=
|
||||
JWT_SECRET=9j7f7vUWEzxUBjLYcQimZp5wmxHEglcjU3beog26qC4pQKENZSpfWQfv065tjZrZ
|
||||
|
||||
DB_CONNECTION=mysql
|
||||
DB_HOST=172.18.0.2
|
||||
DB_PORT=3306
|
||||
DB_DATABASE=ci_test_shipping_portal
|
||||
DB_USERNAME=ci
|
||||
DB_PASSWORD=bi9y@T8r
|
||||
+7
-1
@@ -6,6 +6,7 @@
|
||||
**/.idea/
|
||||
.env
|
||||
.env.backup
|
||||
.env.testing.example
|
||||
.phpunit.result.cache
|
||||
Homestead.json
|
||||
Homestead.yaml
|
||||
@@ -21,7 +22,12 @@ gox.iml
|
||||
rebuild_docker.sh
|
||||
docker/*
|
||||
db/*
|
||||
package-lock.json
|
||||
public/*
|
||||
/public/*
|
||||
storage/framework/laravel-excel/*
|
||||
.vapor/
|
||||
.env.production
|
||||
.env.staging
|
||||
.env.development
|
||||
docz/*
|
||||
.phpunit.cache/
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Site Under Maintenance</title>
|
||||
<style>
|
||||
body {
|
||||
font-family: Arial, sans-serif;
|
||||
background-color: #f4f4f4;
|
||||
text-align: center;
|
||||
padding: 50px;
|
||||
}
|
||||
.content {
|
||||
background: white;
|
||||
padding: 20px;
|
||||
border-radius: 10px;
|
||||
display: inline-block;
|
||||
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
setInterval(function() {
|
||||
window.location.href = "/";
|
||||
}, 60000); // 60000 ms = 1 minute, 300000 ms = 5 minutes
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="content">
|
||||
<h1>We'll be back soon!</h1>
|
||||
<p>Sorry for the inconvenience but we're performing some maintenance at the moment. We'll be back online shortly!</p>
|
||||
<p>— CIEF IZYIM</p>
|
||||
|
||||
<a href="/" class="btn">Go Back Home</a>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
Vendored
+181
@@ -0,0 +1,181 @@
|
||||
// Webhook + Gitlab git pull + Vapor
|
||||
|
||||
// def payload = readJSON text: "${payload}"
|
||||
// String userName = payload.user_name
|
||||
// String userEmail = payload.user_email
|
||||
// String httpUrl = payload.project.http_url
|
||||
|
||||
|
||||
pipeline {
|
||||
agent {
|
||||
docker {
|
||||
args '--network ci-net --group-add 992 -v /var/run/docker.sock:/var/run/docker.sock'
|
||||
image '303644228504.dkr.ecr.ap-southeast-1.amazonaws.com/jenkins-pipeline-agent-php-8.3-node-22:latest'
|
||||
registryCredentialsId "ecr:ap-southeast-1:aws-ec2-instance-iam-role"
|
||||
registryUrl "https://303644228504.dkr.ecr.ap-southeast-1.amazonaws.com"
|
||||
}
|
||||
}
|
||||
environment {
|
||||
HOME = '.'
|
||||
// DB_CONNECTION = 'mysql'
|
||||
// DB_DATABASE = 'portal_development'
|
||||
// APP_ENV = 'testing'
|
||||
}
|
||||
stages {
|
||||
stage('Download source code from Git') {
|
||||
steps {
|
||||
script{
|
||||
currentBuild.description = 'Step 1 of 6 Completed'
|
||||
println("GIT GIT_BRANCH: " + GIT_BRANCH)
|
||||
switch(GIT_BRANCH) {
|
||||
case "vapor/production":
|
||||
case "vapor/staging":
|
||||
case "vapor/development":
|
||||
case "vapor/test":
|
||||
git(
|
||||
url: 'https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal.git',
|
||||
credentialsId: 'gitlab-jenkins-localhost',
|
||||
branch: GIT_BRANCH
|
||||
)
|
||||
break
|
||||
case "origin/dillon/34-jenkins-vapor":
|
||||
git(
|
||||
url: 'https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal.git',
|
||||
credentialsId: 'gitlab-jenkins-localhost',
|
||||
branch: 'dillon/34-jenkins-vapor'
|
||||
)
|
||||
break
|
||||
}
|
||||
currentBuild.description = 'Step 2 of 6 Completed'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage('Install') {
|
||||
steps {
|
||||
sh 'composer update'
|
||||
script{
|
||||
currentBuild.description = 'Step 3 of 6 Completed'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage('Tests') {
|
||||
steps {
|
||||
// sh 'vendor/bin/phpunit tests/Unit'
|
||||
// withCredentials([
|
||||
// usernamePassword(
|
||||
// credentialsId: 'shipping-portal-dev-db-credential',
|
||||
// usernameVariable: 'DB_USERNAME',
|
||||
// passwordVariable: 'DB_PASSWORD'
|
||||
// ),
|
||||
// string(credentialsId: 'shipping-portal-dev-db-host', variable: 'DB_HOST')
|
||||
// ]) {
|
||||
// sh 'vendor/bin/phpunit --filter ListOrderTrackingLogicTest'
|
||||
// }
|
||||
sh '''
|
||||
set -e
|
||||
|
||||
export APP_ENV=testing
|
||||
# export APP_KEY=$(php -r "echo 'base64:'.base64_encode(random_bytes(32));")
|
||||
# export JWT_SECRET=$(php -r "echo bin2hex(random_bytes(32));")
|
||||
|
||||
# Show which PHP binary is used
|
||||
which php
|
||||
php -v
|
||||
|
||||
# List PHP modules to confirm pdo_mysql
|
||||
php -m | grep pdo_mysql || echo "pdo_mysql not loaded"
|
||||
|
||||
# Show DB environment variables
|
||||
echo "DB_CONNECTION=$DB_CONNECTION"
|
||||
echo "DB_HOST=$DB_HOST"
|
||||
echo "DB_PORT=$DB_PORT"
|
||||
echo "DB_DATABASE=$DB_DATABASE"
|
||||
echo "DB_USERNAME=$DB_USERNAME"
|
||||
# Do NOT echo password in logs
|
||||
|
||||
php artisan migrate:fresh --force
|
||||
|
||||
vendor/bin/phpunit -c phpunit.ci.xml --group ok_to_run
|
||||
|
||||
'''
|
||||
script {
|
||||
currentBuild.description = 'Step 4 of 6 Completed'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage('Deploy') {
|
||||
steps {
|
||||
script{
|
||||
String gitCommitMessage = getCommitMessage()
|
||||
println("GIT CommitMessage: " + gitCommitMessage)
|
||||
println("GIT GIT_BRANCH: " + GIT_BRANCH)
|
||||
switch(GIT_BRANCH) {
|
||||
case "vapor/production":
|
||||
sh "vendor/bin/vapor deploy production --message='${gitCommitMessage}'"
|
||||
break
|
||||
case "vapor/staging":
|
||||
sh "vendor/bin/vapor deploy staging --message='${gitCommitMessage}'"
|
||||
break
|
||||
case "vapor/development":
|
||||
sh "vendor/bin/vapor deploy development --message='${gitCommitMessage}'"
|
||||
break
|
||||
case "vapor/test":
|
||||
sh "vendor/bin/vapor deploy test --message='${gitCommitMessage}'"
|
||||
break
|
||||
case "origin/dillon/34-jenkins-vapor":
|
||||
sh "vendor/bin/vapor deploy development --message='${gitCommitMessage}'"
|
||||
break
|
||||
}
|
||||
currentBuild.description = 'Step 5 of 6 Completed'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage('Cleanup') {
|
||||
steps {
|
||||
script {
|
||||
try {
|
||||
sh '''
|
||||
echo "Starting Docker cleanup..."
|
||||
|
||||
# Remove stopped containers
|
||||
docker container prune -f
|
||||
|
||||
# Remove unused networks
|
||||
docker network prune -f
|
||||
|
||||
# Remove unused images
|
||||
docker image prune -a -f
|
||||
|
||||
# Remove unused build cache
|
||||
docker builder prune -f
|
||||
|
||||
echo "Docker cleanup completed."
|
||||
|
||||
docker system df
|
||||
'''
|
||||
} catch (Exception e) {
|
||||
echo "Error during cleanup: ${e.message}"
|
||||
}
|
||||
|
||||
currentBuild.description = 'Step 6 of 6 Completed'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@NonCPS
|
||||
String getCommitMessage(){
|
||||
commitMessage = " "
|
||||
for ( changeLogSet in currentBuild.changeSets){
|
||||
for (entry in changeLogSet.getItems()){
|
||||
commitMessage = entry.msg
|
||||
}
|
||||
}
|
||||
commitMessage = commitMessage.replace("'", "`")
|
||||
return commitMessage
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\Exceptions;
|
||||
|
||||
use App\Classes\ValueObjects\Constants\HttpStatus;
|
||||
|
||||
final class CriteriaNotFulfilledException extends ServiceApiException {
|
||||
public function __construct(?string $message = null) {
|
||||
parent::__construct(
|
||||
$message ?? 'One or more required criteria were not fulfilled.',
|
||||
HttpStatus::VALIDATION_FAILED
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
namespace App\Classes\General;
|
||||
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Carbon\Carbon;
|
||||
use Maatwebsite\Excel\Concerns\Exportable;
|
||||
|
||||
class AWSS3Helper
|
||||
{
|
||||
/**
|
||||
* @param string $exportFileName
|
||||
* @param Exportable $exportableObject
|
||||
* @return string
|
||||
*/
|
||||
static function S3Exportable($exportFileName, $exportableObject){
|
||||
//Step 1: Upload to S3
|
||||
$filePathForS3 = 'temp/' . $exportFileName;
|
||||
$exportableObject->store($filePathForS3, 's3');
|
||||
|
||||
//Step 2: Return temporary URL from S3
|
||||
$temporaryUrl = Storage::disk('s3')->temporaryUrl(
|
||||
$filePathForS3,
|
||||
Carbon::now()->addMinutes(10)
|
||||
);
|
||||
|
||||
return $temporaryUrl;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $exportFileName
|
||||
* @param string|resource $contents
|
||||
* @return string
|
||||
*/
|
||||
static function S3PDF($exportFileName, $contents){
|
||||
//Step 1: Upload to S3
|
||||
$filePathForS3 = 'temp/' . $exportFileName;
|
||||
Storage::disk('s3')->put($filePathForS3, $contents);
|
||||
|
||||
//Step 2: Return temporary URL from S3
|
||||
$temporaryUrl = Storage::disk('s3')->temporaryUrl(
|
||||
$filePathForS3,
|
||||
Carbon::now()->addMinutes(10)
|
||||
);
|
||||
|
||||
return $temporaryUrl;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -16,6 +16,7 @@ use Illuminate\Http\Resources\Json\JsonResource;
|
||||
use Illuminate\Http\Resources\Json\ResourceCollection;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use App\Classes\Exceptions\JobResourceNotFoundException;
|
||||
use App\Classes\General\LogHelper;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
abstract class AbstractControllerLogic
|
||||
@@ -65,7 +66,7 @@ abstract class AbstractControllerLogic
|
||||
|
||||
} catch (ErrorException|GeneralExceptions|TypeError $exception){
|
||||
if ($exception instanceof JobResourceNotFoundException) {
|
||||
Log::channel('vue_polling')->info(sprintf(
|
||||
LogHelper::channel('vue_polling')->info(sprintf(
|
||||
"Uncaught exception '%s' with message '%s' in %s:%d",
|
||||
get_class($exception),
|
||||
$exception->getMessage(),
|
||||
|
||||
@@ -19,22 +19,29 @@ abstract class AbstractGetRecord
|
||||
/**
|
||||
* @return Collection
|
||||
*/
|
||||
private function getQueryFilters(){
|
||||
private function getQueryFilters()
|
||||
{
|
||||
return $this->filters->except(self::DECORATION_FILTERS);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Collection
|
||||
*/
|
||||
public function getDecorationFilters(){
|
||||
public function getDecorationFilters()
|
||||
{
|
||||
return $this->filters->only(self::DECORATION_FILTERS);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param null|string $json
|
||||
* @param null|string|array $json
|
||||
* @return array
|
||||
*/
|
||||
public function deserializeFilters(?string $json): array {
|
||||
public function deserializeFilters($json): array
|
||||
{
|
||||
if (is_array($json)) {
|
||||
return $json;
|
||||
}
|
||||
|
||||
return $json !== null ? collect(json_decode($json))->toArray() : [];
|
||||
}
|
||||
|
||||
@@ -50,7 +57,8 @@ abstract class AbstractGetRecord
|
||||
* @param array $filters
|
||||
* @return mixed
|
||||
*/
|
||||
public function handler(array $filters, array $params = []){
|
||||
public function handler(array $filters, array $params = [])
|
||||
{
|
||||
$this->filters = collect($filters);
|
||||
return $this->getResults($this->applyFiltersToQuery(), $params);
|
||||
}
|
||||
|
||||
@@ -17,4 +17,4 @@ class HasInvoiceStatusIn implements Filter
|
||||
$query->where('type', 1)->whereIn('status', $value);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\General\Eloquent\Filters;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class HasParcelWithTransportBetweenDate implements Filter
|
||||
{
|
||||
public static function apply(Builder $builder, $value)
|
||||
{
|
||||
if (is_string($value)) {
|
||||
$value = json_decode($value, true) ?? [];
|
||||
}
|
||||
|
||||
$startDate = Carbon::make(data_get($value, 'start_date'));
|
||||
$endDate = Carbon::make(data_get($value, 'end_date'));
|
||||
|
||||
$start = $startDate ? $startDate->startOfDay() : null;
|
||||
$end = $endDate ? $endDate->endOfDay() : null;
|
||||
|
||||
if (!$start && !$end) return $builder;
|
||||
if ($start && $end && $start->gt($end)) [$start, $end] = [$end, $start];
|
||||
|
||||
return $builder->whereHas('transports', function (Builder $q) use ($start, $end) {
|
||||
if ($start && $end && $start->isSameDay($end)) {
|
||||
return $q->whereDate('drop_date', $start->toDateString());
|
||||
}
|
||||
if ($start && $end) {
|
||||
return $q->whereBetween('drop_date', [$start, $end]);
|
||||
}
|
||||
return $start
|
||||
? $q->where('drop_date', '>=', $start)
|
||||
: $q->where('drop_date', '<=', $end);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\General\Eloquent\Filters;
|
||||
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
|
||||
class MarkingIn implements Filter
|
||||
{
|
||||
|
||||
/**
|
||||
* @param Builder $builder
|
||||
* @param $value
|
||||
* @return Builder|mixed
|
||||
*/
|
||||
public static function apply(Builder $builder, $value)
|
||||
{
|
||||
return $builder->whereHas('companyModules', function ($module) use ($value) {
|
||||
$module->whereHas('connections', function ($connection) use ($value) {
|
||||
$connection->whereIn('invitee_reference', $value);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\General\Eloquent\Filters;
|
||||
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
|
||||
class OrderTrackingId implements Filter
|
||||
{
|
||||
|
||||
/**
|
||||
* @param Builder $builder
|
||||
* @param $value
|
||||
* @return Builder|mixed
|
||||
*/
|
||||
public static function apply(Builder $builder, $value)
|
||||
{
|
||||
return $builder->where('order_tracking_id', $value);
|
||||
}
|
||||
|
||||
}
|
||||
+36
-1
@@ -23,10 +23,45 @@ class PackingListLimitOneByTypeOrderedByInvoiceDate implements Filter
|
||||
$join->on('transactions.owner_id', '=', 'packing_lists.id');
|
||||
$join->where('transactions.owner_type', '=', PackingList::class);
|
||||
$join->where('transactions.status', '=', ApprovalStatus::APPROVED);
|
||||
$join->whereNull('transactions.deleted_at');
|
||||
$join->whereRaw('(transactions.type <> 16 OR transactions.id = (
|
||||
SELECT id FROM transactions WHERE owner_id = packing_lists.id AND type = 16 LIMIT 1
|
||||
))');
|
||||
})->orderBy('transactions.updated_at', 'DESC');
|
||||
}
|
||||
|
||||
//Original with problem
|
||||
// return $builder->select('packing_lists.*')->join('transactions', function($join){
|
||||
// $join->on('transactions.owner_id', '=', 'packing_lists.id');
|
||||
// $join->where('transactions.owner_type', '=', PackingList::class);
|
||||
// $join->where('transactions.status', '=', ApprovalStatus::APPROVED);
|
||||
// $join->whereNull('transactions.deleted_at');
|
||||
// $join->whereRaw('(transactions.type <> 16 OR transactions.id = (
|
||||
// SELECT id FROM transactions WHERE owner_id = packing_lists.id AND type = 16 LIMIT 1
|
||||
// ))');
|
||||
// })->orderBy('transactions.updated_at', 'DESC');
|
||||
|
||||
//Attempt 1
|
||||
// return $builder->with(['transactions' => function ($query) {
|
||||
// $query->where('status', ApprovalStatus::APPROVED)
|
||||
// ->whereNull('deleted_at')
|
||||
// ->whereRaw('(
|
||||
// transactions.type <> 16 OR transactions.id = (
|
||||
// SELECT id FROM transactions AS t2
|
||||
// WHERE t2.owner_id = transactions.owner_id
|
||||
// AND t2.owner_type = ?
|
||||
// AND t2.type = 16
|
||||
// LIMIT 1
|
||||
// )
|
||||
// )', [PackingList::class])
|
||||
// ->orderBy('updated_at', 'DESC');
|
||||
// }]);
|
||||
|
||||
//Attempt 2
|
||||
// return $builder->with(['transactions' => function ($query) {
|
||||
// $query->where('status', ApprovalStatus::APPROVED)
|
||||
// ->where('type', '<>', 16 )
|
||||
// ->whereNull('deleted_at')
|
||||
// ->orderBy('updated_at', 'DESC');
|
||||
// }]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,6 +23,7 @@ class PackingListOrderedByInvoiceDate implements Filter
|
||||
$join->on('transactions.owner_id', '=', 'packing_lists.id');
|
||||
$join->where('transactions.owner_type', '=', PackingList::class);
|
||||
$join->where('transactions.status', '=', ApprovalStatus::APPROVED);
|
||||
$join->whereNull('transactions.deleted_at');
|
||||
})->orderBy('transactions.updated_at', 'DESC');
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\General\Eloquent\Filters;
|
||||
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
|
||||
class TrackingNo implements Filter
|
||||
{
|
||||
|
||||
/**
|
||||
* @param Builder $builder
|
||||
* @param $value
|
||||
* @return Builder|mixed
|
||||
*/
|
||||
public static function apply(Builder $builder, $value)
|
||||
{
|
||||
return $builder->where('tracking_no', $value)
|
||||
->where(function ($query) {
|
||||
$query->whereNotNull('tracking_english')
|
||||
->orWhereNotNull('remark_english');
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\General\Eloquent\Filters;
|
||||
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
|
||||
class TypeNotIn implements Filter
|
||||
{
|
||||
|
||||
/**
|
||||
* @param Builder $builder
|
||||
* @param $value
|
||||
* @return Builder|mixed
|
||||
*/
|
||||
public static function apply(Builder $builder, $value)
|
||||
{
|
||||
return $builder->whereNotIn('type', $value);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -3,6 +3,8 @@ namespace App\Classes\General;
|
||||
|
||||
use Illuminate\Support\Str;
|
||||
use Illuminate\Support\Facades\Cache;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Carbon\Carbon;
|
||||
|
||||
class ExcelHandel
|
||||
{
|
||||
@@ -67,9 +69,23 @@ class ExcelHandel
|
||||
public static function generateExcel($path = '', $exceldata = '', $filename = '', $extension = '')
|
||||
{
|
||||
$file_info = [];
|
||||
$file = \Storage::disk('public')->put('excels/' . $path . '/' . $filename . '.' . $extension, $exceldata);
|
||||
$file_info['original']['file'] = storage_path('app/public/excels/' . $path . '/' . $filename . '.' . $extension);
|
||||
|
||||
$filesystemDriver = Storage::getDefaultDriver();
|
||||
if($filesystemDriver === 's3'){
|
||||
$filePathForS3 = 'public/excels/' . $path . '/' . $filename . '.' . $extension;
|
||||
Storage::disk('s3')->put($filePathForS3, $exceldata);
|
||||
|
||||
$temporaryUrl = Storage::disk('s3')->temporaryUrl(
|
||||
$filePathForS3,
|
||||
Carbon::now()->addMinutes(10)
|
||||
);
|
||||
|
||||
$file_info['original']['file'] = $temporaryUrl; //REMINDER: This is a path to AWS S3 URL (HTTPS) as a public anonymous user, NOT an internal system path
|
||||
}
|
||||
else{
|
||||
$file = Storage::disk('public')->put('excels/' . $path . '/' . $filename . '.' . $extension, $exceldata);
|
||||
$file_info['original']['file'] = storage_path('app/public/excels/' . $path . '/' . $filename . '.' . $extension);
|
||||
}
|
||||
|
||||
return $file_info;
|
||||
}
|
||||
|
||||
@@ -84,4 +100,4 @@ class ExcelHandel
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,4 +49,79 @@ class Helper
|
||||
static function collectionResponse(ResourceCollection $collection){
|
||||
return json_decode($collection->response()->getContent(), true);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param null|string $json
|
||||
* @return array
|
||||
*/
|
||||
static function deserializeFilters(?string $json): array {
|
||||
return $json !== null ? collect(json_decode($json))->toArray() : [];
|
||||
}
|
||||
|
||||
public static function getLHDNStateCodeByName($name)
|
||||
{
|
||||
$path = resource_path('data/lhdn/StateCodes.json');
|
||||
|
||||
if (!file_exists($path)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$json = file_get_contents($path);
|
||||
$data = json_decode($json, true);
|
||||
|
||||
if (!is_array($data)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$name = strtolower(trim($name));
|
||||
|
||||
// Step 1: Try exact match
|
||||
foreach ($data as $item) {
|
||||
if (
|
||||
isset($item['State']) &&
|
||||
strtolower(trim($item['State'])) === $name
|
||||
) {
|
||||
return $item['Code'] ?? null;
|
||||
}
|
||||
}
|
||||
|
||||
// Step 2: Try partial match
|
||||
foreach ($data as $item) {
|
||||
if (
|
||||
isset($item['State']) &&
|
||||
str_contains(strtolower($item['State']), $name)
|
||||
) {
|
||||
return $item['Code'] ?? null;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public static function getLHDNMsicDescriptionByCode($code)
|
||||
{
|
||||
$path = resource_path('data/lhdn/MSICSubCategoryCodes.json');
|
||||
|
||||
if (!file_exists($path)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$json = file_get_contents($path);
|
||||
$data = json_decode($json, true);
|
||||
|
||||
if (!is_array($data)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
foreach ($data as $item) {
|
||||
if (
|
||||
isset($item['Code']) &&
|
||||
$item['Code'] === $code
|
||||
) {
|
||||
return $item['Description'] ?? null;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\General\Interfaces;
|
||||
|
||||
|
||||
use Illuminate\Database\Eloquent\Relations\MorphMany;
|
||||
|
||||
interface KeyValueInterface
|
||||
{
|
||||
|
||||
public function attributesKVP(): morphMany;
|
||||
}
|
||||
@@ -10,4 +10,4 @@ interface Steppable
|
||||
|
||||
public function steps(): morphMany;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\General;
|
||||
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class LogHelper
|
||||
{
|
||||
private String $channelName;
|
||||
|
||||
public static function channel($channelName): self
|
||||
{
|
||||
$logHelper = new self;
|
||||
$logHelper->channelName = $channelName;
|
||||
return $logHelper;
|
||||
}
|
||||
|
||||
public function info($message)
|
||||
{
|
||||
$envVar = env('LARAVEL_VAPOR_ENABLED');
|
||||
$isLocal = env('VAPOR_ENV') === 'local';
|
||||
if($envVar)
|
||||
{
|
||||
Log::info("Info: {$message}, channelName: {$this->channelName}, envVar {$envVar}");
|
||||
}
|
||||
|
||||
if ($envVar && !$isLocal) {
|
||||
Log::channel($this->channelName.'_vapor')->info($message);
|
||||
}
|
||||
else{
|
||||
Log::channel($this->channelName)->info($message);
|
||||
}
|
||||
}
|
||||
|
||||
public function warning($message)
|
||||
{
|
||||
$envVar = env('LARAVEL_VAPOR_ENABLED');
|
||||
$isLocal = env('VAPOR_ENV') === 'local';
|
||||
if($envVar)
|
||||
{
|
||||
Log::info("Warning: {$message}, channelName: {$this->channelName}, envVar {$envVar}");
|
||||
}
|
||||
|
||||
if ($envVar && !$isLocal) {
|
||||
Log::channel($this->channelName . '_vapor')->warning($message);
|
||||
} else {
|
||||
Log::channel($this->channelName)->warning($message);
|
||||
}
|
||||
}
|
||||
|
||||
public function error($message)
|
||||
{
|
||||
$envVar = env('LARAVEL_VAPOR_ENABLED');
|
||||
$isLocal = env('VAPOR_ENV') === 'local';
|
||||
if($envVar)
|
||||
{
|
||||
Log::info("Error: {$message}, channelName: {$this->channelName}, envVar {$envVar}");
|
||||
}
|
||||
|
||||
if ($envVar && !$isLocal) {
|
||||
Log::channel($this->channelName . '_vapor')->error($message);
|
||||
} else {
|
||||
Log::channel($this->channelName)->error($message);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\General;
|
||||
|
||||
use Illuminate\Support\Facades\Route;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class UrlHelper {
|
||||
public static function getRouteParametersFromUrl($url) {
|
||||
$parsedUrl = parse_url($url);
|
||||
$path = $parsedUrl['path'];
|
||||
|
||||
$routes = Route::getRoutes();
|
||||
|
||||
foreach ($routes as $route) {
|
||||
$request = Request::create($path, 'GET');
|
||||
$route->bind($request);
|
||||
if ($route->matches($request)) {
|
||||
return $route->parameters();
|
||||
}
|
||||
}
|
||||
|
||||
return [];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\Jobs\Commands\V2;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use App\Classes\Modules\Transactions\Processors\ApproveShippingInvoiceTransactionProcessor;
|
||||
use App\Classes\ValueObjects\Constants\ApprovalStatus;
|
||||
use App\Classes\ValueObjects\Constants\TransactionType;
|
||||
use App\Models\Transaction;
|
||||
use Exception;
|
||||
|
||||
class ApproveInvoiceV2CommandJob implements ShouldQueue
|
||||
{
|
||||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||||
|
||||
|
||||
public function handle()
|
||||
{
|
||||
Log::info(Carbon::now() . ': Start job - Approve Invoice Command.');
|
||||
$start = new Carbon();
|
||||
|
||||
$invoices = Transaction::where('type', TransactionType::SHIPPING_INVOICE)->where('status', ApprovalStatus::PENDING_SUBMISSION)->get();
|
||||
|
||||
foreach ($invoices as $invoice) {
|
||||
$packingList = $invoice->owner;
|
||||
$order = $packingList->owner;
|
||||
|
||||
try {
|
||||
(App()->make(ApproveShippingInvoiceTransactionProcessor::class))->execute($packingList);
|
||||
Log::info('Invoice Approved for reference ' . $order->reference . '.');
|
||||
} catch (Exception $exception) {
|
||||
Log::info('Failed to Approve invoice for reference ' . $order->reference . '. Exception: ' . $exception->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
$end = new Carbon();
|
||||
$elapsedTime = $start->diff($end)->format('%H:%I:%S');
|
||||
Log::info(Carbon::now() . ': End job - Approve Invoice Command. ElapsedTime: ' . $elapsedTime . '.');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\Jobs\Commands\V2;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use App\Classes\ValueObjects\Constants\ApprovalStatus;
|
||||
use App\Classes\ValueObjects\Constants\PaymentMethodType;
|
||||
use App\Classes\ValueObjects\Constants\TransactionType;
|
||||
use App\Models\Transaction;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
|
||||
class AuditBillplzInvoiceV2CommandJob implements ShouldQueue
|
||||
{
|
||||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||||
|
||||
|
||||
public function handle()
|
||||
{
|
||||
Log::info(Carbon::now() . ': Start job - Audit Billplz Invoice.');
|
||||
$start = new Carbon();
|
||||
|
||||
// ini_set('memory_limit', '-1');
|
||||
|
||||
$transactions = Transaction::where('type', TransactionType::SHIPPING_INVOICE)->where('status', ApprovalStatus::COMPLETED)->whereHas('transactions', function($query){
|
||||
return $query->where('type', TransactionType::PAYMENT)->where('payment_method', PaymentMethodType::PAYMENT_GATEWAY)->where('status', ApprovalStatus::REJECTED);
|
||||
})->get();
|
||||
|
||||
$totalTransactions = count($transactions);
|
||||
$counter = 1;
|
||||
$totalAmount = 0;
|
||||
foreach ($transactions as $transaction){
|
||||
$payment_transaction = $transaction->transactions->sortByDesc('created_at')->first();
|
||||
|
||||
if ($payment_transaction->status === ApprovalStatus::REJECTED) {
|
||||
Log::info($counter . ' of ' . $totalTransactions . '. Order Marking: '. $payment_transaction->owner->owner->owner->reference . '. Transaction Id: '. $payment_transaction->id . '. Invoice Id: '. $transaction->id . ' - Date: '.$payment_transaction->created_at->format('d-m-Y').' - Amount: '. $payment_transaction->amount);
|
||||
|
||||
$totalAmount += $transaction->amount;
|
||||
|
||||
$counter++;
|
||||
}
|
||||
}
|
||||
|
||||
$end = new Carbon();
|
||||
$elapsedTime = $start->diff($end)->format('%H:%I:%S');
|
||||
Log::info(Carbon::now() . ': End job - Audit Billplz Invoice. ElapsedTime: ' . $elapsedTime . '. Total: ' . $totalAmount);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\Jobs\Commands\V2;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use App\Classes\ValueObjects\Constants\ApprovalStatus;
|
||||
use App\Classes\ValueObjects\Constants\PaymentMethodType;
|
||||
use App\Classes\ValueObjects\Constants\TransactionType;
|
||||
use App\Models\Transaction;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class AuditBillplzPaymentV2CommandJob implements ShouldQueue
|
||||
{
|
||||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||||
|
||||
|
||||
public function handle()
|
||||
{
|
||||
Log::info(Carbon::now() . ': Start job - Audit Billplz Payment.');
|
||||
$start = new Carbon();
|
||||
|
||||
// ini_set('memory_limit', '-1');
|
||||
|
||||
$transactions = Transaction::where('type', TransactionType::PAYMENT)->where('payment_method', PaymentMethodType::PAYMENT_GATEWAY)->whereIn('status', [ApprovalStatus::COMPLETED, ApprovalStatus::APPROVED])->get();
|
||||
$totalTransactions = count($transactions);
|
||||
$counter = 1;
|
||||
$totalAmount = 0;
|
||||
foreach ($transactions as $transaction){
|
||||
$response = Http::withBasicAuth(config('billplz.api_key').':', '')->get(config('billplz.base_url').'/api/v3/bills/'.$transaction->payment_reference);
|
||||
|
||||
if($response->successful()){
|
||||
$data = $response->json();
|
||||
if($data['paid']){
|
||||
|
||||
} else {
|
||||
$totalAmount += $transaction->amount;
|
||||
Log::info($counter . ' of ' . $totalTransactions . '. Order: '. $transaction->owner->owner->owner->reference . ' - Date: '.$transaction->owner->created_at->format('d-m-Y').' - Amount: '. $transaction->amount);
|
||||
}
|
||||
}else{
|
||||
Log::info("billplz error</br>");
|
||||
}
|
||||
$counter++;
|
||||
}
|
||||
|
||||
$end = new Carbon();
|
||||
$elapsedTime = $start->diff($end)->format('%H:%I:%S');
|
||||
Log::info(Carbon::now() . ': End job - Audit Billplz Payment. ElapsedTime: ' . $elapsedTime . '. Total: ' . $totalAmount);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\Jobs\Commands\V2;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use App\Classes\Modules\PackingLists\Services\ListsPackingLists;
|
||||
use App\Classes\Modules\Transactions\Processors\CreateInvoiceTransactionProcessor;
|
||||
use App\Classes\ValueObjects\Constants\ApprovalStatus;
|
||||
use App\Models\Order;
|
||||
use Exception;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class AutoGenerateInvoiceV2CommandJob implements ShouldQueue
|
||||
{
|
||||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||||
|
||||
|
||||
public function handle()
|
||||
{
|
||||
Log::info(Carbon::now() . ': Start job - Auto generate invoice.');
|
||||
$start = new Carbon();
|
||||
|
||||
$packingLists = (App()->make(ListsPackingLists::class))->execute(['does_not_have_transaction_type' => 1, 'type' => 2]);
|
||||
|
||||
if (count($packingLists)) {
|
||||
|
||||
foreach ($packingLists as $packingList) {
|
||||
$order = $packingList->owner;
|
||||
if (!($order instanceof Order)) {
|
||||
Log::info('Failed to generate invoice for reference' . $order->reference . '. It is not an instance of Order.');
|
||||
continue;
|
||||
}
|
||||
|
||||
$companyModule = $order->companyModule;
|
||||
$billingAddress = $companyModule->addresses()->where('type', \App\Classes\ValueObjects\Constants\AddressType::BILLING)->first();
|
||||
$deliveryAddress = $order->addresses()->where('status', ApprovalStatus::APPROVED)->first();
|
||||
|
||||
$postCodes = \App\Models\SegmentConstant::whereIn('reference', ['CENTER_POSTCODE', 'OUTSTATION_POSTCODE'])->get()->pluck('value')->flatten();
|
||||
|
||||
if (!!$billingAddress && in_array($deliveryAddress->postcode, $postCodes->toArray())) {
|
||||
try {
|
||||
(App()->make(CreateInvoiceTransactionProcessor::class))->execute($packingList);
|
||||
Log::info('Invoice generated for reference ' . $order->reference . '.');
|
||||
} catch (Exception $exception) {
|
||||
Log::info('Failed to generate invoice for reference ' . $order->reference . '. Exception: ' . $exception->getMessage());
|
||||
}
|
||||
}
|
||||
else{
|
||||
Log::info('Failed to generate invoice for reference ' . $order->reference . '. Billing Address is not defined / Postcode area is not defined.');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$end = new Carbon();
|
||||
$elapsedTime = $start->diff($end)->format('%H:%I:%S');
|
||||
Log::info(Carbon::now() . ': End job - Auto generate invoice. ElapsedTime: ' . $elapsedTime . '.');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\Jobs\Commands\V2;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use App\Classes\ValueObjects\Constants\PaymentMethodType;
|
||||
use App\Classes\ValueObjects\Constants\TransactionType;
|
||||
use App\Models\Transaction;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class CheckDeletedInvoiceButPaidV2CommandJob implements ShouldQueue
|
||||
{
|
||||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||||
|
||||
|
||||
public function handle()
|
||||
{
|
||||
Log::info(Carbon::now() . ': Start job - Check all deleted invoice but has completed payment.');
|
||||
$start = new Carbon();
|
||||
|
||||
// ini_set('memory_limit', '-1');
|
||||
|
||||
$totalAmount = 0;
|
||||
|
||||
$softDeletedTransactions = Transaction::onlyTrashed()->where('type', TransactionType::SHIPPING_INVOICE)->whereHas('transactions', function (Builder $query) {
|
||||
$query->where('type', TransactionType::PAYMENT)->where('payment_method', PaymentMethodType::PAYMENT_GATEWAY);
|
||||
})->get();
|
||||
|
||||
foreach ($softDeletedTransactions as $invoice) {
|
||||
$invoice_payments = $invoice->transactions()->payments()->get();
|
||||
|
||||
foreach($invoice_payments as $invoice_payment) {
|
||||
|
||||
$response = Http::withBasicAuth(config('billplz.api_key').':', '')->get(config('billplz.base_url').'/api/v3/bills/'.$invoice_payment->payment_reference);
|
||||
|
||||
if($response->successful()){
|
||||
$data = $response->json();
|
||||
|
||||
$orderReference = $invoice->owner->owner->reference ?? null;
|
||||
|
||||
if($data['paid']){
|
||||
Log::info('Invoice id: ' . $invoice->id. '. Payment id: ' . $invoice_payment->id . '. Order: ' . $orderReference);
|
||||
} else {
|
||||
|
||||
}
|
||||
}else{
|
||||
Log::info("billplz error</br>");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$end = new Carbon();
|
||||
$elapsedTime = $start->diff($end)->format('%H:%I:%S');
|
||||
Log::info(Carbon::now() . ': End job - Check all deleted invoice but has completed payment. ElapsedTime: ' . $elapsedTime . '. Total: ' . $totalAmount);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\Jobs\Commands\V2;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use App\Classes\Modules\Transactions\Services\ListsGroups;
|
||||
use App\Classes\Modules\Transactions\Processors\CheckStorageInvoiceTransactionProcessor;
|
||||
use App\Models\Order;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class CheckStorageInvoicesGroupTransactionsV2CommandJob implements ShouldQueue
|
||||
{
|
||||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||||
|
||||
public function handle()
|
||||
{
|
||||
Log::info(Carbon::now() . ': Start job - Check all pending group payment with storage invoice is valid.');
|
||||
$start = new Carbon();
|
||||
|
||||
|
||||
$newfilters['order_by_updated_at_desc'] = true;
|
||||
$newfilters['status_in'] = [0, 1];
|
||||
$groups = (App()->make(ListsGroups::class))->execute($newfilters);
|
||||
|
||||
foreach ($groups as $group){
|
||||
Log::info('CheckForStorageInvoiceByTransactions group: '.json_encode($group));
|
||||
foreach ($group->groupTransactions as $groupTransaction) {
|
||||
$invoice = $groupTransaction->transaction;
|
||||
$packingList = $invoice->owner()->first();
|
||||
if($packingList){
|
||||
$order = $packingList->owner()->first();
|
||||
if($order instanceof Order){
|
||||
$storages = (App()->make(CheckStorageInvoiceTransactionProcessor::class))->executeOrder($order);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$end = new Carbon();
|
||||
$elapsedTime = $start->diff($end)->format('%H:%I:%S');
|
||||
Log::info(Carbon::now() . ': End job - Check all pending group payment with storage invoice is valid. ElapsedTime: ' . $elapsedTime . '.');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\Jobs\Commands\V2;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use App\Classes\Modules\Orders\Services\ListsOrders;
|
||||
use App\Classes\Modules\Transactions\Processors\CheckStorageInvoiceTransactionProcessor;
|
||||
use App\Classes\ValueObjects\Constants\OrderType;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class CheckStorageInvoicesOrdersV2CommandJob implements ShouldQueue
|
||||
{
|
||||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||||
|
||||
public function handle()
|
||||
{
|
||||
Log::info(Carbon::now() . ': Start job - Check all orders for storage invoice.');
|
||||
$start = new Carbon();
|
||||
|
||||
$orders = (App()->make(ListsOrders::class))->execute(['with_parcels' => true, 'type_in' => [OrderType::SHARED_CONTAINER, OrderType::DEDICATED_CONTAINER]]);
|
||||
|
||||
$count = 0;
|
||||
foreach ($orders as $order){
|
||||
try{
|
||||
$storages = (App()->make(CheckStorageInvoiceTransactionProcessor::class))->executeOrder($order);
|
||||
$count = $count + 1;
|
||||
Log::info('Order '.$count);
|
||||
}
|
||||
catch(\Exception $ex){
|
||||
Log::info('Exception '.$ex->getMessage());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$end = new Carbon();
|
||||
$elapsedTime = $start->diff($end)->format('%H:%I:%S');
|
||||
Log::info(Carbon::now() . ': End job - Check all orders for storage invoice. ElapsedTime: ' . $elapsedTime . '.');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\Jobs\Commands\V2;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use App\Classes\Modules\Orders\Services\ListsOrders;
|
||||
use App\Classes\Modules\Transactions\Processors\CheckStorageInvoiceTransactionProcessor;
|
||||
use App\Classes\ValueObjects\Constants\OrderType;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class CheckStorageInvoicesSingleOrderV2CommandJob implements ShouldQueue
|
||||
{
|
||||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||||
|
||||
protected $order;
|
||||
|
||||
public function __construct($order)
|
||||
{
|
||||
$this->order = $order;
|
||||
}
|
||||
|
||||
public function handle()
|
||||
{
|
||||
Log::info(Carbon::now() . ': Start job - Check single order for storage invoice.');
|
||||
$start = new Carbon();
|
||||
|
||||
try{
|
||||
Log::info("Processing Order - ID: {$this->order->id}, Reference: {$this->order->reference}");
|
||||
(App()->make(CheckStorageInvoiceTransactionProcessor::class))->executeOrder($this->order);
|
||||
}
|
||||
catch(\Exception $ex){
|
||||
Log::info('Exception '.$ex->getMessage());
|
||||
}
|
||||
|
||||
$end = new Carbon();
|
||||
$elapsedTime = $start->diff($end)->format('%H:%I:%S');
|
||||
Log::info(Carbon::now() . ': End job - Check single order for storage invoice. ElapsedTime: ' . $elapsedTime . '.');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\Jobs\Commands\V2;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class DummyJob implements ShouldQueue
|
||||
{
|
||||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||||
|
||||
|
||||
public function handle()
|
||||
{
|
||||
Log::info(Carbon::now() . ': Start job - Dummy.');
|
||||
$start = new Carbon();
|
||||
|
||||
|
||||
|
||||
$end = new Carbon();
|
||||
$elapsedTime = $start->diff($end)->format('%H:%I:%S');
|
||||
Log::info(Carbon::now() . ': End job - Dummy. ElapsedTime: ' . $elapsedTime . '.');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\Jobs\Commands\V2;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use App\Classes\Modules\Billplzs\Processors\CallbackBillplzProcessor;
|
||||
use App\Classes\ValueObjects\Constants\ApprovalStatus;
|
||||
use App\Models\Group;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class FixApprovedPaymentFailedGroupV2CommandJob implements ShouldQueue
|
||||
{
|
||||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||||
|
||||
public function handle()
|
||||
{
|
||||
Log::info(Carbon::now() . ': Start job - Fix all payment is approved or completed but group failed to be updated.');
|
||||
$start = new Carbon();
|
||||
|
||||
// ini_set('memory_limit', '-1');
|
||||
|
||||
// $this->outputArray = [];
|
||||
|
||||
$groups = Group::whereNotIn('status', [ApprovalStatus::APPROVED, ApprovalStatus::COMPLETED])
|
||||
->whereHas('payment', function ($query) {
|
||||
$query->whereIn('status', [2, 3]);
|
||||
})->get();
|
||||
|
||||
foreach ($groups as $group) {
|
||||
$transaction = $group->payment;
|
||||
|
||||
$response = Http::withBasicAuth(config('billplz.api_key') . ':', '')->get(config('billplz.base_url') . '/api/v3/bills/' . $transaction->payment_reference);
|
||||
|
||||
dump($transaction->payment_reference);
|
||||
|
||||
if ($response->successful()) {
|
||||
$data = $response->json();
|
||||
if ($data['paid']) {
|
||||
$status = ApprovalStatus::PENDING_VERIFICATION;
|
||||
|
||||
if ($data['state'] === 'paid') {
|
||||
$status = ApprovalStatus::APPROVED;
|
||||
}
|
||||
|
||||
Log::info(Carbon::now() . ' : Fixing ' . $transaction->payment_reference);
|
||||
(App()->make(CallbackBillplzProcessor::class))->execute($transaction, $status);
|
||||
}
|
||||
} else {
|
||||
Log::info("billplz error");
|
||||
}
|
||||
}
|
||||
|
||||
$end = new Carbon();
|
||||
$elapsedTime = $start->diff($end)->format('%H:%I:%S');
|
||||
|
||||
// if ($groups) {
|
||||
// $this->info(Carbon::now() . ' : Done . ElapsedTime: ' . $elapsedTime);
|
||||
// }
|
||||
|
||||
$end = new Carbon();
|
||||
$elapsedTime = $start->diff($end)->format('%H:%I:%S');
|
||||
Log::info(Carbon::now() . ': End job - Fix all payment is approved or completed but group failed to be updated. ElapsedTime: ' . $elapsedTime . '.');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\Jobs\Commands\V2;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use App\Classes\Modules\Billplzs\Processors\CallbackBillplzProcessor;
|
||||
use App\Classes\Modules\Billplzs\Services\GetBillplzBill;
|
||||
use App\Classes\Modules\Orders\Processors\UpdateDoFromVTPortalProcessor;
|
||||
use App\Classes\Modules\Orders\Processors\UpdateDoFromYDPortalProcessor;
|
||||
use App\Classes\Modules\Transactions\Services\FetchesTransaction;
|
||||
use App\Classes\Modules\Transactions\Services\UpdatesTransactionStatus;
|
||||
use App\Classes\ValueObjects\Constants\ApprovalStatus;
|
||||
use App\Classes\ValueObjects\Constants\PaymentMethodType;
|
||||
use App\Classes\ValueObjects\Constants\TransactionType;
|
||||
use App\Models\Transaction;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class FixBillplzFailedCallbackPaymentV2CommandJob implements ShouldQueue
|
||||
{
|
||||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||||
|
||||
protected $transactionId;
|
||||
|
||||
public function __construct(int $transactionId)
|
||||
{
|
||||
$this->transactionId = $transactionId;
|
||||
}
|
||||
|
||||
|
||||
public function handle()
|
||||
{
|
||||
Log::info(Carbon::now() . ': Start job - Fix failled callback from billplz.');
|
||||
$start = new Carbon();
|
||||
|
||||
$transaction = Transaction::where('id', $this->transactionId)->first();
|
||||
|
||||
Log::info('Billplz Url: '.config('billplz.base_url').'/api/v3/bills/'.$transaction->payment_reference);
|
||||
$response = Http::withBasicAuth(config('billplz.api_key').':', '')->get(config('billplz.base_url').'/api/v3/bills/'.$transaction->payment_reference);
|
||||
|
||||
if($response->successful()){
|
||||
$data = $response->json();
|
||||
if($data['paid']) {
|
||||
$status = ApprovalStatus::PENDING_VERIFICATION;
|
||||
|
||||
if($data['state'] === 'paid') {
|
||||
$status = ApprovalStatus::APPROVED;
|
||||
}
|
||||
|
||||
Log::info(Carbon::now() . ' : Fixing ' . $transaction->payment_reference);
|
||||
(App()->make(CallbackBillplzProcessor::class))->execute($transaction, $status);
|
||||
}
|
||||
}
|
||||
else{
|
||||
Log::info("billplz error");
|
||||
}
|
||||
|
||||
$end = new Carbon();
|
||||
$elapsedTime = $start->diff($end)->format('%H:%I:%S');
|
||||
Log::info(Carbon::now() . ': End job - Fix failled callback from billplz. ElapsedTime: ' . $elapsedTime . '.');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\Jobs\Commands\V2;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use App\Models\Container;
|
||||
use App\Models\ContainerPackingList;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class FixDuplicateContainerReferenceV2CommandJob implements ShouldQueue
|
||||
{
|
||||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||||
|
||||
|
||||
public function handle()
|
||||
{
|
||||
Log::info(Carbon::now() . ': Start job - Fix Duplicate Container Reference.');
|
||||
$start = new Carbon();
|
||||
|
||||
// ini_set('memory_limit', '-1');
|
||||
|
||||
|
||||
$duplicatedContainers = Container::select('reference', DB::raw('COUNT(reference) as count'))
|
||||
->groupBy('reference')
|
||||
->having('count', '>', 1)
|
||||
->get();
|
||||
|
||||
foreach ($duplicatedContainers as $duplicatedContainer) {
|
||||
$containers = Container::where('reference', $duplicatedContainer->reference)->get();
|
||||
|
||||
$containers = $containers->sortByDesc(function ($container) {
|
||||
return $container->packingLists->count();
|
||||
});
|
||||
|
||||
$firstContainer = $containers->shift();
|
||||
|
||||
foreach ($containers as $container) {
|
||||
$firstContainer->packingLists()->syncWithoutDetaching($container->packingLists);
|
||||
$container->packingLists()->detach();
|
||||
Log::info('Deleted container ' . $container->id);
|
||||
$container->delete();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$end = new Carbon();
|
||||
$elapsedTime = $start->diff($end)->format('%H:%I:%S');
|
||||
Log::info(Carbon::now() . ': End job - Fix Duplicate Container Reference. ElapsedTime: ' . $elapsedTime . '.');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\Jobs\Commands\V2;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use App\Classes\Modules\Orders\Services\FetchesOrder;
|
||||
use App\Classes\Modules\Transactions\Processors\CreateStorageInvoiceDocTransactionFixProcessor;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class FixGroupPaymentProblemV2CommandJob implements ShouldQueue
|
||||
{
|
||||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||||
|
||||
public function handle()
|
||||
{
|
||||
Log::info(Carbon::now() . ': Start job - Fix Group Payment Problem.');
|
||||
$start = new Carbon();
|
||||
|
||||
// ini_set('memory_limit', '-1');
|
||||
|
||||
/*
|
||||
$group = $this->fetchesGroup->execute(['id' => 325]);
|
||||
$this->info('FixGroupPaymentProblem group: '.json_encode($group));
|
||||
if ($group) {
|
||||
foreach ($group->groupTransactions as $groupTransaction) {
|
||||
$invoice = $groupTransaction->transaction;
|
||||
$this->info('FixGroupPaymentProblem group: '.json_encode($invoice));
|
||||
$pL = $invoice->owner;
|
||||
$this->releaseGoodsToCustomerProcessor->execute($pL, $invoice);
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
$order = (App()->make(FetchesOrder::class))->execute(['reference' => '729251424']);
|
||||
$packingLists = $order->destinationWarehousePackages;
|
||||
|
||||
foreach ($packingLists as $packingList){
|
||||
(App()->make(CreateStorageInvoiceDocTransactionFixProcessor::class))->execute($packingList, true);
|
||||
dd(json_encode($packingList));
|
||||
}
|
||||
|
||||
|
||||
$end = new Carbon();
|
||||
$elapsedTime = $start->diff($end)->format('%H:%I:%S');
|
||||
Log::info(Carbon::now() . ': End job - Fix Group Payment Problem. ElapsedTime: ' . $elapsedTime . '.');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\Jobs\Commands\V2;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use App\Classes\Modules\Jobs\DataTransferObjects\FixInvoiceV2CommandObject;
|
||||
use App\Classes\Modules\Transactions\Processors\CreateShippingInvoiceTransactionDocProcessor;
|
||||
use App\Classes\ValueObjects\Constants\DocumentType;
|
||||
use App\Classes\ValueObjects\Constants\TransactionType;
|
||||
use App\Models\CompanyConnection;
|
||||
use App\Models\Order;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class FixInvoiceV2CommandJob implements ShouldQueue
|
||||
{
|
||||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||||
|
||||
/** @var FixInvoiceV2CommandObject*/
|
||||
private $fixInvoiceV2CommandObject;
|
||||
|
||||
/**
|
||||
* FixInvoiceV2CommandJob constructor.
|
||||
* @param FixInvoiceV2CommandObject $fixInvoiceV2CommandObject
|
||||
*/
|
||||
public function __construct(FixInvoiceV2CommandObject $fixInvoiceV2CommandObject)
|
||||
{
|
||||
$this->fixInvoiceV2CommandObject = $fixInvoiceV2CommandObject;
|
||||
}
|
||||
|
||||
public function handle()
|
||||
{
|
||||
Log::info(Carbon::now() . ': Start job - Fix invoice.');
|
||||
$start = new Carbon();
|
||||
|
||||
$connection = CompanyConnection::where('invitee_reference', $this->fixInvoiceV2CommandObject->getMarking())->first();
|
||||
$company_module_id = $connection->invitee->id;
|
||||
|
||||
$orders = Order::where('company_module_id', $company_module_id)->get();
|
||||
|
||||
foreach ($orders as $order){
|
||||
$invoices = $order->transactions()->where('transactions.type', TransactionType::SHIPPING_INVOICE)->get();
|
||||
foreach ($invoices as $invoice){
|
||||
|
||||
dump($invoice->id);
|
||||
|
||||
// $invoice->documents()->delete();
|
||||
$invoice->documents()->where('document_type', DocumentType::SHIPPING_EINVOICE)->delete();
|
||||
|
||||
(App()->make(CreateShippingInvoiceTransactionDocProcessor::class))->execute($invoice);
|
||||
}
|
||||
}
|
||||
|
||||
$end = new Carbon();
|
||||
$elapsedTime = $start->diff($end)->format('%H:%I:%S');
|
||||
Log::info(Carbon::now() . ': End job - Fix invoice. ElapsedTime: ' . $elapsedTime . '.');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\Jobs\Commands\V2;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use App\Classes\Modules\PackingLists\Processors\FetchPackingListsFromYdPortalProcessor;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class FixMissingPackingListV2CommandJob implements ShouldQueue
|
||||
{
|
||||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||||
|
||||
public function handle()
|
||||
{
|
||||
Log::info(Carbon::now() . ': Start job - Fix Missing PackingList.');
|
||||
$start = new Carbon();
|
||||
|
||||
$start_date = '2024-05-05';
|
||||
$end_date = '2024-05-05';
|
||||
|
||||
$start = $start_date ? Carbon::parse($start_date) : null;
|
||||
$end = $end_date ? Carbon::parse($end_date) : null;
|
||||
|
||||
if (!$start || !$end) {
|
||||
return;
|
||||
}
|
||||
|
||||
(App()->make(FetchPackingListsFromYdPortalProcessor::class))->execute($start, $end);
|
||||
|
||||
|
||||
$end = new Carbon();
|
||||
$elapsedTime = $start->diff($end)->format('%H:%I:%S');
|
||||
Log::info(Carbon::now() . ': End job - Fix Missing PackingList. ElapsedTime: ' . $elapsedTime . '.');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\Jobs\Commands\V2;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use App\Models\PackingList;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class FixPackingListV2CommandJob implements ShouldQueue
|
||||
{
|
||||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||||
|
||||
|
||||
public function handle()
|
||||
{
|
||||
Log::info(Carbon::now() . ': Start job - Fix PackingList.');
|
||||
$start = new Carbon();
|
||||
|
||||
$packingLists = PackingList::whereDoesntHave('packages')->get();
|
||||
|
||||
if ($packingLists->isNotEmpty()) {
|
||||
|
||||
$restoredPackagesCount = 0;
|
||||
$restoredPackagesIds = [];
|
||||
|
||||
// Eager loading packages for all packing lists
|
||||
$packingLists->load(['packages' => function ($query) {
|
||||
$query->onlyTrashed();
|
||||
}]);
|
||||
|
||||
foreach ($packingLists as $packingList) {
|
||||
$deletedPackages = $packingList->packages->filter(function ($package) use ($restoredPackagesIds) {
|
||||
// Filter out packages that have already been restored
|
||||
return !in_array($package->id, $restoredPackagesIds);
|
||||
});
|
||||
|
||||
if ($deletedPackages->isNotEmpty()) {
|
||||
$groupedPackages = $deletedPackages->groupBy(function ($item) {
|
||||
return $item->only(['type', 'description', 'width', 'height', 'length', 'weight', 'quantity']);
|
||||
});
|
||||
|
||||
foreach ($groupedPackages as $group) {
|
||||
$latestPackage = $group->sortByDesc('created_at')->first();
|
||||
|
||||
// Check if the package ID is already restored before attempting to restore it
|
||||
if (!in_array($latestPackage->id, $restoredPackagesIds)) {
|
||||
$latestPackage->restore();
|
||||
Log::info('Package ID: ' . $latestPackage->id . ' has been restored');
|
||||
$restoredPackagesCount++;
|
||||
$restoredPackagesIds[] = $latestPackage->id;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Log::info('Restored Packages Count: ' . $restoredPackagesCount);
|
||||
}
|
||||
|
||||
$end = new Carbon();
|
||||
$elapsedTime = $start->diff($end)->format('%H:%I:%S');
|
||||
Log::info(Carbon::now() . ': End job - Fix PackingList. ElapsedTime: ' . $elapsedTime . '.');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\Jobs\Commands\V2;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use App\Classes\Modules\Billplzs\Processors\CallbackBillplzProcessor;
|
||||
use App\Classes\Modules\Documents\Services\ApprovesDocument;
|
||||
use App\Classes\Modules\Documents\Services\RejectsDocument;
|
||||
use App\Classes\Modules\Transactions\Services\FetchesTransaction;
|
||||
use App\Classes\Modules\Transactions\Services\UpdatesTransactionStatus;
|
||||
use App\Classes\ValueObjects\Constants\ApprovalStatus;
|
||||
use App\Models\Group;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class FixPaymentApprovalTimedOutErrorV2CommandJob implements ShouldQueue
|
||||
{
|
||||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||||
|
||||
public function handle()
|
||||
{
|
||||
Log::info(Carbon::now() . ': Start job - Fix payment approval timed out error (status 504: Endpoint request timed out).');
|
||||
$start = new Carbon();
|
||||
|
||||
$status= 'approve';
|
||||
$transactionId = 23160;
|
||||
|
||||
$transaction = (App()->make(FetchesTransaction::class))->execute(['id' => $transactionId]);
|
||||
$document = $transaction->documents()
|
||||
->where('status', ApprovalStatus::PENDING_VERIFICATION)
|
||||
->first();
|
||||
|
||||
Log::info("FixApprovedPaymentFailedGroupV2CommandJob document: ".json_encode($document));
|
||||
|
||||
if($status === 'approve') {
|
||||
// (App()->make(ApprovesDocument::class))->execute($document);
|
||||
$document->status = ApprovalStatus::APPROVED;
|
||||
// $document->approver = Auth()->user()->id;
|
||||
$document->approval_date = Carbon::now();
|
||||
$document->save();
|
||||
}
|
||||
else {
|
||||
(App()->make(RejectsDocument::class))->execute($document);
|
||||
}
|
||||
|
||||
(App()->make(UpdatesTransactionStatus::class))->execute($transaction, $status === 'approve' ? ApprovalStatus::APPROVED : ApprovalStatus::REJECTED);
|
||||
|
||||
if ($status === 'approve') {
|
||||
(App()->make(CallbackBillplzProcessor::class))->execute($transaction, ApprovalStatus::APPROVED);
|
||||
}
|
||||
|
||||
$end = new Carbon();
|
||||
$elapsedTime = $start->diff($end)->format('%H:%I:%S');
|
||||
Log::info(Carbon::now() . ': End job - Fix payment approval timed out error (status 504: Endpoint request timed out). ElapsedTime: ' . $elapsedTime . '.');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\Jobs\Commands\V2;
|
||||
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use Illuminate\Support\Facades\File;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
|
||||
class HouseKeepingS3FilesV2CommandJob implements ShouldQueue
|
||||
{
|
||||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||||
|
||||
|
||||
public function handle()
|
||||
{
|
||||
Log::info(Carbon::now() . ': Start job - Housekeeping temporary files in S3 Bucket.');
|
||||
$start = new Carbon();
|
||||
|
||||
$s3 = Storage::disk('s3');
|
||||
$directories = [
|
||||
'temp',
|
||||
];
|
||||
foreach ($directories as $directory) {
|
||||
$startInner = Carbon::now();
|
||||
Log::info(Carbon::now() . ' [HouseKeepingS3FilesV2] Start cleaning - ' . $directory);
|
||||
|
||||
$objects = $s3->allFiles($directory);
|
||||
|
||||
foreach ($objects as $object) {
|
||||
$s3->delete($object);
|
||||
Log::info('[HouseKeepingS3FilesV2] Deleted object: ' . $object);
|
||||
}
|
||||
|
||||
Log::info('[HouseKeepingS3FilesV2] All files have been deleted.');
|
||||
|
||||
$endInner = Carbon::now();
|
||||
$elapsedTime = $startInner->diff($endInner)->format('%H:%I:%S');
|
||||
Log::info(Carbon::now() . ' [HouseKeepingS3FilesV2] Process ended. ElapsedTime: ' . $elapsedTime);
|
||||
}
|
||||
|
||||
$end = new Carbon();
|
||||
$elapsedTime = $start->diff($end)->format('%H:%I:%S');
|
||||
Log::info(Carbon::now() . ': End job - Housekeeping temporary files in S3 Bucket. ElapsedTime: ' . $elapsedTime . '.');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\Jobs\Commands\V2;
|
||||
|
||||
use App\Classes\Modules\Accounts\Services\ExpiresEmailVerificationAttempt;
|
||||
use App\Models\UserEmailVerification;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class NewUserRegistrationExpireCheckV2CommandJob implements ShouldQueue
|
||||
{
|
||||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||||
|
||||
public function handle()
|
||||
{
|
||||
Log::info(Carbon::now() . ': Start job - New user email verification expiration check.');
|
||||
$start = new Carbon();
|
||||
|
||||
$attempts = UserEmailVerification::active()->twoDaysOld()->get();
|
||||
|
||||
Log::info('NewUser Carbon now()->subHours(48): '. Carbon::now()->subHours(48));
|
||||
Log::info('NewUser Attempts count: '.count($attempts));
|
||||
|
||||
foreach ($attempts as $attempt){
|
||||
(new ExpiresEmailVerificationAttempt())->execute($attempt);
|
||||
Log::info('NewUser Expired: '.$attempt->id.', '.$attempt->created_at);
|
||||
}
|
||||
|
||||
$end = new Carbon();
|
||||
$elapsedTime = $start->diff($end)->format('%H:%I:%S');
|
||||
Log::info(Carbon::now() . ': End job - New user email verification expiration check. ElapsedTime: ' . $elapsedTime . '.');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\Jobs\Commands\V2;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use App\Classes\Modules\Transactions\Processors\CreatePaymentTransactionProcessor;
|
||||
use App\Classes\Modules\Transactions\Processors\ReleaseGoodsToCustomerProcessor;
|
||||
use App\Classes\ValueObjects\Constants\ApprovalStatus;
|
||||
use App\Classes\ValueObjects\Constants\PaymentMethodType;
|
||||
use App\Models\Group;
|
||||
use App\Models\Transaction;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class OneTimeFixWalletGroupTransactionV2CommandJob implements ShouldQueue
|
||||
{
|
||||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||||
|
||||
public function handle()
|
||||
{
|
||||
Log::info(Carbon::now() . ': Start job - This is a one time fix of unsuccessful group payment through wallet.');
|
||||
$start = new Carbon();
|
||||
$invoice_ids = [31493]; //31493
|
||||
$invoices = Transaction::whereIn('id', $invoice_ids)->get();
|
||||
|
||||
foreach ($invoices as $invoice) {
|
||||
|
||||
if($invoice->status == ApprovalStatus::APPROVED){
|
||||
$paymentTransaction = (App()->make(CreatePaymentTransactionProcessor::class))->execute($invoice, PaymentMethodType::WALLET, '', false);
|
||||
|
||||
if($paymentTransaction && $paymentTransaction->status == ApprovalStatus::APPROVED){
|
||||
$pL = $invoice->owner;
|
||||
(App()->make(ReleaseGoodsToCustomerProcessor::class))->execute($pL, $invoice);
|
||||
}
|
||||
}
|
||||
}
|
||||
$group = Group::where('id', 1569)->first(); //1569
|
||||
$group->status = ApprovalStatus::APPROVED;
|
||||
$group->save();
|
||||
|
||||
$end = new Carbon();
|
||||
$elapsedTime = $start->diff($end)->format('%H:%I:%S');
|
||||
Log::info(Carbon::now() . ': End job - This is a one time fix of unsuccessful group payment through wallet. ElapsedTime: ' . $elapsedTime . '.');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\Jobs\Commands\V2;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use App\Classes\Modules\Billplzs\Processors\CallbackBillplzProcessor;
|
||||
use App\Classes\Modules\Billplzs\Processors\CallbackBillplzDataPatchProcessor;
|
||||
use App\Classes\ValueObjects\Constants\ApprovalStatus;
|
||||
use App\Models\Transaction;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class OneTimeTransactionFixBillplzFailedCbV2CommandJob implements ShouldQueue
|
||||
{
|
||||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||||
|
||||
public function handle()
|
||||
{
|
||||
Log::info(Carbon::now() . ': Start job - One time fix failled callback from billplz.');
|
||||
$start = new Carbon();
|
||||
|
||||
//Transaction fix with this one time fix command: 15205, 16803, 17310, 22008, 6770
|
||||
//This transaction, 16803 has approve payment but not its owner, shipping invoice
|
||||
$transactions = Transaction::whereIn('id', [22008, 6770])->get();
|
||||
|
||||
foreach ($transactions as $transaction){
|
||||
if($transaction){
|
||||
|
||||
Log::info(Carbon::now() . ' : '.$transaction->id);
|
||||
$status = ApprovalStatus::APPROVED;
|
||||
(App()->make(CallbackBillplzProcessor::class))->execute($transaction, $status);
|
||||
// (App()->make(CallbackBillplzDataPatchProcessor::class))->execute($transaction, $status);
|
||||
}
|
||||
}
|
||||
|
||||
$end = new Carbon();
|
||||
$elapsedTime = $start->diff($end)->format('%H:%I:%S');
|
||||
Log::info(Carbon::now() . ': End job - One time fix failled callback from billplz. ElapsedTime: ' . $elapsedTime . '.');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\Jobs\Commands\V2;
|
||||
|
||||
use App\Classes\Modules\Accounts\Services\ExpiresPasswordReset;
|
||||
use App\Models\PasswordReset;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class PasswordResetTokenExpirationV2CommandJob implements ShouldQueue
|
||||
{
|
||||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||||
|
||||
public function handle()
|
||||
{
|
||||
Log::info(Carbon::now() . ': Start job - Password reset token expiration check.');
|
||||
$start = new Carbon();
|
||||
|
||||
$attempts = PasswordReset::active()->oneDayOld()->get();
|
||||
|
||||
Log::info('PasswordReset Carbon now()->subHours(24): '. Carbon::now()->subHours(24));
|
||||
Log::info('PasswordReset Attempts count: '.count($attempts));
|
||||
|
||||
foreach ($attempts as $attempt){
|
||||
(new ExpiresPasswordReset())->execute($attempt);
|
||||
Log::info('PasswordReset Expired: '.$attempt->id.', '.$attempt->created_at);
|
||||
}
|
||||
|
||||
$end = new Carbon();
|
||||
$elapsedTime = $start->diff($end)->format('%H:%I:%S');
|
||||
Log::info(Carbon::now() . ': End job - Password reset token expiration check. ElapsedTime: ' . $elapsedTime . '.');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\Jobs\Commands\V2;
|
||||
|
||||
use App\Classes\Modules\Accounts\DataTransferObjects\KeyValuePairObject;
|
||||
use App\Classes\Modules\Accounts\Services\CreatesKeyValuePair;
|
||||
use App\Classes\Modules\Accounts\Services\UpdatesKeyValuePair;
|
||||
use App\Classes\ValueObjects\Constants\KVPKey;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use App\Models\KeyValuePair;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
|
||||
class ProcessPaymentReportV2CommandJob implements ShouldQueue
|
||||
{
|
||||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||||
|
||||
/** @var array */
|
||||
private $details;
|
||||
|
||||
/**
|
||||
* ProcessPaymentReportV2CommandJob constructor.
|
||||
* @param array $details
|
||||
*/
|
||||
public function __construct(array $details)
|
||||
{
|
||||
$this->details = $details;
|
||||
}
|
||||
|
||||
public function handle()
|
||||
{
|
||||
Log::info(Carbon::now() . ': Start job - Processing single record from 11R - RECEIVE PAYMENT (FULL PAYMENT) [AR RECEIVE PAYMENT] Import.');
|
||||
$start = new Carbon();
|
||||
|
||||
$docNo = $this->details['docno'] ?? null;
|
||||
$docDate = $this->details['docdate'] ?? null;
|
||||
$debtorCode = $this->details['debtorcode'] ?? null;
|
||||
$description = $this->details['description'] ?? null;
|
||||
$paymentMethod = $this->details['paymentmethod'] ?? null;
|
||||
$paymentAmt = $this->details['paymentamt'] ?? null;
|
||||
$knockOffDocNo = $this->details['knockoffdocno'] ?? null;
|
||||
|
||||
Log::info("Processing Payment Report:", [
|
||||
'DocNo' => $docNo,
|
||||
'DocDate' => $docDate,
|
||||
'DebtorCode' => $debtorCode,
|
||||
'Description' => $description,
|
||||
'PaymentMethod' => $paymentMethod,
|
||||
'PaymentAmt' => $paymentAmt,
|
||||
'KnockOffDocNo' => $knockOffDocNo,
|
||||
]);
|
||||
|
||||
if($knockOffDocNo){
|
||||
$kvp = KeyValuePair::where('key', KVPKey::AUTOCOUNT_DOCNO_INVOICE)->where('value', $knockOffDocNo)->first();
|
||||
if($kvp){
|
||||
$transaction = $kvp->owner;
|
||||
if($transaction){
|
||||
if($docNo != "" && $docNo != "<<New>>"){
|
||||
$this->updateOrCreateKeyValuePair($transaction, KVPKey::AUTOCOUNT_DOCNO_OFFICIAL_RECEIPT, $docNo);
|
||||
}
|
||||
// if($eInvoiceValidationLink){
|
||||
// $this->updateOrCreateKeyValuePair($booking, KVPKey::AUTOCOUNT_EINVOICE_VALIDATION_LINK, $eInvoiceValidationLink);
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$end = new Carbon();
|
||||
$elapsedTime = $start->diff($end)->format('%H:%I:%S');
|
||||
Log::info(Carbon::now() . ': End job - Processing single record from 11R - RECEIVE PAYMENT (FULL PAYMENT) [AR RECEIVE PAYMENT] Import. ElapsedTime: ' . $elapsedTime . '.');
|
||||
}
|
||||
|
||||
|
||||
private function updateOrCreateKeyValuePair($booking, $key, $value)
|
||||
{
|
||||
$keyValuePairObject = new KeyValuePairObject($key, $value);
|
||||
$metadata = $booking->attributesKVP()->where('key', $key)->first();
|
||||
|
||||
if ($metadata) {
|
||||
(App()->make(UpdatesKeyValuePair::class))->execute($metadata, $keyValuePairObject);
|
||||
} else {
|
||||
(App()->make(CreatesKeyValuePair::class))->execute($booking, $keyValuePairObject);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,131 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\Jobs\Commands\V2;
|
||||
|
||||
use App\Classes\Modules\Accounts\DataTransferObjects\KeyValuePairObject;
|
||||
use App\Classes\Modules\Accounts\Services\CreatesKeyValuePair;
|
||||
use App\Classes\Modules\Accounts\Services\UpdatesKeyValuePair;
|
||||
use App\Classes\ValueObjects\Constants\KVPKey;
|
||||
use App\Classes\ValueObjects\Constants\TransactionType;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use App\Models\Order;
|
||||
use App\Models\Transaction;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
|
||||
class ProcessSalesInvoiceReportV2CommandJob implements ShouldQueue
|
||||
{
|
||||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||||
|
||||
/** @var array */
|
||||
private $details;
|
||||
|
||||
/**
|
||||
* ProcessSalesInvoiceReportV2CommandJob constructor.
|
||||
* @param array $details
|
||||
*/
|
||||
public function __construct(array $details)
|
||||
{
|
||||
$this->details = $details;
|
||||
}
|
||||
|
||||
public function handle()
|
||||
{
|
||||
Log::info(Carbon::now() . ': Start job - Processing single record for E-Invoice from Sales Invoice Report Import.');
|
||||
$start = new Carbon();
|
||||
|
||||
$docNo = $this->details['docno'] ?? null;
|
||||
$docDate = $this->details['docdate'] ?? null;
|
||||
$debtorCode = $this->details['debtorcode'] ?? null;
|
||||
$ref = $this->details['ref'] ?? null;
|
||||
$shipInfo = $this->details['shipinfo'] ?? null;
|
||||
$accNo = $this->details['accno'] ?? null;
|
||||
$detailDescription = $this->details['detaildescription'] ?? null;
|
||||
$furtherDescription = $this->details['furtherdescription'] ?? null;
|
||||
$classification = $this->details['classification'] ?? null;
|
||||
$projNo = $this->details['projno'] ?? null;
|
||||
$deptNo = $this->details['deptno'] ?? null;
|
||||
$qty = $this->details['qty'] ?? null;
|
||||
$unitPrice = $this->details['unitprice'] ?? null;
|
||||
$taxCode = $this->details['taxcode'] ?? null;
|
||||
$taxableAmt = $this->details['taxableamt'] ?? null;
|
||||
$taxRate = $this->details['taxrate'] ?? null;
|
||||
$submitEinvoice = $this->details['submiteinvoice'] ?? null;
|
||||
$consolidatedEinvoice = $this->details['consolidatedeinvoice'] ?? null;
|
||||
$eInvoiceValidationLink = $this->details['einvoicevalidationlink'] ?? null;
|
||||
|
||||
// Log for debugging
|
||||
Log::info("Processing Sales Invoice Report:", [
|
||||
'DocNo' => $docNo,
|
||||
'DocDate' => $docDate,
|
||||
'DebtorCode' => $debtorCode,
|
||||
'Ref' => $ref,
|
||||
'ShipInfo' => $shipInfo,
|
||||
'AccNo' => $accNo,
|
||||
'DetailDescription' => $detailDescription,
|
||||
'FurtherDescription' => $furtherDescription,
|
||||
'Classification' => $classification,
|
||||
'ProjNo' => $projNo,
|
||||
'DeptNo' => $deptNo,
|
||||
'Qty' => $qty,
|
||||
'UnitPrice' => $unitPrice,
|
||||
'TaxCode' => $taxCode,
|
||||
'TaxableAmt' => $taxableAmt,
|
||||
'TaxRate' => $taxRate,
|
||||
'SubmitEinvoice' => $submitEinvoice,
|
||||
'ConsolidatedEinvoice' => $consolidatedEinvoice,
|
||||
'EInvoiceValidationLink' => $eInvoiceValidationLink,
|
||||
]);
|
||||
|
||||
|
||||
// $order = Order::where('reference', $ref)->first();
|
||||
// $transactions = $order->transactions()->whereIn('transactions.type', [TransactionType::SHIPPING_INVOICE, TransactionType::STORAGE_INVOICE])->get();
|
||||
// $matchedTransaction = null;
|
||||
// foreach ($transactions as $transaction) {
|
||||
// $transactionDetails = $transaction->transactionDetails;
|
||||
// foreach ($transactionDetails as $detail) {
|
||||
// $detailName = str_replace('<br>', ' ', $detail->name);
|
||||
// if (
|
||||
// $detailName === $furtherDescription &&
|
||||
// $detail->quantity == $qty &&
|
||||
// $detail->price == $unitPrice
|
||||
// ) {
|
||||
// $matchedTransaction = $transaction;
|
||||
// break 2;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
$matchedTransaction = Transaction::where('bill_no', $ref)->first();
|
||||
if($matchedTransaction){
|
||||
if($docNo != "" && $docNo != "<<New>>"){
|
||||
$this->updateOrCreateKeyValuePair($matchedTransaction, KVPKey::AUTOCOUNT_DOCNO_INVOICE, $docNo);
|
||||
}
|
||||
if($eInvoiceValidationLink){
|
||||
$this->updateOrCreateKeyValuePair($matchedTransaction, KVPKey::AUTOCOUNT_EINVOICE_VALIDATION_LINK, $eInvoiceValidationLink);
|
||||
}
|
||||
}
|
||||
|
||||
$end = new Carbon();
|
||||
$elapsedTime = $start->diff($end)->format('%H:%I:%S');
|
||||
Log::info(Carbon::now() . ': End job - Processing single record for E-Invoice from Sales Invoice Report Import. ElapsedTime: ' . $elapsedTime . '.');
|
||||
}
|
||||
|
||||
|
||||
private function updateOrCreateKeyValuePair($booking, $key, $value)
|
||||
{
|
||||
$keyValuePairObject = new KeyValuePairObject($key, $value);
|
||||
$metadata = $booking->attributesKVP()->where('key', $key)->first();
|
||||
|
||||
if ($metadata) {
|
||||
(App()->make(UpdatesKeyValuePair::class))->execute($metadata, $keyValuePairObject);
|
||||
} else {
|
||||
(App()->make(CreatesKeyValuePair::class))->execute($booking, $keyValuePairObject);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\Jobs\Commands\V2;
|
||||
|
||||
|
||||
use App\Classes\Modules\Transactions\Processors\CreateShippingEInvoiceDocProcessor;
|
||||
use App\Classes\Modules\Transactions\Processors\CreateStorageEInvoiceDocProcessor;
|
||||
use App\Classes\ValueObjects\Constants\DocumentType;
|
||||
use App\Classes\ValueObjects\Constants\KVPKey;
|
||||
use App\Classes\ValueObjects\Constants\TransactionType;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use App\Models\Transaction;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
|
||||
class ProcessTransactionForEInvoiceV2CommandJob implements ShouldQueue
|
||||
{
|
||||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||||
|
||||
/** @var Transaction */
|
||||
private $transaction;
|
||||
|
||||
/**
|
||||
* ProcessTransactionForEInvoiceV2CommandJob constructor.
|
||||
* @param Transaction $transaction
|
||||
*/
|
||||
public function __construct(Transaction $transaction)
|
||||
{
|
||||
$this->transaction = $transaction;
|
||||
}
|
||||
|
||||
public function handle()
|
||||
{
|
||||
Log::info(Carbon::now() . ': Start job - Processing single transaction for E-Invoice.');
|
||||
$start = new Carbon();
|
||||
|
||||
$isGenerated = false;
|
||||
$companyModule = $this->transaction->owner->owner->companyModule;
|
||||
if($companyModule->company->e_invoice === 1){
|
||||
$document = $this->transaction->documents()->where('document_type', DocumentType::SHIPPING_EINVOICE)->first();
|
||||
$kvp = $this->transaction->attributesKVP()->where('key', KVPKey::AUTOCOUNT_DOCNO_INVOICE)->first();
|
||||
if(!$document && $kvp && $this->transaction->type == TransactionType::SHIPPING_INVOICE){
|
||||
(App()->make(CreateShippingEInvoiceDocProcessor::class))->execute($this->transaction);
|
||||
$isGenerated = true;
|
||||
}
|
||||
else {
|
||||
$document2 = $this->transaction->documents()->where('document_type', DocumentType::STORAGE_EINVOICE)->first();
|
||||
$kvp2 = $this->transaction->attributesKVP()->where('key', KVPKey::AUTOCOUNT_DOCNO_INVOICE)->first();
|
||||
if(!$document2 && $kvp2 && $this->transaction->type == TransactionType::STORAGE_INVOICE){
|
||||
(App()->make(CreateStorageEInvoiceDocProcessor::class))->execute($this->transaction);
|
||||
$isGenerated = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(!$isGenerated){
|
||||
Log::info("NO E-Invoice generated for transaction with id: " . $this->transaction->id . ', order: ' . $this->transaction->owner->owner->reference );
|
||||
}
|
||||
else{
|
||||
Log::info("E-Invoice generated for transaction with id: " . $this->transaction->id . ', order: ' . $this->transaction->owner->owner->reference );
|
||||
}
|
||||
|
||||
$end = new Carbon();
|
||||
$elapsedTime = $start->diff($end)->format('%H:%I:%S');
|
||||
Log::info(Carbon::now() . ': End job - Processing single transaction for E-Invoice. ElapsedTime: ' . $elapsedTime . '.');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\Jobs\Commands\V2;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use App\Classes\Modules\Orders\Services\ListsOrders;
|
||||
use App\Classes\Modules\Transactions\Processors\CheckStorageInvoiceTransactionProcessor;
|
||||
use App\Classes\Modules\Transactions\Processors\ReleaseGoodsToCustomerProcessor;
|
||||
use App\Classes\ValueObjects\Constants\OrderType;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class ReleaseGoodsToCustomerV2CommandJob implements ShouldQueue
|
||||
{
|
||||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||||
|
||||
protected $invoice;
|
||||
|
||||
public function __construct($invoice)
|
||||
{
|
||||
$this->invoice = $invoice;
|
||||
}
|
||||
|
||||
public function handle()
|
||||
{
|
||||
Log::info(Carbon::now() . ': Start job - Release goods to customer.');
|
||||
$start = new Carbon();
|
||||
|
||||
try{
|
||||
$obj = json_encode($this->invoice);
|
||||
Log::info("Processing Order - ID: {$this->invoice->id}, invoice: {$obj}");
|
||||
$pL = $this->invoice->owner;
|
||||
(App()->make(ReleaseGoodsToCustomerProcessor::class))->execute($pL, $this->invoice);
|
||||
}
|
||||
catch(\Exception $ex){
|
||||
Log::info('Exception '.$ex->getMessage());
|
||||
}
|
||||
|
||||
$end = new Carbon();
|
||||
$elapsedTime = $start->diff($end)->format('%H:%I:%S');
|
||||
Log::info(Carbon::now() . ': End job - Release goods to customer. ElapsedTime: ' . $elapsedTime . '.');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\Jobs\Commands\V2;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use App\Classes\Notifications\ShipmentDepartureEmail;
|
||||
use App\Models\Order;
|
||||
use App\Models\Container;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class SendContainerDepartureEmailV2CommandJob implements ShouldQueue
|
||||
{
|
||||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||||
|
||||
|
||||
public function handle()
|
||||
{
|
||||
Log::info(Carbon::now() . ': Start job - Send Container Departure Email.');
|
||||
$start = new Carbon();
|
||||
|
||||
$containers = Container::whereHas('transports', function ($transport){
|
||||
return $transport->whereDate('dispatch_date', '=', Carbon::today());
|
||||
})->get();
|
||||
|
||||
foreach ($containers as $container){
|
||||
foreach ($container->packingLists as $packingList){
|
||||
if(!($packingList->owner instanceof Order)) continue;
|
||||
$user = $packingList->owner->companyModule->employees()->first();
|
||||
if(app()->environment(['production'])) {
|
||||
$user->notify(new ShipmentDepartureEmail($user, $packingList));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$end = new Carbon();
|
||||
$elapsedTime = $start->diff($end)->format('%H:%I:%S');
|
||||
Log::info(Carbon::now() . ': End job - Send Container Departure Email. ElapsedTime: ' . $elapsedTime . '.');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\Jobs\Commands\V2;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use App\Classes\Notifications\PermitsReminderEmail;
|
||||
use App\Models\PermitsReminder;
|
||||
use App\Models\User;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class SendPermitsReminderEmailsV2CommandJob implements ShouldQueue
|
||||
{
|
||||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||||
|
||||
|
||||
public function handle()
|
||||
{
|
||||
Log::info(Carbon::now() . ': Start job - Send Permits Reminders Email.');
|
||||
$start = new Carbon();
|
||||
|
||||
$currentDateTime = now();
|
||||
$startRange = $currentDateTime->subDays(3)->startOfDay();
|
||||
$endRange = $currentDateTime->copy()->addDays(6)->endOfDay();
|
||||
|
||||
$reminders = PermitsReminder::whereDate('reminder_date', '>=', $startRange)
|
||||
->whereDate('reminder_date', '<=', $endRange)
|
||||
->orWhere('reminder_date', '<', now())
|
||||
->pluck('model');
|
||||
|
||||
if ($reminders->isEmpty()) {
|
||||
Log::info('No reminders expiring within the specified range.');
|
||||
return;
|
||||
}
|
||||
|
||||
Log::info($this->getTimeStamp() . 'Reminders: ' . $reminders->toJson());
|
||||
|
||||
$users = User::whereIn('email', $this->getEmailList())->get();
|
||||
|
||||
foreach ($users as $user) {
|
||||
Log::info($this->getTimeStamp() . 'Reminder email sent to ' . $user->email);
|
||||
if (app()->environment('production')) {
|
||||
$user->notify(new PermitsReminderEmail($user, $reminders));
|
||||
}
|
||||
}
|
||||
|
||||
$end = new Carbon();
|
||||
$elapsedTime = $start->diff($end)->format('%H:%I:%S');
|
||||
Log::info(Carbon::now() . ': End job - Send Permits Reminders Email. ElapsedTime: ' . $elapsedTime . '.');
|
||||
}
|
||||
|
||||
public function getTimeStamp()
|
||||
{
|
||||
return '[' . Carbon::now()->format('Y-m-d H:i:s') . '] - ';
|
||||
}
|
||||
|
||||
protected function getEmailList(): array
|
||||
{
|
||||
return [
|
||||
// 'edmond.wuiming2021@gmail.com',
|
||||
'anithagurl96@gmail.com'
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\Jobs\Commands\V2;
|
||||
|
||||
use App\Classes\Modules\Jobs\DataTransferObjects\ShowBillplzPaymentStatusV2CommandObject;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class ShowBillplzPaymentStatusV2CommandJob implements ShouldQueue
|
||||
{
|
||||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||||
|
||||
|
||||
/** @var ShowBillplzPaymentStatusV2CommandObject*/
|
||||
private $showBillplzPaymentStatusV2CommandObject;
|
||||
|
||||
/**
|
||||
* ShowBillplzPaymentStatusV2CommandJob constructor.
|
||||
* @param ShowBillplzPaymentStatusV2CommandObject $showBillplzPaymentStatusV2CommandObject
|
||||
*/
|
||||
public function __construct(ShowBillplzPaymentStatusV2CommandObject $showBillplzPaymentStatusV2CommandObject)
|
||||
{
|
||||
$this->showBillplzPaymentStatusV2CommandObject = $showBillplzPaymentStatusV2CommandObject;
|
||||
}
|
||||
|
||||
public function handle()
|
||||
{
|
||||
Log::info(Carbon::now() . ': Start job - Show Billplz payment status.');
|
||||
$start = new Carbon();
|
||||
|
||||
// ini_set('memory_limit', '-1');
|
||||
|
||||
$billplz_id = $this->showBillplzPaymentStatusV2CommandObject->getBillplzId();
|
||||
$billplz_id = explode(",", $billplz_id);
|
||||
|
||||
foreach ($billplz_id as $payment) {
|
||||
$response = Http::withBasicAuth(config('billplz.api_key').':', '')->get(config('billplz.base_url').'/api/v3/bills/'.$payment);
|
||||
if($response->successful()){
|
||||
$data = $response->json();
|
||||
dump($data);
|
||||
}else{
|
||||
Log::info("billplz error</br>");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$end = new Carbon();
|
||||
$elapsedTime = $start->diff($end)->format('%H:%I:%S');
|
||||
Log::info(Carbon::now() . ': End job - Show Billplz payment status. ElapsedTime: ' . $elapsedTime . '.');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\Jobs\Commands\V2;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use App\Classes\ValueObjects\Constants\ApprovalStatus;
|
||||
use App\Classes\ValueObjects\Constants\PaymentMethodType;
|
||||
use App\Classes\ValueObjects\Constants\TransactionType;
|
||||
use App\Models\Transaction;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class ShowFailediBllplzCallbackV2CommandJob implements ShouldQueue
|
||||
{
|
||||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||||
|
||||
|
||||
public function handle()
|
||||
{
|
||||
Log::info(Carbon::now() . ': Start job - Show all failled callback from billplz.');
|
||||
$start = new Carbon();
|
||||
|
||||
// ini_set('memory_limit', '-1');
|
||||
|
||||
$transactions = Transaction::whereIn('type', [TransactionType::PAYMENT, TransactionType::TOP_UP, TransactionType::GROUP_PAYMENT])->where('payment_method', PaymentMethodType::PAYMENT_GATEWAY)->whereNotIn('status', [ApprovalStatus::APPROVED, ApprovalStatus::COMPLETED])->get();
|
||||
$totalTransactions = count($transactions);
|
||||
|
||||
if ($totalTransactions) {
|
||||
Log::info(Carbon::now() . ' totalTransactions : ' . $totalTransactions);
|
||||
}
|
||||
|
||||
$counter = 1;
|
||||
$totalAmount = 0;
|
||||
foreach ($transactions as $transaction){
|
||||
$response = Http::withBasicAuth(config('billplz.api_key').':', '')->get(config('billplz.base_url').'/api/v3/bills/'.$transaction->payment_reference);
|
||||
|
||||
if($response->successful()){
|
||||
$data = $response->json();
|
||||
if($data['paid']){
|
||||
dump($transaction->payment_reference);
|
||||
dump($transaction->id);
|
||||
}
|
||||
}else{
|
||||
Log::info("billplz error</br>");
|
||||
}
|
||||
$counter++;
|
||||
}
|
||||
|
||||
// if ($totalTransactions) {
|
||||
// Log::info(Carbon::now() . ' : Done Billplz Failled Callback. ElapsedTime: ' . $elapsedTime . '. Total: ' . $totalAmount);
|
||||
// }
|
||||
|
||||
|
||||
$end = new Carbon();
|
||||
$elapsedTime = $start->diff($end)->format('%H:%I:%S');
|
||||
Log::info(Carbon::now() . ': End job - Show all failled callback from billplz. ElapsedTime: ' . $elapsedTime . '. Total: ' . $totalAmount);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\Jobs\Commands\V2;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use App\Classes\ValueObjects\Constants\ApprovalStatus;
|
||||
use App\Classes\ValueObjects\Constants\PaymentMethodType;
|
||||
use App\Classes\ValueObjects\Constants\TransactionType;
|
||||
use App\Models\Order;
|
||||
use App\Models\Transaction;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class ShowFixBillplzFailedCallbackPaymentV2CommandJob implements ShouldQueue
|
||||
{
|
||||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||||
|
||||
public function handle()
|
||||
{
|
||||
Log::info(Carbon::now() . ': Start job - Show Billplz Failled Callback.');
|
||||
$start = new Carbon();
|
||||
|
||||
// ini_set('memory_limit', '-1');
|
||||
// $this->outputArray = [];
|
||||
|
||||
$approvalStatusArray = ApprovalStatus::APPROVAL_STATUS_ID;
|
||||
|
||||
$transactions = Transaction::where('type', TransactionType::PAYMENT)->where('payment_method', PaymentMethodType::PAYMENT_GATEWAY)->whereNotIn('status', [ApprovalStatus::APPROVED, ApprovalStatus::COMPLETED])->get();
|
||||
$totalTransactions = count($transactions);
|
||||
$counter = 1;
|
||||
$totalAmount = 0;
|
||||
foreach ($transactions as $transaction){
|
||||
$response = Http::withBasicAuth(config('billplz.api_key').':', '')->get(config('billplz.base_url').'/api/v3/bills/'.$transaction->payment_reference);
|
||||
|
||||
if($response->successful()){
|
||||
$data = $response->json();
|
||||
if($data['paid']){
|
||||
$totalAmount += $transaction->amount;
|
||||
$invoiceStatus = null;
|
||||
|
||||
switch($transaction->owner->status) {
|
||||
case 3:
|
||||
$invoiceStatus = 'Payment Completed';
|
||||
break;
|
||||
case 5:
|
||||
$invoiceStatus = 'Dispute in progress';
|
||||
break;
|
||||
case 6:
|
||||
$invoiceStatus = 'Cancelled Invoice';
|
||||
break;
|
||||
default:
|
||||
$invoiceStatus = 'Pending Payment';
|
||||
}
|
||||
|
||||
$order = $transaction->owner->owner->owner;
|
||||
|
||||
if(!$order instanceof Order) {
|
||||
Log::info("Error transaction id:" . $transaction->id . 'Type: ' . get_class($order));
|
||||
} else {
|
||||
Log::info($counter . ' of ' . $totalTransactions . '. Order: '. $order->reference . ' - Date: '.$transaction->owner->created_at->format('d-m-Y').' - Amount: '. $transaction->amount . '. Status: ' . $approvalStatusArray[$transaction->status] . '. Invoice Status: ' . $invoiceStatus);
|
||||
}
|
||||
|
||||
} else {
|
||||
// $totalAmount += $transaction->amount;
|
||||
// $this->appendToOutput($counter . ' of ' . $totalTransactions . '. Order: '. $transaction->owner->owner->owner->reference . ' - Date: '.$transaction->owner->created_at->format('d-m-Y').' - Amount: '. $transaction->amount);
|
||||
}
|
||||
}else{
|
||||
Log::info("billplz error</br>");
|
||||
}
|
||||
$counter++;
|
||||
}
|
||||
|
||||
$end = new Carbon();
|
||||
$elapsedTime = $start->diff($end)->format('%H:%I:%S');
|
||||
Log::info(Carbon::now() . ': End job - Show Billplz Failled Callback. ElapsedTime: ' . $elapsedTime . '. Total: ' . $totalAmount);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\Jobs\Commands\V2;
|
||||
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use App\Classes\Modules\Billplzs\Services\GetBillplzBill;
|
||||
use App\Classes\Modules\Orders\Processors\UpdateDoFromVTPortalProcessor;
|
||||
use App\Classes\Modules\Orders\Processors\UpdateDoFromYDPortalProcessor;
|
||||
use App\Classes\Modules\Transactions\Services\FetchesTransaction;
|
||||
use App\Classes\Modules\Transactions\Services\UpdatesTransactionStatus;
|
||||
use App\Classes\ValueObjects\Constants\ApprovalStatus;
|
||||
use App\Classes\ValueObjects\Constants\PaymentMethodType;
|
||||
use App\Classes\ValueObjects\Constants\TransactionType;
|
||||
use App\Models\Transaction;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class SuccessUpdatePaymentStatusV2CommandJob implements ShouldQueue
|
||||
{
|
||||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||||
|
||||
public function handle()
|
||||
{
|
||||
Log::info(Carbon::now() . ': Start job - Success Updated Payment Status.');
|
||||
$start = new Carbon();
|
||||
|
||||
// ini_set('memory_limit', '-1');
|
||||
// $this->outputArray = [];
|
||||
|
||||
$approvalStatusArray = ApprovalStatus::APPROVAL_STATUS_ID;
|
||||
|
||||
$transactions = Transaction::where('type', TransactionType::PAYMENT)
|
||||
->where('payment_method', PaymentMethodType::PAYMENT_GATEWAY)
|
||||
->whereIn('status', [ApprovalStatus::APPROVED, ApprovalStatus::COMPLETED])
|
||||
->get();
|
||||
|
||||
foreach ($transactions as $payment) {
|
||||
$invoice = $payment->owner ?? null;
|
||||
if (!$invoice) {
|
||||
Log::info('Payment has no owner. Payment ID: ' . $payment->id);
|
||||
continue;
|
||||
}
|
||||
|
||||
$packingList = $invoice->owner ?? null;
|
||||
if (!$packingList) {
|
||||
Log::info('Invoice has no owner. Invoice ID: ' . $invoice->id);
|
||||
continue;
|
||||
}
|
||||
|
||||
$order = $packingList->owner;
|
||||
if (!$invoice) {
|
||||
Log::info('PackingList has no owner. PackingList ID: ' . $packingList->id);
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($invoice->status == ApprovalStatus::APPROVED) {
|
||||
|
||||
$totalPaidAmount = $invoice->transactions->where('type', TransactionType::PAYMENT)->whereIn('status', [ApprovalStatus::APPROVED, ApprovalStatus::COMPLETED])->sum('amount');
|
||||
|
||||
if(($invoice->amount - $totalPaidAmount) < 0.01) {
|
||||
(App()->make(UpdatesTransactionStatus::class))->execute($invoice, ApprovalStatus::COMPLETED);
|
||||
|
||||
$packingList->status = ApprovalStatus::APPROVED;
|
||||
$packingList->save();
|
||||
|
||||
if(app()->environment('production')){
|
||||
(App()->make(UpdateDoFromVTPortalProcessor::class))->execute($packingList);
|
||||
(App()->make(UpdateDoFromYDPortalProcessor::class))->execute($packingList);
|
||||
}
|
||||
|
||||
dump('Updated invoice ' . $invoice->id . '. Order: '. $order->reference);
|
||||
} else {
|
||||
Log::info('Failed Update invoice ' . $invoice->id . ' because payment not enough. Invoice Amount: ' . $invoice->amount . ' . Paid Amount: ' . $totalPaidAmount . ' . Order: '. $order->reference);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$end = new Carbon();
|
||||
$elapsedTime = $start->diff($end)->format('%H:%I:%S');
|
||||
Log::info(Carbon::now() . ': End job - Success Updated Payment Status. ElapsedTime: ' . $elapsedTime . '.');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\Jobs\Commands\V2;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use App\Models\Container;
|
||||
use App\Models\Order;
|
||||
use App\Models\User;
|
||||
use App\Classes\Notifications\ShipmentDepartureEmail;
|
||||
|
||||
class TestAttachingS3FileAndSendEmailV2CommandJob implements ShouldQueue
|
||||
{
|
||||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||||
|
||||
|
||||
public function handle()
|
||||
{
|
||||
Log::info(Carbon::now() . ': Start job - Test to attach a file from S3 bucket and trigger an email send.');
|
||||
$start = new Carbon();
|
||||
|
||||
$containers = Container::whereHas('transports', function ($transport){
|
||||
return $transport->whereDate('dispatch_date', '<', Carbon::today())->whereDate('dispatch_date', '>', Carbon::now()->subdays(30));
|
||||
})->get();
|
||||
|
||||
Log::info("[TESTING] total containers: " . count($containers));
|
||||
|
||||
$sent = false;
|
||||
foreach ($containers as $container){
|
||||
if($sent){
|
||||
break;
|
||||
}
|
||||
foreach ($container->packingLists as $packingList){
|
||||
if($sent){
|
||||
break;
|
||||
}
|
||||
|
||||
if(!($packingList->owner instanceof Order)) continue;
|
||||
$user = $packingList->owner->companyModule->employees()->first();
|
||||
$user = User::where('email', 'dillonngoweijoon@gmail.com')->first();
|
||||
|
||||
Log::info("[TESTING] user: " . json_encode($user));
|
||||
Log::info("[TESTING] packingList: " . json_encode($packingList));
|
||||
|
||||
$user->notify(new ShipmentDepartureEmail($user, $packingList));
|
||||
$sent = true;
|
||||
}
|
||||
}
|
||||
|
||||
$end = new Carbon();
|
||||
$elapsedTime = $start->diff($end)->format('%H:%I:%S');
|
||||
Log::info(Carbon::now() . ': End job - Test to attach a file from S3 bucket and trigger an email send. ElapsedTime: ' . $elapsedTime . '.');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\Jobs\Commands\V2;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use App\Classes\Modules\Exports\Services\ExportsNullDebtors;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use App\Classes\ValueObjects\Constants\ApprovalStatus;
|
||||
use App\Classes\ValueObjects\Constants\BusinessType;
|
||||
use App\Models\Company;
|
||||
|
||||
class TestExportExcelToS3BucketV2CommandJob implements ShouldQueue
|
||||
{
|
||||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||||
|
||||
|
||||
public function handle()
|
||||
{
|
||||
Log::info(Carbon::now() . ': Start job - Test Export Excel File to S3 Bucket.');
|
||||
$start = new Carbon();
|
||||
|
||||
Log::info('company 0');
|
||||
|
||||
$company = Company::where(function($query){
|
||||
$query->whereNull('debtor')->orWhere('debtor', '');
|
||||
})->get();
|
||||
|
||||
Log::info('company 1: ' . json_encode($company));
|
||||
|
||||
$company = Company::where(function($query){
|
||||
$query->whereNull('debtor')->orWhere('debtor', '');
|
||||
})->whereHas('companyModules', function($query){
|
||||
$query->where('type', BusinessType::IMPORTER);
|
||||
})->get();
|
||||
|
||||
Log::info('company 2: ' . json_encode($company));
|
||||
|
||||
$company = Company::where(function($query){
|
||||
$query->whereNull('debtor')->orWhere('debtor', '');
|
||||
})->whereHas('companyModules', function($query){
|
||||
$query->where('type', BusinessType::IMPORTER);
|
||||
})->whereHas('parcels', function ($query) {
|
||||
$query->where('packages.status', ApprovalStatus::APPROVED);
|
||||
|
||||
})
|
||||
->with(['companyModules', 'parcels'])
|
||||
->get();
|
||||
|
||||
Log::info('company 3: ' . json_encode($company));
|
||||
|
||||
$company = Company::where(function($query){
|
||||
$query->whereNull('debtor')->orWhere('debtor', '');
|
||||
})->whereHas('companyModules', function($query){
|
||||
$query->where('type', BusinessType::IMPORTER);
|
||||
})->whereHas('parcels')->where('status', ApprovalStatus::APPROVED)->get();
|
||||
|
||||
Log::info('company 4: ' . json_encode($company));
|
||||
|
||||
$export = new ExportsNullDebtors();
|
||||
$filesystemDriver = Storage::getDefaultDriver();
|
||||
|
||||
if ($filesystemDriver === 's3') {
|
||||
$filePathForS3 = 'temp/nullDebtor.xlsx'; //documents/exports
|
||||
$excelFile = $export->store($filePathForS3, 's3');
|
||||
$temporaryUrl = Storage::disk('s3')->temporaryUrl(
|
||||
$filePathForS3,
|
||||
Carbon::now()->addMinutes(10)
|
||||
);
|
||||
Log::info('temporaryUrl: ' . $temporaryUrl);
|
||||
}
|
||||
|
||||
$end = new Carbon();
|
||||
$elapsedTime = $start->diff($end)->format('%H:%I:%S');
|
||||
Log::info(Carbon::now() . ': End job - Test Export Excel File to S3 Bucket. ElapsedTime: ' . $elapsedTime . '.');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\Jobs\Commands\V2;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use App\Classes\Modules\PackingLists\Processors\TestFetchPackingListsFromYdPortalProcessor;
|
||||
|
||||
class TestReadDataFromYDAPIV2CommandJob implements ShouldQueue
|
||||
{
|
||||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||||
|
||||
|
||||
public function handle()
|
||||
{
|
||||
Log::info(Carbon::now() . ': Start job - Test to read data from YD API.');
|
||||
$start = new Carbon();
|
||||
|
||||
(App()->make(TestFetchPackingListsFromYdPortalProcessor::class))->execute();
|
||||
|
||||
$end = new Carbon();
|
||||
$elapsedTime = $start->diff($end)->format('%H:%I:%S');
|
||||
Log::info(Carbon::now() . ': End job - Test to read data from YD API. ElapsedTime: ' . $elapsedTime . '.');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\Jobs\Commands\V2\YD;
|
||||
|
||||
use App\Classes\Modules\PackingLists\Processors\V2\FetchContainersFromYdPortalV2Processor;
|
||||
use App\Classes\Modules\PackingLists\Processors\FetchContainersUpdatesFromYdPortalProcessor;
|
||||
use App\Classes\Modules\PackingLists\Processors\FetchDeliveryUpdatesFromYdPortalProcessor;
|
||||
use App\Classes\Modules\PackingLists\Processors\FetchOrderListsFromYdPortalProcessor;
|
||||
use App\Models\PackingList;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class FetchContainersFromYdPortalV2CommandJob implements ShouldQueue
|
||||
{
|
||||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||||
|
||||
protected $packingList;
|
||||
|
||||
public function __construct(PackingList $packingList)
|
||||
{
|
||||
$this->packingList = $packingList;
|
||||
}
|
||||
|
||||
|
||||
public function handle()
|
||||
{
|
||||
Log::info('Processing FetchContainersFromYdPortalV2CommandJob');
|
||||
$processor = app(FetchContainersFromYdPortalV2Processor::class);
|
||||
$processor->execute($this->packingList);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\Jobs\Commands\V2\YD;
|
||||
|
||||
use App\Classes\Modules\PackingLists\Processors\FetchContainersFromYdPortalProcessor;
|
||||
use App\Classes\Modules\PackingLists\Processors\V2\FetchContainersUpdatesFromYdPortalV2Processor;
|
||||
use App\Classes\Modules\PackingLists\Processors\FetchDeliveryUpdatesFromYdPortalProcessor;
|
||||
use App\Classes\Modules\PackingLists\Processors\FetchOrderListsFromYdPortalProcessor;
|
||||
use App\Models\Container;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class FetchContainersUpdatesFromYdPortalV2CommandJob implements ShouldQueue
|
||||
{
|
||||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||||
|
||||
protected $container;
|
||||
|
||||
public function __construct(Container $container)
|
||||
{
|
||||
$this->container = $container;
|
||||
}
|
||||
|
||||
public function handle()
|
||||
{
|
||||
Log::info('Processing FetchContainersUpdatesFromYdPortalV2CommandJob');
|
||||
$processor = app(FetchContainersUpdatesFromYdPortalV2Processor::class);
|
||||
$processor->execute($this->container);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\Jobs\Commands\V2\YD;
|
||||
|
||||
use App\Classes\Modules\PackingLists\Processors\FetchContainersFromYdPortalProcessor;
|
||||
use App\Classes\Modules\PackingLists\Processors\FetchContainersUpdatesFromYdPortalProcessor;
|
||||
use App\Classes\Modules\PackingLists\Processors\V2\FetchDeliveryUpdatesFromYdPortalV2Processor;
|
||||
use App\Classes\Modules\PackingLists\Processors\FetchOrderListsFromYdPortalProcessor;
|
||||
use App\Models\PackingList;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class FetchDeliveryUpdatesFromYdPortalV2CommandJob implements ShouldQueue
|
||||
{
|
||||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||||
|
||||
protected $packingListId;
|
||||
|
||||
public function __construct(int $packingListId)
|
||||
{
|
||||
$this->packingListId = $packingListId;
|
||||
}
|
||||
|
||||
public function handle()
|
||||
{
|
||||
Log::info('Processing FetchDeliveryUpdatesFromYdPortalV2CommandJob');
|
||||
$processor = app(FetchDeliveryUpdatesFromYdPortalV2Processor::class);
|
||||
$processor->execute($this->packingListId);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\Jobs\Commands\V2\YD;
|
||||
|
||||
use App\Classes\Modules\PackingLists\Processors\V2\FetchOrderListsFromYdPortalV2Processor;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class FetchOrderListsFromYdPortalV2CommandJob implements ShouldQueue
|
||||
{
|
||||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||||
|
||||
protected $startDate;
|
||||
protected $endDate;
|
||||
|
||||
public function __construct(?Carbon $startDate, ?Carbon $endDate)
|
||||
{
|
||||
$this->startDate = $startDate;
|
||||
$this->endDate = $endDate;
|
||||
}
|
||||
|
||||
public function handle()
|
||||
{
|
||||
Log::info('Processing FetchOrderListsFromYdPortalV2CommandJob for start date: ' . $this->startDate. ', and end date: ' . $this->endDate);
|
||||
$processor = app(FetchOrderListsFromYdPortalV2Processor::class);
|
||||
$processor->execute($this->startDate, $this->endDate);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\Jobs\Commands\V2\YD;
|
||||
|
||||
use App\Classes\Modules\PackingLists\Processors\V2\FetchPackingListsFromYdPortalV2Processor;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class FetchPackingListsFromYdPortalV2CommandJob implements ShouldQueue
|
||||
{
|
||||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||||
|
||||
protected $startDate;
|
||||
protected $endDate;
|
||||
|
||||
public function __construct(?Carbon $startDate, ?Carbon $endDate)
|
||||
{
|
||||
$this->startDate = $startDate;
|
||||
$this->endDate = $endDate;
|
||||
}
|
||||
|
||||
public function handle()
|
||||
{
|
||||
Log::info('Processing FetchPackingListsFromYdPortalV2CommandJob for start date: ' . $this->startDate. ', and end date: ' . $this->endDate);
|
||||
$processor = app(FetchPackingListsFromYdPortalV2Processor::class);
|
||||
$processor->execute($this->startDate, $this->endDate);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\Jobs\Commands\V2\YD;
|
||||
|
||||
use App\Classes\Modules\PackingLists\Processors\V2\FetchByTrakingNoYdPortalV2Processor;
|
||||
use App\Models\PackingList;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class FetchTrakingInfoYDByPackingListV2CommandJob implements ShouldQueue
|
||||
{
|
||||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||||
|
||||
protected $packingList;
|
||||
|
||||
public function __construct(PackingList $packingList)
|
||||
{
|
||||
$this->packingList = $packingList;
|
||||
}
|
||||
|
||||
public function handle()
|
||||
{
|
||||
Log::info('Processing FetchTrakingInfoYDByPackingListV2CommandJob');
|
||||
$processor = app(FetchByTrakingNoYdPortalV2Processor::class);
|
||||
$processor->execute($this->packingList);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\Jobs\Commands\V2\YD;
|
||||
|
||||
use App\Classes\Modules\PackingLists\Processors\V2\FetchByTrakingNoYdPortalV2Processor;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class FetchTrakingInfoYDByTrackingNoV2CommandJob implements ShouldQueue
|
||||
{
|
||||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||||
|
||||
protected $trackingNo;
|
||||
|
||||
public function __construct(string $trackingNo)
|
||||
{
|
||||
$this->trackingNo = $trackingNo;
|
||||
}
|
||||
|
||||
public function handle()
|
||||
{
|
||||
Log::info('Processing FetchTrakingInfoYDByTrackingNoV2CommandJob');
|
||||
$processor = app(FetchByTrakingNoYdPortalV2Processor::class);
|
||||
$processor->processTrackingNo($this->trackingNo);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\Jobs\Commands\V2\YD;
|
||||
|
||||
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use Illuminate\Support\Facades\Artisan;
|
||||
|
||||
class ProcessYDByTrakingNoDataV2Job implements ShouldQueue
|
||||
{
|
||||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||||
|
||||
protected $trackingNo;
|
||||
|
||||
public function __construct($trackingNo)
|
||||
{
|
||||
$this->trackingNo = $trackingNo;
|
||||
}
|
||||
|
||||
public function handle()
|
||||
{
|
||||
Artisan::call('process-yd-by-traking-no-data-command', [
|
||||
'trackingNo' => $this->trackingNo
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\Jobs\Commands\V2\YD;
|
||||
|
||||
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use Illuminate\Support\Facades\Artisan;
|
||||
|
||||
class ProcessYDPortalDataV2Job implements ShouldQueue
|
||||
{
|
||||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||||
|
||||
protected $start;
|
||||
protected $end;
|
||||
|
||||
public function __construct($start, $end)
|
||||
{
|
||||
$this->start = $start;
|
||||
$this->end = $end;
|
||||
}
|
||||
|
||||
public function handle()
|
||||
{
|
||||
Artisan::call('process-yd-portal-data-command', [
|
||||
'start_date' => $this->start,
|
||||
'end_date' => $this->end
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\Jobs\Commands\V3\YD;
|
||||
|
||||
|
||||
use App\Classes\Modules\PackingLists\Processors\V3\FetchContainersUpdatesYdPortalV3Processor;
|
||||
use App\Models\Container;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class FetchContainersUpdatesYdPortalV3CommandJob implements ShouldQueue
|
||||
{
|
||||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||||
|
||||
protected $container;
|
||||
|
||||
public function __construct(Container $container)
|
||||
{
|
||||
$this->container = $container;
|
||||
}
|
||||
|
||||
public function handle()
|
||||
{
|
||||
Log::info('Processing FetchContainersUpdatesYdPortalV3CommandJob');
|
||||
$processor = app(FetchContainersUpdatesYdPortalV3Processor::class);
|
||||
$processor->execute($this->container);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\Jobs\Commands\V3\YD;
|
||||
|
||||
|
||||
use App\Classes\Modules\PackingLists\Processors\V3\FetchContainersYdPortalV3Processor;
|
||||
use App\Models\PackingList;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class FetchContainersYdPortalV3CommandJob implements ShouldQueue
|
||||
{
|
||||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||||
|
||||
protected $packingList;
|
||||
|
||||
public function __construct(PackingList $packingList)
|
||||
{
|
||||
$this->packingList = $packingList;
|
||||
}
|
||||
|
||||
public function handle()
|
||||
{
|
||||
Log::info('Processing FetchContainersYdPortalV3CommandJob');
|
||||
$processor = app(FetchContainersYdPortalV3Processor::class);
|
||||
$processor->execute($this->packingList);
|
||||
}
|
||||
}
|
||||
@@ -13,6 +13,7 @@ use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class FetchOrdersFromYDPortalJob implements ShouldQueue
|
||||
{
|
||||
@@ -29,12 +30,17 @@ class FetchOrdersFromYDPortalJob implements ShouldQueue
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
Log::info('FetchOrdersFromYDPortalJob starts');
|
||||
Log::info('FetchPackingListsFromYdPortalProcessor starts');
|
||||
(App()->make(FetchPackingListsFromYdPortalProcessor::class))->execute();
|
||||
Log::info('FetchContainersFromYdPortalProcessor starts');
|
||||
(App()->make(FetchContainersFromYdPortalProcessor::class))->execute();
|
||||
Log::info('FetchContainersUpdatesFromYdPortalProcessor starts');
|
||||
(App()->make(FetchContainersUpdatesFromYdPortalProcessor::class))->execute();
|
||||
Log::info('FetchDeliveryUpdatesFromYdPortalProcessor starts');
|
||||
(App()->make(FetchDeliveryUpdatesFromYdPortalProcessor::class))->execute();
|
||||
|
||||
// (App()->make(FetchOrderListsFromYdPortalProcessor::class))->execute();
|
||||
Log::info('FetchOrdersFromYDPortalJob ends');
|
||||
// (App()->make(FetchOrderListsFromYdPortalProcessor::class))->execute();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
namespace App\Classes\Jobs;
|
||||
|
||||
use App\Classes\Modules\PackingLists\Processors\ListPackingListsJobProcessor;
|
||||
use App\Classes\Modules\Jobs\DataTransferObjects\ListGenericJobObject;
|
||||
use App\Classes\Modules\Jobs\DataTransferObjects\JobSubmissionObject;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
@@ -17,29 +17,29 @@ class ListPackingListsJob implements ShouldQueue
|
||||
|
||||
public $timeout = 900;
|
||||
|
||||
/** @var ListGenericJobObject */
|
||||
private $listGenericJobObject;
|
||||
/** @var JobSubmissionObject */
|
||||
private $jobSubmissionObject;
|
||||
|
||||
/**
|
||||
* ListPackingListsJob constructor.
|
||||
* @param ListGenericJobObject $listGenericJobObject
|
||||
* @param JobSubmissionObject $JobSubmissionObject
|
||||
*/
|
||||
public function __construct(ListGenericJobObject $listGenericJobObject)
|
||||
public function __construct(JobSubmissionObject $jobSubmissionObject)
|
||||
{
|
||||
$this->listGenericJobObject = $listGenericJobObject;
|
||||
$this->jobSubmissionObject = $jobSubmissionObject;
|
||||
}
|
||||
|
||||
public function handle()
|
||||
{
|
||||
$rawPayload = $this->job->payload();
|
||||
if(isset($rawPayload['data']['commandName'])){
|
||||
$this->listGenericJobObject->setJobCommandName($rawPayload['data']['commandName']);
|
||||
$this->jobSubmissionObject->setJobCommandName($rawPayload['data']['commandName']);
|
||||
}
|
||||
|
||||
if(isset($rawPayload['data']['command'])){
|
||||
$this->listGenericJobObject->setJobCommand($rawPayload['data']['command']);
|
||||
$this->jobSubmissionObject->setJobCommand($rawPayload['data']['command']);
|
||||
}
|
||||
|
||||
$result = (App()->make(ListPackingListsJobProcessor::class))->execute($this->listGenericJobObject);
|
||||
$result = (App()->make(ListPackingListsJobProcessor::class))->execute($this->jobSubmissionObject);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\Jobs;
|
||||
|
||||
use App\Classes\Modules\Reports\Processors\MonthlyReportJobProcessor;
|
||||
use App\Classes\Modules\Jobs\DataTransferObjects\JobSubmissionObject;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
|
||||
|
||||
class MonthlyReportJob implements ShouldQueue
|
||||
{
|
||||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||||
|
||||
public $timeout = 900;
|
||||
|
||||
/** @var JobSubmissionObject */
|
||||
private $jobSubmissionObject;
|
||||
|
||||
/**
|
||||
* MonthlyReportJob constructor.
|
||||
* @param JobSubmissionObject $jobSubmissionObject
|
||||
*/
|
||||
public function __construct(JobSubmissionObject $jobSubmissionObject)
|
||||
{
|
||||
$this->jobSubmissionObject = $jobSubmissionObject;
|
||||
}
|
||||
|
||||
public function handle()
|
||||
{
|
||||
$rawPayload = $this->job->payload();
|
||||
if(isset($rawPayload['data']['commandName'])){
|
||||
$this->jobSubmissionObject->setJobCommandName($rawPayload['data']['commandName']);
|
||||
}
|
||||
|
||||
if(isset($rawPayload['data']['command'])){
|
||||
$this->jobSubmissionObject->setJobCommand($rawPayload['data']['command']);
|
||||
}
|
||||
|
||||
$result = (App()->make(MonthlyReportJobProcessor::class))->execute($this->jobSubmissionObject);
|
||||
}
|
||||
}
|
||||
@@ -20,6 +20,7 @@ use Illuminate\Queue\SerializesModels;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use App\Classes\General\Helper;
|
||||
use App\Classes\General\LogHelper;
|
||||
|
||||
class UpdatePerfexCRMInvoice implements ShouldQueue
|
||||
{
|
||||
@@ -47,7 +48,7 @@ class UpdatePerfexCRMInvoice implements ShouldQueue
|
||||
$invoiceId = 0;
|
||||
$invoiceStatus = 0;
|
||||
$invoice = (App()->make(FetchesPerfexCRMInvoice::class))->execute($customer->userid,"INV-", $transaction->owner->bill_no);
|
||||
Log::channel('perfex_crm')->info('UpdatePerfexCRMInvoice debug bill_no: ' . $transaction->owner->bill_no . ', Project Id: ' . $this->updatePerfexCRMInvoiceObject->getProjectId());
|
||||
LogHelper::channel('perfex_crm')->info('UpdatePerfexCRMInvoice debug bill_no: ' . $transaction->owner->bill_no . ', Project Id: ' . $this->updatePerfexCRMInvoiceObject->getProjectId());
|
||||
|
||||
if(is_null($invoice)){
|
||||
$result = (App()->make(CreatePerfexCRMInvoiceProcessor::class))->execute($transaction->owner, $this->updatePerfexCRMInvoiceObject->getIsPaid());
|
||||
@@ -55,7 +56,7 @@ class UpdatePerfexCRMInvoice implements ShouldQueue
|
||||
$invoiceId = $result->payload['id'];
|
||||
} else {
|
||||
// Log::error(json_encode('UpdatePerfexCRMInvoice CreatePerfexCRMInvoiceProcessor failed'));
|
||||
Log::channel('perfex_crm')->info('UpdatePerfexCRMInvoice CreatePerfexCRMInvoiceProcessor failed');
|
||||
LogHelper::channel('perfex_crm')->info('UpdatePerfexCRMInvoice CreatePerfexCRMInvoiceProcessor failed');
|
||||
}
|
||||
}
|
||||
else{
|
||||
|
||||
@@ -32,12 +32,12 @@ class UpdatePerfexCRMPrelude implements ShouldQueue
|
||||
|
||||
/**
|
||||
* UpdatePerfexCRMPrelude constructor.
|
||||
* @param $packingList
|
||||
* @param PackingList $packingList
|
||||
* @param Transaction $transaction
|
||||
* @param UpdatePerfexCRMObject $updatePerfexCRMObject
|
||||
* @param bool|null $shouldCreateInvoice
|
||||
*/
|
||||
public function __construct($packingList, $transaction, UpdatePerfexCRMObject $updatePerfexCRMObject, ?bool $shouldCreateInvoice = false)
|
||||
public function __construct(?PackingList $packingList, $transaction, UpdatePerfexCRMObject $updatePerfexCRMObject, ?bool $shouldCreateInvoice = false)
|
||||
{
|
||||
$this->packingList = $packingList;
|
||||
$this->transaction = $transaction;
|
||||
@@ -47,6 +47,12 @@ class UpdatePerfexCRMPrelude implements ShouldQueue
|
||||
|
||||
public function handle()
|
||||
{
|
||||
Log::info('UpdatePerfexCRMPrelude packingList: ' . json_encode($this->packingList));
|
||||
|
||||
if(env('APP_ENV') !== 'production'){
|
||||
return;
|
||||
}
|
||||
|
||||
if(is_null($this->packingList)){
|
||||
$this->packingList = $this->transaction->owner->owner;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,87 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\Modules\Accounts\ControllersLogic;
|
||||
|
||||
use App\Classes\Exceptions\ResourceConflictException;
|
||||
use App\Classes\Exceptions\ResourceNotFoundException;
|
||||
use App\Classes\General\Abstracts\AbstractControllerLogic;
|
||||
use App\Classes\Modules\Accounts\Processors\GenerateEmailVerificationAttemptProcessor;
|
||||
use App\Classes\Modules\Companies\DataTransferObjects\EmploymentObject;
|
||||
use App\Classes\Modules\Companies\Processors\AssignEmployeeProcessor;
|
||||
use App\Classes\ValueObjects\Constants\ApprovalStatus;
|
||||
use App\Http\Resources\UserResource;
|
||||
use App\Models\User;
|
||||
use Illuminate\Database\QueryException;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class AdminAddNewMemberLogic extends AbstractControllerLogic
|
||||
{
|
||||
|
||||
public function notification(): array
|
||||
{
|
||||
return [
|
||||
'title' => 'Admin Updated Email',
|
||||
'message' => 'Successfully updated email'
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @var AssignEmployeeProcessor
|
||||
*/
|
||||
private $assignEmployeeProcessor;
|
||||
|
||||
/**
|
||||
* @var GenerateEmailVerificationAttemptProcessor
|
||||
*/
|
||||
private $generateEmailVerificationAttemptProcessor;
|
||||
|
||||
/**
|
||||
* AddNewMemberLogic constructor.
|
||||
* @param AssignEmployeeProcessor $assignEmployeeProcessor
|
||||
* @param GenerateEmailVerificationAttemptProcessor $generateEmailVerificationAttemptProcessor
|
||||
*/
|
||||
public function __construct(AssignEmployeeProcessor $assignEmployeeProcessor, GenerateEmailVerificationAttemptProcessor $generateEmailVerificationAttemptProcessor)
|
||||
{
|
||||
$this->assignEmployeeProcessor = $assignEmployeeProcessor;
|
||||
$this->generateEmailVerificationAttemptProcessor = $generateEmailVerificationAttemptProcessor;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Request $request
|
||||
* @return JsonResponse
|
||||
* @throws ResourceConflictException
|
||||
* @throws \App\Classes\Exceptions\AccessForbiddenException
|
||||
* @throws \App\Classes\Exceptions\MalformedRequestException
|
||||
* @throws \App\Classes\Exceptions\RequestValidationException
|
||||
*/
|
||||
public function logic(Request $request): JsonResponse
|
||||
{
|
||||
Log::info($request->input('employeeId'));
|
||||
|
||||
try {
|
||||
if (!$authUser = User::find($request->input('employeeId'))) {
|
||||
throw new ResourceNotFoundException('User not found.');
|
||||
}
|
||||
|
||||
$user = $authUser->replicate();
|
||||
$user->email = $request->input('email');
|
||||
$user->status = ApprovalStatus::PENDING_VERIFICATION;
|
||||
$user->save();
|
||||
|
||||
} catch (QueryException $e) {
|
||||
throw new ResourceConflictException('Email already exists.');
|
||||
}
|
||||
|
||||
Log::info($request->input('email'));
|
||||
|
||||
if ($company = $authUser->companyModule()->first()) {
|
||||
$this->assignEmployeeProcessor->execute(new EmploymentObject($company, $user));
|
||||
}
|
||||
|
||||
$this->generateEmailVerificationAttemptProcessor->execute($user);
|
||||
|
||||
return $this->resourceResponse(new UserResource($user));
|
||||
}
|
||||
}
|
||||
@@ -36,6 +36,8 @@ use App\Models\User;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\App;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class CreateCustomerLogic extends AbstractControllerLogic
|
||||
{
|
||||
@@ -167,6 +169,19 @@ class CreateCustomerLogic extends AbstractControllerLogic
|
||||
CreatePerfexCRMCustomer::dispatch($createLeadPerfexCRMObject);
|
||||
}
|
||||
|
||||
if(app()->environment(['production'])){
|
||||
// call wac webhook
|
||||
$url = config('wagWebhookUrl.account_registration_url');
|
||||
$payload = [
|
||||
'name' => $request->input('name'),
|
||||
'email' => $request->input('email'),
|
||||
'phone' => $request->input('phone'),
|
||||
'portal' => 'izyim'
|
||||
];
|
||||
$response = Http::post($url, $payload);
|
||||
Log::channel('wac_webhook')->info('Register Account: ' . json_encode($response));
|
||||
}
|
||||
|
||||
// $this->generateEmailVerificationAttemptProcessor->execute($user);
|
||||
|
||||
return $this->response($this->authenticationProcessor->execute($request));
|
||||
|
||||
@@ -77,11 +77,11 @@ class GeneratePasswordResetLogic extends AbstractControllerLogic
|
||||
|
||||
$attempt = $this->generatesPasswordReset->execute($user);
|
||||
|
||||
$this->passwordResetTokenExpiration::dispatch($attempt)->delay(now()->addHours(24));
|
||||
// $this->passwordResetTokenExpiration::dispatch($attempt)->delay(now()->addHours(24)); //converted to schedule task
|
||||
$this->sendResetPasswordEmail::dispatch($user, $attempt);
|
||||
|
||||
return $this->response(['email' => $object->getEmail()]);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\Modules\Accounts\DataTransferObjects;
|
||||
|
||||
|
||||
use App\Classes\General\Interfaces\DataTransferObject;
|
||||
|
||||
class KeyValuePairObject implements DataTransferObject
|
||||
{
|
||||
/** @var string */
|
||||
private $key;
|
||||
|
||||
/** @var string */
|
||||
private $value;
|
||||
|
||||
|
||||
/**
|
||||
* KeyValuePairObject constructor.
|
||||
* @param string $key
|
||||
* @param string $value
|
||||
*/
|
||||
public function __construct(string $key, string $value)
|
||||
{
|
||||
$this->key = $key;
|
||||
$this->value = $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getKey(): string
|
||||
{
|
||||
return $this->key;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getValue(): string
|
||||
{
|
||||
return $this->value;
|
||||
}
|
||||
|
||||
}
|
||||
+1
-1
@@ -50,7 +50,7 @@ class GenerateEmailVerificationAttemptProcessor
|
||||
|
||||
$attempt = $this->generatesEmailVerificationAttempt->execute($user);
|
||||
|
||||
$this->emailVerificationAttemptExpiration::dispatch($attempt)->delay(now()->addHours(48));
|
||||
//$this->emailVerificationAttemptExpiration::dispatch($attempt)->delay(now()->addHours(48)); //converted to schedule task
|
||||
|
||||
$this->sendUserVerificationEmail::dispatch($user, $attempt);
|
||||
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\Modules\Accounts\Services;
|
||||
|
||||
|
||||
use App\Classes\General\Eloquent\AbstractUpdateRelationshipRecord;
|
||||
use App\Classes\General\Interfaces\KeyValueInterface;
|
||||
use App\Classes\Modules\Accounts\DataTransferObjects\KeyValuePairObject;
|
||||
use App\Models\KeyValuePair;
|
||||
|
||||
class CreatesKeyValuePair extends AbstractUpdateRelationshipRecord
|
||||
{
|
||||
/**
|
||||
* @param KeyValueInterface $kv
|
||||
* @param KeyValuePairObject $object
|
||||
* @return \Illuminate\Database\Eloquent\Model
|
||||
* @throws \App\Classes\Exceptions\MalformedRequestException
|
||||
*/
|
||||
|
||||
public function execute(KeyValueInterface $kv, KeyValuePairObject $object) {
|
||||
$model = new KeyValuePair();
|
||||
$model->key = $object->getKey();
|
||||
$model->value = $object->getValue();
|
||||
|
||||
return $this->handler($kv->attributesKVP(), $model);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\Modules\Accounts\Services;
|
||||
|
||||
use App\Classes\General\Eloquent\AbstractDeleteRecord;
|
||||
use App\Models\KeyValuePair;
|
||||
|
||||
class DeletesKeyValuePair extends AbstractDeleteRecord
|
||||
{
|
||||
|
||||
/**
|
||||
* @param KeyValuePair $model
|
||||
* @return mixed
|
||||
* @throws \App\Classes\Exceptions\MalformedRequestException
|
||||
*/
|
||||
public function execute(KeyValuePair $model) {
|
||||
return $this->handler($model);
|
||||
}
|
||||
}
|
||||
@@ -11,7 +11,8 @@ use App\Models\User;
|
||||
use Carbon\Carbon;
|
||||
use Tymon\JWTAuth\JWT;
|
||||
|
||||
class GeneratesAuthenticationToken {
|
||||
class GeneratesAuthenticationToken
|
||||
{
|
||||
|
||||
/** @var JWT */
|
||||
private $builder;
|
||||
@@ -21,7 +22,8 @@ class GeneratesAuthenticationToken {
|
||||
* GeneratesAuthenticationToken constructor.
|
||||
* @param JWT $builder
|
||||
*/
|
||||
public function __construct(JWT $builder) {
|
||||
public function __construct(JWT $builder)
|
||||
{
|
||||
$this->builder = $builder;
|
||||
}
|
||||
|
||||
@@ -31,15 +33,16 @@ class GeneratesAuthenticationToken {
|
||||
* @param bool $rememberUser
|
||||
* @return string
|
||||
*/
|
||||
public function execute(User $user, bool $rememberUser = false): string {
|
||||
public function execute(User $user, bool $rememberUser = false): string
|
||||
{
|
||||
|
||||
$this->builder->manager()->setBlacklistEnabled(false);
|
||||
|
||||
// generate token for the customer
|
||||
$this->builder->factory()->setTTL(Carbon::now()->addDay()->timestamp);
|
||||
$this->builder->factory()->setTTL(525600); // 1 year
|
||||
|
||||
if ($rememberUser === true) {
|
||||
$this->builder->factory()->setTTL(Carbon::now()->addWeek()->timestamp);
|
||||
$this->builder->factory()->setTTL(525600); // 1 year
|
||||
}
|
||||
|
||||
// set the claim based on the object
|
||||
@@ -52,7 +55,8 @@ class GeneratesAuthenticationToken {
|
||||
/**
|
||||
* @param User $user
|
||||
*/
|
||||
private function setTokenClaims(User $user): void {
|
||||
private function setTokenClaims(User $user): void
|
||||
{
|
||||
|
||||
$claims = [
|
||||
'id' => $user->id,
|
||||
@@ -62,7 +66,7 @@ class GeneratesAuthenticationToken {
|
||||
'status' => $user->status
|
||||
];
|
||||
|
||||
if($user->type === RoleTypes::USER) {
|
||||
if ($user->type === RoleTypes::USER) {
|
||||
|
||||
/** @var Company $companyModule */
|
||||
$companyModule = $user->companyModule()->first();
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\Modules\Accounts\Services;
|
||||
|
||||
use App\Classes\General\Eloquent\AbstractUpdateRecord;
|
||||
use App\Classes\Modules\Accounts\DataTransferObjects\KeyValuePairObject;
|
||||
use App\Models\KeyValuePair;
|
||||
|
||||
class UpdatesKeyValuePair extends AbstractUpdateRecord
|
||||
{
|
||||
/**
|
||||
* @param KeyValuePair $model
|
||||
* @param KeyValuePairObject $object
|
||||
* @return \Illuminate\Database\Eloquent\Model
|
||||
* @throws \App\Classes\Exceptions\MalformedRequestException
|
||||
*/
|
||||
public function execute(KeyValuePair $model, KeyValuePairObject $object) {
|
||||
$model->key = $object->getKey();
|
||||
$model->value = $object->getValue();
|
||||
return $this->handler($model);
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,7 @@ namespace App\Classes\Modules\Accounts\Standards\Validators;
|
||||
|
||||
use App\Classes\General\Abstracts\AbstractValidation;
|
||||
use App\Classes\Modules\Accounts\DataTransferObjects\UserObject;
|
||||
use Illuminate\Validation\Rule;
|
||||
|
||||
class UserCreateValidation extends AbstractValidation
|
||||
{
|
||||
@@ -29,7 +30,7 @@ class UserCreateValidation extends AbstractValidation
|
||||
{
|
||||
return [
|
||||
'name' => 'required',
|
||||
'email' => 'required|unique:users',
|
||||
'email' => ['required', Rule::unique('users')],
|
||||
'password' => 'required',
|
||||
];
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ namespace App\Classes\Modules\Accounts\Standards\Validators;
|
||||
|
||||
use App\Classes\General\Abstracts\AbstractValidation;
|
||||
use App\Classes\Modules\Accounts\DataTransferObjects\RegistrationObject;
|
||||
use Illuminate\Validation\Rule;
|
||||
|
||||
class UserRegistrationValidation extends AbstractValidation
|
||||
{
|
||||
@@ -32,7 +33,7 @@ class UserRegistrationValidation extends AbstractValidation
|
||||
{
|
||||
return [
|
||||
'name' => 'required',
|
||||
'email' => 'required|email|max:255|unique:users,email',
|
||||
'email' => ['required', 'email', 'max:255', Rule::unique('users', 'email')],
|
||||
'password' => 'required|min:6|confirmed',
|
||||
'type' => 'required',
|
||||
'status' => 'required'
|
||||
|
||||
@@ -15,8 +15,10 @@ use App\Classes\Modules\Contacts\Processors\CreateContactProcessor;
|
||||
use App\Classes\Modules\Remarks\DataTransferObjects\RemarkObject;
|
||||
use App\Classes\Modules\Remarks\Processors\CreateRemarkProcessor;
|
||||
use App\Classes\ValueObjects\Constants\ApprovalStatus;
|
||||
use App\Classes\ValueObjects\Constants\RemarkTypes;
|
||||
use App\Http\Resources\AddressResource;
|
||||
use App\Models\Address;
|
||||
use Carbon\Carbon;
|
||||
use ErrorException;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
@@ -100,6 +102,24 @@ class CreateAddressLogic extends AbstractControllerLogic
|
||||
$this->createRemarkProcessor->execute($address, $remarkObject);
|
||||
}
|
||||
|
||||
if ($request->input('pickup_time_to') <= $request->input('pickup_time_from')) {
|
||||
$pickupTimeFrom = Carbon::parse($request->input('pickup_time_from'));
|
||||
$request->merge([
|
||||
'pickup_time_to' => $pickupTimeFrom->addHour()->format('H:i') // Format to hh:mm
|
||||
]);
|
||||
}
|
||||
|
||||
$addressExtraFields = [
|
||||
'property_type' => $request->input('property_type'),
|
||||
'receive_goods_working_hours' => $request->input('receive_goods_working_hours'),
|
||||
'receive_goods_after_hours' => $request->input('receive_goods_after_hours'),
|
||||
'receive_goods_on_saturday' => $request->input('receive_goods_on_saturday'),
|
||||
];
|
||||
|
||||
$address->addressExtraFields()->delete();
|
||||
$addressExtraFieldsObject = new RemarkObject(json_encode($addressExtraFields), Auth()->user()->id, RemarkTypes::ADDRESS_EXTRA_COLUMNS);
|
||||
$remark = $this->createRemarkProcessor->execute($address, $addressExtraFieldsObject);
|
||||
|
||||
return $this->resourceResponse(new AddressResource($address));
|
||||
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
namespace App\Classes\Modules\Addresses\ControllersLogic;
|
||||
|
||||
|
||||
use App\Classes\Exceptions\AccessForbiddenException;
|
||||
use App\Classes\General\Abstracts\AbstractControllerLogic;
|
||||
use App\Classes\Modules\Addresses\Services\CreatesAddress;
|
||||
use App\Classes\Modules\Addresses\Standards\Rules\CanCreateAddress;
|
||||
@@ -11,6 +11,7 @@ use App\Classes\Modules\Addresses\Services\FetchesAddress;
|
||||
use App\Classes\Modules\Companies\Services\FetchesCompanyModule;
|
||||
use App\Classes\ValueObjects\Constants\AddressType;
|
||||
use App\Classes\ValueObjects\Constants\ApprovalStatus;
|
||||
use App\Classes\ValueObjects\Constants\RoleTypes;
|
||||
use App\Http\Resources\AddressResource;
|
||||
use App\Models\Address;
|
||||
use App\Models\CompanyModule;
|
||||
@@ -67,7 +68,15 @@ class CreateBillingAddressLogic extends AbstractControllerLogic
|
||||
public function logic(Request $request) : JsonResponse
|
||||
{
|
||||
$companyModule = $this->fetchesCompanyModule->execute(['id' => $request->input('company_module_id')]);
|
||||
|
||||
|
||||
//cief todo: 90 - move this into canCreateAddress
|
||||
$roleToCheck = Auth()->user()->type;
|
||||
if (!in_array($roleToCheck, RoleTypes::ADMIN_ROLES)) {
|
||||
if($companyModule->company->e_invoice === 1){
|
||||
throw new AccessForbiddenException('Update of billing address not allowed.');
|
||||
}
|
||||
}
|
||||
|
||||
$address = $this->fetchesAddress->execute(['id' => $request->input('billing_address_id')]);
|
||||
|
||||
if ($address->type !== AddressType::BILLING || $address->id !== $companyModule->addresses->where('type', AddressType::BILLING)->first()->id) {
|
||||
@@ -83,4 +92,4 @@ class CreateBillingAddressLogic extends AbstractControllerLogic
|
||||
return $this->resourceResponse(new AddressResource($address));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ namespace App\Classes\Modules\Addresses\ControllersLogic;
|
||||
use App\Classes\General\Abstracts\AbstractControllerLogic;
|
||||
use App\Classes\Modules\Addresses\Services\ListsAddresses;
|
||||
use App\Classes\Modules\Addresses\Standards\Rules\CanListAddresses;
|
||||
use App\Classes\ValueObjects\Constants\AddressType;
|
||||
use App\Http\Resources\AddressResource;
|
||||
use ErrorException;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
@@ -51,13 +52,12 @@ class ListAddressesLogic extends AbstractControllerLogic
|
||||
*/
|
||||
public function logic(Request $request) : JsonResponse
|
||||
{
|
||||
|
||||
$this->canListAddresses->passes();
|
||||
|
||||
$query = $this->listsAddresses->execute($this->listsAddresses->deserializeFilters($request->input('filters')));
|
||||
//$query = $this->listsAddresses->execute($this->listsAddresses->deserializeFilters($request->input('filters')));
|
||||
$query = $this->listsAddresses->execute(array_merge($this->listsAddresses->deserializeFilters($request->input('filters')), ['type_not_in' => [AddressType::E_INVOICE]]));
|
||||
|
||||
return $this->collectionResponse(AddressResource::collection($query));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,10 +15,12 @@ use App\Classes\Modules\Remarks\DataTransferObjects\RemarkObject;
|
||||
use App\Classes\Modules\Remarks\Processors\CreateRemarkProcessor;
|
||||
use App\Classes\ValueObjects\Constants\AddressType;
|
||||
use App\Classes\ValueObjects\Constants\ApprovalStatus;
|
||||
use App\Classes\ValueObjects\Constants\RemarkTypes;
|
||||
use App\Http\Resources\AddressResource;
|
||||
use App\Models\Address;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Carbon\Carbon;
|
||||
|
||||
class UpdateAddressLogic extends AbstractControllerLogic
|
||||
{
|
||||
@@ -102,6 +104,24 @@ class UpdateAddressLogic extends AbstractControllerLogic
|
||||
$this->createRemarkProcessor->execute($address, $remarkObject);
|
||||
}
|
||||
|
||||
if ($request->input('pickup_time_to') <= $request->input('pickup_time_from')) {
|
||||
$pickupTimeFrom = Carbon::parse($request->input('pickup_time_from'));
|
||||
$request->merge([
|
||||
'pickup_time_to' => $pickupTimeFrom->addHour()->format('H:i') // Format to hh:mm
|
||||
]);
|
||||
}
|
||||
|
||||
$addressExtraFields = [
|
||||
'property_type' => $request->input('property_type'),
|
||||
'receive_goods_working_hours' => $request->input('receive_goods_working_hours'),
|
||||
'receive_goods_after_hours' => $request->input('receive_goods_after_hours'),
|
||||
'receive_goods_on_saturday' => $request->input('receive_goods_on_saturday'),
|
||||
];
|
||||
|
||||
$address->addressExtraFields()->delete();
|
||||
$addressExtraFieldsObject = new RemarkObject(json_encode($addressExtraFields), Auth()->user()->id, RemarkTypes::ADDRESS_EXTRA_COLUMNS);
|
||||
$remark = $this->createRemarkProcessor->execute($address, $addressExtraFieldsObject);
|
||||
|
||||
return $this->resourceResponse(new AddressResource($address));
|
||||
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ class AddressObject implements DataTransferObject
|
||||
/** @var int */
|
||||
private $districtId;
|
||||
|
||||
/** @var int */
|
||||
/** @var string */
|
||||
private $postCode;
|
||||
|
||||
/** @var int */
|
||||
@@ -42,12 +42,12 @@ class AddressObject implements DataTransferObject
|
||||
* @param int $countryId
|
||||
* @param int $stateId
|
||||
* @param int $districtId
|
||||
* @param int $postCode
|
||||
* @param string $postCode
|
||||
* @param int $type
|
||||
* @param int $status
|
||||
* @param null|string $reference
|
||||
*/
|
||||
public function __construct(string $streetOne, ?string $streetTwo, int $countryId, int $stateId, int $districtId, int $postCode, int $type, int $status, ?string $reference = null)
|
||||
public function __construct(string $streetOne, ?string $streetTwo, int $countryId, int $stateId, int $districtId, string $postCode, int $type, int $status, ?string $reference = null)
|
||||
{
|
||||
$this->streetOne = $streetOne;
|
||||
$this->streetTwo = $streetTwo;
|
||||
@@ -101,9 +101,9 @@ class AddressObject implements DataTransferObject
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
* @return string
|
||||
*/
|
||||
public function getPostCode(): int
|
||||
public function getPostCode(): string
|
||||
{
|
||||
return $this->postCode;
|
||||
}
|
||||
@@ -133,4 +133,4 @@ class AddressObject implements DataTransferObject
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\Modules\Addresses\Services;
|
||||
|
||||
|
||||
use App\Classes\General\Eloquent\AbstractUpdateRelationshipRecord;
|
||||
use App\Classes\General\Interfaces\Addressable;
|
||||
use App\Classes\Modules\Addresses\DataTransferObjects\AddressObject;
|
||||
use App\Models\Address;
|
||||
use App\Models\CompanyModule;
|
||||
|
||||
class UpsertsAddress extends AbstractUpdateRelationshipRecord
|
||||
{
|
||||
/**
|
||||
* Create or update the company's address.
|
||||
*
|
||||
* @param Addressable $addressable
|
||||
* @param AddressObject $object
|
||||
* @param int $id
|
||||
* @return \Illuminate\Database\Eloquent\Model
|
||||
* @throws \App\Classes\Exceptions\MalformedRequestException
|
||||
*/
|
||||
public function execute(Addressable $addressable, AddressObject $object, int $id)
|
||||
{
|
||||
//Create new or update?
|
||||
$model = $addressable->addresses()->where('id', $id)->first() ?? new Address();
|
||||
|
||||
$model->reference = $object->getReference();
|
||||
$model->street_one = $object->getStreetOne();
|
||||
$model->street_two = $object->getStreetTwo();
|
||||
$model->country_id = $object->getCountryId();
|
||||
$model->state_id = $object->getStateId();
|
||||
$model->district_id = $object->getDistrictId();
|
||||
$model->postcode = $object->getPostCode();
|
||||
$model->status = $object->getStatus();
|
||||
$model->type = $object->getType();
|
||||
|
||||
return $this->handler($addressable->addresses(), $model);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\Modules\Anthropic\Services;
|
||||
|
||||
|
||||
use Illuminate\Support\Facades\Http;
|
||||
use App\Classes\Exceptions\MalformedRequestException;
|
||||
use App\Classes\Exceptions\ConnectionErrorException;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class CreatesClaudeResponse
|
||||
{
|
||||
/**
|
||||
* @param string $userPrompt
|
||||
* @param string $model
|
||||
* @return null|object
|
||||
* @throws MalformedRequestException
|
||||
*/
|
||||
public function execute(string $userPrompt, string $model = "") {
|
||||
try {
|
||||
$content = [];
|
||||
|
||||
$content[] = [
|
||||
'type' => 'text',
|
||||
'text' => $userPrompt,
|
||||
];
|
||||
|
||||
$response = Http::withHeaders([
|
||||
'x-api-key' => config('anthropic.api_key'),
|
||||
'anthropic-version' => config('anthropic.api_version', '2023-06-01'),
|
||||
'Content-Type' => 'application/json',
|
||||
])->post(config('anthropic.base_url') . '/v1/messages', [
|
||||
'model' => !empty($model) ? $model : config('anthropic.default_model', 'claude-sonnet-4-5-20250929'),
|
||||
'max_tokens' => 8192,
|
||||
'messages' => [
|
||||
[
|
||||
'role' => 'user',
|
||||
'content' => $content,
|
||||
],
|
||||
],
|
||||
]);
|
||||
|
||||
if ($response->successful()) {
|
||||
return $response->json();
|
||||
} else {
|
||||
Log::info('CreatesClaudeResponse error: ' . $response->body());
|
||||
return null;
|
||||
}
|
||||
}
|
||||
catch (\Illuminate\Http\Client\ConnectionException $exception) {
|
||||
Log::info('ConnectionException' . json_encode($exception));
|
||||
throw new ConnectionErrorException(
|
||||
'Failed to connect to Claude API',
|
||||
$exception->getMessage(),
|
||||
$userPrompt,
|
||||
$exception->getTraceAsString()
|
||||
);
|
||||
}
|
||||
catch (\Exception $exception) {
|
||||
Log::info('Exception' . json_encode($exception));
|
||||
throw new MalformedRequestException(
|
||||
'Unable to get correct response from Claude API: ' . $exception->getMessage()
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\Modules\Anthropic\Services;
|
||||
|
||||
|
||||
use Illuminate\Support\Facades\Http;
|
||||
use App\Classes\Exceptions\MalformedRequestException;
|
||||
use App\Classes\Exceptions\ConnectionErrorException;
|
||||
|
||||
class CreatesClaudeResponseWithFiles
|
||||
{
|
||||
public function execute(string $userPrompt, array $fileIds)
|
||||
{
|
||||
try {
|
||||
$content = [];
|
||||
|
||||
// User prompt
|
||||
$content[] = [
|
||||
'type' => 'text',
|
||||
'text' => $userPrompt,
|
||||
];
|
||||
|
||||
// Attach files
|
||||
foreach ($fileIds as $fileId) {
|
||||
$content[] = [
|
||||
'type' => 'document',
|
||||
'source' => [
|
||||
'type' => 'file',
|
||||
'file_id' => $fileId,
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
$response = Http::withHeaders([
|
||||
'x-api-key' => config('anthropic.api_key'),
|
||||
'anthropic-version' => config('anthropic.api_version', '2023-06-01'),
|
||||
'anthropic-beta' => 'files-api-2025-04-14',
|
||||
'Content-Type' => 'application/json',
|
||||
])->post(config('anthropic.base_url') . '/v1/messages', [
|
||||
'model' => config('anthropic.default_model', 'claude-sonnet-4-5-20250929'),
|
||||
'max_tokens' => 16384,
|
||||
'messages' => [
|
||||
[
|
||||
'role' => 'user',
|
||||
'content' => $content,
|
||||
],
|
||||
],
|
||||
]);
|
||||
|
||||
return $response->json();
|
||||
}
|
||||
catch (\Illuminate\Http\Client\ConnectionException $exception) {
|
||||
$error = 'Failed to connect to Claude API';
|
||||
throw new ConnectionErrorException(
|
||||
$error,
|
||||
$exception->getMessage(),
|
||||
$userPrompt,
|
||||
$exception->getTraceAsString()
|
||||
);
|
||||
}
|
||||
catch (\Exception $exception) {
|
||||
throw new MalformedRequestException(
|
||||
'Unable to get correct response from Claude API: ' . $exception->getMessage()
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\Modules\Anthropic\Services;
|
||||
|
||||
|
||||
use Illuminate\Support\Facades\Http;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use App\Classes\Exceptions\MalformedRequestException;
|
||||
use App\Classes\Exceptions\ConnectionErrorException;
|
||||
|
||||
class UploadsClaudeFiles
|
||||
{
|
||||
public function execute(array $paths): array
|
||||
{
|
||||
try {
|
||||
$ids = [];
|
||||
|
||||
foreach ($paths as $path) {
|
||||
$response = Http::withHeaders([
|
||||
'x-api-key' => config('anthropic.api_key'),
|
||||
'anthropic-version' => '2023-06-01',
|
||||
'anthropic-beta' => 'files-api-2025-04-14',
|
||||
])->attach(
|
||||
'file',
|
||||
fopen($path, 'r'),
|
||||
basename($path)
|
||||
)->post(config('anthropic.base_url') . '/v1/files');
|
||||
|
||||
$data = $response->json();
|
||||
|
||||
if ($response->successful() && isset($data['id'])) {
|
||||
$ids[] = $data['id'];
|
||||
} else {
|
||||
Log::error('Claude file upload failed', [
|
||||
'path' => $path,
|
||||
'response' => $data,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
return $ids;
|
||||
}
|
||||
catch (\Illuminate\Http\Client\ConnectionException $exception) {
|
||||
$error = 'Failed to connect to Claude API';
|
||||
throw new ConnectionErrorException(
|
||||
$error,
|
||||
$exception->getMessage(),
|
||||
$exception->getTraceAsString()
|
||||
);
|
||||
}
|
||||
catch (\Exception $exception) {
|
||||
throw new MalformedRequestException(
|
||||
'Unable to get correct response from Claude API: ' . $exception->getMessage()
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,140 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\Modules\Billplzs\Processors;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use App\Models\Wallet;
|
||||
use App\Models\Group;
|
||||
use App\Classes\ValueObjects\Constants\ApprovalStatus;
|
||||
use App\Classes\ValueObjects\Constants\PaymentMethodType;
|
||||
use App\Classes\Modules\Transactions\Processors\CreatePaymentTransactionProcessor;
|
||||
use App\Classes\Modules\Transactions\Processors\ReleaseGoodsToCustomerProcessor;
|
||||
use App\Classes\Modules\Transactions\Services\UpdatesTransactionStatus;
|
||||
use App\Classes\Modules\Wallets\Services\UpdatesWalletBalance;
|
||||
use App\Classes\Modules\Orders\Processors\UpdateDoFromVTPortalProcessor;
|
||||
use App\Classes\Modules\Orders\Processors\UpdateDoFromYDPortalProcessor;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
//Date: 20240817
|
||||
//This Processor is used for one time data patching with OneTimeTransactionFixBillplzFailedCallback.php
|
||||
class CallbackBillplzDataPatchProcessor
|
||||
{
|
||||
/** @var UpdatesTransactionStatus */
|
||||
private $updatesTransactionStatus;
|
||||
|
||||
/** @var UpdateDoFromVTPortalProcessor */
|
||||
private $updateDoFromVTPortalProcessor;
|
||||
|
||||
/** @var UpdateDoFromYDPortalProcessor */
|
||||
private $updateDoFromYDPortalProcessor;
|
||||
|
||||
/** @var UpdatesWalletBalance */
|
||||
private $updatesWalletBalance;
|
||||
|
||||
/** @var CreatePaymentTransactionProcessor */
|
||||
private $createPaymentTransactionProcessor;
|
||||
|
||||
/** @var ReleaseGoodsToCustomerProcessor */
|
||||
private $releaseGoodsToCustomerProcessor;
|
||||
|
||||
/**
|
||||
* CallbackBillplzDataPatchProcessor constructor.
|
||||
* @param UpdatesTransactionStatus $updatesTransactionStatus
|
||||
* @param UpdateDoFromVTPortalProcessor $updateDoFromVTPortalProcessor
|
||||
* @param UpdateDoFromYDPortalProcessor $updateDoFromYDPortalProcessor
|
||||
* @param UpdatesWalletBalance $updatesWalletBalance
|
||||
* @param CreatePaymentTransactionProcessor $createPaymentTransactionProcessor
|
||||
* @param ReleaseGoodsToCustomerProcessor $releaseGoodsToCustomerProcessor
|
||||
*/
|
||||
public function __construct(UpdatesTransactionStatus $updatesTransactionStatus, UpdateDoFromVTPortalProcessor $updateDoFromVTPortalProcessor, UpdateDoFromYDPortalProcessor $updateDoFromYDPortalProcessor, UpdatesWalletBalance $updatesWalletBalance, CreatePaymentTransactionProcessor $createPaymentTransactionProcessor, ReleaseGoodsToCustomerProcessor $releaseGoodsToCustomerProcessor)
|
||||
{
|
||||
$this->updatesTransactionStatus = $updatesTransactionStatus;
|
||||
$this->updateDoFromVTPortalProcessor = $updateDoFromVTPortalProcessor;
|
||||
$this->updateDoFromYDPortalProcessor = $updateDoFromYDPortalProcessor;
|
||||
$this->updatesWalletBalance = $updatesWalletBalance;
|
||||
$this->createPaymentTransactionProcessor = $createPaymentTransactionProcessor;
|
||||
$this->releaseGoodsToCustomerProcessor = $releaseGoodsToCustomerProcessor;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param Request $request
|
||||
* @throws \App\Classes\Exceptions\MalformedRequestException
|
||||
*/
|
||||
public function execute($transaction, $status)
|
||||
{
|
||||
$invoice = $transaction->owner;
|
||||
$packingList = $invoice->owner;
|
||||
|
||||
$proceed = $this->checkForGroupPayment($transaction);
|
||||
if(!$proceed) return false;
|
||||
|
||||
$this->updatesTransactionStatus->execute($transaction, $status);
|
||||
|
||||
Log::info('CallbackBillplzDataPatchProcessor 1');
|
||||
|
||||
// check if is wallet top up
|
||||
if ($transaction->owner instanceof Wallet && $status === ApprovalStatus::APPROVED) {
|
||||
|
||||
Log::info('CallbackBillplzDataPatchProcessor 2');
|
||||
|
||||
$this->updatesWalletBalance->execute($transaction->owner, $transaction->amount);
|
||||
|
||||
$group = Group::where('reference', $transaction->payment_reference)->first();
|
||||
|
||||
// check if is group payment
|
||||
if ($group) {
|
||||
foreach ($group->groupTransactions as $groupTransaction) {
|
||||
$invoice = $groupTransaction->transaction;
|
||||
Log::info('CallbackBillplzDataPatchProcessor 3: '.json_encode($invoice));
|
||||
|
||||
if($invoice->status !== ApprovalStatus::COMPLETED){
|
||||
$paymentTransaction = $this->createPaymentTransactionProcessor->execute($invoice, PaymentMethodType::WALLET, null, false);
|
||||
|
||||
if($paymentTransaction && $paymentTransaction->status == ApprovalStatus::APPROVED){
|
||||
$pL = $invoice->owner;
|
||||
$this->releaseGoodsToCustomerProcessor->execute($pL, $invoice, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$group->status = $status;
|
||||
$group->save();
|
||||
}
|
||||
}
|
||||
|
||||
if (!$transaction->owner instanceof Wallet) {
|
||||
Log::info('CallbackBillplzDataPatchProcessor 3');
|
||||
$this->releaseGoodsToCustomerProcessor->execute($packingList, $invoice);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private function checkForGroupPayment($transaction){
|
||||
//This check is targetting group payment that expired and soft deleted
|
||||
//command:check-storage-invoices must already run for this part of the code to work properly
|
||||
$group = Group::withTrashed()->where('reference', $transaction->payment_reference)->first();
|
||||
if ($group) {
|
||||
$totalAmountToBePaid = 0;
|
||||
$actualAmountPaid = $transaction->amount;
|
||||
|
||||
foreach ($group->groupTransactions as $groupTransaction) {
|
||||
$invoice = $groupTransaction->transaction;
|
||||
if($invoice->status !== ApprovalStatus::COMPLETED){
|
||||
$totalAmountToBePaid += $invoice->amount;
|
||||
}
|
||||
}
|
||||
|
||||
if(($totalAmountToBePaid - $actualAmountPaid) < 0.01){
|
||||
|
||||
}
|
||||
else{
|
||||
Log::channel('storage_invoices')->info('Total amount from current transaction: '.$totalAmountToBePaid);
|
||||
Log::channel('storage_invoices')->info('Total amount from paid transaction: '.$transaction->amount);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Classes\Modules\Billplzs\Processors;
|
||||
|
||||
use App\Classes\General\LogHelper;
|
||||
use Illuminate\Http\Request;
|
||||
use App\Models\Wallet;
|
||||
use App\Models\Group;
|
||||
@@ -36,7 +37,7 @@ class CallbackBillplzProcessor
|
||||
private $releaseGoodsToCustomerProcessor;
|
||||
|
||||
/**
|
||||
* CreateUserProcessor constructor.
|
||||
* CallbackBillplzProcessor constructor.
|
||||
* @param UpdatesTransactionStatus $updatesTransactionStatus
|
||||
* @param UpdateDoFromVTPortalProcessor $updateDoFromVTPortalProcessor
|
||||
* @param UpdateDoFromYDPortalProcessor $updateDoFromYDPortalProcessor
|
||||
@@ -121,8 +122,8 @@ class CallbackBillplzProcessor
|
||||
|
||||
}
|
||||
else{
|
||||
Log::channel('storage_invoices')->info('Total amount from current transaction: '.$totalAmountToBePaid); //cief todo: to be removed
|
||||
Log::channel('storage_invoices')->info('Total amount from paid transaction: '.$transaction->amount); //cief todo: to be removed
|
||||
LogHelper::channel('storage_invoices')->info('Total amount from current transaction: '.$totalAmountToBePaid);
|
||||
LogHelper::channel('storage_invoices')->info('Total amount from paid transaction: '.$transaction->amount);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ namespace App\Classes\Modules\Billplzs\Services;
|
||||
|
||||
use Illuminate\Support\Facades\Http;
|
||||
use App\Classes\Exceptions\MalformedRequestException;
|
||||
use App\Classes\General\LogHelper;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class DeletesBillplzBill
|
||||
@@ -16,7 +17,7 @@ class DeletesBillplzBill
|
||||
public function execute(string $billID) {
|
||||
try{
|
||||
$response = Http::withBasicAuth(config('billplz.api_key').':', '')->delete(config('billplz.base_url').'/api/v3/bills/'.$billID);
|
||||
Log::channel('storage_invoices')->info('DeletesBillplzBill response: '.json_encode($response));
|
||||
LogHelper::channel('storage_invoices')->info('DeletesBillplzBill response: '.json_encode($response));
|
||||
|
||||
if($response->successful()){
|
||||
$data = $response->json();
|
||||
|
||||
+33
-30
@@ -8,15 +8,12 @@ use App\Classes\Modules\Documents\Standards\Rules\CanApproveDocument;
|
||||
use App\Classes\Modules\Orders\Services\UpdatesOrdersStatus;
|
||||
use App\Classes\ValueObjects\Constants\ApprovalStatus;
|
||||
use App\Http\Resources\DocumentResource;
|
||||
|
||||
use App\Classes\General\Abstracts\AbstractControllerLogic;
|
||||
|
||||
use App\Classes\Modules\Documents\Services\FetchesDocument;
|
||||
|
||||
use App\Classes\Modules\Documents\Services\ApprovesDocument;
|
||||
use App\Classes\Modules\Documents\Services\PendingVerificationDocument;
|
||||
use App\Classes\Modules\Notifications\DataTransferObjects\NotificationObject;
|
||||
Use App\Classes\Modules\Notifications\Processors\CreateNotificationProcessor;
|
||||
|
||||
use App\Classes\Modules\Notifications\Processors\CreateNotificationProcessor;
|
||||
use App\Models\Document;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
@@ -27,10 +24,11 @@ class ApproveIdentificationDocumentLogic extends AbstractControllerLogic
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
protected function notification():array {
|
||||
protected function notification(): array
|
||||
{
|
||||
return [
|
||||
'title' => 'Approve Document',
|
||||
'message' => 'You have successfully approved the Document'
|
||||
'title' => 'Update Document Status',
|
||||
'message' => 'You have successfully updated the Document Status'
|
||||
];
|
||||
}
|
||||
|
||||
@@ -43,6 +41,9 @@ class ApproveIdentificationDocumentLogic extends AbstractControllerLogic
|
||||
/** @var RejectsDocument */
|
||||
private $rejectsDocument;
|
||||
|
||||
/** @var PendingVerificationDocument */
|
||||
private $pendingVerificationDocument;
|
||||
|
||||
/** @var FetchesDocument */
|
||||
private $fetchesDocument;
|
||||
|
||||
@@ -61,11 +62,12 @@ class ApproveIdentificationDocumentLogic extends AbstractControllerLogic
|
||||
* @param ApprovesDocument $approvesDocument
|
||||
* @param RejectsDocument $rejectsDocument
|
||||
* @param FetchesDocument $fetchesDocument
|
||||
* @param PendingVerificationDocument $pendingVerificationDocument
|
||||
* @param UpdatesCompanyStatus $updatesCompanyStatus
|
||||
* @param UpdatesOrdersStatus $updatesOrdersStatus
|
||||
* @param CreateNotificationProcessor $createNotificationProcessor
|
||||
*/
|
||||
public function __construct(CanApproveDocument $canApproveDocument, ApprovesDocument $approvesDocument, RejectsDocument $rejectsDocument, FetchesDocument $fetchesDocument, UpdatesCompanyStatus $updatesCompanyStatus, UpdatesOrdersStatus $updatesOrdersStatus, CreateNotificationProcessor $createNotificationProcessor)
|
||||
public function __construct(CanApproveDocument $canApproveDocument, ApprovesDocument $approvesDocument, RejectsDocument $rejectsDocument, FetchesDocument $fetchesDocument, UpdatesCompanyStatus $updatesCompanyStatus, UpdatesOrdersStatus $updatesOrdersStatus, CreateNotificationProcessor $createNotificationProcessor, PendingVerificationDocument $pendingVerificationDocument)
|
||||
{
|
||||
$this->canApproveDocument = $canApproveDocument;
|
||||
$this->approvesDocument = $approvesDocument;
|
||||
@@ -74,6 +76,7 @@ class ApproveIdentificationDocumentLogic extends AbstractControllerLogic
|
||||
$this->updatesCompanyStatus = $updatesCompanyStatus;
|
||||
$this->updatesOrdersStatus = $updatesOrdersStatus;
|
||||
$this->createNotificationProcessor = $createNotificationProcessor;
|
||||
$this->pendingVerificationDocument = $pendingVerificationDocument;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -83,37 +86,37 @@ class ApproveIdentificationDocumentLogic extends AbstractControllerLogic
|
||||
* @throws \App\Classes\Exceptions\MalformedRequestException
|
||||
* @throws \App\Classes\Exceptions\RequestValidationException
|
||||
*/
|
||||
public function logic(Request $request) : JsonResponse
|
||||
public function logic(Request $request): JsonResponse
|
||||
{
|
||||
|
||||
$status = $request->route('status');
|
||||
|
||||
/** @var Document $document */
|
||||
$document = $this->fetchesDocument->execute(['id' => $request->route('document_id')]);
|
||||
|
||||
$this->canApproveDocument->passes();
|
||||
|
||||
$document = $status === 'approve' ? $this->approvesDocument->execute($document) : $this->rejectsDocument->execute($document);
|
||||
|
||||
$this->updatesCompanyStatus->execute($document->owner, $status === 'approve' ? ApprovalStatus::APPROVED : ApprovalStatus::REJECTED);
|
||||
|
||||
// $object = new NotificationObject(
|
||||
// 'ID Verification ' . ( $status === 'approve' ? 'Approved' : 'Rejected' ),
|
||||
// ( $status === 'approve' ? 'Dear user, congratulations that your ' : 'Dear user, we are sorry to inform you that your ' ) . ( $document->type === 'IDENTITY_CARD' ? 'IC' : 'SSM' ) . ( $status === 'approve' ? ' has been approved. Start your first order now!' : ' has been rejected due to ' . ( $request->input('rejectRemark') ?? '' ) . ', please resubmit it for further action.' ),
|
||||
// $document->owner,
|
||||
// $document->owner->companyModules()->first()->employees()->first(),
|
||||
// $document,
|
||||
// );
|
||||
//
|
||||
// $this->createNotificationProcessor->execute($object);
|
||||
|
||||
if($status === 'approve'){
|
||||
$orders = $this->updatesOrdersStatus->execute($document->owner, ApprovalStatus::APPROVED);
|
||||
if ($status === 'approve') {
|
||||
$document = $this->approvesDocument->execute($document);
|
||||
$this->updatesCompanyStatus->execute($document->owner, ApprovalStatus::APPROVED);
|
||||
$this->updatesOrdersStatus->execute($document->owner, ApprovalStatus::APPROVED);
|
||||
} elseif ($status === 'reject') {
|
||||
$document = $this->rejectsDocument->execute($document);
|
||||
$this->updatesCompanyStatus->execute($document->owner, ApprovalStatus::REJECTED);
|
||||
} elseif ($status === 'pending') {
|
||||
$document = $this->pendingVerificationDocument->execute($document);
|
||||
$this->updatesCompanyStatus->execute($document->owner, ApprovalStatus::PENDING_VERIFICATION);
|
||||
}
|
||||
|
||||
// $object = new NotificationObject(
|
||||
// 'ID Verification ' . ( $status === 'approve' ? 'Approved' : 'Rejected' ),
|
||||
// ( $status === 'approve' ? 'Dear user, congratulations that your ' : 'Dear user, we are sorry to inform you that your ' ) . ( $document->type === 'IDENTITY_CARD' ? 'IC' : 'SSM' ) . ( $status === 'approve' ? ' has been approved. Start your first order now!' : ' has been rejected due to ' . ( $request->input('rejectRemark') ?? '' ) . ', please resubmit it for further action.' ),
|
||||
// $document->owner,
|
||||
// $document->owner->companyModules()->first()->employees()->first(),
|
||||
// $document,
|
||||
// );
|
||||
|
||||
// $this->createNotificationProcessor->execute($object);
|
||||
|
||||
return $this->resourceResponse(new DocumentResource($document));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\Modules\Companies\ControllersLogic;
|
||||
|
||||
|
||||
use App\Classes\General\Abstracts\AbstractControllerLogic;
|
||||
use App\Classes\Modules\Contacts\DataTransferObjects\ContactObject;
|
||||
use App\Classes\Modules\Companies\Services\FetchesCompany;
|
||||
use App\Classes\Modules\Contacts\Services\CreatesContact;
|
||||
use App\Http\Resources\ContactResource;
|
||||
use ErrorException;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use App\Classes\Modules\Contacts\Processors\CreateContactProcessor;
|
||||
use App\Http\Resources\CompanyResource;
|
||||
|
||||
class CreateCompanyContactNumberLogic extends AbstractControllerLogic
|
||||
{
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
protected function notification():array {
|
||||
return [
|
||||
'title' => 'Created Company Contact Number',
|
||||
'message' => 'You have successfully created the Company Contact Number'
|
||||
];
|
||||
}
|
||||
|
||||
/** @var FetchesCompany */
|
||||
private $fetchesCompany;
|
||||
|
||||
/** @var CreatesContact */
|
||||
private $createsContact;
|
||||
|
||||
/** @var CreateContactProcessor */
|
||||
private $createContactProcessor;
|
||||
|
||||
/**
|
||||
* UpdateCompanyControllersLogic constructor.
|
||||
* @param FetchesCompany $fetchesCompany
|
||||
* @param CreatesContact $createsContact
|
||||
* @param CreateContactProcessor $createContactProcessor
|
||||
*/
|
||||
public function __construct(FetchesCompany $fetchesCompany, CreatesContact $createsContact, CreateContactProcessor $createContactProcessor)
|
||||
{
|
||||
$this->fetchesCompany = $fetchesCompany;
|
||||
$this->createsContact = $createsContact;
|
||||
$this->createContactProcessor = $createContactProcessor;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Request $request
|
||||
* @return JsonResponse
|
||||
* @throws ErrorException
|
||||
*/
|
||||
public function logic(Request $request) : JsonResponse
|
||||
{
|
||||
$company = $this->fetchesCompany->execute(['id' => $request->input('companyId')]);
|
||||
|
||||
$contact = new ContactObject(
|
||||
$company->reference,
|
||||
$request->input('contactNumber'),
|
||||
$company->email,
|
||||
$company->wechat_id
|
||||
);
|
||||
|
||||
$this->createContactProcessor->execute($contact, $company);
|
||||
|
||||
return $this->resourceResponse(new CompanyResource($company));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\Modules\Companies\ControllersLogic;
|
||||
|
||||
|
||||
use App\Classes\General\Abstracts\AbstractControllerLogic;
|
||||
use App\Classes\Modules\Companies\Services\FetchesCompany;
|
||||
use App\Classes\Modules\Companies\Standards\Rules\CanFetchCompany;
|
||||
use App\Classes\ValueObjects\Constants\AddressType;
|
||||
use App\Http\Resources\EInvoiceInfoResource;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class FetchCompanyEInvoiceInfoLogic extends AbstractControllerLogic
|
||||
{
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
protected function notification():array {
|
||||
return [
|
||||
'title' => 'Retrieved Company E-Invoice Info',
|
||||
'message' => 'You have successfully retrieved a Company E-Invoice Info'
|
||||
];
|
||||
}
|
||||
|
||||
/** @var CanFetchCompany */
|
||||
private $canFetchCompany;
|
||||
|
||||
/** @var FetchesCompany */
|
||||
private $fetchesCompany;
|
||||
|
||||
/**
|
||||
* FetchCompanyEInvoiceInfoLogic constructor.
|
||||
* @param CanFetchCompany $canFetchCompany
|
||||
* @param FetchesCompany $fetchesCompany
|
||||
*/
|
||||
public function __construct(CanFetchCompany $canFetchCompany, FetchesCompany $fetchesCompany)
|
||||
{
|
||||
$this->canFetchCompany = $canFetchCompany;
|
||||
$this->fetchesCompany = $fetchesCompany;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param Request $request
|
||||
* @return JsonResponse
|
||||
* @throws \App\Classes\Exceptions\AccessForbiddenException
|
||||
* @throws \App\Classes\Exceptions\RequestValidationException
|
||||
*/
|
||||
public function logic(Request $request) : JsonResponse
|
||||
{
|
||||
$this->canFetchCompany->passes();
|
||||
|
||||
$company = $this->fetchesCompany->execute(['id' => $request->route('id')]);
|
||||
$eInvoiceInfo = $company->companyModules()->first()->addresses()->where('type', '=', AddressType::E_INVOICE)->latest()->first();
|
||||
|
||||
if($eInvoiceInfo){
|
||||
$eInvoiceInfo->tin = $company->tin;
|
||||
$eInvoiceInfo->msic_code = $company->msic_code;
|
||||
$eInvoiceInfo->e_invoice = $company->e_invoice;
|
||||
}
|
||||
else{
|
||||
return $this->response([]);
|
||||
}
|
||||
|
||||
return $this->resourceResponse(new EInvoiceInfoResource($eInvoiceInfo));
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user