feat: rename comment thread into activity (#939)
* feat: rename commentThread into activity server * feat: rename commentThread into activity front * feat: migration only create tables feat: migration only create tables * Update activities * fix: rebase partial fix * fix: all rebase problems and drop activity target alter * fix: lint * Update migration * Update migration * Fix conflicts * Fix conflicts --------- Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
@ -0,0 +1,28 @@
|
||||
import { Test, TestingModule } from '@nestjs/testing';
|
||||
|
||||
import { PrismaService } from 'src/database/prisma.service';
|
||||
import { prismaMock } from 'src/database/client-mock/jest-prisma-singleton';
|
||||
|
||||
import { ActivityTargetService } from './activity-target.service';
|
||||
|
||||
describe('ActivityTargetService', () => {
|
||||
let service: ActivityTargetService;
|
||||
|
||||
beforeEach(async () => {
|
||||
const module: TestingModule = await Test.createTestingModule({
|
||||
providers: [
|
||||
ActivityTargetService,
|
||||
{
|
||||
provide: PrismaService,
|
||||
useValue: prismaMock,
|
||||
},
|
||||
],
|
||||
}).compile();
|
||||
|
||||
service = module.get<ActivityTargetService>(ActivityTargetService);
|
||||
});
|
||||
|
||||
it('should be defined', () => {
|
||||
expect(service).toBeDefined();
|
||||
});
|
||||
});
|
||||
40
server/src/core/activity/services/activity-target.service.ts
Normal file
40
server/src/core/activity/services/activity-target.service.ts
Normal file
@ -0,0 +1,40 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
|
||||
import { PrismaService } from 'src/database/prisma.service';
|
||||
|
||||
@Injectable()
|
||||
export class ActivityTargetService {
|
||||
constructor(private readonly prismaService: PrismaService) {}
|
||||
|
||||
// Find
|
||||
findFirst = this.prismaService.client.activityTarget.findFirst;
|
||||
findFirstOrThrow = this.prismaService.client.activityTarget.findFirstOrThrow;
|
||||
|
||||
findUnique = this.prismaService.client.activityTarget.findUnique;
|
||||
findUniqueOrThrow =
|
||||
this.prismaService.client.activityTarget.findUniqueOrThrow;
|
||||
|
||||
findMany = this.prismaService.client.activityTarget.findMany;
|
||||
|
||||
// Create
|
||||
create = this.prismaService.client.activityTarget.create;
|
||||
createMany = this.prismaService.client.activityTarget.createMany;
|
||||
|
||||
// Update
|
||||
update = this.prismaService.client.activityTarget.update;
|
||||
upsert = this.prismaService.client.activityTarget.upsert;
|
||||
updateMany = this.prismaService.client.activityTarget.updateMany;
|
||||
|
||||
// Delete
|
||||
delete = this.prismaService.client.activityTarget.delete;
|
||||
deleteMany = this.prismaService.client.activityTarget.deleteMany;
|
||||
|
||||
// Aggregate
|
||||
aggregate = this.prismaService.client.activityTarget.aggregate;
|
||||
|
||||
// Count
|
||||
count = this.prismaService.client.activityTarget.count;
|
||||
|
||||
// GroupBy
|
||||
groupBy = this.prismaService.client.activityTarget.groupBy;
|
||||
}
|
||||
28
server/src/core/activity/services/activity.service.spec.ts
Normal file
28
server/src/core/activity/services/activity.service.spec.ts
Normal file
@ -0,0 +1,28 @@
|
||||
import { Test, TestingModule } from '@nestjs/testing';
|
||||
|
||||
import { PrismaService } from 'src/database/prisma.service';
|
||||
import { prismaMock } from 'src/database/client-mock/jest-prisma-singleton';
|
||||
|
||||
import { ActivityService } from './activity.service';
|
||||
|
||||
describe('ActivityService', () => {
|
||||
let service: ActivityService;
|
||||
|
||||
beforeEach(async () => {
|
||||
const module: TestingModule = await Test.createTestingModule({
|
||||
providers: [
|
||||
ActivityService,
|
||||
{
|
||||
provide: PrismaService,
|
||||
useValue: prismaMock,
|
||||
},
|
||||
],
|
||||
}).compile();
|
||||
|
||||
service = module.get<ActivityService>(ActivityService);
|
||||
});
|
||||
|
||||
it('should be defined', () => {
|
||||
expect(service).toBeDefined();
|
||||
});
|
||||
});
|
||||
39
server/src/core/activity/services/activity.service.ts
Normal file
39
server/src/core/activity/services/activity.service.ts
Normal file
@ -0,0 +1,39 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
|
||||
import { PrismaService } from 'src/database/prisma.service';
|
||||
|
||||
@Injectable()
|
||||
export class ActivityService {
|
||||
constructor(private readonly prismaService: PrismaService) {}
|
||||
|
||||
// Find
|
||||
findFirst = this.prismaService.client.activity.findFirst;
|
||||
findFirstOrThrow = this.prismaService.client.activity.findFirstOrThrow;
|
||||
|
||||
findUnique = this.prismaService.client.activity.findUnique;
|
||||
findUniqueOrThrow = this.prismaService.client.activity.findUniqueOrThrow;
|
||||
|
||||
findMany = this.prismaService.client.activity.findMany;
|
||||
|
||||
// Create
|
||||
create = this.prismaService.client.activity.create;
|
||||
createMany = this.prismaService.client.activity.createMany;
|
||||
|
||||
// Update
|
||||
update = this.prismaService.client.activity.update;
|
||||
upsert = this.prismaService.client.activity.upsert;
|
||||
updateMany = this.prismaService.client.activity.updateMany;
|
||||
|
||||
// Delete
|
||||
delete = this.prismaService.client.activity.delete;
|
||||
deleteMany = this.prismaService.client.activity.deleteMany;
|
||||
|
||||
// Aggregate
|
||||
aggregate = this.prismaService.client.activity.aggregate;
|
||||
|
||||
// Count
|
||||
count = this.prismaService.client.activity.count;
|
||||
|
||||
// GroupBy
|
||||
groupBy = this.prismaService.client.activity.groupBy;
|
||||
}
|
||||
Reference in New Issue
Block a user