letter outgoint attachment
This commit is contained in:
parent
43f67a5381
commit
7b9db24c83
@ -43,6 +43,7 @@ type CreateOutgoingLetterAttachment struct {
|
|||||||
FileURL string `json:"file_url" validate:"required"`
|
FileURL string `json:"file_url" validate:"required"`
|
||||||
FileName string `json:"file_name" validate:"required"`
|
FileName string `json:"file_name" validate:"required"`
|
||||||
FileType string `json:"file_type" validate:"required"`
|
FileType string `json:"file_type" validate:"required"`
|
||||||
|
IsFinal bool `json:"is_final" validate:"omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type CreateOutgoingLetterRequest struct {
|
type CreateOutgoingLetterRequest struct {
|
||||||
@ -79,6 +80,7 @@ type OutgoingLetterAttachmentResponse struct {
|
|||||||
FileName string `json:"file_name"`
|
FileName string `json:"file_name"`
|
||||||
FileType string `json:"file_type"`
|
FileType string `json:"file_type"`
|
||||||
UploadedAt time.Time `json:"uploaded_at"`
|
UploadedAt time.Time `json:"uploaded_at"`
|
||||||
|
IsFinal bool `json:"is_final"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type OutgoingLetterApprovalResponse struct {
|
type OutgoingLetterApprovalResponse struct {
|
||||||
|
|||||||
@ -76,6 +76,7 @@ type LetterOutgoingAttachment struct {
|
|||||||
FileType string `gorm:"not null" json:"file_type"`
|
FileType string `gorm:"not null" json:"file_type"`
|
||||||
UploadedBy *uuid.UUID `json:"uploaded_by,omitempty"`
|
UploadedBy *uuid.UUID `json:"uploaded_by,omitempty"`
|
||||||
UploadedAt time.Time `gorm:"autoCreateTime" json:"uploaded_at"`
|
UploadedAt time.Time `gorm:"autoCreateTime" json:"uploaded_at"`
|
||||||
|
IsFinal bool `gorm:"default:false" json:"is_final"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (LetterOutgoingAttachment) TableName() string { return "letter_outgoing_attachments" }
|
func (LetterOutgoingAttachment) TableName() string { return "letter_outgoing_attachments" }
|
||||||
|
|||||||
@ -915,7 +915,7 @@ func (s *LetterOutgoingServiceImpl) AddAttachments(ctx context.Context, letterID
|
|||||||
FileURL: a.FileURL,
|
FileURL: a.FileURL,
|
||||||
FileName: a.FileName,
|
FileName: a.FileName,
|
||||||
FileType: a.FileType,
|
FileType: a.FileType,
|
||||||
UploadedBy: &userID,
|
IsFinal: a.IsFinal,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1589,6 +1589,7 @@ func transformLetterToResponse(letter *entities.LetterOutgoing) *contract.Outgoi
|
|||||||
FileName: attachment.FileName,
|
FileName: attachment.FileName,
|
||||||
FileType: attachment.FileType,
|
FileType: attachment.FileType,
|
||||||
UploadedAt: attachment.UploadedAt,
|
UploadedAt: attachment.UploadedAt,
|
||||||
|
IsFinal: attachment.IsFinal,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,2 @@
|
|||||||
|
ALTER TABLE letter_outgoing_attachments
|
||||||
|
ADD COLUMN IF NOT EXISTS is_final BOOLEAN NOT NULL DEFAULT FALSE;
|
||||||
Loading…
x
Reference in New Issue
Block a user