mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-22 05:53:58 +00:00
Merge branch 'development' of https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0 into development
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<php>
|
||||
<ini name="display_errors" value="On" />
|
||||
<ini name="display_startup_errors" value="On" />
|
||||
</php>
|
||||
<phpunit
|
||||
colors="true"
|
||||
>
|
||||
<testsuites>
|
||||
<testsuite name="dryrun">
|
||||
<directory suffix="php">./tests/Browser/DryRun/</directory>
|
||||
</testsuite>
|
||||
</testsuites>
|
||||
</phpunit>
|
||||
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
APP_NAME=Laravel
|
||||
APP_ENV=local
|
||||
APP_KEY=base64:X521H/hWdbsG6S/JG0Q/BZgTo1azoV18kzqkqMQSDrQ=
|
||||
APP_DEBUG=true
|
||||
APP_URL=http://localhost
|
||||
|
||||
LOG_CHANNEL=stack
|
||||
|
||||
DB_CONNECTION=dusk
|
||||
DB_HOST=127.0.0.1
|
||||
DB_PORT=3306
|
||||
DB_DATABASE=exchange-test
|
||||
DB_USERNAME=root
|
||||
DB_PASSWORD=
|
||||
|
||||
BROADCAST_DRIVER=log
|
||||
CACHE_DRIVER=file
|
||||
QUEUE_CONNECTION=sync
|
||||
SESSION_DRIVER=file
|
||||
SESSION_LIFETIME=120
|
||||
|
||||
REDIS_HOST=127.0.0.1
|
||||
REDIS_PASSWORD=null
|
||||
REDIS_PORT=6379
|
||||
|
||||
MAIL_MAILER=smtp
|
||||
MAIL_HOST=smtp.mailtrap.io
|
||||
MAIL_PORT=2525
|
||||
MAIL_USERNAME=null
|
||||
MAIL_PASSWORD=null
|
||||
MAIL_ENCRYPTION=null
|
||||
MAIL_FROM_ADDRESS=null
|
||||
MAIL_FROM_NAME="${APP_NAME}"
|
||||
|
||||
AWS_ACCESS_KEY_ID=
|
||||
AWS_SECRET_ACCESS_KEY=
|
||||
AWS_DEFAULT_REGION=us-east-1
|
||||
AWS_BUCKET=
|
||||
|
||||
PUSHER_APP_ID=
|
||||
PUSHER_APP_KEY=
|
||||
PUSHER_APP_SECRET=
|
||||
PUSHER_APP_CLUSTER=mt1
|
||||
|
||||
MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
|
||||
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
|
||||
|
||||
FILESYSTEM_DRIVER="documents"
|
||||
|
||||
JWT_SECRET=
|
||||
JWT_TTL=1440
|
||||
|
||||
SHIPPING_URL=http://shipping-portal.test/
|
||||
MIX_SHIPPING_URL="${SHIPPING_URL}"
|
||||
|
||||
BILLPLZ_BASE_URL="https://www.billplz-sandbox.com"
|
||||
BILLPLZ_API_KEY="0fa4c710-761b-4a7a-a501-c2c2d02643d5"
|
||||
BILLPLZ_X_SIGNATURE_KEY="S-pbNVthVRsvnPfZlgLwqqOg"
|
||||
BILLPLZ_COLLECTION_ID="hev2wdjy"
|
||||
@@ -101,7 +101,7 @@ class CreateCustomerLogic extends AbstractControllerLogic
|
||||
|
||||
$this->assignSegmentProcessor->execute($company);
|
||||
|
||||
$this->generateEmailVerificationAttemptProcessor->execute($user);
|
||||
// $this->generateEmailVerificationAttemptProcessor->execute($user);
|
||||
|
||||
return $this->response($this->authenticationProcessor->execute($request));
|
||||
|
||||
|
||||
+2
-1
@@ -10,7 +10,7 @@
|
||||
"require": {
|
||||
"php": "^7.2.5",
|
||||
"ext-fileinfo": "*",
|
||||
"ext-json": "^1.6",
|
||||
"ext-json": "*",
|
||||
"ext-zip": "*",
|
||||
"barryvdh/laravel-dompdf": "^0.9.0",
|
||||
"carlos-meneses/laravel-mpdf": "^2.1",
|
||||
@@ -31,6 +31,7 @@
|
||||
"require-dev": {
|
||||
"facade/ignition": "^2.0",
|
||||
"fzaninotto/faker": "^1.9.1",
|
||||
"laravel/dusk": "^6.23",
|
||||
"mockery/mockery": "^1.3.1",
|
||||
"nunomaduro/collision": "^4.1",
|
||||
"phpunit/phpunit": "^8.5"
|
||||
|
||||
@@ -63,6 +63,26 @@ return [
|
||||
]) : [],
|
||||
],
|
||||
|
||||
'dusk' => [
|
||||
'driver' => 'mysql',
|
||||
'url' => env('DATABASE_URL'),
|
||||
'host' => env('DB_HOST', '127.0.0.1'),
|
||||
'port' => env('DB_PORT', '3306'),
|
||||
'database' => env('DB_DATABASE', 'forge'),
|
||||
'username' => env('DB_USERNAME', 'forge'),
|
||||
'password' => env('DB_PASSWORD', ''),
|
||||
'unix_socket' => env('DB_SOCKET', ''),
|
||||
'charset' => 'utf8mb4',
|
||||
'collation' => 'utf8mb4_unicode_ci',
|
||||
'prefix' => '',
|
||||
'prefix_indexes' => true,
|
||||
'strict' => false,
|
||||
'engine' => null,
|
||||
'options' => extension_loaded('pdo_mysql') ? array_filter([
|
||||
PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
|
||||
]) : [],
|
||||
],
|
||||
|
||||
'pgsql' => [
|
||||
'driver' => 'pgsql',
|
||||
'url' => env('DATABASE_URL'),
|
||||
|
||||
@@ -7,13 +7,13 @@
|
||||
<validation-wrapper-component class="m-b-15" :validator="$v.parameters.email">
|
||||
<label class="text-primary">Email Address</label>
|
||||
<div class="controls">
|
||||
<input type="text" class="form-control fs-12" v-model.trim="parameters.email">
|
||||
<input id="email" name="email" type="text" class="form-control fs-12" v-model.trim="parameters.email">
|
||||
</div>
|
||||
</validation-wrapper-component>
|
||||
<validation-wrapper-component :validator="$v.parameters.password">
|
||||
<label class="text-primary">Password</label>
|
||||
<div class="controls">
|
||||
<input type="password" class="form-control fs-12" v-model="parameters.password">
|
||||
<input id="password" name="password" type="password" class="form-control fs-12" v-model="parameters.password">
|
||||
</div>
|
||||
</validation-wrapper-component>
|
||||
<div class="row m-t-15 align-items-center justify-content-center">
|
||||
@@ -21,7 +21,7 @@
|
||||
<p class="muted fs-11 font-arial m-b-0 pointer" @click="$store.dispatch('toggleSection', {name: 'forgetPassword', status: true})">Forgot password?</p>
|
||||
</div>
|
||||
<div class="col text-right">
|
||||
<div class="btn btn-sm p-l-30 p-r-30 btn-primary bold v-align-middle b-rad-none all-caps" @click="submitForm">Sign In</div>
|
||||
<div class="btn btn-sm p-l-30 p-r-30 btn-primary bold v-align-middle b-rad-none all-caps" @click="submitForm" id="sign-in">Sign In</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -55,4 +55,4 @@
|
||||
mixins: [loginFormValidation]
|
||||
}
|
||||
|
||||
</script>
|
||||
</script>
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -100,7 +100,7 @@
|
||||
</div>
|
||||
<div class="row" v-show="!createBank">
|
||||
<div class="col-7 p-r-0">
|
||||
<div class="row">
|
||||
<div class="row" id="select-list" name="select-list">
|
||||
<div class="col">
|
||||
<div class="form-group no-margin form-group-default">
|
||||
<label>{{ data.serviceType.id === 4 ? 'Alipay recipient Email / Phone' : 'Account No.' }}</label>
|
||||
@@ -115,7 +115,7 @@
|
||||
<div class="row text-left no-margin bg-white">
|
||||
<div class="col no-padding">
|
||||
<div class="row no-margin" v-for="bank in data.recipientBanks.filter(AccountNumber)" v-bind:key="bank.id" >
|
||||
<div class="col b-b b-grey p-t-10 p-b-10 pointer p-t-10 p-b-10" :class="[{'bg-master-lightest': parameters.bankAccount.id === bank.id}, {'text-master': parameters.bankAccount.id === bank.id}, {'hover-primary': parameters.bankAccount.id !== bank.id}, {'pointer': parameters.bankAccount.id !== bank.id}]" @click="selectBank(bank)">
|
||||
<div id="select-option" name="select-option" class="col b-b b-grey p-t-10 p-b-10 pointer p-t-10 p-b-10" :class="[{'bg-master-lightest': parameters.bankAccount.id === bank.id}, {'text-master': parameters.bankAccount.id === bank.id}, {'hover-primary': parameters.bankAccount.id !== bank.id}, {'pointer': parameters.bankAccount.id !== bank.id}]" @click="selectBank(bank)">
|
||||
<div class="row align-items-center justify-content-center">
|
||||
<div class="col">
|
||||
<div class="row">
|
||||
@@ -320,4 +320,4 @@
|
||||
},
|
||||
mixins: [FormHandler]
|
||||
}
|
||||
</script>
|
||||
</script>
|
||||
|
||||
@@ -133,7 +133,7 @@
|
||||
</div>
|
||||
<div class="row p-b-15" v-if="(summary.calculation.total > 0 && (data.status === 1 || data.status === 2)) || ($store.getters.isAdmin && summary.calculation.total > 0)">
|
||||
<div class="col">
|
||||
<div class="btn btn-sm btn-block btn-success b-rad-none shadow-sm pointer requestModal" data-type="transferSummary" >Transfer Now</div>
|
||||
<div class="btn btn-sm btn-block btn-success b-rad-none shadow-sm pointer requestModal" data-type="transferSummary" id="transfer-now" name="transfer-now">Transfer Now</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" v-if="summary.calculation.total > 0 && data.status === 0">
|
||||
@@ -152,7 +152,7 @@
|
||||
</modal-component>
|
||||
</div>
|
||||
</div>
|
||||
<modal-component v-if="summary.calculation.total > 0" class="animate__animated animate__fast animate__fadeIn" styleType="fill-in" type="transferSummary" size="large">
|
||||
<modal-component id="select-account-modal" v-if="summary.calculation.total > 0" class="animate__animated animate__fast animate__fadeIn" styleType="fill-in" type="transferSummary" size="large">
|
||||
<booking-confirmation-component :data="summary" :section="section"></booking-confirmation-component>
|
||||
</modal-component>
|
||||
</div>
|
||||
|
||||
@@ -124,7 +124,7 @@
|
||||
</div>
|
||||
<div class="row m-t-20" v-if="data.company.employee.status === 2 && data.company.status === 2 && data.outstanding_amount > 0">
|
||||
<div class="col">
|
||||
<button class="btn btn-sm all-caps b-rad-none btn-success btn-block" @click="makePayment()">Make Payment</button>
|
||||
<button id="payment-btn" class="btn btn-sm all-caps b-rad-none btn-success btn-block" @click="makePayment()">Make Payment</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -233,7 +233,7 @@
|
||||
<div class="m-b-15 m-t-10 text-center">
|
||||
<img src="/images/fpx-logo-vector-01.png" alt="logo" height="25">
|
||||
</div>
|
||||
<p class="no-margin bold all-caps">Online Banking</p>
|
||||
<p id="online-banking" class="no-margin bold all-caps">Online Banking</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -266,7 +266,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="row m-t-10 m-b-10">
|
||||
<div class="col text-center"><div class="padding-10 bg-master-lightest pointer" @click="$store.dispatch('toggleSection', {name: 'otherPaymentMethods', status: !$store.getters.isShowing('otherPaymentMethods')})"><i class="fa m-r-10" :class="[{'fa-angle-up': $store.getters.isShowing('otherPaymentMethods')}, {'fa-angle-down': !$store.getters.isShowing('otherPaymentMethods')}]"></i>{{$store.getters.isShowing('otherPaymentMethods') ? 'Hide' : 'Show'}} Alternative Methods <i class="fa m-l-10" :class="[{'fa-angle-up': $store.getters.isShowing('otherPaymentMethods')}, {'fa-angle-down': !$store.getters.isShowing('otherPaymentMethods')}]"></i></div></div>
|
||||
<div class="col text-center"><div id="expend-method" class="padding-10 bg-master-lightest pointer" @click="$store.dispatch('toggleSection', {name: 'otherPaymentMethods', status: !$store.getters.isShowing('otherPaymentMethods')})"><i class="fa m-r-10" :class="[{'fa-angle-up': $store.getters.isShowing('otherPaymentMethods')}, {'fa-angle-down': !$store.getters.isShowing('otherPaymentMethods')}]"></i>{{$store.getters.isShowing('otherPaymentMethods') ? 'Hide' : 'Show'}} Alternative Methods <i class="fa m-l-10" :class="[{'fa-angle-up': $store.getters.isShowing('otherPaymentMethods')}, {'fa-angle-down': !$store.getters.isShowing('otherPaymentMethods')}]"></i></div></div>
|
||||
</div>
|
||||
<div class="row" v-show="$store.getters.isShowing('otherPaymentMethods')">
|
||||
<div class="col">
|
||||
@@ -280,7 +280,7 @@
|
||||
viewBox="0 0 172 172"
|
||||
style=" fill:#000000;"><defs><linearGradient x1="86" y1="15.45313" x2="86" y2="157.24562" gradientUnits="userSpaceOnUse" id="color-1_46094_gr1"><stop offset="0" stop-color="#009add"></stop><stop offset="1" stop-color="#00baa4"></stop></linearGradient><linearGradient x1="86" y1="62.14844" x2="86" y2="87.68238" gradientUnits="userSpaceOnUse" id="color-2_46094_gr2"><stop offset="0" stop-color="#4ec9ff"></stop><stop offset="1" stop-color="#2bffe6"></stop></linearGradient></defs><g fill="none" fill-rule="nonzero" stroke="none" stroke-width="1" stroke-linecap="butt" stroke-linejoin="miter" stroke-miterlimit="10" stroke-dasharray="" stroke-dashoffset="0" font-family="none" font-weight="none" font-size="none" text-anchor="none" style="mix-blend-mode: normal"><path d="M0,172v-172h172v172z" fill="none"></path><g><path d="M142.4375,26.875h-18.8125v-5.375c0,-2.96431 -2.41069,-5.375 -5.375,-5.375h-64.5c-2.96431,0 -5.375,2.41069 -5.375,5.375v5.375h-18.8125c-4.44513,0 -8.0625,3.61737 -8.0625,8.0625v86c0,4.44512 3.61737,8.0625 8.0625,8.0625h40.3125v10.75h-10.75c-4.44512,0 -8.0625,3.61738 -8.0625,8.0625v2.6875h-10.75v5.375h10.75h69.875h10.75v-5.375h-10.75v-2.6875c0,-4.44512 -3.61738,-8.0625 -8.0625,-8.0625h-10.75v-10.75h40.3125c4.44512,0 8.0625,-3.61738 8.0625,-8.0625v-86c0,-4.44513 -3.61737,-8.0625 -8.0625,-8.0625zM123.625,96.75v-53.75h10.75v64.5h-96.75v-64.5h10.75v53.75zM107.5,91.375h-43v-48.64644c5.25675,-1.06962 9.40894,-5.22181 10.47856,-10.47856h22.04019c1.06963,5.25675 5.22181,9.40894 10.47856,10.47856v48.64644zM53.75,21.5h64.5v69.875h-5.375v-53.75h-2.6875c-4.44512,0 -8.0625,-3.61738 -8.0625,-8.0625v-2.6875h-32.25v2.6875c0,4.44512 -3.61737,8.0625 -8.0625,8.0625h-2.6875v53.75h-5.375zM112.875,145.125c1.4835,0 2.6875,1.204 2.6875,2.6875v2.6875h-59.125v-2.6875c0,-1.4835 1.204,-2.6875 2.6875,-2.6875h10.75h32.25zM96.75,139.75h-21.5v-10.75h21.5zM145.125,120.9375c0,1.4835 -1.204,2.6875 -2.6875,2.6875h-40.3125h-32.25h-40.3125c-1.4835,0 -2.6875,-1.204 -2.6875,-2.6875v-86c0,-1.4835 1.204,-2.6875 2.6875,-2.6875h18.8125v5.375h-10.75c-2.96431,0 -5.375,2.41069 -5.375,5.375v64.5c0,2.96431 2.41069,5.375 5.375,5.375h96.75c2.96431,0 5.375,-2.41069 5.375,-5.375v-64.5c0,-2.96431 -2.41069,-5.375 -5.375,-5.375h-10.75v-5.375h18.8125c1.4835,0 2.6875,1.204 2.6875,2.6875z" fill="url(#color-1_46094_gr1)"></path><path d="M86,64.5c-5.93706,0 -10.75,4.81294 -10.75,10.75c0,5.93706 4.81294,10.75 10.75,10.75c5.93706,0 10.75,-4.81294 10.75,-10.75c0,-5.93706 -4.81294,-10.75 -10.75,-10.75z" fill="url(#color-2_46094_gr2)"></path></g></g></svg>
|
||||
</div>
|
||||
<p class="no-margin bold">Manual Transfer</p>
|
||||
<p id="manual-transfer" class="no-margin bold">Manual Transfer</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -406,7 +406,7 @@
|
||||
<button class="btn btn-xs all-caps b-rad-none btn-default bg-master-lighter btn-block" @click="expandPayment = false">Cancel</button>
|
||||
</div>
|
||||
<div class="col p-l-0">
|
||||
<button class="btn btn-xs all-caps b-rad-none btn-success btn-block" :class="[{'hide': paymentMethod.name === ''}]" @click="submitForm()">Create Booking</button>
|
||||
<button id="create-booking" class="btn btn-xs all-caps b-rad-none btn-success btn-block" :class="[{'hide': paymentMethod.name === ''}]" @click="submitForm()">Create Booking</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -506,9 +506,9 @@
|
||||
<button class="btn btn-sm all-caps b-rad-none btn-default bg-master-lighter btn-block" @click="cancelQuotation()">Cancel</button>
|
||||
</div>
|
||||
<div class="col p-l-0" >
|
||||
<button class="btn btn-sm all-caps b-rad-none btn-success btn-block requestModal" data-type="paymentSummary" v-if="paymentMethod.id !== 'wallet' || walletOutstanding >= 0">Lock Booking</button>
|
||||
<button id="lock-booking" class="btn btn-sm all-caps b-rad-none btn-success btn-block requestModal" data-type="paymentSummary" v-if="paymentMethod.id !== 'wallet' || walletOutstanding >= 0">Lock Booking</button>
|
||||
</div>
|
||||
<modal-component v-if="calculation.total > 0" class="animate__animated animate__fast animate__fadeIn" styleType="fill-in" type="paymentSummary">
|
||||
<modal-component id="confirm-booking-modal" v-if="calculation.total > 0" class="animate__animated animate__fast animate__fadeIn" styleType="fill-in" type="paymentSummary">
|
||||
<confirm-quotation-form-component v-on:cancelQuotation="cancelQuotation()" :calculation="calculation" :section="section" :id="item.id" :payment_method="paymentMethod.id" :bank_code="onlinePayment.id" :amount="amount"></confirm-quotation-form-component>
|
||||
</modal-component>
|
||||
</div>
|
||||
|
||||
@@ -71,7 +71,7 @@
|
||||
<button class="btn btn-sm all-caps b-rad-none btn-default bg-master-lighter" data-dismiss="modal">Cancel</button>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<button class="btn btn-sm all-caps b-rad-none btn-success" @click="submitForm()">Confirm Booking</button>
|
||||
<button id="confirm-booking" class="btn btn-sm all-caps b-rad-none btn-success" @click="submitForm()">Confirm Booking</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row text-right" v-if="payment_method !== 'wallet'">
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
<div class="col no-padding">
|
||||
<div class="form-group form-group-default m-b-0">
|
||||
<label>Recipient Gets</label>
|
||||
<input type="text" placeholder="0.00" value="0" class="form-control" v-model="recipientInput" @keyup="updateAmount($event, 1)" v-money="money">
|
||||
<input id="cc_get" name="cc_get" type="text" placeholder="0.00" value="0" class="form-control" v-model="recipientInput" @keyup="updateAmount($event, 1)" v-money="money">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-auto bg-primary text-white">
|
||||
@@ -111,7 +111,7 @@
|
||||
<div class="col no-padding">
|
||||
<div class="form-group form-group-default m-b-0">
|
||||
<label>You'r Sending</label>
|
||||
<input type="text" placeholder="0.00" value="0.00" v-model="senderInput" class="form-control" @keyup="updateAmount($event, 0)" v-money="money">
|
||||
<input id="cc_sending" name="cc_sending" type="text" placeholder="0.00" value="0.00" v-model="senderInput" class="form-control" @keyup="updateAmount($event, 0)" v-money="money">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-auto bg-primary text-white">
|
||||
|
||||
@@ -30,13 +30,13 @@
|
||||
<div class="col-sm-12 col-md-4 pr-md-1">
|
||||
<div class="form-group form-group-default b-rad-none">
|
||||
<label>Stock Code</label>
|
||||
<input type="text" class="form-control b-rad-none" v-model="product.stockCode" />
|
||||
<input id="stock_code" name="stock_code" type="text" class="form-control b-rad-none" v-model="product.stockCode" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-12 col-md pl-md-1">
|
||||
<div class="form-group form-group-default b-rad-none required">
|
||||
<label>description</label>
|
||||
<input class="form-control b-rad-none" rows="1" @keyup="onlyEnglish($event)" v-model="product.description">
|
||||
<input id="desc" name="desc" class="form-control b-rad-none" rows="1" @keyup="onlyEnglish($event)" v-model="product.description">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -44,13 +44,13 @@
|
||||
<div class="col-sm-12 col-md-6 pr-md-1">
|
||||
<div class="form-group form-group-default b-rad-none required">
|
||||
<label>Unit Price</label>
|
||||
<input type="text" class="form-control b-rad-none" placeholder="Unit Price" v-model.lazy="product.unit_price" v-money="productPrice" />
|
||||
<input id="unit_price" name="unit_price" type="text" class="form-control b-rad-none" placeholder="Unit Price" v-model.lazy="product.unit_price" v-money="productPrice" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-12 col-md-6 pl-md-1">
|
||||
<div class="form-group form-group-default b-rad-none no-padding no-border">
|
||||
<div class="row no-margin">
|
||||
<div class="col-auto bg-master-lightest pointer" @mousedown="updateQuantity" @mouseleave="clearInterval" @mouseup="clearInterval" @touchstart="updateQuantity" @touchend="clearInterval" @touchcancel="clearInterval">
|
||||
<div id="minus-quantity" name="minus-quantity" class="col-auto bg-master-lightest pointer" @mousedown="updateQuantity" @mouseleave="clearInterval" @mouseup="clearInterval" @touchstart="updateQuantity" @touchend="clearInterval" @touchcancel="clearInterval">
|
||||
<div class="row h-100 align-items-center">
|
||||
<div class="col">
|
||||
<i class="fa fa-minus"></i>
|
||||
@@ -59,9 +59,9 @@
|
||||
</div>
|
||||
<div class="col no-padding">
|
||||
<label class="p-t-5 p-l-5 text-center">Quantity</label>
|
||||
<input type="text" class="form-control m-b-5 b-rad-none no-border text-center" v-model.lazy="product.quantity" v-mask="'#########'"/>
|
||||
<input id="quantity" name="quantity" type="text" class="form-control m-b-5 b-rad-none no-border text-center" v-model.lazy="product.quantity" v-mask="'#########'"/>
|
||||
</div>
|
||||
<div class="col-auto bg-master-lightest pointer" @mousedown="updateQuantity('add')" @mouseleave="clearInterval" @mouseup="clearInterval" @touchstart="updateQuantity('add')" @touchend="clearInterval" @touchcancel="clearInterval">
|
||||
<div id="add-quantity" name="add-quantity" class="col-auto bg-master-lightest pointer" @mousedown="updateQuantity('add')" @mouseleave="clearInterval" @mouseup="clearInterval" @touchstart="updateQuantity('add')" @touchend="clearInterval" @touchcancel="clearInterval">
|
||||
<div class="row h-100 align-items-center">
|
||||
<div class="col">
|
||||
<i class="fa fa-plus"></i>
|
||||
@@ -78,7 +78,7 @@
|
||||
<h6 class="no-margin bold text-complete">{{data.fixed_currency.short_code}} {{productTotal.toFixed(3)}}</h6>
|
||||
</div>
|
||||
<div class="col-sm-12 col-md">
|
||||
<button class="btn btn-sm btn-block btn-complete b-rad-none" @click="addProduct()">Add Product</button>
|
||||
<button id="add-product" name="add-product" class="btn btn-sm btn-block btn-complete b-rad-none" @click="addProduct()">Add Product</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -119,7 +119,7 @@
|
||||
<div class="col">
|
||||
<div class="row m-b-10">
|
||||
<div class="col">
|
||||
<button class="btn btn-xs all-caps b-rad-none btn-primary btn-block" @click="submitForm()">{{(Math.round((poTotal + Number.EPSILON) * 1000) / 1000).toFixed(3) !== (Math.round((data.amount + Number.EPSILON) * 1000) / 1000).toFixed(3) ? 'Save Purchase Order' : 'Save & Confirm'}}</button>
|
||||
<button id="save-purchase-order" name="save-purchase-order" class="btn btn-xs all-caps b-rad-none btn-primary btn-block" @click="submitForm()">{{(Math.round((poTotal + Number.EPSILON) * 1000) / 1000).toFixed(3) !== (Math.round((data.amount + Number.EPSILON) * 1000) / 1000).toFixed(3) ? 'Save Purchase Order' : 'Save & Confirm'}}</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" v-if="(Math.round((poTotal + Number.EPSILON) * 1000) / 1000).toFixed(3) !== data.amount">
|
||||
@@ -269,4 +269,4 @@
|
||||
},
|
||||
mixins: [formHandler]
|
||||
}
|
||||
</script>
|
||||
</script>
|
||||
|
||||
@@ -58,13 +58,13 @@
|
||||
<div class="col-4 p-r-5">
|
||||
<div class="form-group form-group-default b-rad-none">
|
||||
<label>Stock Code</label>
|
||||
<input type="text" class="form-control b-rad-none" v-model="product.stockCode" />
|
||||
<input id="stock_code" name="stock_code" type="text" class="form-control b-rad-none" v-model="product.stockCode" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="col p-l-5">
|
||||
<div class="form-group form-group-default b-rad-none required">
|
||||
<label>description</label>
|
||||
<input class="form-control b-rad-none" rows="1" @keyup="onlyEnglish($event)" v-model="product.description">
|
||||
<input id="desc" name="desc" class="form-control b-rad-none" rows="1" @keyup="onlyEnglish($event)" v-model="product.description">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -72,13 +72,13 @@
|
||||
<div class="col-6 p-r-5">
|
||||
<div class="form-group form-group-default b-rad-none required">
|
||||
<label>Unit Price</label>
|
||||
<input type="text" class="form-control b-rad-none" placeholder="Unit Price" v-model.lazy="product.unit_price" v-money="productPrice" />
|
||||
<input id="unit_price" name="unit_price" type="text" class="form-control b-rad-none" placeholder="Unit Price" v-model.lazy="product.unit_price" v-money="productPrice" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-6 p-l-5">
|
||||
<div class="form-group form-group-default b-rad-none no-padding no-border">
|
||||
<div class="row no-margin">
|
||||
<div class="col-auto bg-master-lighter pointer" @mousedown="updateQuantity" @mouseleave="clearInterval" @mouseup="clearInterval" @touchstart="updateQuantity" @touchend="clearInterval" @touchcancel="clearInterval">
|
||||
<div id="minus-quantity" name="minus-quantity" class="col-auto bg-master-lighter pointer" @mousedown="updateQuantity" @mouseleave="clearInterval" @mouseup="clearInterval" @touchstart="updateQuantity" @touchend="clearInterval" @touchcancel="clearInterval">
|
||||
<div class="row h-100 align-items-center">
|
||||
<div class="col">
|
||||
<i class="fa fa-minus"></i>
|
||||
@@ -87,9 +87,9 @@
|
||||
</div>
|
||||
<div class="col no-padding">
|
||||
<label class="p-t-5 p-l-5 text-center">Quantity</label>
|
||||
<input type="text" class="form-control m-b-5 b-rad-none no-border text-center" v-model.lazy="product.quantity" v-mask="'#########'"/>
|
||||
<input id="quantity" name="quantity" type="text" class="form-control m-b-5 b-rad-none no-border text-center" v-model.lazy="product.quantity" v-mask="'#########'"/>
|
||||
</div>
|
||||
<div class="col-auto bg-master-lighter pointer" @mousedown="updateQuantity('add')" @mouseleave="clearInterval" @mouseup="clearInterval" @touchstart="updateQuantity('add')" @touchend="clearInterval" @touchcancel="clearInterval">
|
||||
<div id="add-quantity" name="add-quantity" class="col-auto bg-master-lighter pointer" @mousedown="updateQuantity('add')" @mouseleave="clearInterval" @mouseup="clearInterval" @touchstart="updateQuantity('add')" @touchend="clearInterval" @touchcancel="clearInterval">
|
||||
<div class="row h-100 align-items-center">
|
||||
<div class="col">
|
||||
<i class="fa fa-plus"></i>
|
||||
@@ -185,4 +185,4 @@
|
||||
},
|
||||
mixins: [formHandler]
|
||||
}
|
||||
</script>
|
||||
</script>
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<template>
|
||||
<div class="row">
|
||||
<div class="col-auto">
|
||||
<button class="btn btn-lg btn-default bg-master-lightest b-rad-none all-caps fs-12" data-dismiss="modal">Cancel</button>
|
||||
<button id="cancel-new-booking" name="cancel-new-booking" class="btn btn-lg btn-default bg-master-lightest b-rad-none all-caps fs-12" data-dismiss="modal">Cancel</button>
|
||||
</div>
|
||||
<div class="col text-right">
|
||||
<button class="btn btn-lg btn-success b-rad-none all-caps fs-12" v-if="Object.keys(data.bankAccount).length" @click="submitForm()">Confirm & Proceed</button>
|
||||
<button id="confirm-new-booking" name="confirm-new-booking" class="btn btn-lg btn-success b-rad-none all-caps fs-12" v-if="Object.keys(data.bankAccount).length" @click="submitForm()">Confirm & Proceed</button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -37,4 +37,4 @@
|
||||
},
|
||||
mixins: [ModalFormHandler]
|
||||
}
|
||||
</script>
|
||||
</script>
|
||||
|
||||
@@ -0,0 +1,76 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Browser\DryRun;
|
||||
|
||||
use Illuminate\Foundation\Testing\DatabaseMigrations;
|
||||
use Laravel\Dusk\Browser;
|
||||
use Tests\DuskTestCase;
|
||||
use App\Classes\Modules\Transactions\Services\FetchesTransaction;
|
||||
|
||||
|
||||
class CreateBookingTest extends DuskTestCase
|
||||
{
|
||||
public function testLogin()
|
||||
{
|
||||
$this->browse(function (Browser $browser) {
|
||||
$browser->visit('http://exchange-2.0.test')
|
||||
->pause(5000)
|
||||
->type('email', 'giftolavie@hotmail.com')
|
||||
->type('password', 'pass123')
|
||||
->click('#sign-in')
|
||||
->pause(5000)
|
||||
->assertPathIs('/dashboard');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
* @depends testLogin
|
||||
*/
|
||||
public function testCreateBooking()
|
||||
{
|
||||
$this->browse(function (Browser $browser) {
|
||||
$browser->waitForLocation('/dashboard')
|
||||
->waitForText('X1 Service')
|
||||
->typeSlowly('cc_sending', '10000')
|
||||
->pause(5000)
|
||||
->waitForText('Transfer Now',5000)
|
||||
->click('#transfer-now')
|
||||
->whenAvailable('#select-account-modal', function ($modal) {
|
||||
$modal->pause(1000)
|
||||
->press('#select-list')
|
||||
->press('#select-option')
|
||||
->pause(5000)
|
||||
->click('#confirm-new-booking');
|
||||
#->click('#cancel-new-booking');
|
||||
})
|
||||
->pause(7000)
|
||||
->typeSlowly('stock_code', '123')
|
||||
->typeSlowly('desc', 'Product A')
|
||||
->typeSlowly('unit_price', '100')
|
||||
->pause(7000)
|
||||
->click('#add-quantity')
|
||||
->click('#add-quantity')
|
||||
->pause(7000)
|
||||
->click('#minus-quantity')
|
||||
->click('#minus-quantity')
|
||||
->pause(7000)
|
||||
->typeSlowly('quantity', '5')
|
||||
->pause(7000)
|
||||
->click('#add-product')
|
||||
->pause(7000)
|
||||
->click('#save-purchase-order')
|
||||
->click('#payment-btn')
|
||||
->click('#online-banking')
|
||||
->click('#create-booking')
|
||||
->pause(3000)
|
||||
->click('#lock-booking')
|
||||
->whenAvailable('#confirm-booking-modal', function ($modal) {
|
||||
$modal->click('#confirm-booking');
|
||||
})
|
||||
->pause(10000);
|
||||
//Assert if booking created successfully
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Browser\DryRun;
|
||||
|
||||
use Illuminate\Foundation\Testing\DatabaseMigrations;
|
||||
use Laravel\Dusk\Browser;
|
||||
use Tests\DuskTestCase;
|
||||
|
||||
class LoginTest extends DuskTestCase
|
||||
{
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
public function testLogin()
|
||||
{
|
||||
$this->browse(function (Browser $browser) {
|
||||
$browser->visit('http://exchange-2.0.test')
|
||||
->pause(500)
|
||||
->type('email', 'junkit.mah@bioloop.com.my')
|
||||
->type('password', '123456abcabc')
|
||||
->click('#sign-in')
|
||||
->pause(5000)
|
||||
->assertPathIs('/dashboard');
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Browser\DryRun;
|
||||
|
||||
use Laravel\Dusk\Browser;
|
||||
use Tests\DuskTestCase;
|
||||
|
||||
class UserRegisterTest extends DuskTestCase
|
||||
{
|
||||
public function testRegister()
|
||||
{
|
||||
$this->browse(function (Browser $browser) {
|
||||
$browser->visit('http://exchange-2.0.test/signup')
|
||||
->pause(5000)
|
||||
->click('#company-select')
|
||||
->type('company_name', 'lazada')
|
||||
->type('name', 'Someone')
|
||||
->type('phone', '0128888888')
|
||||
->click('#next')
|
||||
->type('email', 'someone@gmail.com')
|
||||
->type('password', 'pass123')
|
||||
->type('password_confirmation', 'pass123')
|
||||
->click('#complete')
|
||||
->pause(5000)
|
||||
->assertPathIs('/dashboard');
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Browser\Pages;
|
||||
|
||||
use Laravel\Dusk\Browser;
|
||||
|
||||
class HomePage extends Page
|
||||
{
|
||||
/**
|
||||
* Get the URL for the page.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function url()
|
||||
{
|
||||
return '/';
|
||||
}
|
||||
|
||||
/**
|
||||
* Assert that the browser is on the page.
|
||||
*
|
||||
* @param \Laravel\Dusk\Browser $browser
|
||||
* @return void
|
||||
*/
|
||||
public function assert(Browser $browser)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the element shortcuts for the page.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function elements()
|
||||
{
|
||||
return [
|
||||
'@element' => '#selector',
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Browser\Pages;
|
||||
|
||||
use Laravel\Dusk\Page as BasePage;
|
||||
|
||||
abstract class Page extends BasePage
|
||||
{
|
||||
/**
|
||||
* Get the global element shortcuts for the site.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function siteElements()
|
||||
{
|
||||
return [
|
||||
'@element' => '#selector',
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
*
|
||||
!.gitignore
|
||||
@@ -0,0 +1,2 @@
|
||||
*
|
||||
!.gitignore
|
||||
@@ -0,0 +1,2 @@
|
||||
*
|
||||
!.gitignore
|
||||
@@ -0,0 +1,59 @@
|
||||
<?php
|
||||
|
||||
namespace Tests;
|
||||
|
||||
use Facebook\WebDriver\Chrome\ChromeOptions;
|
||||
use Facebook\WebDriver\Remote\DesiredCapabilities;
|
||||
use Facebook\WebDriver\Remote\RemoteWebDriver;
|
||||
use Laravel\Dusk\TestCase as BaseTestCase;
|
||||
|
||||
abstract class DuskTestCase extends BaseTestCase
|
||||
{
|
||||
use CreatesApplication;
|
||||
|
||||
/**
|
||||
* Prepare for Dusk test execution.
|
||||
*
|
||||
* @beforeClass
|
||||
* @return void
|
||||
*/
|
||||
public static function prepare()
|
||||
{
|
||||
if (! static::runningInSail()) {
|
||||
static::startChromeDriver();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create the RemoteWebDriver instance.
|
||||
*
|
||||
* @return \Facebook\WebDriver\Remote\RemoteWebDriver
|
||||
*/
|
||||
protected function driver()
|
||||
{
|
||||
$options = (new ChromeOptions)->addArguments([
|
||||
'--no-sandbox'
|
||||
]);
|
||||
|
||||
|
||||
return RemoteWebDriver::create(
|
||||
//'http://localhost:86',
|
||||
'http://localhost:9515',
|
||||
DesiredCapabilities::chrome()->setCapability(
|
||||
ChromeOptions::CAPABILITY, $options
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine whether the Dusk command has disabled headless mode.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected function hasHeadlessDisabled()
|
||||
{
|
||||
return true;
|
||||
//isset($_SERVER['DUSK_HEADLESS_DISABLED']) ||
|
||||
//isset($_ENV['DUSK_HEADLESS_DISABLED']);
|
||||
}
|
||||
}
|
||||
@@ -1,119 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Unit;
|
||||
|
||||
use PHPUnit\Exception;
|
||||
use PHPUnit\Framework\AssertionFailedError;
|
||||
use PHPUnit\Framework\ExpectationFailedException;
|
||||
use PHPUnit\Framework\PHPTAssertionFailedError;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use RecursiveIteratorIterator;
|
||||
use RecursiveDirectoryIterator;
|
||||
use FilesystemIterator;
|
||||
|
||||
class QualityControlTest extends TestCase
|
||||
{
|
||||
private $non_standard_folders = [];
|
||||
|
||||
private $file_check=[];
|
||||
|
||||
private $results = [];
|
||||
|
||||
public const CODE_LINE_COUNT = 400;
|
||||
|
||||
public const METHOD_COUNT = 20;
|
||||
|
||||
public function __construct(?string $name = null, array $data = [], string $dataName = '')
|
||||
{
|
||||
//Unit test defaults
|
||||
parent::__construct($name, $data, $dataName);
|
||||
|
||||
$fullPath = dirname(__FILE__, 3).'/app/Classes/Modules';
|
||||
$dirs = $files = [];
|
||||
|
||||
$modules_dir_count = [];
|
||||
|
||||
$current_directory = "";
|
||||
$allowed_folders = ['ControllersLogic','DataTransferObjects','Processors','Services','Standards'];
|
||||
$allowed_standards_folders = ['Criteria','Criterias','Rules','Validators'];
|
||||
$ignore_folders = ['Rates'];
|
||||
|
||||
$directory = new RecursiveDirectoryIterator($fullPath, FilesystemIterator::SKIP_DOTS);
|
||||
|
||||
$modules = array_map('basename',glob($fullPath.'/*', GLOB_ONLYDIR));
|
||||
|
||||
foreach (new RecursiveIteratorIterator($directory, RecursiveIteratorIterator::SELF_FIRST) as $path ) {
|
||||
|
||||
//Note: $path is SplFileInfo class. For all the options/methods , please check here: https://www.php.net/manual/en/class.splfileinfo.php
|
||||
|
||||
if($path->isDir()){
|
||||
//Check Modules directory for allowed folders
|
||||
//TODO: Check folder in correct orders, e.g. if Validators inside Standards folder
|
||||
|
||||
$dirs[] = $path->__toString();
|
||||
|
||||
if(in_array($path->getFileName(),$modules)){
|
||||
$current_directory = $path->getFileName();
|
||||
$modules_dir_count[$path->getFileName()]=['count'=>0,'standards_count'=>0];
|
||||
}else if(in_array($path->getFileName(),$allowed_folders)){
|
||||
$modules_dir_count[$current_directory]['count'] += 1;
|
||||
}else if(in_array($path->getFileName(),$allowed_standards_folders)){
|
||||
$modules_dir_count[$current_directory]['standards_count'] += 1;
|
||||
} else if(!in_array($path->getFileName(),$ignore_folders)){
|
||||
$this->non_standard_folders[]= $path->__toString();
|
||||
}
|
||||
}else{
|
||||
$files[] = realpath($path->__toString());
|
||||
|
||||
//TODO: Read files (.php) & check for class name format & if possible variable name format
|
||||
|
||||
$file = $path->openFile('r');
|
||||
if(!isset($this->file_check[$path->getFileName()]['files'])){
|
||||
$this->file_check[$path->getFileName()]=['lines'=>0,'methods_count'=>0];
|
||||
}
|
||||
$file->seek(PHP_INT_MAX);
|
||||
$linesTotal = $file->key();
|
||||
$this->file_check[$path->getFileName()]['lines'] = $linesTotal;
|
||||
|
||||
|
||||
//Note: Use reflection to get class info : https://www.php.net/manual/en/class.reflectionclass.php
|
||||
$namespace = str_replace($fullPath."/","",$file->getPath());
|
||||
$namespace = str_replace("/","\\",$namespace);
|
||||
$class_name = "App\Classes\Modules\\".$namespace."\\".$file->getBasename('.php');
|
||||
|
||||
$class = new \ReflectionClass($class_name);
|
||||
$class_methods = $class->getMethods();
|
||||
|
||||
$this->file_check[$path->getFileName()]['methods_count'] = count($class_methods);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//var_dump($files, $dirs);
|
||||
//var_dump($this->file_check);
|
||||
//var_dump($modules_dir_count,$non_standard_folders);
|
||||
//die('debug');
|
||||
}
|
||||
|
||||
public function checkCodeStandards()
|
||||
{
|
||||
foreach ($this->file_check as $filename => $file) {
|
||||
$this->results['code line'] = $this->assertLessThanOrEqual($this::CODE_LINE_COUNT, $file['lines'],'Please check '.$filename.', the code line is '.$file['lines']);
|
||||
$this->results['code method'] = $this->assertLessThanOrEqual($this::METHOD_COUNT,$file['methods_count']);
|
||||
}
|
||||
}
|
||||
|
||||
public function checkFolderStandards()
|
||||
{
|
||||
$this->results['folder check'] = $this->assertCount(0,$this->non_standard_folders ,"Found non standard folders");
|
||||
}
|
||||
|
||||
public function testQualityCheck(){
|
||||
$this->checkCodeStandards();
|
||||
$this->checkFolderStandards();
|
||||
|
||||
print_r($this->results);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user