front dev update

This commit is contained in:
Stephan D
2026-01-30 16:54:56 +01:00
parent 51f5b0804a
commit 102c5d3668
31 changed files with 755 additions and 74 deletions

View File

@@ -1,6 +1,7 @@
import 'package:json_annotation/json_annotation.dart';
import 'package:pshared/data/dto/describable.dart';
import 'package:pshared/data/dto/ledger/role.dart';
import 'package:pshared/data/dto/ledger/type.dart';
part 'create.g.dart';
@@ -11,7 +12,7 @@ class CreateLedgerAccountRequest {
final Map<String, String>? metadata;
final String currency;
final bool allowNegative;
final bool isSettlement;
final LedgerAccountRoleDTO role;
final DescribableDTO describable;
final String? ownerRef;
final LedgerAccountTypeDTO accountType;
@@ -20,7 +21,7 @@ class CreateLedgerAccountRequest {
this.metadata,
required this.currency,
required this.allowNegative,
required this.isSettlement,
required this.role,
required this.describable,
required this.accountType,
this.ownerRef,

View File

@@ -0,0 +1,19 @@
import 'package:json_annotation/json_annotation.dart';
import 'package:pshared/api/responses/base.dart';
import 'package:pshared/api/responses/token.dart';
part 'cursor_page.g.dart';
@JsonSerializable(explicitToJson: true)
class CursorPageResponse extends BaseAuthorizedResponse {
@JsonKey(name: 'next_cursor')
final String? nextCursor;
const CursorPageResponse({required super.accessToken, required this.nextCursor});
factory CursorPageResponse.fromJson(Map<String, dynamic> json) => _$CursorPageResponseFromJson(json);
@override
Map<String, dynamic> toJson() => _$CursorPageResponseToJson(this);
}

View File

@@ -1,6 +1,6 @@
import 'package:json_annotation/json_annotation.dart';
import 'package:pshared/api/responses/base.dart';
import 'package:pshared/api/responses/cursor_page.dart';
import 'package:pshared/api/responses/token.dart';
import 'package:pshared/data/dto/payment/payment.dart';
@@ -8,11 +8,14 @@ part 'payments.g.dart';
@JsonSerializable(explicitToJson: true)
class PaymentsResponse extends BaseAuthorizedResponse {
class PaymentsResponse extends CursorPageResponse {
final List<PaymentDTO> payments;
const PaymentsResponse({required super.accessToken, required this.payments});
const PaymentsResponse({
required super.accessToken,
required super.nextCursor,
required this.payments,
});
factory PaymentsResponse.fromJson(Map<String, dynamic> json) => _$PaymentsResponseFromJson(json);
@override