edwardanthony / nestjs-seeder

An extension library for NestJS to perform seeding.
MIT License
102 stars 21 forks source link

feat: pass in index to FactoryValueGenerator #41

Closed simplenotezy closed 3 months ago

simplenotezy commented 3 months ago

Description

This PR introduces a new feature in the FactoryValueGenerator class to include the current index in its operations. This enhancement allows for greater flexibility, e.g. the creation of consistent UUIDs across different seeds, which is particularly useful during development.

Key Benefits

Implementation Details

Example

@Factory((_, __, index) => uuidv5(index.toString(), this.name))
id: string;

Checklist

Please review the changes and provide feedback. Thanks!

simplenotezy commented 3 months ago

Closed in favour of https://github.com/edwardanthony/nestjs-seeder/pull/43