data layer

This commit is contained in:
2026-05-25 08:38:26 +07:00
parent 4e8c11d545
commit a428170fef
81 changed files with 3941 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
package model
import "time"
// Profile is the unified-profile shape returned by /profiles/:id. The
// underlying table is owned by cdp-ingestion (identity-resolution).
type Profile struct {
ID string `json:"id"`
WorkspaceID string `json:"workspace_id"`
UserID string `json:"user_id,omitempty"`
AnonymousIDs []string `json:"anonymous_ids,omitempty"`
Traits map[string]any `json:"traits,omitempty"`
FirstSeenAt time.Time `json:"first_seen_at"`
LastSeenAt time.Time `json:"last_seen_at"`
}
// SavedQuery mirrors the saved_queries table.
type SavedQuery struct {
ID string `json:"id"`
WorkspaceID string `json:"workspace_id"`
OwnerID string `json:"owner_id,omitempty"`
Name string `json:"name"`
Kind string `json:"kind"`
Spec map[string]any `json:"spec"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}