Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added mentions legales to technical settings / tenant back #3898

Open
wants to merge 5 commits into
base: master-qa
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions src/assets/schemas/tenant/tenant.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,58 @@
},
"lastChangedOn": {
"$ref": "common#/definitions/lastChangedOn"
},
"tenantSupport": {
"type": "object",
"nullable": true,
"properties": {
"supportEmail": {
"type": "string",
"format": "email",
"sanitize": "mongo",
"nullable": true,
"transform": [
"toLowerCase"
]
},
"supportPhone": {
"type": "string",
"sanitize": "mongo",
"pattern": "^|\\+?([0-9] ?){9,14}[0-9]$",
"nullable": true
}
}
},
"businessDetails": {
"type": "object",
"nullable": true,
"properties": {
"corporateName": {
"type": "string",
"sanitize": "mongo"
},
"website": {
"type": "string",
"sanitize": "mongo"
},
"rcs": {
"type": "string",
"sanitize": "mongo"
},
"capital": {
"type": "number",
"sanitize": "mongo"
},
"siret": {
"type": "number",
"sanitize": "mongo",
"pattern": "^[0-9]{14}$"
},
"legalStatus": {
"type": "string",
"sanitize": "mongo"
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,19 @@
"$ref": "tenant#/definitions/name"
},
"email": {
"$ref": "user#/definitions/email"
"$ref": "common#/definitions/email"
},
"logo": {
"$ref": "common#/definitions/logo"
},
"address": {
"$ref": "common#/definitions/address"
},
"support": {
"$ref": "tenant#/definitions/tenantSupport"
},
"businessDetails": {
"$ref": "tenant#/definitions/businessDetails"
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe all this data goes to common.js as it can be reused in Company ;P
And why not making it a component like the address ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it could be reused by companies but we won't use it as seen with @ClaudeROSSI

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and yes i should have made a new component as address or support 🤷🏻‍♀️

},
"required": [
Expand Down
6 changes: 6 additions & 0 deletions src/assets/storage/schemas/tenant/tenant-save.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@
},
"components": {
"$ref": "tenant-components#/definitions/components"
},
"support": {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also generic, can be reused in Company for instance ;-)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same comment

"$ref": "tenant#/definitions/tenantSupport"
},
"businessDetails": {
"$ref": "tenant#/definitions/businessDetails"
}
},
"required": [
Expand Down
9 changes: 8 additions & 1 deletion src/server/rest/v1/service/TenantService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ export default class TenantService {
});
}
let projectFields = [
'id', 'name', 'email', 'subdomain', 'components', 'address', 'logo'
'id', 'name', 'email', 'subdomain', 'components', 'address', 'logo', 'support', 'corporateName', 'website', 'rcs', 'capital', 'siret', 'rcs', 'legalStatus',
];
// Check projection
const httpProjectFields = UtilsService.httpFilterProjectToArray(filteredRequest.ProjectFields);
Expand Down Expand Up @@ -400,6 +400,13 @@ export default class TenantService {
tenant.name = filteredRequest.name;
tenant.address = filteredRequest.address;
tenant.email = filteredRequest.email;
tenant.support = filteredRequest.support;
tenant.legalStatus = filteredRequest.legalStatus;
tenant.corporateName = filteredRequest.corporateName;
tenant.website = filteredRequest.website;
tenant.rcs = filteredRequest.rcs;
tenant.capital = filteredRequest.capital;
tenant.siret = filteredRequest.siret;
if (Utils.objectHasProperty(filteredRequest, 'logo')) {
tenant.logo = filteredRequest.logo;
}
Expand Down
10 changes: 9 additions & 1 deletion src/types/Tenant.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import Address from './Address';
import CreatedUpdatedProps from './CreatedUpdatedProps';
import { TenantSupport } from './TenantSupport';

export default interface Tenant extends CreatedUpdatedProps {
id: string;
Expand All @@ -10,7 +11,14 @@ export default interface Tenant extends CreatedUpdatedProps {
logo: string;
components: TenantComponent;
redirectDomain?: string;
idleMode?: boolean // Prevents batch and async tasks executions when moving the tenant to a different cloud infrastructure provider
idleMode?: boolean; // Prevents batch and async tasks executions when moving the tenant to a different cloud infrastructure provider
legalStatus: string;
corporateName: string;
website: string;
support: TenantSupport;
rcs: string;
capital: number;
siret: number;
taskExecutionEnv?: string; // Environement on which tasks should be executed
}

Expand Down
5 changes: 5 additions & 0 deletions src/types/TenantSupport.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@

export interface TenantSupport {
supportEmail: string;
supportPhone: string;
}