Skip to content

Commit 696e541

Browse files
Added structure for PostgreSQL database archival
1 parent 2ee4b1f commit 696e541

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

internal/session/model.go

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,3 +74,28 @@ type SessionView struct {
7474
LastActiveAt time.Time `json:"lastActiveAt"`
7575
Expiry time.Time `json:"expiry"`
7676
}
77+
78+
/* session information structure in archival database */
79+
type ArchivedSession struct {
80+
ID string `db:"id"`
81+
Username string `db:"username"`
82+
IP string `db:"ip"`
83+
UserAgent string `db:"user_agent"`
84+
Status string `db:"status"`
85+
CreatedAt time.Time `db:"created_at"`
86+
LastActiveAt time.Time `db:"last_active_at"`
87+
Expiry time.Time `db:"expiry"`
88+
CompletedCount int `db:"completed_count"`
89+
FailedCount int `db:"failed_count"`
90+
ArchivedAt time.Time `db:"archived_at"`
91+
}
92+
93+
/* NOTE: Still in development */
94+
/* transaction information structure in archival database */
95+
type ArchivedTransaction struct {
96+
ID string `db:"id"`
97+
SessionID string `db:"session_id"`
98+
Status string `db:"status"`
99+
Output string `db:"output"`
100+
CreatedAt time.Time `db:"created_at"`
101+
}

0 commit comments

Comments
 (0)