Compare commits

...

564 Commits

Author SHA1 Message Date
Dillon Ngo e25377d62d Merge branch 'dillon/69-shipping-portal-debugging-on-dev' into development 2024-09-13 01:02:52 +08:00
Dillon Ngo c9570db825 Debugging 2024-09-13 01:02:40 +08:00
Dillon Ngo 807af317a1 Merge branch 'dillon/69-shipping-portal-debugging-on-dev' into development 2024-09-13 00:49:29 +08:00
Dillon Ngo 5c60de2851 Debugging 2024-09-13 00:49:20 +08:00
Dillon Ngo 0c0dd30a1d Merge branch 'dillon/69-shipping-portal-debugging-on-dev' into development 2024-09-13 00:36:48 +08:00
Dillon Ngo 4ed79659df Debugging 2024-09-13 00:36:38 +08:00
Dillon Ngo 0d5d5afbb0 Debugging 2024-09-13 00:35:53 +08:00
Dillon Ngo ee1bab12bf Merge branch 'dillon/69-shipping-portal-debugging-on-dev' into development 2024-09-13 00:31:22 +08:00
Dillon Ngo b077730214 Debugging 2024-09-13 00:31:02 +08:00
edmondlang eacf428c00 Merge branch 'cief-coins' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2024-09-01 23:16:03 +08:00
edmondlang 4faf3064d1 cief coins 2024-09-01 23:15:42 +08:00
edmondlang 5b90c592e3 Merge branch 'cief-coins' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2024-09-01 22:01:46 +08:00
edmondlang 7b89a8bff8 cief coins 2024-09-01 22:01:25 +08:00
edmondlang cc246046b5 cief coins 2024-09-01 21:55:37 +08:00
edmondlang f03b60d93a cief coins 2024-09-01 21:54:47 +08:00
edmondlang 9bc0d2890f Merge branch 'cief-coins' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2024-09-01 21:20:00 +08:00
edmondlang f3d502ea9b cief coins 2024-09-01 21:19:41 +08:00
edmondlang e74bf4fc60 Merge branch 'cief-coins' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2024-09-01 21:06:07 +08:00
edmondlang 8f626230eb cief coins 2024-09-01 21:02:46 +08:00
edmondlang bb273b6334 Merge branch 'cief-coins' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2024-09-01 20:50:57 +08:00
edmondlang d7ef783443 cief coins 2024-09-01 20:49:46 +08:00
edmondlang 9f4c657122 Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2024-09-01 19:59:09 +08:00
edmondlang b7c6c13bde fix payment-and-billing vue console error 2024-09-01 19:58:51 +08:00
edmondlang 4c5483cb7c Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2024-09-01 19:49:03 +08:00
edmondlang 01d666d92a fix payment-and-billing vue console error 2024-09-01 19:48:44 +08:00
Dillon Ngo b3973b52d1 Merge branch 'dillon/46.15-onhold-list-anomaly-fix' into 'master'
Data patch for a problem reported about an item not suppose to appear in ...

See merge request CIEFWorldwideSdnBhd/shipping-portal!236
2024-08-17 00:41:10 +00:00
Dillon Ngo 694876c31f Data patch for a problem reported about an item not suppose to appear in export/on-hold-packing-list 2024-08-17 08:39:19 +08:00
edmondlang ec3c596352 Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2024-08-04 00:46:02 +08:00
edmondlang 499782bbec update /export/aging-list, add 'is credit term customer' column 2024-08-04 00:39:15 +08:00
edmondlang f3eca3dd89 Export Group Transactions CSV 2024-08-03 23:04:47 +08:00
edmondlang 4fc5a4a2d9 Merge branch 'payment-export-decimal-point' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2024-08-02 10:48:43 +08:00
Aqqil Azman 9c4c472a40 fix wrong decimal round off 2024-08-01 09:37:22 +08:00
Aqqil Azman a67afdc0ff changed decimal points to 2 2024-08-01 09:34:14 +08:00
edmondlang b30cdaba84 fix export/aging-list, it has duplicated rows due to unnecessary joins 2024-07-26 00:58:49 +08:00
Dillon Ngo 9ac0ca45be Merge branch 'dillon/46.14-data-patch' into 'master'
Data patch for storage invoice

See merge request CIEFWorldwideSdnBhd/shipping-portal!235
2024-07-22 23:07:16 +00:00
Dillon Ngo 7e7e43ee9c Merge branch 'dillon/46.14-data-patch' into 'master'
Data patch for storage invoice

See merge request CIEFWorldwideSdnBhd/shipping-portal!234
2024-07-22 23:00:09 +00:00
edmondlang cfb6270ae7 Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2024-07-19 00:36:18 +08:00
edmondlang 09402a9c70 Merge branches 'development' and 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2024-07-19 00:29:56 +08:00
edmondlang fec5f2f6dc Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2024-07-19 00:12:52 +08:00
edmondlang b8686ff910 Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development
# Conflicts:
#	routes/apipub.php
2024-07-18 23:18:10 +08:00
edmondlang a0a2c335ba Merge branch 'address-extra-fields' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2024-07-18 00:14:51 +08:00
edmondlang bcfeb49275 update address extra fields 2024-07-18 00:14:19 +08:00
edmondlang b4c6e721fd Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into address-extra-fields 2024-07-17 23:29:51 +08:00
edmondlang 514d3da73c Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2024-07-17 18:14:10 +08:00
edmondlang 82a84157b6 Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2024-07-17 18:11:58 +08:00
edmondlang 58a64784db Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2024-07-17 17:50:46 +08:00
edmondlang c5a71abf57 Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development
# Conflicts:
#	app/Classes/Modules/Accounts/ControllersLogic/CreateCustomerLogic.php
2024-07-06 11:29:34 +08:00
edmondlang ae60f9ae49 Merge branch 'address-extra-fields' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2024-07-05 01:18:59 +08:00
edmondlang a953f78771 update address extra fields 2024-07-05 01:18:36 +08:00
edmondlang 4a2c0db044 Merge branch 'address-extra-fields' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development
# Conflicts:
#	app/Classes/Modules/Addresses/ControllersLogic/UpdateAddressLogic.php
#	package.json
2024-07-05 00:28:12 +08:00
edmondlang cf3e7f04e4 Merge branches 'master' and 'address-extra-fields' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into address-extra-fields 2024-07-05 00:26:12 +08:00
edmondlang be0cd16285 update address extra fields 2024-07-05 00:25:57 +08:00
edmondlang 50f6b664b9 Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2024-07-03 13:24:37 +08:00
edmondlang 4769e0768b test FetchPackingListsFromYdPortalProcessor 2024-07-02 19:47:51 +08:00
edmondlang ce4e8b174f Merge branch 'fix-missing-packinglist' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2024-07-02 13:02:34 +08:00
edmondlang b08e4c618f Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2024-06-26 13:48:21 +08:00
edmondlang 8c781a3362 test code group-transaction-with-completed-payments 2024-06-26 13:05:24 +08:00
edmondlang 57532e9afd Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2024-06-26 13:03:07 +08:00
edmondlang 2f55821046 add multi select 2024-06-24 23:13:48 +08:00
edmondlang 4a9ac3de02 Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into address-extra-fields 2024-06-20 10:03:57 +08:00
edmondlang 1e6fafef28 make address line 2 required 2024-06-20 10:02:15 +08:00
Dillon Ngo 8ff459c373 Merge branch 'dillon/62-fixes-and-new-features' into development 2024-06-15 05:36:38 +08:00
Dillon Ngo 707c48ab12 Fix a rounding problem in group payment which will result in goods cannot be released through CallbackBillplzLogic 2024-06-15 05:36:10 +08:00
Dillon Ngo 6d006ba60b Merge branch 'master' into dillon/62-fixes-and-new-features 2024-06-15 03:23:45 +08:00
edmondlang 4087df6649 Merge branch 'address-extra-fields' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development
# Conflicts:
#	app/Classes/Modules/Addresses/ControllersLogic/CreateAddressLogic.php
#	app/Classes/Modules/Addresses/ControllersLogic/UpdateAddressLogic.php
#	app/Models/Address.php
2024-06-12 12:06:00 +08:00
edmondlang 9d0924c674 address extra fields 2024-06-12 12:02:31 +08:00
edmondlang 4ac1fdb1ba Merge branch 'ga4-user-id' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2024-06-09 21:26:06 +08:00
edmondlang d21a930889 ga4 with user id 2024-06-09 21:25:36 +08:00
Dillon Ngo 42d68a4357 Merge branch 'dillon/46.13-missing-payment-proof-feature' into development 2024-06-09 12:44:43 +08:00
Dillon Ngo f32fc1976e Merge branch 'dillon/46.13-missing-payment-proof-feature' into development 2024-06-09 12:16:41 +08:00
Dillon Ngo cdf5e89a4a Merge branch 'dillon/46.13-missing-payment-proof-feature' into development 2024-06-09 12:01:13 +08:00
edmondlang a32e63b74f Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2024-06-07 17:41:05 +08:00
edmondlang 32d3aebf37 Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development
# Conflicts:
#	resources/views/layouts/base.blade.php
2024-06-07 17:36:33 +08:00
edmondlang 1b2ae413e3 test ga4 2024-06-07 17:35:04 +08:00
edmondlang 1059251b6b test gtag 2024-06-07 17:25:38 +08:00
Dillon Ngo c223aec7c9 Merge branch 'dillon/46.12-warehouse-storage-manual-payment' into development 2024-06-02 20:19:11 +08:00
Dillon Ngo 3c622dc6ca Stop warehouse storage fee from calculating whenever there is a manual payment submitted for verification 2024-06-02 20:17:32 +08:00
Dillon Ngo 819a29b227 Merge branch 'dillon/62-fixes-and-new-features' into development 2024-06-02 11:20:25 +08:00
Dillon Ngo bbd48df118 Redirect a link + New terms and conditions checkbox when creating an order 2024-06-02 11:00:04 +08:00
Dillon Ngo 353bf0ffbd Redirect a link + New terms and conditions checkbox when creating an order 2024-06-02 10:41:47 +08:00
Dillon Ngo bb0ecc42c3 Merge branch 'dillon/62-fixes-and-new-features' into development 2024-06-02 10:25:30 +08:00
Dillon Ngo df3024186b Redirect a link + New terms and conditions checkbox when creating an order 2024-06-02 09:56:56 +08:00
edmondlang e6486644a0 Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development
# Conflicts:
#	app/Classes/Modules/PackingLists/ControllersLogic/Containers/RescheduleContainerLogic.php
2024-05-30 23:10:32 +08:00
edmondlang f8d191267b Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2024-05-27 00:54:20 +08:00
edmondlang 83d7f20a48 Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2024-05-21 01:33:50 +08:00
Jia Sheng 12f8391ca8 Merge branch 'fulfilment-banner' of gitlab.com:CIEFWorldwideSdnBhd/shipping-portal into development 2024-05-20 22:51:54 +08:00
Dillon Ngo 39017c5d8f Merge branch 'dillon/51.5-vue-store-update' into development 2024-05-19 23:55:22 +08:00
jiasheng224 c022ab6578 Merge branch 'fulfilment-banner' of gitlab.com:CIEFWorldwideSdnBhd/shipping-portal into development 2024-05-08 18:49:01 +08:00
Dillon Ngo 8bfdc2431c Merge branch 'dillon/46.11-warehouse-storage-related-fixes' into development 2024-05-08 03:04:08 +08:00
Dillon Ngo ac1957bcb0 Merge branch 'dillon/46.11-warehouse-storage-related-fixes' into development 2024-05-08 01:53:05 +08:00
Dillon Ngo 61a0766e60 Merge branch 'dillon/60-shipping-portal-fixes' into development 2024-05-08 00:57:25 +08:00
edmondlang f3c7c042fc Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2024-05-08 00:25:40 +08:00
Dillon Ngo 424e2b4e5e Merge branch 'dillon/46.11-warehouse-storage-related-fixes' into development 2024-05-06 13:23:45 +08:00
Omair Saleh 7b897f8dce change sst invoice format 2024-04-16 12:37:53 +08:00
Omair Saleh 4d7adba8e8 change sst invoice format 2024-04-15 15:31:33 +08:00
Omair Saleh 3c91a7d099 change sst invoice format 2024-04-15 15:29:52 +08:00
Omair Saleh 0435464382 change sst invoice format 2024-04-15 12:33:37 +08:00
Omair Saleh 6878dbc518 change sst invoice format 2024-04-15 12:27:06 +08:00
Omair Saleh 3ec186da3b change sst invoice format 2024-04-15 12:18:55 +08:00
Omair Saleh 1301e8d1a4 change sst invoice format 2024-04-15 12:02:24 +08:00
edmondlang 75d2fc3d76 Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2024-04-10 23:17:22 +08:00
edmondlang ec6b768755 Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2024-04-10 22:28:49 +08:00
Dillon Ngo b26fea9a49 Merge branch 'dillon/58-shipping-portal-sst' into development 2024-04-07 10:43:32 +08:00
edmondlang b5efe6139d Merge branch 'delete-paid-group-transaction' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2024-03-30 00:50:14 +08:00
edmondlang 90793be9dc Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2024-03-28 23:05:57 +08:00
Dillon Ngo 464160b526 Merge branch 'dillon/46.9-warehouse-storage-charges-fixes' into development 2024-03-26 08:10:57 +08:00
Dillon Ngo bf195bf3e3 Merge branch 'dillon/55-billplz-fix' into development 2024-03-18 14:06:38 +08:00
Dillon Ngo 6e5a18fd05 Merge branch 'dillon/55-billplz-fix' into development 2024-03-18 13:56:57 +08:00
Dillon Ngo 8d5edbd716 Merge branch 'dillon/46.9-warehouse-storage-charges-fixes' into development 2024-03-16 15:50:36 +08:00
edmondlang 898b63cbd2 Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2024-03-14 12:48:41 +08:00
Dillon Ngo 20f0d54844 Merge branch 'dillon/55-billplz-fix' into development 2024-03-14 12:44:17 +08:00
Dillon Ngo 2951800117 Merge branch 'development' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2024-03-14 12:32:42 +08:00
Dillon Ngo 5ac8911fab Merge branch 'dillon/55-billplz-fix' into development 2024-03-14 12:32:26 +08:00
edmondlang 0f1d247c51 Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2024-03-13 00:21:05 +08:00
edmondlang 73aa703658 Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2024-03-13 00:03:11 +08:00
edmondlang 8da81a4696 Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2024-03-12 23:52:58 +08:00
Dillon Ngo 1291267805 Merge branch 'dillon/55-billplz-fix' into development 2024-03-12 14:21:28 +08:00
edmondlang 406fe045fc Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2024-03-10 19:40:04 +08:00
Dillon Ngo 4e0f04eae2 Merge branch 'dillon/46.8-warehouse-storage-charges-fixes' into development 2024-03-09 21:43:57 +08:00
Dillon Ngo 56aec95d50 Attempt to resolve gitlab pipeline job error 2024-03-09 21:43:48 +08:00
Dillon Ngo 0e3fedf56f Merge branch 'development' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2024-03-09 21:20:51 +08:00
Dillon Ngo dadf7153d7 Merge branch 'dillon/46.8-warehouse-storage-charges-fixes' into development 2024-03-09 21:20:35 +08:00
edmondlang 8fdc4168b1 Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2024-03-09 13:56:04 +08:00
Dillon Ngo bf1cb09ece Merge branch 'dillon/46.9-warehouse-storage-charges-fixes' into development 2024-03-09 02:20:57 +08:00
Dillon Ngo a829bec73e Merge branch 'dillon/46.9-warehouse-storage-charges-fixes' into development 2024-03-09 01:22:29 +08:00
Dillon Ngo ff9cb8a9b6 Merge branch 'dillon/46.9-warehouse-storage-charges-fixes' into development 2024-03-08 23:54:03 +08:00
Dillon Ngo 939959193d Merge branch 'dillon/46.9-warehouse-storage-charges-fixes' into development 2024-03-08 23:35:42 +08:00
Dillon Ngo 6db98029d9 Merge branch 'dillon/46.9-warehouse-storage-charges-fixes' into development 2024-03-08 20:45:26 +08:00
Dillon Ngo 17ed9c3599 Merge branch 'dillon/46.8-warehouse-storage-charges-fixes' into development 2024-03-02 14:09:18 +08:00
Dillon Ngo 6aef08ee5e Merge branch 'dillon/46.8-warehouse-storage-charges-fixes' into development 2024-03-02 13:27:16 +08:00
Dillon Ngo 797c0a1bfd Merge branch 'development' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2024-03-01 11:49:48 +08:00
Dillon Ngo de036f8c20 Merge branch 'dillon/46.8-warehouse-storage-charges-fixes' into development 2024-03-01 11:47:39 +08:00
edmondlang b493dd1aaf Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2024-03-01 11:29:10 +08:00
edmondlang 3fb09a005f revert 2024-03-01 11:27:18 +08:00
edmondlang cbfbebc32b test send permits email 2024-03-01 11:00:24 +08:00
Dillon Ngo 86afc4aa66 Merge branch 'dillon/46.8-warehouse-storage-charges-fixes' into development 2024-02-29 22:33:32 +08:00
Dillon Ngo ca5a445df1 Merge branch 'dillon/46.8-warehouse-storage-charges-fixes' into development 2024-02-29 17:19:40 +08:00
Dillon Ngo 649e22cef0 Merge branch 'dillon/46.8-warehouse-storage-charges-fixes' into development 2024-02-29 16:36:46 +08:00
Dillon Ngo 873aaa8263 Merge branch 'dillon/46.6-warehouse-storage-charges-fixes' into development 2024-02-25 15:21:16 +08:00
Dillon Ngo 9148c9063d Merge branch 'dillon/46.6-warehouse-storage-charges-fixes' into development 2024-02-25 14:27:05 +08:00
Dillon Ngo 70688c4a4b Merge branch 'dillon/46.6-warehouse-storage-charges-fixes' into development 2024-02-25 14:04:31 +08:00
Dillon Ngo f9e8f4c852 Merge branch 'dillon/46.6-warehouse-storage-charges-fixes' into development 2024-02-25 13:52:38 +08:00
Dillon Ngo 476f5ba506 Merge branch 'dillon/46.7-warehouse-storage-charges-fixes' into development 2024-02-24 11:41:05 +08:00
Dillon Ngo 73dcc12b09 Merge branch 'dillon/46.7-warehouse-storage-charges-fixes' into development 2024-02-24 11:08:36 +08:00
Dillon Ngo ef934626d6 Merge branch 'dillon/46.7-warehouse-storage-charges-fixes' into development 2024-02-24 10:48:42 +08:00
Dillon Ngo 8fbf163d4b Merge branch 'dillon/46.5-warehouse-storage-charges-fixes' into development 2024-02-24 10:09:26 +08:00
Dillon Ngo 7236a80f68 Merge branch 'dillon/46.5-warehouse-storage-charges-fixes' into development 2024-02-23 11:09:53 +08:00
Dillon Ngo 014244f453 Merge branch 'dillon/46.5-warehouse-storage-charges-fixes' into development 2024-02-23 10:49:48 +08:00
Dillon Ngo a1eed0477f Merge branch 'dillon/46.5-warehouse-storage-charges-fixes' into development 2024-02-18 10:11:13 +08:00
Dillon Ngo d15c5d9bc9 Merge branch 'dillon/46.5-warehouse-storage-charges-fixes' into development 2024-02-18 10:00:57 +08:00
Dillon Ngo f052a95b4d Merge branch 'dillon/46.4-warehouse-storage-charges' into development 2024-02-15 21:21:19 +08:00
Dillon Ngo 6c12d4b436 Merge branch 'dillon/46.4-warehouse-storage-charges' into development 2024-02-15 21:18:11 +08:00
Dillon Ngo aad694ff2e Merge branch 'dillon/46.4-warehouse-storage-charges' into development 2024-02-15 21:02:15 +08:00
Dillon Ngo 1ad8f81080 Merge branch 'dillon/46.4-warehouse-storage-charges' into development 2024-02-15 20:45:56 +08:00
Dillon Ngo 27c990d903 Merge branch 'dillon/51.4-explore-multiple-queues' into development 2024-02-13 22:08:13 +08:00
Dillon Ngo 8d80669eb3 Merge branch 'dillon/51.3-vue-polling-experimental' into development 2024-02-13 22:07:58 +08:00
edmondlang bc4b34f0a9 Merge branch 'permits-reminder' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2024-02-06 10:56:03 +08:00
edmondlang 533977f353 Merge branch 'permits-reminder' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2024-01-30 12:42:24 +08:00
edmondlang b293f84c38 Merge branch 'permits-reminder' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2024-01-30 00:48:37 +08:00
edmondlang 1ceb2bd636 Merge branch 'permits-reminder' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2024-01-30 00:42:49 +08:00
edmondlang bc6a31d458 Merge branch 'permits-reminder' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2024-01-30 00:38:46 +08:00
edmondlang 687dc9f3fe Merge branch 'development' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2024-01-30 00:37:26 +08:00
edmondlang ee65e5fcd1 Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development
# Conflicts:
#	routes/web.php
2024-01-30 00:35:50 +08:00
Dillon Ngo bc0a0c64c4 Merge branch 'dillon/46.4-warehouse-storage-charges' into development 2024-01-24 07:40:25 +08:00
edmondlang 378434dac4 Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2024-01-17 17:19:56 +08:00
edmondlang 28bba28034 Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2024-01-17 17:07:32 +08:00
Dillon Ngo 7e1a0a1bc4 Merge branch 'dillon/46.3.1-warehouse-storage-charges-fixes' into development 2024-01-15 08:38:45 +08:00
Dillon Ngo e0e00ac962 Merge branch 'dillon/46.3-warehouse-storage-charges-fixes' into development 2024-01-14 09:39:14 +08:00
edmondlang 0d8d35ab25 Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2024-01-11 17:50:57 +08:00
edmondlang a66c7990f0 Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2024-01-11 17:37:16 +08:00
edmondlang b4f8519102 update logging code 2024-01-11 16:41:21 +08:00
edmondlang db8a1c0808 update logging 2024-01-11 16:27:57 +08:00
edmondlang ebc601b45e update testing logging 2024-01-11 16:22:13 +08:00
edmondlang ce86dda0b9 comment on route logs table 2024-01-11 15:52:45 +08:00
edmondlang c80c5965b1 add priceCbmLog 2024-01-11 15:48:47 +08:00
edmondlang f7ac3715d0 Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2024-01-11 10:55:44 +08:00
Steve Ng 871dbcfc87 invoice date for shipping portal when export invoice to autocount 2024-01-10 19:12:49 +08:00
Dillon Ngo f3c8d65e03 Merge branch 'dillon/51-vue-polling-experimental-2' into development 2024-01-08 17:50:12 +08:00
Steve Ng b9aa18c705 change posting date to invoice date for shipping portal when export invoice to autocount 2024-01-05 12:01:48 +08:00
Dillon Ngo 071858b55c Merge branch 'dillon/51-vue-polling-experimental-2' into development 2024-01-04 13:52:37 +08:00
Dillon Ngo 7d6e342a79 Merge branch 'dillon/51-vue-polling-experimental-2' into development 2024-01-04 02:51:12 +08:00
Dillon Ngo 8f695401d2 Merge branch 'dillon/51-vue-polling-experimental-2' into development 2024-01-04 02:33:59 +08:00
Steve Ng 58c861b726 change posting date to invoice date for shipping portal when export invoice to autocount 2024-01-03 09:07:10 +08:00
edmondlang 68940e6b6d Merge branch 'api-response-time-logging' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2023-12-31 13:04:21 +08:00
edmondlang dbc57fdaac code update 2023-12-31 12:58:22 +08:00
edmondlang 55f7637d9c Merge branch 'add-attached-timestamp' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2023-12-30 16:58:29 +08:00
edmondlang 1578085bab add attached timestamp 2023-12-30 16:55:45 +08:00
edmondlang 08090036fe Merge branch 'api-response-time-logging' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development
# Conflicts:
#	app/Http/Kernel.php
2023-12-28 23:05:01 +08:00
edmondlang 9c9cf0f96e api and web response time log 2023-12-28 23:04:16 +08:00
edmondlang 73f9418835 Merge branch 'api-response-time-logging' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development
# Conflicts:
#	app/Http/Kernel.php
2023-12-28 22:53:21 +08:00
edmondlang b645bae1b1 Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2023-12-28 22:52:22 +08:00
edmondlang 8513309126 api response time logging 2023-12-28 22:50:19 +08:00
Dillon Ngo 341fe0ff52 Merge branch 'dillon/46-warehouse-storage-charges-2-merge-conflict' into development 2023-12-20 23:59:27 +08:00
Dillon Ngo 888fe3b6d3 Merge branch 'dillon/46-warehouse-storage-charges-2-merge-conflict' into development 2023-12-20 20:52:44 +08:00
edmondlang 1452cf2dee Merge branches 'development', 'development', 'master' and 'development' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2023-12-13 19:08:59 +08:00
edmondlang 1e9af663ba Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2023-12-11 18:44:30 +08:00
Dillon Ngo ae7072b3e3 Merge branch 'dillon/45-air-shipment-2-update-with-master' into development 2023-12-11 15:26:41 +08:00
Dillon Ngo e74c26a2d4 Common method to generate signature + environment variables to store client id and secret 2023-12-11 15:24:43 +08:00
Dillon Ngo 54268b0683 Merge branch 'dillon/46-warehouse-storage-charges' into development 2023-12-10 22:59:59 +08:00
Dillon Ngo 3215638c87 Merge branch 'dillon/46-warehouse-storage-charges' into development 2023-12-10 22:56:24 +08:00
Dillon Ngo 4794251a0c Merge branch 'dillon/48-feedback-form-improvement' into development 2023-12-09 12:50:57 +08:00
Dillon Ngo bef2c05c06 Merge branch 'dillon/45-air-shipment-2-update-with-master' into development 2023-12-09 12:28:25 +08:00
Dillon Ngo 9384236294 Added new columns to handle multiple different kind of notification from WePost 2023-12-09 12:27:57 +08:00
Dillon Ngo 2b1100b3e9 Merge branch 'dillon/46-warehouse-storage-charges' into development 2023-12-07 17:30:35 +08:00
Dillon Ngo 34103f00cd Merge branch 'dillon/46-warehouse-storage-charges' into development 2023-12-07 16:50:35 +08:00
Dillon Ngo a4de710b13 Merge branch 'dillon/46-warehouse-storage-charges' into development 2023-12-05 13:20:28 +08:00
Dillon Ngo 9b1ced0ade Merge branch 'dillon/45-air-shipment-update-with-master' into development 2023-12-04 01:35:45 +08:00
Dillon Ngo bc973c113c An api requested by WePost for air shipment for inbound notification - minor update on path 2023-12-04 01:35:28 +08:00
Dillon Ngo ee732eeb52 Merge branch 'dillon/45-air-shipment-update-with-master' into development 2023-12-03 00:58:01 +08:00
Dillon Ngo 77bd84f61b Implement authorization checking for external api user using api key 2023-12-03 00:56:42 +08:00
Dillon Ngo fcbb71de7e Merge branch 'master' into dillon/45-air-shipment-update-with-master 2023-12-02 23:59:55 +08:00
Dillon Ngo d4e0827600 Merge branch 'dillon/45-air-shipment' into development 2023-12-02 17:29:39 +08:00
Dillon Ngo 8532e73d26 An api requested by WePost for air shipment for inbound notification 2023-12-02 17:28:35 +08:00
Dillon Ngo efd26f9bcf Merge branch 'dillon/45-air-shipment' into development 2023-12-02 17:19:33 +08:00
Dillon Ngo 212e718377 An api requested by WePost for air shipment for inbound notification 2023-12-02 17:19:19 +08:00
Dillon Ngo c519f34bac Merge branch 'dillon/45-air-shipment' into development 2023-12-02 17:01:31 +08:00
Dillon Ngo 3098bc7d18 An api requested by WePost for air shipment for inbound notification 2023-12-02 16:59:54 +08:00
Dillon Ngo f9995d6b2d Merge branch 'dillon/46-warehouse-storage-charges' into development 2023-11-30 19:33:21 +08:00
Dillon Ngo 5b5eb4b7c1 Merge branch 'dillon/46-warehouse-storage-charges' into development 2023-11-30 13:57:11 +08:00
Dillon Ngo c14a53a2c5 Merge branch 'dillon/46-warehouse-storage-charges' into development 2023-11-30 13:37:23 +08:00
Dillon Ngo 7a3610b58b Merge branch 'development' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2023-11-28 23:18:26 +08:00
Dillon Ngo 0bc15bf4ae Merge branch 'dillon/49-problem-with-new-registration-with-existing-credentials' into development 2023-11-28 23:18:05 +08:00
Dillon Ngo 19f0eb5e9b Try to solve a problem in user registration not working with saved credentials on Google Chrome 2023-11-28 23:17:50 +08:00
edmondlang 045dbf9d86 Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2023-11-28 22:17:17 +08:00
Dillon Ngo 9bcf3ca343 Merge branch 'dillon/46-warehouse-storage-charges' into development 2023-11-27 19:29:38 +08:00
Dillon Ngo de9dc5892b Merge branch 'dillon/46-warehouse-storage-charges' into development 2023-11-27 19:21:21 +08:00
Dillon Ngo 95ffac5c87 Merge branch 'development' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2023-11-27 19:15:55 +08:00
Dillon Ngo ab4eca6d01 Merge branch 'dillon/46-warehouse-storage-charges' into development 2023-11-27 19:14:48 +08:00
edmondlang d2b7cf3e1b Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2023-11-26 23:45:51 +08:00
edmondlang 1a1c40338c Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2023-11-26 22:21:20 +08:00
edmondlang 58a086ea46 Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2023-11-26 22:01:36 +08:00
JiaSheng 8b8edeab36 Merge branch 'centralize-izyim-exchange' of gitlab.com:CIEFWorldwideSdnBhd/shipping-portal into development
# Conflicts:
#	app/Classes/Modules/Orders/ControllersLogic/CreateOrderLogic.php
2023-11-24 17:30:29 +08:00
Dillon Ngo 0783ccfb58 Merge branch 'dillon/46-warehouse-storage-charges' into development 2023-11-24 13:44:44 +08:00
Dillon Ngo 1e3a3db02e Merge branch 'dillon/46-warehouse-storage-charges' into development 2023-11-24 02:29:52 +08:00
Dillon Ngo f47d579070 Merge branch 'dillon/46-warehouse-storage-charges' into development 2023-11-24 00:33:25 +08:00
JiaSheng 4c3dead6b7 -Merge branch 'master' of gitlab.com:CIEFWorldwideSdnBhd/shipping-portal into centralize-izyim-exchange
-update for dev environment
2023-11-22 16:19:40 +08:00
Dillon Ngo d61aea9956 Merge branch 'dillon/48-feedback-form-improvement' into development 2023-11-22 03:25:05 +08:00
Dillon Ngo d8762bf0f2 Merge branch 'dillon/48-feedback-form-improvement' into development 2023-11-22 03:15:28 +08:00
Dillon Ngo 3c567f2161 Merge branch 'dillon/48-feedback-form-improvement' into development 2023-11-21 19:41:45 +08:00
Dillon Ngo acf7000580 Merge branch 'dillon/48-feedback-form-improvement' into development 2023-11-21 19:30:02 +08:00
Dillon Ngo 20de400c16 Merge branch 'dillon/48-feedback-form-improvement' into development 2023-11-21 16:37:44 +08:00
JiaSheng 575379adc0 centralize izyim exchange 2023-11-19 17:14:39 +08:00
Dillon Ngo ce2af28766 Merge branch 'dillon/46-warehouse-storage-charges' into development 2023-11-17 17:01:28 +08:00
Dillon Ngo 74f4cfda0c Merge branch 'dillon/46-warehouse-storage-charges' into development 2023-11-16 23:05:18 +08:00
Dillon Ngo 16682965f9 Merge branch 'dillon/46-warehouse-storage-charges' into development 2023-11-09 08:34:58 +08:00
Dillon Ngo 96dc482422 Merge branch 'dillon/46-warehouse-storage-charges' into development 2023-11-04 17:12:52 +08:00
Dillon Ngo 0eb0f7805b Merge branch 'dillon/46-warehouse-storage-charges' into development 2023-11-04 16:41:38 +08:00
Dillon Ngo e92cd13bf8 Merge branch 'dillon/46-warehouse-storage-charges' into development 2023-11-04 15:10:11 +08:00
edmondlang 1d3ab46cc7 Merge branch 'add-delivery-order-to-invoice' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2023-10-27 09:16:42 +08:00
edmondlang f54b451ac4 Merge branch 'add-delivery-order-to-invoice' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2023-10-27 08:56:09 +08:00
Dillon Ngo a59508087c Merge branch 'dillon/46-warehoue-storage-charges' into development 2023-10-27 04:19:30 +08:00
edmondlang 012ead1a8f Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development
# Conflicts:
#	app/Classes/General/Eloquent/Filters/OwnerType.php
2023-10-24 01:06:26 +08:00
edmondlang f865cd7180 Merge branch 'wallet-audit' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2023-10-20 16:26:37 +08:00
edmondlang 8d4f05cd50 Merge branches 'development' and 'wallet-audit' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2023-10-20 16:22:43 +08:00
edmondlang 40371a9225 Merge branch 'wallet-audit' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2023-10-20 16:02:21 +08:00
edmondlang 086f5f79ad test code 2023-10-20 15:44:47 +08:00
edmondlang 5bb6c44967 Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2023-10-20 15:14:45 +08:00
edmondlang 15a4c8dc25 Merge branch 'wallet-audit' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2023-10-20 15:10:22 +08:00
edmondlang fcd7fa655c Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2023-10-19 22:55:05 +08:00
edmondlang bd4598fac0 Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2023-10-19 13:24:13 +08:00
edmondlang 746f38a4f9 Merge branch 'wallet-audit' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development
# Conflicts:
#	app/Classes/Modules/Billplzs/ControllersLogic/CallbackBillplzLogic.php
2023-10-19 12:48:57 +08:00
Steve Ng ab4d01c728 Merge branch 'steve/aging-listing' into development 2023-10-18 08:50:01 +08:00
Dillon 4c47d88440 Merge branch 'dillon/44-quick-undo' into development 2023-10-16 13:26:16 +08:00
Dillon 7ef3580b1b Merge branch 'development' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2023-10-16 01:10:17 +08:00
Dillon 1b04d25a81 Merge branch 'dillon/44-customer-satisfaction-feedback-project-b' into development 2023-10-16 01:10:03 +08:00
edmondlang a8c54abdd9 Merge branch 'add-delivery-order-to-invoice' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2023-10-09 20:39:11 +08:00
edmondlang 14c2ed8d89 Merge branch 'add-delivery-order-to-invoice' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development
# Conflicts:
#	routes/web.php
2023-10-09 20:32:46 +08:00
edmondlang d5143dfbe3 Merge branch 'add-delivery-order-to-invoice' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2023-10-08 22:07:53 +08:00
Dillon ad4675369e Merge branch 'dillon/44-customer-satisfaction-feedback-project' into development 2023-10-08 18:59:00 +08:00
Dillon 4b4c953b36 Merge branch 'dillon/44-customer-satisfaction-feedback-project-b' into development 2023-10-08 17:24:13 +08:00
Dillon 2dbf05d0dc Merge branch 'dillon/44-customer-satisfaction-feedback-project' into development 2023-10-08 16:56:51 +08:00
Dillon 55f18ebafc Merge branch 'dillon/44-customer-satisfaction-feedback-project' into development 2023-10-08 05:26:11 +08:00
Dillon 9f25b49b8c Merge branch 'dillon/44-customer-satisfaction-feedback-project' into development 2023-10-08 05:14:23 +08:00
Dillon 793cde03ac Merge branch 'dillon/44-customer-satisfaction-feedback-project-e' into development 2023-10-08 05:07:09 +08:00
Dillon 58daaa6095 Merge branch 'development' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2023-10-08 04:59:02 +08:00
Dillon dd82f624c5 Merge branch 'dillon/44-customer-satisfaction-feedback-project' into development 2023-10-08 04:58:46 +08:00
edmondlang 9f4cbd48f7 Merge branch 'add-delivery-order-to-invoice' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2023-10-07 17:57:43 +08:00
Dillon af34391b58 Merge branch 'dillon/44-customer-satisfaction-feedback-project' into development 2023-10-07 08:43:04 +08:00
Dillon 4680b2d634 Merge branch 'dillon/44-customer-satisfaction-feedback-project' into development 2023-10-07 08:13:05 +08:00
Dillon 0d3ae2941c Merge branch 'dillon/44-customer-satisfaction-feedback-project' into development 2023-10-07 07:35:33 +08:00
Dillon e15c61e139 Merge branch 'dillon/44-customer-satisfaction-feedback-project' into development 2023-10-07 07:24:23 +08:00
Dillon 4907b8269e Merge branch 'dillon/44-customer-satisfaction-feedback-project-b' into development 2023-10-05 19:59:06 +08:00
Dillon f7124dc0e1 Merge branch 'dillon/44-customer-satisfaction-feedback-project-b' into development 2023-10-05 17:31:18 +08:00
Dillon 9e455f8fc7 Merge branch 'dillon/44-customer-satisfaction-feedback-project' into development 2023-10-05 16:41:36 +08:00
Dillon 3e72fb78d3 Merge branch 'dillon/44-customer-satisfaction-feedback-project' into development 2023-10-04 01:35:07 +08:00
Dillon 85a1605182 Merge branch 'development' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2023-10-04 01:05:26 +08:00
Dillon a17ed000e1 Merge branch 'dillon/44-customer-satisfaction-feedback-project' into development 2023-10-04 01:04:20 +08:00
omair saleh 3cc14e1e14 Merge branch 'dillon/44-customer-satisfaction-feedback-project' into 'development'
change ui for feedback answers to use columns instead of rows

