diff options
| author | ST-DDT <[email protected]> | 2024-12-11 20:40:15 +0100 |
|---|---|---|
| committer | GitHub <[email protected]> | 2024-12-11 20:40:15 +0100 |
| commit | 5ec4a6c9ddc037ae189ee93f339fa52065ac2a26 (patch) | |
| tree | e0f790194ed26dd11648fd4faefe14176228b91d /src/modules | |
| parent | 4b4bac373c0cf22efff343261c6e9abe458f5ccd (diff) | |
| download | faker-5ec4a6c9ddc037ae189ee93f339fa52065ac2a26.tar.xz faker-5ec4a6c9ddc037ae189ee93f339fa52065ac2a26.zip | |
feat(finance): use fake patterns for transactionDescription (#3202)
Diffstat (limited to 'src/modules')
| -rw-r--r-- | src/modules/finance/index.ts | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/src/modules/finance/index.ts b/src/modules/finance/index.ts index 656872b7..cc406808 100644 --- a/src/modules/finance/index.ts +++ b/src/modules/finance/index.ts @@ -969,18 +969,13 @@ export class FinanceModule extends ModuleBase { * * @example * faker.finance.transactionDescription() - * // 'invoice transaction at Kilback - Durgan using card ending with ************4316 for UAH 783.82 in account ***16168663' + * // 'payment transaction at Emard LLC using card ending with ****9187 for HNL 506.57 in account ***2584.' * * @since 5.1.0 */ transactionDescription(): string { - const amount = this.amount(); - const company = this.faker.company.name(); - const transactionType = this.transactionType(); - const account = this.accountNumber(); - const card = this.creditCardNumber().replaceAll(/.(?=.{4})/g, '*'); - const currency = this.currencyCode(); - - return `${transactionType} transaction at ${company} using card ending with ${card} for ${currency} ${amount} in account ***${account}`; + return this.faker.helpers.fake( + this.faker.definitions.finance.transaction_description_pattern + ); } } |
