/******/ (() => { // webpackBootstrap
/******/ 	"use strict";
/******/ 	var __webpack_modules__ = ({

/***/ "./apps/auth/src/merchantuser/merchantuser.entity.ts":
/*!***********************************************************!*\
  !*** ./apps/auth/src/merchantuser/merchantuser.entity.ts ***!
  \***********************************************************/
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {


var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.Marchantuser = void 0;
const typeorm_1 = __webpack_require__(/*! typeorm */ "typeorm");
let Marchantuser = class Marchantuser extends typeorm_1.BaseEntity {
};
exports.Marchantuser = Marchantuser;
__decorate([
    (0, typeorm_1.PrimaryGeneratedColumn)({
        comment: 'the unique identifier',
    }),
    __metadata("design:type", Number)
], Marchantuser.prototype, "idMarchant_User", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'varchar',
        length: 255,
        nullable: false,
    }),
    __metadata("design:type", String)
], Marchantuser.prototype, "Full_Name", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'varchar',
        length: 255,
        nullable: false,
        unique: true,
    }),
    __metadata("design:type", String)
], Marchantuser.prototype, "Email", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'varchar',
        length: 255,
        nullable: false,
        unique: false,
    }),
    __metadata("design:type", String)
], Marchantuser.prototype, "Contact_no", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'varchar',
        length: 255,
        nullable: false,
    }),
    __metadata("design:type", String)
], Marchantuser.prototype, "Password", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'varchar',
        length: 255,
        nullable: true,
    }),
    __metadata("design:type", String)
], Marchantuser.prototype, "OTP", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'varchar',
        length: 255,
        nullable: true,
    }),
    __metadata("design:type", String)
], Marchantuser.prototype, "OTP_Time", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'int',
    }),
    __metadata("design:type", Number)
], Marchantuser.prototype, "Marchant_Location_idMarchant_Location", void 0);
exports.Marchantuser = Marchantuser = __decorate([
    (0, typeorm_1.Entity)('marchant_user')
], Marchantuser);


/***/ }),

/***/ "./apps/auth/src/user/user.entity.ts":
/*!*******************************************!*\
  !*** ./apps/auth/src/user/user.entity.ts ***!
  \*******************************************/
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {


var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var _a;
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.User = void 0;
const typeorm_1 = __webpack_require__(/*! typeorm */ "typeorm");
let User = class User extends typeorm_1.BaseEntity {
};
exports.User = User;
__decorate([
    (0, typeorm_1.PrimaryGeneratedColumn)({
        comment: 'the unique identifier',
    }),
    __metadata("design:type", Number)
], User.prototype, "idUser", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'varchar',
        length: 255,
        nullable: false,
    }),
    __metadata("design:type", String)
], User.prototype, "Full_Name", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'varchar',
        length: 255,
        nullable: false,
        unique: true,
    }),
    __metadata("design:type", String)
], User.prototype, "Email", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'varchar',
        length: 255,
        nullable: false,
    }),
    __metadata("design:type", String)
], User.prototype, "Password", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'varchar',
        length: 255,
        nullable: true,
    }),
    __metadata("design:type", String)
], User.prototype, "OTP", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'varchar',
        length: 255,
        nullable: true,
    }),
    __metadata("design:type", String)
], User.prototype, "OTP_Time", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'varchar',
        length: 255,
        nullable: true,
        default: '1',
    }),
    __metadata("design:type", String)
], User.prototype, "Status", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'varchar',
        length: 255,
        nullable: true,
        default: '1',
    }),
    __metadata("design:type", String)
], User.prototype, "Previlage_Status", void 0);
__decorate([
    (0, typeorm_1.CreateDateColumn)(),
    __metadata("design:type", typeof (_a = typeof Date !== "undefined" && Date) === "function" ? _a : Object)
], User.prototype, "CreatedAt", void 0);
exports.User = User = __decorate([
    (0, typeorm_1.Entity)('user')
], User);


/***/ }),

/***/ "./apps/customer/src/customer.entity.ts":
/*!**********************************************!*\
  !*** ./apps/customer/src/customer.entity.ts ***!
  \**********************************************/
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {


var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.Customer = void 0;
const typeorm_1 = __webpack_require__(/*! typeorm */ "typeorm");
let Customer = class Customer extends typeorm_1.BaseEntity {
};
exports.Customer = Customer;
__decorate([
    (0, typeorm_1.PrimaryGeneratedColumn)({
        comment: 'the unique identifier',
    }),
    __metadata("design:type", Number)
], Customer.prototype, "idCustomer", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'varchar',
        length: 45,
        nullable: true,
    }),
    __metadata("design:type", String)
], Customer.prototype, "Customer_Code", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'varchar',
        length: 45,
        nullable: true,
    }),
    __metadata("design:type", String)
], Customer.prototype, "Contact_No", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'varchar',
        length: 45,
        nullable: false,
    }),
    __metadata("design:type", String)
], Customer.prototype, "First_Name", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'varchar',
        length: 45,
        nullable: false,
    }),
    __metadata("design:type", String)
], Customer.prototype, "Last_Name", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'varchar',
        length: 45,
        nullable: false,
    }),
    __metadata("design:type", String)
], Customer.prototype, "Email", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'varchar',
        length: 45,
        nullable: false,
    }),
    __metadata("design:type", String)
], Customer.prototype, "Password", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'varchar',
        length: 45,
        nullable: false,
    }),
    __metadata("design:type", String)
], Customer.prototype, "NIC", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'varchar',
        length: 45,
        nullable: false,
    }),
    __metadata("design:type", String)
], Customer.prototype, "DOB", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'varchar',
        length: 45,
        nullable: true,
    }),
    __metadata("design:type", String)
], Customer.prototype, "Province", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'varchar',
        length: 45,
        nullable: false,
    }),
    __metadata("design:type", String)
], Customer.prototype, "District", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'varchar',
        length: 45,
        nullable: false,
    }),
    __metadata("design:type", String)
], Customer.prototype, "City", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'varchar',
        length: 945,
        nullable: false,
    }),
    __metadata("design:type", String)
], Customer.prototype, "Street_Address", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'varchar',
        length: 45,
        nullable: false,
    }),
    __metadata("design:type", String)
], Customer.prototype, "PIN_Code", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'varchar',
        length: 45,
        nullable: false,
    }),
    __metadata("design:type", String)
], Customer.prototype, "Registered_Device", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'varchar',
        length: 45,
        nullable: false,
    }),
    __metadata("design:type", String)
], Customer.prototype, "Joined_Date", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'varchar',
        length: 45,
        nullable: false,
        default: '0',
    }),
    __metadata("design:type", String)
], Customer.prototype, "Status", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'varchar',
        length: 945,
        nullable: false,
    }),
    __metadata("design:type", String)
], Customer.prototype, "Salary_Slip_Path", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'varchar',
        length: 45,
        nullable: false,
        default: '0',
    }),
    __metadata("design:type", String)
], Customer.prototype, "Salary_Slip_Verification_Status", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'varchar',
        length: 945,
        nullable: true,
    }),
    __metadata("design:type", String)
], Customer.prototype, "NIC_Front_Path", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'varchar',
        length: 45,
        nullable: false,
        default: '0',
    }),
    __metadata("design:type", String)
], Customer.prototype, "NIC_Front_Verification_Status", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'varchar',
        length: 945,
        nullable: false,
    }),
    __metadata("design:type", String)
], Customer.prototype, "NIC_Back_Path", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'varchar',
        length: 45,
        nullable: false,
        default: '0',
    }),
    __metadata("design:type", String)
], Customer.prototype, "NIC_Back_Verification_Status", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'varchar',
        length: 945,
        nullable: true,
    }),
    __metadata("design:type", String)
], Customer.prototype, "Utility_Bill_Path", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'varchar',
        length: 45,
        nullable: false,
        default: '0',
    }),
    __metadata("design:type", String)
], Customer.prototype, "Utility_Bill_Verification_Status", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'varchar',
        length: 945,
        nullable: true,
    }),
    __metadata("design:type", String)
], Customer.prototype, "Photo_Path", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'varchar',
        length: 45,
        nullable: true,
        default: '0',
    }),
    __metadata("design:type", String)
], Customer.prototype, "Photo_Verification_Status", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'varchar',
        length: 45,
        nullable: true,
    }),
    __metadata("design:type", String)
], Customer.prototype, "Credit_Limit", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'varchar',
        length: 45,
        nullable: false,
        default: '0',
    }),
    __metadata("design:type", String)
], Customer.prototype, "Flag_Status", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'varchar',
        length: 45,
        nullable: false,
        default: '0',
    }),
    __metadata("design:type", String)
], Customer.prototype, "Freeze_Status", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'varchar',
        length: 45,
        nullable: true,
    }),
    __metadata("design:type", String)
], Customer.prototype, "OTP", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'varchar',
        length: 45,
        nullable: true,
    }),
    __metadata("design:type", String)
], Customer.prototype, "OTP_Time", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'varchar',
        length: 45,
        nullable: true,
    }),
    __metadata("design:type", String)
], Customer.prototype, "Pro_Status", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'varchar',
        length: 45,
        nullable: true,
    }),
    __metadata("design:type", String)
], Customer.prototype, "Referral_Code", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'varchar',
        length: 45,
        nullable: true,
    }),
    __metadata("design:type", String)
], Customer.prototype, "Current_mode", void 0);
exports.Customer = Customer = __decorate([
    (0, typeorm_1.Entity)('customer')
], Customer);


/***/ }),

