UNPKG

@bit-ui-libs/common

Version:
181 lines (164 loc) 4.09 kB
import { AttachmentClassification, RelationTypeEnum, StepEnum } from '../../common'; import { ASSET_STATUSES } from '../constants'; import { SellingMethodEnum } from '../enums'; import { AssetTypeStep } from './asset-template'; import { AssetWitness } from './asset-witness'; import { ChainTypeEnum } from './chain-type-enum'; export interface BaseTypePropertyData { id: string | number; name: string; value: string; } export interface BaseType { id: string; name: string; categoryId: number; image: string | null; } export interface CustomerAssetWitness { assetId: string; witnessId: string; relationType: RelationsTypeEnum; witness: AssetWitness; } export interface CustomerAsset { id: string; appName: string; typeId: string; typeName: string; status: AssetStatus; level: AssetLevelEnum; name: string; ownerId: string; orgId: string; serializedSteps: SerializedStep[]; serializedProps: SerializedProp[]; serializedImages: SerializedImage[]; serializedDocuments: SerializedImage[]; serializedCategories: string[]; qrCodeRef?: string | null; rfIdRef?: string | null; eventIdRef: string; city?: string | null; state?: string | null; country?: string | null; isMinted: boolean; isVerifiedByWitness: boolean; createdAt: string; updatedAt: string; mintedAt: string; isFavorite: boolean; isVerifiedByOfficial: boolean; sellingMethod: SellingMethodEnum | null; referenceVDT: AssetReferenceVDTResponse[]; witness: WitnessCustomerAssetResponse[]; createdBy: string; categoryId?: string; assetWitness?: CustomerAssetWitness[]; } export interface S2CCustomerAsset extends CustomerAsset { typeDetail: { id: string; name: string; description: string; categoryId: string; readyForUse: true; imageUrl: string; isActive: true; steps: AssetTypeStep[]; vdtType: ChainTypeEnum; orgId: string; }; isOpen?: boolean; } export interface AssetReferenceVDTResponse { assetId?: string; serviceId?: string; qrCodeRefId: string; vdtType: ChainTypeEnum; bitSysId: string; relationType: RelationTypeEnum; createdAt: string; data: { title: string }; } export interface WitnessCustomerAssetResponse { id: string; relationType: RelationTypeEnum; userId: string; name: string; email: string; firstName: string; lastName: string; avatarUrl: string; serializedImages: SerializedImage[]; serializedProps: SerializedProp[]; eventIdRef: string; isMinted: boolean; city: string; state: string; country: string; locationAccuracy: 'exact' | 'city'; geolocation: { longitude: number; latitude: number; meanSeaLevel: number; }; createdAt: string; mintedAt: string; approved: boolean; updatedAt: string; orgId: string; } export enum RelationsTypeEnum { CHECKIN_OFFICIAL = 'CHECKIN_OFFICIAL', CHECKIN_WITNESS = 'CHECKIN_WITNESS', CHECKIN_INSPECTOR = 'CHECKIN_INSPECTOR', CHECKIN_BUYER = 'CHECKIN_BUYER', CHECKIN_SELLER = 'CHECKIN_SELLER', PARENT_VDT = 'PARENT_VDT', CHILD_VDT = 'CHILD_VDT', } export type AssetStatus = (typeof ASSET_STATUSES)[number]; // export type AssetSteps = (typeof ASSET_STEPS)[number]; export enum AssetLevelEnum { A_PLUS = 'A+', A = 'A', A_MINUS = 'A-', B_PLUS = 'B+', B = 'B', B_MINUS = 'B-', C_PLUS = 'C+', C = 'C', C_MINUS = 'C-', } export interface SerializedStep { step?: StepEnum; order: number; typeId: string; enabled: boolean; finished: boolean; isRequired: boolean; } export interface SerializedProp { id: string; name: string; value: string; } export interface SerializedImage { name: string; docId: string; docType: string; mimeType: string; description: string; classification: AttachmentClassification; isMain: boolean; } export enum VerifyType { NOT_VERIFIED = 'notVerified', OFFICIAL_VERIFIED = 'verifiedByOfficial', SELF_VERIFIED = 'selfVerified', } export type MintStatus = 'MINTING_STARTED' | 'MINTING_FAILED' | 'MINTED'; export interface FavoriteAsset extends CustomerAsset { isDeleted: boolean; }