diff --git a/.travis.yml b/.travis.yml index 5b9cc6a..4fce1a7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -29,7 +29,6 @@ before_install: script: - docker-compose -f docker-compose.yml -f docker-compose.test.yml up -d - while true; do output=`docker-compose exec -T php pidof php-fpm | cat`; if [[ ! -z "${output}" ]]; then break; fi; sleep 1; done; - - docker-compose -f docker-compose.yml -f docker-compose.test.yml exec php php bin/console security:check - docker-compose -f docker-compose.yml -f docker-compose.test.yml exec php php bin/console doctrine:migration:migrate --no-interaction - docker-compose -f docker-compose.yml -f docker-compose.test.yml exec -e FIXTURES=test php php bin/console doctrine:fixtures:load --no-interaction - docker-compose -f docker-compose.yml -f docker-compose.test.yml exec php vendor/bin/behat diff --git a/api/Dockerfile-php b/api/Dockerfile-php index e316e63..18474ad 100644 --- a/api/Dockerfile-php +++ b/api/Dockerfile-php @@ -46,7 +46,7 @@ RUN set -eux; \ \ apk del .build-deps -COPY --from=composer:latest /usr/bin/composer /usr/bin/composer +COPY --from=composer:1.10.16 /usr/bin/composer /usr/bin/composer COPY docker/php/php.ini /usr/local/etc/php/php.ini # https://getcomposer.org/doc/03-cli.md#composer-allow-superuser diff --git a/api/composer.json b/api/composer.json index 74c61e5..96ede34 100644 --- a/api/composer.json +++ b/api/composer.json @@ -11,13 +11,15 @@ "ext-iconv": "*", "api-platform/api-pack": "^1.1", "defuse/php-encryption": "^2.2", - "digitalstate/core": "0.18.0", + "digitalstate/core": "0.19.0", "doctrine/doctrine-fixtures-bundle": "^3.0", "doctrine/doctrine-migrations-bundle": "^1.3", "guzzlehttp/guzzle": "^6.3", + "justinrainbow/json-schema": "^5.0", "knplabs/doctrine-behaviors": "^1.5", "lexik/jwt-authentication-bundle": "^2.6", "ramsey/uuid": "^3.8", + "scienta/doctrine-json-functions": "^4.1", "sensio/framework-extra-bundle": "^5.2", "sensiolabs/security-checker": "^5.0", "symfony/console": "^4.0", @@ -66,8 +68,7 @@ "auto-scripts": { "cache:clear": "symfony-cmd", "assets:install": "symfony-cmd", - "assets:install %PUBLIC_DIR%": "symfony-cmd", - "security-checker security:check": "script" + "assets:install %PUBLIC_DIR%": "symfony-cmd" }, "post-install-cmd": [ "@auto-scripts" diff --git a/api/composer.lock b/api/composer.lock index 7699496..0535c30 100644 --- a/api/composer.lock +++ b/api/composer.lock @@ -1,10 +1,10 @@ { "_readme": [ "This file locks the dependencies of your project to a known state", - "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "59d15553219e3fd0c1268864dff90367", + "content-hash": "2f2aadf1a29918f666b1a3ab260386ac", "packages": [ { "name": "api-platform/api-pack", @@ -330,16 +330,16 @@ }, { "name": "digitalstate/core", - "version": "0.18.0", + "version": "0.19.0", "source": { "type": "git", "url": "https://github.com/DigitalState/Core.git", - "reference": "c94e4b990ef1a7f1adc76b89d06d95f6a47721ec" + "reference": "ddd320c3aacb7c5e7bdb962b5d2715abcb1dd9d2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/DigitalState/Core/zipball/c94e4b990ef1a7f1adc76b89d06d95f6a47721ec", - "reference": "c94e4b990ef1a7f1adc76b89d06d95f6a47721ec", + "url": "https://api.github.com/repos/DigitalState/Core/zipball/ddd320c3aacb7c5e7bdb962b5d2715abcb1dd9d2", + "reference": "ddd320c3aacb7c5e7bdb962b5d2715abcb1dd9d2", "shasum": "" }, "require": { @@ -1947,6 +1947,72 @@ ], "time": "2014-01-12T16:20:24+00:00" }, + { + "name": "justinrainbow/json-schema", + "version": "5.2.10", + "source": { + "type": "git", + "url": "https://github.com/justinrainbow/json-schema.git", + "reference": "2ba9c8c862ecd5510ed16c6340aa9f6eadb4f31b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/justinrainbow/json-schema/zipball/2ba9c8c862ecd5510ed16c6340aa9f6eadb4f31b", + "reference": "2ba9c8c862ecd5510ed16c6340aa9f6eadb4f31b", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "~2.2.20||~2.15.1", + "json-schema/json-schema-test-suite": "1.2.0", + "phpunit/phpunit": "^4.8.35" + }, + "bin": [ + "bin/validate-json" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "JsonSchema\\": "src/JsonSchema/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bruno Prieto Reis", + "email": "bruno.p.reis@gmail.com" + }, + { + "name": "Justin Rainbow", + "email": "justin.rainbow@gmail.com" + }, + { + "name": "Igor Wiedler", + "email": "igor@wiedler.ch" + }, + { + "name": "Robert Schönthal", + "email": "seroscho@googlemail.com" + } + ], + "description": "A library to validate a json schema.", + "homepage": "https://github.com/justinrainbow/json-schema", + "keywords": [ + "json", + "schema" + ], + "time": "2020-05-27T16:41:55+00:00" + }, { "name": "knplabs/doctrine-behaviors", "version": "1.6.0", @@ -2997,6 +3063,68 @@ ], "time": "2018-07-19T23:38:55+00:00" }, + { + "name": "scienta/doctrine-json-functions", + "version": "4.1.2", + "source": { + "type": "git", + "url": "https://github.com/ScientaNL/DoctrineJsonFunctions.git", + "reference": "6cab3f93a7415dbc889da15336c7605efbfe7bd4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ScientaNL/DoctrineJsonFunctions/zipball/6cab3f93a7415dbc889da15336c7605efbfe7bd4", + "reference": "6cab3f93a7415dbc889da15336c7605efbfe7bd4", + "shasum": "" + }, + "require": { + "ext-pdo": "*", + "php": "^7.1" + }, + "require-dev": { + "doctrine/coding-standard": "^5.0", + "doctrine/orm": "~2.6", + "phpunit/phpunit": "^6.5" + }, + "suggest": { + "dunglas/doctrine-json-odm": "To serialize / deserialize objects as JSON documents." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.1-dev" + } + }, + "autoload": { + "psr-4": { + "Scienta\\DoctrineJsonFunctions\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Doctrine Json Functions Contributors", + "homepage": "https://github.com/ScientaNL/DoctrineJsonFunctions/contributors" + } + ], + "description": "A set of extensions to Doctrine 2 that add support for json query functions.", + "keywords": [ + "database", + "doctrine", + "dql", + "json", + "mariadb", + "mysql", + "orm", + "postgres", + "postgresql", + "sqlite" + ], + "time": "2020-02-07T11:05:21+00:00" + }, { "name": "sensio/framework-extra-bundle", "version": "v5.2.4", @@ -6247,6 +6375,7 @@ "code", "zf2" ], + "abandoned": "laminas/laminas-code", "time": "2018-08-13T20:36:59+00:00" }, { @@ -6301,6 +6430,7 @@ "events", "zf2" ], + "abandoned": "laminas/laminas-eventmanager", "time": "2018-04-25T15:33:34+00:00" } ], @@ -6936,6 +7066,7 @@ ], "description": "Promoting the interoperability of container objects (DIC, SL, etc.)", "homepage": "https://github.com/container-interop/container-interop", + "abandoned": "psr/container", "time": "2017-02-14T19:40:03+00:00" }, { @@ -6943,12 +7074,12 @@ "version": "0.9.1", "source": { "type": "git", - "url": "https://github.com/njh/easyrdf.git", + "url": "https://github.com/easyrdf/easyrdf.git", "reference": "acd09dfe0555fbcfa254291e433c45fdd4652566" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/njh/easyrdf/zipball/acd09dfe0555fbcfa254291e433c45fdd4652566", + "url": "https://api.github.com/repos/easyrdf/easyrdf/zipball/acd09dfe0555fbcfa254291e433c45fdd4652566", "reference": "acd09dfe0555fbcfa254291e433c45fdd4652566", "shasum": "" }, @@ -7096,72 +7227,6 @@ "description": "A tool to automatically fix PHP code style", "time": "2019-01-04T18:29:47+00:00" }, - { - "name": "justinrainbow/json-schema", - "version": "5.2.8", - "source": { - "type": "git", - "url": "https://github.com/justinrainbow/json-schema.git", - "reference": "dcb6e1006bb5fd1e392b4daa68932880f37550d4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/justinrainbow/json-schema/zipball/dcb6e1006bb5fd1e392b4daa68932880f37550d4", - "reference": "dcb6e1006bb5fd1e392b4daa68932880f37550d4", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "friendsofphp/php-cs-fixer": "~2.2.20", - "json-schema/json-schema-test-suite": "1.2.0", - "phpunit/phpunit": "^4.8.35" - }, - "bin": [ - "bin/validate-json" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "JsonSchema\\": "src/JsonSchema/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Bruno Prieto Reis", - "email": "bruno.p.reis@gmail.com" - }, - { - "name": "Justin Rainbow", - "email": "justin.rainbow@gmail.com" - }, - { - "name": "Igor Wiedler", - "email": "igor@wiedler.ch" - }, - { - "name": "Robert Schönthal", - "email": "seroscho@googlemail.com" - } - ], - "description": "A library to validate a json schema.", - "homepage": "https://github.com/justinrainbow/json-schema", - "keywords": [ - "json", - "schema" - ], - "time": "2019-01-14T23:55:14+00:00" - }, { "name": "league/html-to-markdown", "version": "4.8.1", @@ -7883,5 +7948,6 @@ "php": "^7.1.3", "ext-iconv": "*" }, - "platform-dev": [] + "platform-dev": [], + "plugin-api-version": "1.1.0" } diff --git a/api/config/fixtures/dev/access/anonymous/access.yaml b/api/config/fixtures/dev/access/anonymous/access.yaml index d49d2fa..6b842c5 100644 --- a/api/config/fixtures/dev/access/anonymous/access.yaml +++ b/api/config/fixtures/dev/access/anonymous/access.yaml @@ -3,6 +3,7 @@ objects: prototype: uuid: ~ + created_at: ~ owner: BusinessUnit owner_uuid: c11c546e-bd01-47cf-97da-e25388357b5a # Administration assignee: Anonymous diff --git a/api/config/fixtures/dev/access/individual/access.yaml b/api/config/fixtures/dev/access/individual/access.yaml index dfe7630..3318fdd 100644 --- a/api/config/fixtures/dev/access/individual/access.yaml +++ b/api/config/fixtures/dev/access/individual/access.yaml @@ -2,6 +2,7 @@ objects: [] prototype: uuid: ~ + created_at: ~ owner: BusinessUnit owner_uuid: c11c546e-bd01-47cf-97da-e25388357b5a # Administration assignee: Individual diff --git a/api/config/fixtures/dev/access/organization/access.yaml b/api/config/fixtures/dev/access/organization/access.yaml index d49418a..23d354e 100644 --- a/api/config/fixtures/dev/access/organization/access.yaml +++ b/api/config/fixtures/dev/access/organization/access.yaml @@ -2,6 +2,7 @@ objects: [] prototype: uuid: ~ + created_at: ~ owner: BusinessUnit owner_uuid: c11c546e-bd01-47cf-97da-e25388357b5a # Administration assignee: Organization diff --git a/api/config/fixtures/dev/access/role/access.yaml b/api/config/fixtures/dev/access/role/access.yaml index f939b3b..3cba202 100644 --- a/api/config/fixtures/dev/access/role/access.yaml +++ b/api/config/fixtures/dev/access/role/access.yaml @@ -16,6 +16,7 @@ objects: prototype: uuid: ~ + created_at: ~ owner: BusinessUnit owner_uuid: c11c546e-bd01-47cf-97da-e25388357b5a # Administration assignee: Role diff --git a/api/config/fixtures/dev/access/role/permission.yaml b/api/config/fixtures/dev/access/role/permission.yaml index a166be2..89a8110 100644 --- a/api/config/fixtures/dev/access/role/permission.yaml +++ b/api/config/fixtures/dev/access/role/permission.yaml @@ -3,7 +3,6 @@ objects: scope: type: owner entity: BusinessUnit - entity_uuid: ~ # Any BusinessUnit key: entity attributes: [BROWSE, READ, EDIT, ADD, DELETE] @@ -11,7 +10,6 @@ objects: scope: type: owner entity: BusinessUnit - entity_uuid: ~ # Any BusinessUnit key: property attributes: [BROWSE, READ, EDIT] diff --git a/api/config/fixtures/dev/access/staff/access.yaml b/api/config/fixtures/dev/access/staff/access.yaml index 3546239..0989c22 100644 --- a/api/config/fixtures/dev/access/staff/access.yaml +++ b/api/config/fixtures/dev/access/staff/access.yaml @@ -2,6 +2,7 @@ objects: [] prototype: uuid: ~ + created_at: ~ owner: BusinessUnit owner_uuid: c11c546e-bd01-47cf-97da-e25388357b5a # Administration assignee: Staff diff --git a/api/config/fixtures/dev/access/system/access.yaml b/api/config/fixtures/dev/access/system/access.yaml index 152ff78..c85191d 100644 --- a/api/config/fixtures/dev/access/system/access.yaml +++ b/api/config/fixtures/dev/access/system/access.yaml @@ -9,6 +9,7 @@ objects: prototype: uuid: ~ + created_at: ~ owner: System owner_uuid: ~ assignee: System diff --git a/api/config/fixtures/dev/config.yaml b/api/config/fixtures/dev/config.yaml index c3952fc..7595490 100644 --- a/api/config/fixtures/dev/config.yaml +++ b/api/config/fixtures/dev/config.yaml @@ -33,6 +33,7 @@ objects: prototype: uuid: ~ + created_at: ~ owner: BusinessUnit owner_uuid: c11c546e-bd01-47cf-97da-e25388357b5a # Administration key: ~ diff --git a/api/config/fixtures/dev/metadata.yaml b/api/config/fixtures/dev/metadata.yaml index 8130c48..16c7828 100644 --- a/api/config/fixtures/dev/metadata.yaml +++ b/api/config/fixtures/dev/metadata.yaml @@ -2,6 +2,7 @@ objects: [] prototype: uuid: ~ + created_at: ~ owner: BusinessUnit owner_uuid: c11c546e-bd01-47cf-97da-e25388357b5a # Administration title: {} diff --git a/api/config/fixtures/dev/record.yaml b/api/config/fixtures/dev/record.yaml index b0badb4..3a70e1a 100644 --- a/api/config/fixtures/dev/record.yaml +++ b/api/config/fixtures/dev/record.yaml @@ -19,6 +19,7 @@ objects: prototype: uuid: ~ + created_at: ~ owner: BusinessUnit owner_uuid: a9d68bf7-5000-49fe-8b00-33dde235b327 # Backoffice identity: ~ diff --git a/api/config/fixtures/dev/system/tenant.yaml b/api/config/fixtures/dev/system/tenant.yaml index feb4948..a0dbc08 100644 --- a/api/config/fixtures/dev/system/tenant.yaml +++ b/api/config/fixtures/dev/system/tenant.yaml @@ -3,4 +3,5 @@ objects: prototype: uuid: ~ + created_at: ~ data: {} diff --git a/api/config/fixtures/test/access/anonymous/access.yaml b/api/config/fixtures/test/access/anonymous/access.yaml index 9230dcc..c12070d 100644 --- a/api/config/fixtures/test/access/anonymous/access.yaml +++ b/api/config/fixtures/test/access/anonymous/access.yaml @@ -19,6 +19,7 @@ objects: prototype: uuid: ~ + created_at: ~ owner: BusinessUnit owner_uuid: ~ assignee: Anonymous diff --git a/api/config/fixtures/test/access/individual/access.yaml b/api/config/fixtures/test/access/individual/access.yaml index fe1473f..3874fbd 100644 --- a/api/config/fixtures/test/access/individual/access.yaml +++ b/api/config/fixtures/test/access/individual/access.yaml @@ -19,6 +19,7 @@ objects: prototype: uuid: ~ + created_at: ~ owner: BusinessUnit owner_uuid: ~ assignee: Individual diff --git a/api/config/fixtures/test/access/organization/access.yaml b/api/config/fixtures/test/access/organization/access.yaml index b484340..dd5c107 100644 --- a/api/config/fixtures/test/access/organization/access.yaml +++ b/api/config/fixtures/test/access/organization/access.yaml @@ -19,6 +19,7 @@ objects: prototype: uuid: ~ + created_at: ~ owner: BusinessUnit owner_uuid: ~ assignee: Organization diff --git a/api/config/fixtures/test/access/role/access.yaml b/api/config/fixtures/test/access/role/access.yaml index fb18ad2..a70eb55 100644 --- a/api/config/fixtures/test/access/role/access.yaml +++ b/api/config/fixtures/test/access/role/access.yaml @@ -2,6 +2,7 @@ objects: [] prototype: uuid: ~ + created_at: ~ owner: BusinessUnit owner_uuid: ~ assignee: Role diff --git a/api/config/fixtures/test/access/staff/access.yaml b/api/config/fixtures/test/access/staff/access.yaml index c004b26..27f374d 100644 --- a/api/config/fixtures/test/access/staff/access.yaml +++ b/api/config/fixtures/test/access/staff/access.yaml @@ -19,6 +19,7 @@ objects: prototype: uuid: ~ + created_at: ~ owner: BusinessUnit owner_uuid: ~ assignee: Staff diff --git a/api/config/fixtures/test/access/system/access.yaml b/api/config/fixtures/test/access/system/access.yaml index 891e0ef..e668643 100644 --- a/api/config/fixtures/test/access/system/access.yaml +++ b/api/config/fixtures/test/access/system/access.yaml @@ -11,6 +11,7 @@ objects: prototype: uuid: ~ + created_at: ~ owner: System owner_uuid: ~ assignee: System diff --git a/api/config/fixtures/test/config.yaml b/api/config/fixtures/test/config.yaml index 5d2b040..5718e19 100644 --- a/api/config/fixtures/test/config.yaml +++ b/api/config/fixtures/test/config.yaml @@ -97,6 +97,7 @@ objects: prototype: uuid: ~ + created_at: ~ owner: BusinessUnit owner_uuid: ~ key: ~ diff --git a/api/config/fixtures/test/metadata.yaml b/api/config/fixtures/test/metadata.yaml index fd99172..63d3607 100644 --- a/api/config/fixtures/test/metadata.yaml +++ b/api/config/fixtures/test/metadata.yaml @@ -33,6 +33,7 @@ objects: prototype: uuid: ~ + created_at: ~ owner: BusinessUnit owner_uuid: ~ title: {} diff --git a/api/config/fixtures/test/record.yaml b/api/config/fixtures/test/record.yaml index 960eb65..18c1d54 100644 --- a/api/config/fixtures/test/record.yaml +++ b/api/config/fixtures/test/record.yaml @@ -45,6 +45,7 @@ objects: prototype: uuid: ~ + created_at: ~ owner: BusinessUnit owner_uuid: ~ identity: ~ diff --git a/api/config/fixtures/test/system/tenant.yaml b/api/config/fixtures/test/system/tenant.yaml index 748d82c..77cf647 100644 --- a/api/config/fixtures/test/system/tenant.yaml +++ b/api/config/fixtures/test/system/tenant.yaml @@ -5,4 +5,5 @@ objects: prototype: uuid: ~ + created_at: ~ data: {} diff --git a/api/config/packages/api_platform.yaml b/api/config/packages/api_platform.yaml index 15a8e2c..c8f8b6b 100644 --- a/api/config/packages/api_platform.yaml +++ b/api/config/packages/api_platform.yaml @@ -5,7 +5,7 @@ api_platform: mapping: paths: ['%kernel.project_dir%/src/Entity'] title: Records - version: 0.18.1 + version: 0.19.0 collection: pagination: page_parameter_name: _page diff --git a/api/config/packages/doctrine.yaml b/api/config/packages/doctrine.yaml index 02aef9d..4ede26b 100644 --- a/api/config/packages/doctrine.yaml +++ b/api/config/packages/doctrine.yaml @@ -7,6 +7,18 @@ doctrine: server_version: '9.6' url: '%env(resolve:DATABASE_URL)%' orm: + dql: + string_functions: + JSON_EXTRACT_PATH: Scienta\DoctrineJsonFunctions\Query\AST\Functions\Postgresql\JsonExtractPath + JSON_GET: Scienta\DoctrineJsonFunctions\Query\AST\Functions\Postgresql\JsonGet + JSON_GET_PATH: Scienta\DoctrineJsonFunctions\Query\AST\Functions\Postgresql\JsonGetPath + JSON_GET_PATH_TEXT: Scienta\DoctrineJsonFunctions\Query\AST\Functions\Postgresql\JsonGetPathText + JSON_GET_TEXT: Scienta\DoctrineJsonFunctions\Query\AST\Functions\Postgresql\JsonGetText + JSONB_CONTAINS: Scienta\DoctrineJsonFunctions\Query\AST\Functions\Postgresql\JsonbContains + JSONB_EXISTS: Scienta\DoctrineJsonFunctions\Query\AST\Functions\Postgresql\JsonbExists + JSONB_EXISTS_ALL: Scienta\DoctrineJsonFunctions\Query\AST\Functions\Postgresql\JsonbExistsAll + JSONB_EXISTS_ANY: Scienta\DoctrineJsonFunctions\Query\AST\Functions\Postgresql\JsonbExistsAny + JSONB_IS_CONTAINED: Scienta\DoctrineJsonFunctions\Query\AST\Functions\Postgresql\JsonbIsContained auto_generate_proxy_classes: '%kernel.debug%' naming_strategy: doctrine.orm.naming_strategy.underscore auto_mapping: true diff --git a/api/config/packages/ds_acl.yaml b/api/config/packages/ds_acl.yaml index 6cc0eab..806564b 100644 --- a/api/config/packages/ds_acl.yaml +++ b/api/config/packages/ds_acl.yaml @@ -3,32 +3,32 @@ ds_acl: - App\Entity\Record - App\Entity\RecordAssociation permissions: - record: { attributes: [BROWSE, READ, EDIT, ADD, DELETE], entity: App\Entity\Record, title: app.permissions.record } - record_property: { attributes: [BROWSE, READ, EDIT], property: App\Entity\Record.*, title: app.permissions.record.property } - record_id: { attributes: [BROWSE, READ, EDIT], property: App\Entity\Record.id, title: app.permissions.record.id } - record_uuid: { attributes: [BROWSE, READ, EDIT], property: App\Entity\Record.uuid, title: app.permissions.record.uuid } - record_created_at: { attributes: [BROWSE, READ, EDIT], property: App\Entity\Record.createdAt, title: app.permissions.record.created_at } - record_updated_at: { attributes: [BROWSE, READ, EDIT], property: App\Entity\Record.updatedAt, title: app.permissions.record.updated_at } - record_deleted_at: { attributes: [BROWSE, READ, EDIT], property: App\Entity\Record.deletedAt, title: app.permissions.record.deleted_at } - record_owner: { attributes: [BROWSE, READ, EDIT], property: App\Entity\Record.owner, title: app.permissions.record.owner } - record_owner_uuid: { attributes: [BROWSE, READ, EDIT], property: App\Entity\Record.ownerUuid, title: app.permissions.record.owner_uuid } - record_identity: { attributes: [BROWSE, READ, EDIT], property: App\Entity\Record.identity, title: app.permissions.record.identity } - record_identity_uuid: { attributes: [BROWSE, READ, EDIT], property: App\Entity\Record.identityUuid, title: app.permissions.record.identity_uuid } - record_title: { attributes: [BROWSE, READ, EDIT], property: App\Entity\Record.title, title: app.permissions.record.title } - record_data: { attributes: [BROWSE, READ, EDIT], property: App\Entity\Record.data, title: app.permissions.record.data } - record_version: { attributes: [BROWSE, READ, EDIT], property: App\Entity\Record.version, title: app.permissions.record.version } - record_tenant: { attributes: [BROWSE, READ, EDIT], property: App\Entity\Record.tenant, title: app.permissions.record.tenant } - record_association: { attributes: [BROWSE, READ, EDIT, ADD, DELETE], entity: App\Entity\Record, title: app.permissions.record_association } - record_association_property: { attributes: [BROWSE, READ, EDIT], property: App\Entity\Record.*, title: app.permissions.record_association.property } - record_association_id: { attributes: [BROWSE, READ, EDIT], property: App\Entity\Record.id, title: app.permissions.record_association.id } - record_association_uuid: { attributes: [BROWSE, READ, EDIT], property: App\Entity\Record.uuid, title: app.permissions.record_association.uuid } - record_association_created_at: { attributes: [BROWSE, READ, EDIT], property: App\Entity\Record.createdAt, title: app.permissions.record_association.created_at } - record_association_updated_at: { attributes: [BROWSE, READ, EDIT], property: App\Entity\Record.updatedAt, title: app.permissions.record_association.updated_at } - record_association_deleted_at: { attributes: [BROWSE, READ, EDIT], property: App\Entity\Record.deletedAt, title: app.permissions.record_association.deleted_at } - record_association_owner: { attributes: [BROWSE, READ, EDIT], property: App\Entity\Record.owner, title: app.permissions.record_association.owner } - record_association_owner_uuid: { attributes: [BROWSE, READ, EDIT], property: App\Entity\Record.ownerUuid, title: app.permissions.record_association.owner_uuid } - record_association_record: { attributes: [BROWSE, READ, EDIT], property: App\Entity\Record.record, title: app.permissions.record_association.record } - record_association_entity: { attributes: [BROWSE, READ, EDIT], property: App\Entity\Record.identity, title: app.permissions.record_association.entity } - record_association_entity_uuid: { attributes: [BROWSE, READ, EDIT], property: App\Entity\Record.identityUuid, title: app.permissions.record_association.entity_uuid } - record_association_version: { attributes: [BROWSE, READ, EDIT], property: App\Entity\Record.version, title: app.permissions.record_association.version } - record_association_tenant: { attributes: [BROWSE, READ, EDIT], property: App\Entity\Record.tenant, title: app.permissions.record_association.tenant } + record: { attributes: [BROWSE, READ, EDIT, ADD, DELETE], entity: App\Entity\Record, title: app.permissions.record } + record_property: { attributes: [BROWSE, READ, EDIT], property: App\Entity\Record.*, title: app.permissions.record.property } + record_id: { attributes: [BROWSE, READ, EDIT], property: App\Entity\Record.id, title: app.permissions.record.id } + record_uuid: { attributes: [BROWSE, READ, EDIT], property: App\Entity\Record.uuid, title: app.permissions.record.uuid } + record_created_at: { attributes: [BROWSE, READ, EDIT], property: App\Entity\Record.createdAt, title: app.permissions.record.created_at } + record_updated_at: { attributes: [BROWSE, READ, EDIT], property: App\Entity\Record.updatedAt, title: app.permissions.record.updated_at } + record_deleted_at: { attributes: [BROWSE, READ, EDIT], property: App\Entity\Record.deletedAt, title: app.permissions.record.deleted_at } + record_owner: { attributes: [BROWSE, READ, EDIT], property: App\Entity\Record.owner, title: app.permissions.record.owner } + record_owner_uuid: { attributes: [BROWSE, READ, EDIT], property: App\Entity\Record.ownerUuid, title: app.permissions.record.owner_uuid } + record_identity: { attributes: [BROWSE, READ, EDIT], property: App\Entity\Record.identity, title: app.permissions.record.identity } + record_identity_uuid: { attributes: [BROWSE, READ, EDIT], property: App\Entity\Record.identityUuid, title: app.permissions.record.identity_uuid } + record_title: { attributes: [BROWSE, READ, EDIT], property: App\Entity\Record.title, title: app.permissions.record.title } + record_data: { attributes: [BROWSE, READ, EDIT], property: App\Entity\Record.data, title: app.permissions.record.data } + record_version: { attributes: [BROWSE, READ, EDIT], property: App\Entity\Record.version, title: app.permissions.record.version } + record_tenant: { attributes: [BROWSE, READ, EDIT], property: App\Entity\Record.tenant, title: app.permissions.record.tenant } + record_association: { attributes: [BROWSE, READ, EDIT, ADD, DELETE], entity: App\Entity\RecordAssociation, title: app.permissions.record_association } + record_association_property: { attributes: [BROWSE, READ, EDIT], property: App\Entity\RecordAssociation.*, title: app.permissions.record_association.property } + record_association_id: { attributes: [BROWSE, READ, EDIT], property: App\Entity\RecordAssociation.id, title: app.permissions.record_association.id } + record_association_uuid: { attributes: [BROWSE, READ, EDIT], property: App\Entity\RecordAssociation.uuid, title: app.permissions.record_association.uuid } + record_association_created_at: { attributes: [BROWSE, READ, EDIT], property: App\Entity\RecordAssociation.createdAt, title: app.permissions.record_association.created_at } + record_association_updated_at: { attributes: [BROWSE, READ, EDIT], property: App\Entity\RecordAssociation.updatedAt, title: app.permissions.record_association.updated_at } + record_association_deleted_at: { attributes: [BROWSE, READ, EDIT], property: App\Entity\RecordAssociation.deletedAt, title: app.permissions.record_association.deleted_at } + record_association_owner: { attributes: [BROWSE, READ, EDIT], property: App\Entity\RecordAssociation.owner, title: app.permissions.record_association.owner } + record_association_owner_uuid: { attributes: [BROWSE, READ, EDIT], property: App\Entity\RecordAssociation.ownerUuid, title: app.permissions.record_association.owner_uuid } + record_association_record: { attributes: [BROWSE, READ, EDIT], property: App\Entity\RecordAssociation.record, title: app.permissions.record_association.record } + record_association_entity: { attributes: [BROWSE, READ, EDIT], property: App\Entity\RecordAssociation.identity, title: app.permissions.record_association.entity } + record_association_entity_uuid: { attributes: [BROWSE, READ, EDIT], property: App\Entity\RecordAssociation.identityUuid, title: app.permissions.record_association.entity_uuid } + record_association_version: { attributes: [BROWSE, READ, EDIT], property: App\Entity\RecordAssociation.version, title: app.permissions.record_association.version } + record_association_tenant: { attributes: [BROWSE, READ, EDIT], property: App\Entity\RecordAssociation.tenant, title: app.permissions.record_association.tenant } diff --git a/api/config/tenant/loader/acl.yaml b/api/config/tenant/loader/acl.yaml index 6f6130c..0af652f 100644 --- a/api/config/tenant/loader/acl.yaml +++ b/api/config/tenant/loader/acl.yaml @@ -25,13 +25,11 @@ objects: - scope: type: owner entity: BusinessUnit - entity_uuid: ~ key: entity attributes: [BROWSE, READ, EDIT, ADD, DELETE] - scope: type: owner entity: BusinessUnit - entity_uuid: ~ key: property attributes: [BROWSE, READ, EDIT] - scope: diff --git a/api/features/api/access/add.feature b/api/features/api/access/add.feature index fdae0d8..973c8be 100644 --- a/api/features/api/access/add.feature +++ b/api/features/api/access/add.feature @@ -10,6 +10,7 @@ Feature: Add accesses And I send a "POST" request to "/accesses" with body: """ { + "createdAt": "2000-01-01 12:00:00", "owner": "BusinessUnit", "ownerUuid": "325e1004-8516-4ca9-a4d3-d7505bd9a7fe", "assignee": "Anonymous", @@ -25,6 +26,7 @@ Feature: Add accesses And the JSON node "id" should be equal to the number 19 And the JSON node "uuid" should exist And the JSON node "createdAt" should exist + And the JSON node "createdAt" should be equal to the string "2000-01-01T12:00:00+00:00" And the JSON node "updatedAt" should exist And the JSON node "owner" should exist And the JSON node "owner" should be equal to the string "BusinessUnit" diff --git a/api/features/api/access/edit.feature b/api/features/api/access/edit.feature index 790a6a7..7a21f60 100644 --- a/api/features/api/access/edit.feature +++ b/api/features/api/access/edit.feature @@ -10,6 +10,7 @@ Feature: Edit accesses And I send a "PUT" request to "/accesses/d332f180-3d5a-4efc-9983-b0e9ca27a363" with body: """ { + "createdAt": "2000-01-01 12:00:00", "owner": "System", "ownerUuid": "aa18b644-a503-49fa-8f53-10f4c1f8e3a1", "assignee": "System", @@ -20,6 +21,7 @@ Feature: Edit accesses Then the response status code should be 200 And the header "Content-Type" should be equal to "application/json; charset=utf-8" And the response should be in JSON + And the JSON node "createdAt" should be equal to the string "2000-01-01T12:00:00+00:00" And the JSON node "owner" should be equal to the string "System" And the JSON node "ownerUuid" should be equal to the string "aa18b644-a503-49fa-8f53-10f4c1f8e3a1" And the JSON node "assignee" should be equal to the string "System" @@ -32,6 +34,7 @@ Feature: Edit accesses Then the response status code should be 200 And the header "Content-Type" should be equal to "application/json; charset=utf-8" And the response should be in JSON + And the JSON node "createdAt" should be equal to the string "2000-01-01T12:00:00+00:00" And the JSON node "owner" should be equal to the string "System" And the JSON node "ownerUuid" should be equal to the string "aa18b644-a503-49fa-8f53-10f4c1f8e3a1" And the JSON node "assignee" should be equal to the string "System" @@ -46,7 +49,6 @@ Feature: Edit accesses { "id": 9999, "uuid": "1ac1b01e-4934-4b89-8a43-7d17a849be61", - "createdAt":"2000-01-01T12:00:00+00:00", "updatedAt":"2000-01-01T12:00:00+00:00", "version": 2, "tenant": "93377748-2abb-4e33-9027-5d8a5c281a41" @@ -57,7 +59,6 @@ Feature: Edit accesses And the response should be in JSON And the JSON node "id" should be equal to the number 1 And the JSON node "uuid" should be equal to the string "d332f180-3d5a-4efc-9983-b0e9ca27a363" - And the JSON node "createdAt" should not contain "2000-01-01T12:00:00+00:00" And the JSON node "updatedAt" should not contain "2000-01-01T12:00:00+00:00" And the JSON node "tenant" should be equal to "b6ac25fe-3cd6-4100-a054-6bba2fc9ef18" @@ -69,7 +70,6 @@ Feature: Edit accesses And the response should be in JSON And the JSON node "id" should be equal to the number 1 And the JSON node "uuid" should be equal to the string "d332f180-3d5a-4efc-9983-b0e9ca27a363" - And the JSON node "createdAt" should not contain "2000-01-01T12:00:00+00:00" And the JSON node "updatedAt" should not contain "2000-01-01T12:00:00+00:00" And the JSON node "tenant" should be equal to "b6ac25fe-3cd6-4100-a054-6bba2fc9ef18" diff --git a/api/features/api/config/edit.feature b/api/features/api/config/edit.feature index 7c4ec8a..44f605f 100644 --- a/api/features/api/config/edit.feature +++ b/api/features/api/config/edit.feature @@ -10,6 +10,7 @@ Feature: Edit configs And I send a "PUT" request to "/configs/b916df26-f099-4f5a-8dca-0f1a496e93d1" with body: """ { + "createdAt": "2000-01-01 12:00:00", "value": "system2@system.ds", "version": 1 } @@ -17,6 +18,7 @@ Feature: Edit configs Then the response status code should be 200 And the header "Content-Type" should be equal to "application/json; charset=utf-8" And the response should be in JSON + And the JSON node "createdAt" should be equal to the string "2000-01-01T12:00:00+00:00" And the JSON node "value" should be equal to the string "system2@system.ds" And the JSON node "version" should be equal to the number 2 @@ -26,6 +28,7 @@ Feature: Edit configs Then the response status code should be 200 And the header "Content-Type" should be equal to "application/json; charset=utf-8" And the response should be in JSON + And the JSON node "createdAt" should be equal to the string "2000-01-01T12:00:00+00:00" And the JSON node "value" should be equal to the string "system2@system.ds" And the JSON node "version" should be equal to the number 2 @@ -37,7 +40,6 @@ Feature: Edit configs { "id": 9999, "uuid": "1ac1b01e-4934-4b89-8a43-7d17a849be61", - "createdAt":"2000-01-01T12:00:00+00:00", "updatedAt":"2000-01-01T12:00:00+00:00", "owner": "System", "ownerUuid": "5f8630dd-4739-4573-bcf6-9133416e4311", @@ -51,7 +53,6 @@ Feature: Edit configs And the response should be in JSON And the JSON node "id" should be equal to the number 1 And the JSON node "uuid" should be equal to the string "b916df26-f099-4f5a-8dca-0f1a496e93d1" - And the JSON node "createdAt" should not contain "2000-01-01T12:00:00+00:00" And the JSON node "updatedAt" should not contain "2000-01-01T12:00:00+00:00" And the JSON node "owner" should be equal to "BusinessUnit" And the JSON node "ownerUuid" should be equal to "325e1004-8516-4ca9-a4d3-d7505bd9a7fe" @@ -66,7 +67,6 @@ Feature: Edit configs And the response should be in JSON And the JSON node "id" should be equal to the number 1 And the JSON node "uuid" should be equal to the string "b916df26-f099-4f5a-8dca-0f1a496e93d1" - And the JSON node "createdAt" should not contain "2000-01-01T12:00:00+00:00" And the JSON node "updatedAt" should not contain "2000-01-01T12:00:00+00:00" And the JSON node "owner" should be equal to "BusinessUnit" And the JSON node "ownerUuid" should be equal to "325e1004-8516-4ca9-a4d3-d7505bd9a7fe" diff --git a/api/features/api/metadata/add.feature b/api/features/api/metadata/add.feature index b5fc857..f67bf2c 100644 --- a/api/features/api/metadata/add.feature +++ b/api/features/api/metadata/add.feature @@ -10,6 +10,7 @@ Feature: Add metadata And I send a "POST" request to "/metadata" with body: """ { + "createdAt": "2000-01-01 12:00:00", "owner": "BusinessUnit", "ownerUuid": "325e1004-8516-4ca9-a4d3-d7505bd9a7fe", "title": { @@ -31,6 +32,7 @@ Feature: Add metadata And the JSON node "id" should be equal to the number 3 And the JSON node "uuid" should exist And the JSON node "createdAt" should exist + And the JSON node "createdAt" should be equal to the string "2000-01-01T12:00:00+00:00" And the JSON node "updatedAt" should exist And the JSON node "deletedAt" should exist And the JSON node "owner" should exist diff --git a/api/features/api/metadata/edit.feature b/api/features/api/metadata/edit.feature index c6edea2..5d06458 100644 --- a/api/features/api/metadata/edit.feature +++ b/api/features/api/metadata/edit.feature @@ -10,6 +10,7 @@ Feature: Edit metadata And I send a "PUT" request to "/metadata/4d4354b9-6069-44c3-9eac-c876a5a90e7f" with body: """ { + "createdAt": "2000-01-01 12:00:00", "owner": "System", "ownerUuid": "aa18b644-a503-49fa-8f53-10f4c1f8e3a1", "title": { @@ -27,6 +28,7 @@ Feature: Edit metadata Then the response status code should be 200 And the header "Content-Type" should be equal to "application/json; charset=utf-8" And the response should be in JSON + And the JSON node "createdAt" should be equal to the string "2000-01-01T12:00:00+00:00" And the JSON node "owner" should be equal to the string "System" And the JSON node "ownerUuid" should be equal to the string "aa18b644-a503-49fa-8f53-10f4c1f8e3a1" And the JSON node "title.en" should be equal to the string "Title - edit" @@ -42,6 +44,7 @@ Feature: Edit metadata Then the response status code should be 200 And the header "Content-Type" should be equal to "application/json; charset=utf-8" And the response should be in JSON + And the JSON node "createdAt" should be equal to the string "2000-01-01T12:00:00+00:00" And the JSON node "owner" should be equal to the string "System" And the JSON node "ownerUuid" should be equal to the string "aa18b644-a503-49fa-8f53-10f4c1f8e3a1" And the JSON node "title.en" should be equal to the string "Title - edit" @@ -59,7 +62,6 @@ Feature: Edit metadata { "id": 9999, "uuid": "421aebbb-e62e-4b87-bced-42921456131b", - "createdAt":"2000-01-01T12:00:00+00:00", "updatedAt":"2000-01-01T12:00:00+00:00", "version": 2, "tenant": "93377748-2abb-4e33-9027-5d8a5c281a41" @@ -70,7 +72,6 @@ Feature: Edit metadata And the response should be in JSON And the JSON node "id" should be equal to the number 1 And the JSON node "uuid" should be equal to the string "4d4354b9-6069-44c3-9eac-c876a5a90e7f" - And the JSON node "createdAt" should not contain "2000-01-01T12:00:00+00:00" And the JSON node "updatedAt" should not contain "2000-01-01T12:00:00+00:00" And the JSON node "tenant" should be equal to "b6ac25fe-3cd6-4100-a054-6bba2fc9ef18" @@ -82,7 +83,6 @@ Feature: Edit metadata And the response should be in JSON And the JSON node "id" should be equal to the number 1 And the JSON node "uuid" should be equal to the string "4d4354b9-6069-44c3-9eac-c876a5a90e7f" - And the JSON node "createdAt" should not contain "2000-01-01T12:00:00+00:00" And the JSON node "updatedAt" should not contain "2000-01-01T12:00:00+00:00" And the JSON node "tenant" should be equal to "b6ac25fe-3cd6-4100-a054-6bba2fc9ef18" diff --git a/api/features/api/record/add.feature b/api/features/api/record/add.feature index f797662..c5d19cd 100644 --- a/api/features/api/record/add.feature +++ b/api/features/api/record/add.feature @@ -10,6 +10,7 @@ Feature: Add records And I send a "POST" request to "/records" with body: """ { + "createdAt": "2000-01-01 12:00:00", "owner": "BusinessUnit", "ownerUuid": "83bf8f26-7181-4bed-92f3-3ce5e4c286d7", "identity": "Individual", @@ -31,6 +32,7 @@ Feature: Add records And the JSON node "id" should be equal to the number 5 And the JSON node "uuid" should exist And the JSON node "createdAt" should exist + And the JSON node "createdAt" should be equal to the string "2000-01-01T12:00:00+00:00" And the JSON node "updatedAt" should exist And the JSON node "deletedAt" should exist And the JSON node "deletedAt" should be null diff --git a/api/features/api/record/edit.feature b/api/features/api/record/edit.feature index 93fc150..5c31ae8 100644 --- a/api/features/api/record/edit.feature +++ b/api/features/api/record/edit.feature @@ -10,6 +10,7 @@ Feature: Edit records And I send a "PUT" request to "/records/88d90364-c6be-4dac-8fa4-7e4d43d08eea" with body: """ { + "createdAt": "2000-01-01 12:00:00", "title": { "en": "Animal License Form Submission - edit", "fr": "Formulaire de soumission pour permis animalier - edit" @@ -23,6 +24,7 @@ Feature: Edit records Then the response status code should be 200 And the header "Content-Type" should be equal to "application/json; charset=utf-8" And the response should be in JSON + And the JSON node "createdAt" should be equal to the string "2000-01-01T12:00:00+00:00" And the JSON node "title.en" should be equal to "Animal License Form Submission - edit" And the JSON node "title.fr" should be equal to "Formulaire de soumission pour permis animalier - edit" And the JSON node "data.type" should be equal to "dog - edit" @@ -34,6 +36,7 @@ Feature: Edit records Then the response status code should be 200 And the header "Content-Type" should be equal to "application/json; charset=utf-8" And the response should be in JSON + And the JSON node "createdAt" should be equal to the string "2000-01-01T12:00:00+00:00" And the JSON node "title.en" should be equal to "Animal License Form Submission - edit" And the JSON node "title.fr" should be equal to "Formulaire de soumission pour permis animalier - edit" And the JSON node "data.type" should be equal to "dog - edit" @@ -47,7 +50,6 @@ Feature: Edit records { "id": 9999, "uuid": "023ef9b1-64e5-48cb-b367-6a4d09ad3161", - "createdAt":"2000-01-01T12:00:00+00:00", "updatedAt":"2000-01-01T12:00:00+00:00", "deletedAt":"2000-01-01T12:00:00+00:00", "tenant": "40048804-8d66-4d48-b553-3833a5a06749" @@ -58,7 +60,6 @@ Feature: Edit records And the response should be in JSON And the JSON node "id" should be equal to the number 1 And the JSON node "uuid" should be equal to the string "88d90364-c6be-4dac-8fa4-7e4d43d08eea" - And the JSON node "createdAt" should not contain "2000-01-01T12:00:00+00:00" And the JSON node "updatedAt" should not contain "2000-01-01T12:00:00+00:00" And the JSON node "deletedAt" should not contain "2000-01-01T12:00:00+00:00" And the JSON node "tenant" should be equal to "b6ac25fe-3cd6-4100-a054-6bba2fc9ef18" @@ -71,7 +72,6 @@ Feature: Edit records And the response should be in JSON And the JSON node "id" should be equal to the number 1 And the JSON node "uuid" should be equal to the string "88d90364-c6be-4dac-8fa4-7e4d43d08eea" - And the JSON node "createdAt" should not contain "2000-01-01T12:00:00+00:00" And the JSON node "updatedAt" should not contain "2000-01-01T12:00:00+00:00" And the JSON node "deletedAt" should not contain "2000-01-01T12:00:00+00:00" And the JSON node "tenant" should be equal to "b6ac25fe-3cd6-4100-a054-6bba2fc9ef18" diff --git a/api/features/api/system/tenant/add.feature b/api/features/api/system/tenant/add.feature index ae37de8..5fe9bc2 100644 --- a/api/features/api/system/tenant/add.feature +++ b/api/features/api/system/tenant/add.feature @@ -10,6 +10,7 @@ Feature: Add tenant And I send a "POST" request to "/system/tenants" with body: """ { + "createdAt": "2000-01-01 12:00:00", "uuid": "3b0f1019-e9b6-458d-b9ad-fd60c079ee7b", "data": { "user": { @@ -70,6 +71,7 @@ Feature: Add tenant And the JSON node "uuid" should exist And the JSON node "uuid" should be equal to "3b0f1019-e9b6-458d-b9ad-fd60c079ee7b" And the JSON node "createdAt" should exist + And the JSON node "createdAt" should be equal to the string "2000-01-01T12:00:00+00:00" And the JSON node "updatedAt" should exist And the JSON node "version" should exist And the JSON node "version" should be equal to the number 1 diff --git a/api/src/Entity/Record.php b/api/src/Entity/Record.php index cf4c95f..681685f 100644 --- a/api/src/Entity/Record.php +++ b/api/src/Entity/Record.php @@ -91,8 +91,9 @@ class Record implements Identifiable, Uuidentifiable, Ownable, Translatable, Loc /** * @var \DateTime - * @ApiProperty(writable=false) - * @Serializer\Groups({"record_output"}) + * @ApiProperty + * @Serializer\Groups({"record_output", "record_input"}) + * @Assert\DateTime */ protected $createdAt; diff --git a/api/src/Entity/RecordAssociation.php b/api/src/Entity/RecordAssociation.php index 024a67f..38814cc 100644 --- a/api/src/Entity/RecordAssociation.php +++ b/api/src/Entity/RecordAssociation.php @@ -25,7 +25,8 @@ * }, * "filters"={ * "app.record_association.search", - * "app.record_association.date" + * "app.record_association.date", + * "app.record_association.order" * } * } * ) diff --git a/api/src/Fixture/Record.php b/api/src/Fixture/Record.php index a119cf8..f65b6bd 100644 --- a/api/src/Fixture/Record.php +++ b/api/src/Fixture/Record.php @@ -3,6 +3,7 @@ namespace App\Fixture; use App\Entity\Record as RecordEntity; +use DateTime; use Doctrine\Common\Persistence\ObjectManager; use Ds\Component\Database\Fixture\Yaml; @@ -36,6 +37,13 @@ public function load(ObjectManager $manager) ->setTitle((array) $object->title) ->setData((array) $object->data) ->setTenant($object->tenant); + + if (null !== $object->created_at) { + $date = new DateTime; + $date->setTimestamp($object->created_at); + $record->setCreatedAt($date); + } + $manager->persist($record); $manager->flush(); } diff --git a/api/src/Migration/Version0_19_0.php b/api/src/Migration/Version0_19_0.php new file mode 100644 index 0000000..0f3121f --- /dev/null +++ b/api/src/Migration/Version0_19_0.php @@ -0,0 +1,50 @@ +acl = new Acl($version); + } + + /** + * Up migration + * + * @param \Doctrine\DBAL\Schema\Schema $schema + */ + public function up(Schema $schema) + { + $this->acl->up($schema); + } + + /** + * Down migration + * + * @param \Doctrine\DBAL\Schema\Schema $schema + */ + public function down(Schema $schema) + { + $this->acl->down($schema); + } +} diff --git a/api/symfony.lock b/api/symfony.lock index e02db02..df7232f 100644 --- a/api/symfony.lock +++ b/api/symfony.lock @@ -245,6 +245,9 @@ "ramsey/uuid": { "version": "3.8.0" }, + "scienta/doctrine-json-functions": { + "version": "4.1.2" + }, "sensio/framework-extra-bundle": { "version": "5.2", "recipe": { diff --git a/docker-compose.yml b/docker-compose.yml index 8043311..763eb24 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -15,7 +15,7 @@ services: - records_database php: - image: digitalstate/records:php-0.18.1 + image: digitalstate/records:php-0.19.0 depends_on: - database env_file: @@ -44,7 +44,7 @@ services: - records_php api: - image: digitalstate/records:api-0.18.1 + image: digitalstate/records:api-0.19.0 depends_on: - php networks: