@things-factory/geography 5.0.15 → 6.0.0-alpha.10

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.
Files changed (49) hide show
  1. package/dist-server/service/geo-area/geo-area-mutation.js +1 -1
  2. package/dist-server/service/geo-area/geo-area-mutation.js.map +1 -1
  3. package/dist-server/service/geo-area/geo-area-query.js +47 -9
  4. package/dist-server/service/geo-area/geo-area-query.js.map +1 -1
  5. package/dist-server/service/geo-area/geo-area-type.js.map +1 -1
  6. package/dist-server/service/geo-area/geo-area.js +3 -4
  7. package/dist-server/service/geo-area/geo-area.js.map +1 -1
  8. package/dist-server/service/geo-city/geo-city-mutation.js +1 -1
  9. package/dist-server/service/geo-city/geo-city-mutation.js.map +1 -1
  10. package/dist-server/service/geo-city/geo-city-query.js +8 -10
  11. package/dist-server/service/geo-city/geo-city-query.js.map +1 -1
  12. package/dist-server/service/geo-city/geo-city-type.js.map +1 -1
  13. package/dist-server/service/geo-city/geo-city.js +3 -4
  14. package/dist-server/service/geo-city/geo-city.js.map +1 -1
  15. package/dist-server/service/geo-continent/geo-continent-mutation.js +1 -1
  16. package/dist-server/service/geo-continent/geo-continent-mutation.js.map +1 -1
  17. package/dist-server/service/geo-continent/geo-continent-query.js +6 -8
  18. package/dist-server/service/geo-continent/geo-continent-query.js.map +1 -1
  19. package/dist-server/service/geo-continent/geo-continent-type.js.map +1 -1
  20. package/dist-server/service/geo-continent/geo-continent.js +2 -3
  21. package/dist-server/service/geo-continent/geo-continent.js.map +1 -1
  22. package/dist-server/service/geo-country/geo-country-mutation.js +1 -1
  23. package/dist-server/service/geo-country/geo-country-mutation.js.map +1 -1
  24. package/dist-server/service/geo-country/geo-country-query.js +18 -9
  25. package/dist-server/service/geo-country/geo-country-query.js.map +1 -1
  26. package/dist-server/service/geo-country/geo-country-type.js.map +1 -1
  27. package/dist-server/service/geo-country/geo-country.js +2 -3
  28. package/dist-server/service/geo-country/geo-country.js.map +1 -1
  29. package/dist-server/service/geo-state/geo-state-mutation.js +1 -1
  30. package/dist-server/service/geo-state/geo-state-mutation.js.map +1 -1
  31. package/dist-server/service/geo-state/geo-state-query.js +7 -9
  32. package/dist-server/service/geo-state/geo-state-query.js.map +1 -1
  33. package/dist-server/service/geo-state/geo-state-type.js.map +1 -1
  34. package/dist-server/service/geo-state/geo-state.js +2 -3
  35. package/dist-server/service/geo-state/geo-state.js.map +1 -1
  36. package/dist-server/tsconfig.tsbuildinfo +1 -1
  37. package/package.json +5 -5
  38. package/server/service/geo-area/geo-area-mutation.ts +11 -6
  39. package/server/service/geo-area/geo-area-query.ts +42 -8
  40. package/server/service/geo-area/geo-area.ts +1 -1
  41. package/server/service/geo-city/geo-city-mutation.ts +14 -6
  42. package/server/service/geo-city/geo-city-query.ts +10 -9
  43. package/server/service/geo-city/geo-city.ts +1 -1
  44. package/server/service/geo-continent/geo-continent-mutation.ts +10 -6
  45. package/server/service/geo-continent/geo-continent-query.ts +8 -7
  46. package/server/service/geo-country/geo-country-mutation.ts +13 -6
  47. package/server/service/geo-country/geo-country-query.ts +16 -8
  48. package/server/service/geo-state/geo-state-mutation.ts +10 -6
  49. package/server/service/geo-state/geo-state-query.ts +9 -8