/***/ "./apps/merchant/src/location/location.controller.ts":
/*!***********************************************************!*\
  !*** ./apps/merchant/src/location/location.controller.ts ***!
  \***********************************************************/
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {


var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var _a, _b, _c, _d, _e;
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.LocationController = void 0;
const common_1 = __webpack_require__(/*! @nestjs/common */ "@nestjs/common");
const microservices_1 = __webpack_require__(/*! @nestjs/microservices */ "@nestjs/microservices");
const location_service_1 = __webpack_require__(/*! ./location.service */ "./apps/merchant/src/location/location.service.ts");
let LocationController = class LocationController {
    constructor(locationDbService) {
        this.locationDbService = locationDbService;
    }
    async getAll() {
        return await this.locationDbService.getAll();
    }
    async getById(data) {
        const { id } = data;
        return await this.locationDbService.getById(id);
    }
    async createMerchantLocation(data) {
        const { body } = data;
        return this.locationDbService.createMerchantLocation(body);
    }
    async updateLocation(data) {
        return await this.locationDbService.updateMerchantLocation(data.id, data.body);
    }
};
exports.LocationController = LocationController;
__decorate([
    (0, microservices_1.MessagePattern)({ cmd: 'merchant_location_get_all' }),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", []),
    __metadata("design:returntype", typeof (_b = typeof Promise !== "undefined" && Promise) === "function" ? _b : Object)
], LocationController.prototype, "getAll", null);
__decorate([
    (0, microservices_1.MessagePattern)({ cmd: 'merchant_location_get_by_id' }),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [Object]),
    __metadata("design:returntype", typeof (_c = typeof Promise !== "undefined" && Promise) === "function" ? _c : Object)
], LocationController.prototype, "getById", null);
__decorate([
    (0, microservices_1.MessagePattern)({ cmd: 'merchant_location_add' }),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [Object]),
    __metadata("design:returntype", typeof (_d = typeof Promise !== "undefined" && Promise) === "function" ? _d : Object)
], LocationController.prototype, "createMerchantLocation", null);
__decorate([
    (0, microservices_1.MessagePattern)({ cmd: 'merchant_location_update' }),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [Object]),
    __metadata("design:returntype", typeof (_e = typeof Promise !== "undefined" && Promise) === "function" ? _e : Object)
], LocationController.prototype, "updateLocation", null);
exports.LocationController = LocationController = __decorate([
    (0, common_1.Controller)(),
    __metadata("design:paramtypes", [typeof (_a = typeof location_service_1.LocationService !== "undefined" && location_service_1.LocationService) === "function" ? _a : Object])
], LocationController);


/***/ }),

/***/ "./apps/merchant/src/location/location.entity.ts":
/*!*******************************************************!*\
  !*** ./apps/merchant/src/location/location.entity.ts ***!
  \*******************************************************/
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {


var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.MerchantLocation = void 0;
const typeorm_1 = __webpack_require__(/*! typeorm */ "typeorm");
let MerchantLocation = class MerchantLocation extends typeorm_1.BaseEntity {
};
exports.MerchantLocation = MerchantLocation;
__decorate([
    (0, typeorm_1.PrimaryGeneratedColumn)({
        comment: 'the unique identifier',
    }),
    __metadata("design:type", Number)
], MerchantLocation.prototype, "idMerchant_Location", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'varchar',
        length: 255,
        nullable: false,
    }),
    __metadata("design:type", String)
], MerchantLocation.prototype, "Description", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'text',
        nullable: true,
    }),
    __metadata("design:type", String)
], MerchantLocation.prototype, "Address", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'varchar',
        length: 255,
        nullable: false,
    }),
    __metadata("design:type", String)
], MerchantLocation.prototype, "Address_Link", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'int',
        nullable: false,
    }),
    __metadata("design:type", Number)
], MerchantLocation.prototype, "Merchant_idMerchant", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'text',
        nullable: true,
    }),
    __metadata("design:type", String)
], MerchantLocation.prototype, "Note", void 0);
exports.MerchantLocation = MerchantLocation = __decorate([
    (0, typeorm_1.Entity)('merchant_location')
], MerchantLocation);


/***/ }),

/***/ "./apps/merchant/src/location/location.module.ts":
/*!*******************************************************!*\
  !*** ./apps/merchant/src/location/location.module.ts ***!
  \*******************************************************/
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {


var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.LocationModule = void 0;
const common_1 = __webpack_require__(/*! @nestjs/common */ "@nestjs/common");
const location_controller_1 = __webpack_require__(/*! ./location.controller */ "./apps/merchant/src/location/location.controller.ts");
const location_service_1 = __webpack_require__(/*! ./location.service */ "./apps/merchant/src/location/location.service.ts");
const config_1 = __webpack_require__(/*! @nestjs/config */ "@nestjs/config");
const typeorm_1 = __webpack_require__(/*! @app/typeorm */ "./libs/typeorm/src/index.ts");
const typeorm_2 = __webpack_require__(/*! @nestjs/typeorm */ "@nestjs/typeorm");
const location_entity_1 = __webpack_require__(/*! ./location.entity */ "./apps/merchant/src/location/location.entity.ts");
let LocationModule = class LocationModule {
};
exports.LocationModule = LocationModule;
exports.LocationModule = LocationModule = __decorate([
    (0, common_1.Module)({
        imports: [
            config_1.ConfigModule.forRoot(),
            typeorm_1.TypeOrmSharedModule,
            typeorm_2.TypeOrmModule.forFeature([location_entity_1.MerchantLocation]),
        ],
        controllers: [location_controller_1.LocationController],
        providers: [location_service_1.LocationService],
        exports: [location_service_1.LocationService],
    })
], LocationModule);


/***/ }),

/***/ "./apps/merchant/src/location/location.service.ts":
/*!********************************************************!*\
  !*** ./apps/merchant/src/location/location.service.ts ***!
  \********************************************************/
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {


var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var __param = (this && this.__param) || function (paramIndex, decorator) {
    return function (target, key) { decorator(target, key, paramIndex); }
};
var _a;
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.LocationService = void 0;
const common_1 = __webpack_require__(/*! @nestjs/common */ "@nestjs/common");
const typeorm_1 = __webpack_require__(/*! @nestjs/typeorm */ "@nestjs/typeorm");
const location_entity_1 = __webpack_require__(/*! ./location.entity */ "./apps/merchant/src/location/location.entity.ts");
const typeorm_2 = __webpack_require__(/*! typeorm */ "typeorm");
let LocationService = class LocationService {
    constructor(merchantLocationRepo) {
        this.merchantLocationRepo = merchantLocationRepo;
    }
    async getAll() {
        const data = await this.merchantLocationRepo.find();
        return data;
    }
    async getById(id) {
        return await this.merchantLocationRepo.findOneBy({
            idMerchant_Location: id,
        });
    }
    async createMerchantLocation(body) {
        const location = this.merchantLocationRepo.create(body);
        const data = await this.merchantLocationRepo.save(location);
        return {
            data: data,
            message: 'Location creation completed!',
        };
    }
    async updateMerchantLocation(id, body) {
        const existing = await this.merchantLocationRepo.findOneBy({
            idMerchant_Location: id,
        });
        if (!existing) {
            throw new Error('Location not found');
        }
        const updated = Object.assign(existing, body);
        const saved = await this.merchantLocationRepo.save(updated);
        return {
            data: saved,
            message: 'Location updated successfully!',
        };
    }
};
exports.LocationService = LocationService;
exports.LocationService = LocationService = __decorate([
    (0, common_1.Injectable)(),
    __param(0, (0, typeorm_1.InjectRepository)(location_entity_1.MerchantLocation)),
    __metadata("design:paramtypes", [typeof (_a = typeof typeorm_2.Repository !== "undefined" && typeorm_2.Repository) === "function" ? _a : Object])
], LocationService);


/***/ }),

/***/ "./apps/merchant/src/merchant-has-category/merchant-has-category.controller.ts":
/*!*************************************************************************************!*\
  !*** ./apps/merchant/src/merchant-has-category/merchant-has-category.controller.ts ***!
  \*************************************************************************************/
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {


var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.MerchantHasCategoryController = void 0;
const common_1 = __webpack_require__(/*! @nestjs/common */ "@nestjs/common");
let MerchantHasCategoryController = class MerchantHasCategoryController {
};
exports.MerchantHasCategoryController = MerchantHasCategoryController;
exports.MerchantHasCategoryController = MerchantHasCategoryController = __decorate([
    (0, common_1.Controller)('merchant-has-category')
], MerchantHasCategoryController);


/***/ }),

/***/ "./apps/merchant/src/merchant-has-category/merchant-has-category.entity.ts":
/*!*********************************************************************************!*\
  !*** ./apps/merchant/src/merchant-has-category/merchant-has-category.entity.ts ***!
  \*********************************************************************************/
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {


var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.MerchantHasCategories = void 0;
const typeorm_1 = __webpack_require__(/*! typeorm */ "typeorm");
let MerchantHasCategories = class MerchantHasCategories extends typeorm_1.BaseEntity {
};
exports.MerchantHasCategories = MerchantHasCategories;
__decorate([
    (0, typeorm_1.PrimaryGeneratedColumn)({
        comment: 'the unique identifier',
    }),
    __metadata("design:type", Number)
], MerchantHasCategories.prototype, "idMerchantHasCategory", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'int',
        nullable: false,
    }),
    __metadata("design:type", Number)
], MerchantHasCategories.prototype, "Merchant_idMerchant", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'int',
        nullable: false,
    }),
    __metadata("design:type", Number)
], MerchantHasCategories.prototype, "MerchantCategory_idMerchantCategory", void 0);
exports.MerchantHasCategories = MerchantHasCategories = __decorate([
    (0, typeorm_1.Entity)('merchant_has_categories')
], MerchantHasCategories);


/***/ }),

