wastewater

package
v0.0.0-...-60c21ee Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2024 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

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

Service is the interface that wraps the Create, GetAll, GetByID, Update, and Delete methods.

func NewService

func NewService(wasteWaterRepository WasteWaterRepositoryInterface) *Service

NewService creates a new instance of the Service struct, initializing it with the provided WasteWaterRepositoryInterface.

Parameters: - wasteWaterRepository: The WasteWaterRepositoryInterface implementation used by the Service.

Returns: - A pointer to the newly created Service instance.

func (*Service) Create

Create creates a new waste water data record in the service.

ctx: The context.Context object for the request. w: The waste water data to be created. Returns an error if there was a problem creating the record.

func (*Service) Delete

func (s *Service) Delete(ctx context.Context, id string) error

Delete deletes a WasteWaterData by ID.

ctx - context.Context for the operation. id - string representing the ID of the data to be deleted. Returns an error if there was a problem deleting the data.

func (*Service) GetAll

func (s *Service) GetAll(ctx context.Context, page, limit int) ([]domain.WasteWaterData, error)

GetAll retrieves all waste water data with pagination.

ctx context.Context, page int, limit int []domain.WasteWaterData, error

func (*Service) GetByID

func (s *Service) GetByID(ctx context.Context, id string) (*domain.WasteWaterData, error)

GetByID retrieves a WasteWaterData by ID.

ctx - context.Context for the operation. id - string representing the ID of the data. Returns a pointer to domain.WasteWaterData and an error.

func (*Service) Update

func (s *Service) Update(ctx context.Context, w *domain.WasteWaterData) error

Update updates a WasteWaterData.

ctx - context.Context for the operation. w - pointer to domain.WasteWaterData representing the data to be updated. Returns an error if there was a problem updating the data.

type WasteWaterRepositoryInterface

type WasteWaterRepositoryInterface interface {
	Create(ctx context.Context, w *domain.WastewaterDataRequest) error
	GetAll(ctx context.Context, page, limit int) ([]domain.WasteWaterData, error)
	GetByID(ctx context.Context, id string) (*domain.WasteWaterData, error)
	Update(ctx context.Context, w *domain.WasteWaterData) error
	Delete(ctx context.Context, id string) error
}

WasteWaterRepositoryInterface is the interface that wraps the Create, GetAll, GetByID, Update, and Delete methods.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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