disconecting expiry time and savings

This commit is contained in:
José Salazar
2026-01-26 18:39:22 -05:00
parent 57ea214871
commit d67dfd6f2f
14 changed files with 16639 additions and 16551 deletions

View File

@@ -1,16 +1,16 @@
# Basic Usage # Basic Usage
```dart ```dart
ExampleConnector.instance.listBusinesses().execute(); ExampleConnector.instance.createBusiness(createBusinessVariables).execute();
ExampleConnector.instance.getBusinessesByUserId(getBusinessesByUserIdVariables).execute(); ExampleConnector.instance.updateBusiness(updateBusinessVariables).execute();
ExampleConnector.instance.getBusinessById(getBusinessByIdVariables).execute(); ExampleConnector.instance.deleteBusiness(deleteBusinessVariables).execute();
ExampleConnector.instance.createInvoice(createInvoiceVariables).execute(); ExampleConnector.instance.listCustomRateCards().execute();
ExampleConnector.instance.updateInvoice(updateInvoiceVariables).execute(); ExampleConnector.instance.getCustomRateCardById(getCustomRateCardByIdVariables).execute();
ExampleConnector.instance.deleteInvoice(deleteInvoiceVariables).execute(); ExampleConnector.instance.listClientFeedbacks(listClientFeedbacksVariables).execute();
ExampleConnector.instance.listRoles().execute(); ExampleConnector.instance.getClientFeedbackById(getClientFeedbackByIdVariables).execute();
ExampleConnector.instance.getRoleById(getRoleByIdVariables).execute(); ExampleConnector.instance.listClientFeedbacksByBusinessId(listClientFeedbacksByBusinessIdVariables).execute();
ExampleConnector.instance.listRolesByVendorId(listRolesByVendorIdVariables).execute(); ExampleConnector.instance.listClientFeedbacksByVendorId(listClientFeedbacksByVendorIdVariables).execute();
ExampleConnector.instance.listRolesByroleCategoryId(listRolesByroleCategoryIdVariables).execute(); ExampleConnector.instance.listClientFeedbacksByBusinessAndVendor(listClientFeedbacksByBusinessAndVendorVariables).execute();
``` ```
@@ -23,8 +23,8 @@ Optional fields can be discovered based on classes that have `Optional` object t
This is an example of a mutation with an optional field: This is an example of a mutation with an optional field:
```dart ```dart
await ExampleConnector.instance.UpdateAssignment({ ... }) await ExampleConnector.instance.updateActivityLog({ ... })
.title(...) .userId(...)
.execute(); .execute();
``` ```

View File

@@ -8,6 +8,7 @@ class CreateAccountVariablesBuilder {
String ownerId; String ownerId;
Optional<String> _accountNumber = Optional.optional(nativeFromJson, nativeToJson); Optional<String> _accountNumber = Optional.optional(nativeFromJson, nativeToJson);
Optional<String> _routeNumber = Optional.optional(nativeFromJson, nativeToJson); Optional<String> _routeNumber = Optional.optional(nativeFromJson, nativeToJson);
Optional<Timestamp> _expiryTime = Optional.optional((json) => json['expiryTime'] = Timestamp.fromJson(json['expiryTime']), defaultSerializer);
final FirebaseDataConnect _dataConnect; CreateAccountVariablesBuilder isPrimary(bool? t) { final FirebaseDataConnect _dataConnect; CreateAccountVariablesBuilder isPrimary(bool? t) {
_isPrimary.value = t; _isPrimary.value = t;
@@ -21,6 +22,10 @@ class CreateAccountVariablesBuilder {
_routeNumber.value = t; _routeNumber.value = t;
return this; return this;
} }
CreateAccountVariablesBuilder expiryTime(Timestamp? t) {
_expiryTime.value = t;
return this;
}
CreateAccountVariablesBuilder(this._dataConnect, {required this.bank,required this.type,required this.last4,required this.ownerId,}); CreateAccountVariablesBuilder(this._dataConnect, {required this.bank,required this.type,required this.last4,required this.ownerId,});
Deserializer<CreateAccountData> dataDeserializer = (dynamic json) => CreateAccountData.fromJson(jsonDecode(json)); Deserializer<CreateAccountData> dataDeserializer = (dynamic json) => CreateAccountData.fromJson(jsonDecode(json));
@@ -30,7 +35,7 @@ class CreateAccountVariablesBuilder {
} }
MutationRef<CreateAccountData, CreateAccountVariables> ref() { MutationRef<CreateAccountData, CreateAccountVariables> ref() {
CreateAccountVariables vars= CreateAccountVariables(bank: bank,type: type,last4: last4,isPrimary: _isPrimary,ownerId: ownerId,accountNumber: _accountNumber,routeNumber: _routeNumber,); CreateAccountVariables vars= CreateAccountVariables(bank: bank,type: type,last4: last4,isPrimary: _isPrimary,ownerId: ownerId,accountNumber: _accountNumber,routeNumber: _routeNumber,expiryTime: _expiryTime,);
return _dataConnect.mutation("createAccount", dataDeserializer, varsSerializer, vars); return _dataConnect.mutation("createAccount", dataDeserializer, varsSerializer, vars);
} }
} }
@@ -112,6 +117,7 @@ class CreateAccountVariables {
final String ownerId; final String ownerId;
late final Optional<String>accountNumber; late final Optional<String>accountNumber;
late final Optional<String>routeNumber; late final Optional<String>routeNumber;
late final Optional<Timestamp>expiryTime;
@Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.')
CreateAccountVariables.fromJson(Map<String, dynamic> json): CreateAccountVariables.fromJson(Map<String, dynamic> json):
@@ -136,6 +142,10 @@ class CreateAccountVariables {
routeNumber = Optional.optional(nativeFromJson, nativeToJson); routeNumber = Optional.optional(nativeFromJson, nativeToJson);
routeNumber.value = json['routeNumber'] == null ? null : nativeFromJson<String>(json['routeNumber']); routeNumber.value = json['routeNumber'] == null ? null : nativeFromJson<String>(json['routeNumber']);
expiryTime = Optional.optional((json) => json['expiryTime'] = Timestamp.fromJson(json['expiryTime']), defaultSerializer);
expiryTime.value = json['expiryTime'] == null ? null : Timestamp.fromJson(json['expiryTime']);
} }
@override @override
bool operator ==(Object other) { bool operator ==(Object other) {
@@ -153,11 +163,12 @@ class CreateAccountVariables {
isPrimary == otherTyped.isPrimary && isPrimary == otherTyped.isPrimary &&
ownerId == otherTyped.ownerId && ownerId == otherTyped.ownerId &&
accountNumber == otherTyped.accountNumber && accountNumber == otherTyped.accountNumber &&
routeNumber == otherTyped.routeNumber; routeNumber == otherTyped.routeNumber &&
expiryTime == otherTyped.expiryTime;
} }
@override @override
int get hashCode => Object.hashAll([bank.hashCode, type.hashCode, last4.hashCode, isPrimary.hashCode, ownerId.hashCode, accountNumber.hashCode, routeNumber.hashCode]); int get hashCode => Object.hashAll([bank.hashCode, type.hashCode, last4.hashCode, isPrimary.hashCode, ownerId.hashCode, accountNumber.hashCode, routeNumber.hashCode, expiryTime.hashCode]);
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
@@ -177,6 +188,9 @@ class CreateAccountVariables {
if(routeNumber.state == OptionalState.set) { if(routeNumber.state == OptionalState.set) {
json['routeNumber'] = routeNumber.toJson(); json['routeNumber'] = routeNumber.toJson();
} }
if(expiryTime.state == OptionalState.set) {
json['expiryTime'] = expiryTime.toJson();
}
return json; return json;
} }
@@ -188,6 +202,7 @@ class CreateAccountVariables {
required this.ownerId, required this.ownerId,
required this.accountNumber, required this.accountNumber,
required this.routeNumber, required this.routeNumber,
required this.expiryTime,
}); });
} }