/***/ "./apps/merchant/src/merchant-has-category/merchant-has-category.module.ts":
/*!*********************************************************************************!*\
  !*** ./apps/merchant/src/merchant-has-category/merchant-has-category.module.ts ***!
  \*********************************************************************************/
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {


var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.MerchantHasCategoryModule = void 0;
const common_1 = __webpack_require__(/*! @nestjs/common */ "@nestjs/common");
const typeorm_1 = __webpack_require__(/*! @nestjs/typeorm */ "@nestjs/typeorm");
const merchant_has_category_entity_1 = __webpack_require__(/*! ./merchant-has-category.entity */ "./apps/merchant/src/merchant-has-category/merchant-has-category.entity.ts");
const merchant_has_category_service_1 = __webpack_require__(/*! ./merchant-has-category.service */ "./apps/merchant/src/merchant-has-category/merchant-has-category.service.ts");
const merchant_has_category_controller_1 = __webpack_require__(/*! ./merchant-has-category.controller */ "./apps/merchant/src/merchant-has-category/merchant-has-category.controller.ts");
let MerchantHasCategoryModule = class MerchantHasCategoryModule {
};
exports.MerchantHasCategoryModule = MerchantHasCategoryModule;
exports.MerchantHasCategoryModule = MerchantHasCategoryModule = __decorate([
    (0, common_1.Module)({
        imports: [typeorm_1.TypeOrmModule.forFeature([merchant_has_category_entity_1.MerchantHasCategories])],
        providers: [merchant_has_category_service_1.MerchantHasCategoryService],
        controllers: [merchant_has_category_controller_1.MerchantHasCategoryController],
        exports: [merchant_has_category_service_1.MerchantHasCategoryService],
    })
], MerchantHasCategoryModule);


/***/ }),

/***/ "./apps/merchant/src/merchant-has-category/merchant-has-category.service.ts":
/*!**********************************************************************************!*\
  !*** ./apps/merchant/src/merchant-has-category/merchant-has-category.service.ts ***!
  \**********************************************************************************/
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {


var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var __param = (this && this.__param) || function (paramIndex, decorator) {
    return function (target, key) { decorator(target, key, paramIndex); }
};
var _a;
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.MerchantHasCategoryService = void 0;
const common_1 = __webpack_require__(/*! @nestjs/common */ "@nestjs/common");
const typeorm_1 = __webpack_require__(/*! @nestjs/typeorm */ "@nestjs/typeorm");
const merchant_has_category_entity_1 = __webpack_require__(/*! ./merchant-has-category.entity */ "./apps/merchant/src/merchant-has-category/merchant-has-category.entity.ts");
const typeorm_2 = __webpack_require__(/*! typeorm */ "typeorm");
let MerchantHasCategoryService = class MerchantHasCategoryService {
    constructor(merchantHasCategoryRepo) {
        this.merchantHasCategoryRepo = merchantHasCategoryRepo;
    }
    async addMerchantHasCategories(Merchant_idMerchant, MerchantCategory_idMerchantCategory) {
        const merchantHasCategory = this.merchantHasCategoryRepo.create({
            Merchant_idMerchant,
            MerchantCategory_idMerchantCategory,
        });
        const data = await this.merchantHasCategoryRepo.save(merchantHasCategory);
        return data;
    }
    async deleteExistingCategoriesById(id) {
        const deleteit = await this.merchantHasCategoryRepo.delete({
            Merchant_idMerchant: id,
        });
        return {
            message: 'Merchant has categories deleted successfully!',
            affected: deleteit,
        };
    }
    async getMerchantHasCategoriesByMerchantId(Merchant_idMerchant) {
        console.log('The merchgant id in srvice : ', Merchant_idMerchant);
        const fetchedData = await this.merchantHasCategoryRepo.query(`SELECT mhc.*,mc.Description FROM merchant_has_categories mhc INNER JOIN merchant_category mc ON mhc.MerchantCategory_idMerchantCategory = mc.idMerchantCategory WHERE mhc.Merchant_idMerchant = ?`, [Merchant_idMerchant]);
        console.log(fetchedData);
        return fetchedData;
    }
};
exports.MerchantHasCategoryService = MerchantHasCategoryService;
exports.MerchantHasCategoryService = MerchantHasCategoryService = __decorate([
    (0, common_1.Injectable)(),
    __param(0, (0, typeorm_1.InjectRepository)(merchant_has_category_entity_1.MerchantHasCategories)),
    __metadata("design:paramtypes", [typeof (_a = typeof typeorm_2.Repository !== "undefined" && typeorm_2.Repository) === "function" ? _a : Object])
], MerchantHasCategoryService);


/***/ }),

/***/ "./apps/merchant/src/merchant.controller.ts":
/*!**************************************************!*\
  !*** ./apps/merchant/src/merchant.controller.ts ***!
  \**************************************************/
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {


var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var _a, _b, _c, _d, _e, _f, _g;
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.MerchantController = void 0;
const common_1 = __webpack_require__(/*! @nestjs/common */ "@nestjs/common");
const merchant_service_1 = __webpack_require__(/*! ./merchant.service */ "./apps/merchant/src/merchant.service.ts");
const merchantdocuments_service_1 = __webpack_require__(/*! ./merchantdocuments/merchantdocuments.service */ "./apps/merchant/src/merchantdocuments/merchantdocuments.service.ts");
const microservices_1 = __webpack_require__(/*! @nestjs/microservices */ "@nestjs/microservices");
const merchant_has_category_service_1 = __webpack_require__(/*! ./merchant-has-category/merchant-has-category.service */ "./apps/merchant/src/merchant-has-category/merchant-has-category.service.ts");
let MerchantController = class MerchantController {
    constructor(merchantService, merchantDocumentsService, merchantHasCategoriesService) {
        this.merchantService = merchantService;
        this.merchantDocumentsService = merchantDocumentsService;
        this.merchantHasCategoriesService = merchantHasCategoriesService;
    }
    async getAll(data) {
        const { protocol, host } = data;
        console.log('The host is :', host);
        const baseUrl = `${protocol}://${host}/uploads/merchant/`;
        const baseUrl2 = `${protocol}://${host}/uploads/merchant/documents/`;
        const merchants = await this.merchantService.getAll();
        const allDocuments = await this.merchantDocumentsService.findAll();
        const merchantsWithDetails = await Promise.all(merchants.map(async (merchant) => {
            const logoUrl = merchant.Logo_Path
                ? baseUrl + merchant.Logo_Path
                : null;
            const merchantDocs = allDocuments
                .filter((doc) => doc.Merchant_idMerchant === merchant.idMerchant)
                .map((doc) => ({
                ...doc,
                Path_Link: baseUrl2 + doc.Path,
            }));
            const merchant_Has_categories = await this.merchantHasCategoriesService.getMerchantHasCategoriesByMerchantId(merchant.idMerchant);
            return {
                ...merchant,
                Logo_Path_Link: logoUrl,
                Documents: merchantDocs,
                merchant_Has_categories,
            };
        }));
        return merchantsWithDetails;
    }
    async getById(data) {
        const protocol = data.protocol;
        const host = data.host;
        console.log('The host is :', host);
        const id = data.id;
        const baseLogoUrl = `${protocol}://${host}/uploads/merchant/`;
        const baseDocUrl = `${protocol}://${host}/uploads/merchant/documents/`;
        const merchant = await this.merchantService.getById(id);
        if (!merchant) {
            throw new common_1.NotFoundException('Merchant not found');
        }
        const logoUrl = merchant.Logo_Path
            ? baseLogoUrl + merchant.Logo_Path
            : null;
        const documents = await this.merchantDocumentsService.findByMerchantId(id);
        const documentList = documents.map((doc) => ({
            ...doc,
            Path_Link: doc.Path ? baseDocUrl + doc.Path : null,
        }));
        const merchant_Has_categories = await this.merchantHasCategoriesService.getMerchantHasCategoriesByMerchantId(id);
        return {
            ...merchant,
            Logo_Path_Link: logoUrl,
            Documents: documentList,
            merchant_Has_categories,
        };
    }
    async create(data) {
        const { body, files, merchantCategory } = data;
        console.log('Merchant category in 110 : ', merchantCategory);
        const logo = files.Logo?.[0];
        const documentFiles = files.documents || [];
        const documentsMetadata = JSON.parse(body.documentMetadata || '[]');
        const createdMerchant = await this.merchantService.create(body, logo);
        console.log('create it ', createdMerchant);
        if (documentFiles.length > 0) {
            await Promise.all(documentFiles.map((file, index) => {
                const documentDto = {
                    fileName: file.filename,
                    description: documentsMetadata[index]?.Description || '',
                    merchantId: createdMerchant.idMerchant,
                };
                return this.merchantDocumentsService.addMerchantDocuments(documentDto);
            }));
        }
        let parsedMerchantCategory = [];
        if (typeof merchantCategory === 'string') {
            try {
                parsedMerchantCategory = JSON.parse(merchantCategory);
            }
            catch (err) {
                console.error('Invalid merchantCategory string received:', merchantCategory);
            }
        }
        else if (Array.isArray(merchantCategory)) {
            parsedMerchantCategory = merchantCategory;
        }
        if (parsedMerchantCategory.length > 0) {
            await Promise.all(parsedMerchantCategory.map(async (item) => {
                await this.merchantHasCategoriesService.addMerchantHasCategories(createdMerchant.idMerchant, item);
            }));
        }
        return {
            merchant: createdMerchant,
            message: 'Merchant and documents created successfully',
        };
    }
    async update(data) {
        const { id, body, files, merchantCategory } = data;
        const logo = files.Logo?.[0];
        const documentFiles = files.documents || [];
        let documentsMetadata = [];
        try {
            documentsMetadata = JSON.parse(body.documentMetadata || '[]');
        }
        catch (error) {
            console.warn('Invalid JSON in documents:', body.documents);
        }
        let existingDocumentInfo = [];
        try {
            existingDocumentInfo = JSON.parse(body.documents_exist || '[]');
        }
        catch (error) {
            console.warn('Invalid JSON in documents_exist:', body.documents_exist);
        }
        const merchant = await this.merchantService.findById(id);
        console.log('The merchant : ', merchant);
        if (!merchant)
            throw new common_1.NotFoundException('Merchant not found');
        if (logo) {
            body.Logo_Path = logo.filename;
        }
        await this.merchantService.update(id, body);
        const currentDocuments = await this.merchantDocumentsService.findByMerchantId(id);
        await Promise.all(currentDocuments.map((doc) => {
            const match = existingDocumentInfo.find((d) => d.Path === doc.Path);
            if (match && match.Description !== doc.Description) {
                return this.merchantDocumentsService.updateDescriptionById(doc.idMerchant_Document, match.Description);
            }
            return Promise.resolve();
        }));
        const existingPaths = existingDocumentInfo.map((d) => d.Path);
        const docsToDelete = currentDocuments.filter((doc) => !existingPaths.includes(doc.Path));
        await Promise.all(docsToDelete.map((doc) => this.merchantDocumentsService.deleteById(doc.idMerchant_Document)));
        await Promise.all(documentFiles.map((file, index) => {
            const documentDto = {
                fileName: file.filename,
                description: documentsMetadata[index]?.Description || '',
                merchantId: id,
            };
            return this.merchantDocumentsService.addMerchantDocuments(documentDto);
        }));
        let parsedMerchantCategory = [];
        if (typeof merchantCategory === 'string') {
            try {
                parsedMerchantCategory = JSON.parse(merchantCategory);
            }
            catch (err) {
                console.error('Invalid merchantCategory string received:', merchantCategory);
            }
        }
        else if (Array.isArray(merchantCategory)) {
            parsedMerchantCategory = merchantCategory;
        }
        if (parsedMerchantCategory.length > 0) {
            await this.merchantHasCategoriesService.deleteExistingCategoriesById(id);
            await Promise.all(parsedMerchantCategory.map(async (item) => {
                await this.merchantHasCategoriesService.addMerchantHasCategories(id, item);
            }));
        }
        return {
            message: 'Merchant updated successfully',
        };
    }
};
exports.MerchantController = MerchantController;
__decorate([
    (0, microservices_1.MessagePattern)({ cmd: 'merchant_get_all' }),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [Object]),
    __metadata("design:returntype", typeof (_d = typeof Promise !== "undefined" && Promise) === "function" ? _d : Object)
], MerchantController.prototype, "getAll", null);
__decorate([
    (0, microservices_1.MessagePattern)({ cmd: 'merchant_get_by_id' }),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [Object]),
    __metadata("design:returntype", typeof (_e = typeof Promise !== "undefined" && Promise) === "function" ? _e : Object)
], MerchantController.prototype, "getById", null);
__decorate([
    (0, microservices_1.MessagePattern)({ cmd: 'merchant_create' }),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [Object]),
    __metadata("design:returntype", typeof (_f = typeof Promise !== "undefined" && Promise) === "function" ? _f : Object)
], MerchantController.prototype, "create", null);
__decorate([
    (0, microservices_1.MessagePattern)({ cmd: 'merchant_update' }),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [Object]),
    __metadata("design:returntype", typeof (_g = typeof Promise !== "undefined" && Promise) === "function" ? _g : Object)
], MerchantController.prototype, "update", null);
exports.MerchantController = MerchantController = __decorate([
    (0, common_1.Controller)('api/merchant'),
    __metadata("design:paramtypes", [typeof (_a = typeof merchant_service_1.MerchantService !== "undefined" && merchant_service_1.MerchantService) === "function" ? _a : Object, typeof (_b = typeof merchantdocuments_service_1.MerchantdocumentsService !== "undefined" && merchantdocuments_service_1.MerchantdocumentsService) === "function" ? _b : Object, typeof (_c = typeof merchant_has_category_service_1.MerchantHasCategoryService !== "undefined" && merchant_has_category_service_1.MerchantHasCategoryService) === "function" ? _c : Object])
], MerchantController);


/***/ }),

/***/ "./apps/merchant/src/merchant.entity.ts":
/*!**********************************************!*\
  !*** ./apps/merchant/src/merchant.entity.ts ***!
  \**********************************************/
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {


var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.Merchant = void 0;
const typeorm_1 = __webpack_require__(/*! typeorm */ "typeorm");
let Merchant = class Merchant extends typeorm_1.BaseEntity {
};
exports.Merchant = Merchant;
__decorate([
    (0, typeorm_1.PrimaryGeneratedColumn)({
        comment: 'the unique identifier',
    }),
    __metadata("design:type", Number)
], Merchant.prototype, "idMerchant", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'varchar',
        length: 255,
        nullable: false,
    }),
    __metadata("design:type", String)
], Merchant.prototype, "No", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'int',
        nullable: false,
    }),
    __metadata("design:type", Number)
], Merchant.prototype, "Merchant_type_idMerchant_type", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'varchar',
        length: 255,
        nullable: false,
    }),
    __metadata("design:type", String)
], Merchant.prototype, "Description", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'text',
        nullable: false,
    }),
    __metadata("design:type", String)
], Merchant.prototype, "Story", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'varchar',
        length: 45,
        nullable: false,
    }),
    __metadata("design:type", String)
], Merchant.prototype, "Shop_Online_Status", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'varchar',
        length: 45,
        nullable: false,
    }),
    __metadata("design:type", String)
], Merchant.prototype, "Shop_in_Store_Status", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'varchar',
        length: 45,
        nullable: false,
    }),
    __metadata("design:type", String)
], Merchant.prototype, "Fb_Status", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'varchar',
        length: 45,
        nullable: false,
    }),
    __metadata("design:type", String)
], Merchant.prototype, "Instagram_Status", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'varchar',
        length: 45,
        nullable: false,
    }),
    __metadata("design:type", String)
], Merchant.prototype, "Other_Status", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'varchar',
        length: 45,
        nullable: false,
    }),
    __metadata("design:type", String)
], Merchant.prototype, "Other2_Status", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'varchar',
        length: 200,
        nullable: false,
    }),
    __metadata("design:type", String)
], Merchant.prototype, "Logo_Path", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'varchar',
        length: 200,
        nullable: false,
    }),
    __metadata("design:type", String)
], Merchant.prototype, "Owner_Full_Name", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'varchar',
        length: 200,
        nullable: false,
    }),
    __metadata("design:type", String)
], Merchant.prototype, "NIC", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'varchar',
        length: 200,
        nullable: false,
    }),
    __metadata("design:type", String)
], Merchant.prototype, "Email", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'varchar',
        length: 200,
        nullable: false,
    }),
    __metadata("design:type", String)
], Merchant.prototype, "Password", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'varchar',
        length: 200,
        nullable: true,
    }),
    __metadata("design:type", String)
], Merchant.prototype, "OTP", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'varchar',
        length: 200,
        nullable: true,
    }),
    __metadata("design:type", String)
], Merchant.prototype, "OTP_Time", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'int',
        nullable: true,
    }),
    __metadata("design:type", Number)
], Merchant.prototype, "User_idUser", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'varchar',
        length: 4,
        nullable: true,
    }),
    __metadata("design:type", Number)
], Merchant.prototype, "Flex_Share_Percentage", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'varchar',
        length: 945,
        nullable: true,
    }),
    __metadata("design:type", String)
], Merchant.prototype, "FB_link", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'varchar',
        length: 945,
        nullable: true,
    }),
    __metadata("design:type", String)
], Merchant.prototype, "Instagram_link", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'varchar',
        length: 945,
        nullable: true,
    }),
    __metadata("design:type", String)
], Merchant.prototype, "Store_link", void 0);
exports.Merchant = Merchant = __decorate([
    (0, typeorm_1.Entity)('merchant')
], Merchant);


/***/ }),

/***/ "./apps/merchant/src/merchant.module.ts":
/*!**********************************************!*\
  !*** ./apps/merchant/src/merchant.module.ts ***!
  \**********************************************/
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {


var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.MerchantModule = void 0;
const common_1 = __webpack_require__(/*! @nestjs/common */ "@nestjs/common");
const merchant_controller_1 = __webpack_require__(/*! ./merchant.controller */ "./apps/merchant/src/merchant.controller.ts");
const merchant_service_1 = __webpack_require__(/*! ./merchant.service */ "./apps/merchant/src/merchant.service.ts");
const config_1 = __webpack_require__(/*! @nestjs/config */ "@nestjs/config");
const typeorm_1 = __webpack_require__(/*! @app/typeorm */ "./libs/typeorm/src/index.ts");
const typeorm_2 = __webpack_require__(/*! @nestjs/typeorm */ "@nestjs/typeorm");
const merchant_entity_1 = __webpack_require__(/*! ./merchant.entity */ "./apps/merchant/src/merchant.entity.ts");
const static_file_1 = __webpack_require__(/*! @app/static-file */ "./libs/static-file/src/index.ts");
const location_module_1 = __webpack_require__(/*! ./location/location.module */ "./apps/merchant/src/location/location.module.ts");
const merchantdocuments_module_1 = __webpack_require__(/*! ./merchantdocuments/merchantdocuments.module */ "./apps/merchant/src/merchantdocuments/merchantdocuments.module.ts");
const merchanttype_module_1 = __webpack_require__(/*! ./merchanttype/merchanttype.module */ "./apps/merchant/src/merchanttype/merchanttype.module.ts");
const merchantcategory_module_1 = __webpack_require__(/*! ./merchantcategory/merchantcategory.module */ "./apps/merchant/src/merchantcategory/merchantcategory.module.ts");
const merchant_has_category_module_1 = __webpack_require__(/*! ./merchant-has-category/merchant-has-category.module */ "./apps/merchant/src/merchant-has-category/merchant-has-category.module.ts");
let MerchantModule = class MerchantModule {
};
exports.MerchantModule = MerchantModule;
exports.MerchantModule = MerchantModule = __decorate([
    (0, common_1.Module)({
        imports: [
            config_1.ConfigModule.forRoot(),
            typeorm_1.TypeOrmSharedModule,
            typeorm_2.TypeOrmModule.forFeature([merchant_entity_1.Merchant]),
            static_file_1.StaticFileModule,
            location_module_1.LocationModule,
            merchantdocuments_module_1.MerchantdocumentsModule,
            merchanttype_module_1.MerchanttypeModule,
            merchantcategory_module_1.MerchantcategoryModule,
            merchant_has_category_module_1.MerchantHasCategoryModule,
        ],
        controllers: [merchant_controller_1.MerchantController],
        providers: [merchant_service_1.MerchantService],
    })
], MerchantModule);


/***/ }),

