From c14a6fac1413e51d36593e96b7bb3ce1cb63a5ee Mon Sep 17 00:00:00 2001 From: VKislov Date: Wed, 2 Aug 2023 15:56:36 +0500 Subject: [PATCH] fix(condo): DOMA-6736 rename onlyProgressionMeterReadingsIsEnabled to onlyGreaterThanPreviousMeterReadingIsEnabled --- .../settings/access/MobileFeatureConfig.js | 2 +- .../OnlyProgressionMeterReadingsForm.tsx | 14 ++-- ...nlyProgressionMeterReadingsSettingCard.tsx | 6 +- apps/condo/domains/settings/constants.js | 2 +- apps/condo/domains/settings/gql.js | 4 +- .../settings/schema/MobileFeatureConfig.js | 4 +- .../schema/MobileFeatureConfig.test.js | 2 +- apps/condo/domains/settings/schema/index.js | 2 +- .../utils/clientSchema/MobileFeatureConfig.ts | 2 +- .../settings/utils/clientSchema/index.ts | 2 +- .../settings/utils/serverSchema/index.js | 2 +- .../settings/utils/testSchema/index.js | 4 +- ...bilefeatureconfighistoryrecord_and_more.js | 69 ------------------- ...bilefeatureconfighistoryrecord_and_more.js | 69 +++++++++++++++++++ apps/condo/schema.graphql | 28 ++++---- apps/condo/schema.ts | 28 ++++---- 16 files changed, 120 insertions(+), 120 deletions(-) delete mode 100644 apps/condo/migrations/20230802145655-0302_mobilefeatureconfighistoryrecord_and_more.js create mode 100644 apps/condo/migrations/20230802153342-0302_mobilefeatureconfighistoryrecord_and_more.js diff --git a/apps/condo/domains/settings/access/MobileFeatureConfig.js b/apps/condo/domains/settings/access/MobileFeatureConfig.js index 9cafd832bfe..a7051760c95 100644 --- a/apps/condo/domains/settings/access/MobileFeatureConfig.js +++ b/apps/condo/domains/settings/access/MobileFeatureConfig.js @@ -1,5 +1,5 @@ /** - * Generated by `createschema settings.MobileFeatureConfig 'organization:Relationship:Organization:CASCADE; emergencyPhone:Text; commonPhone:Text; onlyProgressionMeterReadingsIsEnabled:Checkbox; meta:Json; ticketSubmittingIsEnabled:Checkbox'` + * Generated by `createschema settings.MobileFeatureConfig 'organization:Relationship:Organization:CASCADE; emergencyPhone:Text; commonPhone:Text; onlyGreaterThanPreviousMeterReadingIsEnabled:Checkbox; meta:Json; ticketSubmittingIsEnabled:Checkbox'` */ const { uniq, map, get } = require('lodash') diff --git a/apps/condo/domains/settings/components/ticketSubmitting/OnlyProgressionMeterReadingsForm.tsx b/apps/condo/domains/settings/components/ticketSubmitting/OnlyProgressionMeterReadingsForm.tsx index 0be276de3c4..37bce05a94c 100644 --- a/apps/condo/domains/settings/components/ticketSubmitting/OnlyProgressionMeterReadingsForm.tsx +++ b/apps/condo/domains/settings/components/ticketSubmitting/OnlyProgressionMeterReadingsForm.tsx @@ -41,10 +41,10 @@ export const OnlyProgressionMeterReadingsForm: React.FC(get(mobileConfig, 'onlyProgressionMeterReadingsIsEnabled')) + const [onlyGreaterThanPreviousMeterReadingIsEnabled, setonlyGreaterThanPreviousMeterReadingIsEnabled] = useState(get(mobileConfig, 'onlyGreaterThanPreviousMeterReadingIsEnabled')) const initialValues = { - onlyProgressionMeterReadingsIsEnabled: get(mobileConfig, 'onlyProgressionMeterReadingsIsEnabled'), + onlyGreaterThanPreviousMeterReadingIsEnabled: get(mobileConfig, 'onlyGreaterThanPreviousMeterReadingIsEnabled'), } const updateHook = MobileFeatureConfig.useUpdate({}, () => router.push('/settings?tab=mobileFeatureConfig')) @@ -64,7 +64,7 @@ export const OnlyProgressionMeterReadingsForm: React.FC { - setOnlyProgressionMeterReadingsIsEnabled(!onlyProgressionMeterReadingsIsEnabled) + setonlyGreaterThanPreviousMeterReadingIsEnabled(!onlyGreaterThanPreviousMeterReadingIsEnabled) }} /> @@ -117,5 +117,5 @@ export const OnlyProgressionMeterReadingsForm: React.FC )} - ), [action, mobileConfig, onlyProgressionMeterReadingsIsEnabled]) + ), [action, mobileConfig, onlyGreaterThanPreviousMeterReadingIsEnabled]) } diff --git a/apps/condo/domains/settings/components/ticketSubmitting/OnlyProgressionMeterReadingsSettingCard.tsx b/apps/condo/domains/settings/components/ticketSubmitting/OnlyProgressionMeterReadingsSettingCard.tsx index 643ab264b6e..6a1a2ebc37b 100644 --- a/apps/condo/domains/settings/components/ticketSubmitting/OnlyProgressionMeterReadingsSettingCard.tsx +++ b/apps/condo/domains/settings/components/ticketSubmitting/OnlyProgressionMeterReadingsSettingCard.tsx @@ -18,7 +18,7 @@ export const OnlyProgressionMeterReadingsSettingCard: React.FC - {isEnabled ? OnlyProgressionMeterReadingsIsEnabledLabel : OnlyProgressionMeterReadingsIsDisabledLabel} + {isEnabled ? onlyGreaterThanPreviousMeterReadingIsEnabledLabel : OnlyProgressionMeterReadingsIsDisabledLabel} ) diff --git a/apps/condo/domains/settings/constants.js b/apps/condo/domains/settings/constants.js index 49ca7bdae47..da4fbc2cd03 100644 --- a/apps/condo/domains/settings/constants.js +++ b/apps/condo/domains/settings/constants.js @@ -1,5 +1,5 @@ /** - * Generated by `createschema settings.MobileFeatureConfig 'organization:Relationship:Organization:CASCADE; emergencyPhone:Text; commonPhone:Text; onlyProgressionMeterReadingsIsEnabled:Checkbox; meta:Json; ticketSubmittingIsEnabled:Checkbox'` + * Generated by `createschema settings.MobileFeatureConfig 'organization:Relationship:Organization:CASCADE; emergencyPhone:Text; commonPhone:Text; onlyGreaterThanPreviousMeterReadingIsEnabled:Checkbox; meta:Json; ticketSubmittingIsEnabled:Checkbox'` */ const MOBILE_FEATURE_CONFIGURATION = 'mobile-feature-configuration' diff --git a/apps/condo/domains/settings/gql.js b/apps/condo/domains/settings/gql.js index 80a37c38e7c..88723319bc1 100644 --- a/apps/condo/domains/settings/gql.js +++ b/apps/condo/domains/settings/gql.js @@ -1,5 +1,5 @@ /** - * Generated by `createschema settings.MobileFeatureConfig 'organization:Relationship:Organization:CASCADE; emergencyPhone:Text; commonPhone:Text; onlyProgressionMeterReadingsIsEnabled:Checkbox; meta:Json; ticketSubmittingIsEnabled:Checkbox'` + * Generated by `createschema settings.MobileFeatureConfig 'organization:Relationship:Organization:CASCADE; emergencyPhone:Text; commonPhone:Text; onlyGreaterThanPreviousMeterReadingIsEnabled:Checkbox; meta:Json; ticketSubmittingIsEnabled:Checkbox'` * In most cases you should not change it by hands * Please, don't remove `AUTOGENERATE MARKER`s */ @@ -11,7 +11,7 @@ const { generateGqlQueries } = require('@open-condo/codegen/generate.gql') const COMMON_FIELDS = 'id dv sender { dv fingerprint } v deletedAt newId createdBy { id name } updatedBy { id name } createdAt updatedAt' -const MOBILE_FEATURE_CONFIG_FIELDS = `{ organization { id } commonPhone onlyProgressionMeterReadingsIsEnabled ticketSubmittingIsDisabled meta ${COMMON_FIELDS} }` +const MOBILE_FEATURE_CONFIG_FIELDS = `{ organization { id } commonPhone onlyGreaterThanPreviousMeterReadingIsEnabled ticketSubmittingIsDisabled meta ${COMMON_FIELDS} }` const MobileFeatureConfig = generateGqlQueries('MobileFeatureConfig', MOBILE_FEATURE_CONFIG_FIELDS) /* AUTOGENERATE MARKER */ diff --git a/apps/condo/domains/settings/schema/MobileFeatureConfig.js b/apps/condo/domains/settings/schema/MobileFeatureConfig.js index 31f6f6b35ea..98fcbd774f8 100644 --- a/apps/condo/domains/settings/schema/MobileFeatureConfig.js +++ b/apps/condo/domains/settings/schema/MobileFeatureConfig.js @@ -1,5 +1,5 @@ /** - * Generated by `createschema settings.MobileFeatureConfig 'organization:Relationship:Organization:CASCADE; emergencyPhone:Text; commonPhone:Text; onlyProgressionMeterReadingsIsEnabled:Checkbox; meta:Json; ticketSubmittingIsDisabled:Checkbox'` + * Generated by `createschema settings.MobileFeatureConfig 'organization:Relationship:Organization:CASCADE; emergencyPhone:Text; commonPhone:Text; onlyGreaterThanPreviousMeterReadingIsEnabled:Checkbox; meta:Json; ticketSubmittingIsDisabled:Checkbox'` */ const { Text, Relationship, Checkbox } = require('@keystonejs/fields') @@ -74,7 +74,7 @@ const MobileFeatureConfig = new GQLListSchema('MobileFeatureConfig', { }, }, - onlyProgressionMeterReadingsIsEnabled: { + onlyGreaterThanPreviousMeterReadingIsEnabled: { schemaDoc: 'Restricts residents to submit only meter readings, that are greater than previous. ' + 'Restrictions apply to mobile phones only.', type: Checkbox, diff --git a/apps/condo/domains/settings/schema/MobileFeatureConfig.test.js b/apps/condo/domains/settings/schema/MobileFeatureConfig.test.js index a85c5b02e1c..b280bd1af00 100644 --- a/apps/condo/domains/settings/schema/MobileFeatureConfig.test.js +++ b/apps/condo/domains/settings/schema/MobileFeatureConfig.test.js @@ -1,5 +1,5 @@ /** - * Generated by `createschema settings.MobileFeatureConfig 'organization:Relationship:Organization:CASCADE; emergencyPhone:Text; commonPhone:Text; onlyProgressionMeterReadingsIsEnabled:Checkbox; meta:Json; ticketSubmittingIsEnabled:Checkbox'` + * Generated by `createschema settings.MobileFeatureConfig 'organization:Relationship:Organization:CASCADE; emergencyPhone:Text; commonPhone:Text; onlyGreaterThanPreviousMeterReadingIsEnabled:Checkbox; meta:Json; ticketSubmittingIsEnabled:Checkbox'` */ const { makeLoggedInAdminClient, makeClient, UUID_RE, expectValuesOfCommonFields, catchErrorFrom } = require('@open-condo/keystone/test.utils') diff --git a/apps/condo/domains/settings/schema/index.js b/apps/condo/domains/settings/schema/index.js index 1e327eac44b..a7ae828c564 100644 --- a/apps/condo/domains/settings/schema/index.js +++ b/apps/condo/domains/settings/schema/index.js @@ -1,5 +1,5 @@ /** - * This file is autogenerated by `createschema settings.MobileFeatureConfig 'organization:Relationship:Organization:CASCADE; emergencyPhone:Text; commonPhone:Text; onlyProgressionMeterReadingsIsEnabled:Checkbox; meta:Json; ticketSubmittingIsEnabled:Checkbox'` + * This file is autogenerated by `createschema settings.MobileFeatureConfig 'organization:Relationship:Organization:CASCADE; emergencyPhone:Text; commonPhone:Text; onlyGreaterThanPreviousMeterReadingIsEnabled:Checkbox; meta:Json; ticketSubmittingIsEnabled:Checkbox'` * In most cases you should not change it by hands. And please don't remove `AUTOGENERATE MARKER`s */ diff --git a/apps/condo/domains/settings/utils/clientSchema/MobileFeatureConfig.ts b/apps/condo/domains/settings/utils/clientSchema/MobileFeatureConfig.ts index 0ef989eeefc..39b25ce3ede 100644 --- a/apps/condo/domains/settings/utils/clientSchema/MobileFeatureConfig.ts +++ b/apps/condo/domains/settings/utils/clientSchema/MobileFeatureConfig.ts @@ -1,5 +1,5 @@ /** - * Generated by `createschema settings.MobileFeatureConfig 'organization:Relationship:Organization:CASCADE; emergencyPhone:Text; commonPhone:Text; onlyProgressionMeterReadingsIsEnabled:Checkbox; meta:Json; ticketSubmittingIsEnabled:Checkbox'` + * Generated by `createschema settings.MobileFeatureConfig 'organization:Relationship:Organization:CASCADE; emergencyPhone:Text; commonPhone:Text; onlyGreaterThanPreviousMeterReadingIsEnabled:Checkbox; meta:Json; ticketSubmittingIsEnabled:Checkbox'` */ import { diff --git a/apps/condo/domains/settings/utils/clientSchema/index.ts b/apps/condo/domains/settings/utils/clientSchema/index.ts index f758da7da61..abc4bbd41d3 100644 --- a/apps/condo/domains/settings/utils/clientSchema/index.ts +++ b/apps/condo/domains/settings/utils/clientSchema/index.ts @@ -1,5 +1,5 @@ /** - * This file is autogenerated by `createschema settings.MobileFeatureConfig 'organization:Relationship:Organization:CASCADE; emergencyPhone:Text; commonPhone:Text; onlyProgressionMeterReadingsIsEnabled:Checkbox; meta:Json; ticketSubmittingIsEnabled:Checkbox'` + * This file is autogenerated by `createschema settings.MobileFeatureConfig 'organization:Relationship:Organization:CASCADE; emergencyPhone:Text; commonPhone:Text; onlyGreaterThanPreviousMeterReadingIsEnabled:Checkbox; meta:Json; ticketSubmittingIsEnabled:Checkbox'` * In most cases you should not change it by hands. And please don't remove `AUTOGENERATE MARKER`s */ diff --git a/apps/condo/domains/settings/utils/serverSchema/index.js b/apps/condo/domains/settings/utils/serverSchema/index.js index 5a894d87e61..7960e4cfb03 100644 --- a/apps/condo/domains/settings/utils/serverSchema/index.js +++ b/apps/condo/domains/settings/utils/serverSchema/index.js @@ -1,5 +1,5 @@ /** - * Generated by `createschema settings.MobileFeatureConfig 'organization:Relationship:Organization:CASCADE; emergencyPhone:Text; commonPhone:Text; onlyProgressionMeterReadingsIsEnabled:Checkbox; meta:Json; ticketSubmittingIsEnabled:Checkbox'` + * Generated by `createschema settings.MobileFeatureConfig 'organization:Relationship:Organization:CASCADE; emergencyPhone:Text; commonPhone:Text; onlyGreaterThanPreviousMeterReadingIsEnabled:Checkbox; meta:Json; ticketSubmittingIsEnabled:Checkbox'` * In most cases you should not change it by hands * Please, don't remove `AUTOGENERATE MARKER`s */ diff --git a/apps/condo/domains/settings/utils/testSchema/index.js b/apps/condo/domains/settings/utils/testSchema/index.js index cdda04cbf15..c9750544939 100644 --- a/apps/condo/domains/settings/utils/testSchema/index.js +++ b/apps/condo/domains/settings/utils/testSchema/index.js @@ -1,5 +1,5 @@ /** - * Generated by `createschema settings.MobileFeatureConfig 'organization:Relationship:Organization:CASCADE; emergencyPhone:Text; commonPhone:Text; onlyProgressionMeterReadingsIsEnabled:Checkbox; meta:Json; ticketSubmittingIsEnabled:Checkbox'` + * Generated by `createschema settings.MobileFeatureConfig 'organization:Relationship:Organization:CASCADE; emergencyPhone:Text; commonPhone:Text; onlyGreaterThanPreviousMeterReadingIsEnabled:Checkbox; meta:Json; ticketSubmittingIsEnabled:Checkbox'` * In most cases you should not change it by hands * Please, don't remove `AUTOGENERATE MARKER`s */ @@ -25,7 +25,7 @@ async function createTestMobileFeatureConfig (client, organization, extraAttrs = sender, commonPhone: faker.phone.number('+7922#######'), ticketSubmittingIsDisabled: false, - onlyProgressionMeterReadingsIsEnabled: false, + onlyGreaterThanPreviousMeterReadingIsEnabled: false, organization: { connect: { id: organization.id } }, ...extraAttrs, } diff --git a/apps/condo/migrations/20230802145655-0302_mobilefeatureconfighistoryrecord_and_more.js b/apps/condo/migrations/20230802145655-0302_mobilefeatureconfighistoryrecord_and_more.js deleted file mode 100644 index 4ce4cde91f8..00000000000 --- a/apps/condo/migrations/20230802145655-0302_mobilefeatureconfighistoryrecord_and_more.js +++ /dev/null @@ -1,69 +0,0 @@ -// auto generated by kmigrator -// KMIGRATOR:0302_mobilefeatureconfighistoryrecord_and_more:IyBHZW5lcmF0ZWQg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heF9sZW5ndGg9NTApKSwKICAgICAgICAgICAgICAgICgnaGlzdG9yeV9pZCcsIG1vZGVscy5VVUlERmllbGQoZGJfaW5kZXg9VHJ1ZSkpLAogICAgICAgICAgICBdLAogICAgICAgICAgICBvcHRpb25zPXsKICAgICAgICAgICAgICAgICdkYl90YWJsZSc6ICdNb2JpbGVGZWF0dXJlQ29uZmlnSGlzdG9yeVJlY29yZCcsCiAgICAgICAgICAgIH0sCiAgICAgICAgKSwKICAgICAgICBtaWdyYXRpb25zLkFkZEZpZWxkKAogICAgICAgICAgICBtb2RlbF9uYW1lPSdvcmdhbml6YXRpb25lbXBsb3llZXJvbGUnLAogICAgICAgICAgICBuYW1lPSdjYW5NYW5hZ2VNb2JpbGVGZWF0dXJlQ29uZmlncycsCiAgICAgICAgICAgIGZpZWxkPW1vZGVscy5Cb29sZWFuRmllbGQoZGVmYXVsdD1GYWxzZSksCiAgICAgICAgICAgIHByZXNlcnZlX2RlZmF1bHQ9RmFsc2UsCiAgICAgICAgKSwKICAgICAgICBtaWdyYXRpb25zLkFkZEZpZWxkKAogICAgICAgICAgICBtb2RlbF9uYW1lPSdvcmdhbml6YXRpb25lbXBsb3llZXJvbGVoaXN0b3J5cmVjb3JkJywKICAgICAgICAgICAgbmFtZT0nY2FuTWFuYWdlTW9iaWxlRmVhdHVyZUNvbmZpZ3MnLAogICAgICAgICAgICBmaWVsZD1tb2RlbHMuQm9vbGVhbkZpZWxkKGJsYW5rPVRydWUsIG51bGw9VHJ1ZSksCiAgICAgICAgKSwKICAgICAgICBtaWdyYXRpb25zLkNyZWF0ZU1vZGVsKAogICAgICAgICAgICBuYW1lPSdtb2JpbGVmZWF0dXJlY29uZmlnJywKICAgICAgICAgICAgZmllbGRzPVsKICAgICAgICAgICAgICAgICgnY29tbW9uUGhvbmUnLCBtb2RlbHMuVGV4dEZpZWxkKGJsYW5rPVRydWUsIG51bGw9VHJ1ZSkpLAogICAgICAgICAgICAgICAgKCd0aWNrZXRTdWJtaXR0a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sZWZlYXR1cmVjb25maWdfdW5pcXVlX29yZ2FuaXphdGlvbicpLAogICAgICAgICksCiAgICBdCg== - -exports.up = async (knex) => { - await knex.raw(` - BEGIN; --- --- Create model mobilefeatureconfighistoryrecord --- -CREATE TABLE "MobileFeatureConfigHistoryRecord" ("organization" uuid NULL, "commonPhone" text NULL, "ticketSubmittingIsDisabled" boolean NULL, "onlyProgressionMeterReadingsIsEnabled" boolean NULL, "meta" jsonb NULL, "id" uuid NOT NULL PRIMARY KEY, "v" integer NULL, "createdAt" timestamp with time zone NULL, "updatedAt" timestamp with time zone NULL, "createdBy" uuid NULL, "updatedBy" uuid NULL, "deletedAt" timestamp with time zone NULL, "newId" jsonb NULL, "dv" integer NULL, "sender" jsonb NULL, "history_date" timestamp with time zone NOT NULL, "history_action" varchar(50) NOT NULL, "history_id" uuid NOT NULL); --- --- Add field canManageMobileFeatureConfigs to organizationemployeerole --- -ALTER TABLE "OrganizationEmployeeRole" ADD COLUMN "canManageMobileFeatureConfigs" boolean DEFAULT false NOT NULL; -ALTER TABLE "OrganizationEmployeeRole" ALTER COLUMN "canManageMobileFeatureConfigs" DROP DEFAULT; --- --- Add field canManageMobileFeatureConfigs to organizationemployeerolehistoryrecord --- -ALTER TABLE "OrganizationEmployeeRoleHistoryRecord" ADD COLUMN "canManageMobileFeatureConfigs" boolean NULL; --- --- Create model mobilefeatureconfig --- -CREATE TABLE "MobileFeatureConfig" ("commonPhone" text NULL, "ticketSubmittingIsDisabled" boolean NULL, "onlyProgressionMeterReadingsIsEnabled" boolean NULL, "meta" jsonb NULL, "id" uuid NOT NULL PRIMARY KEY, "v" integer NOT NULL, "createdAt" timestamp with time zone NULL, "updatedAt" timestamp with time zone NULL, "deletedAt" timestamp with time zone NULL, "newId" uuid NULL, "dv" integer NOT NULL, "sender" jsonb NOT NULL, "createdBy" uuid NULL, "organization" uuid NOT NULL, "updatedBy" uuid NULL); --- --- Create constraint mobilefeatureconfig_unique_organization on model mobilefeatureconfig --- -CREATE UNIQUE INDEX "mobilefeatureconfig_unique_organization" ON "MobileFeatureConfig" ("organization") WHERE "deletedAt" IS NULL; -CREATE INDEX "MobileFeatureConfigHistoryRecord_history_id_9bb4c2ac" ON "MobileFeatureConfigHistoryRecord" ("history_id"); -ALTER TABLE "MobileFeatureConfig" ADD CONSTRAINT "MobileFeatureConfig_createdBy_cdc8306c_fk_User_id" FOREIGN KEY ("createdBy") REFERENCES "User" ("id") DEFERRABLE INITIALLY DEFERRED; -ALTER TABLE "MobileFeatureConfig" ADD CONSTRAINT "MobileFeatureConfig_organization_68b5d9ad_fk_Organization_id" FOREIGN KEY ("organization") REFERENCES "Organization" ("id") DEFERRABLE INITIALLY DEFERRED; -ALTER TABLE "MobileFeatureConfig" ADD CONSTRAINT "MobileFeatureConfig_updatedBy_f1a54d9d_fk_User_id" FOREIGN KEY ("updatedBy") REFERENCES "User" ("id") DEFERRABLE INITIALLY DEFERRED; -CREATE INDEX "MobileFeatureConfig_createdAt_43196f84" ON "MobileFeatureConfig" ("createdAt"); -CREATE INDEX "MobileFeatureConfig_updatedAt_c8c7ade9" ON "MobileFeatureConfig" ("updatedAt"); -CREATE INDEX "MobileFeatureConfig_deletedAt_0c7426d3" ON "MobileFeatureConfig" ("deletedAt"); -CREATE INDEX "MobileFeatureConfig_createdBy_cdc8306c" ON "MobileFeatureConfig" ("createdBy"); -CREATE INDEX "MobileFeatureConfig_organization_68b5d9ad" ON "MobileFeatureConfig" ("organization"); -CREATE INDEX "MobileFeatureConfig_updatedBy_f1a54d9d" ON "MobileFeatureConfig" ("updatedBy"); -COMMIT; - - `) -} - -exports.down = async (knex) => { - await knex.raw(` - BEGIN; --- --- Create constraint mobilefeatureconfig_unique_organization on model mobilefeatureconfig --- -DROP INDEX IF EXISTS "mobilefeatureconfig_unique_organization"; --- --- Create model mobilefeatureconfig --- -DROP TABLE "MobileFeatureConfig" CASCADE; --- --- Add field canManageMobileFeatureConfigs to organizationemployeerolehistoryrecord --- -ALTER TABLE "OrganizationEmployeeRoleHistoryRecord" DROP COLUMN "canManageMobileFeatureConfigs" CASCADE; --- --- Add field canManageMobileFeatureConfigs to organizationemployeerole --- -ALTER TABLE "OrganizationEmployeeRole" DROP COLUMN "canManageMobileFeatureConfigs" CASCADE; --- --- Create model mobilefeatureconfighistoryrecord --- -DROP TABLE "MobileFeatureConfigHistoryRecord" CASCADE; -COMMIT; - - `) -} diff --git a/apps/condo/migrations/20230802153342-0302_mobilefeatureconfighistoryrecord_and_more.js b/apps/condo/migrations/20230802153342-0302_mobilefeatureconfighistoryrecord_and_more.js new file mode 100644 index 00000000000..3c84e4951a9 --- /dev/null +++ b/apps/condo/migrations/20230802153342-0302_mobilefeatureconfighistoryrecord_and_more.js @@ -0,0 +1,69 @@ +// auto generated by kmigrator +// KMIGRATOR:0302_mobilefeatureconfighistoryrecord_and_more:IyBHZW5lcmF0ZWQgYnkgRGphbmdvIDQuMi4zIG9uIDIwMjMtMDgtMDIgMTA6MzQKCmZyb20gZGphbmdvLmRiIGltcG9ydCBtaWdyYXRpb25zLCBtb2RlbHMKaW1wb3J0IGRqYW5nby5kYi5tb2RlbHMuZGVsZXRpb24KCgpjbGFzcyBNaWdyYXRpb24obWlncmF0aW9ucy5NaWdyYXRpb24pOgoKICAgIGRlcGVuZGVuY2llcyA9IFsKICAgICAgICAoJ19kamFuZ29fc2NoZW1hJywgJzAzMDFfYjJiYXBwcGVybWlzc2lvbmhpc3RvcnlyZWNvcmRfYW5kX21vcmUnKSwKICAgIF0KCiAgICBvcGVyYXRpb25zID0gWwogICAgICAgIG1pZ3JhdGlvbnMuQ3JlYXRlTW9kZWwoCiAgICAgICAgICAgIG5hbWU9J21vYmlsZWZlYXR1cmVjb25maWdoaXN0b3J5cmVjb3JkJywKICAgICAgICAgICAgZmllbGRzPVsKICAgICAgICAgICAgICAgICgnb3JnYW5pemF0aW9uJywgbW9kZWxzLlVVSURGaWVsZChibGFuaz1UcnVlLCBudWxsPVRydWUpKSwKICAgICAgICAgICAgICAgICg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KSksCiAgICAgICAgICAgICAgICAoJ25ld0lkJywgbW9kZWxzLkpTT05GaWVsZChibGFuaz1UcnVlLCBudWxsPVRydWUpKSwKICAgICAgICAgICAgICAgICgnZHYnLCBtb2RlbHMuSW50ZWdlckZpZWxkKGJsYW5rPVRydWUsIG51bGw9VHJ1ZSkpLAogICAgICAgICAgICAgICAgKCdzZW5kZXInLCBtb2RlbHMuSlNPTkZpZWxkKGJsYW5rPVRydWUsIG51bGw9VHJ1ZSkpLAogICAgICAgICAgICAgICAgKCdoaXN0b3J5X2RhdGUnLCBtb2RlbHMuRGF0ZVRpbWVGaWVsZCgpKSwKICAgICAgICAgICAgICAgICgnaGlzdG9yeV9hY3Rpb24nLCBtb2RlbHMuQ2hhckZpZWxkKGNob2ljZXM9WygnYycsICdjJyksICgndScsICd1JyksICgnZCcsICdkJyldLCBtYXhfbGVuZ3RoPTUwKSksCiAgICAgICAgICAgICAgICAoJ2hpc3RvcnlfaWQnLCBtb2RlbHMuVVVJREZpZWxkKGRiX2luZGV4PVRydWUpKSwKICAgICAgICAgICAgXSwKICAgICAgICAgICAgb3B0aW9ucz17CiAgICAgICAgICAgICAgICAnZGJfdGFibGUnOiAnTW9iaWxlRmVhdHVyZUNvbmZpZ0hpc3RvcnlSZWNvcmQnLAogICAgICAgICAgICB9LAogICAgICAgICksCiAgICAgICAgbWlncmF0aW9ucy5BZGRGaWVsZCgKICAgICAgICAgICAgbW9kZWxfbmFtZT0nb3JnYW5pemF0aW9uZW1wbG95ZWVyb2xlJywKICAgICAgICAgICAgbmFtZT0nY2FuTWFuYWdlTW9iaWxlRmVhdHVyZUNvbmZpZ3MnLAogICAgICAgICAgICBmaWVsZD1tb2RlbHMuQm9vbGVhbkZpZWxkKGRlZmF1bHQ9RmFsc2UpLAogICAgICAgICAgICBwcmVzZXJ2ZV9kZWZhdWx0PUZhbHNlLAogICAgICAgICksCiAgICAgICAgbWlncmF0aW9ucy5BZGRGaWVsZCgKICAgICAgICAgICAgbW9kZWxf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HJlbGF0ZWRfbmFtZT0nKycsIHRvPSdfZGphbmdvX3NjaGVtYS51c2VyJykpLAogICAgICAgICAgICBdLAogICAgICAgICAgICBvcHRpb25zPXsKICAgICAgICAgICAgICAgICdkYl90YWJsZSc6ICdNb2JpbGVGZWF0dXJlQ29uZmlnJywKICAgICAgICAgICAgfSwKICAgICAgICApLAogICAgICAgIG1pZ3JhdGlvbnMuQWRkQ29uc3RyYWludCgKICAgICAgICAgICAgbW9kZWxfbmFtZT0nbW9iaWxlZmVhdHVyZWNvbmZpZycsCiAgICAgICAgICAgIGNvbnN0cmFpbnQ9bW9kZWxzLlVuaXF1ZUNvbnN0cmFpbnQoY29uZGl0aW9uPW1vZGVscy5RKCgnZGVsZXRlZEF0X19pc251bGwnLCBUcnVlKSksIGZpZWxkcz0oJ29yZ2FuaXphdGlvbicsKSwgbmFtZT0nbW9iaWxlZmVhdHVyZWNvbmZpZ191bmlxdWVfb3JnYW5pemF0aW9uJyksCiAgICAgICAgKSwKICAgIF0K + +exports.up = async (knex) => { + await knex.raw(` + BEGIN; +-- +-- Create model mobilefeatureconfighistoryrecord +-- +CREATE TABLE "MobileFeatureConfigHistoryRecord" ("organization" uuid NULL, "commonPhone" text NULL, "ticketSubmittingIsDisabled" boolean NULL, "onlyGreaterThanPreviousMeterReadingIsEnabled" boolean NULL, "meta" jsonb NULL, "id" uuid NOT NULL PRIMARY KEY, "v" integer NULL, "createdAt" timestamp with time zone NULL, "updatedAt" timestamp with time zone NULL, "createdBy" uuid NULL, "updatedBy" uuid NULL, "deletedAt" timestamp with time zone NULL, "newId" jsonb NULL, "dv" integer NULL, "sender" jsonb NULL, "history_date" timestamp with time zone NOT NULL, "history_action" varchar(50) NOT NULL, "history_id" uuid NOT NULL); +-- +-- Add field canManageMobileFeatureConfigs to organizationemployeerole +-- +ALTER TABLE "OrganizationEmployeeRole" ADD COLUMN "canManageMobileFeatureConfigs" boolean DEFAULT false NOT NULL; +ALTER TABLE "OrganizationEmployeeRole" ALTER COLUMN "canManageMobileFeatureConfigs" DROP DEFAULT; +-- +-- Add field canManageMobileFeatureConfigs to organizationemployeerolehistoryrecord +-- +ALTER TABLE "OrganizationEmployeeRoleHistoryRecord" ADD COLUMN "canManageMobileFeatureConfigs" boolean NULL; +-- +-- Create model mobilefeatureconfig +-- +CREATE TABLE "MobileFeatureConfig" ("commonPhone" text NULL, "ticketSubmittingIsDisabled" boolean NULL, "onlyGreaterThanPreviousMeterReadingIsEnabled" boolean NULL, "meta" jsonb NULL, "id" uuid NOT NULL PRIMARY KEY, "v" integer NOT NULL, "createdAt" timestamp with time zone NULL, "updatedAt" timestamp with time zone NULL, "deletedAt" timestamp with time zone NULL, "newId" uuid NULL, "dv" integer NOT NULL, "sender" jsonb NOT NULL, "createdBy" uuid NULL, "organization" uuid NOT NULL, "updatedBy" uuid NULL); +-- +-- Create constraint mobilefeatureconfig_unique_organization on model mobilefeatureconfig +-- +CREATE UNIQUE INDEX "mobilefeatureconfig_unique_organization" ON "MobileFeatureConfig" ("organization") WHERE "deletedAt" IS NULL; +CREATE INDEX "MobileFeatureConfigHistoryRecord_history_id_9bb4c2ac" ON "MobileFeatureConfigHistoryRecord" ("history_id"); +ALTER TABLE "MobileFeatureConfig" ADD CONSTRAINT "MobileFeatureConfig_createdBy_cdc8306c_fk_User_id" FOREIGN KEY ("createdBy") REFERENCES "User" ("id") DEFERRABLE INITIALLY DEFERRED; +ALTER TABLE "MobileFeatureConfig" ADD CONSTRAINT "MobileFeatureConfig_organization_68b5d9ad_fk_Organization_id" FOREIGN KEY ("organization") REFERENCES "Organization" ("id") DEFERRABLE INITIALLY DEFERRED; +ALTER TABLE "MobileFeatureConfig" ADD CONSTRAINT "MobileFeatureConfig_updatedBy_f1a54d9d_fk_User_id" FOREIGN KEY ("updatedBy") REFERENCES "User" ("id") DEFERRABLE INITIALLY DEFERRED; +CREATE INDEX "MobileFeatureConfig_createdAt_43196f84" ON "MobileFeatureConfig" ("createdAt"); +CREATE INDEX "MobileFeatureConfig_updatedAt_c8c7ade9" ON "MobileFeatureConfig" ("updatedAt"); +CREATE INDEX "MobileFeatureConfig_deletedAt_0c7426d3" ON "MobileFeatureConfig" ("deletedAt"); +CREATE INDEX "MobileFeatureConfig_createdBy_cdc8306c" ON "MobileFeatureConfig" ("createdBy"); +CREATE INDEX "MobileFeatureConfig_organization_68b5d9ad" ON "MobileFeatureConfig" ("organization"); +CREATE INDEX "MobileFeatureConfig_updatedBy_f1a54d9d" ON "MobileFeatureConfig" ("updatedBy"); +COMMIT; + + `) +} + +exports.down = async (knex) => { + await knex.raw(` + BEGIN; +-- +-- Create constraint mobilefeatureconfig_unique_organization on model mobilefeatureconfig +-- +DROP INDEX IF EXISTS "mobilefeatureconfig_unique_organization"; +-- +-- Create model mobilefeatureconfig +-- +DROP TABLE "MobileFeatureConfig" CASCADE; +-- +-- Add field canManageMobileFeatureConfigs to organizationemployeerolehistoryrecord +-- +ALTER TABLE "OrganizationEmployeeRoleHistoryRecord" DROP COLUMN "canManageMobileFeatureConfigs" CASCADE; +-- +-- Add field canManageMobileFeatureConfigs to organizationemployeerole +-- +ALTER TABLE "OrganizationEmployeeRole" DROP COLUMN "canManageMobileFeatureConfigs" CASCADE; +-- +-- Create model mobilefeatureconfighistoryrecord +-- +DROP TABLE "MobileFeatureConfigHistoryRecord" CASCADE; +COMMIT; + + `) +} diff --git a/apps/condo/schema.graphql b/apps/condo/schema.graphql index 3e9d7025ce8..88c0ad05d67 100644 --- a/apps/condo/schema.graphql +++ b/apps/condo/schema.graphql @@ -62139,7 +62139,7 @@ type MobileFeatureConfigHistoryRecord { organization: String commonPhone: String ticketSubmittingIsDisabled: Boolean - onlyProgressionMeterReadingsIsEnabled: Boolean + onlyGreaterThanPreviousMeterReadingIsEnabled: Boolean meta: JSON id: ID! v: Int @@ -62183,8 +62183,8 @@ input MobileFeatureConfigHistoryRecordWhereInput { commonPhone_not_in: [String] ticketSubmittingIsDisabled: Boolean ticketSubmittingIsDisabled_not: Boolean - onlyProgressionMeterReadingsIsEnabled: Boolean - onlyProgressionMeterReadingsIsEnabled_not: Boolean + onlyGreaterThanPreviousMeterReadingIsEnabled: Boolean + onlyGreaterThanPreviousMeterReadingIsEnabled_not: Boolean meta: JSON meta_not: JSON meta_in: [JSON] @@ -62276,8 +62276,8 @@ enum SortMobileFeatureConfigHistoryRecordsBy { commonPhone_DESC ticketSubmittingIsDisabled_ASC ticketSubmittingIsDisabled_DESC - onlyProgressionMeterReadingsIsEnabled_ASC - onlyProgressionMeterReadingsIsEnabled_DESC + onlyGreaterThanPreviousMeterReadingIsEnabled_ASC + onlyGreaterThanPreviousMeterReadingIsEnabled_DESC id_ASC id_DESC v_ASC @@ -62300,7 +62300,7 @@ input MobileFeatureConfigHistoryRecordUpdateInput { organization: String commonPhone: String ticketSubmittingIsDisabled: Boolean - onlyProgressionMeterReadingsIsEnabled: Boolean + onlyGreaterThanPreviousMeterReadingIsEnabled: Boolean meta: JSON v: Int createdAt: String @@ -62325,7 +62325,7 @@ input MobileFeatureConfigHistoryRecordCreateInput { organization: String commonPhone: String ticketSubmittingIsDisabled: Boolean - onlyProgressionMeterReadingsIsEnabled: Boolean + onlyGreaterThanPreviousMeterReadingIsEnabled: Boolean meta: JSON v: Int createdAt: String @@ -62369,7 +62369,7 @@ type MobileFeatureConfig { """ Restricts residents to submit only meter readings, that are greater than previous. Restrictions apply to mobile phones only. """ - onlyProgressionMeterReadingsIsEnabled: Boolean + onlyGreaterThanPreviousMeterReadingIsEnabled: Boolean """ Can be used to store additional settings from external sources or mini apps """ @@ -62422,8 +62422,8 @@ input MobileFeatureConfigWhereInput { commonPhone_not_in: [String] ticketSubmittingIsDisabled: Boolean ticketSubmittingIsDisabled_not: Boolean - onlyProgressionMeterReadingsIsEnabled: Boolean - onlyProgressionMeterReadingsIsEnabled_not: Boolean + onlyGreaterThanPreviousMeterReadingIsEnabled: Boolean + onlyGreaterThanPreviousMeterReadingIsEnabled_not: Boolean meta: JSON meta_not: JSON meta_in: [JSON] @@ -62497,8 +62497,8 @@ enum SortMobileFeatureConfigsBy { commonPhone_DESC ticketSubmittingIsDisabled_ASC ticketSubmittingIsDisabled_DESC - onlyProgressionMeterReadingsIsEnabled_ASC - onlyProgressionMeterReadingsIsEnabled_DESC + onlyGreaterThanPreviousMeterReadingIsEnabled_ASC + onlyGreaterThanPreviousMeterReadingIsEnabled_DESC id_ASC id_DESC v_ASC @@ -62521,7 +62521,7 @@ input MobileFeatureConfigUpdateInput { organization: OrganizationRelateToOneInput commonPhone: String ticketSubmittingIsDisabled: Boolean - onlyProgressionMeterReadingsIsEnabled: Boolean + onlyGreaterThanPreviousMeterReadingIsEnabled: Boolean meta: JSON v: Int createdAt: String @@ -62543,7 +62543,7 @@ input MobileFeatureConfigCreateInput { organization: OrganizationRelateToOneInput commonPhone: String ticketSubmittingIsDisabled: Boolean - onlyProgressionMeterReadingsIsEnabled: Boolean + onlyGreaterThanPreviousMeterReadingIsEnabled: Boolean meta: JSON v: Int createdAt: String diff --git a/apps/condo/schema.ts b/apps/condo/schema.ts index c6744fe4fad..52e1fc5f2a6 100644 --- a/apps/condo/schema.ts +++ b/apps/condo/schema.ts @@ -29293,7 +29293,7 @@ export type MobileFeatureConfig = { /** Disabling the ability to send tickets by the user of the resident's mobile application. Instead, he will be shown a screen with phones where he can contact to send a request */ ticketSubmittingIsDisabled?: Maybe; /** Restricts residents to submit only meter readings, that are greater than previous. Restrictions apply to mobile phones only. */ - onlyProgressionMeterReadingsIsEnabled?: Maybe; + onlyGreaterThanPreviousMeterReadingIsEnabled?: Maybe; /** Can be used to store additional settings from external sources or mini apps */ meta?: Maybe; id: Scalars['ID']; @@ -29316,7 +29316,7 @@ export type MobileFeatureConfigCreateInput = { organization?: Maybe; commonPhone?: Maybe; ticketSubmittingIsDisabled?: Maybe; - onlyProgressionMeterReadingsIsEnabled?: Maybe; + onlyGreaterThanPreviousMeterReadingIsEnabled?: Maybe; meta?: Maybe; v?: Maybe; createdAt?: Maybe; @@ -29343,7 +29343,7 @@ export type MobileFeatureConfigHistoryRecord = { organization?: Maybe; commonPhone?: Maybe; ticketSubmittingIsDisabled?: Maybe; - onlyProgressionMeterReadingsIsEnabled?: Maybe; + onlyGreaterThanPreviousMeterReadingIsEnabled?: Maybe; meta?: Maybe; id: Scalars['ID']; v?: Maybe; @@ -29364,7 +29364,7 @@ export type MobileFeatureConfigHistoryRecordCreateInput = { organization?: Maybe; commonPhone?: Maybe; ticketSubmittingIsDisabled?: Maybe; - onlyProgressionMeterReadingsIsEnabled?: Maybe; + onlyGreaterThanPreviousMeterReadingIsEnabled?: Maybe; meta?: Maybe; v?: Maybe; createdAt?: Maybe; @@ -29390,7 +29390,7 @@ export type MobileFeatureConfigHistoryRecordUpdateInput = { organization?: Maybe; commonPhone?: Maybe; ticketSubmittingIsDisabled?: Maybe; - onlyProgressionMeterReadingsIsEnabled?: Maybe; + onlyGreaterThanPreviousMeterReadingIsEnabled?: Maybe; meta?: Maybe; v?: Maybe; createdAt?: Maybe; @@ -29433,8 +29433,8 @@ export type MobileFeatureConfigHistoryRecordWhereInput = { commonPhone_not_in?: Maybe>>; ticketSubmittingIsDisabled?: Maybe; ticketSubmittingIsDisabled_not?: Maybe; - onlyProgressionMeterReadingsIsEnabled?: Maybe; - onlyProgressionMeterReadingsIsEnabled_not?: Maybe; + onlyGreaterThanPreviousMeterReadingIsEnabled?: Maybe; + onlyGreaterThanPreviousMeterReadingIsEnabled_not?: Maybe; meta?: Maybe; meta_not?: Maybe; meta_in?: Maybe>>; @@ -29534,7 +29534,7 @@ export type MobileFeatureConfigUpdateInput = { organization?: Maybe; commonPhone?: Maybe; ticketSubmittingIsDisabled?: Maybe; - onlyProgressionMeterReadingsIsEnabled?: Maybe; + onlyGreaterThanPreviousMeterReadingIsEnabled?: Maybe; meta?: Maybe; v?: Maybe; createdAt?: Maybe; @@ -29572,8 +29572,8 @@ export type MobileFeatureConfigWhereInput = { commonPhone_not_in?: Maybe>>; ticketSubmittingIsDisabled?: Maybe; ticketSubmittingIsDisabled_not?: Maybe; - onlyProgressionMeterReadingsIsEnabled?: Maybe; - onlyProgressionMeterReadingsIsEnabled_not?: Maybe; + onlyGreaterThanPreviousMeterReadingIsEnabled?: Maybe; + onlyGreaterThanPreviousMeterReadingIsEnabled_not?: Maybe; meta?: Maybe; meta_not?: Maybe; meta_in?: Maybe>>; @@ -68009,8 +68009,8 @@ export enum SortMobileFeatureConfigHistoryRecordsBy { CommonPhoneDesc = 'commonPhone_DESC', TicketSubmittingIsDisabledAsc = 'ticketSubmittingIsDisabled_ASC', TicketSubmittingIsDisabledDesc = 'ticketSubmittingIsDisabled_DESC', - OnlyProgressionMeterReadingsIsEnabledAsc = 'onlyProgressionMeterReadingsIsEnabled_ASC', - OnlyProgressionMeterReadingsIsEnabledDesc = 'onlyProgressionMeterReadingsIsEnabled_DESC', + OnlyGreaterThanPreviousMeterReadingIsEnabledAsc = 'onlyGreaterThanPreviousMeterReadingIsEnabled_ASC', + OnlyGreaterThanPreviousMeterReadingIsEnabledDesc = 'onlyGreaterThanPreviousMeterReadingIsEnabled_DESC', IdAsc = 'id_ASC', IdDesc = 'id_DESC', VAsc = 'v_ASC', @@ -68036,8 +68036,8 @@ export enum SortMobileFeatureConfigsBy { CommonPhoneDesc = 'commonPhone_DESC', TicketSubmittingIsDisabledAsc = 'ticketSubmittingIsDisabled_ASC', TicketSubmittingIsDisabledDesc = 'ticketSubmittingIsDisabled_DESC', - OnlyProgressionMeterReadingsIsEnabledAsc = 'onlyProgressionMeterReadingsIsEnabled_ASC', - OnlyProgressionMeterReadingsIsEnabledDesc = 'onlyProgressionMeterReadingsIsEnabled_DESC', + OnlyGreaterThanPreviousMeterReadingIsEnabledAsc = 'onlyGreaterThanPreviousMeterReadingIsEnabled_ASC', + OnlyGreaterThanPreviousMeterReadingIsEnabledDesc = 'onlyGreaterThanPreviousMeterReadingIsEnabled_DESC', IdAsc = 'id_ASC', IdDesc = 'id_DESC', VAsc = 'v_ASC',