Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feed: creation of the seed file for bid_status_histories table and fixing the bid_requests_seed #70

Merged
merged 2 commits into from
Jan 14, 2025
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
63 changes: 32 additions & 31 deletions seeds/safetrust/1734710839892_bid_requests_seed.sql
Original file line number Diff line number Diff line change
Expand Up @@ -10,121 +10,122 @@ INSERT INTO bid_requests (
) VALUES
(
uuid_generate_v4(),
(SELECT id FROM apartments WHERE name = 'Moderno Apartamento en San José Centro'),
(SELECT id FROM users WHERE email = '[email protected]'),
(SELECT id FROM apartments WHERE name = 'Moderno Apartamento en San José Centro' LIMIT 1),
(SELECT id FROM users WHERE email = '[email protected]' LIMIT 1),
'PENDING',
1150.00,
'2024-02-01T10:00:00Z'
),

(
uuid_generate_v4(),
(SELECT id FROM apartments WHERE name = 'Suite Ejecutiva Sabana Norte'),
(SELECT id FROM users WHERE email = '[email protected]'),
(SELECT id FROM apartments WHERE name = 'Suite Ejecutiva Sabana Norte' LIMIT 1),
(SELECT id FROM users WHERE email = '[email protected]' LIMIT 1),
'APPROVED',
900.00,
'2024-03-01T10:00:00Z'
),
(
uuid_generate_v4(),
(SELECT id FROM apartments WHERE name = 'Penthouse de Lujo en Escazú'),
(SELECT id FROM users WHERE email = '[email protected]'),
(SELECT id FROM apartments WHERE name = 'Penthouse de Lujo en Escazú' LIMIT 1),
(SELECT id FROM users WHERE email = '[email protected]' LIMIT 1),
'PENDING',
2300.00,
'2024-04-01T10:00:00Z'
),
(
uuid_generate_v4(),
(SELECT id FROM apartments WHERE name = 'Apartamento Familiar en Santa Ana'),
(SELECT id FROM users WHERE email = '[email protected]'),
(SELECT id FROM apartments WHERE name = 'Apartamento Familiar en Santa Ana' LIMIT 1),
(SELECT id FROM users WHERE email = '[email protected]' LIMIT 1),
'CANCELLED',
1700.00,
'2024-03-15T10:00:00Z'
),
(
uuid_generate_v4(),
(SELECT id FROM apartments WHERE name = 'Estudio Moderno en Heredia Centro'),
(SELECT id FROM users WHERE email = '[email protected]'),
(SELECT id FROM apartments WHERE name = 'Estudio Moderno en Heredia Centro' LIMIT 1),
(SELECT id FROM users WHERE email = '[email protected]' LIMIT 1),
'APPROVED',
580.00,
'2024-02-15T10:00:00Z'
),
(
uuid_generate_v4(),
(SELECT id FROM apartments WHERE name = 'Apartamento Estudiantil en Cartago'),
(SELECT id FROM users WHERE email = '[email protected]'),
(SELECT id FROM apartments WHERE name = 'Apartamento Estudiantil en Cartago' LIMIT 1),
(SELECT id FROM users WHERE email = '[email protected]' LIMIT 1),
'PENDING',
425.00,
'2024-05-01T10:00:00Z'
),
(
uuid_generate_v4(),
(SELECT id FROM apartments WHERE name = 'Suite Frente al Mar en Jacó'),
(SELECT id FROM users WHERE email = '[email protected]'),
(SELECT id FROM apartments WHERE name = 'Suite Frente al Mar en Jacó' LIMIT 1),
(SELECT id FROM users WHERE email = '[email protected]' LIMIT 1),
'APPROVED',
1050.00,
'2024-06-01T10:00:00Z'
),
(
uuid_generate_v4(),
(SELECT id FROM apartments WHERE name = 'Apartamento Ejecutivo San Pedro'),
(SELECT id FROM users WHERE email = '[email protected]'),
(SELECT id FROM apartments WHERE name = 'Apartamento Ejecutivo San Pedro' LIMIT 1),
(SELECT id FROM users WHERE email = '[email protected]' LIMIT 1),
'PENDING',
850.00,
'2024-04-15T10:00:00Z'
),
(
uuid_generate_v4(),
(SELECT id FROM apartments WHERE name = 'Loft Amueblado Santa Ana'),
(SELECT id FROM users WHERE email = '[email protected]'),
(SELECT id FROM apartments WHERE name = 'Loft Amueblado Santa Ana' LIMIT 1),
(SELECT id FROM users WHERE email = '[email protected]' LIMIT 1),
'CANCELLED',
1200.00,
'2024-03-01T10:00:00Z'
),
(
uuid_generate_v4(),
(SELECT id FROM apartments WHERE name = 'Vista Montaña Heredia'),
(SELECT id FROM users WHERE email = '[email protected]'),
(SELECT id FROM apartments WHERE name = 'Vista Montaña Heredia' LIMIT 1),
(SELECT id FROM users WHERE email = '[email protected]' LIMIT 1),
'APPROVED',
1050.00,
'2024-07-01T10:00:00Z'
),
(
uuid_generate_v4(),
(SELECT id FROM apartments WHERE name = 'Apartamento Familiar Alajuela'),
(SELECT id FROM users WHERE email = '[email protected]'),
(SELECT id FROM apartments WHERE name = 'Apartamento Familiar Alajuela' LIMIT 1),
(SELECT id FROM users WHERE email = '[email protected]' LIMIT 1),
'PENDING',
800.00,
'2024-05-15T10:00:00Z'
),
(
uuid_generate_v4(),
(SELECT id FROM apartments WHERE name = 'Eco Apartamento Monteverde'),
(SELECT id FROM users WHERE email = '[email protected]'),
(SELECT id FROM apartments WHERE name = 'Eco Apartamento Monteverde' LIMIT 1),
(SELECT id FROM users WHERE email = '[email protected]' LIMIT 1),
'APPROVED',
900.00,
'2024-06-15T10:00:00Z'
),
(
uuid_generate_v4(),
(SELECT id FROM apartments WHERE name = 'Mini Apartamento San José'),
(SELECT id FROM users WHERE email = '[email protected]'),
(SELECT id FROM apartments WHERE name = 'Mini Apartamento San José' LIMIT 1),
(SELECT id FROM users WHERE email = '[email protected]' LIMIT 1),
'PENDING',
480.00,
'2024-04-01T10:00:00Z'
),
(
uuid_generate_v4(),
(SELECT id FROM apartments WHERE name = 'Luxury Condo Escazú'),
(SELECT id FROM users WHERE email = '[email protected]'),
(SELECT id FROM apartments WHERE name = 'Luxury Condo Escazú' LIMIT 1),
(SELECT id FROM users WHERE email = '[email protected]' LIMIT 1),
'CANCELLED',
2800.00,
'2024-08-01T10:00:00Z'
),
(
uuid_generate_v4(),
(SELECT id FROM apartments WHERE name = 'Student Housing Heredia'),
(SELECT id FROM users WHERE email = '[email protected]'),
(SELECT id FROM apartments WHERE name = 'Student Housing Heredia' LIMIT 1),
(SELECT id FROM users WHERE email = '[email protected]' LIMIT 1),
'APPROVED',
380.00,
'2024-03-01T10:00:00Z'
);
);
24 changes: 24 additions & 0 deletions seeds/safetrust/1735509833667_create_bid_status_histories.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";