/***/ "./apps/merchant/src/merchant.service.ts":
/*!***********************************************!*\
  !*** ./apps/merchant/src/merchant.service.ts ***!
  \***********************************************/
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {


var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var __param = (this && this.__param) || function (paramIndex, decorator) {
    return function (target, key) { decorator(target, key, paramIndex); }
};
var _a, _b;
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.MerchantService = void 0;
const common_1 = __webpack_require__(/*! @nestjs/common */ "@nestjs/common");
const typeorm_1 = __webpack_require__(/*! @nestjs/typeorm */ "@nestjs/typeorm");
const merchant_entity_1 = __webpack_require__(/*! ./merchant.entity */ "./apps/merchant/src/merchant.entity.ts");
const typeorm_2 = __webpack_require__(/*! typeorm */ "typeorm");
const bcrypt = __webpack_require__(/*! bcrypt */ "bcrypt");
let MerchantService = class MerchantService {
    constructor(merchantRepo) {
        this.merchantRepo = merchantRepo;
    }
    async getAll(page = 1, limit = 100) {
        const offset = (page - 1) * limit;
        const fetchData = await this.merchantRepo.query(`SELECT m.*, mt.Description AS merchent_type_des 
     FROM merchant m 
     INNER JOIN merchant_type mt ON m.Merchant_type_idMerchant_type = mt.idMerchantType 
     LIMIT ? OFFSET ?`, [limit, offset]);
        return fetchData;
    }
    async getAllHttp(req, page = '1', limit = '100') {
        const protocol = req.protocol;
        const host = req.get('host') || '';
        const pageNum = parseInt(page, 10);
        const limitNum = parseInt(limit, 10);
        const baseUrl = `${protocol}://${host}/uploads/merchant/`;
        const baseUrl2 = `${protocol}://${host}/uploads/merchant/documents/`;
        const merchants = await this.merchantService.getAll(pageNum, limitNum);
        const allDocuments = await this.merchantDocumentsService.findAll();
        const merchantsWithDetails = await Promise.all(merchants.map(async (merchant) => {
            const logoUrl = merchant.Logo_Path
                ? baseUrl + merchant.Logo_Path
                : null;
            const merchantDocs = allDocuments
                .filter((doc) => doc.Merchant_idMerchant === merchant.idMerchant)
                .map((doc) => ({
                ...doc,
                Path_Link: baseUrl2 + doc.Path,
            }));
            const merchant_Has_categories = await this.merchantHasCategoriesService.getMerchantHasCategoriesByMerchantId(merchant.idMerchant);
            return {
                ...merchant,
                Logo_Path_Link: logoUrl,
                Documents: merchantDocs,
                merchant_Has_categories,
            };
        }));
        return merchantsWithDetails;
    }
    async getById(id) {
        const merchant = await this.merchantRepo.query(`SELECT m.*,mt.Description AS merchent_type_des FROM merchant m INNER JOIN merchant_type mt ON m.Merchant_type_idMerchant_type = mt.idMerchantType WHERE m.idMerchant = ?`, [id]);
        if (!merchant) {
            throw new common_1.NotFoundException('merchant Not Found!');
        }
        return merchant[0];
    }
    async create(data, logo) {
        const hashedPassword = await bcrypt.hash(data.Password, 10);
        const savedMerchant = this.merchantRepo.create({
            ...data,
            Password: hashedPassword,
            Logo_Path: logo?.filename || '',
        });
        await this.merchantRepo.save(savedMerchant);
        return savedMerchant;
    }
    async update(id, data, logo) {
        const merchant = await this.merchantRepo.findOne({
            where: { idMerchant: id },
        });
        if (!merchant)
            throw new Error('Merchant not found');
        delete data.idMerchant;
        if (data.Password) {
            data.Password = await bcrypt.hash(data.Password, 10);
        }
        else {
            delete data.Password;
        }
        Object.assign(merchant, data);
        if (logo) {
            merchant.Logo_Path = logo.filename;
        }
        return await this.merchantRepo.save(merchant);
    }
    async findById(id) {
        const merchant = await this.merchantRepo.findOne({
            where: { idMerchant: id },
        });
        if (!merchant) {
            throw new Error('Merchant not found');
        }
        return merchant;
    }
};
exports.MerchantService = MerchantService;
__decorate([
    (0, common_1.Get)(),
    __param(0, (0, common_1.Req)()),
    __param(1, (0, common_1.Query)('page')),
    __param(2, (0, common_1.Query)('limit')),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [typeof (_b = typeof Request !== "undefined" && Request) === "function" ? _b : Object, String, String]),
    __metadata("design:returntype", Promise)
], MerchantService.prototype, "getAllHttp", null);
exports.MerchantService = MerchantService = __decorate([
    (0, common_1.Injectable)(),
    __param(0, (0, typeorm_1.InjectRepository)(merchant_entity_1.Merchant)),
    __metadata("design:paramtypes", [typeof (_a = typeof typeorm_2.Repository !== "undefined" && typeorm_2.Repository) === "function" ? _a : Object])
], MerchantService);


/***/ }),

/***/ "./apps/merchant/src/merchantcategory/merchantcategory.controller.ts":
/*!***************************************************************************!*\
  !*** ./apps/merchant/src/merchantcategory/merchantcategory.controller.ts ***!
  \***************************************************************************/
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {


var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var _a, _b, _c, _d, _e;
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.MerchantcategoryController = void 0;
const common_1 = __webpack_require__(/*! @nestjs/common */ "@nestjs/common");
const merchantcategory_service_1 = __webpack_require__(/*! ./merchantcategory.service */ "./apps/merchant/src/merchantcategory/merchantcategory.service.ts");
const microservices_1 = __webpack_require__(/*! @nestjs/microservices */ "@nestjs/microservices");
let MerchantcategoryController = class MerchantcategoryController {
    constructor(merchantCategoryDbService) {
        this.merchantCategoryDbService = merchantCategoryDbService;
    }
    async getAll() {
        return await this.merchantCategoryDbService.getAll();
    }
    async getById(data) {
        const { id } = data;
        return await this.merchantCategoryDbService.getById(id);
    }
    async createMerchantCategory(data) {
        const { body } = data;
        return await this.merchantCategoryDbService.createMerchantCategory(body);
    }
    async updateMerchantCategory(data) {
        const { id, body } = data;
        console.log('in micro  id :', id);
        console.log('in micro  id :', body);
        return await this.merchantCategoryDbService.updateMerchantCategory(id, body);
    }
};
exports.MerchantcategoryController = MerchantcategoryController;
__decorate([
    (0, microservices_1.MessagePattern)({ cmd: 'merchant_category_get_all' }),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", []),
    __metadata("design:returntype", typeof (_b = typeof Promise !== "undefined" && Promise) === "function" ? _b : Object)
], MerchantcategoryController.prototype, "getAll", null);
__decorate([
    (0, microservices_1.MessagePattern)({ cmd: 'merchant_category_getby_id' }),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [Object]),
    __metadata("design:returntype", typeof (_c = typeof Promise !== "undefined" && Promise) === "function" ? _c : Object)
], MerchantcategoryController.prototype, "getById", null);
__decorate([
    (0, microservices_1.MessagePattern)({ cmd: 'merchant_category_add' }),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [Object]),
    __metadata("design:returntype", typeof (_d = typeof Promise !== "undefined" && Promise) === "function" ? _d : Object)
], MerchantcategoryController.prototype, "createMerchantCategory", null);
__decorate([
    (0, microservices_1.MessagePattern)({ cmd: 'merchant_category_update' }),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [Object]),
    __metadata("design:returntype", typeof (_e = typeof Promise !== "undefined" && Promise) === "function" ? _e : Object)
], MerchantcategoryController.prototype, "updateMerchantCategory", null);
exports.MerchantcategoryController = MerchantcategoryController = __decorate([
    (0, common_1.Controller)(),
    __metadata("design:paramtypes", [typeof (_a = typeof merchantcategory_service_1.MerchantcategoryService !== "undefined" && merchantcategory_service_1.MerchantcategoryService) === "function" ? _a : Object])
], MerchantcategoryController);


/***/ }),

/***/ "./apps/merchant/src/merchantcategory/merchantcategory.entity.ts":
/*!***********************************************************************!*\
  !*** ./apps/merchant/src/merchantcategory/merchantcategory.entity.ts ***!
  \***********************************************************************/
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {


var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.MerchantCategory = void 0;
const typeorm_1 = __webpack_require__(/*! typeorm */ "typeorm");
let MerchantCategory = class MerchantCategory extends typeorm_1.BaseEntity {
};
exports.MerchantCategory = MerchantCategory;
__decorate([
    (0, typeorm_1.PrimaryGeneratedColumn)({
        comment: 'the unqiue identifier',
    }),
    __metadata("design:type", Number)
], MerchantCategory.prototype, "idMerchantCategory", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'varchar',
        length: 45,
        nullable: false,
    }),
    __metadata("design:type", String)
], MerchantCategory.prototype, "Description", void 0);
exports.MerchantCategory = MerchantCategory = __decorate([
    (0, typeorm_1.Entity)('merchant_category')
], MerchantCategory);


/***/ }),

