letter incoming
This commit is contained in:
@@ -47,3 +47,118 @@ type HealthResponse struct {
|
||||
Timestamp time.Time `json:"timestamp"`
|
||||
Version string `json:"version"`
|
||||
}
|
||||
|
||||
type LabelResponse struct {
|
||||
ID string `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Color *string `json:"color,omitempty"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
}
|
||||
|
||||
type CreateLabelRequest struct {
|
||||
Name string `json:"name"`
|
||||
Color *string `json:"color,omitempty"`
|
||||
}
|
||||
|
||||
type UpdateLabelRequest struct {
|
||||
Name *string `json:"name,omitempty"`
|
||||
Color *string `json:"color,omitempty"`
|
||||
}
|
||||
|
||||
type ListLabelsResponse struct {
|
||||
Labels []LabelResponse `json:"labels"`
|
||||
}
|
||||
|
||||
type PriorityResponse struct {
|
||||
ID string `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Level int `json:"level"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
}
|
||||
|
||||
type CreatePriorityRequest struct {
|
||||
Name string `json:"name"`
|
||||
Level int `json:"level"`
|
||||
}
|
||||
|
||||
type UpdatePriorityRequest struct {
|
||||
Name *string `json:"name,omitempty"`
|
||||
Level *int `json:"level,omitempty"`
|
||||
}
|
||||
|
||||
type ListPrioritiesResponse struct {
|
||||
Priorities []PriorityResponse `json:"priorities"`
|
||||
}
|
||||
|
||||
type InstitutionResponse struct {
|
||||
ID string `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Type string `json:"type"`
|
||||
Address *string `json:"address,omitempty"`
|
||||
ContactPerson *string `json:"contact_person,omitempty"`
|
||||
Phone *string `json:"phone,omitempty"`
|
||||
Email *string `json:"email,omitempty"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
}
|
||||
|
||||
type CreateInstitutionRequest struct {
|
||||
Name string `json:"name"`
|
||||
Type string `json:"type"`
|
||||
Address *string `json:"address,omitempty"`
|
||||
ContactPerson *string `json:"contact_person,omitempty"`
|
||||
Phone *string `json:"phone,omitempty"`
|
||||
Email *string `json:"email,omitempty"`
|
||||
}
|
||||
|
||||
type UpdateInstitutionRequest struct {
|
||||
Name *string `json:"name,omitempty"`
|
||||
Type *string `json:"type,omitempty"`
|
||||
Address *string `json:"address,omitempty"`
|
||||
ContactPerson *string `json:"contact_person,omitempty"`
|
||||
Phone *string `json:"phone,omitempty"`
|
||||
Email *string `json:"email,omitempty"`
|
||||
}
|
||||
|
||||
type ListInstitutionsResponse struct {
|
||||
Institutions []InstitutionResponse `json:"institutions"`
|
||||
}
|
||||
|
||||
type DispositionActionResponse struct {
|
||||
ID string `json:"id"`
|
||||
Code string `json:"code"`
|
||||
Label string `json:"label"`
|
||||
Description *string `json:"description,omitempty"`
|
||||
RequiresNote bool `json:"requires_note"`
|
||||
GroupName *string `json:"group_name,omitempty"`
|
||||
SortOrder *int `json:"sort_order,omitempty"`
|
||||
IsActive bool `json:"is_active"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
}
|
||||
|
||||
type CreateDispositionActionRequest struct {
|
||||
Code string `json:"code"`
|
||||
Label string `json:"label"`
|
||||
Description *string `json:"description,omitempty"`
|
||||
RequiresNote *bool `json:"requires_note,omitempty"`
|
||||
GroupName *string `json:"group_name,omitempty"`
|
||||
SortOrder *int `json:"sort_order,omitempty"`
|
||||
IsActive *bool `json:"is_active,omitempty"`
|
||||
}
|
||||
|
||||
type UpdateDispositionActionRequest struct {
|
||||
Code *string `json:"code,omitempty"`
|
||||
Label *string `json:"label,omitempty"`
|
||||
Description *string `json:"description,omitempty"`
|
||||
RequiresNote *bool `json:"requires_note,omitempty"`
|
||||
GroupName *string `json:"group_name,omitempty"`
|
||||
SortOrder *int `json:"sort_order,omitempty"`
|
||||
IsActive *bool `json:"is_active,omitempty"`
|
||||
}
|
||||
|
||||
type ListDispositionActionsResponse struct {
|
||||
Actions []DispositionActionResponse `json:"actions"`
|
||||
}
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
package contract
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/google/uuid"
|
||||
)
|
||||
|
||||
type DispositionRouteResponse struct {
|
||||
ID uuid.UUID `json:"id"`
|
||||
FromDepartmentID uuid.UUID `json:"from_department_id"`
|
||||
ToDepartmentID uuid.UUID `json:"to_department_id"`
|
||||
IsActive bool `json:"is_active"`
|
||||
AllowedActions map[string]interface{} `json:"allowed_actions,omitempty"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
}
|
||||
|
||||
type CreateDispositionRouteRequest struct {
|
||||
FromDepartmentID uuid.UUID `json:"from_department_id"`
|
||||
ToDepartmentID uuid.UUID `json:"to_department_id"`
|
||||
IsActive *bool `json:"is_active,omitempty"`
|
||||
AllowedActions *map[string]interface{} `json:"allowed_actions,omitempty"`
|
||||
}
|
||||
|
||||
type UpdateDispositionRouteRequest struct {
|
||||
IsActive *bool `json:"is_active,omitempty"`
|
||||
AllowedActions *map[string]interface{} `json:"allowed_actions,omitempty"`
|
||||
}
|
||||
|
||||
type ListDispositionRoutesResponse struct {
|
||||
Routes []DispositionRouteResponse `json:"routes"`
|
||||
}
|
||||
@@ -0,0 +1,122 @@
|
||||
package contract
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/google/uuid"
|
||||
)
|
||||
|
||||
type CreateIncomingLetterAttachment struct {
|
||||
FileURL string `json:"file_url"`
|
||||
FileName string `json:"file_name"`
|
||||
FileType string `json:"file_type"`
|
||||
}
|
||||
|
||||
type CreateIncomingLetterRequest struct {
|
||||
ReferenceNumber *string `json:"reference_number,omitempty"`
|
||||
Subject string `json:"subject"`
|
||||
Description *string `json:"description,omitempty"`
|
||||
PriorityID *uuid.UUID `json:"priority_id,omitempty"`
|
||||
SenderInstitutionID *uuid.UUID `json:"sender_institution_id,omitempty"`
|
||||
ReceivedDate time.Time `json:"received_date"`
|
||||
DueDate *time.Time `json:"due_date,omitempty"`
|
||||
Attachments []CreateIncomingLetterAttachment `json:"attachments,omitempty"`
|
||||
}
|
||||
|
||||
type IncomingLetterAttachmentResponse struct {
|
||||
ID uuid.UUID `json:"id"`
|
||||
FileURL string `json:"file_url"`
|
||||
FileName string `json:"file_name"`
|
||||
FileType string `json:"file_type"`
|
||||
UploadedAt time.Time `json:"uploaded_at"`
|
||||
}
|
||||
|
||||
type IncomingLetterResponse struct {
|
||||
ID uuid.UUID `json:"id"`
|
||||
LetterNumber string `json:"letter_number"`
|
||||
ReferenceNumber *string `json:"reference_number,omitempty"`
|
||||
Subject string `json:"subject"`
|
||||
Description *string `json:"description,omitempty"`
|
||||
PriorityID *uuid.UUID `json:"priority_id,omitempty"`
|
||||
SenderInstitutionID *uuid.UUID `json:"sender_institution_id,omitempty"`
|
||||
ReceivedDate time.Time `json:"received_date"`
|
||||
DueDate *time.Time `json:"due_date,omitempty"`
|
||||
Status string `json:"status"`
|
||||
CreatedBy uuid.UUID `json:"created_by"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
Attachments []IncomingLetterAttachmentResponse `json:"attachments"`
|
||||
}
|
||||
|
||||
type UpdateIncomingLetterRequest struct {
|
||||
ReferenceNumber *string `json:"reference_number,omitempty"`
|
||||
Subject *string `json:"subject,omitempty"`
|
||||
Description *string `json:"description,omitempty"`
|
||||
PriorityID *uuid.UUID `json:"priority_id,omitempty"`
|
||||
SenderInstitutionID *uuid.UUID `json:"sender_institution_id,omitempty"`
|
||||
ReceivedDate *time.Time `json:"received_date,omitempty"`
|
||||
DueDate *time.Time `json:"due_date,omitempty"`
|
||||
Status *string `json:"status,omitempty"`
|
||||
}
|
||||
|
||||
type ListIncomingLettersRequest struct {
|
||||
Page int `json:"page"`
|
||||
Limit int `json:"limit"`
|
||||
Status *string `json:"status,omitempty"`
|
||||
Query *string `json:"query,omitempty"`
|
||||
}
|
||||
|
||||
type ListIncomingLettersResponse struct {
|
||||
Letters []IncomingLetterResponse `json:"letters"`
|
||||
Pagination PaginationResponse `json:"pagination"`
|
||||
}
|
||||
|
||||
type CreateDispositionActionSelection struct {
|
||||
ActionID uuid.UUID `json:"action_id"`
|
||||
Note *string `json:"note,omitempty"`
|
||||
}
|
||||
|
||||
type CreateLetterDispositionRequest struct {
|
||||
LetterID uuid.UUID `json:"letter_id"`
|
||||
ToDepartmentIDs []uuid.UUID `json:"to_department_ids"`
|
||||
Notes *string `json:"notes,omitempty"`
|
||||
SelectedActions []CreateDispositionActionSelection `json:"selected_actions,omitempty"`
|
||||
}
|
||||
|
||||
type DispositionResponse struct {
|
||||
ID uuid.UUID `json:"id"`
|
||||
LetterID uuid.UUID `json:"letter_id"`
|
||||
FromDepartmentID *uuid.UUID `json:"from_department_id,omitempty"`
|
||||
ToDepartmentID *uuid.UUID `json:"to_department_id,omitempty"`
|
||||
Notes *string `json:"notes,omitempty"`
|
||||
Status string `json:"status"`
|
||||
CreatedBy uuid.UUID `json:"created_by"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
}
|
||||
|
||||
type ListDispositionsResponse struct {
|
||||
Dispositions []DispositionResponse `json:"dispositions"`
|
||||
}
|
||||
|
||||
type CreateLetterDiscussionRequest struct {
|
||||
ParentID *uuid.UUID `json:"parent_id,omitempty"`
|
||||
Message string `json:"message"`
|
||||
Mentions map[string]interface{} `json:"mentions,omitempty"`
|
||||
}
|
||||
|
||||
type UpdateLetterDiscussionRequest struct {
|
||||
Message string `json:"message"`
|
||||
Mentions map[string]interface{} `json:"mentions,omitempty"`
|
||||
}
|
||||
|
||||
type LetterDiscussionResponse struct {
|
||||
ID uuid.UUID `json:"id"`
|
||||
LetterID uuid.UUID `json:"letter_id"`
|
||||
ParentID *uuid.UUID `json:"parent_id,omitempty"`
|
||||
UserID uuid.UUID `json:"user_id"`
|
||||
Message string `json:"message"`
|
||||
Mentions map[string]interface{} `json:"mentions,omitempty"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
EditedAt *time.Time `json:"edited_at,omitempty"`
|
||||
}
|
||||
Reference in New Issue
Block a user