Logo GenPRES

Dto Module

Holds the serializable shape of the totals, each total as a text block Dto, a state, a norm and whether the norm is custom, and converts totals to and from the Dto.

Types

Type Description

Dto

NormDto

A norm with its bounds; a bound is None when absent.

TotalDto

A total as its text block Dto, its state as text, its norm, and whether the norm is custom.

Functions and values

Function or value Description

fromDto dto

Full Usage: fromDto dto

Parameters:
Returns: Result<Totals, DtoError list>

Reads the text block and the state of every total. A Dto that is null after JSON deserialization gives DtoError.Missing "Totals", a block with an unknown kind gives DtoError.UnknownTextKind, and an unknown state gives DtoError.UnknownTotalState.

dto : Dto
Returns: Result<Totals, DtoError list>

normFromDto dto

Full Usage: normFromDto dto

Parameters:
Returns: TotalNorm

Reads a norm from its Dto. A name that is null after JSON deserialization reads as the empty name.

dto : NormDto
Returns: TotalNorm

normToDto norm

Full Usage: normToDto norm

Parameters:
Returns: NormDto

Maps a norm to its Dto.

norm : TotalNorm
Returns: NormDto

stateFromString _arg1

Full Usage: stateFromString _arg1

Parameters:
    _arg1 : string

Returns: Result<TotalState, DtoError>

Returns the total state of its text, or DtoError.UnknownTotalState for an unknown text.

_arg1 : string
Returns: Result<TotalState, DtoError>

stateToString _arg1

Full Usage: stateToString _arg1

Parameters:
Returns: string

Returns the text of a total state, as the Dto stores it.

_arg1 : TotalState
Returns: string

toDto t

Full Usage: toDto t

Parameters:
Returns: Dto
t : Totals
Returns: Dto

totalFromDto dto

Full Usage: totalFromDto dto

Parameters:
Returns: Result<IntakeTotal, DtoError>

Reads a total from its Dto: UnknownTextKind for a block of an unknown kind, UnknownTotalState for an unknown state.

dto : TotalDto
Returns: Result<IntakeTotal, DtoError>

totalToDto t

Full Usage: totalToDto t

Parameters:
Returns: TotalDto

Maps a total to its Dto.

t : IntakeTotal
Returns: TotalDto

Type something to start searching.