all repos

onasty @ 743648cdf5229ae1e3b209c464e14b09d7a43711

a one-time notes service

onasty/internal/dtos/note.go (view raw)

Oleksandr Smirnov Oleksandr Smirnov
olexsmir@gmail.com
refactor!: rename "burn before expiration" to "keep before expiration" (#199)..., 9 months ago
1
package dtos
2
3
import (
4
	"time"
5
6
	"github.com/gofrs/uuid/v5"
7
)
8
9
type NoteSlug = string
10
11
type GetNote struct {
12
	Content              string
13
	KeepBeforeExpiration bool
14
	ReadAt               time.Time
15
	CreatedAt            time.Time
16
	ExpiresAt            time.Time
17
}
18
19
type NoteMetadata struct {
20
	HasPassword bool
21
	CreatedAt   time.Time
22
}
23
24
type CreateNote struct {
25
	Content              string
26
	UserID               uuid.UUID
27
	Slug                 NoteSlug
28
	KeepBeforeExpiration bool
29
	Password             string
30
	CreatedAt            time.Time
31
	ExpiresAt            time.Time
32
}
33
34
type NoteDetailed struct {
35
	Content              string
36
	Slug                 NoteSlug
37
	KeepBeforeExpiration bool
38
	HasPassword          bool
39
	CreatedAt            time.Time
40
	ExpiresAt            time.Time
41
	ReadAt               time.Time
42
}
43
44
type PatchNote struct {
45
	ExpiresAt            *time.Time
46
	KeepBeforeExpiration *bool
47
}