From e7a63149b30b8083e5b52e8abb62364dd31fcc6e Mon Sep 17 00:00:00 2001 From: edmondlang Date: Tue, 18 Jun 2024 13:43:57 +0800 Subject: [PATCH 01/41] revert update pending_orders, exclude approved refunds order from pending_orders list --- routes/web.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/routes/web.php b/routes/web.php index 469e2625..5d79c691 100644 --- a/routes/web.php +++ b/routes/web.php @@ -403,7 +403,7 @@ Route::get('/segments', function (Request $request) { Route::get('/pending_orders', function(){ $payments = Transaction::where('type', TransactionType::PAYMENT)->where('owner_type', Booking::class)->whereIn('status', [ApprovalStatus::APPROVED]) ->whereDoesntHave('transactions', function ($query) { - return $query->where('type', TransactionType::REFUND)->whereIn('status', [ApprovalStatus::PENDING_SUBMISSION, ApprovalStatus::PENDING_VERIFICATION, ApprovalStatus::APPROVED]); + return $query->where('type', TransactionType::REFUND)->whereIn('status', [ApprovalStatus::PENDING_SUBMISSION, ApprovalStatus::PENDING_VERIFICATION]); }) ->get(); From 60b1bbeee6ac614058d9299c9e6f9d875a648e80 Mon Sep 17 00:00:00 2001 From: edmondlang Date: Fri, 21 Jun 2024 15:11:10 +0800 Subject: [PATCH 02/41] admin 1688 work flow template --- .../AdminWorkFlowSectionComponent.vue | 77 +++++++++++++++++++ .../dashboards/admin_work_flow.blade.php | 4 + routes/web.php | 3 + 3 files changed, 84 insertions(+) create mode 100644 resources/assets/vue/components/general/sections/AdminWorkFlowSectionComponent.vue create mode 100644 resources/views/pages/dashboards/admin_work_flow.blade.php diff --git a/resources/assets/vue/components/general/sections/AdminWorkFlowSectionComponent.vue b/resources/assets/vue/components/general/sections/AdminWorkFlowSectionComponent.vue new file mode 100644 index 00000000..bd75c002 --- /dev/null +++ b/resources/assets/vue/components/general/sections/AdminWorkFlowSectionComponent.vue @@ -0,0 +1,77 @@ + + + + + \ No newline at end of file diff --git a/resources/views/pages/dashboards/admin_work_flow.blade.php b/resources/views/pages/dashboards/admin_work_flow.blade.php new file mode 100644 index 00000000..4fe3ddb2 --- /dev/null +++ b/resources/views/pages/dashboards/admin_work_flow.blade.php @@ -0,0 +1,4 @@ +@extends('layouts.base_portal') +@section('inner_content') + +@endsection \ No newline at end of file diff --git a/routes/web.php b/routes/web.php index 12269a21..9ee682ae 100644 --- a/routes/web.php +++ b/routes/web.php @@ -1190,3 +1190,6 @@ Route::get('check-duplicate-refunds', function () { echo ''; }); +Route::get('/admin-work-flow', function () { + return view('pages.dashboards.admin_work_flow'); +})->name('admin-work-flow'); From 286ed8c73cf99649d5e7c3f8eb0a690dcf0d2517 Mon Sep 17 00:00:00 2001 From: Aqqil Azman Date: Fri, 21 Jun 2024 17:54:04 +0800 Subject: [PATCH 03/41] added approve_po v-if condition and the order number box for approve_po as well as the designated buttons --- .../AdminWorkFlowSectionComponent.vue | 47 ++++++++++++++++--- 1 file changed, 40 insertions(+), 7 deletions(-) diff --git a/resources/assets/vue/components/general/sections/AdminWorkFlowSectionComponent.vue b/resources/assets/vue/components/general/sections/AdminWorkFlowSectionComponent.vue index bd75c002..ade11bf4 100644 --- a/resources/assets/vue/components/general/sections/AdminWorkFlowSectionComponent.vue +++ b/resources/assets/vue/components/general/sections/AdminWorkFlowSectionComponent.vue @@ -3,10 +3,22 @@

{{ currentQuestion.text }}

-
- +
+
+
+

{{ order }}

+
+
+ + + +
+
+
+ +
@@ -43,11 +55,12 @@ export default { ] }, '1688': { text: 'Q1-A1', answers: [{ text: 'A1-A1', next: 'q1-a1-a1' }, { text: 'A1-A2', next: 'q1-a1-a2' }] }, - 'approve_po': { text: 'Q1-A2', answers: [] }, + 'approve_po': { text: 'Order Numbers', answers: [] }, 'fill_po': { text: 'Q1-A3', answers: [] }, }, currentQuestionId: null, - readyToWork: true + readyToWork: true, + orderNumbers: ['Order 123', 'Order 456', 'Order 789'] }; }, computed: { @@ -61,6 +74,15 @@ export default { }, selectAnswer(nextQuestionId) { this.currentQuestionId = nextQuestionId; + }, + selectOrder(order, action) { + if (action === 'approve') { + alert(`${order} has been approved.`); + } else if (action === 'edit') { + alert(`Editing ${order}.`); + } else if (action === 'reject') { + alert(`${order} has been rejected.`); + } } } }; @@ -74,4 +96,15 @@ export default { .btn { margin: 5px; } - \ No newline at end of file + +.box { + border: 1px solid #ddd; + padding: 20px; + margin-top: 20px; + border-radius: 8px; +} + +.order { + margin-bottom: 15px; +} + From 6a8006c0b0039a8b1d6dcfebf9c757b2951df07a Mon Sep 17 00:00:00 2001 From: Aqqil Azman Date: Tue, 25 Jun 2024 13:27:14 +0800 Subject: [PATCH 04/41] continue workflow, added Issue, approve PO and edit order --- .../AdminWorkFlowSectionComponent.vue | 101 ++++++++++++++++-- 1 file changed, 95 insertions(+), 6 deletions(-) diff --git a/resources/assets/vue/components/general/sections/AdminWorkFlowSectionComponent.vue b/resources/assets/vue/components/general/sections/AdminWorkFlowSectionComponent.vue index ade11bf4..8c28cdac 100644 --- a/resources/assets/vue/components/general/sections/AdminWorkFlowSectionComponent.vue +++ b/resources/assets/vue/components/general/sections/AdminWorkFlowSectionComponent.vue @@ -3,16 +3,47 @@

{{ currentQuestion.text }}

-
+

{{ order }}

+ Total: CNY +
+ +
+
+
+
+

{{ order }}

+
+ Total: CNY
+
+
+
+ +
+ +
Total: CNY
+
+ + +
+
+
+

What issue did you encounter?

+ +
Upload an image if needed
+ +
+ + +
+
+
Login Information
+ + + +
+
+
Order Information
+ + +
+
+
Order Amount
+
+
+ +
+ CNY +
+ + +
@@ -31,17 +53,43 @@
Total: CNY
- +
-
+
+
+

Upload English PO

+ +
+
+

Upload China PO

+ +
+
+

Upload bank slip

+ +
+ + +
+

What issue did you encounter?

Upload an image if needed
- + + +
+
+
+

What issue did you encounter?

+ +
Upload an image if needed
+ +
+
@@ -85,12 +133,66 @@ export default { { text: 'Fill PO', next: 'fill_po' } ] }, - '1688': { - text: 'Q1-A1', + '1688': {}, + 'issue_login': { + text: 'Login Issues', answers: [ - { text: 'A1-A1', next: 'q1-a1-a1' }, - { text: 'A1-A2', next: 'q1-a1-a2' } - ] + { text: 'Need TAC', next: 'issue_submit'}, + { text: 'Wrong login details', next: 'issue_submit'}, + { text: 'Others', next: 'po_others'}, + { text: 'Order Cancelled', next: 'refund_request'}, + ] + }, + 'login_successful': {}, + 'issue_order': { + answers: [ + { text: 'Amount not found', next: 'issue_submit'}, + { text: 'Plus Member', next: 'issue_submit'}, + { text: 'Others', next: 'po_others'}, + { text: 'Customer Did not verify 1688 account', next: 'issue_submit'}, + { text: 'WorldFirst account linked another account', next: 'issue_submit'}, + { text: 'Back', next: 'login_successful'}, + ] + }, + 'order_verify': {}, + 'order_verification': { + text: 'Are You Sure this is the correct amount?', + answers: [ + {text: 'Yes', next: 'proceed_order'}, + {text: 'No', next: 'insufficient_order'} + ] + }, + 'proceed_order': { + text: 'Please proceed the order on 1688', + answers: [ + {text: 'Got Issue', next: '1688_order_issue'}, + {text: 'Done', next: '1688_submit'} + ] + }, + '1688_order_issue': { + answers: [ + {text: 'Wrong Pin Number', next: '1688_issue_submit'}, + {text: 'Not Enough Stock', next: '1688_issue_submit'}, + {text: 'Others', next: '1688_others'}, + {text: 'No CrossBoarder', next: '1688_issue_submit'}, + {text: 'AngPau', next: '1688_issue_submit'} + ] + }, + '1688_others': {}, + '1688_submit': {}, + '1688_issue_submit': { + text: 'Issue has been submitted', + answers: [ + { text: 'Stop Working', next: 'stop_working'}, + { text: 'Next Order', next: '1688'} + ] + }, + 'refund_request': { + text: 'Refund Request sent', + answers: [ + { text: 'Stop Working', next: 'stop_working' }, + { text: 'Next PO', next: 'approve_po' } + ] }, 'approve_po': {}, 'fill_po': {}, @@ -110,10 +212,38 @@ export default { ] }, 'edit_po': {}, - 'issue_po': {}, + 'po_others': {}, + 'reject_po': { + text: 'PO Rejected', + answers: [ + { text: 'Issue', next: 'issue_po' }, + { text: 'Back', next: 'approve_po' } + ] + }, + 'issue_po': { + answers: [ + { text: 'Sensitive Goods', next: 'issue_submit'}, + { text: 'Others', next: 'po_others'}, + { text: 'Stop Working', next: 'stop_working'}, + { text: 'Next PO', next: 'approve_po'} + ] + }, + 'issue_submit': { + text: 'Issue has been submitted', + answers: [ + { text: 'Stop Working', next: 'stop_working'}, + { text: 'Next Order', next: 'approve_po'} + ] + }, + '1688_issue_submitted': { + text: 'Issue has been submitted', + answers: [ + { text: 'Stop Working', next: 'stop_working'}, + { text: 'Next Order', next: '1688'} + ] + }, 'stop_working': { text: 'Thank you for your work!', - answers: [] } }, currentQuestionId: null, @@ -139,7 +269,19 @@ export default { } else if (action === 'edit') { this.currentQuestionId = 'edit_po'; } else if (action === 'reject') { - alert(`${order} has been rejected.`); + this.currentQuestionId = 'reject_po'; + } else if (action == 'issue_login') { + this.currentQuestionId = 'issue_login' + } else if (action == 'dummy_login') { + this.currentQuestionId = 'login_successful' + } else if (action == 'error_order') { + this.currentQuestionId = 'issue_order' + } else if (action == 'verify_order') { + this.currentQuestionId = 'order_verify' + } else if (action == 'back_order') { + this.currentQuestionId = 'login_successful' + } else if (action == 'yes_order') { + this.currentQuestionId = 'order_verification' } }, addOrder() { @@ -149,9 +291,18 @@ export default { alert('Orders have been saved: ' + this.orderNumbers.join(', ')); this.currentQuestionId = 'po_filled'; }, - issueOrders(){ + nextorder() { + this.currentQuestionId = '1688'; + }, + issueOthers(){ this.currentQuestionId = 'issue_po'; }, + issue1688() { + this.currentQuestionId = '1688_order_issue'; + }, + submit_issue() { + this.currentQuestionId = '1688_issue_submitted'; + }, submit() { } From f7bd74bee4cca4f7ccf188244ea11a0634c61dc7 Mon Sep 17 00:00:00 2001 From: Aqqil Azman Date: Thu, 18 Jul 2024 15:33:39 +0800 Subject: [PATCH 06/41] made buttons bigger and align them horizontally --- .../AdminWorkFlowSectionComponent.vue | 63 ++++++++++++------- 1 file changed, 39 insertions(+), 24 deletions(-) diff --git a/resources/assets/vue/components/general/sections/AdminWorkFlowSectionComponent.vue b/resources/assets/vue/components/general/sections/AdminWorkFlowSectionComponent.vue index 7add11bf..3190ed5e 100644 --- a/resources/assets/vue/components/general/sections/AdminWorkFlowSectionComponent.vue +++ b/resources/assets/vue/components/general/sections/AdminWorkFlowSectionComponent.vue @@ -16,11 +16,11 @@
Login Information
- +
Order Information
- +
@@ -93,10 +93,12 @@
-
- +
+
+ +
@@ -315,10 +317,6 @@ export default { margin: 20px; } -.btn { - margin: 5px; -} - .box { border: 1px solid #ddd; padding: 20px; @@ -331,20 +329,37 @@ export default { } .image-upload { - width: 80%; - padding: 10px; - font-size: 16px; - border: 1px solid #ccc; - border-radius: 4px; - margin-bottom:10px; - } + width: 80%; + padding: 10px; + font-size: 16px; + border: 1px solid #ccc; + border-radius: 4px; + margin-bottom: 10px; +} .text-box { - width: 80%; - padding: 10px; - font-size: 16px; - border: 1px solid #ccc; - border-radius: 4px; - margin-bottom: 20px; - } + width: 80%; + padding: 10px; + font-size: 16px; + border: 1px solid #ccc; + border-radius: 4px; + margin-bottom: 20px; +} + +.btn { + margin: 5px; + font-size: 18px; /* Adjust the font size */ + padding: 12px 24px; /* Adjust the padding */ + border-radius: 4px; /* Optional: adjust border radius */ +} + +.answer-container { + display: flex; + justify-content: center; + flex-wrap: wrap; +} + +.answer-item { + margin: 10px; +} From 8d48f6f4eb42d6d038dc3b5443244bd8cdc7cd84 Mon Sep 17 00:00:00 2001 From: edmondlang Date: Mon, 22 Jul 2024 01:12:51 +0800 Subject: [PATCH 07/41] 1688 admin work flow clean up and call api --- app/Models/WorkflowTimestamp.php | 47 ++ ...22302_create_workflow_timestamps_table.php | 35 + .../AdminWorkFlowSectionComponent.vue | 602 +++++++++--------- routes/admin_work_flow.php | 90 +++ routes/api.php | 2 + 5 files changed, 470 insertions(+), 306 deletions(-) create mode 100644 app/Models/WorkflowTimestamp.php create mode 100644 database/migrations/2024_07_21_222302_create_workflow_timestamps_table.php create mode 100644 routes/admin_work_flow.php diff --git a/app/Models/WorkflowTimestamp.php b/app/Models/WorkflowTimestamp.php new file mode 100644 index 00000000..bb189afb --- /dev/null +++ b/app/Models/WorkflowTimestamp.php @@ -0,0 +1,47 @@ + 'datetime', + ]; + + /** + * Get the user that owns the workflow timestamp. + */ + public function user() + { + return $this->belongsTo(User::class, 'userId'); + } +} diff --git a/database/migrations/2024_07_21_222302_create_workflow_timestamps_table.php b/database/migrations/2024_07_21_222302_create_workflow_timestamps_table.php new file mode 100644 index 00000000..5a166ffd --- /dev/null +++ b/database/migrations/2024_07_21_222302_create_workflow_timestamps_table.php @@ -0,0 +1,35 @@ +id(); + $table->string('node'); + $table->integer('seconds'); + $table->unsignedBigInteger('userId'); + $table->string('session_id'); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('workflow_timestamps'); + } +} diff --git a/resources/assets/vue/components/general/sections/AdminWorkFlowSectionComponent.vue b/resources/assets/vue/components/general/sections/AdminWorkFlowSectionComponent.vue index 3190ed5e..1d88a6ea 100644 --- a/resources/assets/vue/components/general/sections/AdminWorkFlowSectionComponent.vue +++ b/resources/assets/vue/components/general/sections/AdminWorkFlowSectionComponent.vue @@ -1,120 +1,119 @@