Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
treinamento-2025.1-backend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Harbor Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
RICARDO PRADO FARIA
treinamento-2025.1-backend
Commits
5149373c
Commit
5149373c
authored
2 months ago
by
Ricardo
Browse files
Options
Downloads
Patches
Plain Diff
Issue#10 ADD implant validators
parent
e9560890
No related branches found
No related tags found
1 merge request
!13
Issue#10 ADD implant validators
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/validators/implantsValidator.ts
+7
-6
7 additions, 6 deletions
src/validators/implantsValidator.ts
with
7 additions
and
6 deletions
src/validators/implantsValidator.ts
+
7
−
6
View file @
5149373c
import
{
z
}
from
'
zod
'
;
export
const
implantSchema
=
z
.
object
({
id
:
z
.
number
().
int
().
optional
(),
name
:
z
.
string
().
min
(
1
,
"
Name cannot be empty
"
),
price
:
z
.
number
().
nonnegative
(),
cyberCost
:
z
.
number
().
nonnegative
(),
bodyPart
:
z
.
string
().
min
(
1
,
"
Must be part of something
"
),
});
\ No newline at end of file
name
:
z
.
string
().
min
(
1
,
{
message
:
"
Name cannot be empty
"
}).
max
(
255
,
{
message
:
"
Max of 255 characters
"
}),
price
:
z
.
number
().
nonnegative
({
message
:
"
Price must be positive
"
}).
finite
({
message
:
"
Price must be a valid number
"
}),
cyberCost
:
z
.
number
().
nonnegative
({
message
:
"
cyberCost must be positive
"
}).
finite
({
message
:
"
cyberCost must be a valid number
"
}),
bodyPart
:
z
.
string
().
min
(
1
,
{
message
:
"
Bodypart must be named
"
}).
max
(
255
,
{
message
:
"
Bodypart cant have more than 255 characters
"
}),
});
export
const
updateImplantSchema
=
implantSchema
.
partial
();
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment