update letter outgoing final attachment
This commit is contained in:
@@ -37,15 +37,15 @@ type LetterOutgoing struct {
|
||||
DeletedAt *time.Time `gorm:"index" json:"deleted_at,omitempty"`
|
||||
|
||||
// Relations
|
||||
Priority *Priority `gorm:"foreignKey:PriorityID" json:"priority,omitempty"`
|
||||
ReceiverInstitution *Institution `gorm:"foreignKey:ReceiverInstitutionID" json:"receiver_institution,omitempty"`
|
||||
Creator *User `gorm:"foreignKey:CreatedBy" json:"creator,omitempty"`
|
||||
ApprovalFlow *ApprovalFlow `gorm:"foreignKey:ApprovalFlowID" json:"approval_flow,omitempty"`
|
||||
Recipients []LetterOutgoingRecipient `gorm:"foreignKey:LetterID" json:"recipients,omitempty"`
|
||||
Attachments []LetterOutgoingAttachment `gorm:"foreignKey:LetterID" json:"attachments,omitempty"`
|
||||
Approvals []LetterOutgoingApproval `gorm:"foreignKey:LetterID" json:"approvals,omitempty"`
|
||||
Discussions []LetterOutgoingDiscussion `gorm:"foreignKey:LetterID" json:"discussions,omitempty"`
|
||||
ActivityLogs []LetterOutgoingActivityLog `gorm:"foreignKey:LetterID" json:"activity_logs,omitempty"`
|
||||
Priority *Priority `gorm:"foreignKey:PriorityID" json:"priority,omitempty"`
|
||||
ReceiverInstitution *Institution `gorm:"foreignKey:ReceiverInstitutionID" json:"receiver_institution,omitempty"`
|
||||
Creator *User `gorm:"foreignKey:CreatedBy" json:"creator,omitempty"`
|
||||
ApprovalFlow *ApprovalFlow `gorm:"foreignKey:ApprovalFlowID" json:"approval_flow,omitempty"`
|
||||
Recipients []LetterOutgoingRecipient `gorm:"foreignKey:LetterID" json:"recipients,omitempty"`
|
||||
Attachments []LetterOutgoingAttachment `gorm:"foreignKey:LetterID" json:"attachments,omitempty"`
|
||||
Approvals []LetterOutgoingApproval `gorm:"foreignKey:LetterID" json:"approvals,omitempty"`
|
||||
Discussions []LetterOutgoingDiscussion `gorm:"foreignKey:LetterID" json:"discussions,omitempty"`
|
||||
FinalAttachments []LetterOutgoingFinalAttachment `gorm:"foreignKey:LetterID" json:"final_attachments,omitempty"`
|
||||
}
|
||||
|
||||
func (LetterOutgoing) TableName() string { return "letters_outgoing" }
|
||||
@@ -76,11 +76,22 @@ type LetterOutgoingAttachment struct {
|
||||
FileType string `gorm:"not null" json:"file_type"`
|
||||
UploadedBy *uuid.UUID `json:"uploaded_by,omitempty"`
|
||||
UploadedAt time.Time `gorm:"autoCreateTime" json:"uploaded_at"`
|
||||
IsFinal bool `gorm:"default:false" json:"is_final"`
|
||||
}
|
||||
|
||||
func (LetterOutgoingAttachment) TableName() string { return "letter_outgoing_attachments" }
|
||||
|
||||
type LetterOutgoingFinalAttachment struct {
|
||||
ID uuid.UUID `gorm:"type:uuid;primary_key;default:gen_random_uuid()" json:"id"`
|
||||
LetterID uuid.UUID `gorm:"type:uuid;not null" json:"letter_id"`
|
||||
FileURL string `gorm:"not null" json:"file_url"`
|
||||
FileName string `gorm:"not null" json:"file_name"`
|
||||
FileType string `gorm:"not null" json:"file_type"`
|
||||
UploadedBy *uuid.UUID `json:"uploaded_by,omitempty"`
|
||||
UploadedAt time.Time `gorm:"autoCreateTime" json:"uploaded_at"`
|
||||
}
|
||||
|
||||
func (LetterOutgoingFinalAttachment) TableName() string { return "letter_outgoing_final_attachments" }
|
||||
|
||||
type LetterOutgoingDiscussion struct {
|
||||
ID uuid.UUID `gorm:"type:uuid;primary_key;default:gen_random_uuid()" json:"id"`
|
||||
LetterID uuid.UUID `gorm:"type:uuid;not null" json:"letter_id"`
|
||||
|
||||
Reference in New Issue
Block a user