-
Notifications
You must be signed in to change notification settings - Fork 196
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #93 from panoratech/feat/addings
feat: done
- Loading branch information
Showing
31 changed files
with
481 additions
and
40 deletions.
There are no files selected for viewing
6 changes: 6 additions & 0 deletions
6
packages/api/src/@core/linked-users/dto/create-linked-user.dto.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
export class CreateLinkedUserDto { | ||
linked_user_origin_id: string; | ||
alias: string; | ||
status?: string; | ||
id_project: number; | ||
} |
18 changes: 18 additions & 0 deletions
18
packages/api/src/@core/linked-users/linked-users.controller.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { Test, TestingModule } from '@nestjs/testing'; | ||
import { LinkedUsersController } from './linked-users.controller'; | ||
|
||
describe('LinkedUsersController', () => { | ||
let controller: LinkedUsersController; | ||
|
||
beforeEach(async () => { | ||
const module: TestingModule = await Test.createTestingModule({ | ||
controllers: [LinkedUsersController], | ||
}).compile(); | ||
|
||
controller = module.get<LinkedUsersController>(LinkedUsersController); | ||
}); | ||
|
||
it('should be defined', () => { | ||
expect(controller).toBeDefined(); | ||
}); | ||
}); |
19 changes: 19 additions & 0 deletions
19
packages/api/src/@core/linked-users/linked-users.controller.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { Body, Controller, Post } from '@nestjs/common'; | ||
import { LinkedUsersService } from './linked-users.service'; | ||
import { LoggerService } from '../logger/logger.service'; | ||
import { CreateLinkedUserDto } from './dto/create-linked-user.dto'; | ||
|
||
@Controller('linked-users') | ||
export class LinkedUsersController { | ||
constructor( | ||
private readonly linkedUsersService: LinkedUsersService, | ||
private logger: LoggerService, | ||
) { | ||
this.logger.setContext(LinkedUsersController.name); | ||
} | ||
|
||
@Post('create') | ||
addLinkedUser(@Body() linkedUserCreateDto: CreateLinkedUserDto) { | ||
return this.linkedUsersService.addLinkedUser(linkedUserCreateDto); | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
packages/api/src/@core/linked-users/linked-users.module.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { Module } from '@nestjs/common'; | ||
import { LinkedUsersService } from './linked-users.service'; | ||
import { LinkedUsersController } from './linked-users.controller'; | ||
import { LoggerService } from '../logger/logger.service'; | ||
import { PrismaService } from '../prisma/prisma.service'; | ||
|
||
@Module({ | ||
providers: [LinkedUsersService, LoggerService, PrismaService], | ||
controllers: [LinkedUsersController], | ||
}) | ||
export class LinkedUsersModule {} |
18 changes: 18 additions & 0 deletions
18
packages/api/src/@core/linked-users/linked-users.service.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { Test, TestingModule } from '@nestjs/testing'; | ||
import { LinkedUsersService } from './linked-users.service'; | ||
|
||
describe('LinkedUsersService', () => { | ||
let service: LinkedUsersService; | ||
|
||
beforeEach(async () => { | ||
const module: TestingModule = await Test.createTestingModule({ | ||
providers: [LinkedUsersService], | ||
}).compile(); | ||
|
||
service = module.get<LinkedUsersService>(LinkedUsersService); | ||
}); | ||
|
||
it('should be defined', () => { | ||
expect(service).toBeDefined(); | ||
}); | ||
}); |
23 changes: 23 additions & 0 deletions
23
packages/api/src/@core/linked-users/linked-users.service.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { Injectable } from '@nestjs/common'; | ||
import { CreateLinkedUserDto } from './dto/create-linked-user.dto'; | ||
import { PrismaService } from '../prisma/prisma.service'; | ||
import { LoggerService } from '../logger/logger.service'; | ||
|
||
@Injectable() | ||
export class LinkedUsersService { | ||
constructor(private prisma: PrismaService, private logger: LoggerService) { | ||
this.logger.setContext(LinkedUsersService.name); | ||
} | ||
|
||
async addLinkedUser(data: CreateLinkedUserDto) { | ||
const { id_project, ...rest } = data; | ||
const res = await this.prisma.linked_users.create({ | ||
data: { | ||
...rest, | ||
id_project: Number(id_project), | ||
status: data.status || 'active', | ||
}, | ||
}); | ||
//this.logger.log('Added new linked_user ' + data); | ||
} | ||
} |
4 changes: 4 additions & 0 deletions
4
packages/api/src/@core/organisations/dto/create-organization.dto.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export class CreateOrganizationDto { | ||
name: string; | ||
stripe_customer_id: string; | ||
} |
18 changes: 18 additions & 0 deletions
18
packages/api/src/@core/organisations/organisations.controller.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { Test, TestingModule } from '@nestjs/testing'; | ||
import { OrganisationsController } from './organisations.controller'; | ||
|
||
describe('OrganisationsController', () => { | ||
let controller: OrganisationsController; | ||
|
||
beforeEach(async () => { | ||
const module: TestingModule = await Test.createTestingModule({ | ||
controllers: [OrganisationsController], | ||
}).compile(); | ||
|
||
controller = module.get<OrganisationsController>(OrganisationsController); | ||
}); | ||
|
||
it('should be defined', () => { | ||
expect(controller).toBeDefined(); | ||
}); | ||
}); |
19 changes: 19 additions & 0 deletions
19
packages/api/src/@core/organisations/organisations.controller.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { Body, Controller, Post } from '@nestjs/common'; | ||
import { OrganisationsService } from './organisations.service'; | ||
import { LoggerService } from '../logger/logger.service'; | ||
import { CreateOrganizationDto } from './dto/create-organization.dto'; | ||
|
||
@Controller('organisations') | ||
export class OrganisationsController { | ||
constructor( | ||
private readonly organizationsService: OrganisationsService, | ||
private logger: LoggerService, | ||
) { | ||
this.logger.setContext(OrganisationsController.name); | ||
} | ||
|
||
@Post('create') | ||
createProject(@Body() orgCreateDto: CreateOrganizationDto) { | ||
return this.organizationsService.createOrganization(orgCreateDto); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,11 @@ | ||
import { Module } from '@nestjs/common'; | ||
import { OrganisationsService } from './organisations.service'; | ||
import { OrganisationsController } from './organisations.controller'; | ||
import { PrismaService } from '../prisma/prisma.service'; | ||
import { LoggerService } from '../logger/logger.service'; | ||
|
||
@Module({ | ||
providers: [OrganisationsService], | ||
providers: [OrganisationsService, PrismaService, LoggerService], | ||
controllers: [OrganisationsController], | ||
}) | ||
export class OrganisationsModule {} |
13 changes: 10 additions & 3 deletions
13
packages/api/src/@core/organisations/organisations.service.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,16 @@ | ||
import { Injectable } from '@nestjs/common'; | ||
import { PrismaService } from '../prisma/prisma.service'; | ||
import { LoggerService } from '../logger/logger.service'; | ||
import { CreateOrganizationDto } from './dto/create-organization.dto'; | ||
|
||
@Injectable() | ||
export class OrganisationsService { | ||
//TODO | ||
async createOrganization() { | ||
return; | ||
constructor(private prisma: PrismaService, private logger: LoggerService) { | ||
this.logger.setContext(OrganisationsService.name); | ||
} | ||
async createOrganization(data: CreateOrganizationDto) { | ||
const res = await this.prisma.organizations.create({ | ||
data: data, | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export class CreateProjectDto { | ||
name: string; | ||
id_organization: string; | ||
} |
18 changes: 18 additions & 0 deletions
18
packages/api/src/@core/projects/projects.controller.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { Test, TestingModule } from '@nestjs/testing'; | ||
import { ProjectsController } from './projects.controller'; | ||
|
||
describe('ProjectsController', () => { | ||
let controller: ProjectsController; | ||
|
||
beforeEach(async () => { | ||
const module: TestingModule = await Test.createTestingModule({ | ||
controllers: [ProjectsController], | ||
}).compile(); | ||
|
||
controller = module.get<ProjectsController>(ProjectsController); | ||
}); | ||
|
||
it('should be defined', () => { | ||
expect(controller).toBeDefined(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { Body, Controller, Post } from '@nestjs/common'; | ||
import { ProjectsService } from './projects.service'; | ||
import { LoggerService } from '../logger/logger.service'; | ||
import { CreateProjectDto } from './dto/create-project.dto'; | ||
|
||
@Controller('projects') | ||
export class ProjectsController { | ||
constructor( | ||
private readonly projectsService: ProjectsService, | ||
private logger: LoggerService, | ||
) { | ||
this.logger.setContext(ProjectsController.name); | ||
} | ||
|
||
@Post('create') | ||
createProject(@Body() projectCreateDto: CreateProjectDto) { | ||
return this.projectsService.createProject(projectCreateDto); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,11 @@ | ||
import { Module } from '@nestjs/common'; | ||
import { ProjectsService } from './projects.service'; | ||
import { ProjectsController } from './projects.controller'; | ||
import { LoggerService } from '../logger/logger.service'; | ||
import { PrismaService } from '../prisma/prisma.service'; | ||
|
||
@Module({ | ||
providers: [ProjectsService] | ||
providers: [ProjectsService, LoggerService, PrismaService], | ||
controllers: [ProjectsController], | ||
}) | ||
export class ProjectsModule {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,20 @@ | ||
import { Injectable } from '@nestjs/common'; | ||
import { PrismaService } from '../prisma/prisma.service'; | ||
import { LoggerService } from '../logger/logger.service'; | ||
import { CreateProjectDto } from './dto/create-project.dto'; | ||
|
||
@Injectable() | ||
export class ProjectsService { | ||
//TODO | ||
async createProject() { | ||
return; | ||
constructor(private prisma: PrismaService, private logger: LoggerService) { | ||
this.logger.setContext(ProjectsService.name); | ||
} | ||
async createProject(data: CreateProjectDto) { | ||
const { id_organization, ...rest } = data; | ||
const res = await this.prisma.projects.create({ | ||
data: { | ||
...rest, | ||
id_organization: Number(id_organization), | ||
}, | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+37.7 KB
packages/frontend-snippet/public/assets/accounting/clearbooksLogo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.