View File

@@ -46,6 +46,7 @@ class FilterAccountsAccounts {
final bool? isPrimary; final bool? isPrimary;
final String ownerId; final String ownerId;
final String? accountNumber; final String? accountNumber;
final Timestamp? expiryTime;
final String? routeNumber; final String? routeNumber;
FilterAccountsAccounts.fromJson(dynamic json): FilterAccountsAccounts.fromJson(dynamic json):
@@ -56,6 +57,7 @@ class FilterAccountsAccounts {
isPrimary = json['isPrimary'] == null ? null : nativeFromJson<bool>(json['isPrimary']), isPrimary = json['isPrimary'] == null ? null : nativeFromJson<bool>(json['isPrimary']),
ownerId = nativeFromJson<String>(json['ownerId']), ownerId = nativeFromJson<String>(json['ownerId']),
accountNumber = json['accountNumber'] == null ? null : nativeFromJson<String>(json['accountNumber']), accountNumber = json['accountNumber'] == null ? null : nativeFromJson<String>(json['accountNumber']),
expiryTime = json['expiryTime'] == null ? null : Timestamp.fromJson(json['expiryTime']),
routeNumber = json['routeNumber'] == null ? null : nativeFromJson<String>(json['routeNumber']); routeNumber = json['routeNumber'] == null ? null : nativeFromJson<String>(json['routeNumber']);
@override @override
bool operator ==(Object other) { bool operator ==(Object other) {
@@ -74,11 +76,12 @@ class FilterAccountsAccounts {
isPrimary == otherTyped.isPrimary && isPrimary == otherTyped.isPrimary &&
ownerId == otherTyped.ownerId && ownerId == otherTyped.ownerId &&
accountNumber == otherTyped.accountNumber && accountNumber == otherTyped.accountNumber &&
expiryTime == otherTyped.expiryTime &&
routeNumber == otherTyped.routeNumber; routeNumber == otherTyped.routeNumber;
} }
@override @override
int get hashCode => Object.hashAll([id.hashCode, bank.hashCode, type.hashCode, last4.hashCode, isPrimary.hashCode, ownerId.hashCode, accountNumber.hashCode, routeNumber.hashCode]); int get hashCode => Object.hashAll([id.hashCode, bank.hashCode, type.hashCode, last4.hashCode, isPrimary.hashCode, ownerId.hashCode, accountNumber.hashCode, expiryTime.hashCode, routeNumber.hashCode]);
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
@@ -96,6 +99,9 @@ class FilterAccountsAccounts {
if (accountNumber != null) { if (accountNumber != null) {
json['accountNumber'] = nativeToJson<String?>(accountNumber); json['accountNumber'] = nativeToJson<String?>(accountNumber);
} }
if (expiryTime != null) {
json['expiryTime'] = expiryTime!.toJson();
}
if (routeNumber != null) { if (routeNumber != null) {
json['routeNumber'] = nativeToJson<String?>(routeNumber); json['routeNumber'] = nativeToJson<String?>(routeNumber);
} }
@@ -110,6 +116,7 @@ class FilterAccountsAccounts {
this.isPrimary, this.isPrimary,
required this.ownerId, required this.ownerId,
this.accountNumber, this.accountNumber,
this.expiryTime,
this.routeNumber, this.routeNumber,
}); });
} }

View File

