mirror of
https://gitlab.com/mbugroup/lti-api.git
synced 2026-05-25 07:45:44 +00:00
daily checklist can edit empty kandang kosong
This commit is contained in:
@@ -42,6 +42,13 @@ type DailyChecklistDetailDTO struct {
|
||||
TotalActivity int `json:"total_activity"`
|
||||
Progress float64 `json:"progress"`
|
||||
DocumentURLs []DailyChecklistDocumentDTO `json:"document_urls"`
|
||||
EmptyKandang *DailyChecklistEmptyKandangDTO `json:"empty_kandang,omitempty"`
|
||||
}
|
||||
|
||||
type DailyChecklistEmptyKandangDTO struct {
|
||||
Id uint `json:"id"`
|
||||
StartDate time.Time `json:"start_date"`
|
||||
EndDate time.Time `json:"end_date"`
|
||||
}
|
||||
|
||||
type DailyChecklistDocumentDTO struct {
|
||||
@@ -180,6 +187,17 @@ func ToDailyChecklistListDTO(e entity.DailyChecklist) DailyChecklistListDTO {
|
||||
}
|
||||
}
|
||||
|
||||
func ToDailyChecklistEmptyKandangDTO(e *entity.DailyChecklistEmptyKandang) *DailyChecklistEmptyKandangDTO {
|
||||
if e == nil || e.Id == 0 {
|
||||
return nil
|
||||
}
|
||||
return &DailyChecklistEmptyKandangDTO{
|
||||
Id: e.Id,
|
||||
StartDate: e.StartDate,
|
||||
EndDate: e.EndDate,
|
||||
}
|
||||
}
|
||||
|
||||
func ToDailyChecklistDetailDTO(checklist entity.DailyChecklist, phases []entity.DailyChecklistPhase, tasks []entity.DailyChecklistActivityTask, assignedEmployees []entity.Employee, totalActivities int, progress float64, documentURLs []DailyChecklistDocumentDTO) DailyChecklistDetailDTO {
|
||||
phaseDTOs := make([]DailyChecklistPhaseDTO, 0, len(phases))
|
||||
for _, phase := range phases {
|
||||
@@ -241,5 +259,6 @@ func ToDailyChecklistDetailDTO(checklist entity.DailyChecklist, phases []entity.
|
||||
TotalActivity: totalActivities,
|
||||
Progress: progress,
|
||||
DocumentURLs: documentURLs,
|
||||
EmptyKandang: ToDailyChecklistEmptyKandangDTO(checklist.EmptyKandang),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user