-
Describe your preferred coding environment, i.e. OS, IDE, text editor etc.
-
My prefeerred coding environment:
-
macOS
-
Visual Studio Code
-
DBeaver
-
Sourcetree
-
-
-
Describe the workflow for releasing the codes you developed to prduction system.
-
The workflow in my work: I worked in a small team so we just used a simple git flow, I usually have 3 branches: develop, staging and prod.
-
Step1 I will build a program or fix an issue in develop branch on my localhost.
-
Step2 After I push that, I will merge my commit to the staging branch and then deploy it to the staging environment for user acceptance testing.
-
Step3 When the code has no issue, I will merge that to the prod branch in the staging environment, Finally deploy it to the production environment.
-
-
The workflow in my side project: I use the GitHub flow, and utilize AWS Amplify to handle CI/CD.
-
-
Design a table schema to store the above pricing rules in a MySQL table named
pricing_rules
, please provide the answer inCREATE TABLE
statement format.CREATE TABLE `pricing_rules` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `fixed_fee` smallint unsigned NOT NULL, `base_weight_range` smallint unsigned NOT NULL, `extra_weight_fee` smallint unsigned NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-
Impleent the function
calculate_shipment_fee
- Please see the path:
app\Http\Controller\ShippingController.php
- Please see the path:
-
Can you write a unit test for the above function?
- Please see the path:
app\tests\ShipmentTest.php
- Please see the path:
This project is based on laravel lumen framework.
-
Clone the repository
-
Setup .env file
-
Run in terminal this command for create table:
php artisan migrate
-
Run in terminal this command for fill sample data:
php artisan db:seed
-
Run in terminal this command for test the function:
vendor/bin/phpunit