Press n or j to go to the next uncovered block, b, p or k for the previous block.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x | import { BuilderDto } from '@contracts/dto/forms/builderDto'; import { BuilderDtoMeta } from '@contracts/dto/forms/meta/builderDto.meta'; import { cyrb53 } from '@helpers/hashHelper'; import { getDatabaseService } from '@services/external/database/databaseService'; import { Builder } from '@services/external/database/xata'; import { IApiModule } from '../../types/baseModule'; import { IBuilderImages, builderFileHandler } from './builderFileHandler'; import { builderDtoWithImageToPersistence, builderPersistenceToDto } from './builderMapper'; import { builderPublicUrlHandler } from './builderPublicUrlHandler'; import { builderAdditionalPropertiesToDto, builderCreateRelationships, } from './builderRelationshipsHandler'; const getDbTable = () => getDatabaseService().builder(); export const builderModule: IApiModule<BuilderDto, IBuilderImages, Builder> = { segment: 'builder', dtoMeta: BuilderDtoMeta, sendDiscordMessageOnSubmission: true, getName: (persistence: Builder) => persistence.name, getIcon: (persistence: Builder) => persistence.profilePicUrl, mapDtoWithImageToPersistence: builderDtoWithImageToPersistence, mapPersistenceToDto: builderPersistenceToDto, mapRecordRelationshipsToDto: builderAdditionalPropertiesToDto, createRecord: (persistence) => getDbTable().create(persistence), createRecordRelationships: builderCreateRelationships, readRecord: (id) => getDbTable().read(id), readAllRecords: () => getDbTable().readAll(), updateRecord: (id, persistence) => getDbTable().update(id, persistence), handleFilesInFormData: builderFileHandler, getPublicUrlsOfUploads: builderPublicUrlHandler, calculateCheck: (p) => cyrb53([p.id, p.name, p.contactDetails].join('-')), }; |