feat (encouter): not tested yet, also add crud for soapi, adime, sbar

This commit is contained in:
dpurbosakti
2025-09-08 15:18:41 +07:00
parent 1d069414d7
commit cc226b8034
30 changed files with 2264 additions and 2 deletions

No files matched your search

@@ -0,0 +1,44 @@
/*
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 soapi
import (
"gorm.io/gorm"
e "simrs-vx/internal/domain/main-entities/soapi"
)
type createMw struct {
Name string
Func func(input *e.CreateDto, data *e.Soapi, tx *gorm.DB) error
}
type readListMw struct {
Name string
Func func(input *e.ReadListDto, data *e.Soapi, tx *gorm.DB) error
}
type readDetailMw struct {
Name string
Func func(input *e.ReadDetailDto, data *e.Soapi, tx *gorm.DB) error
}
type UpdateMw = readDetailMw
type DeleteMw = readDetailMw
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