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';

@JsonSerializable()
class CreateLedgerAccountRequest {
  final Map<String, String>? metadata;
  final String currency;
  final bool allowNegative;
  final LedgerAccountRoleDTO role;
  final DescribableDTO describable;
  final String? ownerRef;
  final LedgerAccountTypeDTO accountType;

  const CreateLedgerAccountRequest({
    this.metadata,
    required this.currency,
    required this.allowNegative,
    required this.role,
    required this.describable,
    required this.accountType,
    this.ownerRef,
  });

  factory CreateLedgerAccountRequest.fromJson(Map<String, dynamic> json) =>
      _$CreateLedgerAccountRequestFromJson(json);
  Map<String, dynamic> toJson() => _$CreateLedgerAccountRequestToJson(this);
}
