diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 82d0296..52a2bbe 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -4,9 +4,12 @@ on: push: branches: - 'main' + tags: + - 'v[0-9]+.[0-9]+.[0-9]+' jobs: - call_build-and-push-image: + call_build-and-push-image_latest: + if: startsWith(github.ref, 'refs/heads/') permissions: contents: read packages: write @@ -20,3 +23,19 @@ jobs: registry-user: ${{ github.actor }} secrets: registry-pass: ${{ secrets.GITHUB_TOKEN }} + + call_build-and-push-image_versioned: + if: startsWith(github.ref, 'refs/tags/v0.1.') + permissions: + contents: read + packages: write + uses: eurofurence/reg-workflows/.github/workflows/docker-build-push.yml@main + with: + image-name: ${{ github.repository }} + image-tags: ${{ github.ref_name }} v0.1 + full-repo-url: https://github.com/${{ github.repository }} + branch-or-tag-name: ${{ github.ref_name }} + commit-hash: ${{ github.sha }} + registry-user: ${{ github.actor }} + secrets: + registry-pass: ${{ secrets.GITHUB_TOKEN }} diff --git a/internal/entities/transaction.go b/internal/entities/transaction.go index 13cbcab..40bc376 100644 --- a/internal/entities/transaction.go +++ b/internal/entities/transaction.go @@ -30,11 +30,12 @@ const ( PaymentMethodTransfer PaymentMethod = "transfer" PaymentMethodInternal PaymentMethod = "internal" PaymentMethodGift PaymentMethod = "gift" + PaymentMethodCash PaymentMethod = "cash" ) func (p PaymentMethod) IsValid() bool { switch p { - case PaymentMethodCredit, PaymentMethodPaypal, PaymentMethodTransfer, PaymentMethodInternal, PaymentMethodGift: + case PaymentMethodCredit, PaymentMethodPaypal, PaymentMethodTransfer, PaymentMethodInternal, PaymentMethodGift, PaymentMethodCash: return true } @@ -64,7 +65,7 @@ type Transaction struct { DebitorID int64 `gorm:"index;type:bigint;NOT NULL"` TransactionID string `gorm:"uniqueIndex:idx_uq_tid;type:varchar(80) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;NOT NULL"` TransactionType TransactionType `gorm:"type:enum('due', 'payment')"` - PaymentMethod PaymentMethod `gorm:"type:enum('credit', 'paypal', 'transfer', 'internal', 'gift')"` + PaymentMethod PaymentMethod `gorm:"type:enum('credit', 'paypal', 'transfer', 'internal', 'gift', 'cash')"` PaymentStartUrl string `gorm:"type:text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;default:NULL"` TransactionStatus TransactionStatus `gorm:"type:enum('tentative', 'pending', 'valid', 'deleted')"` Amount Amount `gorm:"embedded"` diff --git a/internal/entities/transactionlog.go b/internal/entities/transactionlog.go index 50e71f4..3a4bfa8 100644 --- a/internal/entities/transactionlog.go +++ b/internal/entities/transactionlog.go @@ -23,7 +23,7 @@ type TransactionLog struct { DebitorID int64 `gorm:"index;type:bigint;NOT NULL"` TransactionID string `gorm:"index;type:varchar(80) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;NOT NULL"` TransactionType TransactionType `gorm:"type:enum('due', 'payment')"` - PaymentMethod PaymentMethod `gorm:"type:enum('credit', 'paypal', 'transfer', 'internal', 'gift')"` + PaymentMethod PaymentMethod `gorm:"type:enum('credit', 'paypal', 'transfer', 'internal', 'gift', 'cash')"` PaymentStartUrl string `gorm:"type:text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;default:NULL"` TransactionStatus TransactionStatus `gorm:"type:enum('tentative', 'pending', 'valid', 'deleted')"` Amount Amount `gorm:"embedded"` diff --git a/internal/logging/logging.go b/internal/logging/logging.go index 4b52189..002e0cb 100644 --- a/internal/logging/logging.go +++ b/internal/logging/logging.go @@ -64,6 +64,7 @@ func SetupLogging(applicationName string, useEcsLogging bool) { aulogging.RequestIdRetriever = GetRequestID if useEcsLogging { auzerolog.SetupJsonLogging(applicationName) + zerolog.TimeFieldFormat = "2006-01-02T15:04:05.000Z" } else { aulogging.DefaultRequestIdValue = defaultReqId auzerolog.SetupPlaintextLogging()