@@ -84,7 +84,7 @@ func (s SIM) String() string {
8484// Message represents a message sent between 2 phone numbers
8585type Message struct {
8686 ID uuid.UUID `json:"id" gorm:"primaryKey;type:uuid;" example:"32343a19-da5e-4b1b-a767-3298a73703cb"`
87- RequestID * string `json:"request_id" example:"153554b5-ae44-44a0-8f4f-7bbac5657ad4"`
87+ RequestID * string `json:"request_id" example:"153554b5-ae44-44a0-8f4f-7bbac5657ad4" validate:"optional" `
8888 Owner string `json:"owner" example:"+18005550199"`
8989 UserID UserID `json:"user_id" gorm:"index:idx_messages__user_id" example:"WB7DRDWrJZRGbYrv2CKGkqbzvqdC"`
9090 Contact string `json:"contact" example:"+18005550100"`
@@ -99,24 +99,24 @@ type Message struct {
9999 SIM SIM `json:"sim" example:"DEFAULT"`
100100
101101 // SendDuration is the number of nanoseconds from when the request was received until when the mobile phone send the message
102- SendDuration * int64 `json:"send_time" example:"133414"`
102+ SendDuration * int64 `json:"send_time" example:"133414" validate:"optional" `
103103
104104 RequestReceivedAt time.Time `json:"request_received_at" example:"2022-06-05T14:26:01.520828+03:00"`
105105 CreatedAt time.Time `json:"created_at" example:"2022-06-05T14:26:02.302718+03:00"`
106106 UpdatedAt time.Time `json:"updated_at" example:"2022-06-05T14:26:10.303278+03:00"`
107107 OrderTimestamp time.Time `json:"order_timestamp" example:"2022-06-05T14:26:09.527976+03:00"`
108- LastAttemptedAt * time.Time `json:"last_attempted_at" example:"2022-06-05T14:26:09.527976+03:00"`
109- NotificationScheduledAt * time.Time `json:"scheduled_at" example:"2022-06-05T14:26:09.527976+03:00"`
110- SentAt * time.Time `json:"sent_at" example:"2022-06-05T14:26:09.527976+03:00"`
111- ScheduledSendTime * time.Time `json:"scheduled_send_time" example:"2022-06-05T14:26:09.527976+03:00"`
112- DeliveredAt * time.Time `json:"delivered_at" example:"2022-06-05T14:26:09.527976+03:00"`
113- ExpiredAt * time.Time `json:"expired_at" example:"2022-06-05T14:26:09.527976+03:00"`
114- FailedAt * time.Time `json:"failed_at" example:"2022-06-05T14:26:09.527976+03:00"`
115- CanBePolled bool `json:"can_be_polled" example:"false"`
108+ LastAttemptedAt * time.Time `json:"last_attempted_at" example:"2022-06-05T14:26:09.527976+03:00" validate:"optional" `
109+ NotificationScheduledAt * time.Time `json:"scheduled_at" example:"2022-06-05T14:26:09.527976+03:00" validate:"optional" `
110+ SentAt * time.Time `json:"sent_at" example:"2022-06-05T14:26:09.527976+03:00" validate:"optional" `
111+ ScheduledSendTime * time.Time `json:"scheduled_send_time" example:"2022-06-05T14:26:09.527976+03:00" validate:"optional" `
112+ DeliveredAt * time.Time `json:"delivered_at" example:"2022-06-05T14:26:09.527976+03:00" validate:"optional" `
113+ ExpiredAt * time.Time `json:"expired_at" example:"2022-06-05T14:26:09.527976+03:00" validate:"optional" `
114+ FailedAt * time.Time `json:"failed_at" example:"2022-06-05T14:26:09.527976+03:00" validate:"optional" `
115+ CanBePolled bool `json:"can_be_polled" example:"false" swaggerignore:"true" `
116116 SendAttemptCount uint `json:"send_attempt_count" example:"0"`
117117 MaxSendAttempts uint `json:"max_send_attempts" example:"1"`
118- ReceivedAt * time.Time `json:"received_at" example:"2022-06-05T14:26:09.527976+03:00"`
119- FailureReason * string `json:"failure_reason" example:"UNKNOWN"`
118+ ReceivedAt * time.Time `json:"received_at" example:"2022-06-05T14:26:09.527976+03:00" validate:"optional" `
119+ FailureReason * string `json:"failure_reason" example:"UNKNOWN" validate:"optional" `
120120}
121121
122122// IsSending determines if a message is being sent
0 commit comments