driver to user id
This commit is contained in:
33
core/identity/domain/repositories/ICompanyRepository.ts
Normal file
33
core/identity/domain/repositories/ICompanyRepository.ts
Normal file
@@ -0,0 +1,33 @@
|
||||
import { Company } from '../entities/Company';
|
||||
|
||||
/**
|
||||
* Domain Repository: ICompanyRepository
|
||||
*
|
||||
* Repository interface for Company entity operations.
|
||||
*/
|
||||
export interface ICompanyRepository {
|
||||
/**
|
||||
* Create a new company (returns unsaved entity)
|
||||
*/
|
||||
create(company: Pick<Company, 'getName' | 'getOwnerUserId' | 'getContactEmail'>): Company;
|
||||
|
||||
/**
|
||||
* Save a company to the database
|
||||
*/
|
||||
save(company: Company): Promise<void>;
|
||||
|
||||
/**
|
||||
* Delete a company by ID
|
||||
*/
|
||||
delete(id: string): Promise<void>;
|
||||
|
||||
/**
|
||||
* Find company by ID
|
||||
*/
|
||||
findById(id: string): Promise<Company | null>;
|
||||
|
||||
/**
|
||||
* Find company by owner user ID
|
||||
*/
|
||||
findByOwnerUserId(userId: string): Promise<Company | null>;
|
||||
}
|
||||
@@ -16,6 +16,7 @@ export interface StoredUser {
|
||||
passwordHash: string;
|
||||
salt?: string;
|
||||
primaryDriverId?: string | undefined;
|
||||
companyId?: string | undefined;
|
||||
createdAt: Date;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user