Skip to content

Commit

Permalink
Merge pull request #109 from eurofurence/issue-105-prep
Browse files Browse the repository at this point in the history
Issue 105 prep
  • Loading branch information
Jumpy-Squirrel authored Jan 13, 2024
2 parents f8d04e2 + 5cf6a89 commit 59a518a
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 4 deletions.
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

0 comments on commit 59a518a

Please sign in to comment.