Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue 105 prep #109

Merged
merged 4 commits into from
Jan 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 }}
5 changes: 3 additions & 2 deletions internal/entities/transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down Expand Up @@ -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"`
Expand Down
2 changes: 1 addition & 1 deletion internal/entities/transactionlog.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down
1 change: 1 addition & 0 deletions internal/logging/logging.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
Loading