-
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
Showing
10 changed files
with
65 additions
and
12 deletions.
There are no files selected for viewing
3 changes: 1 addition & 2 deletions
3
api/src/Application/School/Command/User/AddUserToSchoolCommand.ts
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 |
---|---|---|
@@ -1,9 +1,8 @@ | ||
import { ICommand } from 'src/Application/ICommand'; | ||
import { User } from 'src/Domain/User/User.entity'; | ||
|
||
export class AddUserToSchoolCommand implements ICommand { | ||
constructor( | ||
public readonly user: User, | ||
public readonly userId: string, | ||
public readonly schoolId: string | ||
) {} | ||
} |
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
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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
import { VoucherNotFoundException } from 'src/Domain/School/Exception/VoucherNotFoundException'; | ||
import { School } from 'src/Domain/School/School.entity'; | ||
import { Voucher } from 'src/Domain/School/Voucher.entity'; | ||
import { VoucherRepository } from 'src/Infrastructure/School/Repository/VoucherRepository'; | ||
import { mock, instance, when, verify } from 'ts-mockito'; | ||
|
@@ -15,13 +16,18 @@ describe('GetVoucherByCodeQueryHandler', () => { | |
const expectedResult = new VoucherView( | ||
'eb9e1d9b-dce2-48a9-B64F-f0872f3157d2', | ||
'xLKJS', | ||
'[email protected]' | ||
'[email protected]', | ||
'ee18bf86-c72a-4ed9-a6d1-212f4286759e' | ||
); | ||
|
||
const voucher = mock(Voucher); | ||
const school = mock(School); | ||
when(school.getId()).thenReturn('ee18bf86-c72a-4ed9-a6d1-212f4286759e'); | ||
|
||
const voucher = mock(Voucher); | ||
when(voucher.getId()).thenReturn('eb9e1d9b-dce2-48a9-B64F-f0872f3157d2'); | ||
when(voucher.getCode()).thenReturn('xLKJS'); | ||
when(voucher.getEmail()).thenReturn('[email protected]'); | ||
when(voucher.getSchool()).thenReturn(instance(school)); | ||
when( | ||
voucherRepository.findOneByCode('eb9e1d9b-dce2-48a9-b64f-f0872f3157d2') | ||
).thenResolve(instance(voucher)); | ||
|
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
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
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