See merge request CIEFWorldwideSdnBhd/shipping-portal!173
2023-10-03 08:14:53 +00:00
omair saleh 40e074c57a Merge branch 'dillon/44-customer-satisfaction-feedback-project' into 'development'
change ui for feedback answers to use columns instead of rows

See merge request CIEFWorldwideSdnBhd/shipping-portal!172
2023-10-03 06:11:00 +00:00
omair saleh ab7a9bf144 Merge branch 'dillon/44-customer-satisfaction-feedback-project' into 'development'
change ui for feedback answers to use columns instead of rows

See merge request CIEFWorldwideSdnBhd/shipping-portal!171
2023-10-03 05:55:50 +00:00
Dillon fd1a8447fc Merge branch 'dillon/44-customer-satisfaction-feedback-project-b' into development 2023-10-01 00:34:21 +08:00
Dillon efa7657125 Merge branch 'dillon/44-customer-satisfaction-feedback-project' into development 2023-09-30 18:45:49 +08:00
Dillon 941da8c68d Merge branch 'dillon/44-customer-satisfaction-feedback-project-a' into development 2023-09-30 17:06:53 +08:00
Dillon 35aa074c41 Merge branch 'dillon/44-customer-satisfaction-feedback-project' into development 2023-09-29 02:11:39 +08:00
Dillon d3299aee60 Merge branch 'dillon/44-customer-satisfaction-feedback-project' into development 2023-09-25 10:56:05 +08:00
Dillon c90d994317 Merge branch 'dillon/44-customer-satisfaction-feedback-project' into development 2023-09-23 18:08:06 +08:00
Dillon 8dc6c4ebdc Merge branch 'dillon/44-customer-satisfaction-feedback-project' into development 2023-09-23 16:53:28 +08:00
Dillon 4dce3a7915 Merge branch 'dillon/44-customer-satisfaction-feedback-project' into development 2023-09-23 16:48:15 +08:00
Dillon 3f07b410b9 Merge branch 'dillon/44-customer-satisfaction-feedback-project-a' into development 2023-09-21 21:31:38 +08:00
Dillon 7db02b7688 Merge branch 'dillon/44-customer-satisfaction-feedback-project' into development 2023-09-21 20:35:52 +08:00
Dillon 7f8e0b1712 Merge branch 'dillon/44-customer-satisfaction-feedback-project' into development 2023-09-21 08:04:45 +08:00
Dillon 973c0f0924 Merge branch 'dillon/44-customer-satisfaction-feedback-project' into development 2023-09-21 00:47:31 +08:00
edmondlang 7d156503fc Merge branch 'wallet-credit-note' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2023-09-15 18:42:49 +08:00
edmondlang f38ed3be84 Merge branch 'wallet-credit-note' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2023-09-15 18:37:24 +08:00
edmondlang 58dee4883b Merge branch 'wallet-credit-note' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2023-09-15 18:32:53 +08:00
edmondlang 0e83fba98c Merge branch 'wallet-credit-note' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2023-09-15 18:03:59 +08:00
edmondlang 1fbe8e61cb Merge branch 'wallet-credit-note' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development
# Conflicts:
#	app/Models/CompanyModule.php
2023-09-15 17:41:48 +08:00
Dillon 8307871aba Merge branch 'dillon/42-crm-code-sync-with-exchange-b' into development 2023-08-24 04:53:06 +08:00
Dillon 71ed6b9950 Merge branch 'dillon/42-crm-code-sync-with-exchange-a' into development 2023-08-20 15:58:13 +08:00
Dillon 3e3e19bed3 Merge branch 'dillon/42-crm-code-sync-with-exchange-a' into development 2023-08-20 05:31:12 +08:00
Dillon aff9e35623 Merge branch 'dillon/42-crm-code-sync-with-exchange-a' into development 2023-08-18 12:56:32 +08:00
Dillon 67e7f72f63 Merge branch 'dillon/42-crm-code-sync-with-exchange' into development 2023-08-17 21:49:56 +08:00
Dillon f55beaff5f Merge branch 'dillon/42-crm-code-sync-with-exchange' into development 2023-08-17 21:35:51 +08:00
edmondlang 52083ee48a Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2023-08-03 14:30:59 +08:00
edmondlang f4f652aa97 Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development
# Conflicts:
#	app/Console/Kernel.php
2023-08-03 13:48:41 +08:00
edmondlang 43ccdd0700 Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2023-07-18 12:55:36 +08:00
edmondlang c7ce382424 Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2023-07-09 22:01:49 +08:00
edmondlang e9c3cf8f33 Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2023-07-09 21:55:15 +08:00
edmondlang ffede58dde Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2023-06-29 14:50:07 +08:00
edmondlang 9ff00a3df2 Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2023-06-22 13:42:11 +08:00
edmondlang 7b8eadd5d1 Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development
# Conflicts:
#	app/Classes/Modules/Transactions/ControllersLogic/DeleteGroupLogic.php
2023-05-19 21:28:05 +08:00
Martin Maina Kiragu 9d130e1531 Merge branch 'dev' into 'development'
Dev

See merge request CIEFWorldwideSdnBhd/shipping-portal!165
2023-05-16 15:14:45 +00:00
Martin Kiragu 893d10c7f6 fix conflict issue 2023-05-16 17:47:05 +03:00
edmondlang 68257952ab Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2023-05-15 20:48:43 +08:00
edmondlang 07a7901844 Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2023-05-10 23:01:50 +08:00
edmondlang 91fcb76863 Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2023-05-10 13:39:27 +08:00
edmondlang cac02b8ebe Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2023-05-10 13:13:32 +08:00
edmondlang 4370ba2f9c Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2023-05-08 13:14:45 +08:00
Dillon 41db8f57f5 Merge branch 'dillon/crisp-help-menu-2' into development 2023-05-04 15:42:53 +08:00
Dillon 3497de9727 Merge branch 'dillon/crisp-help-menu' into development 2023-05-04 15:23:54 +08:00
Martin Maina Kiragu 14a4c37fee Merge branch 'feature/reddis' into 'dev'
reddis-predis config and remove the unit test action

See merge request CIEFWorldwideSdnBhd/shipping-portal!164
2023-05-02 05:19:17 +00:00
Martin Kiragu f27e0aa8c6 reddis-predis config and remove the unit test action 2023-05-02 08:17:06 +03:00
Martin Maina Kiragu 5c109d625c Merge branch 'system/transformers' into 'dev'
System/transformers

See merge request CIEFWorldwideSdnBhd/shipping-portal!163
2023-05-02 05:02:59 +00:00
edmondlang 965dfb3098 Merge branch 'multi-payment-final' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development
# Conflicts:
#	app/Classes/Modules/Billplzs/ControllersLogic/CallbackBillplzLogic.php
#	app/Classes/ValueObjects/Constants/TransactionType.php
#	routes/web.php
2023-04-28 18:26:33 +08:00
edmondlang d6fad96d4d add robot.txt 2023-04-28 00:17:00 +08:00
edmondlang 351447b1fc Merge branch 'list-order-v2' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2023-04-25 23:40:47 +08:00
Martin Kiragu a9910c5a12 GroupTransformer 2023-04-24 21:26:35 +03:00
Martin Kiragu 4bee415d2d DeliveryPackingListTransformer transformer updated 2023-04-24 21:08:29 +03:00
Martin Kiragu 02f7adb1e9 DeliveryOrderTransformer added 2023-04-24 21:02:39 +03:00
Martin Kiragu 039a6155ca addation of DeliverPackingListTransformer 2023-04-24 20:51:30 +03:00
Martin Kiragu c8d806a51d updated all resource transformers optionally required by the container transformer 2023-04-24 16:50:53 +03:00
Martin Kiragu 4dbaf6a5dc added ContainerTransformer and its optional relationships 2023-04-24 15:57:31 +03:00
Martin Kiragu fcc0135843 ContactResource with ContactTransformer 2023-04-24 14:35:22 +03:00
Martin Kiragu 4a922ac340 add company transformer with multiple optional relationship loader 2023-04-24 14:29:46 +03:00
Martin Kiragu c4d421db76 add a todo to delete the BookingResource not used anywhere 2023-04-24 14:01:36 +03:00
Martin Kiragu 2816e80bee Bank Account Transformer 2023-04-24 13:56:00 +03:00
Martin Kiragu 466e90a0af Build a AnnouncementTransformer for uniformity and future relationships updates 2023-04-24 13:50:20 +03:00
Martin Kiragu 5e6ae2a905 add backend conditional relationship loading on the AddressResource/AddressTransformer 2023-04-24 13:43:47 +03:00
edmondlang 3378d37ffb Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2023-04-19 12:53:50 +08:00
edmondlang fff3d948d0 Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development
# Conflicts:
#	app/Classes/Modules/Orders/ControllersLogic/CreateOrderLogic.php
2023-04-18 23:44:36 +08:00
Dillon c181882145 Merge branch 'dillon/improvement-1' into development 2023-04-15 21:57:58 +08:00
edmondlang 2a333f7d19 Merge branch 'order-v2' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2023-04-13 16:09:37 +08:00
edmondlang 8f8622aa10 Merge branch 'order-v2' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2023-04-13 16:05:38 +08:00
edmondlang f88936c873 Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2023-04-13 16:01:45 +08:00
Dillon 20f3004e22 Merge branch 'dillon/accounting-bank-mapping' into development 2023-04-06 22:59:39 +08:00
edmondlang fd4bbe5d4f Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2023-04-06 19:25:35 +08:00
edmondlang a630b49867 Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2023-04-06 14:25:33 +08:00
edmondlang 75ce5bd752 Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2023-04-06 00:08:24 +08:00
edmondlang abb7bc2e4c Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2023-04-05 23:50:22 +08:00
edmondlang 857003b25b update code conflict 2023-04-02 11:45:58 +08:00
edmondlang 551119e313 Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development
# Conflicts:
#	app/Classes/ValueObjects/Constants/TransactionType.php
#	routes/web.php
2023-04-02 11:41:55 +08:00
edmondlang b567f50711 Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2023-03-31 00:42:03 +08:00
edmondlang 395b15af90 Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development
# Conflicts:
#	routes/api.php
2023-03-31 00:32:46 +08:00
edmondlang 833ffdab8d Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2023-03-30 15:18:00 +08:00
edmondlang 2f6a30a512 Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2023-03-30 14:38:15 +08:00
edmondlang 4c433f74f1 Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2023-03-30 12:53:00 +08:00
Dillon 852da05e24 Merge branch 'dillon/debug-and-fixes-2' into development 2023-03-30 06:00:12 +08:00
Dillon 1658b65484 A quick fix 2023-03-28 23:42:59 +08:00
Dillon 8e9ff0cad5 Merge branch 'dillon/crm-create-task-3-26' into development 2023-03-28 23:36:35 +08:00
edmondlang acee1a7884 Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2023-03-28 16:17:14 +08:00
edmondlang 0079d745ba Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2023-03-26 22:48:42 +08:00
Dillon 0bd3464184 Merge branch 'dillon/crm-create-task-3-26' into development 2023-03-25 14:20:49 +08:00
Dillon 7ec1bc65a5 Merge branch 'dillon/crm-create-task-3-26' into development 2023-03-25 02:18:03 +08:00
Dillon c401d1e0d5 Merge branch 'development' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2023-03-24 15:15:32 +08:00
Dillon a2983ec9f1 Merge branch 'dillon/crm-create-task-3-26' into development 2023-03-24 15:15:15 +08:00
Martin Maina Kiragu 2421640c0a Merge branch 'feature/dashboard_optimization' into 'development'
Feature/dashboard optimization

See merge request CIEFWorldwideSdnBhd/shipping-portal!156
2023-03-24 03:48:40 +00:00
Martin Kiragu 7dae2228f6 fix ide-autospace formatting 2023-03-24 06:34:04 +03:00
Martin Kiragu 75039466ab fix ide-autospace formatting 2023-03-24 06:28:53 +03:00
Martin Kiragu f3df5fbe9f fix ide-autospace formatting 2023-03-24 06:13:35 +03:00
Martin Kiragu 362e47aaa0 fix ide-autospace formatting 2023-03-24 06:04:28 +03:00
Martin Kiragu ba26cda598 switched the Modal resources to Transformers for /document/lists endpoint 2023-03-24 05:51:32 +03:00
Dillon 8995a567d5 Merge branch 'dillon/crm-create-task-3-26' into development 2023-03-24 03:16:47 +08:00
Dillon 5eeec7806b Merge branch 'dillon/crm-create-task-3-26' into development 2023-03-23 04:31:47 +08:00
Dillon fd46a4fb7f Merge branch 'dillon/crm-create-task-3-26' into development 2023-03-23 04:18:38 +08:00
Dillon 1100267316 Merge branch 'dillon/crm-create-task-3-26' into development 2023-03-22 22:23:43 +08:00
edmondlang e133f1fab8 Merge branch 'multi-payment-final' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2023-03-21 17:38:35 +08:00
edmondlang 5d5892ce07 Merge branch 'multi-payment-final' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development
# Conflicts:
#	routes/transaction.php
2023-03-21 14:13:20 +08:00
edmondlang b26700ea6f Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2023-03-20 18:08:50 +08:00
Dillon 589c2e01d9 Merge branch 'dillon/debug-and-fixes-1' into development 2023-03-19 22:32:53 +08:00
Dillon 9cf6058a65 Merge branch 'dillon/debug-and-fixes-1' into development 2023-03-19 17:34:52 +08:00
Dillon ff4d81966c Merge branch 'dillon/debug-and-fixes-1' into development 2023-03-19 16:39:40 +08:00
Martin Kiragu a4891aa0de added a debugber optional paramenter for addational resource on ListDocument resource 2023-03-19 06:31:44 +03:00
Martin Kiragu 05ba0ba6fd update fix conflicts 2023-03-19 04:41:40 +03:00
Martin Kiragu 9217970237 update helpers 2023-03-19 04:38:24 +03:00
Dillon 828f424cfd Merge branch 'dillon/crm-invoice-update-23' into development 2023-03-19 04:50:46 +08:00
Dillon 057ca8480b Merge branch 'dillon/crm-invoice-update-23' into development 2023-03-19 04:30:36 +08:00
edmondlang d07901f31b Merge branch 'multi-payment-final' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development
# Conflicts:
#	app/Classes/Modules/Billplzs/ControllersLogic/CallbackBillplzLogic.php
#	routes/web.php
2023-03-18 23:36:37 +08:00
Dillon c22638b29e Merge branch 'dillon/debug-and-fixes-1' into development 2023-03-17 17:36:56 +08:00
Martin Kiragu c292bfd1e0 extract repeated queries on MonthlyReport Controller and Add a global Library helper.php file 2023-03-13 09:21:51 +03:00
edmondlang 85942eff1d Merge branch 'multi-payment-final' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2023-03-12 23:27:57 +08:00
edmondlang d69896f807 Merge branch 'multi-payment-final' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2023-03-12 23:13:58 +08:00
Dillon 2c5c97488f Merge branch 'dillon/crm-tasks-department' into development 2023-03-12 17:38:48 +08:00
Dillon 99e38b96ce Merge branch 'dillon/crm-create-task-2' into development 2023-03-11 16:34:04 +08:00
Dillon 81a00a8195 Merge branch 'dillon/crm-create-task-2' into development 2023-03-10 21:14:00 +08:00
Dillon dbab7a9f8c Merge branch 'dillon/crm-feed-improvement-1' into development 2023-03-10 17:59:34 +08:00
Dillon 046676d174 Merge branch 'dillon/crm-create-task-2' into development 2023-03-10 02:52:53 +08:00
edmondlang 2b4f1ad570 Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2023-03-08 14:34:36 +08:00
Dillon bcb78f2392 undo debug logs 2023-03-06 16:00:58 +08:00
Dillon 345a62fec6 debug 2023-03-06 15:54:57 +08:00
Dillon 6257b11a6e Merge branch 'dillon/crm-create-invoice' into development 2023-03-06 15:13:17 +08:00
Dillon 4b124ca96d Merge branch 'dillon/crm-create-invoice' into development 2023-03-05 20:30:04 +08:00
Martin Kiragu 4b25764fb3 Merge branch 'development' of gitlab.com:CIEFWorldwideSdnBhd/shipping-portal into development 2023-03-03 06:29:16 +03:00
Martin Kiragu 422a0af465 move all UI related tests to codeception tets 2023-03-03 06:28:45 +03:00
edmondlang c73d65343b Merge branch 'update-create-dilivery-address' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2023-03-02 23:38:33 +08:00
edmondlang 9e5784b6ec update force create order delivery address 2023-03-02 23:38:12 +08:00
edmondlang 9a863e2143 Merge branch 'update-create-dilivery-address' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2023-03-02 23:18:12 +08:00
edmondlang 8024865d5d create order with force enter billing address 2023-03-02 23:17:42 +08:00
Martin Kiragu 66abe81e73 Merge remote-tracking branch 'origin/development' into development 2023-03-02 12:24:07 +03:00
Martin Kiragu ca178e1b31 add HasFactory facade to Users model 2023-03-02 12:23:49 +03:00
edmondlang e52a27aedb Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2023-03-02 17:06:55 +08:00
Martin Kiragu 6c2c28fb31 rerun UI build on the test job 2023-03-02 11:58:09 +03:00
Martin Kiragu 049da351ef Merge remote-tracking branch 'origin/development' into development 2023-03-02 11:28:03 +03:00
Martin Kiragu 0ce8709f70 reduplicate mysql service for unit test job 2023-03-02 11:27:25 +03:00
edmondlang 1e5609bb1b Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2023-03-02 16:26:11 +08:00
edmondlang 8e7970a925 Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2023-03-02 16:16:23 +08:00
Martin Kiragu 06b2c5166d remove dependencies test and add reruns 2023-03-02 11:01:10 +03:00
Martin Kiragu 6ba3b873a2 add building assets and dependencies test 2023-03-02 10:47:45 +03:00
Martin Kiragu 623fb1609b switch dependencies with an installation rerun 2023-03-02 10:29:40 +03:00
Martin Kiragu 24be20a60d switch dependencies with an installation rerun 2023-03-02 10:17:30 +03:00
Martin Kiragu 3535201481 remove test dependency injection 2023-03-02 10:04:09 +03:00
Martin Kiragu cdefd48d26 remove pdo echo 2023-03-02 09:50:44 +03:00
Martin Kiragu 45fbcf1447 pdo addition 2023-03-02 09:42:49 +03:00
Martin Kiragu 53805f3608 add database test 2023-03-02 09:20:02 +03:00
Martin Kiragu 99e90ad357 update remove pdo and mysql extension 2023-03-02 09:03:28 +03:00
Martin Kiragu 5edb9b5cfe add node and gulp builds 2023-03-02 08:58:23 +03:00
Martin Kiragu 86a5a3b2d9 add migration and seeder 2023-03-02 08:37:38 +03:00
Martin Kiragu a6590e3b81 test set up on the set up job 2023-03-02 08:31:14 +03:00
Martin Kiragu b1bb2b9f33 add .env.example to the env file 2023-03-02 08:25:04 +03:00
Dillon 9318e7471f Merge branch 'dillon/crm-create-task' into development 2023-03-01 12:36:15 +08:00
Martin Maina Kiragu e19ba1c9f3 Merge branch 'feature/TDD' into 'development'
Feature/tdd