@@ -27,6 +27,7 @@ class GetAccountByIdAccount {
final String ownerId; final String ownerId;
final String? accountNumber; final String? accountNumber;
final String? routeNumber; final String? routeNumber;
final Timestamp? expiryTime;
final Timestamp? createdAt; final Timestamp? createdAt;
GetAccountByIdAccount.fromJson(dynamic json): GetAccountByIdAccount.fromJson(dynamic json):
@@ -38,6 +39,7 @@ class GetAccountByIdAccount {
ownerId = nativeFromJson<String>(json['ownerId']), ownerId = nativeFromJson<String>(json['ownerId']),
accountNumber = json['accountNumber'] == null ? null : nativeFromJson<String>(json['accountNumber']), accountNumber = json['accountNumber'] == null ? null : nativeFromJson<String>(json['accountNumber']),
routeNumber = json['routeNumber'] == null ? null : nativeFromJson<String>(json['routeNumber']), routeNumber = json['routeNumber'] == null ? null : nativeFromJson<String>(json['routeNumber']),
expiryTime = json['expiryTime'] == null ? null : Timestamp.fromJson(json['expiryTime']),
createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']); createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']);
@override @override
bool operator ==(Object other) { bool operator ==(Object other) {
@@ -57,11 +59,12 @@ class GetAccountByIdAccount {
ownerId == otherTyped.ownerId && ownerId == otherTyped.ownerId &&
accountNumber == otherTyped.accountNumber && accountNumber == otherTyped.accountNumber &&
routeNumber == otherTyped.routeNumber && routeNumber == otherTyped.routeNumber &&
expiryTime == otherTyped.expiryTime &&
createdAt == otherTyped.createdAt; createdAt == otherTyped.createdAt;
} }
@override @override
int get hashCode => Object.hashAll([id.hashCode, bank.hashCode, type.hashCode, last4.hashCode, isPrimary.hashCode, ownerId.hashCode, accountNumber.hashCode, routeNumber.hashCode, createdAt.hashCode]); int get hashCode => Object.hashAll([id.hashCode, bank.hashCode, type.hashCode, last4.hashCode, isPrimary.hashCode, ownerId.hashCode, accountNumber.hashCode, routeNumber.hashCode, expiryTime.hashCode, createdAt.hashCode]);
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
@@ -82,6 +85,9 @@ class GetAccountByIdAccount {
if (routeNumber != null) { if (routeNumber != null) {
json['routeNumber'] = nativeToJson<String?>(routeNumber); json['routeNumber'] = nativeToJson<String?>(routeNumber);
} }
if (expiryTime != null) {
json['expiryTime'] = expiryTime!.toJson();
}
if (createdAt != null) { if (createdAt != null) {
json['createdAt'] = createdAt!.toJson(); json['createdAt'] = createdAt!.toJson();
} }
@@ -97,6 +103,7 @@ class GetAccountByIdAccount {
required this.ownerId, required this.ownerId,
this.accountNumber, this.accountNumber,
this.routeNumber, this.routeNumber,
this.expiryTime,
this.createdAt, this.createdAt,
}); });
} }

View File

