Skip to content

Commit

Permalink
set publication date to 2024-06-05
Browse files Browse the repository at this point in the history
  • Loading branch information
lsteinmann committed Aug 2, 2024
1 parent a22e9b2 commit 4dbb102
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
9 changes: 9 additions & 0 deletions publication/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,12 @@ iex -S mix phx.server
```

Now you can visit [`localhost:4001`](http://localhost:4001) in your browser and should see the landing page. The next step would be to login as the COUCHDB_USER as defined in the [docker-compose.yml](docker-compose.yml).

## 3. Seed Project for Development
By running

```
mix seed
```

you can add a local copy of 'testopolis' as a finished publication for testing during development.
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,15 @@ defmodule FieldPublication.DatabaseSchema.ReplicationInput do
field(:project_name, :string)
field(:delete_existing_publication, :boolean, default: false)
field(:processing, :boolean, default: true)
field(:draft_date, :date, default: Date.utc_today())
end

@doc false
def changeset(input_struct, attrs \\ %{}) do
input_struct
|> cast(attrs, [
:drafted_by,
:draft_date,
:source_url,
:source_project_name,
:source_user,
Expand Down
4 changes: 2 additions & 2 deletions publication/lib/field_publication/publications.ex
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ defmodule FieldPublication.Publications do
source_project_name: source_project_name,
project_name: project_name,
delete_existing_publication: delete_existing,
drafted_by: drafted_by
drafted_by: drafted_by,
draft_date: draft_date
}) do
draft_date = Date.utc_today()

changeset =
%Publication{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ defmodule FieldPublication.Test.ProjectSeed do
"source_user" => "local_developer",
"source_password" => "fake",
"project_name" => identifier,
"drafted_by" => "mix seed"
"drafted_by" => "mix seed",
"draft_date" => Date.from_iso8601!("2024-06-05")
})

{:ok, %Publication{} = publication} =
Expand Down Expand Up @@ -98,7 +99,7 @@ defmodule FieldPublication.Test.ProjectSeed do

{:ok, %FieldPublication.DatabaseSchema.Publication{} = publication} =
Publications.put(publication, %{
"publication_date" => Date.utc_today(),
"publication_date" => Date.from_iso8601!("2024-06-05"),
"comments" => [
%{
"text" =>
Expand Down

0 comments on commit 4dbb102

Please sign in to comment.