See merge request CIEFWorldwideSdnBhd/shipping-portal!140
2023-03-01 03:54:54 +00:00
edmondlang 8cffae079b test approve invoice 2023-02-28 14:46:04 +08:00
edmondlang 594b25b71b temporary disable all other cron on development server 2023-02-28 14:29:04 +08:00
edmondlang d142a86683 Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2023-02-28 14:23:11 +08:00
edmondlang 935f3e9bf5 Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2023-02-27 15:59:49 +08:00
edmondlang dedd6464f4 Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2023-02-24 18:08:22 +08:00
edmondlang 38aba65178 Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2023-02-23 14:53:41 +08:00
Dillon 091119c244 Merge branch 'dillon/crm-integration' into development 2023-02-22 18:09:51 +08:00
Dillon 4d095b5459 Merge branch 'development' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2023-02-22 17:10:08 +08:00
Dillon 1c50181132 Merge branch 'dillon/crm-integration' into development 2023-02-22 10:37:19 +08:00
edmondlang 9e26c470f5 Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2023-02-21 23:54:08 +08:00
edmondlang 4c0bf164a0 Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2023-02-21 23:43:18 +08:00
edmondlang 8ab7f72e90 reverse invoice search function 2023-02-21 23:42:00 +08:00
edmondlang 5772e30575 Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2023-02-21 23:41:19 +08:00
edmondlang 4b2daa62d7 test auto generate invoice function 2023-02-21 17:32:20 +08:00
edmondlang 2bd8700a61 Merge branch 'auto-generate-invoice' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2023-02-21 16:50:42 +08:00
edmondlang ad7e77c169 Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2023-02-21 15:01:09 +08:00
edmondlang e95c41bd3e Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2023-02-20 19:51:11 +08:00
edmondlang 903269e714 Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2023-02-20 18:22:48 +08:00
edmondlang 4120a50559 commented on the web routes and api routes to test on the crm 2023-02-18 23:09:24 +08:00
Dillon 88b31f2d3f Merge branch 'dillon/crm-integration' into development 2023-02-18 21:08:08 +08:00
Dillon a2f9bf83ce Merge branch 'dillon/crm-integration' into development 2023-02-18 20:29:57 +08:00
Dillon dd2ac4c966 Merge branch 'dillon/crm-integration' into development 2023-02-18 20:09:08 +08:00
Dillon c88f6890d6 Merge branch 'dillon/crm-integration' into development 2023-02-17 09:24:38 +08:00
edmondlang bf4b3fa97f Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2023-02-16 23:13:22 +08:00
edmondlang 6bcea5a8f1 Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2023-02-16 16:53:12 +08:00
Martin Maina Kiragu 2704ec1665 Merge branch 'feature/pipeline' into 'development'
Update .gitlab-ci.yml file

