@ozdao/prometheus-framework 0.2.257 → 0.2.258

Sign up to get free protection for your applications and to get access to all the features.
@@ -285,6 +285,7 @@ var payments_routes = function(app, db, origins, publicPath) {
285
285
  const observer = new Observer2();
286
286
  new WebhookStripe(app, db, observer);
287
287
  const controller = controllerFactory(db);
288
+ console.log("payments ticket", publicPath);
288
289
  const controllerTickets = controllerFactoryTickets(db, publicPath);
289
290
  middlewareFactoryAuth$1(db);
290
291
  observer.subscribe("checkout.session.completed", async (paymentIntent) => {
@@ -284,6 +284,7 @@ var payments_routes = function(app, db, origins, publicPath) {
284
284
  const observer = new Observer2();
285
285
  new WebhookStripe(app, db, observer);
286
286
  const controller = controllerFactory(db);
287
+ console.log("payments ticket", publicPath);
287
288
  const controllerTickets = controllerFactoryTickets(db, publicPath);
288
289
  middlewareFactoryAuth$1(db);
289
290
  observer.subscribe("checkout.session.completed", async (paymentIntent) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ozdao/prometheus-framework",
3
- "version": "0.2.257",
3
+ "version": "0.2.258",
4
4
  "description": "Web3 Framework focused on user experience and ease of development.",
5
5
  "author": "OZ DAO <hello@ozdao.dev>",
6
6
  "license": "GPL-3.0-or-later",
@@ -7,14 +7,18 @@ const eventsRoutes = require('./routes/events.routes.js');
7
7
  const ticketsRoutes = require('./routes/tickets.routes.js');
8
8
 
9
9
  // Импортируем модели
10
- const EventModel = require('./models/event.model.js');
11
- const TicketModel = require('./models/ticket.model.js');
10
+ const createEventModel = require('./models/event.model.js');
11
+ const createTicketModel = require('./models/ticket.model.js');
12
12
 
13
- function initializeEvent(app, db, origins, publicPath) {
14
- console.log('initializeEvent publicPath:', publicPath);
15
- // Настраиваем модели в объекте базы данных
16
- db.event = EventModel(db);
17
- db.ticket = TicketModel(db);
13
+ function initializeEvent(app, db, origins, publicPath, options = {}) {
14
+ console.log('initializeEvent publicPath:', publicPath);
15
+
16
+ // Получаем дополнительные поля для моделей из options
17
+ const { eventFields = {}, ticketFields = {} } = options;
18
+
19
+ // Инициализируем модели с дополнительными полями
20
+ db.event = createEventModel(db, eventFields);
21
+ db.ticket = createTicketModel(db, ticketFields);
18
22
 
19
23
  // Настраиваем маршруты, если объект приложения передан
20
24
  if (app) {
@@ -23,12 +27,11 @@ function initializeEvent(app, db, origins, publicPath) {
23
27
  }
24
28
  }
25
29
 
26
- // Экспортируем функцию инициализации, контроллеры, роуты и модели
27
30
  module.exports = {
28
31
  initialize: initializeEvent,
29
32
  models: {
30
- EventModel,
31
- TicketModel,
33
+ EventModel: createEventModel,
34
+ TicketModel: createTicketModel,
32
35
  },
33
36
  routes: {
34
37
  eventsRoutes,
@@ -3,9 +3,9 @@ const applyEngagementSchema = require('@pf/src/modules/globals/models/schemas/en
3
3
  const applyOwnershipSchema = require('@pf/src/modules/globals/models/schemas/ownership.schema.js');
4
4
  const applyMetadataSchema = require('@pf/src/modules/globals/models/schemas/metadata.schema.js');
5
5
 
6
- module.exports = (db) => {
7
-
8
- const EventSchema = new db.mongoose.Schema({
6
+ module.exports = (db, additionalFields = {}) => {
7
+ // Базовая схема
8
+ const baseSchema = {
9
9
  cover: {
10
10
  type: String,
11
11
  },
@@ -31,42 +31,17 @@ module.exports = (db) => {
31
31
  },
32
32
  specialData: {
33
33
  type: Object,
34
- // default: () => ({
35
- // subtitle: 'NMS Presents',
36
- // ticketPrice: 499,
37
- // ticketText: 'Hurry up and purchase your ticket at a special price of only',
38
- // ticketTextButton: 'Buy Ticket Now →',
39
- // ticketImage: null,
40
- // ticketLinkStripe: null,
41
- // video: null,
42
- // guests: [],
43
- // guestVideo: null,
44
- // guestTitle: null,
45
- // guestDescription: null,
46
- // guestFacebook: null,
47
- // guestInstagram: null,
48
- // guestTelegram: null,
49
- // guestTwitter: null,
50
- // guestSoundcloud: null,
51
- // guestSpotify: null,
52
- // guestYoutube: null,
53
- // paymentContact: null,
54
- // paymentText: 'For extra payment options contact',
55
- // previousTitle: null,
56
- // previousDescription: null,
57
- // previousLink: null,
58
- // previousLinkText: null,
59
- // logos: [],
60
- // lineup: [],
61
- // lineupBackground: null,
62
- // previousVideo: null
63
- // })
64
34
  },
65
- // Adding special boolean property
66
35
  special: {
67
36
  type: Boolean,
68
37
  default: false
69
38
  }
39
+ };
40
+
41
+ // Объединяем базовую схему с дополнительными полями
42
+ const EventSchema = new db.mongoose.Schema({
43
+ ...baseSchema,
44
+ ...additionalFields
70
45
  }, {
71
46
  timestamps: {
72
47
  currentTime: () => Date.now()
@@ -79,13 +54,12 @@ module.exports = (db) => {
79
54
  'date.end': -1,
80
55
  });
81
56
 
82
- applyCommonSchema(EventSchema,db);
83
- applyEngagementSchema(EventSchema,db);
84
- applyOwnershipSchema(EventSchema,db);
85
- applyMetadataSchema(EventSchema,db);
57
+ applyCommonSchema(EventSchema, db);
58
+ applyEngagementSchema(EventSchema, db);
59
+ applyOwnershipSchema(EventSchema, db);
60
+ applyMetadataSchema(EventSchema, db);
86
61
 
87
62
  const Event = db.mongoose.model("Event", EventSchema);
88
63
 
89
64
  return Event;
90
- };
91
-
65
+ };
@@ -14,6 +14,7 @@ module.exports = function(app, db, origins, publicPath) {
14
14
  const webhook = new WebhookStripe(app, db, observer);
15
15
 
16
16
  const controller = controllerFactory(db);
17
+ console.log('payments ticket', publicPath)
17
18
  const controllerTickets = controllerFactoryTickets(db, publicPath);
18
19
 
19
20
  const { verifySignUp, verifyUser } = middlewareFactoryAuth(db);