Compare commits

...

291 Commits

Author SHA1 Message Date
Haziq Danial 6842e3f1db updated pakage remark - haziq 2021-12-07 23:19:21 +08:00
omair saleh 0d6df7ec0c add remarkable interface 2021-10-21 21:04:41 +08:00
omair saleh dd38f41f47 show order numbers with shipped more than received 2021-10-21 13:40:35 +08:00
omair saleh 062b2fb908 show orders with shipping packing list more than warehouse received list 2021-10-21 13:29:22 +08:00
omair saleh 7c027ef62f remove typhoon announcement 2021-10-21 13:11:55 +08:00
omair saleh 6137012a35 remove report web route 2021-10-21 12:43:57 +08:00
omair saleh c79f4cfdab update reference eloquent filter to small letters 2021-10-21 12:42:13 +08:00
omair saleh 073f89be12 fix package component buy when they shipping schedule is not set 2021-10-20 14:59:15 +08:00
omair saleh 3752d71b4f fix package component bug when the schedule is not set 2021-10-20 14:57:08 +08:00
omair saleh b82f3b9f45 update sales report, show unloaded cbm 2021-10-19 18:28:37 +08:00
omair saleh 4a3b3344e7 customer notice 2021-10-15 16:00:11 +08:00
omair saleh ae42e1e03b update notice to customer profiles 2021-10-15 15:55:22 +08:00
omair saleh 8ba5f95690 reference lik eloquent filter 2021-10-13 21:05:08 +08:00
omair saleh 70cc67a559 reposition the order refresh button 2021-10-13 11:26:42 +08:00
omair saleh 149376e4b5 don't show rejected company identifications 2021-10-13 11:17:59 +08:00
omair saleh d5dd880d9e customer report 2021-10-12 19:09:00 +08:00
omair saleh fa628e81ac customer reports 2021-10-12 19:07:41 +08:00
omair saleh 51a6569cf0 show received cbm in sales report 2021-10-12 18:30:00 +08:00
omair saleh 886f091f6a customer report 2021-10-12 17:16:47 +08:00
omair saleh b22b4c374a customer report 2021-10-12 17:12:53 +08:00
omair saleh 2b065cb4a8 customer report 2021-10-12 17:12:26 +08:00
omair saleh bcf7ae4098 fix daily cbm report 2021-10-12 14:07:21 +08:00
omair saleh b355df27db fix daily cbm report 2021-10-12 13:57:35 +08:00
omair saleh c33649fda2 fix daily cbm report 2021-10-12 13:54:46 +08:00
omair saleh 4615843e17 fix daily cbm report 2021-10-12 13:44:31 +08:00
omair saleh 40f51a0f60 ui fix 2021-10-12 13:16:41 +08:00
omair saleh 2c3dff7e77 update datepicker vue component 2021-10-12 13:15:09 +08:00
omair saleh 8178cda2b4 create sales report range frontend 2021-10-12 13:13:12 +08:00
omair saleh 04215916f5 add report from to filters 2021-10-12 12:25:26 +08:00
omair saleh 25f9db99c7 temp show specific report period 2021-10-11 15:13:27 +08:00
omair saleh 04f248e88d temp show specific report period 2021-10-11 15:12:36 +08:00
omair saleh 70e53c197c temp show specific report period 2021-10-11 15:04:11 +08:00
omair saleh 642731b680 temp show specific report period 2021-10-11 15:02:53 +08:00
omair saleh 7bd3ae056d temp show specific report period 2021-10-11 15:00:18 +08:00
omair saleh e58805a023 temp show specific report period 2021-10-11 14:58:45 +08:00
omair saleh fdce49ea82 temp show specific report period 2021-10-11 14:56:40 +08:00
omair saleh 90a0c4ddf5 temp show specific report period 2021-10-11 14:54:52 +08:00
omair saleh f963b012ec temp show specific report period 2021-10-11 14:53:02 +08:00
omair saleh d8289599c9 temp show specific report period 2021-10-11 14:52:30 +08:00
omair saleh 7965398c5a temp show specific report period 2021-10-11 14:51:57 +08:00
omair saleh a1b5737935 temp show specific report period 2021-10-11 14:51:15 +08:00
omair saleh 72400f2ab2 temp show specific report period 2021-10-11 14:48:12 +08:00
omair saleh 6badfadd2d temp show specific report period 2021-10-11 14:47:40 +08:00
omair saleh b9a65005e6 temp show specific report period 2021-10-11 14:44:56 +08:00
omair saleh 190ed6c5f9 temp show specific report period 2021-10-11 14:43:39 +08:00
omair saleh 7c96f3039a temp show specific report period 2021-10-11 14:42:45 +08:00
omair saleh fbb7d31726 temp show specific report period 2021-10-11 14:41:37 +08:00
omair saleh 3d1fb48cfb temp show specific report period 2021-10-11 14:39:30 +08:00
omair saleh f2e944cc0b temp show specific report period 2021-10-11 14:38:23 +08:00
omair saleh 44d7507cbd temp show specific report period 2021-10-11 14:37:13 +08:00
omair saleh 0a32d64e8d temp show specific report period 2021-10-11 14:35:15 +08:00
omair saleh f1edf72fb8 temp show specific report period 2021-10-11 14:32:54 +08:00
omair saleh c85248bc0f temp show specific report period 2021-10-11 14:31:02 +08:00
omair saleh 1aad4de653 temp show specific report period 2021-10-11 14:29:05 +08:00
omair saleh ae031078bc temp show specific report period 2021-10-11 14:28:05 +08:00
omair saleh d5d2a13e31 temp show specific report period 2021-10-11 14:25:47 +08:00
omair saleh 6809bfc693 temp show specific report period 2021-10-11 14:24:44 +08:00
omair saleh a21465992f temp show specific report period 2021-10-11 14:23:14 +08:00
omair saleh f844f5d879 show delivery status in container component 2021-10-11 13:17:05 +08:00
omair saleh 959e5dc970 remove duplicated try catch from logic 2021-10-11 11:01:43 +08:00
omair saleh 149469598e remove unused dependencies from route file 2021-10-11 11:00:53 +08:00
omair saleh fce976ff6b show refresh orders button only in orders page 2021-10-11 10:58:18 +08:00
omair saleh 4b0e1b4b78 change the definition of destination warehouse arrival 2021-10-11 10:53:34 +08:00
omair saleh e6f13fd3d0 change the definition of destination warehouse arrival 2021-10-11 10:39:37 +08:00
omair saleh 8a40ea35ee show daily target 2021-10-08 23:23:18 +08:00
omair saleh 19d0802d0e show daily target 2021-10-08 23:21:15 +08:00
omair saleh 95bd1ca6af add customer without orders list 2021-10-08 22:35:54 +08:00
omair saleh e6c42ef55c add customer without orders list 2021-10-08 22:34:54 +08:00
omair saleh a9c914b41c add customer without orders list 2021-10-08 21:45:37 +08:00
omair saleh c00239c959 add customer without orders list 2021-10-08 21:43:55 +08:00
omair saleh b4844874bb add customer without orders list 2021-10-08 21:42:26 +08:00
omair saleh 1b3c63e05d add customer without orders list 2021-10-08 21:41:06 +08:00
omair saleh c3b0e55271 add customer without orders list 2021-10-08 21:37:45 +08:00
omair saleh 9463bc9478 add customer without orders list 2021-10-08 21:17:49 +08:00
omair saleh 500917fbba make the service chart thinner 2021-10-06 21:56:37 +08:00
omair saleh 9af8dd0d0e fix sales report decimals 2021-10-06 21:54:08 +08:00
omair saleh 2895acc8fc fix sales report decimals 2021-10-06 21:52:28 +08:00
omair saleh 33cd2cef7d fix sales report decimals 2021-10-06 21:50:26 +08:00
omair saleh d2485eaae7 fix sales report decimals 2021-10-06 21:49:05 +08:00
omair saleh 0a5aa9843d show current months sales report 2021-10-06 21:40:58 +08:00
omair saleh 0dbdeba0d2 show september sales report 2021-10-06 21:38:03 +08:00
omair saleh fbd108e8e8 increase fetch container date range limit 2021-10-06 21:34:48 +08:00
omair saleh 52ec457b52 service report 2021-10-06 15:18:40 +08:00
omair saleh f159bf7982 service report 2021-10-06 15:17:06 +08:00
omair saleh 5386700762 service report 2021-10-06 14:15:41 +08:00
omair saleh 5aefef5366 service report 2021-10-05 20:54:19 +08:00
omair saleh 943ec5f7f7 service report 2021-10-05 17:02:17 +08:00
omair saleh 647103f387 service report 2021-10-05 14:57:52 +08:00
omair saleh 9340d4360e update monthly report 2021-10-05 14:24:43 +08:00
omair saleh ebbe2c7863 hide buttons create container button 2021-10-04 16:32:34 +08:00
omair saleh 73dbb41044 hide buttons for packing lists 2021-10-04 16:28:27 +08:00
omair saleh 3dfceeaf37 Merge remote-tracking branch 'origin/master'
# Conflicts:
#	app/Http/Resources/OrderResource.php
#	resources/assets/vue/components/orders/sections/OrderProfileSectionComponent.vue
2021-10-04 16:21:44 +08:00
omair saleh 509f14c790 improve load speed by cleaning the resources to reduce the number of queries submitted per request 2021-10-04 16:17:10 +08:00
omair saleh 33a8d370c5 Merge branch 'container-profile-ui' into 'master'
add 'ADD Container' button

See merge request CIEFWorldwideSdnBhd/shipping-portal!68
2021-10-04 05:27:58 +00:00
omair saleh ad4b8a821c Merge branch 'packaging-list-schedule' into 'master'
create package list ui

See merge request CIEFWorldwideSdnBhd/shipping-portal!66
2021-10-04 05:26:18 +00:00
omair saleh 6c276b59b1 Merge branch 'package-ui-create' into 'master'
create package list ui

See merge request CIEFWorldwideSdnBhd/shipping-portal!55
2021-10-04 05:25:35 +00:00
omair saleh b57a511bb6 Merge branch 'task/EXC-338' into 'master'
Inbound custom cleared

See merge request CIEFWorldwideSdnBhd/shipping-portal!67
2021-10-04 05:25:04 +00:00
glovetleong 8314820204 packing schedule, transport, complete 2021-10-03 21:22:59 +08:00
glovetleong a2cc1e5e4f Merge branch 'package-ui-create' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into packaging-list-schedule 2021-10-03 20:42:46 +08:00
glovetleong 17fb297942 pull 2021-10-03 20:42:35 +08:00
edmondlang b12da6ff44 Merge branch 'master' of gitlab.com:CIEFWorldwideSdnBhd/shipping-portal into container-profile-ui
# Conflicts:
#	resources/assets/vue/components/containers/elements/ContainerProfileSectionComponent.vue
#	routes/web.php
2021-10-03 18:13:20 +08:00
edmondlang cf78e92c5f update container profile section component 2021-10-03 18:07:25 +08:00
edmondlang 7db7553dca Update container profile forms 2021-10-03 18:00:58 +08:00
edmondlang fa1871d712 modify modal add data-dismiss="modal" 2021-10-03 17:06:11 +08:00
omair saleh 16b35b34b3 customer report 2021-10-02 15:24:02 +08:00
omair saleh 33f152ae9c customer report 2021-10-02 15:22:28 +08:00
omair saleh 93c9412298 customer report 2021-10-02 15:17:22 +08:00
omair saleh c74e2927ad customer report 2021-10-02 15:15:27 +08:00
omair saleh 95f52b3a62 customer report 2021-10-02 15:06:10 +08:00
omair saleh 24a286a5a2 customer report 2021-10-02 15:00:49 +08:00
omair saleh bbc247d67e customer report 2021-10-02 14:59:15 +08:00
omair saleh 019073afc5 customer report 2021-10-01 21:25:02 +08:00
omair saleh feb04e8498 customer report 2021-10-01 21:14:33 +08:00
omair saleh 557d85ef8d customer report 2021-10-01 20:45:00 +08:00
omair saleh 1e5df1d64b customer report 2021-10-01 19:50:44 +08:00
omair saleh 186d6f71c6 customer report 2021-10-01 19:48:04 +08:00
omair saleh 2f11666539 customer report 2021-10-01 19:46:00 +08:00
omair saleh 87e9dbe3ec customer report 2021-10-01 19:43:50 +08:00
omair saleh 626ba6bbf4 customer report 2021-10-01 19:40:12 +08:00
omair saleh 8b5ac008d3 customer report 2021-10-01 19:37:12 +08:00
omair saleh ccd7d91076 customer report 2021-10-01 19:35:55 +08:00
omair saleh 7bde77036d customer report 2021-10-01 19:34:25 +08:00
omair saleh bf7443887c customer report 2021-10-01 19:26:42 +08:00
omair saleh 933f39d280 container monthly report 2021-10-01 18:33:29 +08:00
omair saleh 463d342441 container monthly report 2021-10-01 18:33:19 +08:00
omair saleh 27e856bc4d container monthly report 2021-10-01 18:23:10 +08:00
omair saleh 8f381b42f3 container monthly report 2021-10-01 18:18:40 +08:00
omair saleh 1af45e5132 container monthly report 2021-10-01 18:17:17 +08:00
omair saleh 6c5bbf842e container report 2021-10-01 18:16:56 +08:00
omair saleh 96d701bc80 container monthly report 2021-10-01 18:14:46 +08:00
omair saleh 9221bd094c count total containers 2021-10-01 18:11:15 +08:00
omair saleh c76271d8ab loaded cbm monthly report 2021-10-01 18:02:09 +08:00
omair saleh 26a0bc186e total loaded cbm monthly report 2021-10-01 18:00:07 +08:00
omair saleh 2305ddb39d fix container component ui 2021-10-01 17:55:06 +08:00
omair saleh c66273874d marking container loading date as a timestamp in the modal 2021-10-01 17:52:28 +08:00
omair saleh 9ef636c5d5 add container loading date 2021-10-01 17:49:59 +08:00
omair saleh 9b9292546b test updating loading date for containers from vt portal 2021-10-01 17:45:37 +08:00
omair saleh 2974fe4e9a test updating loading date for containers from vt portal 2021-10-01 17:44:20 +08:00
omair saleh e93da67ec1 test updating loading date for containers from vt portal 2021-10-01 17:43:46 +08:00
omair saleh 7c14b74dd1 test updating loading date for containers from vt portal 2021-10-01 17:42:44 +08:00
omair saleh b9b05dfdbe test updating loading date for containers from vt portal 2021-10-01 17:41:42 +08:00
omair saleh e5e00bb9ac test updating loading date for containers from vt portal 2021-10-01 17:40:19 +08:00
omair saleh c6e222caf2 add loading date for container table 2021-10-01 17:35:19 +08:00
omair saleh 973ab58818 hint claim id 2021-09-30 16:12:48 +08:00
Fairuz 2ae879fd51 Inbound custom cleared 2021-09-29 04:38:41 +08:00
omair saleh 8e9db507f6 fix template routes, and hide report button temp 2021-09-28 15:55:24 +08:00
omair saleh 943f5ce64e add custom clearance routes 2021-09-28 13:24:29 +08:00
omair saleh 2c3ea9e3f1 order component address tooltip layout fixes 2021-09-28 13:23:56 +08:00
edmondlang a69ecc2825 update create load container form 2021-09-27 23:56:13 +08:00
edmondlang d13aad9566 container profile forms ui 2021-09-27 21:56:04 +08:00
omair saleh 579200fd61 Merge branch 'task/EXC-337' into 'master'
Task/exc 337

See merge request CIEFWorldwideSdnBhd/shipping-portal!65
2021-09-27 09:10:51 +00:00
omair saleh 37d06798aa Merge branch 'master' into 'task/EXC-337'
# Conflicts:
#   routes/web.php
2021-09-27 09:10:46 +00:00
omair saleh 09a3654e2f add packing list inbound custom route 2021-09-27 17:05:58 +08:00
omair saleh 1c5fbec0b9 Merge branch 'task/EXC-338' into 'master'
Inbound custom cleared

See merge request CIEFWorldwideSdnBhd/shipping-portal!64
2021-09-27 09:04:39 +00:00
omair saleh c8820ad39e Merge branch 'master' into 'task/EXC-338'
# Conflicts:
#   routes/packing_list.php
2021-09-27 09:04:15 +00:00
omair saleh 4122ac4153 Merge branch 'assign-packing-list' into 'master'
assign packing list to container

See merge request CIEFWorldwideSdnBhd/shipping-portal!63
2021-09-27 09:01:15 +00:00
omair saleh 6959370b7a Merge branch 'package-switch-packing-list' into 'master'
package switch packing list

See merge request CIEFWorldwideSdnBhd/shipping-portal!62
2021-09-27 09:00:22 +00:00
omair saleh d7b4e716d8 Merge remote-tracking branch 'origin/master' 2021-09-27 16:59:23 +08:00
omair saleh d7f3b656f7 Merge branch 'container-profile-ui'
# Conflicts:
#	routes/web.php
2021-09-27 16:59:08 +08:00
omair saleh 3b20e240ee Merge branch 'shipping-queue-ui' into 'master'
Shipping queue ui

See merge request CIEFWorldwideSdnBhd/shipping-portal!59
2021-09-27 08:49:55 +00:00
omair saleh aa39adaeb8 clean web routes 2021-09-27 16:43:29 +08:00
omair saleh f0ebd20c5e Merge branch 'payment-and-billing-ui' into 'master'
Payment and billing ui

