@things-factory/calendar 10.1.203 → 10.1.206

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 (114) hide show
  1. package/dist-client/pages/calendar/calendar-list-page.d.ts +1 -9
  2. package/dist-client/pages/calendar/calendar-list-page.js +2 -27
  3. package/dist-client/pages/calendar/calendar-list-page.js.map +1 -1
  4. package/dist-client/pages/event/event-list-page.d.ts +5 -28
  5. package/dist-client/pages/event/event-list-page.js +65 -177
  6. package/dist-client/pages/event/event-list-page.js.map +1 -1
  7. package/dist-client/route.d.ts +1 -1
  8. package/dist-client/route.js +0 -3
  9. package/dist-client/route.js.map +1 -1
  10. package/dist-client/tsconfig.tsbuildinfo +1 -1
  11. package/dist-server/index.d.ts +1 -0
  12. package/dist-server/index.js +5 -0
  13. package/dist-server/index.js.map +1 -1
  14. package/dist-server/role-tasks.d.ts +2 -0
  15. package/dist-server/role-tasks.js +16 -0
  16. package/dist-server/role-tasks.js.map +1 -0
  17. package/dist-server/service/attendee/attendee-query.d.ts +7 -4
  18. package/dist-server/service/attendee/attendee-query.js +34 -25
  19. package/dist-server/service/attendee/attendee-query.js.map +1 -1
  20. package/dist-server/service/attendee/attendee-service.d.ts +41 -0
  21. package/dist-server/service/attendee/attendee-service.js +90 -0
  22. package/dist-server/service/attendee/attendee-service.js.map +1 -0
  23. package/dist-server/service/attendee/attendee-type.d.ts +3 -15
  24. package/dist-server/service/attendee/attendee-type.js +12 -53
  25. package/dist-server/service/attendee/attendee-type.js.map +1 -1
  26. package/dist-server/service/attendee/attendee.d.ts +24 -7
  27. package/dist-server/service/attendee/attendee.js +99 -23
  28. package/dist-server/service/attendee/attendee.js.map +1 -1
  29. package/dist-server/service/attendee/index.d.ts +1 -2
  30. package/dist-server/service/attendee/index.js +1 -2
  31. package/dist-server/service/attendee/index.js.map +1 -1
  32. package/dist-server/service/calendar/calendar-mutation.d.ts +1 -3
  33. package/dist-server/service/calendar/calendar-mutation.js +21 -94
  34. package/dist-server/service/calendar/calendar-mutation.js.map +1 -1
  35. package/dist-server/service/calendar/calendar-query.d.ts +1 -1
  36. package/dist-server/service/calendar/calendar-query.js +15 -17
  37. package/dist-server/service/calendar/calendar-query.js.map +1 -1
  38. package/dist-server/service/calendar/calendar-service.d.ts +10 -0
  39. package/dist-server/service/calendar/calendar-service.js +58 -0
  40. package/dist-server/service/calendar/calendar-service.js.map +1 -0
  41. package/dist-server/service/calendar/calendar-type.d.ts +1 -4
  42. package/dist-server/service/calendar/calendar-type.js +13 -25
  43. package/dist-server/service/calendar/calendar-type.js.map +1 -1
  44. package/dist-server/service/calendar/calendar.d.ts +7 -8
  45. package/dist-server/service/calendar/calendar.js +23 -33
  46. package/dist-server/service/calendar/calendar.js.map +1 -1
  47. package/dist-server/service/event/event-mutation.d.ts +6 -4
  48. package/dist-server/service/event/event-mutation.js +60 -83
  49. package/dist-server/service/event/event-mutation.js.map +1 -1
  50. package/dist-server/service/event/event-query.d.ts +11 -1
  51. package/dist-server/service/event/event-query.js +106 -13
  52. package/dist-server/service/event/event-query.js.map +1 -1
  53. package/dist-server/service/event/event-rules.d.ts +10 -0
  54. package/dist-server/service/event/event-rules.js +38 -0
  55. package/dist-server/service/event/event-rules.js.map +1 -0
  56. package/dist-server/service/event/event-service.d.ts +42 -0
  57. package/dist-server/service/event/event-service.js +159 -0
  58. package/dist-server/service/event/event-service.js.map +1 -0
  59. package/dist-server/service/event/event-type.d.ts +10 -11
  60. package/dist-server/service/event/event-type.js +32 -36
  61. package/dist-server/service/event/event-type.js.map +1 -1
  62. package/dist-server/service/event/event.d.ts +25 -11
  63. package/dist-server/service/event/event.js +89 -36
  64. package/dist-server/service/event/event.js.map +1 -1
  65. package/dist-server/service/event-series/event-series-mutation.d.ts +11 -0
  66. package/dist-server/service/event-series/event-series-mutation.js +100 -0
  67. package/dist-server/service/event-series/event-series-mutation.js.map +1 -0
  68. package/dist-server/service/event-series/event-series-query.d.ts +16 -0
  69. package/dist-server/service/event-series/event-series-query.js +109 -0
  70. package/dist-server/service/event-series/event-series-query.js.map +1 -0
  71. package/dist-server/service/event-series/event-series-service.d.ts +40 -0
  72. package/dist-server/service/event-series/event-series-service.js +253 -0
  73. package/dist-server/service/event-series/event-series-service.js.map +1 -0
  74. package/dist-server/service/event-series/event-series-type.d.ts +41 -0
  75. package/dist-server/service/event-series/event-series-type.js +155 -0
  76. package/dist-server/service/event-series/event-series-type.js.map +1 -0
  77. package/dist-server/service/event-series/event-series.d.ts +32 -0
  78. package/dist-server/service/event-series/event-series.js +134 -0
  79. package/dist-server/service/event-series/event-series.js.map +1 -0
  80. package/dist-server/service/event-series/index.d.ts +6 -0
  81. package/dist-server/service/event-series/index.js +10 -0
  82. package/dist-server/service/event-series/index.js.map +1 -0
  83. package/dist-server/service/event-series/recurrence.d.ts +19 -0
  84. package/dist-server/service/event-series/recurrence.js +95 -0
  85. package/dist-server/service/event-series/recurrence.js.map +1 -0
  86. package/dist-server/service/index.d.ts +15 -4
  87. package/dist-server/service/index.js +29 -11
  88. package/dist-server/service/index.js.map +1 -1
  89. package/dist-server/tsconfig.tsbuildinfo +1 -1
  90. package/package.json +8 -5
  91. package/tests/open-doors.test.ts +18 -21
  92. package/things-factory.config.js +0 -4
  93. package/translations/en.json +44 -1
  94. package/translations/es.json +44 -1
  95. package/translations/ja.json +44 -1
  96. package/translations/ko.json +44 -1
  97. package/translations/ms.json +44 -1
  98. package/translations/zh.json +44 -1
  99. package/concept.md +0 -31
  100. package/dist-client/pages/attendee/attendee-importer.d.ts +0 -23
  101. package/dist-client/pages/attendee/attendee-importer.js +0 -93
  102. package/dist-client/pages/attendee/attendee-importer.js.map +0 -1
  103. package/dist-client/pages/attendee/attendee-list-page.d.ts +0 -56
  104. package/dist-client/pages/attendee/attendee-list-page.js +0 -263
  105. package/dist-client/pages/attendee/attendee-list-page.js.map +0 -1
  106. package/dist-client/pages/calendar/calendar-importer.d.ts +0 -23
  107. package/dist-client/pages/calendar/calendar-importer.js +0 -93
  108. package/dist-client/pages/calendar/calendar-importer.js.map +0 -1
  109. package/dist-client/pages/event/event-importer.d.ts +0 -23
  110. package/dist-client/pages/event/event-importer.js +0 -93
  111. package/dist-client/pages/event/event-importer.js.map +0 -1
  112. package/dist-server/service/attendee/attendee-mutation.d.ts +0 -10
  113. package/dist-server/service/attendee/attendee-mutation.js +0 -140
  114. package/dist-server/service/attendee/attendee-mutation.js.map +0 -1
@@ -1,20 +1,19 @@
1
1
  import { Domain } from '@things-factory/shell';
2
2
  import { User } from '@things-factory/auth-base';
3
- export declare enum CalendarStatus {
4
- STATUS_A = "STATUS_A",
5
- STATUS_B = "STATUS_B"
6
- }
3
+ /**
4
+ * A named group of events in a domain — "management meetings", "plant holidays". Events and series may belong to
5
+ * one; it is optional.
6
+ */
7
7
  export declare class Calendar {
8
8
  readonly id: string;
9
9
  domain?: Domain;
10
10
  domainId?: string;
11
- name?: string;
11
+ name: string;
12
12
  description?: string;
13
- active?: boolean;
14
- state?: CalendarStatus;
15
- params?: string;
13
+ active: boolean;
16
14
  createdAt?: Date;
17
15
  updatedAt?: Date;
16
+ deletedAt?: Date;
18
17
  creator?: User;
19
18
  creatorId?: string;
20
19
  updater?: User;
@@ -1,31 +1,26 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Calendar = exports.CalendarStatus = void 0;
3
+ exports.Calendar = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const typeorm_1 = require("typeorm");
6
6
  const type_graphql_1 = require("type-graphql");
7
7
  const shell_1 = require("@things-factory/shell");
8
8
  const auth_base_1 = require("@things-factory/auth-base");
9
- var CalendarStatus;
10
- (function (CalendarStatus) {
11
- CalendarStatus["STATUS_A"] = "STATUS_A";
12
- CalendarStatus["STATUS_B"] = "STATUS_B";
13
- })(CalendarStatus || (exports.CalendarStatus = CalendarStatus = {}));
14
- (0, type_graphql_1.registerEnumType)(CalendarStatus, {
15
- name: 'CalendarStatus',
16
- description: 'state enumeration of a calendar'
17
- });
9
+ /**
10
+ * A named group of events in a domain — "management meetings", "plant holidays". Events and series may belong to
11
+ * one; it is optional.
12
+ */
18
13
  let Calendar = class Calendar {
19
14
  };
20
15
  exports.Calendar = Calendar;
21
16
  tslib_1.__decorate([
22
17
  (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
23
- (0, type_graphql_1.Field)(type => type_graphql_1.ID),
18
+ (0, type_graphql_1.Field)(type => type_graphql_1.ID, { description: 'Unique identifier of the calendar' }),
24
19
  tslib_1.__metadata("design:type", String)
25
20
  ], Calendar.prototype, "id", void 0);
26
21
  tslib_1.__decorate([
27
22
  (0, typeorm_1.ManyToOne)(type => shell_1.Domain),
28
- (0, type_graphql_1.Field)(type => shell_1.Domain),
23
+ (0, type_graphql_1.Field)(type => shell_1.Domain, { nullable: true, description: 'The domain the calendar belongs to' }),
29
24
  tslib_1.__metadata("design:type", shell_1.Domain)
30
25
  ], Calendar.prototype, "domain", void 0);
31
26
  tslib_1.__decorate([
@@ -34,42 +29,37 @@ tslib_1.__decorate([
34
29
  ], Calendar.prototype, "domainId", void 0);
35
30
  tslib_1.__decorate([
36
31
  (0, typeorm_1.Column)(),
37
- (0, type_graphql_1.Field)({ nullable: true }),
32
+ (0, type_graphql_1.Field)({ description: 'Name of the calendar, unique in the domain' }),
38
33
  tslib_1.__metadata("design:type", String)
39
34
  ], Calendar.prototype, "name", void 0);
40
35
  tslib_1.__decorate([
41
- (0, typeorm_1.Column)({ nullable: true }),
42
- (0, type_graphql_1.Field)({ nullable: true }),
36
+ (0, typeorm_1.Column)({ type: 'text', nullable: true }),
37
+ (0, type_graphql_1.Field)({ nullable: true, description: 'What the calendar is for' }),
43
38
  tslib_1.__metadata("design:type", String)
44
39
  ], Calendar.prototype, "description", void 0);
45
40
  tslib_1.__decorate([
46
- (0, typeorm_1.Column)({ nullable: true }),
47
- (0, type_graphql_1.Field)({ nullable: true }),
41
+ (0, typeorm_1.Column)({ default: true }),
42
+ (0, type_graphql_1.Field)({ description: 'Whether the calendar is in use' }),
48
43
  tslib_1.__metadata("design:type", Boolean)
49
44
  ], Calendar.prototype, "active", void 0);
50
- tslib_1.__decorate([
51
- (0, typeorm_1.Column)({ nullable: true }),
52
- (0, type_graphql_1.Field)({ nullable: true }),
53
- tslib_1.__metadata("design:type", String)
54
- ], Calendar.prototype, "state", void 0);
55
- tslib_1.__decorate([
56
- (0, typeorm_1.Column)({ nullable: true }),
57
- (0, type_graphql_1.Field)({ nullable: true }),
58
- tslib_1.__metadata("design:type", String)
59
- ], Calendar.prototype, "params", void 0);
60
45
  tslib_1.__decorate([
61
46
  (0, typeorm_1.CreateDateColumn)(),
62
- (0, type_graphql_1.Field)({ nullable: true }),
47
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Creation timestamp' }),
63
48
  tslib_1.__metadata("design:type", Date)
64
49
  ], Calendar.prototype, "createdAt", void 0);
65
50
  tslib_1.__decorate([
66
51
  (0, typeorm_1.UpdateDateColumn)(),
67
- (0, type_graphql_1.Field)({ nullable: true }),
52
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Last update timestamp' }),
68
53
  tslib_1.__metadata("design:type", Date)
69
54
  ], Calendar.prototype, "updatedAt", void 0);
55
+ tslib_1.__decorate([
56
+ (0, typeorm_1.DeleteDateColumn)(),
57
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Soft delete timestamp' }),
58
+ tslib_1.__metadata("design:type", Date)
59
+ ], Calendar.prototype, "deletedAt", void 0);
70
60
  tslib_1.__decorate([
71
61
  (0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
72
- (0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true }),
62
+ (0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true, description: 'Who created the calendar' }),
73
63
  tslib_1.__metadata("design:type", auth_base_1.User)
74
64
  ], Calendar.prototype, "creator", void 0);
75
65
  tslib_1.__decorate([
@@ -78,7 +68,7 @@ tslib_1.__decorate([
78
68
  ], Calendar.prototype, "creatorId", void 0);
79
69
  tslib_1.__decorate([
80
70
  (0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
81
- (0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true }),
71
+ (0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true, description: 'Who last changed the calendar' }),
82
72
  tslib_1.__metadata("design:type", auth_base_1.User)
83
73
  ], Calendar.prototype, "updater", void 0);
84
74
  tslib_1.__decorate([
@@ -87,7 +77,7 @@ tslib_1.__decorate([
87
77
  ], Calendar.prototype, "updaterId", void 0);
88
78
  exports.Calendar = Calendar = tslib_1.__decorate([
89
79
  (0, typeorm_1.Entity)(),
90
- (0, typeorm_1.Index)('ix_calendar_0', (calendar) => [calendar.domain, calendar.name], { unique: true }),
91
- (0, type_graphql_1.ObjectType)({ description: 'Entity for Calendar' })
80
+ (0, typeorm_1.Index)('ix_calendar_0', (calendar) => [calendar.domain, calendar.name], { unique: true, where: '"deleted_at" IS NULL' }),
81
+ (0, type_graphql_1.ObjectType)({ description: 'A named group of events in a domain' })
92
82
  ], Calendar);
93
83
  //# sourceMappingURL=calendar.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"calendar.js","sourceRoot":"","sources":["../../../server/service/calendar/calendar.ts"],"names":[],"mappings":";;;;AAAA,qCASgB;AAChB,+CAA2E;AAE3E,iDAA8C;AAC9C,yDAAgD;AAEhD,IAAY,cAGX;AAHD,WAAY,cAAc;IACxB,uCAAqB,CAAA;IACrB,uCAAqB,CAAA;AACvB,CAAC,EAHW,cAAc,8BAAd,cAAc,QAGzB;AAED,IAAA,+BAAgB,EAAC,cAAc,EAAE;IAC/B,IAAI,EAAE,gBAAgB;IACtB,WAAW,EAAE,iCAAiC;CAC/C,CAAC,CAAA;AAKK,IAAM,QAAQ,GAAd,MAAM,QAAQ;CAqDpB,CAAA;AArDY,4BAAQ;AAGV;IAFR,IAAA,gCAAsB,EAAC,MAAM,CAAC;IAC9B,IAAA,oBAAK,EAAC,IAAI,CAAC,EA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AE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC3C,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCAC9B,gBAAI;yCAAA;AAGd;IADC,IAAA,oBAAU,EAAC,CAAC,QAAkB,EAAE,EAAE,CAAC,QAAQ,CAAC,OAAO,CAAC;;2CACnC;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;yCAAA;AAGd;IADC,IAAA,oBAAU,EAAC,CAAC,QAAkB,EAAE,EAAE,CAAC,QAAQ,CAAC,OAAO,CAAC;;2CACnC;mBApDP,QAAQ;IAHpB,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EAAC,eAAe,EAAE,CAAC,QAAkB,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,IAAI,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IAClG,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,qBAAqB,EAAE,CAAC;GACtC,QAAQ,CAqDpB","sourcesContent":["import {\n CreateDateColumn,\n UpdateDateColumn,\n Entity,\n Index,\n Column,\n RelationId,\n ManyToOne,\n PrimaryGeneratedColumn\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 CalendarStatus {\n STATUS_A = 'STATUS_A',\n STATUS_B = 'STATUS_B'\n}\n\nregisterEnumType(CalendarStatus, {\n name: 'CalendarStatus',\n description: 'state enumeration of a calendar'\n})\n\n@Entity()\n@Index('ix_calendar_0', (calendar: Calendar) => [calendar.domain, calendar.name], { unique: true })\n@ObjectType({ description: 'Entity for Calendar' })\nexport class Calendar {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID)\n readonly id: string\n\n @ManyToOne(type => Domain)\n @Field(type => Domain)\n domain?: Domain\n\n @RelationId((calendar: Calendar) => calendar.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?: CalendarStatus\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 @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true })\n creator?: User\n\n @RelationId((calendar: Calendar) => calendar.creator)\n creatorId?: string\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true })\n updater?: User\n\n @RelationId((calendar: Calendar) => calendar.updater)\n updaterId?: string\n}\n"]}
1
+ {"version":3,"file":"calendar.js","sourceRoot":"","sources":["../../../server/service/calendar/calendar.ts"],"names":[],"mappings":";;;;AAAA,qCAAoJ;AACpJ,+CAAoD;AAEpD,iDAA8C;AAC9C,yDAAgD;AAEhD;;;GAGG;AAII,IAAM,QAAQ,GAAd,MAAM,QAAQ;CAiDpB,CAAA;AAjDY,4BAAQ;AAGV;IAFR,IAAA,gCAAsB,EAAC,MAAM,CAAC;IAC9B,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,EAAE,EAAE,WAAW,EAAE,mCAAmC,EAAE,CAAC;;oCACrD;AAInB;IAFC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,CAAC;IACzB,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,cA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QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,0BAA0B,EAAE,CAAC;sCACvE,gBAAI;yCAAA;AAGd;IADC,IAAA,oBAAU,EAAC,CAAC,QAAkB,EAAE,EAAE,CAAC,QAAQ,CAAC,OAAO,CAAC;;2CACnC;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,WAAW,EAAE,+BAA+B,EAAE,CAAC;sCAC5E,gBAAI;yCAAA;AAGd;IADC,IAAA,oBAAU,EAAC,CAAC,QAAkB,EAAE,EAAE,CAAC,QAAQ,CAAC,OAAO,CAAC;;2CACnC;mBAhDP,QAAQ;IAHpB,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EAAC,eAAe,EAAE,CAAC,QAAkB,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,IAAI,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,sBAAsB,EAAE,CAAC;IACjI,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,qCAAqC,EAAE,CAAC;GACtD,QAAQ,CAiDpB","sourcesContent":["import { Column, CreateDateColumn, DeleteDateColumn, Entity, Index, ManyToOne, PrimaryGeneratedColumn, RelationId, UpdateDateColumn } from 'typeorm'\nimport { Field, ID, ObjectType } from 'type-graphql'\n\nimport { Domain } from '@things-factory/shell'\nimport { User } from '@things-factory/auth-base'\n\n/**\n * A named group of events in a domain — \"management meetings\", \"plant holidays\". Events and series may belong to\n * one; it is optional.\n */\n@Entity()\n@Index('ix_calendar_0', (calendar: Calendar) => [calendar.domain, calendar.name], { unique: true, where: '\"deleted_at\" IS NULL' })\n@ObjectType({ description: 'A named group of events in a domain' })\nexport class Calendar {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID, { description: 'Unique identifier of the calendar' })\n readonly id: string\n\n @ManyToOne(type => Domain)\n @Field(type => Domain, { nullable: true, description: 'The domain the calendar belongs to' })\n domain?: Domain\n\n @RelationId((calendar: Calendar) => calendar.domain)\n domainId?: string\n\n @Column()\n @Field({ description: 'Name of the calendar, unique in the domain' })\n name: string\n\n @Column({ type: 'text', nullable: true })\n @Field({ nullable: true, description: 'What the calendar is for' })\n description?: string\n\n @Column({ default: true })\n @Field({ description: 'Whether the calendar is in use' })\n active: boolean\n\n @CreateDateColumn()\n @Field({ nullable: true, description: 'Creation timestamp' })\n createdAt?: Date\n\n @UpdateDateColumn()\n @Field({ nullable: true, description: 'Last update timestamp' })\n updatedAt?: Date\n\n @DeleteDateColumn()\n @Field({ nullable: true, description: 'Soft delete timestamp' })\n deletedAt?: Date\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true, description: 'Who created the calendar' })\n creator?: User\n\n @RelationId((calendar: Calendar) => calendar.creator)\n creatorId?: string\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true, description: 'Who last changed the calendar' })\n updater?: User\n\n @RelationId((calendar: Calendar) => calendar.updater)\n updaterId?: string\n}\n"]}
@@ -1,10 +1,12 @@
1
+ import { AttendeeInput } from '../attendee/attendee-type';
1
2
  import { Event } from './event';
2
- import { NewEvent, EventPatch } from './event-type';
3
+ import { EventPatch, NewEvent } from './event-type';
3
4
  export declare class EventMutation {
4
5
  createEvent(event: NewEvent, context: ResolverContext): Promise<Event>;
5
6
  updateEvent(id: string, patch: EventPatch, context: ResolverContext): Promise<Event>;
6
- updateMultipleEvent(patches: EventPatch[], context: ResolverContext): Promise<Event[]>;
7
+ postponeEvent(id: string, startAt: Date, endAt: Date, reason: string, context: ResolverContext): Promise<Event>;
8
+ cancelEvent(id: string, reason: string, context: ResolverContext): Promise<Event>;
9
+ markEventHeld(id: string, context: ResolverContext): Promise<Event>;
10
+ setEventAttendees(id: string, attendees: AttendeeInput[], context: ResolverContext): Promise<Event>;
7
11
  deleteEvent(id: string, context: ResolverContext): Promise<boolean>;
8
- deleteEvents(ids: string[], context: ResolverContext): Promise<boolean>;
9
- importEvents(events: EventPatch[], context: ResolverContext): Promise<boolean>;
10
12
  }
@@ -3,86 +3,46 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.EventMutation = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const type_graphql_1 = require("type-graphql");
6
- const typeorm_1 = require("typeorm");
6
+ const shell_1 = require("@things-factory/shell");
7
+ const attendee_type_1 = require("../attendee/attendee-type");
7
8
  const event_1 = require("./event");
9
+ const event_service_1 = require("./event-service");
8
10
  const event_type_1 = require("./event-type");
9
11
  let EventMutation = class EventMutation {
10
- async createEvent(event, context) {
11
- const { user, tx } = context.state;
12
- return await tx.getRepository(event_1.Event).save({
13
- ...event,
14
- creator: user,
15
- updater: user
16
- });
12
+ createEvent(event, context) {
13
+ const { domain, user, tx } = context.state;
14
+ return (0, event_service_1.createEvent)(tx, domain, user, event);
17
15
  }
18
- async updateEvent(id, patch, context) {
19
- const { user, tx } = context.state;
20
- const repository = tx.getRepository(event_1.Event);
21
- const event = await repository.findOne({
22
- where: { id }
23
- });
24
- return await repository.save({
25
- ...event,
26
- ...patch,
27
- updater: user
28
- });
16
+ updateEvent(id, patch, context) {
17
+ const { domain, user, tx } = context.state;
18
+ return (0, event_service_1.updateEvent)(tx, domain, user, id, patch);
29
19
  }
30
- async updateMultipleEvent(patches, context) {
31
- const { user, tx } = context.state;
32
- let results = [];
33
- const _createRecords = patches.filter((patch) => patch.cuFlag.toUpperCase() === '+');
34
- const _updateRecords = patches.filter((patch) => patch.cuFlag.toUpperCase() === 'M');
35
- const eventRepo = tx.getRepository(event_1.Event);
36
- if (_createRecords.length > 0) {
37
- for (let i = 0; i < _createRecords.length; i++) {
38
- const newRecord = _createRecords[i];
39
- const result = await eventRepo.save({
40
- ...newRecord,
41
- creator: user,
42
- updater: user
43
- });
44
- results.push({ ...result, cuFlag: '+' });
45
- }
46
- }
47
- if (_updateRecords.length > 0) {
48
- for (let i = 0; i < _updateRecords.length; i++) {
49
- const updateRecord = _updateRecords[i];
50
- const event = await eventRepo.findOneBy({ id: updateRecord.id });
51
- const result = await eventRepo.save({
52
- ...event,
53
- ...updateRecord,
54
- updater: user
55
- });
56
- results.push({ ...result, cuFlag: 'M' });
57
- }
58
- }
59
- return results;
20
+ postponeEvent(id, startAt, endAt, reason, context) {
21
+ const { domain, user, tx } = context.state;
22
+ return (0, event_service_1.postponeEvent)(tx, domain, user, id, { startAt, endAt: endAt ?? undefined, reason });
60
23
  }
61
- async deleteEvent(id, context) {
62
- const { tx } = context.state;
63
- await tx.getRepository(event_1.Event).delete({ id });
64
- return true;
24
+ cancelEvent(id, reason, context) {
25
+ const { domain, user, tx } = context.state;
26
+ return (0, event_service_1.cancelEvent)(tx, domain, user, id, reason);
65
27
  }
66
- async deleteEvents(ids, context) {
67
- const { tx } = context.state;
68
- await tx.getRepository(event_1.Event).delete({
69
- id: (0, typeorm_1.In)(ids)
70
- });
71
- return true;
28
+ markEventHeld(id, context) {
29
+ const { domain, user, tx } = context.state;
30
+ return (0, event_service_1.markEventHeld)(tx, domain, user, id);
72
31
  }
73
- async importEvents(events, context) {
74
- const { tx } = context.state;
75
- await Promise.all(events.map(async (event) => {
76
- const createdEvent = await tx.getRepository(event_1.Event).save({ ...event });
77
- }));
78
- return true;
32
+ setEventAttendees(id, attendees, context) {
33
+ const { domain, user, tx } = context.state;
34
+ return (0, event_service_1.setEventAttendees)(tx, domain, user, id, attendees);
35
+ }
36
+ deleteEvent(id, context) {
37
+ const { domain, user, tx } = context.state;
38
+ return (0, event_service_1.deleteEvent)(tx, domain, user, id);
79
39
  }
80
40
  };
81
41
  exports.EventMutation = EventMutation;
82
42
  tslib_1.__decorate([
83
43
  (0, type_graphql_1.Directive)('@transaction'),
84
44
  (0, type_graphql_1.Directive)('@privilege(category: "calendar", privilege: "mutation", domainOwnerGranted: true)'),
85
- (0, type_graphql_1.Mutation)(returns => event_1.Event, { description: 'To create new Event' }),
45
+ (0, type_graphql_1.Mutation)(returns => event_1.Event, { description: 'To create a one-off event' }),
86
46
  tslib_1.__param(0, (0, type_graphql_1.Arg)('event')),
87
47
  tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
88
48
  tslib_1.__metadata("design:type", Function),
@@ -92,7 +52,7 @@ tslib_1.__decorate([
92
52
  tslib_1.__decorate([
93
53
  (0, type_graphql_1.Directive)('@transaction'),
94
54
  (0, type_graphql_1.Directive)('@privilege(category: "calendar", privilege: "mutation", domainOwnerGranted: true)'),
95
- (0, type_graphql_1.Mutation)(returns => event_1.Event, { description: 'To modify Event information' }),
55
+ (0, type_graphql_1.Mutation)(returns => event_1.Event, { description: 'To change the name, description, place or person responsible of one event' }),
96
56
  tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
97
57
  tslib_1.__param(1, (0, type_graphql_1.Arg)('patch')),
98
58
  tslib_1.__param(2, (0, type_graphql_1.Ctx)()),
@@ -103,44 +63,61 @@ tslib_1.__decorate([
103
63
  tslib_1.__decorate([
104
64
  (0, type_graphql_1.Directive)('@transaction'),
105
65
  (0, type_graphql_1.Directive)('@privilege(category: "calendar", privilege: "mutation", domainOwnerGranted: true)'),
106
- (0, type_graphql_1.Mutation)(returns => [event_1.Event], { description: "To modify multiple Events' information" }),
107
- tslib_1.__param(0, (0, type_graphql_1.Arg)('patches', type => [event_type_1.EventPatch])),
108
- tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
66
+ (0, type_graphql_1.Mutation)(returns => event_1.Event, { description: 'To move one event to another time; nothing else changes' }),
67
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
68
+ tslib_1.__param(1, (0, type_graphql_1.Arg)('startAt')),
69
+ tslib_1.__param(2, (0, type_graphql_1.Arg)('endAt', { nullable: true })),
70
+ tslib_1.__param(3, (0, type_graphql_1.Arg)('reason', { nullable: true })),
71
+ tslib_1.__param(4, (0, type_graphql_1.Ctx)()),
109
72
  tslib_1.__metadata("design:type", Function),
110
- tslib_1.__metadata("design:paramtypes", [Array, Object]),
73
+ tslib_1.__metadata("design:paramtypes", [String, Date,
74
+ Date, String, Object]),
111
75
  tslib_1.__metadata("design:returntype", Promise)
112
- ], EventMutation.prototype, "updateMultipleEvent", null);
76
+ ], EventMutation.prototype, "postponeEvent", null);
113
77
  tslib_1.__decorate([
114
78
  (0, type_graphql_1.Directive)('@transaction'),
115
79
  (0, type_graphql_1.Directive)('@privilege(category: "calendar", privilege: "mutation", domainOwnerGranted: true)'),
116
- (0, type_graphql_1.Mutation)(returns => Boolean, { description: 'To delete Event' }),
80
+ (0, type_graphql_1.Mutation)(returns => event_1.Event, { description: 'To cancel one event; nothing else changes' }),
81
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
82
+ tslib_1.__param(1, (0, type_graphql_1.Arg)('reason', { nullable: true })),
83
+ tslib_1.__param(2, (0, type_graphql_1.Ctx)()),
84
+ tslib_1.__metadata("design:type", Function),
85
+ tslib_1.__metadata("design:paramtypes", [String, String, Object]),
86
+ tslib_1.__metadata("design:returntype", Promise)
87
+ ], EventMutation.prototype, "cancelEvent", null);
88
+ tslib_1.__decorate([
89
+ (0, type_graphql_1.Directive)('@transaction'),
90
+ (0, type_graphql_1.Directive)('@privilege(category: "calendar", privilege: "mutation", domainOwnerGranted: true)'),
91
+ (0, type_graphql_1.Mutation)(returns => event_1.Event, { description: 'To record that an event took place' }),
117
92
  tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
118
93
  tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
119
94
  tslib_1.__metadata("design:type", Function),
120
95
  tslib_1.__metadata("design:paramtypes", [String, Object]),
121
96
  tslib_1.__metadata("design:returntype", Promise)
122
- ], EventMutation.prototype, "deleteEvent", null);
97
+ ], EventMutation.prototype, "markEventHeld", null);
123
98
  tslib_1.__decorate([
124
99
  (0, type_graphql_1.Directive)('@transaction'),
125
100
  (0, type_graphql_1.Directive)('@privilege(category: "calendar", privilege: "mutation", domainOwnerGranted: true)'),
126
- (0, type_graphql_1.Mutation)(returns => Boolean, { description: 'To delete multiple Events' }),
127
- tslib_1.__param(0, (0, type_graphql_1.Arg)('ids', type => [String])),
128
- tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
101
+ (0, type_graphql_1.Mutation)(returns => event_1.Event, { description: 'To make the people named on one event exactly these; naming grants nothing' }),
102
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
103
+ tslib_1.__param(1, (0, type_graphql_1.Arg)('attendees', type => [attendee_type_1.AttendeeInput])),
104
+ tslib_1.__param(2, (0, type_graphql_1.Ctx)()),
129
105
  tslib_1.__metadata("design:type", Function),
130
- tslib_1.__metadata("design:paramtypes", [Array, Object]),
106
+ tslib_1.__metadata("design:paramtypes", [String, Array, Object]),
131
107
  tslib_1.__metadata("design:returntype", Promise)
132
- ], EventMutation.prototype, "deleteEvents", null);
108
+ ], EventMutation.prototype, "setEventAttendees", null);
133
109
  tslib_1.__decorate([
134
110
  (0, type_graphql_1.Directive)('@transaction'),
135
111
  (0, type_graphql_1.Directive)('@privilege(category: "calendar", privilege: "mutation", domainOwnerGranted: true)'),
136
- (0, type_graphql_1.Mutation)(returns => Boolean, { description: 'To import multiple Events' }),
137
- tslib_1.__param(0, (0, type_graphql_1.Arg)('events', type => [event_type_1.EventPatch])),
112
+ (0, type_graphql_1.Mutation)(returns => Boolean, { description: 'To delete a one-off event; an occurrence of a series is cancelled instead' }),
113
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
138
114
  tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
139
115
  tslib_1.__metadata("design:type", Function),
140
- tslib_1.__metadata("design:paramtypes", [Array, Object]),
116
+ tslib_1.__metadata("design:paramtypes", [String, Object]),
141
117
  tslib_1.__metadata("design:returntype", Promise)
142
- ], EventMutation.prototype, "importEvents", null);
118
+ ], EventMutation.prototype, "deleteEvent", null);
143
119
  exports.EventMutation = EventMutation = tslib_1.__decorate([
120
+ (0, type_graphql_1.UseMiddleware)(shell_1.SpeakRefusals),
144
121
  (0, type_graphql_1.Resolver)(event_1.Event)
145
122
  ], EventMutation);
146
123
  //# sourceMappingURL=event-mutation.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"event-mutation.js","sourceRoot":"","sources":["../../../server/service/event/event-mutation.ts"],"names":[],"mappings":";;;;AAAA,+CAAsE;AACtE,qCAA4B;AAE5B,mCAA+B;AAC/B,6CAAmD;AAG5C,IAAM,aAAa,GAAnB,MAAM,aAAa;IAIlB,AAAN,KAAK,CAAC,WAAW,CAAe,KAAe,EAAS,OAAwB;QAC9E,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAElC,OAAO,MAAM,EAAE,CAAC,aAAa,CAAC,aAAK,CAAC,CAAC,IAAI,CAAC;YACxC,GAAG,KAAK;YACR,OAAO,EAAE,IAAI;YACb,OAAO,EAAE,IAAI;SACd,CAAC,CAAA;IACJ,CAAC;IAKK,AAAN,KAAK,CAAC,WAAW,CACJ,EAAU,EACP,KAAiB,EACxB,OAAwB;QAE/B,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAElC,MAAM,UAAU,GAAG,EAAE,CAAC,aAAa,CAAC,aAAK,CAAC,CAAA;QAC1C,MAAM,KAAK,GAAG,MAAM,UAAU,CAAC,OAAO,CAAC;YACrC,KAAK,EAAE,EAAE,EAAE,EAAE;SACd,CAAC,CAAA;QAEF,OAAO,MAAM,UAAU,CAAC,IAAI,CAAC;YAC3B,GAAG,KAAK;YACR,GAAG,KAAK;YACR,OAAO,EAAE,IAAI;SACd,CAAC,CAAA;IACJ,CAAC;IAKK,AAAN,KAAK,CAAC,mBAAmB,CACe,OAAqB,EACpD,OAAwB;QAE/B,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAA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;gDAM9C;AAKK;IAHL,IAAA,wBAAS,EAAC,cAAc,CAAC;IACzB,IAAA,wBAAS,EAAC,mFAAmF,CAAC;IAC9F,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,2BAA2B,EAAE,CAAC;IACvD,mBAAA,IAAA,kBAAG,EAAC,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAA;IAAiB,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;iDAQrE;AAKK;IAHL,IAAA,wBAAS,EAAC,cAAc,CAAC;IACzB,IAAA,wBAAS,EAAC,mFAAmF,CAAC;IAC9F,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,2BAA2B,EAAE,CAAC;IAExE,mBAAA,IAAA,kBAAG,EAAC,QAAQ,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,uBAAU,CAAC,CAAC,CAAA;IACnC,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;iDAWP;wBA1HU,aAAa;IADzB,IAAA,uBAAQ,EAAC,aAAK,CAAC;GACH,aAAa,CA2HzB","sourcesContent":["import { Resolver, Mutation, Arg, Ctx, Directive } from 'type-graphql'\nimport { In } from 'typeorm'\n\nimport { Event } from './event'\nimport { NewEvent, EventPatch } from './event-type'\n\n@Resolver(Event)\nexport class EventMutation {\n @Directive('@transaction')\n @Directive('@privilege(category: \"calendar\", privilege: \"mutation\", domainOwnerGranted: true)')\n @Mutation(returns => Event, { description: 'To create new Event' })\n async createEvent(@Arg('event') event: NewEvent, @Ctx() context: ResolverContext): Promise<Event> {\n const { user, tx } = context.state\n\n return await tx.getRepository(Event).save({\n ...event,\n creator: user,\n updater: user\n })\n }\n\n @Directive('@transaction')\n @Directive('@privilege(category: \"calendar\", privilege: \"mutation\", domainOwnerGranted: true)')\n @Mutation(returns => Event, { description: 'To modify Event information' })\n async updateEvent(\n @Arg('id') id: string,\n @Arg('patch') patch: EventPatch,\n @Ctx() context: ResolverContext\n ): Promise<Event> {\n const { user, tx } = context.state\n\n const repository = tx.getRepository(Event)\n const event = await repository.findOne({\n where: { id }\n })\n\n return await repository.save({\n ...event,\n ...patch,\n updater: user\n })\n }\n\n @Directive('@transaction')\n @Directive('@privilege(category: \"calendar\", privilege: \"mutation\", domainOwnerGranted: true)')\n @Mutation(returns => [Event], { description: \"To modify multiple Events' information\" })\n async updateMultipleEvent(\n @Arg('patches', type => [EventPatch]) patches: EventPatch[],\n @Ctx() context: ResolverContext\n ): Promise<Event[]> {\n const { user, tx } = context.state\n\n let results = []\n const _createRecords = patches.filter((patch: any) => patch.cuFlag.toUpperCase() === '+')\n const _updateRecords = patches.filter((patch: any) => patch.cuFlag.toUpperCase() === 'M')\n const eventRepo = tx.getRepository(Event)\n\n if (_createRecords.length > 0) {\n for (let i = 0; i < _createRecords.length; i++) {\n const newRecord = _createRecords[i]\n\n const result = await eventRepo.save({\n ...newRecord,\n creator: user,\n updater: user\n })\n\n results.push({ ...result, cuFlag: '+' })\n }\n }\n\n if (_updateRecords.length > 0) {\n for (let i = 0; i < _updateRecords.length; i++) {\n const updateRecord = _updateRecords[i]\n const event = await eventRepo.findOneBy({ id: updateRecord.id })\n\n const result = await eventRepo.save({\n ...event,\n ...updateRecord,\n updater: user\n })\n\n results.push({ ...result, cuFlag: 'M' })\n }\n }\n\n return results\n }\n\n @Directive('@transaction')\n @Directive('@privilege(category: \"calendar\", privilege: \"mutation\", domainOwnerGranted: true)')\n @Mutation(returns => Boolean, { description: 'To delete Event' })\n async deleteEvent(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<boolean> {\n const { tx } = context.state\n\n await tx.getRepository(Event).delete({ id })\n\n return true\n }\n\n @Directive('@transaction')\n @Directive('@privilege(category: \"calendar\", privilege: \"mutation\", domainOwnerGranted: true)')\n @Mutation(returns => Boolean, { description: 'To delete multiple Events' })\n async deleteEvents(@Arg('ids', type => [String]) ids: string[], @Ctx() context: ResolverContext): Promise<boolean> {\n const { tx } = context.state\n\n await tx.getRepository(Event).delete({\n id: In(ids)\n })\n\n return true\n }\n\n @Directive('@transaction')\n @Directive('@privilege(category: \"calendar\", privilege: \"mutation\", domainOwnerGranted: true)')\n @Mutation(returns => Boolean, { description: 'To import multiple Events' })\n async importEvents(\n @Arg('events', type => [EventPatch]) events: EventPatch[],\n @Ctx() context: ResolverContext\n ): Promise<boolean> {\n const { tx } = context.state\n\n await Promise.all(\n events.map(async (event: EventPatch) => {\n const createdEvent: Event = await tx.getRepository(Event).save({ ...event })\n })\n )\n\n return true\n }\n}\n"]}
1
+ {"version":3,"file":"event-mutation.js","sourceRoot":"","sources":["../../../server/service/event/event-mutation.ts"],"names":[],"mappings":";;;;AAAA,+CAAqF;AAErF,iDAAqD;AAErD,6DAAyD;AACzD,mCAA+B;AAC/B,mDAAqI;AACrI,6CAAmD;AAI5C,IAAM,aAAa,GAAnB,MAAM,aAAa;IAIxB,WAAW,CAAe,KAAe,EAAS,OAAwB;QACxE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAC1C,OAAO,IAAA,2BAAW,EAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,CAAA;IAC7C,CAAC;IAKD,WAAW,CAAY,EAAU,EAAgB,KAAiB,EAAS,OAAwB;QACjG,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAC1C,OAAO,IAAA,2BAAW,EAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,KAAK,CAAC,CAAA;IACjD,CAAC;IAKD,aAAa,CACA,EAAU,EACL,OAAa,EACK,KAAW,EACV,MAAc,EAC1C,OAAwB;QAE/B,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CA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B,IAAA,4BAAa,EAAC,qBAAa,CAAC;IAC5B,IAAA,uBAAQ,EAAC,aAAK,CAAC;GACH,aAAa,CA8DzB","sourcesContent":["import { Arg, Ctx, Directive, Mutation, Resolver, UseMiddleware } from 'type-graphql'\n\nimport { SpeakRefusals } from '@things-factory/shell'\n\nimport { AttendeeInput } from '../attendee/attendee-type'\nimport { Event } from './event'\nimport { cancelEvent, createEvent, deleteEvent, markEventHeld, postponeEvent, setEventAttendees, updateEvent } from './event-service'\nimport { EventPatch, NewEvent } from './event-type'\n\n@UseMiddleware(SpeakRefusals)\n@Resolver(Event)\nexport class EventMutation {\n @Directive('@transaction')\n @Directive('@privilege(category: \"calendar\", privilege: \"mutation\", domainOwnerGranted: true)')\n @Mutation(returns => Event, { description: 'To create a one-off event' })\n createEvent(@Arg('event') event: NewEvent, @Ctx() context: ResolverContext): Promise<Event> {\n const { domain, user, tx } = context.state\n return createEvent(tx, domain, user, event)\n }\n\n @Directive('@transaction')\n @Directive('@privilege(category: \"calendar\", privilege: \"mutation\", domainOwnerGranted: true)')\n @Mutation(returns => Event, { description: 'To change the name, description, place or person responsible of one event' })\n updateEvent(@Arg('id') id: string, @Arg('patch') patch: EventPatch, @Ctx() context: ResolverContext): Promise<Event> {\n const { domain, user, tx } = context.state\n return updateEvent(tx, domain, user, id, patch)\n }\n\n @Directive('@transaction')\n @Directive('@privilege(category: \"calendar\", privilege: \"mutation\", domainOwnerGranted: true)')\n @Mutation(returns => Event, { description: 'To move one event to another time; nothing else changes' })\n postponeEvent(\n @Arg('id') id: string,\n @Arg('startAt') startAt: Date,\n @Arg('endAt', { nullable: true }) endAt: Date,\n @Arg('reason', { nullable: true }) reason: string,\n @Ctx() context: ResolverContext\n ): Promise<Event> {\n const { domain, user, tx } = context.state\n return postponeEvent(tx, domain, user, id, { startAt, endAt: endAt ?? undefined, reason })\n }\n\n @Directive('@transaction')\n @Directive('@privilege(category: \"calendar\", privilege: \"mutation\", domainOwnerGranted: true)')\n @Mutation(returns => Event, { description: 'To cancel one event; nothing else changes' })\n cancelEvent(@Arg('id') id: string, @Arg('reason', { nullable: true }) reason: string, @Ctx() context: ResolverContext): Promise<Event> {\n const { domain, user, tx } = context.state\n return cancelEvent(tx, domain, user, id, reason)\n }\n\n @Directive('@transaction')\n @Directive('@privilege(category: \"calendar\", privilege: \"mutation\", domainOwnerGranted: true)')\n @Mutation(returns => Event, { description: 'To record that an event took place' })\n markEventHeld(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<Event> {\n const { domain, user, tx } = context.state\n return markEventHeld(tx, domain, user, id)\n }\n\n @Directive('@transaction')\n @Directive('@privilege(category: \"calendar\", privilege: \"mutation\", domainOwnerGranted: true)')\n @Mutation(returns => Event, { description: 'To make the people named on one event exactly these; naming grants nothing' })\n setEventAttendees(@Arg('id') id: string, @Arg('attendees', type => [AttendeeInput]) attendees: AttendeeInput[], @Ctx() context: ResolverContext): Promise<Event> {\n const { domain, user, tx } = context.state\n return setEventAttendees(tx, domain, user, id, attendees)\n }\n\n @Directive('@transaction')\n @Directive('@privilege(category: \"calendar\", privilege: \"mutation\", domainOwnerGranted: true)')\n @Mutation(returns => Boolean, { description: 'To delete a one-off event; an occurrence of a series is cancelled instead' })\n deleteEvent(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<boolean> {\n const { domain, user, tx } = context.state\n return deleteEvent(tx, domain, user, id)\n }\n}\n"]}
@@ -1,10 +1,20 @@
1
- import { ListParam } from '@things-factory/shell';
2
1
  import { User } from '@things-factory/auth-base';
2
+ import { Domain, ListParam } from '@things-factory/shell';
3
+ import { Attendee } from '../attendee/attendee';
4
+ import { Calendar } from '../calendar/calendar';
5
+ import { EventSeries } from '../event-series/event-series';
3
6
  import { Event } from './event';
4
7
  import { EventList } from './event-type';
5
8
  export declare class EventQuery {
6
9
  event(id: string, context: ResolverContext): Promise<Event>;
7
10
  events(params: ListParam, context: ResolverContext): Promise<EventList>;
11
+ eventsBetween(from: Date, to: Date, calendarId: string, context: ResolverContext): Promise<Event[]>;
12
+ myEvents(from: Date, to: Date, context: ResolverContext): Promise<Event[]>;
13
+ attendees(event: Event): Promise<Attendee[]>;
14
+ series(event: Event): Promise<EventSeries>;
15
+ calendar(event: Event): Promise<Calendar>;
16
+ organizer(event: Event): Promise<User>;
17
+ domain(event: Event): Promise<Domain>;
8
18
  updater(event: Event): Promise<User>;
9
19
  creator(event: Event): Promise<User>;
10
20
  }