Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
624644f
more admin nation todo items to stage 2
tszyuloveyou Feb 4, 2026
0f9c5bb
downgrade sass to fix bootstrap warning
tszyuloveyou Feb 4, 2026
05602a2
update compoer
tszyuloveyou Feb 5, 2026
a505887
remove unused parameter from inertia middleware
tszyuloveyou Feb 5, 2026
f1da743
remove unused library tailwind
tszyuloveyou Feb 5, 2026
cd6cf35
remove unused code and add dark mode
tszyuloveyou Feb 5, 2026
36b2e33
fix responsive size
tszyuloveyou Feb 5, 2026
5222ce7
change address_id column from members table to users table
tszyuloveyou Feb 6, 2026
e751483
update user register found end page for add address field
tszyuloveyou Feb 6, 2026
9bad4e5
update user register back en form validation and store logic
tszyuloveyou Feb 6, 2026
66f1523
update user register tests
tszyuloveyou Feb 6, 2026
428293a
fix "update user register found end page for add address field" missi…
tszyuloveyou Feb 6, 2026
b5f097e
update phpunit test memory limit
tszyuloveyou Feb 6, 2026
74198b9
add more todo item
tszyuloveyou Feb 6, 2026
afe44a1
fix nav Collapse responsive
tszyuloveyou Feb 6, 2026
2022c21
fix missing super administrator role
tszyuloveyou Feb 6, 2026
93b9f8d
move updateAddress function from AdmissionTest Controller to Address …
tszyuloveyou Feb 7, 2026
a749cd6
update user profile for add address
tszyuloveyou Feb 7, 2026
2b96023
update user update profile back end form validation and update logic …
tszyuloveyou Feb 7, 2026
7014e17
update user update profile tests for add address
tszyuloveyou Feb 7, 2026
405f549
fix register tests missing add address too long test care
tszyuloveyou Feb 7, 2026
56a1163
add auto add required mark css and fix some labels missing "for" attr…
tszyuloveyou Feb 7, 2026
d36061e
fix some table missing unique attribute
tszyuloveyou Feb 7, 2026
401229f
fix user tests same function name wrong
tszyuloveyou Feb 7, 2026
4f364ba
fix user profile when district_is null districtValue is not ''
tszyuloveyou Feb 7, 2026
709b8af
update admin user show for add address
tszyuloveyou Feb 7, 2026
2ae2657
update admin user update back end form validation and update logic fo…
tszyuloveyou Feb 7, 2026
8753fcf
update admin update user update tests for add address
tszyuloveyou Feb 7, 2026
81e9c51
add active member and has in progress membership order must type addr…
tszyuloveyou Feb 8, 2026
58346c6
move the validation logic form user controller login and update metho…
tszyuloveyou Feb 9, 2026
6879b3b
fix removed field "login_ip" missing update UserLoginLog model
tszyuloveyou Feb 9, 2026
b2bdf55
fix missing update usar admin index label missing "for"
tszyuloveyou Feb 9, 2026
c96794c
add member data edit and update function to inside user edit and upda…
tszyuloveyou Feb 10, 2026
75145f3
fix missing hidden show member data div when editing
tszyuloveyou Feb 10, 2026
e3b6b8c
fix passport format fail message missing format info
tszyuloveyou Feb 10, 2026
d6076b0
rename prior_evidence_resulis table is_pass column name to is_accepted
tszyuloveyou Feb 11, 2026
8bd407e
change qualifying_test_details.score to nullable
tszyuloveyou Feb 11, 2026
ca9ece7
add is_refunded column to prior_evidence_orders table and update model
tszyuloveyou Feb 11, 2026
9900ea0
add refunded_quota column to admission_test_orders table, update mode…
tszyuloveyou Feb 11, 2026
8b540d5
fix prior_evidence_orders.is_returned wrony type to is_refunded
tszyuloveyou Feb 11, 2026
105dff3
add canEditPassportInformation method to user model and add tests
tszyuloveyou Feb 11, 2026
d4e371c
change user can update passport information on profile if user match …
tszyuloveyou Feb 11, 2026
650a67c
update todo lists
tszyuloveyou Feb 11, 2026
146c358
fix coding style
tszyuloveyou Feb 11, 2026
c3f67fa
fix insert prior_evidence_orders.status wrong type full refunded to f…
tszyuloveyou Feb 11, 2026
4a1f1a1
fix CanEditPassportInformationTest create prior_evidence_orders recor…
tszyuloveyou Feb 11, 2026
23c9072
fix relationship create missing type_id data change to user factory c…
tszyuloveyou Feb 11, 2026
5452851
fix copy test cases misssing update roure data
tszyuloveyou Feb 11, 2026
c77b6b1
add membershipOrder relationship method to user model
tszyuloveyou Feb 11, 2026
3eed02a
fix membership order in progress, user address should be required but…
tszyuloveyou Feb 11, 2026
f2d2a81
add more todo items
tszyuloveyou Feb 11, 2026
6848c20
fix missing gateway_type and gateway_id
tszyuloveyou Feb 11, 2026
df03651
fix coding style
tszyuloveyou Feb 11, 2026
2fffeac
fix wrong type "taken_on" to "test_on"
tszyuloveyou Feb 11, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 16 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,10 @@ Please read laravel official documents:

#### stage 1 permission system, nav, custom web page and admission test

- change address_id from members table to users table
- add can_join_admission_test column to passport_types table
- change module to support submodule
- add edit candidate and edit candidate result permission and update admin admission test candidate permission checking
- change SEO from page to layout export props title, desc. and ogImage and change ogImage from public to storage
- add admin nation index
- add admin nation store
- add admin nation update
- add admin nation update status
- update candidate store method to support select product and contact stripe
- add stripe checkout web hock handle
- change quota validity months to inside product and order table
Expand All @@ -93,10 +89,17 @@ Please read laravel official documents:
- admin user add admission test orders list and create order button
- Add assign roles function to admin user show
- Admin team show page add team member list and relation role
- change whatsapp from twilio to whatsapp cloud api (coming soon)
- add whatsapp_templates table, add seeder and add admin whatsapp templates index
- add admin whatsapp templates index edit and update
- change qr code to from quickchart.io gen image link to use twilio assets
- add user delete function

#### stage 2 third party iq test result

- add admin nation index
- add admin nation store
- add admin nation update
- add admin nation update status
- Add admin third party iq test accept list store
- Add admin third party iq test accept list index
- Add admin third party iq test accept list update name
Expand All @@ -123,7 +126,7 @@ Please read laravel official documents:
- Add membership products edit
- Add membership products price store
- Add membership products price update
- Add membership orders create
- Add membership orders create (require user address)
- Add membership orders index
- Add membership orders show
- Add membership orders update payment status
Expand All @@ -135,6 +138,8 @@ Please read laravel official documents:
- add user public option on user show
- Add member index
- Add member show
- Add upload image to profile when user is member
- Add remove image to profile when user is member
- Add edit forwarding email function
- Add admin forwarding email changing index and approve or reject function

Expand Down Expand Up @@ -200,6 +205,10 @@ Please read laravel official documents:

#### stage 8 contest (coming soon)

#### stage 9 CalDAV (coming soon)

#### stage 10 project management (coming soon)

#### unimportant

- takeout Strip Library from app folder to make a standalone composer package on standalone repo.
35 changes: 1 addition & 34 deletions app/Http/Controllers/Admin/AdmissionTest/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -225,39 +225,6 @@ public function show(AdmissionTest $admissionTest)
);
}

private function updateAddress(Address $address, string $newAddress, int $newDistrictID): Address
{
$addressModel = $address;
if (
$newAddress != $address->value ||
$newDistrictID != $address->district_id
) {
$addressModel = Address::firstWhere([
'district_id' => $newDistrictID,
'value' => $newAddress,
]);
if ($address->admissionTests()->count() == 1) {
if ($addressModel) {
$address->delete();
} else {
$address->update([
'district_id' => $newDistrictID,
'value' => $newAddress,
]);
$addressModel = $address;
}
}
if (! $addressModel) {
$addressModel = Address::create([
'district_id' => $newDistrictID,
'value' => $newAddress,
]);
}
}

return $addressModel;
}