See merge request CIEFWorldwideSdnBhd/shipping-portal!57
2021-09-27 08:41:18 +00:00
omair saleh 0b3ae1f8df Merge branch 'master' into 'payment-and-billing-ui'
# Conflicts:
#   routes/web.php
2021-09-27 08:41:13 +00:00
Fairuz 27684a2940 Changes to inline report 2021-09-27 11:06:38 +08:00
Fairuz ed637739cc Inbound custom cleared 2021-09-27 09:48:00 +08:00
edmondlang a0531e344c add 'ADD Container' button
update add container form
2021-09-25 16:13:31 +08:00
edmondlang 9073d86859 Merge branch 'package-ui-create' of gitlab.com:CIEFWorldwideSdnBhd/shipping-portal into container-profile-forms-ui 2021-09-24 21:59:39 +08:00
glovetleong ce20a941cd tidy 2021-09-24 21:56:50 +08:00
glovetleong b98ab2749a eta and etd in create container 2021-09-24 21:54:06 +08:00
edmondlang 5363034649 Merge branch 'package-ui-create' of gitlab.com:CIEFWorldwideSdnBhd/shipping-portal into container-profile-forms-ui 2021-09-24 19:56:31 +08:00
edmondlang e83ed7a339 Merge branch 'master' of gitlab.com:CIEFWorldwideSdnBhd/shipping-portal into container-profile-forms-ui
# Conflicts:
#	routes/web.php
2021-09-24 19:56:07 +08:00
omair saleh 09f598ffe5 show container total cbm 2021-09-23 18:35:58 +08:00
omair saleh 9719f1da77 show container total cbm 2021-09-23 18:34:53 +08:00
glovetleong 0c63a9e7ca complete container 2021-09-23 15:04:04 +08:00
glovetleong 7d332f01e5 update drop date
update dispatch date
2021-09-23 14:40:12 +08:00
glovetleong 24ea9d381e Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into package-ui-create 2021-09-22 18:14:55 +08:00
glovetleong 9aec13da74 reschedule container 2021-09-22 18:14:36 +08:00
glovetleong 16573e9e00 container create with n/a eta and etd 2021-09-22 15:39:33 +08:00
omair saleh 8039446db5 tooltip for copying invitation link 2021-09-22 14:57:29 +08:00
omair saleh a8e26c4dd6 invitation link registration 2021-09-22 14:20:50 +08:00
omair saleh 65493e6c90 invitation link registration 2021-09-22 14:14:47 +08:00
edmondlang 36018f48b4 Merge branch 'package-ui-create' of gitlab.com:CIEFWorldwideSdnBhd/shipping-portal into container-profile-forms-ui 2021-09-21 23:12:17 +08:00
edmondlang bf07a92873 container profile page ui 2021-09-21 22:37:08 +08:00
omair saleh fd8d9bd0db show claimed accounts in company profile 2021-09-21 02:51:50 +08:00
omair saleh 5b105caf0b show claimed accounts in company profile 2021-09-21 02:50:48 +08:00
omair saleh 1c5d814790 show claimed accounts in company profile 2021-09-21 02:39:58 +08:00
omair saleh c7b4b75982 exchange user table seeder 2021-09-21 02:31:04 +08:00
omair saleh fbfe68c1c2 exchange user table seeder 2021-09-21 02:19:41 +08:00
glovetleong 06b1258b55 merge branch 2021-09-20 16:54:16 +08:00
glovetleong b668708bd5 Merge branch 'package-switch-packing-list' into package-ui-create 2021-09-20 16:48:25 +08:00
glovetleong 13719d56a4 Merge branch 'assign-packing-list' into package-ui-create 2021-09-20 16:47:46 +08:00
glovetleong 26b4f012a8 Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into package-ui-create 2021-09-20 16:46:15 +08:00
glovetleong ad2d54cf0e package switch packing list 2021-09-20 15:34:28 +08:00
glovetleong e84f9d8bef assign packing list to container 2021-09-18 13:40:15 +08:00
glovetleong d7e2366fed container load 2021-09-18 09:56:41 +08:00
omair saleh f7c6873316 update vt portal url 2021-09-17 17:59:37 +08:00
Fairuz b8a145cb5c Excel library, controllers 2021-09-17 07:12:08 +08:00
Fairuz b5076a6f9d Excel library, controllers 2021-09-16 20:47:33 +08:00
glovetleong 2f6055c577 Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into package-ui-create 2021-09-15 21:31:13 +08:00
glovetleong 05ee6b3e98 create warehouse packing list
create shipping packing list
2021-09-15 21:30:49 +08:00
omair saleh 4626eb937e change container list to 5 per page 2021-09-15 18:29:34 +08:00
omair saleh 2be9a3dcfe remove logger from logout logic 2021-09-15 18:26:54 +08:00
omair saleh 1f05c4b56f remove timer from vt fetch jobs 2021-09-15 18:17:03 +08:00
omair saleh a3ecda8f8e round up cbm in container component 2021-09-14 17:26:33 +08:00
glovetleong 174992cc65 create package list ui
edit create package list api
2021-09-14 17:02:42 +08:00
omair saleh 3e23fa6809 revert changes for join table 2021-09-14 12:40:37 +08:00
omair saleh 41554be892 revert changes for join table 2021-09-14 12:32:18 +08:00
omair saleh a7c6c29c25 delete packages change migration 2021-09-14 12:15:17 +08:00
omair saleh 31c0b315b0 Merge branch 'task/EXC-328' into 'master'
Task/exc 328

See merge request CIEFWorldwideSdnBhd/shipping-portal!54
2021-09-14 03:45:35 +00:00
omair saleh 465c111bf1 Merge branch 'task/EXC-324' into 'master'
Join table from frontend

See merge request CIEFWorldwideSdnBhd/shipping-portal!53
2021-09-14 03:45:02 +00:00
omair saleh 0884bcf47a fix long reload issue for container on packing list status update 2021-09-12 17:12:59 +08:00
glovetleong 64f108163a package ui 2021-09-12 14:27:17 +08:00
Fairuz e80dbf4b49 Add timer, moved schedule to commands 2021-09-12 12:48:28 +08:00
Fairuz a203c5bf12 Add timer, moved schedule to commands 2021-09-12 12:46:26 +08:00
Fairuz 18b19fd90a Join table from frontend 2021-09-11 17:26:02 +08:00
omair saleh 2d1ec679eb fix delivery list job 2021-09-11 01:14:32 +08:00
omair saleh e43f7e2880 update packing list to complete after delivery updated 2021-09-11 00:39:39 +08:00
omair saleh 335a9f845e limit delivery list to first 50 2021-09-11 00:09:02 +08:00
omair saleh a5c652ef91 fix address resource loop 2021-09-10 23:55:20 +08:00
omair saleh 00c9fbfdca add db transactions back to packing lists 2021-09-10 23:48:35 +08:00
omair saleh 69180ef937 update delivery list for on hold goods 2021-09-10 23:20:19 +08:00
omair saleh bcffe4ef3e remove packing list database transactions 2021-09-10 23:10:26 +08:00
omair saleh b9794c8ff3 round up cbm 2021-09-10 23:07:24 +08:00
omair saleh 47f00e135b fix order resource loop 2021-09-10 18:26:28 +08:00
omair saleh f0c5ea8617 fix address resource owner bug 2021-09-10 18:18:48 +08:00
edmondlang 688832445a add the route for shipping queue 2021-09-10 16:41:30 +08:00
edmondlang f064ef2eff Merge branch 'master' of gitlab.com:CIEFWorldwideSdnBhd/shipping-portal into shipping-queue-ui
# Conflicts:
#	routes/web.php
2021-09-10 16:22:29 +08:00
edmondlang c652d8df1a shipping queue ui 2021-09-10 15:58:28 +08:00
omair saleh fa5f129af0 add container ref in the package component 2021-09-10 13:38:35 +08:00
omair saleh 06ac4c4e62 merge marking and order number in the container list 2021-09-10 13:12:02 +08:00
omair saleh b57f56dd8f change order address 2021-09-09 23:07:48 +08:00
omair saleh 1939f64cdf change order address 2021-09-09 22:57:02 +08:00
omair saleh 1ba5282244 Merge branch '319_order_address_change_ui' into 'master'
319 order address change ui

See merge request CIEFWorldwideSdnBhd/shipping-portal!52
2021-09-09 12:45:41 +00:00
omair saleh 1c9fba7f19 Merge branch '293_order_address_change' into 'master'
293 order address change

See merge request CIEFWorldwideSdnBhd/shipping-portal!51
2021-09-09 12:45:31 +00:00
omair saleh 512cca3445 fix redirect bug 2021-09-09 15:31:39 +08:00
weichien00 54211a5b72 feat: add approve change prder address component - admin access only. 2021-09-09 13:48:57 +08:00
omair saleh ade8b0fe4f fix cbm calculation bug 2021-09-09 13:26:05 +08:00
omair saleh 3d46895328 fix cbm calculation bug 2021-09-09 13:25:14 +08:00
omair saleh 9970277411 show company create date 2021-09-09 13:18:29 +08:00
omair saleh d77c0b1c06 show company create date 2021-09-09 13:17:32 +08:00
omair saleh ea08d1d998 show company create date 2021-09-09 13:13:59 +08:00
omair saleh d6915bc22f hold and release goods for delivery 2021-09-09 06:43:35 +08:00
omair saleh b4215a5bde hold and release goods for delivery 2021-09-09 06:22:06 +08:00
omair saleh ac3e6fba20 hold and release goods for delivery 2021-09-09 05:47:51 +08:00
omair saleh ee30ebb05d hold and release goods for delivery 2021-09-09 05:35:02 +08:00
omair saleh f21eb73f4a hold and release goods for delivery 2021-09-09 05:09:10 +08:00
omair saleh aa26fb97a0 hold and release goods for delivery 2021-09-09 04:31:32 +08:00
omair saleh 502b702a0a hold and release goods for delivery 2021-09-09 04:26:18 +08:00
omair saleh e426550c73 hold and release goods for delivery 2021-09-09 04:18:49 +08:00
omair saleh fab262a959 hold and release goods for delivery 2021-09-09 04:15:40 +08:00
omair saleh e9b8815f08 hold and release goods for delivery 2021-09-09 04:10:20 +08:00
omair saleh 8dab2a09ff hold and release goods for delivery 2021-09-09 04:05:51 +08:00
weichien00 a4b2e02ec3 wip-feat: request change order shipping address ui. 2021-09-09 01:49:44 +08:00
LEE WC 97adb6b03d Merge branch 'master' into '319_order_address_change_ui'
Master to 319_order_address_change_ui

See merge request CIEFWorldwideSdnBhd/shipping-portal!50
2021-09-08 15:36:17 +00:00
omair saleh a531361514 refresh orders button 2021-09-08 23:23:11 +08:00
omair saleh b24fbc36f9 refresh orders button 2021-09-08 23:19:04 +08:00
omair saleh 600a154714 List containers 2021-09-08 23:06:25 +08:00
omair saleh 0a4753579c Merge branch 'debug_api' into 'master'
Debug api

See merge request CIEFWorldwideSdnBhd/shipping-portal!49
2021-09-08 11:11:55 +00:00
omair saleh 5c021a4e2e Merge branch 'task/EXC-317' into 'master'
Updates on Packing List & Package

See merge request CIEFWorldwideSdnBhd/shipping-portal!46
2021-09-08 11:10:05 +00:00
omair saleh 0045fc22e6 Merge branch 'container-page-ui' into 'master'
Container page ui

See merge request CIEFWorldwideSdnBhd/shipping-portal!48
2021-09-08 11:09:19 +00:00
omair saleh 77e3641be9 add delivery address to warehouse list 2021-09-08 19:06:58 +08:00
edmondlang 536833fd93 Merge branch 'master' of gitlab.com:CIEFWorldwideSdnBhd/shipping-portal into container-page-ui 2021-09-08 16:57:24 +08:00
edmondlang f6115c4012 hide container in menu 2021-09-08 16:56:54 +08:00
edmondlang 5e416f1760 Merge branch 'master' of gitlab.com:CIEFWorldwideSdnBhd/shipping-portal into payment-and-billing-ui 2021-09-08 16:45:36 +08:00
edmondlang d23b59b8e9 payment and billing ui 2021-09-08 16:44:24 +08:00
LEE WC 9a047faece Merge branch '293_order_address_change' into '319_order_address_change_ui'
merge change order address api

See merge request CIEFWorldwideSdnBhd/shipping-portal!47
2021-09-07 06:04:10 +00:00
LEE WC c6865bb5f6 Merge branch '319_order_address_change_ui' into '293_order_address_change'
# Conflicts:
#   app/Http/Resources/OrderResource.php
2021-09-07 06:01:11 +00:00
Fairuz cdaa395824 Updates on Packing List & Package 2021-09-07 09:51:04 +08:00
glovetleong c96a2b71d1 update api 2021-09-06 15:22:28 +08:00
glovetleong 102905df06 Container, Transport, Schedule Api Debug 2021-09-06 14:52:56 +08:00
omair saleh 7f8a4af3fe add marking to arrived parcel components 2021-09-06 13:03:45 +08:00
omair saleh a2f4e1f3fd Revert "add marking to arrived parcel components"
This reverts commit 91c8424dc5.
2021-09-06 13:00:31 +08:00
omair saleh 1933030e9a Revert "add marking to arrived parcel components"
This reverts commit 50cbafce25.
2021-09-06 12:59:11 +08:00
omair saleh 50cbafce25 add marking to arrived parcel components 2021-09-06 12:52:27 +08:00
omair saleh 91c8424dc5 add marking to arrived parcel components 2021-09-06 12:52:11 +08:00
omair saleh 6009e82994 add marking to arrived parcel components 2021-09-06 12:48:57 +08:00
omair saleh 7d67e13b9e change schedule for vt portal fetch 2021-09-05 20:12:52 +08:00
edmondlang b9ab2e9f36 Merge branch 'master' of gitlab.com:CIEFWorldwideSdnBhd/shipping-portal into container-page-ui
# Conflicts:
#	resources/views/partials/menu.blade.php
2021-09-04 16:30:55 +08:00
edmondlang 51d999e3c8 add container page ui 2021-09-04 16:22:09 +08:00
omair saleh b049c95ca2 change schedule for vt portal fetch 2021-09-03 17:25:17 +08:00
omair saleh 3ee8afc4a4 add new schedule for fetching from vt at 11:30 am 2021-09-03 13:07:31 +08:00
omair saleh 1edcb296f3 sort orders by latest 2021-09-02 22:39:37 +08:00
omair saleh 51f1b3adcb change scheduled jobs into a chain 2021-09-02 22:32:01 +08:00
omair saleh 8e05c287b8 frontend suggested changes 2021-09-02 22:25:03 +08:00
omair saleh 050dc8ac7b frontend suggested changes 2021-09-02 22:20:01 +08:00
omair saleh 842fc52b4e fix warehouse list bugs 2021-09-02 16:51:10 +08:00
omair saleh 7008a01b11 fix reschedule containers etd bug 2021-09-02 12:27:40 +08:00
weichien00 e0405bca1e swagger: add show order, request address change, and approve address change api endpoint. 2021-08-19 01:35:23 +08:00
weichien00 6fb5d66631 feat: add route for request and approve address change. 2021-08-19 01:33:50 +08:00
weichien00 5a043e89a0 feat: API to approve order address change. 2021-08-19 01:33:16 +08:00
weichien00 3c20386875 feat: API to request change order address 2021-08-19 01:31:27 +08:00
205 changed files with 7926 additions and 624 deletions
+2 -1
View File
@@ -24,4 +24,5 @@ db/*
docker-compose.yml
package-lock.json
public/*
/public/*
/public/*
storage/framework/laravel-excel/*
@@ -43,4 +43,4 @@ abstract class AbstractListRecord extends AbstractGetRecord
}
}
}
@@ -0,0 +1,21 @@
<?php
namespace App\Classes\General\Eloquent\Filters;
use Carbon\Carbon;
use Illuminate\Database\Eloquent\Builder;
class CreatedAfter implements Filter
{
/**
* @param Builder $builder
* @param $value
* @return mixed
*/
public static function apply(Builder $builder, $value)
{
return $builder->where('created_at', '>', Carbon::parse($value));
}
}
@@ -14,7 +14,7 @@ class Reference implements Filter
*/
public static function apply(Builder $builder, $value)
{
return $builder->where('Reference', '=', $value);
return $builder->where('reference', '=', $value);
}
}
@@ -0,0 +1,20 @@
<?php
namespace App\Classes\General\Eloquent\Filters;
use Illuminate\Database\Eloquent\Builder;
class ReferenceLike implements Filter
{
/**
* @param Builder $builder
* @param $value
* @return Builder|mixed
*/
public static function apply(Builder $builder, $value)
{
return $builder->where('reference', 'LIKE', '%'.$value.'%');
}
}
@@ -0,0 +1,20 @@
<?php
namespace App\Classes\General\Eloquent\Filters;
use Illuminate\Database\Eloquent\Builder;
class WithConfirmedOrders implements Filter
{
/**
* @param Builder $builder
* @param $value
* @return mixed
*/
public static function apply(Builder $builder, $value)
{
return $builder->whereHas('parcels');
}
}
@@ -0,0 +1,20 @@
<?php
namespace App\Classes\General\Eloquent\Filters;
use Illuminate\Database\Eloquent\Builder;
class WithOwner implements Filter
{
/**
* @param Builder $builder
* @param $value
* @return mixed
*/
public static function apply(Builder $builder, $value)
{
return $builder->with('owner');
}
}
@@ -0,0 +1,20 @@
<?php
namespace App\Classes\General\Eloquent\Filters;
use Illuminate\Database\Eloquent\Builder;
class WithPackingLists implements Filter
{
/**
* @param Builder $builder
* @param $value
* @return mixed
*/
public static function apply(Builder $builder, $value)
{
return $builder->with('packingLists');
}
}
@@ -0,0 +1,20 @@
<?php
namespace App\Classes\General\Eloquent\Filters;
use Illuminate\Database\Eloquent\Builder;
class WithoutConfirmedOrders implements Filter
{
/**
* @param Builder $builder
* @param $value
* @return mixed
*/
public static function apply(Builder $builder, $value)
{
return $builder->whereDoesntHave('parcels');
}
}
@@ -0,0 +1,13 @@
<?php
namespace App\Classes\General\Interfaces;
use Illuminate\Database\Eloquent\Relations\MorphMany;
interface Remarkable
{
public function remarks(): morphMany;
}
+3 -3
View File
@@ -45,7 +45,7 @@ class CurlContainerListJob implements ShouldQueue
$last_two_month = Carbon::now()->subMonth(2)->format('Y-m-d');
$client = new \GuzzleHttp\Client(['headers' => $headers]);
$res = $client->post('https://portalvt.azurewebsites.net/Services/DataControllerService.asmx/GetPage', [\GuzzleHttp\RequestOptions::JSON => json_decode('{"controller":"VCustomercontainer","view":"grid1","request":{"PageIndex":' . $this->page . ',"PageSize":10,"PageOffset":0,"SortExpression":"CreatedOn DESC","GroupExpression":"","Filter":["LoadedTime:<=%js%\"' . $last_two_month . 'T00:00:00.000\"\u0000"],"ContextKey":"view1","FilterIsExternal":false,"LookupContextFieldName":null,"LookupContextController":null,"LookupContextView":null,"LookupContext":null,"Inserting":false,"LastCommandName":null,"ExternalFilter":[],"DoesNotRequireData":false,"LastView":"grid1","Tag":null,"RequiresFirstLetters":false,"ViewType":"Grid","SupportsCaching":true,"SystemFilter":null,"RequiresRowCount":true,"QuickFindHint":null,"RequiresPivot":false,"PivotDefinitions":null,"RequiresMetaData":true}}')]);
$res = $client->post('http://portal.vtnation.com.my/Services/DataControllerService.asmx/GetPage', [\GuzzleHttp\RequestOptions::JSON => json_decode('{"controller":"VCustomercontainer","view":"grid1","request":{"PageIndex":' . $this->page . ',"PageSize":10,"PageOffset":0,"SortExpression":"CreatedOn DESC","GroupExpression":"","Filter":["LoadedTime:<=%js%\"' . $last_two_month . 'T00:00:00.000\"\u0000"],"ContextKey":"view1","FilterIsExternal":false,"LookupContextFieldName":null,"LookupContextController":null,"LookupContextView":null,"LookupContext":null,"Inserting":false,"LastCommandName":null,"ExternalFilter":[],"DoesNotRequireData":false,"LastView":"grid1","Tag":null,"RequiresFirstLetters":false,"ViewType":"Grid","SupportsCaching":true,"SystemFilter":null,"RequiresRowCount":true,"QuickFindHint":null,"RequiresPivot":false,"PivotDefinitions":null,"RequiresMetaData":true}}')]);
$data = json_decode($res->getBody()->getContents());
@@ -63,7 +63,7 @@ class CurlContainerListJob implements ShouldQueue
{
// get latest cookies
$client = new \GuzzleHttp\Client(['cookies' => true]);
$r = $client->request('GET', 'https://portalvt.azurewebsites.net');
$r = $client->request('GET', 'http://portal.vtnation.com.my');
$call_cookie = $client->getConfig('cookies');
$call_cookie = $call_cookie->toArray();
$latest_cookie = [];
@@ -79,7 +79,7 @@ class CurlContainerListJob implements ShouldQueue
'Cookie' => $latest_cookie,
];
$client = new \GuzzleHttp\Client(['headers' => $headers]);
$res = $client->post('https://portalvt.azurewebsites.net/Services/DataControllerService.asmx/Login', [\GuzzleHttp\RequestOptions::JSON => [
$res = $client->post('http://portal.vtnation.com.my/Services/DataControllerService.asmx/Login', [\GuzzleHttp\RequestOptions::JSON => [
"username" => "CIEF",
"password" => "0122120880",
"createPersistentCookie" => true,
@@ -0,0 +1,105 @@
<?php
namespace App\Classes\Modules\Accounts\ControllersLogic;
use App\Classes\Exceptions\AccessForbiddenException;
use App\Classes\General\Abstracts\AbstractControllerLogic;
use App\Classes\Modules\Accounts\Processors\AuthenticationProcessor;
use App\Classes\Modules\Accounts\Processors\CreateUserProcessor;
use App\Classes\Modules\Companies\Processors\AssignEmployeeProcessor;
use App\Classes\Modules\Companies\DataTransferObjects\EmploymentObject;
use App\Classes\Modules\Companies\Services\FetchesCompany;
use App\Classes\Modules\Contacts\DataTransferObjects\ContactObject;
use App\Classes\Modules\Contacts\Processors\CreateContactProcessor;
use App\Classes\ValueObjects\Constants\ApprovalStatus;
use App\Classes\ValueObjects\Constants\RoleTypes;
use App\Models\Company;
use App\Models\CompanyModule;
use App\Models\User;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\App;
class CreateInvitedCustomerLogic extends AbstractControllerLogic
{
/**
* @return array
*/
protected function notification(): array
{
return [
'title' => 'Created User',
'message' => 'You have successfully created a new User'
];
}
/** @var CreateUserProcessor */
private $createUserProcessor;
/** @var CreateContactProcessor */
private $createContactProcessor;
/** @var FetchesCompany */
private $fetchesCompany;
/** @var AssignEmployeeProcessor */
private $assignEmployeeProcessor;
/** @var AuthenticationProcessor */
private $authenticationProcessor;
/**
* CreateInvitedCustomerLogic constructor.
* @param CreateUserProcessor $createUserProcessor
* @param CreateContactProcessor $createContactProcessor
* @param FetchesCompany $fetchesCompany
* @param AssignEmployeeProcessor $assignEmployeeProcessor
* @param AuthenticationProcessor $authenticationProcessor
*/
public function __construct(CreateUserProcessor $createUserProcessor, CreateContactProcessor $createContactProcessor, FetchesCompany $fetchesCompany, AssignEmployeeProcessor $assignEmployeeProcessor, AuthenticationProcessor $authenticationProcessor)
{
$this->createUserProcessor = $createUserProcessor;
$this->createContactProcessor = $createContactProcessor;
$this->fetchesCompany = $fetchesCompany;
$this->assignEmployeeProcessor = $assignEmployeeProcessor;
$this->authenticationProcessor = $authenticationProcessor;
}
/**
* @param Request $request
* @return JsonResponse
* @throws \App\Classes\Exceptions\AccessForbiddenException
* @throws \App\Classes\Exceptions\AccessUnauthorisedException
* @throws \App\Classes\Exceptions\MalformedRequestException
* @throws \App\Classes\Exceptions\RequestValidationException
*/
public function logic(Request $request): JsonResponse
{
/** @var Company $company */
$company = $this->fetchesCompany->execute(['id' => $request->input('company_id')]);
/** @var CompanyModule $companyModule */
$companyModule = $company->companyModules()->first();
if($companyModule->employees()->exists()){
throw new AccessForbiddenException('This company\'s account has been claimed by another user already!');
}
/** @var User $user */
$user = $this->createUserProcessor->execute($request, RoleTypes::USER, !App::environment(['production']) ? ApprovalStatus::APPROVED : ApprovalStatus::PENDING_VERIFICATION);
$contactObject = new ContactObject($request->input('name'), $request->input('phone'), $request->input('contact_email'), $request->input('wechat_id'));
$this->createContactProcessor->execute($contactObject, $company);
$Object = new EmploymentObject($companyModule, $user);
$this->assignEmployeeProcessor->execute($Object);
return $this->response($this->authenticationProcessor->execute($request));
}
}
@@ -37,7 +37,6 @@ class LogoutUserLogic extends AbstractControllerLogic
*/
protected function logic(Request $request): JsonResponse {
logger("logout");
$this->invalidatesAuthenticationToken->execute();
return $this->response();
@@ -3,6 +3,7 @@
namespace App\Classes\Modules\Addresses\DataTransferObjects;
use App\Classes\General\Interfaces\DataTransferObject;
use App\Classes\ValueObjects\Constants\ApprovalStatus;
class AddressObject implements DataTransferObject
{
@@ -38,7 +39,7 @@ class AddressObject implements DataTransferObject
* @param int $postCode
* @param null|string $reference
*/
public function __construct(string $streetOne, ?string $streetTwo, int $countryId, int $stateId, int $districtId, int $postCode, ?string $reference = null)
public function __construct(string $streetOne, ?string $streetTwo, int $countryId, int $stateId, int $districtId, int $postCode, ?string $reference = null, ?int $status = ApprovalStatus::APPROVED)
{
$this->streetOne = $streetOne;
$this->streetTwo = $streetTwo;
@@ -47,6 +48,7 @@ class AddressObject implements DataTransferObject
$this->districtId = $districtId;
$this->postCode = $postCode;
$this->reference = $reference;
$this->status = $status;
}
/**
@@ -105,5 +107,13 @@ class AddressObject implements DataTransferObject
return $this->reference;
}
/**
* @return int
*/
public function getStatus(): int
{
return $this->status;
}
}
@@ -7,6 +7,7 @@ use App\Classes\Modules\Addresses\Services\CleansOldAddress;
use App\Classes\Modules\Addresses\Services\CreatesAddress;
use App\Classes\Modules\Addresses\Services\FetchesAddress;
use App\Models\OldAddress;
use App\Models\Order;
use Illuminate\Database\Eloquent\Model;
class CreateAddressFromOldAddressProcessor
@@ -44,8 +45,8 @@ class CreateAddressFromOldAddressProcessor
}
if($address = $addressable->addresses()->where('street_one', $object->getStreetOne())->first()){
return $address;
if(!$addressable instanceof Order && $address = $addressable->addresses()->where('street_one', $object->getStreetOne())->first()) {
return $address;
}
return $this->createsAddress->execute($addressable, $object);
@@ -28,6 +28,7 @@ class CreatesAddress extends AbstractUpdateRelationshipRecord
$model->state_id = $object->getStateId();
$model->district_id = $object->getDistrictId();
$model->postcode = $object->getPostCode();
$model->status = $object->getStatus();
return $this->handler($addressable->addresses(), $model);
@@ -0,0 +1,44 @@
<?php
namespace App\Classes\Modules\Orders\ControllersLogic;
use App\Classes\General\Abstracts\AbstractControllerLogic;
use App\Classes\Modules\Orders\Processors\ApproveChangeOrderAddressProcessor;
use App\Http\Resources\AddressResource;
use App\Http\Resources\OrderResource;
use Illuminate\Http\Request;
use Illuminate\Http\JsonResponse;
class ApproveChangeOrderAddressLogic extends AbstractControllerLogic
{
/**
* @return array
*/
protected function notification(): array
{
return [
'title' => 'Change Order Address Approval',
'message' => 'You have successfully change the order address'
];
}
/** @var ApproveChangeOrderAddressProcessor */
private $approveChangeOrderAddressProcessor;
/**
* ApproveChangeOrderAddressLogic constructor.
* @param ApproveChangeOrderAddressProcessor $approveChangeOrderAddressProcessor
*/
public function __construct(ApproveChangeOrderAddressProcessor $approveChangeOrderAddressProcessor)
{
$this->approveChangeOrderAddressProcessor = $approveChangeOrderAddressProcessor;
}
public function logic(Request $request): JsonResponse
{
$address = $this->approveChangeOrderAddressProcessor->execute($request);
return $this->resourceResponse(new AddressResource($address));
}
}
@@ -0,0 +1,118 @@
<?php
namespace App\Classes\Modules\Orders\ControllersLogic;
use App\Classes\General\Abstracts\AbstractControllerLogic;
use App\Classes\Modules\PackingLists\Processors\CreatePackingListProcessor;
use App\Classes\Modules\PackingLists\Processors\CreatePackageProcessor;
use App\Classes\Modules\Orders\Services\FetchesOrder;
use App\Classes\Modules\Transports\Services\CreatesTransport;
use App\Classes\Modules\PackingLists\Services\GeneratesPackingListReferenceNumber;
use App\Classes\Modules\Schedules\Services\CreatesSchedule;
use App\Classes\Modules\PackingLists\DataTransferObjects\PackingListObject;
use App\Classes\Modules\PackingLists\DataTransferObjects\PackageObject;
use App\Classes\Modules\Transports\DataTransferObjects\TransportObject;
use App\Classes\Modules\Schedules\DataTransferObjects\ScheduleObject;
use App\Classes\ValueObjects\Constants\ApprovalStatus;
use App\Classes\ValueObjects\Constants\OrderRoleTypes;
use App\Classes\ValueObjects\Constants\PackingListType;
use App\Classes\ValueObjects\Constants\TransportType;
use App\Http\Resources\PackingListResource;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Carbon\Carbon;
class CreateShippingPackingListLogic extends AbstractControllerLogic
{
/**
* @return array
*/
protected function notification():array {
return [
'title' => 'Created PackingList',
'message' => 'You have successfully created a new PackingList'
];
}
/** @var CreatePackingListProcessor */
private $createPackingListProcessor;
/** @var GeneratesPackingListReferenceNumber */
private $generatesPackingListReferenceNumber;
/** @var CreatesTransport */
private $createsTransport;
/** @var CreatePackageProcessor */
private $createPackageProcessor;
/** @var CreatesSchedule */
private $createsSchedule;
/** @var FetchesOrder */
private $fetchesOrder;
/**
* CreatePackingListLogic constructor.
* @param CreatePackingListProcessor $createPackingListProcessor
* @param FetchesOrder $fetchesOrder
*/
public function __construct(
CreatePackingListProcessor $createPackingListProcessor,
CreatesTransport $createsTransport,
CreatesSchedule $createsSchedule,
CreatePackageProcessor $createPackageProcessor,
GeneratesPackingListReferenceNumber $generatesPackingListReferenceNumber,
FetchesOrder $fetchesOrder
)
{
$this->createPackingListProcessor = $createPackingListProcessor;
$this->createsTransport = $createsTransport;
$this->createsSchedule = $createsSchedule;
$this->createPackageProcessor = $createPackageProcessor;
$this->generatesPackingListReferenceNumber = $generatesPackingListReferenceNumber;
$this->fetchesOrder = $fetchesOrder;
}
/**
* @param Request $request
* @return JsonResponse
*/
public function logic(Request $request) : JsonResponse
{
$order = $this->fetchesOrder->execute(['id' => $request->input('order_id')]);
$reference_number = $this->generatesPackingListReferenceNumber->execute();
$packingListObject = new PackingListObject(
$reference_number,
$order->orderRoles()->where('role_id', '=', OrderRoleTypes::ORIGIN_WAREHOUSE)->first()->appointee->id,
PackingListType::SHIPPING_PACKING_LIST,
ApprovalStatus::PENDING_SUBMISSION
);
$packingList = $this->createPackingListProcessor->execute($packingListObject, $order);
$packages = $request->input('packages');
foreach ($packages as $key => $row) {
$packageObject = new PackageObject(
$row['type'],
$row['description'],
$row['width'],
$row['height'],
$row['length'],
$row['weight'],
$row['quantity'],
ApprovalStatus::APPROVED,
$row['reference'],
);
$this->createPackageProcessor->execute($packageObject, $packingList);
}
return $this->resourceResponse(new PackingListResource($packingList));
}
}
@@ -0,0 +1,124 @@
<?php
namespace App\Classes\Modules\Orders\ControllersLogic;
use App\Classes\General\Abstracts\AbstractControllerLogic;
use App\Classes\Modules\PackingLists\Processors\CreatePackingListProcessor;
use App\Classes\Modules\PackingLists\Processors\CreatePackageProcessor;
use App\Classes\Modules\Orders\Services\FetchesOrder;
use App\Classes\Modules\Transports\Services\CreatesTransport;
use App\Classes\Modules\PackingLists\Services\GeneratesPackingListReferenceNumber;
use App\Classes\Modules\Schedules\Services\CreatesSchedule;
use App\Classes\Modules\PackingLists\DataTransferObjects\PackingListObject;
use App\Classes\Modules\PackingLists\DataTransferObjects\PackageObject;
use App\Classes\Modules\Transports\DataTransferObjects\TransportObject;
use App\Classes\Modules\Schedules\DataTransferObjects\ScheduleObject;
use App\Classes\ValueObjects\Constants\ApprovalStatus;
use App\Classes\ValueObjects\Constants\OrderRoleTypes;
use App\Classes\ValueObjects\Constants\PackingListType;
use App\Classes\ValueObjects\Constants\TransportType;
use App\Http\Resources\PackingListResource;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Carbon\Carbon;
class CreateWarehousePackingListLogic extends AbstractControllerLogic
{
/**
* @return array
*/
protected function notification():array {
return [
'title' => 'Created Warehouse PackingList',
'message' => 'You have successfully created a new Warehouse PackingList'
];
}
/** @var CreatePackingListProcessor */
private $createPackingListProcessor;
/** @var GeneratesPackingListReferenceNumber */
private $generatesPackingListReferenceNumber;
/** @var CreatesTransport */
private $createsTransport;
/** @var CreatePackageProcessor */
private $createPackageProcessor;
/** @var CreatesSchedule */
private $createsSchedule;
/** @var FetchesOrder */
private $fetchesOrder;
/**
* CreatePackingListLogic constructor.
* @param CreatePackingListProcessor $createPackingListProcessor
* @param FetchesOrder $fetchesOrder
*/
public function __construct(
CreatePackingListProcessor $createPackingListProcessor,
CreatesTransport $createsTransport,
CreatesSchedule $createsSchedule,
CreatePackageProcessor $createPackageProcessor,
GeneratesPackingListReferenceNumber $generatesPackingListReferenceNumber,
FetchesOrder $fetchesOrder
)
{
$this->createPackingListProcessor = $createPackingListProcessor;
$this->createsTransport = $createsTransport;
$this->createsSchedule = $createsSchedule;
$this->createPackageProcessor = $createPackageProcessor;
$this->generatesPackingListReferenceNumber = $generatesPackingListReferenceNumber;
$this->fetchesOrder = $fetchesOrder;
}
/**
* @param Request $request
* @return JsonResponse
*/
public function logic(Request $request) : JsonResponse
{
$order = $this->fetchesOrder->execute(['id' => $request->input('order_id')]);
$reference_number = $this->generatesPackingListReferenceNumber->execute();
$packingListObject = new PackingListObject(
$reference_number,
$order->orderRoles()->where('role_id', '=', OrderRoleTypes::ORIGIN_WAREHOUSE)->first()->appointee->id,
PackingListType::WAREHOUSE_RECEIVE_LIST,
ApprovalStatus::PENDING_SUBMISSION
);
$packingList = $this->createPackingListProcessor->execute($packingListObject, $order);
$transportObject = new TransportObject(TransportType::LAND, null, $request->input('tracking'), Carbon::parse($request->input('receive_date')), Carbon::parse($request->input('receive_date')), ApprovalStatus::APPROVED);
$transport = $this->createsTransport->execute($transportObject, $packingList);
$scheduleObject = new ScheduleObject(Carbon::parse($request->input('receive_date')), Carbon::parse($request->input('receive_date')), ApprovalStatus::APPROVED);
$schedule = $this->createsSchedule->execute($transport, $scheduleObject);
$packages = $request->input('packages');
foreach ($packages as $key => $row) {
$packageObject = new PackageObject(
$row['type'],
$row['description'],
$row['width'],
$row['height'],
$row['length'],
$row['weight'],
$row['quantity'],
ApprovalStatus::APPROVED,
$row['reference'],
);
$this->createPackageProcessor->execute($packageObject, $packingList);
}
return $this->resourceResponse(new PackingListResource($packingList));
}
}
@@ -52,7 +52,7 @@ class FetchOrderLogic extends AbstractControllerLogic
$this->canFetchOrder->passes();
$query = $this->fetchesOrder->execute(['reference' => $request->route('id'), 'with_parcels' => true]);
$query = $this->fetchesOrder->execute(['reference' => $request->route('id'), 'with_packing_lists' => true]);
return $this->resourceResponse(new OrderResource($query));
@@ -0,0 +1,49 @@
<?php
namespace App\Classes\Modules\Orders\ControllersLogic;
use App\Classes\General\Abstracts\AbstractControllerLogic;
use App\Classes\Modules\Orders\Processors\RequestChangeOrderAddressProcessor;
use App\Http\Resources\OrderResource;
use Illuminate\Http\Request;
use Illuminate\Http\JsonResponse;
class RequestChangeOrderAddressLogic extends AbstractControllerLogic
{
/**
* @return array
*/
protected function notification(): array
{
return [
'title' => 'Request To Change Order Address',
'message' => 'You have successfully request to change order address'
];
}
/** @var RequestChangeOrderAddressProcessor */
private $requestChangeOrderAddressProcessor;
/**
* RequestChangeOrderAddressLogic constructor.
* @param RequestChangeOrderAddressProcessor $requestChangeOrderAddressProcessor
*/
public function __construct(RequestChangeOrderAddressProcessor $requestChangeOrderAddressProcessor)
{
$this->requestChangeOrderAddressProcessor = $requestChangeOrderAddressProcessor;
}
/**
* @param Request $request
* @return JsonResponse
* @throws \App\Classes\Exceptions\MalformedRequestException
*/
public function logic(Request $request): JsonResponse
{
$order = $this->requestChangeOrderAddressProcessor->execute($request);
return $this->resourceResponse(new OrderResource($order));
}
}
@@ -0,0 +1,61 @@
<?php
namespace App\Classes\Modules\Orders\Processors;
use App\Classes\Modules\Addresses\Services\FetchesAddress;
use App\Classes\Modules\Orders\Standards\Rules\CanApproveChangeOrderAddress;
use App\Classes\Modules\Orders\Services\UpdatesOrdersAddress;
use App\Classes\ValueObjects\Constants\ApprovalStatus;
use Illuminate\Http\Request;
class ApproveChangeOrderAddressProcessor
{
/** @var CanApproveChangeOrderAddress */
private $canApproveChangeOrderAddress;
/** @var FetchesAddress */
private $fetchesAddress;
/** @var UpdatesOrdersAddress */
private $updatesOrdersAddress;
/**
* ApproveChangeOrderAddressProcessor constructor.
* @param CanApproveChangeOrderAddress $canApproveChangeOrderAddress
* @param FetchesAddress $fetchesAddress
* @param UpdatesOrdersAddress $updatesOrdersAddress
*/
public function __construct(CanApproveChangeOrderAddress $canApproveChangeOrderAddress, FetchesAddress $fetchesAddress, UpdatesOrdersAddress $updatesOrdersAddress)
{
$this->canApproveChangeOrderAddress = $canApproveChangeOrderAddress;
$this->fetchesAddress = $fetchesAddress;
$this->updatesOrdersAddress = $updatesOrdersAddress;
}
/**
* @param Request $request
* @return mixed
* @throws \App\Classes\Exceptions\AccessForbiddenException
* @throws \App\Classes\Exceptions\MalformedRequestException
* @throws \App\Classes\Exceptions\RequestValidationException
*/
public function execute(Request $request)
{
$status = (int) $request->route('status');
$this->canApproveChangeOrderAddress->passes();
$address = $this->fetchesAddress->execute(['id' => $request->route('id')]);
if($status === ApprovalStatus::APPROVED){
$address->owner->addresses()->update(['status' => ApprovalStatus::EXPIRED]);
}
$this->updatesOrdersAddress->execute($address, $status);
return $address;
}
}
@@ -79,6 +79,7 @@ class CreateOrderRolesProcessor
$roleObject = new OrderRoleObject($order, $destinationWarehouse, OrderRoleTypes::DESTINATION_WAREHOUSE);
$this->createsOrderRole->execute($roleObject);
$roleObject = new OrderRoleObject($order, $freightForwarder, OrderRoleTypes::LAST_MILE_DELIVERY_DRIVER);
$this->createsOrderRole->execute($roleObject);
@@ -0,0 +1,66 @@
<?php
namespace App\Classes\Modules\Orders\Processors;
use App\Classes\Modules\Orders\Standards\Rules\CanChangeOrderAddress;
use App\Classes\Modules\Orders\Services\FetchesOrder;
use App\Classes\Modules\Addresses\Services\CreatesAddress;
use App\Classes\Modules\Addresses\Services\FetchesAddress;
use App\Classes\Modules\Addresses\Services\DeletesAddress;
use App\Classes\Modules\Addresses\DataTransferObjects\AddressObject;
use App\Classes\ValueObjects\Constants\ApprovalStatus;
use Illuminate\Http\Request;
class RequestChangeOrderAddressProcessor
{
/** @var CanChangeOrderAddress */
private $canChangeOrderAddress;
/** @var FetchesOrder */
private $fetchesOrder;
/** @var FetchesAddress */
private $fetchesAddress;
/** @var CreatesAddress */
private $createsAddress;
/** @var DeletesAddress */
private $deletesAddress;
/**
* ChangeOrderAddressProcessor constructor.
* @param FetchesOrder $fetchesOrder
* @param CreatesAddress $createsAddress
* @param FetchesAddress $fetchesAddress
* @param DeletesAddress $deletesAddress
*/
public function __construct(CanChangeOrderAddress $canChangeOrderAddress, FetchesOrder $fetchesOrder, CreatesAddress $createsAddress, FetchesAddress $fetchesAddress, DeletesAddress $deletesAddress)
{
$this->canChangeOrderAddress = $canChangeOrderAddress;
$this->fetchesOrder = $fetchesOrder;
$this->createsAddress = $createsAddress;
$this->fetchesAddress = $fetchesAddress;
$this->deletesAddress = $deletesAddress;
}
public function execute(Request $request)
{
$this->canChangeOrderAddress->passes();
$order = $this->fetchesOrder->execute(['id' => $request->get('order_id')]);
foreach ($order->addressesPendingVerification as $address) {
$this->deletesAddress->execute($address);
}
$address = $this->fetchesAddress->execute(['id' => $request->get('address_id')]);
$addressObject = new AddressObject($address->street_one, $address->street_two, $address->country_id, $address->state_id, $address->district_id, $address->postcode, $address->reference, ApprovalStatus::PENDING_VERIFICATION);
$this->createsAddress->execute($order, $addressObject);
return $order;
}
}
@@ -68,7 +68,7 @@ class FetchesDataFromVTPortal
$latest_cookie = [];
$cookieRequest = new \GuzzleHttp\Client(['cookies' => true]);
$cookieRequest->get('https://portalvt.azurewebsites.net');
$cookieRequest->get('http://portal.vtnation.com.my');
foreach ($cookieRequest->getConfig('cookies')->toArray() as $key => $row) {
$latest_cookie[] = $row['Name'] . '=' . $row['Value'];
}
@@ -77,7 +77,7 @@ class FetchesDataFromVTPortal
/** @var $loginRequest */
$loginRequest = $this->clientRequest('https://portalvt.azurewebsites.net/Services/DataControllerService.asmx/Login', 'POST', [
$loginRequest = $this->clientRequest('http://portal.vtnation.com.my/Services/DataControllerService.asmx/Login', 'POST', [
"username" => "CIEF",
"password" => "0122120880",
"createPersistentCookie" => true,
@@ -0,0 +1,21 @@
<?php
namespace App\Classes\Modules\Orders\Services;
use App\Classes\General\Eloquent\AbstractUpdateRecord;
use App\Models\Address;
class UpdatesOrdersAddress extends AbstractUpdateRecord
{
/**
* @param Address $address
* @param int $type
* @return \Illuminate\Database\Eloquent\Model
* @throws \App\Classes\Exceptions\MalformedRequestException
*/
public function execute(Address $address, int $type)
{
$address->status = $type;
return $this->handler($address);
}
}
@@ -0,0 +1,39 @@
<?php
namespace App\Classes\Modules\Orders\Standards\Rules;
use App\Classes\General\Abstracts\AbstractRule;
class CanApproveChangeOrderAddress extends AbstractRule
{
/**
* @return bool
*/
protected function authorized(): bool
{
// TODO Set Authorization rules
return true;
}
/**
* @param OrderObject $object
* @return bool
*/
protected function validators($object): bool
{
return true;
}
/**
* @param OrderObject $object
* @return bool
*/
protected function criteria($object): bool
{
return true;
}
}
@@ -0,0 +1,39 @@
<?php
namespace App\Classes\Modules\Orders\Standards\Rules;
use App\Classes\General\Abstracts\AbstractRule;
class CanChangeOrderAddress extends AbstractRule
{
/**
* @return bool
*/
protected function authorized(): bool
{
// TODO Set Authorization rules
return true;
}
/**
* @param OrderObject $object
* @return bool
*/
protected function validators($object): bool
{
return true;
}
/**
* @param OrderObject $object
* @return bool
*/
protected function criteria($object): bool
{
return true;
}
}
@@ -0,0 +1,61 @@
<?php
namespace App\Classes\Modules\PackingLists\ControllersLogic;
use App\Classes\General\Abstracts\AbstractControllerLogic;
use App\Classes\Modules\PackingLists\Services\UpdatesPackingListStatus;
use App\Classes\Modules\PackingLists\Services\FetchesPackingList;
use App\Classes\ValueObjects\Constants\ApprovalStatus;
use App\Http\Resources\PackingListResource;
use ErrorException;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Carbon\Carbon;
class CompletePackingListLogic extends AbstractControllerLogic
{
/**
* @return array
*/
protected function notification():array {
return [
'title' => 'Updated PackingList',
'message' => 'You have successfully updated the PackingList'
];
}
/** @var UpdatesPackingListStatus */
private $updatesPackingListStatus;
/** @var FetchesPackingList */
private $fetchesPackingList;
/**
* CompletePackingListLogic constructor.
* @param CanUpdatePackingList $canUpdatePackingList
* @param UpdatesPackingListStatus $updatesPackingListStatus
* @param FetchesPackingList $fetchesPackingList
*/
public function __construct(UpdatesPackingListStatus $updatesPackingListStatus, FetchesPackingList $fetchesPackingList)
{
$this->updatesPackingListStatus = $updatesPackingListStatus;
$this->fetchesPackingList = $fetchesPackingList;
}
/**
* @param Request $request
* @return JsonResponse
* @throws ErrorException
*/
public function logic(Request $request) : JsonResponse
{
$packing_list = $this->fetchesPackingList->execute(['id' => $request->route('id')]);
$query = $this->updatesPackingListStatus->execute($packing_list, ApprovalStatus::COMPLETED);
return $this->resourceResponse(new PackingListResource($packing_list));
}
}
@@ -0,0 +1,67 @@
<?php
namespace App\Classes\Modules\PackingLists\ControllersLogic\Containers;
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 ErrorException;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
class AssignPackingListContainerLogic extends AbstractControllerLogic
{
/**
* @return array
*/
protected function notification():array {
return [
'title' => 'Assign Packing List Container',
'message' => 'You have successfully assign Packing List to Container'
];
}
/** @var FetchesContainer */
private $fetchesContainer;
/** @var FetchesPackingList */
private $fetchesPackingList;
/**
* DeleteContainerControllersLogic constructor.
* @param FetchesContainer $fetchesContainer
* @param FetchesPackingList $fetchesPackingList
*/
public function __construct(FetchesContainer $fetchesContainer, FetchesPackingList $fetchesPackingList)
{
$this->fetchesContainer = $fetchesContainer;
$this->fetchesPackingList = $fetchesPackingList;
}
/**
* @param Request $request
* @return JsonResponse
* @throws ErrorException
*/
public function logic(Request $request) : JsonResponse
{
try {
$container = $this->fetchesContainer->execute(['id' => $request->route('id')]);
$packing_list = $request->input('packing_list_id');
foreach ($packing_list as $key => $row) {
$packing_list_item = $this->fetchesPackingList->execute(['id' => $row]);
$container->packingLists()->attach($packing_list_item);
}
return $this->resourceResponse(new ContainerResource($container));
} catch (\Exception $exception){
throw new ErrorException($exception->getMessage(), $exception->getCode());
}
}
}
@@ -0,0 +1,61 @@
<?php
namespace App\Classes\Modules\PackingLists\ControllersLogic\Containers;
use App\Classes\General\Abstracts\AbstractControllerLogic;
use App\Classes\Modules\PackingLists\Services\Containers\UpdatesContainerStatus;
use App\Classes\Modules\PackingLists\Services\Containers\FetchesContainer;
use App\Classes\ValueObjects\Constants\ApprovalStatus;
use App\Http\Resources\ContainerResource;
use ErrorException;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Carbon\Carbon;
class CompleteContainerLogic extends AbstractControllerLogic
{
/**
* @return array
*/
protected function notification():array {
return [
'title' => 'Updated Container',
'message' => 'You have successfully updated the Container'
];
}
/** @var UpdatesContainerStatus */
private $updatesContainerStatus;
/** @var FetchesContainer */
private $fetchesContainer;
/**
* CompleteContainerLogic constructor.
* @param CanUpdateContainer $canUpdateContainer
* @param UpdatesContainerStatus $updatesContainerStatus
* @param FetchesContainer $fetchesContainer
*/
public function __construct(UpdatesContainerStatus $updatesContainerStatus, FetchesContainer $fetchesContainer)
{
$this->updatesContainerStatus = $updatesContainerStatus;
$this->fetchesContainer = $fetchesContainer;
}
/**
* @param Request $request
* @return JsonResponse
* @throws ErrorException
*/
public function logic(Request $request) : JsonResponse
{
$container = $this->fetchesContainer->execute(['id' => $request->route('id')]);
$query = $this->updatesContainerStatus->execute($container, ApprovalStatus::COMPLETED);
return $this->resourceResponse(new ContainerResource($container));
}
}
@@ -4,10 +4,12 @@ namespace App\Classes\Modules\PackingLists\ControllersLogic\Containers;
use App\Classes\General\Abstracts\AbstractControllerLogic;
use App\Classes\Modules\Companies\Services\FetchesCompanyModule;
use App\Classes\Modules\PackingLists\Services\Containers\CreatesContainer;
use App\Classes\Modules\PackingLists\Standards\Rules\Containers\CanCreateContainer;
use App\Classes\Modules\PackingLists\DataTransferObjects\ContainerObject;
use App\Classes\Modules\PackingLists\Services\FetchesPackingList;
use App\Http\Resources\ContainerResource;
use ErrorException;
use Illuminate\Http\JsonResponse;
@@ -21,8 +23,8 @@ class CreateContainerLogic extends AbstractControllerLogic
*/
protected function notification():array {
return [
'title' => 'Created PackingList',
'message' => 'You have successfully created a new PackingList'
'title' => 'Created Container',
'message' => 'You have successfully created a new Container'
];
}
@@ -32,13 +34,17 @@ class CreateContainerLogic extends AbstractControllerLogic
/** @var FetchesPackingList */
private $fetchesPackingList;
/** @var FetchesCompanyModule */
private $fetchesCompanyModule;
/** @var CreatesPackingList */
private $createsContainer;
public function __construct(CanCreateContainer $canCreateContainer, FetchesPackingList $fetchesPackingList, CreatesContainer $createsContainer)
public function __construct(CanCreateContainer $canCreateContainer, FetchesPackingList $fetchesPackingList, FetchesCompanyModule $fetchesCompanyModule, CreatesContainer $createsContainer)
{
$this->canCreateContainer = $canCreateContainer;
$this->fetchesPackingList = $fetchesPackingList;
$this->fetchesCompanyModule = $fetchesCompanyModule;
$this->createsContainer = $createsContainer;
}
@@ -51,15 +57,20 @@ class CreateContainerLogic extends AbstractControllerLogic
*/
public function logic(Request $request) : JsonResponse
{
$object = new ContainerObject($request->input('container_reference'), $request->input('container_type'), $request->input('seal_reference'));
$object = new ContainerObject(
$request->input('container_reference'),
$request->input('container_number'),
$request->input('seal_reference'),
$request->input('container_type'),
$request->input('loading_date'),
$request->input('status')
);
$this->canCreateContainer->passes($object);
$query = $this->createsContainer->execute($object);
$query = $this->createsContainer->execute($object, $this->fetchesCompanyModule->execute(['id' => $request->input('company_module_id')]));
return $this->resourceResponse(new ContainerResource($query));
}
}
@@ -0,0 +1,113 @@
<?php
namespace App\Classes\Modules\PackingLists\ControllersLogic\Containers;
use App\Classes\General\Abstracts\AbstractControllerLogic;
use App\Classes\Modules\Companies\Services\FetchesCompanyModule;
use App\Classes\Modules\PackingLists\Services\Containers\CreatesContainer;
use App\Classes\Modules\PackingLists\Standards\Rules\Containers\CanCreateContainer;
use App\Classes\Modules\Transports\Services\CreatesTransport;
use App\Classes\Modules\Schedules\Services\CreatesSchedule;
use App\Classes\Modules\PackingLists\DataTransferObjects\ContainerObject;
use App\Classes\Modules\Transports\DataTransferObjects\TransportObject;
use App\Classes\Modules\Schedules\DataTransferObjects\ScheduleObject;
use App\Classes\Modules\PackingLists\Services\FetchesPackingList;
use App\Classes\ValueObjects\Constants\TransportType;
use App\Classes\ValueObjects\Constants\ApprovalStatus;
use App\Http\Resources\ContainerResource;
use ErrorException;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Carbon\Carbon;
class CreateLoadContainerLogic extends AbstractControllerLogic
{
/**
* @return array
*/
protected function notification():array {
return [
'title' => 'Created Container',
'message' => 'You have successfully created a new Container'
];
}
/** @var CanCreateContainer */
private $canCreateContainer;
/** @var FetchesPackingList */
private $fetchesPackingList;
/** @var FetchesCompanyModule */
private $fetchesCompanyModule;
/** @var CreatesPackingList */
private $createsContainer;
/** @var CreatesTransport */
private $createsTransport;
/** @var CreatesSchedule */
private $createsSchedule;
public function __construct(
CanCreateContainer $canCreateContainer,
FetchesPackingList $fetchesPackingList,
FetchesCompanyModule $fetchesCompanyModule,
CreatesContainer $createsContainer,
CreatesTransport $createsTransport,
CreatesSchedule $createsSchedule
)
{
$this->canCreateContainer = $canCreateContainer;
$this->fetchesPackingList = $fetchesPackingList;
$this->fetchesCompanyModule = $fetchesCompanyModule;
$this->createsContainer = $createsContainer;
$this->createsTransport = $createsTransport;
$this->createsSchedule = $createsSchedule;
}
/**
* @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
{
$object = new ContainerObject(
$request->input('container_reference'),
$request->input('container_number'),
$request->input('seal_reference'),
$request->input('container_type'),
ApprovalStatus::APPROVED
);
$this->canCreateContainer->passes($object);
$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')),
ApprovalStatus::APPROVED
);
$transport = $this->createsTransport->execute($transportObject, $container);
$scheduleObject = new ScheduleObject(
Carbon::parse($request->input('etd')),
Carbon::parse($request->input('eta')),
ApprovalStatus::APPROVED
);
$schedule = $this->createsSchedule->execute($transport, $scheduleObject);
return $this->resourceResponse(new ContainerResource($container));
}
}
@@ -53,7 +53,7 @@ class FetchContainerLogic extends AbstractControllerLogic
$this->canFetchContainer->passes();
$query = $this->fetchesContainer->execute(['id' => $request->route('id')]);
$query = $this->fetchesContainer->execute(['id' => $request->route('id'), 'with_packing_lists' => true]);
return $this->resourceResponse(new ContainerResource($query));
@@ -0,0 +1,63 @@
<?php
namespace App\Classes\Modules\PackingLists\ControllersLogic\Containers;
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\Classes\Modules\PackingLists\Processors\FetchInboundCustomClearedProcessor;
use App\Http\Resources\ContainerResource;
use ErrorException;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
class InboundCustomClearedLogic extends AbstractControllerLogic
{
/**
* @return array
*/
protected function notification():array {
return [
'title' => 'Retrieved Containers',
'message' => 'You have successfully retrieved a list of Containers'
];
}
/** @var CanListContainers */
private $canListContainers;
/** @var ListsContainers */
private $listsContainers;
private $fetchInboundCustomCleared;
/**
* ListContainersLogic constructor.
* @param CanListContainers $canListContainers
* @param ListsContainers $listsContainers
*/
public function __construct(CanListContainers $canListContainers, ListsContainers $listsContainers, FetchInboundCustomClearedProcessor $fetchInboundCustomCleared)
{
$this->canListContainers = $canListContainers;
$this->listsContainers = $listsContainers;
$this->fetchInboundCustomCleared = $fetchInboundCustomCleared;
}
/**
* @param Request $request
* @return JsonResponse
* @throws ErrorException
*/
public function logic(Request $request) : JsonResponse
{
$query = $this->fetchInboundCustomCleared->execute();
return $this->collectionResponse(ContainerResource::collection($query));
}
}
@@ -45,21 +45,17 @@ class ListContainersLogic extends AbstractControllerLogic
/**
* @param Request $request
* @return JsonResponse
* @throws ErrorException
* @throws \App\Classes\Exceptions\AccessForbiddenException
* @throws \App\Classes\Exceptions\MalformedRequestException
* @throws \App\Classes\Exceptions\RequestValidationException
*/
public function logic(Request $request) : JsonResponse
{
try {
$this->canListContainers->passes();
$this->canListContainers->passes();
$query = $this->listsContainers->execute($this->listsContainers->deserializeFilters($request->input('filters')));
$query = $this->listsContainers->execute($this->listsContainers->deserializeFilters($request->input('filters')));
return $this->collectionResponse(ContainerResource::collection($query));
} catch (\Exception $exception){
throw new ErrorException($exception->getMessage(), $exception->getCode());
}
return $this->collectionResponse(ContainerResource::collection($query));
}
@@ -0,0 +1,82 @@
<?php
namespace App\Classes\Modules\PackingLists\ControllersLogic\Containers;
use App\Classes\General\Abstracts\AbstractControllerLogic;
use App\Classes\Modules\PackingLists\Services\Containers\FetchesContainer;
use App\Classes\Modules\Schedules\Services\CreatesSchedule;
use App\Classes\Modules\Schedules\Services\UpdatesScheduleStatus;
use App\Classes\Modules\Schedules\DataTransferObjects\ScheduleObject;
use App\Classes\ValueObjects\Constants\ApprovalStatus;
use App\Http\Resources\ContainerResource;
use ErrorException;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Carbon\Carbon;
class RescheduleContainerLogic extends AbstractControllerLogic
{
/**
* @return array
*/
protected function notification():array {
return [
'title' => 'Reschedule Container',
'message' => 'You have successfully Reschedule Container'
];
}
/** @var FetchesContainer */
private $fetchesContainer;
/** @var UpdatesScheduleStatus */
private $updatesScheduleStatus;
/** @var CreatesSchedule */
private $createsSchedule;
/**
* DeleteContainerControllersLogic constructor.
* @param FetchesContainer $fetchesContainer
* @param CreatesSchedule $createsSchedule
*/
public function __construct(FetchesContainer $fetchesContainer, UpdatesScheduleStatus $updatesScheduleStatus, CreatesSchedule $createsSchedule)
{
$this->fetchesContainer = $fetchesContainer;
$this->updatesScheduleStatus = $updatesScheduleStatus;
$this->createsSchedule = $createsSchedule;
}
/**
* @param Request $request
* @return JsonResponse
* @throws ErrorException
*/
public function logic(Request $request) : JsonResponse
{
try {
$container = $this->fetchesContainer->execute(['id' => $request->route('id')]);
$transport = $container->transports()->first();
$old_sechedule = $transport->schedules()->first();
$this->updatesScheduleStatus->execute($old_sechedule, ApprovalStatus::REJECTED);
$scheduleObject = new ScheduleObject(
Carbon::parse($request->input('etd')),
Carbon::parse($request->input('eta')),
ApprovalStatus::APPROVED
);
$schedule = $this->createsSchedule->execute($transport, $scheduleObject);
return $this->resourceResponse(new ContainerResource($container));
} catch (\Exception $exception){
throw new ErrorException($exception->getMessage(), $exception->getCode());
}
}
}
@@ -52,14 +52,23 @@ class UpdateContainerLogic extends AbstractControllerLogic
/**
* @param Request $request
* @return JsonResponse
* @throws ErrorException
* @throws \App\Classes\Exceptions\AccessForbiddenException
* @throws \App\Classes\Exceptions\MalformedRequestException
* @throws \App\Classes\Exceptions\RequestValidationException
*/
public function logic(Request $request) : JsonResponse
{
$container = $this->fetchesContainer->execute(['id' => $request->route('id')]);
$object = new ContainerObject( $container->packing_list_id , $request->input('container_reference'), $request->input('container_type'), $request->input('seal_reference'));
$object = new ContainerObject(
$request->input('container_reference'),
$container->container_number,
$request->input('container_type'),
$request->input('seal_reference'),
$request->input('loading_date'),
$container->status,
);
$this->canUpdateContainer->passes($object);
@@ -0,0 +1,60 @@
<?php
namespace App\Classes\Modules\PackingLists\ControllersLogic\Containers;
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 ErrorException;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Carbon\Carbon;
class UpdateDispatchDateContainerLogic extends AbstractControllerLogic
{
/**
* @return array
*/
protected function notification():array {
return [
'title' => 'Updated Dispatch Date Container',
'message' => 'You have successfully updated the Dispatch Date Container'
];
}
/** @var UpdatesDispatchDateTransport */
private $updatesDispatchDateTransport;
/** @var FetchesContainer */
private $fetchesContainer;
/**
* UpdateDispatchDateContainerLogic constructor.
* @param CanUpdateContainer $canUpdateContainer
* @param UpdatesDispatchDateTransport $updatesDispatchDateTransport
* @param FetchesContainer $fetchesContainer
*/
public function __construct(UpdatesDispatchDateTransport $updatesDispatchDateTransport, FetchesContainer $fetchesContainer)
{
$this->updatesDispatchDateTransport = $updatesDispatchDateTransport;
$this->fetchesContainer = $fetchesContainer;
}
/**
* @param Request $request
* @return JsonResponse
* @throws ErrorException
*/
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')));
return $this->resourceResponse(new ContainerResource($container));
}
}
@@ -0,0 +1,60 @@
<?php
namespace App\Classes\Modules\PackingLists\ControllersLogic\Containers;
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 ErrorException;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Carbon\Carbon;
class UpdateDropDateContainerLogic extends AbstractControllerLogic
{
/**
* @return array
*/
protected function notification():array {
return [
'title' => 'Updated Drop Date Container',
'message' => 'You have successfully updated the Drop Date Container'
];
}
/** @var UpdatesDropDateTransport */
private $updatesDropDateTransport;
/** @var FetchesContainer */
private $fetchesContainer;
/**
* UpdateDropDateContainerLogic constructor.
* @param CanUpdateContainer $canUpdateContainer
* @param UpdatesDropDateTransport $updatesDropDateTransport
* @param FetchesContainer $fetchesContainer
*/
public function __construct(UpdatesDropDateTransport $updatesDropDateTransport, FetchesContainer $fetchesContainer)
{
$this->updatesDropDateTransport = $updatesDropDateTransport;
$this->fetchesContainer = $fetchesContainer;
}
/**
* @param Request $request
* @return JsonResponse
* @throws ErrorException
*/
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')));
return $this->resourceResponse(new ContainerResource($container));
}
}
@@ -5,6 +5,7 @@ namespace App\Classes\Modules\PackingLists\ControllersLogic;
use App\Classes\Modules\Companies\Services\FetchesCompany;
use App\Classes\Modules\PackingLists\DataTransferObjects\PackageObject;
use App\Classes\Modules\PackingLists\Processors\CreatePackingListProcessor;
use App\Classes\Modules\Orders\Services\FetchesOrder;
use App\Classes\Modules\PackingLists\Services\Packages\FetchesPackage;
use App\Classes\ValueObjects\Constants\ApprovalStatus;
use App\Classes\General\Abstracts\AbstractControllerLogic;
@@ -13,6 +14,9 @@ use App\Classes\Modules\PackingLists\Services\CreatesPackingListPackage;
use App\Classes\Modules\PackingLists\Standards\Rules\CanCreatePackingList;
use App\Classes\Modules\PackingLists\Standards\Rules\CanCreatePackingListPackage;
use App\Classes\Modules\PackingLists\DataTransferObjects\PackingListObject;
use App\Classes\ValueObjects\Constants\OrderRoleTypes;
use App\Classes\ValueObjects\Constants\PackingListType;
use App\Http\Resources\PackingListResource;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
@@ -34,13 +38,18 @@ class CreatePackingListLogic extends AbstractControllerLogic
/** @var CreatePackingListProcessor */
private $createPackingListProcessor;
/** @var FetchesOrder */
private $fetchesOrder;
/**
* CreatePackingListLogic constructor.
* @param CreatePackingListProcessor $createPackingListProcessor
* @param FetchesOrder $fetchesOrder
*/
public function __construct(CreatePackingListProcessor $createPackingListProcessor)
public function __construct(CreatePackingListProcessor $createPackingListProcessor, FetchesOrder $fetchesOrder)
{
$this->createPackingListProcessor = $createPackingListProcessor;
$this->fetchesOrder = $fetchesOrder;
}
/**
@@ -50,11 +59,13 @@ class CreatePackingListLogic extends AbstractControllerLogic
public function logic(Request $request) : JsonResponse
{
$object = new PackingListObject($request->input('reference_number'), ApprovalStatus::PENDING_SUBMISSION);
$order = $this->fetchesOrder->execute(['reference' => $request->input('reference_number')]);
$query = $this->createPackingListProcessor->execute($object);
$packingListObject = new PackingListObject($request->input('reference_number'), $order->orderRoles()->where('role_id', '=', OrderRoleTypes::ORIGIN_WAREHOUSE)->first()->appointee->id, PackingListType::WAREHOUSE_RECEIVE_LIST, ApprovalStatus::PENDING_SUBMISSION);
return $this->resourceResponse(new PackingListResource($query));
$packingList = $this->createPackingListProcessor->execute($packingListObject, $order);
return $this->resourceResponse(new PackingListResource($packingList));
}
@@ -12,6 +12,7 @@ use App\Classes\Modules\Companies\Services\FetchesCompany;
use App\Http\Resources\PackageResource;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use App\Classes\ValueObjects\Constants\PackageType;
class CreatePackageLogic extends AbstractControllerLogic
{
@@ -61,11 +62,10 @@ class CreatePackageLogic extends AbstractControllerLogic
*/
public function logic(Request $request) : JsonResponse
{
$order = $this->fetchesOrder->execute(['id' => $request->input('order_id')]);
$object = new PackageObject(
null,
$request->input('type'),
$request->input('description'),
$request->input('width'),
@@ -77,7 +77,7 @@ class CreatePackageLogic extends AbstractControllerLogic
$this->canCreatePackage->passes($object);
$query = $this->createsPackage->execute($object);
$query = $this->createsPackage->execute($object, $order->packingLists()->first());
return $this->resourceResponse(new PackageResource($query));
@@ -0,0 +1,53 @@
<?php
namespace App\Classes\Modules\PackingLists\ControllersLogic\Packages;
use App\Classes\General\Abstracts\AbstractControllerLogic;
use App\Classes\Modules\Orders\Services\FetchesOrder;
use App\Classes\Modules\Remarks\DataTransferObjects\RemarkObject;
use App\Classes\Modules\Remarks\Services\CreatesRemark;
use App\Http\Resources\ContactResource;
use App\Http\Resources\OrderResource;
use App\Models\Package;
use App\Models\Remark;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
class CreatePackageRemarkLogic extends AbstractControllerLogic
{
/**
* @return array
*/
protected function notification():array {
return [
'title' => 'Created Package',
'message' => 'You have successfully created a new Package'
];
}
/** @var CreatesRemark */
private $createsRemark;
/**
* CreateContainerRemarkLogic constructor.
* @param CreatesRemark $createsRemark
*/
public function __construct(CreatesRemark $createsRemark, FetchesOrder $fetchesOrder)
{
$this->createsRemark = $createsRemark;
$this->fetchesOrder = $fetchesOrder;
}
public function logic(Request $request) : JsonResponse
{
$order = $this->fetchesOrder->execute(['id' => $request->route('id')]);
$object = new RemarkObject($request->input('content'), auth()->user()->id);
$remark = $this->createsRemark->execute($order ,$object);
return $this->resourceResponse(new OrderResource($order));
}
}
@@ -4,8 +4,8 @@ namespace App\Classes\Modules\PackingLists\ControllersLogic\Packages;
use App\Classes\General\Abstracts\AbstractControllerLogic;
use App\Classes\Modules\Packages\Services\FetchesPackage;
use App\Classes\Modules\Packages\Standards\Rules\CanFetchPackage;
use App\Classes\Modules\PackingLists\Services\Packages\FetchesPackage;
use App\Classes\Modules\PackingLists\Standards\Rules\Packages\CanFetchPackage;
use App\Http\Resources\PackageResource;
use ErrorException;
use Illuminate\Http\JsonResponse;
@@ -4,8 +4,8 @@ namespace App\Classes\Modules\PackingLists\ControllersLogic\Packages;
use App\Classes\General\Abstracts\AbstractControllerLogic;
use App\Classes\Modules\Packages\Services\ListsPackages;
use App\Classes\Modules\Packages\Standards\Rules\CanListPackages;
use App\Classes\Modules\PackingLists\Services\Packages\ListsPackages;
use App\Classes\Modules\PackingLists\Standards\Rules\Packages\CanListPackages;
use App\Http\Resources\PackageResource;
use ErrorException;
use Illuminate\Http\JsonResponse;
@@ -0,0 +1,68 @@
<?php
namespace App\Classes\Modules\PackingLists\ControllersLogic\Packages;
use App\Classes\General\Abstracts\AbstractControllerLogic;
use App\Classes\Modules\PackingLists\Services\Packages\SwitchesPackagePackingList;
use App\Classes\Modules\PackingLists\Services\Packages\FetchesPackage;
use App\Classes\Modules\PackingLists\Services\FetchesPackingList;
use App\Classes\Modules\PackingLists\DataTransferObjects\PackageObject;
use App\Http\Resources\PackageResource;
use ErrorException;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
class SwitchPackagePackingListLogic extends AbstractControllerLogic
{
/**
* @return array
*/
protected function notification():array {
return [
'title' => 'Switched Package Packing List',
'message' => 'You have successfully switched the Package Packing List'
];
}
/** @var SwitchesPackagePackingList */
private $switchesPackagePackingList;
/** @var FetchesPackage */
private $fetchesPackage;
/** @var FetchesPackingList */
private $fetchesPackingList;
/**
* UpdatePackageLogic constructor.
* @param SwitchesPackagePackingList $switchesPackagePackingList
* @param FetchesPackage $fetchesPackage
* @param FetchesPackingList $fetchesPackingList
*/
public function __construct(SwitchesPackagePackingList $switchesPackagePackingList, FetchesPackage $fetchesPackage, FetchesPackingList $fetchesPackingList)
{
$this->switchesPackagePackingList = $switchesPackagePackingList;
$this->fetchesPackage = $fetchesPackage;
$this->fetchesPackingList = $fetchesPackingList;
}
/**
* @param Request $request
* @return JsonResponse
* @throws ErrorException
*/
public function logic(Request $request) : JsonResponse
{
$package = $this->fetchesPackage->execute(['id' => $request->route('id')]);
$packing_list = $this->fetchesPackingList->execute(['id' => $request->input('packing_list_id')]);
$query = $this->switchesPackagePackingList->execute($package, $packing_list);
return $this->resourceResponse(new PackageResource($query));
}
}
@@ -4,10 +4,10 @@ namespace App\Classes\Modules\PackingLists\ControllersLogic\Packages;
use App\Classes\General\Abstracts\AbstractControllerLogic;
use App\Classes\Modules\Packages\Services\UpdatesPackage;
use App\Classes\Modules\Packages\Services\FetchesPackage;
use App\Classes\Modules\Packages\Standards\Rules\CanUpdatePackage;
use App\Classes\Modules\Packages\DataTransferObjects\PackageObject;
use App\Classes\Modules\PackingLists\Services\Packages\UpdatesPackage;
use App\Classes\Modules\PackingLists\Services\Packages\FetchesPackage;
use App\Classes\Modules\PackingLists\Standards\Rules\Packages\CanUpdatePackage;
use App\Classes\Modules\PackingLists\DataTransferObjects\PackageObject;
use App\Http\Resources\PackageResource;
use ErrorException;
use Illuminate\Http\JsonResponse;
@@ -60,8 +60,6 @@ class UpdatePackageLogic extends AbstractControllerLogic
$package = $this->fetchesPackage->execute(['id' => $request->route('id')]);
$object = new PackageObject(
$package->order_id,
null,
$request->input('type'),
$request->input('description'),
$request->input('width'),
@@ -69,7 +67,9 @@ class UpdatePackageLogic extends AbstractControllerLogic
$request->input('length'),
$request->input('weight'),
$request->input('quantity'),
$request->input('status'));
$request->input('status'),
$package->reference
);
$this->canUpdatePackage->passes($object);
@@ -0,0 +1,83 @@
<?php
namespace App\Classes\Modules\PackingLists\ControllersLogic;
use App\Classes\General\Abstracts\AbstractControllerLogic;
use App\Classes\Modules\PackingLists\Services\FetchesPackingList;
use App\Classes\Modules\Schedules\Services\CreatesSchedule;
use App\Classes\Modules\Schedules\Services\UpdatesScheduleStatus;
use App\Classes\Modules\Schedules\DataTransferObjects\ScheduleObject;
use App\Classes\ValueObjects\Constants\ApprovalStatus;
use App\Http\Resources\PackingListResource;
use ErrorException;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Carbon\Carbon;
class ReschedulePackingListLogic extends AbstractControllerLogic
{
/**
* @return array
*/
protected function notification():array {
return [
'title' => 'Reschedule Packing List',
'message' => 'You have successfully Reschedule Packing List'
];
}
/** @var FetchesPackingList */
private $fetchesPackingList;
/** @var UpdatesScheduleStatus */
private $updatesScheduleStatus;
/** @var CreatesSchedule */
private $createsSchedule;
/**
* DeleteContainerControllersLogic constructor.
* @param FetchesPackingList $fetchesPackingList
* @param CreatesSchedule $createsSchedule
*/
public function __construct(FetchesPackingList $fetchesPackingList, UpdatesScheduleStatus $updatesScheduleStatus, CreatesSchedule $createsSchedule)
{
$this->fetchesPackingList = $fetchesPackingList;
$this->updatesScheduleStatus = $updatesScheduleStatus;
$this->createsSchedule = $createsSchedule;
}
/**
* @param Request $request
* @return JsonResponse
* @throws ErrorException
*/
public function logic(Request $request) : JsonResponse
{
try {
$packing_list = $this->fetchesPackingList->execute(['id' => $request->route('id')]);
$transport = $packing_list->transports()->first();
$old_sechedule = $transport->schedules()->first();
$this->updatesScheduleStatus->execute($old_sechedule, ApprovalStatus::REJECTED);
$scheduleObject = new ScheduleObject(
Carbon::parse($request->input('eta')),
Carbon::parse($request->input('etd')),
ApprovalStatus::APPROVED
);
$schedule = $this->createsSchedule->execute($transport, $scheduleObject);
return $this->resourceResponse(new PackingListResource($packing_list));
} catch (\Exception $exception){
throw new ErrorException($exception->getMessage(), $exception->getCode());
}
}
}
@@ -0,0 +1,60 @@
<?php
namespace App\Classes\Modules\PackingLists\ControllersLogic;
use App\Classes\General\Abstracts\AbstractControllerLogic;
use App\Classes\Modules\Transports\Services\UpdatesDispatchDateTransport;
use App\Classes\Modules\PackingLists\Services\FetchesPackingList;
use App\Http\Resources\PackingListResource;
use ErrorException;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Carbon\Carbon;
class UpdateDispatchDatePackingListLogic extends AbstractControllerLogic
{
/**
* @return array
*/
protected function notification():array {
return [
'title' => 'Updated Dispatch Date Packing List',
'message' => 'You have successfully updated the Dispatch Date Packing List'
];
}
/** @var UpdatesDispatchDateTransport */
private $updatesDispatchDateTransport;
/** @var FetchesPackingList */
private $fetchesPackingList;
/**
* UpdateDispatchDatePackingListLogic constructor.
* @param CanUpdateContainer $canUpdateContainer
* @param UpdatesDispatchDateTransport $updatesDispatchDateTransport
* @param FetchesPackingList $fetchesPackingList
*/
public function __construct(UpdatesDispatchDateTransport $updatesDispatchDateTransport, FetchesPackingList $fetchesPackingList)
{
$this->updatesDispatchDateTransport = $updatesDispatchDateTransport;
$this->fetchesPackingList = $fetchesPackingList;
}
/**
* @param Request $request
* @return JsonResponse
* @throws ErrorException
*/
public function logic(Request $request) : JsonResponse
{
$packing_list = $this->fetchesPackingList->execute(['id' => $request->route('id')]);
$transport = $packing_list->transports()->first();
$query = $this->updatesDispatchDateTransport->execute($transport, Carbon::parse($request->input('dispatch_date')));
return $this->resourceResponse(new PackingListResource($packing_list));
}
}
@@ -0,0 +1,60 @@
<?php
namespace App\Classes\Modules\PackingLists\ControllersLogic;
use App\Classes\General\Abstracts\AbstractControllerLogic;
use App\Classes\Modules\Transports\Services\UpdatesDropDateTransport;
use App\Classes\Modules\PackingLists\Services\FetchesPackingList;
use App\Http\Resources\PackingListResource;
use ErrorException;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Carbon\Carbon;
class UpdateDropDatePackingListLogic extends AbstractControllerLogic
{
/**
* @return array
*/
protected function notification():array {
return [
'title' => 'Updated Drop Date Packing List',
'message' => 'You have successfully updated the Drop Date Packing List'
];
}
/** @var UpdatesDropDateTransport */
private $updatesDropDateTransport;
/** @var FetchesPackingList */
private $fetchesPackingList;
/**
* UpdateDispatchDatePackingListLogic constructor.
* @param CanUpdateContainer $canUpdateContainer
* @param UpdatesDropDateTransport $updatesDropDateTransport
* @param FetchesPackingList $fetchesPackingList
*/
public function __construct(UpdatesDropDateTransport $updatesDropDateTransport, FetchesPackingList $fetchesPackingList)
{
$this->updatesDropDateTransport = $updatesDropDateTransport;
$this->fetchesPackingList = $fetchesPackingList;
}
/**
* @param Request $request
* @return JsonResponse
* @throws ErrorException
*/
public function logic(Request $request) : JsonResponse
{
$packing_list = $this->fetchesPackingList->execute(['id' => $request->route('id')]);
$transport = $packing_list->transports()->first();
$query = $this->updatesDropDateTransport->execute($transport, Carbon::parse($request->input('drop_date')));
return $this->resourceResponse(new PackingListResource($packing_list));
}
}
@@ -57,7 +57,7 @@ class UpdatePackingListLogic extends AbstractControllerLogic
{
$packingList = $this->fetchesPackingList->execute(['id' => $request->route('id')]);
$object = new PackingListObject($packingList->reference, $request->input('status'));
$object = new PackingListObject($packingList->reference, $packingList->claimant_id, $packingList->type, $request->input('status'));
$this->canUpdatePackingList->passes($object);
@@ -0,0 +1,62 @@
<?php
namespace App\Classes\Modules\PackingLists\ControllersLogic;
use App\Classes\General\Abstracts\AbstractControllerLogic;
use App\Classes\Modules\PackingLists\Services\UpdatesPackingList;
use App\Classes\Modules\PackingLists\Services\FetchesPackingList;
use App\Classes\Modules\PackingLists\Services\UpdatesPackingListStatus;
use App\Classes\Modules\PackingLists\Standards\Rules\CanUpdatePackingList;
use App\Classes\Modules\PackingLists\DataTransferObjects\PackingListObject;
use App\Http\Resources\PackingListResource;
use ErrorException;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
class UpdatePackingListStatusLogic extends AbstractControllerLogic
{
/**
* @return array
*/
protected function notification():array {
return [
'title' => 'Updated PackingList Status',
'message' => 'You have successfully updated the PackingList status'
];
}
/** @var FetchesPackingList */
private $fetchesPackingList;
/** @var UpdatesPackingListStatus */
private $updatesPackingListStatus;
/**
* UpdatePackingListStatusLogic constructor.
* @param FetchesPackingList $fetchesPackingList
* @param UpdatesPackingListStatus $updatesPackingListStatus
*/
public function __construct(FetchesPackingList $fetchesPackingList, UpdatesPackingListStatus $updatesPackingListStatus)
{
$this->fetchesPackingList = $fetchesPackingList;
$this->updatesPackingListStatus = $updatesPackingListStatus;
}
/**
* @param Request $request
* @return JsonResponse
* @throws \App\Classes\Exceptions\MalformedRequestException
*/
public function logic(Request $request) : JsonResponse
{
$packingList = $this->fetchesPackingList->execute(['id' => $request->route('id')]);
$query = $this->updatesPackingListStatus->execute($packingList, $request->route('status'));
return $this->resourceResponse(new PackingListResource($query));
}
}
@@ -3,6 +3,7 @@
namespace App\Classes\Modules\PackingLists\DataTransferObjects;
use App\Classes\General\Interfaces\DataTransferObject;
use Carbon\Carbon;
class ContainerObject implements DataTransferObject
{
@@ -14,11 +15,14 @@ class ContainerObject implements DataTransferObject
private $containerNumber;
/** @var string */
private $sealNumber;
private $sealReference;
/** @var int */
private $containerType;
/** @var Carbon */
private $loadingDate;
/** @var int */
private $status;
@@ -26,16 +30,18 @@ class ContainerObject implements DataTransferObject
* ContainerObject constructor.
* @param string $reference
* @param string $containerNumber
* @param string $sealNumber
* @param string $sealReference
* @param int $containerType
* @param Carbon $loadingDate
* @param int $status
*/
public function __construct(string $reference, string $containerNumber, string $sealNumber, int $containerType, int $status)
public function __construct(string $reference, string $containerNumber, string $sealReference, int $containerType, Carbon $loadingDate, int $status)
{
$this->reference = $reference;
$this->containerNumber = $containerNumber;
$this->sealNumber = $sealNumber;
$this->sealReference = $sealReference;
$this->containerType = $containerType;
$this->loadingDate = $loadingDate;
$this->status = $status;
}
@@ -58,9 +64,9 @@ class ContainerObject implements DataTransferObject
/**
* @return string
*/
public function getSealNumber(): string
public function getSealReference(): string
{
return $this->sealNumber;
return $this->sealReference;
}
/**
@@ -71,6 +77,14 @@ class ContainerObject implements DataTransferObject
return $this->containerType;
}
/**
* @return Carbon
*/
public function getLoadingDate(): Carbon
{
return $this->loadingDate;
}
/**
* @return int
*/
@@ -79,4 +93,5 @@ class ContainerObject implements DataTransferObject
return $this->status;
}
}
@@ -20,7 +20,7 @@ class CreatePackingListProcessor
/**
* CreatePackingListLogic constructor.
* CreatePackingListProcessor constructor.
* @param CanCreatePackingList $canCreatePackingList
* @param CreatesPackingList $createsPackingList
*/
@@ -65,7 +65,6 @@ class FetchContainersStatusUpdateFromVTPortalProcessor
/**
* @return array
* @throws \App\Classes\Exceptions\MalformedRequestException
*/
public function execute(){
@@ -77,7 +76,7 @@ class FetchContainersStatusUpdateFromVTPortalProcessor
try {
$filter = '["RefNo:=%js%\"'.$container->reference.'\"\u0000"]';
$containerDetailsRequest = $this->fetchesDataFRomVTPortal->clientRequest('https://portalvt.azurewebsites.net/Services/DataControllerService.asmx/GetPage', 'POST', json_decode('{"controller":"VCustomercontainer","view":"grid1","request":{"PageIndex":-1,"PageSize":10000,"SortExpression":"ModifiedOn DESC","Filter":'.$filter.'}}'), '');
$containerDetailsRequest = $this->fetchesDataFRomVTPortal->clientRequest('http://portal.vtnation.com.my/Services/DataControllerService.asmx/GetPage', 'POST', json_decode('{"controller":"VCustomercontainer","view":"grid1","request":{"PageIndex":-1,"PageSize":10000,"SortExpression":"CreatedOn asc","Filter":'.$filter.'}}'), '');
$containerDetails = $this->fetchesDataFRomVTPortal->getResponseBody($containerDetailsRequest);
@@ -89,6 +88,8 @@ class FetchContainersStatusUpdateFromVTPortalProcessor
$eta = Carbon::parse($eta);
$etd = Carbon::parse($eta)->subDays(5);
$delayDate = $containerDetails[6];
$containerStatus = $containerDetails[9];
@@ -98,31 +99,37 @@ class FetchContainersStatusUpdateFromVTPortalProcessor
$transport = $container->transports()->first();
if(!$transport){
$transportObject = new TransportObject(TransportType::SEA, null, null, $eta, null, ApprovalStatus::APPROVED);
$transportObject = new TransportObject(TransportType::SEA, null, null, $etd, null, ApprovalStatus::APPROVED);
/** @var Transport $transport */
$transport = $this->createsTransport->execute($transportObject, $container);
$this->createsSchedule->execute($transport, new ScheduleObject($eta->subDays(5), $eta, ApprovalStatus::APPROVED));
$this->createsSchedule->execute($transport, new ScheduleObject($etd, $eta, ApprovalStatus::APPROVED));
}
if($delayDate){
$delayDate = Carbon::parse($delayDate);
$transport = $container->transports()->first();
$schedule = $transport->schedules()->where('eta', '=', $delayDate)->first();
$etd = $delayDate->subDays(5);
if(!$schedule){
$etd = $schedule->etd;
if(!$transport->schedules()->where('eta', '=', $delayDate)->first()) {
$etd = $transport->schedules()->where('status', '=', ApprovalStatus::APPROVED)->first()->etd;
$transport->schedules()->update(['status' => ApprovalStatus::EXPIRED]);
$this->createsSchedule->execute($transport, new ScheduleObject($etd, $delayDate, ApprovalStatus::APPROVED));
}
$this->createsSchedule->execute($transport, new ScheduleObject($etd, $delayDate, ApprovalStatus::APPROVED));
}
if($containerStatus === 'Unstuffing'){
$container->update(['status' => ApprovalStatus::COMPLETED]);
$container->transports()->first()->update(['drop_date' => Carbon::parse($unstuffingDate)->subDay(), 'status' => ApprovalStatus::COMPLETED]);
$container->packingLists()->update(['status' => ApprovalStatus::APPROVED]);
/** @var PackingList $packingList */
foreach($container->packingLists as $packingList){
if($packingList->status === ApprovalStatus::PENDING_VERIFICATION){
$packingList->status = ApprovalStatus::APPROVED;
$packingList->save();
}
$signature = $packingList->owner->orderRoles()->where('role_id', '=', OrderRoleTypes::SUPERVISOR)->first()->appointee->entity_sigiture;
foreach($packingList->steps()->where('reference', '!=', 'DELIVERY')->get() as $step){
$this->updatesContractObligations->execute($signature, $step->obligation_hash_id);
@@ -3,8 +3,6 @@
namespace App\Classes\Modules\PackingLists\Processors;
use App\Classes\Modules\Orders\Services\FetchesDataFromVTPortal;
use App\Classes\Modules\PackingLists\DataTransferObjects\PackageObject;
use App\Classes\Modules\PackingLists\Services\ListsPackingLists;
use App\Classes\Modules\Schedules\DataTransferObjects\ScheduleObject;
use App\Classes\Modules\Schedules\Services\CreatesSchedule;
use App\Classes\Modules\Transports\DataTransferObjects\TransportObject;
@@ -12,7 +10,6 @@ use App\Classes\Modules\Transports\Services\CreatesTransport;
use App\Classes\Modules\Unity\Services\UpdatesContractObligation;
use App\Classes\ValueObjects\Constants\ApprovalStatus;
use App\Classes\ValueObjects\Constants\OrderRoleTypes;
use App\Classes\ValueObjects\Constants\PackageType;
use App\Classes\ValueObjects\Constants\PackingListType;
use App\Classes\ValueObjects\Constants\TransportType;
use App\Models\PackingList;
@@ -58,36 +55,37 @@ class FetchDeliveryListFromVTPortalProcessor
public function execute(){
try {
$packingLists = PackingList::where('type', '=', PackingListType::SHIPPING_PACKING_LIST)->where('status', '=', ApprovalStatus::APPROVED)->get();
$packingLists = PackingList::where('type', '=', PackingListType::SHIPPING_PACKING_LIST)->whereIn('status', [ApprovalStatus::APPROVED, ApprovalStatus::SUSPENDED])->get();
/** @var PackingList $packingList */
foreach($packingLists as $packingList){
try {
$filter = '["PoNumber:=%js%\"'.$packingList->reference.'\"\u0000"]';
$shippingPackingListsRequest = $this->fetchesDataFRomVTPortal->clientRequest('https://portalvt.azurewebsites.net/Services/DataControllerService.asmx/GetPage', 'POST', json_decode('{"controller":"VPodetailparcel","view":"grid1","request":{"PageIndex":-1,"PageSize":10000,"SortExpression":"ModifiedOn DESC","Filter":'.$filter.'}}'), '');
$shippingPackingListsRequest = $this->fetchesDataFRomVTPortal->clientRequest('http://portal.vtnation.com.my/Services/DataControllerService.asmx/GetPage', 'POST', json_decode('{"controller":"VPodetailparcel","view":"grid1","request":{"PageIndex":-1,"PageSize":10000,"SortExpression":"CreatedOn asc","Filter":'.$filter.'}}'), '');
$shippingPackingLists = $this->fetchesDataFRomVTPortal->getResponseBody($shippingPackingListsRequest);
foreach($shippingPackingLists->Rows as $shippingPackingList){
if(!$shippingPackingList[9] && !$shippingPackingList[10]) {
continue;
}
$deliveryDate = Carbon::parse($shippingPackingList[9] ? $shippingPackingList[9]:$shippingPackingList[10]);
$transportObject = new TransportObject(TransportType::LAND, null, null, $deliveryDate, $deliveryDate, ApprovalStatus::APPROVED);
/** @var Transport $transport */
$transport = $this->createsTransport->execute($transportObject, $packingList);
$this->createsSchedule->execute($transport, new ScheduleObject($deliveryDate, $deliveryDate, ApprovalStatus::APPROVED));
$deliveryStep = $packingList->steps()->where('reference', '=', 'LAST_MILE_DELIVERY')->first();
$signature = $packingList->owner->orderRoles()->where('role_id', '=', OrderRoleTypes::SUPERVISOR)->first()->appointee->entity_sigiture;
$this->updatesContractObligations->execute($signature, $deliveryStep->obligation_hash_id);
$deliveryStep->update(['status' => ApprovalStatus::COMPLETED]);
$shippingPackingList = $shippingPackingLists->Rows[0];
if(!$shippingPackingList[9] && !$shippingPackingList[10]) {
continue;
}
$packingList->status = ApprovalStatus::COMPLETED;
$packingList->save();
$deliveryDate = Carbon::parse($shippingPackingList[9] ? $shippingPackingList[9]:$shippingPackingList[10]);
$transportObject = new TransportObject(TransportType::LAND, null, null, $deliveryDate, $deliveryDate, ApprovalStatus::APPROVED);
/** @var Transport $transport */
$transport = $this->createsTransport->execute($transportObject, $packingList);
$this->createsSchedule->execute($transport, new ScheduleObject($deliveryDate, $deliveryDate, ApprovalStatus::APPROVED));
$deliveryStep = $packingList->steps()->where('reference', '=', 'LAST_MILE_DELIVERY')->first();
$signature = $packingList->owner->orderRoles()->where('role_id', '=', OrderRoleTypes::SUPERVISOR)->first()->appointee->entity_sigiture;
$this->updatesContractObligations->execute($signature, $deliveryStep->obligation_hash_id);
$deliveryStep->update(['status' => ApprovalStatus::COMPLETED]);
} catch (GuzzleException $exception) {
continue;
}
@@ -0,0 +1,79 @@
<?php
namespace App\Classes\Modules\PackingLists\Processors;
use App\Classes\Modules\Orders\Services\FetchesDataFromVTPortal;
use App\Classes\Modules\Schedules\DataTransferObjects\ScheduleObject;
use App\Classes\Modules\Schedules\Services\CreatesSchedule;
use App\Classes\Modules\Transports\DataTransferObjects\TransportObject;
use App\Classes\Modules\Transports\Services\CreatesTransport;
use App\Classes\Modules\Unity\Services\UpdatesContractObligation;
use App\Classes\ValueObjects\Constants\ApprovalStatus;
use App\Classes\ValueObjects\Constants\OrderRoleTypes;
use App\Classes\ValueObjects\Constants\PackingListType;
use App\Classes\ValueObjects\Constants\TransportType;
use App\Models\PackingList;
use App\Models\Transport;
use App\Models\Container;
use Carbon\Carbon;
use GuzzleHttp\Exception\GuzzleException;
use Illuminate\Support\Facades\Log;
class FetchInboundCustomClearedProcessor
{
/** @var FetchesDataFromVTPortal */
private $fetchesDataFRomVTPortal;
/** @var CreatesTransport */
private $createsTransport;
/** @var CreatesSchedule */
private $createsSchedule;
/** @var UpdatesContractObligation */
private $updatesContractObligations;
/**
* FetchDeliveryListFromVTPortalProcessor constructor.
* @param FetchesDataFromVTPortal $fetchesDataFRomVTPortal
* @param CreatesTransport $createsTransport
* @param CreatesSchedule $createsSchedule
* @param UpdatesContractObligation $updatesContractObligations
*/
public function __construct(FetchesDataFromVTPortal $fetchesDataFRomVTPortal, CreatesTransport $createsTransport, CreatesSchedule $createsSchedule, UpdatesContractObligation $updatesContractObligations)
{
$this->fetchesDataFRomVTPortal = $fetchesDataFRomVTPortal;
$this->createsTransport = $createsTransport;
$this->createsSchedule = $createsSchedule;
$this->updatesContractObligations = $updatesContractObligations;
}
/**
* @return array
*/
public function execute(){
$packingLists = PackingList::query()->with(['steps' => function ($query) {
$query->where('steps.status', '<>', 3);
}])
->where('type', PackingListType::SHIPPING_PACKING_LIST)
->whereHas('containers', function($query) {
return $query->whereHas('transports', function($query){
return $query->where('type', '=', TransportType::SEA)->where('status', '=', ApprovalStatus::COMPLETED)->whereHas('schedules', function($query){
return $query->where('etd', '<', Carbon::now());
});
});
})->whereDoesntHave('transports', function($query){
return $query->where('type', '=', TransportType::LAND)->where('status', '=', ApprovalStatus::APPROVED)->whereHas('schedules', function($query){
return $query->where('etd', '<', Carbon::now());
});
})->get();
return $packingLists ;
}
}
@@ -6,7 +6,6 @@ use App\Classes\Exceptions\ResourceNotFoundException;
use App\Classes\Modules\Companies\Services\FetchesCompanyModule;
use App\Classes\Modules\Orders\Services\FetchesDataFromVTPortal;
use App\Classes\Modules\Orders\Services\FetchesOrder;
use App\Classes\Modules\PackingList\Processors\GenerateShippingOrderStepsProcessor;
use App\Classes\Modules\PackingLists\DataTransferObjects\ContainerObject;
use App\Classes\Modules\PackingLists\DataTransferObjects\PackingListObject;
use App\Classes\Modules\PackingLists\Services\Containers\FetchesContainer;
@@ -126,7 +125,7 @@ class FetchLoadedContainersFromVTPortalProcessor
DB::beginTransaction();
try {
$start = $start ? $start : Carbon::now()->subMonth();
$start = $start ? $start : Carbon::now()->subDays(10);
$startLimit = Carbon::parse('11-08-2021');
@@ -137,18 +136,18 @@ class FetchLoadedContainersFromVTPortalProcessor
$end = $end ? $end : Carbon::now();
$filter = '["LoadedTime:$between$%js%\"'.$start->format('Y-m-d').'T00:00:00.000\"$and$%js%\"'.$end->format('Y-m-d').'T00:00:00.000\"\u0000"]';
$containersRequest = $this->fetchesDataFRomVTPortal->clientRequest('https://portalvt.azurewebsites.net/Services/DataControllerService.asmx/GetPage', 'POST', json_decode('{"controller":"VCustomercontainer","view":"grid1","request":{"PageIndex":-1,"PageSize":10000,"SortExpression":"ModifiedOn DESC","Filter":'.$filter.'}}'), '');
$containersRequest = $this->fetchesDataFRomVTPortal->clientRequest('http://portal.vtnation.com.my/Services/DataControllerService.asmx/GetPage', 'POST', json_decode('{"controller":"VCustomercontainer","view":"grid1","request":{"PageIndex":-1,"PageSize":10000,"SortExpression":"LoadedTime asc","Filter":'.$filter.'}}'), '');
$containers = $this->fetchesDataFRomVTPortal->getResponseBody($containersRequest);
foreach ($containers->Rows as $container){
$filter = '["ContainerID:=%js%'.$container[11].'"]';
$containerDetailRequest = $this->fetchesDataFRomVTPortal->clientRequest('https://portalvt.azurewebsites.net/Services/DataControllerService.asmx/GetPage', 'POST', json_decode('{"controller":"VPodetailparcel","view":"grid1","request":{"PageIndex":-1,"PageSize":10000,"SortExpression":"ModifiedOn DESC","Filter":'.$filter.'}}'), '');
$containerDetailRequest = $this->fetchesDataFRomVTPortal->clientRequest('http://portal.vtnation.com.my/Services/DataControllerService.asmx/GetPage', 'POST', json_decode('{"controller":"VPodetailparcel","view":"grid1","request":{"PageIndex":-1,"PageSize":10000,"SortExpression":"CreatedOn asc","Filter":'.$filter.'}}'), '');
$containerDetail = $this->fetchesDataFRomVTPortal->getResponseBody($containerDetailRequest);
$containerObject = new ContainerObject($container[0], str_replace(' ', '', $container[24]), str_replace(' ', '', $container[15]), ContainerTypes::FORTY_FEET_DRY_CONTAINER, ApprovalStatus::PENDING_VERIFICATION);
$containerObject = new ContainerObject($container[0], str_replace(' ', '', $container[24]), str_replace(' ', '', $container[15]), ContainerTypes::FORTY_FEET_DRY_CONTAINER, Carbon::parse($container[5]), ApprovalStatus::PENDING_VERIFICATION);
try {
$container = $this->fetchesContainer->execute(['reference' => $containerObject->getReference()]);
@@ -199,7 +198,10 @@ class FetchLoadedContainersFromVTPortalProcessor
$this->unityAssignContractEntity->execute($supervisorContractEntity->hash_id, $contractObligations);
$packingListObject = new PackingListObject($packingListReference, $order->orderRoles()->where('role_id', '=', OrderRoleTypes::ORIGIN_FREIGHT_FORWARDER)->first()->appointee->id, PackingListType::SHIPPING_PACKING_LIST, ApprovalStatus::PENDING_VERIFICATION, $contractReference);
$connection = $order->companyModule->connections()->first();
$marking = $connection->invitee_reference;
$packingListObject = new PackingListObject($packingListReference, $order->orderRoles()->where('role_id', '=', OrderRoleTypes::ORIGIN_FREIGHT_FORWARDER)->first()->appointee->id, PackingListType::SHIPPING_PACKING_LIST, (int) filter_var($marking, FILTER_SANITIZE_NUMBER_INT) <= 1000 ? ApprovalStatus::PENDING_VERIFICATION : ApprovalStatus::SUSPENDED, $contractReference);
/** @var PackingList $packingList */
$packingList = $this->createPackingListProcessor->execute($packingListObject, $order);
@@ -46,7 +46,9 @@ class FetchPackingListFromVTPortalProcessor
*/
public function execute(){
$packingLists = PackingList::where('type', '=', PackingListType::SHIPPING_PACKING_LIST)->where('status', '=', ApprovalStatus::PENDING_VERIFICATION)->get();
$packingLists = PackingList::where('type', '=', PackingListType::SHIPPING_PACKING_LIST)->whereIn('status', [ApprovalStatus::PENDING_VERIFICATION, ApprovalStatus::SUSPENDED])->whereDoesntHave('containers', function($query){
$query->where('status', '=', ApprovalStatus::COMPLETED);
})->get();
foreach($packingLists as $packingList){
@@ -55,7 +57,7 @@ class FetchPackingListFromVTPortalProcessor
$filter = '["PoNumber:=%js%\"'.$packingList->reference.'\"\u0000"]';
$shippingPackingListsRequest = $this->fetchesDataFRomVTPortal->clientRequest('https://portalvt.azurewebsites.net/Services/DataControllerService.asmx/GetPage', 'POST', json_decode('{"controller":"VPodetailparcel","view":"grid1","request":{"PageIndex":-1,"PageSize":10000,"SortExpression":"ModifiedOn DESC","Filter":'.$filter.'}}'), '');
$shippingPackingListsRequest = $this->fetchesDataFRomVTPortal->clientRequest('http://portal.vtnation.com.my/Services/DataControllerService.asmx/GetPage', 'POST', json_decode('{"controller":"VPodetailparcel","view":"grid1","request":{"PageIndex":-1,"PageSize":10000,"SortExpression":"CreatedOn asc","Filter":'.$filter.'}}'), '');
$shippingPackingLists = $this->fetchesDataFRomVTPortal->getResponseBody($shippingPackingListsRequest);
@@ -0,0 +1,64 @@
<?php
namespace App\Classes\Modules\PackingLists\Processors;
use App\Classes\Modules\Orders\Services\FetchesDataFromVTPortal;
use App\Classes\Modules\PackingLists\DataTransferObjects\PackageObject;
use App\Classes\Modules\PackingLists\Services\ListsPackingLists;
use App\Classes\ValueObjects\Constants\ApprovalStatus;
use App\Classes\ValueObjects\Constants\PackageType;
use App\Classes\ValueObjects\Constants\PackingListType;
use App\Models\PackingList;
use GuzzleHttp\Exception\GuzzleException;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Log;
class FetchPackingListProcessor
{
/** @var ListsPackingLists */
private $listsPackingLists;
/**
* FetchPackingListFromVTPortalProcessor constructor.
* @param ListsPackingLists $listsPackingLists
*/
public function __construct(ListsPackingLists $listsPackingLists)
{
$this->listsPackingLists = $listsPackingLists;
}
/**
* @return array
* @throws \App\Classes\Exceptions\AccessForbiddenException
* @throws \App\Classes\Exceptions\RequestValidationException
*/
public function execute($params){
$packingLists = PackingList::where('type', '=', PackingListType::SHIPPING_PACKING_LIST)
->whereIn('status', [ApprovalStatus::PENDING_VERIFICATION, ApprovalStatus::SUSPENDED])
->whereDoesntHave('containers', function($query){
$query->where('status', '=', ApprovalStatus::COMPLETED);
})->orderBy('created_at','desc')->where('owner_id',$params['orderId'])->get();
//dd($packingLists);
$packingListsArray=[];
foreach($packingLists as $packingList){
$address = $packingList->owner->addresses()->first();
$packingList->fulladdress = $address->street_one.', '.$address->street_two.', '.$address->district->name.', '.$address->post_code.' '.$address->state->name.', '.$address->country->name;
$container = $packingList->containers()->first();
$packingList->container_reference = $container->reference;
$packingList->container_number = $container->container_number;
$packingListsArray[]=$packingList;
}
return $packingListsArray;
}
}
@@ -9,7 +9,7 @@ use App\Classes\Modules\Companies\Services\FetchesCompanyModule;
use App\Classes\Modules\Orders\Processors\CreateOrderProcessor;
use App\Classes\Modules\Orders\Services\FetchesDataFromVTPortal;
use App\Classes\Modules\Orders\Services\FetchesOrder;
use App\Classes\Modules\PackingLists\ControllersLogic\Packages\CreatePackageLogic;
use App\Classes\Modules\PackingLists\ControllersLogic\Packages\CreatePackageRemarkLogic;
use App\Classes\Modules\PackingLists\DataTransferObjects\PackageObject;
use App\Classes\Modules\PackingLists\DataTransferObjects\PackingListObject;
use App\Classes\Modules\PackingLists\Services\FetchesPackingList;
@@ -60,7 +60,7 @@ class FetchWarehouseReceiveListFromVTPortalProcessor
/** @var CreatePackingListProcessor */
private $createPackingListProcessor;
/** @var CreatePackageLogic */
/** @var CreatePackageRemarkLogic */
private $createPackage;
/** @var CreatePackageProcessor */
@@ -82,12 +82,12 @@ class FetchWarehouseReceiveListFromVTPortalProcessor
* @param CreateOrderProcessor $createOrderProcessor
* @param FetchesPackingList $fetchesPakcingList
* @param CreatePackingListProcessor $createPackingListProcessor
* @param CreatePackageLogic $createPackage
* @param CreatePackageRemarkLogic $createPackage
* @param CreatePackageProcessor $createPackageProcessor
* @param CreatesTransport $createsTransport
* @param CreatesSchedule $createsSchedule
*/
public function __construct(FetchesDataFromVTPortal $fetchesDataFRomVTPortal, CleansOldAddress $cleansOldAddress, CreateAddressFromOldAddressProcessor $createAddressFromOldAddressProcessor, FetchesCompanyModule $fetchesCompanyModule, FetchesOrder $fetchesOrder, CreateOrderProcessor $createOrderProcessor, FetchesPackingList $fetchesPakcingList, CreatePackingListProcessor $createPackingListProcessor, CreatePackageLogic $createPackage, CreatePackageProcessor $createPackageProcessor, CreatesTransport $createsTransport, CreatesSchedule $createsSchedule)
public function __construct(FetchesDataFromVTPortal $fetchesDataFRomVTPortal, CleansOldAddress $cleansOldAddress, CreateAddressFromOldAddressProcessor $createAddressFromOldAddressProcessor, FetchesCompanyModule $fetchesCompanyModule, FetchesOrder $fetchesOrder, CreateOrderProcessor $createOrderProcessor, FetchesPackingList $fetchesPakcingList, CreatePackingListProcessor $createPackingListProcessor, CreatePackageRemarkLogic $createPackage, CreatePackageProcessor $createPackageProcessor, CreatesTransport $createsTransport, CreatesSchedule $createsSchedule)
{
$this->fetchesDataFRomVTPortal = $fetchesDataFRomVTPortal;
$this->cleansOldAddress = $cleansOldAddress;
@@ -125,13 +125,15 @@ class FetchWarehouseReceiveListFromVTPortalProcessor
}
$end = $end ? $end : Carbon::now();
$filter = '["ParcelDate:$between$%js%\"'.$start->format('Y-m-d').'T00:00:00.000\"$and$%js%\"'.$end->format('Y-m-d').'T00:00:00.000\"\u0000"]';
$warehouseListRequest = $this->fetchesDataFRomVTPortal->clientRequest('https://portalvt.azurewebsites.net/Services/DataControllerService.asmx/GetPage', 'POST', json_decode('{"controller":"WarehouseList","view":"grid1","request":{"PageIndex":-1,"PageSize":10000,"SortExpression":"ModifiedOn DESC","Filter":'.$filter.'}}'), '');
$warehouseListRequest = $this->fetchesDataFRomVTPortal->clientRequest('http://portal.vtnation.com.my/Services/DataControllerService.asmx/GetPage', 'POST', json_decode('{"controller":"WarehouseList","view":"grid1","request":{"PageIndex":-1,"PageSize":10000,"SortExpression":"ParcelDate asc","Filter":'.$filter.'}}'), '');
$response = $this->fetchesDataFRomVTPortal->getResponseBody($warehouseListRequest);
foreach ($response->Rows as $parcel){
$marking = explode('/', explode('CIEF/', $parcel[5])[1]);
if(!array_key_exists(1, $marking)){
@@ -144,6 +146,7 @@ class FetchWarehouseReceiveListFromVTPortalProcessor
continue;
}
try {
$order = $this->fetchesOrder->execute(['reference' => $orderNumber]);
} catch (ResourceNotFoundException $exception) {
@@ -154,13 +157,16 @@ class FetchWarehouseReceiveListFromVTPortalProcessor
continue;
}
$customerMarking = str_replace(' ', '', str_replace('/', '', str_replace('CIEF/', '', $oldOrder->company->marking)));
$customerMarking = str_replace('/', '', str_replace(' ', '', explode('CIEF/', $oldOrder->company->marking)[1]));
$companyModule = CompanyModule::whereHas('inviters', function($query) use ($customerMarking) {
return $query->where('invitee_reference', '=', $customerMarking);
})->first();
if(!$companyModule) {
if(!$companyModule){
log::error('unknown customer: '.$customerMarking);
continue;
}
@@ -180,6 +186,10 @@ class FetchWarehouseReceiveListFromVTPortalProcessor
$originWarehouse = $this->fetchesCompanyModule->execute(['id' => $warehouseId === 11 ? 3 : 4]);
$order = $this->createOrderProcessor->execute($companyModule->company, $originWarehouse, $address, $orderNumber);
$order->created_at = Carbon::parse($parcel[1]);
$order->save();
}
$packingListReference = $parcel[17];
@@ -217,13 +227,13 @@ class FetchWarehouseReceiveListFromVTPortalProcessor
}
return [];
} catch (\Exception $exception){
Log::error($exception->getMessage());
}
DB::commit();
return [];
}
@@ -0,0 +1,21 @@
<?php
namespace App\Classes\Modules\PackingLists\Services;
use App\Models\Order;
class ChecksIfPackingListReferenceNumberExists
{
private $repository;
public function __construct(Order $repository)
{
$this->repository = $repository;
}
public function execute(string $reference_number): bool {
return $this->repository->where('reference', $reference_number)->exists();
}
}
@@ -22,7 +22,8 @@ class CreatesContainer extends AbstractUpdateRelationshipRecord
$model->reference = $object->getReference();
$model->container_number = $object->getContainerNumber();
$model->container_type = $object->getContainerType();
$model->seal_reference = $object->getSealNumber();
$model->seal_reference = $object->getSealReference();
$model->loading_date = $object->getLoadingDate();
$model->status = $object->getStatus();
return $this->handler($owner->containers(), $model);
@@ -17,7 +17,7 @@ class UpdatesContainer extends AbstractUpdateRecord
*/
public function execute(Container $model, ContainerObject $object) {
$model->container_reference = $object->getContainerReference();
$model->reference = $object->getReference();
$model->container_type = $object->getContainerType();
$model->seal_reference = $object->getSealReference();
@@ -0,0 +1,24 @@
<?php
namespace App\Classes\Modules\PackingLists\Services\Containers;
use App\Classes\General\Eloquent\AbstractUpdateRecord;
use App\Models\Container;
class UpdatesContainerStatus extends AbstractUpdateRecord
{
/**
* @param Container $model
* @param int $status
* @return \Illuminate\Database\Eloquent\Model
* @throws \App\Classes\Exceptions\MalformedRequestException
*/
public function execute(Container $model, int $status) {
$model->status = $status;
return $this->handler($model);
}
}
@@ -0,0 +1,30 @@
<?php
namespace App\Classes\Modules\PackingLists\Services;
class GeneratesPackingListReferenceNumber
{
/** @var ChecksIfPackingListReferenceNumberExists */
private $checksIfPackingListReferenceNumberExists;
/**
* GeneratesTransactionBillNo constructor.
* @param ChecksIfPackingListReferenceNumberExists $checksIfPackingListRefrenceNumberExists
*/
public function __construct(ChecksIfPackingListReferenceNumberExists $checksIfPackingListReferenceNumberExists)
{
$this->checksIfPackingListReferenceNumberExists = $checksIfPackingListReferenceNumberExists;
}
/**
* @return string
*/
public function execute(): string {
$referenceNumber = mt_rand(10000000, 99999999);
return !$this->checksIfPackingListReferenceNumberExists->execute($referenceNumber) ? $referenceNumber : self::execute();
}
}
@@ -0,0 +1,25 @@
<?php
namespace App\Classes\Modules\PackingLists\Services\Packages;
use App\Classes\General\Eloquent\AbstractUpdateRecord;
use App\Models\Package;
use App\Models\PackingList;
class SwitchesPackagePackingList extends AbstractUpdateRecord
{
/**
* @param Package $model
* @param int $status
* @return \Illuminate\Database\Eloquent\Model
* @throws \App\Classes\Exceptions\MalformedRequestException
*/
public function execute(Package $model, PackingList $packing_list) {
$model->packing_list_id = $packing_list->id;
return $this->handler($model);
}
}
@@ -10,7 +10,6 @@ class UpdatesPackage extends AbstractUpdateRecord
{
public function execute(Package $model, PackageObject $object) {
$model->claimant_id = $object->getClaimantId();
$model->type = $object->getType();
$model->description = $object->getDescription();
$model->width = $object->getWidth();
@@ -0,0 +1,24 @@
<?php
namespace App\Classes\Modules\PackingLists\Services;
use App\Classes\General\Eloquent\AbstractUpdateRecord;
use App\Models\PackingList;
class UpdatesPackingListStatus extends AbstractUpdateRecord
{
/**
* @param PackingList $model
* @param int $status
* @return \Illuminate\Database\Eloquent\Model
* @throws \App\Classes\Exceptions\MalformedRequestException
*/
public function execute(PackingList $model, int $status) {
$model->status = $status;
return $this->handler($model);
}
}
@@ -0,0 +1,39 @@
<?php
namespace App\Classes\Modules\Reports\ControllersLogic;
use App\Classes\General\Abstracts\AbstractControllerLogic;
use App\Models\User;
use Maatwebsite\Excel\Concerns\FromCollection;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use App\Classes\Modules\Reports\ControllersLogic\ExportExcelLogic;
use App\Classes\Modules\PackingLists\Processors\FetchPackingListProcessor;
class CustomcClearanceLogic extends AbstractControllerLogic
{
private $excelExportLogic;
private $listsPackingListProcessor;
public function __construct(FetchPackingListProcessor $listsPackingListProcessor){
$this->listsPackingListProcessor = $listsPackingListProcessor;
}
protected function notification():array {
return [];
}
public function logic(Request $request) : JsonResponse
{
$params = $request->all();
$packingLists = $this->listsPackingListProcessor->execute($params);
$excelExportLogic = new ExportExcelLogic(collect($packingLists));
$this->excelExportLogic = $excelExportLogic;
return response()->json(['success' => true]);
}
public function getExcelCollection(){
return $this->excelExportLogic;
}
}
@@ -0,0 +1,50 @@
<?php
namespace App\Classes\Modules\Reports\ControllersLogic;
use Maatwebsite\Excel\Concerns\FromCollection;
use PhpOffice\PhpSpreadsheet\Shared\Date;
use PhpOffice\PhpSpreadsheet\Style\NumberFormat;
use Maatwebsite\Excel\Concerns\WithColumnFormatting;
use Maatwebsite\Excel\Concerns\WithMapping;
use Maatwebsite\Excel\Concerns\WithHeadings;
use Maatwebsite\Excel\Concerns\ShouldAutoSize;
class ExportExcelLogic implements FromCollection, ShouldAutoSize, WithHeadings, WithColumnFormatting, WithMapping
{
private $data;
public function __construct($data)
{
$this->data=$data;
}
public function collection()
{
return $this->data;
}
public function map($order): array
{
return [
(string)$order->reference,
(string)$order->container_number,
(string)$order->fulladdress,
(string)$order->created_at,
"ssxxx"
];
}
public function columnFormats(): array
{
return [
'A'=>'@',
'B' => NumberFormat::FORMAT_DATE_DDMMYYYY,
];
}
public function headings(): array
{
return ["Reference", "Container", "Address", "Created", "Status"];
}
}
@@ -56,7 +56,7 @@ class CreateScheduleLogic extends AbstractControllerLogic
*/
public function logic(Request $request) : JsonResponse
{
$object = new ScheduleObject($request->input('etd'), $request->input('eta'), $request->input('transport_id'), ApprovalStatus::PENDING_SUBMISSION);
$object = new ScheduleObject($request->input('etd'), $request->input('eta'), ApprovalStatus::PENDING_SUBMISSION);
$this->canCreateSchedule->passes($object);
@@ -23,7 +23,7 @@ class ScheduleObject implements DataTransferObject
* @param Carbon $eta
* @param int $status
*/
public function __construct(Carbon $etd, Carbon $eta, int $status)
public function __construct(?Carbon $etd, ?Carbon $eta, int $status)
{
$this->etd = $etd;
$this->eta = $eta;
@@ -33,7 +33,7 @@ class ScheduleObject implements DataTransferObject
/**
* @return Carbon
*/
public function getEtd(): Carbon
public function getEtd(): ?Carbon
{
return $this->etd;
}
@@ -41,7 +41,7 @@ class ScheduleObject implements DataTransferObject
/**
* @return Carbon
*/
public function getEta(): Carbon
public function getEta(): ?Carbon
{
return $this->eta;
}
@@ -0,0 +1,23 @@
<?php
namespace App\Classes\Modules\Schedules\Services;
use App\Classes\General\Eloquent\AbstractUpdateRecord;
use App\Models\Schedule;
class UpdatesScheduleStatus extends AbstractUpdateRecord
{
/**
* @param Schedule $model
* @param int $status
* @return \Illuminate\Database\Eloquent\Model
* @throws \App\Classes\Exceptions\MalformedRequestException
*/
public function execute(Schedule $model, int $status) {
$model->status = $status;
return $this->handler($model);
}
}
@@ -16,7 +16,6 @@ class ScheduleValidation extends AbstractValidation
*/
protected function data($object): array {
return [
'transport_id' => $object->getTransportId(),
'etd' => $object->getETD(),
'eta' => $object->getETA(),
'status' => $object->getStatus(),
@@ -28,7 +27,6 @@ class ScheduleValidation extends AbstractValidation
*/
protected function rules(): array {
return [
'transport_id' => 'required',
'etd' => 'required',
'eta' => 'required',
];
@@ -7,7 +7,7 @@ use App\Classes\General\Abstracts\AbstractControllerLogic;
use App\Classes\Modules\Transports\Services\CreatesTransport;
use App\Classes\Modules\Transports\Standards\Rules\CanCreateTransport;
use App\Classes\Modules\Transports\DataTransferObjects\TransportObject;
use App\Classes\Modules\PackingLists\Services\Containers\FetchesContainer;
use App\Classes\Modules\PackingLists\Services\FetchesPackingList;
use App\Http\Resources\TransportResource;
use ErrorException;
use Illuminate\Http\JsonResponse;
@@ -29,8 +29,8 @@ class CreateTransportLogic extends AbstractControllerLogic
/** @var CanCreateTransport */
private $canCreateTransport;
/** @var FetchesContainer */
private $fetchesContainer;
/** @var FetchesPackingList */
private $fetchesPackingList;
/** @var CreatesTransport */
private $createsTransport;
@@ -38,13 +38,13 @@ class CreateTransportLogic extends AbstractControllerLogic
/**
* CreateTransportLogic constructor.
* @param CanCreateTransport $canCreateTransport
* @param FetchesContainer $fetchesContainer
* @param FetchesPackingList $fetchesPackingList
* @param CreatesTransport $createsTransport
*/
public function __construct(CanCreateTransport $canCreateTransport, FetchesContainer $fetchesContainer, CreatesTransport $createsTransport)
public function __construct(CanCreateTransport $canCreateTransport, FetchesPackingList $fetchesPackingList, CreatesTransport $createsTransport)
{
$this->canCreateTransport = $canCreateTransport;
$this->fetchesContainer = $fetchesContainer;
$this->fetchesPackingList = $fetchesPackingList;
$this->createsTransport = $createsTransport;
}
@@ -58,11 +58,18 @@ class CreateTransportLogic extends AbstractControllerLogic
public function logic(Request $request) : JsonResponse
{
$object = new TransportObject($request->input('type'), $request->input('courier'), $request->input('tracking_number'), null, null, ApprovalStatus::PENDING_SUBMISSION);
$object = new TransportObject(
$request->input('type'),
$request->input('courier'),
$request->input('tracking_number'),
null,
null,
pprovalStatus::PENDING_SUBMISSION
);
$this->canCreateTransport->passes($object);
$query = $this->createsTransport->execute($this->fetchesContainer->execute(['id' => $request->input('container_id')]), $object);
$query = $this->createsTransport->execute($object, $this->fetchesPackingList->execute(['id' => $request->input('packing_list_id')]));
return $this->resourceResponse(new TransportResource($query));
@@ -58,7 +58,14 @@ class UpdateTransportLogic extends AbstractControllerLogic
{
$query = $this->fetchesTransport->execute(['id' => $request->route('id')]);
$object = new TransportObject($request->input('type'), $request->input('courier'), $request->input('tracking_number'), $request->input('dispatch_date'), $request->input('drop_date'), $request->input('status'));
$object = new TransportObject(
$request->input('type'),
$request->input('courier'),
$request->input('tracking_number'),
$request->input('dispatch_date'),
$request->input('drop_date'),
$request->input('status')
);
$this->canUpdateTransport->passes($object);
@@ -0,0 +1,22 @@
<?php
namespace App\Classes\Modules\Transports\Services;
use App\Classes\General\Eloquent\AbstractUpdateRecord;
use App\Classes\Modules\Transports\DataTransferObjects\TransportObject;
use App\Models\Transport;
class UpdatesDispatchDateTransport extends AbstractUpdateRecord
{
/**
* @param Transport $model
* @return \Illuminate\Database\Eloquent\Model
* @throws \App\Classes\Exceptions\MalformedRequestException
*/
public function execute(Transport $model, $date) {
$model->dispatch_date = $date;
return $this->handler($model);
}
}
@@ -0,0 +1,22 @@
<?php
namespace App\Classes\Modules\Transports\Services;
use App\Classes\General\Eloquent\AbstractUpdateRecord;
use App\Classes\Modules\Transports\DataTransferObjects\TransportObject;
use App\Models\Transport;
class UpdatesDropDateTransport extends AbstractUpdateRecord
{
/**
* @param Transport $model
* @return \Illuminate\Database\Eloquent\Model
* @throws \App\Classes\Exceptions\MalformedRequestException
*/
public function execute(Transport $model, $date) {
$model->drop_date = $date;
return $this->handler($model);
}
}
+57
View File
@@ -0,0 +1,57 @@
<?php
namespace App\Console\Commands;
use App\Models\State;
use App\Http\Helpers\General;
use Illuminate\Console\Command;
use App\Classes\Jobs\FetchContainersStatusUpdateFromVTPortalJob;
use App\Classes\Jobs\FetchDeliveryListFromVTPortalJob;
use App\Classes\Jobs\FetchLoadedContainersFromVTPortalJob;
use App\Classes\Jobs\FetchPackingListFromVTPortalJob;
use App\Classes\Jobs\FetchWarehouseReceiveListFromVTPortalJob;
class CurlVTCommand extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'command:curlVTCommand';
// php artisan queue:work
/**
* The console command description.
*
* @var string
*/
protected $description = 'Command description';
/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
}
/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
{
FetchWarehouseReceiveListFromVTPortalJob::withChain([
new FetchLoadedContainersFromVTPortalJob,
new FetchPackingListFromVTPortalJob,
new FetchContainersStatusUpdateFromVTPortalJob,
new FetchDeliveryListFromVTPortalJob
])->dispatch();
}
}
+10 -8
View File
@@ -17,9 +17,7 @@ class Kernel extends ConsoleKernel
*
* @var array
*/
protected $commands = [
//
];
protected $commands = [];
/**
* Define the application's command schedule.
@@ -29,11 +27,15 @@ class Kernel extends ConsoleKernel
*/
protected function schedule(Schedule $schedule)
{
$schedule->job(FetchWarehouseReceiveListFromVTPortalJob::class)->dailyAt('21:00');
$schedule->job(FetchLoadedContainersFromVTPortalJob::class)->dailyAt('21:15');
$schedule->job(FetchPackingListFromVTPortalJob::class)->dailyAt('21:30');
$schedule->job(FetchContainersStatusUpdateFromVTPortalJob::class)->dailyAt('21:45');
$schedule->job(FetchDeliveryListFromVTPortalJob::class)->dailyAt('22:00');
$schedule->command('command:curlVTCommand')
->dailyAt('15:00')
->withoutOverlapping()
->appendOutputTo (storage_path().'/logs/curlvt.log');
$schedule->command('command:curlVTCommand')
->dailyAt('21:00')
->withoutOverlapping()
->appendOutputTo (storage_path().'/logs/curlvt.log');
}
/**
@@ -0,0 +1,20 @@
<?php
namespace App\Http\Controllers\Accounts;
use App\Classes\Modules\Accounts\ControllersLogic\CreateInvitedCustomerLogic;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
class CreateInvitedCustomerController
{
/**
* @param Request $request
* @param CreateInvitedCustomerLogic $createCustomerLogic
* @return JsonResponse
*/
public function create(Request $request, CreateInvitedCustomerLogic $createCustomerLogic): JsonResponse
{
return $createCustomerLogic->execute($request);
}
}
@@ -0,0 +1,20 @@
<?php
namespace App\Http\Controllers\Orders;
use App\Classes\Modules\Orders\ControllersLogic\ApproveChangeOrderAddressLogic;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
class ApproveChangeOrderAddressController
{
/**
* @param Request $request
* @param ApproveChangeOrderAddressLogic $logic
* @return JsonResponse
*/
public function approve(Request $request, ApproveChangeOrderAddressLogic $logic): JsonResponse
{
return $logic->execute($request);
}
}
@@ -0,0 +1,20 @@
<?php
namespace App\Http\Controllers\Orders;
use App\Classes\Modules\Orders\ControllersLogic\CreateShippingPackingListLogic;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
class CreateShippingPackingListController
{
/**
* @param Request $request
* @param CreateShippingPackingListLogic $logic
* @return JsonResponse
*/
public function create(Request $request, CreateShippingPackingListLogic $logic): JsonResponse
{
return $logic->execute($request);
}
}
@@ -0,0 +1,20 @@
<?php
namespace App\Http\Controllers\Orders;
use App\Classes\Modules\Orders\ControllersLogic\CreateWarehousePackingListLogic;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
class CreateWarehousePackingListController
{
/**
* @param Request $request
* @param CreateWarehousePackingListLogic $logic
* @return JsonResponse
*/
public function create(Request $request, CreateWarehousePackingListLogic $logic): JsonResponse
{
return $logic->execute($request);
}
}
@@ -0,0 +1,20 @@
<?php
namespace App\Http\Controllers\Orders;
use App\Classes\Modules\Orders\ControllersLogic\RequestChangeOrderAddressLogic;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
class RequestChangeOrderAddressController
{
/**
* @param Request $request
* @param ChangeOrderAddressLogic $logic
* @return JsonResponse
*/
public function request(Request $request, RequestChangeOrderAddressLogic $logic): JsonResponse
{
return $logic->execute($request);
}
}
@@ -0,0 +1,20 @@
<?php
namespace App\Http\Controllers\PackingLists;
use App\Classes\Modules\PackingLists\ControllersLogic\CompletePackingListLogic;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
class CompletePackingListController
{
/**
* @param Request $request
* @param CompletePackingListLogic $logic
* @return JsonResponse
*/
public function complete(Request $request, CompletePackingListLogic $logic): JsonResponse {
return $logic->execute($request);
}
}
@@ -0,0 +1,20 @@
<?php
namespace App\Http\Controllers\PackingLists\Containers;
use App\Classes\Modules\PackingLists\ControllersLogic\Containers\AssignPackingListContainerLogic;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
class AssignPackingListContainerController
{
/**
* @param Request $request
* @param AssignPackingListContainerLogic $logic
* @return JsonResponse
*/
public function assign(Request $request, AssignPackingListContainerLogic $logic): JsonResponse {
return $logic->execute($request);
}
}
@@ -0,0 +1,20 @@
<?php
namespace App\Http\Controllers\PackingLists\Containers;
use App\Classes\Modules\PackingLists\ControllersLogic\Containers\CompleteContainerLogic;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
class CompleteContainerController
{
/**
* @param Request $request
* @param CompleteContainerLogic $logic
* @return JsonResponse
*/
public function complete(Request $request, CompleteContainerLogic $logic): JsonResponse {
return $logic->execute($request);
}
}
@@ -0,0 +1,20 @@
<?php
namespace App\Http\Controllers\PackingLists\Containers;
use App\Classes\Modules\PackingLists\ControllersLogic\Containers\CreateLoadContainerLogic;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
class CreateLoadContainerController
{
/**
* @param Request $request
* @param CreateLoadContainerLogic $logic
* @return JsonResponse
*/
public function create(Request $request, CreateLoadContainerLogic $logic): JsonResponse {
return $logic->execute($request);
}
}
@@ -0,0 +1,20 @@
<?php
namespace App\Http\Controllers\PackingLists\Containers;
use App\Classes\Modules\PackingLists\ControllersLogic\Containers\InboundCustomClearedLogic;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
class InboundCustomClearedController
{
/**
* @param Request $request
* @param InboundCustomClearedLogic $logic
* @return JsonResponse
*/
public function list(Request $request, InboundCustomClearedLogic $logic): JsonResponse {
return $logic->execute($request);
}
}
@@ -10,7 +10,7 @@ class ListContainersController
{
/**
* @param Request $request
* @param ListContainerLogic $logic
* @param ListContainersLogic $logic
* @return JsonResponse
*/
public function list(Request $request, ListContainersLogic $logic): JsonResponse {
@@ -0,0 +1,19 @@
<?php
namespace App\Http\Controllers\PackingLists\Containers;
use App\Classes\Modules\PackingLists\ControllersLogic\Containers\RescheduleContainerLogic;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
class RescheduleContainerController
{
/**
* @param Request $request
* @param RescheduleContainerLogic $logic
* @return JsonResponse
*/
public function reschedule(Request $request, RescheduleContainerLogic $logic): JsonResponse {
return $logic->execute($request);
}
}
@@ -0,0 +1,20 @@
<?php
namespace App\Http\Controllers\PackingLists\Containers;
use App\Classes\Modules\PackingLists\ControllersLogic\Containers\UpdateDispatchDateContainerLogic;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
class UpdateDispatchDateContainerController
{
/**
* @param Request $request
* @param UpdateDispatchDateContainerLogic $logic
* @return JsonResponse
*/
public function update(Request $request, UpdateDispatchDateContainerLogic $logic): JsonResponse {
return $logic->execute($request);
}
}
@@ -0,0 +1,20 @@
<?php
namespace App\Http\Controllers\PackingLists\Containers;
use App\Classes\Modules\PackingLists\ControllersLogic\Containers\UpdateDropDateContainerLogic;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
class UpdateDropDateContainerController
{
/**
* @param Request $request
* @param UpdateDropDateContainerLogic $logic
* @return JsonResponse
*/
public function update(Request $request, UpdateDropDateContainerLogic $logic): JsonResponse {
return $logic->execute($request);
}
}
@@ -2,7 +2,7 @@
namespace App\Http\Controllers\PackingLists\Packages;
use App\Classes\Modules\ControllersLogic\Packages\CreatePackageLogic;
use App\Classes\Modules\PackingLists\ControllersLogic\Packages\CreatePackageRemarkLogic;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
@@ -10,10 +10,10 @@ class CreatePackageController
{
/**
* @param Request $request
* @param CreatePackageLogic $logic
* @param CreatePackageRemarkLogic $logic
* @return JsonResponse
*/
public function create(Request $request, CreatePackageLogic $logic): JsonResponse {
public function create(Request $request, CreatePackageRemarkLogic $logic): JsonResponse {
return $logic->execute($request);
}

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