@@ -35,7 +35,7 @@ let GeoAreaMutation = class GeoAreaMutation {
35
35
  if (_updateRecords.length > 0) {
36
36
  for (let i = 0; i < _updateRecords.length; i++) {
37
37
  const newRecord = _updateRecords[i];
38
- const geoArea = await geoAreaRepo.findOne(newRecord.id);
38
+ const geoArea = await geoAreaRepo.findOneBy({ id: newRecord.id });
39
39
  const result = await geoAreaRepo.save(Object.assign(Object.assign(Object.assign({}, geoArea), newRecord), { updater: user }));
40
40
  results.push(Object.assign(Object.assign({}, result), { cuFlag: 'M' }));
41
41
  }
@@ -1 +1 @@
1
- {"version":3,"file":"geo-area-mutation.js","sourceRoot":"","sources":["../../../server/service/geo-area/geo-area-mutation.ts"],"names":[],"mappings":";;;;AAAA,+CAAsE;AACtE,qCAA4B;AAC5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IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,mBAAmB,EAAE,CAAC;IAC9C,mBAAA,IAAA,kBAAG,EAAC,IAAI,CAAC,CAAA;IAAc,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;oDAKhD;AAIK;IAFL,IAAA,wBAAS,EAAC,cAAc,CAAC;IACzB,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,6BAA6B,EAAE,CAAC;IACvD,mBAAA,IAAA,kBAAG,EAAC,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAA;IAAiB,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;qDAQvE;AA9FU,eAAe;IAD3B,IAAA,uBAAQ,EAAC,kBAAO,CAAC;GACL,eAAe,CA+F3B;AA/FY,0CAAe","sourcesContent":["import { Arg, Ctx, Directive, Mutation, Resolver } from 'type-graphql'\nimport { In } from 'typeorm'\nimport { GeoArea } from './geo-area'\nimport { GeoAreaPatch, NewGeoArea } from './geo-area-type'\n\n@Resolver(GeoArea)\nexport class GeoAreaMutation {\n @Directive('@transaction')\n @Mutation(returns => GeoArea, { description: 'To create new GeoArea' })\n async createGeoArea(@Arg('geoArea') geoArea: NewGeoArea, @Ctx() context: any): Promise<GeoArea> {\n const { user, tx } = context.state\n\n return await tx.getRepository(GeoArea).save({\n ...geoArea,\n creator: user,\n updater: user\n })\n }\n\n @Directive('@transaction')\n @Mutation(returns => GeoArea, { description: 'To modify GeoArea information' })\n async updateGeoArea(@Arg('id') id: string, @Arg('patch') patch: GeoAreaPatch, @Ctx() context: any): Promise<GeoArea> {\n const { user, tx } = context.state\n\n const repository = tx.getRepository(GeoArea)\n const geoArea = await repository.findOne({\n where: { id }\n })\n\n return await repository.save({\n ...geoArea,\n ...patch,\n updater: user\n })\n }\n\n @Directive('@transaction')\n @Mutation(returns => [GeoArea], { description: \"To modify multiple GeoAreas' information\" })\n async updateMultipleGeoArea(\n @Arg('patches', type => [GeoAreaPatch]) patches: GeoAreaPatch[],\n @Ctx() context: any\n ): Promise<GeoArea[]> {\n const { user, tx } = context.state\n\n let results = []\n const _createRecords = patches.filter((patch: any) => patch.cuFlag.toUpperCase() === '+')\n const _updateRecords = patches.filter((patch: any) => patch.cuFlag.toUpperCase() === 'M')\n const geoAreaRepo = tx.getRepository(GeoArea)\n\n if (_createRecords.length > 0) {\n for (let i = 0; i < _createRecords.length; i++) {\n const newRecord = _createRecords[i]\n\n const result = await geoAreaRepo.save({\n ...newRecord,\n creator: user,\n updater: user\n })\n\n results.push({ ...result, cuFlag: '+' })\n }\n }\n\n if (_updateRecords.length > 0) {\n for (let i = 0; i < _updateRecords.length; i++) {\n const newRecord = _updateRecords[i]\n const geoArea = await geoAreaRepo.findOne(newRecord.id)\n\n const result = await geoAreaRepo.save({\n ...geoArea,\n ...newRecord,\n updater: user\n })\n\n results.push({ ...result, cuFlag: 'M' })\n }\n }\n\n return results\n }\n\n @Directive('@transaction')\n @Mutation(returns => Boolean, { description: 'To delete GeoArea' })\n async deleteGeoArea(@Arg('id') id: string, @Ctx() context: any): Promise<boolean> {\n const { tx } = context.state\n\n await tx.getRepository(GeoArea).delete({ id })\n return true\n }\n\n @Directive('@transaction')\n @Mutation(returns => Boolean, { description: 'To delete multiple geoAreas' })\n async deleteGeoAreas(@Arg('ids', type => [String]) ids: string[], @Ctx() context: any): Promise<boolean> {\n const { domain, tx } = context.state\n\n await tx.getRepository(GeoArea).delete({\n id: In(ids)\n })\n\n return true\n }\n}\n"]}
1
+ {"version":3,"file":"geo-area-mutation.js","sourceRoot":"","sources":["../../../server/service/geo-area/geo-area-mutation.ts"],"names":[],"mappings":";;;;AAAA,+CAAsE;AACtE,qCAA4B;AAE5B,yCAAoC;AACpC,mDAA0D;AAG1D,IAAa,eAAe,GAA5B,MAAa,eAAe;IAG1B,KAAK,CAAC,aAAa,CAAiB,OAA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kBAAG,EAAC,IAAI,CAAC,CAAA;IAAc,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;oDAKhD;AAID;IAFC,IAAA,wBAAS,EAAC,cAAc,CAAC;IACzB,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,6BAA6B,EAAE,CAAC;IACvD,mBAAA,IAAA,kBAAG,EAAC,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAA;IAAiB,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;qDAQvE;AAlGU,eAAe;IAD3B,IAAA,uBAAQ,EAAC,kBAAO,CAAC;GACL,eAAe,CAmG3B;AAnGY,0CAAe","sourcesContent":["import { Arg, Ctx, Directive, Mutation, Resolver } from 'type-graphql'\nimport { In } from 'typeorm'\n\nimport { GeoArea } from './geo-area'\nimport { GeoAreaPatch, NewGeoArea } from './geo-area-type'\n\n@Resolver(GeoArea)\nexport class GeoAreaMutation {\n @Directive('@transaction')\n @Mutation(returns => GeoArea, { description: 'To create new GeoArea' })\n async createGeoArea(@Arg('geoArea') geoArea: NewGeoArea, @Ctx() context: ResolverContext): Promise<GeoArea> {\n const { user, tx } = context.state\n\n return await tx.getRepository(GeoArea).save({\n ...geoArea,\n creator: user,\n updater: user\n })\n }\n\n @Directive('@transaction')\n @Mutation(returns => GeoArea, { description: 'To modify GeoArea information' })\n async updateGeoArea(\n @Arg('id') id: string,\n @Arg('patch') patch: GeoAreaPatch,\n @Ctx() context: ResolverContext\n ): Promise<GeoArea> {\n const { user, tx } = context.state\n\n const repository = tx.getRepository(GeoArea)\n const geoArea = await repository.findOne({\n where: { id }\n })\n\n return await repository.save({\n ...geoArea,\n ...patch,\n updater: user\n })\n }\n\n @Directive('@transaction')\n @Mutation(returns => [GeoArea], { description: \"To modify multiple GeoAreas' information\" })\n async updateMultipleGeoArea(\n @Arg('patches', type => [GeoAreaPatch]) patches: GeoAreaPatch[],\n @Ctx() context: ResolverContext\n ): Promise<GeoArea[]> {\n const { user, tx } = context.state\n\n let results = []\n const _createRecords = patches.filter((patch: any) => patch.cuFlag.toUpperCase() === '+')\n const _updateRecords = patches.filter((patch: any) => patch.cuFlag.toUpperCase() === 'M')\n const geoAreaRepo = tx.getRepository(GeoArea)\n\n if (_createRecords.length > 0) {\n for (let i = 0; i < _createRecords.length; i++) {\n const newRecord = _createRecords[i]\n\n const result = await geoAreaRepo.save({\n ...newRecord,\n creator: user,\n updater: user\n })\n\n results.push({ ...result, cuFlag: '+' })\n }\n }\n\n if (_updateRecords.length > 0) {\n for (let i = 0; i < _updateRecords.length; i++) {\n const newRecord = _updateRecords[i]\n const geoArea = await geoAreaRepo.findOneBy({ id: newRecord.id })\n\n const result = await geoAreaRepo.save({\n ...geoArea,\n ...newRecord,\n updater: user\n })\n\n results.push({ ...result, cuFlag: 'M' })\n }\n }\n\n return results\n }\n\n @Directive('@transaction')\n @Mutation(returns => Boolean, { description: 'To delete GeoArea' })\n async deleteGeoArea(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<boolean> {\n const { tx } = context.state\n\n await tx.getRepository(GeoArea).delete({ id })\n return true\n }\n\n @Directive('@transaction')\n @Mutation(returns => Boolean, { description: 'To delete multiple geoAreas' })\n async deleteGeoAreas(@Arg('ids', type => [String]) ids: string[], @Ctx() context: ResolverContext): Promise<boolean> {\n const { domain, tx } = context.state\n\n await tx.getRepository(GeoArea).delete({\n id: In(ids)\n })\n\n return true\n }\n}\n"]}
@@ -1,34 +1,57 @@
1
1
  "use strict";
2
- var _a;
3
2
  Object.defineProperty(exports, "__esModule", { value: true });
4
3
  exports.GeoAreaQuery = void 0;
5
4
  const tslib_1 = require("tslib");
5
+ const type_graphql_1 = require("type-graphql");
6
6
  const auth_base_1 = require("@things-factory/auth-base");
7
7
  const shell_1 = require("@things-factory/shell");
8
- const type_graphql_1 = require("type-graphql");
9
- const typeorm_1 = require("typeorm");
10
8
  const geo_city_1 = require("../geo-city/geo-city");
11
9
  const geo_area_1 = require("./geo-area");
12
10
  const geo_area_type_1 = require("./geo-area-type");
13
11
  let GeoAreaQuery = class GeoAreaQuery {
14
12
  async geoArea(id, context) {
15
- return await (0, typeorm_1.getRepository)(geo_area_1.GeoArea).findOne({
13
+ return await (0, shell_1.getRepository)(geo_area_1.GeoArea).findOne({
16
14
  where: { id }
17
15
  });
18
16
  }
19
17
  async geoAreas(params, context) {
20
18
  const convertedParams = (0, shell_1.convertListParams)(params);
21
- const [items, total] = await (0, typeorm_1.getRepository)(geo_area_1.GeoArea).findAndCount(convertedParams);
19
+ const [items, total] = await (0, shell_1.getRepository)(geo_area_1.GeoArea).findAndCount(convertedParams);
22
20
  return { items, total };
23
21
  }
22
+ async geoAreasAllPostCode(context) {
23
+ const result = await (0, shell_1.getRepository)(geo_area_1.GeoArea)
24
+ .createQueryBuilder('ga')
25
+ .select('ga.postal_code')
26
+ .distinct(true)
27
+ .orderBy('ga.postal_code')
28
+ .getRawMany();
29
+ const items = result.map(item => {
30
+ return {
31
+ postalCode: item.postal_code
32
+ };
33
+ });
34
+ const total = items.length;
35
+ return { items, total };
36
+ }
37
+ async geoAreasGetStateAndCityByPosCode(postCode, context) {
38
+ let result = await (0, shell_1.getRepository)(geo_area_1.GeoArea)
39
+ .createQueryBuilder('ga')
40
+ .select('ga.city_name', 'cityName')
41
+ .addSelect('ga.state_name', 'stateName')
42
+ .distinct(true)
43
+ .where('ga.postal_code = :postCode', { postCode: postCode })
44
+ .getRawOne();
45
+ return result;
46
+ }
24
47
  async geoCity(geoArea) {
25
- return await (0, typeorm_1.getRepository)(geo_city_1.GeoCity).findOne(geoArea.geoCityId);
48
+ return await (0, shell_1.getRepository)(geo_city_1.GeoCity).findOneBy({ id: geoArea.geoCityId });
26
49
  }
27
50
  async updater(geoArea) {
28
- return await (0, typeorm_1.getRepository)(auth_base_1.User).findOne(geoArea.updaterId);
51
+ return await (0, shell_1.getRepository)(auth_base_1.User).findOneBy({ id: geoArea.updaterId });
29
52
  }
30
53
  async creator(geoArea) {
31
- return await (0, typeorm_1.getRepository)(auth_base_1.User).findOne(geoArea.creatorId);
54
+ return await (0, shell_1.getRepository)(auth_base_1.User).findOneBy({ id: geoArea.creatorId });
32
55
  }
33
56
  };
34
57
  tslib_1.__decorate([
@@ -44,9 +67,24 @@ tslib_1.__decorate([
44
67
  tslib_1.__param(0, (0, type_graphql_1.Args)()),
45
68
  tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
46
69
  tslib_1.__metadata("design:type", Function),
47
- tslib_1.__metadata("design:paramtypes", [typeof (_a = typeof shell_1.ListParam !== "undefined" && shell_1.ListParam) === "function" ? _a : Object, Object]),
70
+ tslib_1.__metadata("design:paramtypes", [shell_1.ListParam, Object]),
48
71
  tslib_1.__metadata("design:returntype", Promise)
49
72
  ], GeoAreaQuery.prototype, "geoAreas", null);
73
+ tslib_1.__decorate([
74
+ (0, type_graphql_1.Query)(returns => geo_area_type_1.GeoAreaList),
75
+ tslib_1.__param(0, (0, type_graphql_1.Ctx)()),
76
+ tslib_1.__metadata("design:type", Function),
77
+ tslib_1.__metadata("design:paramtypes", [Object]),
78
+ tslib_1.__metadata("design:returntype", Promise)
79
+ ], GeoAreaQuery.prototype, "geoAreasAllPostCode", null);
80
+ tslib_1.__decorate([
81
+ (0, type_graphql_1.Query)(returns => geo_area_1.GeoArea),
82
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('postCode')),
83
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
84
+ tslib_1.__metadata("design:type", Function),
85
+ tslib_1.__metadata("design:paramtypes", [String, Object]),
86
+ tslib_1.__metadata("design:returntype", Promise)
87
+ ], GeoAreaQuery.prototype, "geoAreasGetStateAndCityByPosCode", null);
50
88
  tslib_1.__decorate([
51
89
  (0, type_graphql_1.FieldResolver)(type => geo_city_1.GeoCity),
52
90
  tslib_1.__param(0, (0, type_graphql_1.Root)()),
@@ -1 +1 @@
1
- {"version":3,"file":"geo-area-query.js","sourceR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AE,EAAE,WAAW,EAAE,oBAAoB,EAAE,CAAC;IAClD,mBAAA,IAAA,kBAAG,EAAC,IAAI,CAAC,CAAA;IAAc,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;2CAI1C;AAGK;IADL,IAAA,oBAAK,EAAC,OAAO,CAAC,EAAE,CAAC,2BAAW,EAAE,EAAE,WAAW,EAAE,4BAA4B,EAAE,CAAC;IAC7D,mBAAA,IAAA,mBAAI,GAAE,CAAA;IAAqB,mBAAA,IAAA,kBAAG,GAAE,CAAA;;iEAAjB,iBAAS,oBAAT,iBAAS;;4CAKvC;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAO,CAAC;IAChB,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAU,kBAAO;;2CAErC;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAU,kBAAO;;2CAErC;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAU,kBAAO;;2CAErC;AA7BU,YAAY;IADxB,IAAA,uBAAQ,EAAC,kBAAO,CAAC;GACL,YAAY,CA8BxB;AA9BY,oCAAY","sourcesContent":["import { User } from '@things-factory/auth-base'\nimport { convertListParams, ListParam } from '@things-factory/shell'\nimport { Arg, Args, Ctx, FieldResolver, Query, Resolver, Root } from 'type-graphql'\nimport { getRepository } from 'typeorm'\nimport { GeoCity } from '../geo-city/geo-city'\nimport { GeoArea } from './geo-area'\nimport { GeoAreaList } from './geo-area-type'\n\n@Resolver(GeoArea)\nexport class GeoAreaQuery {\n @Query(returns => GeoArea, { description: 'To fetch a GeoArea' })\n async geoArea(@Arg('id') id: string, @Ctx() context: any): Promise<GeoArea> {\n return await getRepository(GeoArea).findOne({\n where: { id }\n })\n }\n\n @Query(returns => GeoAreaList, { description: 'To fetch multiple GeoAreas' })\n async geoAreas(@Args() params: ListParam, @Ctx() context: any): Promise<GeoAreaList> {\n const convertedParams = convertListParams(params)\n const [items, total] = await getRepository(GeoArea).findAndCount(convertedParams)\n\n return { items, total }\n }\n\n @FieldResolver(type => GeoCity)\n async geoCity(@Root() geoArea: GeoArea): Promise<GeoCity> {\n return await getRepository(GeoCity).findOne(geoArea.geoCityId)\n }\n\n @FieldResolver(type => User)\n async updater(@Root() geoArea: GeoArea): Promise<User> {\n return await getRepository(User).findOne(geoArea.updaterId)\n }\n\n @FieldResolver(type => User)\n async creator(@Root() geoArea: GeoArea): Promise<User> {\n return await getRepository(User).findOne(geoArea.creatorId)\n }\n}\n"]}
1
+ {"version":3,"file":"geo-area-query.js","sourceRoot":"","sources":["../../../server/service/geo-area/geo-area-query.ts"],"names":[],"mappings":";;;;AAAA,+CAAmF;AAEnF,yDAAgD;AAChD,iDAAmF;AAEnF,mDAA8C;AAC9C,yCAAoC;AACpC,mDAA6C;AAG7C,IAAa,YAAY,GAAzB,MAAa,YAAY;IAEvB,KAAK,CAAC,OAAO,CAAY,EAAU,EAAS,OAAwB;QAClE,OAAO,MAAM,IAAA,qBAAa,EAAC,kBAAO,CAAC,CAAC,OAAO,CAAC;YAC1C,KAAK,EAAE,EAAE,EAAE,EAAE;SACd,CAAC,CAAA;IACJ,CAAC;IAGD,KAAK,CAAC,QAAQ,CAAS,MAAiB,EAAS,OAAwB;QACvE,MAAM,eAAe,GAAG,IAAA,yBAAiB,EAAC,MAAM,CAAC,CAAA;QACjD,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,MAAM,IAAA,qBAAa,EAAC,kBAAO,CAAC,CAAC,YAAY,CAAC,eAAe,CAAC,CAAA;QAEjF,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,CAAA;IACzB,CAAC;IAGD,KAAK,CAAC,mBAAmB,CAAQ,OAAwB;QACvD,MAAM,MAAM,GAAG,MAAM,IAAA,qBA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IADxB,IAAA,uBAAQ,EAAC,kBAAO,CAAC;GACL,YAAY,CA+DxB;AA/DY,oCAAY","sourcesContent":["import { Arg, Args, Ctx, FieldResolver, Query, Resolver, Root } from 'type-graphql'\n\nimport { User } from '@things-factory/auth-base'\nimport { convertListParams, getRepository, ListParam } from '@things-factory/shell'\n\nimport { GeoCity } from '../geo-city/geo-city'\nimport { GeoArea } from './geo-area'\nimport { GeoAreaList } from './geo-area-type'\n\n@Resolver(GeoArea)\nexport class GeoAreaQuery {\n @Query(returns => GeoArea, { description: 'To fetch a GeoArea' })\n async geoArea(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<GeoArea> {\n return await getRepository(GeoArea).findOne({\n where: { id }\n })\n }\n\n @Query(returns => GeoAreaList, { description: 'To fetch multiple GeoAreas' })\n async geoAreas(@Args() params: ListParam, @Ctx() context: ResolverContext): Promise<GeoAreaList> {\n const convertedParams = convertListParams(params)\n const [items, total] = await getRepository(GeoArea).findAndCount(convertedParams)\n\n return { items, total }\n }\n\n @Query(returns => GeoAreaList)\n async geoAreasAllPostCode(@Ctx() context: ResolverContext) {\n const result = await getRepository(GeoArea)\n .createQueryBuilder('ga')\n .select('ga.postal_code')\n .distinct(true)\n .orderBy('ga.postal_code')\n .getRawMany()\n\n const items: any[] = result.map(item => {\n return {\n postalCode: item.postal_code\n }\n })\n\n const total = items.length\n\n return { items, total }\n }\n\n @Query(returns => GeoArea)\n async geoAreasGetStateAndCityByPosCode(@Arg('postCode') postCode: string, @Ctx() context: ResolverContext) {\n let result = await getRepository(GeoArea)\n .createQueryBuilder('ga')\n .select('ga.city_name', 'cityName')\n .addSelect('ga.state_name', 'stateName')\n .distinct(true)\n .where('ga.postal_code = :postCode', { postCode: postCode })\n .getRawOne()\n\n return result\n }\n\n @FieldResolver(type => GeoCity)\n async geoCity(@Root() geoArea: GeoArea): Promise<GeoCity> {\n return await getRepository(GeoCity).findOneBy({ id: geoArea.geoCityId })\n }\n\n @FieldResolver(type => User)\n async updater(@Root() geoArea: GeoArea): Promise<User> {\n return await getRepository(User).findOneBy({ id: geoArea.updaterId })\n }\n\n @FieldResolver(type => User)\n async creator(@Root() geoArea: GeoArea): Promise<User> {\n return await getRepository(User).findOneBy({ id: geoArea.creatorId })\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"geo-area-type.js","sourceRoot":"","sources":["../../../server/service/geo-area/geo-area-type.ts"],"names":[],"mappings":";;;;AAAA,+CAAoE;AACpE,yCAAoC;AAG7B,IAAM,UAAU,GAAhB,MAAM,UAAU;CAwBtB,CAAA;AAvBC;IAAC,IAAA,oBAAK,GAAE;;wCACI;AAEZ;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;+CACN;AAEpB;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;+CACN;AAEpB;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;4CACT;AAEjB;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;6CACR;AAElB;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;8CACP;AAEnB;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;4CACT;AAEjB;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;6CACR;AAvBP,UAAU;IADtB,IAAA,wBAAS,GAAE;GACC,UAAU,CAwBtB;AAxBY,gCAAU;AA2BhB,IAAM,YAAY,GAAlB,MAAM,YAAY;CA8BxB,CAAA;AA7BC;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;wCAC3B;AAEX;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;0CACb;AAEb;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;iDACN;AAEpB;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;iDACN;AAEpB;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;8CACT;AAEjB;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;+CACR;AAElB;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;gDACP;AAEnB;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;8CACT;AAEjB;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;+CACR;AAElB;IAAC,IAAA,oBAAK,GAAE;;4CACM;AA7BH,YAAY;IADxB,IAAA,wBAAS,GAAE;GACC,YAAY,CA8BxB;AA9BY,oCAAY;AAiClB,IAAM,WAAW,GAAjB,MAAM,WAAW;CAMvB,CAAA;AALC;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,kBAAO,CAAC,CAAC;;0CACT;AAEhB;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,CAAC;;0CACN;AALF,WAAW;IADvB,IAAA,yBAAU,GAAE;GACA,WAAW,CAMvB;AANY,kCAAW","sourcesContent":["import { Field, ID, InputType, Int, ObjectType } from 'type-graphql'\nimport { GeoArea } from './geo-area'\n\n@InputType()\nexport class NewGeoArea {\n @Field()\n name: string\n\n @Field({ nullable: true })\n description?: string\n\n @Field({ nullable: true })\n countryCode?: string\n\n @Field({ nullable: true })\n cityName?: string\n\n @Field({ nullable: true })\n stateName?: string\n\n @Field({ nullable: true })\n postalCode?: string\n\n @Field({ nullable: true })\n latitude?: string\n\n @Field({ nullable: true })\n longitude?: string\n}\n\n@InputType()\nexport class GeoAreaPatch {\n @Field(type => ID, { nullable: true })\n id?: string\n\n @Field({ nullable: true })\n name?: string\n\n @Field({ nullable: true })\n description?: string\n\n @Field({ nullable: true })\n countryCode?: string\n\n @Field({ nullable: true })\n cityName?: string\n\n @Field({ nullable: true })\n stateName?: string\n\n @Field({ nullable: true })\n postalCode?: string\n\n @Field({ nullable: true })\n latitude?: string\n\n @Field({ nullable: true })\n longitude?: string\n\n @Field()\n cuFlag: string\n}\n\n@ObjectType()\nexport class GeoAreaList {\n @Field(type => [GeoArea])\n items: GeoArea[]\n\n @Field(type => Int)\n total: number\n}\n"]}
1
+ {"version":3,"file":"geo-area-type.js","sourceRoot":"","sources":["../../../server/service/geo-area/geo-area-type.ts"],"names":[],"mappings":";;;;AAAA,+CAAoE;AACpE,yCAAoC;AAGpC,IAAa,UAAU,GAAvB,MAAa,UAAU;CAwBtB,CAAA;AAtBC;IADC,IAAA,oBAAK,GAAE;;wCACI;AAGZ;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;+CACN;AAGpB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;+CACN;AAGpB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;4CACT;AAGjB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;6CACR;AAGlB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;8CACP;AAGnB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;4CACT;AAGjB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;6CACR;AAvBP,UAAU;IADtB,IAAA,wBAAS,GAAE;GACC,UAAU,CAwBtB;AAxBY,gCAAU;AA2BvB,IAA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\nexport class NewGeoArea {\n @Field()\n name: string\n\n @Field({ nullable: true })\n description?: string\n\n @Field({ nullable: true })\n countryCode?: string\n\n @Field({ nullable: true })\n cityName?: string\n\n @Field({ nullable: true })\n stateName?: string\n\n @Field({ nullable: true })\n postalCode?: string\n\n @Field({ nullable: true })\n latitude?: string\n\n @Field({ nullable: true })\n longitude?: string\n}\n\n@InputType()\nexport class GeoAreaPatch {\n @Field(type => ID, { nullable: true })\n id?: string\n\n @Field({ nullable: true })\n name?: string\n\n @Field({ nullable: true })\n description?: string\n\n @Field({ nullable: true })\n countryCode?: string\n\n @Field({ nullable: true })\n cityName?: string\n\n @Field({ nullable: true })\n stateName?: string\n\n @Field({ nullable: true })\n postalCode?: string\n\n @Field({ nullable: true })\n latitude?: string\n\n @Field({ nullable: true })\n longitude?: string\n\n @Field()\n cuFlag: string\n}\n\n@ObjectType()\nexport class GeoAreaList {\n @Field(type => [GeoArea])\n items: GeoArea[]\n\n @Field(type => Int)\n total: number\n}\n"]}
@@ -1,5 +1,4 @@
1
1
  "use strict";
2
- var _a, _b;
3
2
  Object.defineProperty(exports, "__esModule", { value: true });
4
3
  exports.GeoArea = void 0;
5
4
  const tslib_1 = require("tslib");
@@ -76,7 +75,7 @@ tslib_1.__decorate([
76
75
  tslib_1.__decorate([
77
76
  (0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
78
77
  (0, type_graphql_1.Field)({ nullable: true }),
79
- tslib_1.__metadata("design:type", typeof (_a = typeof auth_base_1.User !== "undefined" && auth_base_1.User) === "function" ? _a : Object)
78
+ tslib_1.__metadata("design:type", auth_base_1.User)
80
79
  ], GeoArea.prototype, "creator", void 0);
81
80
  tslib_1.__decorate([
82
81
  (0, typeorm_1.RelationId)((geoArea) => geoArea.creator),
@@ -85,7 +84,7 @@ tslib_1.__decorate([
85
84
  tslib_1.__decorate([
86
85
  (0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
87
86
  (0, type_graphql_1.Field)({ nullable: true }),
88
- tslib_1.__metadata("design:type", typeof (_b = typeof auth_base_1.User !== "undefined" && auth_base_1.User) === "function" ? _b : Object)
87
+ tslib_1.__metadata("design:type", auth_base_1.User)
89
88
  ], GeoArea.prototype, "updater", void 0);
90
89
  tslib_1.__decorate([
91
90
  (0, typeorm_1.RelationId)((geoArea) => geoArea.creator),
@@ -93,7 +92,7 @@ tslib_1.__decorate([
93
92
  ], GeoArea.prototype, "updaterId", void 0);
94
93
  GeoArea = tslib_1.__decorate([
95
94
  (0, typeorm_1.Entity)(),
96
- (0, typeorm_1.Index)('ix_geo_area_0', (geoArea) => [geoArea.geoCity, geoArea.name], { unique: true }),
95
+ (0, typeorm_1.Index)('ix_geo_area_0', (geoArea) => [geoArea.geoCity, geoArea.name, geoArea.postalCode, geoArea.stateName], { unique: true }),
97
96
  (0, type_graphql_1.ObjectType)({ description: 'Entity for GeoArea' })
98
97
  ], GeoArea);
99
98
  exports.GeoArea = GeoArea;
@@ -1 +1 @@
1
- {"version":3,"file":"geo-area.js","sourceRoot":"","sources":["../../../server/service/geo-area/geo-area.ts"],"names":[],"mappings":";;;;;AAAA,yDAAgD;AAChD,+CAAoD;AACpD,qCASgB;AAChB,mDAA8C;AAKvC,IAAM,OAAO,GAAb,MAAM,OAAO;CAiEnB,CAAA;AAhEC;IAAC,IAAA,gCAAsB,EAAC,MAAM,CAAC;IAC9B,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,CAAC;;mCACC;AAEnB;IAAC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAO,CAAC;IAC1B,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCAChB,kBAAO;wCAAA;AAEjB;IAAC,IAAA,oBAAU,EAAC,CAAC,OAAgB,EAAE,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC;;0CAChC;AAElB;IAAC,IAAA,gBAAM,GAAE;IACR,IAAA,oBAAK,GAAE;;qCACI;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,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC3C,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;0DAChB,gBAAI,oBAAJ,gBAAI;wCAAA;AAEd;IAAC,IAAA,oBAAU,EAAC,CAAC,OAAgB,EAAE,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC;;0CAChC;AAElB;IAAC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC3C,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;0DAChB,gBAAI,oBAAJ,gBAAI;wCAAA;AAEd;IAAC,IAAA,oBAAU,EAAC,CAAC,OAAgB,EAAE,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC;;0CAChC;AAhEP,OAAO;IAHnB,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EAAC,eAAe,EAAE,CAAC,OAAgB,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC,IAAI,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IAC/F,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,oBAAoB,EAAE,CAAC;GACrC,OAAO,CAiEnB;AAjEY,0BAAO","sourcesContent":["import { User } from '@things-factory/auth-base'\nimport { Field, ID, ObjectType } from 'type-graphql'\nimport {\n Column,\n CreateDateColumn,\n Entity,\n Index,\n ManyToOne,\n PrimaryGeneratedColumn,\n RelationId,\n UpdateDateColumn\n} from 'typeorm'\nimport { GeoCity } from '../geo-city/geo-city'\n\n@Entity()\n@Index('ix_geo_area_0', (geoArea: GeoArea) => [geoArea.geoCity, geoArea.name], { unique: true })\n@ObjectType({ description: 'Entity for GeoArea' })\nexport class GeoArea {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID)\n readonly id: string\n\n @ManyToOne(type => GeoCity)\n @Field({ nullable: true })\n geoCity?: GeoCity\n\n @RelationId((geoArea: GeoArea) => geoArea.geoCity)\n geoCityId?: string\n\n @Column()\n @Field()\n name: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n description?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n countryCode?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n cityName?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n stateName?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n postalCode?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n latitude?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n longitude?: string\n\n @CreateDateColumn()\n @Field({ nullable: true })\n createdAt?: Date\n\n @UpdateDateColumn()\n @Field({ nullable: true })\n updatedAt?: Date\n\n @ManyToOne(type => User, { nullable: true })\n @Field({ nullable: true })\n creator?: User\n\n @RelationId((geoArea: GeoArea) => geoArea.creator)\n creatorId?: string\n\n @ManyToOne(type => User, { nullable: true })\n @Field({ nullable: true })\n updater?: User\n\n @RelationId((geoArea: GeoArea) => geoArea.creator)\n updaterId?: string\n}\n"]}
1
+ {"version":3,"file":"geo-area.js","sourceRoot":"","sources":["../../../server/service/geo-area/geo-area.ts"],"names":[],"mappings":";;;;AAAA,yDAAgD;AAChD,+CAAoD;AACpD,qCASgB;AAChB,mDAA8C;AAK9C,IAAa,OAAO,GAApB,MAAa,OAAO;CAiEnB,CAAA;AA9DC;IAFC,IAAA,gCAAsB,EAAC,MAAM,CAAC;IAC9B,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,CAAC;;mCACC;AAInB;IAFC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAO,CAAC;IAC1B,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCAChB,kBAAO;wCAAA;AAGjB;IADC,IAAA,oBA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AAA;AAIhB;IAFC,IAAA,0BAAgB,GAAE;IAClB,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCACd,IAAI;0CAAA;AAIhB;IAFC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC3C,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCAChB,gBAAI;wCAAA;AAGd;IADC,IAAA,oBAAU,EAAC,CAAC,OAAgB,EAAE,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC;;0CAChC;AAIlB;IAFC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC3C,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCAChB,gBAAI;wCAAA;AAGd;IADC,IAAA,oBAAU,EAAC,CAAC,OAAgB,EAAE,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC;;0CAChC;AAhEP,OAAO;IAHnB,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EAAC,eAAe,EAAE,CAAC,OAAgB,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,UAAU,EAAC,OAAO,CAAC,SAAS,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IACrI,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,oBAAoB,EAAE,CAAC;GACrC,OAAO,CAiEnB;AAjEY,0BAAO","sourcesContent":["import { User } from '@things-factory/auth-base'\nimport { Field, ID, ObjectType } from 'type-graphql'\nimport {\n Column,\n CreateDateColumn,\n Entity,\n Index,\n ManyToOne,\n PrimaryGeneratedColumn,\n RelationId,\n UpdateDateColumn\n} from 'typeorm'\nimport { GeoCity } from '../geo-city/geo-city'\n\n@Entity()\n@Index('ix_geo_area_0', (geoArea: GeoArea) => [geoArea.geoCity, geoArea.name, geoArea.postalCode,geoArea.stateName], { unique: true })\n@ObjectType({ description: 'Entity for GeoArea' })\nexport class GeoArea {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID)\n readonly id: string\n\n @ManyToOne(type => GeoCity)\n @Field({ nullable: true })\n geoCity?: GeoCity\n\n @RelationId((geoArea: GeoArea) => geoArea.geoCity)\n geoCityId?: string\n\n @Column()\n @Field()\n name: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n description?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n countryCode?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n cityName?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n stateName?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n postalCode?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n latitude?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n longitude?: string\n\n @CreateDateColumn()\n @Field({ nullable: true })\n createdAt?: Date\n\n @UpdateDateColumn()\n @Field({ nullable: true })\n updatedAt?: Date\n\n @ManyToOne(type => User, { nullable: true })\n @Field({ nullable: true })\n creator?: User\n\n @RelationId((geoArea: GeoArea) => geoArea.creator)\n creatorId?: string\n\n @ManyToOne(type => User, { nullable: true })\n @Field({ nullable: true })\n updater?: User\n\n @RelationId((geoArea: GeoArea) => geoArea.creator)\n updaterId?: string\n}\n"]}
@@ -35,7 +35,7 @@ let GeoCityMutation = class GeoCityMutation {
35
35
  if (_updateRecords.length > 0) {
36
36
  for (let i = 0; i < _updateRecords.length; i++) {
37
37
  const newRecord = _updateRecords[i];
38
- const geoCity = await geoCityRepo.findOne(newRecord.id);
38
+ const geoCity = await geoCityRepo.findOneBy({ id: newRecord.id });
39
39
  const result = await geoCityRepo.save(Object.assign(Object.assign(Object.assign({}, geoCity), newRecord), { updater: user }));
40
40
  results.push(Object.assign(Object.assign({}, result), { cuFlag: 'M' }));
41
41
  }
@@ -1 +1 @@
1
- {"version":3,"file":"geo-city-mutation.js","sourceRoot":"","sources":["../../../server/service/geo-city/geo-city-mutation.ts"],"names":[],"mappings":";;;;AAAA,+CAAsE;AACtE,qCAA4B;AAC5B,yCAAoC;AACpC,mDAA0D;AAGnD,IAAM,eAAe,GAArB,MAAM,eAAe;IAGpB,AAAN,KAAK,CAAC,aAAa,CAAiB,OAAmB,EAAS,OAAY;QAC1E,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAElC,OAAO,MAAM,EAAE,CAAC,aAAa,CAAC,kBAAO,CAAC,CAAC,IAAI,iCACtC,OAAO,KACV,OAAO,EAAE,IAAI,EACb,OAAO,EAAE,IAAI,IACb,CAAA;IACJ,CAAC;IAIK,AAAN,KAAK,CAAC,aAAa,CAAY,EAAU,EAAgB,KAAmB,EAAS,OAAY;QAC/F,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAElC,MAAM,UAAU,GAAG,EAAE,CAAC,aAAa,CAAC,kBAAO,CAAC,CAAA;QAC5C,MAAM,OAAO,GAAG,MAAM,UAAU,CAAC,OAAO,CAAC;YACvC,KAAK,EAAE,EAAE,EAAE,EAAE;SACd,CAAC,CAAA;QAEF,OAAO,MAAM,UAAU,CAAC,IAAI,+CACvB,OAAO,GACP,KAAK,KACR,OAAO,EAAE,IAAI,IACb,CAAA;IACJ,CAAC;IAIK,AAAN,KAAK,CAAC,qBAAqB,CACe,OAAuB,EACxD,OAAY;QAEnB,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAElC,IAAI,OAAO,GAAG,EAAE,CAAA;QAChB,MAAM,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,KAAU,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,WAAW,EAAE,KAAK,GAAG,CAAC,CA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AI,CAAC,EAAE,CAAC,CAAC,4BAAY,CAAC,CAAC,CAAA;IACtC,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;4DAuCP;AAIK;IAFL,IAAA,wBAAS,EAAC,cAAc,CAAC;IACzB,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,mBAAmB,EAAE,CAAC;IAC9C,mBAAA,IAAA,kBAAG,EAAC,IAAI,CAAC,CAAA;IAAc,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;oDAKhD;AAIK;IAFL,IAAA,wBAAS,EAAC,cAAc,CAAC;IACzB,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,6BAA6B,EAAE,CAAC;IACtD,mBAAA,IAAA,kBAAG,EAAC,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAA;IAAiB,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;sDAQxE;AA9FU,eAAe;IAD3B,IAAA,uBAAQ,EAAC,kBAAO,CAAC;GACL,eAAe,CA+F3B;AA/FY,0CAAe","sourcesContent":["import { Arg, Ctx, Directive, Mutation, Resolver } from 'type-graphql'\nimport { In } from 'typeorm'\nimport { GeoCity } from './geo-city'\nimport { GeoCityPatch, NewGeoCity } from './geo-city-type'\n\n@Resolver(GeoCity)\nexport class GeoCityMutation {\n @Directive('@transaction')\n @Mutation(returns => GeoCity, { description: 'To create new GeoCity' })\n async createGeoCity(@Arg('geoCity') geoCity: NewGeoCity, @Ctx() context: any): Promise<GeoCity> {\n const { user, tx } = context.state\n\n return await tx.getRepository(GeoCity).save({\n ...geoCity,\n creator: user,\n updater: user\n })\n }\n\n @Directive('@transaction')\n @Mutation(returns => GeoCity, { description: 'To modify GeoCity information' })\n async updateGeoCity(@Arg('id') id: string, @Arg('patch') patch: GeoCityPatch, @Ctx() context: any): Promise<GeoCity> {\n const { user, tx } = context.state\n\n const repository = tx.getRepository(GeoCity)\n const geoCity = await repository.findOne({\n where: { id }\n })\n\n return await repository.save({\n ...geoCity,\n ...patch,\n updater: user\n })\n }\n\n @Directive('@transaction')\n @Mutation(returns => [GeoCity], { description: \"To modify multiple GeoCities' information\" })\n async updateMultipleGeoCity(\n @Arg('patches', type => [GeoCityPatch]) patches: GeoCityPatch[],\n @Ctx() context: any\n ): Promise<GeoCity[]> {\n const { user, tx } = context.state\n\n let results = []\n const _createRecords = patches.filter((patch: any) => patch.cuFlag.toUpperCase() === '+')\n const _updateRecords = patches.filter((patch: any) => patch.cuFlag.toUpperCase() === 'M')\n const geoCityRepo = tx.getRepository(GeoCity)\n\n if (_createRecords.length > 0) {\n for (let i = 0; i < _createRecords.length; i++) {\n const newRecord = _createRecords[i]\n\n const result = await geoCityRepo.save({\n ...newRecord,\n creator: user,\n updater: user\n })\n\n results.push({ ...result, cuFlag: '+' })\n }\n }\n\n if (_updateRecords.length > 0) {\n for (let i = 0; i < _updateRecords.length; i++) {\n const newRecord = _updateRecords[i]\n const geoCity = await geoCityRepo.findOne(newRecord.id)\n\n const result = await geoCityRepo.save({\n ...geoCity,\n ...newRecord,\n updater: user\n })\n\n results.push({ ...result, cuFlag: 'M' })\n }\n }\n\n return results\n }\n\n @Directive('@transaction')\n @Mutation(returns => Boolean, { description: 'To delete GeoCity' })\n async deleteGeoCity(@Arg('id') id: string, @Ctx() context: any): Promise<boolean> {\n const { tx } = context.state\n\n await tx.getRepository(GeoCity).delete({ id })\n return true\n }\n\n @Directive('@transaction')\n @Mutation(returns => Boolean, { description: 'To delete multiple geoCitys' })\n async deleteGeoCities(@Arg('ids', type => [String]) ids: string[], @Ctx() context: any): Promise<boolean> {\n const { tx } = context.state\n\n await tx.getRepository(GeoCity).delete({\n id: In(ids)\n })\n\n return true\n }\n}\n"]}
1
+ {"version":3,"file":"geo-city-mutation.js","sourceRoot":"","sources":["../../../server/service/geo-city/geo-city-mutation.ts"],"names":[],"mappings":";;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IACzB,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,mBAAmB,EAAE,CAAC;IAC9C,mBAAA,IAAA,kBAAG,EAAC,IAAI,CAAC,CAAA;IAAc,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;oDAKhD;AAID;IAFC,IAAA,wBAAS,EAAC,cAAc,CAAC;IACzB,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,6BAA6B,EAAE,CAAC;IAE1E,mBAAA,IAAA,kBAAG,EAAC,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAA;IAC5B,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;sDASP;AArGU,eAAe;IAD3B,IAAA,uBAAQ,EAAC,kBAAO,CAAC;GACL,eAAe,CAsG3B;AAtGY,0CAAe","sourcesContent":["import { Arg, Ctx, Directive, Mutation, Resolver } from 'type-graphql'\nimport { In } from 'typeorm'\n\nimport { GeoCity } from './geo-city'\nimport { GeoCityPatch, NewGeoCity } from './geo-city-type'\n\n@Resolver(GeoCity)\nexport class GeoCityMutation {\n @Directive('@transaction')\n @Mutation(returns => GeoCity, { description: 'To create new GeoCity' })\n async createGeoCity(@Arg('geoCity') geoCity: NewGeoCity, @Ctx() context: ResolverContext): Promise<GeoCity> {\n const { user, tx } = context.state\n\n return await tx.getRepository(GeoCity).save({\n ...geoCity,\n creator: user,\n updater: user\n })\n }\n\n @Directive('@transaction')\n @Mutation(returns => GeoCity, { description: 'To modify GeoCity information' })\n async updateGeoCity(\n @Arg('id') id: string,\n @Arg('patch') patch: GeoCityPatch,\n @Ctx() context: ResolverContext\n ): Promise<GeoCity> {\n const { user, tx } = context.state\n\n const repository = tx.getRepository(GeoCity)\n const geoCity = await repository.findOne({\n where: { id }\n })\n\n return await repository.save({\n ...geoCity,\n ...patch,\n updater: user\n })\n }\n\n @Directive('@transaction')\n @Mutation(returns => [GeoCity], { description: \"To modify multiple GeoCities' information\" })\n async updateMultipleGeoCity(\n @Arg('patches', type => [GeoCityPatch]) patches: GeoCityPatch[],\n @Ctx() context: ResolverContext\n ): Promise<GeoCity[]> {\n const { user, tx } = context.state\n\n let results = []\n const _createRecords = patches.filter((patch: any) => patch.cuFlag.toUpperCase() === '+')\n const _updateRecords = patches.filter((patch: any) => patch.cuFlag.toUpperCase() === 'M')\n const geoCityRepo = tx.getRepository(GeoCity)\n\n if (_createRecords.length > 0) {\n for (let i = 0; i < _createRecords.length; i++) {\n const newRecord = _createRecords[i]\n\n const result = await geoCityRepo.save({\n ...newRecord,\n creator: user,\n updater: user\n })\n\n results.push({ ...result, cuFlag: '+' })\n }\n }\n\n if (_updateRecords.length > 0) {\n for (let i = 0; i < _updateRecords.length; i++) {\n const newRecord = _updateRecords[i]\n const geoCity = await geoCityRepo.findOneBy({ id: newRecord.id })\n\n const result = await geoCityRepo.save({\n ...geoCity,\n ...newRecord,\n updater: user\n })\n\n results.push({ ...result, cuFlag: 'M' })\n }\n }\n\n return results\n }\n\n @Directive('@transaction')\n @Mutation(returns => Boolean, { description: 'To delete GeoCity' })\n async deleteGeoCity(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<boolean> {\n const { tx } = context.state\n\n await tx.getRepository(GeoCity).delete({ id })\n return true\n }\n\n @Directive('@transaction')\n @Mutation(returns => Boolean, { description: 'To delete multiple geoCitys' })\n async deleteGeoCities(\n @Arg('ids', type => [String]) ids: string[],\n @Ctx() context: ResolverContext\n ): Promise<boolean> {\n const { tx } = context.state\n\n await tx.getRepository(GeoCity).delete({\n id: In(ids)\n })\n\n return true\n }\n}\n"]}
@@ -1,38 +1,36 @@
1
1
  "use strict";
2
- var _a;
3
2
  Object.defineProperty(exports, "__esModule", { value: true });
4
3
  exports.GeoCityQuery = void 0;
5
4
  const tslib_1 = require("tslib");
5
+ const type_graphql_1 = require("type-graphql");
6
6
  const auth_base_1 = require("@things-factory/auth-base");
7
7
  const shell_1 = require("@things-factory/shell");
8
- const type_graphql_1 = require("type-graphql");
9
- const typeorm_1 = require("typeorm");
10
8
  const geo_country_1 = require("../geo-country/geo-country");
11
9
  const geo_state_1 = require("../geo-state/geo-state");
12
10
  const geo_city_1 = require("./geo-city");
13
11
  const geo_city_type_1 = require("./geo-city-type");
14
12
  let GeoCityQuery = class GeoCityQuery {
15
13
  async geoCity(id, context) {
16
- return await (0, typeorm_1.getRepository)(geo_city_1.GeoCity).findOne({
14
+ return await (0, shell_1.getRepository)(geo_city_1.GeoCity).findOne({
17
15
  where: { id }
18
16
  });
19
17
  }
20
18
  async geoCities(params, context) {
21
19
  const convertedParams = (0, shell_1.convertListParams)(params);
22
- const [items, total] = await (0, typeorm_1.getRepository)(geo_city_1.GeoCity).findAndCount(convertedParams);
20
+ const [items, total] = await (0, shell_1.getRepository)(geo_city_1.GeoCity).findAndCount(convertedParams);
23
21
  return { items, total };
24
22
  }
25
23
  async geoCountry(geoCity) {
26
- return await (0, typeorm_1.getRepository)(geo_country_1.GeoCountry).findOne(geoCity.geoCountryId);
24
+ return await (0, shell_1.getRepository)(geo_country_1.GeoCountry).findOneBy({ id: geoCity.geoCountryId });
27
25
  }
28
26
  async geoState(geoCity) {
29
- return await (0, typeorm_1.getRepository)(geo_state_1.GeoState).findOne(geoCity.geoStateId);
27
+ return await (0, shell_1.getRepository)(geo_state_1.GeoState).findOneBy({ id: geoCity.geoStateId });
30
28
  }
31
29
  async updater(geoCity) {
32
- return await (0, typeorm_1.getRepository)(auth_base_1.User).findOne(geoCity.updaterId);
30
+ return await (0, shell_1.getRepository)(auth_base_1.User).findOneBy({ id: geoCity.updaterId });
33
31
  }
34
32
  async creator(geoCity) {
35
- return await (0, typeorm_1.getRepository)(auth_base_1.User).findOne(geoCity.creatorId);
33
+ return await (0, shell_1.getRepository)(auth_base_1.User).findOneBy({ id: geoCity.creatorId });
36
34
  }
37
35
  };
38
36
  tslib_1.__decorate([
@@ -48,7 +46,7 @@ tslib_1.__decorate([
48
46
  tslib_1.__param(0, (0, type_graphql_1.Args)()),
49
47
  tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
50
48
  tslib_1.__metadata("design:type", Function),
51
- tslib_1.__metadata("design:paramtypes", [typeof (_a = typeof shell_1.ListParam !== "undefined" && shell_1.ListParam) === "function" ? _a : Object, Object]),
49
+ tslib_1.__metadata("design:paramtypes", [shell_1.ListParam, Object]),
52
50
  tslib_1.__metadata("design:returntype", Promise)
53
51
  ], GeoCityQuery.prototype, "geoCities", null);
54
52
  tslib_1.__decorate([
@@ -1 +1 @@
1
- {"version":3,"file":"geo-city-query.js","sourceRoot":"","sources":["../../../server/service/geo-city/geo-city-query.ts"],"names":[],"mappings":";;;;;AAAA,yDAAgD;AAChD,iDAAoE;AACpE,+CAAmF;AACnF,qCAAuC;AACvC,4DAAuD;AACvD,sDAAiD;AACjD,yCAAoC;AACpC,mDAA6C;AAGtC,IAAM,YAAY,GAAlB,MAAM,YAAY;IAEjB,AAAN,KAAK,CAAC,OAAO,CAAY,EAAU,EAAS,OAAY;QACtD,OAAO,MAAM,IAAA,uBAAa,EAAC,kBAAO,CAAC,CAAC,OAAO,CAAC;YAC1C,KAAK,EAAE,EAAE,EAAE,EAAE;SACd,CAAC,CAAA;IACJ,CAAC;IAGK,AAAN,KAAK,CAAC,SAAS,CAAS,MAAiB,EAAS,OAAY;QAC5D,MAAM,eAAe,GAAG,IAAA,yBAAiB,EAAC,MAAM,CAAC,CAAA;QACjD,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,MAAM,IAAA,uBAAa,EAAC,kBAAO,CAAC,CAAC,YAAY,CAAC,eAAe,CAAC,CAAA;QAEjF,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,CAAA;IACzB,CAAC;IAGK,AAAN,KAAK,CAAC,UAAU,CAAS,OAAgB;QACvC,OAAO,MAAM,IAAA,uBAAa,EAAC,wBAAU,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,YA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IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAU,kBAAO;;2CAErC;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAU,kBAAO;;2CAErC;AAlCU,YAAY;IADxB,IAAA,uBAAQ,EAAC,kBAAO,CAAC;GACL,YAAY,CAmCxB;AAnCY,oCAAY","sourcesContent":["import { User } from '@things-factory/auth-base'\nimport { convertListParams, ListParam } from '@things-factory/shell'\nimport { Arg, Args, Ctx, FieldResolver, Query, Resolver, Root } from 'type-graphql'\nimport { getRepository } from 'typeorm'\nimport { GeoCountry } from '../geo-country/geo-country'\nimport { GeoState } from '../geo-state/geo-state'\nimport { GeoCity } from './geo-city'\nimport { GeoCityList } from './geo-city-type'\n\n@Resolver(GeoCity)\nexport class GeoCityQuery {\n @Query(returns => GeoCity, { description: 'To fetch a GeoCity' })\n async geoCity(@Arg('id') id: string, @Ctx() context: any): Promise<GeoCity> {\n return await getRepository(GeoCity).findOne({\n where: { id }\n })\n }\n\n @Query(returns => GeoCityList, { description: 'To fetch multiple GeoCities' })\n async geoCities(@Args() params: ListParam, @Ctx() context: any): Promise<GeoCityList> {\n const convertedParams = convertListParams(params)\n const [items, total] = await getRepository(GeoCity).findAndCount(convertedParams)\n\n return { items, total }\n }\n\n @FieldResolver(type => GeoCountry)\n async geoCountry(@Root() geoCity: GeoCity): Promise<GeoCountry> {\n return await getRepository(GeoCountry).findOne(geoCity.geoCountryId)\n }\n\n @FieldResolver(type => GeoState)\n async geoState(@Root() geoCity: GeoCity): Promise<GeoState> {\n return await getRepository(GeoState).findOne(geoCity.geoStateId)\n }\n\n @FieldResolver(type => User)\n async updater(@Root() geoCity: GeoCity): Promise<User> {\n return await getRepository(User).findOne(geoCity.updaterId)\n }\n\n @FieldResolver(type => User)\n async creator(@Root() geoCity: GeoCity): Promise<User> {\n return await getRepository(User).findOne(geoCity.creatorId)\n }\n}\n"]}
1
+ {"version":3,"file":"geo-city-query.js","sourceRoot":"","sources":["../../../server/service/geo-city/geo-city-query.ts"],"names":[],"mappings":";;;;AAAA,+CAAmF;AAEnF,yDAAgD;AAChD,iDAAmF;AAEnF,4DAAuD;AACvD,sDAAiD;AACjD,yCAAoC;AACpC,mDAA6C;AAG7C,IAAa,YAAY,GAAzB,MAAa,YAAY;IAEvB,KAAK,CAAC,OAAO,CAAY,EAAU,EAAS,OAAwB;QAClE,OAAO,MAAM,IAAA,qBAAa,EAAC,kBAAO,CAAC,CAAC,OAAO,CAAC;YAC1C,KAAK,EAAE,EAAE,EAAE,EAAE;SACd,CAAC,CAAA;IACJ,CAAC;IAGD,KAAK,CAAC,SAAS,CAAS,MAAiB,EAAS,OAAwB;QACxE,MAAM,eAAe,GAAG,IAAA,yBAAiB,EAAC,MAAM,CAAC,CAAA;QACjD,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,MAAM,IAAA,qBAAa,EAAC,kBAAO,CAAC,CAAC,YAAY,CAAC,eAAe,CAAC,CAAA;QAEjF,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,CAAA;IACzB,CAAC;IAGD,KAAK,CAAC,UAAU,CAAS,OAAgB;QACvC,OAAO,MAAM,IAAA,qBAAa,EAAC,wBAAU,CAAC,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,OAAO,CAAC,YAAY,EAAE,CAAC,CAAA;IAChF,CAAC;IAGD,KAAK,CAAC,QAAQ,CAAS,OAAgB;QACrC,OAAO,MAAM,IAAA,qBAAa,EAAC,oBAAQ,CAAC,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,OAAO,CAAC,UAAU,EAAE,CAAC,CAAA;IAC5E,CAAC;IAGD,KAAK,CAAC,OAAO,CAAS,OAAgB;QACpC,OAAO,MAAM,IAAA,qBAAa,EAAC,gBAAI,CAAC,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE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AY,CAmCxB;AAnCY,oCAAY","sourcesContent":["import { Arg, Args, Ctx, FieldResolver, Query, Resolver, Root } from 'type-graphql'\n\nimport { User } from '@things-factory/auth-base'\nimport { convertListParams, getRepository, ListParam } from '@things-factory/shell'\n\nimport { GeoCountry } from '../geo-country/geo-country'\nimport { GeoState } from '../geo-state/geo-state'\nimport { GeoCity } from './geo-city'\nimport { GeoCityList } from './geo-city-type'\n\n@Resolver(GeoCity)\nexport class GeoCityQuery {\n @Query(returns => GeoCity, { description: 'To fetch a GeoCity' })\n async geoCity(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<GeoCity> {\n return await getRepository(GeoCity).findOne({\n where: { id }\n })\n }\n\n @Query(returns => GeoCityList, { description: 'To fetch multiple GeoCities' })\n async geoCities(@Args() params: ListParam, @Ctx() context: ResolverContext): Promise<GeoCityList> {\n const convertedParams = convertListParams(params)\n const [items, total] = await getRepository(GeoCity).findAndCount(convertedParams)\n\n return { items, total }\n }\n\n @FieldResolver(type => GeoCountry)\n async geoCountry(@Root() geoCity: GeoCity): Promise<GeoCountry> {\n return await getRepository(GeoCountry).findOneBy({ id: geoCity.geoCountryId })\n }\n\n @FieldResolver(type => GeoState)\n async geoState(@Root() geoCity: GeoCity): Promise<GeoState> {\n return await getRepository(GeoState).findOneBy({ id: geoCity.geoStateId })\n }\n\n @FieldResolver(type => User)\n async updater(@Root() geoCity: GeoCity): Promise<User> {\n return await getRepository(User).findOneBy({ id: geoCity.updaterId })\n }\n\n @FieldResolver(type => User)\n async creator(@Root() geoCity: GeoCity): Promise<User> {\n return await getRepository(User).findOneBy({ id: geoCity.creatorId })\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"geo-city-type.js","sourceRoot":"","sources":["../../../server/service/geo-city/geo-city-type.ts"],"names":[],"mappings":";;;;AAAA,+CAAoE;AACpE,yCAAoC;AAG7B,IAAM,UAAU,GAAhB,MAAM,UAAU;CAYtB,CAAA;AAXC;IAAC,IAAA,oBAAK,GAAE;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} from './geo-city'\n\n@InputType()\nexport class NewGeoCity {\n @Field()\n name: string\n\n @Field({ nullable: true })\n description?: string\n\n @Field({ nullable: true })\n latitude?: string\n\n @Field({ nullable: true })\n longitude?: string\n}\n\n@InputType()\nexport class GeoCityPatch {\n @Field(type => ID, { nullable: true })\n id?: string\n\n @Field({ nullable: true })\n name?: string\n\n @Field({ nullable: true })\n description?: string\n\n @Field({ nullable: true })\n latitude?: string\n\n @Field({ nullable: true })\n longitude?: string\n\n @Field()\n cuFlag: string\n}\n\n@ObjectType()\nexport class GeoCityList {\n @Field(type => [GeoCity])\n items: GeoCity[]\n\n @Field(type => Int)\n total: number\n}\n"]}
1
+ {"version":3,"file":"geo-city-type.js","sourceRoot":"","sources":["../../../server/service/geo-city/geo-city-type.ts"],"names":[],"mappings":";;;;AAAA,+CAAoE;AACpE,yCAAoC;AAGpC,IAAa,UAAU,GAAvB,MAAa,UAAU;CAYtB,CAAA;AAVC;IADC,IAAA,oBAAK,GAAE;;wCACI;AAGZ;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;+CACN;AAGpB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;4CACT;AAGjB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;6CACR;AAXP,UAAU;IADtB,IAAA,wBAAS,GAAE;GACC,UAAU,CAYtB;AAZY,gCAAU;AAevB,IAAa,YAAY,GAAzB,MAAa,YAAY;CAkBxB,CAAA;AAhBC;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;wCAC3B;AAGX;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;0CACb;AAGb;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;iDACN;AAGpB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;8CACT;AAGjB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;+CACR;AAGlB;IADC,IAAA,oBAAK,GAAE;;4CACM;AAjBH,YAAY;IADxB,IAAA,wBAAS,GAAE;GACC,YAAY,CAkBxB;AAlBY,oCAAY;AAqBzB,IAAa,WAAW,GAAxB,MAAa,WAAW;CAMvB,CAAA;AAJC;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,kBAAO,CAAC,CAAC;;0CACT;AAGhB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,CAAC;;0CACN;AALF,WAAW;IADvB,IAAA,yBAAU,GAAE;GACA,WAAW,CAMvB;AANY,kCAAW","sourcesContent":["import { Field, ID, InputType, Int, ObjectType } from 'type-graphql'\nimport { GeoCity } from './geo-city'\n\n@InputType()\nexport class NewGeoCity {\n @Field()\n name: string\n\n @Field({ nullable: true })\n description?: string\n\n @Field({ nullable: true })\n latitude?: string\n\n @Field({ nullable: true })\n longitude?: string\n}\n\n@InputType()\nexport class GeoCityPatch {\n @Field(type => ID, { nullable: true })\n id?: string\n\n @Field({ nullable: true })\n name?: string\n\n @Field({ nullable: true })\n description?: string\n\n @Field({ nullable: true })\n latitude?: string\n\n @Field({ nullable: true })\n longitude?: string\n\n @Field()\n cuFlag: string\n}\n\n@ObjectType()\nexport class GeoCityList {\n @Field(type => [GeoCity])\n items: GeoCity[]\n\n @Field(type => Int)\n total: number\n}\n"]}
@@ -1,5 +1,4 @@
1
1
  "use strict";
2
- var _a, _b;
3
2
  Object.defineProperty(exports, "__esModule", { value: true });
4
3
  exports.GeoCity = void 0;
5
4
  const tslib_1 = require("tslib");
@@ -70,7 +69,7 @@ tslib_1.__decorate([
70
69
  nullable: true
71
70
  }),
72
71
  (0, type_graphql_1.Field)({ nullable: true }),
73
- tslib_1.__metadata("design:type", typeof (_a = typeof auth_base_1.User !== "undefined" && auth_base_1.User) === "function" ? _a : Object)
72
+ tslib_1.__metadata("design:type", auth_base_1.User)
74
73
  ], GeoCity.prototype, "creator", void 0);
75
74
  tslib_1.__decorate([
76
75
  (0, typeorm_1.RelationId)((geoCity) => geoCity.creator),
@@ -81,7 +80,7 @@ tslib_1.__decorate([
81
80
  nullable: true
82
81
  }),
83
82
  (0, type_graphql_1.Field)({ nullable: true }),
84
- tslib_1.__metadata("design:type", typeof (_b = typeof auth_base_1.User !== "undefined" && auth_base_1.User) === "function" ? _b : Object)
83
+ tslib_1.__metadata("design:type", auth_base_1.User)
85
84
  ], GeoCity.prototype, "updater", void 0);
86
85
  tslib_1.__decorate([
87
86
  (0, typeorm_1.RelationId)((geoCity) => geoCity.creator),
@@ -89,7 +88,7 @@ tslib_1.__decorate([
89
88
  ], GeoCity.prototype, "updaterId", void 0);
90
89
  GeoCity = tslib_1.__decorate([
91
90
  (0, typeorm_1.Entity)(),
92
- (0, typeorm_1.Index)('ix_geo_city_0', (geoCity) => [geoCity.geoCountry, geoCity.name], { unique: true }),
91
+ (0, typeorm_1.Index)('ix_geo_city_0', (geoCity) => [geoCity.geoCountry, geoCity.name, geoCity.geoState], { unique: true }),
93
92
  (0, type_graphql_1.ObjectType)({ description: 'Entity for GeoCity' })
94
93
  ], GeoCity);
95
94
  exports.GeoCity = GeoCity;
@@ -1 +1 @@
1
- {"version":3,"file":"geo-city.js","sourceRoot":"","sources":["../../../server/service/geo-city/geo-city.ts"],"names":[],"mappings":";;;;;AAAA,yDAAgD;AAChD,+CAAoD;AACpD,qCASgB;AAChB,4DAAuD;AACvD,sDAAiD;AAK1C,IAAM,OAAO,GAAb,MAAM,OAAO;CA8DnB,CAAA;AA7DC;IAAC,IAAA,gCAAsB,EAAC,MAAM,CAAC;IAC9B,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,CAAC;;mCACC;AAEnB;IAAC,IAA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vB,QAAQ,EAAE,IAAI;KACf,CAAC;IACD,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;0DAChB,gBAAI,oBAAJ,gBAAI;wCAAA;AAEd;IAAC,IAAA,oBAAU,EAAC,CAAC,OAAgB,EAAE,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC;;0CAChC;AAElB;IAAC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,EAAE;QACvB,QAAQ,EAAE,IAAI;KACf,CAAC;IACD,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;0DAChB,gBAAI,oBAAJ,gBAAI;wCAAA;AAEd;IAAC,IAAA,oBAAU,EAAC,CAAC,OAAgB,EAAE,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC;;0CAChC;AA7DP,OAAO;IAHnB,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EAAC,eAAe,EAAE,CAAC,OAAgB,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,UAAU,EAAE,OAAO,CAAC,IAAI,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IAClG,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,oBAAoB,EAAE,CAAC;GACrC,OAAO,CA8DnB;AA9DY,0BAAO","sourcesContent":["import { User } from '@things-factory/auth-base'\nimport { Field, ID, ObjectType } from 'type-graphql'\nimport {\n Column,\n CreateDateColumn,\n Entity,\n Index,\n ManyToOne,\n PrimaryGeneratedColumn,\n RelationId,\n UpdateDateColumn\n} from 'typeorm'\nimport { GeoCountry } from '../geo-country/geo-country'\nimport { GeoState } from '../geo-state/geo-state'\n\n@Entity()\n@Index('ix_geo_city_0', (geoCity: GeoCity) => [geoCity.geoCountry, geoCity.name], { unique: true })\n@ObjectType({ description: 'Entity for GeoCity' })\nexport class GeoCity {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID)\n readonly id: string\n\n @ManyToOne(type => GeoCountry)\n @Field()\n geoCountry: GeoCountry\n\n @RelationId((geoCity: GeoCity) => geoCity.geoCountry)\n geoCountryId?: string\n\n @ManyToOne(type => GeoState)\n @Field({ nullable: true })\n geoState?: GeoState\n\n @RelationId((geoCity: GeoCity) => geoCity.geoState)\n geoStateId?: string\n\n @Column()\n @Field()\n name: string\n\n @Column({\n nullable: true\n })\n @Field({ nullable: true })\n description?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n latitude?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n longitude?: string\n\n @CreateDateColumn()\n @Field({ nullable: true })\n createdAt?: Date\n\n @UpdateDateColumn()\n @Field({ nullable: true })\n updatedAt?: Date\n\n @ManyToOne(type => User, {\n nullable: true\n })\n @Field({ nullable: true })\n creator?: User\n\n @RelationId((geoCity: GeoCity) => geoCity.creator)\n creatorId?: string\n\n @ManyToOne(type => User, {\n nullable: true\n })\n @Field({ nullable: true })\n updater?: User\n\n @RelationId((geoCity: GeoCity) => geoCity.creator)\n updaterId?: string\n}\n"]}
1
+ {"version":3,"file":"geo-city.js","sourceRoot":"","sources":["../../../server/service/geo-city/geo-city.ts"],"names":[],"mappings":";;;;AAAA,yDAAgD;AAChD,+CAAoD;AACpD,qCASgB;AAChB,4DAAuD;AACvD,sDAAiD;AAKjD,IAAa,OAAO,GAApB,MAAa,OAAO;CA8DnB,CAAA;AA3DC;IAFC,IAAA,gCAAsB,EAAC,MAAM,CAAC;IAC9B,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,CAAC;;mCACC;AAInB;IAFC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,wBAAU,CAAC;IAC7B,IAAA,oBAAK,GAAE;sCACI,wBAAU;2CAAA;AAGtB;IADC,IAAA,oBAAU,EAAC,CAAC,OAAgB,EAAE,EAAE,CAAC,OAAO,CAAC,UAAU,CAAC;;6CAChC;AAIrB;IAFC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAA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AAI,CAAC,EAAE,CAAC,gBAAI,EAAE;QACvB,QAAQ,EAAE,IAAI;KACf,CAAC;IACD,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCAChB,gBAAI;wCAAA;AAGd;IADC,IAAA,oBAAU,EAAC,CAAC,OAAgB,EAAE,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC;;0CAChC;AA7DP,OAAO;IAHnB,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EAAC,eAAe,EAAE,CAAC,OAAgB,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,UAAU,EAAE,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IACpH,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,oBAAoB,EAAE,CAAC;GACrC,OAAO,CA8DnB;AA9DY,0BAAO","sourcesContent":["import { User } from '@things-factory/auth-base'\nimport { Field, ID, ObjectType } from 'type-graphql'\nimport {\n Column,\n CreateDateColumn,\n Entity,\n Index,\n ManyToOne,\n PrimaryGeneratedColumn,\n RelationId,\n UpdateDateColumn\n} from 'typeorm'\nimport { GeoCountry } from '../geo-country/geo-country'\nimport { GeoState } from '../geo-state/geo-state'\n\n@Entity()\n@Index('ix_geo_city_0', (geoCity: GeoCity) => [geoCity.geoCountry, geoCity.name, geoCity.geoState], { unique: true })\n@ObjectType({ description: 'Entity for GeoCity' })\nexport class GeoCity {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID)\n readonly id: string\n\n @ManyToOne(type => GeoCountry)\n @Field()\n geoCountry: GeoCountry\n\n @RelationId((geoCity: GeoCity) => geoCity.geoCountry)\n geoCountryId?: string\n\n @ManyToOne(type => GeoState)\n @Field({ nullable: true })\n geoState?: GeoState\n\n @RelationId((geoCity: GeoCity) => geoCity.geoState)\n geoStateId?: string\n\n @Column()\n @Field()\n name: string\n\n @Column({\n nullable: true\n })\n @Field({ nullable: true })\n description?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n latitude?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n longitude?: string\n\n @CreateDateColumn()\n @Field({ nullable: true })\n createdAt?: Date\n\n @UpdateDateColumn()\n @Field({ nullable: true })\n updatedAt?: Date\n\n @ManyToOne(type => User, {\n nullable: true\n })\n @Field({ nullable: true })\n creator?: User\n\n @RelationId((geoCity: GeoCity) => geoCity.creator)\n creatorId?: string\n\n @ManyToOne(type => User, {\n nullable: true\n })\n @Field({ nullable: true })\n updater?: User\n\n @RelationId((geoCity: GeoCity) => geoCity.creator)\n updaterId?: string\n}\n"]}
@@ -35,7 +35,7 @@ let GeoContinentMutation = class GeoContinentMutation {
35
35
  if (_updateRecords.length > 0) {
36
36
  for (let i = 0; i < _updateRecords.length; i++) {
37
37
  const newRecord = _updateRecords[i];
38
- const geoContinent = await geoContinentRepo.findOne(newRecord.id);
38
+ const geoContinent = await geoContinentRepo.findOneBy({ id: newRecord.id });
39
39
  const result = await geoContinentRepo.save(Object.assign(Object.assign(Object.assign({}, geoContinent), newRecord), { updater: user }));
40
40
  results.push(Object.assign(Object.assign({}, result), { cuFlag: 'M' }));
41
41
  }
@@ -1 +1 @@
1
- {"version":3,"file":"geo-continent-mutation.js","sourceRoot":"","sources":["../../../server/service/geo-continent/geo-continent-mutation.ts"],"names":[],"mappings":";;;;AAAA,+CAAsE;AACtE,qCAA4B;AAC5B,mDAA8C;AAC9C,6DAAyE;AAGlE,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;IAGzB,AAAN,KAAK,CAAC,kBAAkB,CACD,YAA6B,EAC3C,OAAY;QAEnB,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAElC,OAAO,MAAM,EAAE,CAAC,aAAa,CAAC,4BAAY,CAAC,CAAC,IAAI,iCAC3C,YAAY,KACf,OAAO,EAAE,IAAI,EACb,OAAO,EAAE,IAAI,IACb,C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AAkC,EAAE,CAAC;IACvD,mBAAA,IAAA,kBAAG,EAAC,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAA;IAAiB,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;+DAQ5E;AArGU,oBAAoB;IADhC,IAAA,uBAAQ,EAAC,4BAAY,CAAC;GACV,oBAAoB,CAsGhC;AAtGY,oDAAoB","sourcesContent":["import { Arg, Ctx, Directive, Mutation, Resolver } from 'type-graphql'\nimport { In } from 'typeorm'\nimport { GeoContinent } from './geo-continent'\nimport { GeoContinentPatch, NewGeoContinent } from './geo-continent-type'\n\n@Resolver(GeoContinent)\nexport class GeoContinentMutation {\n @Directive('@transaction')\n @Mutation(returns => GeoContinent, { description: 'To create new GeoContinent' })\n async createGeoContinent(\n @Arg('geoContinent') geoContinent: NewGeoContinent,\n @Ctx() context: any\n ): Promise<GeoContinent> {\n const { user, tx } = context.state\n\n return await tx.getRepository(GeoContinent).save({\n ...geoContinent,\n creator: user,\n updater: user\n })\n }\n\n @Directive('@transaction')\n @Mutation(returns => GeoContinent, { description: 'To modify GeoContinent information' })\n async updateGeoContinent(\n @Arg('id') id: string,\n @Arg('patch') patch: GeoContinentPatch,\n @Ctx() context: any\n ): Promise<GeoContinent> {\n const { user, tx } = context.state\n\n const repository = tx.getRepository(GeoContinent)\n const geoContinent = await repository.findOne({\n where: { id }\n })\n\n return await repository.save({\n ...geoContinent,\n ...patch,\n updater: user\n })\n }\n\n @Directive('@transaction')\n @Mutation(returns => [GeoContinent], { description: \"To modify multiple GeoContinents' information\" })\n async updateMultipleGeoContinent(\n @Arg('patches', type => [GeoContinentPatch]) patches: GeoContinentPatch[],\n @Ctx() context: any\n ): Promise<GeoContinent[]> {\n const { user, tx } = context.state\n\n let results = []\n const _createRecords = patches.filter((patch: any) => patch.cuFlag.toUpperCase() === '+')\n const _updateRecords = patches.filter((patch: any) => patch.cuFlag.toUpperCase() === 'M')\n const geoContinentRepo = tx.getRepository(GeoContinent)\n\n if (_createRecords.length > 0) {\n for (let i = 0; i < _createRecords.length; i++) {\n const newRecord = _createRecords[i]\n\n const result = await geoContinentRepo.save({\n ...newRecord,\n creator: user,\n updater: user\n })\n\n results.push({ ...result, cuFlag: '+' })\n }\n }\n\n if (_updateRecords.length > 0) {\n for (let i = 0; i < _updateRecords.length; i++) {\n const newRecord = _updateRecords[i]\n const geoContinent = await geoContinentRepo.findOne(newRecord.id)\n\n const result = await geoContinentRepo.save({\n ...geoContinent,\n ...newRecord,\n updater: user\n })\n\n results.push({ ...result, cuFlag: 'M' })\n }\n }\n\n return results\n }\n\n @Directive('@transaction')\n @Mutation(returns => Boolean, { description: 'To delete GeoContinent' })\n async deleteGeoContinent(@Arg('id') id: string, @Ctx() context: any): Promise<boolean> {\n const { tx } = context.state\n\n await tx.getRepository(GeoContinent).delete({ id })\n return true\n }\n\n @Directive('@transaction')\n @Mutation(returns => Boolean, { description: 'To delete multiple geoContinents' })\n async deleteGeoContinents(@Arg('ids', type => [String]) ids: string[], @Ctx() context: any): Promise<boolean> {\n const { tx } = context.state\n\n await tx.getRepository(GeoContinent).delete({\n id: In(ids)\n })\n\n return true\n }\n}\n"]}
1
+ {"version":3,"file":"geo-continent-mutation.js","sourceRoot":"","sources":["../../../server/service/geo-continent/geo-continent-mutation.ts"],"names":[],"mappings":";;;;AAAA,+CAAsE;AACtE,qCAA4B;AAE5B,mDAA8C;AAC9C,6DAAyE;AAGzE,IAAa,oBAAoB,GAAjC,MAAa,oBAAoB;IAG/B,KAAK,CAAC,kBAAkB,CACD,YAA6B,EAC3C,OAAwB;QAE/B,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAElC,OAAO,MAAM,EAAE,CAAC,aAAa,CAAC,4BAAY,CAAC,CAAC,IAAI,iCAC3C,YAAY,KACf,OAAO,EAAE,IAAI,EACb,OAAO,EAAE,IAAI,IACb,CAAA;IACJ,CAAC;IAID,KAAK,CAA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A,kBAAG,EAAC,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAA;IAC5B,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;+DASP;AAxGU,oBAAoB;IADhC,IAAA,uBAAQ,EAAC,4BAAY,CAAC;GACV,oBAAoB,CAyGhC;AAzGY,oDAAoB","sourcesContent":["import { Arg, Ctx, Directive, Mutation, Resolver } from 'type-graphql'\nimport { In } from 'typeorm'\n\nimport { GeoContinent } from './geo-continent'\nimport { GeoContinentPatch, NewGeoContinent } from './geo-continent-type'\n\n@Resolver(GeoContinent)\nexport class GeoContinentMutation {\n @Directive('@transaction')\n @Mutation(returns => GeoContinent, { description: 'To create new GeoContinent' })\n async createGeoContinent(\n @Arg('geoContinent') geoContinent: NewGeoContinent,\n @Ctx() context: ResolverContext\n ): Promise<GeoContinent> {\n const { user, tx } = context.state\n\n return await tx.getRepository(GeoContinent).save({\n ...geoContinent,\n creator: user,\n updater: user\n })\n }\n\n @Directive('@transaction')\n @Mutation(returns => GeoContinent, { description: 'To modify GeoContinent information' })\n async updateGeoContinent(\n @Arg('id') id: string,\n @Arg('patch') patch: GeoContinentPatch,\n @Ctx() context: ResolverContext\n ): Promise<GeoContinent> {\n const { user, tx } = context.state\n\n const repository = tx.getRepository(GeoContinent)\n const geoContinent = await repository.findOne({\n where: { id }\n })\n\n return await repository.save({\n ...geoContinent,\n ...patch,\n updater: user\n })\n }\n\n @Directive('@transaction')\n @Mutation(returns => [GeoContinent], { description: \"To modify multiple GeoContinents' information\" })\n async updateMultipleGeoContinent(\n @Arg('patches', type => [GeoContinentPatch]) patches: GeoContinentPatch[],\n @Ctx() context: ResolverContext\n ): Promise<GeoContinent[]> {\n const { user, tx } = context.state\n\n let results = []\n const _createRecords = patches.filter((patch: any) => patch.cuFlag.toUpperCase() === '+')\n const _updateRecords = patches.filter((patch: any) => patch.cuFlag.toUpperCase() === 'M')\n const geoContinentRepo = tx.getRepository(GeoContinent)\n\n if (_createRecords.length > 0) {\n for (let i = 0; i < _createRecords.length; i++) {\n const newRecord = _createRecords[i]\n\n const result = await geoContinentRepo.save({\n ...newRecord,\n creator: user,\n updater: user\n })\n\n results.push({ ...result, cuFlag: '+' })\n }\n }\n\n if (_updateRecords.length > 0) {\n for (let i = 0; i < _updateRecords.length; i++) {\n const newRecord = _updateRecords[i]\n const geoContinent = await geoContinentRepo.findOneBy({ id: newRecord.id })\n\n const result = await geoContinentRepo.save({\n ...geoContinent,\n ...newRecord,\n updater: user\n })\n\n results.push({ ...result, cuFlag: 'M' })\n }\n }\n\n return results\n }\n\n @Directive('@transaction')\n @Mutation(returns => Boolean, { description: 'To delete GeoContinent' })\n async deleteGeoContinent(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<boolean> {\n const { tx } = context.state\n\n await tx.getRepository(GeoContinent).delete({ id })\n return true\n }\n\n @Directive('@transaction')\n @Mutation(returns => Boolean, { description: 'To delete multiple geoContinents' })\n async deleteGeoContinents(\n @Arg('ids', type => [String]) ids: string[],\n @Ctx() context: ResolverContext\n ): Promise<boolean> {\n const { tx } = context.state\n\n await tx.getRepository(GeoContinent).delete({\n id: In(ids)\n })\n\n return true\n }\n}\n"]}
@@ -1,30 +1,28 @@
1
1
  "use strict";
2
- var _a;
3
2
  Object.defineProperty(exports, "__esModule", { value: true });
4
3
  exports.GeoContinentQuery = void 0;
5
4
  const tslib_1 = require("tslib");
5
+ const type_graphql_1 = require("type-graphql");
6
6
  const auth_base_1 = require("@things-factory/auth-base");
7
7
  const shell_1 = require("@things-factory/shell");
8
- const type_graphql_1 = require("type-graphql");
9
- const typeorm_1 = require("typeorm");
10
8
  const geo_continent_1 = require("./geo-continent");
11
9
  const geo_continent_type_1 = require("./geo-continent-type");
12
10
  let GeoContinentQuery = class GeoContinentQuery {
13
11
  async geoContinent(id, context) {
14
- return await (0, typeorm_1.getRepository)(geo_continent_1.GeoContinent).findOne({
12
+ return await (0, shell_1.getRepository)(geo_continent_1.GeoContinent).findOne({
15
13
  where: { id }
16
14
  });
17
15
  }
18
16
  async geoContinents(params, context) {
19
17
  const convertedParams = (0, shell_1.convertListParams)(params);
20
- const [items, total] = await (0, typeorm_1.getRepository)(geo_continent_1.GeoContinent).findAndCount(convertedParams);
18
+ const [items, total] = await (0, shell_1.getRepository)(geo_continent_1.GeoContinent).findAndCount(convertedParams);
21
19
  return { items, total };
22
20
  }
23
21
  async updater(geoContinent) {
24
- return await (0, typeorm_1.getRepository)(auth_base_1.User).findOne(geoContinent.updaterId);
22
+ return await (0, shell_1.getRepository)(auth_base_1.User).findOneBy({ id: geoContinent.updaterId });
25
23
  }
26
24
  async creator(geoContinent) {
27
- return await (0, typeorm_1.getRepository)(auth_base_1.User).findOne(geoContinent.creatorId);
25
+ return await (0, shell_1.getRepository)(auth_base_1.User).findOneBy({ id: geoContinent.creatorId });
28
26
  }
29
27
  };
30
28
  tslib_1.__decorate([
@@ -40,7 +38,7 @@ tslib_1.__decorate([
40
38
  tslib_1.__param(0, (0, type_graphql_1.Args)()),
41
39
  tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
42
40
  tslib_1.__metadata("design:type", Function),
43
- tslib_1.__metadata("design:paramtypes", [typeof (_a = typeof shell_1.ListParam !== "undefined" && shell_1.ListParam) === "function" ? _a : Object, Object]),
41
+ tslib_1.__metadata("design:paramtypes", [shell_1.ListParam, Object]),
44
42
  tslib_1.__metadata("design:returntype", Promise)
45
43
  ], GeoContinentQuery.prototype, "geoContinents", null);
46
44
  tslib_1.__decorate([
@@ -1 +1 @@
1
- {"version":3,"file":"geo-continent-query.js","sourceRoot":"","sources":["../../../server/service/geo-continent/geo-continent-query.ts"],"names":[],"mappings":";;;;;AAAA,yDAAgD;AAChD,iDAAoE;AACpE,+CAAmF;AACnF,qCAAuC;AACvC,mDAA8C;AAC9C,6DAAuD;AAGhD,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;IAEtB,AAAN,KAAK,CAAC,YAAY,CAAY,EAAU,EAAS,OAAY;Q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C,EAAE,CAAC,gBAAI,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAe,4BAAY;;gDAE/C;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAe,4BAAY;;gDAE/C;AAxBU,iBAAiB;IAD7B,IAAA,uBAAQ,EAAC,4BAAY,CAAC;GACV,iBAAiB,CAyB7B;AAzBY,8CAAiB","sourcesContent":["import { User } from '@things-factory/auth-base'\nimport { convertListParams, ListParam } from '@things-factory/shell'\nimport { Arg, Args, Ctx, FieldResolver, Query, Resolver, Root } from 'type-graphql'\nimport { getRepository } from 'typeorm'\nimport { GeoContinent } from './geo-continent'\nimport { GeoContinentList } from './geo-continent-type'\n\n@Resolver(GeoContinent)\nexport class GeoContinentQuery {\n @Query(returns => GeoContinent, { description: 'To fetch a GeoContinent' })\n async geoContinent(@Arg('id') id: string, @Ctx() context: any): Promise<GeoContinent> {\n return await getRepository(GeoContinent).findOne({\n where: { id }\n })\n }\n\n @Query(returns => GeoContinentList, { description: 'To fetch multiple GeoContinents' })\n async geoContinents(@Args() params: ListParam, @Ctx() context: any): Promise<GeoContinentList> {\n const convertedParams = convertListParams(params)\n const [items, total] = await getRepository(GeoContinent).findAndCount(convertedParams)\n\n return { items, total }\n }\n\n @FieldResolver(type => User)\n async updater(@Root() geoContinent: GeoContinent): Promise<User> {\n return await getRepository(User).findOne(geoContinent.updaterId)\n }\n\n @FieldResolver(type => User)\n async creator(@Root() geoContinent: GeoContinent): Promise<User> {\n return await getRepository(User).findOne(geoContinent.creatorId)\n }\n}\n"]}
1
+ {"version":3,"file":"geo-continent-query.js","sourceRoot":"","sources":["../../../server/service/geo-continent/geo-continent-query.ts"],"names":[],"mappings":";;;;AAAA,+CAAmF;AAEnF,yDAAgD;AAChD,iDAAmF;AAEnF,mDAA8C;AAC9C,6DAAuD;AAGvD,IAAa,iBAAiB,GAA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AA,kBAAG,GAAE,CAAA;;6CAAjB,iBAAS;;sDAK5C;AAGD;IADC,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAe,4BAAY;;gDAE/C;AAGD;IADC,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAe,4BAAY;;gDAE/C;AAxBU,iBAAiB;IAD7B,IAAA,uBAAQ,EAAC,4BAAY,CAAC;GACV,iBAAiB,CAyB7B;AAzBY,8CAAiB","sourcesContent":["import { Arg, Args, Ctx, FieldResolver, Query, Resolver, Root } from 'type-graphql'\n\nimport { User } from '@things-factory/auth-base'\nimport { convertListParams, getRepository, ListParam } from '@things-factory/shell'\n\nimport { GeoContinent } from './geo-continent'\nimport { GeoContinentList } from './geo-continent-type'\n\n@Resolver(GeoContinent)\nexport class GeoContinentQuery {\n @Query(returns => GeoContinent, { description: 'To fetch a GeoContinent' })\n async geoContinent(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<GeoContinent> {\n return await getRepository(GeoContinent).findOne({\n where: { id }\n })\n }\n\n @Query(returns => GeoContinentList, { description: 'To fetch multiple GeoContinents' })\n async geoContinents(@Args() params: ListParam, @Ctx() context: ResolverContext): Promise<GeoContinentList> {\n const convertedParams = convertListParams(params)\n const [items, total] = await getRepository(GeoContinent).findAndCount(convertedParams)\n\n return { items, total }\n }\n\n @FieldResolver(type => User)\n async updater(@Root() geoContinent: GeoContinent): Promise<User> {\n return await getRepository(User).findOneBy({ id: geoContinent.updaterId })\n }\n\n @FieldResolver(type => User)\n async creator(@Root() geoContinent: GeoContinent): Promise<User> {\n return await getRepository(User).findOneBy({ id: geoContinent.creatorId })\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"geo-continent-type.js","sourceRoot":"","sources":["../../../server/service/geo-continent/geo-continent-type.ts"],"names":[],"mappings":";;;;AAAA,+CAAoE;AACpE,mDAA8C;AAGvC,IAAM,eAAe,GAArB,MAAM,eAAe;CAM3B,CAAA;AALC;IAAC,IAAA,oBAAK,GAAE;;6CACI;AAEZ;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;oDACN;AALT,eAAe;IAD3B,IAAA,wBAAS,GAAE;GACC,eAAe,CAM3B;AANY,0CAAe;AASrB,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;CAY7B,CAAA;AAXC;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;6CAC3B;AAEX;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;+CACb;AAEb;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;sDACN;AAEpB;IAAC,IAAA,oBAAK,GAAE;;iDACM;AAXH,iBAAiB;IAD7B,IAAA,wBAAS,GAAE;GACC,iBAAiB,CAY7B;AAZY,8CAAiB;AAevB,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;CAM5B,CAAA;AALC;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,4BAAY,CAAC,CAAC;;+CACT;AAErB;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,CAAC;;+CACN;AALF,gBAAgB;IAD5B,IAAA,yBAAU,GAAE;GACA,gBAAgB,CAM5B;AANY,4CAAgB","sourcesContent":["import { Field, ID, InputType, Int, ObjectType } from 'type-graphql'\nimport { GeoContinent } from './geo-continent'\n\n@InputType()\nexport class NewGeoContinent {\n @Field()\n name: string\n\n @Field({ nullable: true })\n description?: string\n}\n\n@InputType()\nexport class GeoContinentPatch {\n @Field(type => ID, { nullable: true })\n id?: string\n\n @Field({ nullable: true })\n name?: string\n\n @Field({ nullable: true })\n description?: string\n\n @Field()\n cuFlag: string\n}\n\n@ObjectType()\nexport class GeoContinentList {\n @Field(type => [GeoContinent])\n items: GeoContinent[]\n\n @Field(type => Int)\n total: number\n}\n"]}
1
+ {"version":3,"file":"geo-continent-type.js","sourceRoot":"","sources":["../../../server/service/geo-continent/geo-continent-type.ts"],"names":[],"mappings":";;;;AAAA,+CAAoE;AACpE,mDAA8C;AAG9C,IAAa,eAAe,GAA5B,MAAa,eAAe;CAM3B,CAAA;AAJC;IADC,IAAA,oBAAK,GAAE;;6CACI;AAGZ;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;oDACN;AALT,eAAe;IAD3B,IAAA,wBAAS,GAAE;GACC,eAAe,CAM3B;AANY,0CAAe;AAS5B,IAAa,iBAAiB,GAA9B,MAAa,iBAAiB;CAY7B,CAAA;AAVC;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;6CAC3B;AAGX;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;+CACb;AAGb;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;sDACN;AAGpB;IADC,IAAA,oBAAK,GAAE;;iDACM;AAXH,iBAAiB;IAD7B,IAAA,wBAAS,GAAE;GACC,iBAAiB,CAY7B;AAZY,8CAAiB;AAe9B,IAAa,gBAAgB,GAA7B,MAAa,gBAAgB;CAM5B,CAAA;AAJC;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,4BAAY,CAAC,CAAC;;+CACT;AAGrB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,CAAC;;+CACN;AALF,gBAAgB;IAD5B,IAAA,yBAAU,GAAE;GACA,gBAAgB,CAM5B;AANY,4CAAgB","sourcesContent":["import { Field, ID, InputType, Int, ObjectType } from 'type-graphql'\nimport { GeoContinent } from './geo-continent'\n\n@InputType()\nexport class NewGeoContinent {\n @Field()\n name: string\n\n @Field({ nullable: true })\n description?: string\n}\n\n@InputType()\nexport class GeoContinentPatch {\n @Field(type => ID, { nullable: true })\n id?: string\n\n @Field({ nullable: true })\n name?: string\n\n @Field({ nullable: true })\n description?: string\n\n @Field()\n cuFlag: string\n}\n\n@ObjectType()\nexport class GeoContinentList {\n @Field(type => [GeoContinent])\n items: GeoContinent[]\n\n @Field(type => Int)\n total: number\n}\n"]}