See merge request CIEFWorldwideSdnBhd/shipping-portal!144
2023-02-13 07:28:57 +00:00
Martin Maina Kiragu 0c636d2156 remove spaces on Export warehouse service 2023-02-13 05:17:03 +00:00
Martin Kiragu 1270ba3f43 delete the code ide-helper file 2023-02-13 08:08:06 +03:00
Martin Kiragu f2c32c5024 fix more spaces 2023-02-13 08:07:11 +03:00
Martin Kiragu ccb3bde260 clean up spaces on my branch 2023-02-13 08:01:23 +03:00
Martin Kiragu a7eb14c2b7 Merge branch 'feature/TDD' of gitlab.com:CIEFWorldwideSdnBhd/shipping-portal into feature/TDD 2023-02-13 07:37:01 +03:00
Martin Kiragu abac96b1e5 revert all models changes 2023-02-13 07:36:40 +03:00
Martin Maina Kiragu ecb48c8897 Merge branch 'master' into 'feature/TDD'
# Conflicts:
#   config/app.php
2023-02-13 04:24:32 +00:00
Martin Maina Kiragu 2686229a0f Merge branch 'master' into 'feature/pipeline'
# Conflicts:
#   config/app.php
2023-02-13 04:12:19 +00:00
Martin Kiragu 558fa7ae52 remove migration and seeder 2023-02-13 06:49:08 +03:00
Martin Kiragu 88e2136c07 add cp .env 2023-02-13 06:47:58 +03:00
Martin Kiragu 70cdcded9b generate key, run migration and database seeder 2023-02-13 06:40:02 +03:00
Martin Kiragu 4022b640f9 test by rerunning the install 2023-02-13 06:31:05 +03:00
Martin Kiragu 0d780074b8 vender test to php 2023-02-13 06:23:53 +03:00
Martin Kiragu 078f675a7f add codeception and change vender test to php 2023-02-13 06:20:42 +03:00
Martin Kiragu 2b48a86f98 comment the Meneses\LaravelMpdf\LaravelMpdfServiceProvider 2023-02-13 06:11:41 +03:00
Martin Maina Kiragu 19f3aa18fc Update .gitlab-ci.yml file
add libzip
2023-02-13 03:07:34 +00:00
Martin Maina Kiragu 2b4c932fc8 Update .gitlab-ci.yml file
add libzip
2023-02-13 03:05:29 +00:00
Martin Maina Kiragu 89f0ca651a Update .gitlab-ci.yml file
add libzip
2023-02-13 03:01:07 +00:00
Martin Maina Kiragu c9fc5938c6 Update .gitlab-ci.yml file
add libzip
2023-02-13 02:55:41 +00:00
Martin Maina Kiragu 2ad8235c1b Update .gitlab-ci.yml file
add libzip
2023-02-13 02:53:22 +00:00
Martin Maina Kiragu dbf8301cb9 Update .gitlab-ci.yml file
add libzip
2023-02-13 02:49:27 +00:00
Martin Maina Kiragu 7d582c6bca Update .gitlab-ci.yml file
add libzip
2023-02-13 02:48:30 +00:00
Martin Maina Kiragu 3c4b6afcb2 Update .gitlab-ci.yml file
add zip
2023-02-13 02:46:21 +00:00
Martin Maina Kiragu e4bc56d188 Update .gitlab-ci.yml file 2023-02-13 02:44:10 +00:00
Martin Maina Kiragu 9a448d5a3d Update .gitlab-ci.yml file 2023-02-13 02:41:24 +00:00
Martin Maina Kiragu 5c1074b244 Update .gitlab-ci.yml file 2023-02-13 02:38:49 +00:00
Martin Maina Kiragu 49fcdfd89e Update .gitlab-ci.yml file 2023-02-13 02:36:51 +00:00
Martin Maina Kiragu c900759234 Update .gitlab-ci.yml file 2023-02-13 02:30:15 +00:00
Martin Maina Kiragu cd3b47ab1a Update .gitlab-ci.yml file 2023-02-13 02:26:31 +00:00
Martin Maina Kiragu c5f95cdf61 Update .gitlab-ci.yml file 2023-02-13 02:22:31 +00:00
Martin Maina Kiragu cc428a92b8 Update .gitlab-ci.yml file 2023-02-13 02:08:09 +00:00
Martin Maina Kiragu 97bac45612 Update .gitlab-ci.yml file 2023-02-13 02:03:30 +00:00
Martin Maina Kiragu 8048396a88 Update .gitlab-ci.yml file 2023-02-13 01:59:14 +00:00
Martin Maina Kiragu 400ec31235 Update .gitlab-ci.yml file 2023-02-13 01:54:53 +00:00
Martin Maina Kiragu 4d9346c62c Update .gitlab-ci.yml file 2023-02-13 01:49:47 +00:00
Martin Maina Kiragu 94fd2069e8 Update .gitlab-ci.yml file 2023-02-13 01:43:41 +00:00
Martin Maina Kiragu 1f401eb347 Update .gitlab-ci.yml file 2023-02-13 01:39:09 +00:00
Martin Maina Kiragu 80e282bda0 Update .gitlab-ci.yml file 2023-02-13 01:35:00 +00:00
Martin Maina Kiragu 65cd6aae3c Update .gitlab-ci.yml file 2023-02-13 01:33:05 +00:00
Martin Maina Kiragu eba2a30024 Update .gitlab-ci.yml file 2023-02-13 01:28:16 +00:00
Martin Maina Kiragu c103deb2a7 Update .gitlab-ci.yml file 2023-02-13 01:25:16 +00:00
Martin Maina Kiragu dcef782587 Update .gitlab-ci.yml file
--update to php 7.4
2023-02-13 01:22:54 +00:00
Martin Maina Kiragu 10e7da4673 Update .gitlab-ci.yml file 2023-02-13 01:15:20 +00:00
Martin Kiragu faff35f241 update the pipeline with master branch code 2023-02-13 04:07:33 +03:00
Martin Maina Kiragu e2c1562f19 Update .gitlab-ci.yml file 2023-02-13 00:57:12 +00:00
Martin Maina Kiragu df35ceb798 Update .gitlab-ci.yml file 2023-02-13 00:51:03 +00:00
Martin Maina Kiragu cdb81a0bf4 Update .gitlab-ci.yml file 2023-02-13 00:48:41 +00:00
Martin Maina Kiragu f1b1955190 Update .gitlab-ci.yml file 2023-02-13 00:42:05 +00:00
Martin Maina Kiragu 860632b7a3 Update .gitlab-ci.yml file 2023-02-13 00:39:49 +00:00
Martin Maina Kiragu bde7a61fb4 Update .gitlab-ci.yml file 2023-02-13 00:35:42 +00:00
edmondlang b6600c5168 Merge branch 'update-laravelmpdf' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2023-02-10 20:56:42 +08:00
edmondlang 25f38ef7fe Merge branches 'development' and 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2023-02-07 23:40:38 +08:00
edmondlang ddeb44b920 Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2023-02-07 23:32:35 +08:00
Martin Maina Kiragu 02be710203 Update .gitlab-ci.yml file try php 7.3 2023-02-06 16:14:50 +00:00
Martin Maina Kiragu 2ffbfc9f1c Update .gitlab-ci.yml file 2023-02-06 16:12:41 +00:00
Martin Maina Kiragu 7b34f8116c Update .gitlab-ci.yml file 2023-02-06 16:09:41 +00:00
Martin Maina Kiragu 8a9b6df255 Update .gitlab-ci.yml file 2023-02-06 16:04:42 +00:00
Martin Kiragu c881dd44d6 updated action file 2023-02-06 18:38:12 +03:00
Martin Kiragu 1cfaeaf8bb add triggers 2023-02-06 18:28:46 +03:00
Martin Kiragu 914f29184d simple pipeline configuration 2023-02-06 18:23:51 +03:00
edmondlang f510d57463 Merge branch 'change-company-ui' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2023-02-06 23:08:03 +08:00
edmondlang 7833c17938 Merge branch 'change-company-ui' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2023-02-06 23:02:43 +08:00
edmondlang 97fdffe6eb Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2023-02-06 22:46:53 +08:00
edmondlang b1f2900f1c Merge branch 'change-company-ui' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2023-02-06 22:25:33 +08:00
edmondlang ddf015dc71 Revert "work on combine invoices"
This reverts commit 2a9d4fd212.
2023-02-06 22:24:48 +08:00
Sheikh Ahmer 2a9d4fd212 work on combine invoices 2023-02-04 16:36:09 +05:00
Martin Kiragu 2cacc23a38 login acceptance test 2023-02-04 10:04:34 +03:00
Martin Kiragu a7fd5a038e Merge branch 'master' of gitlab.com:CIEFWorldwideSdnBhd/shipping-portal into feature/TDD 2023-02-04 07:53:45 +03:00
edmondlang 626b31084f Merge branch 'wip-invoice-tab' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2023-02-03 16:11:48 +08:00
Martin Kiragu 4f3c25d5bd Merge branch 'master' of gitlab.com:CIEFWorldwideSdnBhd/shipping-portal into feature/TDD 2023-01-29 10:51:30 +03:00
Martin Kiragu 8da942e41e updated list of all user, passwords and emails unit tests 2023-01-28 12:56:41 +03:00
edmondlang b599c8a151 Merge branch 'multi-invoice-combined-ui' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2023-01-20 17:15:25 +08:00
Martin Kiragu d41f796825 fix access_token issue 2023-01-20 10:39:39 +03:00
Martin Kiragu dd612e2660 fix issues 2023-01-19 12:12:54 +03:00
Martin Kiragu c503b5e677 acceptance test set up and demo 2023-01-19 12:03:09 +03:00
Martin Kiragu 0b433cfa18 ed debug 2023-01-19 09:39:16 +03:00
Martin Kiragu 75aba8c4ac remove password related tests on auth test class 2023-01-19 09:39:16 +03:00
Martin Kiragu 81c65874a3 added the Auth tdd and a modal property autogenerator helpers 2023-01-19 09:39:15 +03:00
Martin Kiragu 79d29d9c7b Authentication TDD 2023-01-19 09:39:15 +03:00
Martin Kiragu 1e558b93af set up testig env codeception laravela and phpunit 2023-01-19 09:39:15 +03:00
edmondlang 6d3d52639e Merge branch 'multi-invoice-combined-ui' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2023-01-19 00:33:37 +08:00
edmondlang a1d460aa6c Merge branch 'multi-invoice-combined-ui' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2023-01-19 00:20:38 +08:00
edmondlang 5a0bc7aaea Merge branch 'multi-invoice-combined-ui' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development
# Conflicts:
#	resources/views/pages/pdfs/shipping_invoices_combined.blade.php
2023-01-18 23:59:58 +08:00
Martin Kiragu c7962b4231 ed debug 2023-01-18 18:34:18 +03:00
Martin Kiragu d14bb39ae8 remove password related tests on auth test class 2023-01-18 09:11:30 +03:00
Martin Kiragu 5cc2f51c02 added the Auth tdd and a modal property autogenerator helpers 2023-01-18 08:17:05 +03:00
Martin Kiragu a185f73e8a Authentication TDD 2023-01-16 14:40:57 +03:00
edmondlang f9a9598210 Merge branch 'dillon/search-marking-by-email' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2023-01-15 14:20:38 +08:00
edmondlang 9976ccec41 Merge branch 'ChangeCompanie' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2023-01-11 22:39:58 +08:00
edmondlang 8bfb2d749a Merge branch 'dillon/multiple-invoices-combined' of gitlab.com:CIEFWorldwideSdnBhd/shipping-portal into development 2023-01-11 18:25:28 +08:00
Martin Kiragu 7bf9a570a1 set up testig env codeception laravela and phpunit 2023-01-11 12:44:32 +03:00
edmondlang b38df170e8 Merge branch 'multiple-payment-ui' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into development 2023-01-09 22:58:10 +08:00
Dillon bf38ace70c Multiple invoices into one 2023-01-07 11:51:27 +08:00
edmondlang 66c008f97e Merge branch 'master' of gitlab.com:CIEFWorldwideSdnBhd/shipping-portal into development 2023-01-03 13:49:15 +08:00
edmondlang 0298eb946f Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into activity-route-log-dev 2023-01-02 17:41:29 +08:00
edmondlang 70fb35e37c api and web route logs 2023-01-02 17:41:00 +08:00
edmondlang 1a30877ca9 activity route log dev 2022-12-31 11:53:41 +08:00
WAKOYA_KUMSA\waqo1 569a22c0db route activity log 2022-12-28 13:15:15 +03:00
233 changed files with 7836 additions and 535 deletions
+8 -2
View File
@@ -10,9 +10,9 @@ LOG_LEVEL=debug
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=laravel
DB_DATABASE=shpping_portal
DB_USERNAME=root
DB_PASSWORD=
DB_PASSWORD=root
BROADCAST_DRIVER=log
CACHE_DRIVER=file
@@ -56,10 +56,16 @@ MIX_EXCHANGE_URL="${EXCHANGE_URL}"
YD_API_CODE=''
JWT_SECRET=Btj63iMEleEaww6Bb2IBECkxWn7YHPhhPFluAkg9DfcQik0qDRy6QW75ABGmPT2h
PERFEXCRM_BASE_URL=""
PERFEXCRM_API_KEY=""
PERFEXCRM_IS_ENABLED="false"
WEPOST_BASE_URL=https://wepost-uat.90warehouse.com/api/router
WEPOST_CLIENT_ID=1234
WEPOST_CLIENT_SECRET=cief-secret-temp
WEPOST_IS_ENABLED=false
STORAGE_FEE_LAUNCH_DATE="2023-12-11 00:00:00"
SST_START_DATE="2024-04-01 00:00:00"
+59
View File
@@ -0,0 +1,59 @@
APP_NAME=Laravel
APP_ENV=local
APP_KEY=base64:rIar2fvNeRzQdvKOgLUg03detGDMx6ym2SYFRjawrAc=
APP_DEBUG=true
APP_URL=http://localhost
LOG_CHANNEL=stack
LOG_LEVEL=debug
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=shpping_portal
DB_USERNAME=root
DB_PASSWORD=P@ssw0rd
BROADCAST_DRIVER=log
CACHE_DRIVER=file
FILESYSTEM_DRIVER=local
QUEUE_CONNECTION=sync
SESSION_DRIVER=file
SESSION_LIFETIME=120
MEMCACHED_HOST=127.0.0.1
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379
MAIL_MAILER=smtp
MAIL_HOST=mailhog
MAIL_PORT=1025
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
MAIL_FROM_ADDRESS=null
MAIL_FROM_NAME="${APP_NAME}"
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET=
AWS_USE_PATH_STYLE_ENDPOINT=false
PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=
PUSHER_APP_CLUSTER=mt1
MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
UNITY_APP_URL="https://unity.izyim.com"
EXCHANGE_URL=https://dev.exchange.cief-malaysia.com/
MIX_EXCHANGE_URL="${EXCHANGE_URL}"
YD_API_CODE=''
JWT_SECRET=Btj63iMEleEaww6Bb2IBECkxWn7YHPhhPFluAkg9DfcQik0qDRy6QW75ABGmPT2h
+2
View File
@@ -2,6 +2,8 @@
/public/hot
/public/storage
/storage/*.key
/tests/_output
/tests/_support
/vendor
**/.idea/
.env
+120
View File
@@ -0,0 +1,120 @@
image: php:7.4
stages:
- service_build
- node
- building_assets
- database
- unit_test
- acceptance_test
- code_quality
# Variables
variables:
MYSQL_ROOT_PASSWORD: root
MYSQL_USER: mysql_password
MYSQL_PASSWORD: mysql_password
MYSQL_DATABASE: shpping_portal
DB_HOST: mysql
before_script:
- apt-get update -yqq
- apt-get install -yqq
- apt-get install -y libonig-dev
- apt-get install -y libxml2-dev
- apt-get install -y libzip-dev
- apt-get install -y libgd-dev
- apt-get install -y libgd-dev
# Install PDO MySQL extension
- docker-php-ext-install pdo_mysql
#install php dependencies
- docker-php-ext-install mbstring xml zip gd
# Install composer package manager
- curl --location --output /usr/local/bin/composer https://getcomposer.org/download/latest-stable/composer.phar
- chmod +x /usr/local/bin/composer
# Install MySQL client
- apt-get install -y default-mysql-client
#install node js
- apt-get update && apt-get install -y nodejs npm
#install gulp Js
- npm install -g gulp-cli
#jobs
#buld the backend
composer_php:
stage: service_build
script:
- composer install
- cp .env.example .env
- php artisan key:generate
rules:
- if: '$CI_COMMIT_BRANCH =~ /.*/'
#build the UI
#node installation
npm:
stage: node
script:
- npm install # Install npm dependencies
rules:
- if: '$CI_COMMIT_BRANCH =~ /.*/'
#building assets
building_assets:
stage: building_assets
# dependencies:
# - npm
script:
- npm install # Install npm dependencies
- gulp build # Build assets
rules:
- if: '$CI_COMMIT_BRANCH =~ /.*/'
#mysql
database:
stage: database
services:
- name: mysql:8.0
command: [ "--default-authentication-plugin=mysql_native_password" ]
#dependencies:
# - composer_php
script:
- composer install
- cp .env.example .env
- php artisan key:generate
- php artisan migrate:fresh
- php artisan db:seed
rules:
- if: '$CI_COMMIT_BRANCH =~ /.*/'
#mysql
#unit_test:
# stage: unit_test
# services:
# - name: mysql:8.0
# command: [ "--default-authentication-plugin=mysql_native_password" ]
#dependencies:
# - database
# script:
# - npm install # Install npm dependencies
# - gulp build # Build assets
# - composer install
# - cp .env.example .env
# - php artisan key:generate
# - php artisan migrate:fresh
# - php artisan db:seed
# - php artisan test
# rules:
# - if: '$CI_COMMIT_BRANCH =~ /.*/'
+20 -43
View File
@@ -1,62 +1,39 @@
<p align="center"><a href="https://laravel.com" target="_blank"><img src="https://raw.githubusercontent.com/laravel/art/master/logo-lockup/5%20SVG/2%20CMYK/1%20Full%20Color/laravel-logolockup-cmyk-red.svg" width="400"></a></p>
## Shipping portal documentation
<p align="center">
<a href="https://travis-ci.org/laravel/framework"><img src="https://travis-ci.org/laravel/framework.svg" alt="Build Status"></a>
<a href="https://packagist.org/packages/laravel/framework"><img src="https://img.shields.io/packagist/dt/laravel/framework" alt="Total Downloads"></a>
<a href="https://packagist.org/packages/laravel/framework"><img src="https://img.shields.io/packagist/v/laravel/framework" alt="Latest Stable Version"></a>
<a href="https://packagist.org/packages/laravel/framework"><img src="https://img.shields.io/packagist/l/laravel/framework" alt="License"></a>
</p>
simple documentation on how to install, run, test, commit and deploy application
## About Laravel
## creating and running unit tests
Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experience to be truly fulfilling. Laravel takes the pain out of development by easing common tasks used in many web projects, such as:
Required Tools
- [Simple, fast routing engine](https://laravel.com/docs/routing).
- [Powerful dependency injection container](https://laravel.com/docs/container).
- Multiple back-ends for [session](https://laravel.com/docs/session) and [cache](https://laravel.com/docs/cache) storage.
- Expressive, intuitive [database ORM](https://laravel.com/docs/eloquent).
- Database agnostic [schema migrations](https://laravel.com/docs/migrations).
- [Robust background job processing](https://laravel.com/docs/queues).
- [Real-time event broadcasting](https://laravel.com/docs/broadcasting).
- Chromium Driver / selenium
- add running and setting selenium on all OS if possible
Laravel is accessible, powerful, and provides tools required for large, robust applications.
Required Packages :
## Learning Laravel
- laravel/legacy-factories
Laravel has the most extensive and thorough [documentation](https://laravel.com/docs) and video tutorial library of all modern web application frameworks, making it a breeze to get started with the framework.
- codeception/codeception
If you don't feel like reading, [Laracasts](https://laracasts.com) can help. Laracasts contains over 1500 video tutorials on a range of topics including Laravel, modern PHP, unit testing, and JavaScript. Boost your skills by digging into our comprehensive video library.
Or Simply Run
## Laravel Sponsors
``Composer install``
We would like to extend our thanks to the following sponsors for funding Laravel development. If you are interested in becoming a sponsor, please visit the Laravel [Patreon page](https://patreon.com/taylorotwell).
To create a unit test
### Premium Partners
``php artisan make test: Test Example --unit``
- **[Vehikl](https://vehikl.com/)**
- **[Tighten Co.](https://tighten.co)**
- **[Kirschbaum Development Group](https://kirschbaumdevelopment.com)**
- **[64 Robots](https://64robots.com)**
- **[Cubet Techno Labs](https://cubettech.com)**
- **[Cyber-Duck](https://cyber-duck.co.uk)**
- **[Many](https://www.many.co.uk)**
- **[Webdock, Fast VPS Hosting](https://www.webdock.io/en)**
- **[DevSquad](https://devsquad.com)**
- **[Curotec](https://www.curotec.com/services/technologies/laravel/)**
- **[OP.GG](https://op.gg)**
Running the tests :
## Contributing
Running a single Test
Thank you for considering contributing to the Laravel framework! The contribution guide can be found in the [Laravel documentation](https://laravel.com/docs/contributions).
`` php artisan test --filter Example``
## Code of Conduct
Running Unit tests -
In order to ensure that the Laravel community is welcoming to all, please review and abide by the [Code of Conduct](https://laravel.com/docs/contributions#code-of-conduct).
`` php artisan test ``
## Security Vulnerabilities
Running Codeception tests -
If you discover a security vulnerability within Laravel, please send an e-mail to Taylor Otwell via [taylor@laravel.com](mailto:taylor@laravel.com). All security vulnerabilities will be promptly addressed.
``vendor/bin/codecept run``
## License
The Laravel framework is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).
@@ -64,22 +64,28 @@ abstract class AbstractControllerLogic
return $response;
} catch (ErrorException|GeneralExceptions|TypeError $exception){
if ($exception instanceof JobResourceNotFoundException) {
Log::channel('vue_polling')->info(sprintf(
"Uncaught exception '%s' with message '%s' in %s:%d",
get_class($exception),
$exception->getMessage(),
$exception->getTrace()[0]['file'],
$exception->getTrace()[0]['line']
));
}
else{
if ($request->has('isApiPub')) {
Log::error($exception);
}
return (new ApiResponseObject($this->getNotificationTitle().' failed', $exception->getMessage(),
return (new ApiResponseObject($this->getNotificationTitle().' failed', "Server Error",
!in_array($exception->getCode(), [0, 42000]) ? $exception->getCode() : HttpStatus::SERVER_ERROR))->handler();
} else {
if ($exception instanceof JobResourceNotFoundException) {
Log::channel('vue_polling')->info(sprintf(
"Uncaught exception '%s' with message '%s' in %s:%d",
get_class($exception),
$exception->getMessage(),
$exception->getTrace()[0]['file'],
$exception->getTrace()[0]['line']
));
}
else{
Log::error($exception);
}
return (new ApiResponseObject($this->getNotificationTitle().' failed', $exception->getMessage(),
!in_array($exception->getCode(), [0, 42000]) ? $exception->getCode() : HttpStatus::SERVER_ERROR))->handler();
}
}
}
@@ -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,12 @@
<?php
namespace App\Classes\General\Interfaces;
use Illuminate\Database\Eloquent\Relations\MorphMany;
interface KeyValueInterface
{
public function attributes(): morphMany;
}
+42
View File
@@ -0,0 +1,42 @@
<?php
namespace App\Classes\General;
class WePostHelper
{
/**
* @param string $clientId
* @param string $clientSecrent
* @param string $type
* @return string
*/
static function generateSignature(string $clientId, string $clientSecrent, string $type){
// public parameters
$timestamp = 1234; //time();
$params = [
'client_id' => $clientId,
'type' => $type,
'timestamp' => $timestamp
];
// $businessParams = [
// 'test1' => '1',
// ];
ksort($params);
$str = '';
foreach ($params as $key => $value) {
if(is_array($value)) {
$str .= $key.json_encode($value, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
continue;
}
$str .= $key. $value;
}
$str = $clientSecrent.$str.$clientSecrent;
$signature = strtoupper(md5($str));
return $signature;
}
}
+3 -1
View File
@@ -11,14 +11,16 @@ use App\Classes\Modules\PerfexCRM\Services\UpdatesPerfexCRMInvoice;
use App\Classes\Modules\PerfexCRM\DataTransferObjects\UpdatePerfexCRMInvoiceObject;
use App\Classes\Modules\PerfexCRM\DataTransferObjects\InvoicePaymentPerfexCRMObject;
use App\Classes\ValueObjects\Constants\PerfexCRMInvoiceStatus;
use App\Models\PackingList;
use App\Models\Transaction;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
use Carbon\Carbon;
use Illuminate\Support\Facades\Log;
use Carbon\Carbon;
use App\Classes\General\Helper;
class UpdatePerfexCRMInvoice implements ShouldQueue
@@ -28,7 +28,8 @@ use App\Classes\ValueObjects\Constants\CompanyType;
use App\Classes\ValueObjects\Constants\RoleTypes;
use App\Classes\Jobs\CreatePerfexCRMCustomer;
use App\Classes\Modules\Accounts\Processors\RegisterOnExchangeProcessor;
use App\Classes\Modules\Companies\Services\ConnectCompanyModuleToExchangeCompany;
use App\Models\Company;
use App\Models\CompanyModule;
use App\Models\User;
@@ -89,6 +90,12 @@ class CreateCustomerLogic extends AbstractControllerLogic
/** @var CreatePerfexCRMLeadProcessor */
private $createPerfexCRMLeadProcessor;
/** @var RegisterOnExchangeProcessor */
private $registerOnExchangeProcessor;
/** @var ConnectCompanyModuleToExchangeCompany */
private $connectCompanyModuleToExchangeCompany;
/**
* CreateCustomerLogic constructor.
* @param CreateUserProcessor $createUserProcessor
@@ -103,8 +110,10 @@ class CreateCustomerLogic extends AbstractControllerLogic
* @param GenerateEmailVerificationAttemptProcessor $generateEmailVerificationAttemptProcessor
* @param FetchesCompanyModule $fetchesCompanyModule
* @param CreatePerfexCRMLeadProcessor $createPerfexCRMLeadProcessor
* @param RegisterOnExchangeProcessor $registerOnExchangeProcessor
* @param ConnectCompanyModuleToExchangeCompany $connectCompanyModuleToExchangeCompany
*/
public function __construct(CreateUserProcessor $createUserProcessor, CreateCompanyProcessor $createCompanyProcessor, CreateCompanyModuleProcessor $createCompanyModuleProcessor, CreateContactProcessor $createContactProcessor, CreatesCompanyConnection $createsCompanyConnection, ApprovesCompanyConnection $approvesCompanyConnection, AssignEmployeeProcessor $assignEmployeeProcessor, UploadIdentityDocumentProcessor $uploadIdentityDocumentProcessor, AuthenticationProcessor $authenticationProcessor, GenerateEmailVerificationAttemptProcessor $generateEmailVerificationAttemptProcessor, FetchesCompanyModule $fetchesCompanyModule, CreatePerfexCRMLeadProcessor $createPerfexCRMLeadProcessor)
public function __construct(CreateUserProcessor $createUserProcessor, CreateCompanyProcessor $createCompanyProcessor, CreateCompanyModuleProcessor $createCompanyModuleProcessor, CreateContactProcessor $createContactProcessor, CreatesCompanyConnection $createsCompanyConnection, ApprovesCompanyConnection $approvesCompanyConnection, AssignEmployeeProcessor $assignEmployeeProcessor, UploadIdentityDocumentProcessor $uploadIdentityDocumentProcessor, AuthenticationProcessor $authenticationProcessor, GenerateEmailVerificationAttemptProcessor $generateEmailVerificationAttemptProcessor, FetchesCompanyModule $fetchesCompanyModule, CreatePerfexCRMLeadProcessor $createPerfexCRMLeadProcessor, RegisterOnExchangeProcessor $registerOnExchangeProcessor, ConnectCompanyModuleToExchangeCompany $connectCompanyModuleToExchangeCompany)
{
$this->createUserProcessor = $createUserProcessor;
$this->createCompanyProcessor = $createCompanyProcessor;
@@ -118,6 +127,8 @@ class CreateCustomerLogic extends AbstractControllerLogic
$this->generateEmailVerificationAttemptProcessor = $generateEmailVerificationAttemptProcessor;
$this->fetchesCompanyModule = $fetchesCompanyModule;
$this->createPerfexCRMLeadProcessor = $createPerfexCRMLeadProcessor;
$this->registerOnExchangeProcessor = $registerOnExchangeProcessor;
$this->connectCompanyModuleToExchangeCompany = $connectCompanyModuleToExchangeCompany;
}
/**
@@ -155,7 +166,7 @@ class CreateCustomerLogic extends AbstractControllerLogic
$this->assignEmployeeProcessor->execute($Object);
$this->uploadIdentityDocumentProcessor->execute($request, $company);
// $this->uploadIdentityDocumentProcessor->execute($request, $company);
if(config('perfexcrm.is_enabled') == 'true'){
// $this->createPerfexCRMLeadProcessor->execute($request);
@@ -184,6 +195,19 @@ class CreateCustomerLogic extends AbstractControllerLogic
// $this->generateEmailVerificationAttemptProcessor->execute($user);
$exchangeCompanyId = null;
if ($request->input('exchange_company_id')) {
$exchangeCompanyId = $request->input('exchange_company_id');
} else {
// register account on exchange portal if this registration not coming from exchange
$exchangeCompanyId = $this->registerOnExchangeProcessor->execute($request, $companyModule->id);
}
if ($exchangeCompanyId) {
// create exchange company connection
$this->connectCompanyModuleToExchangeCompany->execute($companyModule, $exchangeCompanyId);
}
return $this->response($this->authenticationProcessor->execute($request));
}
}
@@ -0,0 +1,83 @@
<?php
namespace App\Classes\Modules\Accounts\ControllersLogic;
use App\Classes\Exceptions\AccessUnauthorisedException;
use App\Classes\Modules\Accounts\Processors\AuthenticationProcessor;
use App\Classes\General\Abstracts\AbstractControllerLogic;
use App\Classes\Modules\Accounts\Services\GeneratesAuthenticationToken;
use App\Classes\Modules\Accounts\Services\GeneratesAuthenticationTokenWithExchangeBookingId;
use App\Models\ExchangeCompanyConnection;
use App\Models\Order;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Log;
class LoginThroughExchangeLogic extends AbstractControllerLogic
{
protected function notification():array {
return [
'title' => 'Authentication',
'message' => 'You have successfully logged in to your account'
];
}
/** @var AuthenticationProcessor */
private $authenticationProcessor;
/** @var GeneratesAuthenticationToken */
private $generatesAuthenticationToken;
/** @var GeneratesAuthenticationTokenWithExchangeBookingId */
private $generatesAuthenticationTokenWithExchangeBookingId;
/**
* LoginThroughExchangeLogic constructor.
* @param AuthenticationProcessor $authenticationProcessor
* @param GeneratesAuthenticationToken $generatesAuthenticationToken
* @param GeneratesAuthenticationTokenWithExchangeBookingId $generatesAuthenticationTokenWithExchangeBookingId
*/
public function __construct(GeneratesAuthenticationToken $generatesAuthenticationToken, GeneratesAuthenticationTokenWithExchangeBookingId $generatesAuthenticationTokenWithExchangeBookingId)
{
$this->generatesAuthenticationToken = $generatesAuthenticationToken;
$this->generatesAuthenticationTokenWithExchangeBookingId = $generatesAuthenticationTokenWithExchangeBookingId;
}
/**
* @param Request $request
* @return JsonResponse
* @throws \App\Classes\Exceptions\AccessForbiddenException
* @throws \App\Classes\Exceptions\AccessUnauthorisedException
* @throws \App\Classes\Exceptions\RequestValidationException
*/
protected function logic(Request $request): JsonResponse {
$token = explode('.', $request->input("exchangeToken"))[1];
$decodedToken = base64_decode($token);
$exchangeUser = json_decode($decodedToken, true)['user'];
$exchangeCompanyId = $exchangeUser['company_id'];
$connection = ExchangeCompanyConnection::where("exchange_company_id", $exchangeCompanyId)->first();
if (!$connection) {
throw new AccessUnauthorisedException('These credentials do not match our records.');
}
$companyModule = $connection->companyModule;
$user = $companyModule->employees->last();
$exchangeBookingId = null;
if (isset($exchangeUser['booking_id']) && $exchangeUser['booking_id']) {
$exchangeBookingId = $exchangeUser['booking_id'];
$token = $this->generatesAuthenticationTokenWithExchangeBookingId->execute($user, $exchangeBookingId);
return $this->response(['access_token' => $token, 'redirect_url' => route('dashboard') . "?createOrder=true"]);
} else {
$token = $this->generatesAuthenticationToken->execute($user);
$order = Order::where('id', $request->input("orderId"))->first();
return $this->response(['access_token' => $token, 'redirect_url' => route('order.show' , $order->reference)]);
}
}
}
@@ -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;
}
}
@@ -0,0 +1,45 @@
<?php
namespace App\Classes\Modules\Accounts\Processors;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\App;
use Illuminate\Support\Facades\Log;
class RegisterOnExchangeProcessor
{
/**
* @param Request $request
* @return string
* @throws \App\Classes\Exceptions\AccessForbiddenException
* @throws \App\Classes\Exceptions\MalformedRequestException
* @throws \App\Classes\Exceptions\RequestValidationException
*/
public function execute(Request $request, $companyModuleId) {
if (App::environment(['production'])) {
dd("Delete this line before push to production");
$url = 'https://exchange.cief-malaysia.com/api/v1/account/registration/registration';
} else if (App::environment(['local'])) {
$url = 'http://127.0.0.1:8000/api/v1/account/registration/registration';
} else {
$url = 'https://dev.exchange.cief-malaysia.com/api/v1/account/registration/registration';
}
try {
$client = new \GuzzleHttp\Client(['verify' => false]);
$formParams = $request->toArray();
$formParams['shipping_company_module_id'] = $companyModuleId;
$response = $client->request('POST', $url, ['form_params' => $formParams]);
$body = $response->getBody();
$contents = json_decode($body, true);
$payload = $contents['payload'];
$token = explode('.', $payload['access_token'])[1];
$decodedToken = base64_decode($token);
$exchangeUser = json_decode($decodedToken, true)['user'];
return $exchangeUser['company_id'];
} catch(\GuzzleHttp\Exception\RequestException $exception){
Log::error($exception->getResponse()->getBody()->getContents());
}
}
}
@@ -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->attributes(), $model);
}
}
@@ -0,0 +1,81 @@
<?php
namespace App\Classes\Modules\Accounts\Services;
use App\Classes\Exceptions\InternalServerErrorException;
use App\Classes\ValueObjects\Constants\OrderRoleTypes;
use App\Classes\ValueObjects\Constants\RoleTypes;
use App\Models\Company;
use App\Models\Role;
use App\Models\User;
use Carbon\Carbon;
use Tymon\JWTAuth\JWT;
class GeneratesAuthenticationTokenWithExchangeBookingId {
/** @var JWT */
private $builder;
/**
* GeneratesAuthenticationTokenWithExchangeBookingId constructor.
* @param JWT $builder
*/
public function __construct(JWT $builder) {
$this->builder = $builder;
}
/**
* @param User $user
* @param bool $rememberUser
* @return string
*/
public function execute(User $user, $bookingId): string {
$this->builder->manager()->setBlacklistEnabled(false);
// generate token for the customer
$this->builder->factory()->setTTL(Carbon::now()->addDay()->timestamp);
// set the claim based on the object
$this->setTokenClaims($user, $bookingId);
return $this->builder->fromUser($user);
}
/**
* @param User $user
*/
private function setTokenClaims(User $user, $bookingId): void {
$claims = [
'id' => $user->id,
'name' => $user->name,
'email' => $user->email,
'type' => $user->type,
'status' => $user->status
];
if($user->type === RoleTypes::USER) {
/** @var Company $companyModule */
$companyModule = $user->companyModule()->first();
$claims = array_merge($claims, [
'company_id' => $companyModule->company_id,
'company_module_id' => $companyModule->id,
'company_module_type' => $companyModule->type,
'company_name' => $companyModule->name,
'company_marking' => $companyModule->type !== 8 ? $companyModule->inviters()->withPivot('invitee_reference')->first()->pivot->invitee_reference : 'HWT',
'exchange_booking_id' => $bookingId
]);
}
$this->builder->factory()->customClaims(['user' => $claims]);
$this->builder->factory()->buildClaimsCollection();
}
}
@@ -3,6 +3,9 @@
namespace App\Classes\Modules\Addresses\ControllersLogic;
use App\Classes\Exceptions\AccessForbiddenException;
use App\Classes\Exceptions\MalformedRequestException;
use App\Classes\Exceptions\RequestValidationException;
use App\Classes\General\Abstracts\AbstractControllerLogic;
use App\Classes\General\Interfaces\Contactable;
use App\Classes\Modules\Addresses\Services\CreatesAddress;
@@ -15,8 +18,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 App\Transformers\AddressTransformer;
use ErrorException;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
@@ -27,7 +32,8 @@ class CreateAddressLogic extends AbstractControllerLogic
/**
* @return array
*/
protected function notification():array {
protected function notification(): array
{
return [
'title' => 'Created Address',
'message' => 'You have successfully created a new Address'
@@ -74,11 +80,11 @@ class CreateAddressLogic extends AbstractControllerLogic
/**
* @param Request $request
* @return JsonResponse
* @throws \App\Classes\Exceptions\AccessForbiddenException
* @throws \App\Classes\Exceptions\MalformedRequestException
* @throws \App\Classes\Exceptions\RequestValidationException
* @throws AccessForbiddenException
* @throws MalformedRequestException
* @throws RequestValidationException
*/
public function logic(Request $request) : JsonResponse
public function logic(Request $request): JsonResponse
{
$district = $this->fetchesDistrict->execute(['id' => $request->input('district_id')]);
@@ -90,16 +96,31 @@ class CreateAddressLogic extends AbstractControllerLogic
/** @var Address $address */
$address = $this->createsAddress->execute($this->fetchesCompanyModule->execute(['id' => $request->input('company_module_id')]), $object);
if($request->input('phone')){
if ($request->input('phone')) {
$contactObject = new ContactObject($request->input('person_in_charge'), $request->input('phone'), '', '');
$this->createContactProcessor->execute($contactObject, $address);
}
if($request->input('remark')){
if ($request->input('remark')) {
$remarkObject = new RemarkObject($request->input('remark'), Auth()->user()->id);
$this->createRemarkProcessor->execute($address, $remarkObject);
}
/* return fractal()
->item($address, new AddressTransformer())
->parseIncludes('remark')
->respond(200, [], JSON_PRETTY_PRINT);*/
$addressExtraFields = [
'property_type' => $request->input('property_type'),
'tools_required_unload' => $request->input('tools_required_unload'),
'pickup_time_from' => $request->input('pickup_time_from'),
'pickup_time_to' => $request->input('pickup_time_to'),
];
$addressExtraFieldsObject = new RemarkObject(json_encode($addressExtraFields), Auth()->user()->id, RemarkTypes::ADDRESS_EXTRA_COLUMNS);
$this->createRemarkProcessor->execute($address, $addressExtraFieldsObject);
return $this->resourceResponse(new AddressResource($address));
}
@@ -3,6 +3,9 @@
namespace App\Classes\Modules\Addresses\ControllersLogic;
use App\Classes\Exceptions\AccessForbiddenException;
use App\Classes\Exceptions\MalformedRequestException;
use App\Classes\Exceptions\RequestValidationException;
use App\Classes\General\Abstracts\AbstractControllerLogic;
use App\Classes\Modules\Addresses\Services\CreatesAddress;
use App\Classes\Modules\Addresses\Standards\Rules\CanCreateAddress;
@@ -14,6 +17,7 @@ use App\Classes\ValueObjects\Constants\ApprovalStatus;
use App\Http\Resources\AddressResource;
use App\Models\Address;
use App\Models\CompanyModule;
use App\Transformers\AddressTransformer;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
@@ -23,7 +27,8 @@ class CreateBillingAddressLogic extends AbstractControllerLogic
/**
* @return array
*/
protected function notification():array {
protected function notification(): array
{
return [
'title' => 'Created Billing Address',
'message' => 'You have successfully created a new Billing Address'
@@ -60,27 +65,35 @@ class CreateBillingAddressLogic extends AbstractControllerLogic
/**
* @param Request $request
* @return JsonResponse
* @throws \App\Classes\Exceptions\AccessForbiddenException
* @throws \App\Classes\Exceptions\MalformedRequestException
* @throws \App\Classes\Exceptions\RequestValidationException
* @throws AccessForbiddenException
* @throws MalformedRequestException
* @throws RequestValidationException
*/
public function logic(Request $request) : JsonResponse
public function logic(Request $request): JsonResponse
{
$companyModule = $this->fetchesCompanyModule->execute(['id' => $request->input('company_module_id')]);
$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) {
$billingAddressInputed = $this->fetchesAddress->execute(['id' => $request->input('billing_address_id')]);
if ($billingAddressInputed->type !== AddressType::BILLING || $billingAddressInputed->id !== $companyModule->addresses->where('type', AddressType::BILLING)->first()->id) {
// delete all current billing address
Address::where('owner_type', CompanyModule::class)->where('owner_id', $request->input('company_module_id'))->where('type', AddressType::BILLING)->delete();
// create addrress
$billingAddress = new AddressObject($address->street_one, $address->street_two, $address->country_id, $address->state_id, $address->district_id, $address->postcode, AddressType::BILLING, ApprovalStatus::APPROVED, $address->reference);
// create new billing addrress
$billingAddress = new AddressObject($billingAddressInputed->street_one, $billingAddressInputed->street_two, $billingAddressInputed->country_id, $billingAddressInputed->state_id, $billingAddressInputed->district_id, $billingAddressInputed->postcode, AddressType::BILLING, ApprovalStatus::APPROVED, $billingAddressInputed->reference);
$this->canCreateAddress->passes($billingAddress);
$this->createsAddress->execute($companyModule, $billingAddress);
}
return $this->resourceResponse(new AddressResource($address));
//load address with only owner address
/* return fractal()
->item($billingAddressInputed, new AddressTransformer())
->parseIncludes('Owner_address')
->respond(200, [], JSON_PRETTY_PRINT);*/
return $this->resourceResponse(new AddressResource($billingAddressInputed));
}
}
@@ -3,6 +3,8 @@
namespace App\Classes\Modules\Addresses\ControllersLogic;
use App\Classes\Exceptions\AccessForbiddenException;
use App\Classes\Exceptions\RequestValidationException;
use App\Classes\General\Abstracts\AbstractControllerLogic;
use App\Classes\Modules\Addresses\Services\FetchesAddress;
use App\Classes\Modules\Addresses\Standards\Rules\CanFetchAddress;
@@ -17,7 +19,8 @@ class FetchAddressLogic extends AbstractControllerLogic
/**
* @return array
*/
protected function notification():array {
protected function notification(): array
{
return [
'title' => 'Retrieved Address',
'message' => 'You have successfully retrieved a Address'
@@ -45,15 +48,22 @@ class FetchAddressLogic extends AbstractControllerLogic
/**
* @param Request $request
* @return JsonResponse
* @throws \App\Classes\Exceptions\AccessForbiddenException
* @throws \App\Classes\Exceptions\RequestValidationException
* @throws AccessForbiddenException
* @throws RequestValidationException
*/
public function logic(Request $request) : JsonResponse
public function logic(Request $request): JsonResponse
{
$this->canFetchAddress->passes();
$query = $this->fetchesAddress->execute(['id' => $request->route('id')]);
//load address with no relationships
/* return fractal()
->item($address, new AddressTransformer())
->respond(200, [], JSON_PRETTY_PRINT);*/
return $this->resourceResponse(new AddressResource($query));
}
@@ -3,10 +3,14 @@
namespace App\Classes\Modules\Addresses\ControllersLogic;
use App\Classes\Exceptions\AccessForbiddenException;
use App\Classes\Exceptions\MalformedRequestException;
use App\Classes\Exceptions\RequestValidationException;
use App\Classes\General\Abstracts\AbstractControllerLogic;
use App\Classes\Modules\Addresses\Services\ListsAddresses;
use App\Classes\Modules\Addresses\Standards\Rules\CanListAddresses;
use App\Http\Resources\AddressResource;
use App\Transformers\AddressTransformer;
use ErrorException;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
@@ -17,7 +21,8 @@ class ListAddressesLogic extends AbstractControllerLogic
/**
* @return array
*/
protected function notification():array {
protected function notification(): array
{
return [
'title' => 'Retrieved Addresses',
'message' => 'You have successfully retrieved a list of Addresses'
@@ -45,17 +50,25 @@ class ListAddressesLogic extends AbstractControllerLogic
/**
* @param Request $request
* @return JsonResponse
* @throws \App\Classes\Exceptions\AccessForbiddenException
* @throws \App\Classes\Exceptions\MalformedRequestException
* @throws \App\Classes\Exceptions\RequestValidationException
* @throws AccessForbiddenException
* @throws MalformedRequestException
* @throws RequestValidationException
*/
public function logic(Request $request) : JsonResponse
public function logic(Request $request): JsonResponse
{
$this->canListAddresses->passes();
$query = $this->listsAddresses->execute($this->listsAddresses->deserializeFilters($request->input('filters')));
//a collection of addresses with all incluides
/* return fractal()
->collection($query, new AddressTransformer)
->parseIncludes('Owner_address')
->parseIncludes('remark')
->parseIncludes('contact')
->respond(200, [], JSON_PRETTY_PRINT);*/
return $this->collectionResponse(AddressResource::collection($query));
}
@@ -7,7 +7,6 @@ use App\Classes\General\Abstracts\AbstractControllerLogic;
use App\Classes\Modules\Addresses\Services\ListsAddresses;
use App\Classes\Modules\Addresses\Services\ListsDistricts;
use App\Classes\Modules\Addresses\Standards\Rules\CanListAddresses;
use App\Http\Resources\AddressResource;
use App\Http\Resources\DistrictResource;
use ErrorException;
use Illuminate\Http\JsonResponse;
@@ -7,7 +7,6 @@ use App\Classes\General\Abstracts\AbstractControllerLogic;
use App\Classes\Modules\Addresses\Services\ListsAddresses;
use App\Classes\Modules\Addresses\Services\ListsStates;
use App\Classes\Modules\Addresses\Standards\Rules\CanListAddresses;
use App\Http\Resources\AddressResource;
use App\Http\Resources\StateResource;
use ErrorException;
use Illuminate\Http\JsonResponse;
@@ -9,6 +9,7 @@ use App\Classes\Modules\Addresses\Services\FetchesAddress;
use App\Classes\Modules\Addresses\Services\ResetsAddressesDefault;
use App\Classes\Modules\Addresses\Services\SetsAddressToDefault;
use App\Models\Address;
use App\Transformers\AddressTransformer;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
@@ -33,7 +34,7 @@ class SetAddressToDefaultLogic extends AbstractControllerLogic
/** @var ResetsAddressesDefault */
private $resetsAddressesDefault;
/** @var SetsAddressToDefault*/
/** @var SetsAddressToDefault */
private $setsAddressToDefault;
@@ -64,7 +65,15 @@ class SetAddressToDefaultLogic extends AbstractControllerLogic
$this->resetsAddressesDefault->execute($address->owner, $address->type);
return $this->resourceResponse(new AddressResource($this->setsAddressToDefault->execute($address)));
$setAddress = $this->setsAddressToDefault->execute($address);
//no relationships needed
/* return fractal()
->item($setAddress, new AddressTransformer())
->respond(200, [], JSON_PRETTY_PRINT);*/
return $this->resourceResponse(new AddressResource($address));
}
}
@@ -15,10 +15,13 @@ 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 App\Transformers\AddressTransformer;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Carbon\Carbon;
class UpdateAddressLogic extends AbstractControllerLogic
{
@@ -26,7 +29,8 @@ class UpdateAddressLogic extends AbstractControllerLogic
/**
* @return array
*/
protected function notification():array {
protected function notification(): array
{
return [
'title' => 'Updated Address',
'message' => 'You have successfully updated the Address'
@@ -77,7 +81,7 @@ class UpdateAddressLogic extends AbstractControllerLogic
* @throws \App\Classes\Exceptions\MalformedRequestException
* @throws \App\Classes\Exceptions\RequestValidationException
*/
public function logic(Request $request) : JsonResponse
public function logic(Request $request): JsonResponse
{
$district = $this->fetchesDistrict->execute(['id' => $request->input('district_id')]);
@@ -90,18 +94,44 @@ class UpdateAddressLogic extends AbstractControllerLogic
/** @var Address $address */
$address = $this->updatesAddress->execute($address, $object);
$address->contacts()->delete(); $address->remarks()->delete();
$address->contacts()->delete();
$address->remarks()->delete();
if($request->input('phone')){
if ($request->input('phone')) {
$contactObject = new ContactObject($request->input('person_in_charge'), $request->input('phone'), '', '');
$this->createContactProcessor->execute($contactObject, $address);
}
if($request->input('remark')){
if ($request->input('remark')) {
$remarkObject = new RemarkObject($request->input('remark'), Auth()->user()->id);
$this->createRemarkProcessor->execute($address, $remarkObject);
}
//only remark relationship needed
/* return fractal()
->item($address, new AddressTransformer())
->parseIncludes('remark')
->respond(200, [], JSON_PRETTY_PRINT);*/
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'),
'additional_request' => $request->input('additional_request'),
'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);
$this->createRemarkProcessor->execute($address, $addressExtraFieldsObject);
return $this->resourceResponse(new AddressResource($address));
}
@@ -20,7 +20,7 @@ class AssignsAnnouncementToSegment extends AbstractUpdateRecord
{
try {
$announcement->segments()->attach($segment);
$announcement->segments()->attach($segment, ['created_at' => now(), 'updated_at' => now()]);
return $announcement;
@@ -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); //cief todo: to be removed
Log::channel('storage_invoices')->info('Total amount from paid transaction: '.$transaction->amount); //cief todo: to be removed
return false;
}
}
return true;
}
}
@@ -36,7 +36,7 @@ class CallbackBillplzProcessor
private $releaseGoodsToCustomerProcessor;
/**
* CreateUserProcessor constructor.
* CallbackBillplzProcessor constructor.
* @param UpdatesTransactionStatus $updatesTransactionStatus
* @param UpdateDoFromVTPortalProcessor $updateDoFromVTPortalProcessor
* @param UpdateDoFromYDPortalProcessor $updateDoFromYDPortalProcessor
@@ -10,16 +10,18 @@ use App\Classes\ValueObjects\Constants\ApprovalStatus;
use App\Http\Resources\DocumentResource;
use App\Classes\General\Abstracts\AbstractControllerLogic;
use App\Classes\Modules\Companies\Processors\ApproveIdentificationDocumentOnExchangeProcessor;
use App\Classes\Modules\Documents\Services\FetchesDocument;
use App\Classes\Modules\Documents\Services\ApprovesDocument;
use App\Classes\Modules\Notifications\DataTransferObjects\NotificationObject;
Use App\Classes\Modules\Notifications\Processors\CreateNotificationProcessor;
use App\Classes\ValueObjects\Constants\DocumentType;
use App\Models\Document;
use App\Models\ExchangeCompanyConnection;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Log;
class ApproveIdentificationDocumentLogic extends AbstractControllerLogic
{
@@ -55,6 +57,9 @@ class ApproveIdentificationDocumentLogic extends AbstractControllerLogic
/** @var CreateNotificationProcessor */
private $createNotificationProcessor;
/** @var ApproveIdentificationDocumentOnExchangeProcessor */
private $approveIdentificationDocumentOnExchangeProcessor;
/**
* ApproveIdentificationDocumentLogic constructor.
* @param CanApproveDocument $canApproveDocument
@@ -64,8 +69,9 @@ class ApproveIdentificationDocumentLogic extends AbstractControllerLogic
* @param UpdatesCompanyStatus $updatesCompanyStatus
* @param UpdatesOrdersStatus $updatesOrdersStatus
* @param CreateNotificationProcessor $createNotificationProcessor
* @param ApproveIdentificationDocumentOnExchangeProcessor $approveIdentificationDocumentOnExchangeProcessor
*/
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, ApproveIdentificationDocumentOnExchangeProcessor $approveIdentificationDocumentOnExchangeProcessor)
{
$this->canApproveDocument = $canApproveDocument;
$this->approvesDocument = $approvesDocument;
@@ -74,6 +80,7 @@ class ApproveIdentificationDocumentLogic extends AbstractControllerLogic
$this->updatesCompanyStatus = $updatesCompanyStatus;
$this->updatesOrdersStatus = $updatesOrdersStatus;
$this->createNotificationProcessor = $createNotificationProcessor;
$this->approveIdentificationDocumentOnExchangeProcessor = $approveIdentificationDocumentOnExchangeProcessor;
}
/**
@@ -85,11 +92,18 @@ class ApproveIdentificationDocumentLogic extends AbstractControllerLogic
*/
public function logic(Request $request) : JsonResponse
{
$documentId = $request->route('document_id');
if ($request->route('exchange_company_id')) {
$companyModule = ExchangeCompanyConnection::where('exchange_company_id', $request->route('exchange_company_id'))->first()->companyModule;
$company = $companyModule->company;
$documentId = $company->documents()->whereIn('document_type', DocumentType::IDENTIFICATION_DOCUMENTS)->where('status', ApprovalStatus::PENDING_VERIFICATION)->first()->id;
}
$status = $request->route('status');
/** @var Document $document */
$document = $this->fetchesDocument->execute(['id' => $request->route('document_id')]);
$document = $this->fetchesDocument->execute(['id' => $documentId]);
$this->canApproveDocument->passes();
@@ -111,6 +125,11 @@ class ApproveIdentificationDocumentLogic extends AbstractControllerLogic
$orders = $this->updatesOrdersStatus->execute($document->owner, ApprovalStatus::APPROVED);
}
// if this request is not calling from exchange portal, then approve the document on exchange portal for this user
$companyModule = $document->owner->companyModules()->first();
if (!$request->route('exchange_company_id') && $companyModule->exchangeCompanyConnection()->first()) {
$this->approveIdentificationDocumentOnExchangeProcessor->execute($request, $companyModule->id, $status);
}
return $this->resourceResponse(new DocumentResource($document));
@@ -4,6 +4,7 @@ namespace App\Classes\Modules\Companies\ControllersLogic;
use App\Classes\General\Abstracts\AbstractControllerLogic;
use App\Classes\Modules\Companies\Processors\CreateIdentificationDocumentOnExchangeProcessor;
use App\Classes\Modules\Companies\Services\FetchesCompany;
use App\Classes\Modules\Companies\Services\UpdatesCompanyStatus;
use App\Classes\Modules\Documents\DataTransferObjects\DocumentObject;
@@ -14,6 +15,7 @@ use App\Classes\ValueObjects\Constants\CompanyType;
use App\Classes\ValueObjects\Constants\DocumentType;
use App\Models\Company;
use App\Models\Document;
use App\Models\ExchangeCompanyConnection;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
@@ -42,6 +44,9 @@ class CreateIdentificationDocumentLogic extends AbstractControllerLogic
/** @var UpdatesCompanyStatus */
private $updatesCompanyStatus;
/** @var CreateIdentificationDocumentOnExchangeProcessor */
private $createIdentificationDocumentOnExchangeProcessor;
/**
* CreateIdentificationDocumentLogic constructor.
@@ -49,13 +54,15 @@ class CreateIdentificationDocumentLogic extends AbstractControllerLogic
* @param CreatesDocument $createsDocument
* @param CreatesFiles $createsFile
* @param UpdatesCompanyStatus $updatesCompanyStatus
* @param CreateIdentificationDocumentOnExchangeProcessor $createIdentificationDocumentOnExchangeProcessor
*/
public function __construct(FetchesCompany $fetchesCompany, CreatesDocument $createsDocument, CreatesFiles $createsFile, UpdatesCompanyStatus $updatesCompanyStatus)
public function __construct(FetchesCompany $fetchesCompany, CreatesDocument $createsDocument, CreatesFiles $createsFile, UpdatesCompanyStatus $updatesCompanyStatus, CreateIdentificationDocumentOnExchangeProcessor $createIdentificationDocumentOnExchangeProcessor)
{
$this->fetchesCompany = $fetchesCompany;
$this->createsDocument = $createsDocument;
$this->createsFile = $createsFile;
$this->updatesCompanyStatus = $updatesCompanyStatus;
$this->createIdentificationDocumentOnExchangeProcessor = $createIdentificationDocumentOnExchangeProcessor;
}
/**
@@ -66,8 +73,15 @@ class CreateIdentificationDocumentLogic extends AbstractControllerLogic
public function logic(Request $request) : JsonResponse
{
if ($request->route('exchange_company_id')) {
$companyModule = ExchangeCompanyConnection::where('exchange_company_id', $request->route('exchange_company_id'))->first()->companyModule;
$companyId = $companyModule->company_id;
} else {
$companyId = $request->route('id');
}
/** @var Company $company */
$company = $this->fetchesCompany->execute(['id' => $request->route('id')]);
$company = $this->fetchesCompany->execute(['id' => $companyId]);
$object = new DocumentObject($company->type === CompanyType::COMPANY_BUSINESS ?
DocumentType::SSM_REGISTRATION : DocumentType::IDENTITY_CARD, $request->input('files'),
$request->input('identification_no'), ApprovalStatus::PENDING_VERIFICATION, 'identifications');
@@ -78,6 +92,12 @@ class CreateIdentificationDocumentLogic extends AbstractControllerLogic
$this->updatesCompanyStatus->execute($company, ApprovalStatus::PENDING_VERIFICATION);
// create identification on exchange if this request not coming from exchange
$companyModule = $company->companyModules()->first();
if (!$request->route('exchange_company_id') && $companyModule->exchangeCompanyConnection()->first()) {
$this->createIdentificationDocumentOnExchangeProcessor->execute($request, $companyModule->id);
}
return $this->response([]);
}
@@ -0,0 +1,45 @@
<?php
namespace App\Classes\Modules\Companies\ControllersLogic;
use App\Classes\General\Abstracts\AbstractControllerLogic;
use App\Classes\Modules\Companies\Processors\LinkExchangeCompanyProcessor;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
class LinkExchangeCompanyLogic extends AbstractControllerLogic
{
protected function notification():array {
return [
'title' => 'Connect Exchange with Izyim Account',
'message' => 'You have successfully connect your exchange account to Izyim Account'
];
}
/** @var LinkExchangeCompanyProcessor */
private $linkExchangeCompanyProcessor;
/**
* LinkExchangeCompanyLogic constructor.
* @param LinkExchangeCompanyProcessor $linkExchangeCompanyProcessor
*/
public function __construct(LinkExchangeCompanyProcessor $linkExchangeCompanyProcessor)
{
$this->linkExchangeCompanyProcessor = $linkExchangeCompanyProcessor;
}
/**
* @param Request $request
* @return JsonResponse
* @throws \App\Classes\Exceptions\AccessForbiddenException
* @throws \App\Classes\Exceptions\AccessUnauthorisedException
* @throws \App\Classes\Exceptions\RequestValidationException
*/
protected function logic(Request $request): JsonResponse {
return $this->response($this->linkExchangeCompanyProcessor->execute($request));
}
}
@@ -3,10 +3,14 @@
namespace App\Classes\Modules\Companies\ControllersLogic;
use App\Classes\Exceptions\AccessForbiddenException;
use App\Classes\Exceptions\MalformedRequestException;
use App\Classes\Exceptions\RequestValidationException;
use App\Classes\General\Abstracts\AbstractControllerLogic;
use App\Classes\Modules\Companies\Services\ListsCompanyModules;
use App\Classes\Modules\Companies\Standards\Rules\CanListCompanies;
use App\Http\Resources\CompanyModuleResource;
use App\Transformers\CompanyTransformer;
use ErrorException;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
@@ -17,7 +21,8 @@ class ListCompanyModulesLogic extends AbstractControllerLogic
/**
* @return array
*/
protected function notification():array {
protected function notification(): array
{
return [
'title' => 'Retrieved Company Moduels',
'message' => 'You have successfully retrieved a list of Companies'
@@ -45,15 +50,26 @@ class ListCompanyModulesLogic extends AbstractControllerLogic
/**
* @param Request $request
* @return JsonResponse
* @throws \App\Classes\Exceptions\AccessForbiddenException
* @throws \App\Classes\Exceptions\MalformedRequestException
* @throws \App\Classes\Exceptions\RequestValidationException
* @throws AccessForbiddenException
* @throws MalformedRequestException
* @throws RequestValidationException
*/
public function logic(Request $request) : JsonResponse
public function logic(Request $request): JsonResponse
{
$this->canListCompanies->passes();
$query = $this->listsCompanyModules->execute($this->listsCompanyModules->deserializeFilters($request->input('filters')));
/*include all relationships*/
/* return fractal()
->collection($query, new CompanyTransformer)
->parseIncludes('company')
->parseIncludes('contact')
->parseIncludes('remarks')
->parseIncludes('address')
->parseIncludes('billingAddress')
->respond(200, [], JSON_PRETTY_PRINT);*/
return $this->collectionResponse(CompanyModuleResource::collection($query));
}
@@ -0,0 +1,48 @@
<?php
namespace App\Classes\Modules\Companies\Processors;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\App;
use Illuminate\Support\Facades\Log;
class ApproveIdentificationDocumentOnExchangeProcessor
{
/**
* @param Request $request
* @return string
* @throws \App\Classes\Exceptions\AccessForbiddenException
* @throws \App\Classes\Exceptions\MalformedRequestException
* @throws \App\Classes\Exceptions\RequestValidationException
*/
public function execute(Request $request, $companyModuleId, $status) {
if (App::environment(['production'])) {
dd("Delete this line before push to production");
$url = "https://exchange.cief-malaysia.com/api/v1/shipping/company/{$companyModuleId}/identification/approval/{$status}";
} else if (App::environment(['local'])) {
$url = "http://127.0.0.1:8000/api/v1/shipping/company/{$companyModuleId}/identification/approval/{$status}";
} else {
$url = "https://dev.exchange.cief-malaysia.com/api/v1/shipping/company/{$companyModuleId}/identification/approval/{$status}";
}
try {
$client = new \GuzzleHttp\Client(['verify' => false]);
$token = $request->bearerToken();
$headers = [
'Authorization' => 'Bearer ' . $token,
'Accept' => 'application/json',
];
$formParams = $request->toArray();
$response = $client->request('PUT', $url, [
'headers' => $headers,
'form_params' => $formParams
]);
$body = $response->getBody();
$contents = json_decode($body, true);
return $contents;
} catch(\GuzzleHttp\Exception\RequestException $exception){
Log::error($exception->getResponse()->getBody()->getContents());
}
}
}
@@ -0,0 +1,48 @@
<?php
namespace App\Classes\Modules\Companies\Processors;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\App;
use Illuminate\Support\Facades\Log;
class CreateIdentificationDocumentOnExchangeProcessor
{
/**
* @param Request $request
* @return string
* @throws \App\Classes\Exceptions\AccessForbiddenException
* @throws \App\Classes\Exceptions\MalformedRequestException
* @throws \App\Classes\Exceptions\RequestValidationException
*/
public function execute(Request $request, $companyModuleId) {
if (App::environment(['production'])) {
dd("Delete this line before push to production");
$url = "https://exchange.cief-malaysia.com/api/v1/shipping/company/{$companyModuleId}/identification/create";
} else if (App::environment(['local'])) {
$url = "http://127.0.0.1:8000/api/v1/shipping/company/{$companyModuleId}/identification/create";
} else {
$url = "https://dev.exchange.cief-malaysia.com/api/v1/shipping/company/{$companyModuleId}/identification/create";
}
try {
$client = new \GuzzleHttp\Client(['verify' => false]);
$token = $request->bearerToken();
$headers = [
'Authorization' => 'Bearer ' . $token,
'Accept' => 'application/json',
];
$formParams = $request->toArray();
$response = $client->request('POST', $url, [
'headers' => $headers,
'form_params' => $formParams
]);
$body = $response->getBody();
$contents = json_decode($body, true);
return $contents;
} catch(\GuzzleHttp\Exception\RequestException $exception){
Log::error($exception->getResponse()->getBody()->getContents());
}
}
}
@@ -0,0 +1,80 @@
<?php
namespace App\Classes\Modules\Companies\Processors;
use App\Classes\Modules\Accounts\DataTransferObjects\AuthenticationCredentialsObject;
use App\Classes\Modules\Accounts\Services\AuthenticatesUser;
use App\Classes\Modules\Accounts\Services\AuthenticationRedirect;
use App\Classes\Modules\Accounts\Services\FetchesUser;
use App\Classes\Modules\Accounts\Services\GeneratesAuthenticationToken;
use App\Classes\Modules\Accounts\Standards\Rules\CanAuthenticateUser;
use App\Classes\Modules\Companies\Services\ConnectCompanyModuleToExchangeCompany;
use Illuminate\Http\Request;
class LinkExchangeCompanyProcessor
{
/** @var CanAuthenticateUser */
private $canAuthenticateUser;
/** @var AuthenticatesUser */
private $authenticatesUser;
/** @var GeneratesAuthenticationToken */
private $generatesAuthenticationToken;
/** @var FetchesUser */
private $fetchesUser;
/** @var AuthenticationRedirect */
private $authenticationRedirect;
/** @var ConnectCompanyModuleToExchangeCompany */
private $connectCompanyModuleToExchangeCompany;
/**
* AuthenticationProcessor constructor.
* @param CanAuthenticateUser $canAuthenticateUser
* @param AuthenticatesUser $authenticatesUser
* @param GeneratesAuthenticationToken $generatesAuthenticationToken
* @param FetchesUser $fetchesUser
* @param AuthenticationRedirect $authenticationRedirect
* @param ConnectCompanyModuleToExchangeCompany $connectCompanyModuleToExchangeCompany
*/
public function __construct(CanAuthenticateUser $canAuthenticateUser, AuthenticatesUser $authenticatesUser, GeneratesAuthenticationToken $generatesAuthenticationToken, FetchesUser $fetchesUser, AuthenticationRedirect $authenticationRedirect, ConnectCompanyModuleToExchangeCompany $connectCompanyModuleToExchangeCompany)
{
$this->canAuthenticateUser = $canAuthenticateUser;
$this->authenticatesUser = $authenticatesUser;
$this->generatesAuthenticationToken = $generatesAuthenticationToken;
$this->fetchesUser = $fetchesUser;
$this->authenticationRedirect = $authenticationRedirect;
$this->connectCompanyModuleToExchangeCompany = $connectCompanyModuleToExchangeCompany;
}
/**
* @param Request $request
* @return array
* @throws \App\Classes\Exceptions\AccessForbiddenException
* @throws \App\Classes\Exceptions\AccessUnauthorisedException
* @throws \App\Classes\Exceptions\RequestValidationException
*/
public function execute(Request $request): array {
$object = new AuthenticationCredentialsObject($request->input('email'), $request->input('password'));
$this->canAuthenticateUser->passes($object);
$this->authenticatesUser->execute($object);
$user = $this->fetchesUser->execute(['email' => $object->getEmail()]);
$companyModule = $user->companyModule()->first();
$this->connectCompanyModuleToExchangeCompany->execute($companyModule, $request->route('exchange_company_id'));
return ['shipping_company_module_id' => $companyModule->id];
}
}
@@ -20,7 +20,7 @@ class AssignsCompanyConnectionToConnectionSegment extends AbstractUpdateRecord
{
try {
$companyConnection->segments()->attach($segment);
$companyConnection->segments()->attach($segment, ['created_at' => now(), 'updated_at' => now()]);
return $companyConnection;
@@ -22,7 +22,7 @@ class AssignsCompanyToSegment extends AbstractUpdateRecord
try {
$companyModule = $company->companyModules()->where('type', BusinessType::IMPORTER)->first();
$connection = $companyModule->connections()->where('inviter_reference', 'CIEF');
$connection->segments()->attach($segment);
$connection->segments()->attach($segment, ['created_at' => now(), 'updated_at' => now()]);
return $company;
@@ -18,7 +18,7 @@ class AssignsEmployee extends AbstractUpdateRecord
{
try {
$object->getCompanyModule()->employees()->attach($object->getUser(), ['status' => $object->getStatus(),'role_id' => $object->getRoleId()]);
$object->getCompanyModule()->employees()->attach($object->getUser(), ['status' => $object->getStatus(), 'role_id' => $object->getRoleId(), 'created_at' => now(), 'updated_at' => now()]);
return $object->getCompanyModule();
@@ -0,0 +1,25 @@
<?php
namespace App\Classes\Modules\Companies\Services;
use App\Classes\Exceptions\MalformedRequestException;
use App\Classes\General\Eloquent\AbstractUpdateRecord;
use App\Models\CompanyModule;
use App\Models\ExchangeCompanyConnection;
class ConnectCompanyModuleToExchangeCompany extends AbstractUpdateRecord
{
/**
* @param Company $company
* @return \Illuminate\Database\Eloquent\Model
* @throws MalformedRequestException
*/
public function execute(CompanyModule $companyModule, $exchangeCompanyId)
{
$model = new ExchangeCompanyConnection();
$model->company_module_id = $companyModule->id;
$model->exchange_company_id = $exchangeCompanyId;
return $this->handler($model);
}
}
@@ -8,6 +8,7 @@ use App\Classes\Modules\Contacts\Services\UpdatesContact;
use App\Classes\Modules\Contacts\DataTransferObjects\ContactObject;
use App\Classes\Modules\Contacts\Services\FetchesContact;
use App\Http\Resources\ContactResource;
use App\Transformers\ContactTransformer;
use ErrorException;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
@@ -63,6 +64,13 @@ class UpdateContactLogic extends AbstractControllerLogic
$query = $this->updatesContact->execute($query, $object);
/*uniformity*/
/* return fractal()
->item($query, new ContactTransformer())
->parseIncludes('remark')
->respond(200, [], JSON_PRETTY_PRINT);*/
return $this->resourceResponse(new ContactResource($query));
}
@@ -7,6 +7,7 @@ use App\Classes\Modules\Orders\Services\CancelsOrder;
use App\Classes\Modules\Orders\Services\FetchesOrder;
use App\Http\Resources\DeliveryOrderResource;
use App\Models\Order;
use App\Transformers\DeliveryOrderTransformer;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
@@ -52,6 +53,14 @@ class CancelDeliveryOrderLogic extends AbstractControllerLogic
/** @var Order $order */
$order = $this->fetchesOrder->execute(['id' => $request->route('id')]);
$order = $this->cancelsOrder->execute($order);
//no relationship needed
/* return fractal()
->item($order, new DeliveryOrderTransformer())
->respond(200, [], JSON_PRETTY_PRINT);*/
return $this->resourceResponse(new DeliveryOrderResource($this->cancelsOrder->execute($order)));
}
@@ -172,6 +172,12 @@ class CreateDeliveryOrderLogic extends AbstractControllerLogic
$packageObject = new PackageObject($request->input('packing_list.type'), $request->input('packing_list.description'), (float) 1, (float) 1, (float) 1, $request->input('packing_list.weight'), (float) $request->input('packing_list.quantity'), ApprovalStatus::APPROVED);
$this->createsPackage->execute($packageObject, $packingList);
//add relationship to order
/* return fractal()
->item($order, new DeliveryOrderTransformer())
->parseIncludes(['sender_address', 'delivery_address', 'sender_address.contacts', 'delivery_address.contacts', 'sender_address.remarks', 'delivery_address.remarks', 'packing_list', 'packing_list.packages'])
->respond(200, [], JSON_PRETTY_PRINT);*/
return $this->resourceResponse(new DeliveryOrderResource($order));
}
@@ -48,6 +48,12 @@ class ListOrdersLogic extends AbstractControllerLogic
$query = $this->listsOrders->execute(array_merge($this->listsOrders->deserializeFilters($request->input('filters')), ['with_parcels' => true, 'type_in' => [OrderType::LAST_MILE_DELIVERY]]));
//no relationship needed
/* return fractal()
->collection($query, new DeliveryOrderTransformer)
->respond(200, [], JSON_PRETTY_PRINT);*/
return $this->collectionResponse(DeliveryOrderResource::collection($query));
}
@@ -7,9 +7,13 @@ use App\Classes\General\Abstracts\AbstractControllerLogic;
use App\Classes\Modules\Documents\Services\ListsDocuments;
use App\Classes\Modules\Documents\Standards\Rules\CanListDocuments;
use App\Http\Resources\DocumentResource;
use App\Models\Document;
use App\Transformers\DocumentTransformer;
use ErrorException;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use League\Fractal;
class ListDocumentLogic extends AbstractControllerLogic
{
@@ -58,6 +62,11 @@ class ListDocumentLogic extends AbstractControllerLogic
return $this->collectionResponse(DocumentResource::collection($query));
/* return fractal()
->collection($query, new DocumentTransformer)
->respond(200, [], JSON_PRETTY_PRINT);*/
}
}
@@ -5,6 +5,7 @@ namespace App\Classes\Modules\Documents\Services;
use App\Classes\General\Eloquent\AbstractUpdateRecord;
use App\Classes\ValueObjects\Constants\ApprovalStatus;
use App\Models\Document;
use App\Models\User;
use Carbon\Carbon;
class ApprovesDocument extends AbstractUpdateRecord
@@ -17,8 +18,19 @@ class ApprovesDocument extends AbstractUpdateRecord
*/
public function execute(Document $model)
{
$user = Auth()->user();
// if auth user is null, then this services is calling from exchange
if (!$user) {
$token = explode('.', request()->bearerToken())[1];
$decodedToken = base64_decode($token);
$exchangeUser = json_decode($decodedToken, true)['user'];
$user = User::where('email', $exchangeUser['email'])->first();
if (!$user) {
$user = User::find(1);
}
}
$model->status = ApprovalStatus::APPROVED;
$model->approver = Auth()->user()->id;
$model->approver = $user->id;
$model->approval_date = Carbon::now();
return $this->handler($model);
@@ -5,7 +5,10 @@ namespace App\Classes\Modules\Documents\Services;
use App\Classes\General\Eloquent\AbstractUpdateRecord;
use App\Classes\ValueObjects\Constants\ApprovalStatus;
use App\Models\Document;
use App\Models\User;
use Carbon\Carbon;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Log;
class RejectsDocument extends AbstractUpdateRecord
{
@@ -17,8 +20,19 @@ class RejectsDocument extends AbstractUpdateRecord
*/
public function execute(Document $model)
{
$user = Auth()->user();
// if auth user is null, then this services is calling from exchange
if (!$user) {
$token = explode('.', request()->bearerToken())[1];
$decodedToken = base64_decode($token);
$exchangeUser = json_decode($decodedToken, true)['user'];
$user = User::where('email', $exchangeUser['email'])->first();
if (!$user) {
$user = User::find(1);
}
}
$model->status = ApprovalStatus::REJECTED;
$model->approver = Auth()->user()->id;
$model->approver = $user->id;
$model->approval_date = Carbon::now();
return $this->handler($model);
@@ -24,8 +24,8 @@ class ExportsAgingList implements WithHeadings, WithHeadingRow, WithMapping, Sho
{
$this->filters = [
"has_invoice_status_in" => [2],
"packing_list_ordered_by_invoice_date" => true,
"with_aging_column" => true
// "packing_list_ordered_by_invoice_date" => true,
// "with_aging_column" => true
];
}
@@ -39,6 +39,7 @@ class ExportsAgingList implements WithHeadings, WithHeadingRow, WithMapping, Sho
'Invoice Date',
'Days',
'Amount',
'Credit Term Customer',
];
}
@@ -55,9 +56,16 @@ class ExportsAgingList implements WithHeadings, WithHeadingRow, WithMapping, Sho
$invDate = 'n/a';
$invNo = 'n/a';
$days = 'n/a';
$isCreditTermCustomer = false;
if ($list->owner instanceof Order) {
$inviterPivotInviteeReference = $list->owner->companyModule->inviters()->withPivot('invitee_reference')->first();
$companyModule = $list->owner->companyModule;
$segment = $companyModule->connections()->first()->segments()->where('name', 'Credit Term Customer')->first();
if ($segment) {
$isCreditTermCustomer = true;
}
if ($inviterPivotInviteeReference) {
$marking = $inviterPivotInviteeReference->pivot->invitee_reference;
@@ -87,6 +95,7 @@ class ExportsAgingList implements WithHeadings, WithHeadingRow, WithMapping, Sho
$invDate,
$days,
$amt,
$isCreditTermCustomer ? 'TRUE' : 'FALSE',
];
}
@@ -0,0 +1,108 @@
<?php
namespace App\Classes\Modules\Exports\Services;
use App\Classes\ValueObjects\Constants\PaymentMethodType;
use App\Classes\ValueObjects\Constants\TransactionType;
use App\Classes\ValueObjects\Constants\ApprovalStatus;
use App\Models\Group;
use App\Models\Transaction;
use Maatwebsite\Excel\Concerns\Exportable;
use Maatwebsite\Excel\Concerns\FromQuery;
use Maatwebsite\Excel\Concerns\ShouldAutoSize;
use Maatwebsite\Excel\Concerns\WithHeadingRow;
use Maatwebsite\Excel\Concerns\WithHeadings;
use Maatwebsite\Excel\Concerns\WithMapping;
use Illuminate\Http\Request;
use Carbon\Carbon;
class ExportsGroupTransactions implements
FromQuery,
WithHeadings,
WithHeadingRow,
WithMapping,
ShouldAutoSize
{
use Exportable;
private $request;
public function __construct(Request $request)
{
$this->request = $request;
}
public function headings(): array
{
return [
'DocNo',
'DocDate',
'PaymentDate',
'DebtorCode',
'Ref',
'ShipInfo',
'AccNo',
'DetailDescription',
'FurtherDescription',
'ProjNo',
'DeptNo',
'Qty',
'UnitPrice',
'TaxType',
'TaxableAmt',
'TaxRate'
];
}
public function query()
{
$start_date = $this->parseDate($this->request->input('startDate'));
$end_date = $this->parseDate($this->request->input('endDate'));
return Group::when($start_date && $end_date, function ($query) use ($start_date, $end_date) {
$query->whereBetween('created_at', [
$start_date->startOfDay(),
$end_date->endOfDay()
]);
})
->when($start_date && !$end_date, function ($query) use ($start_date) {
$query->where('created_at', '>=', $start_date->startOfDay());
})
->when(!$start_date && $end_date, function ($query) use ($end_date) {
$query->where('created_at', '<=', $end_date->endOfDay());
});
}
private function parseDate($date)
{
return $date ? Carbon::parse($date)->startOfDay() : null;
}
public function map($transaction): array
{
$company = $transaction->receiverCompany;
return [
'<<New>>', //'DocNo',
'', //'DocDate',
$transaction->created_at->format('m/d/Y H:m'), //'PaymentDate',
$company->debtor, //'DebtorCode',
$company->referece, //'Ref',
$company->referece, //'ShipInfo',
'500-0000', //'AccNo',
'X1 Freight Service Charge', //'DetailDescription',
'FurtherDescription', //'FurtherDescription',
'M3', //'ProjNo',
'CIEF', //'DeptNo',
'', //'Qty',
'', //'UnitPrice',
'', //'TaxType',
floatval($transaction->tax) > 0 ? number_format($transaction->tax, 2) : '0.00', //'TaxableAmt',
'', //'TaxRate'
];
}
private function getTaxType($tax_percentage)
{
return floatval($tax_percentage) > 0 ? 'SV-6' : '';
}
}
@@ -156,7 +156,7 @@ class ExportsPaymentTransactions implements FromQuery, WithHeadings, WithHeading
$detail->quantity,
$detail->price,
floatval($detail->tax_percentage) > 0 ? 'SV-6' : '',
floatval($detail->tax_percentage) > 0 ? $detail->amount : '0',
floatval($detail->tax_percentage) > 0 ? number_format($detail->amount, 2) : '0.00',
$detail->tax_percentage,
];
@@ -5,7 +5,6 @@ namespace App\Classes\Modules\Exports\Services;
use App\Classes\ValueObjects\Constants\ApprovalStatus;
use App\Classes\ValueObjects\Constants\PackingListType;
use App\Models\Order;
use App\Models\State;
use Maatwebsite\Excel\Concerns\Exportable;
use Maatwebsite\Excel\Concerns\FromQuery;
use Maatwebsite\Excel\Concerns\WithHeadingRow;
@@ -32,10 +31,8 @@ class ExportsWarehousePackingList implements FromQuery, WithHeadings, WithHeadin
*/
public function query()
{
$johor_state_id = State::where('name', 'johor')->first()->id;
return Order::whereHas('addresses', function($address) use ($johor_state_id){
$address->where('status', ApprovalStatus::APPROVED)->where('state_id', $johor_state_id);
return Order::whereHas('addresses', function($address) {
$address->where('status', ApprovalStatus::APPROVED);
})->whereHas('packingLists', function($packingLists) {
$packingLists->where('type', PackingListType::SHIPPING_PACKING_LIST)->whereDoesntHave('transports');
});
@@ -6,6 +6,7 @@ use App\Classes\General\Abstracts\AbstractControllerLogic;
use App\Classes\Modules\Orders\Processors\ApproveChangeOrderAddressProcessor;
use App\Http\Resources\AddressResource;
use App\Http\Resources\OrderResource;
use App\Transformers\AddressTransformer;
use Illuminate\Http\Request;
use Illuminate\Http\JsonResponse;
@@ -39,6 +40,12 @@ class ApproveChangeOrderAddressLogic extends AbstractControllerLogic
{
$address = $this->approveChangeOrderAddressProcessor->execute($request);
//load address with no relationships
/* return fractal()
->item($address, new AddressTransformer())
->respond(200, [], JSON_PRETTY_PRINT);*/
return $this->resourceResponse(new AddressResource($address));
}
}
@@ -4,14 +4,25 @@ namespace App\Classes\Modules\Orders\ControllersLogic;
use App\Classes\Exceptions\RequestValidationException;
use App\Classes\General\Abstracts\AbstractControllerLogic;
use App\Classes\Modules\Addresses\DataTransferObjects\AddressObject;
use App\Classes\Modules\Addresses\Services\CreatesAddress;
use App\Classes\Modules\Accounts\DataTransferObjects\KeyValuePairObject;
use App\Classes\Modules\Addresses\Services\FetchesAddress;
use App\Classes\Modules\Companies\Services\FetchesCompany;
use App\Classes\Modules\Companies\Services\FetchesCompanyModule;
use App\Classes\Modules\Orders\Processors\ConnectOrderToExchangeBookingOnExchangeProcessor;
use App\Classes\Modules\PerfexCRM\Processors\NewLeadTaskToPerfexCRMProcessor;
use App\Classes\Modules\Orders\Processors\CreateOrderProcessor;
use App\Classes\Modules\Orders\Services\ConnectOrderToExchangeBooking;
use App\Classes\Modules\Orders\Services\GeneratesOrderNumber;
use App\Classes\ValueObjects\Constants\AddressType;
use App\Classes\ValueObjects\Constants\ApprovalStatus;
use App\Classes\Modules\Addresses\Standards\Rules\CanCreateAddress;
use App\Models\Address;
use App\Classes\Modules\Accounts\Services\CreatesKeyValuePair;
use App\Classes\ValueObjects\Constants\WarehouseReferences;
use App\Http\Resources\OrderResource;
use App\Models\Order;
use Illuminate\Http\Request;
use Illuminate\Http\JsonResponse;
@@ -41,8 +52,25 @@ class CreateOrderLogic extends AbstractControllerLogic
/** @var GeneratesOrderNumber */
private $generatesOrderNumber;
/** @var CreatesAddress */
private $createsAddress;
/** @var CanCreateAddress */
private $canCreateAddress;
/** @var NewLeadTaskToPerfexCRMProcessor */
private $newLeadTaskToPerfexCRMProcessor;
/** @var ConnectOrderToExchangeBooking */
private $connectOrderToExchangeBooking;
/** @var ConnectOrderToExchangeBookingOnExchangeProcessor */
private $connectOrderToExchangeBookingOnExchangeProcessor;
/** @var CreatesKeyValuePair */
private $createsKeyValuePair;
/**
* CreateOrderLogic constructor.
* @param FetchesCompany $fetchesCompany
@@ -51,8 +79,10 @@ class CreateOrderLogic extends AbstractControllerLogic
* @param FetchesCompanyModule $fetchesCompanyModule
* @param GeneratesOrderNumber $generatesOrderNumber
* @param NewLeadTaskToPerfexCRMProcessor $newLeadTaskToPerfexCRMProcessor
* @param ConnectOrderToExchangeBooking $connectOrderToExchangeBooking
* @param ConnectOrderToExchangeBookingOnExchangeProcessor $connectOrderToExchangeBookingOnExchangeProcessor
*/
public function __construct(FetchesCompany $fetchesCompany, FetchesAddress $fetchesAddress, CreateOrderProcessor $createOrderProcessor, FetchesCompanyModule $fetchesCompanyModule, GeneratesOrderNumber $generatesOrderNumber, NewLeadTaskToPerfexCRMProcessor $newLeadTaskToPerfexCRMProcessor)
public function __construct(FetchesCompany $fetchesCompany, FetchesAddress $fetchesAddress, CreateOrderProcessor $createOrderProcessor, FetchesCompanyModule $fetchesCompanyModule, GeneratesOrderNumber $generatesOrderNumber, NewLeadTaskToPerfexCRMProcessor $newLeadTaskToPerfexCRMProcessor, ConnectOrderToExchangeBooking $connectOrderToExchangeBooking, ConnectOrderToExchangeBookingOnExchangeProcessor $connectOrderToExchangeBookingOnExchangeProcessor, CreatesKeyValuePair $createsKeyValuePair)
{
$this->fetchesCompany = $fetchesCompany;
$this->fetchesAddress = $fetchesAddress;
@@ -60,12 +90,18 @@ class CreateOrderLogic extends AbstractControllerLogic
$this->fetchesCompanyModule = $fetchesCompanyModule;
$this->generatesOrderNumber = $generatesOrderNumber;
$this->newLeadTaskToPerfexCRMProcessor = $newLeadTaskToPerfexCRMProcessor;
$this->connectOrderToExchangeBooking = $connectOrderToExchangeBooking;
$this->connectOrderToExchangeBookingOnExchangeProcessor = $connectOrderToExchangeBookingOnExchangeProcessor;
$this->createsKeyValuePair = $createsKeyValuePair;
}
public function logic(Request $request): JsonResponse
{
$isTermsAgreed = $request->input('is_terms_agree');
if(!$isTermsAgreed){
throw new RequestValidationException('You must read and agree to our terms and conditions to proceed');
}
$company = $this->fetchesCompany->execute(['id' => $request->input('company_id')]);
@@ -91,12 +127,32 @@ class CreateOrderLogic extends AbstractControllerLogic
throw new RequestValidationException('Our Yiwu warehouse is unable to ship goods to Sabah & Sarawak at the moment. you can select our Guangzhou warehouse as an alternative.');
}
/** @var Order $order */
$order = $this->createOrderProcessor->execute($company, $originWarehouse, $address, $this->generatesOrderNumber->execute());
$keyValuePairObject = new KeyValuePairObject(
"TERMS_AND_CONDITIONS",
$isTermsAgreed
);
$this->createsKeyValuePair->execute($order, $keyValuePairObject);
if(config('perfexcrm.is_enabled') == 'true'){
$this->newLeadTaskToPerfexCRMProcessor->execute($company);
}
$token = explode('.', $request->bearerToken())[1];
$decodedToken = base64_decode($token);
$exchangeUser = json_decode($decodedToken, true)['user'];
$exchangeBookingId = null;
if (isset($exchangeUser['exchange_booking_id']) && $exchangeUser['exchange_booking_id']) {
$exchangeBookingId = $exchangeUser['exchange_booking_id'];
}
if ($exchangeBookingId) {
$this->connectOrderToExchangeBooking->execute($order, $exchangeBookingId);
$this->connectOrderToExchangeBookingOnExchangeProcessor->execute($request, $order->id, $exchangeBookingId);
}
return $this->resourceResponse(new OrderResource($order));
}
}
@@ -0,0 +1,48 @@
<?php
namespace App\Classes\Modules\Orders\Processors;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\App;
use Illuminate\Support\Facades\Log;
class ConnectOrderToExchangeBookingOnExchangeProcessor
{
/**
* @param Request $request
* @return string
* @throws \App\Classes\Exceptions\AccessForbiddenException
* @throws \App\Classes\Exceptions\MalformedRequestException
* @throws \App\Classes\Exceptions\RequestValidationException
*/
public function execute(Request $request, $orderId, $exchangeBookingId) {
if (App::environment(['production'])) {
dd("Delete this line before push to production");
$url = "https://exchange.cief-malaysia.com/api/v1/shipping/order/{$orderId}/booking/{$exchangeBookingId}/connect";
} else if (App::environment(['local'])) {
$url = "http://127.0.0.1:8000/api/v1/shipping/order/{$orderId}/booking/{$exchangeBookingId}/connect";
} else {
$url = "https://dev.exchange.cief-malaysia.com/api/v1/shipping/order/{$orderId}/booking/{$exchangeBookingId}/connect";
}
try {
$client = new \GuzzleHttp\Client(['verify' => false]);
$token = $request->bearerToken();
$headers = [
'Authorization' => 'Bearer ' . $token,
'Accept' => 'application/json',
];
$formParams = $request->toArray();
$response = $client->request('POST', $url, [
'headers' => $headers,
'form_params' => $formParams
]);
$body = $response->getBody();
$contents = json_decode($body, true);
return $contents;
} catch(\GuzzleHttp\Exception\RequestException $exception){
Log::error($exception->getResponse()->getBody()->getContents());
}
}
}
@@ -67,7 +67,7 @@ class CreateOrderProcessor
* @param CompanyModule $originWarehouse
* @param Address $address
* @param int|null $orderNumber
* @return Addressable
* @return Order
* @throws \App\Classes\Exceptions\AccessForbiddenException
* @throws \App\Classes\Exceptions\MalformedRequestException
* @throws \App\Classes\Exceptions\RequestValidationException
@@ -0,0 +1,25 @@
<?php
namespace App\Classes\Modules\Orders\Services;
use App\Classes\Exceptions\MalformedRequestException;
use App\Classes\General\Eloquent\AbstractUpdateRecord;
use App\Models\ExchangeBookingOrder;
use App\Models\Order;
class ConnectOrderToExchangeBooking extends AbstractUpdateRecord
{
/**
* @param Order $order
* @return \Illuminate\Database\Eloquent\Model
* @throws MalformedRequestException
*/
public function execute(Order $order, $exchangeBookingId)
{
$model = new ExchangeBookingOrder();
$model->order_id = $order->id;
$model->exchange_booking_id = $exchangeBookingId;
return $this->handler($model);
}
}
@@ -6,6 +6,7 @@ use App\Classes\General\Abstracts\AbstractControllerLogic;
use App\Classes\Modules\PackingLists\Services\Containers\FetchesContainer;
use App\Classes\Modules\PackingLists\Services\FetchesPackingList;
use App\Http\Resources\ContainerResource;
use App\Transformers\ContainerTransformer;
use ErrorException;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
@@ -53,9 +54,16 @@ class AssignPackingListContainerLogic extends AbstractControllerLogic
foreach ($packing_list as $key => $row) {
$packing_list_item = $this->fetchesPackingList->execute(['id' => $row]);
$container->packingLists()->attach($packing_list_item);
$container->packingLists()->attach($packing_list_item, ['created_at' => now(), 'updated_at' => now()]);
}
//only return with packing list relationship
/* return fractal()
->item($container, new ContainerTransformer())
->parseInclude(['packingLists'])
->respond(200, [], JSON_PRETTY_PRINT);*/
return $this->resourceResponse(new ContainerResource($container));
} catch (\Exception $exception){
@@ -8,6 +8,7 @@ use App\Classes\Modules\PackingLists\Services\Containers\FetchesContainer;
use App\Classes\ValueObjects\Constants\ApprovalStatus;
use App\Http\Resources\ContainerResource;
use App\Transformers\ContainerTransformer;
use ErrorException;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
@@ -19,7 +20,8 @@ class CompleteContainerLogic extends AbstractControllerLogic
/**
* @return array
*/
protected function notification():array {
protected function notification(): array
{
return [
'title' => 'Updated Container',
'message' => 'You have successfully updated the Container'
@@ -51,10 +53,16 @@ class CompleteContainerLogic extends AbstractControllerLogic
* @return JsonResponse
* @throws ErrorException
*/
public function logic(Request $request) : JsonResponse
public function logic(Request $request): JsonResponse
{
$container = $this->fetchesContainer->execute(['id' => $request->route('id')]);
$query = $this->updatesContainerStatus->execute($container, ApprovalStatus::COMPLETED);
//no relationships needed
/* return fractal()
->item($container, new ContainerTransformer())
->respond(200, [], JSON_PRETTY_PRINT);*/
return $this->resourceResponse(new ContainerResource($container));
}
@@ -11,6 +11,7 @@ use App\Classes\Modules\PackingLists\DataTransferObjects\ContainerObject;
use App\Classes\Modules\PackingLists\Services\FetchesPackingList;
use App\Http\Resources\ContainerResource;
use App\Transformers\ContainerTransformer;
use ErrorException;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
@@ -70,6 +71,11 @@ class CreateContainerLogic extends AbstractControllerLogic
$query = $this->createsContainer->execute($object, $this->fetchesCompanyModule->execute(['id' => $request->input('company_module_id')]));
//no relationship needed
/* return fractal()
->item($query, new ContainerTransformer())
->respond(200, [], JSON_PRETTY_PRINT);*/
return $this->resourceResponse(new ContainerResource($query));
}
@@ -8,6 +8,7 @@ use App\Classes\Modules\PackingLists\Services\Containers\FetchesContainer;
use App\Classes\Modules\Remarks\DataTransferObjects\RemarkObject;
use App\Classes\Modules\Remarks\Processors\CreateRemarkProcessor;
use App\Http\Resources\ContainerResource;
use App\Transformers\ContainerTransformer;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
@@ -18,7 +19,8 @@ class CreateContainerRemarkLogic extends AbstractControllerLogic
/**
* @return array
*/
protected function notification():array {
protected function notification(): array
{
return [
'title' => 'Created Container Remark',
'message' => 'You have successfully created a new Container Remark'
@@ -50,7 +52,7 @@ class CreateContainerRemarkLogic extends AbstractControllerLogic
* @throws \App\Classes\Exceptions\MalformedRequestException
* @throws \App\Classes\Exceptions\RequestValidationException
*/
public function logic(Request $request) : JsonResponse
public function logic(Request $request): JsonResponse
{
$container = $this->fetchesContainer->execute(['id' => $request->route('id')]);
@@ -59,6 +61,12 @@ class CreateContainerRemarkLogic extends AbstractControllerLogic
$this->createRemarkProcessor->execute($container, $object);
//load with remarks only
/* return fractal()
->item($container, new ContainerTransformer())
->parseIncludes(['remarks'])
->respond(200, [], JSON_PRETTY_PRINT);*/
return $this->resourceResponse(new ContainerResource($container));
}
@@ -17,6 +17,7 @@ use App\Classes\ValueObjects\Constants\TransportType;
use App\Classes\ValueObjects\Constants\ApprovalStatus;
use App\Http\Resources\ContainerResource;
use App\Transformers\ContainerTransformer;
use ErrorException;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
@@ -28,7 +29,8 @@ class CreateLoadContainerLogic extends AbstractControllerLogic
/**
* @return array
*/
protected function notification():array {
protected function notification(): array
{
return [
'title' => 'Created Container',
'message' => 'You have successfully created a new Container'
@@ -41,7 +43,7 @@ class CreateLoadContainerLogic extends AbstractControllerLogic
/** @var FetchesPackingList */
private $fetchesPackingList;
/** @var FetchesCompanyModule */
/** @var FetchesCompanyModule */
private $fetchesCompanyModule;
/** @var CreatesPackingList */
@@ -54,12 +56,12 @@ class CreateLoadContainerLogic extends AbstractControllerLogic
private $createsSchedule;
public function __construct(
CanCreateContainer $canCreateContainer,
FetchesPackingList $fetchesPackingList,
FetchesCompanyModule $fetchesCompanyModule,
CreatesContainer $createsContainer,
CreatesTransport $createsTransport,
CreatesSchedule $createsSchedule
CanCreateContainer $canCreateContainer,
FetchesPackingList $fetchesPackingList,
FetchesCompanyModule $fetchesCompanyModule,
CreatesContainer $createsContainer,
CreatesTransport $createsTransport,
CreatesSchedule $createsSchedule
)
{
$this->canCreateContainer = $canCreateContainer;
@@ -77,11 +79,11 @@ class CreateLoadContainerLogic extends AbstractControllerLogic
* @throws \App\Classes\Exceptions\MalformedRequestException
* @throws \App\Classes\Exceptions\RequestValidationException
*/
public function logic(Request $request) : JsonResponse
public function logic(Request $request): JsonResponse
{
$object = new ContainerObject(
$request->input('container_reference'),
$request->input('container_number'),
$request->input('container_reference'),
$request->input('container_number'),
$request->input('seal_reference'),
$request->input('container_type'),
ApprovalStatus::APPROVED
@@ -92,21 +94,27 @@ class CreateLoadContainerLogic extends AbstractControllerLogic
$container = $this->createsContainer->execute($object, $this->fetchesCompanyModule->execute(['id' => $request->input('company_module_id')]));
$transportObject = new TransportObject(
TransportType::LAND, null,
$request->input('tracking'),
Carbon::parse($request->input('etd')),
Carbon::parse($request->input('eta')),
TransportType::LAND, null,
$request->input('tracking'),
Carbon::parse($request->input('etd')),
Carbon::parse($request->input('eta')),
ApprovalStatus::APPROVED
);
$transport = $this->createsTransport->execute($transportObject, $container);
$scheduleObject = new ScheduleObject(
Carbon::parse($request->input('etd')),
Carbon::parse($request->input('etd')),
Carbon::parse($request->input('eta')),
ApprovalStatus::APPROVED
);
);
$schedule = $this->createsSchedule->execute($transport, $scheduleObject);
//include transport
/* return fractal()
->item($container, new ContainerTransformer())
->parseIncludes(['transport'])
->respond(200, [], JSON_PRETTY_PRINT);*/
return $this->resourceResponse(new ContainerResource($container));
}
@@ -7,6 +7,7 @@ use App\Classes\General\Abstracts\AbstractControllerLogic;
use App\Classes\Modules\PackingLists\Services\Containers\FetchesContainer;
use App\Classes\Modules\PackingLists\Standards\Rules\Containers\CanFetchContainer;
use App\Http\Resources\ContainerResource;
use App\Transformers\ContainerTransformer;
use ErrorException;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
@@ -17,7 +18,8 @@ class FetchContainerLogic extends AbstractControllerLogic
/**
* @return array
*/
protected function notification():array {
protected function notification(): array
{
return [
'title' => 'Retrieved Container',
'message' => 'You have successfully retrieved a Container'
@@ -48,12 +50,18 @@ class FetchContainerLogic extends AbstractControllerLogic
* @throws \App\Classes\Exceptions\AccessForbiddenException
* @throws \App\Classes\Exceptions\RequestValidationException
*/
public function logic(Request $request) : JsonResponse
public function logic(Request $request): JsonResponse
{
$this->canFetchContainer->passes();
$query = $this->fetchesContainer->execute(['id' => $request->route('id'), 'with_packing_lists' => true]);
//load with packing lists
/* return fractal()
->item($query, new ContainerTransformer())
->parseIncludes(['packing_lists'])
->respond(200, [], JSON_PRETTY_PRINT);*/
return $this->resourceResponse(new ContainerResource($query));
}
@@ -9,6 +9,7 @@ use App\Classes\Modules\PackingLists\Standards\Rules\Containers\CanListContainer
use App\Classes\Modules\PackingLists\Processors\FetchInboundCustomClearedProcessor;
use App\Http\Resources\ContainerResource;
use App\Transformers\ContainerTransformer;
use ErrorException;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
@@ -19,7 +20,8 @@ class InboundCustomClearedLogic extends AbstractControllerLogic
/**
* @return array
*/
protected function notification():array {
protected function notification(): array
{
return [
'title' => 'Retrieved Containers',
'message' => 'You have successfully retrieved a list of Containers'
@@ -52,11 +54,16 @@ class InboundCustomClearedLogic extends AbstractControllerLogic
* @return JsonResponse
* @throws ErrorException
*/
public function logic(Request $request) : JsonResponse
public function logic(Request $request): JsonResponse
{
$query = $this->fetchInboundCustomCleared->execute();
//no relations required
/* return fractal()
->item($query, new ContainerTransformer())
->respond(200, [], JSON_PRETTY_PRINT);*/
return $this->collectionResponse(ContainerResource::collection($query));
}
@@ -3,10 +3,14 @@
namespace App\Classes\Modules\PackingLists\ControllersLogic\Containers;
use App\Classes\Exceptions\AccessForbiddenException;
use App\Classes\Exceptions\MalformedRequestException;
use App\Classes\Exceptions\RequestValidationException;
use App\Classes\General\Abstracts\AbstractControllerLogic;
use App\Classes\Modules\PackingLists\Services\Containers\ListsContainers;
use App\Classes\Modules\PackingLists\Standards\Rules\Containers\CanListContainers;
use App\Http\Resources\ContainerResource;
use App\Transformers\ContainerTransformer;
use ErrorException;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
@@ -17,7 +21,8 @@ class ListContainersLogic extends AbstractControllerLogic
/**
* @return array
*/
protected function notification():array {
protected function notification(): array
{
return [
'title' => 'Retrieved Containers',
'message' => 'You have successfully retrieved a list of Containers'
@@ -45,16 +50,22 @@ class ListContainersLogic extends AbstractControllerLogic
/**
* @param Request $request
* @return JsonResponse
* @throws \App\Classes\Exceptions\AccessForbiddenException
* @throws \App\Classes\Exceptions\MalformedRequestException
* @throws \App\Classes\Exceptions\RequestValidationException
* @throws AccessForbiddenException
* @throws MalformedRequestException
* @throws RequestValidationException
*/
public function logic(Request $request) : JsonResponse
public function logic(Request $request): JsonResponse
{
$this->canListContainers->passes();
$query = $this->listsContainers->execute($this->listsContainers->deserializeFilters($request->input('filters')));
//load with no filters, a details page to be added to load one with all related data
/* return fractal()
->collection($query, new ContainerTransformer)
->respond(200, [], JSON_PRETTY_PRINT);*/
return $this->collectionResponse(ContainerResource::collection($query));
}
@@ -10,6 +10,7 @@ use App\Classes\Modules\Schedules\DataTransferObjects\ScheduleObject;
use App\Classes\ValueObjects\Constants\ApprovalStatus;
use App\Http\Resources\ContainerResource;
use App\Transformers\ContainerTransformer;
use ErrorException;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
@@ -20,7 +21,8 @@ class RescheduleContainerLogic extends AbstractControllerLogic
/**
* @return array
*/
protected function notification():array {
protected function notification(): array
{
return [
'title' => 'Reschedule Container',
'message' => 'You have successfully Reschedule Container'
@@ -54,7 +56,7 @@ class RescheduleContainerLogic extends AbstractControllerLogic
* @return JsonResponse
* @throws ErrorException
*/
public function logic(Request $request) : JsonResponse
public function logic(Request $request): JsonResponse
{
$container = $this->fetchesContainer->execute(['id' => $request->route('id')]);
$transport = $container->transports()->first();
@@ -3,12 +3,16 @@
namespace App\Classes\Modules\PackingLists\ControllersLogic\Containers;
use App\Classes\Exceptions\AccessForbiddenException;
use App\Classes\Exceptions\MalformedRequestException;
use App\Classes\Exceptions\RequestValidationException;
use App\Classes\General\Abstracts\AbstractControllerLogic;
use App\Classes\Modules\PackingLists\Services\Containers\UpdatesContainer;
use App\Classes\Modules\PackingLists\Services\Containers\FetchesContainer;
use App\Classes\Modules\PackingLists\Standards\Rules\Containers\CanUpdateContainer;
use App\Classes\Modules\PackingLists\DataTransferObjects\ContainerObject;
use App\Http\Resources\ContainerResource;
use App\Transformers\ContainerTransformer;
use ErrorException;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
@@ -19,7 +23,8 @@ class UpdateContainerLogic extends AbstractControllerLogic
/**
* @return array
*/
protected function notification():array {
protected function notification(): array
{
return [
'title' => 'Updated Container',
'message' => 'You have successfully updated the Container'
@@ -52,19 +57,19 @@ class UpdateContainerLogic extends AbstractControllerLogic
/**
* @param Request $request
* @return JsonResponse
* @throws \App\Classes\Exceptions\AccessForbiddenException
* @throws \App\Classes\Exceptions\MalformedRequestException
* @throws \App\Classes\Exceptions\RequestValidationException
* @throws AccessForbiddenException
* @throws MalformedRequestException
* @throws RequestValidationException
*/
public function logic(Request $request) : JsonResponse
public function logic(Request $request): JsonResponse
{
$container = $this->fetchesContainer->execute(['id' => $request->route('id')]);
$object = new ContainerObject(
$request->input('container_reference'),
$container->container_number,
$request->input('container_type'),
$object = new ContainerObject(
$request->input('container_reference'),
$container->container_number,
$request->input('container_type'),
$request->input('seal_reference'),
$request->input('loading_date'),
$container->status,
@@ -74,6 +79,12 @@ class UpdateContainerLogic extends AbstractControllerLogic
$query = $this->updatesContainer->execute($container, $object);
//no relationships
/*
return fractal()
->item($query, new ContainerTransformer())
->respond(200, [], JSON_PRETTY_PRINT);*/
return $this->resourceResponse(new ContainerResource($query));
}
@@ -6,6 +6,7 @@ use App\Classes\General\Abstracts\AbstractControllerLogic;
use App\Classes\Modules\Transports\Services\UpdatesDispatchDateTransport;
use App\Classes\Modules\PackingLists\Services\Containers\FetchesContainer;
use App\Http\Resources\ContainerResource;
use App\Transformers\ContainerTransformer;
use ErrorException;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
@@ -17,7 +18,8 @@ class UpdateDispatchDateContainerLogic extends AbstractControllerLogic
/**
* @return array
*/
protected function notification():array {
protected function notification(): array
{
return [
'title' => 'Updated Dispatch Date Container',
'message' => 'You have successfully updated the Dispatch Date Container'
@@ -49,11 +51,18 @@ class UpdateDispatchDateContainerLogic extends AbstractControllerLogic
* @return JsonResponse
* @throws ErrorException
*/
public function logic(Request $request) : JsonResponse
public function logic(Request $request): JsonResponse
{
$container = $this->fetchesContainer->execute(['id' => $request->route('id')]);
$transport = $container->transports()->first();
$query = $this->updatesDispatchDateTransport->execute($transport, Carbon::parse($request->input('dispatch_date')));
//no relationships queried
/* return fractal()
->item($query, new ContainerTransformer())
->respond(200, [], JSON_PRETTY_PRINT);*/
return $this->resourceResponse(new ContainerResource($container));
}
@@ -6,6 +6,7 @@ use App\Classes\General\Abstracts\AbstractControllerLogic;
use App\Classes\Modules\Transports\Services\UpdatesDropDateTransport;
use App\Classes\Modules\PackingLists\Services\Containers\FetchesContainer;
use App\Http\Resources\ContainerResource;
use App\Transformers\ContainerTransformer;
use ErrorException;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
@@ -17,7 +18,8 @@ class UpdateDropDateContainerLogic extends AbstractControllerLogic
/**
* @return array
*/
protected function notification():array {
protected function notification(): array
{
return [
'title' => 'Updated Drop Date Container',
'message' => 'You have successfully updated the Drop Date Container'
@@ -49,11 +51,17 @@ class UpdateDropDateContainerLogic extends AbstractControllerLogic
* @return JsonResponse
* @throws ErrorException
*/
public function logic(Request $request) : JsonResponse
public function logic(Request $request): JsonResponse
{
$container = $this->fetchesContainer->execute(['id' => $request->route('id')]);
$transport = $container->transports()->first();
$query = $this->updatesDropDateTransport->execute($transport, Carbon::parse($request->input('drop_date')));
//no relationship needed
/* return fractal()
->item($query, new ContainerTransformer())
->respond(200, [], JSON_PRETTY_PRINT);*/
return $this->resourceResponse(new ContainerResource($container));
}
@@ -14,6 +14,7 @@ use App\Classes\ValueObjects\Constants\OrderRoleTypes;
use App\Classes\ValueObjects\Constants\PackingListType;
use App\Http\Resources\DeliverPackingListResource;
use App\Transformers\DeliverPackingListTransformer;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
@@ -24,7 +25,8 @@ class CreateDeliverPackingListLogic extends AbstractControllerLogic
/**
* @return array
*/
protected function notification():array {
protected function notification(): array
{
return [
'title' => 'Created Deliver PackingList',
'message' => 'You have successfully created a new Deliver PackingList'
@@ -60,7 +62,7 @@ class CreateDeliverPackingListLogic extends AbstractControllerLogic
* @param Request $request
* @return JsonResponse
*/
public function logic(Request $request) : JsonResponse
public function logic(Request $request): JsonResponse
{
$company_module = $this->fetchesCompanyModule->execute(['id' => $request->input('company_module_id')]);
$packing_list_id = $request->input('packing_list_id');
@@ -68,9 +70,9 @@ class CreateDeliverPackingListLogic extends AbstractControllerLogic
$reference_number = $this->generatesPackingListReferenceNumber->execute();
$packingListObject = new PackingListObject(
$reference_number,
null,
PackingListType::DELIVERY_PACKING_LIST,
$reference_number,
null,
PackingListType::DELIVERY_PACKING_LIST,
ApprovalStatus::PENDING_SUBMISSION
);
@@ -82,6 +84,12 @@ class CreateDeliverPackingListLogic extends AbstractControllerLogic
$deliverPackingList->packing_list_owner()->sync($packing_list_id);
//no relationships required
/* return fractal()
->item($deliverPackingList, new DeliverPackingListTransformer())
->respond(200, [], JSON_PRETTY_PRINT);*/
return $this->resourceResponse(new DeliverPackingListResource($deliverPackingList));
}
@@ -129,7 +129,7 @@ class FetchContainersFromYdPortalProcessor
try {
$container = $this->fetchesContainer->execute(['reference' => $containerReference]);
$container->packingLists()->detach($packingList);
$container->packingLists()->attach($packingList);
$container->packingLists()->attach($packingList, ['created_at' => now(), 'updated_at' => now()]);
} catch (ResourceNotFoundException $exception){
if(!($packingList->owner instanceof Order)) continue;
@@ -143,7 +143,7 @@ class FetchContainersFromYdPortalProcessor
$container = $this->createContainerProcessor->execute($containerObject, $originWarehouse);
$container->packingLists()->detach($packingList);
$container->packingLists()->attach($packingList);
$container->packingLists()->attach($packingList, ['created_at' => now(), 'updated_at' => now()]);
if(config('perfexcrm.is_enabled') == 'true'){
$this->packingListToPerfexCRMProcessor->execute($packingList, PerfexCRMTasksYDStages::LOAD_CONTAINER);
@@ -274,7 +274,7 @@ class FetchLoadedContainersFromVTPortalProcessor
}
$container->packingLists()->detach($packingList);
$container->packingLists()->attach($packingList);
$container->packingLists()->attach($packingList, ['created_at' => now(), 'updated_at' => now()]);
$packingList->packages()->delete();
$replica = $packingList->packingLists()->where('type', PackingListType::SHIPPING_PACKING_LIST_REPLICA)->first();
@@ -385,7 +385,7 @@ class FetchOrderListsFromYdPortalProcessor
try {
$container = $this->fetchesContainer->execute(['reference' => $containerReference]);
$container->packingLists()->detach($packingList);
$container->packingLists()->attach($packingList);
$container->packingLists()->attach($packingList, ['created_at' => now(), 'updated_at' => now()]);
} catch (ResourceNotFoundException $exception){
if (!$allow_contract) {
@@ -129,9 +129,12 @@ class FetchPackingListsFromYdPortalProcessor
$rows = $this->fetchesDataFRomYDPortal->getResponseBody($orderRequest);
dump('Row Count: ' . count($rows->data));
if(!$rows->data) continue;
foreach($rows->data as $row){
dump($row);
if(!is_numeric($row->goodcount)) continue;
$time_start = microtime(true);
@@ -13,10 +13,14 @@ class RemarkObject implements DataTransferObject
/** @var string*/
private $content;
public function __construct(string $content, int $commenterID)
/** @var int|null */
private $type;
public function __construct(string $content, int $commenterID, int $type = null)
{
$this->commenterID = $commenterID;
$this->content = $content;
$this->type = $type;
}
/**
@@ -35,4 +39,12 @@ class RemarkObject implements DataTransferObject
return $this->content;
}
/**
* @return int|null
*/
public function getType(): ?int
{
return $this->type;
}
}
@@ -24,6 +24,7 @@ class CreatesRemark extends AbstractUpdateRelationshipRecord
$model->commenter_id = $object->getCommenterId();
$model->content = $object->getContent();
$model->type = $object->getType();
return $this->handler($remarkable->remarks(), $model);
@@ -0,0 +1,104 @@
<?php
namespace App\Classes\Modules\Transactions\ControllersLogic;
use App\Classes\Notifications\InvoiceIssuedEmail;
use Illuminate\Http\Request;
use Illuminate\Http\JsonResponse;
use Meneses\LaravelMpdf\Facades\LaravelMpdf;
use App\Classes\ValueObjects\Constants\DocumentType;
use App\Classes\ValueObjects\Constants\ApprovalStatus;
use App\Classes\ValueObjects\Constants\TransactionType;
use App\Classes\Modules\Documents\Services\CreatesFiles;
use App\Classes\General\Abstracts\AbstractControllerLogic;
use App\Classes\Modules\Documents\Services\CreatesDocument;
use App\Classes\Modules\Documents\DataTransferObjects\DocumentObject;
use App\Classes\Modules\PackingLists\Services\FetchesPackingList;
use App\Classes\Modules\Transactions\Services\UpdatesTransactionStatus;
use App\Classes\Modules\Transactions\ControllersLogic\Document;
class CreateCombinedInvoicesLogic extends AbstractControllerLogic
{
/**
* @return array
*/
protected function notification():array {
return [
'title' => 'Shipping Invoice Status',
'message' => 'You have successfully updated multiple shipping invoices status'
];
}
/** @var FetchesPackingList */
private $fetchesPackingList;
/** @var UpdatesTransactionStatus */
private $updatesTransactionStatus;
/** @var CreatesDocument */
private $createsDocument;
/** @var CreatesFiles */
private $createsFiles;
/**
* ApprovePaymentVerificationLogic constructor.
* @param FetchesPackingList $fetchesPackingList
* @param UpdatesTransactionStatus $updatesTransactionStatus
* @param CreatesDocument $createsDocument
* @param CreatesFiles $createsFiles
* @param CreateInvoiceTransactionProcessor $createInvoiceTransactionProcessor
*/
public function __construct(FetchesPackingList $fetchesPackingList, UpdatesTransactionStatus $updatesTransactionStatus, CreatesDocument $createsDocument, CreatesFiles $createsFiles)
{
$this->fetchesPackingList = $fetchesPackingList;
$this->updatesTransactionStatus = $updatesTransactionStatus;
$this->createsDocument = $createsDocument;
$this->createsFiles = $createsFiles;
}
/**
* @param Request $request
* @return JsonResponse
* @throws \App\Classes\Exceptions\MalformedRequestException
*/
public function logic(Request $request) : JsonResponse
{
$items = $request->input('ids');
$invoice_transactions=array();
foreach($items as $item){
$packing_list = $this->fetchesPackingList->execute(['id' => $item['id']]);
$invoice_transaction = $packing_list->transactions()->where('transactions.type', TransactionType::SHIPPING_INVOICE)->whereIn('status', [ApprovalStatus::PENDING_VERIFICATION, ApprovalStatus::PENDING_SUBMISSION])->first();
array_push($invoice_transactions, $invoice_transaction);
// $this->updatesTransactionStatus->execute($invoice_transaction, ApprovalStatus::APPROVED);
}
$transaction_invoice_pdf = LaravelMpdf::loadView('pages.pdfs.shipping_invoices_combined', ['invoice_transactions' => $invoice_transactions]);
$document_object = new DocumentObject(
DocumentType::SHIPPING_INVOICE,
[chunk_split('data:application/pdf;base64,'.base64_encode($transaction_invoice_pdf->output()))],
'',
ApprovalStatus::COMPLETED,
'shipping_invoice'
);
/** @var Document $document */
$document = $this->createsDocument->execute($invoice_transaction, $document_object);
$this->createsFiles->execute($document, $document_object);
$user = $packing_list->owner->companyModule->employees()->first();
if(app()->environment(['production'])) {
$user->notify(new InvoiceIssuedEmail($user, $packing_list));
}
return $this->response([]);
}
}
@@ -22,7 +22,7 @@ use App\Models\GroupTransaction;
use App\Http\Resources\WalletTransactionResource;
use App\Models\Wallet;
use App\Classes\Modules\Transactions\Processors\ReleaseGoodsToCustomerProcessor;
use Illuminate\Support\Facades\Log;
class CreateGroupsLogic extends AbstractControllerLogic
{
@@ -200,7 +200,9 @@ class CreateGroupsLogic extends AbstractControllerLogic
if (in_array($payment_method, [PaymentMethodType::PAYMENT_GATEWAY, PaymentMethodType::CASH])) {
// create only one billplz payment for wallet top up
$amount = floatval(str_replace(',', '', $reqAmount));
$amount2 = floatval(str_replace(',', '', $reqAmount));
Log::channel('storage_invoices')->info('CreateGroupsLogic reqAmount from client: ' .$amount2);
Log::channel('storage_invoices')->info('CreateGroupsLogic amount from backend: ' .$amount); //the real amount should always be from backend
$companyModuleId = $invoice->receiver;
$companyModule = $this->fetchesCompanyModule->execute(['id' => $companyModuleId]);
@@ -5,6 +5,7 @@ namespace App\Classes\Modules\Transactions\ControllersLogic;
use App\Classes\General\Abstracts\AbstractControllerLogic;
use App\Classes\Modules\Transactions\Services\ListsGroups;
use App\Http\Resources\GroupResource;
use App\Transformers\GroupTransformer;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
@@ -22,7 +23,8 @@ class ListGroupsLogic extends AbstractControllerLogic
/**
* @return array
*/
protected function notification():array {
protected function notification(): array
{
return [
'title' => 'Retrieved Groups',
'message' => 'You have successfully retrieved a list of groups'
@@ -32,10 +34,15 @@ class ListGroupsLogic extends AbstractControllerLogic
/** @var ListsGroups */
private $listsGroups;
public function logic(Request $request) : JsonResponse
public function logic(Request $request): JsonResponse
{
$query = $this->listsGroups->execute($this->listsGroups->deserializeFilters($request->input('filters')));
//no relationship needed
/* return fractal()
->collection($query, new GroupTransformer())
->respond(200, [], JSON_PRETTY_PRINT);*/
return $this->collectionResponse(GroupResource::collection($query));
}
@@ -32,7 +32,8 @@ class UpdateGroupLogic extends AbstractControllerLogic
/**
* @return array
*/
protected function notification():array {
protected function notification(): array
{
return [
'title' => 'Update Group Transaction',
'message' => 'You have successfully updated this Group Transaction'
@@ -86,7 +87,7 @@ class UpdateGroupLogic extends AbstractControllerLogic
* @return JsonResponse
* @throws \App\Classes\Exceptions\MalformedRequestException
*/
public function logic(Request $request) : JsonResponse
public function logic(Request $request): JsonResponse
{
$group = $this->fetchesGroup->execute(['id' => $request->route('id')]);
@@ -100,7 +101,7 @@ class UpdateGroupLogic extends AbstractControllerLogic
// $group->transactions()->update(['amount' => DB::raw('(original_amount * (1 / currency_rate)) + service_charge + tax')]);
foreach($transactions as $transaction) {
foreach ($transactions as $transaction) {
$constant = SegmentConstant::where('reference', SegmentConstants::SERVICE_CHARGE)->where('detail->id', $supplier->id)->first();
$serviceCharge = $this->calculatesTransactionServiceCharge->execute($transaction->original_amount, $rate, $constant);
@@ -169,7 +170,7 @@ class UpdateGroupLogic extends AbstractControllerLogic
$object = new DocumentObject(
DocumentType::CURRENCY_VENDOR_ORDER,
[chunk_split('data:application/pdf;base64,'.base64_encode($pdf->output()))],
[chunk_split('data:application/pdf;base64,' . base64_encode($pdf->output()))],
'',
ApprovalStatus::COMPLETED,
'currency_vendor_order'
@@ -179,6 +180,11 @@ class UpdateGroupLogic extends AbstractControllerLogic
$document = $this->createsDocument->execute($group, $object);
$this->createsFile->execute($document, $object);
//no relationship needed
/* return fractal()
->item($group, new GroupTransformer())
->respond(200, [], JSON_PRETTY_PRINT);*/
return $this->resourceResponse(new GroupResource($group));
}
@@ -4,6 +4,7 @@
namespace App\Classes\Modules\Transactions\Processors;
use App\Classes\Exceptions\MalformedRequestException;
use App\Classes\General\Eloquent\Filters\PaymentMethodType as FiltersPaymentMethodType;
use App\Classes\Modules\Orders\Services\FetchesOrder;
use App\Classes\Modules\Transactions\Services\GeneratesTransactionBillNumber;
use App\Classes\Modules\Transactions\Services\CreatesTransaction;
@@ -123,7 +124,7 @@ class CheckStorageInvoiceTransactionProcessor
$result = $this->processSingleTransactionOfTypeShippingInvoice($invoice_transaction, $packingList, $order->company_module_id, $eta);
}
else{
$result = $this->isPaidOrWaivedStorageInvoiceExist($invoice_transaction, $packingList, $eta);
$result = $this->isExistPaidOrWaivedStorageInvoice($invoice_transaction, $packingList, $eta);
}
if($result){
$results[] = $result;
@@ -205,8 +206,9 @@ class CheckStorageInvoiceTransactionProcessor
$price_cbm = $pricePerCBM * $cbm * $resultNumberOfDaysExceeded;
$dateToCompare = Carbon::parse(env('SST_START_DATE', '2024-04-01 00:00:00'));
Log::channel('storage_invoices')->info('dateToCompare: '.json_encode($dateToCompare));
if(!$storageInvoice && $resultNumberOfDaysExceeded > 0 && $transaction->status != ApprovalStatus::COMPLETED){
if(!$storageInvoice && $resultNumberOfDaysExceeded > 0 && $transaction->status !== ApprovalStatus::COMPLETED){
Log::channel('storage_invoices')->info('Created $transaction->id: '.$transaction->id);
$billNumber = $this->generatesTransactionBillNumber->execute('STOR-');
@@ -252,7 +254,7 @@ class CheckStorageInvoiceTransactionProcessor
$proceedToUpdate = false;
if(abs($price_cbm - $amount) > $epsilon && $storageInvoice->status !== ApprovalStatus::COMPLETED){
if(abs($price_cbm - $amount) > $epsilon && $storageInvoice->status !== ApprovalStatus::COMPLETED && !$this->isExistPendingVerificationManualPayment($storageInvoice)){
$paymentTransactions = $storageInvoice->transactions()->where('transactions.type', TransactionType::PAYMENT)->where('transactions.status', ApprovalStatus::PENDING_SUBMISSION)->get();
// if(!$isBackDoorCheck){
if(count($paymentTransactions) > 0){
@@ -294,7 +296,7 @@ class CheckStorageInvoiceTransactionProcessor
}
private function isPaidOrWaivedStorageInvoiceExist($transaction, $packingList, $eta){
private function isExistPaidOrWaivedStorageInvoice($transaction, $packingList, $eta){
$pricePerCBM = 3;
$resultNumberOfDaysFree = 10;
$dt1 = $eta->copy()->addDay()->startOfDay();
@@ -349,6 +351,21 @@ class CheckStorageInvoiceTransactionProcessor
return [];
}
private function isExistPendingVerificationManualPayment($storageInvoice){
$g = $storageInvoice->groups()->whereIn('status', [ApprovalStatus::PENDING_VERIFICATION, ApprovalStatus::COMPLETED, ApprovalStatus::SUSPENDED])->where('payment_method', PaymentMethodType::CASH)->latest('updated_at')->first();
Log::channel('storage_invoices')->info('group: ' .json_encode($g));
if($g){
$gr = $g->reference;
$manualPaymentTransaction =Transaction::where('payment_reference', $gr)->first();
Log::channel('storage_invoices')->info('manualPaymentTransaction: ' .json_encode($manualPaymentTransaction));
if($manualPaymentTransaction->status === ApprovalStatus::PENDING_SUBMISSION || $manualPaymentTransaction->status === ApprovalStatus::PENDING_VERIFICATION){
Log::channel('storage_invoices')->info('isExistPendingVerificationManualPayment');
return true;
}
}
return false;
}
private function updatePaymentTransactionViaGroupPayment($storageInvoice){
Log::channel('storage_invoices')->info('updatePaymentTransactionViaGroupPayment');
$groups = $storageInvoice->groups()->whereNotIn('status', [ApprovalStatus::COMPLETED, ApprovalStatus::SUSPENDED])->get();
@@ -362,7 +379,8 @@ class CheckStorageInvoiceTransactionProcessor
$this->updatesTransactionStatus->execute($walletTransaction, ApprovalStatus::EXPIRED);
if($walletTransaction->payment_reference){
$deletedBillplzBill = $this->deletesBillplzBill->execute($walletTransaction->payment_reference);
Log::channel('storage_invoices')->info('deletedBillplzBill TransactionType::WALLET: '.json_encode($deletedBillplzBill));
Log::channel('storage_invoices')->info('deletedBillplzBill with reference: '.$walletTransaction->payment_reference);
Log::channel('storage_invoices')->info('deletedBillplzBill return response: '.json_encode($deletedBillplzBill));
}
}
}
@@ -109,6 +109,7 @@ class CreateInvoiceTransactionProcessor
$base_price_constant = $this->fetchesSegmentConstant->execute(['segment_id' => 1, 'reference' => SegmentConstants::BASE_PRICE]);
$warehouse_rate_constant = $this->fetchesSegmentConstant->execute(['segment_id' => 1, 'reference' => SegmentConstants::WAREHOUSE_RATE]);
$state_rate_constant = $this->fetchesSegmentConstant->execute(['segment_id' => 1, 'reference' => SegmentConstants::STATE_RATE]);
Log::channel('priceCbmLog')->info(json_encode($state_rate_constant));
$center_postcode_constant = $this->fetchesSegmentConstant->execute(['segment_id' => 1, 'reference' => SegmentConstants::CENTER_POSTCODE]);
$outstation_postcode_constant = $this->fetchesSegmentConstant->execute(['segment_id' => 1, 'reference' => SegmentConstants::OUTSTATION_POSTCODE]);
@@ -136,13 +137,18 @@ class CreateInvoiceTransactionProcessor
$warehouse_rate = is_object($selected_warehouse_rate) ? $selected_warehouse_rate->amount : 0;
$stateId = $address->state_id;
Log::channel('priceCbmLog')->info('stateId: ' . $stateId);
$state_rate_constant = $this->getConstantByKey($state_rate_constant, $stateId);
Log::channel('priceCbmLog')->info('state_rate_constant: ' . json_encode($state_rate_constant));
// get $state_rate
$postcode = $address->postcode;
$this->checkPostcodeExistInConstant($center_postcode_constant, $postcode) === true ? $state_select = 'center' : '' ;
Log::channel('priceCbmLog')->info('state_select: ' . $state_select);
$this->checkPostcodeExistInConstant($outstation_postcode_constant, $postcode) === true ? $state_select = 'outstation' : '' ;
Log::channel('priceCbmLog')->info('state_select: ' . $state_select);
$state_rate_constant = (array)$state_rate_constant;
Log::channel('priceCbmLog')->info('state_rate_constant: ' . json_encode($state_rate_constant));
$state_rate = $state_select == '' ? 0 : $state_rate_constant[$state_select];
$container = $packing_list->containers()->first();
@@ -181,7 +187,13 @@ class CreateInvoiceTransactionProcessor
$minimum_charge = 0;
}
Log::channel('priceCbmLog')->info('$base_price: ' . $base_price);
Log::channel('priceCbmLog')->info('$segment_price: ' . $segment_price);
Log::channel('priceCbmLog')->info('$warehouse_rate: ' . $warehouse_rate);
Log::channel('priceCbmLog')->info('$state_rate: ' . $state_rate);
$price_cbm = $base_price + $segment_price + $warehouse_rate + $state_rate;
Log::channel('priceCbmLog')->info('$price_cbm: ' . $price_cbm);
Log::channel('priceCbmLog')->info('');
$total_cbm = $price_cbm * ($cbm + $minimum_charge + $over_weight_cbm);
@@ -21,6 +21,7 @@ use App\Classes\Modules\Orders\Processors\UpdateDoFromVTPortalProcessor;
use App\Classes\Modules\Orders\Processors\UpdateDoFromYDPortalProcessor;
use App\Classes\Modules\Transactions\Services\UpdatesTransactionStatus;
use Illuminate\Support\Facades\Log;
use App\Classes\Modules\Wallets\Processors\CreditWalletProcessor;
class CreatePaymentTransactionProcessor
{
@@ -49,6 +50,9 @@ class CreatePaymentTransactionProcessor
/** @var UpdatesTransactionStatus */
private $updatesTransactionStatus ;
/** @var CreditWalletProcessor */
private $creditWalletProcessor ;
/**
* @param FetchesTransaction $fetchesTransaction,
* @param GeneratesTransactionBillNumber $generatesTransactionBillNumber,
@@ -60,6 +64,7 @@ class CreatePaymentTransactionProcessor
* @param UpdateDoFromVTPortalProcessor $updateDoFromVTPortalProcessor
* @param UpdateDoFromYDPortalProcessor $updateDoFromYDPortalProcessor
* @param UpdatesTransactionStatus $updatesTransactionStatus
* @param CreditWalletProcessor $creditWalletProcessor
*/
public function __construct(
GeneratesTransactionBillNumber $generatesTransactionBillNumber,
@@ -69,6 +74,7 @@ class CreatePaymentTransactionProcessor
UpdatesWalletBalance $updatesWalletBalance,
UpdateDoFromVTPortalProcessor $updateDoFromVTPortalProcessor,
UpdateDoFromYDPortalProcessor $updateDoFromYDPortalProcessor,
CreditWalletProcessor $creditWalletProcessor,
UpdatesTransactionStatus $updatesTransactionStatus
)
{
@@ -79,6 +85,7 @@ class CreatePaymentTransactionProcessor
$this->updatesWalletBalance = $updatesWalletBalance;
$this->updateDoFromVTPortalProcessor = $updateDoFromVTPortalProcessor;
$this->updateDoFromYDPortalProcessor = $updateDoFromYDPortalProcessor;
$this->creditWalletProcessor = $creditWalletProcessor;
$this->updatesTransactionStatus = $updatesTransactionStatus;
}
@@ -174,6 +181,11 @@ class CreatePaymentTransactionProcessor
$payment_transaction = $this->createsPaymentTransaction->execute($invoice, $object);
// cief coins
if ($approvalStatus == ApprovalStatus::APPROVED) {
$wallet = $this->creditWalletProcessor->execute($company_module, transactionType::CIEF_COINS_CREDIT, $amount, 'Cief Coins Credit', 3); // TODO-cief-coins: pls confirm the reference
}
return $payment_transaction;
}
}
@@ -44,24 +44,33 @@ class ReleaseGoodsToCustomerProcessor
/**
* @param $packingList
* @param $invoice
* @param $processCompletedInvoices
* @throws \App\Classes\Exceptions\MalformedRequestException
*/
public function execute($packingList, $invoice = null)
public function execute($packingList, $invoice = null, $processCompletedInvoices = false)
{
$result = false;
$totalInvoicesAmountPaid = 0.00;
$totalInvoicesAmount = 0.00;
$invoiceTransactions = $packingList->transactions()->where('status', [ApprovalStatus::APPROVED])->whereIn('type', [TransactionType::SHIPPING_INVOICE, TransactionType::STORAGE_INVOICE])->get();
if($processCompletedInvoices){
//processCompletedInvoices, for manual processing of invoices, e.g. incomplete payment gateway finish with storage invoice
$invoiceTransactions = $packingList->transactions()->whereIn('status', [ApprovalStatus::APPROVED, ApprovalStatus::COMPLETED])->whereIn('type', [TransactionType::SHIPPING_INVOICE, TransactionType::STORAGE_INVOICE])->get();
}
else{
$invoiceTransactions = $packingList->transactions()->where('status', ApprovalStatus::APPROVED)->whereIn('type', [TransactionType::SHIPPING_INVOICE, TransactionType::STORAGE_INVOICE])->get();
}
//Part 1: Process each single invoice type and get the total of all invoices
//Part 1: Process each single invoice type and get the total of all invoices (STORAGE + SHIPPING)
foreach($invoiceTransactions as $invoiceTransaction){
$totalInvoiceAmountPaid = $invoiceTransaction->transactions->where('type', TransactionType::PAYMENT)->whereIn('status', [ApprovalStatus::APPROVED, ApprovalStatus::COMPLETED])->sum('amount');
if ($invoice && $invoice->type == $invoiceTransaction->type) {
if(($invoice->amount - $totalInvoiceAmountPaid) < 0.01){
Log::channel('storage_invoices')->info('ReleaseGoodsToCustomerProcessor updatesTransactionStatus');
$this->updatesTransactionStatus->execute($invoice, ApprovalStatus::COMPLETED);
if($invoice->type == TransactionType::STORAGE_INVOICE){
//cief todo: remove the following if block
if($invoice->type === TransactionType::STORAGE_INVOICE){
Log::channel('storage_invoices')->info('ReleaseGoodsToCustomerProcessor createStorageInvoiceDocTransactionProcessor');
$this->createStorageInvoiceDocTransactionProcessor->execute($packingList);
}
}
@@ -3,16 +3,12 @@
namespace App\Classes\Modules\Wallets\ControllersLogic;
use App\Classes\General\Abstracts\AbstractControllerLogic;
use App\Classes\Modules\Wallets\DataTransferObjects\WalletObject;
use App\Classes\Modules\Wallets\Services\ListsWallet;
use App\Classes\Modules\Wallets\Standards\Rules\CanListWallet;
use App\Http\Resources\WalletResource;
use ErrorException;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
use App\Classes\Modules\Wallets\Services\ListsWallets;
class ListWalletLogic extends AbstractControllerLogic
{
@@ -26,8 +22,8 @@ class ListWalletLogic extends AbstractControllerLogic
];
}
/** @var ListWallet */
private $listsWallet;
/** @var ListsWallets */
private $listsWallets;
/** @var CanCreateCompanyWallet */
private $canListWallet;
@@ -38,10 +34,10 @@ class ListWalletLogic extends AbstractControllerLogic
* @param GeneratesWalletCode $generatesWalletCode
* @param CanCreateCompanyWallet $canCreateCompanyWallet
*/
public function __construct(CanListWallet $canListWallet, ListsWallet $listsWallet)
public function __construct(CanListWallet $canListWallet, ListsWallets $listsWallets)
{
$this->canListWallet = $canListWallet;
$this->listsWallet = $listsWallet;
$this->listsWallets = $listsWallets;
}
/**
@@ -53,7 +49,7 @@ class ListWalletLogic extends AbstractControllerLogic
{
//$this->canListWallet->passes();
$query = $this->listsWallet->execute($this->listsWallet->deserializeFilters($request->input('filters')));
$query = $this->listsWallets->execute($this->listsWallets->deserializeFilters($request->input('filters')));
return $this->collectionResponse(WalletResource::collection($query));
}
@@ -79,19 +79,40 @@ class CreditWalletProcessor
* @return \Illuminate\Database\Eloquent\Model
* @throws \App\Classes\Exceptions\MalformedRequestException
*/
public function execute(CompanyModule $companyModule, int $transactionType, float $amount, string $reference)
public function execute(CompanyModule $companyModule, int $transactionType, float $amount, string $reference, ?int $currencyId = 1)
{
if (!$companyModule->wallets()->first()) {
$object = new WalletObject($companyModule->id, 1, $this->generatesWalletCode->execute());
/** @var Wallet $wallet */
$wallet = $companyModule->wallets()->where('currency_id', $currencyId)->first();
if (!$wallet) {
$object = new WalletObject($companyModule->id, $currencyId, $this->generatesWalletCode->execute());
$this->createsWallet->execute($object, $companyModule);
$wallet = $companyModule->wallets()->where('currency_id', $currencyId)->first();
}
/** @var Wallet $wallet */
$wallet = $companyModule->wallets()->first();
$billNumberPrefix = null;
$transaction_object_transaction_type = $transactionType;
switch ($transactionType) {
case TransactionType::PAYMENT:
$billNumberPrefix = 'DEBIT-NOTE-';
$transaction_object_transaction_type = TransactionType::DEBIT_NOTE;
break;
case TransactionType::CIEF_COINS_CREDIT:
$billNumberPrefix = 'COINS-CREDIT-'; // TODO-cief-coins: pls confirm the prefix
break;
case TransactionType::CIEF_COINS_DEBIT:
$billNumberPrefix = 'COINS-DEBIT-'; // TODO-cief-coins: pls confirm the prefix
break;
default:
$billNumberPrefix = 'CREDIT-NOTE-';
$transaction_object_transaction_type = TransactionType::CREDIT_NOTE;
break;
}
$billNumber = $this->generatesTransactionBillNumber->execute($transactionType === 2 ? 'DEBIT-NOTE-' : 'CREDIT-NOTE-');
$billNumber = $this->generatesTransactionBillNumber->execute($billNumberPrefix);
$transaction_object = new TransactionObject($billNumber, $transaction_object_transaction_type, 1, $wallet->owner->id, 1, PaymentMethodType::CASH, $amount, $amount, 1, 1, 1, 0, 0, null, ApprovalStatus::APPROVED, [], $reference);
$transaction_object = new TransactionObject($billNumber, $transactionType === 2 ? TransactionType::DEBIT_NOTE : TransactionType::CREDIT_NOTE, 1, $wallet->owner->id, 1, PaymentMethodType::CASH, $amount, $amount, 1, 1, 1, 0, 0, null, ApprovalStatus::APPROVED, [], $reference);
$transaction = $this->createsTransactionableTransaction->execute($wallet, $transaction_object);
$this->updatesWalletBalance->execute($wallet, $transaction->amount);
@@ -2,28 +2,31 @@
namespace App\Classes\Modules\Wallets\Services;
use Illuminate\Database\Eloquent\Builder;
use App\Classes\General\Eloquent\AbstractListRecord;
use Illuminate\Database\Eloquent\Builder;
use App\Models\Wallet;
class ListsWallet extends AbstractListRecord
class ListsWallets extends AbstractListRecord
{
/** @var Booking */
/** @var Wallet */
private $repository;
/**
* ListsBookings constructor.
* @param Booking $repository
* Wallet constructor.
* @param Wallet $repository
*/
public function __construct(Wallet $repository)
{
$this->repository = $repository;
}
/**
* @return Builder
*/
public function getRepository(): Builder
function getRepository(): Builder
{
return $this->repository->newQuery();
}
@@ -27,11 +27,15 @@ class UpdatesWalletBalance extends AbstractUpdateRecord
foreach ($model->transactions as $transaction) {
if (!in_array((int) $transaction->status, [ApprovalStatus::APPROVED, ApprovalStatus::COMPLETED])) continue;
if ((int) $transaction->type === TransactionType::TOP_UP) $topups += (float) $transaction->amount;
if ((int) $transaction->type === TransactionType::GROUP_PAYMENT) $topups += (float) $transaction->amount;
if ((int) $transaction->type === TransactionType::CREDIT_NOTE) $credit += (float) $transaction->amount;
if ((int) $transaction->type === TransactionType::PAYMENT) $payments += (float) $transaction->amount;
if ((int) $transaction->type === TransactionType::DEBIT_NOTE) $debit += (float) $transaction->amount;
if ((int) $transaction->type === TransactionType::TOP_UP) $topups += (float) $transaction->amount;
if ((int) $transaction->type === TransactionType::GROUP_PAYMENT) $topups += (float) $transaction->amount;
if ((int) $transaction->type === TransactionType::CREDIT_NOTE) $credit += (float) $transaction->amount;
if ((int) $transaction->type === TransactionType::PAYMENT) $payments += (float) $transaction->amount;
if ((int) $transaction->type === TransactionType::DEBIT_NOTE) $debit += (float) $transaction->amount;
// cief coins
if ((int) $transaction->type === TransactionType::CIEF_COINS_CREDIT) $credit += (float) $transaction->amount;
if ((int) $transaction->type === TransactionType::CIEF_COINS_DEBIT) $debit += (float) $transaction->amount;
}
$auditBalance = ($topups + $credit) - ($payments + $debit);
@@ -0,0 +1,167 @@
<?php
namespace App\Classes\Modules\WePost\ControllersLogic;
use App\Classes\General\Abstracts\AbstractControllerLogic;
use App\Classes\General\WePostHelper;
use App\Classes\Modules\WePost\Services\CreatesWePostNotification;
use App\Classes\Modules\WePost\DataTransferObjects\WePostNotificationObject;
use App\Classes\Modules\WePost\DataTransferObjects\WePostProcessNotificationObject;
use App\Classes\Modules\WePost\Standards\Rules\CanProcessWePostNotification;
use App\Http\Resources\WePostNotificationResource;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
class ProcessWePostNotificationLogic extends AbstractControllerLogic
{
/**
* @return array
*/
protected function notification():array {
return [
'title' => 'Process WePost Notification',
'message' => 'Payload proccessed'
];
}
/** @var CreatesWePostNotification */
private $createsWePostNotification;
/** @var CanProcessWePostNotification */
private $canProcessWePostNotification;
/**
* ProcessWePostNotificationLogic constructor.
* @param CreatesWePostNotification $createsWePostNotification
* @param CanProcessWePostNotification $canProcessWePostNotification
*/
public function __construct(
CreatesWePostNotification $createsWePostNotification, CanProcessWePostNotification $canProcessWePostNotification)
{
$this->createsWePostNotification = $createsWePostNotification;
$this->canProcessWePostNotification = $canProcessWePostNotification;
}
/**
* @param Request $request
* @return JsonResponse
* @throws \App\Classes\Exceptions\AccessForbiddenException
* @throws \App\Classes\Exceptions\MalformedRequestException
* @throws \App\Classes\Exceptions\RequestValidationException
*/
public function logic(Request $request) : JsonResponse
{
$request->merge([
'isApiPub' => true,
]);
$object = new WePostProcessNotificationObject($request->query('api-key'));
$this->canProcessWePostNotification->passes($object);
$result = null;
$code = 0;
$logisticsOrderCode = "";
$executeTime = "";
$timeZone = "";
$status = "";
$packageInfo = [];
$clientId = "";
$type = "";
$timestamp = 0;
$sign = "";
$orderCode = "";
$bizAction = "";
$bizActionDesc= "";
$segmentCode = "";
$isSplitOut = "";
$packageInfos = [];
if($request->has('type')){
$type = $request->input('type');
if($type === 'wepost.service.conso.inbound'){
$logisticsOrderCode = $request->input('logisticsOrderCode');
$executeTime = $request->input('executeTime');
$timeZone = $request->input('timeZone');
$status = $request->input('status');
$packageInfo = $request->input('packageInfo');
$clientId = $request->input('client_id');
$type = $request->input('type');
$timestamp = $request->input('timestamp');
$sign = $request->input('sign');
}
else if($type === 'wepost.service.conso.co.biz.action.notify'){
$executeTime = $request->input('executeTime');
$timeZone = $request->input('timeZone');
$clientId = $request->input('client_id');
$type = $request->input('type');
$timestamp = $request->input('timestamp');
$sign = $request->input('sign');
$orderCode = $request->input('orderCode');
$bizAction = $request->input('bizAction');
$bizActionDesc = $request->input('bizActionDesc');
}
else if($type === 'wepost.service.conso.outbound'){
$executeTime = $request->input('executeTime');
$timeZone = $request->input('timeZone');
$clientId = $request->input('client_id');
$type = $request->input('type');
$timestamp = $request->input('timestamp');
$sign = $request->input('sign');
$orderCode = $request->input('orderCode');
$segmentCode = $request->input('segmentCode');
$isSplitOut = $request->input('isSplitOut');
$packageInfos = $request->input('packageInfos');
}
else{
$code = 1202; //Missing required fields
}
}
else{
$code = 1202; //Missing required fields
}
if(!$sign){
$code = 1100; //Signature is empty
}
if($code == 0){
if($this->verifySignature($type, $sign)){
$object = new WePostNotificationObject(
$logisticsOrderCode, $executeTime, $timeZone, $status,$packageInfo,
$clientId, $type, $timestamp, $sign,
$orderCode, $segmentCode, $bizAction, $bizActionDesc, $isSplitOut, $packageInfos);
$result = $this->createsWePostNotification->execute($object);
}
else{
$code = 1101; //Signature verification failed
}
}
if($code != 0){
$request->merge([
'code' => $code,
]);
}
// $result = [];
// $result['logisticsOrderCode'] = $notification->logistics_order_code;
// return $this->collectionResponse(OrderItemResource::collection($order->orderItems));
// return $this->resourceResponse(new OrderResource($order));
//return $this->response(['data' => $result]);
return $this->resourceResponse(new WePostNotificationResource($result));
}
private function verifySignature($type, $sign){
$result = false;
$signToCompare = WePostHelper::generateSignature(config('wepost.client_id'), config('wepost.client_secret'), $type);
// dd($signToCompare);
if($sign == $signToCompare){
$result = true;
}
return $result;
}
}
@@ -0,0 +1,226 @@
<?php
namespace App\Classes\Modules\WePost\DataTransferObjects;
use App\Classes\General\Interfaces\DataTransferObject;
class WePostNotificationObject implements DataTransferObject
{
/** @var string */
private string $logisticsOrderCode;
/** @var string */
private string $executeTime;
/** @var string */
private string $timeZone;
/** @var string */
private string $status;
/** @var array */
private array $packageInfo;
/** @var string */
private string $clientId;
/** @var string */
private string $type;
/** @var int */
private int $timestamp;
/** @var string */
private string $sign;
/** @var string */
private string $orderCode;
/** @var string */
private string $bizAction;
/** @var string */
private string $bizActionDesc;
/** @var string */
private string $segmentCode;
/** @var string */
private string $isSplitOut;
/** @var array */
private array $packageInfos;
/**
* WePostNotificationObject constructor.
* @param string $logisticsOrderCode
* @param string $executeTime,
* @param string $timeZone,
* @param string $status,
* @param array $packageInfo,
* @param string $clientId,
* @param string $type,
* @param int $timestamp,
* @param string $sign
* @param string $orderCode
* @param string $bizAction
* @param string $bizActionDesc
* @param string $segmentCode
* @param string $isSplitOut
* @param array $packageInfos
*/
public function __construct(
string $logisticsOrderCode,
string $executeTime,
string $timeZone,
string $status,
array $packageInfo,
string $clientId,
string $type,
int $timestamp,
string $sign,
string $orderCode = "",
string $bizAction = "",
string $bizActionDesc = "",
string $segmentCode = "",
string $isSplitOut = "",
array $packageInfos = []
) {
$this->logisticsOrderCode = $logisticsOrderCode;
$this->executeTime = $executeTime;
$this->timeZone = $timeZone;
$this->status = $status;
$this->packageInfo = $packageInfo;
$this->clientId = $clientId;
$this->type = $type;
$this->timestamp = $timestamp;
$this->sign = $sign;
$this->orderCode = $orderCode;
$this->bizAction = $bizAction;
$this->bizActionDesc = $bizActionDesc;
$this->segmentCode = $segmentCode;
$this->isSplitOut = $isSplitOut;
$this->packageInfos = $packageInfos;
}
/**
* @return string
*/
public function getLogisticsOrderCode(): string
{
return $this->logisticsOrderCode;
}
/**
* @return string
*/
public function getExecuteTime(): string
{
return $this->executeTime;
}
/**
* @return string
*/
public function getTimeZone(): string
{
return $this->timeZone;
}
/**
* @return string
*/
public function getStatus(): string
{
return $this->status;
}
/**
* @return array
*/
public function getPackageInfo(): array
{
return $this->packageInfo;
}
/**
* @return string
*/
public function getClientId(): string
{
return $this->clientId;
}
/**
* @return string
*/
public function getType(): string
{
return $this->type;
}
/**
* @return int
*/
public function getTimestamp(): int
{
return $this->timestamp;
}
/**
* @return string
*/
public function getSign(): string
{
return $this->sign;
}
/**
* @return string
*/
public function getOrderCode(): string
{
return $this->orderCode;
}
/**
* @return string
*/
public function getBizAction(): string
{
return $this->bizAction;
}
/**
* @return string
*/
public function getBizActionDesc(): string
{
return $this->bizActionDesc;
}
/**
* @return string
*/
public function getSegmentCode(): string
{
return $this->segmentCode;
}
/**
* @return string
*/
public function getIsSplitOut(): string
{
return $this->isSplitOut;
}
/**
* @return string
*/
public function getPackageInfos(): string
{
return json_encode($this->packageInfos);
}
}
@@ -0,0 +1,30 @@
<?php
namespace App\Classes\Modules\WePost\DataTransferObjects;
use App\Classes\General\Interfaces\DataTransferObject;
class WePostProcessNotificationObject implements DataTransferObject
{
/** @var string */
private string $token;
/**
* WePostProcessNotificationObject constructor.
* @param string $token
*/
public function __construct(
string $token
) {
$this->token = $token;
}
/**
* @return string
*/
public function getToken(): string
{
return $this->token;
}
}
@@ -0,0 +1,38 @@
<?php
namespace App\Classes\Modules\WePost\Services;
use App\Classes\General\Eloquent\AbstractUpdateRecord;
use App\Classes\Modules\WePost\DataTransferObjects\WePostNotificationObject;
use App\Models\WePostNotification;
class CreatesWePostNotification extends AbstractUpdateRecord
{
/**
* @param WePostNotificationObject $object
* @return \Illuminate\Database\Eloquent\Model
* @throws \App\Classes\Exceptions\MalformedRequestException
*/
public function execute(WePostNotificationObject $object)
{
$model = new WePostNotification();
$model->logistics_order_code = $object->getLogisticsOrderCode();
$model->execute_time = $object->getExecuteTime();
$model->timezone = $object->getTimeZone();
$model->status = $object->getStatus();
$model->package_info = $object->getPackageInfo();
$model->client_id = $object->getClientId();
$model->type = $object->getType();
$model->timestamp = $object->getTimestamp();
$model->sign = $object->getSign();
$model->order_code = $object->getOrderCode();
$model->biz_action = $object->getBizAction();
$model->biz_action_desc = $object->getBizActionDesc();
$model->segment_code = $object->getSegmentCode();
$model->is_split_out = $object->getIsSplitOut();
$model->package_infos = $object->getPackageInfos();
return $this->handler($model);
}
}
@@ -0,0 +1,46 @@
<?php
namespace App\Classes\Modules\WePost\Standards\Rules;
use App\Classes\General\Abstracts\AbstractRule;
use App\Models\PersonalAccessTokens;
class CanProcessWePostNotification extends AbstractRule
{
/**
* @return bool
*/
protected function authorized($object): bool
{
$personalAccessToken = PersonalAccessTokens::where('token', $object->getToken())->first();
if($personalAccessToken){
$abilities = json_decode($personalAccessToken->abilities, true);
if (in_array('process notification', $abilities)|| in_array('*', $abilities)) {
return true;
}
}
return false;
}
/**
* @param $object
* @return bool
*/
protected function validators($object): bool
{
return true;
}
/**
* @param $object
* @return bool
*/
protected function criteria($object): bool
{
return true;
}
}
@@ -10,4 +10,6 @@ final class RemarkTypes
public const EXTERNAL = 1;
}
public const ADDRESS_EXTRA_COLUMNS = 2;
}
@@ -0,0 +1,11 @@
<?php
namespace App\Classes\ValueObjects\Constants;
final class RouteType {
public const WEB = 1;
public const API = 2;
}
@@ -42,4 +42,9 @@ final class TransactionType {
];
public const STORAGE_INVOICE = 16;
public const CIEF_COINS_DEBIT = 17;
public const CIEF_COINS_CREDIT = 18;
}
@@ -4,6 +4,7 @@ namespace App\Console\Commands;
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 Carbon\Carbon;
@@ -32,15 +33,19 @@ class OneTimeTransactionFixBillplzFailedCallback extends Command
/** @var CallbackBillplzProcessor */
private $callbackBillplzProcessor;
/** @var CallbackBillplzDataPatchProcessor */
private $callbackBillplzDataPatchProcessor;
/**
* Create a new command instance.
*
* @return void
*/
public function __construct(CallbackBillplzProcessor $callbackBillplzProcessor)
public function __construct(CallbackBillplzProcessor $callbackBillplzProcessor, CallbackBillplzDataPatchProcessor $callbackBillplzDataPatchProcessor)
{
parent::__construct();
$this->callbackBillplzProcessor = $callbackBillplzProcessor;
$this->callbackBillplzDataPatchProcessor = $callbackBillplzDataPatchProcessor;
}
/**
@@ -55,20 +60,22 @@ class OneTimeTransactionFixBillplzFailedCallback extends Command
$this->outputArray = [];
$start = new Carbon();
//Transaction fix with this one time fix command: 15205, 16803
//Transaction fix with this one time fix command: 15205, 16803, 17310
//This transaction, 16803 has approve payment but not its owner, shipping invoice
$transaction = Transaction::whereIn('id', [16803])->first();
$this->info(Carbon::now() . ' : One time fix failled callback from billplz for transaction with id 16803 cron started.');
$transaction = Transaction::whereIn('id', [17310])->first();
$this->info(Carbon::now() . ' : One time fix failled callback from billplz for transaction with id 17310 cron started.');
if($transaction && $transaction->id == 16803){
if($transaction && $transaction->id == 17310){
$this->info(Carbon::now() . ' : 17310.');
$status = ApprovalStatus::APPROVED;
$this->callbackBillplzProcessor->execute($transaction, $status);
// $this->callbackBillplzProcessor->execute($transaction, $status);
$this->callbackBillplzDataPatchProcessor->execute($transaction, $status);
}
$end = new Carbon();
$elapsedTime = $start->diff($end)->format('%H:%I:%S');
$this->info(Carbon::now() . ' : One time fix failled callback from billplz for transaction with id 16803 cron ended. ElapsedTime: ' . $elapsedTime);
$this->info(Carbon::now() . ' : One time fix failled callback from billplz for transaction with id 17310 cron ended. ElapsedTime: ' . $elapsedTime);
}
}
+13 -8
View File
@@ -28,15 +28,15 @@ class Kernel extends ConsoleKernel
protected function schedule(Schedule $schedule)
{
$schedule->command('command:curlVTCommand')
->cron('0 8 * * *')
->withoutOverlapping()
->appendOutputTo (storage_path().'/logs/curlvt.log');
// $schedule->command('command:curlVTCommand')
// ->cron('0 8 * * *')
// ->withoutOverlapping()
// ->appendOutputTo (storage_path().'/logs/curlvt.log');
$schedule->command('command:curlYdOrderListCommand')
->cron('0 9-18/3 * * *')
->withoutOverlapping()
->appendOutputTo (storage_path().'/logs/curlyd.log');
// $schedule->command('command:curlYdOrderListCommand')
// ->cron('30 9-18/3 * * *')
// ->withoutOverlapping()
// ->appendOutputTo (storage_path().'/logs/curlyd.log');
$schedule->command('fix-packinglist')
->cron('30 9-18/3 * * *')
@@ -58,6 +58,11 @@ class Kernel extends ConsoleKernel
->withoutOverlapping()
->appendOutputTo (storage_path().'/logs/auto_generate_invoice.log');
$schedule->command('approve:invoice')
->hourly()
->withoutOverlapping()
->appendOutputTo (storage_path().'/logs/approve_invoice.log');
$schedule->command('billplz-failed-callback:fix')
->hourly()
->withoutOverlapping()
@@ -0,0 +1,21 @@
<?php
namespace App\Http\Controllers\Accounts;
use App\Classes\Modules\Accounts\ControllersLogic\LoginThroughExchangeLogic;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
class LoginThroughExchangeController
{
/**
* @param Request $request
* @param LoginThroughExchangeLogic $logic
* @return JsonResponse
*/
public function authenticate(Request $request, LoginThroughExchangeLogic $logic): JsonResponse {
return $logic->execute($request);
}
}
@@ -0,0 +1,21 @@
<?php
namespace App\Http\Controllers\Companies;
use App\Classes\Modules\Companies\ControllersLogic\LinkExchangeCompanyLogic;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
class LinkExchangeCompanyController
{
/**
* @param Request $request
* @param LinkExchangeCompanyLogic $logic
* @return JsonResponse
*/
public function authenticate(Request $request, LinkExchangeCompanyLogic $logic): JsonResponse {
return $logic->execute($request);
}
}
@@ -5,6 +5,7 @@ namespace App\Http\Controllers\Exports;
use App\Classes\Modules\Exports\Services\ExportsCustomersOrderLatestDate;
use App\Classes\Modules\Exports\Services\ExportsCustomerTotalOrderByYear;
use App\Classes\Modules\Exports\Services\ExportsGroupTransactions;
use App\Classes\Modules\Exports\Services\ExportsPaymentTransactions;
use App\Models\User;
use Illuminate\Http\Request;
@@ -33,6 +34,13 @@ class ExportCustomersToExcelController
return $response;
}
public function groupTransaction(Request $request){
$exportsTransactions = new ExportsGroupTransactions($request);
$response = $exportsTransactions->download('group-transactions.xls', Excel::XLS, ['Content-Type' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet']);
ob_end_clean();
return $response;
}
public function totalOrders(Request $request){
$exportsTotalOrders = new ExportsCustomerTotalOrderByYear($request);
$response = $exportsTotalOrders->download('total-orders-' . $request->route('year') . '.xls', Excel::XLS, ['Content-Type' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet']);
@@ -19,7 +19,39 @@ use Illuminate\Http\Request;
class MonthlyReportController
{
public function salesReport(Request $request): JsonResponse {
/**
* Get Containers
* @param $from
* @param $to
* @return mixed
*/
private function getContainersByLoadingDate($from, $to)
{
return Container::whereBetween('loading_date', [$from, $to])->orderBy('loading_date')->get();
}
private function getPackages($from, $to)
{
$containers = $this->getContainersByLoadingDate($from, $to);
$packingLists = $containers->flatMap(function ($container) {
return $container->packingLists;
});
return $packingLists->map(function ($packingList) {
$replica = in_array(Auth()->user()->type, [RoleTypes::SHADOW_ADMIN, RoleTypes::SUPER_ADMIN]) ? $packingList : $packingList->packingLists()->where('type', PackingListType::SHIPPING_PACKING_LIST_REPLICA)->first();
return $replica ? $replica : $packingList;
})->flatMap(function ($packingList) {
return $packingList->packages;
});
}
public function salesReport(Request $request): JsonResponse
{
$from = $request->route('from') ? Carbon::parse($request->route('from')) : Carbon::now()->startOfMonth();
$to = $request->route('to') ? Carbon::parse($request->route('to')) : Carbon::now()->endOfMonth();
@@ -39,16 +71,18 @@ class MonthlyReportController
return $container->orders;
})->unique();
$packingLists = $containers->flatMap(function ($container) {
return $container->packingLists;
});
$packages = $this->getPackages($from, $to);
$packages = $packingLists->map(function ($packingList) {
$replica = in_array(Auth()->user()->type, [RoleTypes::SHADOW_ADMIN, RoleTypes::SUPER_ADMIN]) ? $packingList : $packingList->packingLists()->where('type', PackingListType::SHIPPING_PACKING_LIST_REPLICA)->first();
return $replica ? $replica : $packingList;
})->flatMap(function ($packingList) {
return $packingList->packages;
});
/* $packingLists = $containers->flatMap(function ($container) {
return $container->packingLists;
});
$packages = $packingLists->map(function ($packingList) {
$replica = in_array(Auth()->user()->type, [RoleTypes::SHADOW_ADMIN, RoleTypes::SUPER_ADMIN]) ? $packingList : $packingList->packingLists()->where('type', PackingListType::SHIPPING_PACKING_LIST_REPLICA)->first();
return $replica ? $replica : $packingList;
})->flatMap(function ($packingList) {
return $packingList->packages;
});*/
$totalCbm = $packages->sum(function($package){
return (( (float) $package->width / 100) * ( (float) $package->length / 100) * ( (float) $package->height / 100)) * $package->quantity;
@@ -89,19 +123,18 @@ class MonthlyReportController
$model = (int) $request->route('model');
$value = (float) $request->route('value');
$packages = $this->getPackages($from, $to);
$containers = Container::whereBetween('loading_date', [$from, $to])->orderBy('loading_date')->get();
/* $packingLists = $containers->flatMap(function ($container) {
return $container->packingLists;
});
$packingLists = $containers->flatMap(function ($container) {
return $container->packingLists;
});
$packages = $packingLists->map(function ($packingList) {
$replica = in_array(Auth()->user()->type, [RoleTypes::SHADOW_ADMIN, RoleTypes::SUPER_ADMIN]) ? $packingList : $packingList->packingLists()->where('type', PackingListType::SHIPPING_PACKING_LIST_REPLICA)->first();
return $replica ? $replica : $packingList;
})->flatMap(function ($packingList) {
return $packingList->packages;
});
$packages = $packingLists->map(function ($packingList) {
$replica = in_array(Auth()->user()->type, [RoleTypes::SHADOW_ADMIN, RoleTypes::SUPER_ADMIN]) ? $packingList : $packingList->packingLists()->where('type', PackingListType::SHIPPING_PACKING_LIST_REPLICA)->first();
return $replica ? $replica : $packingList;
})->flatMap(function ($packingList) {
return $packingList->packages;
});*/
$totalCbm = $packages->sum(function($package){
return (( (float) $package->width / 100) * ( (float) $package->length / 100) * ( (float) $package->height / 100)) * $package->quantity;
@@ -142,18 +175,20 @@ class MonthlyReportController
$from = $request->route('from') ? Carbon::parse($request->route('from')) : Carbon::parse('01-01-2018');
$to = $request->route('to') ? Carbon::parse($request->route('to')) : Carbon::now();
$containers = Container::whereBetween('loading_date', [$from, $to])->orderBy('loading_date')->get();
/* $containers = $this->getContainersByLoadingDate($from, $to);
$packingLists = $containers->flatMap(function ($container) {
return $container->packingLists;
});
$packingLists = $containers->flatMap(function ($container) {
return $container->packingLists;
});
$packages = $packingLists->map(function ($packingList) {
$replica = in_array(Auth()->user()->type, [RoleTypes::SHADOW_ADMIN, RoleTypes::SUPER_ADMIN]) ? $packingList : $packingList->packingLists()->where('type', PackingListType::SHIPPING_PACKING_LIST_REPLICA)->first();
return $replica ? $replica : $packingList;
})->flatMap(function ($packingList) {
return $packingList->packages;
});
$packages = $packingLists->map(function ($packingList) {
$replica = in_array(Auth()->user()->type, [RoleTypes::SHADOW_ADMIN, RoleTypes::SUPER_ADMIN]) ? $packingList : $packingList->packingLists()->where('type', PackingListType::SHIPPING_PACKING_LIST_REPLICA)->first();
return $replica ? $replica : $packingList;
})->flatMap(function ($packingList) {
return $packingList->packages;
});*/
$packages = $this->getPackages($from, $to);
$packages = $packages->filter(function($package) use ($id) {
return $package->companyModule->id === $id;
@@ -210,17 +245,19 @@ class MonthlyReportController
$minCbm = $request->input('cbm');
$minOrders = $request->input('minOrders');
$activeCompanies = CompanyModule::where('type', \App\Classes\ValueObjects\Constants\BusinessType::IMPORTER)->whereHas('orderPackingLists', function($query) use($inactive_start, $inactive_end) {
return $query->where('packing_lists.type', \App\Classes\ValueObjects\Constants\PackingListType::WAREHOUSE_RECEIVE_LIST)->whereHas('transports', function ($query) use ($inactive_start, $inactive_end) {
return $query->where('drop_date', '>=', \Carbon\Carbon::parse($inactive_start))->where('drop_date', '<=', \Carbon\Carbon::parse($inactive_end)->addDay());
});
})->pluck('id');
/* $activeCompanies = CompanyModule::where('type', BusinessType::IMPORTER)->whereHas('orderPackingLists', function ($query) use ($inactive_start, $inactive_end) {
return $query->where('packing_lists.type', PackingListType::WAREHOUSE_RECEIVE_LIST)->whereHas('transports', function ($query) use ($inactive_start, $inactive_end) {
return $query->where('drop_date', '>=', Carbon::parse($inactive_start))->where('drop_date', '<=', Carbon::parse($inactive_end)->addDay());
});
})->pluck('id');
$companies = CompanyModule::where('type', \App\Classes\ValueObjects\Constants\BusinessType::IMPORTER)->whereHas('orderPackingLists', function($query) use($active_start, $active_end) {
return $query->where('packing_lists.type', \App\Classes\ValueObjects\Constants\PackingListType::WAREHOUSE_RECEIVE_LIST)->whereHas('transports', function ($query) use ($active_start, $active_end) {
return $query->whereDate('drop_date', '>=', \Carbon\Carbon::parse($active_start))->whereDate('drop_date', '<=', \Carbon\Carbon::parse($active_end)->addDay());
});
})->whereNotIn('id', $activeCompanies)->get();
$companies = CompanyModule::where('type', BusinessType::IMPORTER)->whereHas('orderPackingLists', function ($query) use ($active_start, $active_end) {
return $query->where('packing_lists.type', PackingListType::WAREHOUSE_RECEIVE_LIST)->whereHas('transports', function ($query) use ($active_start, $active_end) {
return $query->whereDate('drop_date', '>=', Carbon::parse($active_start))->whereDate('drop_date', '<=', Carbon::parse($active_end)->addDay());
});
})->whereNotIn('id', $activeCompanies)->get();*/
$companies = getActiveCompanies($inactive_start, $inactive_end, $active_start, $active_end);
$customerActivityData = [];
$counter = 1;
@@ -240,7 +277,7 @@ class MonthlyReportController
if ($minOrders != 'null' && $packingList->count() < $minOrders) { continue; }
array_push($customerActivityData, array(
'key' => $counter,
'key' => $counter,
'marking' => $marking,
'packingListCount'=> $packingList->count(),
'totalCbm'=> $totalCbm,
@@ -0,0 +1,15 @@
<?php
namespace App\Http\Controllers\Transactions;
use App\Classes\Modules\Transactions\ControllersLogic\CreateCombinedInvoicesLogic;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
class CreateCombinedInvoicesController
{
public function combine(Request $request, CreateCombinedInvoicesLogic $logic): JsonResponse {
return $logic->execute($request);
}
}

Some files were not shown because too many files have changed in this diff Show More