Skip to content

Commit

Permalink
Merge branch 'develop' into feature/dark-mode
Browse files Browse the repository at this point in the history
  • Loading branch information
tuj authored Jun 25, 2024
2 parents fcc7f0c + be5adfe commit 9fc9107
Show file tree
Hide file tree
Showing 62 changed files with 2,310 additions and 70 deletions.
41 changes: 39 additions & 2 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,12 @@ API_SERVICE_SPRINT_NAME_REGEX="/(?<weeks>(?:-?\d+-?)*)\.(?<year>\d+)$/"
APP_WEEK_GOAL_LOW=25.0
APP_WEEK_GOAL_HIGH=34.5
APP_INVOICE_SUPPLIER_ACCOUNT=APP_INVOICE_SUPPLIER_ACCOUNT
APP_INVOICE_RECEIVER_DEFAULT_ACCOUNT=APP_INVOICE_DEFAULT_RECEIVER_ACCOUNT
APP_INVOICE_DESCRIPTION_TEMPLATE="Spørgsmål vedrørende fakturaen rettes til %name%, %email%."
APP_PROJECT_BILLING_DEFAULT_DESCRIPTION=
APP_DEFAULT_PLANNING_DATA_PROVIDER=
APP_HTTP_CLIENT_RETRY_DELAY_MS=1000
APP_HTTP_CLIENT_MAX_RETRIES=3
APP_DEFAULT_DATA_PROVIDER=

###< Planning ###

###> itk-dev/openid-connect-bundle ###
Expand Down Expand Up @@ -56,3 +58,38 @@ OIDC_CLI_LOGIN_ROUTE=index
CLIENT_STANDARD_PRICE=705.00

DEFAULT_URI=https://economics.local.itkdev.dk/

PRODUCT_QUANTITY_SCALE=2

# Invoice entry accounts.
# Must be a valid JSON object mapping account IDs to a account metadata.
#
# Requirements;
#
# * At least one account must be defined.
# * "label" is required.
# * One and only one account must be "default" (a single account will be
# "default")
# * If more than one account is defined, one and only one account must be
# "product".
# * The "product" account cannot be "default"
#
# INVOICE_ENTRY_ACCOUNTS='{
# "test": {
# "label": "Test account"
# },
# "account-87": {
# "label": "The default account",
# "default": true
# },
# "product": {
# "label": "The real PSP element",
# "product": true
# }
# }'
#
INVOICE_ENTRY_ACCOUNTS='{
"Define INVOICE_ENTRY_ACCOUNTS in .env.local": {
"label": "Define INVOICE_ENTRY_ACCOUNTS in .env.local"
}
}'
7 changes: 6 additions & 1 deletion .env.test
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,10 @@ PANTHER_ERROR_SCREENSHOT_DIR=./var/error-screenshots
DATABASE_URL="mysql://root:password@mariadb:3306/db_test?serverVersion=10.9.3-MariaDB&charset=utf8mb4"

APP_INVOICE_SUPPLIER_ACCOUNT=1111
APP_INVOICE_RECEIVER_DEFAULT_ACCOUNT="XG-0000000000-00000"
APP_PROJECT_BILLING_DEFAULT_DESCRIPTION="Beskrivelse"

INVOICE_ENTRY_ACCOUNTS='{
"test": {
"label": "test"
}
}'
19 changes: 18 additions & 1 deletion .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,24 @@ jobs:
MYSQL_PASSWORD: db
MYSQL_DATABASE: db_test
MYSQL_ROOT_PASSWORD: password
options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=3
# https://mariadb.org/mariadb-server-docker-official-images-healthcheck-without-mysqladmin/
# healthcheck:
# test: [ "CMD", "healthcheck.sh", "--connect", "--innodb_initialized" ]
# start_period: 1m
# start_interval: 10s
# interval: 5s
# timeout: 2s
# retries: 3
#
# Actions report
#
# The workflow is not valid. .github/workflows/pr.yml (Line: 17, Col: 17): Unexpected value 'healthcheck'
#
options: >-
--health-cmd="healthcheck.sh --connect --innodb_initialized"
--health-interval=5s
--health-timeout=2s
--health-retries=3
strategy:
fail-fast: false
matrix:
Expand Down
29 changes: 28 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,32 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

