mirror of
https://github.com/ever-co/ever-gauzy.git
synced 2026-10-02 01:54:50 +08:00
feat: make sure more entities are now per tenant / organization
This commit is contained in:
@@ -3,10 +3,10 @@ import { ApiProperty } from '@nestjs/swagger';
|
||||
import { IsString } from 'class-validator';
|
||||
import { ICandidateCriterionsRating } from '@gauzy/models';
|
||||
import { CandidateFeedback } from '../candidate-feedbacks/candidate-feedbacks.entity';
|
||||
import { Base } from '../core/entities/base';
|
||||
import { TenantOrganizationBase } from '../core/entities/tenant-organization-base';
|
||||
|
||||
@Entity('candidate_criterion_rating')
|
||||
export class CandidateCriterionsRating extends Base
|
||||
export class CandidateCriterionsRating extends TenantOrganizationBase
|
||||
implements ICandidateCriterionsRating {
|
||||
@ApiProperty({ type: String })
|
||||
@Column()
|
||||
|
||||
@@ -2,10 +2,10 @@ import { Entity, Column, ManyToOne } from 'typeorm';
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { ICandidateInterviewers, ICandidateInterview } from '@gauzy/models';
|
||||
import { CandidateInterview } from '../candidate-interview/candidate-interview.entity';
|
||||
import { Base } from '../core/entities/base';
|
||||
import { TenantOrganizationBase } from '../core/entities/tenant-organization-base';
|
||||
|
||||
@Entity('candidate_interviewer')
|
||||
export class CandidateInterviewers extends Base
|
||||
export class CandidateInterviewers extends TenantOrganizationBase
|
||||
implements ICandidateInterviewers {
|
||||
@ApiProperty({ type: String })
|
||||
@Column()
|
||||
|
||||
+2
-2
@@ -5,10 +5,10 @@ import {
|
||||
ICandidateInterview
|
||||
} from '@gauzy/models';
|
||||
import { CandidateInterview } from '../candidate-interview/candidate-interview.entity';
|
||||
import { Base } from '../core/entities/base';
|
||||
import { TenantOrganizationBase } from '../core/entities/tenant-organization-base';
|
||||
|
||||
@Entity('candidate_personal_quality')
|
||||
export class CandidatePersonalQualities extends Base
|
||||
export class CandidatePersonalQualities extends TenantOrganizationBase
|
||||
implements ICandidatePersonalQualities {
|
||||
@ApiProperty({ type: String })
|
||||
@Column()
|
||||
|
||||
@@ -2,10 +2,10 @@ import { Column, Entity, ManyToOne } from 'typeorm';
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { ICandidateTechnologies, ICandidateInterview } from '@gauzy/models';
|
||||
import { CandidateInterview } from '../candidate-interview/candidate-interview.entity';
|
||||
import { Base } from '../core/entities/base';
|
||||
import { TenantOrganizationBase } from '../core/entities/tenant-organization-base';
|
||||
|
||||
@Entity('candidate_technology')
|
||||
export class CandidateTechnologies extends Base
|
||||
export class CandidateTechnologies extends TenantOrganizationBase
|
||||
implements ICandidateTechnologies {
|
||||
@ApiProperty({ type: String })
|
||||
@Column()
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { Column, JoinColumn, ManyToOne, RelationId } from 'typeorm';
|
||||
import { Column, Index, JoinColumn, ManyToOne, RelationId } from 'typeorm';
|
||||
import { Tenant } from '../../tenant/tenant.entity';
|
||||
import { Base } from './base';
|
||||
import { IsString, IsOptional } from 'class-validator';
|
||||
@@ -17,6 +17,7 @@ export abstract class TenantBase extends Base
|
||||
@RelationId((t: TenantBase) => t.tenant)
|
||||
@IsString()
|
||||
@IsOptional()
|
||||
@Index()
|
||||
@Column({ nullable: true })
|
||||
tenantId?: string;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { Column, JoinColumn, ManyToOne, RelationId } from 'typeorm';
|
||||
import { Column, Index, JoinColumn, ManyToOne, RelationId } from 'typeorm';
|
||||
import { Organization } from '../../organization/organization.entity';
|
||||
import { IsOptional, IsString } from 'class-validator';
|
||||
import { TenantBase } from './tenant-base';
|
||||
@@ -23,6 +23,7 @@ export abstract class TenantOrganizationBase extends Base
|
||||
@RelationId((it: TenantOrganizationBase) => it.organization)
|
||||
@IsString()
|
||||
@IsOptional()
|
||||
@Index()
|
||||
@Column({ nullable: true })
|
||||
organizationId?: string;
|
||||
|
||||
@@ -36,6 +37,7 @@ export abstract class TenantOrganizationBase extends Base
|
||||
@RelationId((t: TenantBase) => t.tenant)
|
||||
@IsString()
|
||||
@IsOptional()
|
||||
@Index()
|
||||
@Column({ nullable: true })
|
||||
tenantId?: string;
|
||||
}
|
||||
|
||||
@@ -13,10 +13,10 @@ import {
|
||||
} from 'class-validator';
|
||||
import { Column, Entity, Index, ManyToOne } from 'typeorm';
|
||||
import { Employee } from '../employee/employee.entity';
|
||||
import { Base } from '../core/entities/base';
|
||||
import { TenantOrganizationBase } from '../core/entities/tenant-organization-base';
|
||||
|
||||
@Entity('employee_recurring_expense')
|
||||
export class EmployeeRecurringExpense extends Base
|
||||
export class EmployeeRecurringExpense extends TenantOrganizationBase
|
||||
implements IEmployeeRecurringExpense {
|
||||
@ApiProperty({ type: String })
|
||||
@IsString()
|
||||
|
||||
@@ -10,10 +10,11 @@ import {
|
||||
} from 'class-validator';
|
||||
import { IEmployeeSetting, CurrenciesEnum } from '@gauzy/models';
|
||||
import { Employee } from '../employee/employee.entity';
|
||||
import { Base } from '../core/entities/base';
|
||||
import { TenantOrganizationBase } from '../core/entities/tenant-organization-base';
|
||||
|
||||
@Entity('employee_setting')
|
||||
export class EmployeeSetting extends Base implements IEmployeeSetting {
|
||||
export class EmployeeSetting extends TenantOrganizationBase
|
||||
implements IEmployeeSetting {
|
||||
@ApiProperty({ type: String })
|
||||
@IsString()
|
||||
@IsNotEmpty()
|
||||
|
||||
@@ -12,7 +12,8 @@ import {
|
||||
IOrganizationDepartment,
|
||||
IOrganizationEmploymentType,
|
||||
IInvoiceItem,
|
||||
IRequestApprovalEmployee
|
||||
IRequestApprovalEmployee,
|
||||
IPayment
|
||||
} from '@gauzy/models';
|
||||
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
|
||||
import {
|
||||
@@ -45,6 +46,7 @@ import { Skill } from '../skills/skill.entity';
|
||||
import { Contact } from '../contact/contact.entity';
|
||||
import { TimeLog } from '../timesheet/time-log.entity';
|
||||
import { TenantOrganizationBase } from '../core/entities/tenant-organization-base';
|
||||
import { Payment } from '../payment/payment.entity';
|
||||
|
||||
@Entity('employee')
|
||||
export class Employee extends TenantOrganizationBase implements IEmployee {
|
||||
@@ -205,6 +207,11 @@ export class Employee extends TenantOrganizationBase implements IEmployee {
|
||||
@JoinColumn()
|
||||
invoiceItems?: IInvoiceItem[];
|
||||
|
||||
@ApiPropertyOptional({ type: Payment, isArray: true })
|
||||
@OneToMany((type) => Payment, (payments) => payments.recordedBy)
|
||||
@JoinColumn()
|
||||
payments?: IPayment[];
|
||||
|
||||
@OneToMany(
|
||||
(type) => RequestApprovalEmployee,
|
||||
(requestApprovals) => requestApprovals.employee
|
||||
|
||||
@@ -2,10 +2,11 @@ import { IEstimateEmail } from '@gauzy/models';
|
||||
import { ApiPropertyOptional } from '@nestjs/swagger';
|
||||
import { IsDate, IsEmail, IsString } from 'class-validator';
|
||||
import { Column, Entity } from 'typeorm';
|
||||
import { Base } from '../core/entities/base';
|
||||
import { TenantOrganizationBase } from '../core/entities/tenant-organization-base';
|
||||
|
||||
@Entity('estimate_email')
|
||||
export class EstimateEmail extends Base implements IEstimateEmail {
|
||||
export class EstimateEmail extends TenantOrganizationBase
|
||||
implements IEstimateEmail {
|
||||
@ApiPropertyOptional({ type: String })
|
||||
@IsString()
|
||||
@Column()
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
import { Entity, Column } from 'typeorm';
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { IHelpCenterArticle } from '@gauzy/models';
|
||||
import { Base } from '../core/entities/base';
|
||||
import { TenantOrganizationBase } from '../core/entities/tenant-organization-base';
|
||||
|
||||
@Entity('knowledge_base_article')
|
||||
export class HelpCenterArticle extends Base implements IHelpCenterArticle {
|
||||
export class HelpCenterArticle extends TenantOrganizationBase
|
||||
implements IHelpCenterArticle {
|
||||
@ApiProperty({ type: String })
|
||||
@Column()
|
||||
name: string;
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
import { Entity, Column } from 'typeorm';
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { IHelpCenterAuthor } from '@gauzy/models';
|
||||
import { Base } from '../core/entities/base';
|
||||
import { TenantOrganizationBase } from '../core/entities/tenant-organization-base';
|
||||
|
||||
@Entity('knowledge_base_author')
|
||||
export class HelpCenterAuthor extends Base implements IHelpCenterAuthor {
|
||||
export class HelpCenterAuthor extends TenantOrganizationBase
|
||||
implements IHelpCenterAuthor {
|
||||
@ApiProperty({ type: String })
|
||||
@Column()
|
||||
employeeId: string;
|
||||
|
||||
+2
-2
@@ -1,11 +1,11 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { Column, Entity, JoinColumn, RelationId, ManyToOne } from 'typeorm';
|
||||
import { Base } from '../core/entities/base';
|
||||
import { IIntegrationEntitySetting } from '@gauzy/models';
|
||||
import { IntegrationEntitySetting } from '../integration-entity-setting/integration-entity-setting.entity';
|
||||
import { TenantBase } from '../core/entities/tenant-base';
|
||||
|
||||
@Entity('integration_entity_setting_tied_entity')
|
||||
export class IntegrationEntitySettingTiedEntity extends Base
|
||||
export class IntegrationEntitySettingTiedEntity extends TenantBase
|
||||
implements IIntegrationEntitySetting {
|
||||
@ApiProperty({ type: IntegrationEntitySetting })
|
||||
@ManyToOne(
|
||||
|
||||
@@ -7,13 +7,13 @@ import {
|
||||
ManyToOne,
|
||||
OneToMany
|
||||
} from 'typeorm';
|
||||
import { Base } from '../core/entities/base';
|
||||
import { IIntegrationEntitySetting } from '@gauzy/models';
|
||||
import { IntegrationTenant } from '../integration-tenant/integration-tenant.entity';
|
||||
import { IntegrationEntitySettingTiedEntity } from '../integration-entity-setting-tied-entity/integration-entity-setting-tied-entity.entity';
|
||||
import { TenantBase } from '../core/entities/tenant-base';
|
||||
|
||||
@Entity('integration_entity_setting')
|
||||
export class IntegrationEntitySetting extends Base
|
||||
export class IntegrationEntitySetting extends TenantBase
|
||||
implements IIntegrationEntitySetting {
|
||||
@ApiPropertyOptional({ type: IntegrationTenant })
|
||||
@ManyToOne(
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { Column, Entity, JoinColumn, RelationId, ManyToOne } from 'typeorm';
|
||||
import { Base } from '../core/entities/base';
|
||||
import { IIntegrationMap } from '@gauzy/models';
|
||||
import { IntegrationTenant } from '../integration-tenant/integration-tenant.entity';
|
||||
import { TenantBase } from '../core/entities/tenant-base';
|
||||
|
||||
@Entity('integration_map')
|
||||
export class IntegrationMap extends Base implements IIntegrationMap {
|
||||
export class IntegrationMap extends TenantBase implements IIntegrationMap {
|
||||
@ApiProperty({ type: IntegrationTenant })
|
||||
@ManyToOne((type) => IntegrationTenant, {
|
||||
nullable: false
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { Column, Entity, JoinColumn, RelationId, ManyToOne } from 'typeorm';
|
||||
import { Base } from '../core/entities/base';
|
||||
import { IIntegrationSetting } from '@gauzy/models';
|
||||
import { IntegrationTenant } from '../integration-tenant/integration-tenant.entity';
|
||||
import { TenantBase } from '../core/entities/tenant-base';
|
||||
|
||||
@Entity('integration_setting')
|
||||
export class IntegrationSetting extends Base implements IIntegrationSetting {
|
||||
export class IntegrationSetting extends TenantBase
|
||||
implements IIntegrationSetting {
|
||||
@ApiProperty({ type: IntegrationTenant })
|
||||
@ManyToOne((type) => IntegrationTenant, {
|
||||
nullable: false
|
||||
|
||||
@@ -1,30 +1,12 @@
|
||||
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
|
||||
import {
|
||||
Column,
|
||||
Entity,
|
||||
JoinColumn,
|
||||
RelationId,
|
||||
ManyToOne,
|
||||
OneToMany
|
||||
} from 'typeorm';
|
||||
import { Tenant } from '../tenant/tenant.entity';
|
||||
import { Base } from '../core/entities/base';
|
||||
import { Column, Entity, JoinColumn, OneToMany } from 'typeorm';
|
||||
import { IIntegrationTenant } from '@gauzy/models';
|
||||
import { IntegrationEntitySetting } from '../integration-entity-setting/integration-entity-setting.entity';
|
||||
import { TenantBase } from '../core/entities/tenant-base';
|
||||
|
||||
@Entity('integration_tenant')
|
||||
export class IntegrationTenant extends Base implements IIntegrationTenant {
|
||||
@ApiProperty({ type: Tenant })
|
||||
@ManyToOne((type) => Tenant, {
|
||||
nullable: false
|
||||
})
|
||||
@JoinColumn()
|
||||
tenant: Tenant;
|
||||
|
||||
@ApiProperty({ type: String, readOnly: true })
|
||||
@RelationId((integration: IntegrationTenant) => integration.tenant)
|
||||
readonly tenantId: string;
|
||||
|
||||
export class IntegrationTenant extends TenantBase
|
||||
implements IIntegrationTenant {
|
||||
@ApiPropertyOptional({ type: IntegrationEntitySetting, isArray: true })
|
||||
@OneToMany(
|
||||
(type) => IntegrationEntitySetting,
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { Column, Entity } from 'typeorm';
|
||||
import { Base } from '../core/entities/base';
|
||||
import { IIntegrationType } from '@gauzy/models';
|
||||
import { TenantBase } from '../core/entities/tenant-base';
|
||||
|
||||
@Entity('integration_type')
|
||||
export class IntegrationType extends Base implements IIntegrationType {
|
||||
export class IntegrationType extends TenantBase implements IIntegrationType {
|
||||
@ApiProperty({ type: String })
|
||||
@Column({ nullable: false })
|
||||
name: string;
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
import { IInvoiceEstimateHistory } from '@gauzy/models';
|
||||
import { Base } from '../core/entities/base';
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { IsString } from 'class-validator';
|
||||
import { Entity, Column, JoinColumn, ManyToOne } from 'typeorm';
|
||||
import { User } from '../user/user.entity';
|
||||
import { Invoice } from '../invoice/invoice.entity';
|
||||
import { Organization } from '../organization/organization.entity';
|
||||
import { TenantOrganizationBase } from '../core/entities/tenant-organization-base';
|
||||
|
||||
@Entity('invoice_estimate_history')
|
||||
export class InvoiceEstimateHistory extends Base
|
||||
export class InvoiceEstimateHistory extends TenantOrganizationBase
|
||||
implements IInvoiceEstimateHistory {
|
||||
@ApiProperty({ type: String })
|
||||
@IsString()
|
||||
@@ -34,20 +33,4 @@ export class InvoiceEstimateHistory extends Base
|
||||
})
|
||||
@JoinColumn()
|
||||
invoice: Invoice;
|
||||
|
||||
@ApiProperty({ type: Organization })
|
||||
@ManyToOne(
|
||||
(type) => Organization,
|
||||
(organization) => organization.invoiceEstimateHistories,
|
||||
{
|
||||
onDelete: 'SET NULL'
|
||||
}
|
||||
)
|
||||
@JoinColumn()
|
||||
organization: Organization;
|
||||
|
||||
@ApiProperty({ type: String })
|
||||
@IsString()
|
||||
@Column()
|
||||
organizationId: string;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import { Base } from '../core/entities/base';
|
||||
import { Entity, Column, JoinColumn, ManyToOne } from 'typeorm';
|
||||
import { IInvoiceItem } from '@gauzy/models';
|
||||
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
|
||||
@@ -8,9 +7,11 @@ import { Task } from '../tasks/task.entity';
|
||||
import { Employee } from '../employee/employee.entity';
|
||||
import { OrganizationProject } from '../organization-projects/organization-projects.entity';
|
||||
import { Product } from '../product/product.entity';
|
||||
import { TenantOrganizationBase } from '../core/entities/tenant-organization-base';
|
||||
|
||||
@Entity('invoice_item')
|
||||
export class InvoiceItem extends Base implements IInvoiceItem {
|
||||
export class InvoiceItem extends TenantOrganizationBase
|
||||
implements IInvoiceItem {
|
||||
@ApiPropertyOptional({ type: String })
|
||||
@IsString()
|
||||
@IsOptional()
|
||||
|
||||
@@ -1,19 +1,15 @@
|
||||
import { Column, Entity } from 'typeorm';
|
||||
import { Base } from '../core/entities/base';
|
||||
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
|
||||
import { IOrganizationDocument } from '@gauzy/models';
|
||||
import { TenantOrganizationBase } from '../core/entities/tenant-organization-base';
|
||||
|
||||
@Entity('organization_document')
|
||||
export class OrganizationDocuments extends Base
|
||||
export class OrganizationDocuments extends TenantOrganizationBase
|
||||
implements IOrganizationDocument {
|
||||
@ApiProperty({ type: String })
|
||||
@Column()
|
||||
name: string;
|
||||
|
||||
@ApiProperty({ type: String })
|
||||
@Column()
|
||||
organizationId: string;
|
||||
|
||||
@ApiPropertyOptional({ type: String })
|
||||
@Column()
|
||||
documentUrl: string;
|
||||
|
||||
+3
-12
@@ -1,14 +1,12 @@
|
||||
import { IOrganizationEmploymentType } from '@gauzy/models';
|
||||
import { IsNotEmpty } from 'class-validator';
|
||||
import { Column, Entity, JoinTable, ManyToMany, ManyToOne } from 'typeorm';
|
||||
import { Base } from '../core/entities/base';
|
||||
import { Column, Entity, JoinTable, ManyToMany } from 'typeorm';
|
||||
import { Employee } from '../employee/employee.entity';
|
||||
import { Tag } from '../tags/tag.entity';
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { Organization } from '../organization/organization.entity';
|
||||
import { TenantOrganizationBase } from '../core/entities/tenant-organization-base';
|
||||
|
||||
@Entity('organization_employment_type')
|
||||
export class OrganizationEmploymentType extends Base
|
||||
export class OrganizationEmploymentType extends TenantOrganizationBase
|
||||
implements IOrganizationEmploymentType {
|
||||
@ApiProperty()
|
||||
@ManyToMany((type) => Tag, (tag) => tag.organizationEmploymentType)
|
||||
@@ -20,10 +18,6 @@ export class OrganizationEmploymentType extends Base
|
||||
@Column()
|
||||
name: string;
|
||||
|
||||
@Column()
|
||||
@IsNotEmpty()
|
||||
organizationId: string;
|
||||
|
||||
@ManyToMany(
|
||||
(type) => Employee,
|
||||
(employee) => employee.organizationEmploymentTypes,
|
||||
@@ -33,7 +27,4 @@ export class OrganizationEmploymentType extends Base
|
||||
name: 'organization_employment_type_employee'
|
||||
})
|
||||
members?: Employee[];
|
||||
|
||||
@ManyToOne((type) => Organization, (organization) => organization.id)
|
||||
organization?: Organization;
|
||||
}
|
||||
|
||||
@@ -1,27 +1,13 @@
|
||||
import { Column, Entity, JoinColumn, ManyToOne, RelationId } from 'typeorm';
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { IsNotEmpty, IsString } from 'class-validator';
|
||||
import { Base } from '../core/entities/base';
|
||||
import { IOrganizationLanguages } from '@gauzy/models';
|
||||
import { Language } from '../language/language.entity';
|
||||
import { Organization } from '../organization/organization.entity';
|
||||
import { TenantOrganizationBase } from '../core/entities/tenant-organization-base';
|
||||
|
||||
@Entity('organization_languages')
|
||||
export class OrganizationLanguages extends Base
|
||||
@Entity('organization_language')
|
||||
export class OrganizationLanguages extends TenantOrganizationBase
|
||||
implements IOrganizationLanguages {
|
||||
@ApiProperty({ type: Organization })
|
||||
@ManyToOne((type) => Organization, { nullable: false, onDelete: 'CASCADE' })
|
||||
@JoinColumn()
|
||||
organization: Organization;
|
||||
|
||||
@ApiProperty({ type: String, readOnly: true })
|
||||
@RelationId(
|
||||
(organization_languages: OrganizationLanguages) =>
|
||||
organization_languages.organization
|
||||
)
|
||||
@Column()
|
||||
readonly organizationId: string;
|
||||
|
||||
@ApiProperty({ type: Language })
|
||||
@ManyToOne((type) => Language, { nullable: false, onDelete: 'CASCADE' })
|
||||
@JoinColumn()
|
||||
|
||||
@@ -1,20 +1,12 @@
|
||||
import {
|
||||
Column,
|
||||
Entity,
|
||||
Index,
|
||||
ManyToMany,
|
||||
JoinTable,
|
||||
ManyToOne
|
||||
} from 'typeorm';
|
||||
import { Column, Entity, Index, ManyToMany, JoinTable } from 'typeorm';
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { IsNotEmpty, IsString } from 'class-validator';
|
||||
import { Base } from '../core/entities/base';
|
||||
import { IOrganizationPosition } from '@gauzy/models';
|
||||
import { Tag } from '../tags/tag.entity';
|
||||
import { Organization } from '../organization/organization.entity';
|
||||
import { TenantOrganizationBase } from '../core/entities/tenant-organization-base';
|
||||
|
||||
@Entity('organization_position')
|
||||
export class OrganizationPositions extends Base
|
||||
export class OrganizationPositions extends TenantOrganizationBase
|
||||
implements IOrganizationPosition {
|
||||
@ApiProperty()
|
||||
@ManyToMany((type) => Tag, (tag) => tag.organizationPosition)
|
||||
@@ -29,13 +21,4 @@ export class OrganizationPositions extends Base
|
||||
@Index()
|
||||
@Column()
|
||||
name: string;
|
||||
|
||||
@ApiProperty({ type: String })
|
||||
@IsString()
|
||||
@IsNotEmpty()
|
||||
@Column()
|
||||
organizationId: string;
|
||||
|
||||
@ManyToOne((type) => Organization, (organization) => organization.id)
|
||||
organization?: Organization;
|
||||
}
|
||||
|
||||
+3
-15
@@ -11,21 +11,12 @@ import {
|
||||
Min,
|
||||
IsBoolean
|
||||
} from 'class-validator';
|
||||
import { Column, Entity, Index, ManyToOne } from 'typeorm';
|
||||
|
||||
import { Base } from '../core/entities/base';
|
||||
import { Organization } from '../organization/organization.entity';
|
||||
import { Column, Entity, Index } from 'typeorm';
|
||||
import { TenantOrganizationBase } from '../core/entities/tenant-organization-base';
|
||||
|
||||
@Entity('organization_recurring_expense')
|
||||
export class OrganizationRecurringExpense extends Base
|
||||
export class OrganizationRecurringExpense extends TenantOrganizationBase
|
||||
implements IOrganizationRecurringExpense {
|
||||
@ApiProperty({ type: String })
|
||||
@IsString()
|
||||
@IsNotEmpty()
|
||||
@Index()
|
||||
@Column()
|
||||
organizationId: string;
|
||||
|
||||
@ApiProperty({ type: Number, minimum: 1, maximum: 31 })
|
||||
@IsNumber()
|
||||
@IsNotEmpty()
|
||||
@@ -114,7 +105,4 @@ export class OrganizationRecurringExpense extends Base
|
||||
@Index()
|
||||
@Column({ nullable: true })
|
||||
parentRecurringExpenseId?: string;
|
||||
|
||||
@ManyToOne((type) => Organization, (organization) => organization.id)
|
||||
organization: Organization;
|
||||
}
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
import { IOrganizationTeamEmployee } from '@gauzy/models';
|
||||
import { Base } from '../core/entities/base';
|
||||
import { Entity, Column, ManyToOne, JoinColumn, RelationId } from 'typeorm';
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { IsString, IsNotEmpty } from 'class-validator';
|
||||
import { OrganizationTeam } from '../organization-team/organization-team.entity';
|
||||
import { Employee } from '../employee/employee.entity';
|
||||
import { Role } from '../role/role.entity';
|
||||
import { TenantOrganizationBase } from '../core/entities/tenant-organization-base';
|
||||
|
||||
@Entity('organization_team_employee')
|
||||
export class OrganizationTeamEmployee extends Base
|
||||
export class OrganizationTeamEmployee extends TenantOrganizationBase
|
||||
implements IOrganizationTeamEmployee {
|
||||
@ApiProperty({ type: String })
|
||||
@IsString()
|
||||
|
||||
@@ -8,14 +8,15 @@ import {
|
||||
} from 'typeorm';
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { IsNotEmpty, IsString } from 'class-validator';
|
||||
import { Base } from '../core/entities/base';
|
||||
import { IOrganizationTeam } from '@gauzy/models';
|
||||
import { OrganizationTeamEmployee } from '../organization-team-employee/organization-team-employee.entity';
|
||||
import { Tag } from '../tags/tag.entity';
|
||||
import { RequestApprovalTeam } from '../request-approval-team/request-approval-team.entity';
|
||||
import { TenantOrganizationBase } from '../core/entities/tenant-organization-base';
|
||||
|
||||
@Entity('organization_team')
|
||||
export class OrganizationTeam extends Base implements IOrganizationTeam {
|
||||
export class OrganizationTeam extends TenantOrganizationBase
|
||||
implements IOrganizationTeam {
|
||||
@ApiProperty()
|
||||
@ManyToMany((type) => Tag, (tag) => tag.organizationTeam)
|
||||
@JoinTable({
|
||||
@@ -30,12 +31,6 @@ export class OrganizationTeam extends Base implements IOrganizationTeam {
|
||||
@Column()
|
||||
name: string;
|
||||
|
||||
@ApiProperty({ type: String })
|
||||
@IsString()
|
||||
@IsNotEmpty()
|
||||
@Column()
|
||||
organizationId: string;
|
||||
|
||||
@OneToMany(
|
||||
(type) => OrganizationTeamEmployee,
|
||||
(organizationTeamEmployee) => organizationTeamEmployee.organizationTeam,
|
||||
|
||||
@@ -65,6 +65,7 @@ export class Organization extends Base implements IOrganization {
|
||||
@RelationId((t: TenantBase) => t.tenant)
|
||||
@IsString()
|
||||
@IsOptional()
|
||||
@Index()
|
||||
@Column()
|
||||
tenantId?: string;
|
||||
|
||||
@@ -371,11 +372,6 @@ export class Organization extends Base implements IOrganization {
|
||||
})
|
||||
skills: ISkill[];
|
||||
|
||||
@ApiPropertyOptional({ type: String })
|
||||
@IsOptional()
|
||||
@Column({ nullable: true })
|
||||
organizationId?: string;
|
||||
|
||||
@ApiPropertyOptional({ type: Payment, isArray: true })
|
||||
@OneToMany((type) => Payment, (payment) => payment.organization, {
|
||||
onDelete: 'SET NULL'
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
import { Entity, Column, ManyToMany, JoinTable, ManyToOne } from 'typeorm';
|
||||
import { Entity, Column, ManyToMany, JoinTable } from 'typeorm';
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { Tag } from '../tags/tag.entity';
|
||||
import { Base } from '../core/entities/base';
|
||||
import { Organization } from '../organization/organization.entity';
|
||||
import { IsString, IsNotEmpty } from 'class-validator';
|
||||
import { TenantOrganizationBase } from '../core/entities/tenant-organization-base';
|
||||
|
||||
@Entity({
|
||||
name: 'organization_employee_level'
|
||||
})
|
||||
export class EmployeeLevel extends Base {
|
||||
export class EmployeeLevel extends TenantOrganizationBase {
|
||||
@ApiProperty()
|
||||
@ManyToMany((type) => Tag, (tag) => tag.employeeLevel)
|
||||
@JoinTable({
|
||||
@@ -21,13 +20,4 @@ export class EmployeeLevel extends Base {
|
||||
@IsNotEmpty()
|
||||
@Column()
|
||||
level: string;
|
||||
|
||||
@ApiProperty({ type: String })
|
||||
@IsString()
|
||||
@IsNotEmpty()
|
||||
@Column()
|
||||
organizationId: string;
|
||||
|
||||
@ManyToOne((type) => Organization, (organization) => organization.id)
|
||||
organization?: Organization;
|
||||
}
|
||||
|
||||
@@ -3,11 +3,9 @@ import {
|
||||
Column,
|
||||
ManyToOne,
|
||||
JoinColumn,
|
||||
RelationId,
|
||||
JoinTable,
|
||||
ManyToMany
|
||||
} from 'typeorm';
|
||||
import { Base } from '../core/entities/base';
|
||||
import { IPayment, CurrenciesEnum, PaymentMethodEnum } from '@gauzy/models';
|
||||
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
|
||||
import {
|
||||
@@ -18,16 +16,15 @@ import {
|
||||
IsNumber,
|
||||
IsBoolean
|
||||
} from 'class-validator';
|
||||
import { Tenant } from '../tenant/tenant.entity';
|
||||
import { Tag } from '../tags/tag.entity';
|
||||
import { User } from '../user/user.entity';
|
||||
import { Invoice } from '../invoice/invoice.entity';
|
||||
import { Organization } from '../organization/organization.entity';
|
||||
import { OrganizationProject } from '../organization-projects/organization-projects.entity';
|
||||
import { OrganizationContact } from '../organization-contact/organization-contact.entity';
|
||||
import { TenantOrganizationBase } from '../core/entities/tenant-organization-base';
|
||||
|
||||
@Entity('payment')
|
||||
export class Payment extends Base implements IPayment {
|
||||
export class Payment extends TenantOrganizationBase implements IPayment {
|
||||
@ApiPropertyOptional({ type: String })
|
||||
@IsString()
|
||||
@IsOptional()
|
||||
@@ -41,28 +38,11 @@ export class Payment extends Base implements IPayment {
|
||||
@JoinColumn()
|
||||
invoice?: Invoice;
|
||||
|
||||
@ApiPropertyOptional({ type: Organization })
|
||||
@ManyToOne(
|
||||
(type) => Organization,
|
||||
(organization) => organization.payments,
|
||||
{
|
||||
onDelete: 'SET NULL'
|
||||
}
|
||||
)
|
||||
@JoinColumn()
|
||||
organization?: Organization;
|
||||
|
||||
@ApiPropertyOptional({ type: String })
|
||||
@IsString()
|
||||
@IsOptional()
|
||||
@Column({ nullable: true })
|
||||
organizationId?: string;
|
||||
|
||||
@ApiPropertyOptional({ type: String })
|
||||
@IsString()
|
||||
@IsOptional()
|
||||
@Column({ nullable: true })
|
||||
userId?: string;
|
||||
employeeId?: string;
|
||||
|
||||
@ApiPropertyOptional({ type: User })
|
||||
@ManyToOne((type) => User)
|
||||
@@ -102,15 +82,6 @@ export class Payment extends Base implements IPayment {
|
||||
@Column({ nullable: true })
|
||||
overdue?: boolean;
|
||||
|
||||
@ApiProperty({ type: Tenant })
|
||||
@ManyToOne(() => Tenant, { nullable: true, onDelete: 'CASCADE' })
|
||||
@JoinColumn()
|
||||
tenant?: Tenant;
|
||||
|
||||
@ApiProperty({ type: String, readOnly: true })
|
||||
@RelationId((payment: Payment) => payment.tenant)
|
||||
readonly tenantId?: string;
|
||||
|
||||
@ApiPropertyOptional({ type: OrganizationProject })
|
||||
@ManyToOne((type) => OrganizationProject, (project) => project.payments, {
|
||||
onDelete: 'SET NULL'
|
||||
|
||||
@@ -54,9 +54,7 @@ export const createDefaultPayment = async (
|
||||
payment.overdue = faker.random.boolean();
|
||||
payment.tenant = tenant;
|
||||
payment.tags = invoice.tags;
|
||||
|
||||
// TODO: which user we need to set here, employee?
|
||||
payment.userId = faker.random.arrayElement(employees).id;
|
||||
payment.employeeId = faker.random.arrayElement(employees).id;
|
||||
payment.recordedBy = faker.random.arrayElement(users);
|
||||
|
||||
payments.push(payment);
|
||||
@@ -121,9 +119,9 @@ export const createRandomPayment = async (
|
||||
payment.overdue = faker.random.boolean();
|
||||
payment.tenant = tenant;
|
||||
payment.tags = tags;
|
||||
|
||||
// TODO: which user we need to set here, employee?
|
||||
payment.userId = faker.random.arrayElement(tenantEmployees).id;
|
||||
payment.employeeId = faker.random.arrayElement(
|
||||
tenantEmployees
|
||||
).id;
|
||||
payment.recordedBy = faker.random.arrayElement(users);
|
||||
|
||||
payments.push(payment);
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
import { Base } from '../core/entities/base';
|
||||
import { IPipeline } from '@gauzy/models';
|
||||
import { Organization } from '../organization/organization.entity';
|
||||
import {
|
||||
AfterInsert,
|
||||
AfterLoad,
|
||||
@@ -8,35 +6,21 @@ import {
|
||||
BeforeInsert,
|
||||
Column,
|
||||
Entity,
|
||||
JoinColumn,
|
||||
ManyToOne,
|
||||
OneToMany,
|
||||
RelationId
|
||||
OneToMany
|
||||
} from 'typeorm';
|
||||
import { IsNotEmpty, IsString, IsBoolean } from 'class-validator';
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { PipelineStage } from '../pipeline-stage/pipeline-stage.entity';
|
||||
import { TenantOrganizationBase } from '../core/entities/tenant-organization-base';
|
||||
|
||||
@Entity('pipeline')
|
||||
export class Pipeline extends Base implements IPipeline {
|
||||
export class Pipeline extends TenantOrganizationBase implements IPipeline {
|
||||
@OneToMany(() => PipelineStage, ({ pipeline }) => pipeline, {
|
||||
cascade: ['insert']
|
||||
})
|
||||
@ApiProperty({ type: PipelineStage })
|
||||
public stages: PipelineStage[];
|
||||
|
||||
@ManyToOne(() => Organization)
|
||||
@ApiProperty({ type: Organization })
|
||||
@JoinColumn()
|
||||
public organization: Organization;
|
||||
|
||||
@RelationId(({ organization }: Pipeline) => organization)
|
||||
@ApiProperty({ type: String })
|
||||
@IsNotEmpty()
|
||||
@IsString()
|
||||
@Column()
|
||||
public organizationId: string;
|
||||
|
||||
@Column({ nullable: true, type: 'text' })
|
||||
@ApiProperty({ type: String })
|
||||
@IsString()
|
||||
|
||||
@@ -8,10 +8,10 @@ import { ApiProperty } from '@nestjs/swagger';
|
||||
import { IsString, IsNotEmpty, IsNumber } from 'class-validator';
|
||||
import { RequestApproval } from '../request-approval/request-approval.entity';
|
||||
import { Employee } from '../employee/employee.entity';
|
||||
import { Base } from '../core/entities/base';
|
||||
import { TenantOrganizationBase } from '../core/entities/tenant-organization-base';
|
||||
|
||||
@Entity('request_approval_employee')
|
||||
export class RequestApprovalEmployee extends Base
|
||||
export class RequestApprovalEmployee extends TenantOrganizationBase
|
||||
implements IRequestApprovalEmployee {
|
||||
@ApiProperty({ type: String })
|
||||
@IsString()
|
||||
|
||||
@@ -30,6 +30,7 @@ export class RolePermissions extends Base implements IRolePermissions {
|
||||
@RelationId((t: RolePermissions) => t.tenant)
|
||||
@IsString()
|
||||
@IsOptional()
|
||||
@Index()
|
||||
@Column({ nullable: true })
|
||||
tenantId?: string;
|
||||
|
||||
|
||||
@@ -26,6 +26,7 @@ export class Role extends Base implements IRole {
|
||||
@RelationId((t: Role) => t.tenant)
|
||||
@IsString()
|
||||
@IsOptional()
|
||||
@Index()
|
||||
@Column({ nullable: true })
|
||||
tenantId?: string;
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import { Base } from '../core/entities/base';
|
||||
import {
|
||||
Entity,
|
||||
Column,
|
||||
@@ -11,7 +10,6 @@ import {
|
||||
} from 'typeorm';
|
||||
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
|
||||
import { IsOptional } from 'class-validator';
|
||||
|
||||
import { ITask, TaskStatusEnum } from '@gauzy/models';
|
||||
import { OrganizationProject } from '../organization-projects/organization-projects.entity';
|
||||
import { InvoiceItem } from '../invoice-item/invoice-item.entity';
|
||||
@@ -21,9 +19,10 @@ import { OrganizationTeam } from '../organization-team/organization-team.entity'
|
||||
import { User } from '../user/user.entity';
|
||||
import { OrganizationSprint } from '../organization-sprint/organization-sprint.entity';
|
||||
import { TimeLog } from '../timesheet/time-log.entity';
|
||||
import { TenantOrganizationBase } from '../core/entities/tenant-organization-base';
|
||||
|
||||
@Entity('task')
|
||||
export class Task extends Base implements ITask {
|
||||
export class Task extends TenantOrganizationBase implements ITask {
|
||||
@ApiProperty({ type: Tag })
|
||||
@ManyToMany((type) => Tag, (tag) => tag.task)
|
||||
@JoinTable({
|
||||
|
||||
@@ -1,22 +1,13 @@
|
||||
import {
|
||||
Entity,
|
||||
Index,
|
||||
Column,
|
||||
ManyToMany,
|
||||
JoinTable,
|
||||
RelationId,
|
||||
ManyToOne,
|
||||
JoinColumn
|
||||
} from 'typeorm';
|
||||
import { Base } from '../core/entities/base';
|
||||
import { Entity, Index, Column, ManyToMany, JoinTable } from 'typeorm';
|
||||
import { ITimeOffPolicy } from '@gauzy/models';
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { IsString, IsNotEmpty, IsBoolean } from 'class-validator';
|
||||
import { Employee } from '../employee/employee.entity';
|
||||
import { Organization } from '../organization/organization.entity';
|
||||
import { TenantOrganizationBase } from '../core/entities/tenant-organization-base';
|
||||
|
||||
@Entity('time_off_policy')
|
||||
export class TimeOffPolicy extends Base implements ITimeOffPolicy {
|
||||
export class TimeOffPolicy extends TenantOrganizationBase
|
||||
implements ITimeOffPolicy {
|
||||
@ApiProperty({ type: String })
|
||||
@IsString()
|
||||
@IsNotEmpty()
|
||||
@@ -24,17 +15,6 @@ export class TimeOffPolicy extends Base implements ITimeOffPolicy {
|
||||
@Column()
|
||||
name: string;
|
||||
|
||||
@ApiProperty({ type: Organization })
|
||||
@ManyToOne((type) => Organization, { nullable: true, onDelete: 'CASCADE' })
|
||||
@JoinColumn()
|
||||
organization: Organization;
|
||||
|
||||
@ApiProperty({ type: String, readOnly: true })
|
||||
@RelationId((policy: TimeOffPolicy) => policy.organization)
|
||||
@IsString()
|
||||
@Column({ nullable: true })
|
||||
organizationId: string;
|
||||
|
||||
@ApiProperty({ type: Boolean })
|
||||
@IsBoolean()
|
||||
@Column()
|
||||
|
||||
@@ -6,7 +6,6 @@ import {
|
||||
JoinTable,
|
||||
ManyToOne
|
||||
} from 'typeorm';
|
||||
import { Base } from '../core/entities/base';
|
||||
import { ITimeOff as ITimeOffRequest, StatusTypesEnum } from '@gauzy/models';
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import {
|
||||
@@ -18,20 +17,17 @@ import {
|
||||
} from 'class-validator';
|
||||
import { Employee } from '../employee/employee.entity';
|
||||
import { TimeOffPolicy } from '../time-off-policy/time-off-policy.entity';
|
||||
import { TenantOrganizationBase } from '../core/entities/tenant-organization-base';
|
||||
|
||||
@Entity('time_off_request')
|
||||
export class TimeOffRequest extends Base implements ITimeOffRequest {
|
||||
export class TimeOffRequest extends TenantOrganizationBase
|
||||
implements ITimeOffRequest {
|
||||
@ManyToMany((type) => Employee, { cascade: true })
|
||||
@JoinTable({
|
||||
name: 'time_off_request_employee'
|
||||
})
|
||||
employees?: Employee[];
|
||||
|
||||
@ApiProperty({ type: String })
|
||||
@IsString()
|
||||
@Column()
|
||||
organizationId?: string;
|
||||
|
||||
@ApiProperty({ type: String })
|
||||
@IsString()
|
||||
@IsOptional()
|
||||
|
||||
@@ -7,7 +7,6 @@ import {
|
||||
CreateDateColumn,
|
||||
AfterLoad
|
||||
} from 'typeorm';
|
||||
import { Base } from '../core/entities/base';
|
||||
import {
|
||||
IActivity,
|
||||
ActivityType,
|
||||
@@ -31,9 +30,10 @@ import { Employee } from '../employee/employee.entity';
|
||||
import { OrganizationProject } from '../organization-projects/organization-projects.entity';
|
||||
import { Task } from '../tasks/task.entity';
|
||||
import { environment as env } from '@env-api/environment';
|
||||
import { TenantOrganizationBase } from '../core/entities/tenant-organization-base';
|
||||
|
||||
@Entity('activity')
|
||||
export class Activity extends Base implements IActivity {
|
||||
export class Activity extends TenantOrganizationBase implements IActivity {
|
||||
@ApiProperty({ type: Employee })
|
||||
@ManyToOne(() => Employee)
|
||||
@JoinColumn()
|
||||
|
||||
@@ -6,15 +6,15 @@ import {
|
||||
JoinColumn,
|
||||
AfterLoad
|
||||
} from 'typeorm';
|
||||
import { Base } from '../core/entities/base';
|
||||
import { IScreenshot } from '@gauzy/models';
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { IsString, IsOptional, IsNumber, IsDateString } from 'class-validator';
|
||||
import { TimeSlot } from './time-slot.entity';
|
||||
import { FileStorage } from '../core/file-storage';
|
||||
import { TenantOrganizationBase } from '../core/entities/tenant-organization-base';
|
||||
|
||||
@Entity('screenshot')
|
||||
export class Screenshot extends Base implements IScreenshot {
|
||||
export class Screenshot extends TenantOrganizationBase implements IScreenshot {
|
||||
@ApiProperty({ type: TimeSlot })
|
||||
@ManyToOne(() => TimeSlot, { nullable: true, onDelete: 'CASCADE' })
|
||||
@JoinColumn()
|
||||
|
||||
@@ -8,7 +8,6 @@ import {
|
||||
ManyToMany,
|
||||
JoinTable
|
||||
} from 'typeorm';
|
||||
import { Base } from '../core/entities/base';
|
||||
import {
|
||||
ITimeLog,
|
||||
TimeLogType,
|
||||
@@ -29,9 +28,10 @@ import { OrganizationContact } from '../organization-contact/organization-contac
|
||||
import { Task } from '../tasks/task.entity';
|
||||
import * as moment from 'moment';
|
||||
import { TimeSlot } from './time-slot.entity';
|
||||
import { TenantOrganizationBase } from '../core/entities/tenant-organization-base';
|
||||
|
||||
@Entity('time_log')
|
||||
export class TimeLog extends Base implements ITimeLog {
|
||||
export class TimeLog extends TenantOrganizationBase implements ITimeLog {
|
||||
@ApiProperty({ type: Employee })
|
||||
@ManyToOne(() => Employee, { nullable: true })
|
||||
@JoinColumn()
|
||||
|
||||
@@ -6,15 +6,16 @@ import {
|
||||
JoinColumn,
|
||||
Unique
|
||||
} from 'typeorm';
|
||||
import { Base } from '../core/entities/base';
|
||||
import { ITimeSlotMinute } from '@gauzy/models';
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { IsNumber, IsDateString } from 'class-validator';
|
||||
import { TimeSlot } from './time-slot.entity';
|
||||
import { TenantOrganizationBase } from '../core/entities/tenant-organization-base';
|
||||
|
||||
@Entity('time_slot_minutes')
|
||||
@Entity('time_slot_minute')
|
||||
@Unique(['timeSlotId', 'datetime'])
|
||||
export class TimeSlotMinute extends Base implements ITimeSlotMinute {
|
||||
export class TimeSlotMinute extends TenantOrganizationBase
|
||||
implements ITimeSlotMinute {
|
||||
@ApiProperty({ type: TimeSlot })
|
||||
@ManyToOne(() => TimeSlot, { nullable: true, onDelete: 'CASCADE' })
|
||||
@JoinColumn()
|
||||
|
||||
@@ -9,7 +9,6 @@ import {
|
||||
OneToMany,
|
||||
ManyToMany
|
||||
} from 'typeorm';
|
||||
import { Base } from '../core/entities/base';
|
||||
import {
|
||||
ITimeSlot,
|
||||
ITimeSlotMinute,
|
||||
@@ -26,10 +25,11 @@ import { Screenshot } from './screenshot.entity';
|
||||
import { TimeSlotMinute } from './time-slot-minute.entity';
|
||||
import { TimeLog } from './time-log.entity';
|
||||
import { Activity } from './activity.entity';
|
||||
import { TenantOrganizationBase } from '../core/entities/tenant-organization-base';
|
||||
|
||||
@Entity('time_slot')
|
||||
@Unique(['employeeId', 'startedAt'])
|
||||
export class TimeSlot extends Base implements ITimeSlot {
|
||||
export class TimeSlot extends TenantOrganizationBase implements ITimeSlot {
|
||||
@ApiProperty({ type: Employee })
|
||||
@ManyToOne(() => Employee)
|
||||
@JoinColumn()
|
||||
|
||||
@@ -6,7 +6,6 @@ import {
|
||||
JoinColumn,
|
||||
OneToMany
|
||||
} from 'typeorm';
|
||||
import { Base } from '../core/entities/base';
|
||||
import { ITimesheet, TimesheetStatus } from '@gauzy/models';
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import {
|
||||
@@ -18,9 +17,10 @@ import {
|
||||
} from 'class-validator';
|
||||
import { Employee } from '../employee/employee.entity';
|
||||
import { TimeLog } from './time-log.entity';
|
||||
import { TenantOrganizationBase } from '../core/entities/tenant-organization-base';
|
||||
|
||||
@Entity('timesheet')
|
||||
export class Timesheet extends Base implements ITimesheet {
|
||||
export class Timesheet extends TenantOrganizationBase implements ITimesheet {
|
||||
@ApiProperty({ type: Employee })
|
||||
@ManyToOne(() => Employee, { nullable: true })
|
||||
@JoinColumn()
|
||||
|
||||
@@ -33,13 +33,11 @@ import {
|
||||
ManyToMany,
|
||||
JoinTable,
|
||||
OneToOne,
|
||||
AfterLoad,
|
||||
OneToMany
|
||||
AfterLoad
|
||||
} from 'typeorm';
|
||||
import { Role } from '../role/role.entity';
|
||||
import { Tag } from '../tags/tag.entity';
|
||||
import { Employee } from '../employee/employee.entity';
|
||||
import { Payment } from '../payment/payment.entity';
|
||||
import { Base } from '../core/entities/base';
|
||||
import { Tenant } from '../tenant/tenant.entity';
|
||||
|
||||
@@ -55,6 +53,7 @@ export class User extends Base implements IUser {
|
||||
@RelationId((t: User) => t.tenant)
|
||||
@IsString()
|
||||
@IsOptional()
|
||||
@Index()
|
||||
@Column({ nullable: true })
|
||||
tenantId?: string;
|
||||
|
||||
@@ -126,17 +125,6 @@ export class User extends Base implements IUser {
|
||||
@Column({ length: 500, nullable: true })
|
||||
imageUrl?: string;
|
||||
|
||||
@ApiPropertyOptional({ type: Payment, isArray: true })
|
||||
@OneToMany((type) => Payment, (payments) => payments.recordedBy)
|
||||
@JoinColumn()
|
||||
payments?: IPayment[];
|
||||
|
||||
@ApiPropertyOptional({ type: String })
|
||||
@IsString()
|
||||
@IsOptional()
|
||||
@Column({ nullable: true })
|
||||
paymentsId?: string;
|
||||
|
||||
@ApiProperty({ type: String, enum: LanguagesEnum })
|
||||
@IsEnum(LanguagesEnum)
|
||||
@Column({ nullable: true })
|
||||
|
||||
@@ -27,6 +27,7 @@ export class ApprovalPolicyMutationComponent extends TranslationBaseComponent
|
||||
approvalPolicy: IApprovalPolicy;
|
||||
employees: IEmployee[] = [];
|
||||
organizationId: string;
|
||||
// TODO: remove from here, we should never use TenantId in the client app
|
||||
tenantId: string;
|
||||
isHasType = true;
|
||||
|
||||
@@ -65,7 +66,7 @@ export class ApprovalPolicyMutationComponent extends TranslationBaseComponent
|
||||
}
|
||||
|
||||
async saveApprovalPolicy() {
|
||||
const apprPolicy: IApprovalPolicyCreateInput = {
|
||||
const approvalPolicy: IApprovalPolicyCreateInput = {
|
||||
name: this.form.value['name'],
|
||||
description: this.form.value['description'],
|
||||
organizationId: this.organizationId,
|
||||
@@ -74,7 +75,7 @@ export class ApprovalPolicyMutationComponent extends TranslationBaseComponent
|
||||
};
|
||||
|
||||
let result: IApprovalPolicy;
|
||||
result = await this.approvalPolicyService.save(apprPolicy);
|
||||
result = await this.approvalPolicyService.save(approvalPolicy);
|
||||
|
||||
this.closeDialog(result);
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
"deepscan.enable": true,
|
||||
"cSpell.words": [
|
||||
"Upwork",
|
||||
"timesheet",
|
||||
"toastr"
|
||||
]
|
||||
},
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { SafeResourceUrl } from '@angular/platform-browser';
|
||||
import { ITenant } from './tenant.model';
|
||||
import { IBasePerTenantAndOrganizationEntityModel } from './base-entity.model';
|
||||
import { IOrganizationProjectsCreateInput } from '..';
|
||||
|
||||
@@ -31,7 +30,6 @@ export interface IIntegrationViewModel {
|
||||
|
||||
export interface IIntegrationTenant
|
||||
extends IBasePerTenantAndOrganizationEntityModel {
|
||||
tenant: ITenant;
|
||||
name: string;
|
||||
entitySettings?: IIntegrationEntitySetting[];
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ export interface IPayment extends IBasePerTenantAndOrganizationEntityModel {
|
||||
tags?: ITag[];
|
||||
note?: string;
|
||||
recordedBy?: IUser;
|
||||
userId?: string;
|
||||
employeeId?: string;
|
||||
paymentDate?: Date;
|
||||
amount?: number;
|
||||
currency?: string;
|
||||
|
||||
Reference in New Issue
Block a user