Compare commits

..

No commits in common. "ai-dev" and "master" have entirely different histories.

17 changed files with 7 additions and 164 deletions

5
.gitignore vendored
View File

@ -1,8 +1,3 @@
node_modules/ node_modules/
*/node_modules/ */node_modules/
*/build/ */build/
**/node_modules/
**/build/
.DS_Store
.env

File diff suppressed because one or more lines are too long

View File

@ -33,11 +33,6 @@ module.exports = class InventoryDBApi {
returned_quantity: data.returned_quantity returned_quantity: data.returned_quantity
|| ||
null
,
picture: data.picture
||
null null
, ,
@ -77,11 +72,6 @@ module.exports = class InventoryDBApi {
returned_quantity: item.returned_quantity returned_quantity: item.returned_quantity
|| ||
null null
,
picture: item.picture
||
null
, ,
importHash: item.importHash || null, importHash: item.importHash || null,
@ -112,8 +102,6 @@ module.exports = class InventoryDBApi {
if (data.returned_quantity !== undefined) updatePayload.returned_quantity = data.returned_quantity; if (data.returned_quantity !== undefined) updatePayload.returned_quantity = data.returned_quantity;
if (data.picture !== undefined) updatePayload.picture = data.picture;
updatePayload.updatedById = currentUser.id; updatePayload.updatedById = currentUser.id;
await inventory.update(updatePayload, {transaction}); await inventory.update(updatePayload, {transaction});
@ -220,17 +208,6 @@ module.exports = class InventoryDBApi {
}; };
} }
if (filter.picture) {
where = {
...where,
[Op.and]: Utils.ilike(
'inventory',
'picture',
filter.picture,
),
};
}
if (filter.available_quantityRange) { if (filter.available_quantityRange) {
const [start, end] = filter.available_quantityRange; const [start, end] = filter.available_quantityRange;

View File

@ -1,54 +0,0 @@
module.exports = {
/**
* @param {QueryInterface} queryInterface
* @param {Sequelize} Sequelize
* @returns {Promise<void>}
*/
async up(queryInterface, Sequelize) {
/**
* @type {Transaction}
*/
const transaction = await queryInterface.sequelize.transaction();
try {
await queryInterface.addColumn(
'inventory',
'picture',
{
type: Sequelize.DataTypes.TEXT,
},
{ transaction }
);
await transaction.commit();
} catch (err) {
await transaction.rollback();
throw err;
}
},
/**
* @param {QueryInterface} queryInterface
* @param {Sequelize} Sequelize
* @returns {Promise<void>}
*/
async down(queryInterface, Sequelize) {
/**
* @type {Transaction}
*/
const transaction = await queryInterface.sequelize.transaction();
try {
await queryInterface.removeColumn(
'inventory',
'picture',
{ transaction }
);
await transaction.commit();
} catch (err) {
await transaction.rollback();
throw err;
}
}
};

View File

@ -34,11 +34,6 @@ returned_quantity: {
}, },
picture: {
type: DataTypes.TEXT,
},
importHash: { importHash: {
type: DataTypes.STRING(255), type: DataTypes.STRING(255),
allowNull: true, allowNull: true,

View File

@ -20,9 +20,6 @@ const { parse } = require('json2csv');
* product_name: * product_name:
* type: string * type: string
* default: product_name * default: product_name
* picture:
* type: string
* default: picture
* available_quantity: * available_quantity:
* type: integer * type: integer
@ -289,7 +286,7 @@ router.get('/', wrapAsync(async (req, res) => {
req.query, { currentUser } req.query, { currentUser }
); );
if (filetype && filetype === 'csv') { if (filetype && filetype === 'csv') {
const fields = ['id','product_name','picture', const fields = ['id','product_name',
'available_quantity','reserved_quantity','returned_quantity', 'available_quantity','reserved_quantity','returned_quantity',

View File

@ -67,8 +67,6 @@ module.exports = class SearchService {
"product_name", "product_name",
"picture",
], ],
"machinery": [ "machinery": [

View File

@ -1 +0,0 @@
{}

View File

@ -97,15 +97,6 @@ const CardInventory = ({
</dd> </dd>
</div> </div>
<div className='flex justify-between gap-x-4 py-3'>
<dt className='text-gray-500 dark:text-dark-600'>Picture</dt>
<dd className='flex items-start gap-x-2'>
<div className='font-medium line-clamp-4'>
{ item.picture }
</div>
</dd>
</div>
</dl> </dl>
</li> </li>
))} ))}

View File

@ -55,11 +55,6 @@ const ListInventory = ({ inventory, loading, onDelete, currentPage, numPages, on
<p className={'line-clamp-2'}>{ item.returned_quantity }</p> <p className={'line-clamp-2'}>{ item.returned_quantity }</p>
</div> </div>
<div className={'flex-1 px-3'}>
<p className={'text-xs text-gray-500'}>Picture</p>
<p className={'line-clamp-2'}>{ item.picture }</p>
</div>
</Link> </Link>
<ListActionsPopover <ListActionsPopover
onDelete={onDelete} onDelete={onDelete}

View File

@ -82,19 +82,6 @@ export const loadColumns = async (
}, },
{
field: 'picture',
headerName: 'Picture',
flex: 1,
minWidth: 120,
filterable: false,
headerClassName: 'datagrid--header',
cellClassName: 'datagrid--cell',
editable: true,
},
{ {
field: 'actions', field: 'actions',
type: 'actions', type: 'actions',

View File

@ -40,8 +40,6 @@ const EditInventory = () => {
'returned_quantity': '', 'returned_quantity': '',
'picture': '',
} }
const [initialValues, setInitialValues] = useState(initVals) const [initialValues, setInitialValues] = useState(initVals)
@ -131,15 +129,6 @@ const EditInventory = () => {
/> />
</FormField> </FormField>
<FormField
label="Picture"
>
<Field
name="picture"
placeholder="Picture"
/>
</FormField>
<BaseDivider /> <BaseDivider />
<BaseButtons> <BaseButtons>
<BaseButton type="submit" color="info" label="Submit" /> <BaseButton type="submit" color="info" label="Submit" />

View File

@ -41,8 +41,6 @@ const EditInventoryPage = () => {
'returned_quantity': '', 'returned_quantity': '',
'picture': '',
} }
const [initialValues, setInitialValues] = useState(initVals) const [initialValues, setInitialValues] = useState(initVals)
@ -129,15 +127,6 @@ const EditInventoryPage = () => {
/> />
</FormField> </FormField>
<FormField
label="Picture"
>
<Field
name="picture"
placeholder="Picture"
/>
</FormField>
<BaseDivider /> <BaseDivider />
<BaseButtons> <BaseButtons>
<BaseButton type="submit" color="info" label="Submit" /> <BaseButton type="submit" color="info" label="Submit" />

View File

@ -22,7 +22,7 @@ const InventoryTablesPage = () => {
const dispatch = useAppDispatch(); const dispatch = useAppDispatch();
const [filters] = useState([{label: 'ProductName', title: 'product_name'},{label: 'Picture', title: 'picture'}, const [filters] = useState([{label: 'ProductName', title: 'product_name'},
{label: 'AvailableQuantity', title: 'available_quantity', number: 'true'},{label: 'ReservedQuantity', title: 'reserved_quantity', number: 'true'},{label: 'ReturnedQuantity', title: 'returned_quantity', number: 'true'}, {label: 'AvailableQuantity', title: 'available_quantity', number: 'true'},{label: 'ReservedQuantity', title: 'reserved_quantity', number: 'true'},{label: 'ReturnedQuantity', title: 'returned_quantity', number: 'true'},

View File

@ -33,8 +33,6 @@ const initialValues = {
returned_quantity: '', returned_quantity: '',
picture: '',
} }
const InventoryNew = () => { const InventoryNew = () => {
@ -102,15 +100,6 @@ const InventoryNew = () => {
/> />
</FormField> </FormField>
<FormField
label="Picture"
>
<Field
name="picture"
placeholder="Picture"
/>
</FormField>
<BaseDivider /> <BaseDivider />
<BaseButtons> <BaseButtons>
<BaseButton type="submit" color="info" label="Submit" /> <BaseButton type="submit" color="info" label="Submit" />

View File

@ -22,7 +22,7 @@ const InventoryTablesPage = () => {
const dispatch = useAppDispatch(); const dispatch = useAppDispatch();
const [filters] = useState([{label: 'ProductName', title: 'product_name'},{label: 'Picture', title: 'picture'}, const [filters] = useState([{label: 'ProductName', title: 'product_name'},
{label: 'AvailableQuantity', title: 'available_quantity', number: 'true'},{label: 'ReservedQuantity', title: 'reserved_quantity', number: 'true'},{label: 'ReturnedQuantity', title: 'returned_quantity', number: 'true'}, {label: 'AvailableQuantity', title: 'available_quantity', number: 'true'},{label: 'ReservedQuantity', title: 'reserved_quantity', number: 'true'},{label: 'ReturnedQuantity', title: 'returned_quantity', number: 'true'},

View File

@ -69,11 +69,6 @@ const InventoryView = () => {
<p>{inventory?.returned_quantity || 'No data'}</p> <p>{inventory?.returned_quantity || 'No data'}</p>
</div> </div>
<div className={'mb-4'}>
<p className={'block font-bold mb-2'}>Picture</p>
<p>{inventory?.picture}</p>
</div>
<BaseDivider /> <BaseDivider />
<BaseButton <BaseButton