-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
gianmarco.bado
committed
Apr 10, 2024
1 parent
3c92430
commit 246d4ff
Showing
4 changed files
with
76 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import { fakerIT as faker } from '@faker-js/faker' | ||
|
||
import { ClubMember } from '../ClubMember' | ||
import { | ||
PAYMENT_STATUS, | ||
MEMBERSHIP_STATUS, | ||
MEMBERSHIP_TYPE | ||
} from '../constants' | ||
|
||
export const mockMemberGenerator = function* () { | ||
for (const payment of Object.values(PAYMENT_STATUS)) { | ||
for (const membership of Object.values(MEMBERSHIP_STATUS)) { | ||
for (const memberType of Object.values(MEMBERSHIP_TYPE)) { | ||
const firstName = faker.person.firstName() | ||
const lastName = faker.person.lastName() | ||
const email = faker.internet | ||
.email({ | ||
firstName, | ||
lastName, | ||
provider: 'fakemail.dev' | ||
}) | ||
.toLowerCase() | ||
|
||
yield new ClubMember( | ||
firstName, | ||
lastName, | ||
payment, | ||
faker.location.zipCode(), | ||
'XXXXXX00X00X000X', | ||
true, | ||
true, | ||
new Date(), | ||
faker.date.birthdate(), | ||
email, | ||
faker.location.streetAddress(), | ||
faker.location.city(), | ||
faker.location.state({ abbreviated: true }), | ||
faker.location.state({ abbreviated: true }), | ||
faker.location.city(), | ||
membership, | ||
faker.phone.number(), | ||
memberType | ||
) | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters