Skip to content

SSF-135 - admin order management changes#121

Open
swarkewalia wants to merge 1 commit intomainfrom
sk/SSF-149-admin-order-management-updates
Open

SSF-135 - admin order management changes#121
swarkewalia wants to merge 1 commit intomainfrom
sk/SSF-149-admin-order-management-updates

Conversation

@swarkewalia
Copy link

ℹ️ Issue

Closes 135

📝 Description

  • grayed out 'action required' column to match figma
  • added 'assignee' column to store volunteer who created the order (shows 'no assignees' for now since there isn't a order creation workflow yet!)
  • updated GET /api/orders to return assignee data & updated frontend to use assignee instead of first pantry volunteer

✔️ Verification

UI testing

@Juwang110 Juwang110 self-requested a review March 9, 2026 00:15
Copy link

@Juwang110 Juwang110 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall logic looks good, just need to refactor for a non-nullable assignee

public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`
ALTER TABLE orders
ADD COLUMN assignee_id INT,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that asignees should not be able to be nullable

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since there isn't an order creation workflow yet, i think it might be best to keep it nullable for now and change it later once that's implemented. the existing orders currently have null assignees so it might break things

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Yurika-Kan what do you think? I don't think it will break anything since the null assignees are new here but will defer to your judgement

export class AddAssigneeToOrders1773009000618 implements MigrationInterface {
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`
ALTER TABLE orders

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also here we can edit the dummy data to add ids for the asignee for each order

})
shippingCost!: number | null;

@ManyToOne(() => User, { nullable: true })

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should not be nullable


@ManyToOne(() => User, { nullable: true })
@JoinColumn({ name: 'assignee_id', referencedColumnName: 'id' })
assignee!: User | null;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove | null

nullable: true,
})
shippingCost!: number | null;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see the relation but we should add an explicity assignee_id column definition to this entity since we add a table column

id: number;
firstName: string;
lastName: string;
} | null;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove | null

{order.assignee?.lastName.charAt(0).toUpperCase()}
</Box>
) : (
<Box>No Assignees</Box>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can remove the no assignee case

@Yurika-Kan Yurika-Kan self-requested a review March 11, 2026 08:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants