Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions apps/backend/src/allocations/allocations.entity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,4 @@ export class Allocation {

@Column({ name: 'fulfilled_at', type: 'timestamp' })
fulfilledAt: Date;

@Column({ name: 'status', type: 'varchar', length: 255 })
status: string;
}
1 change: 0 additions & 1 deletion apps/backend/src/allocations/allocations.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ export class AllocationsService {
allocatedQuantity: true,
reservedAt: true,
fulfilledAt: true,
status: true,
},
});
}
Expand Down
2 changes: 2 additions & 0 deletions apps/backend/src/config/typeorm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import { RemoveOrdersDonationId1761500262238 } from '../migrations/1761500262238
import { AddVolunteerPantryUniqueConstraint1760033134668 } from '../migrations/1760033134668-AddVolunteerPantryUniqueConstraint';
import { AllergyFriendlyToBoolType1763963056712 } from '../migrations/1763963056712-AllergyFriendlyToBoolType';
import { UpdatePantryUserFieldsFixed1764350314832 } from '../migrations/1764350314832-UpdatePantryUserFieldsFixed';
import { RemoveUnusedStatuses1764816885341 } from '../migrations/1764816885341-RemoveUnusedStatuses';
import { UpdatePantryFields1763762628431 } from '../migrations/1763762628431-UpdatePantryFields';

const config = {
Expand Down Expand Up @@ -61,6 +62,7 @@ const config = {
AddVolunteerPantryUniqueConstraint1760033134668,
AllergyFriendlyToBoolType1763963056712,
UpdatePantryUserFieldsFixed1764350314832,
RemoveUnusedStatuses1764816885341,
],
};

Expand Down
3 changes: 0 additions & 3 deletions apps/backend/src/donationItems/donationItems.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ export class DonationItemsController {
itemName: { type: 'string', example: 'Rice Noodles' },
quantity: { type: 'integer', example: 100 },
reservedQuantity: { type: 'integer', example: 0 },
status: { type: 'string', example: 'available' },
ozPerItem: { type: 'integer', example: 5 },
estimatedValue: { type: 'integer', example: 100 },
foodType: {
Expand All @@ -53,7 +52,6 @@ export class DonationItemsController {
itemName: string;
quantity: number;
reservedQuantity: number;
status: string;
ozPerItem: number;
estimatedValue: number;
foodType: FoodType;
Expand All @@ -70,7 +68,6 @@ export class DonationItemsController {
body.itemName,
body.quantity,
body.reservedQuantity,
body.status,
body.ozPerItem,
body.estimatedValue,
body.foodType,
Expand Down
3 changes: 0 additions & 3 deletions apps/backend/src/donationItems/donationItems.entity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@ export class DonationItem {
@Column({ name: 'reserved_quantity', type: 'int', default: 0 })
reservedQuantity: number;

@Column({ name: 'status', type: 'varchar', length: 25, default: 'avaliable' })
status: string;

@Column({ name: 'oz_per_item', type: 'int', nullable: true })
ozPerItem: number;

Expand Down
2 changes: 0 additions & 2 deletions apps/backend/src/donationItems/donationItems.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ export class DonationItemsService {
itemName: string,
quantity: number,
reservedQuantity: number,
status: string,
ozPerItem: number,
estimatedValue: number,
foodType: FoodType,
Expand All @@ -37,7 +36,6 @@ export class DonationItemsService {
itemName,
quantity,
reservedQuantity,
status,
ozPerItem,
estimatedValue,
foodType,
Expand Down
25 changes: 25 additions & 0 deletions apps/backend/src/migrations/1764816885341-RemoveUnusedStatuses.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { MigrationInterface, QueryRunner } from "typeorm";

export class RemoveUnusedStatuses1764816885341 implements MigrationInterface {

public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`ALTER TABLE allocations DROP COLUMN IF EXISTS status;`
);
await queryRunner.query(
`ALTER TABLE donation_items DROP COLUMN IF EXISTS status;`
);
}

public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`
ALTER TABLE allocations
ADD COLUMN status VARCHAR(25) NOT NULL DEFAULT 'pending';
`);

await queryRunner.query(`
ALTER TABLE donation_items
ADD COLUMN status VARCHAR(25) NOT NULL DEFAULT 'available';
`);
}
}
6 changes: 2 additions & 4 deletions apps/frontend/src/types/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export interface PantryApplicationDto {
export interface Donation {
donationId: number;
dateDonated: string;
status: string;
status: DonationStatus;
totalItems: number;
totalOz: number;
totalEstimatedValue: number;
Expand All @@ -113,7 +113,6 @@ export interface DonationItem {
itemName: string;
quantity: number;
reservedQuantity: number;
status: string;
ozPerItem: number;
estimatedValue: number;
foodType: string;
Expand Down Expand Up @@ -163,7 +162,7 @@ export interface Order {
pantryId: number;
foodManufacturer: FoodManufacturer;
shippedBy: number | null;
status: string;
status: OrderStatus;
createdAt: string;
shippedAt: string;
deliveredAt: string;
Expand Down Expand Up @@ -196,7 +195,6 @@ export interface Allocation {
allocatedQuantity: number;
reservedAt: string;
fulfilledAt: string;
status: string;
}

export enum VolunteerType {
Expand Down
Loading