generated from 8iq/nodejs-hackathon-boilerplate-starter-kit
-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(condo): DOMA-8295 mutation to delete meter readings (#4335)
* feat(condo): DOMA-8295 added mutation for deleting of meter readings * feat(condo): DOMA-8295 use loadListByChunks for big data * refactor(condo): DOMA-8295 some refactored * refactor(condo): DOMA-8295 cleanup * chore(condo): DOMA-8295 added notes * refactor(condo): DOMA-8295 some refactoring * test(condo): DOMA-8295 added test * feat(condo): DOMA-8295 updated "_internalDeleteMeterAndMeterReadingsService" mutation test(condo): DOMA-8295 updated tests for "_internalDeleteMeterAndMeterReadingsService" * chore(condo): DOMA-8295 updated docs * chore(condo): DOMA-8295 updated schema * chore(condo): DOMA-8295 updated schema
- Loading branch information
Showing
12 changed files
with
1,090 additions
and
124 deletions.
There are no files selected for viewing
18 changes: 18 additions & 0 deletions
18
apps/condo/domains/meter/access/_internalDeleteMeterReadingsService.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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/** | ||
* Generated by `createservice meter.InternalDeleteMeterReadingsService --type mutations` | ||
*/ | ||
const { throwAuthenticationError } = require('@open-condo/keystone/apolloErrorFormatter') | ||
|
||
async function canInternalDeleteMeterReadings ({ authentication: { item: user } }) { | ||
if (!user) return throwAuthenticationError() | ||
if (user.deletedAt) return false | ||
return !!(user.isAdmin || user.isSupport) | ||
} | ||
|
||
/* | ||
Rules are logical functions that used for list access, and may return a boolean (meaning | ||
all or no items are available) or a set of filters that limit the available items. | ||
*/ | ||
module.exports = { | ||
canInternalDeleteMeterReadings, | ||
} |
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
Oops, something went wrong.