feat: add file move and trash retention
All checks were successful
CI / hygiene (push) Successful in 2s
Build and Deploy / build-and-deploy (push) Successful in 30s
CI / test (push) Successful in 19s

This commit is contained in:
Grendgi
2026-06-16 14:40:28 +03:00
parent 2723f20ab0
commit 3de4e5dfe7
7 changed files with 176 additions and 13 deletions

View File

@@ -1,6 +1,9 @@
package model
import "time"
import (
"errors"
"time"
)
const (
NodeTypeFolder = "folder"
@@ -12,6 +15,8 @@ const (
AccessEdit = "edit"
)
var ErrInvalidMove = errors.New("invalid move")
type Node struct {
ID string `json:"id"`
ParentID *string `json:"parent_id,omitempty"`
@@ -32,6 +37,8 @@ type Node struct {
EffectiveAccess string `json:"effective_access"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
TrashedAt *time.Time `json:"trashed_at,omitempty"`
PurgeAfter *time.Time `json:"purge_after,omitempty"`
DeletedAt *time.Time `json:"deleted_at,omitempty"`
}
@@ -52,6 +59,10 @@ type UpdateNodeRequest struct {
Title *string `json:"title"`
}
type MoveNodeRequest struct {
ParentID *string `json:"parent_id"`
}
type ReplaceAccessRequest struct {
Access []Access `json:"access"`
}