Files
indee-demo/backend/test/mocks/user.ts
Dorian cdd24a5def Implement backend API and database services in Docker setup
- Added a new `api` service for the NestJS backend, including health checks and dependencies on PostgreSQL, Redis, and MinIO.
- Introduced PostgreSQL and Redis services with health checks and configurations for data persistence.
- Added MinIO for S3-compatible object storage and a one-shot service to initialize required buckets.
- Updated the Nginx configuration to proxy requests to the new backend API and MinIO storage.
- Enhanced the Dockerfile to support the new API environment variables and configurations.
- Updated the `package.json` and `package-lock.json` to include new dependencies for QR code generation and other utilities.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 20:14:39 +00:00

83 lines
1.9 KiB
TypeScript

import { User } from 'src/users/entities/user.entity';
import {
audienceMonthlyStripe,
rssAddonMonthlyStripe,
verificationAddonMonthlyStripe,
} from './subscription';
import { Subscription } from 'src/subscriptions/entities/subscription.entity';
import { Filmmaker } from 'src/filmmakers/entities/filmmaker.entity';
interface UserParameters {
id?: string;
email?: string;
legalName?: string;
profilePictureUrl?: string;
subscriptions?: Subscription[];
filmmaker?: Filmmaker;
}
export const createUser = ({
id = 'a2b9b1b0-0b1b-4b1b-8b1b-2b1b3b1b4b1b5',
email = 'test@oneseventech.com',
legalName = 'Test User',
profilePictureUrl = 'https://example.com/profile.jpg',
subscriptions = [],
filmmaker,
}: UserParameters = {}): User => {
return {
cognitoId: 'test-cognito-id',
id,
email,
legalName,
profilePictureUrl,
createdAt: new Date(),
updatedAt: new Date(),
subscriptions,
filmmaker,
seasonRents: [],
redemptions: [],
};
};
const createFilmmaker = (
id: string,
userId: string,
professionalName: string,
bio: string,
): any => {
return {
id,
userId,
professionalName,
lightningAddress: '',
bio,
createdAt: new Date(),
updatedAt: new Date(),
};
};
export const audienceUserStripe: User = createUser({
subscriptions: [audienceMonthlyStripe],
});
export const proPlusUserStripe: User = createUser({
subscriptions: [rssAddonMonthlyStripe],
filmmaker: createFilmmaker(
'a2b9b1b0-0b1b-4b1b-8b1b-2b1b3b1b4b1b5',
'a2b9b1b0-0b1b-4b1b-8b1b-2b1b3b1b4b1b5',
'Test Filmmaker',
'Test bio',
),
});
export const ultimateUserStripe: User = createUser({
subscriptions: [verificationAddonMonthlyStripe],
filmmaker: createFilmmaker(
'a2b9b1b0-0b1b-4b1b-8b1b-2b1b3b1b4b1b5',
'a2b9b1b0-0b1b-4b1b-8b1b-2b1b3b1b4b1b5',
'Test Filmmaker',
'Test bio',
),
});
export const audienceUserNoSubscription: User = createUser();