maxonflutter / Grocery-Shopping-App-with-Flutter-Dart-Frog

A simple eCommerce UI connected with a backend server using dart_frog
19 stars 5 forks source link

Junior AI: Create the cart model #9

Open maxonflutter opened 1 year ago

maxonflutter commented 1 year ago

The scope of work for Junior AI

The cart model represents a user's ongoing or past shopping session, and stores the selected products and the overall cost.

Attributes:
  - `userId`: A foreign key linking the cart to a user 
  - `cartItems`: A list containing all the CartItem objects that have been added to the cart. 

The CartItem class is already available in the project repository. Use the cart item properties to create two getters in the Cart class the totalQuantity and the totalPrice.

Code or Test

Code

Create or Edit

Create

Any relevant code snippet

class CartItem extends Equatable {
  final String id;
  final Product product;
  final int quantity;
  final double subtotal;

  const CartItem({
    required this.id,
    required this.product,
    required this.quantity,
    required this.subtotal,
  });
}

Any relevant file references

No response

Code Generator

None of the options

ghost commented 1 year ago

Junior AI Bot Update 🤖

Hello! I'm pleased to inform you that the Junior AI Bot has started working on this issue. Hang on tight while the bot handles the task.

Account Status 💰

Currently, you have 2150 credits remaining in your account.

Should you need more credits or wish to view our pricing plans, kindly visit Junior Pricing.

Support & Community 💬

For any technical support, queries, or to engage with the community, please don't hesitate to send an email to massimo@atomsbox.com or join us the our Discord Channel.

Learn & Support ⭐

Want to see Junior AI Bot in action? Check out the GitHub project for examples. If you find the project helpful, please consider giving a star to support it!