import {CardTransaction} from './types'; import {formatter, FormatType} from '../utils'; import {CommonFirestoreConverter} from '../types'; export const CardTransactionsConverter: CommonFirestoreConverter = { toFirestore() { throw new Error('please use the rawCollection to write'); }, fromFirestore(snapshot): CardTransaction { return { ...formatter>(snapshot.data(), { createdAt: FormatType.Time, updatedAt: FormatType.Time, card: FormatType.Id, user: FormatType.Id, error: FormatType.Id, feePayment: FormatType.Id, transaction: FormatType.Id, }), id: snapshot.id, }; }, };