LCOV - code coverage report
Current view: top level - lib/_classes/integration - integration_record.dart Coverage Total Hit
Test: lcov.info Lines: 0.0 % 6 0
Test Date: 2026-11-14 15:08:11 Functions: - 0 0

            Line data    Source code
       1              : // Copyright 2026 The terCAD team. All rights reserved.
       2              : // Use of this source code is governed by a CC BY-NC-ND 4.0 license that can be found in the LICENSE file.
       3              : 
       4              : import 'package:app_finance/_classes/structure/bill_app_data.dart';
       5              : import 'package:app_finance/_classes/structure/interface_app_data.dart';
       6              : import 'package:app_finance/_classes/structure/invoice_app_data.dart';
       7              : import 'package:flutter_currency_picker/flutter_currency_picker.dart';
       8              : 
       9              : typedef IntegrationImportResult = ({int added, int skipped, int pending});
      10              : 
      11              : class IntegrationRecord {
      12            0 :   static InterfaceAppData toAppData({
      13              :     required double amount,
      14              :     required String? currency,
      15              :     required DateTime date,
      16              :     required String title,
      17              :     required String account,
      18              :     required String category,
      19              :   }) {
      20            0 :     final code = currency != null ? CurrencyProvider.find(currency) : null;
      21            0 :     if (amount < 0) {
      22            0 :       return BillAppData(
      23              :         account: account,
      24              :         category: category,
      25              :         title: title,
      26            0 :         details: amount.abs(),
      27              :         currency: code,
      28              :         createdAt: date,
      29              :         updatedAt: date,
      30              :         hidden: false,
      31              :       );
      32              :     }
      33            0 :     return InvoiceAppData(
      34              :       account: account,
      35              :       title: title,
      36              :       details: amount,
      37              :       currency: code,
      38              :       createdAt: date,
      39              :       updatedAt: date,
      40              :       hidden: false,
      41              :     );
      42              :   }
      43              : }
        

Generated by: LCOV version 2.0-1