Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

## 3.7.3
- Refactor `CaclInput`.

## 3.7.2

- Remove unused properties `mapLayerId` and `poisIds` from `MapLayerInput`
Expand Down
46 changes: 14 additions & 32 deletions lib/src/ats/ats.freezed.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 7 additions & 2 deletions lib/src/ats/src/cacl/input/cacl_equipment_input.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ part of '../../../ats.dart';
/// A model class representing a cacl equipment input.
@unfreezed
abstract class CaclEquipmentInput with _$CaclEquipmentInput {
CaclEquipmentInput._() {
measuringTape ??= EquipmentMeasurementInput();
densimeter ??= EquipmentMeasurementInput();
thermometer ??= EquipmentMeasurementInput();
}

/// Creates a new [CaclEquipmentInput] instance.
factory CaclEquipmentInput({
/// The [measuringTape] parameter is the measuringTape of the cacl equipment input.
Expand All @@ -18,6 +24,5 @@ abstract class CaclEquipmentInput with _$CaclEquipmentInput {
/// Creates a new [CaclEquipmentInput] instance from a JSON map.
///
/// The [json] parameter is the JSON map to create the instance from.
factory CaclEquipmentInput.fromJson(Map<String, dynamic> json) =>
_$CaclEquipmentInputFromJson(json);
factory CaclEquipmentInput.fromJson(Map<String, dynamic> json) => _$CaclEquipmentInputFromJson(json);
}
13 changes: 11 additions & 2 deletions lib/src/ats/src/cacl/input/cacl_input.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,17 @@ part of '../../../ats.dart';

/// A model class representing a cacl input.
@unfreezed
abstract class CaclInput with _$CaclInput {
/// Creates a new [CaclInput] instance.
sealed class CaclInput with _$CaclInput {
CaclInput._() {
// Inicialización de valores no constantes
measurements ??= MeasurementsInput();
results ??= ResultsInput();
volumeMoved ??= VolumeMovedInput();
measurer01 ??= CaclMeasurement();
measurer02 ??= CaclMeasurement();
equipments ??= CaclEquipmentInput();
}

factory CaclInput({
/// The [id] parameter is the id of the cacl input.
String? id,
Expand Down
16 changes: 13 additions & 3 deletions lib/src/ats/src/cacl/input/measurements_input.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,18 @@ part of '../../../ats.dart';

/// A model class representing a measurements input.
@unfreezed
abstract class MeasurementsInput with _$MeasurementsInput {
sealed class MeasurementsInput with _$MeasurementsInput {
MeasurementsInput._() {
referenceHeight ??= MeasurementInput();
productLevelHeight ??= MeasurementInput();
correctedLevelHeight ??= MeasurementInput();
waterHeight ??= MeasurementInput();
ambientLineVolume ??= MeasurementInput();
ambientDensity ??= MeasurementInput();
ambientTemperature ??= MeasurementInput();
averageTankTemperature ??= MeasurementInput();
}

/// Creates a new [MeasurementsInput] instance.
factory MeasurementsInput({
/// The [referenceHeight] parameter is the referenceHeight of the measurements input.
Expand Down Expand Up @@ -33,6 +44,5 @@ abstract class MeasurementsInput with _$MeasurementsInput {
/// Creates a new [MeasurementsInput] instance from a JSON map.
///
/// The [json] parameter is the JSON map to create the instance from.
factory MeasurementsInput.fromJson(Map<String, dynamic> json) =>
_$MeasurementsInputFromJson(json);
factory MeasurementsInput.fromJson(Map<String, dynamic> json) => _$MeasurementsInputFromJson(json);
}
13 changes: 12 additions & 1 deletion lib/src/ats/src/cacl/input/results_input.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,18 @@ part of '../../../ats.dart';

/// A model class representing a results input.
@unfreezed
abstract class ResultsInput with _$ResultsInput {
sealed class ResultsInput with _$ResultsInput {
ResultsInput._() {
environmentalTankVolume ??= MeasurementInput();
waterVolume ??= MeasurementInput();
densityAt20 ??= MeasurementInput();
volumeCorrectionFactor ??= MeasurementInput();
alcoholicContent ??= MeasurementInput();
environmentalVolume ??= MeasurementInput();
volumeAt20 ??= MeasurementInput();
kilogramsAt20 ??= MeasurementInput();
}

/// Creates a new [ResultsInput] instance.
factory ResultsInput({
/// The [environmentalTankVolume] parameter is the environmentalTankVolume of the results input.
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
description: Layrz API models for Dart/Flutter. This package contains the models used by the Layrz API.
name: layrz_models
version: "3.7.2"
version: "3.7.3"
repository: https://github.com/goldenm-software/layrz_models

environment:
Expand Down
Loading