Files
simrsx-be/internal/use-case/_use-case-template/crud/tycovar.go
T
2025-08-18 13:02:14 +07:00

33 lines
1.2 KiB
Go

/*
DESCRIPTION:
A sample, part of the package that contains type, constants, and/or variables.
In this sample it also provides type and variable regarding the needs of the
middleware to separate from main use-case which has the basic CRUD
functionality. The purpose of this is to make the code more maintainable.
*/
package crud
import (
"gorm.io/gorm"
e "simrs-vx/internal/domain/main-entities/single"
)
type createMw func(input *e.CreateDto, data *e.Single, tx *gorm.DB) error
type readListMw func(input *e.ReadListDto, data *e.Single, tx *gorm.DB) error
type readDetailMw func(input *e.ReadDetailDto, data *e.Single, tx *gorm.DB) error
type updateMw func(input *e.ReadDetailDto, data *e.Single, tx *gorm.DB) error
type deleteMw func(input *e.ReadDetailDto, data *e.Single, tx *gorm.DB) error
var createPreMw []createMw // preprocess middleware
var createPostMw []createMw // postprocess middleware
var readListPreMw []readListMw // ..
var readListPostMw []readListMw // ..
var readDetailPreMw []readDetailMw
var readDetailPostMw []readDetailMw
var updatePreMw []readDetailMw
var updatePostMw []readDetailMw
var deletePreMw []readDetailMw
var deletePostMw []readDetailMw