/*
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 vehicle

import (
	"gorm.io/gorm"

	v "simrs-vx/internal/domain/main-entities/vehicle"
)

type createMw struct {
	Name string
	Func func(input *v.CreateDto, data *v.Vehicle, tx *gorm.DB) error
}

type readListMw struct {
	Name string
	Func func(input *v.ReadListDto, data *v.Vehicle, tx *gorm.DB) error
}

type readDetailMw struct {
	Name string
	Func func(input *v.ReadDetailDto, data *v.Vehicle, 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
