dto

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package dto provides data transfer objects for the events service.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateEventInput

type CreateEventInput struct {
	Title       string         `json:"title"`
	Datetime    time.Time      `json:"start_date"`
	Duration    time.Duration  `json:"end_date"`
	UserID      string         `json:"user_id"`
	Description *string        `json:"description,omitempty"`
	RemindIn    *time.Duration `json:"remind_in,omitempty"`
}

CreateEventInput represents the input for creating an event.

type DateFilterInput

type DateFilterInput struct {
	Date   time.Time `json:"date"`
	UserID *string   `json:"user_id"`
	Period Period    `json:"period"`
}

DateFilterInput represents the input for getters by a fixed period, starting from a specific date.

type DateRangeInput

type DateRangeInput struct {
	DateStart time.Time `json:"date_start"`
	DateEnd   time.Time `json:"date_end"`
	UserID    *string   `json:"user_id"`
}

DateRangeInput represents the input for getters by a range of dates.

type Period

type Period uint8

Period represents a period of time.

const (
	Day Period = iota
	Week
	Month
)

Possible values for Period.

func (Period) MarshalJSON

func (p Period) MarshalJSON() ([]byte, error)

MarshalJSON impelements custom JSON marshaling for Period type.

func (Period) String

func (p Period) String() string

String returns a string representation of the Period.

type UpdateEventInput

type UpdateEventInput struct {
	ID          uuid.UUID      `json:"id"`
	Title       *string        `json:"title,omitempty"`
	Datetime    *time.Time     `json:"start_date,omitempty"`
	Duration    *time.Duration `json:"end_date,omitempty"`
	UserID      *string        `json:"user_id,omitempty"`
	Description *string        `json:"description,omitempty"`
	RemindIn    *time.Duration `json:"remind_in,omitempty"`
}

UpdateEventInput represents the input for updating an event.

Jump to

Keyboard shortcuts

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