@things-factory/quotation 9.0.0-beta.27 → 9.0.0-beta.29

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 (78) hide show
  1. package/dist-client/actions/main.d.ts +1 -0
  2. package/dist-client/actions/main.js +2 -0
  3. package/dist-client/actions/main.js.map +1 -0
  4. package/dist-client/activities/activity-quotation-edit.d.ts +14 -0
  5. package/dist-client/activities/activity-quotation-edit.js +87 -0
  6. package/dist-client/activities/activity-quotation-edit.js.map +1 -0
  7. package/dist-client/activities/activity-quotation-view.d.ts +14 -0
  8. package/dist-client/activities/activity-quotation-view.js +87 -0
  9. package/dist-client/activities/activity-quotation-view.js.map +1 -0
  10. package/dist-client/bootstrap.d.ts +1 -0
  11. package/dist-client/bootstrap.js +8 -0
  12. package/dist-client/bootstrap.js.map +1 -0
  13. package/dist-client/index.d.ts +1 -0
  14. package/dist-client/index.js +2 -0
  15. package/dist-client/index.js.map +1 -0
  16. package/dist-client/pages/main.d.ts +1 -0
  17. package/dist-client/pages/main.js +27 -0
  18. package/dist-client/pages/main.js.map +1 -0
  19. package/dist-client/pages/quotation/quotation-importer.d.ts +23 -0
  20. package/dist-client/pages/quotation/quotation-importer.js +94 -0
  21. package/dist-client/pages/quotation/quotation-importer.js.map +1 -0
  22. package/dist-client/pages/quotation/quotation-list-page.d.ts +61 -0
  23. package/dist-client/pages/quotation/quotation-list-page.js +306 -0
  24. package/dist-client/pages/quotation/quotation-list-page.js.map +1 -0
  25. package/dist-client/reducers/main.d.ts +6 -0
  26. package/dist-client/reducers/main.js +14 -0
  27. package/dist-client/reducers/main.js.map +1 -0
  28. package/dist-client/route.d.ts +1 -0
  29. package/dist-client/route.js +11 -0
  30. package/dist-client/route.js.map +1 -0
  31. package/dist-client/tsconfig.tsbuildinfo +1 -0
  32. package/dist-server/activities/activity-quotation.d.ts +42 -0
  33. package/dist-server/activities/activity-quotation.js +114 -0
  34. package/dist-server/activities/activity-quotation.js.map +1 -0
  35. package/dist-server/activities/index.d.ts +1 -0
  36. package/dist-server/activities/index.js +17 -0
  37. package/dist-server/activities/index.js.map +1 -0
  38. package/dist-server/controllers/index.d.ts +0 -0
  39. package/dist-server/controllers/index.js +1 -0
  40. package/dist-server/controllers/index.js.map +1 -0
  41. package/dist-server/index.d.ts +3 -0
  42. package/dist-server/index.js +7 -0
  43. package/dist-server/index.js.map +1 -0
  44. package/dist-server/middlewares/index.d.ts +1 -0
  45. package/dist-server/middlewares/index.js +7 -0
  46. package/dist-server/middlewares/index.js.map +1 -0
  47. package/dist-server/migrations/index.d.ts +1 -0
  48. package/dist-server/migrations/index.js +12 -0
  49. package/dist-server/migrations/index.js.map +1 -0
  50. package/dist-server/routes.d.ts +0 -0
  51. package/dist-server/routes.js +24 -0
  52. package/dist-server/routes.js.map +1 -0
  53. package/dist-server/service/index.d.ts +6 -0
  54. package/dist-server/service/index.js +23 -0
  55. package/dist-server/service/index.js.map +1 -0
  56. package/dist-server/service/quotation/event-subscriber.d.ts +7 -0
  57. package/dist-server/service/quotation/event-subscriber.js +21 -0
  58. package/dist-server/service/quotation/event-subscriber.js.map +1 -0
  59. package/dist-server/service/quotation/index.d.ts +7 -0
  60. package/dist-server/service/quotation/index.js +12 -0
  61. package/dist-server/service/quotation/index.js.map +1 -0
  62. package/dist-server/service/quotation/quotation-history.d.ts +25 -0
  63. package/dist-server/service/quotation/quotation-history.js +132 -0
  64. package/dist-server/service/quotation/quotation-history.js.map +1 -0
  65. package/dist-server/service/quotation/quotation-mutation.d.ts +10 -0
  66. package/dist-server/service/quotation/quotation-mutation.js +168 -0
  67. package/dist-server/service/quotation/quotation-mutation.js.map +1 -0
  68. package/dist-server/service/quotation/quotation-query.d.ts +12 -0
  69. package/dist-server/service/quotation/quotation-query.js +97 -0
  70. package/dist-server/service/quotation/quotation-query.js.map +1 -0
  71. package/dist-server/service/quotation/quotation-type.d.ts +23 -0
  72. package/dist-server/service/quotation/quotation-type.js +86 -0
  73. package/dist-server/service/quotation/quotation-type.js.map +1 -0
  74. package/dist-server/service/quotation/quotation.d.ts +25 -0
  75. package/dist-server/service/quotation/quotation.js +112 -0
  76. package/dist-server/service/quotation/quotation.js.map +1 -0
  77. package/dist-server/tsconfig.tsbuildinfo +1 -0
  78. package/package.json +5 -5
