note

package
v0.0.0-...-e6240ef Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 7, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	NOTE_ALREADY_ARCHIVED_ERROR = domain.NewErrorCode(4101, "NOTE_ALREADY_ARCHIVED_ERROR", "note is already archived")
	NOTE_ALREADY_ACTIVE_ERROR   = domain.NewErrorCode(4102, "NOTE_ALREADY_ACTIVE_ERROR", "note is already activated")
)

Functions

This section is empty.

Types

type ArchiveNote

type ArchiveNote struct {
	UserId int64  `validate:"required"`
	NoteId string `validate:"required,uuid4"`
}

type CreateNote

type CreateNote struct {
	UserEmail string `validate:"required,email"`
	Title     string `validate:"required,gte=1,printascii"`
	Content   string `validate:"required,gte=1,printascii"`
}

type DeleteNote

type DeleteNote struct {
	UserId int64  `validate:"required"`
	NoteId string `validate:"required,uuid4"`
}

type GetNoteById

type GetNoteById struct {
	UserId int64  `validate:"required"`
	NoteId string `validate:"required,uuid4"`
}

type GetNotesByUserEmail

type GetNotesByUserEmail struct {
	UserEmail string `validate:"required,email"`
	Status    entity.NoteStatus
}

type NotesUseCase

type NotesUseCase struct {
	// contains filtered or unexported fields
}

func NewNotesUseCase

func NewNotesUseCase(notesRepository repository.NotesRepository, usersRepository repository.UserRepository) *NotesUseCase

func (*NotesUseCase) ArchiveNote

func (u *NotesUseCase) ArchiveNote(ctx context.Context, data ArchiveNote) *domain.Error

func (*NotesUseCase) CreateNote

func (u *NotesUseCase) CreateNote(ctx context.Context, data CreateNote) (noteId string, err *domain.Error)

func (*NotesUseCase) DeleteNote

func (u *NotesUseCase) DeleteNote(ctx context.Context, data DeleteNote) *domain.Error

func (*NotesUseCase) GetNoteById

func (u *NotesUseCase) GetNoteById(ctx context.Context, data GetNoteById) (note entity.Note, err *domain.Error)

func (*NotesUseCase) GetNotesByUserEmail

func (u *NotesUseCase) GetNotesByUserEmail(ctx context.Context, data GetNotesByUserEmail) (notes []entity.Note, err *domain.Error)

func (*NotesUseCase) UnArchiveNote

func (u *NotesUseCase) UnArchiveNote(ctx context.Context, data UnArchiveNote) *domain.Error

func (*NotesUseCase) UpdateNote

func (u *NotesUseCase) UpdateNote(ctx context.Context, data UpdateNote) *domain.Error

type UnArchiveNote

type UnArchiveNote struct {
	UserId int64  `validate:"required"`
	NoteId string `validate:"required,uuid4"`
}

type UpdateNote

type UpdateNote struct {
	UserId  int64  `validate:"required"`
	NoteId  string `validate:"required,uuid"`
	Title   string `validate:"required,gte=1,printascii"`
	Content string `validate:"required,gte=1,printascii"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL