Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
16c3f49
refactor: move SearchOrganizationTokens to FrontierService
paanSinghCoder Apr 22, 2026
277e4e7
chore: bump @raystack/proton and PROTON_COMMIT to main (#482)
paanSinghCoder Apr 22, 2026
31b444e
feat(sdk): add sorting and RQL infinite loading to views-new tokens
paanSinghCoder Apr 22, 2026
fb0ace5
Merge branch 'main' into refactor/search-org-tokens-to-frontier-service
paanSinghCoder Apr 22, 2026
b0d39b9
Merge branch 'refactor/search-org-tokens-to-frontier-service' into fe…
paanSinghCoder Apr 22, 2026
c0e134a
Merge branch 'main' into refactor/search-org-tokens-to-frontier-service
paanSinghCoder Apr 22, 2026
89c1f8f
Merge branch 'refactor/search-org-tokens-to-frontier-service' into fe…
paanSinghCoder Apr 22, 2026
9eafacc
fix: restore two-letter initials fallback in Member avatar
paanSinghCoder Apr 22, 2026
28ec4dd
fix: drop UUID fallback in Member column; use '-' instead
paanSinghCoder Apr 22, 2026
d039c17
fix: restore console.error signal when transactions query fails
paanSinghCoder Apr 22, 2026
47151a5
fix: restore fixed widths for Date (140px) and Tokens (200px) columns
paanSinghCoder Apr 22, 2026
2542efa
fix: catch fetchNextPage rejection in onLoadMore
paanSinghCoder Apr 22, 2026
edbca8c
feat: add source field to SearchOrganizationTokens + restore Event co…
paanSinghCoder Apr 23, 2026
e6cef5b
test: update OrgTokensRepository SQL assertions for new source column
paanSinghCoder Apr 24, 2026
4a666cf
Merge branch 'main' into feat/add-sorting-and-pagination-tokens
paanSinghCoder Apr 27, 2026
0096ac5
chore: bump @raystack/proton + PROTON_COMMIT to proton main (#484 mer…
paanSinghCoder Apr 27, 2026
0602180
fix: use apsara-v1 composition Tooltip API in tokens Event column
paanSinghCoder Apr 27, 2026
4c5cfa5
fix: restore DataTable.VirtualizedContent in tokens-view
paanSinghCoder Apr 27, 2026
6a75c85
fix: switch tokens-view back to DataTable.Content for natural page sc…
paanSinghCoder Apr 27, 2026
cc9748f
feat: add filtering functionality to TokensView with new filters bar
paanSinghCoder Apr 27, 2026
fff4546
fix: switch tokens-view to VirtualizedContent with bounded height
paanSinghCoder Apr 28, 2026
ca1b034
Merge branch 'main' into feat/add-sorting-and-pagination-tokens
paanSinghCoder Apr 29, 2026
1cfc3e6
Merge branch 'main' into feat/add-sorting-and-pagination-tokens
paanSinghCoder Apr 29, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ TAG := $(shell git rev-list --tags --max-count=1)
VERSION := $(shell git describe --tags ${TAG})
.PHONY: build check fmt lint test test-race vet test-cover-html help install proto admin-app compose-up-dev
.DEFAULT_GOAL := build
PROTON_COMMIT := "3b6b44c18601494a2e8201f26cbf9c8335f0f0ea"
PROTON_COMMIT := "7523cfd3a676d3fb72d63c8c4f0476738a2217b3"

admin-app:
@echo " > generating admin build"
Expand Down
3 changes: 3 additions & 0 deletions core/aggregates/orgtokens/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ type Page struct {
type AggregatedToken struct {
Amount int64 `rql:"name=amount,type=number"`
Type string `rql:"name=type,type=string"`
Source string `rql:"name=source,type=string"`
Description string `rql:"name=description,type=string"`
UserID string `rql:"name=user_id,type=string"`
UserTitle string `rql:"name=user_title,type=string"`
Expand All @@ -59,6 +60,7 @@ func (s Service) Search(ctx context.Context, orgID string, query *rql.Query) (Or
type CSVExport struct {
Amount string `csv:"Amount"`
Type string `csv:"Type"`
Source string `csv:"Source"`
Description string `csv:"Description"`
UserID string `csv:"User ID"`
UserTitle string `csv:"User Title"`
Expand All @@ -71,6 +73,7 @@ func NewCSVExport(token AggregatedToken) CSVExport {
return CSVExport{
Amount: strconv.FormatInt(token.Amount, 10),
Type: token.Type,
Source: token.Source,
Description: token.Description,
UserID: token.UserID,
UserTitle: token.UserTitle,
Expand Down
1 change: 1 addition & 0 deletions internal/api/v1beta1connect/organization_tokens.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ func transformAggregatedTokenToPB(v svc.AggregatedToken) *frontierv1beta1.Search
return &frontierv1beta1.SearchOrganizationTokensResponse_OrganizationToken{
Amount: v.Amount,
Type: v.Type,
Source: v.Source,
Description: v.Description,
UserId: v.UserID,
UserTitle: v.UserTitle,
Expand Down
5 changes: 5 additions & 0 deletions internal/store/postgres/org_tokens_repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (

const (
COLUMN_TYPE = "type"
COLUMN_SOURCE = "source"
COLUMN_DESCRIPTION = "description"
COLUMN_USER_ID = "user_id"
COLUMN_ACCOUNT_ID = "account_id"
Expand All @@ -22,6 +23,7 @@ const (
type OrgToken struct {
Amount sql.NullInt64 `db:"token_amount"`
Type sql.NullString `db:"token_type"`
Source sql.NullString `db:"token_source"`
Description sql.NullString `db:"token_description"`
UserID sql.NullString `db:"token_user_id"`
UserTitle sql.NullString `db:"user_title"`
Expand All @@ -34,6 +36,7 @@ func (t *OrgToken) transformToAggregatedToken() svc.AggregatedToken {
return svc.AggregatedToken{
Amount: t.Amount.Int64,
Type: t.Type.String,
Source: t.Source.String,
Description: t.Description.String,
UserID: t.UserID.String,
UserTitle: t.UserTitle.String,
Expand Down Expand Up @@ -119,6 +122,7 @@ func (r OrgTokensRepository) buildBaseQuery(orgID string) *goqu.SelectDataset {
Select(
goqu.I(TABLE_BILLING_TRANSACTIONS+"."+COLUMN_AMOUNT).As("token_amount"),
goqu.I(TABLE_BILLING_TRANSACTIONS+"."+COLUMN_TYPE).As("token_type"),
goqu.I(TABLE_BILLING_TRANSACTIONS+"."+COLUMN_SOURCE).As("token_source"),
goqu.I(TABLE_BILLING_TRANSACTIONS+"."+COLUMN_DESCRIPTION).As("token_description"),
goqu.I(TABLE_BILLING_TRANSACTIONS+"."+COLUMN_USER_ID).As("token_user_id"),
goqu.I(TABLE_USERS+".title").As("user_title"),
Expand All @@ -144,6 +148,7 @@ func (r OrgTokensRepository) addFilter(query *goqu.SelectDataset, filter rql.Fil
COLUMN_TITLE: TABLE_USERS + "." + COLUMN_TITLE,
COLUMN_DESCRIPTION: TABLE_BILLING_TRANSACTIONS + "." + COLUMN_DESCRIPTION,
COLUMN_TYPE: TABLE_BILLING_TRANSACTIONS + "." + COLUMN_TYPE,
COLUMN_SOURCE: TABLE_BILLING_TRANSACTIONS + "." + COLUMN_SOURCE,
COLUMN_AMOUNT: TABLE_BILLING_TRANSACTIONS + "." + COLUMN_AMOUNT,
COLUMN_CREATED_AT: TABLE_BILLING_TRANSACTIONS + "." + COLUMN_CREATED_AT,
}
Expand Down
12 changes: 6 additions & 6 deletions internal/store/postgres/org_tokens_repository_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func TestOrgTokensRepository_prepareDataQuery(t *testing.T) {
Limit: 10,
Offset: 20,
},
wantSQL: `SELECT "billing_transactions"."amount" AS "token_amount", "billing_transactions"."type" AS "token_type", "billing_transactions"."description" AS "token_description", "billing_transactions"."user_id" AS "token_user_id", "users"."title" AS "user_title", "users"."avatar" AS "user_avatar", "billing_transactions"."created_at" AS "token_created_at", "billing_customers"."org_id" AS "org_id" FROM "billing_transactions" INNER JOIN "billing_customers" ON ("billing_transactions"."account_id" = "billing_customers"."id") LEFT JOIN "users" ON CASE WHEN "billing_transactions"."user_id" IS NOT NULL AND "billing_transactions"."user_id" != '' THEN CAST("billing_transactions"."user_id" AS uuid) = "users"."id" ELSE false END WHERE ("billing_customers"."org_id" = $1) LIMIT $2 OFFSET $3`,
wantSQL: `SELECT "billing_transactions"."amount" AS "token_amount", "billing_transactions"."type" AS "token_type", "billing_transactions"."source" AS "token_source", "billing_transactions"."description" AS "token_description", "billing_transactions"."user_id" AS "token_user_id", "users"."title" AS "user_title", "users"."avatar" AS "user_avatar", "billing_transactions"."created_at" AS "token_created_at", "billing_customers"."org_id" AS "org_id" FROM "billing_transactions" INNER JOIN "billing_customers" ON ("billing_transactions"."account_id" = "billing_customers"."id") LEFT JOIN "users" ON CASE WHEN "billing_transactions"."user_id" IS NOT NULL AND "billing_transactions"."user_id" != '' THEN CAST("billing_transactions"."user_id" AS uuid) = "users"."id" ELSE false END WHERE ("billing_customers"."org_id" = $1) LIMIT $2 OFFSET $3`,
wantParams: []interface{}{"org123", int64(10), int64(20)},
wantErr: false,
},
Expand All @@ -41,7 +41,7 @@ func TestOrgTokensRepository_prepareDataQuery(t *testing.T) {
Limit: 10,
Offset: 30,
},
wantSQL: `SELECT "billing_transactions"."amount" AS "token_amount", "billing_transactions"."type" AS "token_type", "billing_transactions"."description" AS "token_description", "billing_transactions"."user_id" AS "token_user_id", "users"."title" AS "user_title", "users"."avatar" AS "user_avatar", "billing_transactions"."created_at" AS "token_created_at", "billing_customers"."org_id" AS "org_id" FROM "billing_transactions" INNER JOIN "billing_customers" ON ("billing_transactions"."account_id" = "billing_customers"."id") LEFT JOIN "users" ON CASE WHEN "billing_transactions"."user_id" IS NOT NULL AND "billing_transactions"."user_id" != '' THEN CAST("billing_transactions"."user_id" AS uuid) = "users"."id" ELSE false END WHERE (("billing_customers"."org_id" = $1) AND ("billing_transactions"."amount" >= $2)) LIMIT $3 OFFSET $4`,
wantSQL: `SELECT "billing_transactions"."amount" AS "token_amount", "billing_transactions"."type" AS "token_type", "billing_transactions"."source" AS "token_source", "billing_transactions"."description" AS "token_description", "billing_transactions"."user_id" AS "token_user_id", "users"."title" AS "user_title", "users"."avatar" AS "user_avatar", "billing_transactions"."created_at" AS "token_created_at", "billing_customers"."org_id" AS "org_id" FROM "billing_transactions" INNER JOIN "billing_customers" ON ("billing_transactions"."account_id" = "billing_customers"."id") LEFT JOIN "users" ON CASE WHEN "billing_transactions"."user_id" IS NOT NULL AND "billing_transactions"."user_id" != '' THEN CAST("billing_transactions"."user_id" AS uuid) = "users"."id" ELSE false END WHERE (("billing_customers"."org_id" = $1) AND ("billing_transactions"."amount" >= $2)) LIMIT $3 OFFSET $4`,
wantParams: []interface{}{"org123", int64(1000), int64(10), int64(30)},
wantErr: false,
},
Expand All @@ -60,7 +60,7 @@ func TestOrgTokensRepository_prepareDataQuery(t *testing.T) {
Limit: 10,
Offset: 40,
},
wantSQL: `SELECT "billing_transactions"."amount" AS "token_amount", "billing_transactions"."type" AS "token_type", "billing_transactions"."description" AS "token_description", "billing_transactions"."user_id" AS "token_user_id", "users"."title" AS "user_title", "users"."avatar" AS "user_avatar", "billing_transactions"."created_at" AS "token_created_at", "billing_customers"."org_id" AS "org_id" FROM "billing_transactions" INNER JOIN "billing_customers" ON ("billing_transactions"."account_id" = "billing_customers"."id") LEFT JOIN "users" ON CASE WHEN "billing_transactions"."user_id" IS NOT NULL AND "billing_transactions"."user_id" != '' THEN CAST("billing_transactions"."user_id" AS uuid) = "users"."id" ELSE false END WHERE (("billing_customers"."org_id" = $1) AND ("billing_transactions"."type" = $2) AND ((CAST("billing_transactions"."type" AS TEXT) ILIKE $3) OR (CAST("billing_transactions"."description" AS TEXT) ILIKE $4) OR (CAST("users"."title" AS TEXT) ILIKE $5) OR (CAST("billing_transactions"."amount" AS TEXT) ILIKE $6))) LIMIT $7 OFFSET $8`,
wantSQL: `SELECT "billing_transactions"."amount" AS "token_amount", "billing_transactions"."type" AS "token_type", "billing_transactions"."source" AS "token_source", "billing_transactions"."description" AS "token_description", "billing_transactions"."user_id" AS "token_user_id", "users"."title" AS "user_title", "users"."avatar" AS "user_avatar", "billing_transactions"."created_at" AS "token_created_at", "billing_customers"."org_id" AS "org_id" FROM "billing_transactions" INNER JOIN "billing_customers" ON ("billing_transactions"."account_id" = "billing_customers"."id") LEFT JOIN "users" ON CASE WHEN "billing_transactions"."user_id" IS NOT NULL AND "billing_transactions"."user_id" != '' THEN CAST("billing_transactions"."user_id" AS uuid) = "users"."id" ELSE false END WHERE (("billing_customers"."org_id" = $1) AND ("billing_transactions"."type" = $2) AND ((CAST("billing_transactions"."type" AS TEXT) ILIKE $3) OR (CAST("billing_transactions"."description" AS TEXT) ILIKE $4) OR (CAST("users"."title" AS TEXT) ILIKE $5) OR (CAST("billing_transactions"."amount" AS TEXT) ILIKE $6))) LIMIT $7 OFFSET $8`,
wantParams: []interface{}{"org123", "credit", "%test%", "%test%", "%test%", "%test%", int64(10), int64(40)},
wantErr: false,
},
Expand All @@ -84,7 +84,7 @@ func TestOrgTokensRepository_prepareDataQuery(t *testing.T) {
Limit: 10,
Offset: 50,
},
wantSQL: `SELECT "billing_transactions"."amount" AS "token_amount", "billing_transactions"."type" AS "token_type", "billing_transactions"."description" AS "token_description", "billing_transactions"."user_id" AS "token_user_id", "users"."title" AS "user_title", "users"."avatar" AS "user_avatar", "billing_transactions"."created_at" AS "token_created_at", "billing_customers"."org_id" AS "org_id" FROM "billing_transactions" INNER JOIN "billing_customers" ON ("billing_transactions"."account_id" = "billing_customers"."id") LEFT JOIN "users" ON CASE WHEN "billing_transactions"."user_id" IS NOT NULL AND "billing_transactions"."user_id" != '' THEN CAST("billing_transactions"."user_id" AS uuid) = "users"."id" ELSE false END WHERE (("billing_customers"."org_id" = $1) AND ("billing_transactions"."created_at" >= $2)) ORDER BY "billing_transactions"."created_at" DESC LIMIT $3 OFFSET $4`,
wantSQL: `SELECT "billing_transactions"."amount" AS "token_amount", "billing_transactions"."type" AS "token_type", "billing_transactions"."source" AS "token_source", "billing_transactions"."description" AS "token_description", "billing_transactions"."user_id" AS "token_user_id", "users"."title" AS "user_title", "users"."avatar" AS "user_avatar", "billing_transactions"."created_at" AS "token_created_at", "billing_customers"."org_id" AS "org_id" FROM "billing_transactions" INNER JOIN "billing_customers" ON ("billing_transactions"."account_id" = "billing_customers"."id") LEFT JOIN "users" ON CASE WHEN "billing_transactions"."user_id" IS NOT NULL AND "billing_transactions"."user_id" != '' THEN CAST("billing_transactions"."user_id" AS uuid) = "users"."id" ELSE false END WHERE (("billing_customers"."org_id" = $1) AND ("billing_transactions"."created_at" >= $2)) ORDER BY "billing_transactions"."created_at" DESC LIMIT $3 OFFSET $4`,
wantParams: []interface{}{"org123", "2024-01-01T00:00:00Z", int64(10), int64(50)},
wantErr: false,
},
Expand All @@ -105,7 +105,7 @@ func TestOrgTokensRepository_prepareDataQuery(t *testing.T) {
Limit: 10,
Offset: 25,
},
wantSQL: `SELECT "billing_transactions"."amount" AS "token_amount", "billing_transactions"."type" AS "token_type", "billing_transactions"."description" AS "token_description", "billing_transactions"."user_id" AS "token_user_id", "users"."title" AS "user_title", "users"."avatar" AS "user_avatar", "billing_transactions"."created_at" AS "token_created_at", "billing_customers"."org_id" AS "org_id" FROM "billing_transactions" INNER JOIN "billing_customers" ON ("billing_transactions"."account_id" = "billing_customers"."id") LEFT JOIN "users" ON CASE WHEN "billing_transactions"."user_id" IS NOT NULL AND "billing_transactions"."user_id" != '' THEN CAST("billing_transactions"."user_id" AS uuid) = "users"."id" ELSE false END WHERE ("billing_customers"."org_id" = $1) ORDER BY "billing_transactions"."type" DESC, "users"."title" ASC LIMIT $2 OFFSET $3`,
wantSQL: `SELECT "billing_transactions"."amount" AS "token_amount", "billing_transactions"."type" AS "token_type", "billing_transactions"."source" AS "token_source", "billing_transactions"."description" AS "token_description", "billing_transactions"."user_id" AS "token_user_id", "users"."title" AS "user_title", "users"."avatar" AS "user_avatar", "billing_transactions"."created_at" AS "token_created_at", "billing_customers"."org_id" AS "org_id" FROM "billing_transactions" INNER JOIN "billing_customers" ON ("billing_transactions"."account_id" = "billing_customers"."id") LEFT JOIN "users" ON CASE WHEN "billing_transactions"."user_id" IS NOT NULL AND "billing_transactions"."user_id" != '' THEN CAST("billing_transactions"."user_id" AS uuid) = "users"."id" ELSE false END WHERE ("billing_customers"."org_id" = $1) ORDER BY "billing_transactions"."type" DESC, "users"."title" ASC LIMIT $2 OFFSET $3`,
wantParams: []interface{}{"org123", int64(10), int64(25)},
wantErr: false,
},
Expand All @@ -122,7 +122,7 @@ func TestOrgTokensRepository_prepareDataQuery(t *testing.T) {
Limit: 10,
Offset: 45,
},
wantSQL: `SELECT "billing_transactions"."amount" AS "token_amount", "billing_transactions"."type" AS "token_type", "billing_transactions"."description" AS "token_description", "billing_transactions"."user_id" AS "token_user_id", "users"."title" AS "user_title", "users"."avatar" AS "user_avatar", "billing_transactions"."created_at" AS "token_created_at", "billing_customers"."org_id" AS "org_id" FROM "billing_transactions" INNER JOIN "billing_customers" ON ("billing_transactions"."account_id" = "billing_customers"."id") LEFT JOIN "users" ON CASE WHEN "billing_transactions"."user_id" IS NOT NULL AND "billing_transactions"."user_id" != '' THEN CAST("billing_transactions"."user_id" AS uuid) = "users"."id" ELSE false END WHERE (("billing_customers"."org_id" = $1) AND (("billing_transactions"."description" IS NULL) OR ("billing_transactions"."description" = $2))) LIMIT $3 OFFSET $4`,
wantSQL: `SELECT "billing_transactions"."amount" AS "token_amount", "billing_transactions"."type" AS "token_type", "billing_transactions"."source" AS "token_source", "billing_transactions"."description" AS "token_description", "billing_transactions"."user_id" AS "token_user_id", "users"."title" AS "user_title", "users"."avatar" AS "user_avatar", "billing_transactions"."created_at" AS "token_created_at", "billing_customers"."org_id" AS "org_id" FROM "billing_transactions" INNER JOIN "billing_customers" ON ("billing_transactions"."account_id" = "billing_customers"."id") LEFT JOIN "users" ON CASE WHEN "billing_transactions"."user_id" IS NOT NULL AND "billing_transactions"."user_id" != '' THEN CAST("billing_transactions"."user_id" AS uuid) = "users"."id" ELSE false END WHERE (("billing_customers"."org_id" = $1) AND (("billing_transactions"."description" IS NULL) OR ("billing_transactions"."description" = $2))) LIMIT $3 OFFSET $4`,
wantParams: []interface{}{"org123", "", int64(10), int64(45)},
wantErr: false,
},
Expand Down
Loading
Loading