Skip to content

Commit

Permalink
[go] update schema to support new upfc site.
Browse files Browse the repository at this point in the history
**Summary**

two changes are introduced.

- add 'BeforeLottery' to Hpfceventfcticketstatus enum, and we are going to deprecate 'Submitted'.
- add 'HPEventFCTicketSite' enum to support new upfc site.

**Test**

- go test
- go run ./cmd/ --prod ent productionize

````
ALTER TABLE `hpfc_event_tickets` MODIFY COLUMN `status` enum('BeforeLottery','Completed','PaymentOverdue','PendingPayment','Rejected','Submitted','Unknown') NOT NULL DEFAULT 'Submitted', ADD COLUMN `application_site` enum('helloproject','mline') NOT NULL DEFAULT 'helloproject';
ALTER TABLE `test_ents` AUTO_INCREMENT 111669149696;
-------------------------------------------------
Target Database mysql
Are you sure to run SQL above? (y/N)>
````

**Issue**

- N/A
  • Loading branch information
yssk22 committed Nov 12, 2024
1 parent 1183867 commit 02817ac
Show file tree
Hide file tree
Showing 21 changed files with 428 additions and 9 deletions.
7 changes: 7 additions & 0 deletions go/graphql/v3/generated/ent.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -207,13 +207,20 @@ type HPFCEventTicket implements Node {
fcMemberSha256: String!
applicationTitle: String!
applicationID: String
applicationSite: HPFCEventTicketHPEventFCTicketSite!
applicationStartDate: Time
applicationDueDate: Time
paymentStartDate: Time
paymentDueDate: Time
}
"""HPFCEventTicketHPEventFCTicketSite is enum for the field application_site"""
enum HPFCEventTicketHPEventFCTicketSite @goModel(model: "github.com/yssk22/hpapp/go/service/schema/enums.HPEventFCTicketSite") {
helloproject
mline
}
"""HPFCEventTicketHPEventFCTicketStatus is enum for the field status"""
enum HPFCEventTicketHPEventFCTicketStatus @goModel(model: "github.com/yssk22/hpapp/go/service/schema/enums.HPEventFCTicketStatus") {
BeforeLottery
Completed
PaymentOverdue
PendingPayment
Expand Down
93 changes: 92 additions & 1 deletion go/graphql/v3/generated/exec_generated.go

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

7 changes: 7 additions & 0 deletions go/graphql/v3/generated/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ input HPFollowUpsertParamsInput @goModel(model: "github.com/yssk22/hpapp/go/serv
input UpsertEventsParamsInput @goModel(model: "github.com/yssk22/hpapp/go/service/helloproject/upfc.UpsertEventsParams") {
fcMemberSha256: String!
userId: Int!
site: HPEventFCTicketSite!
applications: [EventTicketApplicationInput!]
}

Expand All @@ -79,6 +80,11 @@ enum HPFollowType @goModel(model: "github.com/yssk22/hpapp/go/service/schema/enu
unfollow
}

enum HPEventFCTicketSite @goModel(model: "github.com/yssk22/hpapp/go/service/schema/enums.HPEventFCTicketSite") {
hello_project
m_line
}

input EventTicketApplicationInput @goModel(model: "github.com/yssk22/hpapp/go/service/helloproject/upfc.EventTicketApplication") {
title: String!
openAt: Time
Expand All @@ -94,6 +100,7 @@ input EventTicketApplicationInput @goModel(model: "github.com/yssk22/hpapp/go/se
}

enum HPEventFCTicketStatus @goModel(model: "github.com/yssk22/hpapp/go/service/schema/enums.HPEventFCTicketStatus") {
before_lottery
completed
payment_overdue
pending_payment
Expand Down
6 changes: 6 additions & 0 deletions go/service/ent/entql.go

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

5 changes: 5 additions & 0 deletions go/service/ent/gql_collection.go

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

13 changes: 12 additions & 1 deletion go/service/ent/hpfceventticket.go

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

29 changes: 28 additions & 1 deletion go/service/ent/hpfceventticket/hpfceventticket.go

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

30 changes: 30 additions & 0 deletions go/service/ent/hpfceventticket/where.go

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

Loading

0 comments on commit 02817ac

Please sign in to comment.