Inventory Infrastructure and Example for Suits #10

Merged
OrdisPrime merged 16 commits from inventory_basic into main 2023-06-03 18:06:22 -07:00
OrdisPrime commented 2023-06-03 17:15:45 -07:00 (Migrated from github.com)
No description provided.
AngeloTadeucci (Migrated from github.com) requested changes 2023-06-03 17:38:47 -07:00
AngeloTadeucci (Migrated from github.com) commented 2023-06-03 17:26:15 -07:00

i dont think the comment is necessary

    const inventory = await Inventory.findOne({ accountOwnerId: accountId });
i dont think the comment is necessary ```suggestion const inventory = await Inventory.findOne({ accountOwnerId: accountId }); ```
AngeloTadeucci (Migrated from github.com) commented 2023-06-03 17:26:58 -07:00

check if inventory is undefined before trying toJson()

check if inventory is undefined before trying `toJson()`
@ -1,11 +1,29 @@
import inventory from "@/static/fixed_responses/inventory.json";
/* eslint-disable @typescript-eslint/no-misused-promises */
import { toInventoryResponse } from "@/src/helpers/inventoryHelpers";
AngeloTadeucci (Migrated from github.com) commented 2023-06-03 17:24:58 -07:00

isnt disabled globally now?

isnt disabled globally now?
AngeloTadeucci (Migrated from github.com) commented 2023-06-03 17:37:24 -07:00

use non-relative import

use non-relative import
@ -0,0 +1,258 @@
import { Document, Schema, model } from "mongoose";
import { IInventoryDatabase, IInventoryResponse, ISuitDatabase, ISuitDocument, Oid } from "../types/inventoryTypes";
AngeloTadeucci (Migrated from github.com) commented 2023-06-03 17:37:15 -07:00

use non-relative import

use non-relative import
AngeloTadeucci (Migrated from github.com) commented 2023-06-03 17:36:57 -07:00

use non-relative import

use non-relative import
OrdisPrime (Migrated from github.com) reviewed 2023-06-03 17:39:22 -07:00
@ -1,11 +1,29 @@
import inventory from "@/static/fixed_responses/inventory.json";
/* eslint-disable @typescript-eslint/no-misused-promises */
import { toInventoryResponse } from "@/src/helpers/inventoryHelpers";
OrdisPrime (Migrated from github.com) commented 2023-06-03 17:39:22 -07:00

no idea it shouldn't be

no idea it shouldn't be
OrdisPrime (Migrated from github.com) reviewed 2023-06-03 17:39:50 -07:00
OrdisPrime (Migrated from github.com) commented 2023-06-03 17:39:50 -07:00

it is important, because it is not present in the original response.

it is important, because it is not present in the original response.
OrdisPrime (Migrated from github.com) reviewed 2023-06-03 17:40:09 -07:00
OrdisPrime (Migrated from github.com) commented 2023-06-03 17:40:09 -07:00

?. checks for undefined!

?. checks for undefined!
OrdisPrime (Migrated from github.com) reviewed 2023-06-03 17:40:44 -07:00
OrdisPrime (Migrated from github.com) commented 2023-06-03 17:40:44 -07:00

done

done
AngeloTadeucci (Migrated from github.com) reviewed 2023-06-03 17:43:02 -07:00
AngeloTadeucci (Migrated from github.com) commented 2023-06-03 17:43:01 -07:00

this comment doesn't explain nothing, it says its using accountOwnerId to find an inventory which is obvious.

this comment doesn't explain nothing, it says its using accountOwnerId to find an inventory which is obvious.
AngeloTadeucci (Migrated from github.com) reviewed 2023-06-03 17:43:17 -07:00
@ -1,11 +1,29 @@
import inventory from "@/static/fixed_responses/inventory.json";
/* eslint-disable @typescript-eslint/no-misused-promises */
import { toInventoryResponse } from "@/src/helpers/inventoryHelpers";
AngeloTadeucci (Migrated from github.com) commented 2023-06-03 17:43:16 -07:00

then remove the one from .eslintrc

then remove the one from .eslintrc
AngeloTadeucci (Migrated from github.com) reviewed 2023-06-03 17:43:50 -07:00
AngeloTadeucci (Migrated from github.com) commented 2023-06-03 17:43:49 -07:00

that's why you check before so you dont two undefined checks

that's why you check before so you dont two undefined checks
OrdisPrime (Migrated from github.com) reviewed 2023-06-03 17:44:53 -07:00
OrdisPrime (Migrated from github.com) commented 2023-06-03 17:44:53 -07:00

it explains a lot.

I added the field accountOwnerId and everyone who knows the inventory structure would know the field is not originally there.

The purpose of the field is explained: it exists to find an account's corresponding inventory.

it explains a lot. I added the field accountOwnerId and everyone who knows the inventory structure would know the field is not originally there. The purpose of the field is explained: it exists to find an account's corresponding inventory.
OrdisPrime (Migrated from github.com) reviewed 2023-06-03 17:46:46 -07:00
OrdisPrime (Migrated from github.com) commented 2023-06-03 17:46:46 -07:00

good suggestion!

good suggestion!
OrdisPrime (Migrated from github.com) reviewed 2023-06-03 17:46:59 -07:00
OrdisPrime (Migrated from github.com) commented 2023-06-03 17:46:59 -07:00

I understand now what you mean

I understand now what you mean
OrdisPrime (Migrated from github.com) reviewed 2023-06-03 17:48:55 -07:00
@ -1,11 +1,29 @@
import inventory from "@/static/fixed_responses/inventory.json";
/* eslint-disable @typescript-eslint/no-misused-promises */
import { toInventoryResponse } from "@/src/helpers/inventoryHelpers";
OrdisPrime (Migrated from github.com) commented 2023-06-03 17:48:55 -07:00

I agree with you that it is stupid to have the line in every file that has an async handler.

But I don't like to globally disable a warning. Ill turn the .eslintrc back on

I agree with you that it is stupid to have the line in every file that has an async handler. But I don't like to globally disable a warning. Ill turn the .eslintrc back on
AngeloTadeucci (Migrated from github.com) reviewed 2023-06-03 17:49:11 -07:00
AngeloTadeucci (Migrated from github.com) commented 2023-06-03 17:49:04 -07:00

should that belong then inside inventoryModel.ts?

should that belong then inside inventoryModel.ts?
AngeloTadeucci (Migrated from github.com) approved these changes 2023-06-03 18:05:56 -07:00
@ -8,1 +14,3 @@
response.json(inventory);
const inventory = await Inventory.findOne({ accountOwnerId: accountId });
AngeloTadeucci (Migrated from github.com) commented 2023-06-03 18:04:28 -07:00

remove log

remove log
Sign in to join this conversation.
No description provided.