Initial commit - Event Planner application
This commit is contained in:
7
dist/guest/api/dto/create-guest.dto.d.ts
vendored
Normal file
7
dist/guest/api/dto/create-guest.dto.d.ts
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
export declare class CreateGuestDto {
|
||||
name: string;
|
||||
email?: string;
|
||||
phone?: string;
|
||||
metadata?: Record<string, any>;
|
||||
}
|
||||
//# sourceMappingURL=create-guest.dto.d.ts.map
|
||||
1
dist/guest/api/dto/create-guest.dto.d.ts.map
vendored
Normal file
1
dist/guest/api/dto/create-guest.dto.d.ts.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"create-guest.dto.d.ts","sourceRoot":"","sources":["../../../../src/guest/api/dto/create-guest.dto.ts"],"names":[],"mappings":"AAAA,qBAAa,cAAc;IACzB,IAAI,EAAG,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAChC"}
|
||||
6
dist/guest/api/dto/create-guest.dto.js
vendored
Normal file
6
dist/guest/api/dto/create-guest.dto.js
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.CreateGuestDto = void 0;
|
||||
class CreateGuestDto {
|
||||
}
|
||||
exports.CreateGuestDto = CreateGuestDto;
|
||||
5
dist/guest/api/dto/update-rsvp.dto.d.ts
vendored
Normal file
5
dist/guest/api/dto/update-rsvp.dto.d.ts
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
export declare class UpdateRsvpDto {
|
||||
rsvp: boolean;
|
||||
tableId?: string;
|
||||
}
|
||||
//# sourceMappingURL=update-rsvp.dto.d.ts.map
|
||||
1
dist/guest/api/dto/update-rsvp.dto.d.ts.map
vendored
Normal file
1
dist/guest/api/dto/update-rsvp.dto.d.ts.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"update-rsvp.dto.d.ts","sourceRoot":"","sources":["../../../../src/guest/api/dto/update-rsvp.dto.ts"],"names":[],"mappings":"AAAA,qBAAa,aAAa;IACxB,IAAI,EAAG,OAAO,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB"}
|
||||
6
dist/guest/api/dto/update-rsvp.dto.js
vendored
Normal file
6
dist/guest/api/dto/update-rsvp.dto.js
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.UpdateRsvpDto = void 0;
|
||||
class UpdateRsvpDto {
|
||||
}
|
||||
exports.UpdateRsvpDto = UpdateRsvpDto;
|
||||
11
dist/guest/api/guest.controller.d.ts
vendored
Normal file
11
dist/guest/api/guest.controller.d.ts
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
import { GuestService } from '../services/guest.service';
|
||||
import { CreateGuestDto } from './dto/create-guest.dto';
|
||||
import { UpdateRsvpDto } from './dto/update-rsvp.dto';
|
||||
export declare class GuestController {
|
||||
private readonly guestService;
|
||||
constructor(guestService: GuestService);
|
||||
createGuest(tenantId: string, dto: CreateGuestDto): Promise<import("../entities/guest.entity").Guest>;
|
||||
listGuests(tenantId: string): Promise<import("../entities/guest.entity").Guest[]>;
|
||||
updateRsvp(tenantId: string, id: string, dto: UpdateRsvpDto): Promise<import("../entities/guest.entity").Guest | null>;
|
||||
}
|
||||
//# sourceMappingURL=guest.controller.d.ts.map
|
||||
1
dist/guest/api/guest.controller.d.ts.map
vendored
Normal file
1
dist/guest/api/guest.controller.d.ts.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"guest.controller.d.ts","sourceRoot":"","sources":["../../../src/guest/api/guest.controller.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAEtD,qBACa,eAAe;IACd,OAAO,CAAC,QAAQ,CAAC,YAAY;gBAAZ,YAAY,EAAE,YAAY;IAGjD,WAAW,CACS,QAAQ,EAAE,MAAM,EAChC,GAAG,EAAE,cAAc;IAMvB,UAAU,CAAyB,QAAQ,EAAE,MAAM;IAKnD,UAAU,CACU,QAAQ,EAAE,MAAM,EAC3B,EAAE,EAAE,MAAM,EACf,GAAG,EAAE,aAAa;CAI7B"}
|
||||
62
dist/guest/api/guest.controller.js
vendored
Normal file
62
dist/guest/api/guest.controller.js
vendored
Normal file
@@ -0,0 +1,62 @@
|
||||
"use strict";
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
var __metadata = (this && this.__metadata) || function (k, v) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
||||
};
|
||||
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
||||
return function (target, key) { decorator(target, key, paramIndex); }
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.GuestController = void 0;
|
||||
const common_1 = require("@nestjs/common");
|
||||
const guest_service_1 = require("../services/guest.service");
|
||||
const create_guest_dto_1 = require("./dto/create-guest.dto");
|
||||
const update_rsvp_dto_1 = require("./dto/update-rsvp.dto");
|
||||
let GuestController = class GuestController {
|
||||
constructor(guestService) {
|
||||
this.guestService = guestService;
|
||||
}
|
||||
async createGuest(tenantId, dto) {
|
||||
return this.guestService.createGuest(tenantId, dto);
|
||||
}
|
||||
async listGuests(tenantId) {
|
||||
return this.guestService.listGuests(tenantId);
|
||||
}
|
||||
async updateRsvp(tenantId, id, dto) {
|
||||
return this.guestService.updateRsvp(tenantId, id, dto);
|
||||
}
|
||||
};
|
||||
exports.GuestController = GuestController;
|
||||
__decorate([
|
||||
(0, common_1.Post)(),
|
||||
__param(0, (0, common_1.Headers)('x-tenant-id')),
|
||||
__param(1, (0, common_1.Body)()),
|
||||
__metadata("design:type", Function),
|
||||
__metadata("design:paramtypes", [String, create_guest_dto_1.CreateGuestDto]),
|
||||
__metadata("design:returntype", Promise)
|
||||
], GuestController.prototype, "createGuest", null);
|
||||
__decorate([
|
||||
(0, common_1.Get)(),
|
||||
__param(0, (0, common_1.Headers)('x-tenant-id')),
|
||||
__metadata("design:type", Function),
|
||||
__metadata("design:paramtypes", [String]),
|
||||
__metadata("design:returntype", Promise)
|
||||
], GuestController.prototype, "listGuests", null);
|
||||
__decorate([
|
||||
(0, common_1.Patch)(':id/rsvp'),
|
||||
__param(0, (0, common_1.Headers)('x-tenant-id')),
|
||||
__param(1, (0, common_1.Param)('id')),
|
||||
__param(2, (0, common_1.Body)()),
|
||||
__metadata("design:type", Function),
|
||||
__metadata("design:paramtypes", [String, String, update_rsvp_dto_1.UpdateRsvpDto]),
|
||||
__metadata("design:returntype", Promise)
|
||||
], GuestController.prototype, "updateRsvp", null);
|
||||
exports.GuestController = GuestController = __decorate([
|
||||
(0, common_1.Controller)('guest'),
|
||||
__metadata("design:paramtypes", [guest_service_1.GuestService])
|
||||
], GuestController);
|
||||
18
dist/guest/entities/guest.entity.d.ts
vendored
Normal file
18
dist/guest/entities/guest.entity.d.ts
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
import { EntitySchema } from '@mikro-orm/core';
|
||||
import { BaseEntity } from '../../core/entities/base.entity';
|
||||
export declare class Guest extends BaseEntity {
|
||||
name: string;
|
||||
email?: string;
|
||||
phone?: string;
|
||||
rsvp: boolean;
|
||||
tableId?: string;
|
||||
}
|
||||
export declare const GuestSchema: EntitySchema<Guest, never, import("@mikro-orm/core").EntityCtor<Guest>>;
|
||||
export declare class GuestNotificationPreference extends BaseEntity {
|
||||
guestId: string;
|
||||
email: boolean;
|
||||
whatsapp: boolean;
|
||||
metadata?: Record<string, any>;
|
||||
}
|
||||
export declare const GuestNotificationPreferenceSchema: EntitySchema<GuestNotificationPreference, never, import("@mikro-orm/core").EntityCtor<GuestNotificationPreference>>;
|
||||
//# sourceMappingURL=guest.entity.d.ts.map
|
||||
1
dist/guest/entities/guest.entity.d.ts.map
vendored
Normal file
1
dist/guest/entities/guest.entity.d.ts.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"guest.entity.d.ts","sourceRoot":"","sources":["../../../src/guest/entities/guest.entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAE7D,qBAAa,KAAM,SAAQ,UAAU;IACnC,IAAI,EAAG,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,OAAO,CAAS;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,eAAO,MAAM,WAAW,yEA4CtB,CAAC;AAEH,qBAAa,2BAA4B,SAAQ,UAAU;IACzD,OAAO,EAAG,MAAM,CAAC;IACjB,KAAK,EAAE,OAAO,CAAQ;IACtB,QAAQ,EAAE,OAAO,CAAS;IAC1B,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAChC;AAED,eAAO,MAAM,iCAAiC,qHAoC5C,CAAC"}
|
||||
103
dist/guest/entities/guest.entity.js
vendored
Normal file
103
dist/guest/entities/guest.entity.js
vendored
Normal file
@@ -0,0 +1,103 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.GuestNotificationPreferenceSchema = exports.GuestNotificationPreference = exports.GuestSchema = exports.Guest = void 0;
|
||||
const core_1 = require("@mikro-orm/core");
|
||||
const uuid_1 = require("uuid");
|
||||
const base_entity_1 = require("../../core/entities/base.entity");
|
||||
class Guest extends base_entity_1.BaseEntity {
|
||||
constructor() {
|
||||
super(...arguments);
|
||||
this.rsvp = false;
|
||||
}
|
||||
}
|
||||
exports.Guest = Guest;
|
||||
exports.GuestSchema = new core_1.EntitySchema({
|
||||
class: Guest,
|
||||
tableName: 'guests',
|
||||
properties: {
|
||||
id: {
|
||||
type: 'uuid',
|
||||
primary: true,
|
||||
default: (0, uuid_1.v4)(),
|
||||
},
|
||||
tenantId: {
|
||||
type: 'string',
|
||||
},
|
||||
metadata: {
|
||||
type: 'json',
|
||||
nullable: true,
|
||||
},
|
||||
createdAt: {
|
||||
type: 'date',
|
||||
default: new Date(),
|
||||
},
|
||||
updatedAt: {
|
||||
type: 'date',
|
||||
default: new Date(),
|
||||
},
|
||||
name: {
|
||||
type: 'string',
|
||||
},
|
||||
email: {
|
||||
type: 'string',
|
||||
nullable: true,
|
||||
},
|
||||
phone: {
|
||||
type: 'string',
|
||||
nullable: true,
|
||||
},
|
||||
rsvp: {
|
||||
type: 'boolean',
|
||||
default: false,
|
||||
},
|
||||
tableId: {
|
||||
type: 'uuid',
|
||||
nullable: true,
|
||||
},
|
||||
},
|
||||
});
|
||||
class GuestNotificationPreference extends base_entity_1.BaseEntity {
|
||||
constructor() {
|
||||
super(...arguments);
|
||||
this.email = true;
|
||||
this.whatsapp = false;
|
||||
}
|
||||
}
|
||||
exports.GuestNotificationPreference = GuestNotificationPreference;
|
||||
exports.GuestNotificationPreferenceSchema = new core_1.EntitySchema({
|
||||
class: GuestNotificationPreference,
|
||||
tableName: 'guest_notification_preferences',
|
||||
properties: {
|
||||
id: {
|
||||
type: 'uuid',
|
||||
primary: true,
|
||||
default: (0, uuid_1.v4)(),
|
||||
},
|
||||
tenantId: {
|
||||
type: 'string',
|
||||
},
|
||||
metadata: {
|
||||
type: 'json',
|
||||
nullable: true,
|
||||
},
|
||||
createdAt: {
|
||||
type: 'date',
|
||||
default: new Date(),
|
||||
},
|
||||
updatedAt: {
|
||||
type: 'date',
|
||||
default: new Date(),
|
||||
},
|
||||
guestId: {
|
||||
type: 'uuid',
|
||||
},
|
||||
email: {
|
||||
type: 'boolean',
|
||||
default: true,
|
||||
},
|
||||
whatsapp: {
|
||||
type: 'boolean',
|
||||
default: false,
|
||||
},
|
||||
},
|
||||
});
|
||||
3
dist/guest/guest.module.d.ts
vendored
Normal file
3
dist/guest/guest.module.d.ts
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
export declare class GuestModule {
|
||||
}
|
||||
//# sourceMappingURL=guest.module.d.ts.map
|
||||
1
dist/guest/guest.module.d.ts.map
vendored
Normal file
1
dist/guest/guest.module.d.ts.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"guest.module.d.ts","sourceRoot":"","sources":["../../src/guest/guest.module.ts"],"names":[],"mappings":"AASA,qBAWa,WAAW;CAAG"}
|
||||
33
dist/guest/guest.module.js
vendored
Normal file
33
dist/guest/guest.module.js
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
"use strict";
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.GuestModule = void 0;
|
||||
const common_1 = require("@nestjs/common");
|
||||
const nestjs_1 = require("@mikro-orm/nestjs");
|
||||
const core_module_1 = require("../core/core.module");
|
||||
const guest_service_1 = require("./services/guest.service");
|
||||
const guest_controller_1 = require("./api/guest.controller");
|
||||
const guest_subscriber_1 = require("./subscribers/guest.subscriber");
|
||||
const guest_entity_1 = require("./entities/guest.entity");
|
||||
const guest_registration_1 = require("./guest.registration");
|
||||
let GuestModule = class GuestModule {
|
||||
};
|
||||
exports.GuestModule = GuestModule;
|
||||
exports.GuestModule = GuestModule = __decorate([
|
||||
(0, common_1.Module)({
|
||||
imports: [
|
||||
core_module_1.CoreModule,
|
||||
nestjs_1.MikroOrmModule.forFeature({
|
||||
entities: [guest_entity_1.GuestSchema, guest_entity_1.GuestNotificationPreferenceSchema],
|
||||
}),
|
||||
],
|
||||
providers: [guest_service_1.GuestService, guest_subscriber_1.GuestSubscriber, guest_registration_1.GuestModuleRegistration],
|
||||
controllers: [guest_controller_1.GuestController],
|
||||
exports: [guest_service_1.GuestService],
|
||||
})
|
||||
], GuestModule);
|
||||
8
dist/guest/guest.registration.d.ts
vendored
Normal file
8
dist/guest/guest.registration.d.ts
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
import { OnModuleInit } from '@nestjs/common';
|
||||
import { ModuleRegistryService } from '../core/services/module-registry.service';
|
||||
export declare class GuestModuleRegistration implements OnModuleInit {
|
||||
private readonly moduleRegistry;
|
||||
constructor(moduleRegistry: ModuleRegistryService);
|
||||
onModuleInit(): void;
|
||||
}
|
||||
//# sourceMappingURL=guest.registration.d.ts.map
|
||||
1
dist/guest/guest.registration.d.ts.map
vendored
Normal file
1
dist/guest/guest.registration.d.ts.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"guest.registration.d.ts","sourceRoot":"","sources":["../../src/guest/guest.registration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC1D,OAAO,EAAE,qBAAqB,EAAE,MAAM,0CAA0C,CAAC;AAEjF,qBACa,uBAAwB,YAAW,YAAY;IAC9C,OAAO,CAAC,QAAQ,CAAC,cAAc;gBAAd,cAAc,EAAE,qBAAqB;IAElE,YAAY;CAQb"}
|
||||
32
dist/guest/guest.registration.js
vendored
Normal file
32
dist/guest/guest.registration.js
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
"use strict";
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
var __metadata = (this && this.__metadata) || function (k, v) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.GuestModuleRegistration = void 0;
|
||||
const common_1 = require("@nestjs/common");
|
||||
const module_registry_service_1 = require("../core/services/module-registry.service");
|
||||
let GuestModuleRegistration = class GuestModuleRegistration {
|
||||
constructor(moduleRegistry) {
|
||||
this.moduleRegistry = moduleRegistry;
|
||||
}
|
||||
onModuleInit() {
|
||||
this.moduleRegistry.registerModule({
|
||||
key: 'guest',
|
||||
name: 'Invitados',
|
||||
description: 'Gestión de invitados, RSVP y asignación de mesas.',
|
||||
routePrefix: '/guest',
|
||||
});
|
||||
}
|
||||
};
|
||||
exports.GuestModuleRegistration = GuestModuleRegistration;
|
||||
exports.GuestModuleRegistration = GuestModuleRegistration = __decorate([
|
||||
(0, common_1.Injectable)(),
|
||||
__metadata("design:paramtypes", [module_registry_service_1.ModuleRegistryService])
|
||||
], GuestModuleRegistration);
|
||||
15
dist/guest/services/guest.service.d.ts
vendored
Normal file
15
dist/guest/services/guest.service.d.ts
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
import { MikroORM } from '@mikro-orm/core';
|
||||
import { EventEmitter2 } from '@nestjs/event-emitter';
|
||||
import { Guest } from '../entities/guest.entity';
|
||||
import { CreateGuestDto } from '../api/dto/create-guest.dto';
|
||||
import { UpdateRsvpDto } from '../api/dto/update-rsvp.dto';
|
||||
export declare class GuestService {
|
||||
private readonly orm;
|
||||
private readonly eventEmitter;
|
||||
constructor(orm: MikroORM, eventEmitter: EventEmitter2);
|
||||
private get em();
|
||||
createGuest(tenantId: string, dto: CreateGuestDto): Promise<Guest>;
|
||||
updateRsvp(tenantId: string, guestId: string, dto: UpdateRsvpDto): Promise<Guest | null>;
|
||||
listGuests(tenantId: string): Promise<Guest[]>;
|
||||
}
|
||||
//# sourceMappingURL=guest.service.d.ts.map
|
||||
1
dist/guest/services/guest.service.d.ts.map
vendored
Normal file
1
dist/guest/services/guest.service.d.ts.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"guest.service.d.ts","sourceRoot":"","sources":["../../../src/guest/services/guest.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAE3D,qBACa,YAAY;IAErB,OAAO,CAAC,QAAQ,CAAC,GAAG;IACpB,OAAO,CAAC,QAAQ,CAAC,YAAY;gBADZ,GAAG,EAAE,QAAQ,EACb,YAAY,EAAE,aAAa;IAG9C,OAAO,KAAK,EAAE,GAEb;IAEK,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,KAAK,CAAC;IAWlE,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,aAAa,GAAG,OAAO,CAAC,KAAK,GAAG,IAAI,CAAC;IAaxF,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,EAAE,CAAC;CAGrD"}
|
||||
57
dist/guest/services/guest.service.js
vendored
Normal file
57
dist/guest/services/guest.service.js
vendored
Normal file
@@ -0,0 +1,57 @@
|
||||
"use strict";
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
var __metadata = (this && this.__metadata) || function (k, v) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.GuestService = void 0;
|
||||
const common_1 = require("@nestjs/common");
|
||||
const core_1 = require("@mikro-orm/core");
|
||||
const event_emitter_1 = require("@nestjs/event-emitter");
|
||||
const guest_entity_1 = require("../entities/guest.entity");
|
||||
let GuestService = class GuestService {
|
||||
constructor(orm, eventEmitter) {
|
||||
this.orm = orm;
|
||||
this.eventEmitter = eventEmitter;
|
||||
}
|
||||
get em() {
|
||||
return this.orm.em.fork();
|
||||
}
|
||||
async createGuest(tenantId, dto) {
|
||||
const guest = this.em.create(guest_entity_1.Guest, {
|
||||
tenantId,
|
||||
...dto,
|
||||
});
|
||||
this.em.persist(guest);
|
||||
await this.em.flush();
|
||||
this.eventEmitter.emit('guest.invited', { guest });
|
||||
return guest;
|
||||
}
|
||||
async updateRsvp(tenantId, guestId, dto) {
|
||||
const guest = await this.em.findOne(guest_entity_1.Guest, { tenantId, id: guestId });
|
||||
if (!guest)
|
||||
return null;
|
||||
guest.rsvp = dto.rsvp;
|
||||
if (dto.tableId) {
|
||||
guest.tableId = dto.tableId;
|
||||
}
|
||||
this.em.persist(guest);
|
||||
await this.em.flush();
|
||||
this.eventEmitter.emit('guest.rsvp', { guest });
|
||||
return guest;
|
||||
}
|
||||
async listGuests(tenantId) {
|
||||
return this.em.find(guest_entity_1.Guest, { tenantId });
|
||||
}
|
||||
};
|
||||
exports.GuestService = GuestService;
|
||||
exports.GuestService = GuestService = __decorate([
|
||||
(0, common_1.Injectable)(),
|
||||
__metadata("design:paramtypes", [core_1.MikroORM,
|
||||
event_emitter_1.EventEmitter2])
|
||||
], GuestService);
|
||||
10
dist/guest/subscribers/guest.subscriber.d.ts
vendored
Normal file
10
dist/guest/subscribers/guest.subscriber.d.ts
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
import { NotificationService } from '../../core/services/notification.service';
|
||||
import { NotificationRuleService } from '../../core/services/notification-rule.service';
|
||||
export declare class GuestSubscriber {
|
||||
private readonly notificationService;
|
||||
private readonly notificationRuleService;
|
||||
constructor(notificationService: NotificationService, notificationRuleService: NotificationRuleService);
|
||||
handleGuestInvited(payload: any): Promise<void>;
|
||||
handleGuestRsvp(payload: any): Promise<void>;
|
||||
}
|
||||
//# sourceMappingURL=guest.subscriber.d.ts.map
|
||||
1
dist/guest/subscribers/guest.subscriber.d.ts.map
vendored
Normal file
1
dist/guest/subscribers/guest.subscriber.d.ts.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"guest.subscriber.d.ts","sourceRoot":"","sources":["../../../src/guest/subscribers/guest.subscriber.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAC;AAC/E,OAAO,EAAE,uBAAuB,EAAE,MAAM,+CAA+C,CAAC;AAExF,qBACa,eAAe;IAExB,OAAO,CAAC,QAAQ,CAAC,mBAAmB;IACpC,OAAO,CAAC,QAAQ,CAAC,uBAAuB;gBADvB,mBAAmB,EAAE,mBAAmB,EACxC,uBAAuB,EAAE,uBAAuB;IAI7D,kBAAkB,CAAC,OAAO,EAAE,GAAG;IAgB/B,eAAe,CAAC,OAAO,EAAE,GAAG;CAcnC"}
|
||||
58
dist/guest/subscribers/guest.subscriber.js
vendored
Normal file
58
dist/guest/subscribers/guest.subscriber.js
vendored
Normal file
@@ -0,0 +1,58 @@
|
||||
"use strict";
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
var __metadata = (this && this.__metadata) || function (k, v) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.GuestSubscriber = void 0;
|
||||
const event_emitter_1 = require("@nestjs/event-emitter");
|
||||
const common_1 = require("@nestjs/common");
|
||||
const notification_service_1 = require("../../core/services/notification.service");
|
||||
const notification_rule_service_1 = require("../../core/services/notification-rule.service");
|
||||
let GuestSubscriber = class GuestSubscriber {
|
||||
constructor(notificationService, notificationRuleService) {
|
||||
this.notificationService = notificationService;
|
||||
this.notificationRuleService = notificationRuleService;
|
||||
}
|
||||
async handleGuestInvited(payload) {
|
||||
const { guest } = payload;
|
||||
const rules = await this.notificationRuleService.getRulesForEvent(guest.tenantId, 'guest', 'guest.invited');
|
||||
for (const rule of rules) {
|
||||
for (const channel of rule.channels) {
|
||||
await this.notificationService.send(channel, guest.email || guest.phone || '', 'Has sido invitado', `Hola ${guest.name}, has sido invitado al evento.`);
|
||||
}
|
||||
}
|
||||
}
|
||||
async handleGuestRsvp(payload) {
|
||||
const { guest } = payload;
|
||||
const rules = await this.notificationRuleService.getRulesForEvent(guest.tenantId, 'guest', 'guest.rsvp');
|
||||
for (const rule of rules) {
|
||||
for (const channel of rule.channels) {
|
||||
await this.notificationService.send(channel, guest.email || guest.phone || '', 'RSVP actualizado', `Hola ${guest.name}, tu RSVP ha sido actualizado.`);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
exports.GuestSubscriber = GuestSubscriber;
|
||||
__decorate([
|
||||
(0, event_emitter_1.OnEvent)('guest.invited'),
|
||||
__metadata("design:type", Function),
|
||||
__metadata("design:paramtypes", [Object]),
|
||||
__metadata("design:returntype", Promise)
|
||||
], GuestSubscriber.prototype, "handleGuestInvited", null);
|
||||
__decorate([
|
||||
(0, event_emitter_1.OnEvent)('guest.rsvp'),
|
||||
__metadata("design:type", Function),
|
||||
__metadata("design:paramtypes", [Object]),
|
||||
__metadata("design:returntype", Promise)
|
||||
], GuestSubscriber.prototype, "handleGuestRsvp", null);
|
||||
exports.GuestSubscriber = GuestSubscriber = __decorate([
|
||||
(0, common_1.Injectable)(),
|
||||
__metadata("design:paramtypes", [notification_service_1.NotificationService,
|
||||
notification_rule_service_1.NotificationRuleService])
|
||||
], GuestSubscriber);
|
||||
5
dist/guest/workflows/guest.workflow.d.ts
vendored
Normal file
5
dist/guest/workflows/guest.workflow.d.ts
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
import { BaseWorkflow } from '../../core/workflows/base-workflow';
|
||||
export declare class GuestWorkflow extends BaseWorkflow {
|
||||
execute(...args: any[]): Promise<any>;
|
||||
}
|
||||
//# sourceMappingURL=guest.workflow.d.ts.map
|
||||
1
dist/guest/workflows/guest.workflow.d.ts.map
vendored
Normal file
1
dist/guest/workflows/guest.workflow.d.ts.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"guest.workflow.d.ts","sourceRoot":"","sources":["../../../src/guest/workflows/guest.workflow.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAElE,qBAAa,aAAc,SAAQ,YAAY;IACvC,OAAO,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC;CAM5C"}
|
||||
13
dist/guest/workflows/guest.workflow.js
vendored
Normal file
13
dist/guest/workflows/guest.workflow.js
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.GuestWorkflow = void 0;
|
||||
const base_workflow_1 = require("../../core/workflows/base-workflow");
|
||||
class GuestWorkflow extends base_workflow_1.BaseWorkflow {
|
||||
async execute(...args) {
|
||||
this.logExecution('Ejecutando workflow de invitados', args);
|
||||
// Implementar lógica de workflow para invitados
|
||||
// ...existing code...
|
||||
return {};
|
||||
}
|
||||
}
|
||||
exports.GuestWorkflow = GuestWorkflow;
|
||||
Reference in New Issue
Block a user