front dev update
This commit is contained in:
@@ -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,
|
||||
|
||||
19
frontend/pshared/lib/api/responses/cursor_page.dart
Normal file
19
frontend/pshared/lib/api/responses/cursor_page.dart
Normal 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);
|
||||
}
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user