Skip to content

Commit

Permalink
Company and phone number
Browse files Browse the repository at this point in the history
  • Loading branch information
ogroppo committed Sep 25, 2023
1 parent a34d14a commit d3eed99
Show file tree
Hide file tree
Showing 9 changed files with 66 additions and 18 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# deverything

## 0.28.0

### Minor Changes

- company and phone number

## 0.27.1

### Patch Changes
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ These functions are optimized for low entropy random data generation useful for
-`randomArrayItem()`
- `randomBankAccount()`
- `randomBool()`
- `randomCompany()`
-`randomCoords()`
- `randomLat()`
- `randomLng()`
Expand Down Expand Up @@ -124,6 +125,7 @@ These functions are optimized for low entropy random data generation useful for
- `randomNumericId()` autoincremental process-unique id
- `randomParagraph()`
- `randomPassword()`
- `randomPhoneNumber()`
- `randomUUID()` lightweight uuid generation, passing UUID validation
- `randomWord()`

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "deverything",
"version": "0.27.1",
"version": "0.28.0",
"description": "Everything you need for Dev",
"main": "./dist/index.js",
"module": "./dist/index.mjs",
Expand Down
27 changes: 10 additions & 17 deletions src/constants/banking.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,6 @@ export const BANK_ACCOUNT_NUMBER_SAMPLES = [
"72796383",
];

export const VAT_REGISTRATION_NUMBER_SAMPLES = [
"IE1234567T",
"GB123456789",
"XI123456789",
];

export const SORT_CODE_SAMPLES = ["100000", "902127", "800551"];

export const SSN_SAMPLES = ["235-55-7216", "372-37-3976", "414-99-6488"];
Expand All @@ -71,20 +65,11 @@ export const BANK_NAME_SAMPLES = [
"Goldman Sachs Group Inc.",
];

export const COMPANY_NAME_SAMPLES = [
"Acme Inc.",
"Globex Ltd.",
"Aurora LLC",
"Serenity Systems",
"Vulcan Ventures",
"Umbrella Corp.",
];

export type BankAccount = {
abaNumber?: string;
accountHolderName: string;
accountHolderType?: "company" | "individual" | "other";
accountNumber?: string;
accountHolderType: "company" | "individual" | "other";
accountNumber: string;
accountType?: "checking" | "savings";
bankName?: string;
bsbNumber?: string;
Expand All @@ -107,6 +92,7 @@ export const UK_BANK_ACCOUNT_SAMPLES: BankAccount[] = [
bicSwift: "BARCGB22",
iban: "GB51BARC20039534871253",
sortCode: "12-34-56",
accountHolderType: "individual",
},
{
accountHolderName: "Jane Evans",
Expand All @@ -116,6 +102,7 @@ export const UK_BANK_ACCOUNT_SAMPLES: BankAccount[] = [
bicSwift: "HSBCGB2L",
iban: "GB82BARC20031847813531",
sortCode: "65-43-21",
accountHolderType: "company",
},
];

Expand All @@ -128,6 +115,7 @@ export const US_BANK_ACCOUNT_SAMPLES: BankAccount[] = [
"Bank of America Corporate Center, 100 North Tryon Street, Charlotte, NC 28255, USA",
bankName: "Bank of America Corporation",
routingNumber: "111000025",
accountHolderType: "individual",
},
{
accountHolderName: "Sally T King",
Expand All @@ -136,6 +124,7 @@ export const US_BANK_ACCOUNT_SAMPLES: BankAccount[] = [
bankAddress: "383 Madison Avenue, New York, NY 10179, USA",
bankName: "JPMorgan Chase & Co.",
routingNumber: "021000021",
accountHolderType: "company",
},
];

Expand All @@ -149,6 +138,7 @@ export const AU_BANK_ACCOUNT_SAMPLES: BankAccount[] = [
bankName: "Commonwealth Bank of Australia",
bicSwift: "CTBAAU2S",
bsbNumber: "062-000",
accountHolderType: "individual",
},
{
accountHolderName: "Jennifer Ann Brown",
Expand All @@ -158,6 +148,7 @@ export const AU_BANK_ACCOUNT_SAMPLES: BankAccount[] = [
bankName: "Westpac Banking Corporation",
bicSwift: "WPACAU2S",
bsbNumber: "032-001",
accountHolderType: "company",
},
];

Expand All @@ -171,6 +162,7 @@ export const CA_BANK_ACCOUNT_SAMPLES: BankAccount[] = [
bankName: "Royal Bank of Canada",
branchTransitNumber: "45678",
institutionNumber: "123",
accountHolderType: "individual",
},
{
accountHolderName: "Olivia Orange",
Expand All @@ -181,6 +173,7 @@ export const CA_BANK_ACCOUNT_SAMPLES: BankAccount[] = [
bankName: "Toronto-Dominion Bank",
branchTransitNumber: "65432",
institutionNumber: "987",
accountHolderType: "company",
},
];

Expand Down
19 changes: 19 additions & 0 deletions src/constants/companies.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
export const VAT_REGISTRATION_NUMBER_SAMPLES = [
"IE1234567T",
"GB123456789",
"XI123456789",
];

export const COMPANY_NAME_SAMPLES = [
"Acme Inc.",
"Globex Ltd.",
"Aurora LLC",
"Serenity Systems",
"Vulcan Ventures",
"Umbrella Corp.",
];

export type Company = {
name: string;
vatRegNumber?: string;
};
7 changes: 7 additions & 0 deletions src/constants/phoneNumbers.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export const PHONE_NUMBER_SAMPLES = [
"+44 20 7123 4567", // (United Kingdom)
"+33 1 45 67 89 10", // (France)
"+81 3 1234 5678", //(Japan)
"+61 2 9876 5432", //(Australia)
"+49 30 9876 5432", //(Germany)
];
2 changes: 2 additions & 0 deletions src/random/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ export * from "./randomAlphaNumericCode";
export * from "./randomArrayItem";
export * from "./randomBankAccount";
export * from "./randomBool";
export * from "./randomCompany";
export * from "./randomCoords";
export * from "./randomDate";
export * from "./randomEmail";
Expand All @@ -21,6 +22,7 @@ export * from "./randomIP";
export * from "./randomName";
export * from "./randomNumericCode";
export * from "./randomNumericId";
export * from "./randomPhoneNumber";
export * from "./randomParagraph";
export * from "./randomPassword";
export * from "./randomUUID";
Expand Down
13 changes: 13 additions & 0 deletions src/random/randomCompany.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import {
COMPANY_NAME_SAMPLES,
Company,
VAT_REGISTRATION_NUMBER_SAMPLES,
} from "../constants/companies";
import { randomArrayItem } from "./randomArrayItem";

export const randomCompany = (): Company => {
return {
name: randomArrayItem(COMPANY_NAME_SAMPLES),
vatRegNumber: randomArrayItem(VAT_REGISTRATION_NUMBER_SAMPLES),
};
};
6 changes: 6 additions & 0 deletions src/random/randomPhoneNumber.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { PHONE_NUMBER_SAMPLES } from "../constants/phoneNumbers";
import { randomArrayItem } from "./randomArrayItem";

export const randomPhoneNumber = () => {
return randomArrayItem(PHONE_NUMBER_SAMPLES);
};

0 comments on commit d3eed99

Please sign in to comment.