Skip to content

Commit

Permalink
Merge pull request #805 from traPtitech/tx-title
Browse files Browse the repository at this point in the history
transactionにtitleを追加
  • Loading branch information
H1rono authored Dec 9, 2024
2 parents 31fc9cf + 15ed51a commit 7a76319
Show file tree
Hide file tree
Showing 19 changed files with 407 additions and 73 deletions.
3 changes: 2 additions & 1 deletion ent/migrate/schema.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

56 changes: 55 additions & 1 deletion ent/mutation.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 23 additions & 4 deletions ent/runtime.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions ent/schema/transactiondetail.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package schema

import (
"errors"
"strings"
"time"

"entgo.io/ent"
Expand All @@ -19,6 +21,12 @@ func (TransactionDetail) Fields() []ent.Field {
return []ent.Field{
field.UUID("id", uuid.UUID{}).
Default(uuid.New),
field.String("title").NotEmpty().MaxLen(64).Validate(func(s string) error {
if strings.Contains(s, "\n") {
return errors.New("title cannot contain new line")
}
return nil
}),
field.Int("amount").
Default(0),
field.String("target").
Expand Down
13 changes: 12 additions & 1 deletion ent/transactiondetail.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions ent/transactiondetail/transactiondetail.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

70 changes: 70 additions & 0 deletions ent/transactiondetail/where.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions ent/transactiondetail_create.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 7a76319

Please sign in to comment.