/***/ "./apps/merchant/src/merchantcategory/merchantcategory.module.ts":
/*!***********************************************************************!*\
  !*** ./apps/merchant/src/merchantcategory/merchantcategory.module.ts ***!
  \***********************************************************************/
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {


var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.MerchantcategoryModule = void 0;
const common_1 = __webpack_require__(/*! @nestjs/common */ "@nestjs/common");
const merchantcategory_service_1 = __webpack_require__(/*! ./merchantcategory.service */ "./apps/merchant/src/merchantcategory/merchantcategory.service.ts");
const typeorm_1 = __webpack_require__(/*! @nestjs/typeorm */ "@nestjs/typeorm");
const config_1 = __webpack_require__(/*! @nestjs/config */ "@nestjs/config");
const merchantcategory_entity_1 = __webpack_require__(/*! ./merchantcategory.entity */ "./apps/merchant/src/merchantcategory/merchantcategory.entity.ts");
const merchantcategory_controller_1 = __webpack_require__(/*! ./merchantcategory.controller */ "./apps/merchant/src/merchantcategory/merchantcategory.controller.ts");
let MerchantcategoryModule = class MerchantcategoryModule {
};
exports.MerchantcategoryModule = MerchantcategoryModule;
exports.MerchantcategoryModule = MerchantcategoryModule = __decorate([
    (0, common_1.Module)({
        imports: [
            typeorm_1.TypeOrmModule.forFeature([merchantcategory_entity_1.MerchantCategory]),
            config_1.ConfigModule.forRoot(),
        ],
        controllers: [merchantcategory_controller_1.MerchantcategoryController],
        providers: [merchantcategory_service_1.MerchantcategoryService],
    })
], MerchantcategoryModule);


/***/ }),

/***/ "./apps/merchant/src/merchantcategory/merchantcategory.service.ts":
/*!************************************************************************!*\
  !*** ./apps/merchant/src/merchantcategory/merchantcategory.service.ts ***!
  \************************************************************************/
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {


var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var __param = (this && this.__param) || function (paramIndex, decorator) {
    return function (target, key) { decorator(target, key, paramIndex); }
};
var _a;
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.MerchantcategoryService = void 0;
const common_1 = __webpack_require__(/*! @nestjs/common */ "@nestjs/common");
const typeorm_1 = __webpack_require__(/*! @nestjs/typeorm */ "@nestjs/typeorm");
const merchantcategory_entity_1 = __webpack_require__(/*! ./merchantcategory.entity */ "./apps/merchant/src/merchantcategory/merchantcategory.entity.ts");
const typeorm_2 = __webpack_require__(/*! typeorm */ "typeorm");
let MerchantcategoryService = class MerchantcategoryService {
    constructor(MerchantCategoryRepo) {
        this.MerchantCategoryRepo = MerchantCategoryRepo;
    }
    async getAll() {
        const data = await this.MerchantCategoryRepo.find();
        return data;
    }
    async getById(id) {
        const data = this.MerchantCategoryRepo.findOneBy({
            idMerchantCategory: id,
        });
        return data;
    }
    async createMerchantCategory(body) {
        const merchantCategory = this.MerchantCategoryRepo.create(body);
        const data = await this.MerchantCategoryRepo.save(merchantCategory);
        return {
            data: data,
            message: 'Merchant Category Adding Completed!',
        };
    }
    async updateMerchantCategory(id, body) {
        const existing = await this.MerchantCategoryRepo.findOneBy({
            idMerchantCategory: id,
        });
        if (!existing) {
            throw new Error('Merchant category Not Found!');
        }
        const updated = Object.assign(existing, body);
        const saved = await this.MerchantCategoryRepo.save(updated);
        return {
            data: saved,
            message: 'Merchant Category Updating Completed!',
        };
    }
};
exports.MerchantcategoryService = MerchantcategoryService;
exports.MerchantcategoryService = MerchantcategoryService = __decorate([
    (0, common_1.Injectable)(),
    __param(0, (0, typeorm_1.InjectRepository)(merchantcategory_entity_1.MerchantCategory)),
    __metadata("design:paramtypes", [typeof (_a = typeof typeorm_2.Repository !== "undefined" && typeorm_2.Repository) === "function" ? _a : Object])
], MerchantcategoryService);


/***/ }),

/***/ "./apps/merchant/src/merchantdocuments/merchantdocuments.controller.ts":
/*!*****************************************************************************!*\
  !*** ./apps/merchant/src/merchantdocuments/merchantdocuments.controller.ts ***!
  \*****************************************************************************/
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {


var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.MerchantdocumentsController = void 0;
const common_1 = __webpack_require__(/*! @nestjs/common */ "@nestjs/common");
let MerchantdocumentsController = class MerchantdocumentsController {
};
exports.MerchantdocumentsController = MerchantdocumentsController;
exports.MerchantdocumentsController = MerchantdocumentsController = __decorate([
    (0, common_1.Controller)('merchantdocuments')
], MerchantdocumentsController);


/***/ }),

/***/ "./apps/merchant/src/merchantdocuments/merchantdocuments.entity.ts":
/*!*************************************************************************!*\
  !*** ./apps/merchant/src/merchantdocuments/merchantdocuments.entity.ts ***!
  \*************************************************************************/
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {


var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.MerchantDocumnets = void 0;
const typeorm_1 = __webpack_require__(/*! typeorm */ "typeorm");
let MerchantDocumnets = class MerchantDocumnets extends typeorm_1.BaseEntity {
};
exports.MerchantDocumnets = MerchantDocumnets;
__decorate([
    (0, typeorm_1.PrimaryGeneratedColumn)({
        comment: 'the unique identifier',
    }),
    __metadata("design:type", Number)
], MerchantDocumnets.prototype, "idMerchant_Document", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'int',
        nullable: false,
    }),
    __metadata("design:type", Number)
], MerchantDocumnets.prototype, "Merchant_idMerchant", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'varchar',
        length: 45,
        nullable: true,
    }),
    __metadata("design:type", String)
], MerchantDocumnets.prototype, "Description", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'text',
        nullable: true,
    }),
    __metadata("design:type", String)
], MerchantDocumnets.prototype, "Path", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'varchar',
        length: 45,
        default: '0',
    }),
    __metadata("design:type", String)
], MerchantDocumnets.prototype, "Verification_Status", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'int',
        nullable: true,
    }),
    __metadata("design:type", Number)
], MerchantDocumnets.prototype, "User_idUser", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'varchar',
        length: 45,
        nullable: true,
    }),
    __metadata("design:type", String)
], MerchantDocumnets.prototype, "Created_Time", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'varchar',
        length: 45,
        nullable: true,
    }),
    __metadata("design:type", String)
], MerchantDocumnets.prototype, "Approved_Time", void 0);
exports.MerchantDocumnets = MerchantDocumnets = __decorate([
    (0, typeorm_1.Entity)('merchant_documents')
], MerchantDocumnets);


/***/ }),

/***/ "./apps/merchant/src/merchantdocuments/merchantdocuments.module.ts":
/*!*************************************************************************!*\
  !*** ./apps/merchant/src/merchantdocuments/merchantdocuments.module.ts ***!
  \*************************************************************************/
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {


var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.MerchantdocumentsModule = void 0;
const common_1 = __webpack_require__(/*! @nestjs/common */ "@nestjs/common");
const merchantdocuments_service_1 = __webpack_require__(/*! ./merchantdocuments.service */ "./apps/merchant/src/merchantdocuments/merchantdocuments.service.ts");
const merchantdocuments_controller_1 = __webpack_require__(/*! ./merchantdocuments.controller */ "./apps/merchant/src/merchantdocuments/merchantdocuments.controller.ts");
const typeorm_1 = __webpack_require__(/*! @nestjs/typeorm */ "@nestjs/typeorm");
const merchantdocuments_entity_1 = __webpack_require__(/*! ./merchantdocuments.entity */ "./apps/merchant/src/merchantdocuments/merchantdocuments.entity.ts");
let MerchantdocumentsModule = class MerchantdocumentsModule {
};
exports.MerchantdocumentsModule = MerchantdocumentsModule;
exports.MerchantdocumentsModule = MerchantdocumentsModule = __decorate([
    (0, common_1.Module)({
        imports: [typeorm_1.TypeOrmModule.forFeature([merchantdocuments_entity_1.MerchantDocumnets])],
        providers: [merchantdocuments_service_1.MerchantdocumentsService],
        controllers: [merchantdocuments_controller_1.MerchantdocumentsController],
        exports: [merchantdocuments_service_1.MerchantdocumentsService],
    })
], MerchantdocumentsModule);


/***/ }),

/***/ "./apps/merchant/src/merchantdocuments/merchantdocuments.service.ts":
/*!**************************************************************************!*\
  !*** ./apps/merchant/src/merchantdocuments/merchantdocuments.service.ts ***!
  \**************************************************************************/
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {


var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var __param = (this && this.__param) || function (paramIndex, decorator) {
    return function (target, key) { decorator(target, key, paramIndex); }
};
var _a;
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.MerchantdocumentsService = void 0;
const common_1 = __webpack_require__(/*! @nestjs/common */ "@nestjs/common");
const typeorm_1 = __webpack_require__(/*! @nestjs/typeorm */ "@nestjs/typeorm");
const typeorm_2 = __webpack_require__(/*! typeorm */ "typeorm");
const merchantdocuments_entity_1 = __webpack_require__(/*! ./merchantdocuments.entity */ "./apps/merchant/src/merchantdocuments/merchantdocuments.entity.ts");
let MerchantdocumentsService = class MerchantdocumentsService {
    constructor(merchantDocumentRepo) {
        this.merchantDocumentRepo = merchantDocumentRepo;
    }
    async findAll() {
        return await this.merchantDocumentRepo.find();
    }
    async addMerchantDocuments(data) {
        console.log('merchant id : ', data.merchantId);
        const document = this.merchantDocumentRepo.create({
            Path: data.fileName,
            Description: data.description,
            Merchant_idMerchant: data.merchantId,
        });
        return await this.merchantDocumentRepo.save(document);
    }
    async findByMerchantId(merchantId) {
        return await this.merchantDocumentRepo.find({
            where: { Merchant_idMerchant: merchantId },
        });
    }
    async deleteById(id) {
        await this.merchantDocumentRepo.delete(id);
    }
    async deleteDocumentsNotInList(merchantId, existingPaths) {
        const allDocs = await this.findByMerchantId(merchantId);
        const toDelete = allDocs.filter((doc) => !existingPaths.includes(doc.Path));
        if (toDelete.length > 0) {
            const idsToDelete = toDelete.map((doc) => doc.idMerchant_Document);
            await this.merchantDocumentRepo.delete(idsToDelete);
        }
    }
    async updateDescriptionById(id, description) {
        console.log('id', id);
        console.log(description);
        return await this.merchantDocumentRepo.update(id, {
            Description: description,
        });
    }
};
exports.MerchantdocumentsService = MerchantdocumentsService;
exports.MerchantdocumentsService = MerchantdocumentsService = __decorate([
    (0, common_1.Injectable)(),
    __param(0, (0, typeorm_1.InjectRepository)(merchantdocuments_entity_1.MerchantDocumnets)),
    __metadata("design:paramtypes", [typeof (_a = typeof typeorm_2.Repository !== "undefined" && typeorm_2.Repository) === "function" ? _a : Object])
], MerchantdocumentsService);


/***/ }),

