@yozu-libs/domain 1.0.9 → 1.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/interaction/adapters/typeorm/interaction.repository.d.ts +2 -1
- package/dist/interaction/adapters/typeorm/interaction.repository.js +9 -0
- package/dist/interaction/adapters/typeorm/interaction.repository.js.map +1 -1
- package/dist/interaction/ports/interaction.repository.port.d.ts +2 -1
- package/package.json +3 -3
|
@@ -3,7 +3,7 @@ import { InteractionEntity } from '../../entities/interaction.entity.js';
|
|
|
3
3
|
import { InteractionRepositoryPort } from '../../ports/interaction.repository.port.js';
|
|
4
4
|
import { InteractionOrmEntity } from './interaction.orm-entity.js';
|
|
5
5
|
import { InteractionMapper } from './interaction.mapper.js';
|
|
6
|
-
import { InteractionTypeEnum } from '@yozu-libs/common';
|
|
6
|
+
import { InteractionTypeEnum, InteractionDirectionEnum } from '@yozu-libs/common';
|
|
7
7
|
export declare class InteractionRepository implements InteractionRepositoryPort {
|
|
8
8
|
private readonly repository;
|
|
9
9
|
private readonly mapper;
|
|
@@ -13,5 +13,6 @@ export declare class InteractionRepository implements InteractionRepositoryPort
|
|
|
13
13
|
findByStudentAndOffer(studentId: string, jobOfferId: string): Promise<InteractionEntity[]>;
|
|
14
14
|
findByType(type: InteractionTypeEnum): Promise<InteractionEntity[]>;
|
|
15
15
|
findAll(): Promise<InteractionEntity[]>;
|
|
16
|
+
findOneByDirection(studentId: string, jobOfferId: string, direction: InteractionDirectionEnum): Promise<InteractionEntity | null>;
|
|
16
17
|
delete(id: string): Promise<boolean>;
|
|
17
18
|
}
|
|
@@ -32,6 +32,15 @@ export class InteractionRepository {
|
|
|
32
32
|
const ormEntities = await this.repository.find();
|
|
33
33
|
return ormEntities.map((orm) => this.mapper.toDomain(orm));
|
|
34
34
|
}
|
|
35
|
+
async findOneByDirection(studentId, jobOfferId, direction) {
|
|
36
|
+
const ormEntity = await this.repository.findOne({
|
|
37
|
+
where: { studentId, jobOfferId, direction },
|
|
38
|
+
});
|
|
39
|
+
if (!ormEntity) {
|
|
40
|
+
return null;
|
|
41
|
+
}
|
|
42
|
+
return this.mapper.toDomain(ormEntity);
|
|
43
|
+
}
|
|
35
44
|
async delete(id) {
|
|
36
45
|
const result = await this.repository.delete(id);
|
|
37
46
|
return result.affected !== 0;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interaction.repository.js","sourceRoot":"","sources":["../../../../src/interaction/adapters/typeorm/interaction.repository.ts"],"names":[],"mappings":"AAOA,MAAM,OAAO,qBAAqB;IAEb;IACA;IAFnB,YACmB,UAA4C,EAC5C,MAAyB;QADzB,eAAU,GAAV,UAAU,CAAkC;QAC5C,WAAM,GAAN,MAAM,CAAmB;IACzC,CAAC;IAEJ,KAAK,CAAC,IAAI,CAAC,MAAyB;QAClC,MAAM,SAAS,GAAG,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;QACpD,MAAM,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IACxC,CAAC;IAED,KAAK,CAAC,QAAQ,CAAC,EAAU;QACvB,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;QACnE,IAAI,CAAC,SAAS,EAAE,CAAC;YACf,OAAO,IAAI,CAAC;QACd,CAAC;QACD,OAAO,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;IACzC,CAAC;IAED,KAAK,CAAC,qBAAqB,CAAC,SAAiB,EAAE,UAAkB;QAC/D,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;YAC7C,KAAK,EAAE,EAAE,SAAS,EAAE,UAAU,EAAE;SACjC,CAAC,CAAC;QACH,OAAO,WAAW,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC;IAC7D,CAAC;IAED,KAAK,CAAC,UAAU,CAAC,IAAyB;QACxC,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;YAC7C,KAAK,EAAE,EAAE,IAAI,EAAE;SAChB,CAAC,CAAC;QACH,OAAO,WAAW,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC;IAC7D,CAAC;IAED,KAAK,CAAC,OAAO;QACX,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC;QACjD,OAAO,WAAW,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC;IAC7D,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,EAAU;QACrB,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QAChD,OAAO,MAAM,CAAC,QAAQ,KAAK,CAAC,CAAC;IAC/B,CAAC;CACF"}
|
|
1
|
+
{"version":3,"file":"interaction.repository.js","sourceRoot":"","sources":["../../../../src/interaction/adapters/typeorm/interaction.repository.ts"],"names":[],"mappings":"AAOA,MAAM,OAAO,qBAAqB;IAEb;IACA;IAFnB,YACmB,UAA4C,EAC5C,MAAyB;QADzB,eAAU,GAAV,UAAU,CAAkC;QAC5C,WAAM,GAAN,MAAM,CAAmB;IACzC,CAAC;IAEJ,KAAK,CAAC,IAAI,CAAC,MAAyB;QAClC,MAAM,SAAS,GAAG,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;QACpD,MAAM,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IACxC,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;QAEnC,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC;YAC9C,KAAK,EAAE,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE;SAC5C,CAAC,CAAC;QACH,IAAI,CAAC,SAAS,EAAE,CAAC;YACf,OAAO,IAAI,CAAC;QACd,CAAC;QACD,OAAO,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;IACzC,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,EAAU;QACrB,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QAChD,OAAO,MAAM,CAAC,QAAQ,KAAK,CAAC,CAAC;IAC/B,CAAC;CACF"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { RepositoryPort } from '../../core/index.js';
|
|
2
2
|
import { InteractionEntity } from '../entities/interaction.entity.js';
|
|
3
|
-
import { InteractionTypeEnum } from '@yozu-libs/common';
|
|
3
|
+
import { InteractionTypeEnum, InteractionDirectionEnum } from '@yozu-libs/common';
|
|
4
4
|
export interface InteractionRepositoryPort extends RepositoryPort<InteractionEntity> {
|
|
5
5
|
findByStudentAndOffer(studentId: string, jobOfferId: string): Promise<InteractionEntity[]>;
|
|
6
6
|
findByType(type: InteractionTypeEnum): Promise<InteractionEntity[]>;
|
|
7
|
+
findOneByDirection(studentId: string, jobOfferId: string, direction: InteractionDirectionEnum): Promise<InteractionEntity | null>;
|
|
7
8
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yozu-libs/domain",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.11",
|
|
4
4
|
"description": "Modèles de domaine, entités, mappers, repositories pour le DDD",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
"lint": "eslint \"src/**/*.ts\" --fix"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@yozu-libs/common": "^1.1.
|
|
20
|
-
"@yozu-libs/logger": "^1.0.
|
|
19
|
+
"@yozu-libs/common": "^1.1.12",
|
|
20
|
+
"@yozu-libs/logger": "^1.0.10",
|
|
21
21
|
"typeorm": "^0.3.20"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|