aws-service-stack 0.14.181 → 0.14.185
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_examples/controller/e-order/e-order.config.js.map +1 -1
- package/dist/_examples/controller/supplier/supplier-config.d.ts +1 -1
- package/dist/_examples/controller/supplier/supplier-config.js +2 -3
- package/dist/_examples/controller/supplier/supplier-config.js.map +1 -1
- package/dist/_examples/controller/supplier/supplier-controller.js +2 -2
- package/dist/_examples/controller/supplier/supplier-controller.js.map +1 -1
- package/dist/_examples/controller/supplier/supplier-crud.js +3 -0
- package/dist/_examples/controller/supplier/supplier-crud.js.map +1 -1
- package/dist/_examples/model-shared/example.model.js.map +1 -0
- package/dist/_examples/{repositories/supplier → model-shared}/suppler.model.d.ts +79 -100
- package/dist/_examples/model-shared/suppler.model.js +85 -0
- package/dist/_examples/model-shared/suppler.model.js.map +1 -0
- package/dist/_examples/repositories/order/order-es.repo.d.ts +1 -1
- package/dist/_examples/repositories/order/order-es.repo.interface.d.ts +1 -1
- package/dist/_examples/repositories/order/order-es.repo.interface.js.map +1 -1
- package/dist/_examples/repositories/order/order-es.repo.js.map +1 -1
- package/dist/_examples/repositories/order/order-repo-db.d.ts +3 -3
- package/dist/_examples/repositories/order/order-repo-db.interface.d.ts +1 -1
- package/dist/_examples/repositories/order/order-repo-db.interface.js.map +1 -1
- package/dist/_examples/repositories/order/order-repo-db.js +3 -3
- package/dist/_examples/repositories/order/order-repo-db.js.map +1 -1
- package/dist/_examples/repositories/profile/profile-repo-db.d.ts +1 -1
- package/dist/_examples/repositories/profile/profile-repo-db.interface.d.ts +2 -1
- package/dist/_examples/repositories/profile/profile-repo-db.interface.js +1 -0
- package/dist/_examples/repositories/profile/profile-repo-db.interface.js.map +1 -1
- package/dist/_examples/repositories/profile/profile-repo-db.js.map +1 -1
- package/dist/_examples/repositories/supplier/supplier-repo-db.d.ts +1 -1
- package/dist/_examples/repositories/supplier/supplier-repo-db.interface.d.ts +1 -1
- package/dist/_examples/repositories/supplier/supplier-repo-db.interface.js.map +1 -1
- package/dist/_examples/repositories/supplier/supplier-repo-db.js.map +1 -1
- package/dist/_examples/repositories/supplier/supplier-repo-es.d.ts +1 -1
- package/dist/_examples/repositories/supplier/supplier-repo-es.interface.d.ts +1 -1
- package/dist/_examples/repositories/supplier/supplier-repo-es.interface.js.map +1 -1
- package/dist/_examples/repositories/supplier/supplier-repo-es.js.map +1 -1
- package/dist/_examples/repositories/user-repo-db.d.ts +2 -2
- package/dist/_examples/repositories/user-repo-db.interface.d.ts +1 -1
- package/dist/_examples/repositories/user-repo-db.interface.js.map +1 -1
- package/dist/_examples/repositories/user-repo-db.js +3 -3
- package/dist/_examples/repositories/user-repo-db.js.map +1 -1
- package/dist/_examples/service/order-service.d.ts +2 -2
- package/dist/_examples/service/order-service.interface.d.ts +2 -1
- package/dist/_examples/service/order-service.interface.js +1 -0
- package/dist/_examples/service/order-service.interface.js.map +1 -1
- package/dist/_examples/service/order-service.js.map +1 -1
- package/dist/_examples/service/profile-service.d.ts +1 -1
- package/dist/_examples/service/profile-service.interface.d.ts +1 -1
- package/dist/_examples/service/profile-service.interface.js.map +1 -1
- package/dist/_examples/service/profile-service.js +14 -17
- package/dist/_examples/service/profile-service.js.map +1 -1
- package/dist/_examples/service/supplier/supplier-service.d.ts +1 -1
- package/dist/_examples/service/supplier/supplier-service.interface.d.ts +1 -1
- package/dist/_examples/service/supplier/supplier-service.interface.js.map +1 -1
- package/dist/_examples/service/supplier/supplier-service.js.map +1 -1
- package/dist/_examples/service/user-service.d.ts +2 -3
- package/dist/_examples/service/user-service.interface.d.ts +1 -1
- package/dist/_examples/service/user-service.interface.js.map +1 -1
- package/dist/_examples/service/user-service.js +2 -2
- package/dist/_examples/service/user-service.js.map +1 -1
- package/dist/controller/base-controller.js +7 -6
- package/dist/controller/base-controller.js.map +1 -1
- package/dist/model/base.config.d.ts +9 -98
- package/dist/model/base.config.js +8 -102
- package/dist/model/base.config.js.map +1 -1
- package/dist/model/base.model.d.ts +8 -50
- package/dist/model/base.model.js +0 -28
- package/dist/model/base.model.js.map +1 -1
- package/dist/model/dynamodb.model.d.ts +33 -1
- package/dist/model/dynamodb.model.js +23 -7
- package/dist/model/dynamodb.model.js.map +1 -1
- package/dist/model/filter.model.d.ts +19 -35
- package/dist/model/filter.model.js +0 -19
- package/dist/model/filter.model.js.map +1 -1
- package/dist/model/http.model.d.ts +10 -0
- package/dist/model/http.model.js +13 -1
- package/dist/model/http.model.js.map +1 -1
- package/dist/model/index.d.ts +4 -1
- package/dist/model/index.js +4 -1
- package/dist/model/index.js.map +1 -1
- package/dist/model/validation.model.d.ts +26 -0
- package/dist/model/validation.model.js +19 -0
- package/dist/model/validation.model.js.map +1 -0
- package/dist/repositories/base-core.repo.interface.d.ts +2 -1
- package/dist/repositories/base-core.repo.interface.js.map +1 -1
- package/dist/repositories/base-db.repo.d.ts +2 -1
- package/dist/repositories/base-db.repo.interface.d.ts +11 -15
- package/dist/repositories/base-db.repo.interface.js.map +1 -1
- package/dist/repositories/base-db.repo.js.map +1 -1
- package/dist/repositories/base-es.repo.d.ts +3 -1
- package/dist/repositories/base-es.repo.interface.d.ts +1 -1
- package/dist/repositories/base-es.repo.interface.js.map +1 -1
- package/dist/repositories/base-es.repo.js +26 -19
- package/dist/repositories/base-es.repo.js.map +1 -1
- package/dist/service/base.service.d.ts +3 -5
- package/dist/service/base.service.interface.d.ts +1 -1
- package/dist/service/base.service.interface.js.map +1 -1
- package/dist/service/base.service.js +7 -34
- package/dist/service/base.service.js.map +1 -1
- package/dist/utils/auth.util.d.ts +0 -2
- package/dist/utils/auth.util.js +0 -6
- package/dist/utils/auth.util.js.map +1 -1
- package/dist/utils/dynamodb.utils.d.ts +1 -7
- package/dist/utils/dynamodb.utils.js +6 -12
- package/dist/utils/dynamodb.utils.js.map +1 -1
- package/dist/utils/http.util.d.ts +1 -2
- package/dist/utils/http.util.js.map +1 -1
- package/dist/utils/validation.util.d.ts +10 -10
- package/dist/utils/validation.util.js +53 -80
- package/dist/utils/validation.util.js.map +1 -1
- package/package.json +1 -1
- package/dist/_examples/model/example.model.js.map +0 -1
- package/dist/_examples/repositories/supplier/suppler.model.js +0 -75
- package/dist/_examples/repositories/supplier/suppler.model.js.map +0 -1
- package/dist/model/schema-validator.d.ts +0 -27
- package/dist/model/schema-validator.js +0 -116
- package/dist/model/schema-validator.js.map +0 -1
- /package/dist/_examples/{model → model-shared}/example.model.d.ts +0 -0
- /package/dist/_examples/{model → model-shared}/example.model.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"e-order.config.js","sourceRoot":"","sources":["../../../../src/_examples/controller/e-order/e-order.config.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"e-order.config.js","sourceRoot":"","sources":["../../../../src/_examples/controller/e-order/e-order.config.ts"],"names":[],"mappings":";;;AAAA,4DAA8D;AAC9D,yCAA8F;AAC9F,8FAM0D;AAE1D,2BAA2B;AACd,QAAA,gBAAgB,GAAG;IAC9B,MAAM,EAAE,wGAAwG;IAChH,KAAK,EAAE,OAAO;CACf,CAAC;AACW,QAAA,IAAI,GAAG,WAAW,CAAC,CAAC,gBAAgB;AAEjD,sBAAsB;AACtB,MAAa,YAAa,SAAQ,8BAAgB;IAChD;QACE,WAAW;QACX,MAAM,SAAS,GAAG,uCAAuC,CAAC;QAC1D,MAAM,cAAc,GAAG,WAAW,CAAC;QACnC,MAAM,QAAQ,GAAG,IAAI,qBAAc,EAAE;aAClC,SAAS,CAAC,WAAW,CAAC;aACtB,GAAG,CAAC,cAAc,EAAE,EAAE,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,CAAC,YAAY,CAAC,EAAE,CAAC;aACrE,GAAG,CAAC,iBAAiB,EAAE,EAAE,KAAK,EAAE,eAAe,EAAE,OAAO,EAAE,CAAC,eAAe,CAAC,EAAE,CAAC;aAC9E,GAAG,CAAC,sBAAsB,EAAE,EAAE,KAAK,EAAE,oBA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,KAAK,CAAC,EAAE,QAAQ,EAAE,iDAAQ,EAAE;YACvF,EAAE,MAAM,EAAE,iBAAC,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,YAAI,EAAE,EAAE,MAAM,EAAE,CAAC,aAAC,CAAC,KAAK,CAAC,EAAE,SAAS,EAAE,gCAAM,EAAE,QAAQ,EAAE,iDAAQ,EAAE;YAC7F,EAAE,MAAM,EAAE,iBAAC,CAAC,GAAG,EAAE,IAAI,EAAE,GAAG,YAAI,OAAO,EAAE,MAAM,EAAE,CAAC,aAAC,CAAC,KAAK,CAAC,EAAE,SAAS,EAAE,iCAAO,EAAE,QAAQ,EAAE,iDAAQ,EAAE;YAClG,EAAE,MAAM,EAAE,iBAAC,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,YAAI,OAAO,EAAE,MAAM,EAAE,CAAC,aAAC,CAAC,KAAK,CAAC,EAAE,SAAS,EAAE,gCAAM,EAAE,QAAQ,EAAE,iDAAQ,EAAE;YACnG,EAAE,MAAM,EAAE,iBAAC,CAAC,MAAM,EAAE,IAAI,EAAE,GAAG,YAAI,OAAO,EAAE,MAAM,EAAE,CAAC,aAAC,CAAC,KAAK,CAAC,EAAE;SAC9D,CAAC;QAEF,OAAO;QACP,KAAK,CAAC,YAAI,EAAE,cAAc,CAAC,CAAC;QAC5B,IAAI,CAAC,WAAW,CAAC,SAAS,EAAE,cAAc,EAAE,QAAQ,CAAC;aAClD,aAAa,CAAC,wBAAgB,CAAC,MAAM,EAAE,wBAAgB,CAAC,KAAK,CAAC;aAC9D,WAAW,CAAC,UAAU,CAAC,CAAC;IAC7B,CAAC;CACF;AAnCD,oCAmCC;AAED,qCAAqC;AACxB,QAAA,cAAc,GAAG,IAAI,YAAY,EAAE,CAAC","sourcesContent":["import { EntityConfigImpl } from \"../../../model/base.config\";\nimport { Access as a, DynamoIndexMap, EndpointPolicy, HttpMethod as m } from \"@chinggis/core\";\nimport {\n CREATE,\n REPLACE,\n RESPONSE_FIELDS_DETAILS as FIELDS_D,\n RESPONSE_FIELDS_LIST as FIELDS_L,\n UPDATE,\n} from \"../../repositories/order/order-repo-db.interface\";\n\n// OpenSearch configuration\nexport const openSearch_order = {\n domain: \"https://search-amplify-opense-1ddfdekgbbpwe-kgxh6aum57h2wc4moozm2jcvom.ap-southeast-1.es.amazonaws.com\",\n index: \"order\",\n};\nexport const path = \"/e-orders\"; // url path base\n\n// Order configuration\nexport class EOrderConfig extends EntityConfigImpl {\n constructor() {\n // DYNAMODB\n const tableName = \"Order-y6r5xlyvorgtjjnyugtn4bz7ga-prod\";\n const ownerFieldName = \"profileId\";\n const indexMap = new DynamoIndexMap()\n .setFields(\"profileId\")\n .set(\"byClientType\", { field: \"clientType\", rFields: [\"clientType\"] })\n .set(\"byCompletedDate\", { field: \"completedDate\", rFields: [\"completedDate\"] })\n .set(\"byCompletedYearMonth\", { field: \"completedYearMonth\", rFields: [\"completedYearMonth\"] })\n .set(\"byLicenceId\", { field: \"licenceId\", rFields: [\"licenceId\"] })\n .set(\"byMonPayInvoice\", { field: \"monPayInvoiceId\", rFields: [\"monPayInvoiceId\"] })\n .set(\"byOdooNumber\", { field: \"odooNumber\", rFields: [\"odooNumber\"] })\n .set(\"byProfile\", { field: \"profileId\", rFields: [\"profileId\"] })\n .set(\"byRecipientPhone\", { field: \"recipientPhone\", rFields: [\"recipientPhone\"] })\n .set(\"bySocialInvoice\", { field: \"socialInvoiceId\", rFields: [\"socialInvoiceId\"] });\n\n // PERMISSIONS\n const adminGroupName = \"adminUsers\";\n const policyList: EndpointPolicy[] = [\n { method: m.GET, path: `${path}`, access: [a.ADMIN], response: FIELDS_L },\n { method: m.GET, path: `${path}/search`, access: [a.ADMIN], response: FIELDS_L },\n { method: m.GET, path: `${path}/{id}`, access: [a.OWNER, a.ADMIN], response: FIELDS_D },\n { method: m.POST, path: `${path}`, access: [a.ADMIN], validator: CREATE, response: FIELDS_D },\n { method: m.PUT, path: `${path}/{id}`, access: [a.ADMIN], validator: REPLACE, response: FIELDS_D },\n { method: m.PATCH, path: `${path}/{id}`, access: [a.ADMIN], validator: UPDATE, response: FIELDS_D },\n { method: m.DELETE, path: `${path}/{id}`, access: [a.ADMIN] },\n ];\n\n // INIT\n super(path, adminGroupName);\n this.setDynamoDB(tableName, ownerFieldName, indexMap)\n .setOpenSearch(openSearch_order.domain, openSearch_order.index)\n .setPolicies(policyList);\n }\n}\n\n// Export default Order configuration\nexport const CONFIG_E_ORDER = new EOrderConfig();\n"]}
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.CONFIG_SUPPLIER = exports.SupplierConfig = exports.path = exports.openSearch_supplier = void 0;
|
|
4
|
-
const base_config_1 = require("../../../model/base.config");
|
|
5
4
|
const core_1 = require("../../../index.js");
|
|
6
|
-
const suppler_model_1 = require("../../
|
|
5
|
+
const suppler_model_1 = require("../../model-shared/suppler.model");
|
|
7
6
|
exports.openSearch_supplier = {
|
|
8
7
|
domain: "https://search-amplify-opense-1qu4zfdauaeh1-ncvbubjnpcsfempstbsykhoadi.ap-southeast-1.es.amazonaws.com",
|
|
9
8
|
index: "saccount",
|
|
10
9
|
};
|
|
11
10
|
exports.path = "/supplier/accounts"; // url path base
|
|
12
11
|
// Supplier configuration
|
|
13
|
-
class SupplierConfig extends
|
|
12
|
+
class SupplierConfig extends core_1.EntityConfigImpl {
|
|
14
13
|
constructor() {
|
|
15
14
|
// DYNAMODB
|
|
16
15
|
const tableName = "SAccount-2i5o74z4mjf6lpabqp7myrkdre-dev";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"supplier-config.js","sourceRoot":"","sources":["../../../../src/_examples/controller/supplier/supplier-config.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"supplier-config.js","sourceRoot":"","sources":["../../../../src/_examples/controller/supplier/supplier-config.ts"],"names":[],"mappings":";;;AAAA,yCAAgH;AAChH,oEAM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,EAAE,iBAAC,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,YAAI,EAAE,EAAE,MAAM,EAAE,CAAC,aAAC,CAAC,KAAK,CAAC,EAAE,SAAS,EAAE,sBAAM,EAAE,QAAQ,EAAE,uCAAQ,EAAE;YAC7F,EAAE,MAAM,EAAE,iBAAC,CAAC,GAAG,EAAE,IAAI,EAAE,GAAG,YAAI,OAAO,EAAE,MAAM,EAAE,CAAC,aAAC,CAAC,KAAK,CAAC,EAAE,SAAS,EAAE,uBAAO,EAAE,QAAQ,EAAE,uCAAQ,EAAE;YAClG,EAAE,MAAM,EAAE,iBAAC,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,YAAI,OAAO,EAAE,MAAM,EAAE,CAAC,aAAC,CAAC,KAAK,CAAC,EAAE,SAAS,EAAE,sBAAM,EAAE,QAAQ,EAAE,uCAAQ,EAAE;YACnG,EAAE,MAAM,EAAE,iBAAC,CAAC,MAAM,EAAE,IAAI,EAAE,GAAG,YAAI,OAAO,EAAE,MAAM,EAAE,CAAC,aAAC,CAAC,KAAK,CAAC,EAAE;SAC9D,CAAC;QAEF,OAAO;QACP,KAAK,CAAC,YAAI,EAAE,cAAc,CAAC,CAAC;QAC5B,IAAI,CAAC,WAAW,CAAC,SAAS,EAAE,cAAc,EAAE,QAAQ,CAAC;aAClD,aAAa,CAAC,2BAAmB,CAAC,MAAM,EAAE,2BAAmB,CAAC,KAAK,CAAC;aACpE,WAAW,CAAC,UAAU,CAAC,CAAC;IAC7B,CAAC;CACF;AA5BD,wCA4BC;AAED,wCAAwC;AAC3B,QAAA,eAAe,GAAG,IAAI,cAAc,EAAE,CAAC","sourcesContent":["import { Access as a, DynamoIndexMap, EndpointPolicy, EntityConfigImpl, HttpMethod as m } from \"@chinggis/core\";\nimport {\n CREATE,\n REPLACE,\n RESPONSE_FIELDS_DETAILS as FIELDS_D,\n RESPONSE_FIELDS_LIST as FIELDS_L,\n UPDATE,\n} from \"../../model-shared/suppler.model\";\n\nexport const openSearch_supplier = {\n domain: \"https://search-amplify-opense-1qu4zfdauaeh1-ncvbubjnpcsfempstbsykhoadi.ap-southeast-1.es.amazonaws.com\",\n index: \"saccount\",\n};\nexport const path = \"/supplier/accounts\"; // url path base\n\n// Supplier configuration\nexport class SupplierConfig extends EntityConfigImpl {\n constructor() {\n // DYNAMODB\n const tableName = \"SAccount-2i5o74z4mjf6lpabqp7myrkdre-dev\";\n const ownerFieldName = \"username\";\n const indexMap = new DynamoIndexMap()\n .setFields(\"username\")\n .set(\"byAccountType\", { field: \"accountType\", rFields: [\"accountType\"] });\n\n // PERMISSIONS\n const adminGroupName = \"adminUsers\";\n const policyList: EndpointPolicy[] = [\n { method: m.GET, path: `${path}`, access: [a.ADMIN], response: FIELDS_L },\n { method: m.GET, path: `${path}/search`, access: [a.ADMIN], response: FIELDS_L },\n { method: m.GET, path: `${path}/list-non-level-one`, access: [a.ADMIN], response: FIELDS_L },\n { method: m.GET, path: `${path}/{id}`, access: [a.OWNER, a.ADMIN], response: FIELDS_D },\n { method: m.POST, path: `${path}`, access: [a.ADMIN], validator: CREATE, response: FIELDS_D },\n { method: m.PUT, path: `${path}/{id}`, access: [a.ADMIN], validator: REPLACE, response: FIELDS_D },\n { method: m.PATCH, path: `${path}/{id}`, access: [a.ADMIN], validator: UPDATE, response: FIELDS_D },\n { method: m.DELETE, path: `${path}/{id}`, access: [a.ADMIN] },\n ];\n\n // INIT\n super(path, adminGroupName);\n this.setDynamoDB(tableName, ownerFieldName, indexMap)\n .setOpenSearch(openSearch_supplier.domain, openSearch_supplier.index)\n .setPolicies(policyList);\n }\n}\n\n// Export default Supplier configuration\nexport const CONFIG_SUPPLIER = new SupplierConfig();\n"]}
|
|
@@ -66,7 +66,7 @@ let SupplierController = class SupplierController extends core_1.BaseController
|
|
|
66
66
|
}
|
|
67
67
|
processCrudRequest(event) {
|
|
68
68
|
return __awaiter(this, void 0, void 0, function* () {
|
|
69
|
-
log.debug(`processCrudRequest: ${JSON.stringify(event, null, 2)}`);
|
|
69
|
+
log.debug(`_example processCrudRequest: ${JSON.stringify(event, null, 2)}`);
|
|
70
70
|
if (this.resourcePath === `GET ${supplier_config_1.path}/list-non-level-one`) {
|
|
71
71
|
return yield this.service.ListNonLevelOne(this.request.filterAndSort);
|
|
72
72
|
}
|
|
@@ -82,7 +82,7 @@ let SupplierController = class SupplierController extends core_1.BaseController
|
|
|
82
82
|
}
|
|
83
83
|
if (this.resourcePath === `PUT ${supplier_config_1.path}/convert-to-cognito` && this.isAdmin) {
|
|
84
84
|
const { username, email } = this.request.body;
|
|
85
|
-
log.debug(`convert to cognito user: ${username}, email: ${email}`);
|
|
85
|
+
log.debug(`_example convert to cognito user: ${username}, email: ${email}`);
|
|
86
86
|
}
|
|
87
87
|
});
|
|
88
88
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"supplier-controller.js","sourceRoot":"","sources":["../../../../src/_examples/controller/supplier/supplier-controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iDAA4C;AAS5C,uDAA0D;AAC1D,yCAAgD;AAGhD,mDAAiD;AAG1C,IAAM,kBAAkB,GAAxB,MAAM,kBAAmB,SAAQ,qBAA+B;IACrE;QACE,MAAM,OAAO,GAAoB,gBAAS,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;QAClE,KAAK,CAAC,OAAO,EAAE,iCAAe,CAAC,QAAQ,EAAE,CAAC,CAAC;IAC7C,CAAC;IAES,eAAe,CAAC,QAAkB;QAC1C,MAAM,IAAI,KAAK,CAAC,2BAA2B,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;IAClF,CAAC;IAEe,kBAAkB,CAAC,KAA2B;;YAC5D,GAAG,CAAC,KAAK,CAAC,
|
|
1
|
+
{"version":3,"file":"supplier-controller.js","sourceRoot":"","sources":["../../../../src/_examples/controller/sup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AC,GAAG,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;gBAC1C,CAAC;YACH,CAAC;YAED,IAAI,IAAI,CAAC,YAAY,KAAK,OAAO,sBAAI,qBAAqB,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;gBAC3E,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC;gBAC9C,GAAG,CAAC,KAAK,CAAC,qCAAqC,QAAQ,YAAY,KAAK,EAAE,CAAC,CAAC;YAC9E,CAAC;QACH,CAAC;KAAA;IAES,kBAAkB,CAAC,KAA0B;QACrD,MAAM,IAAI,KAAK,CAAC,2BAA2B,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;IAC/E,CAAC;IAEe,qBAAqB,CAAC,KAAqB;;YACzD,MAAM,IAAI,KAAK,CAAC,2BAA2B,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;QAC/E,CAAC;KAAA;IACS,qBAAqB,CAAC,KAAsC;QACpE,MAAM,IAAI,KAAK,CAAC,2BAA2B,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;IAC/E,CAAC;CACF,CAAA;AA1CY,gDAAkB;6BAAlB,kBAAkB;IAD9B,IAAA,gBAAO,EAAC,oBAAoB,CAAC;;GACjB,kBAAkB,CA0C9B","sourcesContent":["import Container, { Service } from \"typedi\";\n\nimport {\n APIGatewayProxyEvent,\n APIGatewayProxyWebsocketEventV2,\n DynamoDBStreamEvent,\n ScheduledEvent,\n SQSEvent,\n} from \"aws-lambda\";\nimport { CONFIG_SUPPLIER, path } from \"./supplier-config\";\nimport { BaseController } from \"@chinggis/core\";\n\nimport { SupplierService } from \"../../service/supplier/supplier-service.interface\";\nimport \"../../service/supplier/supplier-service\";\n\n@Service(\"SupplierController\")\nexport class SupplierController extends BaseController<SupplierService> {\n constructor() {\n const service: SupplierService = Container.get(\"SupplierService\");\n super(service, CONFIG_SUPPLIER.toObject());\n }\n\n protected processSQSEvent(sqsEvent: SQSEvent): Promise<any> {\n throw new Error(`Method not implemented. ${JSON.stringify(sqsEvent, null, 2)}`);\n }\n\n protected async processCrudRequest(event: APIGatewayProxyEvent): Promise<any> {\n log.debug(`_example processCrudRequest: ${JSON.stringify(event, null, 2)}`);\n\n if (this.resourcePath === `GET ${path}/list-non-level-one`) {\n return await this.service.ListNonLevelOne(this.request.filterAndSort);\n }\n if (this.resourcePath === `GET ${path}/find-all`) {\n this.service.setConfig(CONFIG_SUPPLIER.toObject());\n try {\n // return await this.service.findAll();\n return await this.service.search(this.request.filterAndSort);\n } catch (err) {\n log.error(JSON.stringify(err, null, 2));\n }\n }\n\n if (this.resourcePath === `PUT ${path}/convert-to-cognito` && this.isAdmin) {\n const { username, email } = this.request.body;\n log.debug(`_example convert to cognito user: ${username}, email: ${email}`);\n }\n }\n\n protected processStreamEvent(event: DynamoDBStreamEvent): Promise<void> {\n throw new Error(`Method not implemented. ${JSON.stringify(event, null, 2)}`);\n }\n\n protected async processScheduledEvent(event: ScheduledEvent): Promise<void> {\n throw new Error(`Method not implemented. ${JSON.stringify(event, null, 2)}`);\n }\n protected processWebSocketEvent(event: APIGatewayProxyWebsocketEventV2): Promise<void> {\n throw new Error(`Method not implemented. ${JSON.stringify(event, null, 2)}`);\n }\n}\n"]}
|
|
@@ -60,6 +60,9 @@ let HelperCDI = class HelperCDI {
|
|
|
60
60
|
}
|
|
61
61
|
process(event) {
|
|
62
62
|
return __awaiter(this, void 0, void 0, function* () {
|
|
63
|
+
log.debug("_example event start----------------------------------------\n");
|
|
64
|
+
log.debug(JSON.stringify(event, null, 2));
|
|
65
|
+
log.debug("_example event end ----------------------------------------\n\n");
|
|
63
66
|
return this.controller.resolveCrudRequest(event);
|
|
64
67
|
});
|
|
65
68
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"supplier-crud.js","sourceRoot":"","sources":["../../../../src/_examples/controller/supplier/supplier-crud.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,4BAA0B;AAC1B,iDAA4C;AAI5C,iCAA+B;AAExB,MAAM,OAAO,GAAG,CAAC,KAA2B,EAAE,EAAE,CAAC,gBAAS,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAAnF,QAAA,OAAO,WAA4E;AAGhG,IAAM,SAAS,GAAf,MAAM,SAAS;IAAf;QACmB,eAAU,GAAuB,gBAAS,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"supplier-crud.js","sourceRoot":"","sources":["../../../../src/_examples/controller/supplier/supplier-crud.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,4BAA0B;AAC1B,iDAA4C;AAI5C,iCAA+B;AAExB,MAAM,OAAO,GAAG,CAAC,KAA2B,EAAE,EAAE,CAAC,gBAAS,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAAnF,QAAA,OAAO,WAA4E;AAGhG,IAAM,SAAS,GAAf,MAAM,SAAS;IAAf;QACmB,eAAU,GAAuB,gBAAS,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC;IAQxF,CAAC;IANO,OAAO,CAAC,KAA2B;;YACvC,GAAG,CAAC,KAAK,CAAC,gEAAgE,CAAC,CAAC;YAC5E,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;YAC1C,GAAG,CAAC,KAAK,CAAC,kEAAkE,CAAC,CAAC;YAC9E,OAAO,IAAI,CAAC,UAAU,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC;QACnD,CAAC;KAAA;CACF,CAAA;AATK,SAAS;IADd,IAAA,gBAAO,GAAE;GACJ,SAAS,CASd","sourcesContent":["import \"reflect-metadata\";\nimport Container, { Service } from \"typedi\";\nimport { APIGatewayProxyEvent } from \"aws-lambda\";\n\nimport { SupplierController } from \"./supplier-controller\";\nimport \"./supplier-controller\";\n\nexport const handler = (event: APIGatewayProxyEvent) => Container.get(HelperCDI).process(event);\n\n@Service()\nclass HelperCDI {\n private readonly controller: SupplierController = Container.get(\"SupplierController\");\n\n async process(event: APIGatewayProxyEvent) {\n log.debug(\"_example event start----------------------------------------\\n\");\n log.debug(JSON.stringify(event, null, 2));\n log.debug(\"_example event end ----------------------------------------\\n\\n\");\n return this.controller.resolveCrudRequest(event);\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"example.model.js","sourceRoot":"","sources":["../../../src/_examples/model-shared/example.model.ts"],"names":[],"mappings":";;;AAEA,IAAY,MAIX;AAJD,WAAY,MAAM;IAChB,qBAAW,CAAA;IACX,uBAAa,CAAA;IACb,qCAA2B,CAAA;AAC7B,CAAC,EAJW,MAAM,sBAAN,MAAM,QAIjB","sourcesContent":["import { BaseEntity } from \"../../model/base.model\";\n\nexport enum Gender {\n boy = \"boy\",\n girl = \"girl\",\n unspecified = \"unspecified\",\n}\n\nexport interface Profile extends BaseEntity {\n email?: string | null;\n emailVerified?: boolean | null;\n phone?: string | null;\n toVerifyPhone?: string | null;\n phoneVerified?: boolean | null;\n phoneVerificationCode?: string | null;\n providerIds?: Array<string | null> | null;\n firstName?: string | null;\n lastName?: string | null;\n birthDate?: string | null;\n gender?: Gender | null;\n facebook?: string | null;\n google?: string | null;\n apple?: string | null;\n cardNumber?: string | null;\n cardIssued?: string | null;\n initialPurchaseAmount?: number | null;\n initialUsedPoint?: number | null;\n initialAvailablePoint?: number | null;\n availablePoint: number;\n cardPin?: string | null;\n cardPinVerified?: boolean | null;\n loyaltyPercentage?: number | null;\n devices?: Array<string | null> | null;\n boughtEntityIds?: Array<string | null> | null;\n oldPhoneNumbers?: Array<string | null> | null;\n note: string;\n}\n\nexport interface User extends BaseEntity {\n firstName: string;\n lastName: string;\n email: string;\n}\nexport interface Order extends BaseEntity {\n profileId: string;\n //todo\n}\n\nexport interface OrderItem extends BaseEntity {\n profileId: string;\n orderId: string;\n //todo\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { ResponseFields } from "
|
|
2
|
+
import { ResponseFields } from "../../index.js";
|
|
3
3
|
export type SAccount = {
|
|
4
4
|
__typename: "SAccount";
|
|
5
5
|
username: string;
|
|
@@ -31,51 +31,7 @@ export type SAccount = {
|
|
|
31
31
|
accountType: AccountType;
|
|
32
32
|
digitalCommissionRate?: number | null;
|
|
33
33
|
};
|
|
34
|
-
export interface ResponseDTO_details_SAccount {
|
|
35
|
-
username: string;
|
|
36
|
-
email?: string | null;
|
|
37
|
-
firstName?: string | null;
|
|
38
|
-
lastName?: string | null;
|
|
39
|
-
phoneList?: Array<string | null> | null;
|
|
40
|
-
company?: boolean | null;
|
|
41
|
-
taxPayer?: boolean | null;
|
|
42
|
-
addresses?: ModelAddressConnection | null;
|
|
43
|
-
accountType: AccountType;
|
|
44
|
-
loginStatus?: SLoginStatus | null;
|
|
45
|
-
level3date?: string | null;
|
|
46
|
-
availableCreateOrder?: boolean | null;
|
|
47
|
-
validUntil?: string | null;
|
|
48
|
-
createdAt?: string | null;
|
|
49
|
-
updatedAt?: string | null;
|
|
50
|
-
updatedBy?: string | null;
|
|
51
|
-
bankName?: string | null;
|
|
52
|
-
bankAccountNumber?: string | null;
|
|
53
|
-
bankReceiverName?: string | null;
|
|
54
|
-
internomPercent?: number | null;
|
|
55
|
-
feeWarehouse?: number | null;
|
|
56
|
-
feeSales?: Array<SupplierFee | null> | null;
|
|
57
|
-
feeTransport?: Array<SupplierFee | null> | null;
|
|
58
|
-
feeSOrder?: number | null;
|
|
59
|
-
feeReceivablesPercent?: number | null;
|
|
60
|
-
feePaymentPercent?: number | null;
|
|
61
|
-
digitalCommissionRate?: number | null;
|
|
62
|
-
}
|
|
63
34
|
export declare const RESPONSE_FIELDS_DETAILS: ResponseFields;
|
|
64
|
-
export interface ResponseDTO_list_SAccount {
|
|
65
|
-
username: string;
|
|
66
|
-
email?: string | null;
|
|
67
|
-
company?: boolean | null;
|
|
68
|
-
firstName?: string | null;
|
|
69
|
-
lastName?: string | null;
|
|
70
|
-
phoneList?: Array<string | null> | null;
|
|
71
|
-
taxPayer?: boolean | null;
|
|
72
|
-
accountType: AccountType;
|
|
73
|
-
loginStatus?: SLoginStatus | null;
|
|
74
|
-
validUntil?: string | null;
|
|
75
|
-
createdAt?: string | null;
|
|
76
|
-
updatedAt?: string | null;
|
|
77
|
-
updatedBy?: SAccountUpdatedBy | null;
|
|
78
|
-
}
|
|
79
35
|
export declare const RESPONSE_FIELDS_LIST: ResponseFields;
|
|
80
36
|
export declare enum SLoginStatus {
|
|
81
37
|
cognitoNotCreated = "cognitoNotCreated",
|
|
@@ -126,93 +82,116 @@ export type Address = {
|
|
|
126
82
|
createdAt?: string | null;
|
|
127
83
|
updatedAt?: string | null;
|
|
128
84
|
};
|
|
129
|
-
export declare const CREATE: z.ZodObject<{
|
|
85
|
+
export declare const CREATE: z.ZodEffects<z.ZodObject<{
|
|
130
86
|
username: z.ZodString;
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
updatedBy: z.ZodOptional<z.ZodNullable<z.ZodAny>>;
|
|
151
|
-
level3date: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
87
|
+
firstName: z.ZodString;
|
|
88
|
+
lastName: z.ZodOptional<z.ZodString>;
|
|
89
|
+
email: z.ZodOptional<z.ZodString>;
|
|
90
|
+
phoneList: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
91
|
+
company: z.ZodBoolean;
|
|
92
|
+
accountType: z.ZodEnum<["level1", "level2", "level3", "level4"]>;
|
|
93
|
+
taxPayer: z.ZodBoolean;
|
|
94
|
+
isForeign: z.ZodOptional<z.ZodBoolean>;
|
|
95
|
+
feeReceivablesPercent: z.ZodNumber;
|
|
96
|
+
feeSOrder: z.ZodNumber;
|
|
97
|
+
internomPercent: z.ZodNumber;
|
|
98
|
+
digitalCommissionRate: z.ZodNumber;
|
|
99
|
+
feeTransport: z.ZodNumber;
|
|
100
|
+
feeWarehouse: z.ZodNumber;
|
|
101
|
+
feeSales: z.ZodOptional<z.ZodArray<z.ZodAny, "many">>;
|
|
102
|
+
bankName: z.ZodOptional<z.ZodString>;
|
|
103
|
+
bankAccountNumber: z.ZodOptional<z.ZodString>;
|
|
104
|
+
bankReceiverName: z.ZodOptional<z.ZodString>;
|
|
105
|
+
availableCreateOrder: z.ZodBoolean;
|
|
152
106
|
validUntil: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
153
|
-
feeReceivablesPercent: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
154
|
-
feePaymentPercent: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
155
|
-
addresses: z.ZodOptional<z.ZodNullable<z.ZodAny>>;
|
|
156
|
-
accountType: z.ZodAny;
|
|
157
|
-
digitalCommissionRate: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
158
107
|
}, "strip", z.ZodTypeAny, {
|
|
159
|
-
createdAt?: string;
|
|
160
|
-
updatedAt?: string;
|
|
161
|
-
updatedBy?: any;
|
|
162
108
|
email?: string;
|
|
163
109
|
firstName?: string;
|
|
164
110
|
lastName?: string;
|
|
165
|
-
emailDeliveryFailed?: boolean;
|
|
166
111
|
username?: string;
|
|
167
112
|
company?: boolean;
|
|
168
113
|
taxPayer?: boolean;
|
|
169
|
-
accountType?:
|
|
114
|
+
accountType?: "level1" | "level2" | "level3" | "level4";
|
|
170
115
|
validUntil?: string;
|
|
171
|
-
internomPercent?: number;
|
|
172
|
-
availableCreateOrder?: boolean;
|
|
173
116
|
phoneList?: string[];
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
feeSales?: any[];
|
|
177
|
-
feeTransport?: any[];
|
|
117
|
+
isForeign?: boolean;
|
|
118
|
+
feeReceivablesPercent?: number;
|
|
178
119
|
feeSOrder?: number;
|
|
120
|
+
internomPercent?: number;
|
|
121
|
+
digitalCommissionRate?: number;
|
|
122
|
+
feeTransport?: number;
|
|
123
|
+
feeWarehouse?: number;
|
|
124
|
+
feeSales?: any[];
|
|
179
125
|
bankName?: string;
|
|
180
126
|
bankAccountNumber?: string;
|
|
181
127
|
bankReceiverName?: string;
|
|
182
|
-
|
|
183
|
-
feeReceivablesPercent?: number;
|
|
184
|
-
feePaymentPercent?: number;
|
|
185
|
-
addresses?: any;
|
|
186
|
-
digitalCommissionRate?: number;
|
|
128
|
+
availableCreateOrder?: boolean;
|
|
187
129
|
}, {
|
|
188
|
-
createdAt?: string;
|
|
189
|
-
updatedAt?: string;
|
|
190
|
-
updatedBy?: any;
|
|
191
130
|
email?: string;
|
|
192
131
|
firstName?: string;
|
|
193
132
|
lastName?: string;
|
|
194
|
-
emailDeliveryFailed?: boolean;
|
|
195
133
|
username?: string;
|
|
196
134
|
company?: boolean;
|
|
197
135
|
taxPayer?: boolean;
|
|
198
|
-
accountType?:
|
|
136
|
+
accountType?: "level1" | "level2" | "level3" | "level4";
|
|
199
137
|
validUntil?: string;
|
|
138
|
+
phoneList?: string[];
|
|
139
|
+
isForeign?: boolean;
|
|
140
|
+
feeReceivablesPercent?: number;
|
|
141
|
+
feeSOrder?: number;
|
|
200
142
|
internomPercent?: number;
|
|
143
|
+
digitalCommissionRate?: number;
|
|
144
|
+
feeTransport?: number;
|
|
145
|
+
feeWarehouse?: number;
|
|
146
|
+
feeSales?: any[];
|
|
147
|
+
bankName?: string;
|
|
148
|
+
bankAccountNumber?: string;
|
|
149
|
+
bankReceiverName?: string;
|
|
201
150
|
availableCreateOrder?: boolean;
|
|
151
|
+
}>, {
|
|
152
|
+
email?: string;
|
|
153
|
+
firstName?: string;
|
|
154
|
+
lastName?: string;
|
|
155
|
+
username?: string;
|
|
156
|
+
company?: boolean;
|
|
157
|
+
taxPayer?: boolean;
|
|
158
|
+
accountType?: "level1" | "level2" | "level3" | "level4";
|
|
159
|
+
validUntil?: string;
|
|
202
160
|
phoneList?: string[];
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
feeSales?: any[];
|
|
206
|
-
feeTransport?: any[];
|
|
161
|
+
isForeign?: boolean;
|
|
162
|
+
feeReceivablesPercent?: number;
|
|
207
163
|
feeSOrder?: number;
|
|
164
|
+
internomPercent?: number;
|
|
165
|
+
digitalCommissionRate?: number;
|
|
166
|
+
feeTransport?: number;
|
|
167
|
+
feeWarehouse?: number;
|
|
168
|
+
feeSales?: any[];
|
|
208
169
|
bankName?: string;
|
|
209
170
|
bankAccountNumber?: string;
|
|
210
171
|
bankReceiverName?: string;
|
|
211
|
-
|
|
172
|
+
availableCreateOrder?: boolean;
|
|
173
|
+
}, {
|
|
174
|
+
email?: string;
|
|
175
|
+
firstName?: string;
|
|
176
|
+
lastName?: string;
|
|
177
|
+
username?: string;
|
|
178
|
+
company?: boolean;
|
|
179
|
+
taxPayer?: boolean;
|
|
180
|
+
accountType?: "level1" | "level2" | "level3" | "level4";
|
|
181
|
+
validUntil?: string;
|
|
182
|
+
phoneList?: string[];
|
|
183
|
+
isForeign?: boolean;
|
|
212
184
|
feeReceivablesPercent?: number;
|
|
213
|
-
|
|
214
|
-
|
|
185
|
+
feeSOrder?: number;
|
|
186
|
+
internomPercent?: number;
|
|
215
187
|
digitalCommissionRate?: number;
|
|
188
|
+
feeTransport?: number;
|
|
189
|
+
feeWarehouse?: number;
|
|
190
|
+
feeSales?: any[];
|
|
191
|
+
bankName?: string;
|
|
192
|
+
bankAccountNumber?: string;
|
|
193
|
+
bankReceiverName?: string;
|
|
194
|
+
availableCreateOrder?: boolean;
|
|
216
195
|
}>;
|
|
217
196
|
export declare const UPDATE: z.ZodObject<{
|
|
218
197
|
username: z.ZodString;
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.REPLACE = exports.UPDATE = exports.CREATE = exports.AccountType = exports.SLoginStatus = exports.RESPONSE_FIELDS_LIST = exports.RESPONSE_FIELDS_DETAILS = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
exports.RESPONSE_FIELDS_DETAILS = {
|
|
6
|
+
exclude: ["__typename", "emailDeliveryFailed", "z", "a"],
|
|
7
|
+
};
|
|
8
|
+
exports.RESPONSE_FIELDS_LIST = {
|
|
9
|
+
include: [
|
|
10
|
+
"username",
|
|
11
|
+
"email",
|
|
12
|
+
"company",
|
|
13
|
+
"firstName",
|
|
14
|
+
"lastName",
|
|
15
|
+
// "phoneList",
|
|
16
|
+
"taxPayer",
|
|
17
|
+
"accountType",
|
|
18
|
+
// "loginStatus",
|
|
19
|
+
"validUntil",
|
|
20
|
+
"createdAt",
|
|
21
|
+
"updatedAt",
|
|
22
|
+
"updatedBy",
|
|
23
|
+
],
|
|
24
|
+
};
|
|
25
|
+
var SLoginStatus;
|
|
26
|
+
(function (SLoginStatus) {
|
|
27
|
+
SLoginStatus["cognitoNotCreated"] = "cognitoNotCreated";
|
|
28
|
+
SLoginStatus["pending"] = "pending";
|
|
29
|
+
SLoginStatus["confirmed"] = "confirmed";
|
|
30
|
+
})(SLoginStatus || (exports.SLoginStatus = SLoginStatus = {}));
|
|
31
|
+
var AccountType;
|
|
32
|
+
(function (AccountType) {
|
|
33
|
+
AccountType["level1"] = "level1";
|
|
34
|
+
AccountType["level2"] = "level2";
|
|
35
|
+
AccountType["level3"] = "level3";
|
|
36
|
+
AccountType["level4"] = "level4";
|
|
37
|
+
})(AccountType || (exports.AccountType = AccountType = {}));
|
|
38
|
+
// VALIDATORS
|
|
39
|
+
exports.CREATE = zod_1.z
|
|
40
|
+
.object({
|
|
41
|
+
// Хувь хүний мэдээлэл
|
|
42
|
+
username: zod_1.z.string().min(1, { message: "Хэрэглэгчийн нэр хоосон байж болохгүй" }),
|
|
43
|
+
firstName: zod_1.z.string().min(1, { message: "Овог хоосон байж болохгүй" }),
|
|
44
|
+
lastName: zod_1.z.string().optional(),
|
|
45
|
+
email: zod_1.z.string().email({ message: "Имэйл хаяг буруу байна" }).optional(),
|
|
46
|
+
phoneList: zod_1.z.array(zod_1.z.string().min(1, { message: "Утасны дугаар хоосон байж болохгүй" })).optional(),
|
|
47
|
+
// Байгууллагын мэдээлэл
|
|
48
|
+
company: zod_1.z.boolean(),
|
|
49
|
+
accountType: zod_1.z.enum(["level1", "level2", "level3", "level4"], {
|
|
50
|
+
errorMap: () => ({ message: "Бүртгэлийн төрөл буруу байна" }),
|
|
51
|
+
}),
|
|
52
|
+
taxPayer: zod_1.z.boolean(),
|
|
53
|
+
isForeign: zod_1.z.boolean().optional(),
|
|
54
|
+
// Шиймтгэлийн мэдээлэл мэдээлэл
|
|
55
|
+
feeReceivablesPercent: zod_1.z.number().nonnegative({ message: "Хүснэгтийн хувь буруу байна" }),
|
|
56
|
+
feeSOrder: zod_1.z.number().nonnegative({ message: "Захиалгын хураамж буруу байна" }),
|
|
57
|
+
internomPercent: zod_1.z.number().min(0).max(100, { message: "Internom хувь 0-100 хооронд байх ёстой" }),
|
|
58
|
+
digitalCommissionRate: zod_1.z.number().min(0).max(100, { message: "Дижитал комиссын хувь 0-100 хооронд байх ёстой" }),
|
|
59
|
+
feeTransport: zod_1.z.number().nonnegative({ message: "Тээврийн хураамж буруу байна" }),
|
|
60
|
+
feeWarehouse: zod_1.z.number().nonnegative({ message: "Агуулахын хураамж буруу байна" }),
|
|
61
|
+
feeSales: zod_1.z.array(zod_1.z.any()).optional(),
|
|
62
|
+
// Банкны мэдээлэл
|
|
63
|
+
bankName: zod_1.z.string().optional(),
|
|
64
|
+
bankAccountNumber: zod_1.z.string().optional(),
|
|
65
|
+
bankReceiverName: zod_1.z.string().optional(),
|
|
66
|
+
// Захиалга ба хүчинтэй хугацаа
|
|
67
|
+
availableCreateOrder: zod_1.z.boolean(),
|
|
68
|
+
validUntil: zod_1.z.string().nullable().optional(),
|
|
69
|
+
})
|
|
70
|
+
.superRefine((data, ctx) => {
|
|
71
|
+
if (!data.company && (!data.lastName || data.lastName.trim() === "")) {
|
|
72
|
+
ctx.addIssue({
|
|
73
|
+
path: ["lastName"],
|
|
74
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
75
|
+
message: "Овог хоосон байж болохгүй",
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
exports.UPDATE = zod_1.z.object({
|
|
80
|
+
username: zod_1.z.string(),
|
|
81
|
+
});
|
|
82
|
+
exports.REPLACE = zod_1.z.object({
|
|
83
|
+
username: zod_1.z.string(),
|
|
84
|
+
});
|
|
85
|
+
//# sourceMappingURL=suppler.model.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"suppler.model.js","sourceRoot":"","sources":["../../../src/_examples/model-shared/suppler.model.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAmCX,QAAA,uBAAuB,GAAmB;IACrD,OAAO,EAAE,CAAC,YAAY,EAAE,qBAAqB,EAAE,GAAG,EAAE,GAAG,CAAC;CACzD,CAAC;AAEW,QAAA,oBAAoB,GAAmB;IAClD,OAAO,EAAE;QACP,UAAU;QACV,OAAO;QACP,SAAS;QACT,WAAW;QACX,UAAU;QACV,kBAAkB;QAClB,UAAU;QACV,aAAa;QACb,oBAAoB;QACpB,YAAY;QACZ,WAAW;QACX,WAAW;QACX,WAAW;KACZ;CACF,CA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D,WAAW,CAAC,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE;IACzB,IAAI,CAAC,IAAI,CAAC,OAAO,IAAI,CAAC,CAAC,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;QACrE,GAAG,CAAC,QAAQ,CAAC;YACX,IAAI,EAAE,CAAC,UAAU,CAAC;YAClB,IAAI,EAAE,OAAC,CAAC,YAAY,CAAC,MAAM;YAC3B,OAAO,EAAE,2BAA2B;SACrC,CAAC,CAAC;IACL,CAAC;AACH,CAAC,CAAC,CAAC;AAEQ,QAAA,MAAM,GAAG,OAAC,CAAC,MAAM,CAAC;IAC7B,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE;CACrB,CAAC,CAAC;AACU,QAAA,OAAO,GAAG,OAAC,CAAC,MAAM,CAAC;IAC9B,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE;CACrB,CAAC,CAAC","sourcesContent":["import { z } from \"zod\";\nimport { ResponseFields } from \"@chinggis/core\";\n\nexport type SAccount = {\n __typename: \"SAccount\";\n username: string;\n email?: string | null;\n emailDeliveryFailed?: boolean | null;\n internomPercent?: number | null;\n firstName?: string | null;\n lastName?: string | null;\n availableCreateOrder?: boolean | null;\n phoneList?: Array<string | null> | null;\n loginStatus?: SLoginStatus | null;\n feeWarehouse?: Array<SupplierFee | null> | null;\n feeSales?: Array<SupplierFee | null> | null;\n feeTransport?: Array<SupplierFee | null> | null;\n feeSOrder?: number | null;\n taxPayer?: boolean | null;\n company?: boolean | null;\n bankName?: string | null;\n bankAccountNumber?: string | null;\n bankReceiverName?: string | null;\n createdAt?: string | null;\n updatedAt?: string | null;\n updatedBy?: SAccountUpdatedBy | null;\n level3date?: string | null;\n validUntil?: string | null;\n feeReceivablesPercent?: number | null;\n feePaymentPercent?: number | null;\n addresses?: ModelAddressConnection | null;\n accountType: AccountType;\n digitalCommissionRate?: number | null;\n};\n\nexport const RESPONSE_FIELDS_DETAILS: ResponseFields = {\n exclude: [\"__typename\", \"emailDeliveryFailed\", \"z\", \"a\"],\n};\n\nexport const RESPONSE_FIELDS_LIST: ResponseFields = {\n include: [\n \"username\",\n \"email\",\n \"company\",\n \"firstName\",\n \"lastName\",\n // \"phoneList\",\n \"taxPayer\",\n \"accountType\",\n // \"loginStatus\",\n \"validUntil\",\n \"createdAt\",\n \"updatedAt\",\n \"updatedBy\",\n ],\n};\n\nexport enum SLoginStatus {\n cognitoNotCreated = \"cognitoNotCreated\",\n pending = \"pending\",\n confirmed = \"confirmed\",\n}\n\nexport type SupplierFee = {\n __typename: \"SupplierFee\";\n date?: string | null;\n fee?: number | null;\n};\n\nexport type SAccountUpdatedBy = {\n __typename: \"SAccountUpdatedBy\";\n username?: string | null;\n email?: string | null;\n};\n\nexport type ModelAddressConnection = {\n __typename: \"ModelAddressConnection\";\n items: Array<Address | null>;\n nextToken?: string | null;\n};\n\nexport enum AccountType {\n level1 = \"level1\",\n level2 = \"level2\",\n level3 = \"level3\",\n level4 = \"level4\",\n}\n\nexport type Address = {\n __typename: \"Address\";\n id: string;\n owner: string;\n account?: SAccount | null;\n name?: string | null;\n phone?: string | null;\n countryId?: string | null;\n countryName?: string | null;\n cityId?: string | null;\n cityName?: string | null;\n districtId?: string | null;\n districtName?: string | null;\n horooId?: string | null;\n horooName?: string | null;\n addressLine?: string | null;\n accessCode?: string | null;\n doorNumber?: string | null;\n zipCode?: string | null;\n note?: string | null;\n createdAt?: string | null;\n updatedAt?: string | null;\n};\n\n// VALIDATORS\nexport const CREATE = z\n .object({\n // Хувь хүний мэдээлэл\n username: z.string().min(1, { message: \"Хэрэглэгчийн нэр хоосон байж болохгүй\" }),\n firstName: z.string().min(1, { message: \"Овог хоосон байж болохгүй\" }),\n lastName: z.string().optional(),\n email: z.string().email({ message: \"Имэйл хаяг буруу байна\" }).optional(),\n phoneList: z.array(z.string().min(1, { message: \"Утасны дугаар хоосон байж болохгүй\" })).optional(),\n\n // Байгууллагын мэдээлэл\n company: z.boolean(),\n accountType: z.enum([\"level1\", \"level2\", \"level3\", \"level4\"], {\n errorMap: () => ({ message: \"Бүртгэлийн төрөл буруу байна\" }),\n }),\n taxPayer: z.boolean(),\n isForeign: z.boolean().optional(),\n\n // Шиймтгэлийн мэдээлэл мэдээлэл\n feeReceivablesPercent: z.number().nonnegative({ message: \"Хүснэгтийн хувь буруу байна\" }),\n feeSOrder: z.number().nonnegative({ message: \"Захиалгын хураамж буруу байна\" }),\n internomPercent: z.number().min(0).max(100, { message: \"Internom хувь 0-100 хооронд байх ёстой\" }),\n digitalCommissionRate: z.number().min(0).max(100, { message: \"Дижитал комиссын хувь 0-100 хооронд байх ёстой\" }),\n feeTransport: z.number().nonnegative({ message: \"Тээврийн хураамж буруу байна\" }),\n feeWarehouse: z.number().nonnegative({ message: \"Агуулахын хураамж буруу байна\" }),\n feeSales: z.array(z.any()).optional(),\n\n // Банкны мэдээлэл\n bankName: z.string().optional(),\n bankAccountNumber: z.string().optional(),\n bankReceiverName: z.string().optional(),\n\n // Захиалга ба хүчинтэй хугацаа\n availableCreateOrder: z.boolean(),\n validUntil: z.string().nullable().optional(),\n })\n .superRefine((data, ctx) => {\n if (!data.company && (!data.lastName || data.lastName.trim() === \"\")) {\n ctx.addIssue({\n path: [\"lastName\"],\n code: z.ZodIssueCode.custom,\n message: \"Овог хоосон байж болохгүй\",\n });\n }\n });\n\nexport const UPDATE = z.object({\n username: z.string(),\n});\nexport const REPLACE = z.object({\n username: z.string(),\n});\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BaseRepoESImpl } from "../../../index.js";
|
|
2
|
-
import { Order, OrderItem } from "../../model/example.model";
|
|
3
2
|
import { OrderRepoES } from "./order-es.repo.interface";
|
|
3
|
+
import { Order, OrderItem } from "../../model-shared/example.model";
|
|
4
4
|
export declare class OrderRepoESImpl extends BaseRepoESImpl<Order> implements OrderRepoES {
|
|
5
5
|
findOrderItemsByOrderId(orderId: string, includeFields: string[]): Promise<OrderItem[]>;
|
|
6
6
|
findOrderItemsByFields(filterParams: Map<string, string[]>, includeFields: string[]): Promise<OrderItem[]>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BaseRepoES } from "../../../index.js";
|
|
2
|
-
import { Order, OrderItem } from "../../model/example.model";
|
|
2
|
+
import { Order, OrderItem } from "../../model-shared/example.model";
|
|
3
3
|
export interface OrderRepoES extends BaseRepoES<Order> {
|
|
4
4
|
findOrdersByFields(filter: Map<string, string[]>, includeFields: string[]): Promise<Order[]>;
|
|
5
5
|
findOrderItemsByFields(filter: Map<string, string[]>, includeFields: string[]): Promise<OrderItem[]>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"order-es.repo.interface.js","sourceRoot":"","sources":["../../../../src/_examples/repositories/order/order-es.repo.interface.ts"],"names":[],"mappings":"","sourcesContent":["import { BaseRepoES } from \"@chinggis/core\";\nimport { Order, OrderItem } from \"../../model/example.model\";\n\nexport interface OrderRepoES extends BaseRepoES<Order> {\n findOrdersByFields(filter: Map<string, string[]>, includeFields: string[]): Promise<Order[]>;\n\n findOrderItemsByFields(filter: Map<string, string[]>, includeFields: string[]): Promise<OrderItem[]>;\n\n findOrderItemsByOrderId(orderId: string, includeFields: string[]): Promise<OrderItem[]>;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"order-es.repo.interface.js","sourceRoot":"","sources":["../../../../src/_examples/repositories/order/order-es.repo.interface.ts"],"names":[],"mappings":"","sourcesContent":["import { BaseRepoES } from \"@chinggis/core\";\nimport { Order, OrderItem } from \"../../model-shared/example.model\";\n\nexport interface OrderRepoES extends BaseRepoES<Order> {\n findOrdersByFields(filter: Map<string, string[]>, includeFields: string[]): Promise<Order[]>;\n\n findOrderItemsByFields(filter: Map<string, string[]>, includeFields: string[]): Promise<OrderItem[]>;\n\n findOrderItemsByOrderId(orderId: string, includeFields: string[]): Promise<OrderItem[]>;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"order-es.repo.js","sourceRoot":"","sources":["../../../../src/_examples/repositories/order/order-es.repo.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,mCAAiC;AAEjC,yCAAgD;
|
|
1
|
+
{"version":3,"file":"order-es.repo.js","sourceRoot":"","sources":["../../../../src/_examples/repositories/order/order-es.repo.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,mCAAiC;AAEjC,yCAAgD;AAMzC,IAAM,eAAe,GAArB,MAAM,eAAgB,SAAQ,qBAAqB;IAClD,uBAAuB,CAAC,OAAe,EAAE,aAAuB;;YACpE,MAAM,SAAS,GAAG,IAAI,GAAG,EAAoB,CAAC;YAC9C,SAAS,CAAC,GAAG,CAAC,SAAS,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;YACpC,OAAO,IAAI,CAAC,sBAAsB,CAAC,SAAS,EAAE,aAAa,CAAC,CAAC;QAC/D,CAAC;KAAA;IAEK,sBAAsB,CAAC,YAAmC,EAAE,aAAuB;;YACvF,+GAA+G;YAC/G,EAAE;YACF,6FAA6F;YAC7F,EAAE;YACF,0CAA0C;YAC1C,8CAA8C;YAC9C,QAAQ;YACR,2CAA2C;YAC3C,yFAAyF;YACzF,oBAAoB;YACpB,2DAA2D;YAC3D,iBAAiB;YACjB,IAAI;YACJ,OAAO,EAAE,CAAC;QACZ,CAAC;KAAA;IAEK,kBAAkB,CAAC,YAAmC,EAAE,aAAuB;;YACnF,sCAAsC;YACtC,wBAAwB;YACxB,kCAAkC;YAClC,iBAAiB;YACjB,aAAa;YACb,mCAAmC;YACnC,EAAE;YACF,6FAA6F;YAC7F,EAAE;YACF,0CAA0C;YAC1C,8CAA8C;YAC9C,QAAQ;YACR,qFAAqF;YACrF,oBAAoB;YACpB,2DAA2D;YAC3D,iBAAiB;YACjB,IAAI;YACJ,OAAO,EAAE,CAAC;QACZ,CAAC;KAAA;CACF,CAAA;AA5CY,0CAAe;0BAAf,eAAe;IAD3B,IAAA,gBAAO,EAAC,aAAa,CAAC;GACV,eAAe,CA4C3B;AAED,IAAY,KAGX;AAHD,WAAY,KAAK;IACf,wBAAe,CAAA;IACf,gCAAuB,CAAA;AACzB,CAAC,EAHW,KAAK,qBAAL,KAAK,QAGhB","sourcesContent":["import { Service } from \"typedi\";\n\nimport { BaseRepoESImpl } from \"@chinggis/core\";\n\nimport { OrderRepoES } from \"./order-es.repo.interface\";\nimport { Order, OrderItem } from \"../../model-shared/example.model\";\n\n@Service(\"OrderRepoES\")\nexport class OrderRepoESImpl extends BaseRepoESImpl<Order> implements OrderRepoES {\n async findOrderItemsByOrderId(orderId: string, includeFields: string[]): Promise<OrderItem[]> {\n const filterMap = new Map<string, string[]>();\n filterMap.set(\"orderId\", [orderId]);\n return this.findOrderItemsByFields(filterMap, includeFields);\n }\n\n async findOrderItemsByFields(filterParams: Map<string, string[]>, includeFields: string[]): Promise<OrderItem[]> {\n // const searchQuery = searchQueryES().index(Index.orderItem).size(10000).from(0).includeFields(includeFields);\n //\n // for (const [field, values] of filterParams.entries()) searchQuery.mustTerm(field, values);\n //\n // const builtQuery = searchQuery.build();\n // // console.log(JSON.stringify(builtQuery));\n // try {\n // return await this.search(searchQuery);\n // return await searchElasticSearch<OrderItem>(builtQuery, OPENSEARCH.INTERNOM.domain);\n // } catch (error) {\n // console.error(\"Error executing search query:\", error);\n // throw error;\n // }\n return [];\n }\n\n async findOrdersByFields(filterParams: Map<string, string[]>, includeFields: string[]): Promise<Order[]> {\n // const searchQuery = searchQueryES()\n // .index(Index.order)\n // .filterFieldExists(\"address\")\n // .size(10000)\n // .from(0)\n // .includeFields(includeFields);\n //\n // for (const [field, values] of filterParams.entries()) searchQuery.mustTerm(field, values);\n //\n // const builtQuery = searchQuery.build();\n // // console.log(JSON.stringify(builtQuery));\n // try {\n // return await searchElasticSearch<Order>(builtQuery, OPENSEARCH.INTERNOM.domain);\n // } catch (error) {\n // console.error(\"Error executing search query:\", error);\n // throw error;\n // }\n return [];\n }\n}\n\nexport enum Index {\n order = \"order\",\n orderItem = \"orderitem\",\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import "
|
|
2
|
-
import {
|
|
3
|
-
import { Order } from "../../model/example.model";
|
|
1
|
+
import { BaseRepoDBImpl } from "../../../index.js";
|
|
2
|
+
import { Order } from "../../model-shared/example.model";
|
|
4
3
|
import { OrderRepoDB } from "./order-repo-db.interface";
|
|
4
|
+
import "./order-repo-db";
|
|
5
5
|
export declare class OrderRepoDBImpl extends BaseRepoDBImpl<Order> implements OrderRepoDB {
|
|
6
6
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { BaseRepoDB } from "../../../repositories/base-db.repo.interface";
|
|
2
|
-
import { Order } from "../../model/example.model";
|
|
3
2
|
import { z } from "zod";
|
|
4
3
|
import { ResponseFields } from "../../../index.js";
|
|
4
|
+
import { Order } from "../../model-shared/example.model";
|
|
5
5
|
export declare const RESPONSE_FIELDS_LIST: ResponseFields;
|
|
6
6
|
export declare const RESPONSE_FIELDS_DETAILS: ResponseFields;
|
|
7
7
|
export declare const CREATE: z.ZodObject<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"order-repo-db.interface.js","sourceRoot":"","sources":["../../../../src/_examples/repositories/order/order-repo-db.interface.ts"],"names":[],"mappings":";;;AAEA,6BAAwB;
|
|
1
|
+
{"version":3,"file":"order-repo-db.interface.js","sourceRoot":"","sources":["../../../../src/_examples/repositories/order/order-repo-db.interface.ts"],"names":[],"mappings":";;;AAEA,6BAAwB;AAIxB,2BAA2B;AACd,QAAA,oBAAoB,GAAmB;IAClD,OAAO,EAAE,CAAC,IAAI,EAAE,WAAW,EAAE,WAAW,EAAE,WAAW,CAAC;CACvD,CAAC;AAEW,QAAA,uBAAuB,GAAmB;IACrD,OAAO,EAAE,CAAC,IAAI,EAAE,WAAW,EAAE,WAAW,EAAE,WAAW,CAAC;CACvD,CAAC;AAEF,qBAAqB;AACR,QAAA,MAAM,GAAG,OAAC,CAAC,MAAM,CAAC;IAC7B,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;CAC7B,CAAC,CAAC;AAEU,QAAA,MAAM,GAAG,OAAC,CAAC,MAAM,CAAC;IAC7B,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;CACxC,CAAC,CAAC;AAEU,QAAA,OAAO,GAAG,OAAC,CAAC,MAAM,CAAC;IAC9B,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;CAC7B,CAAC,CAAC","sourcesContent":["import { BaseRepoDB } from \"../../../repositories/base-db.repo.interface\";\n\nimport { z } from \"zod\";\nimport { ResponseFields } from \"@chinggis/core\";\nimport { Order } from \"../../model-shared/example.model\";\n\n// Response field constants\nexport const RESPONSE_FIELDS_LIST: ResponseFields = {\n include: [\"id\", \"profileId\", \"createdAt\", \"updatedAt\"],\n};\n\nexport const RESPONSE_FIELDS_DETAILS: ResponseFields = {\n include: [\"id\", \"profileId\", \"createdAt\", \"updatedAt\"],\n};\n\n// Validation schemas\nexport const CREATE = z.object({\n profileId: z.string().min(1),\n});\n\nexport const UPDATE = z.object({\n profileId: z.string().min(1).optional(),\n});\n\nexport const REPLACE = z.object({\n profileId: z.string().min(1),\n});\n\nexport interface OrderRepoDB extends BaseRepoDB<Order> {}\n"]}
|
|
@@ -8,9 +8,9 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
exports.OrderRepoDBImpl = void 0;
|
|
10
10
|
const typedi_1 = require("typedi");
|
|
11
|
-
require("
|
|
12
|
-
|
|
13
|
-
let OrderRepoDBImpl = class OrderRepoDBImpl extends
|
|
11
|
+
const core_1 = require("../../../index.js");
|
|
12
|
+
require("./order-repo-db");
|
|
13
|
+
let OrderRepoDBImpl = class OrderRepoDBImpl extends core_1.BaseRepoDBImpl {
|
|
14
14
|
};
|
|
15
15
|
exports.OrderRepoDBImpl = OrderRepoDBImpl;
|
|
16
16
|
exports.OrderRepoDBImpl = OrderRepoDBImpl = __decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"order-repo-db.js","sourceRoot":"","sources":["../../../../src/_examples/repositories/order/order-repo-db.ts"],"names":[],"mappings":";;;;;;;;;AAAA,mCAAiC;
|
|
1
|
+
{"version":3,"file":"order-repo-db.js","sourceRoot":"","sources":["../../../../src/_examples/repositories/order/order-repo-db.ts"],"names":[],"mappings":";;;;;;;;;AAAA,mCAAiC;AAEjC,yCAAgD;AAIhD,2BAAyB;AAGlB,IAAM,eAAe,GAArB,MAAM,eAAgB,SAAQ,qBAAqB;CAA0B,CAAA;AAAvE,0CAAe;0BAAf,eAAe;IAD3B,IAAA,gBAAO,EAAC,aAAa,CAAC;GACV,eAAe,CAAwD","sourcesContent":["import { Service } from \"typedi\";\n\nimport { BaseRepoDBImpl } from \"@chinggis/core\";\nimport { Order } from \"../../model-shared/example.model\";\n\nimport { OrderRepoDB } from \"./order-repo-db.interface\";\nimport \"./order-repo-db\";\n\n@Service(\"OrderRepoDB\")\nexport class OrderRepoDBImpl extends BaseRepoDBImpl<Order> implements OrderRepoDB {}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ProfileRepoDB } from "./profile-repo-db.interface";
|
|
2
2
|
import "./profile-repo-db";
|
|
3
3
|
import { BaseRepoDBImpl } from "../../../repositories/base-db.repo";
|
|
4
|
-
import { Profile } from "../../model/example.model";
|
|
4
|
+
import { Profile } from "../../model-shared/example.model";
|
|
5
5
|
export declare class ProfileRepoDBImpl extends BaseRepoDBImpl<Profile> implements ProfileRepoDB {
|
|
6
6
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { BaseRepoDB } from "../../../repositories/base-db.repo.interface";
|
|
2
|
-
import
|
|
2
|
+
import "../../../repositories/base-db.repo";
|
|
3
|
+
import { Profile } from "../../model-shared/example.model";
|
|
3
4
|
export interface ProfileRepoDB extends BaseRepoDB<Profile> {
|
|
4
5
|
}
|