Basic PIM Service - rettersoft/rbs-docs GitHub Wiki

Basic PIM Service

Models

enum AttributeType {
    Text = "text",
    LongText = "longText",
    Number = "number"
}

export class AttributeDefinition {
    @Length(10, 10)
    id: string;

    @IsDefined()
    @IsEnum(AttributeType)
    attributeType: AttributeType;

    @IsDefined()
    @IsBoolean()
    isLocalized: boolean
}



export class PimProduct {
    @IsDefined()
    sku: string

    @ValidateNested({ each: true })
    @Type(() => AttributeValue)
    attributes: AttributeValue[]

    @IsDefined()
    @IsArray()
    categories: string[]
}

export class PimProductImage {

}

export class AttributeValue {

    @IsDefined()
    @IsString()
    attributeId: string

    @ValidateNested({ each: true })
    @Type(() => LocalizedValue)
    value: LocalizedValue[]
}

export class LocalizedValue {
    @IsDefined()
    locale: string

    @IsDefined()
    @IsString()
    value: string
}

export class PimCategory {

    @IsDefined()
    @IsAlphanumeric()
    @IsAscii()
    id: string

    @IsAlphanumeric()
    @IsAscii()
    @IsOptional()
    parentId: string

    @IsDefined()
    @ValidateNested({ each: true })
    @Type(() => LocalizedValue)
    name: LocalizedValue[]
}

export class PimConfig {
    @IsDefined()
    @ArrayNotEmpty()
    locales: Array<string>
}

export class ImportExcelPayload {
    @IsDefined()
    @IsBase64()
    content: string
}

export class ImportExcelLineObject {
    @IsDefined()
    sku: string

    @IsDefined()
    categories: string
}

Available Actions

enum PimActionType {
    GET_ATTRIBUTES = "rbs.pimproduct.request.GET_ATTRIBUTES",
    UPSERT_ATTRIBUTE = "rbs.pimproduct.request.UPSERT_ATTRIBUTE",
    GET_PRODUCTS = "rbs.pimproduct.request.GET_PRODUCTS",
    UPSERT_PRODUCT = "rbs.pimproduct.request.UPSERT_PRODUCT",
    GET_CATEGORIES = "rbs.pimproduct.request.GET_CATEGORIES",
    UPSERT_CATEGORY = "rbs.pimproduct.request.UPSERT_CATEGORY",
    GET_CONFIG = "rbs.pimproduct.request.GET_CONFIG",
    SET_CONFIG = "rbs.pimproduct.request.SET_CONFIG",
    IMPORT_EXCEL = "rbs.pimproduct.request.IMPORT_EXCEL",
}
⚠️ **GitHub.com Fallback** ⚠️