@@ -27,6 +27,7 @@ class GetAccountsByOwnerIdAccounts {
final String ownerId; final String ownerId;
final String? accountNumber; final String? accountNumber;
final String? routeNumber; final String? routeNumber;
final Timestamp? expiryTime;
final Timestamp? createdAt; final Timestamp? createdAt;
GetAccountsByOwnerIdAccounts.fromJson(dynamic json): GetAccountsByOwnerIdAccounts.fromJson(dynamic json):
@@ -38,6 +39,7 @@ class GetAccountsByOwnerIdAccounts {
ownerId = nativeFromJson<String>(json['ownerId']), ownerId = nativeFromJson<String>(json['ownerId']),
accountNumber = json['accountNumber'] == null ? null : nativeFromJson<String>(json['accountNumber']), accountNumber = json['accountNumber'] == null ? null : nativeFromJson<String>(json['accountNumber']),
routeNumber = json['routeNumber'] == null ? null : nativeFromJson<String>(json['routeNumber']), routeNumber = json['routeNumber'] == null ? null : nativeFromJson<String>(json['routeNumber']),
expiryTime = json['expiryTime'] == null ? null : Timestamp.fromJson(json['expiryTime']),
createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']); createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']);
@override @override
bool operator ==(Object other) { bool operator ==(Object other) {
@@ -57,11 +59,12 @@ class GetAccountsByOwnerIdAccounts {
ownerId == otherTyped.ownerId && ownerId == otherTyped.ownerId &&
accountNumber == otherTyped.accountNumber && accountNumber == otherTyped.accountNumber &&
routeNumber == otherTyped.routeNumber && routeNumber == otherTyped.routeNumber &&
expiryTime == otherTyped.expiryTime &&
createdAt == otherTyped.createdAt; createdAt == otherTyped.createdAt;
} }
@override @override
int get hashCode => Object.hashAll([id.hashCode, bank.hashCode, type.hashCode, last4.hashCode, isPrimary.hashCode, ownerId.hashCode, accountNumber.hashCode, routeNumber.hashCode, createdAt.hashCode]); int get hashCode => Object.hashAll([id.hashCode, bank.hashCode, type.hashCode, last4.hashCode, isPrimary.hashCode, ownerId.hashCode, accountNumber.hashCode, routeNumber.hashCode, expiryTime.hashCode, createdAt.hashCode]);
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
@@ -82,6 +85,9 @@ class GetAccountsByOwnerIdAccounts {
if (routeNumber != null) { if (routeNumber != null) {
json['routeNumber'] = nativeToJson<String?>(routeNumber); json['routeNumber'] = nativeToJson<String?>(routeNumber);
} }
if (expiryTime != null) {
json['expiryTime'] = expiryTime!.toJson();
}
if (createdAt != null) { if (createdAt != null) {
json['createdAt'] = createdAt!.toJson(); json['createdAt'] = createdAt!.toJson();
} }
@@ -97,6 +103,7 @@ class GetAccountsByOwnerIdAccounts {
required this.ownerId, required this.ownerId,
this.accountNumber, this.accountNumber,
this.routeNumber, this.routeNumber,
this.expiryTime,
this.createdAt, this.createdAt,
}); });
} }

View File

@@ -26,6 +26,7 @@ class ListAccountsAccounts {
final String ownerId; final String ownerId;
final String? accountNumber; final String? accountNumber;
final String? routeNumber; final String? routeNumber;
final Timestamp? expiryTime;
final Timestamp? createdAt; final Timestamp? createdAt;
ListAccountsAccounts.fromJson(dynamic json): ListAccountsAccounts.fromJson(dynamic json):
@@ -37,6 +38,7 @@ class ListAccountsAccounts {
ownerId = nativeFromJson<String>(json['ownerId']), ownerId = nativeFromJson<String>(json['ownerId']),
accountNumber = json['accountNumber'] == null ? null : nativeFromJson<String>(json['accountNumber']), accountNumber = json['accountNumber'] == null ? null : nativeFromJson<String>(json['accountNumber']),
routeNumber = json['routeNumber'] == null ? null : nativeFromJson<String>(json['routeNumber']), routeNumber = json['routeNumber'] == null ? null : nativeFromJson<String>(json['routeNumber']),
expiryTime = json['expiryTime'] == null ? null : Timestamp.fromJson(json['expiryTime']),
createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']); createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']);
@override @override
bool operator ==(Object other) { bool operator ==(Object other) {
@@ -56,11 +58,12 @@ class ListAccountsAccounts {
ownerId == otherTyped.ownerId && ownerId == otherTyped.ownerId &&
accountNumber == otherTyped.accountNumber && accountNumber == otherTyped.accountNumber &&
routeNumber == otherTyped.routeNumber && routeNumber == otherTyped.routeNumber &&
expiryTime == otherTyped.expiryTime &&
createdAt == otherTyped.createdAt; createdAt == otherTyped.createdAt;
} }
@override @override
int get hashCode => Object.hashAll([id.hashCode, bank.hashCode, type.hashCode, last4.hashCode, isPrimary.hashCode, ownerId.hashCode, accountNumber.hashCode, routeNumber.hashCode, createdAt.hashCode]); int get hashCode => Object.hashAll([id.hashCode, bank.hashCode, type.hashCode, last4.hashCode, isPrimary.hashCode, ownerId.hashCode, accountNumber.hashCode, routeNumber.hashCode, expiryTime.hashCode, createdAt.hashCode]);
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
@@ -81,6 +84,9 @@ class ListAccountsAccounts {
if (routeNumber != null) { if (routeNumber != null) {
json['routeNumber'] = nativeToJson<String?>(routeNumber); json['routeNumber'] = nativeToJson<String?>(routeNumber);
} }
if (expiryTime != null) {
json['expiryTime'] = expiryTime!.toJson();
}
if (createdAt != null) { if (createdAt != null) {
json['createdAt'] = createdAt!.toJson(); json['createdAt'] = createdAt!.toJson();
} }
@@ -96,6 +102,7 @@ class ListAccountsAccounts {
required this.ownerId, required this.ownerId,
this.accountNumber, this.accountNumber,
this.routeNumber, this.routeNumber,
this.expiryTime,
this.createdAt, this.createdAt,
}); });
} }

