Vagabonds-Labs / cofiblocks

Welcome to Cofiblocks marketplace: A Starknet web3 platform to innovate Costa Rica coffee industry. Cofiblocks connects small coffee farmers directly with coffee lovers, cutting out unnecessary intermediaries.
https://www.cofiblocks.com/
10 stars 20 forks source link

Centralize Type Definitions #58

Open evgongora opened 2 days ago

evgongora commented 2 days ago

Description:

Order-related types and enums are duplicated across files. We need to centralize these in a shared types file.

Code References:

my-orders

const SalesStatusEnum = {
    Paid: "Paid",
    Prepared: "Prepared",
    Shipped: "Shipped",
    Delivered: "Delivered",
} as const;

type SalesStatus = (typeof SalesStatusEnum)[keyof typeof SalesStatusEnum];

const filtersSchema = z.object({
    statusPaid: z.boolean().optional(),
    statusPrepared: z.boolean().optional(),
    statusShipped: z.boolean().optional(),
    statusDelivered: z.boolean().optional(),
});

type FormValues = z.infer<typeof filtersSchema>;

my-sales

const SalesStatusEnum = {
    Paid: "Paid",
    Prepared: "Prepared",
    Shipped: "Shipped",
    Delivered: "Delivered",
} as const;

type SalesStatus = (typeof SalesStatusEnum)[keyof typeof SalesStatusEnum];

const DeliveryMethodEnum = {
    Address: "Address",
    Meetup: "Meetup",
} as const;

type DeliveryMethod =
    (typeof DeliveryMethodEnum)[keyof typeof DeliveryMethodEnum];

const filtersSchema = z.object({
    statusPaid: z.boolean().optional(),
    statusPrepared: z.boolean().optional(),
    statusShipped: z.boolean().optional(),
    statusDelivered: z.boolean().optional(),
    deliveryAddress: z.boolean().optional(),
    deliveryMeetup: z.boolean().optional(),
});

Acceptance Criteria:

  1. Status enums
  2. Delivery method enums
  3. Order interfaces
  4. Form value types
martinvibes commented 2 days ago

Hey @evgongora can I work on this issue

ShantelPeters commented 1 day ago

Can i please be assigned to this issue @evgongora

PedroCo3lho commented 1 day ago

Hi @evgongora, can I work on this as my first issue in the project? I’m a full-stack developer with a solid understanding of TypeScript, Next.js, and TailwindCSS. I plan to organize all the types by creating a \types folder in apps/web/src, centralizing and modularizing the types based on their context. I will then export and update their usage throughout the web folder. Looking forward to your approval!

KevinLatino commented 1 day ago

Hello @evgongora! My name is Kevin Latino, and I'm a frontend developer and active open-source contributor. I'm a member of Dojo Coding, a thriving Web3 community in Costa Rica. I have experience with React, Next.js, and TypeScript, also I have experience in data fetching and API integrations and I recently won the LATAM Hackathon hosted by Base. I've also contributed to projects in ecosystems like Starknet and Stellar.

For this issue, I will centralize the order-related types and enums in a shared types file to eliminate duplication. I will create a shared file that includes the status enums, delivery method enums, order interfaces, and form value types. I’ll update all components to use the shared types, ensuring type safety across the application.

qgatssdev commented 1 day ago

The ETA for this is less than 2 days. I can have a pull request ready by then, i'm a fullstack engineer with over 4 years of experience.

derianrddev commented 1 day ago

My Background and How It Can Be Leveraged Hello, my name is Derian Rodríguez. I am a passionate software engineer with over one year of experience. I am part of the Dojo Coding Community and have been actively contributing to open-source projects through OnlyDust. I have experience in frontend development using JavaScript/TypeScript, React, and Next.js. I would love to contribute and support the development of this project.

How I Plan on Tackling This Issue I will create a shared file for types and enums. I will modify the MyOrders and MySales pages to import enums and types from the new file. I will verify that all components dependent on the updated types work correctly.

PedroCo3lho commented 1 day ago

Hi @evgongora, can I work on this as my first issue in the project? I’m a full-stack developer with a solid understanding of TypeScript, Next.js, and TailwindCSS. I plan to organize all the types by creating a \types folder in apps/web/src, centralizing and modularizing the types based on their context. I will then export and update their usage throughout the web folder. Looking forward to your approval!

Can I try solving this issue?

caxtonacollins commented 1 day ago

please assign this issue to me, I am ready to put in the work

hannahredler commented 23 hours ago

Hey! I'm Hannah, a full stack dev with several years experience in web3! I have a strong focus on clean code and would happily take this task, centralizing type definitions, reducing duplication and making sure it still works correctly.

GideonBature commented 23 hours ago

Would love to tackle this!

My name is Gideon Bature, a Software Engineer with experience building Starknet based smart contracts, using Cairo. If assigned this issue, I will send my first PR within 72 hrs.

Thank you!

GideonBature commented 23 hours ago

Would love to tackle this!

My name is Gideon Bature, a Software Engineer with experience using TypeScript. If assigned this issue, I will send my first PR within 72 hrs.

Thank you!

Michaelkingsdev commented 23 hours ago

May I handle this issue? I am an experienced frontend developer with 3 years of experience.

od-hunter commented 23 hours ago

This is my first time contributing to this ecosystem and I would love to be given the opportunity. I am a blockchain developer, and my experience includes html, css, react, javaScript, typescript, c#, solidity & Cairo.

To solve this issue I’ll take the following steps: 1.⁠ ⁠I’ll create a file (orderTypes.ts) containing the SalesStatusEnum, DeliveryMethodEnum, SalesStatus, DeliveryMethod, Order interface, and form value types (FormValues). 2.⁠ ⁠⁠Then I’ll update the my-orders.ts and my-sales.ts files to import the shared types and enums from orderTypes.ts rather than redefining them locally. 3.⁠ ⁠⁠I’ll use TypeScript's type inference to ensure proper typing across the application

Please assign me I’m ready to work.

PedroCo3lho commented 14 hours ago

Thank you, I'll start work on it!