64 lines
1.6 KiB
Dart
64 lines
1.6 KiB
Dart
import 'package:pshared/models/describable.dart';
|
|
import 'package:pshared/models/ledger/balance.dart';
|
|
|
|
|
|
class LedgerAccount implements Describable {
|
|
final String ledgerAccountRef;
|
|
final String organizationRef;
|
|
final String? ownerRef;
|
|
final String accountCode;
|
|
final String accountType;
|
|
final String currency;
|
|
final String status;
|
|
final bool allowNegative;
|
|
final bool isSettlement;
|
|
final Map<String, String>? metadata;
|
|
final DateTime? createdAt;
|
|
final DateTime? updatedAt;
|
|
final Describable describable;
|
|
final LedgerBalance? balance;
|
|
|
|
@override
|
|
String get name => describable.name;
|
|
|
|
@override
|
|
String? get description => describable.description;
|
|
|
|
const LedgerAccount({
|
|
required this.ledgerAccountRef,
|
|
required this.organizationRef,
|
|
this.ownerRef,
|
|
required this.accountCode,
|
|
required this.accountType,
|
|
required this.currency,
|
|
required this.status,
|
|
required this.allowNegative,
|
|
required this.isSettlement,
|
|
this.metadata,
|
|
this.createdAt,
|
|
this.updatedAt,
|
|
required this.describable,
|
|
this.balance,
|
|
});
|
|
|
|
LedgerAccount copyWith({
|
|
Describable? describable,
|
|
LedgerBalance? balance,
|
|
}) => LedgerAccount(
|
|
ledgerAccountRef: ledgerAccountRef,
|
|
organizationRef: organizationRef,
|
|
ownerRef: ownerRef,
|
|
accountCode: accountCode,
|
|
accountType: accountType,
|
|
currency: currency,
|
|
status: status,
|
|
allowNegative: allowNegative,
|
|
isSettlement: isSettlement,
|
|
metadata: metadata,
|
|
createdAt: createdAt,
|
|
updatedAt: updatedAt,
|
|
describable: describable ?? this.describable,
|
|
balance: balance ?? this.balance,
|
|
);
|
|
}
|