permit

package
v0.0.0-...-4109721 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package permit provides a core business API of a permit.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateContent

func CreateContent(operationType string, perm Permit) (string, error)

CreateContent creates a message application permit and returns the message in base64.

Types

type Application

type Application struct {
	ID        int       `json:"application_id"`
	Status    string    `json:"status"`
	CatalogID uuid.UUID `json:"catalog_id"`
	Form      any       `json:"form"`
}

An Application contains the data needed to apply for a permit.

type ApplicationUpdate

type ApplicationUpdate struct {
	Status string `jsons:"status"`
	Detail any    `jsons:"detail"`
}

ApplicationUpdate defines what information may be provided to modify an existing Application permit.

type Core

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

Core manages the set of APIs for permit.

func NewCore

func NewCore(logger *slog.Logger, db *sqlx.DB) *Core

NewCore constructs the permit acces API.

func (*Core) Create

func (c *Core) Create(ctx context.Context, apl Application) error

Create creates an application to a permit.

func (*Core) FetchAll

func (c *Core) FetchAll(ctx context.Context) ([]Application, error)

FetchAll gets all a applications permit.

func (*Core) Retrieve

func (c *Core) Retrieve(ctx context.Context, aplID int) (Application, error)

Retrieve application permit.

func (*Core) Update

func (c *Core) Update(ctx context.Context, aplID int, aplUpdate ApplicationUpdate) (Application, error)

Update updates an application permit.

type Permit

type Permit struct {
	Application Application `json:"application"`
}

A Permit is the payload of a message permit.

func New

func New(application Application) Permit

New is a factory function to create a Permit.

Directories

Path Synopsis
Package permitdb contains permit related CRUD functionality.
Package permitdb contains permit related CRUD functionality.

Jump to

Keyboard shortcuts

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