Use array for provider on userAutofilter on providerAuto build aliases for routesAdd base class for state providersAdd command to add providersAdd user command with providersCheck read/write securitybatch endpointextra fields as json blobadd service name in headertest version- add plain post to KeyFigures?
- add permissions for country?
N8N_WORKFLOW_ENDPOINT="http://192.168.3.20:5678/api/v1"
N8N_WORKFLOW_API_KEY="n8n_api_cd9be...."
n8n needs the following environment variables defined, they will not be visible in the UI.
N8N_TEMPLATES_HOST=http://api-test.docksal.site/api/v1/n8n
OCHA_API_URL=http://api-test.docksal.site/api/v1
ACAPS_USERNAME
ACAPS_PASSWORD
Workflows can be executed from files, no UI needed.
files
is a mapped directory.
docker-compose exec -u node n8n n8n execute --file /files/IDPS.json
docker-compose exec -e FTS_YEAR=2019 -u node n8n n8n execute --file /files/FTS.json
docker-compose exec -e CERF_YEAR=2022 -u node n8n n8n execute --file /files/cerf_by_country.json
docker-compose exec -e CERF_YEAR=2021 -u node n8n n8n execute --file /files/cerf_by_country.json
docker-compose exec -e CERF_YEAR=2020 -u node n8n n8n execute --file /files/cerf_by_country.json
docker-compose exec -e CERF_YEAR=2019 -u node n8n n8n execute --file /files/cerf_by_country.json
docker-compose exec -e CERF_YEAR=2018 -u node n8n n8n execute --file /files/cerf_by_country.json
docker-compose exec -e CERF_YEAR=2017 -u node n8n n8n execute --file /files/cerf_by_country.json
docker-compose exec -e CERF_YEAR=2016 -u node n8n n8n execute --file /files/cerf_by_country.json
console app:add-provider cerf "CERF" cerf key_figures
console app:add-user cerf cerf@example.com cerf cerf cerf
console app:grant-access numbers cerf
console cache:clear
console dbal:run-sql "delete from key_figures where provider = \"rw_crisis\""
console dbal:run-sql "select id, value from key_figures where year=2022 and iso3=\"afg\" and provider = \"rw_crisis\""
console dbal:run-sql "select * from key_figures where id = \"rw_crisis_AFG_2021_PeopleinNeed\""
console dbal:run-sql "update user set webhook = "https://numbers.reliefweb.int/webhook/listen\" where Username = "numbers"" console dbal:run-sql "update user set webhook = "http://numbers.docksal.site/webhook/listen\" where Username = "numbers""
console make:entity -a InternallyDisplacedPersonsValues
console make:entity --api-resource InternallyDisplacedPersons
console make:migration
console doctrine:migrations:migrate
console app:add-user idps idps@example.com idps --idps
Use for custom endpoints.
console make:state-provider
Use for creating a basic command.
console make:command
fin console doctrine:database:drop --env=test --force
fin console doctrine:database:create --env=test --if-not-exists -n
fin console doctrine:schema:create --env=test -n
fin console netbrothers:version --env=test --drop-version
fin console netbrothers:version --env=test
fin console hautelook:fixtures:load --env=test -n
fin exec phpunit
console app:add-provider fts "FTS" fts key_figures
console app:add-provider idps "Internally displaced persons key figures" idps key_figures
console app:add-provider cbpf "Country-Based Pooled Funds" cbpf key_figures
Admin have read/write access to all resources.
Add users with read permissions.
console app:add-user fts fts@example.com fts fts
console app:add-user rwcrisis rwcrisis@example.com rwcrisis rw_crisis
console app:add-user idps idps@example.com idps idps
console app:add-user admin admin@example.com admin --admin
Add users with read/write permissions.
console app:add-user idps idps@example.com idps idps idps
console app:add-user cbpf cbpf@example.com cbpf cbpf cbpf
Install using composer require lexik/jwt-authentication-bundle
console app:add-user username password info@example.com
console lexik:jwt:generate-token info@example.com --user-class="App\Entity\User"
console import:fts 2022
console import:fts 2021
/api/fts/years
/api/fts/countries
/api/fts/country/{iso3}
/api/fts/year/{year}
composer run changelog
to create changelogcomposer run release
to create new releasecomposer run release:patch
to create new release and bump patch versioncomposer run release:minor
to create new release and bump minor versioncomposer run release:major
to create new release and bump major version
On develop branch run the following
git fetch --all
today=$(date +%d-%m-%Y)
git checkout -b $today-prep-release
composer run release:patch
git add composer.json
git add CHANGELOG.md
git commit -m "chore: $today prep release"
git push origin $today-prep-release
gh_pr
- Merge to dev
- create PR to merge to main
- Merge to main
- Tag a new release
- Deploy
external_id
has to be a string.
SELECT *
FROM key_figures k0_
WHERE k0_.provider = 'fts' AND k0_.year = '2023' AND JSON_EXTRACT(k0_.extra, '$.external_id') = '1116';
select distinct op.id, op.name, op.office_type from ocha_presence op inner join ocha_presence_external_id opei on op.id = opei.ocha_presence_id where provider_id = 'fts';
select distinct year from ocha_presence op inner join ocha_presence_external_id opei on op.id = opei.ocha_presence_id where provider_id = 'fts' and op.id = 'yem';
select kf.*
from ocha_presence op
inner join ocha_presence_external_id opei on op.id = opei.ocha_presence_id
inner join ocha_presence_external_id_external_lookup mtm on opei.id = mtm.ocha_presence_external_id_id
inner join external_lookup el on el.id = mtm.external_lookup_id
inner join key_figures kf on el.external_id = JSON_UNQUOTE(JSON_EXTRACT(kf.extra, '$.external_id'))
where provider_id = 'fts' and op.id = 'yem';