Skip to content

Commit ff743b9

Browse files
committed
feat: seed includes published apps with boundary geojson + consultation dates for applicants portal
Both portals now fully working and verified via Playwright: - BOPS back-office: login, My cases (18 assigned), All cases (35), application detail - BOPS applicants: homepage, application detail with map, consultation status, comment link - Seed publishes 10 in-assessment apps with boundary geojson and consultation end dates - ApiUser with full permissions for API auth between portals
1 parent d5caa68 commit ff743b9

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

cloudformation/scenarios/bops-planning/docker/bops/scripts/seed_sample_data.rb

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,28 @@
198198
)
199199
end
200200

201+
# 7. Publish ~30% of in_assessment apps for the applicants portal
202+
# Applicants portal only shows apps where published_at is set
203+
geojson = {
204+
type: "Feature",
205+
geometry: {
206+
type: "Polygon",
207+
coordinates: [[[-0.128, 51.507], [-0.127, 51.507], [-0.127, 51.508], [-0.128, 51.508], [-0.128, 51.507]]]
208+
}
209+
}.to_json
210+
211+
published = 0
212+
PlanningApplication.where(local_authority: la, status: "in_assessment", published_at: nil).limit(10).each do |pa|
213+
pa.update_columns(published_at: Time.current - rand(1..7).days, boundary_geojson: geojson)
214+
consultation = pa.consultation || pa.create_consultation!
215+
consultation.update_columns(end_date: Time.current + 14.days, start_date: Time.current - 7.days) unless consultation.end_date
216+
published += 1
217+
end
218+
puts "Published #{published} apps for applicants portal"
219+
201220
puts "Created: #{created}, Errors: #{errors}"
202221
puts "By status: #{PlanningApplication.where(local_authority: la).group(:status).count}"
203222
assigned = PlanningApplication.where(local_authority: la).joins(:case_record).where(case_records: { user_id: assessor.id }).count
204223
puts "Assigned to assessor: #{assigned}/#{created}"
224+
puts "Published: #{PlanningApplication.where(local_authority: la).where.not(published_at: nil).count}"
205225
puts "=== Seed Complete ==="

0 commit comments

Comments
 (0)