private function updateLocation(Location $location, string $newLocationName): Location
{
$newLocation = $location;
Expand Down Expand Up @@ -295,7 +262,7 @@ public function update(TestRequest $request, AdmissionTest $admissionTest)
'location' => $admissionTest->location->name,
'address' => "{$admissionTest->address->value}, {$admissionTest->address->district->name}, {$admissionTest->address->district->area->name}",
];
$address = $this->updateAddress($admissionTest->address, $request->address, $request->district_id);
$address = $admissionTest->address->updateAddress($request->district_id, $request->address);
$location = $this->updateLocation($admissionTest->location, $request->location);
$admissionTest->update([
'type_id' => $request->type_id,
Expand Down
57 changes: 54 additions & 3 deletions app/Http/Controllers/Admin/UserController.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
use App\Http\Controllers\Controller;
use App\Http\Requests\Admin\User\ResetPasswordRequest;
use App\Http\Requests\Admin\User\UpdateRequest;
use App\Models\Address;
use App\Models\Area;
use App\Models\Gender;
use App\Models\PassportType;
use App\Models\ResetPasswordLog;
Expand Down Expand Up @@ -124,16 +126,19 @@ public function index(Request $request)
public function show(User $user)
{
$user->load([
'emails.lastVerification' => function ($query) {
'member', 'emails.lastVerification' => function ($query) {
$query->select(['contact_id', 'verified_at', 'expired_at']);
}, 'mobiles.lastVerification' => function ($query) {
$query->select(['contact_id', 'verified_at', 'expired_at']);
},
}, 'address',
]);
$user->member?->makeHidden(['user_id', 'created_at', 'updated_at']);
$user->member?->append('is_active');
$user->emails->append('is_verified');
$user->emails->makeHidden(['user_id', 'type', 'created_at', 'lastVerification']);
$user->mobiles->append('is_verified');
$user->mobiles->makeHidden(['user_id', 'type', 'created_at', 'lastVerification']);
$user->address?->makeHidden(['id', 'created_at', 'updated_at']);

return Inertia::render('Admin/Users/Show')
->with('user', $user)
Expand All @@ -149,6 +154,24 @@ public function show(User $user)
'maxBirthday', now()
->subYears(2)
->format('Y-m-d')
)->with(
'districts', function () {
$areas = Area::with([
'districts' => function ($query) {
$query->orderBy('display_order');
},
])->orderBy('display_order')
->get();
$districts = [];
foreach ($areas as $area) {
$districts[$area->name] = [];
foreach ($area->districts as $district) {
$districts[$area->name][$district->id] = $district->name;
}
}

return $districts;
}
);
}

Expand All @@ -166,10 +189,38 @@ public function update(UpdateRequest $request, User $user)
'gender_id' => $gender->id,
'birthday' => $request->birthday,
];
if ($user->address) {
if ($request->district_id) {
$return['address_id'] = $user->address->updateAddress(
$request->district_id,
$request->address
)->id;
} else {
$user->address->delete();
$return['address_id'] = null;
}
} elseif ($request->district_id) {
$return['address_id'] = Address::firstOrCreate([
'district_id' => $request->district_id,
'value' => $request->address,
])->id;
}
$user->update($return);
unset($return['gender_id']);
unset($return['address_id']);
$return['district_id'] = $request->district_id;
$return['address'] = $request->address;
$return['gender'] = $gender->name;
$return['success'] = 'The user data update success!';
if ($user->member) {
$user->member->update([
'prefix_name' => $request->prefix_name,
'nickname' => $request->nickname,
'suffix_name' => $request->suffix_name,
]);
$return['prefix_name'] = $user->member->prefix_name;
$return['nickname'] = $user->member->nickname;
$return['suffix_name'] = $user->member->suffix_name;
}
DB::commit();

return $return;
Expand Down
Loading