driver to user id

This commit is contained in:
2026-01-07 13:26:31 +01:00
parent 0db80fa98d
commit 94d60527f4
27 changed files with 856 additions and 1170 deletions

View 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>;
}

View File

@@ -16,6 +16,7 @@ export interface StoredUser {
passwordHash: string;
salt?: string;
primaryDriverId?: string | undefined;
companyId?: string | undefined;
createdAt: Date;
}