import 'package:pshared/data/dto/payment/intent/fx.dart';
import 'package:pshared/data/mapper/payment/currency_pair.dart';
import 'package:pshared/data/mapper/payment/enums.dart';
import 'package:pshared/models/payment/fx/intent.dart';


extension FxIntentMapper on FxIntent {
  FxIntentDTO toDTO() => FxIntentDTO(
    pair: pair?.toDTO(),
    side: fxSideToValue(side),
    firm: firm,
    ttlMs: ttlMs,
    preferredProvider: preferredProvider,
    maxAgeMs: maxAgeMs,
  );
}

extension FxIntentDTOMapper on FxIntentDTO {
  FxIntent toDomain() => FxIntent(
    pair: pair?.toDomain(),
    side: fxSideFromValue(side),
    firm: firm,
    ttlMs: ttlMs,
    preferredProvider: preferredProvider,
    maxAgeMs: maxAgeMs,
  );
}
