website refactor
This commit is contained in:
@@ -51,7 +51,7 @@ describe('InMemoryNotificationRepository', () => {
|
||||
await repository.create(n2);
|
||||
await repository.create(n3);
|
||||
|
||||
expect((await repository.findById('n1'))?.id).toBe('n1');
|
||||
expect((await repository.findById('n1'))?.id.value).toBe('n1');
|
||||
expect((await repository.findByRecipientId('driver-1')).length).toBe(2);
|
||||
expect(await repository.countUnreadByRecipientId('driver-1')).toBe(2);
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ describe('NotificationOrmMapper', () => {
|
||||
|
||||
const domain = mapper.toDomain(entity);
|
||||
|
||||
expect(domain.id).toBe(entity.id);
|
||||
expect(domain.id.value).toBe(entity.id);
|
||||
expect(domain.recipientId).toBe(entity.recipientId);
|
||||
expect(domain.type).toBe(entity.type);
|
||||
expect(domain.title).toBe(entity.title);
|
||||
@@ -94,7 +94,7 @@ describe('NotificationOrmMapper', () => {
|
||||
|
||||
const entity = mapper.toOrmEntity(domain);
|
||||
|
||||
expect(entity.id).toBe(domain.id);
|
||||
expect(entity.id).toBe(domain.id.value);
|
||||
expect(entity.recipientId).toBe(domain.recipientId);
|
||||
expect(entity.type).toBe(domain.type);
|
||||
expect(entity.title).toBe(domain.title);
|
||||
|
||||
@@ -33,7 +33,7 @@ describe('PenaltyOrmMapper', () => {
|
||||
|
||||
const domain = mapper.toDomain(entity);
|
||||
|
||||
expect(domain.id).toBe(entity.id);
|
||||
expect(domain.id.toString()).toBe(entity.id);
|
||||
expect(createSpy).not.toHaveBeenCalled();
|
||||
expect(rehydrateSpy).toHaveBeenCalled();
|
||||
});
|
||||
@@ -98,7 +98,7 @@ describe('ProtestOrmMapper', () => {
|
||||
|
||||
const domain = mapper.toDomain(entity);
|
||||
|
||||
expect(domain.id).toBe(entity.id);
|
||||
expect(domain.id.toString()).toBe(entity.id);
|
||||
expect(createSpy).not.toHaveBeenCalled();
|
||||
expect(rehydrateSpy).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
@@ -32,32 +32,33 @@ import { ConsoleLogger } from '@adapters/logging/ConsoleLogger';
|
||||
import { InMemoryPaymentRepository } from '@adapters/payments/persistence/inmemory/InMemoryPaymentRepository';
|
||||
import { InMemoryWalletRepository } from '@adapters/payments/persistence/inmemory/InMemoryWalletRepository';
|
||||
|
||||
// Define injection tokens
|
||||
export const SPONSOR_REPOSITORY_TOKEN = 'SponsorRepository';
|
||||
export const SEASON_SPONSORSHIP_REPOSITORY_TOKEN = 'SeasonSponsorshipRepository';
|
||||
export const SEASON_REPOSITORY_TOKEN = 'SeasonRepository';
|
||||
export const LEAGUE_REPOSITORY_TOKEN = 'LeagueRepository';
|
||||
export const LEAGUE_MEMBERSHIP_REPOSITORY_TOKEN = 'LeagueMembershipRepository';
|
||||
export const RACE_REPOSITORY_TOKEN = 'RaceRepository';
|
||||
export const SPONSORSHIP_PRICING_REPOSITORY_TOKEN = 'SponsorshipPricingRepository';
|
||||
export const SPONSORSHIP_REQUEST_REPOSITORY_TOKEN = 'SponsorshipRequestRepository';
|
||||
import {
|
||||
SPONSOR_REPOSITORY_TOKEN,
|
||||
SEASON_SPONSORSHIP_REPOSITORY_TOKEN,
|
||||
SEASON_REPOSITORY_TOKEN,
|
||||
LEAGUE_REPOSITORY_TOKEN,
|
||||
LEAGUE_MEMBERSHIP_REPOSITORY_TOKEN,
|
||||
RACE_REPOSITORY_TOKEN,
|
||||
SPONSORSHIP_PRICING_REPOSITORY_TOKEN,
|
||||
SPONSORSHIP_REQUEST_REPOSITORY_TOKEN,
|
||||
LOGGER_TOKEN,
|
||||
GET_SPONSORS_USE_CASE_TOKEN,
|
||||
CREATE_SPONSOR_USE_CASE_TOKEN,
|
||||
GET_SPONSOR_DASHBOARD_USE_CASE_TOKEN,
|
||||
GET_SPONSOR_SPONSORSHIPS_USE_CASE_TOKEN,
|
||||
GET_ENTITY_SPONSORSHIP_PRICING_USE_CASE_TOKEN,
|
||||
GET_SPONSOR_USE_CASE_TOKEN,
|
||||
GET_PENDING_SPONSORSHIP_REQUESTS_USE_CASE_TOKEN,
|
||||
ACCEPT_SPONSORSHIP_REQUEST_USE_CASE_TOKEN,
|
||||
REJECT_SPONSORSHIP_REQUEST_USE_CASE_TOKEN,
|
||||
GET_SPONSOR_BILLING_USE_CASE_TOKEN
|
||||
} from './SponsorTokens';
|
||||
|
||||
// Define local injection tokens
|
||||
export const PAYMENT_REPOSITORY_TOKEN = 'PaymentRepository';
|
||||
export const WALLET_REPOSITORY_TOKEN = 'WalletRepository';
|
||||
export const LEAGUE_WALLET_REPOSITORY_TOKEN = 'LeagueWalletRepository';
|
||||
export const LEAGUE_WALLET_REPOSITORY_TOKEN = 'ILeagueWalletRepository';
|
||||
export const NOTIFICATION_SERVICE_TOKEN = 'NotificationService';
|
||||
export const LOGGER_TOKEN = 'Logger';
|
||||
|
||||
// Use case / application service tokens
|
||||
export const GET_SPONSORS_USE_CASE_TOKEN = 'GetSponsorsUseCase';
|
||||
export const CREATE_SPONSOR_USE_CASE_TOKEN = 'CreateSponsorUseCase';
|
||||
export const GET_SPONSOR_DASHBOARD_USE_CASE_TOKEN = 'GetSponsorDashboardUseCase';
|
||||
export const GET_SPONSOR_SPONSORSHIPS_USE_CASE_TOKEN = 'GetSponsorSponsorshipsUseCase';
|
||||
export const GET_ENTITY_SPONSORSHIP_PRICING_USE_CASE_TOKEN = 'GetEntitySponsorshipPricingUseCase';
|
||||
export const GET_SPONSOR_USE_CASE_TOKEN = 'GetSponsorUseCase';
|
||||
export const GET_PENDING_SPONSORSHIP_REQUESTS_USE_CASE_TOKEN = 'GetPendingSponsorshipRequestsUseCase';
|
||||
export const ACCEPT_SPONSORSHIP_REQUEST_USE_CASE_TOKEN = 'AcceptSponsorshipRequestUseCase';
|
||||
export const REJECT_SPONSORSHIP_REQUEST_USE_CASE_TOKEN = 'RejectSponsorshipRequestUseCase';
|
||||
export const GET_SPONSOR_BILLING_USE_CASE_TOKEN = 'GetSponsorBillingUseCase';
|
||||
|
||||
export const SponsorProviders: Provider[] = [
|
||||
SponsorService,
|
||||
|
||||
@@ -21,12 +21,12 @@ export class AdminUserOrmEntity {
|
||||
@Column({ type: 'text', nullable: true })
|
||||
primaryDriverId?: string;
|
||||
|
||||
@Column({ type: 'timestamp', nullable: true })
|
||||
@Column({ type: 'datetime', nullable: true })
|
||||
lastLoginAt?: Date;
|
||||
|
||||
@CreateDateColumn({ type: 'timestamp' })
|
||||
@CreateDateColumn({ type: 'datetime' })
|
||||
createdAt!: Date;
|
||||
|
||||
@UpdateDateColumn({ type: 'timestamp' })
|
||||
@UpdateDateColumn({ type: 'datetime' })
|
||||
updatedAt!: Date;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user