Browse Source

bugfix

master
Daniel 1 month ago
parent
commit
0683acf451
5 changed files with 55 additions and 159 deletions
  1. +0
    -1
      export/openapi.json
  2. +1
    -0
      openapi.json
  3. +46
    -146
      openapi.yaml
  4. +2
    -2
      src/ApiResource/SaleApi.php
  5. +6
    -10
      src/Entity/Sale.php

+ 0
- 1
export/openapi.json
File diff suppressed because it is too large
View File


+ 1
- 0
openapi.json
File diff suppressed because it is too large
View File


export/openapi.yaml → openapi.yaml View File

@@ -8,6 +8,42 @@ servers:
url: /
description: ''
paths:
/api/auth:
post:
operationId: login_check_post
tags:
- 'Login Check'
responses:
200:
description: 'User token created'
content:
application/json:
schema:
type: object
properties:
token: { readOnly: true, type: string, nullable: false }
required:
- token
summary: 'Creates a user token.'
description: 'Creates a user token.'
requestBody:
description: 'The login data'
content:
application/json:
schema:
type: object
properties:
email:
type: string
nullable: false
password:
type: string
nullable: false
required:
- email
- password
required: true
parameters: []
/api/comments:
get:
operationId: api_comments_get_collection
@@ -774,22 +810,6 @@ paths:
type: array
items:
$ref: '#/components/schemas/DocumentObject-document_object.read'
text/html:
schema:
type: array
items:
$ref: '#/components/schemas/DocumentObject-document_object.read'
application/hal+json:
schema:
type: object
properties:
_embedded: { type: array, items: { $ref: '#/components/schemas/DocumentObject.jsonhal-document_object.read' } }
totalItems: { type: integer, minimum: 0 }
itemsPerPage: { type: integer, minimum: 0 }
_links: { type: object, properties: { self: { type: object, properties: { href: { type: string, format: iri-reference } } }, first: { type: object, properties: { href: { type: string, format: iri-reference } } }, last: { type: object, properties: { href: { type: string, format: iri-reference } } }, next: { type: object, properties: { href: { type: string, format: iri-reference } } }, previous: { type: object, properties: { href: { type: string, format: iri-reference } } } } }
required:
- _links
- _embedded
summary: 'Retrieves the collection of DocumentObject resources.'
description: 'Retrieves the collection of DocumentObject resources.'
parameters:
@@ -830,18 +850,12 @@ paths:
201:
description: 'DocumentObject resource created'
content:
application/ld+json:
schema:
$ref: '#/components/schemas/DocumentObject.jsonld-document_object.read'
application/json:
schema:
$ref: '#/components/schemas/DocumentObject-document_object.read'
text/html:
schema:
$ref: '#/components/schemas/DocumentObject-document_object.read'
application/hal+json:
application/ld+json:
schema:
$ref: '#/components/schemas/DocumentObject.jsonhal-document_object.read'
$ref: '#/components/schemas/DocumentObject.jsonld-document_object.read'
links: { }
400:
description: 'Invalid input'
@@ -878,12 +892,6 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/DocumentObject-document_object.read'
text/html:
schema:
$ref: '#/components/schemas/DocumentObject-document_object.read'
application/hal+json:
schema:
$ref: '#/components/schemas/DocumentObject.jsonhal-document_object.read'
404:
description: 'Resource not found'
summary: 'Retrieves a DocumentObject resource.'
@@ -1269,22 +1277,6 @@ paths:
type: array
items:
$ref: '#/components/schemas/MediaObject-media_object.read'
text/html:
schema:
type: array
items:
$ref: '#/components/schemas/MediaObject-media_object.read'
application/hal+json:
schema:
type: object
properties:
_embedded: { type: array, items: { $ref: '#/components/schemas/MediaObject.jsonhal-media_object.read' } }
totalItems: { type: integer, minimum: 0 }
itemsPerPage: { type: integer, minimum: 0 }
_links: { type: object, properties: { self: { type: object, properties: { href: { type: string, format: iri-reference } } }, first: { type: object, properties: { href: { type: string, format: iri-reference } } }, last: { type: object, properties: { href: { type: string, format: iri-reference } } }, next: { type: object, properties: { href: { type: string, format: iri-reference } } }, previous: { type: object, properties: { href: { type: string, format: iri-reference } } } } }
required:
- _links
- _embedded
summary: 'Retrieves the collection of MediaObject resources.'
description: 'Retrieves the collection of MediaObject resources.'
parameters:
@@ -1325,18 +1317,12 @@ paths:
201:
description: 'MediaObject resource created'
content:
application/ld+json:
schema:
$ref: '#/components/schemas/MediaObject.jsonld-media_object.read'
application/json:
schema:
$ref: '#/components/schemas/MediaObject-media_object.read'
text/html:
schema:
$ref: '#/components/schemas/MediaObject-media_object.read'
application/hal+json:
application/ld+json:
schema:
$ref: '#/components/schemas/MediaObject.jsonhal-media_object.read'
$ref: '#/components/schemas/MediaObject.jsonld-media_object.read'
links: { }
400:
description: 'Invalid input'
@@ -1373,12 +1359,6 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/MediaObject-media_object.read'
text/html:
schema:
$ref: '#/components/schemas/MediaObject-media_object.read'
application/hal+json:
schema:
$ref: '#/components/schemas/MediaObject.jsonhal-media_object.read'
404:
description: 'Resource not found'
summary: 'Retrieves a MediaObject resource.'
@@ -4467,42 +4447,6 @@ paths:
allowReserved: false
deprecated: false
parameters: []
/auth:
post:
operationId: login_check_post
tags:
- 'Login Check'
responses:
200:
description: 'User token created'
content:
application/json:
schema:
type: object
properties:
token: { readOnly: true, type: string, nullable: false }
required:
- token
summary: 'Creates a user token.'
description: 'Creates a user token.'
requestBody:
description: 'The login data'
content:
application/json:
schema:
type: object
properties:
email:
type: string
nullable: false
password:
type: string
nullable: false
required:
- email
- password
required: true
parameters: []
components:
schemas:
Comment:
@@ -5237,28 +5181,6 @@ components:
type:
- string
- 'null'
DocumentObject.jsonhal-document_object.read:
type: object
description: ''
deprecated: false
externalDocs:
url: 'https://schema.org/MediaObject'
properties:
_links:
type: object
properties:
self:
type: object
properties:
href:
type: string
format: iri-reference
contentUrl:
externalDocs:
url: 'https://schema.org/contentUrl'
type:
- string
- 'null'
DocumentObject.jsonld-document_object.read:
type: object
description: ''
@@ -5308,28 +5230,6 @@ components:
type:
- string
- 'null'
MediaObject.jsonhal-media_object.read:
type: object
description: ''
deprecated: false
externalDocs:
url: 'https://schema.org/MediaObject'
properties:
_links:
type: object
properties:
self:
type: object
properties:
href:
type: string
format: iri-reference
contentUrl:
externalDocs:
url: 'https://schema.org/contentUrl'
type:
- string
- 'null'
MediaObject.jsonld-media_object.read:
type: object
description: ''
@@ -6698,11 +6598,11 @@ components:
example: 'https://example.com/'
turnover:
type:
- integer
- number
- 'null'
profit:
type:
- integer
- number
- 'null'
quantity:
type:
@@ -6764,11 +6664,11 @@ components:
example: 'https://example.com/'
turnover:
type:
- integer
- number
- 'null'
profit:
type:
- integer
- number
- 'null'
quantity:
type:
@@ -6844,11 +6744,11 @@ components:
example: 'https://example.com/'
turnover:
type:
- integer
- number
- 'null'
profit:
type:
- integer
- number
- 'null'
quantity:
type:

+ 2
- 2
src/ApiResource/SaleApi.php View File

@@ -122,10 +122,10 @@ class SaleApi implements OwnerInterface
public ?ProductApi $productIri = null;

#[NotBlank]
public ?int $turnover = null;
public ?float $turnover = null;

#[NotBlank]
public ?int $profit = null;
public ?float $profit = null;

#[NotBlank]
public ?int $quantity = null;


+ 6
- 10
src/Entity/Sale.php View File

@@ -29,10 +29,10 @@ class Sale
private ?Product $product = null;

#[ORM\Column]
private ?int $turnover = null;
private ?float $turnover = null;

#[ORM\Column(nullable: true)]
private ?int $profit = null;
private ?float $profit = null;

#[ORM\Column(type: "integer", nullable: false, options: ["unsigned" => true])]
protected int $quantity;
@@ -96,28 +96,24 @@ class Sale
return $this;
}

public function getTurnover(): ?int
public function getTurnover(): ?float
{
return $this->turnover;
}

public function setTurnover(int $turnover): static
public function setTurnover(?float $turnover): void
{
$this->turnover = $turnover;

return $this;
}

public function getProfit(): ?int
public function getProfit(): ?float
{
return $this->profit;
}

public function setProfit(?int $profit): static
public function setProfit(?float $profit): void
{
$this->profit = $profit;

return $this;
}

public function getQuantity(): int


Loading…
Cancel
Save