import { GuidGenerator , HashGenerator } from 'common' ; import { inject , injectable } from 'inversify' ; import { ItemType } from 'storage-documents' ; @ injectable ( ) export class PartitionKeyFactory { constructor ( @ inject ( HashGenerator ) private readonly hashGenerator , @ inject ( GuidGenerator ) private readonly guidGenerator ) { } public createPartitionKeyForDocument ( documentType , documentId ) { const node = this . guidGenerator . getGuidNode ( documentId ) ; return this . hashGenerator . getDbHashBucket ( documentType , node ) ; } }