Skip to content

Commit

Permalink
feat(finance): currency object (#1809)
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt Mayer committed Feb 26, 2023
1 parent 11a5f51 commit 59157a4
Show file tree
Hide file tree
Showing 11 changed files with 1,004 additions and 585 deletions.
21 changes: 3 additions & 18 deletions src/definitions/finance.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Currency } from '../modules/finance';
import type { LocaleEntry } from './definitions';

/**
* The possible definitions related to finance.
*/
Expand All @@ -18,27 +18,12 @@ export type FinanceDefinitions = LocaleEntry<{
credit_card: { [issuer: string]: string[] };

/**
* Currencies by their full name and their symbols (e.g. `US Dollar` -> `USD` / `$`).
* Currencies including their name, code and symbol (e.g. `US Dollar` / `USD` / `$`).
*/
currency: { [currencyName: string]: FinanceCurrencyEntryDefinitions };
currency: Currency[];

/**
* Types of transactions (e.g. `deposit`).
*/
transaction_type: string[];
}>;

/**
* The possible definitions related to currency entries.
*/
export interface FinanceCurrencyEntryDefinitions {
/**
* The code/short text/abbreviation for the currency (e.g. `USD`).
*/
code: string;

/**
* The symbol for the currency (e.g. `$`).
*/
symbol: string;
}
5 changes: 1 addition & 4 deletions src/definitions/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@ export type { CompanyDefinitions } from './company';
export type { DatabaseDefinitions } from './database';
export type { DateDefinitions, DateEntryDefinition } from './date';
export type { Definitions, LocaleDefinition } from './definitions';
export type {
FinanceCurrencyEntryDefinitions,
FinanceDefinitions,
} from './finance';
export type { FinanceDefinitions } from './finance';
export type { HackerDefinitions } from './hacker';
export type { InternetDefinitions } from './internet';
export type { LocationDefinitions } from './location';
Expand Down
3 changes: 1 addition & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ export type {
DatabaseDefinitions,
DateDefinitions,
DateEntryDefinition,
FinanceCurrencyEntryDefinitions,
FinanceDefinitions,
HackerDefinitions,
InternetDefinitions,
Expand Down Expand Up @@ -53,7 +52,7 @@ export type { CompanyModule } from './modules/company';
export type { DatabaseModule } from './modules/database';
export type { DatatypeModule } from './modules/datatype';
export type { DateModule } from './modules/date';
export type { FinanceModule } from './modules/finance';
export type { Currency, FinanceModule } from './modules/finance';
export type { GitModule } from './modules/git';
export type { HackerModule } from './modules/hacker';
export type { HelpersModule } from './modules/helpers';
Expand Down
7 changes: 4 additions & 3 deletions src/locales/el/finance/currency.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
export default {
Ευρώ: {
export default [
{
name: 'Ευρώ',
code: 'EUR',
symbol: '€',
},
};
];

0 comments on commit 59157a4

Please sign in to comment.