This document provides a concise guide to the ShelfType module, focusing on the ShelfType model and its usage.
Defines the structure for ShelfType entities.
type ShelfType = {
_id?: string;
id: string;
createdAt: Date | string;
updatedAt: Date | string;
deletedAt?: Date;
code: string;
prefix: string;
brand: string;
mold: string;
description: string;
size: number;
};
Defines the structure for creating a new ShelfType.
type CreateShelfTypeDTO = {
code?: string;
prefix?: string;
brand?: string;
mold?: string;
description?: string;
size?: number;
external_id?: any;
};
Defines the structure for updating an existing ShelfType.
type UpdateShelfTypeDTO = {
code?: string;
prefix?: string;
brand?: string;
mold?: string;
description?: string;
size?: number;
external_id?: any;
};
import OZMapSDK from 'ozmapsdk';
const sdk = new OZMapSDK('ozmapURL', { apiKey: 'yourApiKey' });
const newShelfTypeData: CreateShelfTypeDTO = {
code: 'ST001',
prefix: 'PX',
brand: 'BrandX',
mold: 'MoldY',
description: 'Description here',
size: 5,
};
sdk.shelfType.create(newShelfTypeData).then((shelfType) => {
console.log('ShelfType created:', shelfType);
});
import OZMapSDK from 'ozmapsdk';
const sdk = new OZMapSDK('ozmapURL', { apiKey: 'yourApiKey' });
const updateShelfTypeData: UpdateShelfTypeDTO = {
description: 'Updated description',
};
sdk.shelfType.updateById('shelfTypeId', updateShelfTypeData).then(() => {
console.log('ShelfType updated');
});
import OZMapSDK from 'ozmapsdk';
const sdk = new OZMapSDK('ozmapURL', { apiKey: 'yourApiKey' });
sdk.shelfType.find({ page: 1, limit: 10 }).then((pagination) => {
console.log('shelfType:', pagination);
});
import OZMapSDK from 'ozmapsdk';
const sdk = new OZMapSDK('ozmapURL', { apiKey: 'yourApiKey' });
sdk.shelfType.findById('shelfTypeId').then((shelfType) => {
console.log('shelfType:', shelfType);
});
import OZMapSDK from 'ozmapsdk';
const sdk = new OZMapSDK('ozmapURL', { apiKey: 'yourApiKey' });
sdk.shelfType.deleteById('shelfTypeId').then(() => {
console.log('shelfType deleted');
});