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

feat: Add item endpoint #61

Merged
merged 34 commits into from
Jul 22, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
c8b2b1b
doc: add CHANGELOG generated thanks to git-cliff
RakuJa May 19, 2024
c7e5570
chore: satisfy frontend requests for alignment random generator to be…
RakuJa May 21, 2024
075fff5
feat:
RakuJa May 21, 2024
c311ea1
chore: remove alignment trait from get_creature
RakuJa May 22, 2024
584f659
Merge branch 'refs/heads/add_changelog' into add_item_endpoint
RakuJa May 22, 2024
13697be
feat: introduce possibility to filter with pathfinder versions
RakuJa May 26, 2024
debb3b2
chore: merge
RakuJa May 26, 2024
ccf6e56
feat:
RakuJa May 26, 2024
631f564
doc: add changelog
RakuJa May 27, 2024
293e2b7
doc: update README.md
RakuJa May 27, 2024
b8c6887
chore: CI refactor
RakuJa May 30, 2024
b7c21aa
chore: divide actions
RakuJa May 30, 2024
96c90dc
chore: update actions
RakuJa May 30, 2024
51e3806
chore: update actions
RakuJa May 30, 2024
8b2aa2a
chore: update actions
RakuJa May 30, 2024
11a1da2
chore: update actions
RakuJa May 30, 2024
7d05fc5
chore: refactor actions
RakuJa May 30, 2024
0c23924
Merge branch 'refs/heads/add_changelog' into add_item_endpoint
RakuJa May 30, 2024
583ab83
feat: add total item count for pagination
RakuJa May 30, 2024
c7ad8d8
doc: update item swagger
RakuJa May 30, 2024
aad2a7c
fix: pf version filter
RakuJa May 30, 2024
ea8dce0
feat: add total for creature
RakuJa May 30, 2024
e100570
chore: changed response item to uniform with creature response
RakuJa May 30, 2024
ea6138a
refactor: pagination, folder structure,
RakuJa Jun 5, 2024
39f0b44
feat: introduce weapon and armor in shop and random gen. fix ranged/m…
RakuJa Jun 6, 2024
38fb761
fix: Dockerfile not building for new curl dependency from swagger-ui
RakuJa Jun 6, 2024
acbee1f
Merge branch 'refs/heads/master' into add_item_endpoint
RakuJa Jun 6, 2024
fe364ee
fix: swagger with wrong response data
RakuJa Jun 6, 2024
9520081
feat: add creature armor, fix weapon duplicates, fix weapon base item…
RakuJa Jun 8, 2024
55d5fb8
feat:
RakuJa Jul 7, 2024
9406c09
feat:
RakuJa Jul 7, 2024
071477f
chore: add rarity sorting
RakuJa Jul 7, 2024
710fc64
chore: optimize regex usage, avoid useless recreation of Regex instan…
RakuJa Jul 7, 2024
0e02d27
chore:
RakuJa Jul 10, 2024
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
Prev Previous commit
chore:
* filter item by pathfinder version;
* allow upper and lower case alternative for encounter difficulty and pathfinder version.
  • Loading branch information
RakuJa committed Jul 10, 2024
commit 0e02d27c0fc2e6b55916de3386d700ec9e571380
6 changes: 6 additions & 0 deletions src/models/encounter_structs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,18 @@ pub struct RandomEncounterData {
Serialize, Deserialize, ToSchema, Default, EnumIter, Eq, PartialEq, Hash, Ord, PartialOrd, Clone,
)]
pub enum EncounterChallengeEnum {
#[serde(alias = "trivial", alias = "TRIVIAL")]
Trivial,
#[serde(alias = "low", alias = "LOW")]
Low,
#[default]
#[serde(alias = "moderate", alias = "MODERATE")]
Moderate,
#[serde(alias = "severe", alias = "SEVERE")]
Severe,
#[serde(alias = "extreme", alias = "EXTREME")]
Extreme,
#[serde(alias = "impossible", alias = "IMPOSSIBLE")]
Impossible,
// Impossible = 320 with chara adjust 60, invented by me but what else can I do?
// Pathfinder 2E thinks that a GM will only try out extreme encounter at maximum
Expand Down
7 changes: 6 additions & 1 deletion src/models/item/item_struct.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use crate::models::item::item_metadata::type_enum::ItemTypeEnum;
use crate::models::pf_version_enum::PathfinderVersionEnum;
use crate::models::routers_validator_structs::ItemFieldFilters;
use crate::models::shared::rarity_enum::RarityEnum;
use crate::models::shared::size_enum::SizeEnum;
Expand Down Expand Up @@ -163,6 +164,10 @@ impl Item {
.to_lowercase()
.contains(cat.to_lowercase().as_str())
}
})
}) && match filters.pathfinder_version.clone().unwrap_or_default() {
PathfinderVersionEnum::Legacy => !self.remaster,
PathfinderVersionEnum::Remaster => self.remaster,
PathfinderVersionEnum::Any => true,
}
}
}
3 changes: 3 additions & 0 deletions src/models/pf_version_enum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@ use utoipa::ToSchema;
Serialize, Deserialize, Eq, PartialEq, Hash, Default, ToSchema, Clone, EnumIter, Display,
)]
pub enum PathfinderVersionEnum {
#[serde(alias = "legacy", alias = "LEGACY")]
Legacy,
#[serde(alias = "remaster", alias = "REMASTER")]
Remaster,
#[default]
#[serde(alias = "any", alias = "ANY")]
Any,
}

Expand Down
Loading