feat: fixing all rqeuest for information
This commit is contained in:
parent
f67a9ab415
commit
11d0977d86
|
|
@ -50,10 +50,10 @@ func (_i *requestForInformationItemsController) All(c *fiber.Ctx) error {
|
|||
}
|
||||
|
||||
reqContext := request.RequestForInformationItemsQueryRequestContext{
|
||||
RequestForInformationId: c.Query("request_for_information_id"),
|
||||
RequestedInfo: c.Query("requested_info"),
|
||||
RequestForInformationId: c.Query("requestForInformationId"),
|
||||
RequestedInfo: c.Query("requestedInfo"),
|
||||
Reason: c.Query("reason"),
|
||||
StatusId: c.Query("status_id"),
|
||||
StatusId: c.Query("statusId"),
|
||||
}
|
||||
req := reqContext.ToParamRequest()
|
||||
req.Pagination = paginate
|
||||
|
|
|
|||
|
|
@ -51,12 +51,12 @@ func (_i *requestForInformationObjectionController) All(c *fiber.Ctx) error {
|
|||
}
|
||||
|
||||
reqContext := request.RequestForInformationObjectionQueryRequestContext{
|
||||
RequestForInformationId: c.Query("request_for_information_id"),
|
||||
DocumentName: c.Query("document_name"),
|
||||
MainReason: c.Query("main_reason"),
|
||||
SecondaryReason: c.Query("secondary_reason"),
|
||||
CreatedById: c.Query("created_by_id"),
|
||||
StatusId: c.Query("status_id"),
|
||||
RequestForInformationId: c.Query("requestForInformationId"),
|
||||
DocumentName: c.Query("documentName"),
|
||||
MainReason: c.Query("mainReason"),
|
||||
SecondaryReason: c.Query("secondaryReason"),
|
||||
CreatedById: c.Query("createdById"),
|
||||
StatusId: c.Query("statusId"),
|
||||
}
|
||||
req := reqContext.ToParamRequest()
|
||||
req.Pagination = paginate
|
||||
|
|
|
|||
|
|
@ -50,10 +50,10 @@ func (_i *requestForInformationRepliesController) All(c *fiber.Ctx) error {
|
|||
}
|
||||
|
||||
reqContext := request.RequestForInformationRepliesQueryRequestContext{
|
||||
RequestForInformationItemId: c.Query("request_for_information_item_id"),
|
||||
FileUrl: c.Query("file_url"),
|
||||
RequestForInformationItemId: c.Query("requestForInformationItemId"),
|
||||
FileUrl: c.Query("fileUrl"),
|
||||
Response: c.Query("response"),
|
||||
StatusId: c.Query("status_id"),
|
||||
StatusId: c.Query("statusId"),
|
||||
}
|
||||
req := reqContext.ToParamRequest()
|
||||
req.Pagination = paginate
|
||||
|
|
|
|||
|
|
@ -50,12 +50,12 @@ func (_i *requestForInformationsController) All(c *fiber.Ctx) error {
|
|||
}
|
||||
|
||||
reqContext := request.RequestForInformationsQueryRequestContext{
|
||||
TicketNumber: c.Query("ticket_number"),
|
||||
HowToGetInfo: c.Query("how_to_get_info"),
|
||||
HowToGetFiles: c.Query("how_to_get_files"),
|
||||
NextAction: c.Query("next_action"),
|
||||
CreatedById: c.Query("created_by_id"),
|
||||
StatusId: c.Query("status_id"),
|
||||
TicketNumber: c.Query("ticketNumber"),
|
||||
HowToGetInfo: c.Query("howToGetInfo"),
|
||||
HowToGetFiles: c.Query("howToGetFiles"),
|
||||
NextAction: c.Query("nextAction"),
|
||||
CreatedById: c.Query("createdById"),
|
||||
StatusId: c.Query("statusId"),
|
||||
}
|
||||
req := reqContext.ToParamRequest()
|
||||
req.Pagination = paginate
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import (
|
|||
"go-humas-be/app/module/request_for_informations/request"
|
||||
"go-humas-be/utils/paginator"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
|
||||
type requestForInformationsRepository struct {
|
||||
|
|
@ -38,6 +39,10 @@ func (_i *requestForInformationsRepository) GetAll(req request.RequestForInforma
|
|||
query := _i.DB.DB.Model(&entity.RequestForInformations{})
|
||||
query = query.Where("is_active = ?", true)
|
||||
|
||||
_i.Log.Info().Str("timestamp", time.Now().
|
||||
Format(time.RFC3339)).Str("Service:Create", "PpidData:Create").
|
||||
Interface("Request : ", req).Msg("")
|
||||
|
||||
if req.TicketNumber != nil && *req.TicketNumber != "" {
|
||||
ticketNumber := strings.ToLower(*req.TicketNumber)
|
||||
query = query.Where("LOWER(ticket_number) LIKE ?", "%"+strings.ToLower(ticketNumber)+"%")
|
||||
|
|
|
|||
Loading…
Reference in New Issue