Init All Docs
This commit is contained in:
@@ -3,11 +3,11 @@ package contract
|
||||
import "time"
|
||||
|
||||
const (
|
||||
SettingIncomingLetterPrefix = "INCOMING_LETTER_PREFIX"
|
||||
SettingIncomingLetterSequence = "INCOMING_LETTER_SEQUENCE"
|
||||
SettingIncomingLetterRecipients = "INCOMING_LETTER_RECIPIENTS"
|
||||
SettingOutgoingLetterPrefix = "OUTGOING_LETTER_PREFIX"
|
||||
SettingOutgoingLetterSequence = "OUTGOING_LETTER_SEQUENCE"
|
||||
SettingIncomingLetterPrefix = "INCOMING_LETTER_PREFIX"
|
||||
SettingIncomingLetterSequence = "INCOMING_LETTER_SEQUENCE"
|
||||
SettingIncomingLetterDepartmentRecipients = "INCOMING_LETTER_DEPARTMENT_RECIPIENTS"
|
||||
SettingOutgoingLetterPrefix = "OUTGOING_LETTER_PREFIX"
|
||||
SettingOutgoingLetterSequence = "OUTGOING_LETTER_SEQUENCE"
|
||||
)
|
||||
|
||||
type ErrorResponse struct {
|
||||
|
||||
@@ -27,12 +27,19 @@ type DispositionRouteResponse struct {
|
||||
}
|
||||
|
||||
type CreateDispositionRouteRequest struct {
|
||||
FromDepartmentID uuid.UUID `json:"from_department_id"`
|
||||
ToDepartmentID uuid.UUID `json:"to_department_id"`
|
||||
FromDepartmentID uuid.UUID `json:"from_department_id" binding:"required"`
|
||||
ToDepartmentIDs []uuid.UUID `json:"to_department_ids" binding:"required,min=1"`
|
||||
IsActive *bool `json:"is_active,omitempty"`
|
||||
AllowedActions *map[string]interface{} `json:"allowed_actions,omitempty"`
|
||||
}
|
||||
|
||||
// BulkCreateDispositionRouteResponse response for bulk create/update operation
|
||||
type BulkCreateDispositionRouteResponse struct {
|
||||
Created int `json:"created"`
|
||||
Updated int `json:"updated"`
|
||||
Routes []DispositionRouteResponse `json:"routes"`
|
||||
}
|
||||
|
||||
type UpdateDispositionRouteRequest struct {
|
||||
IsActive *bool `json:"is_active,omitempty"`
|
||||
AllowedActions *map[string]interface{} `json:"allowed_actions,omitempty"`
|
||||
@@ -41,3 +48,26 @@ type UpdateDispositionRouteRequest struct {
|
||||
type ListDispositionRoutesResponse struct {
|
||||
Routes []DispositionRouteResponse `json:"routes"`
|
||||
}
|
||||
|
||||
// DepartmentMapping represents department ID and name mapping
|
||||
type DepartmentMapping struct {
|
||||
ID uuid.UUID `json:"id"`
|
||||
Name string `json:"name"`
|
||||
}
|
||||
|
||||
// DispositionRouteGroupedItem represents a single grouped route item with clean department structure
|
||||
type DispositionRouteGroupedItem struct {
|
||||
FromDepartment DepartmentMapping `json:"from_department"`
|
||||
ToDepartments []DepartmentMapping `json:"to_departments"`
|
||||
}
|
||||
|
||||
// ListDispositionRoutesGroupedResponse returns all routes grouped by from_department_id
|
||||
type ListDispositionRoutesGroupedResponse struct {
|
||||
Dispositions []DispositionRouteGroupedItem `json:"dispositions"`
|
||||
}
|
||||
|
||||
// ListDispositionRoutesDetailedResponse returns all routes with department details
|
||||
type ListDispositionRoutesDetailedResponse struct {
|
||||
Routes []DispositionRouteResponse `json:"routes"`
|
||||
Total int `json:"total"`
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ type CreateIncomingLetterAttachment struct {
|
||||
}
|
||||
|
||||
type CreateIncomingLetterRequest struct {
|
||||
LetterNumber string `json:"-"` // Generated by service layer
|
||||
ReferenceNumber *string `json:"reference_number,omitempty"`
|
||||
Subject string `json:"subject"`
|
||||
Description *string `json:"description,omitempty"`
|
||||
@@ -46,6 +47,7 @@ type IncomingLetterResponse struct {
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
Attachments []IncomingLetterAttachmentResponse `json:"attachments"`
|
||||
IsRead bool `json:"is_read"`
|
||||
}
|
||||
|
||||
type UpdateIncomingLetterRequest struct {
|
||||
@@ -60,16 +62,35 @@ type UpdateIncomingLetterRequest struct {
|
||||
}
|
||||
|
||||
type ListIncomingLettersRequest struct {
|
||||
Page int `json:"page"`
|
||||
Limit int `json:"limit"`
|
||||
Status *string `json:"status,omitempty"`
|
||||
Query *string `json:"query,omitempty"`
|
||||
DepartmentID *uuid.UUID
|
||||
Page int `json:"page"`
|
||||
Limit int `json:"limit"`
|
||||
Status *string `json:"status,omitempty"`
|
||||
Query *string `json:"query,omitempty"`
|
||||
DepartmentID *uuid.UUID
|
||||
IsRead *bool `json:"is_read,omitempty"`
|
||||
PriorityIDs []uuid.UUID `json:"priority_ids,omitempty"`
|
||||
IsDispositioned *bool `json:"is_dispositioned,omitempty"`
|
||||
IsArchived *bool `json:"is_archived,omitempty"`
|
||||
}
|
||||
|
||||
type ListIncomingLettersResponse struct {
|
||||
Letters []IncomingLetterResponse `json:"letters"`
|
||||
Pagination PaginationResponse `json:"pagination"`
|
||||
Letters []IncomingLetterResponse `json:"letters"`
|
||||
Pagination PaginationResponse `json:"pagination"`
|
||||
TotalUnread int `json:"total_unread"`
|
||||
}
|
||||
|
||||
type LetterUnreadCountResponse struct {
|
||||
IncomingLetter struct {
|
||||
Unread int `json:"unread"`
|
||||
} `json:"incoming_letter"`
|
||||
OutgoingLetter struct {
|
||||
Unread int `json:"unread"`
|
||||
} `json:"outgoing_letter"`
|
||||
}
|
||||
|
||||
type MarkLetterReadResponse struct {
|
||||
Success bool `json:"success"`
|
||||
Message string `json:"message"`
|
||||
}
|
||||
|
||||
type CreateDispositionActionSelection struct {
|
||||
@@ -83,6 +104,7 @@ type CreateLetterDispositionRequest struct {
|
||||
ToDepartmentIDs []uuid.UUID `json:"to_department_ids"`
|
||||
Notes *string `json:"notes,omitempty"`
|
||||
SelectedActions []CreateDispositionActionSelection `json:"selected_actions,omitempty"`
|
||||
CreatedBy uuid.UUID `json:"created_by"`
|
||||
}
|
||||
|
||||
type DispositionResponse struct {
|
||||
@@ -144,6 +166,38 @@ type ListEnhancedDispositionsResponse struct {
|
||||
Discussions []LetterDiscussionResponse `json:"discussions"`
|
||||
}
|
||||
|
||||
type GetDepartmentDispositionStatusRequest struct {
|
||||
LetterIncomingID uuid.UUID `json:"letter_incoming_id"`
|
||||
DepartmentID uuid.UUID `json:"department_id"`
|
||||
}
|
||||
|
||||
type DepartmentDispositionStatusResponse struct {
|
||||
ID uuid.UUID `json:"id"`
|
||||
LetterID uuid.UUID `json:"letter_id"`
|
||||
Letter *IncomingLetterResponse `json:"letter,omitempty"`
|
||||
FromDepartmentID *uuid.UUID `json:"from_department_id,omitempty"`
|
||||
FromDepartment *DepartmentResponse `json:"from_department,omitempty"`
|
||||
ToDepartmentID uuid.UUID `json:"to_department_id"`
|
||||
ToDepartment *DepartmentResponse `json:"to_department,omitempty"`
|
||||
Status string `json:"status"`
|
||||
Notes *string `json:"notes,omitempty"`
|
||||
ReadAt *time.Time `json:"read_at,omitempty"`
|
||||
CompletedAt *time.Time `json:"completed_at,omitempty"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
}
|
||||
|
||||
type ListDepartmentDispositionStatusResponse struct {
|
||||
Dispositions []DepartmentDispositionStatusResponse `json:"dispositions"`
|
||||
Pagination PaginationResponse `json:"pagination"`
|
||||
}
|
||||
|
||||
type UpdateDispositionStatusRequest struct {
|
||||
LetterIncomingID uuid.UUID `json:"letter_incoming_id"`
|
||||
Status string `json:"status"`
|
||||
Notes *string `json:"notes,omitempty"`
|
||||
}
|
||||
|
||||
type CreateLetterDiscussionRequest struct {
|
||||
ParentID *uuid.UUID `json:"parent_id,omitempty"`
|
||||
Message string `json:"message"`
|
||||
@@ -172,3 +226,33 @@ type LetterDiscussionResponse struct {
|
||||
// Preloaded user profiles for mentions
|
||||
MentionedUsers []UserResponse `json:"mentioned_users,omitempty"`
|
||||
}
|
||||
|
||||
type GetLetterCTARequest struct {
|
||||
LetterIncomingID uuid.UUID `json:"letter_incoming_id"`
|
||||
}
|
||||
|
||||
type LetterCTAAction struct {
|
||||
Type string `json:"type"` // "create_disposition", "update_status", "view"
|
||||
Label string `json:"label"` // Human-readable label for the action
|
||||
Path string `json:"path"` // API endpoint path
|
||||
Method string `json:"method"` // HTTP method: GET, POST, PUT, etc.
|
||||
Description string `json:"description"` // Description of what this action does
|
||||
}
|
||||
|
||||
type LetterCTAResponse struct {
|
||||
LetterIncomingID uuid.UUID `json:"letter_incoming_id"`
|
||||
Actions []LetterCTAAction `json:"actions"`
|
||||
DispositionID *uuid.UUID `json:"disposition_id,omitempty"`
|
||||
CurrentStatus *string `json:"current_status,omitempty"`
|
||||
Message string `json:"message"`
|
||||
}
|
||||
|
||||
type BulkArchiveLettersRequest struct {
|
||||
LetterIDs []uuid.UUID `json:"letter_ids" binding:"required,min=1"`
|
||||
}
|
||||
|
||||
type BulkArchiveLettersResponse struct {
|
||||
Success bool `json:"success"`
|
||||
Message string `json:"message"`
|
||||
ArchivedCount int `json:"archived_count"`
|
||||
}
|
||||
|
||||
@@ -111,6 +111,7 @@ type ListOutgoingLettersRequest struct {
|
||||
PriorityID *uuid.UUID `form:"priority_id" json:"priority_id,omitempty"`
|
||||
SortBy string `form:"sort_by" json:"sort_by,omitempty"`
|
||||
SortOrder string `form:"sort_order" json:"sort_order,omitempty"`
|
||||
IsArchived *bool `form:"is_archived" json:"is_archived,omitempty"`
|
||||
}
|
||||
|
||||
type ListOutgoingLettersResponse struct {
|
||||
|
||||
@@ -0,0 +1,107 @@
|
||||
package contract
|
||||
|
||||
import "github.com/google/uuid"
|
||||
|
||||
type TriggerNotificationRequest struct {
|
||||
UserID uuid.UUID `json:"user_id" validate:"required"`
|
||||
TemplateID string `json:"template_id" validate:"required"`
|
||||
TemplateData map[string]interface{} `json:"template_data,omitempty"`
|
||||
To *NotificationTo `json:"to,omitempty"`
|
||||
Overrides *NotificationOverrides `json:"overrides,omitempty"`
|
||||
}
|
||||
|
||||
type NotificationTo struct {
|
||||
Email string `json:"email,omitempty"`
|
||||
Phone string `json:"phone,omitempty"`
|
||||
SubscriberID string `json:"subscriber_id,omitempty"`
|
||||
}
|
||||
|
||||
type NotificationOverrides struct {
|
||||
Email *EmailOverride `json:"email,omitempty"`
|
||||
SMS *SMSOverride `json:"sms,omitempty"`
|
||||
InApp *InAppOverride `json:"in_app,omitempty"`
|
||||
Push *PushOverride `json:"push,omitempty"`
|
||||
Chat *ChatOverride `json:"chat,omitempty"`
|
||||
}
|
||||
|
||||
type EmailOverride struct {
|
||||
Subject string `json:"subject,omitempty"`
|
||||
Body string `json:"body,omitempty"`
|
||||
From string `json:"from,omitempty"`
|
||||
}
|
||||
|
||||
type SMSOverride struct {
|
||||
Content string `json:"content,omitempty"`
|
||||
From string `json:"from,omitempty"`
|
||||
}
|
||||
|
||||
type InAppOverride struct {
|
||||
Content string `json:"content,omitempty"`
|
||||
}
|
||||
|
||||
type PushOverride struct {
|
||||
Title string `json:"title,omitempty"`
|
||||
Content string `json:"content,omitempty"`
|
||||
}
|
||||
|
||||
type ChatOverride struct {
|
||||
Content string `json:"content,omitempty"`
|
||||
}
|
||||
|
||||
type TriggerNotificationResponse struct {
|
||||
Success bool `json:"success"`
|
||||
TransactionID string `json:"transaction_id,omitempty"`
|
||||
Message string `json:"message,omitempty"`
|
||||
}
|
||||
|
||||
type BulkTriggerNotificationRequest struct {
|
||||
TemplateID string `json:"template_id" validate:"required"`
|
||||
UserIDs []uuid.UUID `json:"user_ids" validate:"required,min=1"`
|
||||
TemplateData map[string]interface{} `json:"template_data,omitempty"`
|
||||
Overrides *NotificationOverrides `json:"overrides,omitempty"`
|
||||
}
|
||||
|
||||
type BulkTriggerNotificationResponse struct {
|
||||
Success bool `json:"success"`
|
||||
TotalSent int `json:"total_sent"`
|
||||
TotalFailed int `json:"total_failed"`
|
||||
Results []NotificationResult `json:"results,omitempty"`
|
||||
}
|
||||
|
||||
type NotificationResult struct {
|
||||
UserID uuid.UUID `json:"user_id"`
|
||||
Success bool `json:"success"`
|
||||
TransactionID string `json:"transaction_id,omitempty"`
|
||||
Error string `json:"error,omitempty"`
|
||||
}
|
||||
|
||||
type GetSubscriberRequest struct {
|
||||
UserID uuid.UUID `json:"user_id" validate:"required"`
|
||||
}
|
||||
|
||||
type GetSubscriberResponse struct {
|
||||
SubscriberID string `json:"subscriber_id"`
|
||||
Email string `json:"email"`
|
||||
FirstName string `json:"first_name"`
|
||||
LastName string `json:"last_name"`
|
||||
Phone string `json:"phone,omitempty"`
|
||||
Avatar string `json:"avatar,omitempty"`
|
||||
Data map[string]interface{} `json:"data,omitempty"`
|
||||
Channels []ChannelCredentials `json:"channels,omitempty"`
|
||||
}
|
||||
|
||||
type ChannelCredentials struct {
|
||||
Channel string `json:"channel"`
|
||||
Credentials map[string]interface{} `json:"credentials"`
|
||||
}
|
||||
|
||||
type UpdateSubscriberChannelRequest struct {
|
||||
UserID uuid.UUID `json:"user_id" validate:"required"`
|
||||
Channel string `json:"channel" validate:"required,oneof=email sms push chat in_app"`
|
||||
Credentials map[string]interface{} `json:"credentials" validate:"required"`
|
||||
}
|
||||
|
||||
type UpdateSubscriberChannelResponse struct {
|
||||
Success bool `json:"success"`
|
||||
Message string `json:"message,omitempty"`
|
||||
}
|
||||
Reference in New Issue
Block a user