* [PR-133](https://github.com/itk-dev/economics/pull/133)
1742: Simplified hour report form.
* [PR-132](https://github.com/itk-dev/economics/pull/132)
1742: Fixed synchronization issues.
* [PR-128](https://github.com/itk-dev/economics/pull/128)
1595: Added retryable http client decorator for handling rate limiting.
* [PR-117](https://github.com/itk-dev/economics/pull/117)
1211: Added hour report
NOTE: APP_DEFAULT_PLANNING_DATA_PROVIDER has been changed to APP_DEFAULT_DATA_PROVIDER. This has to be changed when releasing.
* [PR-124](https://github.com/itk-dev/economics/pull/124)
710: Added workload report

## [2.3.0] - 2024-06-03

* [PR-126](https://github.com/itk-dev/economics/pull/126)
1590: Added worklog product as prefix on product invoice entries
* [PR-125](https://github.com/itk-dev/economics/pull/125)
1547: Set account based on invoice entry type
* [PR-123](https://github.com/itk-dev/economics/pull/123)
1544: Allowed invoicing issues with products and no worklogs
* [PR-122](https://github.com/itk-dev/economics/pull/122)
1547: Added invoice entry account selector
* [PR-121](https://github.com/itk-dev/economics/pull/121)
1485: Fixed floating number issues
* [PR-120](https://github.com/itk-dev/economics/pull/120)
1484: Cleaned up worklog cleanup
* [PR-118](https://github.com/itk-dev/economics/pull/118)
1485: Made product quantity floatable

Expand Down Expand Up @@ -245,7 +271,8 @@ complete process.
* Updated to authorization code flow.
* Changed worklog save button styling to be sticky.

[Unreleased]: https://github.com/itk-dev/economics/compare/2.2.0...HEAD
[Unreleased]: https://github.com/itk-dev/economics/compare/2.3.0...HEAD
[2.3.0]: https://github.com/itk-dev/economics/compare/2.2.0...2.3.0
[2.2.0]: https://github.com/itk-dev/economics/compare/2.1.2...2.2.0
[2.1.2]: https://github.com/itk-dev/economics/compare/2.1.1...2.1.2
[2.1.1]: https://github.com/itk-dev/economics/compare/2.1.0...2.1.1
Expand Down
18 changes: 14 additions & 4 deletions assets/styles/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,10 @@
@apply grid gap-3 mb-6 md:grid-cols-4;
}

#hour_report {
@apply grid gap-3 mb-6 md:grid-cols-6;
}

.form-default {
@apply grid gap-3 mb-6 md:grid-cols-6;
}
Expand All @@ -152,7 +156,7 @@
@apply flex flex-col justify-end;
}

#sprint_report > div {
#sprint_report > div, #hour_report > div {
@apply flex flex-col;
}

Expand All @@ -167,7 +171,13 @@
.subheading {
@apply font-medium leading-tight text-2xl mt-5 mb-5;
}

.hour-report-submit {
@apply mt-6;
}
.label.required::after {
content: '*';
@apply text-red-500 ml-1;
}
/*
** Alerts
*/
Expand Down Expand Up @@ -371,7 +381,7 @@
*/

.navigation-item {
@apply flex items-center p-2 text-base font-normal rounded-lg hover:bg-gray-100 hover:dark:bg-gray-500;
@apply flex items-center p-2 text-base font-normal rounded-lg hover:bg-gray-100 hover:dark:bg-gray-500 cursor-pointer;
}

.navigation-item.current {
Expand All @@ -383,7 +393,7 @@
}

.navigation-item-submenu.shown {
@apply flex flex-col visible pt-1 gap-y-1 px-10;
@apply flex flex-col visible pt-1 gap-y-1 pl-5;
}

.collapsible:has(+ .navigation-item-submenu):after {
Expand Down
1 change: 1 addition & 0 deletions config/packages/twig.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ twig:
format: 'd.m.Y'
globals:
view_controller: '@App\Controller\ViewController'
invoice_entry_helper: '@App\Service\InvoiceEntryHelper'

when@test:
twig:
Expand Down
15 changes: 13 additions & 2 deletions config/services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,8 @@ services:
bind:
$defaultInvoiceDescriptionTemplate: '%env(APP_INVOICE_DESCRIPTION_TEMPLATE)%'
$invoiceSupplierAccount: '%env(string:APP_INVOICE_SUPPLIER_ACCOUNT)%'
$invoiceDefaultReceiverAccount: '%env(string:APP_INVOICE_RECEIVER_DEFAULT_ACCOUNT)%'
$projectBillingDefaultDescription: '%env(string:APP_PROJECT_BILLING_DEFAULT_DESCRIPTION)%'
$planningDefaultDataProvider: '%env(string:APP_DEFAULT_PLANNING_DATA_PROVIDER)%'
$defaultDataProvider: '%env(string:APP_DEFAULT_DATA_PROVIDER)%'

# makes classes in src/ available to be used as services
# this creates a service per class whose id is the fully-qualified class name
Expand All @@ -43,9 +42,21 @@ services:
$weekGoalLow: '%env(float:APP_WEEK_GOAL_LOW)%'
$weekGoalHigh: '%env(float:APP_WEEK_GOAL_HIGH)%'
$sprintNameRegex: '%env(API_SERVICE_SPRINT_NAME_REGEX)%'
$httpClientRetryDelayMs: '%env(int:APP_HTTP_CLIENT_RETRY_DELAY_MS)%'
$httpClientMaxRetries: '%env(int:APP_HTTP_CLIENT_MAX_RETRIES)%'

App\Service\ClientHelper:
arguments:
$options:
standard_price: '%env(float:CLIENT_STANDARD_PRICE)%'

App\Controller\IssueController:
arguments:
$options:
issue_product_type_options:
quantity_scale: '%env(int:PRODUCT_QUANTITY_SCALE)%'

App\Service\InvoiceEntryHelper:
arguments:
$options:
accounts: '%env(json:INVOICE_ENTRY_ACCOUNTS)%'
31 changes: 31 additions & 0 deletions migrations/Version20240530104522.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php

declare(strict_types=1);

namespace DoctrineMigrations;

use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;

/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20240530104522 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}

public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE issue ADD plan_hours DOUBLE PRECISION DEFAULT NULL, ADD hours_remaining DOUBLE PRECISION DEFAULT NULL');
}

public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE issue DROP plan_hours, DROP hours_remaining');
}
}
35 changes: 35 additions & 0 deletions migrations/Version20240530115938.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?php

declare(strict_types=1);

namespace DoctrineMigrations;

use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;

/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20240530115938 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}

public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE issue_product ADD invoice_entry_id INT DEFAULT NULL, ADD is_billed TINYINT(1) DEFAULT NULL');
$this->addSql('ALTER TABLE issue_product ADD CONSTRAINT FK_76B2414CA51E131A FOREIGN KEY (invoice_entry_id) REFERENCES invoice_entry (id) ON DELETE SET NULL');
$this->addSql('CREATE INDEX IDX_76B2414CA51E131A ON issue_product (invoice_entry_id)');
}

public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE issue_product DROP FOREIGN KEY FK_76B2414CA51E131A');
$this->addSql('DROP INDEX IDX_76B2414CA51E131A ON issue_product');
$this->addSql('ALTER TABLE issue_product DROP invoice_entry_id, DROP is_billed');
}
}
49 changes: 49 additions & 0 deletions migrations/Version20240531125801.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<?php

declare(strict_types=1);

namespace DoctrineMigrations;

use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;

/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20240531125801 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}

