From 6bc387069842f66dc9633604dae03beaa94585bf Mon Sep 17 00:00:00 2001 From: phoenix Date: Mon, 15 Dec 2025 20:09:40 +0000 Subject: [PATCH 1/8] tsk-11: Expand MessageEventResponse (#17) Closes #11 Reviewed-on: https://git.kundeng.us/phoenix/textsender-models/pulls/17 Co-authored-by: phoenix Co-committed-by: phoenix --- tx0/message/message_event_response.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tx0/message/message_event_response.go b/tx0/message/message_event_response.go index c1cae36..69b3e6a 100644 --- a/tx0/message/message_event_response.go +++ b/tx0/message/message_event_response.go @@ -13,5 +13,13 @@ type MessageEventResponse struct { ScheduledMessageEventId uuid.UUID `json:"scheduled_message_event_id,omitempty"` Response types.JSONB `json:"response"` UserId uuid.UUID `json:"user_id,omitempty"` + ContactId *uuid.UUID `json:"contact_id,omitempty"` + MessageId *uuid.UUID `json:"message_id,omitempty"` + Status *string `json:"status"` Sent time.Time `json:"sent"` } + +const ( + Message_Event_Response_Status_Instant = "Instant" + Message_Event_Response_Status_Scheduled = "Scheduled" +) From 8f7198ed7c6a2fc680057c815c0bb4793b4817c3 Mon Sep 17 00:00:00 2001 From: phoenix Date: Mon, 15 Dec 2025 20:58:47 +0000 Subject: [PATCH 2/8] tsk-12: Contact improvements (#18) Closes #12 Reviewed-on: https://git.kundeng.us/phoenix/textsender-models/pulls/18 Co-authored-by: phoenix Co-committed-by: phoenix --- tx0/contact/contact.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tx0/contact/contact.go b/tx0/contact/contact.go index e3b277d..6baee60 100644 --- a/tx0/contact/contact.go +++ b/tx0/contact/contact.go @@ -5,7 +5,10 @@ import ( ) type Contact struct { - Id uuid.UUID `json:"id,omitempty"` - PhoneNumber string `json:"phone_number,omitempty"` - UserId uuid.UUID `json:"user_id,omitempty"` + Id *uuid.UUID `json:"id,omitempty"` + Firstname *string `json:"first_name,omitempty"` + Lastname *string `json:"last_name,omitempty"` + Nickname *string `json:"nickname,omitempty"` + PhoneNumber string `json:"phone_number"` + UserId *uuid.UUID `json:"user_id,omitempty"` } From c4d195df4bc45878f13386f7bed8d467824a49c9 Mon Sep 17 00:00:00 2001 From: phoenix Date: Tue, 16 Dec 2025 02:16:38 +0000 Subject: [PATCH 3/8] tsk-13: Fix typo in TwilioConfig (#19) Closes #13 Reviewed-on: https://git.kundeng.us/phoenix/textsender-models/pulls/19 Co-authored-by: phoenix Co-committed-by: phoenix --- tx0/config/twilio_config.go | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/tx0/config/twilio_config.go b/tx0/config/twilio_config.go index 9e5723a..d175bb7 100644 --- a/tx0/config/twilio_config.go +++ b/tx0/config/twilio_config.go @@ -4,7 +4,7 @@ import ( "fmt" ) -type TwiloConfig struct { +type TwilioConfig struct { AccountSID string `json:"auth_sid"` ServiceSID string `json:"service_sid"` URI string `json:"uri"` @@ -12,10 +12,11 @@ type TwiloConfig struct { Number string `json:"phone_number"` } -func (config *TwiloConfig) PrintConfig() { - fmt.Printf("Account SID: %s\n", config.AccountSID) - fmt.Printf("Service SID: %s\n", config.ServiceSID) +func (config *TwilioConfig) PrintConfig() { + fmt.Println("Twilio config") + fmt.Println("Account SID:", config.AccountSID) + fmt.Println("Service SID:", config.ServiceSID) fmt.Println("URI:", config.URI) - fmt.Printf("Auth Token: %s\n", config.AuthToken) - fmt.Printf("Number: %s\n", config.Number) + fmt.Println("Auth Token:", config.AuthToken) + fmt.Println("Number:", config.Number) } From 245ff35e58739265c7dcb0918015ce2f86b21993 Mon Sep 17 00:00:00 2001 From: phoenix Date: Tue, 16 Dec 2025 02:38:30 +0000 Subject: [PATCH 4/8] tsk-14: User improvements (#20) Closes #14 Reviewed-on: https://git.kundeng.us/phoenix/textsender-models/pulls/20 Co-authored-by: phoenix Co-committed-by: phoenix --- tx0/user/service_user.go | 8 ++++---- tx0/user/user.go | 14 ++++++++++---- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/tx0/user/service_user.go b/tx0/user/service_user.go index 8bcbda8..22762d5 100644 --- a/tx0/user/service_user.go +++ b/tx0/user/service_user.go @@ -7,8 +7,8 @@ import ( ) type ServiceUser struct { - Id uuid.UUID `json:"id"` - Username string `json:"username,omitempty"` - Passphrase string `json:"passphrase,omitempty"` - Created *time.Time `json:"date_created,omitempty"` + Id uuid.UUID `json:"id"` + Username string `json:"username,omitempty"` + Passphrase string `json:"passphrase,omitempty"` + Created time.Time `json:"date_created"` } diff --git a/tx0/user/user.go b/tx0/user/user.go index 0327720..ab6f8af 100644 --- a/tx0/user/user.go +++ b/tx0/user/user.go @@ -1,12 +1,18 @@ package user import ( + "time" + "github.com/google/uuid" ) type User struct { - Id uuid.UUID `json:"id"` - PhoneNumber string `json:"phone_number"` - Username string `json:"username"` - Password string `json:"password"` + Id uuid.UUID `json:"id"` + PhoneNumber string `json:"phone_number"` + Username string `json:"username"` + Password string `json:"password"` + Firstname *string `json:"first_name,omitempty"` + Lastname *string `json:"last_name,omitempty"` + Created time.Time `json:"date_created"` + LastLogin *time.Time `json:"last_login,omitempty"` } From f9b55b6bb71244e0e40f63cee5374582aaa72bc9 Mon Sep 17 00:00:00 2001 From: phoenix Date: Tue, 16 Dec 2025 02:58:11 +0000 Subject: [PATCH 5/8] tsk-15: Add User Id to LoginResult (#21) Closes #15 Reviewed-on: https://git.kundeng.us/phoenix/textsender-models/pulls/21 Co-authored-by: phoenix Co-committed-by: phoenix --- tx0/token/token.go | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/tx0/token/token.go b/tx0/token/token.go index f2be04e..a62607c 100644 --- a/tx0/token/token.go +++ b/tx0/token/token.go @@ -11,8 +11,13 @@ type Claims struct { jwt.RegisteredClaims } -type Login struct { - AccessToken string `json:"access_token"` - TokenType string `json:"token_type"` - ExpiresIn int64 `json:"expires_in"` +type LoginResult struct { + UserId uuid.UUID `json:"user_id"` + AccessToken string `json:"access_token"` + TokenType string `json:"token_type"` + ExpiresIn int64 `json:"expires_in"` } + +// Alias for LoginResult +// Will be deprecated at some point +type Login = LoginResult From 7915171bb222105bcbf2ec037d13666f0b58adc8 Mon Sep 17 00:00:00 2001 From: phoenix Date: Mon, 22 Dec 2025 14:24:33 -0500 Subject: [PATCH 6/8] Made values of constant uppercase and changed type of field --- tx0/message/message_event_response.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tx0/message/message_event_response.go b/tx0/message/message_event_response.go index 69b3e6a..d9a0e3c 100644 --- a/tx0/message/message_event_response.go +++ b/tx0/message/message_event_response.go @@ -15,11 +15,11 @@ type MessageEventResponse struct { UserId uuid.UUID `json:"user_id,omitempty"` ContactId *uuid.UUID `json:"contact_id,omitempty"` MessageId *uuid.UUID `json:"message_id,omitempty"` - Status *string `json:"status"` + Status string `json:"status"` Sent time.Time `json:"sent"` } const ( - Message_Event_Response_Status_Instant = "Instant" - Message_Event_Response_Status_Scheduled = "Scheduled" + Message_Event_Response_Status_Instant = "INSTANT" + Message_Event_Response_Status_Scheduled = "SCHEDULED" ) From bad958a59281439f8aef8d80f733de3dc8e164b7 Mon Sep 17 00:00:00 2001 From: phoenix Date: Mon, 22 Dec 2025 14:24:51 -0500 Subject: [PATCH 7/8] Code formatting --- tx0/message/message_event_response.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tx0/message/message_event_response.go b/tx0/message/message_event_response.go index d9a0e3c..f47d461 100644 --- a/tx0/message/message_event_response.go +++ b/tx0/message/message_event_response.go @@ -15,7 +15,7 @@ type MessageEventResponse struct { UserId uuid.UUID `json:"user_id,omitempty"` ContactId *uuid.UUID `json:"contact_id,omitempty"` MessageId *uuid.UUID `json:"message_id,omitempty"` - Status string `json:"status"` + Status string `json:"status"` Sent time.Time `json:"sent"` } From 404ad1594b1c214f0e6387222b92e01d6558783a Mon Sep 17 00:00:00 2001 From: phoenix Date: Mon, 22 Dec 2025 17:13:52 -0500 Subject: [PATCH 8/8] Version bump --- .gitea/workflows/tag_release.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/tag_release.yaml b/.gitea/workflows/tag_release.yaml index 265964a..951edd3 100644 --- a/.gitea/workflows/tag_release.yaml +++ b/.gitea/workflows/tag_release.yaml @@ -25,7 +25,7 @@ jobs: run: | echo "Creating version" - VERSION="0.0.11" + VERSION="0.0.12" PROJECT_COMMIT_HASH=$(git rev-parse HEAD | cut -c 1-10) BRANCH_REF="${{ gitea.ref }}" BRANCH_NAME=$(echo "$BRANCH_REF" | cut -d '/' -f 3)