mnemo_cards/mnemo_cards_backend/lib/api/purchase/payment_extension.dart
Dmitry 550b56276e
Some checks are pending
Backend CI / test (push) Waiting to run
Backend CI / build (push) Blocked by required conditions
Mobile App CI / test (push) Waiting to run
Mobile App CI / build-android (push) Blocked by required conditions
Mobile App CI / build-ios (push) Blocked by required conditions
Web App CI / test (push) Waiting to run
Web App CI / build (push) Blocked by required conditions
Deploy Mnemo Cards / Deploy Backend (push) Waiting to run
Deploy Mnemo Cards / Deploy Web App (push) Blocked by required conditions
Deploy Mnemo Cards / Final Verification (push) Blocked by required conditions
Deploy Telegram Bot / Deploy Telegram Bot (push) Waiting to run
postgress fix
2025-12-13 23:55:50 +03:00

20 lines
569 B
Dart

import 'package:mnemo_cards_common_backend/mnemo_cards_common_backend.dart';
import 'package:mnemo_cards_common/mnemo_cards_common.dart';
extension PaymentExt on PaymentModel {
PaymentDto toDto({
bool withToken = false,
bool withMeta = false,
}) {
return PaymentDto(
amount: amount,
currency: currency,
status: status,
date: date,
paymentSystem: paymentSystem,
products: products.map((p) => p.toDto()).toList(),
externalToken: withToken ? externalToken : null,
meta: withMeta ? meta : null,
);
}
}