INSERT INTO bid_status_histories (id, bid_request_id, status, notes, changed_by, created_at)
VALUES
(uuid_generate_v4(), (SELECT id FROM bid_requests LIMIT 1 OFFSET 0), 'Submitted', 'Bid request has been submitted.', (SELECT id FROM users LIMIT 1 OFFSET 0), NOW()),
(uuid_generate_v4(), (SELECT id FROM bid_requests LIMIT 1 OFFSET 1), 'Reviewed', 'Initial review completed by team lead.', (SELECT id FROM users LIMIT 1 OFFSET 1), NOW() - INTERVAL '1 day'),
(uuid_generate_v4(), (SELECT id FROM bid_requests LIMIT 1 OFFSET 2), 'Approved', 'Bid request approved by manager.', (SELECT id FROM users LIMIT 1 OFFSET 2), NOW() - INTERVAL '2 days'),
(uuid_generate_v4(), (SELECT id FROM bid_requests LIMIT 1 OFFSET 3), 'In_Progress', 'Work on the bid has begun.', (SELECT id FROM users LIMIT 1 OFFSET 3), NOW() - INTERVAL '3 days'),
(uuid_generate_v4(), (SELECT id FROM bid_requests LIMIT 1 OFFSET 4), 'Rejected', 'Bid request rejected due to insufficient budget.', (SELECT id FROM users LIMIT 1 OFFSET 4), NOW() - INTERVAL '4 days'),
(uuid_generate_v4(), (SELECT id FROM bid_requests LIMIT 1 OFFSET 5), 'Completed', 'All tasks related to the bid request have been completed.', (SELECT id FROM users LIMIT 1 OFFSET 5), NOW() - INTERVAL '5 days'),
(uuid_generate_v4(), (SELECT id FROM bid_requests LIMIT 1 OFFSET 6), 'Rejected', 'incorrect info.', (SELECT id FROM users LIMIT 1 OFFSET 6), NOW() - INTERVAL '5 days'),
(uuid_generate_v4(), (SELECT id FROM bid_requests LIMIT 1 OFFSET 7), 'Submitted', 'Bid request has been submitted.', (SELECT id FROM users LIMIT 1 OFFSET 7), NOW() - INTERVAL '5 days'),
(uuid_generate_v4(), (SELECT id FROM bid_requests LIMIT 1 OFFSET 8), 'In_Progress', 'Awaiting approval.', (SELECT id FROM users LIMIT 1 OFFSET 8), NOW() - INTERVAL '9 days'),
(uuid_generate_v4(), (SELECT id FROM bid_requests LIMIT 1 OFFSET 9), 'Approved', 'Reviewed and approved.', (SELECT id FROM users LIMIT 1 OFFSET 9), NOW() - INTERVAL '6 days'),
(uuid_generate_v4(), (SELECT id FROM bid_requests LIMIT 1 OFFSET 10), 'Rejected', 'Bid amount exceeded limit.', (SELECT id FROM users LIMIT 1 OFFSET 10), NOW() - INTERVAL '2 days'),
(uuid_generate_v4(), (SELECT id FROM bid_requests LIMIT 1 OFFSET 11), 'Aprroved', 'Bid has been finalized', (SELECT id FROM users LIMIT 1 OFFSET 11), NOW() - INTERVAL '6 days'),
(uuid_generate_v4(), (SELECT id FROM bid_requests LIMIT 1 OFFSET 12), 'Submitted', 'Initial status set.', (SELECT id FROM users LIMIT 1 OFFSET 12), NOW() - INTERVAL '10 days'),
(uuid_generate_v4(), (SELECT id FROM bid_requests LIMIT 1 OFFSET 13), 'In_Progress', 'Work on the bid has begun.', (SELECT id FROM users LIMIT 1 OFFSET 13), NOW() - INTERVAL '3 days'),
(uuid_generate_v4(), (SELECT id FROM bid_requests LIMIT 1 OFFSET 14), 'Rejected', 'Insufficient details provided.', (SELECT id FROM users LIMIT 1 OFFSET 14), NOW() - INTERVAL '4 days'),
(uuid_generate_v4(), (SELECT id FROM bid_requests LIMIT 1 OFFSET 15), 'Completed', 'All tasks related to the bid request have been completed.', (SELECT id FROM users LIMIT 1 OFFSET 15), NOW() - INTERVAL '5 days'),
(uuid_generate_v4(), (SELECT id FROM bid_requests LIMIT 1 OFFSET 16), 'Approved', 'Successfully met all requirements', (SELECT id FROM users LIMIT 1 OFFSET 16), NOW() - INTERVAL '5 days'),
(uuid_generate_v4(), (SELECT id FROM bid_requests LIMIT 1 OFFSET 17), 'Submitted', 'Bid request has been submitted.', (SELECT id FROM users LIMIT 1 OFFSET 17), NOW() - INTERVAL '5 days'),
(uuid_generate_v4(), (SELECT id FROM bid_requests LIMIT 1 OFFSET 18), 'In_Progress', 'Waiting on additional documentation', (SELECT id FROM users LIMIT 1 OFFSET 18), NOW() - INTERVAL '9 days'),
(uuid_generate_v4(), (SELECT id FROM bid_requests LIMIT 1 OFFSET 19), 'Approved', 'Reviewed and approved.', (SELECT id FROM users LIMIT 1 OFFSET 19), NOW() - INTERVAL '6 days');