Skip to content

Commit

Permalink
Merge branch 'release/v2.4.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
appsol committed Jan 22, 2024
2 parents 7509f0e + 607e7ca commit 7631447
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 20 deletions.
5 changes: 3 additions & 2 deletions aws/resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,13 +124,14 @@ def create_database_resource(template, database_allocated_storage_parameter,
AllocatedStorage=Ref(database_allocated_storage_parameter),
DBInstanceClass=Ref(database_class_parameter),
Engine='MySQL',
EngineVersion='5.7',
EngineVersion='8.0',
MasterUsername=Ref(database_username_parameter),
MasterUserPassword=Ref(database_password_parameter),
VPCSecurityGroups=[
GetAtt(database_security_group_resource, 'GroupId')],
DBSubnetGroupName=Ref(database_subnet_group_resource),
PubliclyAccessible=False
PubliclyAccessible=False,
AllowMajorVersionUpgrade=True
)
)

Expand Down
6 changes: 3 additions & 3 deletions config/local.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,17 @@
/*
* The URI for the Terms and Conditions page.
*/
'tandc_uri' => env('TANDC_URI', Str::finish(config('local.frontend_uri'), '/') . 'terms-and-conditions'),
'tandc_uri' => env('TANDC_URI', Str::finish(env('FRONTEND_URI', ''), '/') . 'terms-and-conditions'),

/*
* The URI for the Privacy page.
*/
'privacy_uri' => env('PRIVACY_URI', Str::finish(config('local.frontend_uri'), '/') . 'privacy-policy'),
'privacy_uri' => env('PRIVACY_URI', Str::finish(env('FRONTEND_URI', ''), '/') . 'privacy-policy'),

/*
* The URI for the Accessibility page.
*/
'accessibility_uri' => env('ACCESSIBILITY_URI', Str::finish(config('local.frontend_uri'), '/') . 'accessibility_statement'),
'accessibility_uri' => env('ACCESSIBILITY_URI', Str::finish(env('FRONTEND_URI', ''), '/') . 'accessibility_statement'),

/*
* The number of working days a service must respond within.
Expand Down
26 changes: 13 additions & 13 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: "3"
version: '3'

services:
app:
Expand Down Expand Up @@ -43,22 +43,22 @@ services:
- .:/var/www/html

mysql:
image: mysql:5.7
image: mysql:8.0
environment:
MYSQL_ROOT_PASSWORD: "${DB_ROOT_PASS}"
MYSQL_DATABASE: "${DB_DATABASE}"
MYSQL_USER: "${DB_USERNAME}"
MYSQL_PASSWORD: "${DB_PASSWORD}"
MYSQL_ROOT_PASSWORD: '${DB_ROOT_PASS}'
MYSQL_DATABASE: '${DB_DATABASE}'
MYSQL_USER: '${DB_USERNAME}'
MYSQL_PASSWORD: '${DB_PASSWORD}'
volumes:
- mysql-data:/var/lib/mysql

mysql-testing:
image: mysql:5.7
image: mysql:8.0
environment:
MYSQL_ROOT_PASSWORD: "${DB_ROOT_PASS}"
MYSQL_DATABASE: "${DB_DATABASE}"
MYSQL_USER: "${DB_USERNAME}"
MYSQL_PASSWORD: "${DB_PASSWORD}"
MYSQL_ROOT_PASSWORD: '${DB_ROOT_PASS}'
MYSQL_DATABASE: '${DB_DATABASE}'
MYSQL_USER: '${DB_USERNAME}'
MYSQL_PASSWORD: '${DB_PASSWORD}'
command: mysqld --general-log=1 --general-log-file=/var/log/mysql/general-log.log

redis:
Expand All @@ -72,8 +72,8 @@ services:
elasticsearch:
image: elasticsearch:7.9.3
environment:
- "discovery.type=single-node"
- "xpack.ml.enabled=false"
- 'discovery.type=single-node'
- 'xpack.ml.enabled=false'
volumes:
- elasticsearch-data:/usr/share/elasticsearch/data

Expand Down
47 changes: 45 additions & 2 deletions tests/Feature/UpdateRequestsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@
use App\Models\UsefulInfo;
use App\Events\EndpointHit;
use App\Models\SocialMedia;
use Carbon\CarbonImmutable;
use App\Models\Organisation;
use App\Models\UpdateRequest;
use Illuminate\Http\Response;
use Laravel\Passport\Passport;
use App\Models\ServiceLocation;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Date;
use Illuminate\Support\Facades\Event;
use Illuminate\Support\Facades\Queue;
Expand Down Expand Up @@ -1496,6 +1496,7 @@ public function last_modified_at_is_set_to_now_when_service_updated(): void
'created_at' => $oldNow,
'updated_at' => $oldNow,
]);

$updateRequest = $service->updateRequests()->create([
'user_id' => User::factory()->create()->id,
'data' => [
Expand All @@ -1507,7 +1508,49 @@ public function last_modified_at_is_set_to_now_when_service_updated(): void

$response->assertStatus(Response::HTTP_OK);
$this->assertDatabaseHas($service->getTable(), [
'last_modified_at' => $newNow->format(CarbonImmutable::ISO8601),
'last_modified_at' => $newNow->toDateTimeString(),
]);
}

/**
* @test
*/
public function lastModifiedAtIsUpdatedWhenServiceUpdatedByUpdateRequest()
{
$oldNow = Date::now()->subMonths(6);
$newNow = Date::now();
Date::setTestNow($newNow);

$service = Service::factory()->create([
'slug' => 'test-service',
'status' => Service::STATUS_ACTIVE,
'last_modified_at' => $oldNow,
'created_at' => $oldNow,
'updated_at' => $oldNow,
]);
$taxonomy = Taxonomy::factory()->create();
$service->syncTaxonomyRelationships(new Collection([$taxonomy]));
$user = User::factory()->create()->makeServiceAdmin($service);

Passport::actingAs($user);

$payload = [
'name' => 'Test Service',
];
$response = $this->json('PUT', "/core/v1/services/{$service->id}", $payload);

$response->assertStatus(Response::HTTP_OK);
$response->assertJsonFragment(['data' => $payload]);

$updateRequest = UpdateRequest::find($response->json('id'));

$this->assertEquals($updateRequest->data, $payload);

$this->approveUpdateRequest($updateRequest->id);

$this->assertDatabaseHas($service->getTable(), [
'id' => $service->id,
'last_modified_at' => $newNow->toDateTimeString(),
]);
}
}

0 comments on commit 7631447

Please sign in to comment.