feat: account deletion
This commit is contained in:
parent
4769760b93
commit
2db260f849
20 changed files with 785 additions and 29 deletions
30
internal/model/account_deletion_request.go
Normal file
30
internal/model/account_deletion_request.go
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
package model
|
||||
|
||||
import "time"
|
||||
|
||||
const (
|
||||
AccountDeletionStatusPending = "pending"
|
||||
AccountDeletionStatusProcessing = "processing"
|
||||
AccountDeletionStatusCompleted = "completed"
|
||||
AccountDeletionStatusFailed = "failed"
|
||||
)
|
||||
|
||||
// AccountDeletionRequest is both the work queue entry and the historical
|
||||
// audit record for an account deletion. The row is created when the user
|
||||
// confirms deletion, transitions through processing, and is kept after
|
||||
// completion as the audit trail (the related user row is gone by then).
|
||||
type AccountDeletionRequest struct {
|
||||
ID string `db:"id"`
|
||||
UserID string `db:"user_id"`
|
||||
Email string `db:"email"`
|
||||
Name *string `db:"name"`
|
||||
Reason *string `db:"reason"`
|
||||
IPAddress *string `db:"ip_address"`
|
||||
Status string `db:"status"`
|
||||
Attempts int `db:"attempts"`
|
||||
LastError *string `db:"last_error"`
|
||||
SpacesDeleted *int `db:"spaces_deleted"`
|
||||
RequestedAt time.Time `db:"requested_at"`
|
||||
UpdatedAt time.Time `db:"updated_at"`
|
||||
CompletedAt *time.Time `db:"completed_at"`
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue