autoApprove method
Implementation
RemoteDto autoApprove(RemoteDto lRemoteDto, WardenType lWardenType) {
if (lWardenType != WardenType.USER)
throw ArgumentError("Can only Auto Approve User");
if (lRemoteDto.trDto.operation != OperationType.INSERT)
throw ArgumentError("Can only Auto Approve Inserts");
if (autoApproveTables.contains(lRemoteDto.waterLineDto!.water_table_id)) {
lRemoteDto.waterLineDto!.water_state = WaterState.SERVER_APPROVED;
// Change ts to null so that server will use the latest ts
lRemoteDto.trDto.ts = null;
// Set id to null so that we generate an Id
lRemoteDto.trDto.set('id', null);
return lRemoteDto;
}
throw ArgumentError("No tables found to Approve");
}