@hed-hog/contact 0.0.299 → 0.0.301

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.
Files changed (81) hide show
  1. package/dist/contact.module.d.ts.map +1 -1
  2. package/dist/contact.module.js +2 -0
  3. package/dist/contact.module.js.map +1 -1
  4. package/dist/index.d.ts +3 -0
  5. package/dist/index.d.ts.map +1 -1
  6. package/dist/index.js +3 -0
  7. package/dist/index.js.map +1 -1
  8. package/dist/person/person.service.js +350 -350
  9. package/dist/proposal/dto/proposal.dto.d.ts +152 -0
  10. package/dist/proposal/dto/proposal.dto.d.ts.map +1 -0
  11. package/dist/proposal/dto/proposal.dto.js +396 -0
  12. package/dist/proposal/dto/proposal.dto.js.map +1 -0
  13. package/dist/proposal/proposal-contract.subscriber.d.ts +11 -0
  14. package/dist/proposal/proposal-contract.subscriber.d.ts.map +1 -0
  15. package/dist/proposal/proposal-contract.subscriber.js +51 -0
  16. package/dist/proposal/proposal-contract.subscriber.js.map +1 -0
  17. package/dist/proposal/proposal-event.types.d.ts +122 -0
  18. package/dist/proposal/proposal-event.types.d.ts.map +1 -0
  19. package/dist/proposal/proposal-event.types.js +13 -0
  20. package/dist/proposal/proposal-event.types.js.map +1 -0
  21. package/dist/proposal/proposal.controller.d.ts +56 -0
  22. package/dist/proposal/proposal.controller.d.ts.map +1 -0
  23. package/dist/proposal/proposal.controller.js +191 -0
  24. package/dist/proposal/proposal.controller.js.map +1 -0
  25. package/dist/proposal/proposal.module.d.ts +3 -0
  26. package/dist/proposal/proposal.module.d.ts.map +1 -0
  27. package/dist/proposal/proposal.module.js +32 -0
  28. package/dist/proposal/proposal.module.js.map +1 -0
  29. package/dist/proposal/proposal.service.d.ts +95 -0
  30. package/dist/proposal/proposal.service.d.ts.map +1 -0
  31. package/dist/proposal/proposal.service.js +1914 -0
  32. package/dist/proposal/proposal.service.js.map +1 -0
  33. package/dist/proposal/proposal.service.spec.d.ts +2 -0
  34. package/dist/proposal/proposal.service.spec.d.ts.map +1 -0
  35. package/dist/proposal/proposal.service.spec.js +187 -0
  36. package/dist/proposal/proposal.service.spec.js.map +1 -0
  37. package/hedhog/data/dashboard.yaml +6 -0
  38. package/hedhog/data/dashboard_component.yaml +87 -0
  39. package/hedhog/data/dashboard_component_role.yaml +55 -0
  40. package/hedhog/data/dashboard_item.yaml +95 -0
  41. package/hedhog/data/dashboard_role.yaml +6 -0
  42. package/hedhog/data/route.yaml +112 -68
  43. package/hedhog/frontend/app/dashboard/_components/dashboard-widgets.tsx.ejs +508 -0
  44. package/hedhog/frontend/app/dashboard/_components/use-crm-dashboard-data.ts.ejs +104 -0
  45. package/hedhog/frontend/app/dashboard/page.tsx.ejs +37 -431
  46. package/hedhog/frontend/app/pipeline/_components/lead-detail-sheet.tsx.ejs +252 -209
  47. package/hedhog/frontend/app/pipeline/_components/lead-proposals-tab.tsx.ejs +1584 -0
  48. package/hedhog/frontend/messages/en.json +136 -42
  49. package/hedhog/frontend/messages/pt.json +135 -41
  50. package/hedhog/frontend/widgets/next-actions.tsx.ejs +40 -0
  51. package/hedhog/frontend/widgets/overview-kpis.tsx.ejs +47 -0
  52. package/hedhog/frontend/widgets/owner-performance.tsx.ejs +42 -0
  53. package/hedhog/frontend/widgets/quick-access.tsx.ejs +29 -0
  54. package/hedhog/frontend/widgets/source-breakdown.tsx.ejs +40 -0
  55. package/hedhog/frontend/widgets/stage-distribution.tsx.ejs +40 -0
  56. package/hedhog/frontend/widgets/top-owners.tsx.ejs +42 -0
  57. package/hedhog/frontend/widgets/unattended.tsx.ejs +40 -0
  58. package/hedhog/table/crm_activity.yaml +68 -68
  59. package/hedhog/table/crm_stage_history.yaml +34 -34
  60. package/hedhog/table/person_company.yaml +27 -27
  61. package/hedhog/table/proposal.yaml +112 -0
  62. package/hedhog/table/proposal_approval.yaml +63 -0
  63. package/hedhog/table/proposal_document.yaml +77 -0
  64. package/hedhog/table/proposal_item.yaml +64 -0
  65. package/hedhog/table/proposal_revision.yaml +78 -0
  66. package/package.json +6 -5
  67. package/src/contact.module.ts +2 -0
  68. package/src/index.ts +3 -0
  69. package/src/person/dto/account.dto.ts +100 -100
  70. package/src/person/dto/activity.dto.ts +54 -54
  71. package/src/person/dto/dashboard-query.dto.ts +25 -25
  72. package/src/person/dto/followup-query.dto.ts +25 -25
  73. package/src/person/dto/reports-query.dto.ts +25 -25
  74. package/src/person/person.controller.ts +176 -176
  75. package/src/person/person.service.ts +4825 -4825
  76. package/src/proposal/dto/proposal.dto.ts +341 -0
  77. package/src/proposal/proposal-contract.subscriber.ts +43 -0
  78. package/src/proposal/proposal-event.types.ts +130 -0
  79. package/src/proposal/proposal.controller.ts +168 -0
  80. package/src/proposal/proposal.module.ts +19 -0
  81. package/src/proposal/proposal.service.ts +2525 -0
