@@ -29,6 +29,8 @@ type EventRepository interface {
2929 GetEventPay (ctx context.Context , orderNo string ) (data EventPay , err error )
3030 UpdateRegistrationEvent (ctx context.Context , event RegistrationEvent ) error
3131 UpdateEvent (ctx context.Context , event Event ) error
32+ ListRegistrationByEvent (ctx context.Context , eventID uint , pagination FilterPagination ) (data []RegistrationEvent , totalCount int64 , err error )
33+ GetRegistrationEventByID (ctx context.Context , id uint ) (data RegistrationEvent , err error )
3234}
3335
3436type EventUsecase interface {
@@ -44,6 +46,8 @@ type EventUsecase interface {
4446 ListRegistration (ctx context.Context , filter EventFilter ) (resp []RegistrationEvent , pagination Pagination , err error )
4547 ListEventPay (ctx context.Context , filter EventFilter ) (data []EventPay , pagination Pagination , err error )
4648 PayProcess (ctx context.Context , payload PayProcessPayload ) error
49+ ListRegistrationByEvent (ctx context.Context , eventID uint , filterPagination FilterPagination ) (data []EventRegistrationDTO , pagination Pagination , err error )
50+ UpdateRegistrationStatus (ctx context.Context , registrationID uint , payload UpdateRegistrationStatusRequest ) error
4751}
4852
4953type EventHandler interface {
@@ -60,6 +64,8 @@ type EventHandler interface {
6064 ListEventPay (w http.ResponseWriter , r * http.Request )
6165 PayProcess (w http.ResponseWriter , r * http.Request )
6266 UpdateEvent (w http.ResponseWriter , r * http.Request )
67+ ListRegistrationByEvent (w http.ResponseWriter , r * http.Request )
68+ UpdateRegistrationStatus (w http.ResponseWriter , r * http.Request )
6369}
6470
6571type Event struct {
@@ -197,7 +203,7 @@ type EventAdminDTO struct {
197203 ReservationStartDate null.Time `json:"reservation_start_date"`
198204 ReservationEndDate null.Time `json:"reservation_end_date"`
199205 // AdditionalLink string `json:"additional_link"`
200- SessionType string `json:"session_type"`
206+ SessionType string `json:"session_type"`
201207}
202208
203209type UpdateEvenPayload struct {
@@ -238,57 +244,12 @@ func (EventPay) TableName() string {
238244 return "event_pays"
239245}
240246
241- type RegisterEventPayload struct {
242- EventID uint `json:"event_id"`
243- UserID string `json:"user_id"`
244- Name string `json:"name"`
245- Email string `json:"email"`
246- PhoneNumber string `json:"phone_number"`
247- ImageProofPayment string `json:"image_proof_payment"`
248- NetAmount float64 `json:"net_amount"`
249- }
250-
251- type RegistrationEvent struct {
252- ID uint `json:"id" gorm:"primarykey"`
253- OrderNo string `json:"order_no"`
254- EventID uint `json:"event_id"` // lock event
255- UserID string `json:"user_id"` // lock user
256- ImageProofPayment string `json:"image_proof_payment"`
257- PaymentDate null.Time `json:"payment_date"`
258- Status string `json:"status"` // register, pay, approve/cancel/decline
259- UpToYou string `json:"-"`
260- CreatedByUserID int `json:"-"`
261- UpdatedByUserID int `json:"-"`
262- DeletedByUserID int `json:"-"`
263- CreatedAt time.Time `json:"created_at"`
264- UpdatedAt null.Time `json:"-"`
265- DeletedAt null.Time `json:"-"`
266- Event Event `json:"event_detail" gorm:"foreignKey:EventID"`
267- }
268-
269- func (RegistrationEvent ) TableName () string {
270- return "registration_events"
271- }
272-
273- type RegistrationEventDTO struct {
274- OrderNo string `json:"order_no"`
275- }
276-
277- type RegisterEventResponse struct {
278- OrderNo string `json:"order_no"`
279- }
280-
281247type EventPayPayload struct {
282248 OrderNo string `json:"order_no"`
283249 ImageProofPayment string `json:"image_proof_payment"`
284250 NetAmount float64 `json:"net_amount"`
285251}
286252
287- type RegisterStatusResponse struct {
288- OrderNo string `json:"order_no"`
289- Status string `json:"string"`
290- }
291-
292253type PayProcessPayload struct {
293254 OrderNo string `json:"order_no"`
294255 Status string `json:"status"`
@@ -319,12 +280,12 @@ func (e Event) ToDTO() EventDTO {
319280
320281func (e Event ) ToAdminDTO () EventAdminDTO {
321282 id := int (e .ID )
322-
283+
323284 tags := make ([]string , len (e .Tags ))
324285 for i , tag := range e .Tags {
325286 tags [i ] = tag .Tag
326287 }
327-
288+
328289 speakers := make ([]string , len (e .Speakers ))
329290 for i , speaker := range e .Speakers {
330291 speakers [i ] = speaker .Name
@@ -350,6 +311,6 @@ func (e Event) ToAdminDTO() EventAdminDTO {
350311 ReservationStartDate : e .ReservationStartDate ,
351312 ReservationEndDate : e .ReservationEndDate ,
352313 // AdditionalLink: e.AdditionalLink,
353- SessionType : e .SessionType ,
314+ SessionType : e .SessionType ,
354315 }
355316}
0 commit comments