generated from 8iq/nodejs-hackathon-boilerplate-starter-kit
-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(codegen): INFRA-316 remove some redundant code, move generate.con…
…do.server.utils to codegen
- Loading branch information
1 parent
1c4f943
commit 01ff192
Showing
37 changed files
with
103 additions
and
905 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 0 additions & 15 deletions
15
packages/codegen/templates/app00/domains/condo/gql/fields.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,6 @@ | ||
const COMMON_FIELDS = 'id dv sender { dv fingerprint } v deletedAt newId createdBy { id name } updatedBy { id name } createdAt updatedAt' | ||
|
||
const ADDRESS_META_DATA_SUBFIELDS_QUERY_LIST = 'postal_code country country_iso_code federal_district region_fias_id region_kladr_id region_iso_code region_with_type region_type region_type_full region area_fias_id area_kladr_id area_with_type area_type area_type_full area city_fias_id city_kladr_id city_with_type city_type city_type_full city city_area city_district_fias_id city_district_kladr_id city_district_with_type city_district_type city_district_type_full city_district settlement_fias_id settlement_kladr_id settlement_with_type settlement_type settlement_type_full settlement street_fias_id street_kladr_id street_with_type street_type street_type_full street house_fias_id house_kladr_id house_type house_type_full house block_type block_type_full block entrance floor flat_fias_id flat_type flat_type_full flat flat_area square_meter_price flat_price postal_box fias_id fias_code fias_level fias_actuality_state kladr_id geoname_id capital_marker okato oktmo tax_office tax_office_legal timezone geo_lat geo_lon beltway_hit beltway_distance metro { name line distance } qc_geo qc_complete qc_house history_values unparsed_parts source qc' | ||
const ADDRESS_META_SUBFIELDS_QUERY_LIST = `dv value unrestricted_value data { ${ADDRESS_META_DATA_SUBFIELDS_QUERY_LIST} }` | ||
|
||
const PROPERTY_MAP_SECTION_FIELDS = 'id type index name preview floors { id type index name units { id type unitType name label preview } }' | ||
const PROPERTY_MAP_JSON_FIELDS = `dv type sections { ${PROPERTY_MAP_SECTION_FIELDS} } parking { ${PROPERTY_MAP_SECTION_FIELDS} }` | ||
const PROPERTY_FIELDS = `id name deletedAt address addressMeta { ${ADDRESS_META_SUBFIELDS_QUERY_LIST} } type map { ${PROPERTY_MAP_JSON_FIELDS} } addressKey` | ||
|
||
const CONTACT_FIELDS = `organization { id name } property { id address addressMeta { ${ADDRESS_META_SUBFIELDS_QUERY_LIST} } } name phone unitName unitType email role { id name } isVerified ${COMMON_FIELDS}` | ||
|
||
|
||
module.exports = { | ||
COMMON_FIELDS, | ||
ADDRESS_META_DATA_SUBFIELDS_QUERY_LIST, | ||
ADDRESS_META_SUBFIELDS_QUERY_LIST, | ||
PROPERTY_MAP_SECTION_FIELDS, | ||
PROPERTY_MAP_JSON_FIELDS, | ||
PROPERTY_FIELDS, | ||
CONTACT_FIELDS, | ||
} |
28 changes: 0 additions & 28 deletions
28
packages/codegen/templates/app00/domains/condo/gql/gql.bot.js
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 0 additions & 32 deletions
32
packages/codegen/templates/app00/domains/condo/gql/gql.server.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,54 +1,22 @@ | ||
const { gql } = require('graphql-tag') | ||
|
||
const { generateGqlQueries } = require('@open-condo/codegen/generate.gql') | ||
|
||
const { | ||
PROPERTY_FIELDS: DEFAULT_PROPERTY_FIELDS, | ||
ADDRESS_META_SUBFIELDS_QUERY_LIST, | ||
} = require('./fields') | ||
|
||
|
||
const B2B_APP_ROLE_FIELDS = '{ id permissions role { id } app { id } }' | ||
const B2BAppRole = generateGqlQueries('B2BAppRole', B2B_APP_ROLE_FIELDS) | ||
|
||
const CONTACT_FIELDS = '{ id organization { id } name phone email isVerified unitName unitType property { id } }' | ||
const Contact = generateGqlQueries('Contact', CONTACT_FIELDS) | ||
|
||
const ORGANIZATION_FIELDS = '{ id }' | ||
const Organization = generateGqlQueries('Organization', ORGANIZATION_FIELDS) | ||
|
||
const ORGANIZATION_EMPLOYEE_FIELDS = '{ id role { id } user { id } }' | ||
const OrganizationEmployee = generateGqlQueries('OrganizationEmployee', ORGANIZATION_EMPLOYEE_FIELDS) | ||
|
||
const PROPERTY_FIELDS = `{ ${DEFAULT_PROPERTY_FIELDS} }` | ||
const Property = generateGqlQueries('Property', PROPERTY_FIELDS) | ||
|
||
const RESIDENT_FIELDS = '{ id user { id name phone } property { id } unitName unitType residentOrganization { id } }' | ||
const Resident = generateGqlQueries('Resident', RESIDENT_FIELDS) | ||
|
||
const USER_FIELDS = '{ id phone name email }' | ||
const User = generateGqlQueries('User', USER_FIELDS) | ||
|
||
const GET_ALL_PROPERTY_WITH_META_QUERY = gql` | ||
query getAllPropertyIdsWithOrganizationId($where: PropertyWhereInput) { | ||
objs: allProperties(where: $where) { id name organization { id } type address addressMeta { ${ADDRESS_META_SUBFIELDS_QUERY_LIST} } } | ||
} | ||
` | ||
|
||
const SEND_B2C_APP_PUSH_MESSAGE_MUTATION = gql` | ||
mutation sendB2CAppPushMessage ($data: SendB2CAppPushMessageInput!) { | ||
result: sendB2CAppPushMessage(data: $data) { id status } | ||
} | ||
` | ||
|
||
module.exports = { | ||
B2BAppRole, | ||
Contact, | ||
Organization, | ||
OrganizationEmployee, | ||
Property, | ||
Resident, | ||
User, | ||
GET_ALL_PROPERTY_WITH_META_QUERY, | ||
SEND_B2C_APP_PUSH_MESSAGE_MUTATION, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,9 @@ | ||
const botGql = require('./gql.bot') | ||
const clientGql = require('./gql.client') | ||
const { CONDO_CONFIG } = clientGql | ||
const serverGql = require('./gql.server') | ||
|
||
module.exports = { | ||
clientGql, | ||
serverGql, | ||
botGql, | ||
CONDO_CONFIG, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 0 additions & 6 deletions
6
packages/codegen/templates/app00/domains/condo/utils/bots/index.js
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.