@@ -0,0 +1,122 @@
1
+ export declare const PROPOSAL_EVENT_NAMES: {
2
+ readonly CREATED: "contact.proposal.created";
3
+ readonly SENT: "contact.proposal.sent";
4
+ readonly APPROVED: "contact.proposal.approved";
5
+ readonly REJECTED: "contact.proposal.rejected";
6
+ readonly CANCELLED: "contact.proposal.cancelled";
7
+ readonly CONVERT_REQUESTED: "contact.proposal.convert_requested";
8
+ readonly CONVERTED: "contact.proposal.converted";
9
+ };
10
+ export type ProposalLifecycleEventName = (typeof PROPOSAL_EVENT_NAMES)[keyof typeof PROPOSAL_EVENT_NAMES];
11
+ export interface ProposalSourceReference {
12
+ sourceModule: 'contact';
13
+ sourceEntity: 'proposal';
14
+ sourceId: string;
15
+ source_module: 'contact';
16
+ source_entity: 'proposal';
17
+ source_id: string;
18
+ }
19
+ export interface ProposalCommercialTermsSnapshot {
20
+ contractCategory: string | null;
21
+ contractType: string | null;
22
+ billingModel: string | null;
23
+ validFrom: string | null;
24
+ validUntil: string | null;
25
+ summary: string | null;
26
+ notes: string | null;
27
+ }
28
+ export interface ProposalItemSummary {
29
+ id: number | null;
30
+ name: string;
31
+ description: string | null;
32
+ itemType: string | null;
33
+ termType: string | null;
34
+ quantity: number;
35
+ unitAmountCents: number;
36
+ totalAmountCents: number;
37
+ amount: number;
38
+ recurrence: string | null;
39
+ dueDay: number | null;
40
+ }
41
+ export interface ProposalPartySnapshot {
42
+ id: number | null;
43
+ name: string | null;
44
+ tradeName: string | null;
45
+ email: string | null;
46
+ phone: string | null;
47
+ document: string | null;
48
+ type: string | null;
49
+ }
50
+ export interface ProposalRevisionSnapshot {
51
+ id: number | null;
52
+ revisionNumber: number;
53
+ title: string | null;
54
+ summary: string | null;
55
+ contentHtml: string | null;
56
+ submittedAt: string | null;
57
+ approvedAt: string | null;
58
+ }
59
+ export interface ProposalContractSnapshot {
60
+ contractId: number | null;
61
+ code: string | null;
62
+ name: string | null;
63
+ status: string | null;
64
+ url: string | null;
65
+ }
66
+ export interface ProposalLifecycleEventPayload extends ProposalSourceReference {
67
+ eventName: ProposalLifecycleEventName;
68
+ eventKey: string;
69
+ correlationId: string;
70
+ proposalId: number;
71
+ proposalRevisionId: number | null;
72
+ approvedByUserId: number | null;
73
+ dealId: number | null;
74
+ personId: number | null;
75
+ companyId: number | null;
76
+ customerIds: {
77
+ personId: number | null;
78
+ companyId: number | null;
79
+ };
80
+ code: string | null;
81
+ title: string | null;
82
+ version: number;
83
+ status: string | null;
84
+ approvedAt: string | null;
85
+ validUntil: string | null;
86
+ currency: string;
87
+ proposal: {
88
+ code: string | null;
89
+ title: string | null;
90
+ status: string | null;
91
+ contractCategory: string | null;
92
+ contractType: string | null;
93
+ billingModel: string | null;
94
+ currencyCode: string | null;
95
+ validFrom: string | null;
96
+ validUntil: string | null;
97
+ subtotalAmountCents: number;
98
+ discountAmountCents: number;
99
+ taxAmountCents: number;
100
+ totalAmountCents: number;
101
+ totalAmount: number;
102
+ notes: string | null;
103
+ };
104
+ subtotal: number;
105
+ subtotalCents: number;
106
+ discount: number;
107
+ discountCents: number;
108
+ tax: number;
109
+ taxCents: number;
110
+ total: number;
111
+ totalCents: number;
112
+ commercialTerms: ProposalCommercialTermsSnapshot;
113
+ itemsSummary: ProposalItemSummary[];
114
+ items: ProposalItemSummary[];
115
+ person: ProposalPartySnapshot | null;
116
+ revision: ProposalRevisionSnapshot | null;
117
+ contract: ProposalContractSnapshot | null;
118
+ triggeredByUserId: number | null;
119
+ emittedAt: string;
120
+ locale: string | null;
121
+ }
122
+ //# sourceMappingURL=proposal-event.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"proposal-event.types.d.ts","sourceRoot":"","sources":["../../src/proposal/proposal-event.types.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,oBAAoB;;;;;;;;CAQvB,CAAC;AAEX,MAAM,MAAM,0BAA0B,GACpC,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,OAAO,oBAAoB,CAAC,CAAC;AAEnE,MAAM,WAAW,uBAAuB;IACtC,YAAY,EAAE,SAAS,CAAC;IACxB,YAAY,EAAE,UAAU,CAAC;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,SAAS,CAAC;IACzB,aAAa,EAAE,UAAU,CAAC;IAC1B,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,+BAA+B;IAC9C,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB;AAED,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,QAAQ,EAAE,MAAM,GAAG,I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E,MAAM,GAAG,IAAI,CAAC;KACtB,CAAC;IACF,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC;IACtB,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,EAAE,+BAA+B,CAAC;IACjD,YAAY,EAAE,mBAAmB,EAAE,CAAC;IACpC,KAAK,EAAE,mBAAmB,EAAE,CAAC;IAC7B,MAAM,EAAE,qBAAqB,GAAG,IAAI,CAAC;IACrC,QAAQ,EAAE,wBAAwB,GAAG,IAAI,CAAC;IAC1C,QAAQ,EAAE,wBAAwB,GAAG,IAAI,CAAC;IAC1C,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB"}
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PROPOSAL_EVENT_NAMES = void 0;
4
+ exports.PROPOSAL_EVENT_NAMES = {
5
+ CREATED: 'contact.proposal.created',
6
+ SENT: 'contact.proposal.sent',
7
+ APPROVED: 'contact.proposal.approved',
8
+ REJECTED: 'contact.proposal.rejected',
9
+ CANCELLED: 'contact.proposal.cancelled',
10
+ CONVERT_REQUESTED: 'contact.proposal.convert_requested',
11
+ CONVERTED: 'contact.proposal.converted',
12
+ };
13
+ //# sourceMappingURL=proposal-event.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"proposal-event.types.js","sourceRoot":"","sources":["../../src/proposal/proposal-event.types.ts"],"names":[],"mappings":";;;AAAa,QAAA,oBAAoB,GAAG;IAClC,OAAO,EAAE,0BAA0B;IACnC,IAAI,EAAE,uBAAuB;IAC7B,QAAQ,EAAE,2BAA2B;IACrC,QAAQ,EAAE,2BAA2B;IACrC,SAAS,EAAE,4BAA4B;IACvC,iBAAiB,EAAE,oCAAoC;IACvD,SAAS,EAAE,4BAA4B;CAC/B,CAAC"}
@@ -0,0 +1,56 @@
1
+ import { DeleteDTO } from '@hed-hog/api';
2
+ import { CreateProposalDto, ProposalDecisionDto, ProposalListQueryDto, SubmitProposalDto, UpdateProposalDto } from './dto/proposal.dto';
3
+ import { ProposalService } from './proposal.service';
4
+ export declare class ProposalController {
5
+ private readonly proposalService;
6
+ constructor(proposalService: ProposalService);
7
+ list(paginationParams: any, query: ProposalListQueryDto): Promise<{
8
+ data: any;
9
+ total: any;
10
+ page: number;
11
+ pageSize: number;
12
+ prev: number;
13
+ next: number;
14
+ lastPage: number;
15
+ }>;
16
+ getStats(): Promise<{
17
+ total: any;
18
+ draft: any;
19
+ pendingApproval: any;
20
+ approved: any;
21
+ rejected: any;
22
+ contractGenerated: any;
23
+ }>;
24
+ getById(id: number, locale: string): Promise<any>;
25
+ generateDocument(id: number, locale: string, user: any): Promise<{
26
+ proposalId: any;
27
+ proposalRevisionId: any;
28
+ version: number;
29
+ renderVersion: number;
30
+ fileId: number;
31
+ fileName: string;
32
+ mimeType: string;
33
+ documentType: string;
34
+ downloadUrl: string;
35
+ html: string;
36
+ acceptance: {
37
+ status: string;
38
+ acceptedAt: any;
39
+ expectedSignerName: any;
40
+ expectedSignerEmail: any;
41
+ };
42
+ }>;
43
+ create(body: CreateProposalDto, locale: string, user: any): Promise<any>;
44
+ update(id: number, body: UpdateProposalDto, locale: string, user: any): Promise<any>;
45
+ submitForApproval(id: number, body: SubmitProposalDto, locale: string, user: any): Promise<any>;
46
+ send(id: number, body: SubmitProposalDto, locale: string, user: any): Promise<any>;
47
+ approve(id: number, body: ProposalDecisionDto, locale: string, user: any): Promise<any>;
48
+ reject(id: number, body: ProposalDecisionDto, locale: string, user: any): Promise<any>;
49
+ cancel(id: number, body: ProposalDecisionDto, locale: string, user: any): Promise<any>;
50
+ requestConversion(id: number, body: ProposalDecisionDto, locale: string, user: any): Promise<any>;
51
+ remove(body: DeleteDTO, locale: string, user: any): Promise<{
52
+ deleted: number;
53
+ ids: number[];
54
+ }>;
55
+ }
56
+ //# sourceMappingURL=proposal.controller.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"proposal.controller.d.ts","sourceRoot":"","sources":["../../src/proposal/proposal.controller.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAc,MAAM,cAAc,CAAC;AAcrD,OAAO,EACH,iBAAiB,EACjB,mBAAmB,EACnB,oBAAoB,EACpB,iBAAiB,EACjB,iBAAiB,EACpB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAErD,qBAEa,kBAAkB;IACjB,OAAO,CAAC,QAAQ,CAAC,eAAe;gBAAf,eAAe,EAAE,eAAe;IAGvD,IAAI,CACM,gBAAgB,KAAA,EACrB,KAAK,EAAE,oBAAoB;;;;;;;;;IAShC,QAAQ;;;;;;;;IAKR,OAAO,CACgB,EAAE,EAAE,MAAM,EAC3B,MAAM,EAAE,MAAM;IAMpB,gBAAgB,CACO,EAAE,EAAE,MAAM,EAC3B,MAAM,EAAE,MAAM,EAChB,IAAI,KAAA;;;;;;;;;;;;;;;;;;IAUR,MAAM,CACF,IAAI,EAAE,iBAAiB,EACrB,MAAM,EAAE,MAAM,EAChB,IAAI,KAAA;IAMR,MAAM,CACiB,EAAE,EAAE,MAAM,EAC7B,IAAI,EAAE,iBAAiB,EACrB,MAAM,EAAE,MAAM,EAChB,IAAI,KAAA;IAMR,iBAAiB,CACM,EAAE,EAAE,MAAM,EAC7B,IAAI,EAAE,iBAAiB,EACrB,MAAM,EAAE,MAAM,EAChB,IAAI,KAAA;IAWR,IAAI,CACmB,EAAE,EAAE,MAAM,EAC7B,IAAI,EAAE,iBAAiB,EACrB,MAAM,EAAE,MAAM,EAChB,IAAI,KAAA;IAWR,OAAO,CACgB,EAAE,EAAE,MAAM,EAC7B,IAAI,EAAE,mBAAmB,EACvB,MAAM,EAAE,MAAM,EAChB,IAAI,KAAA;IAMR,MAAM,CACiB,EAAE,EAAE,MAAM,EAC7B,IAAI,EAAE,mBAAmB,EACvB,MAAM,EAAE,MAAM,EAChB,IAAI,KAAA;IAMR,MAAM,CACiB,EAAE,EAAE,MAAM,EAC7B,IAAI,EAAE,mBAAmB,EACvB,MAAM,EAAE,MAAM,EAChB,IAAI,KAAA;IAMR,iBAAiB,CACM,EAAE,EAAE,MAAM,EAC7B,IAAI,EAAE,mBAAmB,EACvB,MAAM,EAAE,MAAM,EAChB,IAAI,KAAA;IAWR,MAAM,CACF,IAAI,EAAE,SAAS,EACb,MAAM,EAAE,MAAM,EAChB,IAAI,KAAA;;;;CAIf"}
@@ -0,0 +1,191 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
12
+ return function (target, key) { decorator(target, key, paramIndex); }
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.ProposalController = void 0;
16
+ const api_1 = require("@hed-hog/api");
17
+ const api_locale_1 = require("@hed-hog/api-locale");
18
+ const api_pagination_1 = require("@hed-hog/api-pagination");
19
+ const common_1 = require("@nestjs/common");
20
+ const proposal_dto_1 = require("./dto/proposal.dto");
21
+ const proposal_service_1 = require("./proposal.service");
22
+ let ProposalController = class ProposalController {
23
+ constructor(proposalService) {
24
+ this.proposalService = proposalService;
25
+ }
26
+ async list(paginationParams, query) {
27
+ return this.proposalService.list(Object.assign(Object.assign({}, paginationParams), query));
28
+ }
29
+ async getStats() {
30
+ return this.proposalService.getStats();
31
+ }
32
+ async getById(id, locale) {
33
+ return this.proposalService.getById(id, locale);
34
+ }
35
+ async generateDocument(id, locale, user) {
36
+ return this.proposalService.generateDocument(id, locale, Number((user === null || user === void 0 ? void 0 : user.id) || 0));
37
+ }
38
+ async create(body, locale, user) {
39
+ return this.proposalService.create(body, locale, Number((user === null || user === void 0 ? void 0 : user.id) || 0));
40
+ }
41
+ async update(id, body, locale, user) {
42
+ return this.proposalService.update(id, body, locale, Number((user === null || user === void 0 ? void 0 : user.id) || 0));
43
+ }
44
+ async submitForApproval(id, body, locale, user) {
45
+ return this.proposalService.submitForApproval(id, body, locale, Number((user === null || user === void 0 ? void 0 : user.id) || 0));
46
+ }
47
+ async send(id, body, locale, user) {
48
+ return this.proposalService.submitForApproval(id, body, locale, Number((user === null || user === void 0 ? void 0 : user.id) || 0));
49
+ }
50
+ async approve(id, body, locale, user) {
51
+ return this.proposalService.approve(id, body, locale, Number((user === null || user === void 0 ? void 0 : user.id) || 0));
52
+ }
53
+ async reject(id, body, locale, user) {
54
+ return this.proposalService.reject(id, body, locale, Number((user === null || user === void 0 ? void 0 : user.id) || 0));
55
+ }
56
+ async cancel(id, body, locale, user) {
57
+ return this.proposalService.cancel(id, body, locale, Number((user === null || user === void 0 ? void 0 : user.id) || 0));
58
+ }
59
+ async requestConversion(id, body, locale, user) {
60
+ return this.proposalService.requestConversion(id, body, locale, Number((user === null || user === void 0 ? void 0 : user.id) || 0));
61
+ }
62
+ async remove(body, locale, user) {
63
+ return this.proposalService.remove(body, locale, Number((user === null || user === void 0 ? void 0 : user.id) || 0));
64
+ }
65
+ };
66
+ exports.ProposalController = ProposalController;
67
+ __decorate([
68
+ (0, common_1.Get)(),
69
+ __param(0, (0, api_pagination_1.Pagination)()),
70
+ __param(1, (0, common_1.Query)()),
71
+ __metadata("design:type", Function),
72
+ __metadata("design:paramtypes", [Object, proposal_dto_1.ProposalListQueryDto]),
73
+ __metadata("design:returntype", Promise)
74
+ ], ProposalController.prototype, "list", null);
75
+ __decorate([
76
+ (0, common_1.Get)('stats'),
77
+ __metadata("design:type", Function),
78
+ __metadata("design:paramtypes", []),
79
+ __metadata("design:returntype", Promise)
80
+ ], ProposalController.prototype, "getStats", null);
81
+ __decorate([
82
+ (0, common_1.Get)(':id'),
83
+ __param(0, (0, common_1.Param)('id', common_1.ParseIntPipe)),
84
+ __param(1, (0, api_locale_1.Locale)()),
85
+ __metadata("design:type", Function),
86
+ __metadata("design:paramtypes", [Number, String]),
87
+ __metadata("design:returntype", Promise)
88
+ ], ProposalController.prototype, "getById", null);
89
+ __decorate([
90
+ (0, common_1.Post)(':id/generate-pdf'),
91
+ __param(0, (0, common_1.Param)('id', common_1.ParseIntPipe)),
92
+ __param(1, (0, api_locale_1.Locale)()),
93
+ __param(2, (0, api_1.User)()),
94
+ __metadata("design:type", Function),
95
+ __metadata("design:paramtypes", [Number, String, Object]),
96
+ __metadata("design:returntype", Promise)
97
+ ], ProposalController.prototype, "generateDocument", null);
98
+ __decorate([
99
+ (0, common_1.Post)(),
100
+ __param(0, (0, common_1.Body)()),
101
+ __param(1, (0, api_locale_1.Locale)()),
102
+ __param(2, (0, api_1.User)()),
103
+ __metadata("design:type", Function),
104
+ __metadata("design:paramtypes", [proposal_dto_1.CreateProposalDto, String, Object]),
105
+ __metadata("design:returntype", Promise)
106
+ ], ProposalController.prototype, "create", null);
107
+ __decorate([
108
+ (0, common_1.Patch)(':id'),
109
+ __param(0, (0, common_1.Param)('id', common_1.ParseIntPipe)),
110
+ __param(1, (0, common_1.Body)()),
111
+ __param(2, (0, api_locale_1.Locale)()),
112
+ __param(3, (0, api_1.User)()),
113
+ __metadata("design:type", Function),
114
+ __metadata("design:paramtypes", [Number, proposal_dto_1.UpdateProposalDto, String, Object]),
115
+ __metadata("design:returntype", Promise)
116
+ ], ProposalController.prototype, "update", null);
117
+ __decorate([
118
+ (0, common_1.Post)(':id/submit'),
119
+ __param(0, (0, common_1.Param)('id', common_1.ParseIntPipe)),
120
+ __param(1, (0, common_1.Body)()),
121
+ __param(2, (0, api_locale_1.Locale)()),
122
+ __param(3, (0, api_1.User)()),
123
+ __metadata("design:type", Function),
124
+ __metadata("design:paramtypes", [Number, proposal_dto_1.SubmitProposalDto, String, Object]),
125
+ __metadata("design:returntype", Promise)
126
+ ], ProposalController.prototype, "submitForApproval", null);
127
+ __decorate([
128
+ (0, common_1.Post)(':id/send'),
129
+ __param(0, (0, common_1.Param)('id', common_1.ParseIntPipe)),
130
+ __param(1, (0, common_1.Body)()),
131
+ __param(2, (0, api_locale_1.Locale)()),
132
+ __param(3, (0, api_1.User)()),
133
+ __metadata("design:type", Function),
134
+ __metadata("design:paramtypes", [Number, proposal_dto_1.SubmitProposalDto, String, Object]),
135
+ __metadata("design:returntype", Promise)
136
+ ], ProposalController.prototype, "send", null);
137
+ __decorate([
138
+ (0, common_1.Post)(':id/approve'),
139
+ __param(0, (0, common_1.Param)('id', common_1.ParseIntPipe)),
140
+ __param(1, (0, common_1.Body)()),
141
+ __param(2, (0, api_locale_1.Locale)()),
142
+ __param(3, (0, api_1.User)()),
143
+ __metadata("design:type", Function),
144
+ __metadata("design:paramtypes", [Number, proposal_dto_1.ProposalDecisionDto, String, Object]),
145
+ __metadata("design:returntype", Promise)
146
+ ], ProposalController.prototype, "approve", null);
147
+ __decorate([
148
+ (0, common_1.Post)(':id/reject'),
149
+ __param(0, (0, common_1.Param)('id', common_1.ParseIntPipe)),
150
+ __param(1, (0, common_1.Body)()),
151
+ __param(2, (0, api_locale_1.Locale)()),
152
+ __param(3, (0, api_1.User)()),
153
+ __metadata("design:type", Function),
154
+ __metadata("design:paramtypes", [Number, proposal_dto_1.ProposalDecisionDto, String, Object]),
155
+ __metadata("design:returntype", Promise)
156
+ ], ProposalController.prototype, "reject", null);
157
+ __decorate([
158
+ (0, common_1.Post)(':id/cancel'),
159
+ __param(0, (0, common_1.Param)('id', common_1.ParseIntPipe)),
160
+ __param(1, (0, common_1.Body)()),
161
+ __param(2, (0, api_locale_1.Locale)()),
162
+ __param(3, (0, api_1.User)()),
163
+ __metadata("design:type", Function),
164
+ __metadata("design:paramtypes", [Number, proposal_dto_1.ProposalDecisionDto, String, Object]),
165
+ __metadata("design:returntype", Promise)
166
+ ], ProposalController.prototype, "cancel", null);
167
+ __decorate([
168
+ (0, common_1.Post)(':id/convert'),
169
+ __param(0, (0, common_1.Param)('id', common_1.ParseIntPipe)),
170
+ __param(1, (0, common_1.Body)()),
171
+ __param(2, (0, api_locale_1.Locale)()),
172
+ __param(3, (0, api_1.User)()),
173
+ __metadata("design:type", Function),
174
+ __metadata("design:paramtypes", [Number, proposal_dto_1.ProposalDecisionDto, String, Object]),
175
+ __metadata("design:returntype", Promise)
176
+ ], ProposalController.prototype, "requestConversion", null);
177
+ __decorate([
178
+ (0, common_1.Delete)(),
179
+ __param(0, (0, common_1.Body)()),
180
+ __param(1, (0, api_locale_1.Locale)()),
181
+ __param(2, (0, api_1.User)()),
182
+ __metadata("design:type", Function),
183
+ __metadata("design:paramtypes", [api_1.DeleteDTO, String, Object]),
184
+ __metadata("design:returntype", Promise)
185
+ ], ProposalController.prototype, "remove", null);
186
+ exports.ProposalController = ProposalController = __decorate([
187
+ (0, api_1.Role)(),
188
+ (0, common_1.Controller)('proposal'),
189
+ __metadata("design:paramtypes", [proposal_service_1.ProposalService])
190
+ ], ProposalController);
191
+ //# sourceMappingURL=proposal.controller.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"proposal.controller.js","sourceRoot":"","sources":["../../src/proposal/proposal.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,sCAAqD;AACrD,oDAA6C;AAC7C,4DAAqD;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,EAAC,IAAI,EAAE,qBAAY,CAAC,CAAA;IACzB,WAAA,IAAA,aAAI,GAAE,CAAA;IACN,WAAA,IAAA,mBAAM,GAAE,CAAA;IACR,WAAA,IAAA,UAAI,GAAE,CAAA;;6CAFO,kCAAmB;;gDAKlC;AAGK;IADL,IAAA,aAAI,EAAC,YAAY,CAAC;IAEhB,WAAA,IAAA,cAAK,EAAC,IAAI,EAAE,qBAAY,CAAC,CAAA;IACzB,WAAA,IAAA,aAAI,GAAE,CAAA;IACN,WAAA,IAAA,mBAAM,GAAE,CAAA;IACR,WAAA,IAAA,UAAI,GAAE,CAAA;;6CAFO,kCAAmB;;gDAKlC;AAGK;IADL,IAAA,aAAI,EAAC,aAAa,CAAC;IAEjB,WAAA,IAAA,cAAK,EAAC,IAAI,EAAE,qBAAY,CAAC,CAAA;IACzB,WAAA,IAAA,aAAI,GAAE,CAAA;IACN,WAAA,IAAA,mBAAM,GAAE,CAAA;IACR,WAAA,IAAA,UAAI,GAAE,CAAA;;6CAFO,kCAAmB;;2DAUlC;AAGK;IADL,IAAA,eAAM,GAAE;IAEN,WAAA,IAAA,aAAI,GAAE,CAAA;IACN,WAAA,IAAA,mBAAM,GAAE,CAAA;IACR,WAAA,IAAA,UAAI,GAAE,CAAA;;qCAFO,eAAS;;gDAKxB;6BA7IU,kBAAkB;IAF9B,IAAA,UAAI,GAAE;IACN,IAAA,mBAAU,EAAC,UAAU,CAAC;qCAEyB,kCAAe;GADlD,kBAAkB,CA8I9B"}
@@ -0,0 +1,3 @@
1
+ export declare class ProposalModule {
2
+ }
3
+ //# sourceMappingURL=proposal.module.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"proposal.module.d.ts","sourceRoot":"","sources":["../../src/proposal/proposal.module.ts"],"names":[],"mappings":"AAQA,qBAUa,cAAc;CAAG"}
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.ProposalModule = void 0;
10
+ const api_pagination_1 = require("@hed-hog/api-pagination");
11
+ const api_prisma_1 = require("@hed-hog/api-prisma");
12
+ const core_1 = require("@hed-hog/core");
13
+ const common_1 = require("@nestjs/common");
14
+ const proposal_contract_subscriber_1 = require("./proposal-contract.subscriber");
15
+ const proposal_controller_1 = require("./proposal.controller");
16
+ const proposal_service_1 = require("./proposal.service");
17
+ let ProposalModule = class ProposalModule {
18
+ };
19
+ exports.ProposalModule = ProposalModule;
20
+ exports.ProposalModule = ProposalModule = __decorate([
21
+ (0, common_1.Module)({
22
+ imports: [
23
+ (0, common_1.forwardRef)(() => core_1.CoreModule),
24
+ (0, common_1.forwardRef)(() => api_prisma_1.PrismaModule),
25
+ (0, common_1.forwardRef)(() => api_pagination_1.PaginationModule),
26
+ ],
27
+ controllers: [proposal_controller_1.ProposalController],
28
+ providers: [proposal_service_1.ProposalService, proposal_contract_subscriber_1.ProposalContractSubscriber],
29
+ exports: [proposal_service_1.ProposalService],
30
+ })
31
+ ], ProposalModule);
32
+ //# sourceMappingURL=proposal.module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"proposal.module.js","sourceRoot":"","sources":["../../src/proposal/proposal.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,4DAA2D;AAC3D,oDAAmD;AACnD,wCAA2C;AAC3C,2CAAoD;AACpD,iFAA4E;AAC5E,+DAA2D;AAC3D,yDAAqD;AAY9C,IAAM,cAAc,GAApB,MAAM,cAAc;CAAG,CAAA;AAAjB,wCAAc;yBAAd,cAAc;IAV1B,IAAA,eAAM,EAAC;QACN,OAAO,EAAE;YACP,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,iBAAU,CAAC;YAC5B,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,yBAAY,CAAC;YAC9B,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,iCAAgB,CAAC;SACnC;QACD,WAAW,EAAE,CAAC,wCAAkB,CAAC;QACjC,SAAS,EAAE,CAAC,kCAAe,EAAE,yDAA0B,CAAC;QACxD,OAAO,EAAE,CAAC,kCAAe,CAAC;KAC3B,CAAC;GACW,cAAc,CAAG"}
@@ -0,0 +1,95 @@
1
+ import { DeleteDTO } from '@hed-hog/api';
2
+ import { PaginationDTO } from '@hed-hog/api-pagination';
3
+ import { PrismaService } from '@hed-hog/api-prisma';
4
+ import { FileService, IntegrationDeveloperApiService, SettingService } from '@hed-hog/core';
5
+ import { CreateProposalDto, ProposalDecisionDto, ProposalListQueryDto, SubmitProposalDto, UpdateProposalDto } from './dto/proposal.dto';
6
+ export declare class ProposalService {
7
+ private readonly prisma;
8
+ private readonly integrationApi;
9
+ private readonly fileService;
10
+ private readonly settingService;
11
+ private readonly logger;
12
+ constructor(prisma: PrismaService, integrationApi: IntegrationDeveloperApiService, fileService: FileService, settingService: SettingService);
13
+ list(params: PaginationDTO & ProposalListQueryDto & {
14
+ take?: number;
15
+ skip?: number;
16
+ pageSize?: number;
17
+ }): Promise<{
18
+ data: any;
19
+ total: any;
20
+ page: number;
21
+ pageSize: number;
22
+ prev: number;
23
+ next: number;
24
+ lastPage: number;
25
+ }>;
26
+ getStats(): Promise<{
27
+ total: any;
28
+ draft: any;
29
+ pendingApproval: any;
30
+ approved: any;
31
+ rejected: any;
32
+ contractGenerated: any;
33
+ }>;
34
+ getById(id: number, locale: string): Promise<any>;
35
+ create(data: CreateProposalDto, locale: string, userId?: number): Promise<any>;
36
+ update(id: number, data: UpdateProposalDto, locale: string, userId?: number): Promise<any>;
37
+ submitForApproval(id: number, data: SubmitProposalDto, locale: string, userId?: number): Promise<any>;
38
+ approve(id: number, data: ProposalDecisionDto, locale: string, userId?: number): Promise<any>;
39
+ reject(id: number, data: ProposalDecisionDto, locale: string, userId?: number): Promise<any>;
40
+ cancel(id: number, data: ProposalDecisionDto, locale: string, userId?: number): Promise<any>;
41
+ requestConversion(id: number, data: ProposalDecisionDto, locale: string, userId?: number): Promise<any>;
42
+ markConvertedFromIntegration(payload: any): Promise<any>;
43
+ generateDocument(id: number, locale: string, userId?: number): Promise<{
44
+ proposalId: any;
45
+ proposalRevisionId: any;
46
+ version: number;
47
+ renderVersion: number;
48
+ fileId: number;
49
+ fileName: string;
50
+ mimeType: string;
51
+ documentType: string;
52
+ downloadUrl: string;
53
+ html: string;
54
+ acceptance: {
55
+ status: string;
56
+ acceptedAt: any;
57
+ expectedSignerName: any;
58
+ expectedSignerEmail: any;
59
+ };
60
+ }>;
61
+ remove(data: DeleteDTO, locale: string, userId?: number): Promise<{
62
+ deleted: number;
63
+ ids: number[];
64
+ }>;
65
+ private publishProposalLifecycleEvent;
66
+ private buildProposalLifecyclePayload;
67
+ private assertPersonExists;
68
+ private resolveProposalCode;
69
+ private normalizeItems;
70
+ private normalizeDocuments;
71
+ private resolveTotals;
72
+ private getCurrentProposalRevision;
73
+ private assertProposalDocumentReadiness;
74
+ private upsertGeneratedProposalDocument;
75
+ private renderProposalPdfBuffer;
76
+ private buildProposalDocumentHtml;
77
+ private resolveProposalDocumentLogoUrl;
78
+ private resolveProposalDocumentCompanyName;
79
+ private buildProposalDocumentFileName;
80
+ private mergeProposalRevisionSnapshot;
81
+ private normalizeSnapshotJson;
82
+ private getProposalDocumentLabels;
83
+ private formatMoney;
84
+ private formatDateLabel;
85
+ private sanitizeDocumentHtml;
86
+ private humanizeEnumLabel;
87
+ private escapeHtml;
88
+ private lockProposalForTransition;
89
+ private assertProposalWorkflowReadiness;
90
+ private assertCanEdit;
91
+ private normalizeOptionalText;
92
+ private loadProposalDetail;
93
+ private loadProposalIntegrationSnapshot;
94
+ }
95
+ //# sourceMappingURL=proposal.service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"proposal.service.d.ts","sourceRoot":"","sources":["../../src/proposal/proposal.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EACH,WAAW,EACX,8BAA8B,EAC9B,cAAc,EACjB,MAAM,eAAe,CAAC;AASvB,OAAO,EACH,iBAAiB,EACjB,mBAAmB,EAGnB,oBAAoB,EAEpB,iBAAiB,EACjB,iBAAiB,EACpB,MAAM,oBAAoB,CAAC;AAO5B,qBACa,eAAe;IAIxB,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,cAAc;IAE/B,OAAO,CAAC,QAAQ,CAAC,WAAW;IAE5B,OAAO,CAAC,QAAQ,CAAC,cAAc;IARjC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAoC;gBAGxC,MAAM,EAAE,aAAa,EACrB,cAAc,EAAE,8BAA8B,EAE9C,WAAW,EAAE,WAAW,EAExB,cAAc,EAAE,cAAc;IAG3C,IAAI,CACR,MAAM,EAAE,aAAa,GACnB,oBAAoB,GAAG;QACrB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB;;;;;;;;;IAgFC,QAAQ;;;;;;;;IAuCR,OAAO,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;IAqBlC,MAAM,CAAC,IAAI,EAAE,iBAAiB,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM;IA4F/D,MAAM,CACV,EAAE,EAAE,MAAM,EACV,IAAI,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