diff --git a/.env b/.env index bb5febf3..3368f4ea 100644 --- a/.env +++ b/.env @@ -73,7 +73,7 @@ CONTAINER_REPRO=https://hub.docker.com/repository/docker/conduction/orc-php ################################################## NOTIFICATION_ENABLED=falsedxfddxf -NOTIFICATION_PROVIDER=sasdasd +NOTIFICATION_PROVIDER=sasdasdasd NOTIFICATION_ENABLED_AUTHORIZATION=sasd ################################################## diff --git a/api/config/packages/doctrine.yaml b/api/config/packages/doctrine.yaml index dae8287b..2dc3f229 100644 --- a/api/config/packages/doctrine.yaml +++ b/api/config/packages/doctrine.yaml @@ -10,6 +10,7 @@ doctrine: url: '%env(resolve:DATABASE_URL)%' types: uuid: Ramsey\Uuid\Doctrine\UuidType + datetime: App\Types\UTCDateTimeType #We override the default doctrine datetime with a UTC based version incompleteDate: App\Types\IncompleteDateType underInvestigation: App\Types\UnderInvestigationType money: Tbbc\MoneyBundle\Type\MoneyType diff --git a/api/src/Swagger/SwaggerDecorator.php b/api/src/Swagger/SwaggerDecorator.php index e0883841..02144843 100644 --- a/api/src/Swagger/SwaggerDecorator.php +++ b/api/src/Swagger/SwaggerDecorator.php @@ -442,7 +442,7 @@ private function getAdditionalEntityDocs($entity) $groups = $propertyAnnotation->getGroups(); break; - // Constrainds (Validation) + // Constrainds (Validation) case "Assert\Date": $atributes['type'] = 'string'; $atributes['format'] = 'date'; diff --git a/api/src/Types/UTCDateTimeType.php b/api/src/Types/UTCDateTimeType.php new file mode 100644 index 00000000..23f934c6 --- /dev/null +++ b/api/src/Types/UTCDateTimeType.php @@ -0,0 +1,46 @@ +setTimeZone(self::$utc); + + return $value->format($platform->getDateTimeFormatString()); + } + + public function convertToPHPValue($value, AbstractPlatform $platform) + { + if ($value === null) { + return null; + } + + if (is_null(self::$utc)) { + self::$utc = new \DateTimeZone('UTC'); + } + + $val = \DateTime::createFromFormat($platform->getDateTimeFormatString(), $value, self::$utc); + + if (!$val) { + throw ConversionException::conversionFailed($value, $this->getName()); + } + + return $val; + } +} diff --git a/docker-compose.yml b/docker-compose.yml index 3b2e71d6..bf6a04f4 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -180,7 +180,7 @@ services: # - db-data:/var/lib/postgresql/data:rw db: - image: mysql:5.6 + image: mysql:5.7 restart: always environment: - MYSQL_ROOT_PASSWORD=example diff --git a/openapi.yaml b/openapi.yaml new file mode 120000 index 00000000..f23a4951 --- /dev/null +++ b/openapi.yaml @@ -0,0 +1 @@ +api/public/schema/openapi.yaml \ No newline at end of file diff --git a/publiccode.yaml b/publiccode.yaml new file mode 120000 index 00000000..81a2ac2e --- /dev/null +++ b/publiccode.yaml @@ -0,0 +1 @@ +api/public/schema/publiccode.yaml \ No newline at end of file