propertygrp

package
v0.0.0-...-c2300e3 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppBlock

type AppBlock struct {
	ID         string     `json:"id"`
	PropertyID string     `json:"propertyID"`
	Name       string     `json:"name"`
	Floors     []AppFloor `json:"floors"`
	Status     string     `json:"status"`
	CreatedAt  string     `json:"createdAt"`
	UpdatedAt  string     `json:"updatedAt"`
}

type AppFloor

type AppFloor struct {
	ID         string    `json:"id"`
	Name       string    `json:"name"`
	PropertyID string    `json:"propertyID"`
	BlockID    string    `json:"blockID"`
	Units      []AppUnit `json:"units"`
	Status     string    `json:"status"`
	CreatedAt  string    `json:"createdAt"`
	UpdatedAt  string    `json:"updatedAt"`
}

type AppNewBlock

type AppNewBlock struct {
	Name   string        `json:"name" validate:"required"`
	Floors []AppNewFloor `json:"floors" validate:"required"`
}

type AppNewFloor

type AppNewFloor struct {
	Name  string       `json:"name" validate:"required"`
	Units []AppNewUnit `json:"units" validate:"required"`
}

type AppNewProperty

type AppNewProperty struct {
	ManagerID       uuid.UUID     `json:"-"`
	Name            string        `json:"name" validate:"required"`
	AddressLevel1ID uint32        `json:"addressLevel1ID" validate:"required,min=1"`
	AddressLevel2ID uint32        `json:"addressLevel2ID" validate:"required,min=1"`
	AddressLevel3ID uint32        `json:"addressLevel3ID" validate:"required,min=1"`
	Street          string        `json:"street" validate:"required"`
	Status          string        `json:"status" validate:"required"`
	Blocks          []AppNewBlock `json:"blocks" validate:"required"`
}

func (AppNewProperty) Validate

func (r AppNewProperty) Validate() error

Validate checks the data in the model is considered clean.

type AppNewUnit

type AppNewUnit struct {
	Name string `json:"name" validate:"required"`
}

type AppProperty

type AppProperty struct {
	ID              string `json:"id"`
	ManagerID       string `json:"managerID"`
	Name            string `json:"name"`
	AddressLevel1ID uint32 `json:"addressLevel1ID"`
	AddressLevel2ID uint32 `json:"addressLevel2ID"`
	AddressLevel3ID uint32 `json:"addressLevel3ID"`
	Street          string `json:"street"`
	Status          string `json:"status"`
	CreatedAt       string `json:"createdAt"`
	UpdatedAt       string `json:"updatedAt"`
}

type AppPropertyDetail

type AppPropertyDetail struct {
	ID              string     `json:"id"`
	ManagerID       string     `json:"managerID"`
	Name            string     `json:"name"`
	AddressLevel1ID uint32     `json:"addressLevel1ID"`
	AddressLevel2ID uint32     `json:"addressLevel2ID"`
	AddressLevel3ID uint32     `json:"addressLevel3ID"`
	Street          string     `json:"street"`
	Status          string     `json:"status"`
	CreatedAt       string     `json:"createdAt"`
	UpdatedAt       string     `json:"updatedAt"`
	Blocks          []AppBlock `json:"blocks"`
}

type AppUnit

type AppUnit struct {
	ID         string `json:"id"`
	PropertyID string `json:"propertyID"`
	BlockID    string `json:"blockID"`
	FloorID    string `json:"floorID"`
	Name       string `json:"name"`
	Status     string `json:"status"`
	CreatedAt  string `json:"createdAt"`
	UpdatedAt  string `json:"updatedAt"`
}

type AppUpdateProperty

type AppUpdateProperty struct {
	Name            *string `json:"name"`
	AddressLevel1ID *uint32 `json:"addressLevel1ID" validate:"omitempty,min=1"`
	AddressLevel2ID *uint32 `json:"addressLevel2ID" validate:"omitempty,min=1"`
	AddressLevel3ID *uint32 `json:"addressLevel3ID" validate:"omitempty,min=1"`
	Street          *string `json:"street"`
	Status          *string `json:"status"`
}

func (AppUpdateProperty) Validate

func (r AppUpdateProperty) Validate() error

Validate checks the data in the model is considered clean.

type Handlers

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

func New

func New(
	property *property.Core,
	block *block.Core,
	floor *floor.Core,
	unit *unit.Core,
) *Handlers

func (*Handlers) Create

func (h *Handlers) Create(ctx context.Context, w http.ResponseWriter, r *http.Request) error

func (*Handlers) Delete

func (h *Handlers) Delete(ctx context.Context, w http.ResponseWriter, r *http.Request) error

func (*Handlers) QueryByManagerID

func (h *Handlers) QueryByManagerID(ctx context.Context, w http.ResponseWriter, r *http.Request) error

func (*Handlers) Update

func (h *Handlers) Update(ctx context.Context, w http.ResponseWriter, r *http.Request) error

Jump to

Keyboard shortcuts

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