add sms sending feat

This commit is contained in:
Nyan Lin Paing
2026-08-23 20:44:52 +07:00
parent 41c9454334
commit da9cd9bbe0
17 changed files with 492 additions and 9 deletions
@@ -28,6 +28,37 @@ test('a booking status transition is recorded in the audit log', function () {
expect($activity->attribute_changes->get('attributes'))->toMatchArray(['status' => BookingStatus::Confirmed->value]);
});
test('assigning a driver is recorded in the audit log with who and when', function () {
$dispatcher = User::factory()->create();
$booking = Booking::factory()->create(['status' => BookingStatus::Confirmed]);
$this->actingAs($dispatcher);
$booking->update([
'driver_name' => 'U Aung',
'driver_phone' => '+959111222333',
'car_plate_number' => 'YGN-1234',
'car_model' => 'Tesla Model Y',
]);
$activity = Activity::where('subject_type', Booking::class)
->where('subject_id', $booking->id)
->where('log_name', 'booking')
->latest('id')
->first();
expect($activity)->not->toBeNull();
expect($activity->attribute_changes->get('attributes'))->toMatchArray([
'driver_name' => 'U Aung',
'driver_phone' => '+959111222333',
'car_plate_number' => 'YGN-1234',
'car_model' => 'Tesla Model Y',
]);
expect($activity->causer_type)->toBe(User::class);
expect($activity->causer_id)->toBe($dispatcher->id);
expect($activity->created_at)->not->toBeNull();
});
test('a catalog CRUD write is recorded in the audit log', function () {
$company = EvCompany::factory()->create(['name' => 'Original Name']);