/***/ "./apps/merchant/src/merchanttype/merchanttype.controller.ts":
/*!*******************************************************************!*\
  !*** ./apps/merchant/src/merchanttype/merchanttype.controller.ts ***!
  \*******************************************************************/
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {


var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var _a, _b, _c, _d, _e;
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.MerchanttypeController = void 0;
const common_1 = __webpack_require__(/*! @nestjs/common */ "@nestjs/common");
const merchanttype_service_1 = __webpack_require__(/*! ./merchanttype.service */ "./apps/merchant/src/merchanttype/merchanttype.service.ts");
const microservices_1 = __webpack_require__(/*! @nestjs/microservices */ "@nestjs/microservices");
let MerchanttypeController = class MerchanttypeController {
    constructor(merchantTypeDbService) {
        this.merchantTypeDbService = merchantTypeDbService;
    }
    async getAll() {
        return await this.merchantTypeDbService.getAll();
    }
    async getById(data) {
        const { id } = data;
        return await this.merchantTypeDbService.getById(id);
    }
    async createMerchantType(data) {
        const { body } = data;
        return await this.merchantTypeDbService.createMerchantType(body);
    }
    async updateMerchantType(data) {
        const { id, body } = data;
        return await this.merchantTypeDbService.updateMerchantType(id, body);
    }
};
exports.MerchanttypeController = MerchanttypeController;
__decorate([
    (0, microservices_1.MessagePattern)({ cmd: 'merchant_type_get_all' }),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", []),
    __metadata("design:returntype", typeof (_b = typeof Promise !== "undefined" && Promise) === "function" ? _b : Object)
], MerchanttypeController.prototype, "getAll", null);
__decorate([
    (0, microservices_1.MessagePattern)({ cmd: 'merchant_type_get_by_id' }),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [Object]),
    __metadata("design:returntype", typeof (_c = typeof Promise !== "undefined" && Promise) === "function" ? _c : Object)
], MerchanttypeController.prototype, "getById", null);
__decorate([
    (0, microservices_1.MessagePattern)({ cmd: 'merchant_type_add' }),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [Object]),
    __metadata("design:returntype", typeof (_d = typeof Promise !== "undefined" && Promise) === "function" ? _d : Object)
], MerchanttypeController.prototype, "createMerchantType", null);
__decorate([
    (0, microservices_1.MessagePattern)({ cmd: 'merchant_type_update' }),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [Object]),
    __metadata("design:returntype", typeof (_e = typeof Promise !== "undefined" && Promise) === "function" ? _e : Object)
], MerchanttypeController.prototype, "updateMerchantType", null);
exports.MerchanttypeController = MerchanttypeController = __decorate([
    (0, common_1.Controller)(),
    __metadata("design:paramtypes", [typeof (_a = typeof merchanttype_service_1.MerchanttypeService !== "undefined" && merchanttype_service_1.MerchanttypeService) === "function" ? _a : Object])
], MerchanttypeController);


/***/ }),

/***/ "./apps/merchant/src/merchanttype/merchanttype.entity.ts":
/*!***************************************************************!*\
  !*** ./apps/merchant/src/merchanttype/merchanttype.entity.ts ***!
  \***************************************************************/
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {


var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.MerchantType = void 0;
const typeorm_1 = __webpack_require__(/*! typeorm */ "typeorm");
let MerchantType = class MerchantType extends typeorm_1.BaseEntity {
};
exports.MerchantType = MerchantType;
__decorate([
    (0, typeorm_1.PrimaryGeneratedColumn)({
        comment: 'the unqiue identifier',
    }),
    __metadata("design:type", Number)
], MerchantType.prototype, "idMerchantType", void 0);
__decorate([
    (0, typeorm_1.Column)({
        type: 'varchar',
        length: 45,
        nullable: false,
    }),
    __metadata("design:type", String)
], MerchantType.prototype, "Description", void 0);
exports.MerchantType = MerchantType = __decorate([
    (0, typeorm_1.Entity)('merchant_type')
], MerchantType);


/***/ }),

/***/ "./apps/merchant/src/merchanttype/merchanttype.module.ts":
/*!***************************************************************!*\
  !*** ./apps/merchant/src/merchanttype/merchanttype.module.ts ***!
  \***************************************************************/
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {


var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.MerchanttypeModule = void 0;
const common_1 = __webpack_require__(/*! @nestjs/common */ "@nestjs/common");
const merchanttype_service_1 = __webpack_require__(/*! ./merchanttype.service */ "./apps/merchant/src/merchanttype/merchanttype.service.ts");
const typeorm_1 = __webpack_require__(/*! @nestjs/typeorm */ "@nestjs/typeorm");
const merchanttype_entity_1 = __webpack_require__(/*! ./merchanttype.entity */ "./apps/merchant/src/merchanttype/merchanttype.entity.ts");
const merchanttype_controller_1 = __webpack_require__(/*! ./merchanttype.controller */ "./apps/merchant/src/merchanttype/merchanttype.controller.ts");
const config_1 = __webpack_require__(/*! @nestjs/config */ "@nestjs/config");
let MerchanttypeModule = class MerchanttypeModule {
};
exports.MerchanttypeModule = MerchanttypeModule;
exports.MerchanttypeModule = MerchanttypeModule = __decorate([
    (0, common_1.Module)({
        imports: [typeorm_1.TypeOrmModule.forFeature([merchanttype_entity_1.MerchantType]), config_1.ConfigModule.forRoot()],
        providers: [merchanttype_service_1.MerchanttypeService],
        controllers: [merchanttype_controller_1.MerchanttypeController],
        exports: [merchanttype_service_1.MerchanttypeService],
    })
], MerchanttypeModule);


/***/ }),

/***/ "./apps/merchant/src/merchanttype/merchanttype.service.ts":
/*!****************************************************************!*\
  !*** ./apps/merchant/src/merchanttype/merchanttype.service.ts ***!
  \****************************************************************/
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {


var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var __param = (this && this.__param) || function (paramIndex, decorator) {
    return function (target, key) { decorator(target, key, paramIndex); }
};
var _a;
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.MerchanttypeService = void 0;
const common_1 = __webpack_require__(/*! @nestjs/common */ "@nestjs/common");
const typeorm_1 = __webpack_require__(/*! @nestjs/typeorm */ "@nestjs/typeorm");
const merchanttype_entity_1 = __webpack_require__(/*! ./merchanttype.entity */ "./apps/merchant/src/merchanttype/merchanttype.entity.ts");
const typeorm_2 = __webpack_require__(/*! typeorm */ "typeorm");
let MerchanttypeService = class MerchanttypeService {
    constructor(merchantTypeRepo) {
        this.merchantTypeRepo = merchantTypeRepo;
    }
    async getAll() {
        const data = await this.merchantTypeRepo.find();
        return data;
    }
    async getById(id) {
        const data = this.merchantTypeRepo.findOneBy({
            idMerchantType: id,
        });
        return data;
    }
    async createMerchantType(body) {
        const merchantType = this.merchantTypeRepo.create(body);
        const data = await this.merchantTypeRepo.save(merchantType);
        return {
            data: data,
            message: 'Merchant Type Adding completed!',
        };
    }
    async updateMerchantType(id, body) {
        const existing = await this.merchantTypeRepo.findOneBy({
            idMerchantType: id,
        });
        if (!existing) {
            throw new Error('Merchant Type Not Found!');
        }
        const updated = Object.assign(existing, body);
        const saved = await this.merchantTypeRepo.save(updated);
        return {
            data: saved,
            message: 'Merchant Type Updating Completed!',
        };
    }
};
exports.MerchanttypeService = MerchanttypeService;
exports.MerchanttypeService = MerchanttypeService = __decorate([
    (0, common_1.Injectable)(),
    __param(0, (0, typeorm_1.InjectRepository)(merchanttype_entity_1.MerchantType)),
    __metadata("design:paramtypes", [typeof (_a = typeof typeorm_2.Repository !== "undefined" && typeorm_2.Repository) === "function" ? _a : Object])
], MerchanttypeService);


/***/ }),

/***/ "./libs/static-file/src/index.ts":
/*!***************************************!*\
  !*** ./libs/static-file/src/index.ts ***!
  \***************************************/
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {


var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
    for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
__exportStar(__webpack_require__(/*! ./static-file.module */ "./libs/static-file/src/static-file.module.ts"), exports);
__exportStar(__webpack_require__(/*! ./static-file.service */ "./libs/static-file/src/static-file.service.ts"), exports);


/***/ }),

/***/ "./libs/static-file/src/static-file.module.ts":
/*!****************************************************!*\
  !*** ./libs/static-file/src/static-file.module.ts ***!
  \****************************************************/
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {


var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.StaticFileModule = void 0;
const common_1 = __webpack_require__(/*! @nestjs/common */ "@nestjs/common");
const static_file_service_1 = __webpack_require__(/*! ./static-file.service */ "./libs/static-file/src/static-file.service.ts");
const serve_static_1 = __webpack_require__(/*! @nestjs/serve-static */ "@nestjs/serve-static");
const path_1 = __webpack_require__(/*! path */ "path");
let StaticFileModule = class StaticFileModule {
};
exports.StaticFileModule = StaticFileModule;
exports.StaticFileModule = StaticFileModule = __decorate([
    (0, common_1.Module)({
        imports: [
            serve_static_1.ServeStaticModule.forRoot({
                rootPath: (0, path_1.join)(process.cwd(), 'uploads'),
                serveRoot: '/uploads',
                serveStaticOptions: {
                    index: false,
                },
            }),
        ],
        providers: [static_file_service_1.StaticFileService],
        exports: [static_file_service_1.StaticFileService],
    })
], StaticFileModule);


/***/ }),

/***/ "./libs/static-file/src/static-file.service.ts":
/*!*****************************************************!*\
  !*** ./libs/static-file/src/static-file.service.ts ***!
  \*****************************************************/
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {


var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.StaticFileService = void 0;
const common_1 = __webpack_require__(/*! @nestjs/common */ "@nestjs/common");
let StaticFileService = class StaticFileService {
};
exports.StaticFileService = StaticFileService;
exports.StaticFileService = StaticFileService = __decorate([
    (0, common_1.Injectable)()
], StaticFileService);


/***/ }),

/***/ "./libs/typeorm/src/index.ts":
/*!***********************************!*\
  !*** ./libs/typeorm/src/index.ts ***!
  \***********************************/
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {


var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
    for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
__exportStar(__webpack_require__(/*! ./typeorm.module */ "./libs/typeorm/src/typeorm.module.ts"), exports);
__exportStar(__webpack_require__(/*! ./typeorm.service */ "./libs/typeorm/src/typeorm.service.ts"), exports);


/***/ }),

/***/ "./libs/typeorm/src/typeorm.module.ts":
/*!********************************************!*\
  !*** ./libs/typeorm/src/typeorm.module.ts ***!
  \********************************************/
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {


var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.TypeOrmSharedModule = void 0;
const common_1 = __webpack_require__(/*! @nestjs/common */ "@nestjs/common");
const typeorm_1 = __webpack_require__(/*! @nestjs/typeorm */ "@nestjs/typeorm");
const config_1 = __webpack_require__(/*! @nestjs/config */ "@nestjs/config");
const user_entity_1 = __webpack_require__(/*! apps/auth/src/user/user.entity */ "./apps/auth/src/user/user.entity.ts");
const merchantuser_entity_1 = __webpack_require__(/*! apps/auth/src/merchantuser/merchantuser.entity */ "./apps/auth/src/merchantuser/merchantuser.entity.ts");
const merchant_entity_1 = __webpack_require__(/*! apps/merchant/src/merchant.entity */ "./apps/merchant/src/merchant.entity.ts");
const location_entity_1 = __webpack_require__(/*! apps/merchant/src/location/location.entity */ "./apps/merchant/src/location/location.entity.ts");
const merchantdocuments_entity_1 = __webpack_require__(/*! apps/merchant/src/merchantdocuments/merchantdocuments.entity */ "./apps/merchant/src/merchantdocuments/merchantdocuments.entity.ts");
const merchanttype_entity_1 = __webpack_require__(/*! apps/merchant/src/merchanttype/merchanttype.entity */ "./apps/merchant/src/merchanttype/merchanttype.entity.ts");
const merchantcategory_entity_1 = __webpack_require__(/*! apps/merchant/src/merchantcategory/merchantcategory.entity */ "./apps/merchant/src/merchantcategory/merchantcategory.entity.ts");
const merchant_has_category_entity_1 = __webpack_require__(/*! apps/merchant/src/merchant-has-category/merchant-has-category.entity */ "./apps/merchant/src/merchant-has-category/merchant-has-category.entity.ts");
const customer_entity_1 = __webpack_require__(/*! apps/customer/src/customer.entity */ "./apps/customer/src/customer.entity.ts");
let TypeOrmSharedModule = class TypeOrmSharedModule {
};
exports.TypeOrmSharedModule = TypeOrmSharedModule;
exports.TypeOrmSharedModule = TypeOrmSharedModule = __decorate([
    (0, common_1.Module)({
        imports: [
            config_1.ConfigModule.forRoot({ isGlobal: true }),
            typeorm_1.TypeOrmModule.forRoot({
                type: 'mysql',
                host: process.env.LOGIN_DB_HOST,
                port: parseInt(process.env.LOGIN_DB_PORT, 10),
                username: process.env.LOGIN_DB_USERNAME,
                password: process.env.LOGIN_DB_PASSWORD,
                database: process.env.LOGIN_DB_NAME,
                entities: [
                    user_entity_1.User,
                    merchantuser_entity_1.Marchantuser,
                    merchant_entity_1.Merchant,
                    location_entity_1.MerchantLocation,
                    merchantdocuments_entity_1.MerchantDocumnets,
                    merchanttype_entity_1.MerchantType,
                    merchantcategory_entity_1.MerchantCategory,
                    merchant_has_category_entity_1.MerchantHasCategories,
                    customer_entity_1.Customer,
                    __dirname + '/../../**/*.entity{.ts,.js}',
                ],
                synchronize: true,
                logging: false,
            }),
        ],
    })
], TypeOrmSharedModule);


/***/ }),

/***/ "./libs/typeorm/src/typeorm.service.ts":
/*!*********************************************!*\
  !*** ./libs/typeorm/src/typeorm.service.ts ***!
  \*********************************************/
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {


var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.TypeormService = void 0;
const common_1 = __webpack_require__(/*! @nestjs/common */ "@nestjs/common");
let TypeormService = class TypeormService {
};
exports.TypeormService = TypeormService;
exports.TypeormService = TypeormService = __decorate([
    (0, common_1.Injectable)()
], TypeormService);


/***/ }),

/***/ "@nestjs/common":
/*!*********************************!*\
  !*** external "@nestjs/common" ***!
  \*********************************/
/***/ ((module) => {

module.exports = require("@nestjs/common");

/***/ }),

/***/ "@nestjs/config":
/*!*********************************!*\
  !*** external "@nestjs/config" ***!
  \*********************************/
/***/ ((module) => {

module.exports = require("@nestjs/config");

/***/ }),

/***/ "@nestjs/core":
/*!*******************************!*\
  !*** external "@nestjs/core" ***!
  \*******************************/
/***/ ((module) => {

module.exports = require("@nestjs/core");

/***/ }),

/***/ "@nestjs/microservices":
/*!****************************************!*\
  !*** external "@nestjs/microservices" ***!
  \****************************************/
/***/ ((module) => {

module.exports = require("@nestjs/microservices");

/***/ }),

/***/ "@nestjs/serve-static":
/*!***************************************!*\
  !*** external "@nestjs/serve-static" ***!
  \***************************************/
/***/ ((module) => {

module.exports = require("@nestjs/serve-static");

/***/ }),

/***/ "@nestjs/typeorm":
/*!**********************************!*\
  !*** external "@nestjs/typeorm" ***!
  \**********************************/
/***/ ((module) => {

module.exports = require("@nestjs/typeorm");

/***/ }),

/***/ "bcrypt":
/*!*************************!*\
  !*** external "bcrypt" ***!
  \*************************/
/***/ ((module) => {

module.exports = require("bcrypt");

/***/ }),

/***/ "typeorm":
/*!**************************!*\
  !*** external "typeorm" ***!
  \**************************/
/***/ ((module) => {

module.exports = require("typeorm");

/***/ }),

/***/ "path":
/*!***********************!*\
  !*** external "path" ***!
  \***********************/
/***/ ((module) => {

module.exports = require("path");

/***/ })

/******/ 	});
/************************************************************************/
/******/ 	// The module cache
/******/ 	var __webpack_module_cache__ = {};
/******/ 	
/******/ 	// The require function
/******/ 	function __webpack_require__(moduleId) {
/******/ 		// Check if module is in cache
/******/ 		var cachedModule = __webpack_module_cache__[moduleId];
/******/ 		if (cachedModule !== undefined) {
/******/ 			return cachedModule.exports;
/******/ 		}
/******/ 		// Create a new module (and put it into the cache)
/******/ 		var module = __webpack_module_cache__[moduleId] = {
/******/ 			// no module.id needed
/******/ 			// no module.loaded needed
/******/ 			exports: {}
/******/ 		};
/******/ 	
/******/ 		// Execute the module function
/******/ 		__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/ 	
/******/ 		// Return the exports of the module
/******/ 		return module.exports;
/******/ 	}
/******/ 	
/************************************************************************/
var __webpack_exports__ = {};
// This entry needs to be wrapped in an IIFE because it needs to be isolated against other modules in the chunk.
(() => {
var exports = __webpack_exports__;
/*!***********************************!*\
  !*** ./apps/merchant/src/main.ts ***!
  \***********************************/

Object.defineProperty(exports, "__esModule", ({ value: true }));
const core_1 = __webpack_require__(/*! @nestjs/core */ "@nestjs/core");
const merchant_module_1 = __webpack_require__(/*! ./merchant.module */ "./apps/merchant/src/merchant.module.ts");
const common_1 = __webpack_require__(/*! @nestjs/common */ "@nestjs/common");
const microservices_1 = __webpack_require__(/*! @nestjs/microservices */ "@nestjs/microservices");
async function bootstrap() {
    const app = await core_1.NestFactory.createMicroservice(merchant_module_1.MerchantModule, {
        transport: microservices_1.Transport.TCP,
        options: {
            host: '0.0.0.0',
            port: 8878,
        },
    });
    app.useGlobalPipes(new common_1.ValidationPipe());
    await app.listen();
    console.log('Merchant Microservice is listening on TCP port 8878');
}
bootstrap();

})();

/******/ })()
;