wms-be/modules/assignment/dto/assignment_dto.go

51 lines
1.9 KiB
Go

package dto
import pkgdto "github.com/Caknoooo/go-gin-clean-starter/pkg/dto"
const (
MESSAGE_FAILED_CREATE_ASSIGNMENT = "failed create assignment"
MESSAGE_SUCCESS_CREATE_ASSIGNMENT = "success create assignment"
MESSAGE_FAILED_GET_ASSIGNMENT = "failed get assignment"
MESSAGE_SUCCESS_GET_ASSIGNMENT = "success get assignment"
MESSAGE_FAILED_UPDATE_ASSIGNMENT = "failed update assignment"
MESSAGE_SUCCESS_UPDATE_ASSIGNMENT = "success update assignment"
MESSAGE_FAILED_DELETE_ASSIGNMENT = "failed delete assignment"
MESSAGE_SUCCESS_DELETE_ASSIGNMENT = "success delete assignment"
MESSAGE_FAILED_GET_DATA_FROM_BODY = "failed get data from body"
)
type AssignmentCreateRequest struct {
DocumentType string `json:"document_type" binding:"required"`
DocumentID string `json:"document_id" binding:"required"`
ClientID string `json:"client_id" binding:"required"`
AssignmentUsers []AssignmentUserCreateRequest `json:"assignment_users,omitempty" binding:"dive"`
}
type AssignmentUserCreateRequest struct {
TaskType string `json:"task_type"`
UserID string `json:"user_id"`
RoleID string `json:"role_id"`
ClientID string `json:"client_id"`
}
type AssignmentUpdateRequest struct {
DocumentType string `json:"document_type"`
DocumentID string `json:"document_id"`
}
type AssignmentResponse struct {
ID string `json:"id"`
DocumentType string `json:"document_type"`
DocumentID string `json:"document_id"`
Client pkgdto.IdNameResponse `json:"client"`
AssignmentUsers []AssignmentUserResponse `json:"assignment_users"`
}
type AssignmentUserResponse struct {
ID string `json:"id"`
TaskType string `json:"task_type"`
User pkgdto.IdNameResponse `json:"user"`
Role pkgdto.IdNameResponse `json:"role"`
Client pkgdto.IdNameResponse `json:"client"`
}