Get text messages for a contact and the phone status
Some checks failed
/ golint (push) Failing after 10s
Some checks failed
/ golint (push) Failing after 10s
This commit is contained in:
parent
5d03ab0844
commit
5b0d009353
6 changed files with 86 additions and 5 deletions
|
|
@ -19,6 +19,13 @@ func ContactPhoneInsert(ctx context.Context, txn db.Ex, m model.ContactPhone) (m
|
|||
return db.ExecuteOneTx[model.ContactPhone](ctx, txn, statement)
|
||||
}
|
||||
|
||||
func ContactPhoneFromContactID(ctx context.Context, txn db.Ex, contact_id int64) (model.ContactPhone, error) {
|
||||
statement := table.ContactPhone.SELECT(
|
||||
table.ContactPhone.AllColumns,
|
||||
).FROM(table.ContactPhone).
|
||||
WHERE(table.ContactPhone.ContactID.EQ(postgres.Int(contact_id)))
|
||||
return db.ExecuteOneTx[model.ContactPhone](ctx, txn, statement)
|
||||
}
|
||||
func ContactPhoneFromE164(ctx context.Context, txn db.Ex, e164 string) (model.ContactPhone, error) {
|
||||
statement := table.ContactPhone.SELECT(
|
||||
table.ContactPhone.AllColumns,
|
||||
|
|
|
|||
|
|
@ -28,7 +28,8 @@ func TextLogsFromPhoneNumber(ctx context.Context, txn db.Ex, number string) ([]m
|
|||
table.TextLog.AllColumns,
|
||||
).FROM(table.TextLog).
|
||||
WHERE(table.TextLog.Source.EQ(postgres.String(number)).OR(
|
||||
table.TextLog.Destination.EQ(postgres.String(number))))
|
||||
table.TextLog.Destination.EQ(postgres.String(number)))).
|
||||
ORDER_BY(table.TextLog.Created.DESC())
|
||||
return db.ExecuteManyTx[model.TextLog](ctx, txn, statement)
|
||||
}
|
||||
func TextLogWelcomeFromDestination(ctx context.Context, txn db.Ex, destination string) ([]model.TextLog, error) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue