@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.
- package/dist-client/pages/calendar/calendar-list-page.d.ts +1 -9
- package/dist-client/pages/calendar/calendar-list-page.js +2 -27
- package/dist-client/pages/calendar/calendar-list-page.js.map +1 -1
- package/dist-client/pages/event/event-list-page.d.ts +5 -28
- package/dist-client/pages/event/event-list-page.js +65 -177
- package/dist-client/pages/event/event-list-page.js.map +1 -1
- package/dist-client/route.d.ts +1 -1
- package/dist-client/route.js +0 -3
- package/dist-client/route.js.map +1 -1
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-server/index.d.ts +1 -0
- package/dist-server/index.js +5 -0
- package/dist-server/index.js.map +1 -1
- package/dist-server/role-tasks.d.ts +2 -0
- package/dist-server/role-tasks.js +16 -0
- package/dist-server/role-tasks.js.map +1 -0
- package/dist-server/service/attendee/attendee-query.d.ts +7 -4
- package/dist-server/service/attendee/attendee-query.js +34 -25
- package/dist-server/service/attendee/attendee-query.js.map +1 -1
- package/dist-server/service/attendee/attendee-service.d.ts +41 -0
- package/dist-server/service/attendee/attendee-service.js +90 -0
- package/dist-server/service/attendee/attendee-service.js.map +1 -0
- package/dist-server/service/attendee/attendee-type.d.ts +3 -15
- package/dist-server/service/attendee/attendee-type.js +12 -53
- package/dist-server/service/attendee/attendee-type.js.map +1 -1
- package/dist-server/service/attendee/attendee.d.ts +24 -7
- package/dist-server/service/attendee/attendee.js +99 -23
- package/dist-server/service/attendee/attendee.js.map +1 -1
- package/dist-server/service/attendee/index.d.ts +1 -2
- package/dist-server/service/attendee/index.js +1 -2
- package/dist-server/service/attendee/index.js.map +1 -1
- package/dist-server/service/calendar/calendar-mutation.d.ts +1 -3
- package/dist-server/service/calendar/calendar-mutation.js +21 -94
- package/dist-server/service/calendar/calendar-mutation.js.map +1 -1
- package/dist-server/service/calendar/calendar-query.d.ts +1 -1
- package/dist-server/service/calendar/calendar-query.js +15 -17
- package/dist-server/service/calendar/calendar-query.js.map +1 -1
- package/dist-server/service/calendar/calendar-service.d.ts +10 -0
- package/dist-server/service/calendar/calendar-service.js +58 -0
- package/dist-server/service/calendar/calendar-service.js.map +1 -0
- package/dist-server/service/calendar/calendar-type.d.ts +1 -4
- package/dist-server/service/calendar/calendar-type.js +13 -25
- package/dist-server/service/calendar/calendar-type.js.map +1 -1
- package/dist-server/service/calendar/calendar.d.ts +7 -8
- package/dist-server/service/calendar/calendar.js +23 -33
- package/dist-server/service/calendar/calendar.js.map +1 -1
- package/dist-server/service/event/event-mutation.d.ts +6 -4
- package/dist-server/service/event/event-mutation.js +60 -83
- package/dist-server/service/event/event-mutation.js.map +1 -1
- package/dist-server/service/event/event-query.d.ts +11 -1
- package/dist-server/service/event/event-query.js +106 -13
- package/dist-server/service/event/event-query.js.map +1 -1
- package/dist-server/service/event/event-rules.d.ts +10 -0
- package/dist-server/service/event/event-rules.js +38 -0
- package/dist-server/service/event/event-rules.js.map +1 -0
- package/dist-server/service/event/event-service.d.ts +42 -0
- package/dist-server/service/event/event-service.js +159 -0
- package/dist-server/service/event/event-service.js.map +1 -0
- package/dist-server/service/event/event-type.d.ts +10 -11
- package/dist-server/service/event/event-type.js +32 -36
- package/dist-server/service/event/event-type.js.map +1 -1
- package/dist-server/service/event/event.d.ts +25 -11
- package/dist-server/service/event/event.js +89 -36
- package/dist-server/service/event/event.js.map +1 -1
- package/dist-server/service/event-series/event-series-mutation.d.ts +11 -0
- package/dist-server/service/event-series/event-series-mutation.js +100 -0
- package/dist-server/service/event-series/event-series-mutation.js.map +1 -0
- package/dist-server/service/event-series/event-series-query.d.ts +16 -0
- package/dist-server/service/event-series/event-series-query.js +109 -0
- package/dist-server/service/event-series/event-series-query.js.map +1 -0
- package/dist-server/service/event-series/event-series-service.d.ts +40 -0
- package/dist-server/service/event-series/event-series-service.js +253 -0
- package/dist-server/service/event-series/event-series-service.js.map +1 -0
- package/dist-server/service/event-series/event-series-type.d.ts +41 -0
- package/dist-server/service/event-series/event-series-type.js +155 -0
- package/dist-server/service/event-series/event-series-type.js.map +1 -0
- package/dist-server/service/event-series/event-series.d.ts +32 -0
- package/dist-server/service/event-series/event-series.js +134 -0
- package/dist-server/service/event-series/event-series.js.map +1 -0
- package/dist-server/service/event-series/index.d.ts +6 -0
- package/dist-server/service/event-series/index.js +10 -0
- package/dist-server/service/event-series/index.js.map +1 -0
- package/dist-server/service/event-series/recurrence.d.ts +19 -0
- package/dist-server/service/event-series/recurrence.js +95 -0
- package/dist-server/service/event-series/recurrence.js.map +1 -0
- package/dist-server/service/index.d.ts +15 -4
- package/dist-server/service/index.js +29 -11
- package/dist-server/service/index.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +8 -5
- package/tests/open-doors.test.ts +18 -21
- package/things-factory.config.js +0 -4
- package/translations/en.json +44 -1
- package/translations/es.json +44 -1
- package/translations/ja.json +44 -1
- package/translations/ko.json +44 -1
- package/translations/ms.json +44 -1
- package/translations/zh.json +44 -1
- package/concept.md +0 -31
- package/dist-client/pages/attendee/attendee-importer.d.ts +0 -23
- package/dist-client/pages/attendee/attendee-importer.js +0 -93
- package/dist-client/pages/attendee/attendee-importer.js.map +0 -1
- package/dist-client/pages/attendee/attendee-list-page.d.ts +0 -56
- package/dist-client/pages/attendee/attendee-list-page.js +0 -263
- package/dist-client/pages/attendee/attendee-list-page.js.map +0 -1
- package/dist-client/pages/calendar/calendar-importer.d.ts +0 -23
- package/dist-client/pages/calendar/calendar-importer.js +0 -93
- package/dist-client/pages/calendar/calendar-importer.js.map +0 -1
- package/dist-client/pages/event/event-importer.d.ts +0 -23
- package/dist-client/pages/event/event-importer.js +0 -93
- package/dist-client/pages/event/event-importer.js.map +0 -1
- package/dist-server/service/attendee/attendee-mutation.d.ts +0 -10
- package/dist-server/service/attendee/attendee-mutation.js +0 -140
- 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
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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
|
|
11
|
+
name: string;
|
|
12
12
|
description?: string;
|
|
13
|
-
active
|
|
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 =
|
|
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
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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)({
|
|
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)({
|
|
47
|
-
(0, type_graphql_1.Field)({
|
|
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: '
|
|
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,
|
|
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,cAAM,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,oCAAoC,EAAE,CAAC;sCACpF,cAAM;wCAAA;AAGf;IADC,IAAA,oBAAU,EAAC,CAAC,QAAkB,EAAE,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC;;0CACnC;AAIjB;IAFC,IAAA,gBAAM,GAAE;IACR,IAAA,oBAAK,EAAC,EAAE,WAAW,EAAE,4CAA4C,EAAE,CAAC;;sCACzD;AAIZ;IAFC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IACxC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,0BAA0B,EAAE,CAAC;;6CAC/C;AAIpB;IAFC,IAAA,gBAAM,EAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IACzB,IAAA,oBAAK,EAAC,EAAE,WAAW,EAAE,gCAAgC,EAAE,CAAC;;wCAC1C;AAIf;IAFC,IAAA,0BAAgB,GAAE;IAClB,IAAA,oBAAK,E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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 {
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
11
|
-
const { user, tx } = context.state;
|
|
12
|
-
return
|
|
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
|
-
|
|
19
|
-
const { user, tx } = context.state;
|
|
20
|
-
|
|
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
|
-
|
|
31
|
-
const { user, tx } = context.state;
|
|
32
|
-
|
|
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
|
-
|
|
62
|
-
const { tx } = context.state;
|
|
63
|
-
|
|
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
|
-
|
|
67
|
-
const { tx } = context.state;
|
|
68
|
-
|
|
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
|
-
|
|
74
|
-
const { tx } = context.state;
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
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
|
|
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
|
|
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 =>
|
|
107
|
-
tslib_1.__param(0, (0, type_graphql_1.Arg)('
|
|
108
|
-
tslib_1.__param(1, (0, type_graphql_1.
|
|
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", [
|
|
73
|
+
tslib_1.__metadata("design:paramtypes", [String, Date,
|
|
74
|
+
Date, String, Object]),
|
|
111
75
|
tslib_1.__metadata("design:returntype", Promise)
|
|
112
|
-
], EventMutation.prototype, "
|
|
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 =>
|
|
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, "
|
|
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 =>
|
|
127
|
-
tslib_1.__param(0, (0, type_graphql_1.Arg)('
|
|
128
|
-
tslib_1.__param(1, (0, type_graphql_1.
|
|
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, "
|
|
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
|
|
137
|
-
tslib_1.__param(0, (0, type_graphql_1.Arg)('
|
|
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", [
|
|
116
|
+
tslib_1.__metadata("design:paramtypes", [String, Object]),
|
|
141
117
|
tslib_1.__metadata("design:returntype", Promise)
|
|
142
|
-
], EventMutation.prototype, "
|
|
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,+
|
|
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,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AO,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,2EAA2E,EAAE,CAAC;IAC9G,mBAAA,IAAA,kBAAG,EAAC,IAAI,CAAC,CAAA;IAAc,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;gDAGxC;wBA7DU,aAAa;IAFzB,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
|
}
|