Start work on populating context of communication at API layer

Remove communication stub, it's a performance enhancement.
This commit is contained in:
Eli Ribble 2026-05-12 17:10:05 +00:00
parent 266004624d
commit e569bb32b7
No known key found for this signature in database
9 changed files with 331 additions and 119 deletions

View file

@ -16,3 +16,11 @@ func TextLogFromID(ctx context.Context, id int64) (model.TextLog, error) {
WHERE(table.TextLog.ID.EQ(postgres.Int(id)))
return db.ExecuteOne[model.TextLog](ctx, statement)
}
func TextLogsFromPhoneNumber(ctx context.Context, number string) ([]model.TextLog, error) {
statement := table.TextLog.SELECT(
table.TextLog.AllColumns,
).FROM(table.TextLog).
WHERE(table.TextLog.Source.EQ(postgres.String(number)).OR(
table.TextLog.Destination.EQ(postgres.String(number))))
return db.ExecuteMany[model.TextLog](ctx, statement)
}