Phase A: generierter Dart-Client + DI-Foundation für Rust-Backend
OpenAPI-Generator-Setup: - tool/generate_api_client.sh: Direkter Aufruf der openapi-generator-cli.jar (Java-CLI statt Dart-build_runner-Integration — vermeidet die analyzer-/source_gen-Version-Hölle mit json_serializable) - tool/fetch_openapi_generator.sh: lädt die JAR (29 MB) nach (gitignored) - openapi/holzleitner.json: Snapshot der Backend-Spec für reproduzierbare Generation - packages/holzleitner_api/: generiertes Dart-Sub-Package (built_value + dio), per path-dep im Haupt-pubspec eingehängt Netzwerk-Layer (lib/data/network/): - BackendConfig: API- und Keycloak-Endpoints für Local-Dev (localhost wegen Keycloak-iss-Claim). - AuthTokenProvider-Schnittstelle. - DevPasswordGrantTokenProvider: Phase-A-Provider via Keycloak password-grant, Token-Caching mit Expiry-Check (Phase B ersetzt das durch flutter_appauth PKCE). - HolzleitnerAuthInterceptor: dynamischer Bearer-Inject pro Request. - HolzleitnerApiFactory: baut die generierte HolzleitnerApi-Klasse mit unserem Interceptor statt der vier Default-Auth-Interceptors. - network_locator.registerNetworking(): get_it-Setup, in main() vor runApp() aufgerufen. Clean-Arch-Scaffolding (lib/data/, lib/domain/): - Verzeichnisstruktur für Phase C+D angelegt (mapper/, repository/, entity/, repository/) — befüllt sich in den Folge-Phasen. Smoke-Test: - tool/smoke_test_api.dart ruft /health (ungeschützt) und /me/cars (mit Bearer) via generiertem Client — grün gegen lokales Backend.
This commit is contained in:
9
.gitignore
vendored
9
.gitignore
vendored
@ -43,3 +43,12 @@ app.*.map.json
|
||||
/android/app/debug
|
||||
/android/app/profile
|
||||
/android/app/release
|
||||
|
||||
# OpenAPI-Generator
|
||||
# - JAR wird per tool/fetch_openapi_generator.sh nachgeladen (nicht im Repo)
|
||||
# - Generierter Code in packages/holzleitner_api/ wird commited,
|
||||
# nur Build-Outputs werden ignoriert
|
||||
tool/openapi-generator-cli.jar
|
||||
packages/holzleitner_api/.dart_tool/
|
||||
packages/holzleitner_api/build/
|
||||
packages/holzleitner_api/pubspec.lock
|
||||
|
||||
0
lib/data/mapper/.gitkeep
Normal file
0
lib/data/mapper/.gitkeep
Normal file
9
lib/data/network/auth_token_provider.dart
Normal file
9
lib/data/network/auth_token_provider.dart
Normal file
@ -0,0 +1,9 @@
|
||||
/// Schnittstelle, über die HTTP-Interceptors einen aktuellen
|
||||
/// Access-Token beziehen. Phase A liefert das eine simple
|
||||
/// Password-Grant-Implementation; Phase B (Keycloak OIDC mit
|
||||
/// flutter_appauth) ersetzt sie durch eine echte PKCE-/Refresh-fähige.
|
||||
abstract interface class AuthTokenProvider {
|
||||
/// Liefert einen aktuell gültigen Access-Token oder `null`, wenn
|
||||
/// keine Session aktiv ist. Darf bei Bedarf einen Refresh anstoßen.
|
||||
Future<String?> currentAccessToken();
|
||||
}
|
||||
48
lib/data/network/backend_config.dart
Normal file
48
lib/data/network/backend_config.dart
Normal file
@ -0,0 +1,48 @@
|
||||
/// Endpoint-Konfiguration für das Rust-Backend.
|
||||
///
|
||||
/// Dies ist eine Übergangs-Konfiguration für Phase A der
|
||||
/// Backend-Migration. Sie wird in Phase D durch eine umfassendere
|
||||
/// `LocalDocuFrameConfiguration`-Ablösung ersetzt (oder die bestehende
|
||||
/// Konfiguration wird erweitert).
|
||||
///
|
||||
/// **Werte für lokale Entwicklung:**
|
||||
/// * iOS-Simulator + macOS-Host: `http://127.0.0.1:3000`
|
||||
/// * Android-Emulator: `http://10.0.2.2:3000`
|
||||
/// * Echtes Gerät im LAN: `http://<host-IP>:3000`
|
||||
///
|
||||
/// Default ist iOS-Simulator-tauglich. Für Android-Build vor dem
|
||||
/// Compile umstellen — eine Auto-Erkennung pro Platform kommt mit der
|
||||
/// Phase-D-Config.
|
||||
class BackendConfig {
|
||||
const BackendConfig({
|
||||
required this.apiBaseUrl,
|
||||
required this.keycloakTokenEndpoint,
|
||||
required this.keycloakClientId,
|
||||
});
|
||||
|
||||
/// Basis-URL der Rust-API (kein abschließender Slash).
|
||||
final String apiBaseUrl;
|
||||
|
||||
/// Vollständiger Token-Endpoint des Keycloak-Realms — Format:
|
||||
/// `{issuer}/protocol/openid-connect/token`.
|
||||
final String keycloakTokenEndpoint;
|
||||
|
||||
/// Public-Client-Id, die das Backend als `audience` erwartet
|
||||
/// (aktuell `holzleitner-app`).
|
||||
final String keycloakClientId;
|
||||
|
||||
/// Default-Konfiguration für lokale Entwicklung gegen das
|
||||
/// Docker-Compose-Setup (Postgres + Keycloak + Backend).
|
||||
///
|
||||
/// **Achtung Hostname:** Keycloak prägt das `iss`-Claim des Tokens
|
||||
/// aus dem Hostnamen der Token-Endpoint-URL. Das Backend erwartet
|
||||
/// `iss = http://localhost:8080/realms/holzleitner`, deshalb hier
|
||||
/// `localhost` statt `127.0.0.1`. Auf Android-Emulator entsprechend
|
||||
/// `10.0.2.2` setzen.
|
||||
static const BackendConfig localDev = BackendConfig(
|
||||
apiBaseUrl: 'http://localhost:3000',
|
||||
keycloakTokenEndpoint:
|
||||
'http://localhost:8080/realms/holzleitner/protocol/openid-connect/token',
|
||||
keycloakClientId: 'holzleitner-app',
|
||||
);
|
||||
}
|
||||
73
lib/data/network/dev_password_grant_token_provider.dart
Normal file
73
lib/data/network/dev_password_grant_token_provider.dart
Normal file
@ -0,0 +1,73 @@
|
||||
import 'package:dio/dio.dart';
|
||||
|
||||
import 'auth_token_provider.dart';
|
||||
|
||||
/// **Nur für Phase A / Smoke-Tests.** Spricht direkt den Keycloak-
|
||||
/// Token-Endpoint mit `grant_type=password` an — bequem für
|
||||
/// Dev-Setups, in Produktion komplett ungeeignet (kein PKCE, keine
|
||||
/// Userinteraktion, Credentials in der App).
|
||||
///
|
||||
/// In Phase B ersetzt diese Klasse die KeycloakOidcTokenProvider-
|
||||
/// Implementierung, die auf flutter_appauth basiert.
|
||||
///
|
||||
/// Cached den Token im Speicher und erneuert ihn, sobald die
|
||||
/// Restlaufzeit unter 30 s fällt — kein eingebauter Refresh-Token-
|
||||
/// Flow, dafür einfach.
|
||||
class DevPasswordGrantTokenProvider implements AuthTokenProvider {
|
||||
DevPasswordGrantTokenProvider({
|
||||
required this.tokenEndpoint,
|
||||
required this.clientId,
|
||||
required this.username,
|
||||
required this.password,
|
||||
Dio? dio,
|
||||
}) : _dio = dio ?? Dio();
|
||||
|
||||
final Dio _dio;
|
||||
final String tokenEndpoint;
|
||||
final String clientId;
|
||||
final String username;
|
||||
final String password;
|
||||
|
||||
String? _cachedToken;
|
||||
DateTime? _expiresAt;
|
||||
|
||||
@override
|
||||
Future<String?> currentAccessToken() async {
|
||||
final now = DateTime.now();
|
||||
final cached = _cachedToken;
|
||||
final expiresAt = _expiresAt;
|
||||
if (cached != null &&
|
||||
expiresAt != null &&
|
||||
expiresAt.isAfter(now.add(const Duration(seconds: 30)))) {
|
||||
return cached;
|
||||
}
|
||||
|
||||
final response = await _dio.post<Map<String, dynamic>>(
|
||||
tokenEndpoint,
|
||||
data: {
|
||||
'grant_type': 'password',
|
||||
'client_id': clientId,
|
||||
'username': username,
|
||||
'password': password,
|
||||
'scope': 'openid',
|
||||
},
|
||||
options: Options(contentType: Headers.formUrlEncodedContentType),
|
||||
);
|
||||
|
||||
final data = response.data;
|
||||
if (data == null) {
|
||||
throw StateError('Keycloak token endpoint lieferte leeren Body');
|
||||
}
|
||||
final token = data['access_token'] as String?;
|
||||
final expiresIn = data['expires_in'] as int?;
|
||||
if (token == null || expiresIn == null) {
|
||||
throw StateError(
|
||||
'Keycloak token endpoint lieferte unerwartete Antwort: $data',
|
||||
);
|
||||
}
|
||||
|
||||
_cachedToken = token;
|
||||
_expiresAt = now.add(Duration(seconds: expiresIn));
|
||||
return token;
|
||||
}
|
||||
}
|
||||
35
lib/data/network/holzleitner_api_factory.dart
Normal file
35
lib/data/network/holzleitner_api_factory.dart
Normal file
@ -0,0 +1,35 @@
|
||||
import 'package:dio/dio.dart';
|
||||
import 'package:holzleitner_api/holzleitner_api.dart';
|
||||
|
||||
import 'auth_token_provider.dart';
|
||||
import 'backend_config.dart';
|
||||
import 'holzleitner_auth_interceptor.dart';
|
||||
|
||||
/// Baut den generierten `HolzleitnerApi`-Client mit:
|
||||
/// * eigener `Dio`-Instanz (Base-URL + Timeouts aus [BackendConfig]),
|
||||
/// * **ohne** die vier Default-Auth-Interceptors des Generators —
|
||||
/// stattdessen wird unser [HolzleitnerAuthInterceptor] gehängt.
|
||||
///
|
||||
/// Auf diese Weise bleibt die Token-Quelle pluggable
|
||||
/// ([AuthTokenProvider]), und Phase B (Keycloak OIDC) kann die
|
||||
/// Provider-Implementierung austauschen, ohne den Rest des Codes
|
||||
/// anzufassen.
|
||||
HolzleitnerApi buildHolzleitnerApi({
|
||||
required BackendConfig config,
|
||||
required AuthTokenProvider tokenProvider,
|
||||
}) {
|
||||
final dio = Dio(
|
||||
BaseOptions(
|
||||
baseUrl: config.apiBaseUrl,
|
||||
connectTimeout: const Duration(seconds: 10),
|
||||
receiveTimeout: const Duration(seconds: 30),
|
||||
sendTimeout: const Duration(seconds: 30),
|
||||
headers: const {'Accept': 'application/json'},
|
||||
),
|
||||
);
|
||||
|
||||
return HolzleitnerApi(
|
||||
dio: dio,
|
||||
interceptors: [HolzleitnerAuthInterceptor(tokenProvider)],
|
||||
);
|
||||
}
|
||||
33
lib/data/network/holzleitner_auth_interceptor.dart
Normal file
33
lib/data/network/holzleitner_auth_interceptor.dart
Normal file
@ -0,0 +1,33 @@
|
||||
import 'package:dio/dio.dart';
|
||||
|
||||
import 'auth_token_provider.dart';
|
||||
|
||||
/// Dio-Interceptor, der pro Request den aktuellen Access-Token vom
|
||||
/// `AuthTokenProvider` zieht und als `Authorization: Bearer …`-Header
|
||||
/// anhängt. Provider-Fehler werden geloggt, der Request läuft trotzdem
|
||||
/// weiter — das Backend antwortet dann mit 401, was der reguläre
|
||||
/// Error-Handling-Pfad behandelt.
|
||||
class HolzleitnerAuthInterceptor extends Interceptor {
|
||||
HolzleitnerAuthInterceptor(this._tokenProvider);
|
||||
|
||||
final AuthTokenProvider _tokenProvider;
|
||||
|
||||
@override
|
||||
Future<void> onRequest(
|
||||
RequestOptions options,
|
||||
RequestInterceptorHandler handler,
|
||||
) async {
|
||||
try {
|
||||
final token = await _tokenProvider.currentAccessToken();
|
||||
if (token != null) {
|
||||
options.headers['Authorization'] = 'Bearer $token';
|
||||
}
|
||||
} catch (e, stack) {
|
||||
// TODO Phase B: hier ein strukturiertes Logging-Framework
|
||||
// einhängen statt print.
|
||||
// ignore: avoid_print
|
||||
print('[HolzleitnerAuthInterceptor] Token-Provider hat geworfen: $e\n$stack');
|
||||
}
|
||||
handler.next(options);
|
||||
}
|
||||
}
|
||||
41
lib/data/network/network_locator.dart
Normal file
41
lib/data/network/network_locator.dart
Normal file
@ -0,0 +1,41 @@
|
||||
import 'package:get_it/get_it.dart';
|
||||
import 'package:holzleitner_api/holzleitner_api.dart';
|
||||
|
||||
import 'auth_token_provider.dart';
|
||||
import 'backend_config.dart';
|
||||
import 'dev_password_grant_token_provider.dart';
|
||||
import 'holzleitner_api_factory.dart';
|
||||
|
||||
/// Registriert das HTTP-/API-Subsystem im globalen GetIt-Locator.
|
||||
///
|
||||
/// Aufruf bewusst nicht im AppBloc-Lifecycle, sondern in `main()` vor
|
||||
/// dem `runApp` — die API-Klassen sind über die gesamte App-Lebensdauer
|
||||
/// stabil und brauchen keine Reaktion auf App-Events.
|
||||
///
|
||||
/// Phase A nutzt die `DevPasswordGrantTokenProvider`-Implementation.
|
||||
/// Phase B wird hier den OIDC-PKCE-Provider einhängen und die
|
||||
/// Dev-Implementation komplett entfernen.
|
||||
void registerNetworking({
|
||||
required GetIt locator,
|
||||
BackendConfig config = BackendConfig.localDev,
|
||||
String testfahrerUsername = 'testfahrer',
|
||||
String testfahrerPassword = 'test',
|
||||
}) {
|
||||
locator.registerSingleton<BackendConfig>(config);
|
||||
|
||||
locator.registerSingleton<AuthTokenProvider>(
|
||||
DevPasswordGrantTokenProvider(
|
||||
tokenEndpoint: config.keycloakTokenEndpoint,
|
||||
clientId: config.keycloakClientId,
|
||||
username: testfahrerUsername,
|
||||
password: testfahrerPassword,
|
||||
),
|
||||
);
|
||||
|
||||
locator.registerSingleton<HolzleitnerApi>(
|
||||
buildHolzleitnerApi(
|
||||
config: config,
|
||||
tokenProvider: locator<AuthTokenProvider>(),
|
||||
),
|
||||
);
|
||||
}
|
||||
0
lib/data/repository/.gitkeep
Normal file
0
lib/data/repository/.gitkeep
Normal file
0
lib/domain/entity/.gitkeep
Normal file
0
lib/domain/entity/.gitkeep
Normal file
0
lib/domain/repository/.gitkeep
Normal file
0
lib/domain/repository/.gitkeep
Normal file
@ -3,6 +3,7 @@ import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:get_it/get_it.dart';
|
||||
import 'package:hl_lieferservice/bloc/app_bloc.dart';
|
||||
import 'package:hl_lieferservice/bloc/app_events.dart';
|
||||
import 'package:hl_lieferservice/data/network/network_locator.dart';
|
||||
import 'package:hl_lieferservice/feature/settings/bloc/settings_bloc.dart';
|
||||
import 'package:hl_lieferservice/feature/settings/bloc/settings_event.dart';
|
||||
import 'package:hl_lieferservice/widget/app.dart';
|
||||
@ -10,6 +11,12 @@ import 'package:hl_lieferservice/widget/app.dart';
|
||||
final locator = GetIt.instance;
|
||||
|
||||
void main() {
|
||||
// Backend-Migration Phase A: HTTP-Stack + Token-Provider registrieren,
|
||||
// bevor irgendein Bloc starten kann. Wirft eine Compile-Sicherheit
|
||||
// hin, dass `HolzleitnerApi` ab hier per `locator<HolzleitnerApi>()`
|
||||
// verfügbar ist.
|
||||
registerNetworking(locator: locator);
|
||||
|
||||
runApp(MultiBlocProvider(providers: [
|
||||
BlocProvider(create: (context) => AppBloc(),),
|
||||
BlocProvider(create: (context) => SettingsBloc())
|
||||
|
||||
1827
openapi/holzleitner.json
Normal file
1827
openapi/holzleitner.json
Normal file
File diff suppressed because it is too large
Load Diff
41
packages/holzleitner_api/.gitignore
vendored
Normal file
41
packages/holzleitner_api/.gitignore
vendored
Normal file
@ -0,0 +1,41 @@
|
||||
# See https://dart.dev/guides/libraries/private-files
|
||||
|
||||
# Files and directories created by pub
|
||||
.dart_tool/
|
||||
.buildlog
|
||||
.packages
|
||||
.project
|
||||
.pub/
|
||||
build/
|
||||
**/packages/
|
||||
|
||||
# Files created by dart2js
|
||||
# (Most Dart developers will use pub build to compile Dart, use/modify these
|
||||
# rules if you intend to use dart2js directly
|
||||
# Convention is to use extension '.dart.js' for Dart compiled to Javascript to
|
||||
# differentiate from explicit Javascript files)
|
||||
*.dart.js
|
||||
*.part.js
|
||||
*.js.deps
|
||||
*.js.map
|
||||
*.info.json
|
||||
|
||||
# Directory created by dartdoc
|
||||
doc/api/
|
||||
|
||||
# Don't commit pubspec lock file
|
||||
# (Library packages only! Remove pattern if developing an application package)
|
||||
pubspec.lock
|
||||
|
||||
# Don’t commit files and directories created by other development environments.
|
||||
# For example, if your development environment creates any of the following files,
|
||||
# consider putting them in a global ignore file:
|
||||
|
||||
# IntelliJ
|
||||
*.iml
|
||||
*.ipr
|
||||
*.iws
|
||||
.idea/
|
||||
|
||||
# Mac
|
||||
.DS_Store
|
||||
23
packages/holzleitner_api/.openapi-generator-ignore
Normal file
23
packages/holzleitner_api/.openapi-generator-ignore
Normal file
@ -0,0 +1,23 @@
|
||||
# OpenAPI Generator Ignore
|
||||
# Generated by openapi-generator https://github.com/openapitools/openapi-generator
|
||||
|
||||
# Use this file to prevent files from being overwritten by the generator.
|
||||
# The patterns follow closely to .gitignore or .dockerignore.
|
||||
|
||||
# As an example, the C# client generator defines ApiClient.cs.
|
||||
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
|
||||
#ApiClient.cs
|
||||
|
||||
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
|
||||
#foo/*/qux
|
||||
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
|
||||
|
||||
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
|
||||
#foo/**/qux
|
||||
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
|
||||
|
||||
# You can also negate patterns with an exclamation (!).
|
||||
# For example, you can ignore all files in a docs folder with the file extension .md:
|
||||
#docs/*.md
|
||||
# Then explicitly reverse the ignore rule for a single file:
|
||||
#!docs/README.md
|
||||
160
packages/holzleitner_api/.openapi-generator/FILES
Normal file
160
packages/holzleitner_api/.openapi-generator/FILES
Normal file
@ -0,0 +1,160 @@
|
||||
.gitignore
|
||||
.openapi-generator-ignore
|
||||
README.md
|
||||
analysis_options.yaml
|
||||
doc/Account.md
|
||||
doc/AccountsApi.md
|
||||
doc/Address.md
|
||||
doc/ApplyScansRequest.md
|
||||
doc/ApplyScansResponse.md
|
||||
doc/Article.md
|
||||
doc/AssignCarRequest.md
|
||||
doc/AuditAction.md
|
||||
doc/CancelDeliveryRequest.md
|
||||
doc/Car.md
|
||||
doc/CarResponse.md
|
||||
doc/CarsApi.md
|
||||
doc/CarsList.md
|
||||
doc/CreateCarRequest.md
|
||||
doc/CreateDeliveryNoteRequest.md
|
||||
doc/Customer.md
|
||||
doc/CustomerContact.md
|
||||
doc/DeliveriesApi.md
|
||||
doc/Delivery.md
|
||||
doc/DeliveryItem.md
|
||||
doc/DeliveryNote.md
|
||||
doc/DeliveryNoteResponse.md
|
||||
doc/DeliveryOrderEntry.md
|
||||
doc/DeliveryResponse.md
|
||||
doc/DeliveryState.md
|
||||
doc/DeliveryWithItems.md
|
||||
doc/HealthApi.md
|
||||
doc/HoldDeliveryRequest.md
|
||||
doc/ScanEvent.md
|
||||
doc/ScanResult.md
|
||||
doc/ScanResultStatus.md
|
||||
doc/ScanState.md
|
||||
doc/ScanStatus.md
|
||||
doc/ScansApi.md
|
||||
doc/SetDeliveryOrderRequest.md
|
||||
doc/SetDeliveryOrderResponse.md
|
||||
doc/SyncApi.md
|
||||
doc/SyncDelivery.md
|
||||
doc/SyncDeliveryItem.md
|
||||
doc/SyncTourRequest.md
|
||||
doc/SyncTourResponse.md
|
||||
doc/Tour.md
|
||||
doc/TourDetails.md
|
||||
doc/TourSummary.md
|
||||
doc/TourSummaryList.md
|
||||
doc/ToursApi.md
|
||||
doc/UpdateCarRequest.md
|
||||
doc/Warehouse.md
|
||||
lib/holzleitner_api.dart
|
||||
lib/src/api.dart
|
||||
lib/src/api/accounts_api.dart
|
||||
lib/src/api/cars_api.dart
|
||||
lib/src/api/deliveries_api.dart
|
||||
lib/src/api/health_api.dart
|
||||
lib/src/api/scans_api.dart
|
||||
lib/src/api/sync_api.dart
|
||||
lib/src/api/tours_api.dart
|
||||
lib/src/api_util.dart
|
||||
lib/src/auth/api_key_auth.dart
|
||||
lib/src/auth/auth.dart
|
||||
lib/src/auth/basic_auth.dart
|
||||
lib/src/auth/bearer_auth.dart
|
||||
lib/src/auth/oauth.dart
|
||||
lib/src/date_serializer.dart
|
||||
lib/src/model/account.dart
|
||||
lib/src/model/address.dart
|
||||
lib/src/model/apply_scans_request.dart
|
||||
lib/src/model/apply_scans_response.dart
|
||||
lib/src/model/article.dart
|
||||
lib/src/model/assign_car_request.dart
|
||||
lib/src/model/audit_action.dart
|
||||
lib/src/model/cancel_delivery_request.dart
|
||||
lib/src/model/car.dart
|
||||
lib/src/model/car_response.dart
|
||||
lib/src/model/cars_list.dart
|
||||
lib/src/model/create_car_request.dart
|
||||
lib/src/model/create_delivery_note_request.dart
|
||||
lib/src/model/customer.dart
|
||||
lib/src/model/customer_contact.dart
|
||||
lib/src/model/date.dart
|
||||
lib/src/model/delivery.dart
|
||||
lib/src/model/delivery_item.dart
|
||||
lib/src/model/delivery_note.dart
|
||||
lib/src/model/delivery_note_response.dart
|
||||
lib/src/model/delivery_order_entry.dart
|
||||
lib/src/model/delivery_response.dart
|
||||
lib/src/model/delivery_state.dart
|
||||
lib/src/model/delivery_with_items.dart
|
||||
lib/src/model/hold_delivery_request.dart
|
||||
lib/src/model/scan_event.dart
|
||||
lib/src/model/scan_result.dart
|
||||
lib/src/model/scan_result_status.dart
|
||||
lib/src/model/scan_state.dart
|
||||
lib/src/model/scan_status.dart
|
||||
lib/src/model/set_delivery_order_request.dart
|
||||
lib/src/model/set_delivery_order_response.dart
|
||||
lib/src/model/sync_delivery.dart
|
||||
lib/src/model/sync_delivery_item.dart
|
||||
lib/src/model/sync_tour_request.dart
|
||||
lib/src/model/sync_tour_response.dart
|
||||
lib/src/model/tour.dart
|
||||
lib/src/model/tour_details.dart
|
||||
lib/src/model/tour_summary.dart
|
||||
lib/src/model/tour_summary_list.dart
|
||||
lib/src/model/update_car_request.dart
|
||||
lib/src/model/warehouse.dart
|
||||
lib/src/serializers.dart
|
||||
pubspec.yaml
|
||||
test/account_test.dart
|
||||
test/accounts_api_test.dart
|
||||
test/address_test.dart
|
||||
test/apply_scans_request_test.dart
|
||||
test/apply_scans_response_test.dart
|
||||
test/article_test.dart
|
||||
test/assign_car_request_test.dart
|
||||
test/audit_action_test.dart
|
||||
test/cancel_delivery_request_test.dart
|
||||
test/car_response_test.dart
|
||||
test/car_test.dart
|
||||
test/cars_api_test.dart
|
||||
test/cars_list_test.dart
|
||||
test/create_car_request_test.dart
|
||||
test/create_delivery_note_request_test.dart
|
||||
test/customer_contact_test.dart
|
||||
test/customer_test.dart
|
||||
test/deliveries_api_test.dart
|
||||
test/delivery_item_test.dart
|
||||
test/delivery_note_response_test.dart
|
||||
test/delivery_note_test.dart
|
||||
test/delivery_order_entry_test.dart
|
||||
test/delivery_response_test.dart
|
||||
test/delivery_state_test.dart
|
||||
test/delivery_test.dart
|
||||
test/delivery_with_items_test.dart
|
||||
test/health_api_test.dart
|
||||
test/hold_delivery_request_test.dart
|
||||
test/scan_event_test.dart
|
||||
test/scan_result_status_test.dart
|
||||
test/scan_result_test.dart
|
||||
test/scan_state_test.dart
|
||||
test/scan_status_test.dart
|
||||
test/scans_api_test.dart
|
||||
test/set_delivery_order_request_test.dart
|
||||
test/set_delivery_order_response_test.dart
|
||||
test/sync_api_test.dart
|
||||
test/sync_delivery_item_test.dart
|
||||
test/sync_delivery_test.dart
|
||||
test/sync_tour_request_test.dart
|
||||
test/sync_tour_response_test.dart
|
||||
test/tour_details_test.dart
|
||||
test/tour_summary_list_test.dart
|
||||
test/tour_summary_test.dart
|
||||
test/tour_test.dart
|
||||
test/tours_api_test.dart
|
||||
test/update_car_request_test.dart
|
||||
test/warehouse_test.dart
|
||||
1
packages/holzleitner_api/.openapi-generator/VERSION
Normal file
1
packages/holzleitner_api/.openapi-generator/VERSION
Normal file
@ -0,0 +1 @@
|
||||
7.10.0
|
||||
143
packages/holzleitner_api/README.md
Normal file
143
packages/holzleitner_api/README.md
Normal file
@ -0,0 +1,143 @@
|
||||
# holzleitner_api (EXPERIMENTAL)
|
||||
Backend für die Holzleitner-Lieferservice-App — Tour, Beladung, Ausführung.
|
||||
|
||||
This Dart package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
|
||||
|
||||
- API version: 0.1.0
|
||||
- Generator version: 7.10.0
|
||||
- Build package: org.openapitools.codegen.languages.DartDioClientCodegen
|
||||
|
||||
## Requirements
|
||||
|
||||
* Dart 2.15.0+ or Flutter 2.8.0+
|
||||
* Dio 5.0.0+ (https://pub.dev/packages/dio)
|
||||
|
||||
## Installation & Usage
|
||||
|
||||
### pub.dev
|
||||
To use the package from [pub.dev](https://pub.dev), please include the following in pubspec.yaml
|
||||
```yaml
|
||||
dependencies:
|
||||
holzleitner_api: 1.0.0
|
||||
```
|
||||
|
||||
### Github
|
||||
If this Dart package is published to Github, please include the following in pubspec.yaml
|
||||
```yaml
|
||||
dependencies:
|
||||
holzleitner_api:
|
||||
git:
|
||||
url: https://github.com/GIT_USER_ID/GIT_REPO_ID.git
|
||||
#ref: main
|
||||
```
|
||||
|
||||
### Local development
|
||||
To use the package from your local drive, please include the following in pubspec.yaml
|
||||
```yaml
|
||||
dependencies:
|
||||
holzleitner_api:
|
||||
path: /path/to/holzleitner_api
|
||||
```
|
||||
|
||||
## Getting Started
|
||||
|
||||
Please follow the [installation procedure](#installation--usage) and then run the following:
|
||||
|
||||
```dart
|
||||
import 'package:holzleitner_api/holzleitner_api.dart';
|
||||
|
||||
|
||||
final api = HolzleitnerApi().getAccountsApi();
|
||||
final int personalnummer = 789; // int | Personalnummer des Accounts
|
||||
|
||||
try {
|
||||
final response = await api.getAccount(personalnummer);
|
||||
print(response);
|
||||
} catch on DioException (e) {
|
||||
print("Exception when calling AccountsApi->getAccount: $e\n");
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Documentation for API Endpoints
|
||||
|
||||
All URIs are relative to *http://localhost*
|
||||
|
||||
Class | Method | HTTP request | Description
|
||||
------------ | ------------- | ------------- | -------------
|
||||
[*AccountsApi*](doc/AccountsApi.md) | [**getAccount**](doc/AccountsApi.md#getaccount) | **GET** /accounts/{personalnummer} | Liest den Account zu einer Personalnummer.
|
||||
[*CarsApi*](doc/CarsApi.md) | [**createMyCar**](doc/CarsApi.md#createmycar) | **POST** /me/cars | Legt ein neues Fahrzeug für den angemeldeten Fahrer an.
|
||||
[*CarsApi*](doc/CarsApi.md) | [**listMyCars**](doc/CarsApi.md#listmycars) | **GET** /me/cars | Listet die Fahrzeuge des angemeldeten Fahrers.
|
||||
[*CarsApi*](doc/CarsApi.md) | [**updateMyCar**](doc/CarsApi.md#updatemycar) | **PATCH** /me/cars/{car_id} | Aktualisiert ein Fahrzeug (Kennzeichen ändern / deaktivieren).
|
||||
[*DeliveriesApi*](doc/DeliveriesApi.md) | [**assignCar**](doc/DeliveriesApi.md#assigncar) | **PUT** /deliveries/{delivery_id}/assigned-car | Setzt das `assigned_car_id` einer Lieferung. `carId: null` löst die Zuordnung wieder. Der Use Case stellt sicher, dass das Fahrzeug zum angemeldeten Account gehört.
|
||||
[*DeliveriesApi*](doc/DeliveriesApi.md) | [**cancel**](doc/DeliveriesApi.md#cancel) | **POST** /deliveries/{delivery_id}/cancel | Setzt die Lieferung auf `canceled` — endgültig. Erlaubt aus `active` und `held`.
|
||||
[*DeliveriesApi*](doc/DeliveriesApi.md) | [**complete**](doc/DeliveriesApi.md#complete) | **POST** /deliveries/{delivery_id}/complete | Schließt die Lieferung ab — `state = completed`. Nur aus `active`.
|
||||
[*DeliveriesApi*](doc/DeliveriesApi.md) | [**createNote**](doc/DeliveriesApi.md#createnote) | **POST** /deliveries/{delivery_id}/notes | Legt eine neue Notiz an einer Lieferung an. Mindestens eines von `text` und `imageAttachment` muss inhaltlich gefüllt sein (Leerstrings werden serverseitig getrimmt und als leer behandelt).
|
||||
[*DeliveriesApi*](doc/DeliveriesApi.md) | [**hold**](doc/DeliveriesApi.md#hold) | **POST** /deliveries/{delivery_id}/hold | Setzt die Lieferung auf `held`. Nur aus `active` zulässig.
|
||||
[*DeliveriesApi*](doc/DeliveriesApi.md) | [**resume**](doc/DeliveriesApi.md#resume) | **POST** /deliveries/{delivery_id}/resume | Setzt die Lieferung zurück auf `active`. Nur aus `held` zulässig.
|
||||
[*HealthApi*](doc/HealthApi.md) | [**health**](doc/HealthApi.md#health) | **GET** /health | Health-Endpoint für Load-Balancer und Container-Probes. Bewusst kein Auth — eine `200 ok`-Antwort darf nicht von der Auth abhängen.
|
||||
[*ScansApi*](doc/ScansApi.md) | [**applyScans**](doc/ScansApi.md#applyscans) | **POST** /scans | Wendet eine Liste von Scan-Events idempotent an.
|
||||
[*SyncApi*](doc/SyncApi.md) | [**syncTour**](doc/SyncApi.md#synctour) | **POST** /sync/tour | Sync-Endpoint für das ERP: legt eine Tagestour samt Lieferungen und Positionen idempotent an. Identität pro Tour `(driver_personalnummer, tour_date)`, pro Lieferung `(belegart_id, belegnummer)`.
|
||||
[*ToursApi*](doc/ToursApi.md) | [**getTour**](doc/ToursApi.md#gettour) | **GET** /tours/{tour_id} | Lädt eine Tour mit allen Lieferungen, Positionen und referenzierten Stammdaten — die App nutzt das als einzigen großen Read.
|
||||
[*ToursApi*](doc/ToursApi.md) | [**listMyToursToday**](doc/ToursApi.md#listmytourstoday) | **GET** /me/tours/today | Listet heutige Touren des angemeldeten Fahrers (Filter aus dem JWT).
|
||||
[*ToursApi*](doc/ToursApi.md) | [**setDeliveryOrder**](doc/ToursApi.md#setdeliveryorder) | **PUT** /tours/{tour_id}/delivery-order | Schreibt die Sortier-Reihenfolge aller Lieferungen einer Tour neu. Der Client schickt die **vollständige** neue Reihenfolge; fehlende oder fremde Lieferungs-Ids werden mit `400 validation` abgelehnt.
|
||||
|
||||
|
||||
## Documentation For Models
|
||||
|
||||
- [Account](doc/Account.md)
|
||||
- [Address](doc/Address.md)
|
||||
- [ApplyScansRequest](doc/ApplyScansRequest.md)
|
||||
- [ApplyScansResponse](doc/ApplyScansResponse.md)
|
||||
- [Article](doc/Article.md)
|
||||
- [AssignCarRequest](doc/AssignCarRequest.md)
|
||||
- [AuditAction](doc/AuditAction.md)
|
||||
- [CancelDeliveryRequest](doc/CancelDeliveryRequest.md)
|
||||
- [Car](doc/Car.md)
|
||||
- [CarResponse](doc/CarResponse.md)
|
||||
- [CarsList](doc/CarsList.md)
|
||||
- [CreateCarRequest](doc/CreateCarRequest.md)
|
||||
- [CreateDeliveryNoteRequest](doc/CreateDeliveryNoteRequest.md)
|
||||
- [Customer](doc/Customer.md)
|
||||
- [CustomerContact](doc/CustomerContact.md)
|
||||
- [Delivery](doc/Delivery.md)
|
||||
- [DeliveryItem](doc/DeliveryItem.md)
|
||||
- [DeliveryNote](doc/DeliveryNote.md)
|
||||
- [DeliveryNoteResponse](doc/DeliveryNoteResponse.md)
|
||||
- [DeliveryOrderEntry](doc/DeliveryOrderEntry.md)
|
||||
- [DeliveryResponse](doc/DeliveryResponse.md)
|
||||
- [DeliveryState](doc/DeliveryState.md)
|
||||
- [DeliveryWithItems](doc/DeliveryWithItems.md)
|
||||
- [HoldDeliveryRequest](doc/HoldDeliveryRequest.md)
|
||||
- [ScanEvent](doc/ScanEvent.md)
|
||||
- [ScanResult](doc/ScanResult.md)
|
||||
- [ScanResultStatus](doc/ScanResultStatus.md)
|
||||
- [ScanState](doc/ScanState.md)
|
||||
- [ScanStatus](doc/ScanStatus.md)
|
||||
- [SetDeliveryOrderRequest](doc/SetDeliveryOrderRequest.md)
|
||||
- [SetDeliveryOrderResponse](doc/SetDeliveryOrderResponse.md)
|
||||
- [SyncDelivery](doc/SyncDelivery.md)
|
||||
- [SyncDeliveryItem](doc/SyncDeliveryItem.md)
|
||||
- [SyncTourRequest](doc/SyncTourRequest.md)
|
||||
- [SyncTourResponse](doc/SyncTourResponse.md)
|
||||
- [Tour](doc/Tour.md)
|
||||
- [TourDetails](doc/TourDetails.md)
|
||||
- [TourSummary](doc/TourSummary.md)
|
||||
- [TourSummaryList](doc/TourSummaryList.md)
|
||||
- [UpdateCarRequest](doc/UpdateCarRequest.md)
|
||||
- [Warehouse](doc/Warehouse.md)
|
||||
|
||||
|
||||
## Documentation For Authorization
|
||||
|
||||
|
||||
Authentication schemes defined for the API:
|
||||
### bearer_auth
|
||||
|
||||
- **Type**: HTTP Bearer Token authentication (JWT)
|
||||
|
||||
|
||||
## Author
|
||||
|
||||
|
||||
|
||||
9
packages/holzleitner_api/analysis_options.yaml
Normal file
9
packages/holzleitner_api/analysis_options.yaml
Normal file
@ -0,0 +1,9 @@
|
||||
analyzer:
|
||||
language:
|
||||
strict-inference: true
|
||||
strict-raw-types: true
|
||||
strict-casts: false
|
||||
exclude:
|
||||
- test/*.dart
|
||||
errors:
|
||||
deprecated_member_use_from_same_package: ignore
|
||||
17
packages/holzleitner_api/doc/Account.md
Normal file
17
packages/holzleitner_api/doc/Account.md
Normal file
@ -0,0 +1,17 @@
|
||||
# holzleitner_api.model.Account
|
||||
|
||||
## Load the model package
|
||||
```dart
|
||||
import 'package:holzleitner_api/api.dart';
|
||||
```
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**active** | **bool** | |
|
||||
**name** | **String** | |
|
||||
**personalnummer** | **int** | |
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
55
packages/holzleitner_api/doc/AccountsApi.md
Normal file
55
packages/holzleitner_api/doc/AccountsApi.md
Normal file
@ -0,0 +1,55 @@
|
||||
# holzleitner_api.api.AccountsApi
|
||||
|
||||
## Load the API package
|
||||
```dart
|
||||
import 'package:holzleitner_api/api.dart';
|
||||
```
|
||||
|
||||
All URIs are relative to *http://localhost*
|
||||
|
||||
Method | HTTP request | Description
|
||||
------------- | ------------- | -------------
|
||||
[**getAccount**](AccountsApi.md#getaccount) | **GET** /accounts/{personalnummer} | Liest den Account zu einer Personalnummer.
|
||||
|
||||
|
||||
# **getAccount**
|
||||
> Account getAccount(personalnummer)
|
||||
|
||||
Liest den Account zu einer Personalnummer.
|
||||
|
||||
### Example
|
||||
```dart
|
||||
import 'package:holzleitner_api/api.dart';
|
||||
|
||||
final api = HolzleitnerApi().getAccountsApi();
|
||||
final int personalnummer = 789; // int | Personalnummer des Accounts
|
||||
|
||||
try {
|
||||
final response = api.getAccount(personalnummer);
|
||||
print(response);
|
||||
} catch on DioException (e) {
|
||||
print('Exception when calling AccountsApi->getAccount: $e\n');
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**personalnummer** | **int**| Personalnummer des Accounts |
|
||||
|
||||
### Return type
|
||||
|
||||
[**Account**](Account.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
[bearer_auth](../README.md#bearer_auth)
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
19
packages/holzleitner_api/doc/Address.md
Normal file
19
packages/holzleitner_api/doc/Address.md
Normal file
@ -0,0 +1,19 @@
|
||||
# holzleitner_api.model.Address
|
||||
|
||||
## Load the model package
|
||||
```dart
|
||||
import 'package:holzleitner_api/api.dart';
|
||||
```
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**city** | **String** | |
|
||||
**country** | **String** | |
|
||||
**houseNumber** | **String** | |
|
||||
**postalCode** | **String** | |
|
||||
**street** | **String** | |
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
15
packages/holzleitner_api/doc/ApplyScansRequest.md
Normal file
15
packages/holzleitner_api/doc/ApplyScansRequest.md
Normal file
@ -0,0 +1,15 @@
|
||||
# holzleitner_api.model.ApplyScansRequest
|
||||
|
||||
## Load the model package
|
||||
```dart
|
||||
import 'package:holzleitner_api/api.dart';
|
||||
```
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**scans** | [**BuiltList<ScanEvent>**](ScanEvent.md) | |
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
15
packages/holzleitner_api/doc/ApplyScansResponse.md
Normal file
15
packages/holzleitner_api/doc/ApplyScansResponse.md
Normal file
@ -0,0 +1,15 @@
|
||||
# holzleitner_api.model.ApplyScansResponse
|
||||
|
||||
## Load the model package
|
||||
```dart
|
||||
import 'package:holzleitner_api/api.dart';
|
||||
```
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**results** | [**BuiltList<ScanResult>**](ScanResult.md) | |
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
19
packages/holzleitner_api/doc/Article.md
Normal file
19
packages/holzleitner_api/doc/Article.md
Normal file
@ -0,0 +1,19 @@
|
||||
# holzleitner_api.model.Article
|
||||
|
||||
## Load the model package
|
||||
```dart
|
||||
import 'package:holzleitner_api/api.dart';
|
||||
```
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**articleNumber** | **String** | |
|
||||
**defaultWarehouseId** | **String** | | [optional]
|
||||
**id** | **String** | |
|
||||
**name** | **String** | |
|
||||
**scannable** | **bool** | |
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
15
packages/holzleitner_api/doc/AssignCarRequest.md
Normal file
15
packages/holzleitner_api/doc/AssignCarRequest.md
Normal file
@ -0,0 +1,15 @@
|
||||
# holzleitner_api.model.AssignCarRequest
|
||||
|
||||
## Load the model package
|
||||
```dart
|
||||
import 'package:holzleitner_api/api.dart';
|
||||
```
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**carId** | **String** | | [optional]
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
14
packages/holzleitner_api/doc/AuditAction.md
Normal file
14
packages/holzleitner_api/doc/AuditAction.md
Normal file
@ -0,0 +1,14 @@
|
||||
# holzleitner_api.model.AuditAction
|
||||
|
||||
## Load the model package
|
||||
```dart
|
||||
import 'package:holzleitner_api/api.dart';
|
||||
```
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
15
packages/holzleitner_api/doc/CancelDeliveryRequest.md
Normal file
15
packages/holzleitner_api/doc/CancelDeliveryRequest.md
Normal file
@ -0,0 +1,15 @@
|
||||
# holzleitner_api.model.CancelDeliveryRequest
|
||||
|
||||
## Load the model package
|
||||
```dart
|
||||
import 'package:holzleitner_api/api.dart';
|
||||
```
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**reason** | **String** | |
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
18
packages/holzleitner_api/doc/Car.md
Normal file
18
packages/holzleitner_api/doc/Car.md
Normal file
@ -0,0 +1,18 @@
|
||||
# holzleitner_api.model.Car
|
||||
|
||||
## Load the model package
|
||||
```dart
|
||||
import 'package:holzleitner_api/api.dart';
|
||||
```
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**accountId** | **int** | Verweis auf [`crate::domain::Account::personalnummer`]. |
|
||||
**active** | **bool** | |
|
||||
**id** | **String** | |
|
||||
**plate** | **String** | |
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
15
packages/holzleitner_api/doc/CarResponse.md
Normal file
15
packages/holzleitner_api/doc/CarResponse.md
Normal file
@ -0,0 +1,15 @@
|
||||
# holzleitner_api.model.CarResponse
|
||||
|
||||
## Load the model package
|
||||
```dart
|
||||
import 'package:holzleitner_api/api.dart';
|
||||
```
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**car** | [**Car**](Car.md) | |
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
141
packages/holzleitner_api/doc/CarsApi.md
Normal file
141
packages/holzleitner_api/doc/CarsApi.md
Normal file
@ -0,0 +1,141 @@
|
||||
# holzleitner_api.api.CarsApi
|
||||
|
||||
## Load the API package
|
||||
```dart
|
||||
import 'package:holzleitner_api/api.dart';
|
||||
```
|
||||
|
||||
All URIs are relative to *http://localhost*
|
||||
|
||||
Method | HTTP request | Description
|
||||
------------- | ------------- | -------------
|
||||
[**createMyCar**](CarsApi.md#createmycar) | **POST** /me/cars | Legt ein neues Fahrzeug für den angemeldeten Fahrer an.
|
||||
[**listMyCars**](CarsApi.md#listmycars) | **GET** /me/cars | Listet die Fahrzeuge des angemeldeten Fahrers.
|
||||
[**updateMyCar**](CarsApi.md#updatemycar) | **PATCH** /me/cars/{car_id} | Aktualisiert ein Fahrzeug (Kennzeichen ändern / deaktivieren).
|
||||
|
||||
|
||||
# **createMyCar**
|
||||
> CarResponse createMyCar(createCarRequest)
|
||||
|
||||
Legt ein neues Fahrzeug für den angemeldeten Fahrer an.
|
||||
|
||||
### Example
|
||||
```dart
|
||||
import 'package:holzleitner_api/api.dart';
|
||||
|
||||
final api = HolzleitnerApi().getCarsApi();
|
||||
final CreateCarRequest createCarRequest = ; // CreateCarRequest |
|
||||
|
||||
try {
|
||||
final response = api.createMyCar(createCarRequest);
|
||||
print(response);
|
||||
} catch on DioException (e) {
|
||||
print('Exception when calling CarsApi->createMyCar: $e\n');
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**createCarRequest** | [**CreateCarRequest**](CreateCarRequest.md)| |
|
||||
|
||||
### Return type
|
||||
|
||||
[**CarResponse**](CarResponse.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
[bearer_auth](../README.md#bearer_auth)
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: application/json
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
# **listMyCars**
|
||||
> CarsList listMyCars(includeInactive)
|
||||
|
||||
Listet die Fahrzeuge des angemeldeten Fahrers.
|
||||
|
||||
### Example
|
||||
```dart
|
||||
import 'package:holzleitner_api/api.dart';
|
||||
|
||||
final api = HolzleitnerApi().getCarsApi();
|
||||
final bool includeInactive = true; // bool | Wenn true, werden inaktive Fahrzeuge mitgeliefert (default: false)
|
||||
|
||||
try {
|
||||
final response = api.listMyCars(includeInactive);
|
||||
print(response);
|
||||
} catch on DioException (e) {
|
||||
print('Exception when calling CarsApi->listMyCars: $e\n');
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**includeInactive** | **bool**| Wenn true, werden inaktive Fahrzeuge mitgeliefert (default: false) | [optional]
|
||||
|
||||
### Return type
|
||||
|
||||
[**CarsList**](CarsList.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
[bearer_auth](../README.md#bearer_auth)
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
# **updateMyCar**
|
||||
> CarResponse updateMyCar(carId, updateCarRequest)
|
||||
|
||||
Aktualisiert ein Fahrzeug (Kennzeichen ändern / deaktivieren).
|
||||
|
||||
### Example
|
||||
```dart
|
||||
import 'package:holzleitner_api/api.dart';
|
||||
|
||||
final api = HolzleitnerApi().getCarsApi();
|
||||
final String carId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // String |
|
||||
final UpdateCarRequest updateCarRequest = ; // UpdateCarRequest |
|
||||
|
||||
try {
|
||||
final response = api.updateMyCar(carId, updateCarRequest);
|
||||
print(response);
|
||||
} catch on DioException (e) {
|
||||
print('Exception when calling CarsApi->updateMyCar: $e\n');
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**carId** | **String**| |
|
||||
**updateCarRequest** | [**UpdateCarRequest**](UpdateCarRequest.md)| |
|
||||
|
||||
### Return type
|
||||
|
||||
[**CarResponse**](CarResponse.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
[bearer_auth](../README.md#bearer_auth)
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: application/json
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
15
packages/holzleitner_api/doc/CarsList.md
Normal file
15
packages/holzleitner_api/doc/CarsList.md
Normal file
@ -0,0 +1,15 @@
|
||||
# holzleitner_api.model.CarsList
|
||||
|
||||
## Load the model package
|
||||
```dart
|
||||
import 'package:holzleitner_api/api.dart';
|
||||
```
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**cars** | [**BuiltList<Car>**](Car.md) | |
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
15
packages/holzleitner_api/doc/CreateCarRequest.md
Normal file
15
packages/holzleitner_api/doc/CreateCarRequest.md
Normal file
@ -0,0 +1,15 @@
|
||||
# holzleitner_api.model.CreateCarRequest
|
||||
|
||||
## Load the model package
|
||||
```dart
|
||||
import 'package:holzleitner_api/api.dart';
|
||||
```
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**plate** | **String** | |
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
17
packages/holzleitner_api/doc/CreateDeliveryNoteRequest.md
Normal file
17
packages/holzleitner_api/doc/CreateDeliveryNoteRequest.md
Normal file
@ -0,0 +1,17 @@
|
||||
# holzleitner_api.model.CreateDeliveryNoteRequest
|
||||
|
||||
## Load the model package
|
||||
```dart
|
||||
import 'package:holzleitner_api/api.dart';
|
||||
```
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**authorCarId** | **String** | Fahrzeug, das die Notiz erzeugt hat. Muss zum angemeldeten Account gehören. `None` ist erlaubt. | [optional]
|
||||
**imageAttachment** | **String** | Object-Storage-Key oder URL eines vorab hochgeladenen Bildes. | [optional]
|
||||
**text** | **String** | | [optional]
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
18
packages/holzleitner_api/doc/Customer.md
Normal file
18
packages/holzleitner_api/doc/Customer.md
Normal file
@ -0,0 +1,18 @@
|
||||
# holzleitner_api.model.Customer
|
||||
|
||||
## Load the model package
|
||||
```dart
|
||||
import 'package:holzleitner_api/api.dart';
|
||||
```
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**address** | [**Address**](Address.md) | |
|
||||
**erpCustomerId** | **int** | |
|
||||
**id** | **String** | |
|
||||
**name** | **String** | |
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
19
packages/holzleitner_api/doc/CustomerContact.md
Normal file
19
packages/holzleitner_api/doc/CustomerContact.md
Normal file
@ -0,0 +1,19 @@
|
||||
# holzleitner_api.model.CustomerContact
|
||||
|
||||
## Load the model package
|
||||
```dart
|
||||
import 'package:holzleitner_api/api.dart';
|
||||
```
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**customerId** | **String** | |
|
||||
**email** | **String** | | [optional]
|
||||
**id** | **String** | |
|
||||
**name** | **String** | |
|
||||
**phone** | **String** | | [optional]
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
273
packages/holzleitner_api/doc/DeliveriesApi.md
Normal file
273
packages/holzleitner_api/doc/DeliveriesApi.md
Normal file
@ -0,0 +1,273 @@
|
||||
# holzleitner_api.api.DeliveriesApi
|
||||
|
||||
## Load the API package
|
||||
```dart
|
||||
import 'package:holzleitner_api/api.dart';
|
||||
```
|
||||
|
||||
All URIs are relative to *http://localhost*
|
||||
|
||||
Method | HTTP request | Description
|
||||
------------- | ------------- | -------------
|
||||
[**assignCar**](DeliveriesApi.md#assigncar) | **PUT** /deliveries/{delivery_id}/assigned-car | Setzt das `assigned_car_id` einer Lieferung. `carId: null` löst die Zuordnung wieder. Der Use Case stellt sicher, dass das Fahrzeug zum angemeldeten Account gehört.
|
||||
[**cancel**](DeliveriesApi.md#cancel) | **POST** /deliveries/{delivery_id}/cancel | Setzt die Lieferung auf `canceled` — endgültig. Erlaubt aus `active` und `held`.
|
||||
[**complete**](DeliveriesApi.md#complete) | **POST** /deliveries/{delivery_id}/complete | Schließt die Lieferung ab — `state = completed`. Nur aus `active`.
|
||||
[**createNote**](DeliveriesApi.md#createnote) | **POST** /deliveries/{delivery_id}/notes | Legt eine neue Notiz an einer Lieferung an. Mindestens eines von `text` und `imageAttachment` muss inhaltlich gefüllt sein (Leerstrings werden serverseitig getrimmt und als leer behandelt).
|
||||
[**hold**](DeliveriesApi.md#hold) | **POST** /deliveries/{delivery_id}/hold | Setzt die Lieferung auf `held`. Nur aus `active` zulässig.
|
||||
[**resume**](DeliveriesApi.md#resume) | **POST** /deliveries/{delivery_id}/resume | Setzt die Lieferung zurück auf `active`. Nur aus `held` zulässig.
|
||||
|
||||
|
||||
# **assignCar**
|
||||
> DeliveryResponse assignCar(deliveryId, assignCarRequest)
|
||||
|
||||
Setzt das `assigned_car_id` einer Lieferung. `carId: null` löst die Zuordnung wieder. Der Use Case stellt sicher, dass das Fahrzeug zum angemeldeten Account gehört.
|
||||
|
||||
### Example
|
||||
```dart
|
||||
import 'package:holzleitner_api/api.dart';
|
||||
|
||||
final api = HolzleitnerApi().getDeliveriesApi();
|
||||
final String deliveryId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // String |
|
||||
final AssignCarRequest assignCarRequest = ; // AssignCarRequest |
|
||||
|
||||
try {
|
||||
final response = api.assignCar(deliveryId, assignCarRequest);
|
||||
print(response);
|
||||
} catch on DioException (e) {
|
||||
print('Exception when calling DeliveriesApi->assignCar: $e\n');
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**deliveryId** | **String**| |
|
||||
**assignCarRequest** | [**AssignCarRequest**](AssignCarRequest.md)| |
|
||||
|
||||
### Return type
|
||||
|
||||
[**DeliveryResponse**](DeliveryResponse.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
[bearer_auth](../README.md#bearer_auth)
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: application/json
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
# **cancel**
|
||||
> DeliveryResponse cancel(deliveryId, cancelDeliveryRequest)
|
||||
|
||||
Setzt die Lieferung auf `canceled` — endgültig. Erlaubt aus `active` und `held`.
|
||||
|
||||
### Example
|
||||
```dart
|
||||
import 'package:holzleitner_api/api.dart';
|
||||
|
||||
final api = HolzleitnerApi().getDeliveriesApi();
|
||||
final String deliveryId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // String |
|
||||
final CancelDeliveryRequest cancelDeliveryRequest = ; // CancelDeliveryRequest |
|
||||
|
||||
try {
|
||||
final response = api.cancel(deliveryId, cancelDeliveryRequest);
|
||||
print(response);
|
||||
} catch on DioException (e) {
|
||||
print('Exception when calling DeliveriesApi->cancel: $e\n');
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**deliveryId** | **String**| |
|
||||
**cancelDeliveryRequest** | [**CancelDeliveryRequest**](CancelDeliveryRequest.md)| |
|
||||
|
||||
### Return type
|
||||
|
||||
[**DeliveryResponse**](DeliveryResponse.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
[bearer_auth](../README.md#bearer_auth)
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: application/json
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
# **complete**
|
||||
> DeliveryResponse complete(deliveryId)
|
||||
|
||||
Schließt die Lieferung ab — `state = completed`. Nur aus `active`.
|
||||
|
||||
### Example
|
||||
```dart
|
||||
import 'package:holzleitner_api/api.dart';
|
||||
|
||||
final api = HolzleitnerApi().getDeliveriesApi();
|
||||
final String deliveryId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // String |
|
||||
|
||||
try {
|
||||
final response = api.complete(deliveryId);
|
||||
print(response);
|
||||
} catch on DioException (e) {
|
||||
print('Exception when calling DeliveriesApi->complete: $e\n');
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**deliveryId** | **String**| |
|
||||
|
||||
### Return type
|
||||
|
||||
[**DeliveryResponse**](DeliveryResponse.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
[bearer_auth](../README.md#bearer_auth)
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
# **createNote**
|
||||
> DeliveryNoteResponse createNote(deliveryId, createDeliveryNoteRequest)
|
||||
|
||||
Legt eine neue Notiz an einer Lieferung an. Mindestens eines von `text` und `imageAttachment` muss inhaltlich gefüllt sein (Leerstrings werden serverseitig getrimmt und als leer behandelt).
|
||||
|
||||
### Example
|
||||
```dart
|
||||
import 'package:holzleitner_api/api.dart';
|
||||
|
||||
final api = HolzleitnerApi().getDeliveriesApi();
|
||||
final String deliveryId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // String |
|
||||
final CreateDeliveryNoteRequest createDeliveryNoteRequest = ; // CreateDeliveryNoteRequest |
|
||||
|
||||
try {
|
||||
final response = api.createNote(deliveryId, createDeliveryNoteRequest);
|
||||
print(response);
|
||||
} catch on DioException (e) {
|
||||
print('Exception when calling DeliveriesApi->createNote: $e\n');
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**deliveryId** | **String**| |
|
||||
**createDeliveryNoteRequest** | [**CreateDeliveryNoteRequest**](CreateDeliveryNoteRequest.md)| |
|
||||
|
||||
### Return type
|
||||
|
||||
[**DeliveryNoteResponse**](DeliveryNoteResponse.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
[bearer_auth](../README.md#bearer_auth)
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: application/json
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
# **hold**
|
||||
> DeliveryResponse hold(deliveryId, holdDeliveryRequest)
|
||||
|
||||
Setzt die Lieferung auf `held`. Nur aus `active` zulässig.
|
||||
|
||||
### Example
|
||||
```dart
|
||||
import 'package:holzleitner_api/api.dart';
|
||||
|
||||
final api = HolzleitnerApi().getDeliveriesApi();
|
||||
final String deliveryId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // String |
|
||||
final HoldDeliveryRequest holdDeliveryRequest = ; // HoldDeliveryRequest |
|
||||
|
||||
try {
|
||||
final response = api.hold(deliveryId, holdDeliveryRequest);
|
||||
print(response);
|
||||
} catch on DioException (e) {
|
||||
print('Exception when calling DeliveriesApi->hold: $e\n');
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**deliveryId** | **String**| |
|
||||
**holdDeliveryRequest** | [**HoldDeliveryRequest**](HoldDeliveryRequest.md)| |
|
||||
|
||||
### Return type
|
||||
|
||||
[**DeliveryResponse**](DeliveryResponse.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
[bearer_auth](../README.md#bearer_auth)
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: application/json
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
# **resume**
|
||||
> DeliveryResponse resume(deliveryId)
|
||||
|
||||
Setzt die Lieferung zurück auf `active`. Nur aus `held` zulässig.
|
||||
|
||||
### Example
|
||||
```dart
|
||||
import 'package:holzleitner_api/api.dart';
|
||||
|
||||
final api = HolzleitnerApi().getDeliveriesApi();
|
||||
final String deliveryId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // String |
|
||||
|
||||
try {
|
||||
final response = api.resume(deliveryId);
|
||||
print(response);
|
||||
} catch on DioException (e) {
|
||||
print('Exception when calling DeliveriesApi->resume: $e\n');
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**deliveryId** | **String**| |
|
||||
|
||||
### Return type
|
||||
|
||||
[**DeliveryResponse**](DeliveryResponse.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
[bearer_auth](../README.md#bearer_auth)
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
26
packages/holzleitner_api/doc/Delivery.md
Normal file
26
packages/holzleitner_api/doc/Delivery.md
Normal file
@ -0,0 +1,26 @@
|
||||
# holzleitner_api.model.Delivery
|
||||
|
||||
## Load the model package
|
||||
```dart
|
||||
import 'package:holzleitner_api/api.dart';
|
||||
```
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**assignedCarId** | **String** | Fahrzeug-Zuordnung, gesetzt in der Auswählen-Phase. Bei Ein-Auto-Teams beim Sync automatisch gefüllt. | [optional]
|
||||
**contactPersonIds** | **BuiltList<String>** | Ausgewählte Ansprechpartner für genau diese Lieferung (Auswahl aus `Customer.contacts`). Kann leer sein. |
|
||||
**customerId** | **String** | |
|
||||
**deliveryAddressSnapshot** | [**Address**](Address.md) | Eingefrorene Liefer-Adresse zum Zeitpunkt des Tour-Syncs. Schützt vor rückwirkenden Kunden-Adressänderungen. |
|
||||
**desiredTime** | **String** | Wunsch-Lieferzeit als Freitext (z. B. \"vormittags\", \"ab 14:00\"). | [optional]
|
||||
**erpBelegartId** | **int** | ERP-Beleg-Bezug: business-stabiles Paar `(Belegart, Belegnummer)`. Überlebt den Belegkopf-Archivübergang. |
|
||||
**erpBelegnummer** | **String** | |
|
||||
**id** | **String** | |
|
||||
**specialAgreements** | **String** | Sondervereinbarungen (z. B. „Türklingel defekt, hintenrum klopfen\"). | [optional]
|
||||
**state** | [**DeliveryState**](DeliveryState.md) | |
|
||||
**stateReason** | **String** | Begründung bei `state == Held` oder `state == Canceled`. Beim Resume / Complete wieder `None`. | [optional]
|
||||
**tourId** | **String** | |
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
22
packages/holzleitner_api/doc/DeliveryItem.md
Normal file
22
packages/holzleitner_api/doc/DeliveryItem.md
Normal file
@ -0,0 +1,22 @@
|
||||
# holzleitner_api.model.DeliveryItem
|
||||
|
||||
## Load the model package
|
||||
```dart
|
||||
import 'package:holzleitner_api/api.dart';
|
||||
```
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**articleId** | **String** | |
|
||||
**belegzeilenNr** | **int** | ERP-Belegzeilen-Nr (Position innerhalb des Belegs). |
|
||||
**deliveryId** | **String** | |
|
||||
**id** | **String** | |
|
||||
**komponentenArtikelNr** | **String** | Bei Items aus einer Stückliste: Artikelnummer der Komponente. Bei regulären Belegzeilen: `None`. | [optional]
|
||||
**requiredQuantity** | **int** | |
|
||||
**scanState** | [**ScanState**](ScanState.md) | |
|
||||
**warehouseId** | **String** | |
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
21
packages/holzleitner_api/doc/DeliveryNote.md
Normal file
21
packages/holzleitner_api/doc/DeliveryNote.md
Normal file
@ -0,0 +1,21 @@
|
||||
# holzleitner_api.model.DeliveryNote
|
||||
|
||||
## Load the model package
|
||||
```dart
|
||||
import 'package:holzleitner_api/api.dart';
|
||||
```
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**authorCarId** | **String** | Fahrzeug, falls bekannt — nullable bis das Backend Cars verwaltet. | [optional]
|
||||
**authorPersonalnummer** | **int** | Personalnummer des Akteurs (aus dem JWT). Pflicht. |
|
||||
**createdAt** | [**DateTime**](DateTime.md) | |
|
||||
**deliveryId** | **String** | |
|
||||
**id** | **String** | |
|
||||
**imageAttachment** | **String** | Referenz auf einen Bild-Anhang (z. B. Object-Storage-Key/URL). | [optional]
|
||||
**text** | **String** | | [optional]
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
15
packages/holzleitner_api/doc/DeliveryNoteResponse.md
Normal file
15
packages/holzleitner_api/doc/DeliveryNoteResponse.md
Normal file
@ -0,0 +1,15 @@
|
||||
# holzleitner_api.model.DeliveryNoteResponse
|
||||
|
||||
## Load the model package
|
||||
```dart
|
||||
import 'package:holzleitner_api/api.dart';
|
||||
```
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**note** | [**DeliveryNote**](DeliveryNote.md) | |
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
16
packages/holzleitner_api/doc/DeliveryOrderEntry.md
Normal file
16
packages/holzleitner_api/doc/DeliveryOrderEntry.md
Normal file
@ -0,0 +1,16 @@
|
||||
# holzleitner_api.model.DeliveryOrderEntry
|
||||
|
||||
## Load the model package
|
||||
```dart
|
||||
import 'package:holzleitner_api/api.dart';
|
||||
```
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**deliveryId** | **String** | |
|
||||
**sortOrder** | **int** | |
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
15
packages/holzleitner_api/doc/DeliveryResponse.md
Normal file
15
packages/holzleitner_api/doc/DeliveryResponse.md
Normal file
@ -0,0 +1,15 @@
|
||||
# holzleitner_api.model.DeliveryResponse
|
||||
|
||||
## Load the model package
|
||||
```dart
|
||||
import 'package:holzleitner_api/api.dart';
|
||||
```
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**delivery** | [**Delivery**](Delivery.md) | |
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
14
packages/holzleitner_api/doc/DeliveryState.md
Normal file
14
packages/holzleitner_api/doc/DeliveryState.md
Normal file
@ -0,0 +1,14 @@
|
||||
# holzleitner_api.model.DeliveryState
|
||||
|
||||
## Load the model package
|
||||
```dart
|
||||
import 'package:holzleitner_api/api.dart';
|
||||
```
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
28
packages/holzleitner_api/doc/DeliveryWithItems.md
Normal file
28
packages/holzleitner_api/doc/DeliveryWithItems.md
Normal file
@ -0,0 +1,28 @@
|
||||
# holzleitner_api.model.DeliveryWithItems
|
||||
|
||||
## Load the model package
|
||||
```dart
|
||||
import 'package:holzleitner_api/api.dart';
|
||||
```
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**assignedCarId** | **String** | Fahrzeug-Zuordnung, gesetzt in der Auswählen-Phase. Bei Ein-Auto-Teams beim Sync automatisch gefüllt. | [optional]
|
||||
**contactPersonIds** | **BuiltList<String>** | Ausgewählte Ansprechpartner für genau diese Lieferung (Auswahl aus `Customer.contacts`). Kann leer sein. |
|
||||
**customerId** | **String** | |
|
||||
**deliveryAddressSnapshot** | [**Address**](Address.md) | Eingefrorene Liefer-Adresse zum Zeitpunkt des Tour-Syncs. Schützt vor rückwirkenden Kunden-Adressänderungen. |
|
||||
**desiredTime** | **String** | Wunsch-Lieferzeit als Freitext (z. B. \"vormittags\", \"ab 14:00\"). | [optional]
|
||||
**erpBelegartId** | **int** | ERP-Beleg-Bezug: business-stabiles Paar `(Belegart, Belegnummer)`. Überlebt den Belegkopf-Archivübergang. |
|
||||
**erpBelegnummer** | **String** | |
|
||||
**id** | **String** | |
|
||||
**specialAgreements** | **String** | Sondervereinbarungen (z. B. „Türklingel defekt, hintenrum klopfen\"). | [optional]
|
||||
**state** | [**DeliveryState**](DeliveryState.md) | |
|
||||
**stateReason** | **String** | Begründung bei `state == Held` oder `state == Canceled`. Beim Resume / Complete wieder `None`. | [optional]
|
||||
**tourId** | **String** | |
|
||||
**items** | [**BuiltList<DeliveryItem>**](DeliveryItem.md) | |
|
||||
**sortOrder** | **int** | Sortier-Reihenfolge innerhalb der Tour (1-basiert). |
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
51
packages/holzleitner_api/doc/HealthApi.md
Normal file
51
packages/holzleitner_api/doc/HealthApi.md
Normal file
@ -0,0 +1,51 @@
|
||||
# holzleitner_api.api.HealthApi
|
||||
|
||||
## Load the API package
|
||||
```dart
|
||||
import 'package:holzleitner_api/api.dart';
|
||||
```
|
||||
|
||||
All URIs are relative to *http://localhost*
|
||||
|
||||
Method | HTTP request | Description
|
||||
------------- | ------------- | -------------
|
||||
[**health**](HealthApi.md#health) | **GET** /health | Health-Endpoint für Load-Balancer und Container-Probes. Bewusst kein Auth — eine `200 ok`-Antwort darf nicht von der Auth abhängen.
|
||||
|
||||
|
||||
# **health**
|
||||
> String health()
|
||||
|
||||
Health-Endpoint für Load-Balancer und Container-Probes. Bewusst kein Auth — eine `200 ok`-Antwort darf nicht von der Auth abhängen.
|
||||
|
||||
### Example
|
||||
```dart
|
||||
import 'package:holzleitner_api/api.dart';
|
||||
|
||||
final api = HolzleitnerApi().getHealthApi();
|
||||
|
||||
try {
|
||||
final response = api.health();
|
||||
print(response);
|
||||
} catch on DioException (e) {
|
||||
print('Exception when calling HealthApi->health: $e\n');
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
This endpoint does not need any parameter.
|
||||
|
||||
### Return type
|
||||
|
||||
**String**
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: text/plain
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
15
packages/holzleitner_api/doc/HoldDeliveryRequest.md
Normal file
15
packages/holzleitner_api/doc/HoldDeliveryRequest.md
Normal file
@ -0,0 +1,15 @@
|
||||
# holzleitner_api.model.HoldDeliveryRequest
|
||||
|
||||
## Load the model package
|
||||
```dart
|
||||
import 'package:holzleitner_api/api.dart';
|
||||
```
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**reason** | **String** | |
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
20
packages/holzleitner_api/doc/ScanEvent.md
Normal file
20
packages/holzleitner_api/doc/ScanEvent.md
Normal file
@ -0,0 +1,20 @@
|
||||
# holzleitner_api.model.ScanEvent
|
||||
|
||||
## Load the model package
|
||||
```dart
|
||||
import 'package:holzleitner_api/api.dart';
|
||||
```
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**action** | [**AuditAction**](AuditAction.md) | |
|
||||
**actorCarId** | **String** | Fahrzeug, in dem der Scan gemacht wurde. Muss zum angemeldeten Account gehören. `None` ist erlaubt, schwächt aber den Audit-Trail. | [optional]
|
||||
**clientScanId** | **String** | |
|
||||
**clientScannedAt** | [**DateTime**](DateTime.md) | |
|
||||
**deliveryItemId** | **String** | |
|
||||
**reason** | **String** | Pflicht bei `Hold` und `Remove`. Sonst ignoriert. | [optional]
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
19
packages/holzleitner_api/doc/ScanResult.md
Normal file
19
packages/holzleitner_api/doc/ScanResult.md
Normal file
@ -0,0 +1,19 @@
|
||||
# holzleitner_api.model.ScanResult
|
||||
|
||||
## Load the model package
|
||||
```dart
|
||||
import 'package:holzleitner_api/api.dart';
|
||||
```
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**clientScanId** | **String** | |
|
||||
**deliveryItemId** | **String** | Aktueller `scan_state` der Position nach der Verarbeitung — genau dann gesetzt, wenn der Server den Stand kennen konnte (`Applied` oder `Duplicate`). Erlaubt der App, die UI ohne Re-Fetch zu aktualisieren. | [optional]
|
||||
**newScanState** | [**ScanState**](ScanState.md) | | [optional]
|
||||
**reason** | **String** | Bei `Rejected`: Begründung. Bei `Applied`/`Duplicate`: `None`. | [optional]
|
||||
**status** | [**ScanResultStatus**](ScanResultStatus.md) | |
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
14
packages/holzleitner_api/doc/ScanResultStatus.md
Normal file
14
packages/holzleitner_api/doc/ScanResultStatus.md
Normal file
@ -0,0 +1,14 @@
|
||||
# holzleitner_api.model.ScanResultStatus
|
||||
|
||||
## Load the model package
|
||||
```dart
|
||||
import 'package:holzleitner_api/api.dart';
|
||||
```
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
18
packages/holzleitner_api/doc/ScanState.md
Normal file
18
packages/holzleitner_api/doc/ScanState.md
Normal file
@ -0,0 +1,18 @@
|
||||
# holzleitner_api.model.ScanState
|
||||
|
||||
## Load the model package
|
||||
```dart
|
||||
import 'package:holzleitner_api/api.dart';
|
||||
```
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**heldReason** | **String** | Grund bei `status == Held` oder `status == Removed`. | [optional]
|
||||
**lastUpdatedAt** | [**DateTime**](DateTime.md) | |
|
||||
**scannedQuantity** | **int** | |
|
||||
**status** | [**ScanStatus**](ScanStatus.md) | |
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
14
packages/holzleitner_api/doc/ScanStatus.md
Normal file
14
packages/holzleitner_api/doc/ScanStatus.md
Normal file
@ -0,0 +1,14 @@
|
||||
# holzleitner_api.model.ScanStatus
|
||||
|
||||
## Load the model package
|
||||
```dart
|
||||
import 'package:holzleitner_api/api.dart';
|
||||
```
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
57
packages/holzleitner_api/doc/ScansApi.md
Normal file
57
packages/holzleitner_api/doc/ScansApi.md
Normal file
@ -0,0 +1,57 @@
|
||||
# holzleitner_api.api.ScansApi
|
||||
|
||||
## Load the API package
|
||||
```dart
|
||||
import 'package:holzleitner_api/api.dart';
|
||||
```
|
||||
|
||||
All URIs are relative to *http://localhost*
|
||||
|
||||
Method | HTTP request | Description
|
||||
------------- | ------------- | -------------
|
||||
[**applyScans**](ScansApi.md#applyscans) | **POST** /scans | Wendet eine Liste von Scan-Events idempotent an.
|
||||
|
||||
|
||||
# **applyScans**
|
||||
> ApplyScansResponse applyScans(applyScansRequest)
|
||||
|
||||
Wendet eine Liste von Scan-Events idempotent an.
|
||||
|
||||
Pro Event ein eigenes Resultat. Status `applied` schreibt einen frischen Audit-Eintrag, `duplicate` liefert den aktuellen Stand am Server, `rejected` enthält die Begründung. Reihenfolge der `results` entspricht der Reihenfolge der `scans` im Request.
|
||||
|
||||
### Example
|
||||
```dart
|
||||
import 'package:holzleitner_api/api.dart';
|
||||
|
||||
final api = HolzleitnerApi().getScansApi();
|
||||
final ApplyScansRequest applyScansRequest = ; // ApplyScansRequest |
|
||||
|
||||
try {
|
||||
final response = api.applyScans(applyScansRequest);
|
||||
print(response);
|
||||
} catch on DioException (e) {
|
||||
print('Exception when calling ScansApi->applyScans: $e\n');
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**applyScansRequest** | [**ApplyScansRequest**](ApplyScansRequest.md)| |
|
||||
|
||||
### Return type
|
||||
|
||||
[**ApplyScansResponse**](ApplyScansResponse.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
[bearer_auth](../README.md#bearer_auth)
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: application/json
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
15
packages/holzleitner_api/doc/SetDeliveryOrderRequest.md
Normal file
15
packages/holzleitner_api/doc/SetDeliveryOrderRequest.md
Normal file
@ -0,0 +1,15 @@
|
||||
# holzleitner_api.model.SetDeliveryOrderRequest
|
||||
|
||||
## Load the model package
|
||||
```dart
|
||||
import 'package:holzleitner_api/api.dart';
|
||||
```
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**deliveryIds** | **BuiltList<String>** | Reihenfolge: Position im Array (0-basiert) wird zu `sort_order` (1-basiert) gemappt. |
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
16
packages/holzleitner_api/doc/SetDeliveryOrderResponse.md
Normal file
16
packages/holzleitner_api/doc/SetDeliveryOrderResponse.md
Normal file
@ -0,0 +1,16 @@
|
||||
# holzleitner_api.model.SetDeliveryOrderResponse
|
||||
|
||||
## Load the model package
|
||||
```dart
|
||||
import 'package:holzleitner_api/api.dart';
|
||||
```
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**order** | [**BuiltList<DeliveryOrderEntry>**](DeliveryOrderEntry.md) | |
|
||||
**tourId** | **String** | |
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
55
packages/holzleitner_api/doc/SyncApi.md
Normal file
55
packages/holzleitner_api/doc/SyncApi.md
Normal file
@ -0,0 +1,55 @@
|
||||
# holzleitner_api.api.SyncApi
|
||||
|
||||
## Load the API package
|
||||
```dart
|
||||
import 'package:holzleitner_api/api.dart';
|
||||
```
|
||||
|
||||
All URIs are relative to *http://localhost*
|
||||
|
||||
Method | HTTP request | Description
|
||||
------------- | ------------- | -------------
|
||||
[**syncTour**](SyncApi.md#synctour) | **POST** /sync/tour | Sync-Endpoint für das ERP: legt eine Tagestour samt Lieferungen und Positionen idempotent an. Identität pro Tour `(driver_personalnummer, tour_date)`, pro Lieferung `(belegart_id, belegnummer)`.
|
||||
|
||||
|
||||
# **syncTour**
|
||||
> SyncTourResponse syncTour(syncTourRequest)
|
||||
|
||||
Sync-Endpoint für das ERP: legt eine Tagestour samt Lieferungen und Positionen idempotent an. Identität pro Tour `(driver_personalnummer, tour_date)`, pro Lieferung `(belegart_id, belegnummer)`.
|
||||
|
||||
### Example
|
||||
```dart
|
||||
import 'package:holzleitner_api/api.dart';
|
||||
|
||||
final api = HolzleitnerApi().getSyncApi();
|
||||
final SyncTourRequest syncTourRequest = ; // SyncTourRequest |
|
||||
|
||||
try {
|
||||
final response = api.syncTour(syncTourRequest);
|
||||
print(response);
|
||||
} catch on DioException (e) {
|
||||
print('Exception when calling SyncApi->syncTour: $e\n');
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**syncTourRequest** | [**SyncTourRequest**](SyncTourRequest.md)| |
|
||||
|
||||
### Return type
|
||||
|
||||
[**SyncTourResponse**](SyncTourResponse.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
[bearer_auth](../README.md#bearer_auth)
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: application/json
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
24
packages/holzleitner_api/doc/SyncDelivery.md
Normal file
24
packages/holzleitner_api/doc/SyncDelivery.md
Normal file
@ -0,0 +1,24 @@
|
||||
# holzleitner_api.model.SyncDelivery
|
||||
|
||||
## Load the model package
|
||||
```dart
|
||||
import 'package:holzleitner_api/api.dart';
|
||||
```
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**belegartId** | **int** | |
|
||||
**belegnummer** | **String** | |
|
||||
**customerAddress** | [**Address**](Address.md) | |
|
||||
**customerName** | **String** | |
|
||||
**deliveryAddress** | [**Address**](Address.md) | Snapshot der Lieferadresse (kann von der Stammadresse abweichen). |
|
||||
**desiredTime** | **String** | | [optional]
|
||||
**erpCustomerId** | **int** | |
|
||||
**items** | [**BuiltList<SyncDeliveryItem>**](SyncDeliveryItem.md) | |
|
||||
**sortOrder** | **int** | 1-basiert, definiert die initiale Reihenfolge in der App. |
|
||||
**specialAgreements** | **String** | | [optional]
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
23
packages/holzleitner_api/doc/SyncDeliveryItem.md
Normal file
23
packages/holzleitner_api/doc/SyncDeliveryItem.md
Normal file
@ -0,0 +1,23 @@
|
||||
# holzleitner_api.model.SyncDeliveryItem
|
||||
|
||||
## Load the model package
|
||||
```dart
|
||||
import 'package:holzleitner_api/api.dart';
|
||||
```
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**articleDefaultWarehouseCode** | **String** | Default-Lager-Code für den Artikel (Anlage neuer Artikel). | [optional]
|
||||
**articleName** | **String** | |
|
||||
**articleNumber** | **String** | |
|
||||
**articleScannable** | **bool** | |
|
||||
**belegzeilenNr** | **int** | |
|
||||
**komponentenArtikelNr** | **String** | Komponenten-Artikelnummer bei aufgelösten Stücklisten, sonst leer. | [optional]
|
||||
**requiredQuantity** | **int** | |
|
||||
**warehouseCode** | **String** | |
|
||||
**warehouseName** | **String** | |
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
17
packages/holzleitner_api/doc/SyncTourRequest.md
Normal file
17
packages/holzleitner_api/doc/SyncTourRequest.md
Normal file
@ -0,0 +1,17 @@
|
||||
# holzleitner_api.model.SyncTourRequest
|
||||
|
||||
## Load the model package
|
||||
```dart
|
||||
import 'package:holzleitner_api/api.dart';
|
||||
```
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**deliveries** | [**BuiltList<SyncDelivery>**](SyncDelivery.md) | |
|
||||
**driverPersonalnummer** | **int** | |
|
||||
**tourDate** | [**Date**](Date.md) | |
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
15
packages/holzleitner_api/doc/SyncTourResponse.md
Normal file
15
packages/holzleitner_api/doc/SyncTourResponse.md
Normal file
@ -0,0 +1,15 @@
|
||||
# holzleitner_api.model.SyncTourResponse
|
||||
|
||||
## Load the model package
|
||||
```dart
|
||||
import 'package:holzleitner_api/api.dart';
|
||||
```
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**tourId** | **String** | |
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
18
packages/holzleitner_api/doc/Tour.md
Normal file
18
packages/holzleitner_api/doc/Tour.md
Normal file
@ -0,0 +1,18 @@
|
||||
# holzleitner_api.model.Tour
|
||||
|
||||
## Load the model package
|
||||
```dart
|
||||
import 'package:holzleitner_api/api.dart';
|
||||
```
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**accountId** | **int** | |
|
||||
**date** | [**Date**](Date.md) | |
|
||||
**id** | **String** | |
|
||||
**syncedAt** | [**DateTime**](DateTime.md) | Zeitpunkt des letzten ERP-Sync — für Drift-Erkennung. |
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
21
packages/holzleitner_api/doc/TourDetails.md
Normal file
21
packages/holzleitner_api/doc/TourDetails.md
Normal file
@ -0,0 +1,21 @@
|
||||
# holzleitner_api.model.TourDetails
|
||||
|
||||
## Load the model package
|
||||
```dart
|
||||
import 'package:holzleitner_api/api.dart';
|
||||
```
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**articles** | [**BuiltList<Article>**](Article.md) | |
|
||||
**customerContacts** | [**BuiltList<CustomerContact>**](CustomerContact.md) | |
|
||||
**customers** | [**BuiltList<Customer>**](Customer.md) | |
|
||||
**deliveries** | [**BuiltList<DeliveryWithItems>**](DeliveryWithItems.md) | |
|
||||
**notes** | [**BuiltList<DeliveryNote>**](DeliveryNote.md) | Alle Notizen aller Lieferungen dieser Tour, in einer Liste. Die App joint clientseitig per `delivery_id`. Reihenfolge: pro Lieferung aufsteigend nach `created_at`. |
|
||||
**tour** | [**Tour**](Tour.md) | |
|
||||
**warehouses** | [**BuiltList<Warehouse>**](Warehouse.md) | |
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
17
packages/holzleitner_api/doc/TourSummary.md
Normal file
17
packages/holzleitner_api/doc/TourSummary.md
Normal file
@ -0,0 +1,17 @@
|
||||
# holzleitner_api.model.TourSummary
|
||||
|
||||
## Load the model package
|
||||
```dart
|
||||
import 'package:holzleitner_api/api.dart';
|
||||
```
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**deliveryCount** | **int** | |
|
||||
**tourDate** | [**Date**](Date.md) | |
|
||||
**tourId** | **String** | |
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
15
packages/holzleitner_api/doc/TourSummaryList.md
Normal file
15
packages/holzleitner_api/doc/TourSummaryList.md
Normal file
@ -0,0 +1,15 @@
|
||||
# holzleitner_api.model.TourSummaryList
|
||||
|
||||
## Load the model package
|
||||
```dart
|
||||
import 'package:holzleitner_api/api.dart';
|
||||
```
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**tours** | [**BuiltList<TourSummary>**](TourSummary.md) | |
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
137
packages/holzleitner_api/doc/ToursApi.md
Normal file
137
packages/holzleitner_api/doc/ToursApi.md
Normal file
@ -0,0 +1,137 @@
|
||||
# holzleitner_api.api.ToursApi
|
||||
|
||||
## Load the API package
|
||||
```dart
|
||||
import 'package:holzleitner_api/api.dart';
|
||||
```
|
||||
|
||||
All URIs are relative to *http://localhost*
|
||||
|
||||
Method | HTTP request | Description
|
||||
------------- | ------------- | -------------
|
||||
[**getTour**](ToursApi.md#gettour) | **GET** /tours/{tour_id} | Lädt eine Tour mit allen Lieferungen, Positionen und referenzierten Stammdaten — die App nutzt das als einzigen großen Read.
|
||||
[**listMyToursToday**](ToursApi.md#listmytourstoday) | **GET** /me/tours/today | Listet heutige Touren des angemeldeten Fahrers (Filter aus dem JWT).
|
||||
[**setDeliveryOrder**](ToursApi.md#setdeliveryorder) | **PUT** /tours/{tour_id}/delivery-order | Schreibt die Sortier-Reihenfolge aller Lieferungen einer Tour neu. Der Client schickt die **vollständige** neue Reihenfolge; fehlende oder fremde Lieferungs-Ids werden mit `400 validation` abgelehnt.
|
||||
|
||||
|
||||
# **getTour**
|
||||
> TourDetails getTour(tourId)
|
||||
|
||||
Lädt eine Tour mit allen Lieferungen, Positionen und referenzierten Stammdaten — die App nutzt das als einzigen großen Read.
|
||||
|
||||
### Example
|
||||
```dart
|
||||
import 'package:holzleitner_api/api.dart';
|
||||
|
||||
final api = HolzleitnerApi().getToursApi();
|
||||
final String tourId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // String | Eindeutige Tour-Id (UUID)
|
||||
|
||||
try {
|
||||
final response = api.getTour(tourId);
|
||||
print(response);
|
||||
} catch on DioException (e) {
|
||||
print('Exception when calling ToursApi->getTour: $e\n');
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**tourId** | **String**| Eindeutige Tour-Id (UUID) |
|
||||
|
||||
### Return type
|
||||
|
||||
[**TourDetails**](TourDetails.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
[bearer_auth](../README.md#bearer_auth)
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
# **listMyToursToday**
|
||||
> TourSummaryList listMyToursToday()
|
||||
|
||||
Listet heutige Touren des angemeldeten Fahrers (Filter aus dem JWT).
|
||||
|
||||
### Example
|
||||
```dart
|
||||
import 'package:holzleitner_api/api.dart';
|
||||
|
||||
final api = HolzleitnerApi().getToursApi();
|
||||
|
||||
try {
|
||||
final response = api.listMyToursToday();
|
||||
print(response);
|
||||
} catch on DioException (e) {
|
||||
print('Exception when calling ToursApi->listMyToursToday: $e\n');
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
This endpoint does not need any parameter.
|
||||
|
||||
### Return type
|
||||
|
||||
[**TourSummaryList**](TourSummaryList.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
[bearer_auth](../README.md#bearer_auth)
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
# **setDeliveryOrder**
|
||||
> SetDeliveryOrderResponse setDeliveryOrder(tourId, setDeliveryOrderRequest)
|
||||
|
||||
Schreibt die Sortier-Reihenfolge aller Lieferungen einer Tour neu. Der Client schickt die **vollständige** neue Reihenfolge; fehlende oder fremde Lieferungs-Ids werden mit `400 validation` abgelehnt.
|
||||
|
||||
### Example
|
||||
```dart
|
||||
import 'package:holzleitner_api/api.dart';
|
||||
|
||||
final api = HolzleitnerApi().getToursApi();
|
||||
final String tourId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // String |
|
||||
final SetDeliveryOrderRequest setDeliveryOrderRequest = ; // SetDeliveryOrderRequest |
|
||||
|
||||
try {
|
||||
final response = api.setDeliveryOrder(tourId, setDeliveryOrderRequest);
|
||||
print(response);
|
||||
} catch on DioException (e) {
|
||||
print('Exception when calling ToursApi->setDeliveryOrder: $e\n');
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**tourId** | **String**| |
|
||||
**setDeliveryOrderRequest** | [**SetDeliveryOrderRequest**](SetDeliveryOrderRequest.md)| |
|
||||
|
||||
### Return type
|
||||
|
||||
[**SetDeliveryOrderResponse**](SetDeliveryOrderResponse.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
[bearer_auth](../README.md#bearer_auth)
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: application/json
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
16
packages/holzleitner_api/doc/UpdateCarRequest.md
Normal file
16
packages/holzleitner_api/doc/UpdateCarRequest.md
Normal file
@ -0,0 +1,16 @@
|
||||
# holzleitner_api.model.UpdateCarRequest
|
||||
|
||||
## Load the model package
|
||||
```dart
|
||||
import 'package:holzleitner_api/api.dart';
|
||||
```
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**active** | **bool** | Wenn gesetzt: aktiv/inaktiv. Inaktive Fahrzeuge tauchen in `GET /me/cars?activeOnly=true` (default) nicht auf. | [optional]
|
||||
**plate** | **String** | Wenn gesetzt: neues Kennzeichen. | [optional]
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
18
packages/holzleitner_api/doc/Warehouse.md
Normal file
18
packages/holzleitner_api/doc/Warehouse.md
Normal file
@ -0,0 +1,18 @@
|
||||
# holzleitner_api.model.Warehouse
|
||||
|
||||
## Load the model package
|
||||
```dart
|
||||
import 'package:holzleitner_api/api.dart';
|
||||
```
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**code** | **String** | |
|
||||
**id** | **String** | |
|
||||
**isStandard** | **bool** | |
|
||||
**name** | **String** | |
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
62
packages/holzleitner_api/lib/holzleitner_api.dart
Normal file
62
packages/holzleitner_api/lib/holzleitner_api.dart
Normal file
@ -0,0 +1,62 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
|
||||
export 'package:holzleitner_api/src/api.dart';
|
||||
export 'package:holzleitner_api/src/auth/api_key_auth.dart';
|
||||
export 'package:holzleitner_api/src/auth/basic_auth.dart';
|
||||
export 'package:holzleitner_api/src/auth/bearer_auth.dart';
|
||||
export 'package:holzleitner_api/src/auth/oauth.dart';
|
||||
export 'package:holzleitner_api/src/serializers.dart';
|
||||
export 'package:holzleitner_api/src/model/date.dart';
|
||||
|
||||
export 'package:holzleitner_api/src/api/accounts_api.dart';
|
||||
export 'package:holzleitner_api/src/api/cars_api.dart';
|
||||
export 'package:holzleitner_api/src/api/deliveries_api.dart';
|
||||
export 'package:holzleitner_api/src/api/health_api.dart';
|
||||
export 'package:holzleitner_api/src/api/scans_api.dart';
|
||||
export 'package:holzleitner_api/src/api/sync_api.dart';
|
||||
export 'package:holzleitner_api/src/api/tours_api.dart';
|
||||
|
||||
export 'package:holzleitner_api/src/model/account.dart';
|
||||
export 'package:holzleitner_api/src/model/address.dart';
|
||||
export 'package:holzleitner_api/src/model/apply_scans_request.dart';
|
||||
export 'package:holzleitner_api/src/model/apply_scans_response.dart';
|
||||
export 'package:holzleitner_api/src/model/article.dart';
|
||||
export 'package:holzleitner_api/src/model/assign_car_request.dart';
|
||||
export 'package:holzleitner_api/src/model/audit_action.dart';
|
||||
export 'package:holzleitner_api/src/model/cancel_delivery_request.dart';
|
||||
export 'package:holzleitner_api/src/model/car.dart';
|
||||
export 'package:holzleitner_api/src/model/car_response.dart';
|
||||
export 'package:holzleitner_api/src/model/cars_list.dart';
|
||||
export 'package:holzleitner_api/src/model/create_car_request.dart';
|
||||
export 'package:holzleitner_api/src/model/create_delivery_note_request.dart';
|
||||
export 'package:holzleitner_api/src/model/customer.dart';
|
||||
export 'package:holzleitner_api/src/model/customer_contact.dart';
|
||||
export 'package:holzleitner_api/src/model/delivery.dart';
|
||||
export 'package:holzleitner_api/src/model/delivery_item.dart';
|
||||
export 'package:holzleitner_api/src/model/delivery_note.dart';
|
||||
export 'package:holzleitner_api/src/model/delivery_note_response.dart';
|
||||
export 'package:holzleitner_api/src/model/delivery_order_entry.dart';
|
||||
export 'package:holzleitner_api/src/model/delivery_response.dart';
|
||||
export 'package:holzleitner_api/src/model/delivery_state.dart';
|
||||
export 'package:holzleitner_api/src/model/delivery_with_items.dart';
|
||||
export 'package:holzleitner_api/src/model/hold_delivery_request.dart';
|
||||
export 'package:holzleitner_api/src/model/scan_event.dart';
|
||||
export 'package:holzleitner_api/src/model/scan_result.dart';
|
||||
export 'package:holzleitner_api/src/model/scan_result_status.dart';
|
||||
export 'package:holzleitner_api/src/model/scan_state.dart';
|
||||
export 'package:holzleitner_api/src/model/scan_status.dart';
|
||||
export 'package:holzleitner_api/src/model/set_delivery_order_request.dart';
|
||||
export 'package:holzleitner_api/src/model/set_delivery_order_response.dart';
|
||||
export 'package:holzleitner_api/src/model/sync_delivery.dart';
|
||||
export 'package:holzleitner_api/src/model/sync_delivery_item.dart';
|
||||
export 'package:holzleitner_api/src/model/sync_tour_request.dart';
|
||||
export 'package:holzleitner_api/src/model/sync_tour_response.dart';
|
||||
export 'package:holzleitner_api/src/model/tour.dart';
|
||||
export 'package:holzleitner_api/src/model/tour_details.dart';
|
||||
export 'package:holzleitner_api/src/model/tour_summary.dart';
|
||||
export 'package:holzleitner_api/src/model/tour_summary_list.dart';
|
||||
export 'package:holzleitner_api/src/model/update_car_request.dart';
|
||||
export 'package:holzleitner_api/src/model/warehouse.dart';
|
||||
|
||||
115
packages/holzleitner_api/lib/src/api.dart
Normal file
115
packages/holzleitner_api/lib/src/api.dart
Normal file
@ -0,0 +1,115 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
|
||||
import 'package:dio/dio.dart';
|
||||
import 'package:built_value/serializer.dart';
|
||||
import 'package:holzleitner_api/src/serializers.dart';
|
||||
import 'package:holzleitner_api/src/auth/api_key_auth.dart';
|
||||
import 'package:holzleitner_api/src/auth/basic_auth.dart';
|
||||
import 'package:holzleitner_api/src/auth/bearer_auth.dart';
|
||||
import 'package:holzleitner_api/src/auth/oauth.dart';
|
||||
import 'package:holzleitner_api/src/api/accounts_api.dart';
|
||||
import 'package:holzleitner_api/src/api/cars_api.dart';
|
||||
import 'package:holzleitner_api/src/api/deliveries_api.dart';
|
||||
import 'package:holzleitner_api/src/api/health_api.dart';
|
||||
import 'package:holzleitner_api/src/api/scans_api.dart';
|
||||
import 'package:holzleitner_api/src/api/sync_api.dart';
|
||||
import 'package:holzleitner_api/src/api/tours_api.dart';
|
||||
|
||||
class HolzleitnerApi {
|
||||
static const String basePath = r'http://localhost';
|
||||
|
||||
final Dio dio;
|
||||
final Serializers serializers;
|
||||
|
||||
HolzleitnerApi({
|
||||
Dio? dio,
|
||||
Serializers? serializers,
|
||||
String? basePathOverride,
|
||||
List<Interceptor>? interceptors,
|
||||
}) : this.serializers = serializers ?? standardSerializers,
|
||||
this.dio = dio ??
|
||||
Dio(BaseOptions(
|
||||
baseUrl: basePathOverride ?? basePath,
|
||||
connectTimeout: const Duration(milliseconds: 5000),
|
||||
receiveTimeout: const Duration(milliseconds: 3000),
|
||||
)) {
|
||||
if (interceptors == null) {
|
||||
this.dio.interceptors.addAll([
|
||||
OAuthInterceptor(),
|
||||
BasicAuthInterceptor(),
|
||||
BearerAuthInterceptor(),
|
||||
ApiKeyAuthInterceptor(),
|
||||
]);
|
||||
} else {
|
||||
this.dio.interceptors.addAll(interceptors);
|
||||
}
|
||||
}
|
||||
|
||||
void setOAuthToken(String name, String token) {
|
||||
if (this.dio.interceptors.any((i) => i is OAuthInterceptor)) {
|
||||
(this.dio.interceptors.firstWhere((i) => i is OAuthInterceptor) as OAuthInterceptor).tokens[name] = token;
|
||||
}
|
||||
}
|
||||
|
||||
void setBearerAuth(String name, String token) {
|
||||
if (this.dio.interceptors.any((i) => i is BearerAuthInterceptor)) {
|
||||
(this.dio.interceptors.firstWhere((i) => i is BearerAuthInterceptor) as BearerAuthInterceptor).tokens[name] = token;
|
||||
}
|
||||
}
|
||||
|
||||
void setBasicAuth(String name, String username, String password) {
|
||||
if (this.dio.interceptors.any((i) => i is BasicAuthInterceptor)) {
|
||||
(this.dio.interceptors.firstWhere((i) => i is BasicAuthInterceptor) as BasicAuthInterceptor).authInfo[name] = BasicAuthInfo(username, password);
|
||||
}
|
||||
}
|
||||
|
||||
void setApiKey(String name, String apiKey) {
|
||||
if (this.dio.interceptors.any((i) => i is ApiKeyAuthInterceptor)) {
|
||||
(this.dio.interceptors.firstWhere((element) => element is ApiKeyAuthInterceptor) as ApiKeyAuthInterceptor).apiKeys[name] = apiKey;
|
||||
}
|
||||
}
|
||||
|
||||
/// Get AccountsApi instance, base route and serializer can be overridden by a given but be careful,
|
||||
/// by doing that all interceptors will not be executed
|
||||
AccountsApi getAccountsApi() {
|
||||
return AccountsApi(dio, serializers);
|
||||
}
|
||||
|
||||
/// Get CarsApi instance, base route and serializer can be overridden by a given but be careful,
|
||||
/// by doing that all interceptors will not be executed
|
||||
CarsApi getCarsApi() {
|
||||
return CarsApi(dio, serializers);
|
||||
}
|
||||
|
||||
/// Get DeliveriesApi instance, base route and serializer can be overridden by a given but be careful,
|
||||
/// by doing that all interceptors will not be executed
|
||||
DeliveriesApi getDeliveriesApi() {
|
||||
return DeliveriesApi(dio, serializers);
|
||||
}
|
||||
|
||||
/// Get HealthApi instance, base route and serializer can be overridden by a given but be careful,
|
||||
/// by doing that all interceptors will not be executed
|
||||
HealthApi getHealthApi() {
|
||||
return HealthApi(dio, serializers);
|
||||
}
|
||||
|
||||
/// Get ScansApi instance, base route and serializer can be overridden by a given but be careful,
|
||||
/// by doing that all interceptors will not be executed
|
||||
ScansApi getScansApi() {
|
||||
return ScansApi(dio, serializers);
|
||||
}
|
||||
|
||||
/// Get SyncApi instance, base route and serializer can be overridden by a given but be careful,
|
||||
/// by doing that all interceptors will not be executed
|
||||
SyncApi getSyncApi() {
|
||||
return SyncApi(dio, serializers);
|
||||
}
|
||||
|
||||
/// Get ToursApi instance, base route and serializer can be overridden by a given but be careful,
|
||||
/// by doing that all interceptors will not be executed
|
||||
ToursApi getToursApi() {
|
||||
return ToursApi(dio, serializers);
|
||||
}
|
||||
}
|
||||
103
packages/holzleitner_api/lib/src/api/accounts_api.dart
Normal file
103
packages/holzleitner_api/lib/src/api/accounts_api.dart
Normal file
@ -0,0 +1,103 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:built_value/json_object.dart';
|
||||
import 'package:built_value/serializer.dart';
|
||||
import 'package:dio/dio.dart';
|
||||
|
||||
import 'package:holzleitner_api/src/api_util.dart';
|
||||
import 'package:holzleitner_api/src/model/account.dart';
|
||||
|
||||
class AccountsApi {
|
||||
|
||||
final Dio _dio;
|
||||
|
||||
final Serializers _serializers;
|
||||
|
||||
const AccountsApi(this._dio, this._serializers);
|
||||
|
||||
/// Liest den Account zu einer Personalnummer.
|
||||
///
|
||||
///
|
||||
/// Parameters:
|
||||
/// * [personalnummer] - Personalnummer des Accounts
|
||||
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
|
||||
/// * [headers] - Can be used to add additional headers to the request
|
||||
/// * [extras] - Can be used to add flags to the request
|
||||
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
|
||||
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
|
||||
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
|
||||
///
|
||||
/// Returns a [Future] containing a [Response] with a [Account] as data
|
||||
/// Throws [DioException] if API call or serialization fails
|
||||
Future<Response<Account>> getAccount({
|
||||
required int personalnummer,
|
||||
CancelToken? cancelToken,
|
||||
Map<String, dynamic>? headers,
|
||||
Map<String, dynamic>? extra,
|
||||
ValidateStatus? validateStatus,
|
||||
ProgressCallback? onSendProgress,
|
||||
ProgressCallback? onReceiveProgress,
|
||||
}) async {
|
||||
final _path = r'/accounts/{personalnummer}'.replaceAll('{' r'personalnummer' '}', encodeQueryParameter(_serializers, personalnummer, const FullType(int)).toString());
|
||||
final _options = Options(
|
||||
method: r'GET',
|
||||
headers: <String, dynamic>{
|
||||
...?headers,
|
||||
},
|
||||
extra: <String, dynamic>{
|
||||
'secure': <Map<String, String>>[
|
||||
{
|
||||
'type': 'http',
|
||||
'scheme': 'bearer',
|
||||
'name': 'bearer_auth',
|
||||
},
|
||||
],
|
||||
...?extra,
|
||||
},
|
||||
validateStatus: validateStatus,
|
||||
);
|
||||
|
||||
final _response = await _dio.request<Object>(
|
||||
_path,
|
||||
options: _options,
|
||||
cancelToken: cancelToken,
|
||||
onSendProgress: onSendProgress,
|
||||
onReceiveProgress: onReceiveProgress,
|
||||
);
|
||||
|
||||
Account? _responseData;
|
||||
|
||||
try {
|
||||
final rawResponse = _response.data;
|
||||
_responseData = rawResponse == null ? null : _serializers.deserialize(
|
||||
rawResponse,
|
||||
specifiedType: const FullType(Account),
|
||||
) as Account;
|
||||
|
||||
} catch (error, stackTrace) {
|
||||
throw DioException(
|
||||
requestOptions: _response.requestOptions,
|
||||
response: _response,
|
||||
type: DioExceptionType.unknown,
|
||||
error: error,
|
||||
stackTrace: stackTrace,
|
||||
);
|
||||
}
|
||||
|
||||
return Response<Account>(
|
||||
data: _responseData,
|
||||
headers: _response.headers,
|
||||
isRedirect: _response.isRedirect,
|
||||
requestOptions: _response.requestOptions,
|
||||
redirects: _response.redirects,
|
||||
statusCode: _response.statusCode,
|
||||
statusMessage: _response.statusMessage,
|
||||
extra: _response.extra,
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
315
packages/holzleitner_api/lib/src/api/cars_api.dart
Normal file
315
packages/holzleitner_api/lib/src/api/cars_api.dart
Normal file
@ -0,0 +1,315 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:built_value/json_object.dart';
|
||||
import 'package:built_value/serializer.dart';
|
||||
import 'package:dio/dio.dart';
|
||||
|
||||
import 'package:holzleitner_api/src/api_util.dart';
|
||||
import 'package:holzleitner_api/src/model/car_response.dart';
|
||||
import 'package:holzleitner_api/src/model/cars_list.dart';
|
||||
import 'package:holzleitner_api/src/model/create_car_request.dart';
|
||||
import 'package:holzleitner_api/src/model/update_car_request.dart';
|
||||
|
||||
class CarsApi {
|
||||
|
||||
final Dio _dio;
|
||||
|
||||
final Serializers _serializers;
|
||||
|
||||
const CarsApi(this._dio, this._serializers);
|
||||
|
||||
/// Legt ein neues Fahrzeug für den angemeldeten Fahrer an.
|
||||
///
|
||||
///
|
||||
/// Parameters:
|
||||
/// * [createCarRequest]
|
||||
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
|
||||
/// * [headers] - Can be used to add additional headers to the request
|
||||
/// * [extras] - Can be used to add flags to the request
|
||||
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
|
||||
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
|
||||
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
|
||||
///
|
||||
/// Returns a [Future] containing a [Response] with a [CarResponse] as data
|
||||
/// Throws [DioException] if API call or serialization fails
|
||||
Future<Response<CarResponse>> createMyCar({
|
||||
required CreateCarRequest createCarRequest,
|
||||
CancelToken? cancelToken,
|
||||
Map<String, dynamic>? headers,
|
||||
Map<String, dynamic>? extra,
|
||||
ValidateStatus? validateStatus,
|
||||
ProgressCallback? onSendProgress,
|
||||
ProgressCallback? onReceiveProgress,
|
||||
}) async {
|
||||
final _path = r'/me/cars';
|
||||
final _options = Options(
|
||||
method: r'POST',
|
||||
headers: <String, dynamic>{
|
||||
...?headers,
|
||||
},
|
||||
extra: <String, dynamic>{
|
||||
'secure': <Map<String, String>>[
|
||||
{
|
||||
'type': 'http',
|
||||
'scheme': 'bearer',
|
||||
'name': 'bearer_auth',
|
||||
},
|
||||
],
|
||||
...?extra,
|
||||
},
|
||||
contentType: 'application/json',
|
||||
validateStatus: validateStatus,
|
||||
);
|
||||
|
||||
dynamic _bodyData;
|
||||
|
||||
try {
|
||||
const _type = FullType(CreateCarRequest);
|
||||
_bodyData = _serializers.serialize(createCarRequest, specifiedType: _type);
|
||||
|
||||
} catch(error, stackTrace) {
|
||||
throw DioException(
|
||||
requestOptions: _options.compose(
|
||||
_dio.options,
|
||||
_path,
|
||||
),
|
||||
type: DioExceptionType.unknown,
|
||||
error: error,
|
||||
stackTrace: stackTrace,
|
||||
);
|
||||
}
|
||||
|
||||
final _response = await _dio.request<Object>(
|
||||
_path,
|
||||
data: _bodyData,
|
||||
options: _options,
|
||||
cancelToken: cancelToken,
|
||||
onSendProgress: onSendProgress,
|
||||
onReceiveProgress: onReceiveProgress,
|
||||
);
|
||||
|
||||
CarResponse? _responseData;
|
||||
|
||||
try {
|
||||
final rawResponse = _response.data;
|
||||
_responseData = rawResponse == null ? null : _serializers.deserialize(
|
||||
rawResponse,
|
||||
specifiedType: const FullType(CarResponse),
|
||||
) as CarResponse;
|
||||
|
||||
} catch (error, stackTrace) {
|
||||
throw DioException(
|
||||
requestOptions: _response.requestOptions,
|
||||
response: _response,
|
||||
type: DioExceptionType.unknown,
|
||||
error: error,
|
||||
stackTrace: stackTrace,
|
||||
);
|
||||
}
|
||||
|
||||
return Response<CarResponse>(
|
||||
data: _responseData,
|
||||
headers: _response.headers,
|
||||
isRedirect: _response.isRedirect,
|
||||
requestOptions: _response.requestOptions,
|
||||
redirects: _response.redirects,
|
||||
statusCode: _response.statusCode,
|
||||
statusMessage: _response.statusMessage,
|
||||
extra: _response.extra,
|
||||
);
|
||||
}
|
||||
|
||||
/// Listet die Fahrzeuge des angemeldeten Fahrers.
|
||||
///
|
||||
///
|
||||
/// Parameters:
|
||||
/// * [includeInactive] - Wenn true, werden inaktive Fahrzeuge mitgeliefert (default: false)
|
||||
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
|
||||
/// * [headers] - Can be used to add additional headers to the request
|
||||
/// * [extras] - Can be used to add flags to the request
|
||||
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
|
||||
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
|
||||
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
|
||||
///
|
||||
/// Returns a [Future] containing a [Response] with a [CarsList] as data
|
||||
/// Throws [DioException] if API call or serialization fails
|
||||
Future<Response<CarsList>> listMyCars({
|
||||
bool? includeInactive,
|
||||
CancelToken? cancelToken,
|
||||
Map<String, dynamic>? headers,
|
||||
Map<String, dynamic>? extra,
|
||||
ValidateStatus? validateStatus,
|
||||
ProgressCallback? onSendProgress,
|
||||
ProgressCallback? onReceiveProgress,
|
||||
}) async {
|
||||
final _path = r'/me/cars';
|
||||
final _options = Options(
|
||||
method: r'GET',
|
||||
headers: <String, dynamic>{
|
||||
...?headers,
|
||||
},
|
||||
extra: <String, dynamic>{
|
||||
'secure': <Map<String, String>>[
|
||||
{
|
||||
'type': 'http',
|
||||
'scheme': 'bearer',
|
||||
'name': 'bearer_auth',
|
||||
},
|
||||
],
|
||||
...?extra,
|
||||
},
|
||||
validateStatus: validateStatus,
|
||||
);
|
||||
|
||||
final _queryParameters = <String, dynamic>{
|
||||
if (includeInactive != null) r'includeInactive': encodeQueryParameter(_serializers, includeInactive, const FullType(bool)),
|
||||
};
|
||||
|
||||
final _response = await _dio.request<Object>(
|
||||
_path,
|
||||
options: _options,
|
||||
queryParameters: _queryParameters,
|
||||
cancelToken: cancelToken,
|
||||
onSendProgress: onSendProgress,
|
||||
onReceiveProgress: onReceiveProgress,
|
||||
);
|
||||
|
||||
CarsList? _responseData;
|
||||
|
||||
try {
|
||||
final rawResponse = _response.data;
|
||||
_responseData = rawResponse == null ? null : _serializers.deserialize(
|
||||
rawResponse,
|
||||
specifiedType: const FullType(CarsList),
|
||||
) as CarsList;
|
||||
|
||||
} catch (error, stackTrace) {
|
||||
throw DioException(
|
||||
requestOptions: _response.requestOptions,
|
||||
response: _response,
|
||||
type: DioExceptionType.unknown,
|
||||
error: error,
|
||||
stackTrace: stackTrace,
|
||||
);
|
||||
}
|
||||
|
||||
return Response<CarsList>(
|
||||
data: _responseData,
|
||||
headers: _response.headers,
|
||||
isRedirect: _response.isRedirect,
|
||||
requestOptions: _response.requestOptions,
|
||||
redirects: _response.redirects,
|
||||
statusCode: _response.statusCode,
|
||||
statusMessage: _response.statusMessage,
|
||||
extra: _response.extra,
|
||||
);
|
||||
}
|
||||
|
||||
/// Aktualisiert ein Fahrzeug (Kennzeichen ändern / deaktivieren).
|
||||
///
|
||||
///
|
||||
/// Parameters:
|
||||
/// * [carId]
|
||||
/// * [updateCarRequest]
|
||||
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
|
||||
/// * [headers] - Can be used to add additional headers to the request
|
||||
/// * [extras] - Can be used to add flags to the request
|
||||
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
|
||||
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
|
||||
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
|
||||
///
|
||||
/// Returns a [Future] containing a [Response] with a [CarResponse] as data
|
||||
/// Throws [DioException] if API call or serialization fails
|
||||
Future<Response<CarResponse>> updateMyCar({
|
||||
required String carId,
|
||||
required UpdateCarRequest updateCarRequest,
|
||||
CancelToken? cancelToken,
|
||||
Map<String, dynamic>? headers,
|
||||
Map<String, dynamic>? extra,
|
||||
ValidateStatus? validateStatus,
|
||||
ProgressCallback? onSendProgress,
|
||||
ProgressCallback? onReceiveProgress,
|
||||
}) async {
|
||||
final _path = r'/me/cars/{car_id}'.replaceAll('{' r'car_id' '}', encodeQueryParameter(_serializers, carId, const FullType(String)).toString());
|
||||
final _options = Options(
|
||||
method: r'PATCH',
|
||||
headers: <String, dynamic>{
|
||||
...?headers,
|
||||
},
|
||||
extra: <String, dynamic>{
|
||||
'secure': <Map<String, String>>[
|
||||
{
|
||||
'type': 'http',
|
||||
'scheme': 'bearer',
|
||||
'name': 'bearer_auth',
|
||||
},
|
||||
],
|
||||
...?extra,
|
||||
},
|
||||
contentType: 'application/json',
|
||||
validateStatus: validateStatus,
|
||||
);
|
||||
|
||||
dynamic _bodyData;
|
||||
|
||||
try {
|
||||
const _type = FullType(UpdateCarRequest);
|
||||
_bodyData = _serializers.serialize(updateCarRequest, specifiedType: _type);
|
||||
|
||||
} catch(error, stackTrace) {
|
||||
throw DioException(
|
||||
requestOptions: _options.compose(
|
||||
_dio.options,
|
||||
_path,
|
||||
),
|
||||
type: DioExceptionType.unknown,
|
||||
error: error,
|
||||
stackTrace: stackTrace,
|
||||
);
|
||||
}
|
||||
|
||||
final _response = await _dio.request<Object>(
|
||||
_path,
|
||||
data: _bodyData,
|
||||
options: _options,
|
||||
cancelToken: cancelToken,
|
||||
onSendProgress: onSendProgress,
|
||||
onReceiveProgress: onReceiveProgress,
|
||||
);
|
||||
|
||||
CarResponse? _responseData;
|
||||
|
||||
try {
|
||||
final rawResponse = _response.data;
|
||||
_responseData = rawResponse == null ? null : _serializers.deserialize(
|
||||
rawResponse,
|
||||
specifiedType: const FullType(CarResponse),
|
||||
) as CarResponse;
|
||||
|
||||
} catch (error, stackTrace) {
|
||||
throw DioException(
|
||||
requestOptions: _response.requestOptions,
|
||||
response: _response,
|
||||
type: DioExceptionType.unknown,
|
||||
error: error,
|
||||
stackTrace: stackTrace,
|
||||
);
|
||||
}
|
||||
|
||||
return Response<CarResponse>(
|
||||
data: _responseData,
|
||||
headers: _response.headers,
|
||||
isRedirect: _response.isRedirect,
|
||||
requestOptions: _response.requestOptions,
|
||||
redirects: _response.redirects,
|
||||
statusCode: _response.statusCode,
|
||||
statusMessage: _response.statusMessage,
|
||||
extra: _response.extra,
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
601
packages/holzleitner_api/lib/src/api/deliveries_api.dart
Normal file
601
packages/holzleitner_api/lib/src/api/deliveries_api.dart
Normal file
@ -0,0 +1,601 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:built_value/json_object.dart';
|
||||
import 'package:built_value/serializer.dart';
|
||||
import 'package:dio/dio.dart';
|
||||
|
||||
import 'package:holzleitner_api/src/api_util.dart';
|
||||
import 'package:holzleitner_api/src/model/assign_car_request.dart';
|
||||
import 'package:holzleitner_api/src/model/cancel_delivery_request.dart';
|
||||
import 'package:holzleitner_api/src/model/create_delivery_note_request.dart';
|
||||
import 'package:holzleitner_api/src/model/delivery_note_response.dart';
|
||||
import 'package:holzleitner_api/src/model/delivery_response.dart';
|
||||
import 'package:holzleitner_api/src/model/hold_delivery_request.dart';
|
||||
|
||||
class DeliveriesApi {
|
||||
|
||||
final Dio _dio;
|
||||
|
||||
final Serializers _serializers;
|
||||
|
||||
const DeliveriesApi(this._dio, this._serializers);
|
||||
|
||||
/// Setzt das `assigned_car_id` einer Lieferung. `carId: null` löst die Zuordnung wieder. Der Use Case stellt sicher, dass das Fahrzeug zum angemeldeten Account gehört.
|
||||
///
|
||||
///
|
||||
/// Parameters:
|
||||
/// * [deliveryId]
|
||||
/// * [assignCarRequest]
|
||||
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
|
||||
/// * [headers] - Can be used to add additional headers to the request
|
||||
/// * [extras] - Can be used to add flags to the request
|
||||
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
|
||||
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
|
||||
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
|
||||
///
|
||||
/// Returns a [Future] containing a [Response] with a [DeliveryResponse] as data
|
||||
/// Throws [DioException] if API call or serialization fails
|
||||
Future<Response<DeliveryResponse>> assignCar({
|
||||
required String deliveryId,
|
||||
required AssignCarRequest assignCarRequest,
|
||||
CancelToken? cancelToken,
|
||||
Map<String, dynamic>? headers,
|
||||
Map<String, dynamic>? extra,
|
||||
ValidateStatus? validateStatus,
|
||||
ProgressCallback? onSendProgress,
|
||||
ProgressCallback? onReceiveProgress,
|
||||
}) async {
|
||||
final _path = r'/deliveries/{delivery_id}/assigned-car'.replaceAll('{' r'delivery_id' '}', encodeQueryParameter(_serializers, deliveryId, const FullType(String)).toString());
|
||||
final _options = Options(
|
||||
method: r'PUT',
|
||||
headers: <String, dynamic>{
|
||||
...?headers,
|
||||
},
|
||||
extra: <String, dynamic>{
|
||||
'secure': <Map<String, String>>[
|
||||
{
|
||||
'type': 'http',
|
||||
'scheme': 'bearer',
|
||||
'name': 'bearer_auth',
|
||||
},
|
||||
],
|
||||
...?extra,
|
||||
},
|
||||
contentType: 'application/json',
|
||||
validateStatus: validateStatus,
|
||||
);
|
||||
|
||||
dynamic _bodyData;
|
||||
|
||||
try {
|
||||
const _type = FullType(AssignCarRequest);
|
||||
_bodyData = _serializers.serialize(assignCarRequest, specifiedType: _type);
|
||||
|
||||
} catch(error, stackTrace) {
|
||||
throw DioException(
|
||||
requestOptions: _options.compose(
|
||||
_dio.options,
|
||||
_path,
|
||||
),
|
||||
type: DioExceptionType.unknown,
|
||||
error: error,
|
||||
stackTrace: stackTrace,
|
||||
);
|
||||
}
|
||||
|
||||
final _response = await _dio.request<Object>(
|
||||
_path,
|
||||
data: _bodyData,
|
||||
options: _options,
|
||||
cancelToken: cancelToken,
|
||||
onSendProgress: onSendProgress,
|
||||
onReceiveProgress: onReceiveProgress,
|
||||
);
|
||||
|
||||
DeliveryResponse? _responseData;
|
||||
|
||||
try {
|
||||
final rawResponse = _response.data;
|
||||
_responseData = rawResponse == null ? null : _serializers.deserialize(
|
||||
rawResponse,
|
||||
specifiedType: const FullType(DeliveryResponse),
|
||||
) as DeliveryResponse;
|
||||
|
||||
} catch (error, stackTrace) {
|
||||
throw DioException(
|
||||
requestOptions: _response.requestOptions,
|
||||
response: _response,
|
||||
type: DioExceptionType.unknown,
|
||||
error: error,
|
||||
stackTrace: stackTrace,
|
||||
);
|
||||
}
|
||||
|
||||
return Response<DeliveryResponse>(
|
||||
data: _responseData,
|
||||
headers: _response.headers,
|
||||
isRedirect: _response.isRedirect,
|
||||
requestOptions: _response.requestOptions,
|
||||
redirects: _response.redirects,
|
||||
statusCode: _response.statusCode,
|
||||
statusMessage: _response.statusMessage,
|
||||
extra: _response.extra,
|
||||
);
|
||||
}
|
||||
|
||||
/// Setzt die Lieferung auf `canceled` — endgültig. Erlaubt aus `active` und `held`.
|
||||
///
|
||||
///
|
||||
/// Parameters:
|
||||
/// * [deliveryId]
|
||||
/// * [cancelDeliveryRequest]
|
||||
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
|
||||
/// * [headers] - Can be used to add additional headers to the request
|
||||
/// * [extras] - Can be used to add flags to the request
|
||||
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
|
||||
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
|
||||
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
|
||||
///
|
||||
/// Returns a [Future] containing a [Response] with a [DeliveryResponse] as data
|
||||
/// Throws [DioException] if API call or serialization fails
|
||||
Future<Response<DeliveryResponse>> cancel({
|
||||
required String deliveryId,
|
||||
required CancelDeliveryRequest cancelDeliveryRequest,
|
||||
CancelToken? cancelToken,
|
||||
Map<String, dynamic>? headers,
|
||||
Map<String, dynamic>? extra,
|
||||
ValidateStatus? validateStatus,
|
||||
ProgressCallback? onSendProgress,
|
||||
ProgressCallback? onReceiveProgress,
|
||||
}) async {
|
||||
final _path = r'/deliveries/{delivery_id}/cancel'.replaceAll('{' r'delivery_id' '}', encodeQueryParameter(_serializers, deliveryId, const FullType(String)).toString());
|
||||
final _options = Options(
|
||||
method: r'POST',
|
||||
headers: <String, dynamic>{
|
||||
...?headers,
|
||||
},
|
||||
extra: <String, dynamic>{
|
||||
'secure': <Map<String, String>>[
|
||||
{
|
||||
'type': 'http',
|
||||
'scheme': 'bearer',
|
||||
'name': 'bearer_auth',
|
||||
},
|
||||
],
|
||||
...?extra,
|
||||
},
|
||||
contentType: 'application/json',
|
||||
validateStatus: validateStatus,
|
||||
);
|
||||
|
||||
dynamic _bodyData;
|
||||
|
||||
try {
|
||||
const _type = FullType(CancelDeliveryRequest);
|
||||
_bodyData = _serializers.serialize(cancelDeliveryRequest, specifiedType: _type);
|
||||
|
||||
} catch(error, stackTrace) {
|
||||
throw DioException(
|
||||
requestOptions: _options.compose(
|
||||
_dio.options,
|
||||
_path,
|
||||
),
|
||||
type: DioExceptionType.unknown,
|
||||
error: error,
|
||||
stackTrace: stackTrace,
|
||||
);
|
||||
}
|
||||
|
||||
final _response = await _dio.request<Object>(
|
||||
_path,
|
||||
data: _bodyData,
|
||||
options: _options,
|
||||
cancelToken: cancelToken,
|
||||
onSendProgress: onSendProgress,
|
||||
onReceiveProgress: onReceiveProgress,
|
||||
);
|
||||
|
||||
DeliveryResponse? _responseData;
|
||||
|
||||
try {
|
||||
final rawResponse = _response.data;
|
||||
_responseData = rawResponse == null ? null : _serializers.deserialize(
|
||||
rawResponse,
|
||||
specifiedType: const FullType(DeliveryResponse),
|
||||
) as DeliveryResponse;
|
||||
|
||||
} catch (error, stackTrace) {
|
||||
throw DioException(
|
||||
requestOptions: _response.requestOptions,
|
||||
response: _response,
|
||||
type: DioExceptionType.unknown,
|
||||
error: error,
|
||||
stackTrace: stackTrace,
|
||||
);
|
||||
}
|
||||
|
||||
return Response<DeliveryResponse>(
|
||||
data: _responseData,
|
||||
headers: _response.headers,
|
||||
isRedirect: _response.isRedirect,
|
||||
requestOptions: _response.requestOptions,
|
||||
redirects: _response.redirects,
|
||||
statusCode: _response.statusCode,
|
||||
statusMessage: _response.statusMessage,
|
||||
extra: _response.extra,
|
||||
);
|
||||
}
|
||||
|
||||
/// Schließt die Lieferung ab — `state = completed`. Nur aus `active`.
|
||||
///
|
||||
///
|
||||
/// Parameters:
|
||||
/// * [deliveryId]
|
||||
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
|
||||
/// * [headers] - Can be used to add additional headers to the request
|
||||
/// * [extras] - Can be used to add flags to the request
|
||||
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
|
||||
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
|
||||
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
|
||||
///
|
||||
/// Returns a [Future] containing a [Response] with a [DeliveryResponse] as data
|
||||
/// Throws [DioException] if API call or serialization fails
|
||||
Future<Response<DeliveryResponse>> complete({
|
||||
required String deliveryId,
|
||||
CancelToken? cancelToken,
|
||||
Map<String, dynamic>? headers,
|
||||
Map<String, dynamic>? extra,
|
||||
ValidateStatus? validateStatus,
|
||||
ProgressCallback? onSendProgress,
|
||||
ProgressCallback? onReceiveProgress,
|
||||
}) async {
|
||||
final _path = r'/deliveries/{delivery_id}/complete'.replaceAll('{' r'delivery_id' '}', encodeQueryParameter(_serializers, deliveryId, const FullType(String)).toString());
|
||||
final _options = Options(
|
||||
method: r'POST',
|
||||
headers: <String, dynamic>{
|
||||
...?headers,
|
||||
},
|
||||
extra: <String, dynamic>{
|
||||
'secure': <Map<String, String>>[
|
||||
{
|
||||
'type': 'http',
|
||||
'scheme': 'bearer',
|
||||
'name': 'bearer_auth',
|
||||
},
|
||||
],
|
||||
...?extra,
|
||||
},
|
||||
validateStatus: validateStatus,
|
||||
);
|
||||
|
||||
final _response = await _dio.request<Object>(
|
||||
_path,
|
||||
options: _options,
|
||||
cancelToken: cancelToken,
|
||||
onSendProgress: onSendProgress,
|
||||
onReceiveProgress: onReceiveProgress,
|
||||
);
|
||||
|
||||
DeliveryResponse? _responseData;
|
||||
|
||||
try {
|
||||
final rawResponse = _response.data;
|
||||
_responseData = rawResponse == null ? null : _serializers.deserialize(
|
||||
rawResponse,
|
||||
specifiedType: const FullType(DeliveryResponse),
|
||||
) as DeliveryResponse;
|
||||
|
||||
} catch (error, stackTrace) {
|
||||
throw DioException(
|
||||
requestOptions: _response.requestOptions,
|
||||
response: _response,
|
||||
type: DioExceptionType.unknown,
|
||||
error: error,
|
||||
stackTrace: stackTrace,
|
||||
);
|
||||
}
|
||||
|
||||
return Response<DeliveryResponse>(
|
||||
data: _responseData,
|
||||
headers: _response.headers,
|
||||
isRedirect: _response.isRedirect,
|
||||
requestOptions: _response.requestOptions,
|
||||
redirects: _response.redirects,
|
||||
statusCode: _response.statusCode,
|
||||
statusMessage: _response.statusMessage,
|
||||
extra: _response.extra,
|
||||
);
|
||||
}
|
||||
|
||||
/// Legt eine neue Notiz an einer Lieferung an. Mindestens eines von `text` und `imageAttachment` muss inhaltlich gefüllt sein (Leerstrings werden serverseitig getrimmt und als leer behandelt).
|
||||
///
|
||||
///
|
||||
/// Parameters:
|
||||
/// * [deliveryId]
|
||||
/// * [createDeliveryNoteRequest]
|
||||
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
|
||||
/// * [headers] - Can be used to add additional headers to the request
|
||||
/// * [extras] - Can be used to add flags to the request
|
||||
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
|
||||
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
|
||||
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
|
||||
///
|
||||
/// Returns a [Future] containing a [Response] with a [DeliveryNoteResponse] as data
|
||||
/// Throws [DioException] if API call or serialization fails
|
||||
Future<Response<DeliveryNoteResponse>> createNote({
|
||||
required String deliveryId,
|
||||
required CreateDeliveryNoteRequest createDeliveryNoteRequest,
|
||||
CancelToken? cancelToken,
|
||||
Map<String, dynamic>? headers,
|
||||
Map<String, dynamic>? extra,
|
||||
ValidateStatus? validateStatus,
|
||||
ProgressCallback? onSendProgress,
|
||||
ProgressCallback? onReceiveProgress,
|
||||
}) async {
|
||||
final _path = r'/deliveries/{delivery_id}/notes'.replaceAll('{' r'delivery_id' '}', encodeQueryParameter(_serializers, deliveryId, const FullType(String)).toString());
|
||||
final _options = Options(
|
||||
method: r'POST',
|
||||
headers: <String, dynamic>{
|
||||
...?headers,
|
||||
},
|
||||
extra: <String, dynamic>{
|
||||
'secure': <Map<String, String>>[
|
||||
{
|
||||
'type': 'http',
|
||||
'scheme': 'bearer',
|
||||
'name': 'bearer_auth',
|
||||
},
|
||||
],
|
||||
...?extra,
|
||||
},
|
||||
contentType: 'application/json',
|
||||
validateStatus: validateStatus,
|
||||
);
|
||||
|
||||
dynamic _bodyData;
|
||||
|
||||
try {
|
||||
const _type = FullType(CreateDeliveryNoteRequest);
|
||||
_bodyData = _serializers.serialize(createDeliveryNoteRequest, specifiedType: _type);
|
||||
|
||||
} catch(error, stackTrace) {
|
||||
throw DioException(
|
||||
requestOptions: _options.compose(
|
||||
_dio.options,
|
||||
_path,
|
||||
),
|
||||
type: DioExceptionType.unknown,
|
||||
error: error,
|
||||
stackTrace: stackTrace,
|
||||
);
|
||||
}
|
||||
|
||||
final _response = await _dio.request<Object>(
|
||||
_path,
|
||||
data: _bodyData,
|
||||
options: _options,
|
||||
cancelToken: cancelToken,
|
||||
onSendProgress: onSendProgress,
|
||||
onReceiveProgress: onReceiveProgress,
|
||||
);
|
||||
|
||||
DeliveryNoteResponse? _responseData;
|
||||
|
||||
try {
|
||||
final rawResponse = _response.data;
|
||||
_responseData = rawResponse == null ? null : _serializers.deserialize(
|
||||
rawResponse,
|
||||
specifiedType: const FullType(DeliveryNoteResponse),
|
||||
) as DeliveryNoteResponse;
|
||||
|
||||
} catch (error, stackTrace) {
|
||||
throw DioException(
|
||||
requestOptions: _response.requestOptions,
|
||||
response: _response,
|
||||
type: DioExceptionType.unknown,
|
||||
error: error,
|
||||
stackTrace: stackTrace,
|
||||
);
|
||||
}
|
||||
|
||||
return Response<DeliveryNoteResponse>(
|
||||
data: _responseData,
|
||||
headers: _response.headers,
|
||||
isRedirect: _response.isRedirect,
|
||||
requestOptions: _response.requestOptions,
|
||||
redirects: _response.redirects,
|
||||
statusCode: _response.statusCode,
|
||||
statusMessage: _response.statusMessage,
|
||||
extra: _response.extra,
|
||||
);
|
||||
}
|
||||
|
||||
/// Setzt die Lieferung auf `held`. Nur aus `active` zulässig.
|
||||
///
|
||||
///
|
||||
/// Parameters:
|
||||
/// * [deliveryId]
|
||||
/// * [holdDeliveryRequest]
|
||||
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
|
||||
/// * [headers] - Can be used to add additional headers to the request
|
||||
/// * [extras] - Can be used to add flags to the request
|
||||
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
|
||||
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
|
||||
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
|
||||
///
|
||||
/// Returns a [Future] containing a [Response] with a [DeliveryResponse] as data
|
||||
/// Throws [DioException] if API call or serialization fails
|
||||
Future<Response<DeliveryResponse>> hold({
|
||||
required String deliveryId,
|
||||
required HoldDeliveryRequest holdDeliveryRequest,
|
||||
CancelToken? cancelToken,
|
||||
Map<String, dynamic>? headers,
|
||||
Map<String, dynamic>? extra,
|
||||
ValidateStatus? validateStatus,
|
||||
ProgressCallback? onSendProgress,
|
||||
ProgressCallback? onReceiveProgress,
|
||||
}) async {
|
||||
final _path = r'/deliveries/{delivery_id}/hold'.replaceAll('{' r'delivery_id' '}', encodeQueryParameter(_serializers, deliveryId, const FullType(String)).toString());
|
||||
final _options = Options(
|
||||
method: r'POST',
|
||||
headers: <String, dynamic>{
|
||||
...?headers,
|
||||
},
|
||||
extra: <String, dynamic>{
|
||||
'secure': <Map<String, String>>[
|
||||
{
|
||||
'type': 'http',
|
||||
'scheme': 'bearer',
|
||||
'name': 'bearer_auth',
|
||||
},
|
||||
],
|
||||
...?extra,
|
||||
},
|
||||
contentType: 'application/json',
|
||||
validateStatus: validateStatus,
|
||||
);
|
||||
|
||||
dynamic _bodyData;
|
||||
|
||||
try {
|
||||
const _type = FullType(HoldDeliveryRequest);
|
||||
_bodyData = _serializers.serialize(holdDeliveryRequest, specifiedType: _type);
|
||||
|
||||
} catch(error, stackTrace) {
|
||||
throw DioException(
|
||||
requestOptions: _options.compose(
|
||||
_dio.options,
|
||||
_path,
|
||||
),
|
||||
type: DioExceptionType.unknown,
|
||||
error: error,
|
||||
stackTrace: stackTrace,
|
||||
);
|
||||
}
|
||||
|
||||
final _response = await _dio.request<Object>(
|
||||
_path,
|
||||
data: _bodyData,
|
||||
options: _options,
|
||||
cancelToken: cancelToken,
|
||||
onSendProgress: onSendProgress,
|
||||
onReceiveProgress: onReceiveProgress,
|
||||
);
|
||||
|
||||
DeliveryResponse? _responseData;
|
||||
|
||||
try {
|
||||
final rawResponse = _response.data;
|
||||
_responseData = rawResponse == null ? null : _serializers.deserialize(
|
||||
rawResponse,
|
||||
specifiedType: const FullType(DeliveryResponse),
|
||||
) as DeliveryResponse;
|
||||
|
||||
} catch (error, stackTrace) {
|
||||
throw DioException(
|
||||
requestOptions: _response.requestOptions,
|
||||
response: _response,
|
||||
type: DioExceptionType.unknown,
|
||||
error: error,
|
||||
stackTrace: stackTrace,
|
||||
);
|
||||
}
|
||||
|
||||
return Response<DeliveryResponse>(
|
||||
data: _responseData,
|
||||
headers: _response.headers,
|
||||
isRedirect: _response.isRedirect,
|
||||
requestOptions: _response.requestOptions,
|
||||
redirects: _response.redirects,
|
||||
statusCode: _response.statusCode,
|
||||
statusMessage: _response.statusMessage,
|
||||
extra: _response.extra,
|
||||
);
|
||||
}
|
||||
|
||||
/// Setzt die Lieferung zurück auf `active`. Nur aus `held` zulässig.
|
||||
///
|
||||
///
|
||||
/// Parameters:
|
||||
/// * [deliveryId]
|
||||
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
|
||||
/// * [headers] - Can be used to add additional headers to the request
|
||||
/// * [extras] - Can be used to add flags to the request
|
||||
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
|
||||
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
|
||||
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
|
||||
///
|
||||
/// Returns a [Future] containing a [Response] with a [DeliveryResponse] as data
|
||||
/// Throws [DioException] if API call or serialization fails
|
||||
Future<Response<DeliveryResponse>> resume({
|
||||
required String deliveryId,
|
||||
CancelToken? cancelToken,
|
||||
Map<String, dynamic>? headers,
|
||||
Map<String, dynamic>? extra,
|
||||
ValidateStatus? validateStatus,
|
||||
ProgressCallback? onSendProgress,
|
||||
ProgressCallback? onReceiveProgress,
|
||||
}) async {
|
||||
final _path = r'/deliveries/{delivery_id}/resume'.replaceAll('{' r'delivery_id' '}', encodeQueryParameter(_serializers, deliveryId, const FullType(String)).toString());
|
||||
final _options = Options(
|
||||
method: r'POST',
|
||||
headers: <String, dynamic>{
|
||||
...?headers,
|
||||
},
|
||||
extra: <String, dynamic>{
|
||||
'secure': <Map<String, String>>[
|
||||
{
|
||||
'type': 'http',
|
||||
'scheme': 'bearer',
|
||||
'name': 'bearer_auth',
|
||||
},
|
||||
],
|
||||
...?extra,
|
||||
},
|
||||
validateStatus: validateStatus,
|
||||
);
|
||||
|
||||
final _response = await _dio.request<Object>(
|
||||
_path,
|
||||
options: _options,
|
||||
cancelToken: cancelToken,
|
||||
onSendProgress: onSendProgress,
|
||||
onReceiveProgress: onReceiveProgress,
|
||||
);
|
||||
|
||||
DeliveryResponse? _responseData;
|
||||
|
||||
try {
|
||||
final rawResponse = _response.data;
|
||||
_responseData = rawResponse == null ? null : _serializers.deserialize(
|
||||
rawResponse,
|
||||
specifiedType: const FullType(DeliveryResponse),
|
||||
) as DeliveryResponse;
|
||||
|
||||
} catch (error, stackTrace) {
|
||||
throw DioException(
|
||||
requestOptions: _response.requestOptions,
|
||||
response: _response,
|
||||
type: DioExceptionType.unknown,
|
||||
error: error,
|
||||
stackTrace: stackTrace,
|
||||
);
|
||||
}
|
||||
|
||||
return Response<DeliveryResponse>(
|
||||
data: _responseData,
|
||||
headers: _response.headers,
|
||||
isRedirect: _response.isRedirect,
|
||||
requestOptions: _response.requestOptions,
|
||||
redirects: _response.redirects,
|
||||
statusCode: _response.statusCode,
|
||||
statusMessage: _response.statusMessage,
|
||||
extra: _response.extra,
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
90
packages/holzleitner_api/lib/src/api/health_api.dart
Normal file
90
packages/holzleitner_api/lib/src/api/health_api.dart
Normal file
@ -0,0 +1,90 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:built_value/json_object.dart';
|
||||
import 'package:built_value/serializer.dart';
|
||||
import 'package:dio/dio.dart';
|
||||
|
||||
|
||||
class HealthApi {
|
||||
|
||||
final Dio _dio;
|
||||
|
||||
final Serializers _serializers;
|
||||
|
||||
const HealthApi(this._dio, this._serializers);
|
||||
|
||||
/// Health-Endpoint für Load-Balancer und Container-Probes. Bewusst kein Auth — eine `200 ok`-Antwort darf nicht von der Auth abhängen.
|
||||
///
|
||||
///
|
||||
/// Parameters:
|
||||
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
|
||||
/// * [headers] - Can be used to add additional headers to the request
|
||||
/// * [extras] - Can be used to add flags to the request
|
||||
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
|
||||
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
|
||||
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
|
||||
///
|
||||
/// Returns a [Future] containing a [Response] with a [String] as data
|
||||
/// Throws [DioException] if API call or serialization fails
|
||||
Future<Response<String>> health({
|
||||
CancelToken? cancelToken,
|
||||
Map<String, dynamic>? headers,
|
||||
Map<String, dynamic>? extra,
|
||||
ValidateStatus? validateStatus,
|
||||
ProgressCallback? onSendProgress,
|
||||
ProgressCallback? onReceiveProgress,
|
||||
}) async {
|
||||
final _path = r'/health';
|
||||
final _options = Options(
|
||||
method: r'GET',
|
||||
headers: <String, dynamic>{
|
||||
...?headers,
|
||||
},
|
||||
extra: <String, dynamic>{
|
||||
'secure': <Map<String, String>>[],
|
||||
...?extra,
|
||||
},
|
||||
validateStatus: validateStatus,
|
||||
);
|
||||
|
||||
final _response = await _dio.request<Object>(
|
||||
_path,
|
||||
options: _options,
|
||||
cancelToken: cancelToken,
|
||||
onSendProgress: onSendProgress,
|
||||
onReceiveProgress: onReceiveProgress,
|
||||
);
|
||||
|
||||
String? _responseData;
|
||||
|
||||
try {
|
||||
final rawResponse = _response.data;
|
||||
_responseData = rawResponse == null ? null : rawResponse as String;
|
||||
|
||||
} catch (error, stackTrace) {
|
||||
throw DioException(
|
||||
requestOptions: _response.requestOptions,
|
||||
response: _response,
|
||||
type: DioExceptionType.unknown,
|
||||
error: error,
|
||||
stackTrace: stackTrace,
|
||||
);
|
||||
}
|
||||
|
||||
return Response<String>(
|
||||
data: _responseData,
|
||||
headers: _response.headers,
|
||||
isRedirect: _response.isRedirect,
|
||||
requestOptions: _response.requestOptions,
|
||||
redirects: _response.redirects,
|
||||
statusCode: _response.statusCode,
|
||||
statusMessage: _response.statusMessage,
|
||||
extra: _response.extra,
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
123
packages/holzleitner_api/lib/src/api/scans_api.dart
Normal file
123
packages/holzleitner_api/lib/src/api/scans_api.dart
Normal file
@ -0,0 +1,123 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:built_value/json_object.dart';
|
||||
import 'package:built_value/serializer.dart';
|
||||
import 'package:dio/dio.dart';
|
||||
|
||||
import 'package:holzleitner_api/src/model/apply_scans_request.dart';
|
||||
import 'package:holzleitner_api/src/model/apply_scans_response.dart';
|
||||
|
||||
class ScansApi {
|
||||
|
||||
final Dio _dio;
|
||||
|
||||
final Serializers _serializers;
|
||||
|
||||
const ScansApi(this._dio, this._serializers);
|
||||
|
||||
/// Wendet eine Liste von Scan-Events idempotent an.
|
||||
/// Pro Event ein eigenes Resultat. Status `applied` schreibt einen frischen Audit-Eintrag, `duplicate` liefert den aktuellen Stand am Server, `rejected` enthält die Begründung. Reihenfolge der `results` entspricht der Reihenfolge der `scans` im Request.
|
||||
///
|
||||
/// Parameters:
|
||||
/// * [applyScansRequest]
|
||||
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
|
||||
/// * [headers] - Can be used to add additional headers to the request
|
||||
/// * [extras] - Can be used to add flags to the request
|
||||
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
|
||||
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
|
||||
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
|
||||
///
|
||||
/// Returns a [Future] containing a [Response] with a [ApplyScansResponse] as data
|
||||
/// Throws [DioException] if API call or serialization fails
|
||||
Future<Response<ApplyScansResponse>> applyScans({
|
||||
required ApplyScansRequest applyScansRequest,
|
||||
CancelToken? cancelToken,
|
||||
Map<String, dynamic>? headers,
|
||||
Map<String, dynamic>? extra,
|
||||
ValidateStatus? validateStatus,
|
||||
ProgressCallback? onSendProgress,
|
||||
ProgressCallback? onReceiveProgress,
|
||||
}) async {
|
||||
final _path = r'/scans';
|
||||
final _options = Options(
|
||||
method: r'POST',
|
||||
headers: <String, dynamic>{
|
||||
...?headers,
|
||||
},
|
||||
extra: <String, dynamic>{
|
||||
'secure': <Map<String, String>>[
|
||||
{
|
||||
'type': 'http',
|
||||
'scheme': 'bearer',
|
||||
'name': 'bearer_auth',
|
||||
},
|
||||
],
|
||||
...?extra,
|
||||
},
|
||||
contentType: 'application/json',
|
||||
validateStatus: validateStatus,
|
||||
);
|
||||
|
||||
dynamic _bodyData;
|
||||
|
||||
try {
|
||||
const _type = FullType(ApplyScansRequest);
|
||||
_bodyData = _serializers.serialize(applyScansRequest, specifiedType: _type);
|
||||
|
||||
} catch(error, stackTrace) {
|
||||
throw DioException(
|
||||
requestOptions: _options.compose(
|
||||
_dio.options,
|
||||
_path,
|
||||
),
|
||||
type: DioExceptionType.unknown,
|
||||
error: error,
|
||||
stackTrace: stackTrace,
|
||||
);
|
||||
}
|
||||
|
||||
final _response = await _dio.request<Object>(
|
||||
_path,
|
||||
data: _bodyData,
|
||||
options: _options,
|
||||
cancelToken: cancelToken,
|
||||
onSendProgress: onSendProgress,
|
||||
onReceiveProgress: onReceiveProgress,
|
||||
);
|
||||
|
||||
ApplyScansResponse? _responseData;
|
||||
|
||||
try {
|
||||
final rawResponse = _response.data;
|
||||
_responseData = rawResponse == null ? null : _serializers.deserialize(
|
||||
rawResponse,
|
||||
specifiedType: const FullType(ApplyScansResponse),
|
||||
) as ApplyScansResponse;
|
||||
|
||||
} catch (error, stackTrace) {
|
||||
throw DioException(
|
||||
requestOptions: _response.requestOptions,
|
||||
response: _response,
|
||||
type: DioExceptionType.unknown,
|
||||
error: error,
|
||||
stackTrace: stackTrace,
|
||||
);
|
||||
}
|
||||
|
||||
return Response<ApplyScansResponse>(
|
||||
data: _responseData,
|
||||
headers: _response.headers,
|
||||
isRedirect: _response.isRedirect,
|
||||
requestOptions: _response.requestOptions,
|
||||
redirects: _response.redirects,
|
||||
statusCode: _response.statusCode,
|
||||
statusMessage: _response.statusMessage,
|
||||
extra: _response.extra,
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
123
packages/holzleitner_api/lib/src/api/sync_api.dart
Normal file
123
packages/holzleitner_api/lib/src/api/sync_api.dart
Normal file
@ -0,0 +1,123 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:built_value/json_object.dart';
|
||||
import 'package:built_value/serializer.dart';
|
||||
import 'package:dio/dio.dart';
|
||||
|
||||
import 'package:holzleitner_api/src/model/sync_tour_request.dart';
|
||||
import 'package:holzleitner_api/src/model/sync_tour_response.dart';
|
||||
|
||||
class SyncApi {
|
||||
|
||||
final Dio _dio;
|
||||
|
||||
final Serializers _serializers;
|
||||
|
||||
const SyncApi(this._dio, this._serializers);
|
||||
|
||||
/// Sync-Endpoint für das ERP: legt eine Tagestour samt Lieferungen und Positionen idempotent an. Identität pro Tour `(driver_personalnummer, tour_date)`, pro Lieferung `(belegart_id, belegnummer)`.
|
||||
///
|
||||
///
|
||||
/// Parameters:
|
||||
/// * [syncTourRequest]
|
||||
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
|
||||
/// * [headers] - Can be used to add additional headers to the request
|
||||
/// * [extras] - Can be used to add flags to the request
|
||||
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
|
||||
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
|
||||
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
|
||||
///
|
||||
/// Returns a [Future] containing a [Response] with a [SyncTourResponse] as data
|
||||
/// Throws [DioException] if API call or serialization fails
|
||||
Future<Response<SyncTourResponse>> syncTour({
|
||||
required SyncTourRequest syncTourRequest,
|
||||
CancelToken? cancelToken,
|
||||
Map<String, dynamic>? headers,
|
||||
Map<String, dynamic>? extra,
|
||||
ValidateStatus? validateStatus,
|
||||
ProgressCallback? onSendProgress,
|
||||
ProgressCallback? onReceiveProgress,
|
||||
}) async {
|
||||
final _path = r'/sync/tour';
|
||||
final _options = Options(
|
||||
method: r'POST',
|
||||
headers: <String, dynamic>{
|
||||
...?headers,
|
||||
},
|
||||
extra: <String, dynamic>{
|
||||
'secure': <Map<String, String>>[
|
||||
{
|
||||
'type': 'http',
|
||||
'scheme': 'bearer',
|
||||
'name': 'bearer_auth',
|
||||
},
|
||||
],
|
||||
...?extra,
|
||||
},
|
||||
contentType: 'application/json',
|
||||
validateStatus: validateStatus,
|
||||
);
|
||||
|
||||
dynamic _bodyData;
|
||||
|
||||
try {
|
||||
const _type = FullType(SyncTourRequest);
|
||||
_bodyData = _serializers.serialize(syncTourRequest, specifiedType: _type);
|
||||
|
||||
} catch(error, stackTrace) {
|
||||
throw DioException(
|
||||
requestOptions: _options.compose(
|
||||
_dio.options,
|
||||
_path,
|
||||
),
|
||||
type: DioExceptionType.unknown,
|
||||
error: error,
|
||||
stackTrace: stackTrace,
|
||||
);
|
||||
}
|
||||
|
||||
final _response = await _dio.request<Object>(
|
||||
_path,
|
||||
data: _bodyData,
|
||||
options: _options,
|
||||
cancelToken: cancelToken,
|
||||
onSendProgress: onSendProgress,
|
||||
onReceiveProgress: onReceiveProgress,
|
||||
);
|
||||
|
||||
SyncTourResponse? _responseData;
|
||||
|
||||
try {
|
||||
final rawResponse = _response.data;
|
||||
_responseData = rawResponse == null ? null : _serializers.deserialize(
|
||||
rawResponse,
|
||||
specifiedType: const FullType(SyncTourResponse),
|
||||
) as SyncTourResponse;
|
||||
|
||||
} catch (error, stackTrace) {
|
||||
throw DioException(
|
||||
requestOptions: _response.requestOptions,
|
||||
response: _response,
|
||||
type: DioExceptionType.unknown,
|
||||
error: error,
|
||||
stackTrace: stackTrace,
|
||||
);
|
||||
}
|
||||
|
||||
return Response<SyncTourResponse>(
|
||||
data: _responseData,
|
||||
headers: _response.headers,
|
||||
isRedirect: _response.isRedirect,
|
||||
requestOptions: _response.requestOptions,
|
||||
redirects: _response.redirects,
|
||||
statusCode: _response.statusCode,
|
||||
statusMessage: _response.statusMessage,
|
||||
extra: _response.extra,
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
288
packages/holzleitner_api/lib/src/api/tours_api.dart
Normal file
288
packages/holzleitner_api/lib/src/api/tours_api.dart
Normal file
@ -0,0 +1,288 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:built_value/json_object.dart';
|
||||
import 'package:built_value/serializer.dart';
|
||||
import 'package:dio/dio.dart';
|
||||
|
||||
import 'package:holzleitner_api/src/api_util.dart';
|
||||
import 'package:holzleitner_api/src/model/set_delivery_order_request.dart';
|
||||
import 'package:holzleitner_api/src/model/set_delivery_order_response.dart';
|
||||
import 'package:holzleitner_api/src/model/tour_details.dart';
|
||||
import 'package:holzleitner_api/src/model/tour_summary_list.dart';
|
||||
|
||||
class ToursApi {
|
||||
|
||||
final Dio _dio;
|
||||
|
||||
final Serializers _serializers;
|
||||
|
||||
const ToursApi(this._dio, this._serializers);
|
||||
|
||||
/// Lädt eine Tour mit allen Lieferungen, Positionen und referenzierten Stammdaten — die App nutzt das als einzigen großen Read.
|
||||
///
|
||||
///
|
||||
/// Parameters:
|
||||
/// * [tourId] - Eindeutige Tour-Id (UUID)
|
||||
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
|
||||
/// * [headers] - Can be used to add additional headers to the request
|
||||
/// * [extras] - Can be used to add flags to the request
|
||||
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
|
||||
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
|
||||
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
|
||||
///
|
||||
/// Returns a [Future] containing a [Response] with a [TourDetails] as data
|
||||
/// Throws [DioException] if API call or serialization fails
|
||||
Future<Response<TourDetails>> getTour({
|
||||
required String tourId,
|
||||
CancelToken? cancelToken,
|
||||
Map<String, dynamic>? headers,
|
||||
Map<String, dynamic>? extra,
|
||||
ValidateStatus? validateStatus,
|
||||
ProgressCallback? onSendProgress,
|
||||
ProgressCallback? onReceiveProgress,
|
||||
}) async {
|
||||
final _path = r'/tours/{tour_id}'.replaceAll('{' r'tour_id' '}', encodeQueryParameter(_serializers, tourId, const FullType(String)).toString());
|
||||
final _options = Options(
|
||||
method: r'GET',
|
||||
headers: <String, dynamic>{
|
||||
...?headers,
|
||||
},
|
||||
extra: <String, dynamic>{
|
||||
'secure': <Map<String, String>>[
|
||||
{
|
||||
'type': 'http',
|
||||
'scheme': 'bearer',
|
||||
'name': 'bearer_auth',
|
||||
},
|
||||
],
|
||||
...?extra,
|
||||
},
|
||||
validateStatus: validateStatus,
|
||||
);
|
||||
|
||||
final _response = await _dio.request<Object>(
|
||||
_path,
|
||||
options: _options,
|
||||
cancelToken: cancelToken,
|
||||
onSendProgress: onSendProgress,
|
||||
onReceiveProgress: onReceiveProgress,
|
||||
);
|
||||
|
||||
TourDetails? _responseData;
|
||||
|
||||
try {
|
||||
final rawResponse = _response.data;
|
||||
_responseData = rawResponse == null ? null : _serializers.deserialize(
|
||||
rawResponse,
|
||||
specifiedType: const FullType(TourDetails),
|
||||
) as TourDetails;
|
||||
|
||||
} catch (error, stackTrace) {
|
||||
throw DioException(
|
||||
requestOptions: _response.requestOptions,
|
||||
response: _response,
|
||||
type: DioExceptionType.unknown,
|
||||
error: error,
|
||||
stackTrace: stackTrace,
|
||||
);
|
||||
}
|
||||
|
||||
return Response<TourDetails>(
|
||||
data: _responseData,
|
||||
headers: _response.headers,
|
||||
isRedirect: _response.isRedirect,
|
||||
requestOptions: _response.requestOptions,
|
||||
redirects: _response.redirects,
|
||||
statusCode: _response.statusCode,
|
||||
statusMessage: _response.statusMessage,
|
||||
extra: _response.extra,
|
||||
);
|
||||
}
|
||||
|
||||
/// Listet heutige Touren des angemeldeten Fahrers (Filter aus dem JWT).
|
||||
///
|
||||
///
|
||||
/// Parameters:
|
||||
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
|
||||
/// * [headers] - Can be used to add additional headers to the request
|
||||
/// * [extras] - Can be used to add flags to the request
|
||||
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
|
||||
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
|
||||
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
|
||||
///
|
||||
/// Returns a [Future] containing a [Response] with a [TourSummaryList] as data
|
||||
/// Throws [DioException] if API call or serialization fails
|
||||
Future<Response<TourSummaryList>> listMyToursToday({
|
||||
CancelToken? cancelToken,
|
||||
Map<String, dynamic>? headers,
|
||||
Map<String, dynamic>? extra,
|
||||
ValidateStatus? validateStatus,
|
||||
ProgressCallback? onSendProgress,
|
||||
ProgressCallback? onReceiveProgress,
|
||||
}) async {
|
||||
final _path = r'/me/tours/today';
|
||||
final _options = Options(
|
||||
method: r'GET',
|
||||
headers: <String, dynamic>{
|
||||
...?headers,
|
||||
},
|
||||
extra: <String, dynamic>{
|
||||
'secure': <Map<String, String>>[
|
||||
{
|
||||
'type': 'http',
|
||||
'scheme': 'bearer',
|
||||
'name': 'bearer_auth',
|
||||
},
|
||||
],
|
||||
...?extra,
|
||||
},
|
||||
validateStatus: validateStatus,
|
||||
);
|
||||
|
||||
final _response = await _dio.request<Object>(
|
||||
_path,
|
||||
options: _options,
|
||||
cancelToken: cancelToken,
|
||||
onSendProgress: onSendProgress,
|
||||
onReceiveProgress: onReceiveProgress,
|
||||
);
|
||||
|
||||
TourSummaryList? _responseData;
|
||||
|
||||
try {
|
||||
final rawResponse = _response.data;
|
||||
_responseData = rawResponse == null ? null : _serializers.deserialize(
|
||||
rawResponse,
|
||||
specifiedType: const FullType(TourSummaryList),
|
||||
) as TourSummaryList;
|
||||
|
||||
} catch (error, stackTrace) {
|
||||
throw DioException(
|
||||
requestOptions: _response.requestOptions,
|
||||
response: _response,
|
||||
type: DioExceptionType.unknown,
|
||||
error: error,
|
||||
stackTrace: stackTrace,
|
||||
);
|
||||
}
|
||||
|
||||
return Response<TourSummaryList>(
|
||||
data: _responseData,
|
||||
headers: _response.headers,
|
||||
isRedirect: _response.isRedirect,
|
||||
requestOptions: _response.requestOptions,
|
||||
redirects: _response.redirects,
|
||||
statusCode: _response.statusCode,
|
||||
statusMessage: _response.statusMessage,
|
||||
extra: _response.extra,
|
||||
);
|
||||
}
|
||||
|
||||
/// Schreibt die Sortier-Reihenfolge aller Lieferungen einer Tour neu. Der Client schickt die **vollständige** neue Reihenfolge; fehlende oder fremde Lieferungs-Ids werden mit `400 validation` abgelehnt.
|
||||
///
|
||||
///
|
||||
/// Parameters:
|
||||
/// * [tourId]
|
||||
/// * [setDeliveryOrderRequest]
|
||||
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
|
||||
/// * [headers] - Can be used to add additional headers to the request
|
||||
/// * [extras] - Can be used to add flags to the request
|
||||
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
|
||||
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
|
||||
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
|
||||
///
|
||||
/// Returns a [Future] containing a [Response] with a [SetDeliveryOrderResponse] as data
|
||||
/// Throws [DioException] if API call or serialization fails
|
||||
Future<Response<SetDeliveryOrderResponse>> setDeliveryOrder({
|
||||
required String tourId,
|
||||
required SetDeliveryOrderRequest setDeliveryOrderRequest,
|
||||
CancelToken? cancelToken,
|
||||
Map<String, dynamic>? headers,
|
||||
Map<String, dynamic>? extra,
|
||||
ValidateStatus? validateStatus,
|
||||
ProgressCallback? onSendProgress,
|
||||
ProgressCallback? onReceiveProgress,
|
||||
}) async {
|
||||
final _path = r'/tours/{tour_id}/delivery-order'.replaceAll('{' r'tour_id' '}', encodeQueryParameter(_serializers, tourId, const FullType(String)).toString());
|
||||
final _options = Options(
|
||||
method: r'PUT',
|
||||
headers: <String, dynamic>{
|
||||
...?headers,
|
||||
},
|
||||
extra: <String, dynamic>{
|
||||
'secure': <Map<String, String>>[
|
||||
{
|
||||
'type': 'http',
|
||||
'scheme': 'bearer',
|
||||
'name': 'bearer_auth',
|
||||
},
|
||||
],
|
||||
...?extra,
|
||||
},
|
||||
contentType: 'application/json',
|
||||
validateStatus: validateStatus,
|
||||
);
|
||||
|
||||
dynamic _bodyData;
|
||||
|
||||
try {
|
||||
const _type = FullType(SetDeliveryOrderRequest);
|
||||
_bodyData = _serializers.serialize(setDeliveryOrderRequest, specifiedType: _type);
|
||||
|
||||
} catch(error, stackTrace) {
|
||||
throw DioException(
|
||||
requestOptions: _options.compose(
|
||||
_dio.options,
|
||||
_path,
|
||||
),
|
||||
type: DioExceptionType.unknown,
|
||||
error: error,
|
||||
stackTrace: stackTrace,
|
||||
);
|
||||
}
|
||||
|
||||
final _response = await _dio.request<Object>(
|
||||
_path,
|
||||
data: _bodyData,
|
||||
options: _options,
|
||||
cancelToken: cancelToken,
|
||||
onSendProgress: onSendProgress,
|
||||
onReceiveProgress: onReceiveProgress,
|
||||
);
|
||||
|
||||
SetDeliveryOrderResponse? _responseData;
|
||||
|
||||
try {
|
||||
final rawResponse = _response.data;
|
||||
_responseData = rawResponse == null ? null : _serializers.deserialize(
|
||||
rawResponse,
|
||||
specifiedType: const FullType(SetDeliveryOrderResponse),
|
||||
) as SetDeliveryOrderResponse;
|
||||
|
||||
} catch (error, stackTrace) {
|
||||
throw DioException(
|
||||
requestOptions: _response.requestOptions,
|
||||
response: _response,
|
||||
type: DioExceptionType.unknown,
|
||||
error: error,
|
||||
stackTrace: stackTrace,
|
||||
);
|
||||
}
|
||||
|
||||
return Response<SetDeliveryOrderResponse>(
|
||||
data: _responseData,
|
||||
headers: _response.headers,
|
||||
isRedirect: _response.isRedirect,
|
||||
requestOptions: _response.requestOptions,
|
||||
redirects: _response.redirects,
|
||||
statusCode: _response.statusCode,
|
||||
statusMessage: _response.statusMessage,
|
||||
extra: _response.extra,
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
77
packages/holzleitner_api/lib/src/api_util.dart
Normal file
77
packages/holzleitner_api/lib/src/api_util.dart
Normal file
@ -0,0 +1,77 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
|
||||
import 'dart:convert';
|
||||
import 'dart:typed_data';
|
||||
|
||||
import 'package:built_collection/built_collection.dart';
|
||||
import 'package:built_value/serializer.dart';
|
||||
import 'package:dio/dio.dart';
|
||||
|
||||
/// Format the given form parameter object into something that Dio can handle.
|
||||
/// Returns primitive or String.
|
||||
/// Returns List/Map if the value is BuildList/BuiltMap.
|
||||
dynamic encodeFormParameter(Serializers serializers, dynamic value, FullType type) {
|
||||
if (value == null) {
|
||||
return '';
|
||||
}
|
||||
if (value is String || value is num || value is bool) {
|
||||
return value;
|
||||
}
|
||||
final serialized = serializers.serialize(
|
||||
value as Object,
|
||||
specifiedType: type,
|
||||
);
|
||||
if (serialized is String) {
|
||||
return serialized;
|
||||
}
|
||||
if (value is BuiltList || value is BuiltSet || value is BuiltMap) {
|
||||
return serialized;
|
||||
}
|
||||
return json.encode(serialized);
|
||||
}
|
||||
|
||||
dynamic encodeQueryParameter(
|
||||
Serializers serializers,
|
||||
dynamic value,
|
||||
FullType type,
|
||||
) {
|
||||
if (value == null) {
|
||||
return '';
|
||||
}
|
||||
if (value is String || value is num || value is bool) {
|
||||
return value;
|
||||
}
|
||||
if (value is Uint8List) {
|
||||
// Currently not sure how to serialize this
|
||||
return value;
|
||||
}
|
||||
final serialized = serializers.serialize(
|
||||
value as Object,
|
||||
specifiedType: type,
|
||||
);
|
||||
if (serialized == null) {
|
||||
return '';
|
||||
}
|
||||
if (serialized is String) {
|
||||
return serialized;
|
||||
}
|
||||
return serialized;
|
||||
}
|
||||
|
||||
ListParam<Object?> encodeCollectionQueryParameter<T>(
|
||||
Serializers serializers,
|
||||
dynamic value,
|
||||
FullType type, {
|
||||
ListFormat format = ListFormat.multi,
|
||||
}) {
|
||||
final serialized = serializers.serialize(
|
||||
value as Object,
|
||||
specifiedType: type,
|
||||
);
|
||||
if (value is BuiltList<T> || value is BuiltSet<T>) {
|
||||
return ListParam(List.of((serialized as Iterable<Object?>).cast()), format);
|
||||
}
|
||||
throw ArgumentError('Invalid value passed to encodeCollectionQueryParameter');
|
||||
}
|
||||
30
packages/holzleitner_api/lib/src/auth/api_key_auth.dart
Normal file
30
packages/holzleitner_api/lib/src/auth/api_key_auth.dart
Normal file
@ -0,0 +1,30 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
|
||||
|
||||
import 'package:dio/dio.dart';
|
||||
import 'package:holzleitner_api/src/auth/auth.dart';
|
||||
|
||||
class ApiKeyAuthInterceptor extends AuthInterceptor {
|
||||
final Map<String, String> apiKeys = {};
|
||||
|
||||
@override
|
||||
void onRequest(RequestOptions options, RequestInterceptorHandler handler) {
|
||||
final authInfo = getAuthInfo(options, (secure) => secure['type'] == 'apiKey');
|
||||
for (final info in authInfo) {
|
||||
final authName = info['name'] as String;
|
||||
final authKeyName = info['keyName'] as String;
|
||||
final authWhere = info['where'] as String;
|
||||
final apiKey = apiKeys[authName];
|
||||
if (apiKey != null) {
|
||||
if (authWhere == 'query') {
|
||||
options.queryParameters[authKeyName] = apiKey;
|
||||
} else {
|
||||
options.headers[authKeyName] = apiKey;
|
||||
}
|
||||
}
|
||||
}
|
||||
super.onRequest(options, handler);
|
||||
}
|
||||
}
|
||||
18
packages/holzleitner_api/lib/src/auth/auth.dart
Normal file
18
packages/holzleitner_api/lib/src/auth/auth.dart
Normal file
@ -0,0 +1,18 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
|
||||
import 'package:dio/dio.dart';
|
||||
|
||||
abstract class AuthInterceptor extends Interceptor {
|
||||
/// Get auth information on given route for the given type.
|
||||
/// Can return an empty list if type is not present on auth data or
|
||||
/// if route doesn't need authentication.
|
||||
List<Map<String, String>> getAuthInfo(RequestOptions route, bool Function(Map<String, String> secure) handles) {
|
||||
if (route.extra.containsKey('secure')) {
|
||||
final auth = route.extra['secure'] as List<Map<String, String>>;
|
||||
return auth.where((secure) => handles(secure)).toList();
|
||||
}
|
||||
return [];
|
||||
}
|
||||
}
|
||||
37
packages/holzleitner_api/lib/src/auth/basic_auth.dart
Normal file
37
packages/holzleitner_api/lib/src/auth/basic_auth.dart
Normal file
@ -0,0 +1,37 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:dio/dio.dart';
|
||||
import 'package:holzleitner_api/src/auth/auth.dart';
|
||||
|
||||
class BasicAuthInfo {
|
||||
final String username;
|
||||
final String password;
|
||||
|
||||
const BasicAuthInfo(this.username, this.password);
|
||||
}
|
||||
|
||||
class BasicAuthInterceptor extends AuthInterceptor {
|
||||
final Map<String, BasicAuthInfo> authInfo = {};
|
||||
|
||||
@override
|
||||
void onRequest(
|
||||
RequestOptions options,
|
||||
RequestInterceptorHandler handler,
|
||||
) {
|
||||
final metadataAuthInfo = getAuthInfo(options, (secure) => (secure['type'] == 'http' && secure['scheme']?.toLowerCase() == 'basic') || secure['type'] == 'basic');
|
||||
for (final info in metadataAuthInfo) {
|
||||
final authName = info['name'] as String;
|
||||
final basicAuthInfo = authInfo[authName];
|
||||
if (basicAuthInfo != null) {
|
||||
final basicAuth = 'Basic ${base64Encode(utf8.encode('${basicAuthInfo.username}:${basicAuthInfo.password}'))}';
|
||||
options.headers['Authorization'] = basicAuth;
|
||||
break;
|
||||
}
|
||||
}
|
||||
super.onRequest(options, handler);
|
||||
}
|
||||
}
|
||||
26
packages/holzleitner_api/lib/src/auth/bearer_auth.dart
Normal file
26
packages/holzleitner_api/lib/src/auth/bearer_auth.dart
Normal file
@ -0,0 +1,26 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
|
||||
import 'package:dio/dio.dart';
|
||||
import 'package:holzleitner_api/src/auth/auth.dart';
|
||||
|
||||
class BearerAuthInterceptor extends AuthInterceptor {
|
||||
final Map<String, String> tokens = {};
|
||||
|
||||
@override
|
||||
void onRequest(
|
||||
RequestOptions options,
|
||||
RequestInterceptorHandler handler,
|
||||
) {
|
||||
final authInfo = getAuthInfo(options, (secure) => secure['type'] == 'http' && secure['scheme']?.toLowerCase() == 'bearer');
|
||||
for (final info in authInfo) {
|
||||
final token = tokens[info['name']];
|
||||
if (token != null) {
|
||||
options.headers['Authorization'] = 'Bearer ${token}';
|
||||
break;
|
||||
}
|
||||
}
|
||||
super.onRequest(options, handler);
|
||||
}
|
||||
}
|
||||
26
packages/holzleitner_api/lib/src/auth/oauth.dart
Normal file
26
packages/holzleitner_api/lib/src/auth/oauth.dart
Normal file
@ -0,0 +1,26 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
|
||||
import 'package:dio/dio.dart';
|
||||
import 'package:holzleitner_api/src/auth/auth.dart';
|
||||
|
||||
class OAuthInterceptor extends AuthInterceptor {
|
||||
final Map<String, String> tokens = {};
|
||||
|
||||
@override
|
||||
void onRequest(
|
||||
RequestOptions options,
|
||||
RequestInterceptorHandler handler,
|
||||
) {
|
||||
final authInfo = getAuthInfo(options, (secure) => secure['type'] == 'oauth' || secure['type'] == 'oauth2');
|
||||
for (final info in authInfo) {
|
||||
final token = tokens[info['name']];
|
||||
if (token != null) {
|
||||
options.headers['Authorization'] = 'Bearer ${token}';
|
||||
break;
|
||||
}
|
||||
}
|
||||
super.onRequest(options, handler);
|
||||
}
|
||||
}
|
||||
31
packages/holzleitner_api/lib/src/date_serializer.dart
Normal file
31
packages/holzleitner_api/lib/src/date_serializer.dart
Normal file
@ -0,0 +1,31 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
|
||||
import 'package:built_collection/built_collection.dart';
|
||||
import 'package:built_value/serializer.dart';
|
||||
import 'package:holzleitner_api/src/model/date.dart';
|
||||
|
||||
class DateSerializer implements PrimitiveSerializer<Date> {
|
||||
|
||||
const DateSerializer();
|
||||
|
||||
@override
|
||||
Iterable<Type> get types => BuiltList.of([Date]);
|
||||
|
||||
@override
|
||||
String get wireName => 'Date';
|
||||
|
||||
@override
|
||||
Date deserialize(Serializers serializers, Object serialized,
|
||||
{FullType specifiedType = FullType.unspecified}) {
|
||||
final parsed = DateTime.parse(serialized as String);
|
||||
return Date(parsed.year, parsed.month, parsed.day);
|
||||
}
|
||||
|
||||
@override
|
||||
Object serialize(Serializers serializers, Date date,
|
||||
{FullType specifiedType = FullType.unspecified}) {
|
||||
return date.toString();
|
||||
}
|
||||
}
|
||||
138
packages/holzleitner_api/lib/src/model/account.dart
Normal file
138
packages/holzleitner_api/lib/src/model/account.dart
Normal file
@ -0,0 +1,138 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
|
||||
// ignore_for_file: unused_element
|
||||
import 'package:built_value/built_value.dart';
|
||||
import 'package:built_value/serializer.dart';
|
||||
|
||||
part 'account.g.dart';
|
||||
|
||||
/// Account eines Liefer-Unternehmens oder Einzel-Lieferfahrers. Die Personalnummer ist sowohl Primärschlüssel als auch Login-ID. Sie stammt aus dem ERP-Stamm — entweder ein Unternehmen (juristische Person, eigener Personalnummern-Kreis) oder eine natürliche Person. Mehrere physische Fahrer können denselben Account benutzen; das Modell unterscheidet sie nicht, sondern loggt die Aktivität auf [`crate::domain::Car`]- Ebene (siehe Audit-Log).
|
||||
///
|
||||
/// Properties:
|
||||
/// * [active]
|
||||
/// * [name]
|
||||
/// * [personalnummer]
|
||||
@BuiltValue()
|
||||
abstract class Account implements Built<Account, AccountBuilder> {
|
||||
@BuiltValueField(wireName: r'active')
|
||||
bool get active;
|
||||
|
||||
@BuiltValueField(wireName: r'name')
|
||||
String get name;
|
||||
|
||||
@BuiltValueField(wireName: r'personalnummer')
|
||||
int get personalnummer;
|
||||
|
||||
Account._();
|
||||
|
||||
factory Account([void updates(AccountBuilder b)]) = _$Account;
|
||||
|
||||
@BuiltValueHook(initializeBuilder: true)
|
||||
static void _defaults(AccountBuilder b) => b;
|
||||
|
||||
@BuiltValueSerializer(custom: true)
|
||||
static Serializer<Account> get serializer => _$AccountSerializer();
|
||||
}
|
||||
|
||||
class _$AccountSerializer implements PrimitiveSerializer<Account> {
|
||||
@override
|
||||
final Iterable<Type> types = const [Account, _$Account];
|
||||
|
||||
@override
|
||||
final String wireName = r'Account';
|
||||
|
||||
Iterable<Object?> _serializeProperties(
|
||||
Serializers serializers,
|
||||
Account object, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) sync* {
|
||||
yield r'active';
|
||||
yield serializers.serialize(
|
||||
object.active,
|
||||
specifiedType: const FullType(bool),
|
||||
);
|
||||
yield r'name';
|
||||
yield serializers.serialize(
|
||||
object.name,
|
||||
specifiedType: const FullType(String),
|
||||
);
|
||||
yield r'personalnummer';
|
||||
yield serializers.serialize(
|
||||
object.personalnummer,
|
||||
specifiedType: const FullType(int),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Object serialize(
|
||||
Serializers serializers,
|
||||
Account object, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) {
|
||||
return _serializeProperties(serializers, object, specifiedType: specifiedType).toList();
|
||||
}
|
||||
|
||||
void _deserializeProperties(
|
||||
Serializers serializers,
|
||||
Object serialized, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
required List<Object?> serializedList,
|
||||
required AccountBuilder result,
|
||||
required List<Object?> unhandled,
|
||||
}) {
|
||||
for (var i = 0; i < serializedList.length; i += 2) {
|
||||
final key = serializedList[i] as String;
|
||||
final value = serializedList[i + 1];
|
||||
switch (key) {
|
||||
case r'active':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(bool),
|
||||
) as bool;
|
||||
result.active = valueDes;
|
||||
break;
|
||||
case r'name':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(String),
|
||||
) as String;
|
||||
result.name = valueDes;
|
||||
break;
|
||||
case r'personalnummer':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(int),
|
||||
) as int;
|
||||
result.personalnummer = valueDes;
|
||||
break;
|
||||
default:
|
||||
unhandled.add(key);
|
||||
unhandled.add(value);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Account deserialize(
|
||||
Serializers serializers,
|
||||
Object serialized, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) {
|
||||
final result = AccountBuilder();
|
||||
final serializedList = (serialized as Iterable<Object?>).toList();
|
||||
final unhandled = <Object?>[];
|
||||
_deserializeProperties(
|
||||
serializers,
|
||||
serialized,
|
||||
specifiedType: specifiedType,
|
||||
serializedList: serializedList,
|
||||
unhandled: unhandled,
|
||||
result: result,
|
||||
);
|
||||
return result.build();
|
||||
}
|
||||
}
|
||||
|
||||
117
packages/holzleitner_api/lib/src/model/account.g.dart
Normal file
117
packages/holzleitner_api/lib/src/model/account.g.dart
Normal file
@ -0,0 +1,117 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'account.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// BuiltValueGenerator
|
||||
// **************************************************************************
|
||||
|
||||
class _$Account extends Account {
|
||||
@override
|
||||
final bool active;
|
||||
@override
|
||||
final String name;
|
||||
@override
|
||||
final int personalnummer;
|
||||
|
||||
factory _$Account([void Function(AccountBuilder)? updates]) =>
|
||||
(AccountBuilder()..update(updates))._build();
|
||||
|
||||
_$Account._(
|
||||
{required this.active, required this.name, required this.personalnummer})
|
||||
: super._();
|
||||
@override
|
||||
Account rebuild(void Function(AccountBuilder) updates) =>
|
||||
(toBuilder()..update(updates)).build();
|
||||
|
||||
@override
|
||||
AccountBuilder toBuilder() => AccountBuilder()..replace(this);
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
if (identical(other, this)) return true;
|
||||
return other is Account &&
|
||||
active == other.active &&
|
||||
name == other.name &&
|
||||
personalnummer == other.personalnummer;
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode {
|
||||
var _$hash = 0;
|
||||
_$hash = $jc(_$hash, active.hashCode);
|
||||
_$hash = $jc(_$hash, name.hashCode);
|
||||
_$hash = $jc(_$hash, personalnummer.hashCode);
|
||||
_$hash = $jf(_$hash);
|
||||
return _$hash;
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return (newBuiltValueToStringHelper(r'Account')
|
||||
..add('active', active)
|
||||
..add('name', name)
|
||||
..add('personalnummer', personalnummer))
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
||||
class AccountBuilder implements Builder<Account, AccountBuilder> {
|
||||
_$Account? _$v;
|
||||
|
||||
bool? _active;
|
||||
bool? get active => _$this._active;
|
||||
set active(bool? active) => _$this._active = active;
|
||||
|
||||
String? _name;
|
||||
String? get name => _$this._name;
|
||||
set name(String? name) => _$this._name = name;
|
||||
|
||||
int? _personalnummer;
|
||||
int? get personalnummer => _$this._personalnummer;
|
||||
set personalnummer(int? personalnummer) =>
|
||||
_$this._personalnummer = personalnummer;
|
||||
|
||||
AccountBuilder() {
|
||||
Account._defaults(this);
|
||||
}
|
||||
|
||||
AccountBuilder get _$this {
|
||||
final $v = _$v;
|
||||
if ($v != null) {
|
||||
_active = $v.active;
|
||||
_name = $v.name;
|
||||
_personalnummer = $v.personalnummer;
|
||||
_$v = null;
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@override
|
||||
void replace(Account other) {
|
||||
_$v = other as _$Account;
|
||||
}
|
||||
|
||||
@override
|
||||
void update(void Function(AccountBuilder)? updates) {
|
||||
if (updates != null) updates(this);
|
||||
}
|
||||
|
||||
@override
|
||||
Account build() => _build();
|
||||
|
||||
_$Account _build() {
|
||||
final _$result = _$v ??
|
||||
_$Account._(
|
||||
active: BuiltValueNullFieldError.checkNotNull(
|
||||
active, r'Account', 'active'),
|
||||
name: BuiltValueNullFieldError.checkNotNull(name, r'Account', 'name'),
|
||||
personalnummer: BuiltValueNullFieldError.checkNotNull(
|
||||
personalnummer, r'Account', 'personalnummer'),
|
||||
);
|
||||
replace(_$result);
|
||||
return _$result;
|
||||
}
|
||||
}
|
||||
|
||||
// ignore_for_file: deprecated_member_use_from_same_package,type=lint
|
||||
170
packages/holzleitner_api/lib/src/model/address.dart
Normal file
170
packages/holzleitner_api/lib/src/model/address.dart
Normal file
@ -0,0 +1,170 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
|
||||
// ignore_for_file: unused_element
|
||||
import 'package:built_value/built_value.dart';
|
||||
import 'package:built_value/serializer.dart';
|
||||
|
||||
part 'address.g.dart';
|
||||
|
||||
/// Postanschrift — wird sowohl als aktuelle Kundenanschrift in [`Customer`] als auch als unveränderlicher Snapshot in [`crate::domain::Delivery`] verwendet (`delivery_address_snapshot`). Bewusst als Value Object modelliert: gleiche Adresse = gleicher Wert. Strikte Equality erleichtert Sync-Diffs zwischen ERP und Backend. [`Customer`]: crate::domain::Customer
|
||||
///
|
||||
/// Properties:
|
||||
/// * [city]
|
||||
/// * [country]
|
||||
/// * [houseNumber]
|
||||
/// * [postalCode]
|
||||
/// * [street]
|
||||
@BuiltValue()
|
||||
abstract class Address implements Built<Address, AddressBuilder> {
|
||||
@BuiltValueField(wireName: r'city')
|
||||
String get city;
|
||||
|
||||
@BuiltValueField(wireName: r'country')
|
||||
String get country;
|
||||
|
||||
@BuiltValueField(wireName: r'houseNumber')
|
||||
String get houseNumber;
|
||||
|
||||
@BuiltValueField(wireName: r'postalCode')
|
||||
String get postalCode;
|
||||
|
||||
@BuiltValueField(wireName: r'street')
|
||||
String get street;
|
||||
|
||||
Address._();
|
||||
|
||||
factory Address([void updates(AddressBuilder b)]) = _$Address;
|
||||
|
||||
@BuiltValueHook(initializeBuilder: true)
|
||||
static void _defaults(AddressBuilder b) => b;
|
||||
|
||||
@BuiltValueSerializer(custom: true)
|
||||
static Serializer<Address> get serializer => _$AddressSerializer();
|
||||
}
|
||||
|
||||
class _$AddressSerializer implements PrimitiveSerializer<Address> {
|
||||
@override
|
||||
final Iterable<Type> types = const [Address, _$Address];
|
||||
|
||||
@override
|
||||
final String wireName = r'Address';
|
||||
|
||||
Iterable<Object?> _serializeProperties(
|
||||
Serializers serializers,
|
||||
Address object, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) sync* {
|
||||
yield r'city';
|
||||
yield serializers.serialize(
|
||||
object.city,
|
||||
specifiedType: const FullType(String),
|
||||
);
|
||||
yield r'country';
|
||||
yield serializers.serialize(
|
||||
object.country,
|
||||
specifiedType: const FullType(String),
|
||||
);
|
||||
yield r'houseNumber';
|
||||
yield serializers.serialize(
|
||||
object.houseNumber,
|
||||
specifiedType: const FullType(String),
|
||||
);
|
||||
yield r'postalCode';
|
||||
yield serializers.serialize(
|
||||
object.postalCode,
|
||||
specifiedType: const FullType(String),
|
||||
);
|
||||
yield r'street';
|
||||
yield serializers.serialize(
|
||||
object.street,
|
||||
specifiedType: const FullType(String),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Object serialize(
|
||||
Serializers serializers,
|
||||
Address object, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) {
|
||||
return _serializeProperties(serializers, object, specifiedType: specifiedType).toList();
|
||||
}
|
||||
|
||||
void _deserializeProperties(
|
||||
Serializers serializers,
|
||||
Object serialized, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
required List<Object?> serializedList,
|
||||
required AddressBuilder result,
|
||||
required List<Object?> unhandled,
|
||||
}) {
|
||||
for (var i = 0; i < serializedList.length; i += 2) {
|
||||
final key = serializedList[i] as String;
|
||||
final value = serializedList[i + 1];
|
||||
switch (key) {
|
||||
case r'city':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(String),
|
||||
) as String;
|
||||
result.city = valueDes;
|
||||
break;
|
||||
case r'country':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(String),
|
||||
) as String;
|
||||
result.country = valueDes;
|
||||
break;
|
||||
case r'houseNumber':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(String),
|
||||
) as String;
|
||||
result.houseNumber = valueDes;
|
||||
break;
|
||||
case r'postalCode':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(String),
|
||||
) as String;
|
||||
result.postalCode = valueDes;
|
||||
break;
|
||||
case r'street':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(String),
|
||||
) as String;
|
||||
result.street = valueDes;
|
||||
break;
|
||||
default:
|
||||
unhandled.add(key);
|
||||
unhandled.add(value);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Address deserialize(
|
||||
Serializers serializers,
|
||||
Object serialized, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) {
|
||||
final result = AddressBuilder();
|
||||
final serializedList = (serialized as Iterable<Object?>).toList();
|
||||
final unhandled = <Object?>[];
|
||||
_deserializeProperties(
|
||||
serializers,
|
||||
serialized,
|
||||
specifiedType: specifiedType,
|
||||
serializedList: serializedList,
|
||||
unhandled: unhandled,
|
||||
result: result,
|
||||
);
|
||||
return result.build();
|
||||
}
|
||||
}
|
||||
|
||||
144
packages/holzleitner_api/lib/src/model/address.g.dart
Normal file
144
packages/holzleitner_api/lib/src/model/address.g.dart
Normal file
@ -0,0 +1,144 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'address.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// BuiltValueGenerator
|
||||
// **************************************************************************
|
||||
|
||||
class _$Address extends Address {
|
||||
@override
|
||||
final String city;
|
||||
@override
|
||||
final String country;
|
||||
@override
|
||||
final String houseNumber;
|
||||
@override
|
||||
final String postalCode;
|
||||
@override
|
||||
final String street;
|
||||
|
||||
factory _$Address([void Function(AddressBuilder)? updates]) =>
|
||||
(AddressBuilder()..update(updates))._build();
|
||||
|
||||
_$Address._(
|
||||
{required this.city,
|
||||
required this.country,
|
||||
required this.houseNumber,
|
||||
required this.postalCode,
|
||||
required this.street})
|
||||
: super._();
|
||||
@override
|
||||
Address rebuild(void Function(AddressBuilder) updates) =>
|
||||
(toBuilder()..update(updates)).build();
|
||||
|
||||
@override
|
||||
AddressBuilder toBuilder() => AddressBuilder()..replace(this);
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
if (identical(other, this)) return true;
|
||||
return other is Address &&
|
||||
city == other.city &&
|
||||
country == other.country &&
|
||||
houseNumber == other.houseNumber &&
|
||||
postalCode == other.postalCode &&
|
||||
street == other.street;
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode {
|
||||
var _$hash = 0;
|
||||
_$hash = $jc(_$hash, city.hashCode);
|
||||
_$hash = $jc(_$hash, country.hashCode);
|
||||
_$hash = $jc(_$hash, houseNumber.hashCode);
|
||||
_$hash = $jc(_$hash, postalCode.hashCode);
|
||||
_$hash = $jc(_$hash, street.hashCode);
|
||||
_$hash = $jf(_$hash);
|
||||
return _$hash;
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return (newBuiltValueToStringHelper(r'Address')
|
||||
..add('city', city)
|
||||
..add('country', country)
|
||||
..add('houseNumber', houseNumber)
|
||||
..add('postalCode', postalCode)
|
||||
..add('street', street))
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
||||
class AddressBuilder implements Builder<Address, AddressBuilder> {
|
||||
_$Address? _$v;
|
||||
|
||||
String? _city;
|
||||
String? get city => _$this._city;
|
||||
set city(String? city) => _$this._city = city;
|
||||
|
||||
String? _country;
|
||||
String? get country => _$this._country;
|
||||
set country(String? country) => _$this._country = country;
|
||||
|
||||
String? _houseNumber;
|
||||
String? get houseNumber => _$this._houseNumber;
|
||||
set houseNumber(String? houseNumber) => _$this._houseNumber = houseNumber;
|
||||
|
||||
String? _postalCode;
|
||||
String? get postalCode => _$this._postalCode;
|
||||
set postalCode(String? postalCode) => _$this._postalCode = postalCode;
|
||||
|
||||
String? _street;
|
||||
String? get street => _$this._street;
|
||||
set street(String? street) => _$this._street = street;
|
||||
|
||||
AddressBuilder() {
|
||||
Address._defaults(this);
|
||||
}
|
||||
|
||||
AddressBuilder get _$this {
|
||||
final $v = _$v;
|
||||
if ($v != null) {
|
||||
_city = $v.city;
|
||||
_country = $v.country;
|
||||
_houseNumber = $v.houseNumber;
|
||||
_postalCode = $v.postalCode;
|
||||
_street = $v.street;
|
||||
_$v = null;
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@override
|
||||
void replace(Address other) {
|
||||
_$v = other as _$Address;
|
||||
}
|
||||
|
||||
@override
|
||||
void update(void Function(AddressBuilder)? updates) {
|
||||
if (updates != null) updates(this);
|
||||
}
|
||||
|
||||
@override
|
||||
Address build() => _build();
|
||||
|
||||
_$Address _build() {
|
||||
final _$result = _$v ??
|
||||
_$Address._(
|
||||
city: BuiltValueNullFieldError.checkNotNull(city, r'Address', 'city'),
|
||||
country: BuiltValueNullFieldError.checkNotNull(
|
||||
country, r'Address', 'country'),
|
||||
houseNumber: BuiltValueNullFieldError.checkNotNull(
|
||||
houseNumber, r'Address', 'houseNumber'),
|
||||
postalCode: BuiltValueNullFieldError.checkNotNull(
|
||||
postalCode, r'Address', 'postalCode'),
|
||||
street: BuiltValueNullFieldError.checkNotNull(
|
||||
street, r'Address', 'street'),
|
||||
);
|
||||
replace(_$result);
|
||||
return _$result;
|
||||
}
|
||||
}
|
||||
|
||||
// ignore_for_file: deprecated_member_use_from_same_package,type=lint
|
||||
108
packages/holzleitner_api/lib/src/model/apply_scans_request.dart
Normal file
108
packages/holzleitner_api/lib/src/model/apply_scans_request.dart
Normal file
@ -0,0 +1,108 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
|
||||
// ignore_for_file: unused_element
|
||||
import 'package:built_collection/built_collection.dart';
|
||||
import 'package:holzleitner_api/src/model/scan_event.dart';
|
||||
import 'package:built_value/built_value.dart';
|
||||
import 'package:built_value/serializer.dart';
|
||||
|
||||
part 'apply_scans_request.g.dart';
|
||||
|
||||
/// ApplyScansRequest
|
||||
///
|
||||
/// Properties:
|
||||
/// * [scans]
|
||||
@BuiltValue()
|
||||
abstract class ApplyScansRequest implements Built<ApplyScansRequest, ApplyScansRequestBuilder> {
|
||||
@BuiltValueField(wireName: r'scans')
|
||||
BuiltList<ScanEvent> get scans;
|
||||
|
||||
ApplyScansRequest._();
|
||||
|
||||
factory ApplyScansRequest([void updates(ApplyScansRequestBuilder b)]) = _$ApplyScansRequest;
|
||||
|
||||
@BuiltValueHook(initializeBuilder: true)
|
||||
static void _defaults(ApplyScansRequestBuilder b) => b;
|
||||
|
||||
@BuiltValueSerializer(custom: true)
|
||||
static Serializer<ApplyScansRequest> get serializer => _$ApplyScansRequestSerializer();
|
||||
}
|
||||
|
||||
class _$ApplyScansRequestSerializer implements PrimitiveSerializer<ApplyScansRequest> {
|
||||
@override
|
||||
final Iterable<Type> types = const [ApplyScansRequest, _$ApplyScansRequest];
|
||||
|
||||
@override
|
||||
final String wireName = r'ApplyScansRequest';
|
||||
|
||||
Iterable<Object?> _serializeProperties(
|
||||
Serializers serializers,
|
||||
ApplyScansRequest object, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) sync* {
|
||||
yield r'scans';
|
||||
yield serializers.serialize(
|
||||
object.scans,
|
||||
specifiedType: const FullType(BuiltList, [FullType(ScanEvent)]),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Object serialize(
|
||||
Serializers serializers,
|
||||
ApplyScansRequest object, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) {
|
||||
return _serializeProperties(serializers, object, specifiedType: specifiedType).toList();
|
||||
}
|
||||
|
||||
void _deserializeProperties(
|
||||
Serializers serializers,
|
||||
Object serialized, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
required List<Object?> serializedList,
|
||||
required ApplyScansRequestBuilder result,
|
||||
required List<Object?> unhandled,
|
||||
}) {
|
||||
for (var i = 0; i < serializedList.length; i += 2) {
|
||||
final key = serializedList[i] as String;
|
||||
final value = serializedList[i + 1];
|
||||
switch (key) {
|
||||
case r'scans':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(BuiltList, [FullType(ScanEvent)]),
|
||||
) as BuiltList<ScanEvent>;
|
||||
result.scans.replace(valueDes);
|
||||
break;
|
||||
default:
|
||||
unhandled.add(key);
|
||||
unhandled.add(value);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
ApplyScansRequest deserialize(
|
||||
Serializers serializers,
|
||||
Object serialized, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) {
|
||||
final result = ApplyScansRequestBuilder();
|
||||
final serializedList = (serialized as Iterable<Object?>).toList();
|
||||
final unhandled = <Object?>[];
|
||||
_deserializeProperties(
|
||||
serializers,
|
||||
serialized,
|
||||
specifiedType: specifiedType,
|
||||
serializedList: serializedList,
|
||||
unhandled: unhandled,
|
||||
result: result,
|
||||
);
|
||||
return result.build();
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,106 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'apply_scans_request.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// BuiltValueGenerator
|
||||
// **************************************************************************
|
||||
|
||||
class _$ApplyScansRequest extends ApplyScansRequest {
|
||||
@override
|
||||
final BuiltList<ScanEvent> scans;
|
||||
|
||||
factory _$ApplyScansRequest(
|
||||
[void Function(ApplyScansRequestBuilder)? updates]) =>
|
||||
(ApplyScansRequestBuilder()..update(updates))._build();
|
||||
|
||||
_$ApplyScansRequest._({required this.scans}) : super._();
|
||||
@override
|
||||
ApplyScansRequest rebuild(void Function(ApplyScansRequestBuilder) updates) =>
|
||||
(toBuilder()..update(updates)).build();
|
||||
|
||||
@override
|
||||
ApplyScansRequestBuilder toBuilder() =>
|
||||
ApplyScansRequestBuilder()..replace(this);
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
if (identical(other, this)) return true;
|
||||
return other is ApplyScansRequest && scans == other.scans;
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode {
|
||||
var _$hash = 0;
|
||||
_$hash = $jc(_$hash, scans.hashCode);
|
||||
_$hash = $jf(_$hash);
|
||||
return _$hash;
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return (newBuiltValueToStringHelper(r'ApplyScansRequest')
|
||||
..add('scans', scans))
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
||||
class ApplyScansRequestBuilder
|
||||
implements Builder<ApplyScansRequest, ApplyScansRequestBuilder> {
|
||||
_$ApplyScansRequest? _$v;
|
||||
|
||||
ListBuilder<ScanEvent>? _scans;
|
||||
ListBuilder<ScanEvent> get scans =>
|
||||
_$this._scans ??= ListBuilder<ScanEvent>();
|
||||
set scans(ListBuilder<ScanEvent>? scans) => _$this._scans = scans;
|
||||
|
||||
ApplyScansRequestBuilder() {
|
||||
ApplyScansRequest._defaults(this);
|
||||
}
|
||||
|
||||
ApplyScansRequestBuilder get _$this {
|
||||
final $v = _$v;
|
||||
if ($v != null) {
|
||||
_scans = $v.scans.toBuilder();
|
||||
_$v = null;
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@override
|
||||
void replace(ApplyScansRequest other) {
|
||||
_$v = other as _$ApplyScansRequest;
|
||||
}
|
||||
|
||||
@override
|
||||
void update(void Function(ApplyScansRequestBuilder)? updates) {
|
||||
if (updates != null) updates(this);
|
||||
}
|
||||
|
||||
@override
|
||||
ApplyScansRequest build() => _build();
|
||||
|
||||
_$ApplyScansRequest _build() {
|
||||
_$ApplyScansRequest _$result;
|
||||
try {
|
||||
_$result = _$v ??
|
||||
_$ApplyScansRequest._(
|
||||
scans: scans.build(),
|
||||
);
|
||||
} catch (_) {
|
||||
late String _$failedField;
|
||||
try {
|
||||
_$failedField = 'scans';
|
||||
scans.build();
|
||||
} catch (e) {
|
||||
throw BuiltValueNestedFieldError(
|
||||
r'ApplyScansRequest', _$failedField, e.toString());
|
||||
}
|
||||
rethrow;
|
||||
}
|
||||
replace(_$result);
|
||||
return _$result;
|
||||
}
|
||||
}
|
||||
|
||||
// ignore_for_file: deprecated_member_use_from_same_package,type=lint
|
||||
108
packages/holzleitner_api/lib/src/model/apply_scans_response.dart
Normal file
108
packages/holzleitner_api/lib/src/model/apply_scans_response.dart
Normal file
@ -0,0 +1,108 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
|
||||
// ignore_for_file: unused_element
|
||||
import 'package:holzleitner_api/src/model/scan_result.dart';
|
||||
import 'package:built_collection/built_collection.dart';
|
||||
import 'package:built_value/built_value.dart';
|
||||
import 'package:built_value/serializer.dart';
|
||||
|
||||
part 'apply_scans_response.g.dart';
|
||||
|
||||
/// ApplyScansResponse
|
||||
///
|
||||
/// Properties:
|
||||
/// * [results]
|
||||
@BuiltValue()
|
||||
abstract class ApplyScansResponse implements Built<ApplyScansResponse, ApplyScansResponseBuilder> {
|
||||
@BuiltValueField(wireName: r'results')
|
||||
BuiltList<ScanResult> get results;
|
||||
|
||||
ApplyScansResponse._();
|
||||
|
||||
factory ApplyScansResponse([void updates(ApplyScansResponseBuilder b)]) = _$ApplyScansResponse;
|
||||
|
||||
@BuiltValueHook(initializeBuilder: true)
|
||||
static void _defaults(ApplyScansResponseBuilder b) => b;
|
||||
|
||||
@BuiltValueSerializer(custom: true)
|
||||
static Serializer<ApplyScansResponse> get serializer => _$ApplyScansResponseSerializer();
|
||||
}
|
||||
|
||||
class _$ApplyScansResponseSerializer implements PrimitiveSerializer<ApplyScansResponse> {
|
||||
@override
|
||||
final Iterable<Type> types = const [ApplyScansResponse, _$ApplyScansResponse];
|
||||
|
||||
@override
|
||||
final String wireName = r'ApplyScansResponse';
|
||||
|
||||
Iterable<Object?> _serializeProperties(
|
||||
Serializers serializers,
|
||||
ApplyScansResponse object, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) sync* {
|
||||
yield r'results';
|
||||
yield serializers.serialize(
|
||||
object.results,
|
||||
specifiedType: const FullType(BuiltList, [FullType(ScanResult)]),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Object serialize(
|
||||
Serializers serializers,
|
||||
ApplyScansResponse object, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) {
|
||||
return _serializeProperties(serializers, object, specifiedType: specifiedType).toList();
|
||||
}
|
||||
|
||||
void _deserializeProperties(
|
||||
Serializers serializers,
|
||||
Object serialized, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
required List<Object?> serializedList,
|
||||
required ApplyScansResponseBuilder result,
|
||||
required List<Object?> unhandled,
|
||||
}) {
|
||||
for (var i = 0; i < serializedList.length; i += 2) {
|
||||
final key = serializedList[i] as String;
|
||||
final value = serializedList[i + 1];
|
||||
switch (key) {
|
||||
case r'results':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(BuiltList, [FullType(ScanResult)]),
|
||||
) as BuiltList<ScanResult>;
|
||||
result.results.replace(valueDes);
|
||||
break;
|
||||
default:
|
||||
unhandled.add(key);
|
||||
unhandled.add(value);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
ApplyScansResponse deserialize(
|
||||
Serializers serializers,
|
||||
Object serialized, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) {
|
||||
final result = ApplyScansResponseBuilder();
|
||||
final serializedList = (serialized as Iterable<Object?>).toList();
|
||||
final unhandled = <Object?>[];
|
||||
_deserializeProperties(
|
||||
serializers,
|
||||
serialized,
|
||||
specifiedType: specifiedType,
|
||||
serializedList: serializedList,
|
||||
unhandled: unhandled,
|
||||
result: result,
|
||||
);
|
||||
return result.build();
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,107 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'apply_scans_response.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// BuiltValueGenerator
|
||||
// **************************************************************************
|
||||
|
||||
class _$ApplyScansResponse extends ApplyScansResponse {
|
||||
@override
|
||||
final BuiltList<ScanResult> results;
|
||||
|
||||
factory _$ApplyScansResponse(
|
||||
[void Function(ApplyScansResponseBuilder)? updates]) =>
|
||||
(ApplyScansResponseBuilder()..update(updates))._build();
|
||||
|
||||
_$ApplyScansResponse._({required this.results}) : super._();
|
||||
@override
|
||||
ApplyScansResponse rebuild(
|
||||
void Function(ApplyScansResponseBuilder) updates) =>
|
||||
(toBuilder()..update(updates)).build();
|
||||
|
||||
@override
|
||||
ApplyScansResponseBuilder toBuilder() =>
|
||||
ApplyScansResponseBuilder()..replace(this);
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
if (identical(other, this)) return true;
|
||||
return other is ApplyScansResponse && results == other.results;
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode {
|
||||
var _$hash = 0;
|
||||
_$hash = $jc(_$hash, results.hashCode);
|
||||
_$hash = $jf(_$hash);
|
||||
return _$hash;
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return (newBuiltValueToStringHelper(r'ApplyScansResponse')
|
||||
..add('results', results))
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
||||
class ApplyScansResponseBuilder
|
||||
implements Builder<ApplyScansResponse, ApplyScansResponseBuilder> {
|
||||
_$ApplyScansResponse? _$v;
|
||||
|
||||
ListBuilder<ScanResult>? _results;
|
||||
ListBuilder<ScanResult> get results =>
|
||||
_$this._results ??= ListBuilder<ScanResult>();
|
||||
set results(ListBuilder<ScanResult>? results) => _$this._results = results;
|
||||
|
||||
ApplyScansResponseBuilder() {
|
||||
ApplyScansResponse._defaults(this);
|
||||
}
|
||||
|
||||
ApplyScansResponseBuilder get _$this {
|
||||
final $v = _$v;
|
||||
if ($v != null) {
|
||||
_results = $v.results.toBuilder();
|
||||
_$v = null;
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@override
|
||||
void replace(ApplyScansResponse other) {
|
||||
_$v = other as _$ApplyScansResponse;
|
||||
}
|
||||
|
||||
@override
|
||||
void update(void Function(ApplyScansResponseBuilder)? updates) {
|
||||
if (updates != null) updates(this);
|
||||
}
|
||||
|
||||
@override
|
||||
ApplyScansResponse build() => _build();
|
||||
|
||||
_$ApplyScansResponse _build() {
|
||||
_$ApplyScansResponse _$result;
|
||||
try {
|
||||
_$result = _$v ??
|
||||
_$ApplyScansResponse._(
|
||||
results: results.build(),
|
||||
);
|
||||
} catch (_) {
|
||||
late String _$failedField;
|
||||
try {
|
||||
_$failedField = 'results';
|
||||
results.build();
|
||||
} catch (e) {
|
||||
throw BuiltValueNestedFieldError(
|
||||
r'ApplyScansResponse', _$failedField, e.toString());
|
||||
}
|
||||
rethrow;
|
||||
}
|
||||
replace(_$result);
|
||||
return _$result;
|
||||
}
|
||||
}
|
||||
|
||||
// ignore_for_file: deprecated_member_use_from_same_package,type=lint
|
||||
173
packages/holzleitner_api/lib/src/model/article.dart
Normal file
173
packages/holzleitner_api/lib/src/model/article.dart
Normal file
@ -0,0 +1,173 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
|
||||
// ignore_for_file: unused_element
|
||||
import 'package:built_value/built_value.dart';
|
||||
import 'package:built_value/serializer.dart';
|
||||
|
||||
part 'article.g.dart';
|
||||
|
||||
/// Artikel. ERP-Mirror; die `article_number` ist die business-stabile Artikelnummer aus dem ERP-Stamm und dient gleichzeitig als Brücke. `scannable = false` markiert nicht-physische Positionen wie Dienstleistungen, Versandpauschalen o.ä. — sie tauchen zwar als `DeliveryItem` auf, blockieren aber den Beladen-Fortschritt nicht.
|
||||
///
|
||||
/// Properties:
|
||||
/// * [articleNumber]
|
||||
/// * [defaultWarehouseId]
|
||||
/// * [id]
|
||||
/// * [name]
|
||||
/// * [scannable]
|
||||
@BuiltValue()
|
||||
abstract class Article implements Built<Article, ArticleBuilder> {
|
||||
@BuiltValueField(wireName: r'articleNumber')
|
||||
String get articleNumber;
|
||||
|
||||
@BuiltValueField(wireName: r'defaultWarehouseId')
|
||||
String? get defaultWarehouseId;
|
||||
|
||||
@BuiltValueField(wireName: r'id')
|
||||
String get id;
|
||||
|
||||
@BuiltValueField(wireName: r'name')
|
||||
String get name;
|
||||
|
||||
@BuiltValueField(wireName: r'scannable')
|
||||
bool get scannable;
|
||||
|
||||
Article._();
|
||||
|
||||
factory Article([void updates(ArticleBuilder b)]) = _$Article;
|
||||
|
||||
@BuiltValueHook(initializeBuilder: true)
|
||||
static void _defaults(ArticleBuilder b) => b;
|
||||
|
||||
@BuiltValueSerializer(custom: true)
|
||||
static Serializer<Article> get serializer => _$ArticleSerializer();
|
||||
}
|
||||
|
||||
class _$ArticleSerializer implements PrimitiveSerializer<Article> {
|
||||
@override
|
||||
final Iterable<Type> types = const [Article, _$Article];
|
||||
|
||||
@override
|
||||
final String wireName = r'Article';
|
||||
|
||||
Iterable<Object?> _serializeProperties(
|
||||
Serializers serializers,
|
||||
Article object, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) sync* {
|
||||
yield r'articleNumber';
|
||||
yield serializers.serialize(
|
||||
object.articleNumber,
|
||||
specifiedType: const FullType(String),
|
||||
);
|
||||
if (object.defaultWarehouseId != null) {
|
||||
yield r'defaultWarehouseId';
|
||||
yield serializers.serialize(
|
||||
object.defaultWarehouseId,
|
||||
specifiedType: const FullType.nullable(String),
|
||||
);
|
||||
}
|
||||
yield r'id';
|
||||
yield serializers.serialize(
|
||||
object.id,
|
||||
specifiedType: const FullType(String),
|
||||
);
|
||||
yield r'name';
|
||||
yield serializers.serialize(
|
||||
object.name,
|
||||
specifiedType: const FullType(String),
|
||||
);
|
||||
yield r'scannable';
|
||||
yield serializers.serialize(
|
||||
object.scannable,
|
||||
specifiedType: const FullType(bool),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Object serialize(
|
||||
Serializers serializers,
|
||||
Article object, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) {
|
||||
return _serializeProperties(serializers, object, specifiedType: specifiedType).toList();
|
||||
}
|
||||
|
||||
void _deserializeProperties(
|
||||
Serializers serializers,
|
||||
Object serialized, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
required List<Object?> serializedList,
|
||||
required ArticleBuilder result,
|
||||
required List<Object?> unhandled,
|
||||
}) {
|
||||
for (var i = 0; i < serializedList.length; i += 2) {
|
||||
final key = serializedList[i] as String;
|
||||
final value = serializedList[i + 1];
|
||||
switch (key) {
|
||||
case r'articleNumber':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(String),
|
||||
) as String;
|
||||
result.articleNumber = valueDes;
|
||||
break;
|
||||
case r'defaultWarehouseId':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType.nullable(String),
|
||||
) as String?;
|
||||
if (valueDes == null) continue;
|
||||
result.defaultWarehouseId = valueDes;
|
||||
break;
|
||||
case r'id':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(String),
|
||||
) as String;
|
||||
result.id = valueDes;
|
||||
break;
|
||||
case r'name':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(String),
|
||||
) as String;
|
||||
result.name = valueDes;
|
||||
break;
|
||||
case r'scannable':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(bool),
|
||||
) as bool;
|
||||
result.scannable = valueDes;
|
||||
break;
|
||||
default:
|
||||
unhandled.add(key);
|
||||
unhandled.add(value);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Article deserialize(
|
||||
Serializers serializers,
|
||||
Object serialized, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) {
|
||||
final result = ArticleBuilder();
|
||||
final serializedList = (serialized as Iterable<Object?>).toList();
|
||||
final unhandled = <Object?>[];
|
||||
_deserializeProperties(
|
||||
serializers,
|
||||
serialized,
|
||||
specifiedType: specifiedType,
|
||||
serializedList: serializedList,
|
||||
unhandled: unhandled,
|
||||
result: result,
|
||||
);
|
||||
return result.build();
|
||||
}
|
||||
}
|
||||
|
||||
144
packages/holzleitner_api/lib/src/model/article.g.dart
Normal file
144
packages/holzleitner_api/lib/src/model/article.g.dart
Normal file
@ -0,0 +1,144 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'article.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// BuiltValueGenerator
|
||||
// **************************************************************************
|
||||
|
||||
class _$Article extends Article {
|
||||
@override
|
||||
final String articleNumber;
|
||||
@override
|
||||
final String? defaultWarehouseId;
|
||||
@override
|
||||
final String id;
|
||||
@override
|
||||
final String name;
|
||||
@override
|
||||
final bool scannable;
|
||||
|
||||
factory _$Article([void Function(ArticleBuilder)? updates]) =>
|
||||
(ArticleBuilder()..update(updates))._build();
|
||||
|
||||
_$Article._(
|
||||
{required this.articleNumber,
|
||||
this.defaultWarehouseId,
|
||||
required this.id,
|
||||
required this.name,
|
||||
required this.scannable})
|
||||
: super._();
|
||||
@override
|
||||
Article rebuild(void Function(ArticleBuilder) updates) =>
|
||||
(toBuilder()..update(updates)).build();
|
||||
|
||||
@override
|
||||
ArticleBuilder toBuilder() => ArticleBuilder()..replace(this);
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
if (identical(other, this)) return true;
|
||||
return other is Article &&
|
||||
articleNumber == other.articleNumber &&
|
||||
defaultWarehouseId == other.defaultWarehouseId &&
|
||||
id == other.id &&
|
||||
name == other.name &&
|
||||
scannable == other.scannable;
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode {
|
||||
var _$hash = 0;
|
||||
_$hash = $jc(_$hash, articleNumber.hashCode);
|
||||
_$hash = $jc(_$hash, defaultWarehouseId.hashCode);
|
||||
_$hash = $jc(_$hash, id.hashCode);
|
||||
_$hash = $jc(_$hash, name.hashCode);
|
||||
_$hash = $jc(_$hash, scannable.hashCode);
|
||||
_$hash = $jf(_$hash);
|
||||
return _$hash;
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return (newBuiltValueToStringHelper(r'Article')
|
||||
..add('articleNumber', articleNumber)
|
||||
..add('defaultWarehouseId', defaultWarehouseId)
|
||||
..add('id', id)
|
||||
..add('name', name)
|
||||
..add('scannable', scannable))
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
||||
class ArticleBuilder implements Builder<Article, ArticleBuilder> {
|
||||
_$Article? _$v;
|
||||
|
||||
String? _articleNumber;
|
||||
String? get articleNumber => _$this._articleNumber;
|
||||
set articleNumber(String? articleNumber) =>
|
||||
_$this._articleNumber = articleNumber;
|
||||
|
||||
String? _defaultWarehouseId;
|
||||
String? get defaultWarehouseId => _$this._defaultWarehouseId;
|
||||
set defaultWarehouseId(String? defaultWarehouseId) =>
|
||||
_$this._defaultWarehouseId = defaultWarehouseId;
|
||||
|
||||
String? _id;
|
||||
String? get id => _$this._id;
|
||||
set id(String? id) => _$this._id = id;
|
||||
|
||||
String? _name;
|
||||
String? get name => _$this._name;
|
||||
set name(String? name) => _$this._name = name;
|
||||
|
||||
bool? _scannable;
|
||||
bool? get scannable => _$this._scannable;
|
||||
set scannable(bool? scannable) => _$this._scannable = scannable;
|
||||
|
||||
ArticleBuilder() {
|
||||
Article._defaults(this);
|
||||
}
|
||||
|
||||
ArticleBuilder get _$this {
|
||||
final $v = _$v;
|
||||
if ($v != null) {
|
||||
_articleNumber = $v.articleNumber;
|
||||
_defaultWarehouseId = $v.defaultWarehouseId;
|
||||
_id = $v.id;
|
||||
_name = $v.name;
|
||||
_scannable = $v.scannable;
|
||||
_$v = null;
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@override
|
||||
void replace(Article other) {
|
||||
_$v = other as _$Article;
|
||||
}
|
||||
|
||||
@override
|
||||
void update(void Function(ArticleBuilder)? updates) {
|
||||
if (updates != null) updates(this);
|
||||
}
|
||||
|
||||
@override
|
||||
Article build() => _build();
|
||||
|
||||
_$Article _build() {
|
||||
final _$result = _$v ??
|
||||
_$Article._(
|
||||
articleNumber: BuiltValueNullFieldError.checkNotNull(
|
||||
articleNumber, r'Article', 'articleNumber'),
|
||||
defaultWarehouseId: defaultWarehouseId,
|
||||
id: BuiltValueNullFieldError.checkNotNull(id, r'Article', 'id'),
|
||||
name: BuiltValueNullFieldError.checkNotNull(name, r'Article', 'name'),
|
||||
scannable: BuiltValueNullFieldError.checkNotNull(
|
||||
scannable, r'Article', 'scannable'),
|
||||
);
|
||||
replace(_$result);
|
||||
return _$result;
|
||||
}
|
||||
}
|
||||
|
||||
// ignore_for_file: deprecated_member_use_from_same_package,type=lint
|
||||
109
packages/holzleitner_api/lib/src/model/assign_car_request.dart
Normal file
109
packages/holzleitner_api/lib/src/model/assign_car_request.dart
Normal file
@ -0,0 +1,109 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
|
||||
// ignore_for_file: unused_element
|
||||
import 'package:built_value/built_value.dart';
|
||||
import 'package:built_value/serializer.dart';
|
||||
|
||||
part 'assign_car_request.g.dart';
|
||||
|
||||
/// Setzt das `assigned_car_id` einer Lieferung. `None` (`carId: null`) entfernt die Zuordnung.
|
||||
///
|
||||
/// Properties:
|
||||
/// * [carId]
|
||||
@BuiltValue()
|
||||
abstract class AssignCarRequest implements Built<AssignCarRequest, AssignCarRequestBuilder> {
|
||||
@BuiltValueField(wireName: r'carId')
|
||||
String? get carId;
|
||||
|
||||
AssignCarRequest._();
|
||||
|
||||
factory AssignCarRequest([void updates(AssignCarRequestBuilder b)]) = _$AssignCarRequest;
|
||||
|
||||
@BuiltValueHook(initializeBuilder: true)
|
||||
static void _defaults(AssignCarRequestBuilder b) => b;
|
||||
|
||||
@BuiltValueSerializer(custom: true)
|
||||
static Serializer<AssignCarRequest> get serializer => _$AssignCarRequestSerializer();
|
||||
}
|
||||
|
||||
class _$AssignCarRequestSerializer implements PrimitiveSerializer<AssignCarRequest> {
|
||||
@override
|
||||
final Iterable<Type> types = const [AssignCarRequest, _$AssignCarRequest];
|
||||
|
||||
@override
|
||||
final String wireName = r'AssignCarRequest';
|
||||
|
||||
Iterable<Object?> _serializeProperties(
|
||||
Serializers serializers,
|
||||
AssignCarRequest object, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) sync* {
|
||||
if (object.carId != null) {
|
||||
yield r'carId';
|
||||
yield serializers.serialize(
|
||||
object.carId,
|
||||
specifiedType: const FullType.nullable(String),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Object serialize(
|
||||
Serializers serializers,
|
||||
AssignCarRequest object, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) {
|
||||
return _serializeProperties(serializers, object, specifiedType: specifiedType).toList();
|
||||
}
|
||||
|
||||
void _deserializeProperties(
|
||||
Serializers serializers,
|
||||
Object serialized, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
required List<Object?> serializedList,
|
||||
required AssignCarRequestBuilder result,
|
||||
required List<Object?> unhandled,
|
||||
}) {
|
||||
for (var i = 0; i < serializedList.length; i += 2) {
|
||||
final key = serializedList[i] as String;
|
||||
final value = serializedList[i + 1];
|
||||
switch (key) {
|
||||
case r'carId':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType.nullable(String),
|
||||
) as String?;
|
||||
if (valueDes == null) continue;
|
||||
result.carId = valueDes;
|
||||
break;
|
||||
default:
|
||||
unhandled.add(key);
|
||||
unhandled.add(value);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
AssignCarRequest deserialize(
|
||||
Serializers serializers,
|
||||
Object serialized, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) {
|
||||
final result = AssignCarRequestBuilder();
|
||||
final serializedList = (serialized as Iterable<Object?>).toList();
|
||||
final unhandled = <Object?>[];
|
||||
_deserializeProperties(
|
||||
serializers,
|
||||
serialized,
|
||||
specifiedType: specifiedType,
|
||||
serializedList: serializedList,
|
||||
unhandled: unhandled,
|
||||
result: result,
|
||||
);
|
||||
return result.build();
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,92 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'assign_car_request.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// BuiltValueGenerator
|
||||
// **************************************************************************
|
||||
|
||||
class _$AssignCarRequest extends AssignCarRequest {
|
||||
@override
|
||||
final String? carId;
|
||||
|
||||
factory _$AssignCarRequest(
|
||||
[void Function(AssignCarRequestBuilder)? updates]) =>
|
||||
(AssignCarRequestBuilder()..update(updates))._build();
|
||||
|
||||
_$AssignCarRequest._({this.carId}) : super._();
|
||||
@override
|
||||
AssignCarRequest rebuild(void Function(AssignCarRequestBuilder) updates) =>
|
||||
(toBuilder()..update(updates)).build();
|
||||
|
||||
@override
|
||||
AssignCarRequestBuilder toBuilder() =>
|
||||
AssignCarRequestBuilder()..replace(this);
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
if (identical(other, this)) return true;
|
||||
return other is AssignCarRequest && carId == other.carId;
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode {
|
||||
var _$hash = 0;
|
||||
_$hash = $jc(_$hash, carId.hashCode);
|
||||
_$hash = $jf(_$hash);
|
||||
return _$hash;
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return (newBuiltValueToStringHelper(r'AssignCarRequest')
|
||||
..add('carId', carId))
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
||||
class AssignCarRequestBuilder
|
||||
implements Builder<AssignCarRequest, AssignCarRequestBuilder> {
|
||||
_$AssignCarRequest? _$v;
|
||||
|
||||
String? _carId;
|
||||
String? get carId => _$this._carId;
|
||||
set carId(String? carId) => _$this._carId = carId;
|
||||
|
||||
AssignCarRequestBuilder() {
|
||||
AssignCarRequest._defaults(this);
|
||||
}
|
||||
|
||||
AssignCarRequestBuilder get _$this {
|
||||
final $v = _$v;
|
||||
if ($v != null) {
|
||||
_carId = $v.carId;
|
||||
_$v = null;
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@override
|
||||
void replace(AssignCarRequest other) {
|
||||
_$v = other as _$AssignCarRequest;
|
||||
}
|
||||
|
||||
@override
|
||||
void update(void Function(AssignCarRequestBuilder)? updates) {
|
||||
if (updates != null) updates(this);
|
||||
}
|
||||
|
||||
@override
|
||||
AssignCarRequest build() => _build();
|
||||
|
||||
_$AssignCarRequest _build() {
|
||||
final _$result = _$v ??
|
||||
_$AssignCarRequest._(
|
||||
carId: carId,
|
||||
);
|
||||
replace(_$result);
|
||||
return _$result;
|
||||
}
|
||||
}
|
||||
|
||||
// ignore_for_file: deprecated_member_use_from_same_package,type=lint
|
||||
45
packages/holzleitner_api/lib/src/model/audit_action.dart
Normal file
45
packages/holzleitner_api/lib/src/model/audit_action.dart
Normal file
@ -0,0 +1,45 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
|
||||
// ignore_for_file: unused_element
|
||||
import 'package:built_collection/built_collection.dart';
|
||||
import 'package:built_value/built_value.dart';
|
||||
import 'package:built_value/serializer.dart';
|
||||
|
||||
part 'audit_action.g.dart';
|
||||
|
||||
class AuditAction extends EnumClass {
|
||||
|
||||
/// Aktion-Typen im Scan-Audit-Log. * `Scan` / `Unscan` verändern die `scanned_quantity` (+1 / -1). * `Hold` / `Unhold` ändern nur den Status, keine Menge. * `Remove` markiert die Position als entfernt (Status `Removed`, z. B. weil der Kunde sie nicht annimmt).
|
||||
@BuiltValueEnumConst(wireName: r'scan')
|
||||
static const AuditAction scan = _$scan;
|
||||
/// Aktion-Typen im Scan-Audit-Log. * `Scan` / `Unscan` verändern die `scanned_quantity` (+1 / -1). * `Hold` / `Unhold` ändern nur den Status, keine Menge. * `Remove` markiert die Position als entfernt (Status `Removed`, z. B. weil der Kunde sie nicht annimmt).
|
||||
@BuiltValueEnumConst(wireName: r'unscan')
|
||||
static const AuditAction unscan = _$unscan;
|
||||
/// Aktion-Typen im Scan-Audit-Log. * `Scan` / `Unscan` verändern die `scanned_quantity` (+1 / -1). * `Hold` / `Unhold` ändern nur den Status, keine Menge. * `Remove` markiert die Position als entfernt (Status `Removed`, z. B. weil der Kunde sie nicht annimmt).
|
||||
@BuiltValueEnumConst(wireName: r'hold')
|
||||
static const AuditAction hold = _$hold;
|
||||
/// Aktion-Typen im Scan-Audit-Log. * `Scan` / `Unscan` verändern die `scanned_quantity` (+1 / -1). * `Hold` / `Unhold` ändern nur den Status, keine Menge. * `Remove` markiert die Position als entfernt (Status `Removed`, z. B. weil der Kunde sie nicht annimmt).
|
||||
@BuiltValueEnumConst(wireName: r'unhold')
|
||||
static const AuditAction unhold = _$unhold;
|
||||
/// Aktion-Typen im Scan-Audit-Log. * `Scan` / `Unscan` verändern die `scanned_quantity` (+1 / -1). * `Hold` / `Unhold` ändern nur den Status, keine Menge. * `Remove` markiert die Position als entfernt (Status `Removed`, z. B. weil der Kunde sie nicht annimmt).
|
||||
@BuiltValueEnumConst(wireName: r'remove')
|
||||
static const AuditAction remove = _$remove;
|
||||
|
||||
static Serializer<AuditAction> get serializer => _$auditActionSerializer;
|
||||
|
||||
const AuditAction._(String name): super(name);
|
||||
|
||||
static BuiltSet<AuditAction> get values => _$values;
|
||||
static AuditAction valueOf(String name) => _$valueOf(name);
|
||||
}
|
||||
|
||||
/// Optionally, enum_class can generate a mixin to go with your enum for use
|
||||
/// with Angular. It exposes your enum constants as getters. So, if you mix it
|
||||
/// in to your Dart component class, the values become available to the
|
||||
/// corresponding Angular template.
|
||||
///
|
||||
/// Trigger mixin generation by writing a line like this one next to your enum.
|
||||
abstract class AuditActionMixin = Object with _$AuditActionMixin;
|
||||
|
||||
92
packages/holzleitner_api/lib/src/model/audit_action.g.dart
Normal file
92
packages/holzleitner_api/lib/src/model/audit_action.g.dart
Normal file
@ -0,0 +1,92 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'audit_action.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// BuiltValueGenerator
|
||||
// **************************************************************************
|
||||
|
||||
const AuditAction _$scan = const AuditAction._('scan');
|
||||
const AuditAction _$unscan = const AuditAction._('unscan');
|
||||
const AuditAction _$hold = const AuditAction._('hold');
|
||||
const AuditAction _$unhold = const AuditAction._('unhold');
|
||||
const AuditAction _$remove = const AuditAction._('remove');
|
||||
|
||||
AuditAction _$valueOf(String name) {
|
||||
switch (name) {
|
||||
case 'scan':
|
||||
return _$scan;
|
||||
case 'unscan':
|
||||
return _$unscan;
|
||||
case 'hold':
|
||||
return _$hold;
|
||||
case 'unhold':
|
||||
return _$unhold;
|
||||
case 'remove':
|
||||
return _$remove;
|
||||
default:
|
||||
throw ArgumentError(name);
|
||||
}
|
||||
}
|
||||
|
||||
final BuiltSet<AuditAction> _$values =
|
||||
BuiltSet<AuditAction>(const <AuditAction>[
|
||||
_$scan,
|
||||
_$unscan,
|
||||
_$hold,
|
||||
_$unhold,
|
||||
_$remove,
|
||||
]);
|
||||
|
||||
class _$AuditActionMeta {
|
||||
const _$AuditActionMeta();
|
||||
AuditAction get scan => _$scan;
|
||||
AuditAction get unscan => _$unscan;
|
||||
AuditAction get hold => _$hold;
|
||||
AuditAction get unhold => _$unhold;
|
||||
AuditAction get remove => _$remove;
|
||||
AuditAction valueOf(String name) => _$valueOf(name);
|
||||
BuiltSet<AuditAction> get values => _$values;
|
||||
}
|
||||
|
||||
abstract class _$AuditActionMixin {
|
||||
// ignore: non_constant_identifier_names
|
||||
_$AuditActionMeta get AuditAction => const _$AuditActionMeta();
|
||||
}
|
||||
|
||||
Serializer<AuditAction> _$auditActionSerializer = _$AuditActionSerializer();
|
||||
|
||||
class _$AuditActionSerializer implements PrimitiveSerializer<AuditAction> {
|
||||
static const Map<String, Object> _toWire = const <String, Object>{
|
||||
'scan': 'scan',
|
||||
'unscan': 'unscan',
|
||||
'hold': 'hold',
|
||||
'unhold': 'unhold',
|
||||
'remove': 'remove',
|
||||
};
|
||||
static const Map<Object, String> _fromWire = const <Object, String>{
|
||||
'scan': 'scan',
|
||||
'unscan': 'unscan',
|
||||
'hold': 'hold',
|
||||
'unhold': 'unhold',
|
||||
'remove': 'remove',
|
||||
};
|
||||
|
||||
@override
|
||||
final Iterable<Type> types = const <Type>[AuditAction];
|
||||
@override
|
||||
final String wireName = 'AuditAction';
|
||||
|
||||
@override
|
||||
Object serialize(Serializers serializers, AuditAction object,
|
||||
{FullType specifiedType = FullType.unspecified}) =>
|
||||
_toWire[object.name] ?? object.name;
|
||||
|
||||
@override
|
||||
AuditAction deserialize(Serializers serializers, Object serialized,
|
||||
{FullType specifiedType = FullType.unspecified}) =>
|
||||
AuditAction.valueOf(
|
||||
_fromWire[serialized] ?? (serialized is String ? serialized : ''));
|
||||
}
|
||||
|
||||
// ignore_for_file: deprecated_member_use_from_same_package,type=lint
|
||||
@ -0,0 +1,106 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
|
||||
// ignore_for_file: unused_element
|
||||
import 'package:built_value/built_value.dart';
|
||||
import 'package:built_value/serializer.dart';
|
||||
|
||||
part 'cancel_delivery_request.g.dart';
|
||||
|
||||
/// CancelDeliveryRequest
|
||||
///
|
||||
/// Properties:
|
||||
/// * [reason]
|
||||
@BuiltValue()
|
||||
abstract class CancelDeliveryRequest implements Built<CancelDeliveryRequest, CancelDeliveryRequestBuilder> {
|
||||
@BuiltValueField(wireName: r'reason')
|
||||
String get reason;
|
||||
|
||||
CancelDeliveryRequest._();
|
||||
|
||||
factory CancelDeliveryRequest([void updates(CancelDeliveryRequestBuilder b)]) = _$CancelDeliveryRequest;
|
||||
|
||||
@BuiltValueHook(initializeBuilder: true)
|
||||
static void _defaults(CancelDeliveryRequestBuilder b) => b;
|
||||
|
||||
@BuiltValueSerializer(custom: true)
|
||||
static Serializer<CancelDeliveryRequest> get serializer => _$CancelDeliveryRequestSerializer();
|
||||
}
|
||||
|
||||
class _$CancelDeliveryRequestSerializer implements PrimitiveSerializer<CancelDeliveryRequest> {
|
||||
@override
|
||||
final Iterable<Type> types = const [CancelDeliveryRequest, _$CancelDeliveryRequest];
|
||||
|
||||
@override
|
||||
final String wireName = r'CancelDeliveryRequest';
|
||||
|
||||
Iterable<Object?> _serializeProperties(
|
||||
Serializers serializers,
|
||||
CancelDeliveryRequest object, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) sync* {
|
||||
yield r'reason';
|
||||
yield serializers.serialize(
|
||||
object.reason,
|
||||
specifiedType: const FullType(String),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Object serialize(
|
||||
Serializers serializers,
|
||||
CancelDeliveryRequest object, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) {
|
||||
return _serializeProperties(serializers, object, specifiedType: specifiedType).toList();
|
||||
}
|
||||
|
||||
void _deserializeProperties(
|
||||
Serializers serializers,
|
||||
Object serialized, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
required List<Object?> serializedList,
|
||||
required CancelDeliveryRequestBuilder result,
|
||||
required List<Object?> unhandled,
|
||||
}) {
|
||||
for (var i = 0; i < serializedList.length; i += 2) {
|
||||
final key = serializedList[i] as String;
|
||||
final value = serializedList[i + 1];
|
||||
switch (key) {
|
||||
case r'reason':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(String),
|
||||
) as String;
|
||||
result.reason = valueDes;
|
||||
break;
|
||||
default:
|
||||
unhandled.add(key);
|
||||
unhandled.add(value);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
CancelDeliveryRequest deserialize(
|
||||
Serializers serializers,
|
||||
Object serialized, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) {
|
||||
final result = CancelDeliveryRequestBuilder();
|
||||
final serializedList = (serialized as Iterable<Object?>).toList();
|
||||
final unhandled = <Object?>[];
|
||||
_deserializeProperties(
|
||||
serializers,
|
||||
serialized,
|
||||
specifiedType: specifiedType,
|
||||
serializedList: serializedList,
|
||||
unhandled: unhandled,
|
||||
result: result,
|
||||
);
|
||||
return result.build();
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,94 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'cancel_delivery_request.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// BuiltValueGenerator
|
||||
// **************************************************************************
|
||||
|
||||
class _$CancelDeliveryRequest extends CancelDeliveryRequest {
|
||||
@override
|
||||
final String reason;
|
||||
|
||||
factory _$CancelDeliveryRequest(
|
||||
[void Function(CancelDeliveryRequestBuilder)? updates]) =>
|
||||
(CancelDeliveryRequestBuilder()..update(updates))._build();
|
||||
|
||||
_$CancelDeliveryRequest._({required this.reason}) : super._();
|
||||
@override
|
||||
CancelDeliveryRequest rebuild(
|
||||
void Function(CancelDeliveryRequestBuilder) updates) =>
|
||||
(toBuilder()..update(updates)).build();
|
||||
|
||||
@override
|
||||
CancelDeliveryRequestBuilder toBuilder() =>
|
||||
CancelDeliveryRequestBuilder()..replace(this);
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
if (identical(other, this)) return true;
|
||||
return other is CancelDeliveryRequest && reason == other.reason;
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode {
|
||||
var _$hash = 0;
|
||||
_$hash = $jc(_$hash, reason.hashCode);
|
||||
_$hash = $jf(_$hash);
|
||||
return _$hash;
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return (newBuiltValueToStringHelper(r'CancelDeliveryRequest')
|
||||
..add('reason', reason))
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
||||
class CancelDeliveryRequestBuilder
|
||||
implements Builder<CancelDeliveryRequest, CancelDeliveryRequestBuilder> {
|
||||
_$CancelDeliveryRequest? _$v;
|
||||
|
||||
String? _reason;
|
||||
String? get reason => _$this._reason;
|
||||
set reason(String? reason) => _$this._reason = reason;
|
||||
|
||||
CancelDeliveryRequestBuilder() {
|
||||
CancelDeliveryRequest._defaults(this);
|
||||
}
|
||||
|
||||
CancelDeliveryRequestBuilder get _$this {
|
||||
final $v = _$v;
|
||||
if ($v != null) {
|
||||
_reason = $v.reason;
|
||||
_$v = null;
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@override
|
||||
void replace(CancelDeliveryRequest other) {
|
||||
_$v = other as _$CancelDeliveryRequest;
|
||||
}
|
||||
|
||||
@override
|
||||
void update(void Function(CancelDeliveryRequestBuilder)? updates) {
|
||||
if (updates != null) updates(this);
|
||||
}
|
||||
|
||||
@override
|
||||
CancelDeliveryRequest build() => _build();
|
||||
|
||||
_$CancelDeliveryRequest _build() {
|
||||
final _$result = _$v ??
|
||||
_$CancelDeliveryRequest._(
|
||||
reason: BuiltValueNullFieldError.checkNotNull(
|
||||
reason, r'CancelDeliveryRequest', 'reason'),
|
||||
);
|
||||
replace(_$result);
|
||||
return _$result;
|
||||
}
|
||||
}
|
||||
|
||||
// ignore_for_file: deprecated_member_use_from_same_package,type=lint
|
||||
155
packages/holzleitner_api/lib/src/model/car.dart
Normal file
155
packages/holzleitner_api/lib/src/model/car.dart
Normal file
@ -0,0 +1,155 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
|
||||
// ignore_for_file: unused_element
|
||||
import 'package:built_value/built_value.dart';
|
||||
import 'package:built_value/serializer.dart';
|
||||
|
||||
part 'car.g.dart';
|
||||
|
||||
/// Fahrzeug eines [`crate::domain::Account`]. Wird in der App selbst gepflegt — kein ERP-Spiegel. Eindeutig per UUID. Im Audit-Log ist der `Car` der „Akteur\": die Personalnummer-Ebene (Account) ist gröber und unterscheidet nicht zwischen mehreren gleichzeitig aktiven Fahrern desselben Subunternehmens.
|
||||
///
|
||||
/// Properties:
|
||||
/// * [accountId] - Verweis auf [`crate::domain::Account::personalnummer`].
|
||||
/// * [active]
|
||||
/// * [id]
|
||||
/// * [plate]
|
||||
@BuiltValue()
|
||||
abstract class Car implements Built<Car, CarBuilder> {
|
||||
/// Verweis auf [`crate::domain::Account::personalnummer`].
|
||||
@BuiltValueField(wireName: r'accountId')
|
||||
int get accountId;
|
||||
|
||||
@BuiltValueField(wireName: r'active')
|
||||
bool get active;
|
||||
|
||||
@BuiltValueField(wireName: r'id')
|
||||
String get id;
|
||||
|
||||
@BuiltValueField(wireName: r'plate')
|
||||
String get plate;
|
||||
|
||||
Car._();
|
||||
|
||||
factory Car([void updates(CarBuilder b)]) = _$Car;
|
||||
|
||||
@BuiltValueHook(initializeBuilder: true)
|
||||
static void _defaults(CarBuilder b) => b;
|
||||
|
||||
@BuiltValueSerializer(custom: true)
|
||||
static Serializer<Car> get serializer => _$CarSerializer();
|
||||
}
|
||||
|
||||
class _$CarSerializer implements PrimitiveSerializer<Car> {
|
||||
@override
|
||||
final Iterable<Type> types = const [Car, _$Car];
|
||||
|
||||
@override
|
||||
final String wireName = r'Car';
|
||||
|
||||
Iterable<Object?> _serializeProperties(
|
||||
Serializers serializers,
|
||||
Car object, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) sync* {
|
||||
yield r'accountId';
|
||||
yield serializers.serialize(
|
||||
object.accountId,
|
||||
specifiedType: const FullType(int),
|
||||
);
|
||||
yield r'active';
|
||||
yield serializers.serialize(
|
||||
object.active,
|
||||
specifiedType: const FullType(bool),
|
||||
);
|
||||
yield r'id';
|
||||
yield serializers.serialize(
|
||||
object.id,
|
||||
specifiedType: const FullType(String),
|
||||
);
|
||||
yield r'plate';
|
||||
yield serializers.serialize(
|
||||
object.plate,
|
||||
specifiedType: const FullType(String),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Object serialize(
|
||||
Serializers serializers,
|
||||
Car object, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) {
|
||||
return _serializeProperties(serializers, object, specifiedType: specifiedType).toList();
|
||||
}
|
||||
|
||||
void _deserializeProperties(
|
||||
Serializers serializers,
|
||||
Object serialized, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
required List<Object?> serializedList,
|
||||
required CarBuilder result,
|
||||
required List<Object?> unhandled,
|
||||
}) {
|
||||
for (var i = 0; i < serializedList.length; i += 2) {
|
||||
final key = serializedList[i] as String;
|
||||
final value = serializedList[i + 1];
|
||||
switch (key) {
|
||||
case r'accountId':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(int),
|
||||
) as int;
|
||||
result.accountId = valueDes;
|
||||
break;
|
||||
case r'active':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(bool),
|
||||
) as bool;
|
||||
result.active = valueDes;
|
||||
break;
|
||||
case r'id':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(String),
|
||||
) as String;
|
||||
result.id = valueDes;
|
||||
break;
|
||||
case r'plate':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(String),
|
||||
) as String;
|
||||
result.plate = valueDes;
|
||||
break;
|
||||
default:
|
||||
unhandled.add(key);
|
||||
unhandled.add(value);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Car deserialize(
|
||||
Serializers serializers,
|
||||
Object serialized, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) {
|
||||
final result = CarBuilder();
|
||||
final serializedList = (serialized as Iterable<Object?>).toList();
|
||||
final unhandled = <Object?>[];
|
||||
_deserializeProperties(
|
||||
serializers,
|
||||
serialized,
|
||||
specifiedType: specifiedType,
|
||||
serializedList: serializedList,
|
||||
unhandled: unhandled,
|
||||
result: result,
|
||||
);
|
||||
return result.build();
|
||||
}
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user