83 lines
1.9 KiB
Dart
83 lines
1.9 KiB
Dart
enum ComplianceState { verified, pending, missing }
|
|
|
|
extension ComplianceStateX on ComplianceState {
|
|
String get label => switch (this) {
|
|
ComplianceState.verified => 'Verified',
|
|
ComplianceState.pending => 'Pending',
|
|
ComplianceState.missing => 'Missing',
|
|
};
|
|
}
|
|
|
|
/// A single thing a business must see before you can work: a document, a
|
|
/// certificate, a tax form or a piece of attire.
|
|
class ComplianceItem {
|
|
ComplianceItem({
|
|
required this.id,
|
|
required this.title,
|
|
required this.subtitle,
|
|
required this.state,
|
|
this.statusLabel,
|
|
this.fileName,
|
|
this.fileMeta,
|
|
this.expires,
|
|
this.required_ = true,
|
|
});
|
|
|
|
final String id;
|
|
final String title;
|
|
final String subtitle;
|
|
final ComplianceState state;
|
|
final String? statusLabel;
|
|
final String? fileName;
|
|
final String? fileMeta;
|
|
final DateTime? expires;
|
|
final bool required_;
|
|
|
|
String get badge => statusLabel ?? state.label;
|
|
|
|
ComplianceItem copyWith({
|
|
ComplianceState? state,
|
|
String? statusLabel,
|
|
String? fileName,
|
|
String? fileMeta,
|
|
DateTime? expires,
|
|
bool clearFile = false,
|
|
}) => ComplianceItem(
|
|
id: id,
|
|
title: title,
|
|
subtitle: subtitle,
|
|
state: state ?? this.state,
|
|
statusLabel: statusLabel ?? this.statusLabel,
|
|
fileName: clearFile ? null : (fileName ?? this.fileName),
|
|
fileMeta: clearFile ? null : (fileMeta ?? this.fileMeta),
|
|
expires: expires ?? this.expires,
|
|
required_: required_,
|
|
);
|
|
}
|
|
|
|
class EmergencyContact {
|
|
EmergencyContact({
|
|
required this.name,
|
|
required this.phone,
|
|
required this.relationship,
|
|
});
|
|
|
|
final String name;
|
|
final String phone;
|
|
final String relationship;
|
|
}
|
|
|
|
class BankAccount {
|
|
BankAccount({
|
|
required this.bankName,
|
|
required this.routing,
|
|
required this.accountLast4,
|
|
required this.accountType,
|
|
});
|
|
|
|
final String bankName;
|
|
final String routing;
|
|
final String accountLast4;
|
|
final String accountType;
|
|
}
|