View File

@@ -8,6 +8,7 @@ class UpdateAccountVariablesBuilder {
Optional<bool> _isPrimary = Optional.optional(nativeFromJson, nativeToJson); Optional<bool> _isPrimary = Optional.optional(nativeFromJson, nativeToJson);
Optional<String> _accountNumber = Optional.optional(nativeFromJson, nativeToJson); Optional<String> _accountNumber = Optional.optional(nativeFromJson, nativeToJson);
Optional<String> _routeNumber = Optional.optional(nativeFromJson, nativeToJson); Optional<String> _routeNumber = Optional.optional(nativeFromJson, nativeToJson);
Optional<Timestamp> _expiryTime = Optional.optional((json) => json['expiryTime'] = Timestamp.fromJson(json['expiryTime']), defaultSerializer);
final FirebaseDataConnect _dataConnect; UpdateAccountVariablesBuilder bank(String? t) { final FirebaseDataConnect _dataConnect; UpdateAccountVariablesBuilder bank(String? t) {
_bank.value = t; _bank.value = t;
@@ -33,6 +34,10 @@ class UpdateAccountVariablesBuilder {
_routeNumber.value = t; _routeNumber.value = t;
return this; return this;
} }
UpdateAccountVariablesBuilder expiryTime(Timestamp? t) {
_expiryTime.value = t;
return this;
}
UpdateAccountVariablesBuilder(this._dataConnect, {required this.id,}); UpdateAccountVariablesBuilder(this._dataConnect, {required this.id,});
Deserializer<UpdateAccountData> dataDeserializer = (dynamic json) => UpdateAccountData.fromJson(jsonDecode(json)); Deserializer<UpdateAccountData> dataDeserializer = (dynamic json) => UpdateAccountData.fromJson(jsonDecode(json));
@@ -42,7 +47,7 @@ class UpdateAccountVariablesBuilder {
} }
MutationRef<UpdateAccountData, UpdateAccountVariables> ref() { MutationRef<UpdateAccountData, UpdateAccountVariables> ref() {
UpdateAccountVariables vars= UpdateAccountVariables(id: id,bank: _bank,type: _type,last4: _last4,isPrimary: _isPrimary,accountNumber: _accountNumber,routeNumber: _routeNumber,); UpdateAccountVariables vars= UpdateAccountVariables(id: id,bank: _bank,type: _type,last4: _last4,isPrimary: _isPrimary,accountNumber: _accountNumber,routeNumber: _routeNumber,expiryTime: _expiryTime,);
return _dataConnect.mutation("updateAccount", dataDeserializer, varsSerializer, vars); return _dataConnect.mutation("updateAccount", dataDeserializer, varsSerializer, vars);
} }
} }
@@ -126,6 +131,7 @@ class UpdateAccountVariables {
late final Optional<bool>isPrimary; late final Optional<bool>isPrimary;
late final Optional<String>accountNumber; late final Optional<String>accountNumber;
late final Optional<String>routeNumber; late final Optional<String>routeNumber;
late final Optional<Timestamp>expiryTime;
@Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.')
UpdateAccountVariables.fromJson(Map<String, dynamic> json): UpdateAccountVariables.fromJson(Map<String, dynamic> json):
@@ -156,6 +162,10 @@ class UpdateAccountVariables {
routeNumber = Optional.optional(nativeFromJson, nativeToJson); routeNumber = Optional.optional(nativeFromJson, nativeToJson);
routeNumber.value = json['routeNumber'] == null ? null : nativeFromJson<String>(json['routeNumber']); routeNumber.value = json['routeNumber'] == null ? null : nativeFromJson<String>(json['routeNumber']);
expiryTime = Optional.optional((json) => json['expiryTime'] = Timestamp.fromJson(json['expiryTime']), defaultSerializer);
expiryTime.value = json['expiryTime'] == null ? null : Timestamp.fromJson(json['expiryTime']);
} }
@override @override
bool operator ==(Object other) { bool operator ==(Object other) {
@@ -173,11 +183,12 @@ class UpdateAccountVariables {
last4 == otherTyped.last4 && last4 == otherTyped.last4 &&
isPrimary == otherTyped.isPrimary && isPrimary == otherTyped.isPrimary &&
accountNumber == otherTyped.accountNumber && accountNumber == otherTyped.accountNumber &&
routeNumber == otherTyped.routeNumber; routeNumber == otherTyped.routeNumber &&
expiryTime == otherTyped.expiryTime;
} }
@override @override
int get hashCode => Object.hashAll([id.hashCode, bank.hashCode, type.hashCode, last4.hashCode, isPrimary.hashCode, accountNumber.hashCode, routeNumber.hashCode]); int get hashCode => Object.hashAll([id.hashCode, bank.hashCode, type.hashCode, last4.hashCode, isPrimary.hashCode, accountNumber.hashCode, routeNumber.hashCode, expiryTime.hashCode]);
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
@@ -201,6 +212,9 @@ class UpdateAccountVariables {
if(routeNumber.state == OptionalState.set) { if(routeNumber.state == OptionalState.set) {
json['routeNumber'] = routeNumber.toJson(); json['routeNumber'] = routeNumber.toJson();
} }
if(expiryTime.state == OptionalState.set) {
json['expiryTime'] = expiryTime.toJson();
}
return json; return json;
} }
@@ -212,6 +226,7 @@ class UpdateAccountVariables {
required this.isPrimary, required this.isPrimary,
required this.accountNumber, required this.accountNumber,
required this.routeNumber, required this.routeNumber,
required this.expiryTime,
}); });
} }

View File

@@ -81,8 +81,8 @@ class BillingRepositoryImpl implements BillingRepository {
@override @override
Future<double> getSavingsAmount() async { Future<double> getSavingsAmount() async {
// Simulating savings calculation (e.g., comparing to market rates). // Simulating savings calculation (e.g., comparing to market rates).
await Future<void>.delayed(const Duration(milliseconds: 500)); await Future<void>.delayed(const Duration(milliseconds: 0));
return 320.00; return 0.0;
} }
/// Fetches the breakdown of spending. /// Fetches the breakdown of spending.

View File

@@ -48,6 +48,7 @@ class _PaymentMethodCardState extends State<PaymentMethodCard> {
final String last4 = final String last4 =
account?.last4.isNotEmpty == true ? account!.last4 : '----'; account?.last4.isNotEmpty == true ? account!.last4 : '----';
final bool isPrimary = account?.isPrimary ?? false; final bool isPrimary = account?.isPrimary ?? false;
final String expiryLabel = _formatExpiry(account?.expiryTime);
return Container( return Container(
padding: const EdgeInsets.all(UiConstants.space4), padding: const EdgeInsets.all(UiConstants.space4),
@@ -127,13 +128,13 @@ class _PaymentMethodCardState extends State<PaymentMethodCard> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Text( Text(
'•••• $last4', '•••• $last4',
style: UiTypography.body2b.textPrimary, style: UiTypography.body2b.textPrimary,
), ),
Text( Text(
t.client_billing.expires(date: '12/25'), t.client_billing.expires(date: expiryLabel),
style: UiTypography.footnote2r.textSecondary, style: UiTypography.footnote2r.textSecondary,
), ),
], ],
), ),
), ),
@@ -162,4 +163,14 @@ class _PaymentMethodCardState extends State<PaymentMethodCard> {
}, },
); );
} }
String _formatExpiry(fdc.Timestamp? expiryTime) {
if (expiryTime == null) {
return 'N/A';
}
final DateTime date = expiryTime.toDateTime();
final String month = date.month.toString().padLeft(2, '0');
final String year = (date.year % 100).toString().padLeft(2, '0');
return '$month/$year';
}
} }

