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

transactionにtitleを追加 #805

Merged
merged 8 commits into from
Dec 9, 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
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 @@
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")
}

Check warning on line 27 in ent/schema/transactiondetail.go

View check run for this annotation

Codecov / codecov/patch

ent/schema/transactiondetail.go#L26-L27

Added lines #L26 - L27 were not covered by tests
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