@@ -0,0 +1,97 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.QuotationQuery = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const type_graphql_1 = require("type-graphql");
6
+ const attachment_base_1 = require("@things-factory/attachment-base");
7
+ const shell_1 = require("@things-factory/shell");
8
+ const auth_base_1 = require("@things-factory/auth-base");
9
+ const quotation_1 = require("./quotation");
10
+ const quotation_type_1 = require("./quotation-type");
11
+ let QuotationQuery = class QuotationQuery {
12
+ async quotation(id, context) {
13
+ const { domain } = context.state;
14
+ return await (0, shell_1.getRepository)(quotation_1.Quotation).findOne({
15
+ where: { domain: { id: domain.id }, id }
16
+ });
17
+ }
18
+ async quotations(params, context) {
19
+ const { domain } = context.state;
20
+ const queryBuilder = (0, shell_1.getQueryBuilderFromListParams)({
21
+ domain,
22
+ params,
23
+ repository: await (0, shell_1.getRepository)(quotation_1.Quotation),
24
+ searchables: ['name', 'description']
25
+ });
26
+ const [items, total] = await queryBuilder.getManyAndCount();
27
+ return { items, total };
28
+ }
29
+ async thumbnail(quotation) {
30
+ const attachment = await (0, shell_1.getRepository)(attachment_base_1.Attachment).findOne({
31
+ where: {
32
+ domain: { id: quotation.domainId },
33
+ refType: quotation_1.Quotation.name,
34
+ refBy: quotation.id
35
+ }
36
+ });
37
+ return attachment === null || attachment === void 0 ? void 0 : attachment.fullpath;
38
+ }
39
+ async domain(quotation) {
40
+ return await (0, shell_1.getRepository)(shell_1.Domain).findOneBy({ id: quotation.domainId });
41
+ }
42
+ async updater(quotation) {
43
+ return await (0, shell_1.getRepository)(auth_base_1.User).findOneBy({ id: quotation.updaterId });
44
+ }
45
+ async creator(quotation) {
46
+ return await (0, shell_1.getRepository)(auth_base_1.User).findOneBy({ id: quotation.creatorId });
47
+ }
48
+ };
49
+ exports.QuotationQuery = QuotationQuery;
50
+ tslib_1.__decorate([
51
+ (0, type_graphql_1.Query)(returns => quotation_1.Quotation, { nullable: true, description: 'To fetch a Quotation' }),
52
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
53
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
54
+ tslib_1.__metadata("design:type", Function),
55
+ tslib_1.__metadata("design:paramtypes", [String, Object]),
56
+ tslib_1.__metadata("design:returntype", Promise)
57
+ ], QuotationQuery.prototype, "quotation", null);
58
+ tslib_1.__decorate([
59
+ (0, type_graphql_1.Query)(returns => quotation_type_1.QuotationList, { description: 'To fetch multiple Quotations' }),
60
+ tslib_1.__param(0, (0, type_graphql_1.Args)(type => shell_1.ListParam)),
61
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
62
+ tslib_1.__metadata("design:type", Function),
63
+ tslib_1.__metadata("design:paramtypes", [shell_1.ListParam, Object]),
64
+ tslib_1.__metadata("design:returntype", Promise)
65
+ ], QuotationQuery.prototype, "quotations", null);
66
+ tslib_1.__decorate([
67
+ (0, type_graphql_1.FieldResolver)(type => String),
68
+ tslib_1.__param(0, (0, type_graphql_1.Root)()),
69
+ tslib_1.__metadata("design:type", Function),
70
+ tslib_1.__metadata("design:paramtypes", [quotation_1.Quotation]),
71
+ tslib_1.__metadata("design:returntype", Promise)
72
+ ], QuotationQuery.prototype, "thumbnail", null);
73
+ tslib_1.__decorate([
74
+ (0, type_graphql_1.FieldResolver)(type => shell_1.Domain),
75
+ tslib_1.__param(0, (0, type_graphql_1.Root)()),
76
+ tslib_1.__metadata("design:type", Function),
77
+ tslib_1.__metadata("design:paramtypes", [quotation_1.Quotation]),
78
+ tslib_1.__metadata("design:returntype", Promise)
79
+ ], QuotationQuery.prototype, "domain", null);
80
+ tslib_1.__decorate([
81
+ (0, type_graphql_1.FieldResolver)(type => auth_base_1.User),
82
+ tslib_1.__param(0, (0, type_graphql_1.Root)()),
83
+ tslib_1.__metadata("design:type", Function),
84
+ tslib_1.__metadata("design:paramtypes", [quotation_1.Quotation]),
85
+ tslib_1.__metadata("design:returntype", Promise)
86
+ ], QuotationQuery.prototype, "updater", null);
87
+ tslib_1.__decorate([
88
+ (0, type_graphql_1.FieldResolver)(type => auth_base_1.User),
89
+ tslib_1.__param(0, (0, type_graphql_1.Root)()),
90
+ tslib_1.__metadata("design:type", Function),
91
+ tslib_1.__metadata("design:paramtypes", [quotation_1.Quotation]),
92
+ tslib_1.__metadata("design:returntype", Promise)
93
+ ], QuotationQuery.prototype, "creator", null);
94
+ exports.QuotationQuery = QuotationQuery = tslib_1.__decorate([
95
+ (0, type_graphql_1.Resolver)(quotation_1.Quotation)
96
+ ], QuotationQuery);
97
+ //# sourceMappingURL=quotation-query.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"quotation-query.js","sourceRoot":"","sources":["../../../server/service/quotation/quotation-query.ts"],"names":[],"mappings":";;;;AAAA,+CAA8F;AAC9F,qEAA4D;AAC5D,iDAAuG;AACvG,yDAAgD;AAChD,2CAAuC;AACvC,qDAAgD;AAGzC,IAAM,cAAc,GAApB,MAAM,cAAc;IAEnB,AAAN,KAAK,CAAC,SAAS,CAAY,EAAU,EAAS,OAAwB;QACpE,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAEhC,OAAO,MAAM,IAAA,qBAAa,EAAC,qBAAS,CAAC,CAAC,OAAO,CAAC;YAC5C,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE;SACzC,CAAC,CAAA;IACJ,CAAC;IAGK,AAAN,KAAK,CAAC,UAAU,CACW,MAAiB,EACnC,OAAwB;QAE/B,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAEhC,MAAM,YAAY,GAAG,IAAA,qC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DY,wCAAc;AAEnB;IADL,IAAA,oBAAK,EAAC,OAAO,CAAC,EAAE,CAAC,qBAAU,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,sBAAsB,EAAE,CAAC;IACrE,mBAAA,IAAA,kBAAG,EAAC,IAAI,CAAC,CAAA;IAAc,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;+CAM5C;AAGK;IADL,IAAA,oBAAK,EAAC,OAAO,CAAC,EAAE,CAAC,8BAAa,EAAE,EAAE,WAAW,EAAE,8BAA8B,EAAE,CAAC;IAE9E,mBAAA,IAAA,mBAAI,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAS,CAAC,CAAA;IACvB,mBAAA,IAAA,kBAAG,GAAE,CAAA;;6CAD2B,iBAAS;;gDAe3C;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,MAAM,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAY,qBAAS;;+CAU3C;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,CAAC;IAChB,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAY,qBAAS;;4CAExC;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAY,qBAAS;;6CAEzC;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAY,qBAAS;;6CAEzC;yBAvDU,cAAc;IAD1B,IAAA,uBAAQ,EAAC,qBAAS,CAAC;GACP,cAAc,CAwD1B","sourcesContent":["import { Resolver, Query, FieldResolver, Root, Args, Arg, Ctx, Directive } from 'type-graphql'\nimport { Attachment } from '@things-factory/attachment-base'\nimport { Domain, getQueryBuilderFromListParams, getRepository, ListParam } from '@things-factory/shell'\nimport { User } from '@things-factory/auth-base'\nimport { Quotation } from './quotation'\nimport { QuotationList } from './quotation-type'\n\n@Resolver(Quotation)\nexport class QuotationQuery {\n @Query(returns => Quotation!, { nullable: true, description: 'To fetch a Quotation' })\n async quotation(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<Quotation> {\n const { domain } = context.state\n\n return await getRepository(Quotation).findOne({\n where: { domain: { id: domain.id }, id }\n })\n }\n\n @Query(returns => QuotationList, { description: 'To fetch multiple Quotations' })\n async quotations(\n @Args(type => ListParam) params: ListParam,\n @Ctx() context: ResolverContext\n ): Promise<QuotationList> {\n const { domain } = context.state\n\n const queryBuilder = getQueryBuilderFromListParams({\n domain,\n params,\n repository: await getRepository(Quotation),\n searchables: ['name', 'description']\n })\n\n const [items, total] = await queryBuilder.getManyAndCount()\n\n return { items, total }\n }\n\n @FieldResolver(type => String)\n async thumbnail(@Root() quotation: Quotation): Promise<string | undefined> {\n const attachment: Attachment = await getRepository(Attachment).findOne({\n where: {\n domain: { id: quotation.domainId },\n refType: Quotation.name,\n refBy: quotation.id\n }\n })\n\n return attachment?.fullpath\n }\n\n @FieldResolver(type => Domain)\n async domain(@Root() quotation: Quotation): Promise<Domain> {\n return await getRepository(Domain).findOneBy({ id: quotation.domainId })\n }\n\n @FieldResolver(type => User)\n async updater(@Root() quotation: Quotation): Promise<User> {\n return await getRepository(User).findOneBy({ id: quotation.updaterId })\n }\n\n @FieldResolver(type => User)\n async creator(@Root() quotation: Quotation): Promise<User> {\n return await getRepository(User).findOneBy({ id: quotation.creatorId })\n }\n}\n"]}
@@ -0,0 +1,23 @@
1
+ import type { FileUpload } from 'graphql-upload/GraphQLUpload.js';
2
+ import { Quotation, QuotationStatus } from './quotation';
3
+ export declare class NewQuotation {
4
+ name: string;
5
+ description?: string;
6
+ state?: QuotationStatus;
7
+ active?: boolean;
8
+ params?: string;
9
+ thumbnail?: FileUpload;
10
+ }
11
+ export declare class QuotationPatch {
12
+ id?: string;
13
+ name?: string;
14
+ description?: string;
15
+ state?: QuotationStatus;
16
+ active?: boolean;
17
+ thumbnail?: FileUpload;
18
+ cuFlag?: string;
19
+ }
20
+ export declare class QuotationList {
21
+ items: Quotation[];
22
+ total: number;
23
+ }
@@ -0,0 +1,86 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.QuotationList = exports.QuotationPatch = exports.NewQuotation = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const GraphQLUpload_js_1 = tslib_1.__importDefault(require("graphql-upload/GraphQLUpload.js"));
6
+ const type_graphql_1 = require("type-graphql");
7
+ const quotation_1 = require("./quotation");
8
+ let NewQuotation = class NewQuotation {
9
+ };
10
+ exports.NewQuotation = NewQuotation;
11
+ tslib_1.__decorate([
12
+ (0, type_graphql_1.Field)(),
13
+ tslib_1.__metadata("design:type", String)
14
+ ], NewQuotation.prototype, "name", void 0);
15
+ tslib_1.__decorate([
16
+ (0, type_graphql_1.Field)({ nullable: true }),
17
+ tslib_1.__metadata("design:type", String)
18
+ ], NewQuotation.prototype, "description", void 0);
19
+ tslib_1.__decorate([
20
+ (0, type_graphql_1.Field)(type => quotation_1.QuotationStatus, { nullable: true }),
21
+ tslib_1.__metadata("design:type", String)
22
+ ], NewQuotation.prototype, "state", void 0);
23
+ tslib_1.__decorate([
24
+ (0, type_graphql_1.Field)({ nullable: true }),
25
+ tslib_1.__metadata("design:type", Boolean)
26
+ ], NewQuotation.prototype, "active", void 0);
27
+ tslib_1.__decorate([
28
+ (0, type_graphql_1.Field)({ nullable: true }),
29
+ tslib_1.__metadata("design:type", String)
30
+ ], NewQuotation.prototype, "params", void 0);
31
+ tslib_1.__decorate([
32
+ (0, type_graphql_1.Field)(type => GraphQLUpload_js_1.default, { nullable: true }),
33
+ tslib_1.__metadata("design:type", Object)
34
+ ], NewQuotation.prototype, "thumbnail", void 0);
35
+ exports.NewQuotation = NewQuotation = tslib_1.__decorate([
36
+ (0, type_graphql_1.InputType)()
37
+ ], NewQuotation);
38
+ let QuotationPatch = class QuotationPatch {
39
+ };
40
+ exports.QuotationPatch = QuotationPatch;
41
+ tslib_1.__decorate([
42
+ (0, type_graphql_1.Field)(type => type_graphql_1.ID, { nullable: true }),
43
+ tslib_1.__metadata("design:type", String)
44
+ ], QuotationPatch.prototype, "id", void 0);
45
+ tslib_1.__decorate([
46
+ (0, type_graphql_1.Field)({ nullable: true }),
47
+ tslib_1.__metadata("design:type", String)
48
+ ], QuotationPatch.prototype, "name", void 0);
49
+ tslib_1.__decorate([
50
+ (0, type_graphql_1.Field)({ nullable: true }),
51
+ tslib_1.__metadata("design:type", String)
52
+ ], QuotationPatch.prototype, "description", void 0);
53
+ tslib_1.__decorate([
54
+ (0, type_graphql_1.Field)(type => quotation_1.QuotationStatus, { nullable: true }),
55
+ tslib_1.__metadata("design:type", String)
56
+ ], QuotationPatch.prototype, "state", void 0);
57
+ tslib_1.__decorate([
58
+ (0, type_graphql_1.Field)({ nullable: true }),
59
+ tslib_1.__metadata("design:type", Boolean)
60
+ ], QuotationPatch.prototype, "active", void 0);
61
+ tslib_1.__decorate([
62
+ (0, type_graphql_1.Field)(type => GraphQLUpload_js_1.default, { nullable: true }),
63
+ tslib_1.__metadata("design:type", Object)
64
+ ], QuotationPatch.prototype, "thumbnail", void 0);
65
+ tslib_1.__decorate([
66
+ (0, type_graphql_1.Field)({ nullable: true }),
67
+ tslib_1.__metadata("design:type", String)
68
+ ], QuotationPatch.prototype, "cuFlag", void 0);
69
+ exports.QuotationPatch = QuotationPatch = tslib_1.__decorate([
70
+ (0, type_graphql_1.InputType)()
71
+ ], QuotationPatch);
72
+ let QuotationList = class QuotationList {
73
+ };
74
+ exports.QuotationList = QuotationList;
75
+ tslib_1.__decorate([
76
+ (0, type_graphql_1.Field)(type => [quotation_1.Quotation]),
77
+ tslib_1.__metadata("design:type", Array)
78
+ ], QuotationList.prototype, "items", void 0);
79
+ tslib_1.__decorate([
80
+ (0, type_graphql_1.Field)(type => type_graphql_1.Int),
81
+ tslib_1.__metadata("design:type", Number)
82
+ ], QuotationList.prototype, "total", void 0);
83
+ exports.QuotationList = QuotationList = tslib_1.__decorate([
84
+ (0, type_graphql_1.ObjectType)()
85
+ ], QuotationList);
86
+ //# sourceMappingURL=quotation-type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"quotation-type.js","sourceRoot":"","sources":["../../../server/service/quotation/quotation-type.ts"],"names":[],"mappings":";;;;AACA,+FAA2D;AAC3D,+CAAsF;AAItF,2CAAwD;AAGjD,IAAM,YAAY,GAAlB,MAAM,YAAY;CAkBxB,CAAA;AAlBY,oCAAY;AAEvB;IADC,IAAA,oBAAK,GAAE;;0CACI;AAGZ;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;iDACN;AAGpB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,2BAAe,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;2CAC5B;AAGvB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;4CACV;AAGhB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;4CACX;AAGf;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,0BAAa,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;+CAC3B;uBAjBX,YAAY;IADxB,IAAA,wBAAS,GAAE;GACC,YAAY,CAkBxB;AAGM,IAAM,cAAc,GAApB,MAAM,cAAc;CAqB1B,CAAA;AArBY,wCAAc;AAEzB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;0CAC3B;AAGX;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;4CACb;AAGb;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;mDACN;AAGpB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,2BAAe,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;6CAC5B;AAGvB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;8CACV;AAGhB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,0BAAa,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;iDAC3B;AAGtB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;8CACX;yBApBJ,cAAc;IAD1B,IAAA,wBAAS,GAAE;GACC,cAAc,CAqB1B;AAGM,IAAM,aAAa,GAAnB,MAAM,aAAa;CAMzB,CAAA;AANY,sCAAa;AAExB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,qBAAS,CAAC,CAAC;;4CACT;AAGlB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,CAAC;;4CACN;wBALF,aAAa;IADzB,IAAA,yBAAU,GAAE;GACA,aAAa,CAMzB","sourcesContent":["import type { FileUpload } from 'graphql-upload/GraphQLUpload.js'\nimport GraphQLUpload from 'graphql-upload/GraphQLUpload.js'\nimport { ObjectType, Field, InputType, Int, ID, registerEnumType } from 'type-graphql'\n\nimport { ObjectRef, ScalarObject } from '@things-factory/shell'\n\nimport { Quotation, QuotationStatus } from './quotation'\n\n@InputType()\nexport class NewQuotation {\n @Field()\n name: string\n\n @Field({ nullable: true })\n description?: string\n\n @Field(type => QuotationStatus, { nullable: true })\n state?: QuotationStatus\n\n @Field({ nullable: true })\n active?: boolean\n\n @Field({ nullable: true })\n params?: string\n\n @Field(type => GraphQLUpload, { nullable: true })\n thumbnail?: FileUpload\n}\n\n@InputType()\nexport class QuotationPatch {\n @Field(type => ID, { nullable: true })\n id?: string\n\n @Field({ nullable: true })\n name?: string\n\n @Field({ nullable: true })\n description?: string\n\n @Field(type => QuotationStatus, { nullable: true })\n state?: QuotationStatus\n\n @Field({ nullable: true })\n active?: boolean\n\n @Field(type => GraphQLUpload, { nullable: true })\n thumbnail?: FileUpload\n\n @Field({ nullable: true })\n cuFlag?: string\n}\n\n@ObjectType()\nexport class QuotationList {\n @Field(type => [Quotation])\n items: Quotation[]\n\n @Field(type => Int)\n total: number\n}\n"]}
@@ -0,0 +1,25 @@
1
+ import { Domain } from '@things-factory/shell';
2
+ import { User } from '@things-factory/auth-base';
3
+ export declare enum QuotationStatus {
4
+ STATUS_A = "STATUS_A",
5
+ STATUS_B = "STATUS_B"
6
+ }
7
+ export declare class Quotation {
8
+ readonly id: string;
9
+ version?: number;
10
+ domain?: Domain;
11
+ domainId?: string;
12
+ name?: string;
13
+ description?: string;
14
+ active?: boolean;
15
+ state?: QuotationStatus;
16
+ params?: string;
17
+ createdAt?: Date;
18
+ updatedAt?: Date;
19
+ deletedAt?: Date;
20
+ creator?: User;
21
+ creatorId?: string;
22
+ updater?: User;
23
+ updaterId?: string;
24
+ thumbnail?: string;
25
+ }
@@ -0,0 +1,112 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Quotation = exports.QuotationStatus = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const typeorm_1 = require("typeorm");
6
+ const type_graphql_1 = require("type-graphql");
7
+ const shell_1 = require("@things-factory/shell");
8
+ const auth_base_1 = require("@things-factory/auth-base");
9
+ var QuotationStatus;
10
+ (function (QuotationStatus) {
11
+ QuotationStatus["STATUS_A"] = "STATUS_A";
12
+ QuotationStatus["STATUS_B"] = "STATUS_B";
13
+ })(QuotationStatus || (exports.QuotationStatus = QuotationStatus = {}));
14
+ (0, type_graphql_1.registerEnumType)(QuotationStatus, {
15
+ name: 'QuotationStatus',
16
+ description: 'state enumeration of a quotation'
17
+ });
18
+ let Quotation = class Quotation {
19
+ constructor() {
20
+ this.version = 1;
21
+ }
22
+ };
23
+ exports.Quotation = Quotation;
24
+ tslib_1.__decorate([
25
+ (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
26
+ (0, type_graphql_1.Field)(type => type_graphql_1.ID),
27
+ tslib_1.__metadata("design:type", String)
28
+ ], Quotation.prototype, "id", void 0);
29
+ tslib_1.__decorate([
30
+ (0, typeorm_1.VersionColumn)(),
31
+ (0, type_graphql_1.Field)({ nullable: true }),
32
+ tslib_1.__metadata("design:type", Number)
33
+ ], Quotation.prototype, "version", void 0);
34
+ tslib_1.__decorate([
35
+ (0, typeorm_1.ManyToOne)(type => shell_1.Domain),
36
+ (0, type_graphql_1.Field)(type => shell_1.Domain),
37
+ tslib_1.__metadata("design:type", shell_1.Domain)
38
+ ], Quotation.prototype, "domain", void 0);
39
+ tslib_1.__decorate([
40
+ (0, typeorm_1.RelationId)((quotation) => quotation.domain),
41
+ tslib_1.__metadata("design:type", String)
42
+ ], Quotation.prototype, "domainId", void 0);
43
+ tslib_1.__decorate([
44
+ (0, typeorm_1.Column)(),
45
+ (0, type_graphql_1.Field)({ nullable: true }),
46
+ tslib_1.__metadata("design:type", String)
47
+ ], Quotation.prototype, "name", void 0);
48
+ tslib_1.__decorate([
49
+ (0, typeorm_1.Column)({ nullable: true }),
50
+ (0, type_graphql_1.Field)({ nullable: true }),
51
+ tslib_1.__metadata("design:type", String)
52
+ ], Quotation.prototype, "description", void 0);
53
+ tslib_1.__decorate([
54
+ (0, typeorm_1.Column)({ nullable: true }),
55
+ (0, type_graphql_1.Field)({ nullable: true }),
56
+ tslib_1.__metadata("design:type", Boolean)
57
+ ], Quotation.prototype, "active", void 0);
58
+ tslib_1.__decorate([
59
+ (0, typeorm_1.Column)({ nullable: true }),
60
+ (0, type_graphql_1.Field)({ nullable: true }),
61
+ tslib_1.__metadata("design:type", String)
62
+ ], Quotation.prototype, "state", void 0);
63
+ tslib_1.__decorate([
64
+ (0, typeorm_1.Column)({ nullable: true }),
65
+ (0, type_graphql_1.Field)({ nullable: true }),
66
+ tslib_1.__metadata("design:type", String)
67
+ ], Quotation.prototype, "params", void 0);
68
+ tslib_1.__decorate([
69
+ (0, typeorm_1.CreateDateColumn)(),
70
+ (0, type_graphql_1.Field)({ nullable: true }),
71
+ tslib_1.__metadata("design:type", Date)
72
+ ], Quotation.prototype, "createdAt", void 0);
73
+ tslib_1.__decorate([
74
+ (0, typeorm_1.UpdateDateColumn)(),
75
+ (0, type_graphql_1.Field)({ nullable: true }),
76
+ tslib_1.__metadata("design:type", Date)
77
+ ], Quotation.prototype, "updatedAt", void 0);
78
+ tslib_1.__decorate([
79
+ (0, typeorm_1.DeleteDateColumn)(),
80
+ (0, type_graphql_1.Field)({ nullable: true }),
81
+ tslib_1.__metadata("design:type", Date)
82
+ ], Quotation.prototype, "deletedAt", void 0);
83
+ tslib_1.__decorate([
84
+ (0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
85
+ (0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true }),
86
+ tslib_1.__metadata("design:type", auth_base_1.User)
87
+ ], Quotation.prototype, "creator", void 0);
88
+ tslib_1.__decorate([
89
+ (0, typeorm_1.RelationId)((quotation) => quotation.creator),
90
+ tslib_1.__metadata("design:type", String)
91
+ ], Quotation.prototype, "creatorId", void 0);
92
+ tslib_1.__decorate([
93
+ (0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
94
+ (0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true }),
95
+ tslib_1.__metadata("design:type", auth_base_1.User)
96
+ ], Quotation.prototype, "updater", void 0);
97
+ tslib_1.__decorate([
98
+ (0, typeorm_1.RelationId)((quotation) => quotation.updater),
99
+ tslib_1.__metadata("design:type", String)
100
+ ], Quotation.prototype, "updaterId", void 0);
101
+ tslib_1.__decorate([
102
+ (0, type_graphql_1.Field)(type => String, { nullable: true }),
103
+ tslib_1.__metadata("design:type", String)
104
+ ], Quotation.prototype, "thumbnail", void 0);
105
+ exports.Quotation = Quotation = tslib_1.__decorate([
106
+ (0, typeorm_1.Entity)(),
107
+ (0, typeorm_1.Index)('ix_quotation_0', (quotation) => [quotation.domain, quotation.name, quotation.deletedAt], {
108
+ unique: true
109
+ }),
110
+ (0, type_graphql_1.ObjectType)({ description: 'Entity for Quotation' })
111
+ ], Quotation);
112
+ //# sourceMappingURL=quotation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"quotation.js","sourceRoot":"","sources":["../../../server/service/quotation/quotation.ts"],"names":[],"mappings":";;;;AAAA,qCAWgB;AAChB,+CAA2E;AAE3E,iDAA8C;AAC9C,yDAAgD;AAEhD,IAAY,eAGX;AAHD,WAAY,eAAe;IACzB,wCAAqB,CAAA;IACrB,wCAAqB,CAAA;AACvB,CAAC,EAHW,eAAe,+BAAf,eAAe,QAG1B;AAED,IAAA,+BAAgB,EAAC,eAAe,EAAE;IAChC,IAAI,EAAE,iBAAiB;IACvB,WAAW,EAAE,kCAAkC;CAChD,CAAC,CAAA;AAOK,IAAM,SAAS,GAAf,MAAM,SAAS;IAAf;QAOL,YAAO,GAAY,CAAC,CAAA;IAyDtB,CAAC;CAAA,CAAA;AAhEY,8BAAS;AAGX;IAFR,IAAA,gCAAsB,EAAC,MAAM,CAAC;IAC9B,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,CAAC;;qCACC;AAInB;IAFC,IAAA,uBAAa,GAAE;IACf,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;0CACN;AAIpB;IAFC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,CAAC;IACzB,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,CAAC;sCACb,cAAM;yCAAA;AAGf;IADC,IAAA,oBAAU,EAAC,CAAC,SAAoB,EAAE,EAAE,CAAC,SAAS,CAAC,MAAM,CAAC;;2CACtC;AAIjB;IAFC,IAAA,gBAAM,GAAE;IACR,IAAA,oBAAK,EAAC,EAA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E,CAAC,SAAS,CAAC,OAAO,CAAC;;4CACtC;AAIlB;IAFC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC3C,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCAC9B,gBAAI;0CAAA;AAGd;IADC,IAAA,oBAAU,EAAC,CAAC,SAAoB,EAAE,EAAE,CAAC,SAAS,CAAC,OAAO,CAAC;;4CACtC;AAGlB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,MAAM,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;4CACxB;oBA/DP,SAAS;IALrB,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EAAC,gBAAgB,EAAE,CAAC,SAAoB,EAAE,EAAE,CAAC,CAAC,SAAS,CAAC,MAAM,EAAE,SAAS,CAAC,IAAI,EAAE,SAAS,CAAC,SAAS,CAAC,EAAE;QAC1G,MAAM,EAAE,IAAI;KACb,CAAC;IACD,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,sBAAsB,EAAE,CAAC;GACvC,SAAS,CAgErB","sourcesContent":["import {\n CreateDateColumn,\n UpdateDateColumn,\n DeleteDateColumn,\n Entity,\n Index,\n Column,\n RelationId,\n ManyToOne,\n PrimaryGeneratedColumn,\n VersionColumn\n} from 'typeorm'\nimport { ObjectType, Field, Int, ID, registerEnumType } from 'type-graphql'\n\nimport { Domain } from '@things-factory/shell'\nimport { User } from '@things-factory/auth-base'\n\nexport enum QuotationStatus {\n STATUS_A = 'STATUS_A',\n STATUS_B = 'STATUS_B'\n}\n\nregisterEnumType(QuotationStatus, {\n name: 'QuotationStatus',\n description: 'state enumeration of a quotation'\n})\n\n@Entity()\n@Index('ix_quotation_0', (quotation: Quotation) => [quotation.domain, quotation.name, quotation.deletedAt], {\n unique: true\n})\n@ObjectType({ description: 'Entity for Quotation' })\nexport class Quotation {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID)\n readonly id: string\n\n @VersionColumn()\n @Field({ nullable: true })\n version?: number = 1\n\n @ManyToOne(type => Domain)\n @Field(type => Domain)\n domain?: Domain\n\n @RelationId((quotation: Quotation) => quotation.domain)\n domainId?: string\n\n @Column()\n @Field({ nullable: true })\n name?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n description?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n active?: boolean\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n state?: QuotationStatus\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n params?: string\n\n @CreateDateColumn()\n @Field({ nullable: true })\n createdAt?: Date\n\n @UpdateDateColumn()\n @Field({ nullable: true })\n updatedAt?: Date\n\n @DeleteDateColumn()\n @Field({ nullable: true })\n deletedAt?: Date\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true })\n creator?: User\n\n @RelationId((quotation: Quotation) => quotation.creator)\n creatorId?: string\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true })\n updater?: User\n\n @RelationId((quotation: Quotation) => quotation.updater)\n updaterId?: string\n\n @Field(type => String, { nullable: true })\n thumbnail?: string\n}\n"]}