feat: update request for informations
This commit is contained in:
parent
03310253f1
commit
a0bd1c9bc6
|
|
@ -12,18 +12,18 @@ type RequestForInformationItemsGeneric interface {
|
|||
}
|
||||
|
||||
type RequestForInformationItemsQueryRequest struct {
|
||||
RequestForInformationId *int `json:"request_for_information_id"`
|
||||
RequestedInfo *string `json:"requested_info"`
|
||||
RequestForInformationId *int `json:"requestForInformationId"`
|
||||
RequestedInfo *string `json:"requestedInfo"`
|
||||
Reason *string `json:"reason"`
|
||||
StatusId *int `json:"status_id"`
|
||||
StatusId *int `json:"statusId"`
|
||||
Pagination *paginator.Pagination `json:"pagination"`
|
||||
}
|
||||
|
||||
type RequestForInformationItemsCreateRequest struct {
|
||||
RequestForInformationId int `json:"request_for_information_id" validate:"required"`
|
||||
RequestedInfo string `json:"requested_info" validate:"required"`
|
||||
RequestForInformationId int `json:"requestForInformationId" validate:"required"`
|
||||
RequestedInfo string `json:"requestedInfo" validate:"required"`
|
||||
Reason string `json:"reason" validate:"required"`
|
||||
StatusId int `json:"status_id" validate:"required"`
|
||||
StatusId int `json:"statusId" validate:"required"`
|
||||
}
|
||||
|
||||
func (req RequestForInformationItemsCreateRequest) ToEntity() *entity.RequestForInformationItems {
|
||||
|
|
@ -38,10 +38,10 @@ func (req RequestForInformationItemsCreateRequest) ToEntity() *entity.RequestFor
|
|||
|
||||
type RequestForInformationItemsUpdateRequest struct {
|
||||
ID uint `json:"id" validate:"required"`
|
||||
RequestForInformationId int `json:"request_for_information_id" validate:"required"`
|
||||
RequestedInfo string `json:"requested_info" validate:"required"`
|
||||
RequestForInformationId int `json:"requestForInformationId" validate:"required"`
|
||||
RequestedInfo string `json:"requestedInfo" validate:"required"`
|
||||
Reason string `json:"reason" validate:"required"`
|
||||
StatusId int `json:"status_id" validate:"required"`
|
||||
StatusId int `json:"statusId" validate:"required"`
|
||||
}
|
||||
|
||||
func (req RequestForInformationItemsUpdateRequest) ToEntity() *entity.RequestForInformationItems {
|
||||
|
|
@ -56,10 +56,10 @@ func (req RequestForInformationItemsUpdateRequest) ToEntity() *entity.RequestFor
|
|||
}
|
||||
|
||||
type RequestForInformationItemsQueryRequestContext struct {
|
||||
RequestForInformationId string `json:"request_for_information_id"`
|
||||
RequestedInfo string `json:"requested_info"`
|
||||
RequestForInformationId string `json:"requestForInformationId"`
|
||||
RequestedInfo string `json:"requestedInfo"`
|
||||
Reason string `json:"reason"`
|
||||
StatusId string `json:"status_id"`
|
||||
StatusId string `json:"statusId"`
|
||||
}
|
||||
|
||||
func (req RequestForInformationItemsQueryRequestContext) ToParamRequest() RequestForInformationItemsQueryRequest {
|
||||
|
|
|
|||
|
|
@ -4,11 +4,11 @@ import "time"
|
|||
|
||||
type RequestForInformationItemsResponse struct {
|
||||
ID uint `json:"id"`
|
||||
RequestForInformationId int `json:"request_for_information_id"`
|
||||
RequestedInfo string `json:"requested_info"`
|
||||
RequestForInformationId int `json:"requestForInformationId"`
|
||||
RequestedInfo string `json:"requestedInfo"`
|
||||
Reason string `json:"reason"`
|
||||
StatusId int `json:"status_id"`
|
||||
IsActive *bool `json:"is_active"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
StatusId int `json:"statusId"`
|
||||
IsActive *bool `json:"isActive"`
|
||||
CreatedAt time.Time `json:"createdAt"`
|
||||
UpdatedAt time.Time `json:"updatedAt"`
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,25 +12,26 @@ type RequestForInformationObjectionGeneric interface {
|
|||
}
|
||||
|
||||
type RequestForInformationObjectionQueryRequest struct {
|
||||
RequestForInformationId *uint `json:"request_for_information_id"`
|
||||
DocumentName *string `json:"document_name"`
|
||||
MainReason *string `json:"main_reason"`
|
||||
SecondaryReason *string `json:"secondary_reason"`
|
||||
CreatedById *uint `json:"created_by_id"`
|
||||
StatusId *int `json:"status_id"`
|
||||
RequestForInformationId *uint `json:"requestForInformationId"`
|
||||
DocumentName *string `json:"documentName"`
|
||||
MainReason *string `json:"mainReason"`
|
||||
SecondaryReason *string `json:"secondaryReason"`
|
||||
CreatedById *int `json:"createdById"`
|
||||
StatusId *int `json:"statusId"`
|
||||
Pagination *paginator.Pagination `json:"pagination"`
|
||||
}
|
||||
|
||||
type RequestForInformationObjectionCreateRequest struct {
|
||||
RequestForInformationId uint `json:"request_for_information_id" validate:"required"`
|
||||
DocumentName string `json:"document_name" validate:"required"`
|
||||
MainReason string `json:"main_reason" validate:"required"`
|
||||
SecondaryReason string `json:"secondary_reason" validate:"required"`
|
||||
StatusId int `json:"status_id" validate:"required"`
|
||||
RequestForInformationId uint `json:"requestForInformationId" validate:"required"`
|
||||
DocumentName string `json:"documentName" validate:"required"`
|
||||
MainReason string `json:"mainReason" validate:"required"`
|
||||
SecondaryReason string `json:"secondaryReason" validate:"required"`
|
||||
StatusId int `json:"statusId" validate:"required"`
|
||||
}
|
||||
|
||||
func (req RequestForInformationObjectionCreateRequest) ToEntity() *entity.RequestForInformationObjection {
|
||||
return &entity.RequestForInformationObjection{
|
||||
RequestForInformationId: req.RequestForInformationId,
|
||||
DocumentName: req.DocumentName,
|
||||
MainReason: req.MainReason,
|
||||
SecondaryReason: req.SecondaryReason,
|
||||
|
|
@ -41,11 +42,11 @@ func (req RequestForInformationObjectionCreateRequest) ToEntity() *entity.Reques
|
|||
|
||||
type RequestForInformationObjectionUpdateRequest struct {
|
||||
ID uint `json:"id" validate:"required"`
|
||||
RequestForInformationId uint `json:"request_for_information_id" validate:"required"`
|
||||
DocumentName string `json:"document_name" validate:"required"`
|
||||
MainReason string `json:"main_reason" validate:"required"`
|
||||
SecondaryReason string `json:"secondary_reason" validate:"required"`
|
||||
StatusId int `json:"status_id" validate:"required"`
|
||||
RequestForInformationId uint `json:"requestForInformationId" validate:"required"`
|
||||
DocumentName string `json:"documentName" validate:"required"`
|
||||
MainReason string `json:"mainReason" validate:"required"`
|
||||
SecondaryReason string `json:"secondaryReason" validate:"required"`
|
||||
StatusId int `json:"statusId" validate:"required"`
|
||||
}
|
||||
|
||||
func (req RequestForInformationObjectionUpdateRequest) ToEntity() *entity.RequestForInformationObjection {
|
||||
|
|
@ -61,12 +62,12 @@ func (req RequestForInformationObjectionUpdateRequest) ToEntity() *entity.Reques
|
|||
}
|
||||
|
||||
type RequestForInformationObjectionQueryRequestContext struct {
|
||||
RequestForInformationId string `json:"request_for_information_id"`
|
||||
DocumentName string `json:"document_name"`
|
||||
MainReason string `json:"main_reason"`
|
||||
SecondaryReason string `json:"secondary_reason"`
|
||||
CreatedById string `json:"created_by_id"`
|
||||
StatusId string `json:"status_id"`
|
||||
RequestForInformationId string `json:"requestForInformationId"`
|
||||
DocumentName string `json:"documentName"`
|
||||
MainReason string `json:"mainReason"`
|
||||
SecondaryReason string `json:"secondaryReason"`
|
||||
CreatedById string `json:"createdById"`
|
||||
StatusId string `json:"statusId"`
|
||||
}
|
||||
|
||||
func (req RequestForInformationObjectionQueryRequestContext) ToParamRequest() RequestForInformationObjectionQueryRequest {
|
||||
|
|
@ -91,8 +92,7 @@ func (req RequestForInformationObjectionQueryRequestContext) ToParamRequest() Re
|
|||
if createdByIdStr := req.CreatedById; createdByIdStr != "" {
|
||||
createdById, err := strconv.Atoi(createdByIdStr)
|
||||
if err == nil {
|
||||
createdByIdUint := uint(createdById)
|
||||
request.CreatedById = &createdByIdUint
|
||||
request.CreatedById = &createdById
|
||||
}
|
||||
}
|
||||
if statusIdStr := req.StatusId; statusIdStr != "" {
|
||||
|
|
|
|||
|
|
@ -4,13 +4,13 @@ import "time"
|
|||
|
||||
type RequestForInformationObjectionResponse struct {
|
||||
ID uint `json:"id"`
|
||||
RequestForInformationId uint `json:"request_for_information_id"`
|
||||
DocumentName string `json:"document_name"`
|
||||
MainReason string `json:"main_reason"`
|
||||
SecondaryReason string `json:"secondary_reason"`
|
||||
CreatedById uint `json:"created_by_id"`
|
||||
StatusId int `json:"status_id"`
|
||||
IsActive *bool `json:"is_active"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
RequestForInformationId uint `json:"requestForInformationId"`
|
||||
DocumentName string `json:"documentName"`
|
||||
MainReason string `json:"mainReason"`
|
||||
SecondaryReason string `json:"secondaryReason"`
|
||||
CreatedById uint `json:"createdById"`
|
||||
StatusId int `json:"statusId"`
|
||||
IsActive *bool `json:"isActive"`
|
||||
CreatedAt time.Time `json:"createdAt"`
|
||||
UpdatedAt time.Time `json:"updatedAt"`
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,18 +12,19 @@ type RequestForInformationRepliesGeneric interface {
|
|||
}
|
||||
|
||||
type RequestForInformationRepliesQueryRequest struct {
|
||||
RequestForInformationItemId *int `json:"request_for_information_item_id"`
|
||||
FileUrl *string `json:"file_url"`
|
||||
RequestForInformationItemId *int `json:"requestForInformationItemId"`
|
||||
FileUrl *string `json:"fileUrl"`
|
||||
Response *string `json:"response"`
|
||||
StatusId *int `json:"status_id"`
|
||||
StatusId *int `json:"statusId"`
|
||||
CreatedById *int `json:"createdById"`
|
||||
Pagination *paginator.Pagination `json:"pagination"`
|
||||
}
|
||||
|
||||
type RequestForInformationRepliesCreateRequest struct {
|
||||
RequestForInformationItemId int `json:"request_for_information_item_id" validate:"required"`
|
||||
FileUrl string `json:"file_url" validate:"required"`
|
||||
RequestForInformationItemId int `json:"requestForInformationItemId" validate:"required"`
|
||||
FileUrl string `json:"fileUrl" validate:"required"`
|
||||
Response string `json:"response" validate:"required"`
|
||||
StatusId int `json:"status_id" validate:"required"`
|
||||
StatusId int `json:"statusId" validate:"required"`
|
||||
}
|
||||
|
||||
func (req RequestForInformationRepliesCreateRequest) ToEntity() *entity.RequestForInformationReplies {
|
||||
|
|
@ -38,11 +39,10 @@ func (req RequestForInformationRepliesCreateRequest) ToEntity() *entity.RequestF
|
|||
|
||||
type RequestForInformationRepliesUpdateRequest struct {
|
||||
ID uint `json:"id" validate:"required"`
|
||||
RequestForInformationItemId int `json:"request_for_information_item_id" validate:"required"`
|
||||
FileUrl string `json:"file_url" validate:"required"`
|
||||
RequestForInformationItemId int `json:"requestForInformationItemId" validate:"required"`
|
||||
FileUrl string `json:"fileUrl" validate:"required"`
|
||||
Response string `json:"response" validate:"required"`
|
||||
StatusId int `json:"status_id" validate:"required"`
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
StatusId int `json:"statusId" validate:"required"`
|
||||
}
|
||||
|
||||
func (req RequestForInformationRepliesUpdateRequest) ToEntity() *entity.RequestForInformationReplies {
|
||||
|
|
@ -52,15 +52,16 @@ func (req RequestForInformationRepliesUpdateRequest) ToEntity() *entity.RequestF
|
|||
FileUrl: req.FileUrl,
|
||||
Response: req.Response,
|
||||
StatusId: req.StatusId,
|
||||
UpdatedAt: req.UpdatedAt,
|
||||
UpdatedAt: time.Now(),
|
||||
}
|
||||
}
|
||||
|
||||
type RequestForInformationRepliesQueryRequestContext struct {
|
||||
RequestForInformationItemId string `json:"request_for_information_item_id"`
|
||||
FileUrl string `json:"file_url"`
|
||||
RequestForInformationItemId string `json:"requestForInformationItemId"`
|
||||
FileUrl string `json:"fileUrl"`
|
||||
Response string `json:"response"`
|
||||
StatusId string `json:"status_id"`
|
||||
StatusId string `json:"statusId"`
|
||||
CreatedById string `json:"createdById"`
|
||||
}
|
||||
|
||||
func (req RequestForInformationRepliesQueryRequestContext) ToParamRequest() RequestForInformationRepliesQueryRequest {
|
||||
|
|
@ -84,6 +85,12 @@ func (req RequestForInformationRepliesQueryRequestContext) ToParamRequest() Requ
|
|||
request.StatusId = &statusId
|
||||
}
|
||||
}
|
||||
if createdByIdStr := req.CreatedById; createdByIdStr != "" {
|
||||
createdById, err := strconv.Atoi(createdByIdStr)
|
||||
if err == nil {
|
||||
request.CreatedById = &createdById
|
||||
}
|
||||
}
|
||||
|
||||
return request
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,12 +4,12 @@ import "time"
|
|||
|
||||
type RequestForInformationRepliesResponse struct {
|
||||
ID uint `json:"id"`
|
||||
RequestForInformationItemId int `json:"request_for_information_item_id"`
|
||||
FileUrl string `json:"file_url"`
|
||||
RequestForInformationItemId int `json:"requestForInformationItemId"`
|
||||
FileUrl string `json:"fileUrl"`
|
||||
Response string `json:"response"`
|
||||
StatusId int `json:"status_id"`
|
||||
CreatedById *uint `json:"created_by_id"`
|
||||
IsActive *bool `json:"is_active"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
StatusId int `json:"statusId"`
|
||||
CreatedById *uint `json:"createdById"`
|
||||
IsActive *bool `json:"isActive"`
|
||||
CreatedAt time.Time `json:"createdAt"`
|
||||
UpdatedAt time.Time `json:"updatedAt"`
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,21 +12,21 @@ type RequestForInformationsGeneric interface {
|
|||
}
|
||||
|
||||
type RequestForInformationsQueryRequest struct {
|
||||
TicketNumber *string `json:"ticket_number"`
|
||||
HowToGetInfo *string `json:"how_to_get_info"`
|
||||
HowToGetFiles *string `json:"how_to_get_files"`
|
||||
NextAction *string `json:"next_action"`
|
||||
CreatedById *int `json:"created_by_id"`
|
||||
StatusId *int `json:"status_id"`
|
||||
TicketNumber *string `json:"ticketNumber"`
|
||||
HowToGetInfo *string `json:"howToGetInfo"`
|
||||
HowToGetFiles *string `json:"howToGetFiles"`
|
||||
NextAction *string `json:"nextAction"`
|
||||
CreatedById *int `json:"createdById"`
|
||||
StatusId *int `json:"statusId"`
|
||||
Pagination *paginator.Pagination `json:"pagination"`
|
||||
}
|
||||
|
||||
type RequestForInformationsCreateRequest struct {
|
||||
TicketNumber string `json:"ticket_number" validate:"required"`
|
||||
HowToGetInfo string `json:"how_to_get_info" validate:"required"`
|
||||
HowToGetFiles string `json:"how_to_get_files" validate:"required"`
|
||||
NextAction string `json:"next_action" validate:"required"`
|
||||
StatusId int `json:"status_id" validate:"required"`
|
||||
TicketNumber string `json:"ticketNumber" validate:"required"`
|
||||
HowToGetInfo string `json:"howToGetInfo" validate:"required"`
|
||||
HowToGetFiles string `json:"howToGetFiles" validate:"required"`
|
||||
NextAction string `json:"nextAction" validate:"required"`
|
||||
StatusId int `json:"statusId" validate:"required"`
|
||||
}
|
||||
|
||||
func (req RequestForInformationsCreateRequest) ToEntity() *entity.RequestForInformations {
|
||||
|
|
@ -42,11 +42,11 @@ func (req RequestForInformationsCreateRequest) ToEntity() *entity.RequestForInfo
|
|||
|
||||
type RequestForInformationsUpdateRequest struct {
|
||||
ID uint `json:"id" validate:"required"`
|
||||
TicketNumber string `json:"ticket_number" validate:"required"`
|
||||
HowToGetInfo string `json:"how_to_get_info" validate:"required"`
|
||||
HowToGetFiles string `json:"how_to_get_files" validate:"required"`
|
||||
NextAction string `json:"next_action" validate:"required"`
|
||||
StatusId int `json:"status_id" validate:"required"`
|
||||
TicketNumber string `json:"ticketNumber" validate:"required"`
|
||||
HowToGetInfo string `json:"howToGetInfo" validate:"required"`
|
||||
HowToGetFiles string `json:"howToGetFiles" validate:"required"`
|
||||
NextAction string `json:"nextAction" validate:"required"`
|
||||
StatusId int `json:"statusId" validate:"required"`
|
||||
}
|
||||
|
||||
func (req RequestForInformationsUpdateRequest) ToEntity() *entity.RequestForInformations {
|
||||
|
|
@ -62,12 +62,12 @@ func (req RequestForInformationsUpdateRequest) ToEntity() *entity.RequestForInfo
|
|||
}
|
||||
|
||||
type RequestForInformationsQueryRequestContext struct {
|
||||
TicketNumber string `json:"ticket_number"`
|
||||
HowToGetInfo string `json:"how_to_get_info"`
|
||||
HowToGetFiles string `json:"how_to_get_files"`
|
||||
NextAction string `json:"next_action"`
|
||||
CreatedById string `json:"created_by_id"`
|
||||
StatusId string `json:"status_id"`
|
||||
TicketNumber string `json:"ticketNumber"`
|
||||
HowToGetInfo string `json:"howToGetInfo"`
|
||||
HowToGetFiles string `json:"howToGetFiles"`
|
||||
NextAction string `json:"nextAction"`
|
||||
CreatedById string `json:"createdById"`
|
||||
StatusId string `json:"statusId"`
|
||||
}
|
||||
|
||||
func (req RequestForInformationsQueryRequestContext) ToParamRequest() RequestForInformationsQueryRequest {
|
||||
|
|
|
|||
|
|
@ -4,13 +4,13 @@ import "time"
|
|||
|
||||
type RequestForInformationsResponse struct {
|
||||
ID uint `json:"id"`
|
||||
TicketNumber string `json:"ticket_number"`
|
||||
HowToGetInfo string `json:"how_to_get_info"`
|
||||
HowToGetFiles string `json:"how_to_get_files"`
|
||||
NextAction string `json:"next_action"`
|
||||
CreatedById *uint `json:"created_by_id"`
|
||||
StatusId int `json:"status_id"`
|
||||
IsActive *bool `json:"is_active"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
TicketNumber string `json:"ticketNumber"`
|
||||
HowToGetInfo string `json:"howToGetInfo"`
|
||||
HowToGetFiles string `json:"howToGetFiles"`
|
||||
NextAction string `json:"nextAction"`
|
||||
CreatedById *uint `json:"createdById"`
|
||||
StatusId int `json:"statusId"`
|
||||
IsActive *bool `json:"isActive"`
|
||||
CreatedAt time.Time `json:"createdAt"`
|
||||
UpdatedAt time.Time `json:"updatedAt"`
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue