@lyxa.ai/core 1.0.100 → 1.0.102
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/index.js.map +1 -1
- package/dist/libraries/auth/index.js.map +1 -1
- package/dist/libraries/auth/refreshtoken.js.map +1 -1
- package/dist/libraries/auth/repository.js.map +1 -1
- package/dist/libraries/cache/settings/index.js.map +1 -1
- package/dist/libraries/configuration/index.js.map +1 -1
- package/dist/libraries/configuration/types/EnvironmentConfigurationType.js.map +1 -1
- package/dist/libraries/dispatcher/index.js.map +1 -1
- package/dist/libraries/event/BaseEvent.js.map +1 -1
- package/dist/libraries/event/decorators/metadata.js.map +1 -1
- package/dist/libraries/event/decorators/subscribe.js.map +1 -1
- package/dist/libraries/event/index.js.map +1 -1
- package/dist/libraries/event/registry/SubscriptionRegistry.js.map +1 -1
- package/dist/libraries/event/test/OrderCreationEvent.js.map +1 -1
- package/dist/libraries/firebase/fcmService.js.map +1 -1
- package/dist/libraries/firebase/index.js.map +1 -1
- package/dist/libraries/index.js.map +1 -1
- package/dist/libraries/logger/index.js.map +1 -1
- package/dist/libraries/map/index.js.map +1 -1
- package/dist/libraries/map/interfaces/IMapService.js.map +1 -1
- package/dist/libraries/map/mapService.js.map +1 -1
- package/dist/libraries/map/providers/google-maps.js.map +1 -1
- package/dist/libraries/map/providers/index.js.map +1 -1
- package/dist/libraries/mongo/index.js.map +1 -1
- package/dist/libraries/mongo/models/activity-log.model.js.map +1 -1
- package/dist/libraries/mongo/models/admin-access-control.model.js.map +1 -1
- package/dist/libraries/mongo/models/admin.model.js.map +1 -1
- package/dist/libraries/mongo/models/agent-performance.model.d.ts +13 -0
- package/dist/libraries/mongo/models/agent-performance.model.js +68 -0
- package/dist/libraries/mongo/models/agent-performance.model.js.map +1 -0
- package/dist/libraries/mongo/models/app-screen-setting.model.js +2 -27
- package/dist/libraries/mongo/models/app-screen-setting.model.js.map +1 -1
- package/dist/libraries/mongo/models/attribute.model.js.map +1 -1
- package/dist/libraries/mongo/models/banner.model.js.map +1 -1
- package/dist/libraries/mongo/models/base/base-coupon.model.js.map +1 -1
- package/dist/libraries/mongo/models/base/base-review.model.js.map +1 -1
- package/dist/libraries/mongo/models/bob-finance.model.js.map +1 -1
- package/dist/libraries/mongo/models/brand.model.js.map +1 -1
- package/dist/libraries/mongo/models/cancellation-reason.model.js.map +1 -1
- package/dist/libraries/mongo/models/card.model.js.map +1 -1
- package/dist/libraries/mongo/models/cart-participant.model.js.map +1 -1
- package/dist/libraries/mongo/models/cart.model.js.map +1 -1
- package/dist/libraries/mongo/models/category.model.js.map +1 -1
- package/dist/libraries/mongo/models/core-auth-identity.model.js.map +1 -1
- package/dist/libraries/mongo/models/core-user.model.js.map +1 -1
- package/dist/libraries/mongo/models/counter.model.js.map +1 -1
- package/dist/libraries/mongo/models/coupon.model.js.map +1 -1
- package/dist/libraries/mongo/models/deal-setting.model.js.map +1 -1
- package/dist/libraries/mongo/models/default-chat.model.js.map +1 -1
- package/dist/libraries/mongo/models/dish.model.js.map +1 -1
- package/dist/libraries/mongo/models/embedded/attribute-item.model.js.map +1 -1
- package/dist/libraries/mongo/models/embedded/attribute-map.model.js.map +1 -1
- package/dist/libraries/mongo/models/embedded/business-development-setting.model.js.map +1 -1
- package/dist/libraries/mongo/models/embedded/cash-settlement.model.js.map +1 -1
- package/dist/libraries/mongo/models/embedded/charge-setting.model.d.ts +14 -0
- package/dist/libraries/mongo/models/embedded/charge-setting.model.js +60 -0
- package/dist/libraries/mongo/models/embedded/charge-setting.model.js.map +1 -0
- package/dist/libraries/mongo/models/embedded/charge-settings.model.js.map +1 -1
- package/dist/libraries/mongo/models/embedded/charge.model.js.map +1 -1
- package/dist/libraries/mongo/models/embedded/courier-order-finance.model.js.map +1 -1
- package/dist/libraries/mongo/models/embedded/courier-setting.model.js.map +1 -1
- package/dist/libraries/mongo/models/embedded/currency-setting.model.js.map +1 -1
- package/dist/libraries/mongo/models/embedded/currency.model.js.map +1 -1
- package/dist/libraries/mongo/models/embedded/customer-support-batches.model.js.map +1 -1
- package/dist/libraries/mongo/models/embedded/customer-support-numbers.model.js.map +1 -1
- package/dist/libraries/mongo/models/embedded/delivery-charge-setting.model.js.map +1 -1
- package/dist/libraries/mongo/models/embedded/delivery-info.model.js.map +1 -1
- package/dist/libraries/mongo/models/embedded/featured-item.mode.js.map +1 -1
- package/dist/libraries/mongo/models/embedded/line-item-attribute.model.js.map +1 -1
- package/dist/libraries/mongo/models/embedded/marketing-cut.model.js.map +1 -1
- package/dist/libraries/mongo/models/embedded/order-cancel.model.js.map +1 -1
- package/dist/libraries/mongo/models/embedded/order-finance.model.js.map +1 -1
- package/dist/libraries/mongo/models/embedded/order-pricing.model.js.map +1 -1
- package/dist/libraries/mongo/models/embedded/order-refund.model.js.map +1 -1
- package/dist/libraries/mongo/models/embedded/otp-fields.model.js.map +1 -1
- package/dist/libraries/mongo/models/embedded/package.model.js.map +1 -1
- package/dist/libraries/mongo/models/embedded/parent-document.model.js.map +1 -1
- package/dist/libraries/mongo/models/embedded/payment-attempt.model.js.map +1 -1
- package/dist/libraries/mongo/models/embedded/payment-infromation.model.js.map +1 -1
- package/dist/libraries/mongo/models/embedded/payout-setting.model.js.map +1 -1
- package/dist/libraries/mongo/models/embedded/plus-settings.model.js.map +1 -1
- package/dist/libraries/mongo/models/embedded/price-breakdown.model.js.map +1 -1
- package/dist/libraries/mongo/models/embedded/product-nutrition.model.js.map +1 -1
- package/dist/libraries/mongo/models/embedded/profit.model.js.map +1 -1
- package/dist/libraries/mongo/models/embedded/referral-discount-config.model.js.map +1 -1
- package/dist/libraries/mongo/models/embedded/regular-order-finance.model.js.map +1 -1
- package/dist/libraries/mongo/models/embedded/rider-assignment-model.js.map +1 -1
- package/dist/libraries/mongo/models/embedded/rider-batches.model.js.map +1 -1
- package/dist/libraries/mongo/models/embedded/rider-equipment.model.js.map +1 -1
- package/dist/libraries/mongo/models/embedded/rider-setting.model.js.map +1 -1
- package/dist/libraries/mongo/models/embedded/service-fee-setting.model.js.map +1 -1
- package/dist/libraries/mongo/models/embedded/shop-document.model.js.map +1 -1
- package/dist/libraries/mongo/models/embedded/status-timeline.model.js.map +1 -1
- package/dist/libraries/mongo/models/embedded/subscription-summary.model.js.map +1 -1
- package/dist/libraries/mongo/models/embedded/support-reason-info.model.js.map +1 -1
- package/dist/libraries/mongo/models/embedded/ticket-message.model.d.ts +11 -0
- package/dist/libraries/mongo/models/{providers/courier-order-finance.model.js → embedded/ticket-message.model.js} +23 -11
- package/dist/libraries/mongo/models/embedded/ticket-message.model.js.map +1 -0
- package/dist/libraries/mongo/models/embedded/trip-leg.mode.js.map +1 -1
- package/dist/libraries/mongo/models/embedded/vat.model.js.map +1 -1
- package/dist/libraries/mongo/models/embedded/zone-geometry.mode.js.map +1 -1
- package/dist/libraries/mongo/models/faq.model.js.map +1 -1
- package/dist/libraries/mongo/models/favourite.model.js.map +1 -1
- package/dist/libraries/mongo/models/featured-setting.model.js.map +1 -1
- package/dist/libraries/mongo/models/filter-container.model.js.map +1 -1
- package/dist/libraries/mongo/models/finance-settlement.model.js.map +1 -1
- package/dist/libraries/mongo/models/gallery.model.js.map +1 -1
- package/dist/libraries/mongo/models/index.d.ts +7 -0
- package/dist/libraries/mongo/models/index.js +8 -1
- package/dist/libraries/mongo/models/index.js.map +1 -1
- package/dist/libraries/mongo/models/line-item.model.js.map +1 -1
- package/dist/libraries/mongo/models/list-container.model.js.map +1 -1
- package/dist/libraries/mongo/models/loyalty-point-category.model.js.map +1 -1
- package/dist/libraries/mongo/models/loyalty-point-setting.model.js.map +1 -1
- package/dist/libraries/mongo/models/loyalty-point.model.js.map +1 -1
- package/dist/libraries/mongo/models/marketing.model.js.map +1 -1
- package/dist/libraries/mongo/models/meal-plan.model.js.map +1 -1
- package/dist/libraries/mongo/models/notification.model.js.map +1 -1
- package/dist/libraries/mongo/models/nutrition.model.js.map +1 -1
- package/dist/libraries/mongo/models/order-delivery.model.js.map +1 -1
- package/dist/libraries/mongo/models/order-payment.model.d.ts +4 -0
- package/dist/libraries/mongo/models/order-payment.model.js +15 -3
- package/dist/libraries/mongo/models/order-payment.model.js.map +1 -1
- package/dist/libraries/mongo/models/order.model.js.map +1 -1
- package/dist/libraries/mongo/models/parent.model.js.map +1 -1
- package/dist/libraries/mongo/models/payout.model.js.map +1 -1
- package/dist/libraries/mongo/models/product-marketing.model.js.map +1 -1
- package/dist/libraries/mongo/models/product.model.js.map +1 -1
- package/dist/libraries/mongo/models/providers/areeba-card.model.js.map +1 -1
- package/dist/libraries/mongo/models/providers/buy1-get1-marketing.model.js.map +1 -1
- package/dist/libraries/mongo/models/providers/core-apple-auth-identity.model.js.map +1 -1
- package/dist/libraries/mongo/models/providers/core-email-auth-identity.model.js.map +1 -1
- package/dist/libraries/mongo/models/providers/core-google-auth-identity.model.js.map +1 -1
- package/dist/libraries/mongo/models/providers/core-phone-auth-identity.model.js.map +1 -1
- package/dist/libraries/mongo/models/providers/courier-order.model.js.map +1 -1
- package/dist/libraries/mongo/models/providers/custom-coupon.model.js.map +1 -1
- package/dist/libraries/mongo/models/providers/discount-marketing.model.js.map +1 -1
- package/dist/libraries/mongo/models/providers/featured-marketing.model.js.map +1 -1
- package/dist/libraries/mongo/models/providers/free-delivery-marketing.model.js.map +1 -1
- package/dist/libraries/mongo/models/providers/global-coupon.model.js.map +1 -1
- package/dist/libraries/mongo/models/providers/individual-store-coupon.model.js.map +1 -1
- package/dist/libraries/mongo/models/providers/individual-user-coupon.model.js.map +1 -1
- package/dist/libraries/mongo/models/providers/loyalty-point-marketing.model.js.map +1 -1
- package/dist/libraries/mongo/models/providers/punch-marketing.model.js.map +1 -1
- package/dist/libraries/mongo/models/providers/referral-code-coupon.model.js.map +1 -1
- package/dist/libraries/mongo/models/providers/referral-reward-coupon.model.js.map +1 -1
- package/dist/libraries/mongo/models/providers/regular-order.model.js.map +1 -1
- package/dist/libraries/mongo/models/providers/rider-payout.model.js.map +1 -1
- package/dist/libraries/mongo/models/providers/shop-payout.model.js.map +1 -1
- package/dist/libraries/mongo/models/punch-marketing-history.model.js.map +1 -1
- package/dist/libraries/mongo/models/rating-setting.model.js.map +1 -1
- package/dist/libraries/mongo/models/referral-setting.model.js.map +1 -1
- package/dist/libraries/mongo/models/request-area.model.js.map +1 -1
- package/dist/libraries/mongo/models/reward.model.js.map +1 -1
- package/dist/libraries/mongo/models/rider-review.model.js.map +1 -1
- package/dist/libraries/mongo/models/rider-timeout.model.js.map +1 -1
- package/dist/libraries/mongo/models/rider-tracking.model.js.map +1 -1
- package/dist/libraries/mongo/models/rider.model.d.ts +1 -1
- package/dist/libraries/mongo/models/rider.model.js +2 -2
- package/dist/libraries/mongo/models/rider.model.js.map +1 -1
- package/dist/libraries/mongo/models/role.model.js.map +1 -1
- package/dist/libraries/mongo/models/setting.model.js.map +1 -1
- package/dist/libraries/mongo/models/shared/address.model.js.map +1 -1
- package/dist/libraries/mongo/models/shared/duration.model.js.map +1 -1
- package/dist/libraries/mongo/models/shared/geo-location.model.js.map +1 -1
- package/dist/libraries/mongo/models/shared/work-hour.model.js.map +1 -1
- package/dist/libraries/mongo/models/shop-access-control.model.js.map +1 -1
- package/dist/libraries/mongo/models/shop-category.model.js.map +1 -1
- package/dist/libraries/mongo/models/shop-meal-plan.model.js.map +1 -1
- package/dist/libraries/mongo/models/shop-review.model.js.map +1 -1
- package/dist/libraries/mongo/models/shop.model.js.map +1 -1
- package/dist/libraries/mongo/models/subscription-setting.model.js.map +1 -1
- package/dist/libraries/mongo/models/subscription.model.js.map +1 -1
- package/dist/libraries/mongo/models/support-reason.model.js.map +1 -1
- package/dist/libraries/mongo/models/tag.model.js.map +1 -1
- package/dist/libraries/mongo/models/terms-and-conditions.model.js.map +1 -1
- package/dist/libraries/mongo/models/ticket.model.d.ts +28 -0
- package/dist/libraries/mongo/models/ticket.model.js +175 -0
- package/dist/libraries/mongo/models/ticket.model.js.map +1 -0
- package/dist/libraries/mongo/models/transaction.model.js.map +1 -1
- package/dist/libraries/mongo/models/user-app-section-setting.model.js.map +1 -1
- package/dist/libraries/mongo/models/user.model.js.map +1 -1
- package/dist/libraries/mongo/models/zone.model.js.map +1 -1
- package/dist/libraries/mongo/plugins/soft-delete-plugin.js.map +1 -1
- package/dist/libraries/redis/index.js.map +1 -1
- package/dist/libraries/secrets/index.js.map +1 -1
- package/dist/libraries/trpc/context.js.map +1 -1
- package/dist/libraries/trpc/index.js.map +1 -1
- package/dist/libraries/trpc/middlewares/auth.d.ts +3 -3
- package/dist/libraries/trpc/middlewares/auth.js.map +1 -1
- package/dist/libraries/trpc/middlewares/cors.js.map +1 -1
- package/dist/libraries/trpc/middlewares/phone-verified.d.ts +3 -3
- package/dist/libraries/trpc/middlewares/phone-verified.js.map +1 -1
- package/dist/libraries/trpc/middlewares/publicUserDecoder.d.ts +3 -3
- package/dist/libraries/trpc/middlewares/publicUserDecoder.js.map +1 -1
- package/dist/libraries/twilio/index.js.map +1 -1
- package/dist/libraries/upload/index.js.map +1 -1
- package/dist/utilities/common/password.js.map +1 -1
- package/dist/utilities/common/week.js.map +1 -1
- package/dist/utilities/currency.js.map +1 -1
- package/dist/utilities/enum.d.ts +14 -0
- package/dist/utilities/enum.js +18 -1
- package/dist/utilities/enum.js.map +1 -1
- package/dist/utilities/error-handler.js.map +1 -1
- package/dist/utilities/error-middleware.js.map +1 -1
- package/dist/utilities/pagination.d.ts +5 -5
- package/dist/utilities/pagination.js.map +1 -1
- package/dist/utilities/response.js.map +1 -1
- package/dist/utilities/search.js.map +1 -1
- package/dist/utilities/sorting.js.map +1 -1
- package/dist/utilities/transformers.js.map +1 -1
- package/dist/utilities/validation/common-validation.d.ts +125 -125
- package/dist/utilities/validation/common-validation.js.map +1 -1
- package/dist/utilities/validation/global-validation.js.map +1 -1
- package/dist/utilities/validation/index.js.map +1 -1
- package/package.json +54 -54
- package/dist/libraries/mongo/models/order-finance.model.d.ts +0 -22
- package/dist/libraries/mongo/models/order-finance.model.js +0 -83
- package/dist/libraries/mongo/models/order-finance.model.js.map +0 -1
- package/dist/libraries/mongo/models/providers/courier-order-finance.model.d.ts +0 -7
- package/dist/libraries/mongo/models/providers/courier-order-finance.model.js.map +0 -1
- package/dist/libraries/mongo/models/providers/regular-order-finance.model.d.ts +0 -25
- package/dist/libraries/mongo/models/providers/regular-order-finance.model.js +0 -95
- package/dist/libraries/mongo/models/providers/regular-order-finance.model.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"/","sources":["libraries/mongo/index.ts"],"names":[],"mappings":";;AAkCA,oDAmDC;AAMD,8CAiDC;AAMD,wEAgEC;AAlND,uCAAkE;AAClE,oDAAwG;AAExG,qEAAqE;AAGrE,IAAA,0CAAqB,GAAE,CAAC;AAGxB,IAAI,gBAAwC,CAAC;AAC7C,IAAI,iBAAiB,GAA+B,IAAI,CAAC;AACzD,IAAI,aAAa,GAAG,IAAI,GAAG,EAOxB,CAAC;AAEJ,IAAI,0BAA0B,GAAG,IAAI,GAAG,EASrC,CAAC;AAKG,KAAK,UAAU,oBAAoB,CAAC,GAAW,EAAE,WAAmB;IAC1E,IAAI,CAAC,iBAAiB,EAAE,CAAC;QACxB,iBAAiB,GAAG,IAAI,OAAO,CAAa,OAAO,CAAC,EAAE;YACrD,OAAO,CAAC,GAAG,CAAC,mDAAmD,WAAW,EAAE,CAAC,CAAC;YAC9E,MAAM,UAAU,GAAG,IAAA,2BAAgB,EAAC,GAAG,EAAE;gBACxC,MAAM,EAAE,QAAQ,WAAW,SAAS;aACpC,CAAC,CAAC;YAEH,UAAU,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,IAAI,EAAE;gBACvC,OAAO,CAAC,GAAG,CAAC,4CAA4C,CAAC,CAAC;gBAC1D,gBAAgB,GAAG,UAAU,CAAC;gBAG9B,KAAK,MAAM,CAAC,SAAS,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,IAAI,aAAa,CAAC,OAAO,EAAE,EAAE,CAAC;o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,IAAI,CAAC;IAEnC,OAAO,IAAI,KAAK,CAAC,EAAO,EAAE;QACzB,GAAG,CAAC,MAAM,EAAE,IAAI,EAAE,QAAQ;YAEzB,IAAI,IAAI,KAAK,MAAM,EAAE,CAAC;gBACrB,OAAO,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YACnC,CAAC;YAED,OAAO,KAAK,WAAW,GAAG,IAAW;gBACpC,IAAI,CAAC,aAAa,EAAE,CAAC;oBACpB,aAAa,GAAG,MAAM,OAAO,CAAC;gBAC/B,CAAC;gBAED,MAAM,SAAS,GAAI,aAAqB,CAAC,IAAI,CAAC,CAAC;gBAC/C,IAAI,OAAO,SAAS,KAAK,UAAU,EAAE,CAAC;oBACrC,OAAO,SAAS,CAAC,KAAK,CAAC,aAAa,EAAE,IAAI,CAAC,CAAC;gBAC7C,CAAC;gBACD,OAAO,SAAS,CAAC;YAClB,CAAC,CAAC;QACH,CAAC;KACD,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import mongoose, { Connection, createConnection } from 'mongoose';\nimport { getDiscriminatorModelForClass, getModelForClass, ReturnModelType } from '@typegoose/typegoose';\nimport { AnyParamConstructor, IModelOptions } from '@typegoose/typegoose/lib/types';\nimport { applySoftDeletePlugin } from './plugins/soft-delete-plugin';\n\n// Apply the soft delete plugin globally before any connections or models\napplySoftDeletePlugin();\n\n// Track connection status\nlet globalConnection: Connection | undefined;\nlet connectionPromise: Promise<Connection> | null = null;\nlet pendingModels = new Map<\n\tstring,\n\t{\n\t\tClass: AnyParamConstructor<any>;\n\t\toptions?: IModelOptions;\n\t\tresolve: (model: any) => void;\n\t}\n>();\n\nlet pendingDiscriminatorModels = new Map<\n\tstring,\n\t{\n\t\tbaseModelPromise: Promise<any>; // Store the promise for the base model\n\t\tsubClass: AnyParamConstructor<any>;\n\t\tdiscriminatorName?: string;\n\t\toptions?: IModelOptions;\n\t\tresolve: (model: any) => void;\n\t}\n>();\n\n/**\n * Initialize the global database connection\n */\nexport async function initGlobalConnection(uri: string, environment: string): Promise<Connection> {\n\tif (!connectionPromise) {\n\t\tconnectionPromise = new Promise<Connection>(resolve => {\n\t\t\tconsole.log(`Initializing global connection for environment: ${environment}`);\n\t\t\tconst connection = createConnection(uri, {\n\t\t\t\tdbName: `lyxa-${environment}-global`,\n\t\t\t});\n\n\t\t\tconnection.once('connected', async () => {\n\t\t\t\tconsole.log('Global connection successfully established');\n\t\t\t\tglobalConnection = connection;\n\n\t\t\t\t// Initialize any pending models with the real connection\n\t\t\t\tfor (const [modelName, { Class, options, resolve }] of pendingModels.entries()) {\n\t\t\t\t\tconst model = getModelForClass(Class, {\n\t\t\t\t\t\texistingConnection: globalConnection,\n\t\t\t\t\t\t...options,\n\t\t\t\t\t});\n\t\t\t\t\tresolve(model);\n\t\t\t\t}\n\t\t\t\tpendingModels.clear();\n\n\t\t\t\t// Initialize any pending discriminator models\n\t\t\t\t// Process discriminators sequentially to ensure dependencies are resolved\n\t\t\t\tfor (const [\n\t\t\t\t\tmodelName,\n\t\t\t\t\t{ baseModelPromise, subClass, discriminatorName, options, resolve },\n\t\t\t\t] of pendingDiscriminatorModels.entries()) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\t// Await the base model to be fully resolved\n\t\t\t\t\t\tconst actualBaseModel = await baseModelPromise;\n\n\t\t\t\t\t\t// Create the discriminator model with the actual base model\n\t\t\t\t\t\tconst model = getDiscriminatorModelForClass(actualBaseModel, subClass, discriminatorName, {\n\t\t\t\t\t\t\texistingConnection: globalConnection,\n\t\t\t\t\t\t\t...options,\n\t\t\t\t\t\t});\n\t\t\t\t\t\tresolve(model);\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\tconsole.error(`Failed to create discriminator model ${modelName}:`, error);\n\t\t\t\t\t\t// Resolve with error to unblock the promise chain\n\t\t\t\t\t\tresolve(Promise.reject(error));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tpendingDiscriminatorModels.clear();\n\n\t\t\t\tresolve(connection);\n\t\t\t});\n\t\t});\n\t}\n\treturn connectionPromise;\n}\n\n/**\n * Creates a Typegoose model that will use the global connection when it's ready.\n * Safe to call during module initialization before initGlobalConnection.\n */\nexport function createGlobalModel<T extends AnyParamConstructor<any>>(\n\tClass: T,\n\toptions?: IModelOptions\n): ReturnModelType<T> {\n\tconst modelName = options?.schemaOptions?.collection || Class.name;\n\n\t// If the connection is already initialized, create the model directly\n\tif (globalConnection) {\n\t\treturn getModelForClass(Class, {\n\t\t\texistingConnection: globalConnection,\n\t\t\t...options,\n\t\t});\n\t}\n\n\tconsole.log(`Registering model ${modelName} to be initialized when global connection is ready`);\n\n\t// Create a lazy-loaded model instance that will initialize once the connection is ready\n\tlet actualModel: ReturnModelType<T> | null = null;\n\tlet modelReadyPromise: Promise<ReturnModelType<T>>;\n\n\t// Setup the promise that will resolve once the model is ready\n\tmodelReadyPromise = new Promise<ReturnModelType<T>>(resolve => {\n\t\t// Register this model to be initialized when connection is ready\n\t\tpendingModels.set(modelName, { Class, options, resolve });\n\t});\n\n\t// Create a proxy that forwards operations to the real model once it's available\n\tconst modelProxy = new Proxy({} as ReturnModelType<T>, {\n\t\tget(target, prop, receiver) {\n\t\t\t// Handle special case for 'then' to make the proxy thenable\n\t\t\tif (prop === 'then') {\n\t\t\t\treturn modelReadyPromise.then.bind(modelReadyPromise);\n\t\t\t}\n\n\t\t\treturn async function (...args: any[]) {\n\t\t\t\tif (!actualModel) {\n\t\t\t\t\tactualModel = await modelReadyPromise;\n\t\t\t\t}\n\n\t\t\t\tconst propValue = (actualModel as any)[prop];\n\t\t\t\tif (typeof propValue === 'function') {\n\t\t\t\t\treturn propValue.apply(actualModel, args);\n\t\t\t\t}\n\t\t\t\treturn propValue;\n\t\t\t};\n\t\t},\n\t});\n\n\treturn modelProxy;\n}\n\n/**\n * Creates a Typegoose discriminator model that will use the global connection when it's ready.\n * Safe to call during module initialization before initGlobalConnection.\n */\nexport function createGlobalDiscriminatorModel<\n\tBase extends AnyParamConstructor<any>,\n\tSub extends AnyParamConstructor<any>,\n>(\n\tbaseModel: ReturnModelType<Base>,\n\tsubClass: Sub,\n\tdiscriminatorName?: string,\n\toptions?: IModelOptions\n): ReturnModelType<Sub> {\n\tconst modelName = discriminatorName || subClass.name;\n\n\t// If the connection is already initialized, create the model directly\n\tif (globalConnection) {\n\t\t// Ensure baseModel is fully resolved if it's a promise or proxy\n\t\tif (baseModel instanceof Promise || (baseModel as any).then) {\n\t\t\t// Create a new promise that will resolve with the discriminator model\n\t\t\tconst discriminatorPromise = (async () => {\n\t\t\t\tconst resolvedBaseModel = await baseModel;\n\t\t\t\treturn getDiscriminatorModelForClass(resolvedBaseModel, subClass, discriminatorName, {\n\t\t\t\t\texistingConnection: globalConnection,\n\t\t\t\t\t...options,\n\t\t\t\t});\n\t\t\t})();\n\n\t\t\t// Return a proxy that will await the discriminator model\n\t\t\treturn createProxyForPromise(discriminatorPromise);\n\t\t}\n\n\t\t// If baseModel is not a promise, create the discriminator directly\n\t\treturn getDiscriminatorModelForClass(baseModel, subClass, discriminatorName, {\n\t\t\texistingConnection: globalConnection,\n\t\t\t...options,\n\t\t});\n\t}\n\n\tconsole.log(\n\t\t`Registering discriminator model ${modelName} to be initialized when global connection is ready`\n\t);\n\n\t// Create a lazy-loaded model instance that will initialize once the connection is ready\n\tlet actualModel: ReturnModelType<Sub> | null = null;\n\tlet modelReadyPromise: Promise<ReturnModelType<Sub>>;\n\n\t// Handle the case where baseModel might be a proxy or promise\n\tlet baseModelPromise: Promise<any>;\n\tif (baseModel instanceof Promise || (baseModel as any).then) {\n\t\tbaseModelPromise = Promise.resolve(baseModel);\n\t} else {\n\t\tbaseModelPromise = Promise.resolve(baseModel);\n\t}\n\n\t// Setup the promise that will resolve once the model is ready\n\tmodelReadyPromise = new Promise<ReturnModelType<Sub>>(resolve => {\n\t\t// Register this discriminator model to be initialized when connection is ready\n\t\tpendingDiscriminatorModels.set(modelName, {\n\t\t\tbaseModelPromise,\n\t\t\tsubClass,\n\t\t\tdiscriminatorName,\n\t\t\toptions,\n\t\t\tresolve,\n\t\t});\n\t});\n\n\treturn createProxyForPromise(modelReadyPromise);\n}\n\n/**\n * Helper function to create a proxy for a promise that will resolve to a model\n */\nfunction createProxyForPromise<T extends object>(promise: Promise<T>): T {\n\tlet resolvedValue: T | null = null;\n\n\treturn new Proxy({} as T, {\n\t\tget(target, prop, receiver) {\n\t\t\t// Handle special case for 'then' to make the proxy thenable\n\t\t\tif (prop === 'then') {\n\t\t\t\treturn promise.then.bind(promise);\n\t\t\t}\n\n\t\t\treturn async function (...args: any[]) {\n\t\t\t\tif (!resolvedValue) {\n\t\t\t\t\tresolvedValue = await promise;\n\t\t\t\t}\n\n\t\t\t\tconst propValue = (resolvedValue as any)[prop];\n\t\t\t\tif (typeof propValue === 'function') {\n\t\t\t\t\treturn propValue.apply(resolvedValue, args);\n\t\t\t\t}\n\t\t\t\treturn propValue;\n\t\t\t};\n\t\t},\n\t});\n}\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"/","sources":["libraries/mongo/index.ts"],"names":[],"mappings":";;AAkCA,oDAmDC;AAMD,8CAiDC;AAMD,wEAgEC;AAlND,uCAAkE;AAClE,oDAAwG;AAExG,qEAAqE;AAGrE,IAAA,0CAAqB,GAAE,CAAC;AAGxB,IAAI,gBAAwC,CAAC;AAC7C,IAAI,iBAAiB,GAA+B,IAAI,CAAC;AACzD,IAAI,aAAa,GAAG,IAAI,GAAG,EAOxB,CAAC;AAEJ,IAAI,0BAA0B,GAAG,IAAI,GAAG,EASrC,CAAC;AAKG,KAAK,UAAU,oBAAoB,CAAC,GAAW,EAAE,WAAmB;IAC1E,IAAI,CAAC,iBAAiB,EAAE,CAAC;QACxB,iBAAiB,GAAG,IAAI,OAAO,CAAa,OAAO,CAAC,EAAE;YACrD,OAAO,CAAC,GAAG,CAAC,mDAAmD,WAAW,EAAE,CAAC,CAAC;YAC9E,MAAM,UAAU,GAAG,IAAA,2BAAgB,EAAC,GAAG,EAAE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/C,CAAC;IAGD,iBAAiB,GAAG,IAAI,OAAO,CAAuB,OAAO,CAAC,EAAE;QAE/D,0BAA0B,CAAC,GAAG,CAAC,SAAS,EAAE;YACzC,gBAAgB;YAChB,QAAQ;YACR,iBAAiB;YACjB,OAAO;YACP,OAAO;SACP,CAAC,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,OAAO,qBAAqB,CAAC,iBAAiB,CAAC,CAAC;AACjD,CAAC;AAKD,SAAS,qBAAqB,CAAmB,OAAmB;IACnE,IAAI,aAAa,GAAa,IAAI,CAAC;IAEnC,OAAO,IAAI,KAAK,CAAC,EAAO,EAAE;QACzB,GAAG,CAAC,MAAM,EAAE,IAAI,EAAE,QAAQ;YAEzB,IAAI,IAAI,KAAK,MAAM,EAAE,CAAC;gBACrB,OAAO,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YACnC,CAAC;YAED,OAAO,KAAK,WAAW,GAAG,IAAW;gBACpC,IAAI,CAAC,aAAa,EAAE,CAAC;oBACpB,aAAa,GAAG,MAAM,OAAO,CAAC;gBAC/B,CAAC;gBAED,MAAM,SAAS,GAAI,aAAqB,CAAC,IAAI,CAAC,CAAC;gBAC/C,IAAI,OAAO,SAAS,KAAK,UAAU,EAAE,CAAC;oBACrC,OAAO,SAAS,CAAC,KAAK,CAAC,aAAa,EAAE,IAAI,CAAC,CAAC;gBAC7C,CAAC;gBACD,OAAO,SAAS,CAAC;YAClB,CAAC,CAAC;QACH,CAAC;KACD,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import mongoose, { Connection, createConnection } from 'mongoose';\r\nimport { getDiscriminatorModelForClass, getModelForClass, ReturnModelType } from '@typegoose/typegoose';\r\nimport { AnyParamConstructor, IModelOptions } from '@typegoose/typegoose/lib/types';\r\nimport { applySoftDeletePlugin } from './plugins/soft-delete-plugin';\r\n\r\n// Apply the soft delete plugin globally before any connections or models\r\napplySoftDeletePlugin();\r\n\r\n// Track connection status\r\nlet globalConnection: Connection | undefined;\r\nlet connectionPromise: Promise<Connection> | null = null;\r\nlet pendingModels = new Map<\r\n\tstring,\r\n\t{\r\n\t\tClass: AnyParamConstructor<any>;\r\n\t\toptions?: IModelOptions;\r\n\t\tresolve: (model: any) => void;\r\n\t}\r\n>();\r\n\r\nlet pendingDiscriminatorModels = new Map<\r\n\tstring,\r\n\t{\r\n\t\tbaseModelPromise: Promise<any>; // Store the promise for the base model\r\n\t\tsubClass: AnyParamConstructor<any>;\r\n\t\tdiscriminatorName?: string;\r\n\t\toptions?: IModelOptions;\r\n\t\tresolve: (model: any) => void;\r\n\t}\r\n>();\r\n\r\n/**\r\n * Initialize the global database connection\r\n */\r\nexport async function initGlobalConnection(uri: string, environment: string): Promise<Connection> {\r\n\tif (!connectionPromise) {\r\n\t\tconnectionPromise = new Promise<Connection>(resolve => {\r\n\t\t\tconsole.log(`Initializing global connection for environment: ${environment}`);\r\n\t\t\tconst connection = createConnection(uri, {\r\n\t\t\t\tdbName: `lyxa-${environment}-global`,\r\n\t\t\t});\r\n\r\n\t\t\tconnection.once('connected', async () => {\r\n\t\t\t\tconsole.log('Global connection successfully established');\r\n\t\t\t\tglobalConnection = connection;\r\n\r\n\t\t\t\t// Initialize any pending models with the real connection\r\n\t\t\t\tfor (const [modelName, { Class, options, resolve }] of pendingModels.entries()) {\r\n\t\t\t\t\tconst model = getModelForClass(Class, {\r\n\t\t\t\t\t\texistingConnection: globalConnection,\r\n\t\t\t\t\t\t...options,\r\n\t\t\t\t\t});\r\n\t\t\t\t\tresolve(model);\r\n\t\t\t\t}\r\n\t\t\t\tpendingModels.clear();\r\n\r\n\t\t\t\t// Initialize any pending discriminator models\r\n\t\t\t\t// Process discriminators sequentially to ensure dependencies are resolved\r\n\t\t\t\tfor (const [\r\n\t\t\t\t\tmodelName,\r\n\t\t\t\t\t{ baseModelPromise, subClass, discriminatorName, options, resolve },\r\n\t\t\t\t] of pendingDiscriminatorModels.entries()) {\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\t// Await the base model to be fully resolved\r\n\t\t\t\t\t\tconst actualBaseModel = await baseModelPromise;\r\n\r\n\t\t\t\t\t\t// Create the discriminator model with the actual base model\r\n\t\t\t\t\t\tconst model = getDiscriminatorModelForClass(actualBaseModel, subClass, discriminatorName, {\r\n\t\t\t\t\t\t\texistingConnection: globalConnection,\r\n\t\t\t\t\t\t\t...options,\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\tresolve(model);\r\n\t\t\t\t\t} catch (error) {\r\n\t\t\t\t\t\tconsole.error(`Failed to create discriminator model ${modelName}:`, error);\r\n\t\t\t\t\t\t// Resolve with error to unblock the promise chain\r\n\t\t\t\t\t\tresolve(Promise.reject(error));\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tpendingDiscriminatorModels.clear();\r\n\r\n\t\t\t\tresolve(connection);\r\n\t\t\t});\r\n\t\t});\r\n\t}\r\n\treturn connectionPromise;\r\n}\r\n\r\n/**\r\n * Creates a Typegoose model that will use the global connection when it's ready.\r\n * Safe to call during module initialization before initGlobalConnection.\r\n */\r\nexport function createGlobalModel<T extends AnyParamConstructor<any>>(\r\n\tClass: T,\r\n\toptions?: IModelOptions\r\n): ReturnModelType<T> {\r\n\tconst modelName = options?.schemaOptions?.collection || Class.name;\r\n\r\n\t// If the connection is already initialized, create the model directly\r\n\tif (globalConnection) {\r\n\t\treturn getModelForClass(Class, {\r\n\t\t\texistingConnection: globalConnection,\r\n\t\t\t...options,\r\n\t\t});\r\n\t}\r\n\r\n\tconsole.log(`Registering model ${modelName} to be initialized when global connection is ready`);\r\n\r\n\t// Create a lazy-loaded model instance that will initialize once the connection is ready\r\n\tlet actualModel: ReturnModelType<T> | null = null;\r\n\tlet modelReadyPromise: Promise<ReturnModelType<T>>;\r\n\r\n\t// Setup the promise that will resolve once the model is ready\r\n\tmodelReadyPromise = new Promise<ReturnModelType<T>>(resolve => {\r\n\t\t// Register this model to be initialized when connection is ready\r\n\t\tpendingModels.set(modelName, { Class, options, resolve });\r\n\t});\r\n\r\n\t// Create a proxy that forwards operations to the real model once it's available\r\n\tconst modelProxy = new Proxy({} as ReturnModelType<T>, {\r\n\t\tget(target, prop, receiver) {\r\n\t\t\t// Handle special case for 'then' to make the proxy thenable\r\n\t\t\tif (prop === 'then') {\r\n\t\t\t\treturn modelReadyPromise.then.bind(modelReadyPromise);\r\n\t\t\t}\r\n\r\n\t\t\treturn async function (...args: any[]) {\r\n\t\t\t\tif (!actualModel) {\r\n\t\t\t\t\tactualModel = await modelReadyPromise;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tconst propValue = (actualModel as any)[prop];\r\n\t\t\t\tif (typeof propValue === 'function') {\r\n\t\t\t\t\treturn propValue.apply(actualModel, args);\r\n\t\t\t\t}\r\n\t\t\t\treturn propValue;\r\n\t\t\t};\r\n\t\t},\r\n\t});\r\n\r\n\treturn modelProxy;\r\n}\r\n\r\n/**\r\n * Creates a Typegoose discriminator model that will use the global connection when it's ready.\r\n * Safe to call during module initialization before initGlobalConnection.\r\n */\r\nexport function createGlobalDiscriminatorModel<\r\n\tBase extends AnyParamConstructor<any>,\r\n\tSub extends AnyParamConstructor<any>,\r\n>(\r\n\tbaseModel: ReturnModelType<Base>,\r\n\tsubClass: Sub,\r\n\tdiscriminatorName?: string,\r\n\toptions?: IModelOptions\r\n): ReturnModelType<Sub> {\r\n\tconst modelName = discriminatorName || subClass.name;\r\n\r\n\t// If the connection is already initialized, create the model directly\r\n\tif (globalConnection) {\r\n\t\t// Ensure baseModel is fully resolved if it's a promise or proxy\r\n\t\tif (baseModel instanceof Promise || (baseModel as any).then) {\r\n\t\t\t// Create a new promise that will resolve with the discriminator model\r\n\t\t\tconst discriminatorPromise = (async () => {\r\n\t\t\t\tconst resolvedBaseModel = await baseModel;\r\n\t\t\t\treturn getDiscriminatorModelForClass(resolvedBaseModel, subClass, discriminatorName, {\r\n\t\t\t\t\texistingConnection: globalConnection,\r\n\t\t\t\t\t...options,\r\n\t\t\t\t});\r\n\t\t\t})();\r\n\r\n\t\t\t// Return a proxy that will await the discriminator model\r\n\t\t\treturn createProxyForPromise(discriminatorPromise);\r\n\t\t}\r\n\r\n\t\t// If baseModel is not a promise, create the discriminator directly\r\n\t\treturn getDiscriminatorModelForClass(baseModel, subClass, discriminatorName, {\r\n\t\t\texistingConnection: globalConnection,\r\n\t\t\t...options,\r\n\t\t});\r\n\t}\r\n\r\n\tconsole.log(\r\n\t\t`Registering discriminator model ${modelName} to be initialized when global connection is ready`\r\n\t);\r\n\r\n\t// Create a lazy-loaded model instance that will initialize once the connection is ready\r\n\tlet actualModel: ReturnModelType<Sub> | null = null;\r\n\tlet modelReadyPromise: Promise<ReturnModelType<Sub>>;\r\n\r\n\t// Handle the case where baseModel might be a proxy or promise\r\n\tlet baseModelPromise: Promise<any>;\r\n\tif (baseModel instanceof Promise || (baseModel as any).then) {\r\n\t\tbaseModelPromise = Promise.resolve(baseModel);\r\n\t} else {\r\n\t\tbaseModelPromise = Promise.resolve(baseModel);\r\n\t}\r\n\r\n\t// Setup the promise that will resolve once the model is ready\r\n\tmodelReadyPromise = new Promise<ReturnModelType<Sub>>(resolve => {\r\n\t\t// Register this discriminator model to be initialized when connection is ready\r\n\t\tpendingDiscriminatorModels.set(modelName, {\r\n\t\t\tbaseModelPromise,\r\n\t\t\tsubClass,\r\n\t\t\tdiscriminatorName,\r\n\t\t\toptions,\r\n\t\t\tresolve,\r\n\t\t});\r\n\t});\r\n\r\n\treturn createProxyForPromise(modelReadyPromise);\r\n}\r\n\r\n/**\r\n * Helper function to create a proxy for a promise that will resolve to a model\r\n */\r\nfunction createProxyForPromise<T extends object>(promise: Promise<T>): T {\r\n\tlet resolvedValue: T | null = null;\r\n\r\n\treturn new Proxy({} as T, {\r\n\t\tget(target, prop, receiver) {\r\n\t\t\t// Handle special case for 'then' to make the proxy thenable\r\n\t\t\tif (prop === 'then') {\r\n\t\t\t\treturn promise.then.bind(promise);\r\n\t\t\t}\r\n\r\n\t\t\treturn async function (...args: any[]) {\r\n\t\t\t\tif (!resolvedValue) {\r\n\t\t\t\t\tresolvedValue = await promise;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tconst propValue = (resolvedValue as any)[prop];\r\n\t\t\t\tif (typeof propValue === 'function') {\r\n\t\t\t\t\treturn propValue.apply(resolvedValue, args);\r\n\t\t\t\t}\r\n\t\t\t\treturn propValue;\r\n\t\t\t};\r\n\t\t},\r\n\t});\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"activity-log.model.js","sourceRoot":"/","sources":["libraries/mongo/models/activity-log.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAmF;AACnF,4EAAqE;AACrE,kDAAuD;AACvD,+CAAsC;AAQ/B,IAAM,WAAW,GAAjB,MAAM,WAAY,SAAQ,2BAAU;IAEnC,KAAK,CAAc;IAGnB,YAAY,CAAgB;IAG5B,WAAW,CAAO;IAGlB,WAAW,CAAO;CACzB,CAAA;AAZY,kCAAW;AAEhB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,mBAAK,EAAE,CAAC;;0CACjB;AAGnB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,mBAAY,EAAE,CAAC;;iDACxB;AAG5B;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,oBAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;;gDACnC;AAGlB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,oBAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;;gDACnC;sBAXb,WAAW;IANvB,IAAA,wBAAY,EAAC;QACb,aAAa,EAAE,EAAE,UAAU,EAAE,cAAc,EAAE;QAC7C,OAAO,EAAE;YACR,UAAU,EAAE,oBAAQ,CAAC,KAAK;SAC1B;KACD,CAAC;GACW,WAAW,CAYvB","sourcesContent":["import { modelOptions, prop, Severity, mongoose, Ref } from '@typegoose/typegoose';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\nimport { UpdatedField } from '../../../utilities/enum';\nimport { Admin } from './admin.model';\n\n@modelOptions({\n\tschemaOptions: { collection: 'activityLogs' },\n\toptions: {\n\t\tallowMixed: Severity.ALLOW,\n\t},\n})\nexport class ActivityLog extends TimeStamps {\n\t@prop({ required: true, ref: () => Admin })\n\tpublic admin!: Ref<Admin>;\n\n\t@prop({ required: true, type: String, enum: UpdatedField })\n\tpublic updatedField!: UpdatedField;\n\n\t@prop({ required: true, type: mongoose.Schema.Types.Mixed })\n\tpublic oldDocument!: any;\n\n\t@prop({ required: true, type: mongoose.Schema.Types.Mixed })\n\tpublic newDocument!: any;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"activity-log.model.js","sourceRoot":"/","sources":["libraries/mongo/models/activity-log.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAmF;AACnF,4EAAqE;AACrE,kDAAuD;AACvD,+CAAsC;AAQ/B,IAAM,WAAW,GAAjB,MAAM,WAAY,SAAQ,2BAAU;IAEnC,KAAK,CAAc;IAGnB,YAAY,CAAgB;IAG5B,WAAW,CAAO;IAGlB,WAAW,CAAO;CACzB,CAAA;AAZY,kCAAW;AAEhB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,mBAAK,EAAE,CAAC;;0CACjB;AAGnB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,mBAAY,EAAE,CAAC;;iDACxB;AAG5B;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,oBAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;;gDACnC;AAGlB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,oBAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;;gDACnC;sBAXb,WAAW;IANvB,IAAA,wBAAY,EAAC;QACb,aAAa,EAAE,EAAE,UAAU,EAAE,cAAc,EAAE;QAC7C,OAAO,EAAE;YACR,UAAU,EAAE,oBAAQ,CAAC,KAAK;SAC1B;KACD,CAAC;GACW,WAAW,CAYvB","sourcesContent":["import { modelOptions, prop, Severity, mongoose, Ref } from '@typegoose/typegoose';\r\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\r\nimport { UpdatedField } from '../../../utilities/enum';\r\nimport { Admin } from './admin.model';\r\n\r\n@modelOptions({\r\n\tschemaOptions: { collection: 'activityLogs' },\r\n\toptions: {\r\n\t\tallowMixed: Severity.ALLOW,\r\n\t},\r\n})\r\nexport class ActivityLog extends TimeStamps {\r\n\t@prop({ required: true, ref: () => Admin })\r\n\tpublic admin!: Ref<Admin>;\r\n\r\n\t@prop({ required: true, type: String, enum: UpdatedField })\r\n\tpublic updatedField!: UpdatedField;\r\n\r\n\t@prop({ required: true, type: mongoose.Schema.Types.Mixed })\r\n\tpublic oldDocument!: any;\r\n\r\n\t@prop({ required: true, type: mongoose.Schema.Types.Mixed })\r\n\tpublic newDocument!: any;\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin-access-control.model.js","sourceRoot":"/","sources":["libraries/mongo/models/admin-access-control.model.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,oDAAoE;AACpE,4EAAqE;AACrE,wDAA8B;AAC9B,kDAAoD;AACpD,+CAAsC;AAGtC,KAAK,UAAU,YAAY,CAAC,QAAgB;IAC3C,MAAM,IAAI,GAAG,MAAM,kBAAM,CAAC,OAAO,CAAC,EAA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YACtD,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;QACzB,CAAC;QACD,IAAI,EAAE,CAAC;IACN,CAAC,CAAC;IAEH,IAAA,wBAAY,EAAC,EAAE,aAAa,EAAE,EAAE,UAAU,EAAE,qBAAqB,EAAE,EAAE,CAAC;GAC1D,kBAAkB,CAY9B","sourcesContent":["import { modelOptions, prop, pre, Ref } from '@typegoose/typegoose';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\nimport bcrypt from 'bcryptjs';\nimport { AdminRole } from '../../../utilities/enum';\nimport { Admin } from './admin.model';\nimport { Query } from 'mongoose';\n\nasync function hashPassword(password: string): Promise<string> {\n\tconst salt = await bcrypt.genSalt(10);\n\treturn bcrypt.hash(password, salt);\n}\n\n@pre<AdminAccessControl>('save', async function (next) {\n\tif (this.isModified('password')) {\n\t\tthis.password = await hashPassword(this.password);\n\t}\n\tnext();\n})\n\n@pre<Query<any, AdminAccessControl>>('findOneAndUpdate', async function(next) {\n\tconst update = this.getUpdate() as Record<string, any>;\n\tif (update?.password) {\n\t update.password = await hashPassword(update.password);\n\t this.setUpdate(update);\n\t}\n\tnext();\n })\n\n@modelOptions({ schemaOptions: { collection: 'adminAccessControls' } })\nexport class AdminAccessControl extends TimeStamps {\n\t@prop({ required: true, type: String, unique: true })\n\tpublic email!: string;\n\n\t@prop({ required: true, type: String })\n\tpublic password!: string;\n\n\t@prop({ required: true, ref: () => Admin })\n\tpublic admin!: Ref<Admin>;\n\n\t@prop({ required: true, type: String, enum: AdminRole })\n\tpublic role!: AdminRole;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"admin-access-control.model.js","sourceRoot":"/","sources":["libraries/mongo/models/admin-access-control.model.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,oDAAoE;AACpE,4EAAqE;AACrE,wDAA8B;AAC9B,kDAAoD;AACpD,+CAAsC;AAGtC,KAAK,UAAU,YAAY,CAAC,QAAgB;IAC3C,MAAM,IAAI,GAAG,M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C,MAAM,CAAC,QAAQ,CAAC,CAAC;YACtD,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;QACzB,CAAC;QACD,IAAI,EAAE,CAAC;IACN,CAAC,CAAC;IAEH,IAAA,wBAAY,EAAC,EAAE,aAAa,EAAE,EAAE,UAAU,EAAE,qBAAqB,EAAE,EAAE,CAAC;GAC1D,kBAAkB,CAY9B","sourcesContent":["import { modelOptions, prop, pre, Ref } from '@typegoose/typegoose';\r\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\r\nimport bcrypt from 'bcryptjs';\r\nimport { AdminRole } from '../../../utilities/enum';\r\nimport { Admin } from './admin.model';\r\nimport { Query } from 'mongoose';\r\n\r\nasync function hashPassword(password: string): Promise<string> {\r\n\tconst salt = await bcrypt.genSalt(10);\r\n\treturn bcrypt.hash(password, salt);\r\n}\r\n\r\n@pre<AdminAccessControl>('save', async function (next) {\r\n\tif (this.isModified('password')) {\r\n\t\tthis.password = await hashPassword(this.password);\r\n\t}\r\n\tnext();\r\n})\r\n\r\n@pre<Query<any, AdminAccessControl>>('findOneAndUpdate', async function(next) {\r\n\tconst update = this.getUpdate() as Record<string, any>;\r\n\tif (update?.password) {\r\n\t update.password = await hashPassword(update.password);\r\n\t this.setUpdate(update);\r\n\t}\r\n\tnext();\r\n })\r\n\r\n@modelOptions({ schemaOptions: { collection: 'adminAccessControls' } })\r\nexport class AdminAccessControl extends TimeStamps {\r\n\t@prop({ required: true, type: String, unique: true })\r\n\tpublic email!: string;\r\n\r\n\t@prop({ required: true, type: String })\r\n\tpublic password!: string;\r\n\r\n\t@prop({ required: true, ref: () => Admin })\r\n\tpublic admin!: Ref<Admin>;\r\n\r\n\t@prop({ required: true, type: String, enum: AdminRole })\r\n\tpublic role!: AdminRole;\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin.model.js","sourceRoot":"/","sources":["libraries/mongo/models/admin.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA+D;AAC/D,4EAAqE;AACrE,kDAAiD;AACjD,6EAAkE;AAU3D,IAAM,KAAK,GAAX,MAAM,KAAM,SAAQ,2BAAU;IAE7B,IAAI,CAAU;IAGd,YAAY,CAAU;IAGtB,WAAW,CAAU;IAGrB,MAAM,CAAU;IAQhB,aAAa,CAA0B;CAC9C,CAAA;AApBY,sBAAK;AAEV;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;mCAClB;AAGd;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;2CACM;AAGtB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;0CACX;AAGrB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,aAAM,EAAE,OAAO,EAAE,aAAM,CAAC,MAAM,EAAE,CAAC;;qCACtC;AAQhB;IANN,IAAA,gBAAI,EAAC;QACL,GAAG,EAAE,GAAG,EAAE,CAAC,+CAAkB;QAC7B,YAAY,EAAE,OAAO;QACrB,UAAU,EAAE,KAAK;QACjB,OAAO,EAAE,IAAI;KACb,CAAC;;4CAC4C;gBAnBlC,KAAK;IARjB,IAAA,wBAAY,EAAC;QACb,aAAa,EAAE;YACd,UAAU,EAAE,QAAQ;YACpB,MAAM,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;YAC1B,QAAQ,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;YAC5B,EAAE,EAAE,KAAK;SACT;KACD,CAAC;GACW,KAAK,CAoBjB","sourcesContent":["import { modelOptions, prop, Ref } from '@typegoose/typegoose';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\nimport { Status } from '../../../utilities/enum';\nimport { AdminAccessControl } from './admin-access-control.model';\n\n@modelOptions({\n\tschemaOptions: {\n\t\tcollection: 'admins',\n\t\ttoJSON: { virtuals: true },\n\t\ttoObject: { virtuals: true },\n\t\tid: false,\n\t},\n})\nexport class Admin extends TimeStamps {\n\t@prop({ required: true, type: String })\n\tpublic name!: string;\n\n\t@prop({ type: String })\n\tpublic profilePhoto?: string;\n\n\t@prop({ required: true, type: String })\n\tpublic phoneNumber!: string;\n\n\t@prop({ type: String, enum: Status, default: Status.ACTIVE })\n\tpublic status?: string;\n\n\t@prop({\n\t\tref: () => AdminAccessControl,\n\t\tforeignField: 'admin',\n\t\tlocalField: '_id',\n\t\tjustOne: true,\n\t})\n\tpublic accessControl: Ref<AdminAccessControl>;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"admin.model.js","sourceRoot":"/","sources":["libraries/mongo/models/admin.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA+D;AAC/D,4EAAqE;AACrE,kDAAiD;AACjD,6EAAkE;AAU3D,IAAM,KAAK,GAAX,MAAM,KAAM,SAAQ,2BAAU;IAE7B,IAAI,CAAU;IAGd,YAAY,CAAU;IAGtB,WAAW,CAAU;IAGrB,MAAM,CAAU;IAQhB,aAAa,CAA0B;CAC9C,CAAA;AApBY,sBAAK;AAEV;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;mCAClB;AAGd;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;2CACM;AAGtB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;0CACX;AAGrB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,aAAM,EAAE,OAAO,EAAE,aAAM,CAAC,MAAM,EAAE,CAAC;;qCACtC;AAQhB;IANN,IAAA,gBAAI,EAAC;QACL,GAAG,EAAE,GAAG,EAAE,CAAC,+CAAkB;QAC7B,YAAY,EAAE,OAAO;QACrB,UAAU,EAAE,KAAK;QACjB,OAAO,EAAE,IAAI;KACb,CAAC;;4CAC4C;gBAnBlC,KAAK;IARjB,IAAA,wBAAY,EAAC;QACb,aAAa,EAAE;YACd,UAAU,EAAE,QAAQ;YACpB,MAAM,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;YAC1B,QAAQ,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;YAC5B,EAAE,EAAE,KAAK;SACT;KACD,CAAC;GACW,KAAK,CAoBjB","sourcesContent":["import { modelOptions, prop, Ref } from '@typegoose/typegoose';\r\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\r\nimport { Status } from '../../../utilities/enum';\r\nimport { AdminAccessControl } from './admin-access-control.model';\r\n\r\n@modelOptions({\r\n\tschemaOptions: {\r\n\t\tcollection: 'admins',\r\n\t\ttoJSON: { virtuals: true },\r\n\t\ttoObject: { virtuals: true },\r\n\t\tid: false,\r\n\t},\r\n})\r\nexport class Admin extends TimeStamps {\r\n\t@prop({ required: true, type: String })\r\n\tpublic name!: string;\r\n\r\n\t@prop({ type: String })\r\n\tpublic profilePhoto?: string;\r\n\r\n\t@prop({ required: true, type: String })\r\n\tpublic phoneNumber!: string;\r\n\r\n\t@prop({ type: String, enum: Status, default: Status.ACTIVE })\r\n\tpublic status?: string;\r\n\r\n\t@prop({\r\n\t\tref: () => AdminAccessControl,\r\n\t\tforeignField: 'admin',\r\n\t\tlocalField: '_id',\r\n\t\tjustOne: true,\r\n\t})\r\n\tpublic accessControl: Ref<AdminAccessControl>;\r\n}\r\n"]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';
|
|
2
|
+
import { Admin } from './admin.model';
|
|
3
|
+
import { Ref } from '@typegoose/typegoose';
|
|
4
|
+
export declare class AgentPerformance extends TimeStamps {
|
|
5
|
+
admin: Ref<Admin>;
|
|
6
|
+
totalTicketsOngoing: number;
|
|
7
|
+
totalTicketsResolved: number;
|
|
8
|
+
totalTicketsAccepted: number;
|
|
9
|
+
totalTicketsResolvedTime: number;
|
|
10
|
+
totalTicketsAcceptedTime: number;
|
|
11
|
+
totalScore: number;
|
|
12
|
+
lastCalculatedAt?: Date;
|
|
13
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
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;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.AgentPerformance = void 0;
|
|
13
|
+
const defaultClasses_1 = require("@typegoose/typegoose/lib/defaultClasses");
|
|
14
|
+
const admin_model_1 = require("./admin.model");
|
|
15
|
+
const typegoose_1 = require("@typegoose/typegoose");
|
|
16
|
+
let AgentPerformance = class AgentPerformance extends defaultClasses_1.TimeStamps {
|
|
17
|
+
admin;
|
|
18
|
+
totalTicketsOngoing = 0;
|
|
19
|
+
totalTicketsResolved = 0;
|
|
20
|
+
totalTicketsAccepted = 0;
|
|
21
|
+
totalTicketsResolvedTime = 0;
|
|
22
|
+
totalTicketsAcceptedTime = 0;
|
|
23
|
+
totalScore = 0;
|
|
24
|
+
lastCalculatedAt;
|
|
25
|
+
};
|
|
26
|
+
exports.AgentPerformance = AgentPerformance;
|
|
27
|
+
__decorate([
|
|
28
|
+
(0, typegoose_1.prop)({ ref: () => admin_model_1.Admin, required: true, unique: true }),
|
|
29
|
+
__metadata("design:type", Object)
|
|
30
|
+
], AgentPerformance.prototype, "admin", void 0);
|
|
31
|
+
__decorate([
|
|
32
|
+
(0, typegoose_1.prop)({ type: Number, default: 0, min: 0 }),
|
|
33
|
+
__metadata("design:type", Number)
|
|
34
|
+
], AgentPerformance.prototype, "totalTicketsOngoing", void 0);
|
|
35
|
+
__decorate([
|
|
36
|
+
(0, typegoose_1.prop)({ type: Number, default: 0, min: 0 }),
|
|
37
|
+
__metadata("design:type", Number)
|
|
38
|
+
], AgentPerformance.prototype, "totalTicketsResolved", void 0);
|
|
39
|
+
__decorate([
|
|
40
|
+
(0, typegoose_1.prop)({ type: Number, default: 0, min: 0 }),
|
|
41
|
+
__metadata("design:type", Number)
|
|
42
|
+
], AgentPerformance.prototype, "totalTicketsAccepted", void 0);
|
|
43
|
+
__decorate([
|
|
44
|
+
(0, typegoose_1.prop)({ type: Number, default: 0, min: 0 }),
|
|
45
|
+
__metadata("design:type", Number)
|
|
46
|
+
], AgentPerformance.prototype, "totalTicketsResolvedTime", void 0);
|
|
47
|
+
__decorate([
|
|
48
|
+
(0, typegoose_1.prop)({ type: Number, default: 0, min: 0 }),
|
|
49
|
+
__metadata("design:type", Number)
|
|
50
|
+
], AgentPerformance.prototype, "totalTicketsAcceptedTime", void 0);
|
|
51
|
+
__decorate([
|
|
52
|
+
(0, typegoose_1.prop)({ type: Number, default: 0, min: 0, max: 100 }),
|
|
53
|
+
__metadata("design:type", Number)
|
|
54
|
+
], AgentPerformance.prototype, "totalScore", void 0);
|
|
55
|
+
__decorate([
|
|
56
|
+
(0, typegoose_1.prop)({ type: Date }),
|
|
57
|
+
__metadata("design:type", Date)
|
|
58
|
+
], AgentPerformance.prototype, "lastCalculatedAt", void 0);
|
|
59
|
+
exports.AgentPerformance = AgentPerformance = __decorate([
|
|
60
|
+
(0, typegoose_1.modelOptions)({
|
|
61
|
+
schemaOptions: {
|
|
62
|
+
collection: 'agent-performance',
|
|
63
|
+
},
|
|
64
|
+
}),
|
|
65
|
+
(0, typegoose_1.index)({ admin: 1 }, { unique: true }),
|
|
66
|
+
(0, typegoose_1.index)({ totalScore: -1 })
|
|
67
|
+
], AgentPerformance);
|
|
68
|
+
//# sourceMappingURL=agent-performance.model.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-performance.model.js","sourceRoot":"/","sources":["libraries/mongo/models/agent-performance.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,4EAAqE;AACrE,+CAAsC;AACtC,oDAAsE;AAS/D,IAAM,gBAAgB,GAAtB,MAAM,gBAAiB,SAAQ,2BAAU;IAExC,KAAK,CAAc;IAGnB,mBAAmB,GAAW,CAAC,CAAC;IAGhC,oBAAoB,GAAW,CAAC,CAAC;IAGjC,oBAAoB,GAAW,CAAC,CAAC;IAGjC,wBAAwB,GAAW,CAAC,CAAC;IAGrC,wBAAwB,GAAW,CAAC,CAAC;IAGrC,UAAU,GAAW,CAAC,CAAC;IAGvB,gBAAgB,CAAQ;CAC/B,CAAA;AAxBY,4CAAgB;AAErB;IADN,IAAA,gBAAI,EAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,mBAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;;+CAC/B;AAGnB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC;;6DACJ;AAGhC;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC;;8DACH;AAGjC;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC;;8DACH;AAGjC;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC;;kEACC;AAGrC;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC;;kEACC;AAGrC;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;;oDACvB;AAGvB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;8BACK,IAAI;0DAAC;2BAvBnB,gBAAgB;IAP5B,IAAA,wBAAY,EAAC;QACb,aAAa,EAAE;YACd,UAAU,EAAE,mBAAmB;SAC/B;KACD,CAAC;IACD,IAAA,iBAAK,EAAC,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IACrC,IAAA,iBAAK,EAAC,EAAE,UAAU,EAAE,CAAC,CAAC,EAAE,CAAC;GACb,gBAAgB,CAwB5B","sourcesContent":["import { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\r\nimport { Admin } from './admin.model';\r\nimport { prop, Ref, modelOptions, index } from '@typegoose/typegoose';\r\n\r\n@modelOptions({\r\n\tschemaOptions: {\r\n\t\tcollection: 'agent-performance',\r\n\t},\r\n})\r\n@index({ admin: 1 }, { unique: true })\r\n@index({ totalScore: -1 })\r\nexport class AgentPerformance extends TimeStamps {\r\n\t@prop({ ref: () => Admin, required: true, unique: true })\r\n\tpublic admin!: Ref<Admin>;\r\n\r\n\t@prop({ type: Number, default: 0, min: 0 })\r\n\tpublic totalTicketsOngoing: number = 0;\r\n\r\n\t@prop({ type: Number, default: 0, min: 0 })\r\n\tpublic totalTicketsResolved: number = 0;\r\n\r\n\t@prop({ type: Number, default: 0, min: 0 })\r\n\tpublic totalTicketsAccepted: number = 0;\r\n\r\n\t@prop({ type: Number, default: 0, min: 0 })\r\n\tpublic totalTicketsResolvedTime: number = 0;\r\n\r\n\t@prop({ type: Number, default: 0, min: 0 })\r\n\tpublic totalTicketsAcceptedTime: number = 0;\r\n\r\n\t@prop({ type: Number, default: 0, min: 0, max: 100 })\r\n\tpublic totalScore: number = 0;\r\n\r\n\t@prop({ type: Date })\r\n\tpublic lastCalculatedAt?: Date;\r\n}\r\n"]}
|
|
@@ -13,7 +13,6 @@ exports.AppScreenSetting = void 0;
|
|
|
13
13
|
const typegoose_1 = require("@typegoose/typegoose");
|
|
14
14
|
const defaultClasses_1 = require("@typegoose/typegoose/lib/defaultClasses");
|
|
15
15
|
const enum_1 = require("../../../utilities/enum");
|
|
16
|
-
const _1 = require(".");
|
|
17
16
|
let AppScreenSetting = class AppScreenSetting extends defaultClasses_1.TimeStamps {
|
|
18
17
|
itemType;
|
|
19
18
|
section;
|
|
@@ -39,34 +38,10 @@ __decorate([
|
|
|
39
38
|
__metadata("design:type", String)
|
|
40
39
|
], AppScreenSetting.prototype, "status", void 0);
|
|
41
40
|
__decorate([
|
|
42
|
-
(0, typegoose_1.prop)({ type: Number }),
|
|
41
|
+
(0, typegoose_1.prop)({ type: Number, default: 0 }),
|
|
43
42
|
__metadata("design:type", Number)
|
|
44
43
|
], AppScreenSetting.prototype, "sortingOrder", void 0);
|
|
45
44
|
exports.AppScreenSetting = AppScreenSetting = __decorate([
|
|
46
|
-
(0, typegoose_1.modelOptions)({ schemaOptions: { collection: 'appScreenSettings' } })
|
|
47
|
-
(0, typegoose_1.pre)('save', async function (next) {
|
|
48
|
-
if (this.isNew || typeof this.sortingOrder === 'undefined') {
|
|
49
|
-
try {
|
|
50
|
-
const maxSortingOrder = await _1.AppScreenSettingModel.aggregate([
|
|
51
|
-
{
|
|
52
|
-
$match: {
|
|
53
|
-
deletedAt: null,
|
|
54
|
-
},
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
$group: {
|
|
58
|
-
_id: null,
|
|
59
|
-
maxSortingOrder: { $max: '$sortingOrder' },
|
|
60
|
-
},
|
|
61
|
-
},
|
|
62
|
-
]).exec();
|
|
63
|
-
this.sortingOrder = (maxSortingOrder[0]?.maxSortingOrder ?? -1) + 1;
|
|
64
|
-
}
|
|
65
|
-
catch (error) {
|
|
66
|
-
return next(error);
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
next();
|
|
70
|
-
})
|
|
45
|
+
(0, typegoose_1.modelOptions)({ schemaOptions: { collection: 'appScreenSettings' } })
|
|
71
46
|
], AppScreenSetting);
|
|
72
47
|
//# sourceMappingURL=app-screen-setting.model.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-screen-setting.model.js","sourceRoot":"/","sources":["libraries/mongo/models/app-screen-setting.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"app-screen-setting.model.js","sourceRoot":"/","sources":["libraries/mongo/models/app-screen-setting.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA0D;AAC1D,4EAAqE;AACrE,kDAAwE;AAGjE,IAAM,gBAAgB,GAAtB,MAAM,gBAAiB,SAAQ,2BAAU;IAExC,QAAQ,CAAY;IAGpB,OAAO,CAAe;IAGtB,KAAK,CAAU;IAGf,MAAM,CAAU;IAGhB,YAAY,CAAU;CAC7B,CAAA;AAfY,4CAAgB;AAErB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,eAAQ,EAAE,CAAC;;kDAC5B;AAGpB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,kBAAW,EAAE,CAAC;;iDAC7B;AAGtB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;+CACjB;AAGf;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,aAAM,EAAE,OAAO,EAAE,aAAM,CAAC,MAAM,EAAE,CAAC;;gDACtC;AAGhB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;sDACN;2BAdjB,gBAAgB;IAD5B,IAAA,wBAAY,EAAC,EAAE,aAAa,EAAE,EAAE,UAAU,EAAE,mBAAmB,EAAE,EAAE,CAAC;GACxD,gBAAgB,CAe5B","sourcesContent":["import { modelOptions, prop } from '@typegoose/typegoose';\r\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\r\nimport { ItemType, SectionType, Status } from '../../../utilities/enum';\r\n\r\n@modelOptions({ schemaOptions: { collection: 'appScreenSettings' } })\r\nexport class AppScreenSetting extends TimeStamps {\r\n\t@prop({ required: true, type: String, enum: ItemType })\r\n\tpublic itemType!: ItemType;\r\n\r\n\t@prop({ required: true, type: String, enum: SectionType })\r\n\tpublic section!: SectionType;\r\n\r\n\t@prop({ required: true, type: String })\r\n\tpublic alias!: string;\r\n\r\n\t@prop({ type: String, enum: Status, default: Status.ACTIVE })\r\n\tpublic status?: Status;\r\n\r\n\t@prop({ type: Number, default: 0 })\r\n\tpublic sortingOrder?: number;\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"attribute.model.js","sourceRoot":"/","sources":["libraries/mongo/models/attribute.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAsE;AACtE,4EAAqE;AACrE,0EAAgE;AAChE,kDAAqE;AACrE,6CAAoC;AAI7B,IAAM,SAAS,GAAf,MAAM,SAAU,SAAQ,2BAAU;IAEjC,IAAI,CAAa;IAGjB,IAAI,CAAU;IAGd,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AAE,CAAC;GAC/E,SAAS,CA0BrB","sourcesContent":["import { Index, modelOptions, prop, Ref } from '@typegoose/typegoose';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\nimport { AttributeItem } from './embedded/attribute-item.model';\nimport { AttributeItemSelectionType } from '../../../utilities/enum';\nimport { Shop } from './shop.model';\n\n@modelOptions({ schemaOptions: { collection: 'attributes' } })\n@Index({ shop: 1, name: 1 }, { unique: true, partialFilterExpression: { deletedAt: null } })\nexport class Attribute extends TimeStamps {\n\t@prop({ required: true, ref: () => Shop })\n\tpublic shop!: Ref<Shop>;\n\n\t@prop({ required: true, type: String })\n\tpublic name!: string;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isRequired?: boolean;\n\n\t@prop({\n\t\trequired: true,\n\t\ttype: String,\n\t\tenum: AttributeItemSelectionType,\n\t\tdefault: AttributeItemSelectionType.SINGLE,\n\t})\n\tpublic selectionType!: AttributeItemSelectionType;\n\n\t@prop({ type: Number, min: 0, default: 0 })\n\tpublic minimumRequiredItems?: number;\n\n\t@prop({ type: Number, min: 0, default: 0 })\n\tpublic maximumRequiredItems?: number;\n\n\t@prop({ required: true, type: [AttributeItem] })\n\tpublic items!: AttributeItem[];\n}\n"]}
|
|
1
|
+
{"version":3,"file":"attribute.model.js","sourceRoot":"/","sources":["libraries/mongo/models/attribute.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAsE;AACtE,4EAAqE;AACrE,0EAAgE;AAChE,kDAAqE;AACrE,6CAAoC;AAI7B,IAAM,SAAS,GAAf,MAAM,SAAU,SAAQ,2BAAU;IAEjC,IAAI,CAAa;IAGjB,IAAI,CAAU;IAGd,UAAU,CAAW;IAQrB,aAAa,CAA8B;IAG3C,oBAAoB,CAAU;IAG9B,oBAAoB,CAAU;IAG9B,KAAK,CAAmB;CAC/B,CAAA;AA1BY,8BAAS;AAEd;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,iBAAI,EAAE,CAAC;;uCAClB;AAGjB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;uCAClB;AAGd;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;;6CACZ;AAQrB;IANN,IAAA,gBAAI,EAAC;QACL,QAAQ,EAAE,IAAI;QACd,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,iCAA0B;QAChC,OAAO,EAAE,iCAA0B,CAAC,MAAM;KAC1C,CAAC;;gDACgD;AAG3C;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;uDACN;AAG9B;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;uDACN;AAG9B;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,oCAAa,CAAC,EAAE,CAAC;;wCACjB;oBAzBnB,SAAS;IAFrB,IAAA,wBAAY,EAAC,EAAE,aAAa,EAAE,EAAE,UAAU,EAAE,YAAY,EAAE,EAAE,CAAC;IAC7D,IAAA,iBAAK,EAAC,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,uBAAuB,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE,CAAC;GAC/E,SAAS,CA0BrB","sourcesContent":["import { Index, modelOptions, prop, Ref } from '@typegoose/typegoose';\r\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\r\nimport { AttributeItem } from './embedded/attribute-item.model';\r\nimport { AttributeItemSelectionType } from '../../../utilities/enum';\r\nimport { Shop } from './shop.model';\r\n\r\n@modelOptions({ schemaOptions: { collection: 'attributes' } })\r\n@Index({ shop: 1, name: 1 }, { unique: true, partialFilterExpression: { deletedAt: null } })\r\nexport class Attribute extends TimeStamps {\r\n\t@prop({ required: true, ref: () => Shop })\r\n\tpublic shop!: Ref<Shop>;\r\n\r\n\t@prop({ required: true, type: String })\r\n\tpublic name!: string;\r\n\r\n\t@prop({ type: Boolean, default: false })\r\n\tpublic isRequired?: boolean;\r\n\r\n\t@prop({\r\n\t\trequired: true,\r\n\t\ttype: String,\r\n\t\tenum: AttributeItemSelectionType,\r\n\t\tdefault: AttributeItemSelectionType.SINGLE,\r\n\t})\r\n\tpublic selectionType!: AttributeItemSelectionType;\r\n\r\n\t@prop({ type: Number, min: 0, default: 0 })\r\n\tpublic minimumRequiredItems?: number;\r\n\r\n\t@prop({ type: Number, min: 0, default: 0 })\r\n\tpublic maximumRequiredItems?: number;\r\n\r\n\t@prop({ required: true, type: [AttributeItem] })\r\n\tpublic items!: AttributeItem[];\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"banner.model.js","sourceRoot":"/","sources":["libraries/mongo/models/banner.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAoE;AACpE,4EAAqE;AACrE,kDAA4G;AAC5G,6CAAoC;AACpC,mDAA0C;AAC1C,iEAAuD;AACvD,wBAAgC;AA8BzB,IAAM,MAAM,GAAZ,MAAM,MAAO,SAAQ,2BAAU;IAE9B,KAAK,CAAU;IAGf,KAAK,CAAU;IAGf,QAAQ,CAAY;IAGpB,MAAM,CAAU;IAGhB,UAAU,CAAkB;IAG5B,WAAW,CAAW;IAGtB,SAAS,CAAmB;IAG5B,QAAQ,CAAkB;IAG1B,IAAI,CAAU;IAGd,IAAI,CAAa;IAGjB,OAAO,CAAgB;IAGvB,aAAa,CAAsB;IAGnC,YAAY,CAAU;CAC7B,CAAA;AAvCY,wBAAM;AAEX;IADN,IAAA,gB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,oCAAa,EAAE,CAAC;;6CACO;AAGnC;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;4CACN;iBAtCjB,MAAM;IA5BlB,IAAA,wBAAY,EAAC,EAAE,aAAa,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,EAAE,CAAC;IAC1D,IAAA,eAAG,EAAS,MAAM,EAAE,KAAK,WAAW,IAAI;QAExC,IAAI,IAAI,CAAC,KAAK,IAAI,OAAO,IAAI,CAAC,YAAY,KAAK,WAAW,EAAE,CAAC;YAC5D,IAAI,CAAC;gBAEJ,MAAM,eAAe,GAAG,MAAM,cAAW,CAAC,SAAS,CAA8B;oBAChF;wBACC,MAAM,EAAE;4BACP,SAAS,EAAE,IAAI;yBACf;qBACD;oBACD;wBACC,MAAM,EAAE;4BACP,GAAG,EAAE,IAAI;4BACT,eAAe,EAAE,EAAE,IAAI,EAAE,eAAe,EAAE;yBAC1C;qBACD;iBACD,CAAC,CAAC,IAAI,EAAE,CAAC;gBAGV,IAAI,CAAC,YAAY,GAAG,CAAC,eAAe,CAAC,CAAC,CAAC,EAAE,eAAe,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;YACrE,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBAChB,OAAO,IAAI,CAAC,KAAc,CAAC,CAAC;YAC7B,CAAC;QACF,CAAC;QACD,IAAI,EAAE,CAAC;IACR,CAAC,CAAC;GACW,MAAM,CAuClB","sourcesContent":["import { modelOptions, pre, prop, Ref } from '@typegoose/typegoose';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\nimport { BannerClickType, BannerLinkType, BannerUserType, ItemType, Status } from '../../../utilities/enum';\nimport { Shop } from './shop.model';\nimport { Product } from './product.model';\nimport { ListContainer } from './list-container.model';\nimport { BannerModel } from '.';\n\n@modelOptions({ schemaOptions: { collection: 'banners' } })\n@pre<Banner>('save', async function (next) {\n\t// Only set sortingOrder if it's a new document or sortingOrder is not set\n\tif (this.isNew || typeof this.sortingOrder === 'undefined') {\n\t\ttry {\n\t\t\t// Find the maximum sortingOrder that aren't deleted\n\t\t\tconst maxSortingOrder = await BannerModel.aggregate<{ maxSortingOrder: number }>([\n\t\t\t\t{\n\t\t\t\t\t$match: {\n\t\t\t\t\t\tdeletedAt: null,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t$group: {\n\t\t\t\t\t\t_id: null,\n\t\t\t\t\t\tmaxSortingOrder: { $max: '$sortingOrder' },\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t]).exec();\n\n\t\t\t// Set the new sortingOrder to max + 1 (or 0 if no items found)\n\t\t\tthis.sortingOrder = (maxSortingOrder[0]?.maxSortingOrder ?? -1) + 1;\n\t\t} catch (error) {\n\t\t\treturn next(error as Error);\n\t\t}\n\t}\n\tnext();\n})\nexport class Banner extends TimeStamps {\n\t@prop({ required: true, type: String })\n\tpublic title!: string;\n\n\t@prop({ required: true, type: String })\n\tpublic image!: string;\n\n\t@prop({ required: true, type: String, enum: ItemType })\n\tpublic itemType!: ItemType;\n\n\t@prop({ type: String, enum: Status, default: Status.ACTIVE })\n\tpublic status?: Status;\n\n\t@prop({ type: String, enum: BannerUserType, default: BannerUserType.ALL })\n\tpublic visibility?: BannerUserType;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isClickable?: boolean;\n\n\t@prop({ type: String, enum: BannerClickType })\n\tpublic clickType?: BannerClickType;\n\n\t@prop({ type: String, enum: BannerLinkType })\n\tpublic linkType?: BannerLinkType;\n\n\t@prop({ type: String, trim: true })\n\tpublic link?: string;\n\n\t@prop({ ref: () => Shop })\n\tpublic shop?: Ref<Shop>;\n\n\t@prop({ ref: () => Product })\n\tpublic product?: Ref<Product>;\n\n\t@prop({ ref: () => ListContainer })\n\tpublic listContainer?: Ref<ListContainer>;\n\n\t@prop({ type: Number, default: 0 })\n\tpublic sortingOrder?: number;\n}\n"]}
|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AAY,GAAG,CAAC,eAAe,CAAC,CAAC,CAAC,EAAE,eAAe,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;YACrE,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBAChB,OAAO,IAAI,CAAC,KAAc,CAAC,CAAC;YAC7B,CAAC;QACF,CAAC;QACD,IAAI,EAAE,CAAC;IACR,CAAC,CAAC;GACW,MAAM,CAuClB","sourcesContent":["import { modelOptions, pre, prop, Ref } from '@typegoose/typegoose';\r\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\r\nimport { BannerClickType, BannerLinkType, BannerUserType, ItemType, Status } from '../../../utilities/enum';\r\nimport { Shop } from './shop.model';\r\nimport { Product } from './product.model';\r\nimport { ListContainer } from './list-container.model';\r\nimport { BannerModel } from '.';\r\n\r\n@modelOptions({ schemaOptions: { collection: 'banners' } })\r\n@pre<Banner>('save', async function (next) {\r\n\t// Only set sortingOrder if it's a new document or sortingOrder is not set\r\n\tif (this.isNew || typeof this.sortingOrder === 'undefined') {\r\n\t\ttry {\r\n\t\t\t// Find the maximum sortingOrder that aren't deleted\r\n\t\t\tconst maxSortingOrder = await BannerModel.aggregate<{ maxSortingOrder: number }>([\r\n\t\t\t\t{\r\n\t\t\t\t\t$match: {\r\n\t\t\t\t\t\tdeletedAt: null,\r\n\t\t\t\t\t},\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t$group: {\r\n\t\t\t\t\t\t_id: null,\r\n\t\t\t\t\t\tmaxSortingOrder: { $max: '$sortingOrder' },\r\n\t\t\t\t\t},\r\n\t\t\t\t},\r\n\t\t\t]).exec();\r\n\r\n\t\t\t// Set the new sortingOrder to max + 1 (or 0 if no items found)\r\n\t\t\tthis.sortingOrder = (maxSortingOrder[0]?.maxSortingOrder ?? -1) + 1;\r\n\t\t} catch (error) {\r\n\t\t\treturn next(error as Error);\r\n\t\t}\r\n\t}\r\n\tnext();\r\n})\r\nexport class Banner extends TimeStamps {\r\n\t@prop({ required: true, type: String })\r\n\tpublic title!: string;\r\n\r\n\t@prop({ required: true, type: String })\r\n\tpublic image!: string;\r\n\r\n\t@prop({ required: true, type: String, enum: ItemType })\r\n\tpublic itemType!: ItemType;\r\n\r\n\t@prop({ type: String, enum: Status, default: Status.ACTIVE })\r\n\tpublic status?: Status;\r\n\r\n\t@prop({ type: String, enum: BannerUserType, default: BannerUserType.ALL })\r\n\tpublic visibility?: BannerUserType;\r\n\r\n\t@prop({ type: Boolean, default: false })\r\n\tpublic isClickable?: boolean;\r\n\r\n\t@prop({ type: String, enum: BannerClickType })\r\n\tpublic clickType?: BannerClickType;\r\n\r\n\t@prop({ type: String, enum: BannerLinkType })\r\n\tpublic linkType?: BannerLinkType;\r\n\r\n\t@prop({ type: String, trim: true })\r\n\tpublic link?: string;\r\n\r\n\t@prop({ ref: () => Shop })\r\n\tpublic shop?: Ref<Shop>;\r\n\r\n\t@prop({ ref: () => Product })\r\n\tpublic product?: Ref<Product>;\r\n\r\n\t@prop({ ref: () => ListContainer })\r\n\tpublic listContainer?: Ref<ListContainer>;\r\n\r\n\t@prop({ type: Number, default: 0 })\r\n\tpublic sortingOrder?: number;\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-coupon.model.js","sourceRoot":"/","sources":["libraries/mongo/models/base/base-coupon.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA4C;AAC5C,qDAAuF;AACvF,6DAAoD;AACpD,kDAAyC;AAEzC,MAAa,UAAW,SAAQ,qBAAM;IAE9B,SAAS,CAAa;IAGtB,KAAK,CAAU;IAGf,gBAAgB,CAAiB;IAGjC,QAAQ,CAAY;IAGpB,UAAU,CAAiB;IAG3B,eAAe,CAAiB;IAGhC,aAAa,CAAiB;IAG9B,cAAc,CAAW;IAGzB,MAAM,CAAU;IAGhB,gBAAgB,CAA0B;CACjD;AA9BD,gCA8BC;AA5BO;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,gBAAS,EAAE,CAAC;;6CAC3B;AAGtB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;yCACjB;AAGf;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;oDACE;AAGjC;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,yBAAQ,EAAE,CAAC;8BACvB,yBAAQ;4CAAC;AAGpB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;8CACJ;AAG3B;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;mDACC;AAGhC;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;iDACD;AAG9B;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;;kDACR;AAGzB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,aAAM,EAAE,OAAO,EAAE,aAAM,CAAC,MAAM,EAAE,CAAC;;0CACtC;AAGhB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,6BAAsB,EAAE,CAAC;;oDACJ","sourcesContent":["import { prop } from '@typegoose/typegoose';\nimport { CouponExpirationReason, Status, ValueType } from '../../../../utilities/enum';\nimport { Duration } from '../shared/duration.model';\nimport { Coupon } from '../coupon.model';\n\nexport class BaseCoupon extends Coupon {\n\t@prop({ required: true, type: String, enum: ValueType })\n\tpublic valueType!: ValueType;\n\n\t@prop({ required: true, type: Number })\n\tpublic value!: number;\n\n\t@prop({ type: Number, default: null }) // applicable when valueType percentage\n\tpublic maxDiscountLimit?: number | null;\n\n\t@prop({ required: true, type: Duration })\n\tpublic duration!: Duration;\n\n\t@prop({ type: Number, default: null })\n\tpublic spendLimit?: number | null;\n\n\t@prop({ type: Number, default: null })\n\tpublic totalOrderLimit?: number | null;\n\n\t@prop({ type: Number, default: null })\n\tpublic minOrderValue?: number | null;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic forNewUserOnly?: boolean;\n\n\t@prop({ type: String, enum: Status, default: Status.ACTIVE })\n\tpublic status?: Status;\n\n\t@prop({ type: String, enum: CouponExpirationReason })\n\tpublic expirationReason?: CouponExpirationReason;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"base-coupon.model.js","sourceRoot":"/","sources":["libraries/mongo/models/base/base-coupon.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA4C;AAC5C,qDAAuF;AACvF,6DAAoD;AACpD,kDAAyC;AAEzC,MAAa,UAAW,SAAQ,qBAAM;IAE9B,SAAS,CAAa;IAGtB,KAAK,CAAU;IAGf,gBAAgB,CAAiB;IAGjC,QAAQ,CAAY;IAGpB,UAAU,CAAiB;IAG3B,eAAe,CAAiB;IAGhC,aAAa,CAAiB;IAG9B,cAAc,CAAW;IAGzB,MAAM,CAAU;IAGhB,gBAAgB,CAA0B;CACjD;AA9BD,gCA8BC;AA5BO;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,gBAAS,EAAE,CAAC;;6CAC3B;AAGtB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;yCACjB;AAGf;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;oDACE;AAGjC;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,yBAAQ,EAAE,CAAC;8BACvB,yBAAQ;4CAAC;AAGpB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;8CACJ;AAG3B;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;mDACC;AAGhC;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;iDACD;AAG9B;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;;kDACR;AAGzB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,aAAM,EAAE,OAAO,EAAE,aAAM,CAAC,MAAM,EAAE,CAAC;;0CACtC;AAGhB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,6BAAsB,EAAE,CAAC;;oDACJ","sourcesContent":["import { prop } from '@typegoose/typegoose';\r\nimport { CouponExpirationReason, Status, ValueType } from '../../../../utilities/enum';\r\nimport { Duration } from '../shared/duration.model';\r\nimport { Coupon } from '../coupon.model';\r\n\r\nexport class BaseCoupon extends Coupon {\r\n\t@prop({ required: true, type: String, enum: ValueType })\r\n\tpublic valueType!: ValueType;\r\n\r\n\t@prop({ required: true, type: Number })\r\n\tpublic value!: number;\r\n\r\n\t@prop({ type: Number, default: null }) // applicable when valueType percentage\r\n\tpublic maxDiscountLimit?: number | null;\r\n\r\n\t@prop({ required: true, type: Duration })\r\n\tpublic duration!: Duration;\r\n\r\n\t@prop({ type: Number, default: null })\r\n\tpublic spendLimit?: number | null;\r\n\r\n\t@prop({ type: Number, default: null })\r\n\tpublic totalOrderLimit?: number | null;\r\n\r\n\t@prop({ type: Number, default: null })\r\n\tpublic minOrderValue?: number | null;\r\n\r\n\t@prop({ type: Boolean, default: false })\r\n\tpublic forNewUserOnly?: boolean;\r\n\r\n\t@prop({ type: String, enum: Status, default: Status.ACTIVE })\r\n\tpublic status?: Status;\r\n\r\n\t@prop({ type: String, enum: CouponExpirationReason })\r\n\tpublic expirationReason?: CouponExpirationReason;\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-review.model.js","sourceRoot":"/","sources":["libraries/mongo/models/base/base-review.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA2D;AAC3D,4EAAqE;AACrE,wDAA8C;AAC9C,gDAAuC;AAEvC,MAAa,UAAW,SAAQ,2BAAU;IAElC,IAAI,CAAiB;IAGrB,WAAW,CAAU;IAGrB,MAAM,CAAU;IAGhB,KAAK,CAAc;IAGnB,IAAI,CAAY;IAGhB,SAAS,CAAW;IAGpB,SAAS,CAA2B;CAC3C;AArBD,gCAqBC;AAnBO;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,0BAAQ,EAAE,CAAC;;wCAClB;AAGrB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;+CACX;AAGrB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC;;0CAChC;AAGhB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,mBAAK,EAAE,CAAC;;yCACjB;AAGnB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC;;wCACR;AAGhB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;6CACZ;AAGpB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,oBAAQ,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC;8BACrB,oBAAQ,CAAC,KAAK,CAAC,QAAQ;6CAAC","sourcesContent":["import { mongoose, prop, Ref } from '@typegoose/typegoose';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\nimport { CoreUser } from '../core-user.model';\nimport { Order } from '../order.model';\n\nexport class BaseReview extends TimeStamps {\n\t@prop({ required: true, ref: () => CoreUser })\n\tpublic user!: Ref<CoreUser>;\n\n\t@prop({ required: true, type: String })\n\tpublic description!: string;\n\n\t@prop({ required: true, type: Number, min: 1, max: 5 })\n\tpublic rating!: number;\n\n\t@prop({ required: true, ref: () => Order })\n\tpublic order!: Ref<Order>;\n\n\t@prop({ type: () => [String] })\n\tpublic tags?: string[];\n\n\t@prop({ type: Boolean, default: true })\n\tpublic isVisible?: boolean;\n\n\t@prop({ type: mongoose.Types.ObjectId })\n\tpublic deletedBy?: mongoose.Types.ObjectId;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"base-review.model.js","sourceRoot":"/","sources":["libraries/mongo/models/base/base-review.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA2D;AAC3D,4EAAqE;AACrE,wDAA8C;AAC9C,gDAAuC;AAEvC,MAAa,UAAW,SAAQ,2BAAU;IAElC,IAAI,CAAiB;IAGrB,WAAW,CAAU;IAGrB,MAAM,CAAU;IAGhB,KAAK,CAAc;IAGnB,IAAI,CAAY;IAGhB,SAAS,CAAW;IAGpB,SAAS,CAA2B;CAC3C;AArBD,gCAqBC;AAnBO;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,0BAAQ,EAAE,CAAC;;wCAClB;AAGrB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;+CACX;AAGrB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC;;0CAChC;AAGhB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,mBAAK,EAAE,CAAC;;yCACjB;AAGnB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC;;wCACR;AAGhB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;6CACZ;AAGpB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,oBAAQ,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC;8BACrB,oBAAQ,CAAC,KAAK,CAAC,QAAQ;6CAAC","sourcesContent":["import { mongoose, prop, Ref } from '@typegoose/typegoose';\r\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\r\nimport { CoreUser } from '../core-user.model';\r\nimport { Order } from '../order.model';\r\n\r\nexport class BaseReview extends TimeStamps {\r\n\t@prop({ required: true, ref: () => CoreUser })\r\n\tpublic user!: Ref<CoreUser>;\r\n\r\n\t@prop({ required: true, type: String })\r\n\tpublic description!: string;\r\n\r\n\t@prop({ required: true, type: Number, min: 1, max: 5 })\r\n\tpublic rating!: number;\r\n\r\n\t@prop({ required: true, ref: () => Order })\r\n\tpublic order!: Ref<Order>;\r\n\r\n\t@prop({ type: () => [String] })\r\n\tpublic tags?: string[];\r\n\r\n\t@prop({ type: Boolean, default: true })\r\n\tpublic isVisible?: boolean;\r\n\r\n\t@prop({ type: mongoose.Types.ObjectId })\r\n\tpublic deletedBy?: mongoose.Types.ObjectId;\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bob-finance.model.js","sourceRoot":"/","sources":["libraries/mongo/models/bob-finance.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA+D;AAC/D,4EAAqE;AACrE,kDAOiC;AACjC,+CAAsC;AACtC,iDAAwC;AACxC,+CAAsC;AACtC,6CAAoC;AAG7B,IAAM,UAAU,GAAhB,MAAM,UAAW,SAAQ,2BAAU;IAElC,WAAW,CAAU;IAGrB,WAAW,CAAkB;IAG7B,cAAc,CAAqB;IAGnC,MAAM,CAAU;IAGhB,eAAe,CAAU;IAGzB,MAAM,CAAuB;IAG7B,KAAK,CAAc;IAGnB,IAAI,CAAa;IAGjB,KAAK,CAAc;IAGnB,MAAM,CAAe;IAGrB,QAAQ,CAAY;IAGpB,OAAO,CAAW;IAGlB,eAAe,CAAU;IAGzB,SAAS,CAAU;IAGnB,WAAW,CAAU;IAGrB,SAAS,CAAU;IAGnB,kBAAkB,CAAU;IAG5B,YAAY,CAAgB;IAG5B,WAAW,CAAW;CAC7B,CAAA;AAzDY,gCAAU;AAEf;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;+CACX;AAGrB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,qBAAc,EAAE,CAAC;;+CACzB;AAG7B;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,wBAAiB,EAAE,CAAC;;kDACtB;AAGnC;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;0CACZ;AAGhB;IADN,IAAA,gBAAI,EAAC,EAAE,IAA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N,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,mBAAY,EAAE,OAAO,EAAE,mBAAY,CAAC,IAAI,EAAE,CAAC;;gDACpC;AAG5B;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;;+CACX;qBAxDjB,UAAU;IADtB,IAAA,wBAAY,EAAC,EAAE,aAAa,EAAE,EAAE,UAAU,EAAE,aAAa,EAAE,EAAE,CAAC;GAClD,UAAU,CAyDtB","sourcesContent":["import { modelOptions, prop, Ref } from '@typegoose/typegoose';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\nimport {\n\tBobAccountType,\n\tBobModel,\n\tBobSettlementStatus,\n\tBobSettlementType,\n\tBobType,\n\tPaidCurrency,\n} from '../../../utilities/enum';\nimport { Admin } from './admin.model';\nimport { Payout } from './payout.model';\nimport { Rider } from './rider.model';\nimport { Shop } from './shop.model';\n\n@modelOptions({ schemaOptions: { collection: 'bobFinances' } })\nexport class BOBFinance extends TimeStamps {\n\t@prop({ required: true, type: String })\n\tpublic referenceId!: string;\n\n\t@prop({ required: true, type: String, enum: BobAccountType })\n\tpublic accountType!: BobAccountType;\n\n\t@prop({ required: true, type: String, enum: BobSettlementType })\n\tpublic settlementType!: BobSettlementType;\n\n\t@prop({ type: Number, default: 0 })\n\tpublic amount?: number;\n\n\t@prop({ type: Number, default: 0 })\n\tpublic secondaryAmount?: number;\n\n\t@prop({ type: String, enum: BobSettlementStatus, default: BobSettlementStatus.NOT_PAID })\n\tpublic status?: BobSettlementStatus;\n\n\t@prop({ ref: () => Admin })\n\tpublic admin?: Ref<Admin>;\n\n\t@prop({ ref: () => Shop })\n\tpublic shop?: Ref<Shop>;\n\n\t@prop({ ref: () => Rider })\n\tpublic rider?: Ref<Rider>;\n\n\t@prop({ ref: () => Payout })\n\tpublic payout?: Ref<Payout>;\n\n\t@prop({ type: String, enum: BobModel, default: BobModel.C2B })\n\tpublic bobModel?: BobModel;\n\n\t@prop({ type: String, enum: BobType, default: BobType.INWARD })\n\tpublic bobType?: BobType;\n\n\t@prop({ type: String })\n\tpublic referenceNumber?: string;\n\n\t@prop({ type: String })\n\tpublic crmNumber?: string;\n\n\t@prop({ type: String })\n\tpublic bobLocation?: string;\n\n\t@prop({ type: Number })\n\tpublic riderTips?: number;\n\n\t@prop({ type: Number })\n\tpublic secondaryRiderTips?: number;\n\n\t@prop({ type: String, enum: PaidCurrency, default: PaidCurrency.BASE })\n\tpublic paidCurrency?: PaidCurrency;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isRiderSeen?: boolean;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"bob-finance.model.js","sourceRoot":"/","sources":["libraries/mongo/models/bob-finance.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA+D;AAC/D,4EAAqE;AACrE,kDAOiC;AACjC,+CAAsC;AACtC,iDAAwC;AACxC,+CAAsC;AACtC,6CAAoC;AAG7B,IAAM,UAAU,GAAhB,MAAM,UAAW,SAAQ,2BAAU;IAElC,WAAW,CAAU;IAGrB,WAAW,CAAkB;IAG7B,cAAc,CAAqB;IAGnC,MAAM,CAAU;IAGhB,eAAe,CAAU;IAGzB,MAAM,CAAuB;IAG7B,KAAK,CAAc;IAGnB,IAAI,CAAa;IAGjB,KAAK,CAAc;IAGnB,MAAM,CAAe;IAGrB,QAAQ,CAAY;IAGpB,OAAO,CAAW;IAGlB,eAAe,CAAU;IAGzB,SAAS,CAAU;IAGnB,WAAW,CAAU;IAGrB,SAAS,CAAU;IAGnB,kBAAkB,CAAU;IAG5B,YAAY,CAAgB;IAG5B,WAAW,CAAW;CAC7B,CAAA;AAzDY,gCAAU;AAEf;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;+CACX;AAGrB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,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AAI,EAAE,MAAM,EAAE,CAAC;;mDACS;AAGzB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;6CACG;AAGnB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;+CACK;AAGrB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;6CACG;AAGnB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;sDACY;AAG5B;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,mBAAY,EAAE,OAAO,EAAE,mBAAY,CAAC,IAAI,EAAE,CAAC;;gDACpC;AAG5B;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;;+CACX;qBAxDjB,UAAU;IADtB,IAAA,wBAAY,EAAC,EAAE,aAAa,EAAE,EAAE,UAAU,EAAE,aAAa,EAAE,EAAE,CAAC;GAClD,UAAU,CAyDtB","sourcesContent":["import { modelOptions, prop, Ref } from '@typegoose/typegoose';\r\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\r\nimport {\r\n\tBobAccountType,\r\n\tBobModel,\r\n\tBobSettlementStatus,\r\n\tBobSettlementType,\r\n\tBobType,\r\n\tPaidCurrency,\r\n} from '../../../utilities/enum';\r\nimport { Admin } from './admin.model';\r\nimport { Payout } from './payout.model';\r\nimport { Rider } from './rider.model';\r\nimport { Shop } from './shop.model';\r\n\r\n@modelOptions({ schemaOptions: { collection: 'bobFinances' } })\r\nexport class BOBFinance extends TimeStamps {\r\n\t@prop({ required: true, type: String })\r\n\tpublic referenceId!: string;\r\n\r\n\t@prop({ required: true, type: String, enum: BobAccountType })\r\n\tpublic accountType!: BobAccountType;\r\n\r\n\t@prop({ required: true, type: String, enum: BobSettlementType })\r\n\tpublic settlementType!: BobSettlementType;\r\n\r\n\t@prop({ type: Number, default: 0 })\r\n\tpublic amount?: number;\r\n\r\n\t@prop({ type: Number, default: 0 })\r\n\tpublic secondaryAmount?: number;\r\n\r\n\t@prop({ type: String, enum: BobSettlementStatus, default: BobSettlementStatus.NOT_PAID })\r\n\tpublic status?: BobSettlementStatus;\r\n\r\n\t@prop({ ref: () => Admin })\r\n\tpublic admin?: Ref<Admin>;\r\n\r\n\t@prop({ ref: () => Shop })\r\n\tpublic shop?: Ref<Shop>;\r\n\r\n\t@prop({ ref: () => Rider })\r\n\tpublic rider?: Ref<Rider>;\r\n\r\n\t@prop({ ref: () => Payout })\r\n\tpublic payout?: Ref<Payout>;\r\n\r\n\t@prop({ type: String, enum: BobModel, default: BobModel.C2B })\r\n\tpublic bobModel?: BobModel;\r\n\r\n\t@prop({ type: String, enum: BobType, default: BobType.INWARD })\r\n\tpublic bobType?: BobType;\r\n\r\n\t@prop({ type: String })\r\n\tpublic referenceNumber?: string;\r\n\r\n\t@prop({ type: String })\r\n\tpublic crmNumber?: string;\r\n\r\n\t@prop({ type: String })\r\n\tpublic bobLocation?: string;\r\n\r\n\t@prop({ type: Number })\r\n\tpublic riderTips?: number;\r\n\r\n\t@prop({ type: Number })\r\n\tpublic secondaryRiderTips?: number;\r\n\r\n\t@prop({ type: String, enum: PaidCurrency, default: PaidCurrency.BASE })\r\n\tpublic paidCurrency?: PaidCurrency;\r\n\r\n\t@prop({ type: Boolean, default: false })\r\n\tpublic isRiderSeen?: boolean;\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"brand.model.js","sourceRoot":"/","sources":["libraries/mongo/models/brand.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAiE;AACjE,4EAAqE;AAI9D,IAAM,KAAK,GAAX,MAAM,KAAM,SAAQ,2BAAU;IAE7B,IAAI,CAAU;IAGd,WAAW,CAAU;CAC5B,CAAA;AANY,sBAAK;AAEV;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC;;mCAC7C;AAGd;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,EAAE,CAAC;;0CACX;gBALhB,KAAK;IAFjB,IAAA,wBAAY,EAAC,EAAE,aAAa,EAAE,EAAE,UAAU,EAAE,QAAQ,EAAE,EAAE,CAAC;IACzD,IAAA,iBAAK,EAAC,EAAE,IAAI,EAAE,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,uBAAuB,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE,CAAC;GACtE,KAAK,CAMjB","sourcesContent":["import { Index, modelOptions, prop } from '@typegoose/typegoose';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\n\n@modelOptions({ schemaOptions: { collection: 'brands' } })\n@Index({ name: 1 }, { unique: true, partialFilterExpression: { deletedAt: null } })\nexport class Brand extends TimeStamps {\n\t@prop({ required: true, type: String, trim: true, maxlength: 50 })\n\tpublic name!: string;\n\n\t@prop({ type: String, maxlength: 250 })\n\tpublic description?: string;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"brand.model.js","sourceRoot":"/","sources":["libraries/mongo/models/brand.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAiE;AACjE,4EAAqE;AAI9D,IAAM,KAAK,GAAX,MAAM,KAAM,SAAQ,2BAAU;IAE7B,IAAI,CAAU;IAGd,WAAW,CAAU;CAC5B,CAAA;AANY,sBAAK;AAEV;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC;;mCAC7C;AAGd;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,EAAE,CAAC;;0CACX;gBALhB,KAAK;IAFjB,IAAA,wBAAY,EAAC,EAAE,aAAa,EAAE,EAAE,UAAU,EAAE,QAAQ,EAAE,EAAE,CAAC;IACzD,IAAA,iBAAK,EAAC,EAAE,IAAI,EAAE,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,uBAAuB,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE,CAAC;GACtE,KAAK,CAMjB","sourcesContent":["import { Index, modelOptions, prop } from '@typegoose/typegoose';\r\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\r\n\r\n@modelOptions({ schemaOptions: { collection: 'brands' } })\r\n@Index({ name: 1 }, { unique: true, partialFilterExpression: { deletedAt: null } })\r\nexport class Brand extends TimeStamps {\r\n\t@prop({ required: true, type: String, trim: true, maxlength: 50 })\r\n\tpublic name!: string;\r\n\r\n\t@prop({ type: String, maxlength: 250 })\r\n\tpublic description?: string;\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cancellation-reason.model.js","sourceRoot":"/","sources":["libraries/mongo/models/cancellation-reason.model.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oDAA+D;AAC/D,4EAAqE;AACrE,kDAGiC;AAiC1B,IAAM,kBAAkB,GAAxB,MAAM,kBAAmB,SAAQ,2BAAU;IAEvC,MAAM,CAAU;IAGhB,UAAU,CAA8B;IAGxC,MAAM,CAAwB;IAG9B,YAAY,CAAU;CAChC,CAAA;AAZY,gDAAkB;AAEpB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;kDACF;AAGhB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,iCAA0B,EAAE,CAAC;;sDACZ;AAGxC;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,2BAAoB,EAAE,CAAC;;kDAChB;AAG9B;IADN,IAAA,gBAAI,GAAE;;wDACsB;6BAXpB,kBAAkB;IA/B9B,IAAA,wBAAY,EAAC,EAAE,aAAa,EAAE,EAAE,UAAU,EAAE,qBAAqB,EAAE,EAAE,CAAC;IACtE,IAAA,eAAG,EAAqB,MAAM,EAAE,KAAK,WAAW,IAAI;QACjD,IAAI,CAAC;YAED,MAAM,EAAE,uBAAuB,EAAE,GAAG,wDAAa,GAAG,GAAC,CAAC;YAEtD,IAAI,IAAI,CAAC,KAAK,IAAI,OAAO,IAAI,CAAC,YAAY,KAAK,WAAW,EAAE,CAAC;gBACzD,MAAM,CAAC,MAAM,CAAC,GAAG,MAAM,uBAAuB,CAAC,SAAS,CAA8B;oBAClF;wBACI,MAAM,EAAE;4BACJ,UAAU,EAAE,IAAI,CAAC,UAAU;4BAC3B,MAAM,EAAE,2BAAoB,CAAC,MAAM;4BACnC,SAAS,EAAE,IAAI;yBAClB;qBACJ;oBACD;wBACI,MAAM,EAAE;4BACJ,GAAG,EAAE,IAAI;4BACT,eAAe,EAAE,EAAE,IAAI,EAAE,eAAe,EAAE;yBAC7C;qBACJ;iBACJ,CAAC,CAAC,IAAI,EAAE,CAAC;gBAEV,IAAI,CAAC,YAAY,GAAG,CAAC,MAAM,EAAE,eAAe,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;YAC5D,CAAC;YAED,IAAI,EAAE,CAAC;QACX,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACb,IAAI,CAAC,KAAc,CAAC,CAAC;QACzB,CAAC;IACL,CAAC,CAAC;GACW,kBAAkB,CAY9B","sourcesContent":["import { modelOptions, prop, pre } from '@typegoose/typegoose';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\nimport {\n SettingsReasonStatus,\n CancellationReasonTypeEnum\n} from '../../../utilities/enum';\n\n@modelOptions({ schemaOptions: { collection: 'cancellationReasons' } })\n@pre<CancellationReason>('save', async function (next) {\n try {\n\n const { CancellationReasonModel } = await import('.');\n\n if (this.isNew || typeof this.sortingOrder === 'undefined') {\n const [result] = await CancellationReasonModel.aggregate<{ maxSortingOrder: number }>([\n {\n $match: {\n reasonType: this.reasonType,\n status: SettingsReasonStatus.ACTIVE,\n deletedAt: null,\n },\n },\n {\n $group: {\n _id: null,\n maxSortingOrder: { $max: '$sortingOrder' },\n },\n },\n ]).exec();\n\n this.sortingOrder = (result?.maxSortingOrder ?? -1) + 1;\n }\n\n next();\n } catch (error) {\n next(error as Error);\n }\n})\nexport class CancellationReason extends TimeStamps {\n @prop({ required: true })\n public reason!: string;\n\n @prop({ required: true, enum: CancellationReasonTypeEnum })\n public reasonType!: CancellationReasonTypeEnum;\n\n @prop({ required: true, enum: SettingsReasonStatus })\n public status!: SettingsReasonStatus;\n\n @prop()\n public sortingOrder?: number;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"cancellation-reason.model.js","sourceRoot":"/","sources":["libraries/mongo/models/cancellation-reason.model.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oDAA+D;AAC/D,4EAAqE;AACrE,kDAGiC;AAiC1B,IAAM,kBAAkB,GAAxB,MAAM,kBAAmB,SAAQ,2BAAU;IAEvC,MAAM,CAAU;IAGhB,UAAU,CAA8B;IAGxC,MAAM,CAAwB;IAG9B,YAAY,CAAU;CAChC,CAAA;AAZY,gDAAkB;AAEpB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;kDACF;AAGhB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,iCAA0B,EAAE,CAAC;;sDACZ;AAGxC;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,2BAAoB,EAAE,CAAC;;kDAChB;AAG9B;IADN,IAAA,gBAAI,GAAE;;wDACsB;6BAXpB,kBAAkB;IA/B9B,IAAA,wBAAY,EAAC,EAAE,aAAa,EAAE,EAAE,UAAU,EAAE,qBAAqB,EAAE,EAAE,CAAC;IACtE,IAAA,eAAG,EAAqB,MAAM,EAAE,KAAK,WAAW,IAAI;QACjD,IAAI,CAAC;YAED,MAAM,EAAE,uBAAuB,EAAE,GAAG,wDAAa,GAAG,GAAC,CAAC;YAEtD,IAAI,IAAI,CAAC,KAAK,IAAI,OAAO,IAAI,CAAC,YAAY,KAAK,WAAW,EAAE,CAAC;gBACzD,MAAM,CAAC,MAAM,CAAC,GAAG,MAAM,uBAAuB,CAAC,SAAS,CAA8B;oBAClF;wBACI,MAAM,EAAE;4BACJ,UAAU,EAAE,IAAI,CAAC,UAAU;4BAC3B,MAAM,EAAE,2BAAoB,CAAC,MAAM;4BACnC,SAAS,EAAE,IAAI;yBAClB;qBACJ;oBACD;wBACI,MAAM,EAAE;4BACJ,GAAG,EAAE,IAAI;4BACT,eAAe,EAAE,EAAE,IAAI,EAAE,eAAe,EAAE;yBAC7C;qBACJ;iBACJ,CAAC,CAAC,IAAI,EAAE,CAAC;gBAEV,IAAI,CAAC,YAAY,GAAG,CAAC,MAAM,EAAE,eAAe,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;YAC5D,CAAC;YAED,IAAI,EAAE,CAAC;QACX,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACb,IAAI,CAAC,KAAc,CAAC,CAAC;QACzB,CAAC;IACL,CAAC,CAAC;GACW,kBAAkB,CAY9B","sourcesContent":["import { modelOptions, prop, pre } from '@typegoose/typegoose';\r\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\r\nimport {\r\n SettingsReasonStatus,\r\n CancellationReasonTypeEnum\r\n} from '../../../utilities/enum';\r\n\r\n@modelOptions({ schemaOptions: { collection: 'cancellationReasons' } })\r\n@pre<CancellationReason>('save', async function (next) {\r\n try {\r\n\r\n const { CancellationReasonModel } = await import('.');\r\n\r\n if (this.isNew || typeof this.sortingOrder === 'undefined') {\r\n const [result] = await CancellationReasonModel.aggregate<{ maxSortingOrder: number }>([\r\n {\r\n $match: {\r\n reasonType: this.reasonType,\r\n status: SettingsReasonStatus.ACTIVE,\r\n deletedAt: null,\r\n },\r\n },\r\n {\r\n $group: {\r\n _id: null,\r\n maxSortingOrder: { $max: '$sortingOrder' },\r\n },\r\n },\r\n ]).exec();\r\n\r\n this.sortingOrder = (result?.maxSortingOrder ?? -1) + 1;\r\n }\r\n\r\n next();\r\n } catch (error) {\r\n next(error as Error);\r\n }\r\n})\r\nexport class CancellationReason extends TimeStamps {\r\n @prop({ required: true })\r\n public reason!: string;\r\n\r\n @prop({ required: true, enum: CancellationReasonTypeEnum })\r\n public reasonType!: CancellationReasonTypeEnum;\r\n\r\n @prop({ required: true, enum: SettingsReasonStatus })\r\n public status!: SettingsReasonStatus;\r\n\r\n @prop()\r\n public sortingOrder?: number;\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"card.model.js","sourceRoot":"/","sources":["libraries/mongo/models/card.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA+D;AAC/D,4EAAqE;AACrE,uDAA6C;AAC7C,iDAAwC;AACxC,kDAAiE;AAG1D,IAAM,IAAI,GAAV,MAAM,IAAK,SAAQ,2BAAU;IAE5B,QAAQ,CAAW;IAGnB,QAAQ,CAAiB;IAGzB,MAAM,CAAe;IAGrB,QAAQ,CAAgB;IAGxB,UAAU,CAAU;IAGpB,WAAW,CAAU;IAGrB,GAAG,CAAU;IAGb,YAAY,CAAU;IAGtB,WAAW,CAAU;IAGrB,gBAAgB,CAAU;IAG1B,UAAU,CAAQ;IAGlB,QAAQ,CAAU;IAGlB,WAAW,CAAW;IAGtB,cAAc,CAAU;IAGxB,QAAQ,CAAU;IAGlB,IAAI,CAAY;IAGhB,IAAI,CAAU;CACrB,CAAA;AAnDY,oBAAI;AAET;IADN,IAAA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;AAGtB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;4CACQ;AAGxB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;sCACE;AAGlB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC;;kCACR;AAGhB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;kCACF;eAlDT,IAAI;IADhB,IAAA,wBAAY,EAAC,EAAE,aAAa,EAAE,EAAE,UAAU,EAAE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,gBAAgB,EAAE,UAAU,EAAE,EAAE,CAAC;GAC5F,IAAI,CAmDhB","sourcesContent":["import { modelOptions, prop, Ref } from '@typegoose/typegoose';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\nimport { CoreUser } from './core-user.model';\nimport { Parent } from './parent.model';\nimport { CardType, CardUserType } from '../../../utilities/enum';\n\n@modelOptions({ schemaOptions: { collection: 'cards', timestamps: true, discriminatorKey: 'cardType' } })\nexport class Card extends TimeStamps {\n\t@prop({ type: String, enum: CardType })\n\tpublic cardType: CardType;\n\n\t@prop({ ref: () => CoreUser })\n\tpublic coreUser?: Ref<CoreUser>;\n\n\t@prop({ ref: () => Parent })\n\tpublic parent?: Ref<Parent>;\n\n\t@prop({ type: String, enum: CardUserType })\n\tpublic userType?: CardUserType;\n\n\t@prop({ type: String })\n\tpublic nameOfCard?: string;\n\n\t@prop({ type: String, required: true })\n\tpublic card_number!: string;\n\n\t@prop({ type: String, required: true })\n\tpublic cvv!: string;\n\n\t@prop({ type: String, required: true })\n\tpublic expiry_month!: string;\n\n\t@prop({ type: String, required: true })\n\tpublic expiry_year!: string;\n\n\t@prop({ type: String })\n\tpublic expiryDateString?: string;\n\n\t@prop({ type: Date })\n\tpublic expiryDate?: Date;\n\n\t@prop({ type: String, required: true, default: 'NGN' })\n\tpublic currency?: string;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic defaultCard?: boolean;\n\n\t@prop({ type: String })\n\tpublic cardTypeString?: string;\n\n\t@prop({ type: String })\n\tpublic security?: string;\n\n\t@prop({ type: () => [String] })\n\tpublic pins?: string[];\n\n\t@prop({ type: String })\n\tpublic mode?: string;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"card.model.js","sourceRoot":"/","sources":["libraries/mongo/models/card.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA+D;AAC/D,4EAAqE;AACrE,uDAA6C;AAC7C,iDAAwC;AACxC,kDAAiE;AAG1D,IAAM,IAAI,GAAV,MAAM,IAAK,SAAQ,2BAAU;IAE5B,QAAQ,CAAW;IAGnB,QAAQ,CAAiB;IAGzB,MAAM,CAAe;IAGrB,QAAQ,CAAgB;IAGxB,UAAU,CAAU;IAGpB,WAAW,CAAU;IAGrB,GAAG,CAAU;IAGb,YAAY,CAAU;IAGtB,WAAW,CAAU;IAGrB,gBAAgB,CAAU;IAG1B,UAAU,CAAQ;IAGlB,QAAQ,CAAU;IAGlB,WAAW,CAAW;IAGtB,cAAc,CAAU;IAGxB,QAAQ,CAAU;IAGlB,IAAI,CAAY;IAGhB,IAAI,CAAU;CACrB,CAAA;AAnDY,oBAAI;AAET;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,eAAQ,EAAE,CAAC;;sCACb;AAGnB;IADN,IAAA,gBAAI,EAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,0BAAQ,EAAE,CAAC;;sCACE;AAGzB;IADN,IAAA,gBAAI,EAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,qBAAM,EAAE,CAAC;;oCACA;AAGrB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,mBAAY,EAAE,CAAC;;sCACZ;AAGxB;IADN,IAAA,g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,UAAU,EAAE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,gBAAgB,EAAE,UAAU,EAAE,EAAE,CAAC;GAC5F,IAAI,CAmDhB","sourcesContent":["import { modelOptions, prop, Ref } from '@typegoose/typegoose';\r\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\r\nimport { CoreUser } from './core-user.model';\r\nimport { Parent } from './parent.model';\r\nimport { CardType, CardUserType } from '../../../utilities/enum';\r\n\r\n@modelOptions({ schemaOptions: { collection: 'cards', timestamps: true, discriminatorKey: 'cardType' } })\r\nexport class Card extends TimeStamps {\r\n\t@prop({ type: String, enum: CardType })\r\n\tpublic cardType: CardType;\r\n\r\n\t@prop({ ref: () => CoreUser })\r\n\tpublic coreUser?: Ref<CoreUser>;\r\n\r\n\t@prop({ ref: () => Parent })\r\n\tpublic parent?: Ref<Parent>;\r\n\r\n\t@prop({ type: String, enum: CardUserType })\r\n\tpublic userType?: CardUserType;\r\n\r\n\t@prop({ type: String })\r\n\tpublic nameOfCard?: string;\r\n\r\n\t@prop({ type: String, required: true })\r\n\tpublic card_number!: string;\r\n\r\n\t@prop({ type: String, required: true })\r\n\tpublic cvv!: string;\r\n\r\n\t@prop({ type: String, required: true })\r\n\tpublic expiry_month!: string;\r\n\r\n\t@prop({ type: String, required: true })\r\n\tpublic expiry_year!: string;\r\n\r\n\t@prop({ type: String })\r\n\tpublic expiryDateString?: string;\r\n\r\n\t@prop({ type: Date })\r\n\tpublic expiryDate?: Date;\r\n\r\n\t@prop({ type: String, required: true, default: 'NGN' })\r\n\tpublic currency?: string;\r\n\r\n\t@prop({ type: Boolean, default: false })\r\n\tpublic defaultCard?: boolean;\r\n\r\n\t@prop({ type: String })\r\n\tpublic cardTypeString?: string;\r\n\r\n\t@prop({ type: String })\r\n\tpublic security?: string;\r\n\r\n\t@prop({ type: () => [String] })\r\n\tpublic pins?: string[];\r\n\r\n\t@prop({ type: String })\r\n\tpublic mode?: string;\r\n}\r\n"]}
|
|
@@ -1 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E,IAAI,EAAE,GAAG,EAAE,CAAC,8CAAkB,EAAE,CAAC;8BACb,8CAAkB;2DAAC;0BA1BnC,eAAe;IAZ3B,IAAA,wBAAY,EAAC;QACb,aAAa,EAAE;YACd,UAAU,EAAE,kBAAkB;YAC9B,MAAM,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;YAC1B,QAAQ,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;SAC5B;QACD,OAAO,EAAE;YACR,UAAU,EAAE,oBAAQ,CAAC,KAAK;SAC1B;KACD,CAAC;IACD,IAAA,iBAAK,EAAC,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IAC7C,IAAA,iBAAK,EAAC,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC;GACN,eAAe,CA2B3B","sourcesContent":["import { prop, Ref, index, modelOptions, Severity } from '@typegoose/typegoose';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\nimport { Cart } from './cart.model';\nimport { PaymentMethod } from '../../../utilities/enum';\nimport { PaymentInformation } from './embedded/payment-infromation.model';\nimport { User } from './user.model';\n\n/**\n * CartParticipant model - Tracks users participating in a group cart\n */\n@modelOptions({\n\tschemaOptions: {\n\t\tcollection: 'cartParticipants',\n\t\ttoJSON: { virtuals: true },\n\t\ttoObject: { virtuals: true },\n\t},\n\toptions: {\n\t\tallowMixed: Severity.ALLOW,\n\t},\n})\n@index({ cart: 1, user: 1 }, { unique: true })\n@index({ cart: 1 })\nexport class CartParticipant extends TimeStamps {\n\t@prop({ required: true, ref: () => Cart })\n\tpublic cart!: Ref<Cart>;\n\n\t@prop({ required: true, ref: () => User })\n\tpublic user!: Ref<User>;\n\n\t@prop({ default: () => new Date() })\n\tpublic joinedAt!: Date;\n\n\t@prop({ default: false })\n\tpublic isReady!: boolean;\n\n\t@prop({ default: false })\n\tpublic isPaid!: boolean;\n\n\t@prop()\n\tpublic readyAt?: Date;\n\n\t@prop({ default: 0 })\n\tpublic spentAmount!: number;\n\n\t@prop({ enum: PaymentMethod, type: String })\n\tpublic paymentMethod?: PaymentMethod;\n\n\t@prop({ type: () => PaymentInformation })\n\tpublic paymentInformation?: PaymentInformation;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"cart-participant.model.js","sourceRoot":"/","sources":["libraries/mongo/models/cart-participant.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAgF;AAChF,4EAAqE;AACrE,6CAAoC;AACpC,kDAAwD;AACxD,oFAA0E;AAC1E,6CAAoC;AAiB7B,IAAM,eAAe,GAArB,MAAM,eAAgB,SAAQ,2BAAU;IAEvC,IAAI,CAAa;IAGjB,IAAI,CAAa;IAGjB,QAAQ,CAAQ;IAGhB,OAAO,CAAW;IAGlB,MAAM,CAAW;IAGjB,OAAO,CAAQ;IAGf,WAAW,CAAU;IAGrB,aAAa,CAAiB;IAG9B,kBAAkB,CAAsB;CAC/C,CAAA;AA3BY,0CAAe;AAEpB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,iBAAI,EAAE,CAAC;;6CAClB;AAGjB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,iBAAI,EAAE,CAAC;;6CAClB;AAGjB;IADN,IAAA,gBAAI,EAAC,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,IAAI,EAAE,EAAE,CAAC;8BAClB,IAAI;iDAAC;AAGhB;IADN,IAAA,gBAAI,EAAC,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;;gDACA;AAGlB;IADN,IAAA,gBAAI,EAAC,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;;+CACD;AAGjB;IADN,IAAA,gBAAI,GAAE;8BACU,IAAI;gDAAC;AAGf;IADN,IAAA,gBAAI,EAAC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;oDACO;AAGrB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,oBAAa,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;sDACP;AAG9B;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,8CAAkB,EAAE,CAAC;8BACb,8CAAkB;2DAAC;0BA1BnC,eAAe;IAZ3B,IAAA,wBAAY,EAAC;QACb,aAAa,EAAE;YACd,UAAU,EAAE,kBAAkB;YAC9B,MAAM,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;YAC1B,QAAQ,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;SAC5B;QACD,OAAO,EAAE;YACR,UAAU,EAAE,oBAAQ,CAAC,KAAK;SAC1B;KACD,CAAC;IACD,IAAA,iBAAK,EAAC,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IAC7C,IAAA,iBAAK,EAAC,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC;GACN,eAAe,CA2B3B","sourcesContent":["import { prop, Ref, index, modelOptions, Severity } from '@typegoose/typegoose';\r\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\r\nimport { Cart } from './cart.model';\r\nimport { PaymentMethod } from '../../../utilities/enum';\r\nimport { PaymentInformation } from './embedded/payment-infromation.model';\r\nimport { User } from './user.model';\r\n\r\n/**\r\n * CartParticipant model - Tracks users participating in a group cart\r\n */\r\n@modelOptions({\r\n\tschemaOptions: {\r\n\t\tcollection: 'cartParticipants',\r\n\t\ttoJSON: { virtuals: true },\r\n\t\ttoObject: { virtuals: true },\r\n\t},\r\n\toptions: {\r\n\t\tallowMixed: Severity.ALLOW,\r\n\t},\r\n})\r\n@index({ cart: 1, user: 1 }, { unique: true })\r\n@index({ cart: 1 })\r\nexport class CartParticipant extends TimeStamps {\r\n\t@prop({ required: true, ref: () => Cart })\r\n\tpublic cart!: Ref<Cart>;\r\n\r\n\t@prop({ required: true, ref: () => User })\r\n\tpublic user!: Ref<User>;\r\n\r\n\t@prop({ default: () => new Date() })\r\n\tpublic joinedAt!: Date;\r\n\r\n\t@prop({ default: false })\r\n\tpublic isReady!: boolean;\r\n\r\n\t@prop({ default: false })\r\n\tpublic isPaid!: boolean;\r\n\r\n\t@prop()\r\n\tpublic readyAt?: Date;\r\n\r\n\t@prop({ default: 0 })\r\n\tpublic spentAmount!: number;\r\n\r\n\t@prop({ enum: PaymentMethod, type: String })\r\n\tpublic paymentMethod?: PaymentMethod;\r\n\r\n\t@prop({ type: () => PaymentInformation })\r\n\tpublic paymentInformation?: PaymentInformation;\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cart.model.js","sourceRoot":"/","sources":["libraries/mongo/models/cart.model.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,oDAAqF;AACrF,6CAAoC;AACpC,4EAAqE;AACrE,kDAAwE;AACxE,0DAAqD;AACrD,sDAA8B;AAC9B,mCAAqC;AAErC,iDAAwC;AACxC,6CAAoC;AA0C7B,IAAM,IAAI,GAAV,MAAM,IAAK,SAAQ,2BAAU;IAE5B,KAAK,CAAU;IAGf,IAAI,CAAU;IAGd,IAAI,CAAa;IAGjB,IAAI,CAAa;IAGjB,eAAe,CAAe;IAG9B,YAAY,CAAW;IAGvB,eAAe,CAAQ;IAGvB,iBAAiB,CAAqB;IAGtC,qBAAqB,CAAU;IAQ/B,MAAM,CAAc;IAGpB,MAAM,CAAe;CAC5B,CAAA;AAtCY,oBAAI;AAET;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,EAAE,CAAC;;mCACf;AAGf;IADN,IAAA,gBAAI,GAAE;;kCACc;AAGd;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC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,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IAClD,IAAA,iBAAK,EAAC,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC;IAClB,IAAA,iBAAK,EAAC,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC;IAClB,IAAA,iBAAK,EAAC,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC;IACpB,IAAA,iBAAK,EACL,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,EACpB;QACC,MAAM,EAAE,IAAI;QACZ,uBAAuB,EAAE;YACxB,MAAM,EAAE,EAAE,GAAG,EAAE,CAAC,iBAAU,CAAC,MAAM,EAAE,iBAAU,CAAC,MAAM,CAAC,EAAE;YACvD,SAAS,EAAE,IAAI;SACf;KACD,CACD;IACA,IAAA,eAAG,EAAO,MAAM,EAAE,KAAK,WAAW,IAAI;QACtC,IAAI,IAAI,CAAC,KAAK,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;YAC9B,MAAM,QAAQ,GAAG,IAAA,iBAAO,EAAC,IAAI,CAAC,KAAK,EAAE;gBACpC,KAAK,EAAE,IAAI;gBACX,MAAM,EAAE,IAAI;gBACZ,IAAI,EAAE,IAAI;aACV,CAAC,CAAC;YAEH,MAAM,QAAQ,GAAG,IAAA,oBAAW,EAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;YAChD,IAAI,CAAC,IAAI,GAAG,GAAG,QAAQ,IAAI,QAAQ,EAAE,CAAC;QACvC,CAAC;QACD,IAAI,EAAE,CAAC;IACR,CAAC,CAAC;GACW,IAAI,CAsChB","sourcesContent":["import { prop, Ref, index, modelOptions, Severity, pre } from '@typegoose/typegoose';\nimport { Shop } from './shop.model';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\nimport { CartStatus, PaymentPreference } from '../../../utilities/enum';\nimport { UserAddress } from './shared/address.model';\nimport slugify from 'slugify';\nimport { randomBytes } from 'crypto';\n\nimport { Coupon } from './coupon.model';\nimport { User } from './user.model';\n\n/**\n * Cart configuration model using Typegoose with automatic slug generation\n */\n@modelOptions({\n\tschemaOptions: {\n\t\tcollection: 'carts',\n\t\ttoJSON: { virtuals: true },\n\t\ttoObject: { virtuals: true },\n\t},\n\toptions: {\n\t\tallowMixed: Severity.ALLOW,\n\t},\n})\n@index({ slug: 1 }, { unique: true, sparse: true })\n@index({ user: 1 })\n@index({ shop: 1 })\n@index({ status: 1 })\n@index(\n\t{ user: 1, shop: 1 },\n\t{\n\t\tunique: true,\n\t\tpartialFilterExpression: {\n\t\t\tstatus: { $in: [CartStatus.ACTIVE, CartStatus.LOCKED] },\n\t\t\tdeletedAt: null,\n\t\t},\n\t}\n)\n@pre<Cart>('save', async function (next) {\n\tif (this.title && !this.slug) {\n\t\tconst baseSlug = slugify(this.title, {\n\t\t\tlower: true,\n\t\t\tstrict: true,\n\t\t\ttrim: true,\n\t\t});\n\n\t\tconst uniqueId = randomBytes(8).toString('hex');\n\t\tthis.slug = `${baseSlug}-${uniqueId}`;\n\t}\n\tnext();\n})\nexport class Cart extends TimeStamps {\n\t@prop({ trim: true, maxlength: 100 })\n\tpublic title?: string;\n\n\t@prop()\n\tpublic slug?: string;\n\n\t@prop({ required: true, ref: () => User })\n\tpublic user!: Ref<User>;\n\n\t@prop({ required: true, ref: () => Shop })\n\tpublic shop!: Ref<Shop>;\n\n\t@prop({ required: false, type: UserAddress })\n\tpublic deliveryAddress?: UserAddress;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isGroupOrder?: boolean;\n\n\t@prop({ type: Date })\n\tpublic deadlineToOrder?: Date;\n\n\t@prop({ type: String, enum: PaymentPreference })\n\tpublic paymentPreference?: PaymentPreference;\n\n\t@prop({ type: Number, default: Infinity })\n\tpublic spendingLimitForGuest?: number;\n\n\t@prop({\n\t\tenum: CartStatus,\n\t\ttype: String,\n\t\tdefault: CartStatus.ACTIVE,\n\t\trequired: true,\n\t})\n\tpublic status!: CartStatus;\n\n\t@prop({ ref: () => Coupon })\n\tpublic coupon?: Ref<Coupon>;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"cart.model.js","sourceRoot":"/","sources":["libraries/mongo/models/cart.model.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,oDAAqF;AACrF,6CAAoC;AACpC,4EAAqE;AACrE,kDAAwE;AACxE,0DAAqD;AACrD,sDAA8B;AAC9B,mCAAqC;AAErC,iDAAwC;AACxC,6CAAoC;AA0C7B,IAAM,IAAI,GAAV,MAAM,IAAK,SAAQ,2BAAU;IAE5B,KAAK,CAAU;IAGf,IAAI,CAAU;IAGd,IAAI,CAAa;IAGjB,IAAI,CAAa;IAGjB,eAAe,CAAe;IAG9B,YAAY,CAAW;IAGvB,eAAe,CAAQ;IAGvB,iBAAiB,CAAqB;IAGtC,qBAAqB,CAAU;IAQ/B,MAAM,CAAc;IAGpB,MAAM,CAAe;CAC5B,CAAA;AAtCY,oBAAI;AAET;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,EAAE,CAAC;;mCACf;AAGf;IADN,IAAA,gBAAI,GAAE;;kCACc;AAGd;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,iBAAI,EAAE,CAAC;;kCAClB;AAGjB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,iBAAI,EAAE,CAAC;;kCAClB;AAGjB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE,2BAAW,EAAE,CAAC;8BACpB,2BAAW;6CAAC;AAG9B;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;;0CACV;AAGvB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,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C,iBAAU,CAAC,MAAM,EAAE,iBAAU,CAAC,MAAM,CAAC,EAAE;YACvD,SAAS,EAAE,IAAI;SACf;KACD,CACD;IACA,IAAA,eAAG,EAAO,MAAM,EAAE,KAAK,WAAW,IAAI;QACtC,IAAI,IAAI,CAAC,KAAK,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;YAC9B,MAAM,QAAQ,GAAG,IAAA,iBAAO,EAAC,IAAI,CAAC,KAAK,EAAE;gBACpC,KAAK,EAAE,IAAI;gBACX,MAAM,EAAE,IAAI;gBACZ,IAAI,EAAE,IAAI;aACV,CAAC,CAAC;YAEH,MAAM,QAAQ,GAAG,IAAA,oBAAW,EAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;YAChD,IAAI,CAAC,IAAI,GAAG,GAAG,QAAQ,IAAI,QAAQ,EAAE,CAAC;QACvC,CAAC;QACD,IAAI,EAAE,CAAC;IACR,CAAC,CAAC;GACW,IAAI,CAsChB","sourcesContent":["import { prop, Ref, index, modelOptions, Severity, pre } from '@typegoose/typegoose';\r\nimport { Shop } from './shop.model';\r\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\r\nimport { CartStatus, PaymentPreference } from '../../../utilities/enum';\r\nimport { UserAddress } from './shared/address.model';\r\nimport slugify from 'slugify';\r\nimport { randomBytes } from 'crypto';\r\n\r\nimport { Coupon } from './coupon.model';\r\nimport { User } from './user.model';\r\n\r\n/**\r\n * Cart configuration model using Typegoose with automatic slug generation\r\n */\r\n@modelOptions({\r\n\tschemaOptions: {\r\n\t\tcollection: 'carts',\r\n\t\ttoJSON: { virtuals: true },\r\n\t\ttoObject: { virtuals: true },\r\n\t},\r\n\toptions: {\r\n\t\tallowMixed: Severity.ALLOW,\r\n\t},\r\n})\r\n@index({ slug: 1 }, { unique: true, sparse: true })\r\n@index({ user: 1 })\r\n@index({ shop: 1 })\r\n@index({ status: 1 })\r\n@index(\r\n\t{ user: 1, shop: 1 },\r\n\t{\r\n\t\tunique: true,\r\n\t\tpartialFilterExpression: {\r\n\t\t\tstatus: { $in: [CartStatus.ACTIVE, CartStatus.LOCKED] },\r\n\t\t\tdeletedAt: null,\r\n\t\t},\r\n\t}\r\n)\r\n@pre<Cart>('save', async function (next) {\r\n\tif (this.title && !this.slug) {\r\n\t\tconst baseSlug = slugify(this.title, {\r\n\t\t\tlower: true,\r\n\t\t\tstrict: true,\r\n\t\t\ttrim: true,\r\n\t\t});\r\n\r\n\t\tconst uniqueId = randomBytes(8).toString('hex');\r\n\t\tthis.slug = `${baseSlug}-${uniqueId}`;\r\n\t}\r\n\tnext();\r\n})\r\nexport class Cart extends TimeStamps {\r\n\t@prop({ trim: true, maxlength: 100 })\r\n\tpublic title?: string;\r\n\r\n\t@prop()\r\n\tpublic slug?: string;\r\n\r\n\t@prop({ required: true, ref: () => User })\r\n\tpublic user!: Ref<User>;\r\n\r\n\t@prop({ required: true, ref: () => Shop })\r\n\tpublic shop!: Ref<Shop>;\r\n\r\n\t@prop({ required: false, type: UserAddress })\r\n\tpublic deliveryAddress?: UserAddress;\r\n\r\n\t@prop({ type: Boolean, default: false })\r\n\tpublic isGroupOrder?: boolean;\r\n\r\n\t@prop({ type: Date })\r\n\tpublic deadlineToOrder?: Date;\r\n\r\n\t@prop({ type: String, enum: PaymentPreference })\r\n\tpublic paymentPreference?: PaymentPreference;\r\n\r\n\t@prop({ type: Number, default: Infinity })\r\n\tpublic spendingLimitForGuest?: number;\r\n\r\n\t@prop({\r\n\t\tenum: CartStatus,\r\n\t\ttype: String,\r\n\t\tdefault: CartStatus.ACTIVE,\r\n\t\trequired: true,\r\n\t})\r\n\tpublic status!: CartStatus;\r\n\r\n\t@prop({ ref: () => Coupon })\r\n\tpublic coupon?: Ref<Coupon>;\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"category.model.js","sourceRoot":"/","sources":["libraries/mongo/models/category.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AA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pB","sourcesContent":["import { Index, modelOptions, prop, Ref } from '@typegoose/typegoose';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\nimport { ItemType, Status } from '../../../utilities/enum';\n\n@modelOptions({ schemaOptions: { collection: 'categories' } })\n@Index(\n\t{ name: 1, itemType: 1 },\n\t{ unique: true, partialFilterExpression: { parentCategory: null, deletedAt: null } }\n)\nexport class Category extends TimeStamps {\n\t@prop({ required: true, type: String, trim: true, maxlength: 20 })\n\tpublic name!: string;\n\n\t@prop({ type: String })\n\tpublic image?: string;\n\n\t@prop({ required: true, type: String, enum: ItemType })\n\tpublic itemType!: ItemType;\n\n\t@prop({ ref: () => Category })\n\tpublic parentCategory?: Ref<Category>;\n\n\t@prop({ type: String, enum: Status, default: Status.ACTIVE })\n\tpublic status?: Status;\n\n\t@prop({ type: String, maxlength: 250 })\n\tpublic note?: string;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"category.model.js","sourceRoot":"/","sources":["libraries/mongo/models/category.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAsE;AACtE,4EAAqE;AACrE,kDAA2D;AAOpD,IAAM,QAAQ,GAAd,MAAM,QAAS,SAAQ,2BAAU;IAEhC,IAAI,CAAU;IAGd,KAAK,CAAU;IAGf,QAAQ,CAAY;IAGpB,cAAc,CAAiB;IAG/B,MAAM,CAAU;IAGhB,IAAI,CAAU;CACrB,CAAA;AAlBY,4BAAQ;AAEb;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC;;sCAC7C;AAGd;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;uCACD;AAGf;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,eAAQ,EAAE,CAAC;;0CAC5B;AAGpB;IADN,IAAA,gBAAI,EAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC;;gDACQ;AAG/B;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,aAAM,EAAE,OAAO,EAAE,aAAM,CAAC,MAAM,EAAE,CAAC;;wCACtC;AAGhB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,EAAE,CAAC;;sCAClB;mBAjBT,QAAQ;IALpB,IAAA,wBAAY,EAAC,EAAE,aAAa,EAAE,EAAE,UAAU,EAAE,YAAY,EAAE,EAAE,CAAC;IAC7D,IAAA,iBAAK,EACL,EAAE,IAAI,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,EACxB,EAAE,MAAM,EAAE,IAAI,EAAE,uBAAuB,EAAE,EAAE,cAAc,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE,CACpF;GACY,QAAQ,CAkBpB","sourcesContent":["import { Index, modelOptions, prop, Ref } from '@typegoose/typegoose';\r\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\r\nimport { ItemType, Status } from '../../../utilities/enum';\r\n\r\n@modelOptions({ schemaOptions: { collection: 'categories' } })\r\n@Index(\r\n\t{ name: 1, itemType: 1 },\r\n\t{ unique: true, partialFilterExpression: { parentCategory: null, deletedAt: null } }\r\n)\r\nexport class Category extends TimeStamps {\r\n\t@prop({ required: true, type: String, trim: true, maxlength: 20 })\r\n\tpublic name!: string;\r\n\r\n\t@prop({ type: String })\r\n\tpublic image?: string;\r\n\r\n\t@prop({ required: true, type: String, enum: ItemType })\r\n\tpublic itemType!: ItemType;\r\n\r\n\t@prop({ ref: () => Category })\r\n\tpublic parentCategory?: Ref<Category>;\r\n\r\n\t@prop({ type: String, enum: Status, default: Status.ACTIVE })\r\n\tpublic status?: Status;\r\n\r\n\t@prop({ type: String, maxlength: 250 })\r\n\tpublic note?: string;\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core-auth-identity.model.js","sourceRoot":"/","sources":["libraries/mongo/models/core-auth-identity.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA+D;AAC/D,kDAA+D;AAC/D,uDAA6C;AAGtC,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;IAErB,IAAI,CAAiB;IAGrB,IAAI,CAAwB;CACnC,CAAA;AANY,4CAAgB;AAErB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,0BAAQ,EAAE,CAAC;;8CAClB;AAGrB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,2BAAoB,EAAE,CAAC;;8CAChC;2BALvB,gBAAgB;IAD5B,IAAA,wBAAY,EAAC,EAAE,aAAa,EAAE,EAAE,UAAU,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,EAAE,EAAE,CAAC;GAC/E,gBAAgB,CAM5B","sourcesContent":["import { modelOptions, prop, Ref } from '@typegoose/typegoose';\nimport { CoreAuthIdentityType } from '../../../utilities/enum';\nimport { CoreUser } from './core-user.model';\n\n@modelOptions({ schemaOptions: { collection: 'authIdentities', discriminatorKey: 'type' } })\nexport class CoreAuthIdentity {\n\t@prop({ required: true, ref: () => CoreUser })\n\tpublic user!: Ref<CoreUser>;\n\n\t@prop({ required: true, type: String, enum: CoreAuthIdentityType })\n\tpublic type!: CoreAuthIdentityType;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"core-auth-identity.model.js","sourceRoot":"/","sources":["libraries/mongo/models/core-auth-identity.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA+D;AAC/D,kDAA+D;AAC/D,uDAA6C;AAGtC,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;IAErB,IAAI,CAAiB;IAGrB,IAAI,CAAwB;CACnC,CAAA;AANY,4CAAgB;AAErB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,0BAAQ,EAAE,CAAC;;8CAClB;AAGrB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,2BAAoB,EAAE,CAAC;;8CAChC;2BALvB,gBAAgB;IAD5B,IAAA,wBAAY,EAAC,EAAE,aAAa,EAAE,EAAE,UAAU,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,EAAE,EAAE,CAAC;GAC/E,gBAAgB,CAM5B","sourcesContent":["import { modelOptions, prop, Ref } from '@typegoose/typegoose';\r\nimport { CoreAuthIdentityType } from '../../../utilities/enum';\r\nimport { CoreUser } from './core-user.model';\r\n\r\n@modelOptions({ schemaOptions: { collection: 'authIdentities', discriminatorKey: 'type' } })\r\nexport class CoreAuthIdentity {\r\n\t@prop({ required: true, ref: () => CoreUser })\r\n\tpublic user!: Ref<CoreUser>;\r\n\r\n\t@prop({ required: true, type: String, enum: CoreAuthIdentityType })\r\n\tpublic type!: CoreAuthIdentityType;\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core-user.model.js","sourceRoot":"/","sources":["libraries/mongo/models/core-user.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA0D;AAC1D,4EAAqE;AACrE,kDAAiD;AAG1C,IAAM,QAAQ,GAAd,MAAM,QAAS,SAAQ,2BAAU;IAEhC,IAAI,CAAU;IAGd,KAAK,CAAU;IAGf,MAAM,CAAU;IAGhB,GAAG,CAAQ;IAGX,WAAW,CAAU;IAGrB,SAAS,CAAY;IAGrB,YAAY,CAAU;IAGtB,MAAM,CAAU;IAGhB,SAAS,CAAY;IAGrB,gBAAgB,CAAU;IAG1B,YAAY,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,EAAE,aAAa,EAAE,EAAE,UAAU,EAAE,WAAW,EAAE,EAAE,CAAC;GAChD,QAAQ,CAiCpB","sourcesContent":["import { modelOptions, prop } from '@typegoose/typegoose';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\nimport { Status } from '../../../utilities/enum';\n\n@modelOptions({ schemaOptions: { collection: 'coreUsers' } })\nexport class CoreUser extends TimeStamps {\n\t@prop({ required: true, type: String })\n\tpublic name!: string;\n\n\t@prop({ required: true, type: String })\n\tpublic email!: string;\n\n\t@prop({ required: false, type: String })\n\tpublic gender?: string;\n\n\t@prop({ required: false, type: Date })\n\tpublic dob?: Date;\n\n\t@prop({ required: true, type: String })\n\tpublic countryISO2!: string;\n\n\t@prop({ type: () => [String], default: [] })\n\tpublic fcmTokens?: string[];\n\n\t@prop({ type: String })\n\tpublic profilePhoto?: string;\n\n\t@prop({ type: String, enum: Status, default: Status.ACTIVE })\n\tpublic status?: Status;\n\n\t@prop({ required: true, type: () => [String] })\n\tpublic deviceIds!: string[];\n\n\t@prop({ type: String })\n\tpublic stripeCustomerId?: string;\n\n\t@prop({ type: Number, default: 0 })\n\tpublic RewardPoints?: number;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"core-user.model.js","sourceRoot":"/","sources":["libraries/mongo/models/core-user.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA0D;AAC1D,4EAAqE;AACrE,kDAAiD;AAG1C,IAAM,QAAQ,GAAd,MAAM,QAAS,SAAQ,2BAAU;IAEhC,IAAI,CAAU;IAGd,KAAK,CAAU;IAGf,MAAM,CAAU;IAGhB,GAAG,CAAQ;IAGX,WAAW,CAAU;IAGrB,SAAS,CAAY;IAGrB,YAAY,CAAU;IAGtB,MAAM,CAAU;IAGhB,SAAS,CAAY;IAGrB,gBAAgB,CAAU;IAG1B,YAAY,CAAU;CAC7B,CAAA;AAjCY,4BAAQ;AAEb;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAA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{ modelOptions, prop } from '@typegoose/typegoose';\r\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\r\nimport { Status } from '../../../utilities/enum';\r\n\r\n@modelOptions({ schemaOptions: { collection: 'coreUsers' } })\r\nexport class CoreUser extends TimeStamps {\r\n\t@prop({ required: true, type: String })\r\n\tpublic name!: string;\r\n\r\n\t@prop({ required: true, type: String })\r\n\tpublic email!: string;\r\n\r\n\t@prop({ required: false, type: String })\r\n\tpublic gender?: string;\r\n\r\n\t@prop({ required: false, type: Date })\r\n\tpublic dob?: Date;\r\n\r\n\t@prop({ required: true, type: String })\r\n\tpublic countryISO2!: string;\r\n\r\n\t@prop({ type: () => [String], default: [] })\r\n\tpublic fcmTokens?: string[];\r\n\r\n\t@prop({ type: String })\r\n\tpublic profilePhoto?: string;\r\n\r\n\t@prop({ type: String, enum: Status, default: Status.ACTIVE })\r\n\tpublic status?: Status;\r\n\r\n\t@prop({ required: true, type: () => [String] })\r\n\tpublic deviceIds!: string[];\r\n\r\n\t@prop({ type: String })\r\n\tpublic stripeCustomerId?: string;\r\n\r\n\t@prop({ type: Number, default: 0 })\r\n\tpublic RewardPoints?: number;\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"counter.model.js","sourceRoot":"/","sources":["libraries/mongo/models/counter.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA0D;AAC1D,4EAAqE;AACrE,kDAAsD;AAG/C,IAAM,OAAO,GAAb,MAAM,OAAQ,SAAQ,2BAAU;IAE/B,WAAW,CAAe;IAG1B,KAAK,CAAU;CACtB,CAAA;AANY,0BAAO;AAEZ;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,kBAAW,EAAE,CAAC;;4CACvC;AAG1B;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;sCACf;kBALV,OAAO;IADnB,IAAA,wBAAY,EAAC,EAAE,aAAa,EAAE,EAAE,UAAU,EAAE,UAAU,EAAE,EAAE,CAAC;GAC/C,OAAO,CAMnB","sourcesContent":["import { modelOptions, prop } from '@typegoose/typegoose';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\nimport { CounterType } from '../../../utilities/enum';\n\n@modelOptions({ schemaOptions: { collection: 'counters' } })\nexport class Counter extends TimeStamps {\n\t@prop({ required: true, unique: true, type: String, enum: CounterType })\n\tpublic counterType!: CounterType;\n\n\t@prop({ required: true, default: 0 })\n\tpublic value!: number;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"counter.model.js","sourceRoot":"/","sources":["libraries/mongo/models/counter.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA0D;AAC1D,4EAAqE;AACrE,kDAAsD;AAG/C,IAAM,OAAO,GAAb,MAAM,OAAQ,SAAQ,2BAAU;IAE/B,WAAW,CAAe;IAG1B,KAAK,CAAU;CACtB,CAAA;AANY,0BAAO;AAEZ;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,kBAAW,EAAE,CAAC;;4CACvC;AAG1B;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;sCACf;kBALV,OAAO;IADnB,IAAA,wBAAY,EAAC,EAAE,aAAa,EAAE,EAAE,UAAU,EAAE,UAAU,EAAE,EAAE,CAAC;GAC/C,OAAO,CAMnB","sourcesContent":["import { modelOptions, prop } from '@typegoose/typegoose';\r\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\r\nimport { CounterType } from '../../../utilities/enum';\r\n\r\n@modelOptions({ schemaOptions: { collection: 'counters' } })\r\nexport class Counter extends TimeStamps {\r\n\t@prop({ required: true, unique: true, type: String, enum: CounterType })\r\n\tpublic counterType!: CounterType;\r\n\r\n\t@prop({ required: true, default: 0 })\r\n\tpublic value!: number;\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"coupon.model.js","sourceRoot":"/","sources":["libraries/mongo/models/coupon.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA+D;AAC/D,4EAAqE;AACrE,kDAAqD;AAK9C,IAAM,MAAM,GAAZ,MAAM,MAAO,SAAQ,2BAAU;IAE9B,IAAI,CAAU;IAGd,UAAU,CAAc;IAGxB,iBAAiB,CAAiB;IAGlC,gBAAgB,CAAiB;IAGjC,cAAc,CAAe;CACpC,CAAA;AAfY,wBAAM;AAEX;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;oCAC/C;AAGd;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,iBAAU,EAAE,CAAC;;0CAC1B;AAGxB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;iDACG;AAGlC;IADN,IAAA,gBAAI,EAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,MAAM,EAAE,CAAC;;gDACY;AAGjC;IADN,IAAA,gBAAI,EAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,MAAM,EAAE,CAAC;;8CACQ;iBAdxB,MAAM;IAHlB,IAAA,wBAAY,EAAC;QACb,aAAa,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,gBAAgB,EAAE,YAAY,EAAE;KACxE,CAAC;GACW,MAAM,CAelB","sourcesContent":["import { modelOptions, prop, Ref } from '@typegoose/typegoose';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\nimport { CouponType } from '../../../utilities/enum';\n\n@modelOptions({\n\tschemaOptions: { collection: 'coupons', discriminatorKey: 'couponType' },\n})\nexport class Coupon extends TimeStamps {\n\t@prop({ required: true, uppercase: true, trim: true, type: String })\n\tpublic code!: string;\n\n\t@prop({ required: true, type: String, enum: CouponType })\n\tpublic couponType!: CouponType;\n\n\t@prop({ type: Number, default: null })\n\tpublic orderLimitPerUser?: number | null;\n\n\t@prop({ ref: () => Coupon })\n\tpublic previousVersions?: Ref<Coupon>[];\n\n\t@prop({ ref: () => Coupon })\n\tpublic updatedVersion?: Ref<Coupon>;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"coupon.model.js","sourceRoot":"/","sources":["libraries/mongo/models/coupon.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA+D;AAC/D,4EAAqE;AACrE,kDAAqD;AAK9C,IAAM,MAAM,GAAZ,MAAM,MAAO,SAAQ,2BAAU;IAE9B,IAAI,CAAU;IAGd,UAAU,CAAc;IAGxB,iBAAiB,CAAiB;IAGlC,gBAAgB,CAAiB;IAGjC,cAAc,CAAe;CACpC,CAAA;AAfY,wBAAM;AAEX;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;oCAC/C;AAGd;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,iBAAU,EAAE,CAAC;;0CAC1B;AAGxB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;iDACG;AAGlC;IADN,IAAA,gBAAI,EAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,MAAM,EAAE,CAAC;;gDACY;AAGjC;IADN,IAAA,gBAAI,EAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,MAAM,EAAE,CAAC;;8CACQ;iBAdxB,MAAM;IAHlB,IAAA,wBAAY,EAAC;QACb,aAAa,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,gBAAgB,EAAE,YAAY,EAAE;KACxE,CAAC;GACW,MAAM,CAelB","sourcesContent":["import { modelOptions, prop, Ref } from '@typegoose/typegoose';\r\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\r\nimport { CouponType } from '../../../utilities/enum';\r\n\r\n@modelOptions({\r\n\tschemaOptions: { collection: 'coupons', discriminatorKey: 'couponType' },\r\n})\r\nexport class Coupon extends TimeStamps {\r\n\t@prop({ required: true, uppercase: true, trim: true, type: String })\r\n\tpublic code!: string;\r\n\r\n\t@prop({ required: true, type: String, enum: CouponType })\r\n\tpublic couponType!: CouponType;\r\n\r\n\t@prop({ type: Number, default: null })\r\n\tpublic orderLimitPerUser?: number | null;\r\n\r\n\t@prop({ ref: () => Coupon })\r\n\tpublic previousVersions?: Ref<Coupon>[];\r\n\r\n\t@prop({ ref: () => Coupon })\r\n\tpublic updatedVersion?: Ref<Coupon>;\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deal-setting.model.js","sourceRoot":"/","sources":["libraries/mongo/models/deal-setting.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA0D;AAC1D,4EAAqE;AACrE,kDAAmD;AAG5C,IAAM,WAAW,GAAjB,MAAM,WAAY,SAAQ,2BAAU;IAEnC,QAAQ,CAAY;IAGpB,iBAAiB,CAAY;IAG7B,UAAU,CAAW;IAGrB,UAAU,CAAW;IAGrB,cAAc,CAAW;IAGzB,gBAAgB,CAAW;CAClC,CAAA;AAlBY,kCAAW;AAEhB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,eAAQ,EAAE,CAAC;;6CAC5B;AAGpB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;;sDACF;AAG7B;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;+CACX;AAGrB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;+CACX;AAGrB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;mDACP;AAGzB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;qDACL;sBAjBtB,WAAW;IADvB,IAAA,wBAAY,EAAC,EAAE,aAAa,EAAE,EAAE,UAAU,EAAE,cAAc,EAAE,EAAE,CAAC;GACnD,WAAW,CAkBvB","sourcesContent":["import { modelOptions, prop } from '@typegoose/typegoose';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\nimport { ItemType } from '../../../utilities/enum';\n\n@modelOptions({ schemaOptions: { collection: 'dealSettings' } })\nexport class DealSetting extends TimeStamps {\n\t@prop({ required: true, type: String, enum: ItemType })\n\tpublic itemType?: ItemType;\n\n\t@prop({ type: [Number], default: [] })\n\tpublic percentageBundles?: number[];\n\n\t@prop({ type: Boolean, default: true })\n\tpublic isDiscount?: boolean;\n\n\t@prop({ type: Boolean, default: true })\n\tpublic isBuy1Get1?: boolean;\n\n\t@prop({ type: Boolean, default: true })\n\tpublic isFreeDelivery?: boolean;\n\n\t@prop({ type: Boolean, default: true })\n\tpublic isPunchMarketing?: boolean;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"deal-setting.model.js","sourceRoot":"/","sources":["libraries/mongo/models/deal-setting.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA0D;AAC1D,4EAAqE;AACrE,kDAAmD;AAG5C,IAAM,WAAW,GAAjB,MAAM,WAAY,SAAQ,2BAAU;IAEnC,QAAQ,CAAY;IAGpB,iBAAiB,CAAY;IAG7B,UAAU,CAAW;IAGrB,UAAU,CAAW;IAGrB,cAAc,CAAW;IAGzB,gBAAgB,CAAW;CAClC,CAAA;AAlBY,kCAAW;AAEhB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,eAAQ,EAAE,CAAC;;6CAC5B;AAGpB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;;sDACF;AAG7B;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;+CACX;AAGrB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;+CACX;AAGrB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;mDACP;AAGzB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;qDACL;sBAjBtB,WAAW;IADvB,IAAA,wBAAY,EAAC,EAAE,aAAa,EAAE,EAAE,UAAU,EAAE,cAAc,EAAE,EAAE,CAAC;GACnD,WAAW,CAkBvB","sourcesContent":["import { modelOptions, prop } from '@typegoose/typegoose';\r\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\r\nimport { ItemType } from '../../../utilities/enum';\r\n\r\n@modelOptions({ schemaOptions: { collection: 'dealSettings' } })\r\nexport class DealSetting extends TimeStamps {\r\n\t@prop({ required: true, type: String, enum: ItemType })\r\n\tpublic itemType?: ItemType;\r\n\r\n\t@prop({ type: [Number], default: [] })\r\n\tpublic percentageBundles?: number[];\r\n\r\n\t@prop({ type: Boolean, default: true })\r\n\tpublic isDiscount?: boolean;\r\n\r\n\t@prop({ type: Boolean, default: true })\r\n\tpublic isBuy1Get1?: boolean;\r\n\r\n\t@prop({ type: Boolean, default: true })\r\n\tpublic isFreeDelivery?: boolean;\r\n\r\n\t@prop({ type: Boolean, default: true })\r\n\tpublic isPunchMarketing?: boolean;\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"default-chat.model.js","sourceRoot":"/","sources":["libraries/mongo/models/default-chat.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA0D;AAC1D,4EAAqE;AAG9D,IAAM,WAAW,GAAjB,MAAM,WAAY,SAAQ,2BAAU;IAEnC,IAAI,CAAS;CACpB,CAAA;AAHY,kCAAW;AAEhB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;yCACnB;sBAFR,WAAW;IADvB,IAAA,wBAAY,EAAC,EAAE,aAAa,EAAE,EAAE,UAAU,EAAE,cAAc,EAAE,UAAU,EAAE,IAAI,EAAE,EAAE,CAAC;GACrE,WAAW,CAGvB","sourcesContent":["import { modelOptions, prop } from '@typegoose/typegoose';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\n\n@modelOptions({ schemaOptions: { collection: 'default-chat', timestamps: true } })\nexport class DefaultChat extends TimeStamps {\n\t@prop({ required: true, type: String })\n\tpublic text: string;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"default-chat.model.js","sourceRoot":"/","sources":["libraries/mongo/models/default-chat.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA0D;AAC1D,4EAAqE;AAG9D,IAAM,WAAW,GAAjB,MAAM,WAAY,SAAQ,2BAAU;IAEnC,IAAI,CAAS;CACpB,CAAA;AAHY,kCAAW;AAEhB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;yCACnB;sBAFR,WAAW;IADvB,IAAA,wBAAY,EAAC,EAAE,aAAa,EAAE,EAAE,UAAU,EAAE,cAAc,EAAE,UAAU,EAAE,IAAI,EAAE,EAAE,CAAC;GACrE,WAAW,CAGvB","sourcesContent":["import { modelOptions, prop } from '@typegoose/typegoose';\r\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\r\n\r\n@modelOptions({ schemaOptions: { collection: 'default-chat', timestamps: true } })\r\nexport class DefaultChat extends TimeStamps {\r\n\t@prop({ required: true, type: String })\r\n\tpublic text: string;\r\n}\r\n"]}
|