public function up(Schema $schema): void
{
// Add product from preceding worklog invoice entry as prefix on product entries.
$this->addSql(<<<'SQL'
UPDATE
invoice_entry
SET
product = CONCAT(
IF(
ISNULL(
-- Get "product" from preceding worklog entry (this expression is repeated below).
(SELECT product FROM invoice_entry AS ie WHERE ie.invoice_id = invoice_entry.invoice_id AND ie.entry_type = 'worklog' AND ie.entry_index < invoice_entry.entry_index ORDER BY ie.entry_index DESC LIMIT 1)
),
'',
CONCAT(
(SELECT product FROM invoice_entry AS ie WHERE ie.invoice_id = invoice_entry.invoice_id AND ie.entry_type = 'worklog' AND ie.entry_index < invoice_entry.entry_index ORDER BY ie.entry_index DESC LIMIT 1),
': '
)
),
product
)
WHERE entry_type = 'product'
SQL);
}

public function down(Schema $schema): void
{
// There is not going back (or down)!
}
}
31 changes: 31 additions & 0 deletions migrations/Version20240610110230.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php

declare(strict_types=1);

namespace DoctrineMigrations;

use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;

/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20240610110230 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}

public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE TABLE worker (id INT AUTO_INCREMENT NOT NULL, email VARCHAR(180) NOT NULL, workload DOUBLE PRECISION NOT NULL, UNIQUE INDEX UNIQ_9FB2BF62E7927C74 (email), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
}

public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('DROP TABLE worker');
}
}
Loading

0 comments on commit 9fc9107

Please sign in to comment.