View File

@@ -6,6 +6,7 @@ mutation createAccount(
$ownerId: UUID! $ownerId: UUID!
$accountNumber: String $accountNumber: String
$routeNumber: String $routeNumber: String
$expiryTime: Timestamp
) @auth(level: USER) { ) @auth(level: USER) {
account_insert( account_insert(
data: { data: {
@@ -16,6 +17,7 @@ mutation createAccount(
ownerId: $ownerId ownerId: $ownerId
accountNumber: $accountNumber accountNumber: $accountNumber
routeNumber: $routeNumber routeNumber: $routeNumber
expiryTime: $expiryTime
} }
) )
} }
@@ -28,6 +30,7 @@ mutation updateAccount(
$isPrimary: Boolean $isPrimary: Boolean
$accountNumber: String $accountNumber: String
$routeNumber: String $routeNumber: String
$expiryTime: Timestamp
) @auth(level: USER) { ) @auth(level: USER) {
account_update( account_update(
id: $id id: $id
@@ -38,6 +41,7 @@ mutation updateAccount(
isPrimary: $isPrimary isPrimary: $isPrimary
accountNumber: $accountNumber accountNumber: $accountNumber
routeNumber: $routeNumber routeNumber: $routeNumber
expiryTime: $expiryTime
} }
) )
} }

View File

@@ -8,6 +8,7 @@ query listAccounts @auth(level: USER) {
ownerId ownerId
accountNumber accountNumber
routeNumber routeNumber
expiryTime
createdAt createdAt
} }
} }
@@ -22,6 +23,7 @@ query getAccountById($id: UUID!) @auth(level: USER) {
ownerId ownerId
accountNumber accountNumber
routeNumber routeNumber
expiryTime
createdAt createdAt
} }
} }
@@ -36,6 +38,7 @@ query getAccountsByOwnerId($ownerId: UUID!) @auth(level: USER) {
ownerId ownerId
accountNumber accountNumber
routeNumber routeNumber
expiryTime
createdAt createdAt
} }
} }
@@ -61,6 +64,7 @@ query filterAccounts(
isPrimary isPrimary
ownerId ownerId
accountNumber accountNumber
expiryTime
routeNumber routeNumber
} }
} }

View File

@@ -13,6 +13,7 @@ type Account @table(name: "accounts") {
accountNumber: String accountNumber: String
routeNumber: String routeNumber: String
ownerId: UUID! #staff/business ownerId: UUID! #staff/business
expiryTime: Timestamp
createdAt: Timestamp @default(expr: "request.time") createdAt: Timestamp @default(expr: "request.time")
updatedAt: Timestamp @default(expr: "request.time") updatedAt: Timestamp @default(expr: "request.time")
createdBy: String createdBy: String