@managemint-solutions/entities 1.26.0 → 1.27.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,5 @@
1
1
  export declare enum AdditionalDetailsEntityTypes {
2
+ LEAD = "leads",
2
3
  CLIENT = "clients",
3
4
  PROJECT = "projects",
4
5
  BUDGET_EXPENSE = "budget_expenses",
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.AdditionalDetailsTypes = exports.AdditionalDetailsEntityTypes = void 0;
4
4
  var AdditionalDetailsEntityTypes;
5
5
  (function (AdditionalDetailsEntityTypes) {
6
+ AdditionalDetailsEntityTypes["LEAD"] = "leads";
6
7
  AdditionalDetailsEntityTypes["CLIENT"] = "clients";
7
8
  AdditionalDetailsEntityTypes["PROJECT"] = "projects";
8
9
  AdditionalDetailsEntityTypes["BUDGET_EXPENSE"] = "budget_expenses";
@@ -15,6 +15,7 @@ export declare enum AuditTrailEntityType {
15
15
  ADDITIONAL_DETAILS = "additional_details",
16
16
  SUPPORTING_FILES = "supporting_files",
17
17
  NOTES = "notes",
18
+ LEADS = "leads",
18
19
  CLIENTS = "clients",
19
20
  PROJECTS = "projects",
20
21
  TASKS = "tasks",
@@ -20,6 +20,7 @@ var AuditTrailEntityType;
20
20
  AuditTrailEntityType["ADDITIONAL_DETAILS"] = "additional_details";
21
21
  AuditTrailEntityType["SUPPORTING_FILES"] = "supporting_files";
22
22
  AuditTrailEntityType["NOTES"] = "notes";
23
+ AuditTrailEntityType["LEADS"] = "leads";
23
24
  AuditTrailEntityType["CLIENTS"] = "clients";
24
25
  AuditTrailEntityType["PROJECTS"] = "projects";
25
26
  AuditTrailEntityType["TASKS"] = "tasks";
@@ -0,0 +1,32 @@
1
+ import { UUID } from "crypto";
2
+ import { LeadSource } from "../enum";
3
+ export type GetLeadsDto = {
4
+ search?: string | null;
5
+ page: number;
6
+ page_size: number;
7
+ created_after?: string | null;
8
+ created_before?: string | null;
9
+ status_id_in?: string | null;
10
+ assigned_to_id?: string | null;
11
+ completed?: boolean | null;
12
+ archive: boolean;
13
+ };
14
+ export type LeadIdDto = {
15
+ leadId: string;
16
+ };
17
+ export type CreateLeadDto = {
18
+ name: string;
19
+ contact_person?: string | null;
20
+ email?: string | null;
21
+ phone?: string | null;
22
+ status_id?: UUID | null;
23
+ assigned_to_id?: string | null;
24
+ source?: LeadSource | null;
25
+ estimated_value_minor?: number | null;
26
+ follow_up_date?: string | null;
27
+ lost_reason?: string | null;
28
+ };
29
+ export type UpdateLeadDto = CreateLeadDto;
30
+ export type ConvertLeadDto = {
31
+ client_status_id: string | null;
32
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,10 @@
1
+ /** Where a lead came from. Stored as plain text; the sdk DTO validates it against this list. */
2
+ export declare enum LeadSource {
3
+ REFERRAL = "referral",
4
+ WEBSITE = "website",
5
+ SOCIAL_MEDIA = "social_media",
6
+ EVENT = "event",
7
+ COLD_OUTREACH = "cold_outreach",
8
+ EXISTING_CLIENT = "existing_client",
9
+ OTHER = "other"
10
+ }
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LeadSource = void 0;
4
+ /** Where a lead came from. Stored as plain text; the sdk DTO validates it against this list. */
5
+ var LeadSource;
6
+ (function (LeadSource) {
7
+ LeadSource["REFERRAL"] = "referral";
8
+ LeadSource["WEBSITE"] = "website";
9
+ LeadSource["SOCIAL_MEDIA"] = "social_media";
10
+ LeadSource["EVENT"] = "event";
11
+ LeadSource["COLD_OUTREACH"] = "cold_outreach";
12
+ LeadSource["EXISTING_CLIENT"] = "existing_client";
13
+ LeadSource["OTHER"] = "other";
14
+ })(LeadSource || (exports.LeadSource = LeadSource = {}));
15
+ ;
@@ -0,0 +1,61 @@
1
+ import type { UUID } from 'crypto';
2
+ import { ClientIdentity } from '../clients';
3
+ import { StatusEntity } from '../status';
4
+ import { UserIdentity } from '../users';
5
+ import { LeadSource } from './enum';
6
+ export type LeadIdentity = {
7
+ mms_id: UUID;
8
+ name: string;
9
+ };
10
+ export type LeadSummary = {
11
+ mms_id: UUID;
12
+ created_at: Date;
13
+ name: string;
14
+ /** The person at the business the lead is about; null when the lead is a person. */
15
+ contact_person: string | null;
16
+ email: string;
17
+ status: StatusEntity | null;
18
+ assigned_to: UserIdentity | null;
19
+ /** Minor units in the organization's currency; null when not estimated. */
20
+ estimated_value_minor: number | null;
21
+ /** A date (YYYY-MM-DD) to follow the lead up; null when none is set. */
22
+ follow_up_date: string | null;
23
+ created_by: UserIdentity;
24
+ };
25
+ /**
26
+ * A prospective client. Converting it creates a client from its data, moves its notes,
27
+ * additional details and files to that client, moves the lead itself to the organization's Won
28
+ * status and sets `converted_client`. Won is reached only by converting - it cannot be created
29
+ * or set directly. The lead is not deleted, stays as a record of the deal, and the list hides
30
+ * Won leads by default.
31
+ */
32
+ export type LeadEntity = {
33
+ mms_id: UUID;
34
+ created_at: Date;
35
+ name: string;
36
+ contact_person: string | null;
37
+ email: string;
38
+ phone: string;
39
+ status: StatusEntity | null;
40
+ assigned_to: UserIdentity | null;
41
+ source: LeadSource | null;
42
+ estimated_value_minor: number | null;
43
+ follow_up_date: string | null;
44
+ /** Why the lead was lost; set only while its status is a fail status. */
45
+ lost_reason: string | null;
46
+ converted_client: ClientIdentity | null;
47
+ converted_at: Date | null;
48
+ updated_at: Date | null;
49
+ last_updated_by: UserIdentity | null;
50
+ created_by: UserIdentity;
51
+ archived: boolean;
52
+ archived_at: Date | null;
53
+ archived_by: UserIdentity | null;
54
+ unarchived_at: Date | null;
55
+ unarchived_by: UserIdentity | null;
56
+ deleted: boolean;
57
+ deleted_at: Date | null;
58
+ deleted_by: UserIdentity | null;
59
+ restored_at: Date | null;
60
+ restored_by: UserIdentity | null;
61
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,4 +1,5 @@
1
1
  export declare enum NotesEntityTypes {
2
+ LEAD = "leads",
2
3
  CLIENT = "clients",
3
4
  PROJECT = "projects",
4
5
  BUDGET_EXPENSE = "budget_expenses",
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.NotesEntityTypes = void 0;
4
4
  var NotesEntityTypes;
5
5
  (function (NotesEntityTypes) {
6
+ NotesEntityTypes["LEAD"] = "leads";
6
7
  NotesEntityTypes["CLIENT"] = "clients";
7
8
  NotesEntityTypes["PROJECT"] = "projects";
8
9
  NotesEntityTypes["BUDGET_EXPENSE"] = "budget_expenses";
@@ -1,4 +1,5 @@
1
1
  export declare enum StatusEntityTypes {
2
+ LEAD = "leads",
2
3
  CLIENT = "clients",
3
4
  PROJECT = "projects",
4
5
  TASK = "tasks"
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.StatusEntityTypes = void 0;
4
4
  var StatusEntityTypes;
5
5
  (function (StatusEntityTypes) {
6
+ StatusEntityTypes["LEAD"] = "leads";
6
7
  StatusEntityTypes["CLIENT"] = "clients";
7
8
  StatusEntityTypes["PROJECT"] = "projects";
8
9
  StatusEntityTypes["TASK"] = "tasks";
@@ -6,4 +6,5 @@ export type StatusEntity = {
6
6
  is_complete: boolean;
7
7
  is_fail: boolean;
8
8
  is_triage: boolean;
9
+ is_won: boolean;
9
10
  };
@@ -1,4 +1,5 @@
1
1
  export declare enum SupportingFilesEntityTypes {
2
+ LEAD = "leads",
2
3
  CLIENT = "clients",
3
4
  PROJECT = "projects",
4
5
  BUDGET_EXPENSE = "budget_expenses",
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SupportingFilesExtensions = exports.SupportingFilesEntityTypes = void 0;
4
4
  var SupportingFilesEntityTypes;
5
5
  (function (SupportingFilesEntityTypes) {
6
+ SupportingFilesEntityTypes["LEAD"] = "leads";
6
7
  SupportingFilesEntityTypes["CLIENT"] = "clients";
7
8
  SupportingFilesEntityTypes["PROJECT"] = "projects";
8
9
  SupportingFilesEntityTypes["BUDGET_EXPENSE"] = "budget_expenses";
@@ -63,6 +63,10 @@ export interface PermissionsEntity {
63
63
  is_admin: boolean;
64
64
  is_owner: boolean;
65
65
  view_dashboard: boolean;
66
+ create_leads: boolean;
67
+ read_leads: boolean;
68
+ update_leads: boolean;
69
+ delete_leads: boolean;
66
70
  create_clients: boolean;
67
71
  read_clients: boolean;
68
72
  update_clients: boolean;
@@ -135,6 +139,7 @@ export interface PermissionsEntity {
135
139
  export interface Permissions {
136
140
  permissions: {
137
141
  dashboard: Omit<CrudPermission, 'create' | 'update' | 'delete'>;
142
+ leads: CrudPermission;
138
143
  clients: CrudPermission;
139
144
  projects: CrudPermission;
140
145
  project_budgets: CrudPermission;
@@ -1,4 +1,8 @@
1
1
  export type UpdatePermissionsDto = {
2
+ create_leads: boolean;
3
+ read_leads: boolean;
4
+ update_leads: boolean;
5
+ delete_leads: boolean;
2
6
  create_clients: boolean;
3
7
  read_clients: boolean;
4
8
  update_clients: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@managemint-solutions/entities",
3
- "version": "1.26.0",
3
+ "version": "1.27.0",
4
4
  "description": "Entity types used by both the api and portal",
5
5
  "homepage": "https://github.com/ManageMint-Solutions/managemint-solutions-entities#readme",
6
6
  "bugs": {