import { v4 as uuidv4 } from 'uuid' ; import { DEFAULT_ENTITY_GROUP , Entity , EntityType , EntityUpdate , WatermarkedType , } from '@dark-rush-photography/shared/types' ; import { DocumentModel } from '../schema/document.schema' ; export const loadCreateTestEntity = ( ) : Entity => ( { type : EntityType . Test , watermarkedType : WatermarkedType . WithoutWatermark , group : DEFAULT_ENTITY_GROUP , slug : uuidv4 ( ) , order : 0 , isPublic : false , seoKeywords : [ ] , starredImageIsCentered : false , images : [ ] , isDeleted : false , } ) ; export const loadCreateEntityForFolder = ( entityType , googleDriveFolderId , watermarkedType , group , slug , order ) : Entity => ( { type : entityType , googleDriveFolderId , watermarkedType , group , slug , order , isPublic : false , seoKeywords : [ ] , starredImageIsCentered : false , images : [ ] , isDeleted : false , } ) ; export const loadCreateImagePostEntity = ( text ) : Entity => ( { type : EntityType . ImagePost , watermarkedType : WatermarkedType . WithoutWatermark , group : DEFAULT_ENTITY_GROUP , slug : uuidv4 ( ) , order : 0 , isPublic : false , text , seoKeywords : [ ] , starredImageIsCentered : false , images : [ ] , isDeleted : false , } ) ; export const loadUpdateEntity = ( entityUpdate ) : Partial < DocumentModel > => ( { ... entityUpdate } ) ; export const loadDocumentModelsArray = ( documentModels ) : DocumentModel [ ] => { return Array . isArray ( documentModels ) ? documentModels : [ documentModels ] ; } ;