refactor: repositories (#16036)

This commit is contained in:
Jason Rasmussen
2025-02-11 14:08:13 -05:00
committed by GitHub
parent d2575d8f00
commit 9d85272c2b
90 changed files with 686 additions and 1088 deletions

View File

@@ -5,7 +5,16 @@ import { InjectKysely } from 'nestjs-kysely';
import { DB, Partners, Users } from 'src/db';
import { DummyValue, GenerateSql } from 'src/decorators';
import { PartnerEntity } from 'src/entities/partner.entity';
import { IPartnerRepository, PartnerIds } from 'src/interfaces/partner.interface';
export interface PartnerIds {
sharedById: string;
sharedWithId: string;
}
export enum PartnerDirection {
SharedBy = 'shared-by',
SharedWith = 'shared-with',
}
const columns = ['id', 'name', 'email', 'profileImagePath', 'profileChangedAt'] as const;
@@ -28,7 +37,7 @@ const withSharedWith = (eb: ExpressionBuilder<DB, 'partners'>) => {
};
@Injectable()
export class PartnerRepository implements IPartnerRepository {
export class PartnerRepository {
constructor(@InjectKysely() private db: Kysely<DB>) {}
@GenerateSql({ params: [DummyValue.UUID] })