Compare commits
No commits in common. "ai-dev" and "master" have entirely different histories.
5
.gitignore
vendored
5
.gitignore
vendored
@ -1,8 +1,3 @@
|
||||
node_modules/
|
||||
*/node_modules/
|
||||
*/build/
|
||||
|
||||
**/node_modules/
|
||||
**/build/
|
||||
.DS_Store
|
||||
.env
|
||||
File diff suppressed because one or more lines are too long
@ -33,11 +33,6 @@ module.exports = class InventoryDBApi {
|
||||
|
||||
returned_quantity: data.returned_quantity
|
||||
||
|
||||
null
|
||||
,
|
||||
|
||||
picture: data.picture
|
||||
||
|
||||
null
|
||||
,
|
||||
|
||||
@ -77,11 +72,6 @@ module.exports = class InventoryDBApi {
|
||||
returned_quantity: item.returned_quantity
|
||||
||
|
||||
null
|
||||
,
|
||||
|
||||
picture: item.picture
|
||||
||
|
||||
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.picture !== undefined) updatePayload.picture = data.picture;
|
||||
|
||||
updatePayload.updatedById = currentUser.id;
|
||||
|
||||
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) {
|
||||
const [start, end] = filter.available_quantityRange;
|
||||
|
||||
|
||||
@ -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;
|
||||
}
|
||||
}
|
||||
};
|
||||
@ -34,11 +34,6 @@ returned_quantity: {
|
||||
|
||||
},
|
||||
|
||||
picture: {
|
||||
type: DataTypes.TEXT,
|
||||
|
||||
},
|
||||
|
||||
importHash: {
|
||||
type: DataTypes.STRING(255),
|
||||
allowNull: true,
|
||||
|
||||
@ -20,9 +20,6 @@ const { parse } = require('json2csv');
|
||||
* product_name:
|
||||
* type: string
|
||||
* default: product_name
|
||||
* picture:
|
||||
* type: string
|
||||
* default: picture
|
||||
|
||||
* available_quantity:
|
||||
* type: integer
|
||||
@ -289,7 +286,7 @@ router.get('/', wrapAsync(async (req, res) => {
|
||||
req.query, { currentUser }
|
||||
);
|
||||
if (filetype && filetype === 'csv') {
|
||||
const fields = ['id','product_name','picture',
|
||||
const fields = ['id','product_name',
|
||||
|
||||
'available_quantity','reserved_quantity','returned_quantity',
|
||||
|
||||
|
||||
@ -67,8 +67,6 @@ module.exports = class SearchService {
|
||||
|
||||
"product_name",
|
||||
|
||||
"picture",
|
||||
|
||||
],
|
||||
|
||||
"machinery": [
|
||||
|
||||
@ -1 +0,0 @@
|
||||
{}
|
||||
@ -97,15 +97,6 @@ const CardInventory = ({
|
||||
</dd>
|
||||
</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>
|
||||
</li>
|
||||
))}
|
||||
|
||||
@ -55,11 +55,6 @@ const ListInventory = ({ inventory, loading, onDelete, currentPage, numPages, on
|
||||
<p className={'line-clamp-2'}>{ item.returned_quantity }</p>
|
||||
</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>
|
||||
<ListActionsPopover
|
||||
onDelete={onDelete}
|
||||
|
||||
@ -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',
|
||||
type: 'actions',
|
||||
|
||||
@ -40,8 +40,6 @@ const EditInventory = () => {
|
||||
|
||||
'returned_quantity': '',
|
||||
|
||||
'picture': '',
|
||||
|
||||
}
|
||||
const [initialValues, setInitialValues] = useState(initVals)
|
||||
|
||||
@ -131,15 +129,6 @@ const EditInventory = () => {
|
||||
/>
|
||||
</FormField>
|
||||
|
||||
<FormField
|
||||
label="Picture"
|
||||
>
|
||||
<Field
|
||||
name="picture"
|
||||
placeholder="Picture"
|
||||
/>
|
||||
</FormField>
|
||||
|
||||
<BaseDivider />
|
||||
<BaseButtons>
|
||||
<BaseButton type="submit" color="info" label="Submit" />
|
||||
|
||||
@ -41,8 +41,6 @@ const EditInventoryPage = () => {
|
||||
|
||||
'returned_quantity': '',
|
||||
|
||||
'picture': '',
|
||||
|
||||
}
|
||||
const [initialValues, setInitialValues] = useState(initVals)
|
||||
|
||||
@ -129,15 +127,6 @@ const EditInventoryPage = () => {
|
||||
/>
|
||||
</FormField>
|
||||
|
||||
<FormField
|
||||
label="Picture"
|
||||
>
|
||||
<Field
|
||||
name="picture"
|
||||
placeholder="Picture"
|
||||
/>
|
||||
</FormField>
|
||||
|
||||
<BaseDivider />
|
||||
<BaseButtons>
|
||||
<BaseButton type="submit" color="info" label="Submit" />
|
||||
|
||||
@ -22,7 +22,7 @@ const InventoryTablesPage = () => {
|
||||
|
||||
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'},
|
||||
|
||||
|
||||
@ -33,8 +33,6 @@ const initialValues = {
|
||||
|
||||
returned_quantity: '',
|
||||
|
||||
picture: '',
|
||||
|
||||
}
|
||||
|
||||
const InventoryNew = () => {
|
||||
@ -102,15 +100,6 @@ const InventoryNew = () => {
|
||||
/>
|
||||
</FormField>
|
||||
|
||||
<FormField
|
||||
label="Picture"
|
||||
>
|
||||
<Field
|
||||
name="picture"
|
||||
placeholder="Picture"
|
||||
/>
|
||||
</FormField>
|
||||
|
||||
<BaseDivider />
|
||||
<BaseButtons>
|
||||
<BaseButton type="submit" color="info" label="Submit" />
|
||||
|
||||
@ -22,7 +22,7 @@ const InventoryTablesPage = () => {
|
||||
|
||||
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'},
|
||||
|
||||
|
||||
@ -69,11 +69,6 @@ const InventoryView = () => {
|
||||
<p>{inventory?.returned_quantity || 'No data'}</p>
|
||||
</div>
|
||||
|
||||
<div className={'mb-4'}>
|
||||
<p className={'block font-bold mb-2'}>Picture</p>
|
||||
<p>{inventory?.picture}</p>
|
||||
</div>
|
||||
|
||||
<BaseDivider />
|
||||
|
||||
<BaseButton
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user