-
Notifications
You must be signed in to change notification settings - Fork 4
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 #13 from zazuko/projects
Adds projects
- Loading branch information
Showing
14 changed files
with
774 additions
and
0 deletions.
There are no files selected for viewing
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
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,27 @@ | ||
export namespace BusinessActivitiesStatic { | ||
export interface BusinessActivity { | ||
id: number; | ||
name: string; | ||
default_is_billable?: boolean; | ||
default_price_per_hour?: string; | ||
account_id?: number; | ||
} | ||
|
||
export interface BusinessActivityCreate { | ||
name: string; | ||
default_is_billable?: boolean; | ||
default_price_per_hour?: string; | ||
account_id?: number; | ||
} | ||
|
||
export interface BusinessActivityOverwrite { | ||
name: string; | ||
default_is_billable?: boolean; | ||
default_price_per_hour?: string; | ||
account_id?: number; | ||
} | ||
|
||
export enum BusinessActivitySearchParameters { | ||
name = "name", | ||
} | ||
} |
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,10 @@ | ||
export namespace ProjectStatusesStatic { | ||
export interface ProjectStatus { | ||
id: number; | ||
name: string; | ||
} | ||
|
||
export enum ProjectStatusSearchParameters { | ||
text = 'text' | ||
} | ||
} |
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,10 @@ | ||
export namespace ProjectTypesStatic { | ||
export interface ProjectType { | ||
id: number; | ||
name: string; | ||
} | ||
|
||
export enum ProjectTypeSearchParameters { | ||
project_type = 'project_type' | ||
} | ||
} |
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,58 @@ | ||
export namespace ProjectsStatic { | ||
export interface Project { | ||
id: number; | ||
nr: string; | ||
name: string; | ||
start_date?: string; | ||
end_date?: string; | ||
comment: string; | ||
pr_state_id: number; | ||
pr_project_type_id: number; | ||
contact_id: number; | ||
contact_sub_id?: number; | ||
pr_invoice_type_id?: number; | ||
pr_invoice_type_amount: number; | ||
pr_budget_type_id?: number; | ||
pr_budget_type_amount: number; | ||
} | ||
|
||
export interface ProjectCreate { | ||
contact_id: number; | ||
name: string; | ||
pr_project_type_id: number; | ||
pr_state_id: number; | ||
user_id: number; | ||
comment?: string; | ||
contact_sub_id?: number; | ||
end_date?: string; | ||
pr_budget_type_amount?: number; | ||
pr_budget_type_id?: number; | ||
pr_invoice_type_amount?: number; | ||
pr_invoice_type_id?: number; | ||
pr_sub_state_id?: number; | ||
start_date?: string; | ||
} | ||
|
||
export interface ProjectOverwrite { | ||
contact_id: number; | ||
name: string; | ||
pr_project_type_id: number; | ||
pr_state_id: number; | ||
user_id: number; | ||
comment?: string; | ||
contact_sub_id?: number; | ||
end_date?: string; | ||
pr_budget_type_amount?: number; | ||
pr_budget_type_id?: number; | ||
pr_invoice_type_amount?: number; | ||
pr_invoice_type_id?: number; | ||
pr_sub_state_id?: number; | ||
start_date?: string; | ||
} | ||
|
||
export enum ProjectSearchParameters { | ||
name = "name", | ||
contact_id = "contact_id", | ||
pr_state_id = "pr_state_id", | ||
} | ||
} |
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,17 @@ | ||
import { BusinessActivitiesStatic } from "../interfaces/BusinessActivitiesStatic"; | ||
import BaseCrud from "./BaseCrud"; | ||
import OAuth2 from "../libs/OAuth2"; | ||
import Scopes from "../constants/Scopes"; | ||
|
||
export default class ClientServices extends BaseCrud< | ||
BusinessActivitiesStatic.BusinessActivity, | ||
BusinessActivitiesStatic.BusinessActivity, | ||
BusinessActivitiesStatic.BusinessActivity, | ||
BusinessActivitiesStatic.BusinessActivitySearchParameters, | ||
BusinessActivitiesStatic.BusinessActivityCreate, | ||
BusinessActivitiesStatic.BusinessActivityOverwrite | ||
> { | ||
constructor(bexioAuth: OAuth2) { | ||
super(bexioAuth, "/client_service", Scopes.GENERAL, Scopes.GENERAL); | ||
} | ||
} |
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,76 @@ | ||
import BaseCrud from "./BaseCrud"; | ||
import OAuth2 from "../libs/OAuth2"; | ||
import { Scopes } from ".."; | ||
import { ProjectStatusesStatic } from "../interfaces/ProjectStatusesStatic"; | ||
|
||
export default class ProjectStatuses extends BaseCrud< | ||
ProjectStatusesStatic.ProjectStatus, | ||
ProjectStatusesStatic.ProjectStatus, | ||
ProjectStatusesStatic.ProjectStatus, | ||
ProjectStatusesStatic.ProjectStatusSearchParameters, | ||
{}, | ||
{} | ||
> { | ||
constructor(bexioAuth: OAuth2) { | ||
super( | ||
bexioAuth, | ||
"/pr_project_state", | ||
Scopes.PROJECT_SHOW, | ||
Scopes.PROJECT_EDIT | ||
); | ||
} | ||
|
||
/** | ||
* Not implemented by Bexio yet | ||
* | ||
* @param {number} id | ||
* @param {{}} ressource | ||
* @returns {Promise<ProjectStatusesStatic.ProjectStatus>} | ||
* @memberof ProjectStatuses | ||
*/ | ||
public async overwrite( | ||
id: number, | ||
ressource: {} | ||
): Promise<ProjectStatusesStatic.ProjectStatus> { | ||
throw new Error("not implemented by Bexio yet"); | ||
} | ||
|
||
/** | ||
* Not implemented by Bexio yet | ||
* | ||
* @param {number} id | ||
* @param {{}} ressource | ||
* @returns {Promise<ProjectStatusesStatic.ProjectStatus>} | ||
* @memberof ProjectStatuses | ||
*/ | ||
public async edit( | ||
id: number, | ||
ressource: {} | ||
): Promise<ProjectStatusesStatic.ProjectStatus> { | ||
throw new Error("not implemented by Bexio yet"); | ||
} | ||
|
||
/** | ||
* Not implemented by Bexio yet | ||
* | ||
* @param {{}} ressource | ||
* @returns {Promise<ProjectStatusesStatic.ProjectStatus>} | ||
* @memberof ProjectStatuses | ||
*/ | ||
public async create(ressource: {}): Promise< | ||
ProjectStatusesStatic.ProjectStatus | ||
> { | ||
throw new Error("not implemented by Bexio yet"); | ||
} | ||
|
||
/** | ||
* Not implemented by Bexio yet | ||
* | ||
* @param {number} id | ||
* @returns {Promise<boolean>} | ||
* @memberof ProjectStatuses | ||
*/ | ||
public async delete(id: number): Promise<boolean> { | ||
throw new Error("not implemented by Bexio yet"); | ||
} | ||
} |
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,64 @@ | ||
import { ProjectTypesStatic } from "../interfaces/ProjectTypesStatic"; | ||
import BaseCrud from "./BaseCrud"; | ||
import OAuth2 from "../libs/OAuth2"; | ||
import Scopes from "../constants/Scopes"; | ||
|
||
export default class ProjectTypes extends BaseCrud< | ||
ProjectTypesStatic.ProjectType, | ||
ProjectTypesStatic.ProjectType, | ||
ProjectTypesStatic.ProjectType, | ||
ProjectTypesStatic.ProjectTypeSearchParameters, | ||
{}, | ||
ProjectTypesStatic.ProjectType | ||
> { | ||
constructor(bexioAuth: OAuth2) { | ||
super(bexioAuth, "/pr_project_type", Scopes.PROJECT_SHOW, Scopes.PROJECT_EDIT); | ||
} | ||
|
||
|
||
/** | ||
* Not implemented by Bexio yet | ||
* | ||
* @param {{}} ressource | ||
* @returns {Promise<ProjectTypesStatic.ProjectType>} | ||
* @memberof ProjectTypes | ||
*/ | ||
public async create(ressource: {}): Promise<ProjectTypesStatic.ProjectType> { | ||
throw new Error('not implemented by Bexio yet') | ||
} | ||
|
||
/** | ||
* Not implemented by Bexio yet | ||
* | ||
* @param {number} id | ||
* @param {{}} ressource | ||
* @returns {Promise<ProjectTypesStatic.ProjectType>} | ||
* @memberof ProjectTypes | ||
*/ | ||
public async edit(id: number, ressource: {}): Promise<ProjectTypesStatic.ProjectType> { | ||
throw new Error('not implemented by Bexio yet') | ||
} | ||
|
||
/** | ||
* Not implemented by Bexio yet | ||
* | ||
* @param {number} id | ||
* @param {{}} ressource | ||
* @returns {Promise<ProjectTypesStatic.ProjectType>} | ||
* @memberof ProjectTypes | ||
*/ | ||
public async overwrite(id: number, ressource: {}): Promise<ProjectTypesStatic.ProjectType> { | ||
throw new Error('not implemented by Bexio yet') | ||
} | ||
|
||
/** | ||
* Not implemented by Bexio yet | ||
* | ||
* @param {number} id | ||
* @returns {Promise<boolean>} | ||
* @memberof ProjectTypes | ||
*/ | ||
public async delete(id: number): Promise<boolean> { | ||
throw new Error('not implemented by Bexio yet') | ||
} | ||
} |
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,17 @@ | ||
import { ProjectsStatic } from "../interfaces/ProjectsStatic"; | ||
import BaseCrud from "./BaseCrud"; | ||
import OAuth2 from "../libs/OAuth2"; | ||
import Scopes from "../constants/Scopes"; | ||
|
||
export default class Projects extends BaseCrud< | ||
ProjectsStatic.Project, | ||
ProjectsStatic.Project, | ||
ProjectsStatic.Project, | ||
ProjectsStatic.ProjectSearchParameters, | ||
ProjectsStatic.ProjectCreate, | ||
ProjectsStatic.ProjectOverwrite | ||
> { | ||
constructor(bexioAuth: OAuth2) { | ||
super(bexioAuth, "/pr_project", Scopes.PROJECT_SHOW, Scopes.PROJECT_EDIT); | ||
} | ||
} |
Oops, something went wrong.