Skip to content

Commit

Permalink
fix: pass creation nextEvent
Browse files Browse the repository at this point in the history
  • Loading branch information
VincentHardouin committed Oct 8, 2024
1 parent 69b0a35 commit 7fb0ed6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/domain/usecases/passes/CreatePassUseCase.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export class CreatePassUseCase {
const reservation = await this.reservationRepository.getNextEvent();
const serialNumber = randomUUID();
const passTypeIdentifier = this.config.passTypeIdentifier;
await this.passRepository.save({ passTypeIdentifier, serialNumber });
await this.passRepository.save({ passTypeIdentifier, serialNumber, nextEvent: reservation.code });
return new ReservationPass({ ...reservation, passTypeIdentifier, serialNumber });
}
catch (e) {
Expand Down
4 changes: 2 additions & 2 deletions src/infrastructure/PassRepository.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ class PassRepository {
return pass;
}

async save({ passTypeIdentifier, serialNumber }) {
await this.#knex('passes').insert({ passTypeIdentifier, serialNumber });
async save({ passTypeIdentifier, serialNumber, nextEvent }) {
await this.#knex('passes').insert({ passTypeIdentifier, serialNumber, nextEvent });
}

async findUpdated({ deviceLibraryIdentifier, passTypeIdentifier, passesUpdatedSince }) {
Expand Down

0 comments on commit 7fb0ed6

Please sign in to comment.