mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -04:00
Update for open api docs
This commit is contained in:
parent
149c5b6a0e
commit
2fa010b42f
@ -416,7 +416,6 @@ class InvoiceController extends BaseController
|
|||||||
|
|
||||||
$invoice->service()
|
$invoice->service()
|
||||||
->triggeredActions($request)
|
->triggeredActions($request)
|
||||||
// ->deletePdf()
|
|
||||||
->adjustInventory($old_invoice);
|
->adjustInventory($old_invoice);
|
||||||
|
|
||||||
event(new InvoiceWasUpdated($invoice, $invoice->company, Ninja::eventVars(auth()->user() ? auth()->user()->id : null)));
|
event(new InvoiceWasUpdated($invoice, $invoice->company, Ninja::eventVars(auth()->user() ? auth()->user()->id : null)));
|
||||||
|
@ -28,7 +28,7 @@ class ClientContactRepository extends BaseRepository
|
|||||||
|
|
||||||
public function save(array $data, Client $client) : void
|
public function save(array $data, Client $client) : void
|
||||||
{
|
{
|
||||||
//06-09-2022 sometimes users pass a contact object instead of a nested array, this sequence handles this scenario
|
|
||||||
if (isset($data['contacts']) && (count($data['contacts']) !== count($data['contacts'], COUNT_RECURSIVE))) {
|
if (isset($data['contacts']) && (count($data['contacts']) !== count($data['contacts'], COUNT_RECURSIVE))) {
|
||||||
$contacts = collect($data['contacts']);
|
$contacts = collect($data['contacts']);
|
||||||
} elseif (isset($data['contacts'])) {
|
} elseif (isset($data['contacts'])) {
|
||||||
|
@ -25,8 +25,12 @@ class VendorContactRepository extends BaseRepository
|
|||||||
|
|
||||||
public function save(array $data, Vendor $vendor) : void
|
public function save(array $data, Vendor $vendor) : void
|
||||||
{
|
{
|
||||||
if (isset($data['contacts'])) {
|
|
||||||
|
if (isset($data['contacts']) && (count($data['contacts']) !== count($data['contacts'], COUNT_RECURSIVE))) {
|
||||||
$contacts = collect($data['contacts']);
|
$contacts = collect($data['contacts']);
|
||||||
|
} elseif (isset($data['contacts'])) {
|
||||||
|
$temp_array[] = $data['contacts'];
|
||||||
|
$contacts = collect($temp_array);
|
||||||
} else {
|
} else {
|
||||||
$contacts = collect();
|
$contacts = collect();
|
||||||
}
|
}
|
||||||
@ -80,10 +84,10 @@ class VendorContactRepository extends BaseRepository
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
$vendor->load('contacts');
|
$vendor->fresh();
|
||||||
|
|
||||||
//always made sure we have one blank contact to maintain state
|
//always made sure we have one blank contact to maintain state
|
||||||
if ($vendor->contacts->count() == 0) {
|
if ($vendor->contacts()->count() == 0) {
|
||||||
$new_contact = new VendorContact;
|
$new_contact = new VendorContact;
|
||||||
$new_contact->vendor_id = $vendor->id;
|
$new_contact->vendor_id = $vendor->id;
|
||||||
$new_contact->company_id = $vendor->company_id;
|
$new_contact->company_id = $vendor->company_id;
|
||||||
|
@ -17855,18 +17855,22 @@ components:
|
|||||||
description: 'The hashed if of the contact'
|
description: 'The hashed if of the contact'
|
||||||
type: string
|
type: string
|
||||||
example: Opnel5aKBz
|
example: Opnel5aKBz
|
||||||
|
readOnly: true
|
||||||
user_id:
|
user_id:
|
||||||
description: 'The hashed id of the user who created the contact'
|
description: 'The hashed id of the user who created the contact'
|
||||||
type: string
|
type: string
|
||||||
example: Opnel5aKBz
|
example: Opnel5aKBz
|
||||||
|
readOnly: true
|
||||||
company_id:
|
company_id:
|
||||||
description: 'The hashed id of the company'
|
description: 'The hashed id of the company'
|
||||||
type: string
|
type: string
|
||||||
example: Opnel5aKBz
|
example: Opnel5aKBz
|
||||||
|
readOnly: true
|
||||||
client_id:
|
client_id:
|
||||||
description: 'The hashed id of the client'
|
description: 'The hashed id of the client'
|
||||||
type: string
|
type: string
|
||||||
example: Opnel5aKBz
|
example: Opnel5aKBz
|
||||||
|
readOnly: true
|
||||||
first_name:
|
first_name:
|
||||||
description: 'The first name of the contact'
|
description: 'The first name of the contact'
|
||||||
type: string
|
type: string
|
||||||
@ -17903,18 +17907,26 @@ components:
|
|||||||
description: 'The terms of service which the contact has accpeted'
|
description: 'The terms of service which the contact has accpeted'
|
||||||
type: string
|
type: string
|
||||||
example: 'A long set of ToS'
|
example: 'A long set of ToS'
|
||||||
|
readOnly: true
|
||||||
password:
|
password:
|
||||||
description: 'The hashed password of the contact'
|
description: 'The hashed password of the contact'
|
||||||
type: string
|
type: string
|
||||||
example: '*****'
|
example: '*****'
|
||||||
confirmation-code:
|
confirmation_code:
|
||||||
description: 'The confirmation code used to authenticate the contacts email address'
|
description: 'The confirmation code used to authenticate the contacts email address'
|
||||||
type: string
|
type: string
|
||||||
example: 333-sdjkh34gbasd
|
example: 333-sdjkh34gbasd
|
||||||
|
readOnly: true
|
||||||
token:
|
token:
|
||||||
description: 'A uuid based token.'
|
description: 'A uuid based token.'
|
||||||
type: string
|
type: string
|
||||||
example: 333-sdjkh34gbasd
|
example: 333-sdjkh34gbasd
|
||||||
|
readOnly: true
|
||||||
|
contact_key:
|
||||||
|
description: 'A unique identifier for the contact'
|
||||||
|
type: string
|
||||||
|
example: JD0X52bkfZlJRiroCJ0tcSiAjsJTntZ5uqKdiZ0a
|
||||||
|
readOnly: true
|
||||||
is_primary:
|
is_primary:
|
||||||
description: 'Defines is this contact is the primary contact for the client'
|
description: 'Defines is this contact is the primary contact for the client'
|
||||||
type: boolean
|
type: boolean
|
||||||
@ -17936,31 +17948,37 @@ components:
|
|||||||
type: number
|
type: number
|
||||||
format: integer
|
format: integer
|
||||||
example: '3'
|
example: '3'
|
||||||
|
readOnly: true
|
||||||
email_verified_at:
|
email_verified_at:
|
||||||
description: 'The date which the contact confirmed their email'
|
description: 'The date which the contact confirmed their email'
|
||||||
type: number
|
type: number
|
||||||
format: integer
|
format: integer
|
||||||
example: '134341234234'
|
example: '134341234234'
|
||||||
|
readOnly: true
|
||||||
last_login:
|
last_login:
|
||||||
description: Timestamp
|
description: Timestamp
|
||||||
type: number
|
type: number
|
||||||
format: integer
|
format: integer
|
||||||
example: '134341234234'
|
example: '134341234234'
|
||||||
|
readOnly: true
|
||||||
created_at:
|
created_at:
|
||||||
description: Timestamp
|
description: Timestamp
|
||||||
type: number
|
type: number
|
||||||
format: integer
|
format: integer
|
||||||
example: '134341234234'
|
example: '134341234234'
|
||||||
|
readOnly: true
|
||||||
updated_at:
|
updated_at:
|
||||||
description: Timestamp
|
description: Timestamp
|
||||||
type: number
|
type: number
|
||||||
format: integer
|
format: integer
|
||||||
example: '134341234234'
|
example: '134341234234'
|
||||||
|
readOnly: true
|
||||||
deleted_at:
|
deleted_at:
|
||||||
description: Timestamp
|
description: Timestamp
|
||||||
type: number
|
type: number
|
||||||
format: integer
|
format: integer
|
||||||
example: '134341234234'
|
example: '134341234234'
|
||||||
|
readOnly: true
|
||||||
type: object
|
type: object
|
||||||
ClientContactRequest:
|
ClientContactRequest:
|
||||||
properties:
|
properties:
|
||||||
@ -18021,14 +18039,17 @@ components:
|
|||||||
description: 'The hashed id of the user id'
|
description: 'The hashed id of the user id'
|
||||||
type: string
|
type: string
|
||||||
example: Opnel5aKBz
|
example: Opnel5aKBz
|
||||||
|
readOnly: true
|
||||||
company_id:
|
company_id:
|
||||||
description: 'The hashed id of the company'
|
description: 'The hashed id of the company'
|
||||||
type: string
|
type: string
|
||||||
example: Opnel5aKBz
|
example: Opnel5aKBz
|
||||||
|
readOnly: true
|
||||||
vendor_id:
|
vendor_id:
|
||||||
description: 'The hashed id of the vendor'
|
description: 'The hashed id of the vendor'
|
||||||
type: string
|
type: string
|
||||||
example: Opnel5aKBz
|
example: Opnel5aKBz
|
||||||
|
readOnly: true
|
||||||
first_name:
|
first_name:
|
||||||
description: 'The first name of the contact'
|
description: 'The first name of the contact'
|
||||||
type: string
|
type: string
|
||||||
@ -18037,6 +18058,16 @@ components:
|
|||||||
description: 'The last name of the contact'
|
description: 'The last name of the contact'
|
||||||
type: string
|
type: string
|
||||||
example: Windsor
|
example: Windsor
|
||||||
|
contact_key:
|
||||||
|
description: 'A unique identifier for the contact'
|
||||||
|
type: string
|
||||||
|
example: JD0X52bkfZlJRiroCJ0tcSiAjsJTntZ5uqKdiZ0a
|
||||||
|
readOnly: true
|
||||||
|
confirmation_code:
|
||||||
|
description: 'The confirmation code used to authenticate the contacts email address'
|
||||||
|
type: string
|
||||||
|
example: 333-sdjkh34gbasd
|
||||||
|
readOnly: true
|
||||||
phone:
|
phone:
|
||||||
description: 'The contacts phone number'
|
description: 'The contacts phone number'
|
||||||
type: string
|
type: string
|
||||||
@ -18061,6 +18092,16 @@ components:
|
|||||||
description: 'The contact email address'
|
description: 'The contact email address'
|
||||||
type: string
|
type: string
|
||||||
example: harry@windsor.com
|
example: harry@windsor.com
|
||||||
|
email_verified_at:
|
||||||
|
description: 'The date which the contact confirmed their email'
|
||||||
|
type: number
|
||||||
|
format: integer
|
||||||
|
example: '134341234234'
|
||||||
|
readOnly: true
|
||||||
|
password:
|
||||||
|
description: 'The hashed password of the contact'
|
||||||
|
type: string
|
||||||
|
example: '*****'
|
||||||
is_primary:
|
is_primary:
|
||||||
description: 'Boolean flag determining if the contact is the primary contact for the vendor'
|
description: 'Boolean flag determining if the contact is the primary contact for the vendor'
|
||||||
type: boolean
|
type: boolean
|
||||||
@ -19392,10 +19433,6 @@ components:
|
|||||||
description: 'The hashed id of the company. This is a unique identifier for the company.'
|
description: 'The hashed id of the company. This is a unique identifier for the company.'
|
||||||
type: string
|
type: string
|
||||||
example: Opnel5aKBz
|
example: Opnel5aKBz
|
||||||
client_id:
|
|
||||||
description: 'The hashed id of the client. This is a unique identifier for the client.'
|
|
||||||
type: string
|
|
||||||
example: Opnel5aKBz
|
|
||||||
contacts:
|
contacts:
|
||||||
type: array
|
type: array
|
||||||
items:
|
items:
|
||||||
@ -19525,8 +19562,6 @@ components:
|
|||||||
type: string
|
type: string
|
||||||
example: 'Bob the vendor'
|
example: 'Bob the vendor'
|
||||||
readOnly: true
|
readOnly: true
|
||||||
settings:
|
|
||||||
$ref: '#/components/schemas/CompanySettings'
|
|
||||||
type: object
|
type: object
|
||||||
ClientSettings:
|
ClientSettings:
|
||||||
required:
|
required:
|
||||||
|
@ -4,18 +4,22 @@
|
|||||||
description: 'The hashed if of the contact'
|
description: 'The hashed if of the contact'
|
||||||
type: string
|
type: string
|
||||||
example: Opnel5aKBz
|
example: Opnel5aKBz
|
||||||
|
readOnly: true
|
||||||
user_id:
|
user_id:
|
||||||
description: 'The hashed id of the user who created the contact'
|
description: 'The hashed id of the user who created the contact'
|
||||||
type: string
|
type: string
|
||||||
example: Opnel5aKBz
|
example: Opnel5aKBz
|
||||||
|
readOnly: true
|
||||||
company_id:
|
company_id:
|
||||||
description: 'The hashed id of the company'
|
description: 'The hashed id of the company'
|
||||||
type: string
|
type: string
|
||||||
example: Opnel5aKBz
|
example: Opnel5aKBz
|
||||||
|
readOnly: true
|
||||||
client_id:
|
client_id:
|
||||||
description: 'The hashed id of the client'
|
description: 'The hashed id of the client'
|
||||||
type: string
|
type: string
|
||||||
example: Opnel5aKBz
|
example: Opnel5aKBz
|
||||||
|
readOnly: true
|
||||||
first_name:
|
first_name:
|
||||||
description: 'The first name of the contact'
|
description: 'The first name of the contact'
|
||||||
type: string
|
type: string
|
||||||
@ -52,18 +56,26 @@
|
|||||||
description: 'The terms of service which the contact has accpeted'
|
description: 'The terms of service which the contact has accpeted'
|
||||||
type: string
|
type: string
|
||||||
example: 'A long set of ToS'
|
example: 'A long set of ToS'
|
||||||
|
readOnly: true
|
||||||
password:
|
password:
|
||||||
description: 'The hashed password of the contact'
|
description: 'The hashed password of the contact'
|
||||||
type: string
|
type: string
|
||||||
example: '*****'
|
example: '*****'
|
||||||
confirmation-code:
|
confirmation_code:
|
||||||
description: 'The confirmation code used to authenticate the contacts email address'
|
description: 'The confirmation code used to authenticate the contacts email address'
|
||||||
type: string
|
type: string
|
||||||
example: 333-sdjkh34gbasd
|
example: 333-sdjkh34gbasd
|
||||||
|
readOnly: true
|
||||||
token:
|
token:
|
||||||
description: 'A uuid based token.'
|
description: 'A uuid based token.'
|
||||||
type: string
|
type: string
|
||||||
example: 333-sdjkh34gbasd
|
example: 333-sdjkh34gbasd
|
||||||
|
readOnly: true
|
||||||
|
contact_key:
|
||||||
|
description: 'A unique identifier for the contact'
|
||||||
|
type: string
|
||||||
|
example: JD0X52bkfZlJRiroCJ0tcSiAjsJTntZ5uqKdiZ0a
|
||||||
|
readOnly: true
|
||||||
is_primary:
|
is_primary:
|
||||||
description: 'Defines is this contact is the primary contact for the client'
|
description: 'Defines is this contact is the primary contact for the client'
|
||||||
type: boolean
|
type: boolean
|
||||||
@ -85,29 +97,35 @@
|
|||||||
type: number
|
type: number
|
||||||
format: integer
|
format: integer
|
||||||
example: '3'
|
example: '3'
|
||||||
|
readOnly: true
|
||||||
email_verified_at:
|
email_verified_at:
|
||||||
description: 'The date which the contact confirmed their email'
|
description: 'The date which the contact confirmed their email'
|
||||||
type: number
|
type: number
|
||||||
format: integer
|
format: integer
|
||||||
example: '134341234234'
|
example: '134341234234'
|
||||||
|
readOnly: true
|
||||||
last_login:
|
last_login:
|
||||||
description: Timestamp
|
description: Timestamp
|
||||||
type: number
|
type: number
|
||||||
format: integer
|
format: integer
|
||||||
example: '134341234234'
|
example: '134341234234'
|
||||||
|
readOnly: true
|
||||||
created_at:
|
created_at:
|
||||||
description: Timestamp
|
description: Timestamp
|
||||||
type: number
|
type: number
|
||||||
format: integer
|
format: integer
|
||||||
example: '134341234234'
|
example: '134341234234'
|
||||||
|
readOnly: true
|
||||||
updated_at:
|
updated_at:
|
||||||
description: Timestamp
|
description: Timestamp
|
||||||
type: number
|
type: number
|
||||||
format: integer
|
format: integer
|
||||||
example: '134341234234'
|
example: '134341234234'
|
||||||
|
readOnly: true
|
||||||
deleted_at:
|
deleted_at:
|
||||||
description: Timestamp
|
description: Timestamp
|
||||||
type: number
|
type: number
|
||||||
format: integer
|
format: integer
|
||||||
example: '134341234234'
|
example: '134341234234'
|
||||||
|
readOnly: true
|
||||||
type: object
|
type: object
|
@ -17,10 +17,6 @@
|
|||||||
description: 'The hashed id of the company. This is a unique identifier for the company.'
|
description: 'The hashed id of the company. This is a unique identifier for the company.'
|
||||||
type: string
|
type: string
|
||||||
example: Opnel5aKBz
|
example: Opnel5aKBz
|
||||||
client_id:
|
|
||||||
description: 'The hashed id of the client. This is a unique identifier for the client.'
|
|
||||||
type: string
|
|
||||||
example: Opnel5aKBz
|
|
||||||
contacts:
|
contacts:
|
||||||
type: array
|
type: array
|
||||||
items:
|
items:
|
||||||
@ -150,6 +146,4 @@
|
|||||||
type: string
|
type: string
|
||||||
example: 'Bob the vendor'
|
example: 'Bob the vendor'
|
||||||
readOnly: true
|
readOnly: true
|
||||||
settings:
|
|
||||||
$ref: '#/components/schemas/CompanySettings'
|
|
||||||
type: object
|
type: object
|
@ -9,14 +9,17 @@
|
|||||||
description: 'The hashed id of the user id'
|
description: 'The hashed id of the user id'
|
||||||
type: string
|
type: string
|
||||||
example: Opnel5aKBz
|
example: Opnel5aKBz
|
||||||
|
readOnly: true
|
||||||
company_id:
|
company_id:
|
||||||
description: 'The hashed id of the company'
|
description: 'The hashed id of the company'
|
||||||
type: string
|
type: string
|
||||||
example: Opnel5aKBz
|
example: Opnel5aKBz
|
||||||
|
readOnly: true
|
||||||
vendor_id:
|
vendor_id:
|
||||||
description: 'The hashed id of the vendor'
|
description: 'The hashed id of the vendor'
|
||||||
type: string
|
type: string
|
||||||
example: Opnel5aKBz
|
example: Opnel5aKBz
|
||||||
|
readOnly: true
|
||||||
first_name:
|
first_name:
|
||||||
description: 'The first name of the contact'
|
description: 'The first name of the contact'
|
||||||
type: string
|
type: string
|
||||||
@ -25,6 +28,16 @@
|
|||||||
description: 'The last name of the contact'
|
description: 'The last name of the contact'
|
||||||
type: string
|
type: string
|
||||||
example: Windsor
|
example: Windsor
|
||||||
|
contact_key:
|
||||||
|
description: 'A unique identifier for the contact'
|
||||||
|
type: string
|
||||||
|
example: JD0X52bkfZlJRiroCJ0tcSiAjsJTntZ5uqKdiZ0a
|
||||||
|
readOnly: true
|
||||||
|
confirmation_code:
|
||||||
|
description: 'The confirmation code used to authenticate the contacts email address'
|
||||||
|
type: string
|
||||||
|
example: 333-sdjkh34gbasd
|
||||||
|
readOnly: true
|
||||||
phone:
|
phone:
|
||||||
description: 'The contacts phone number'
|
description: 'The contacts phone number'
|
||||||
type: string
|
type: string
|
||||||
@ -49,6 +62,16 @@
|
|||||||
description: 'The contact email address'
|
description: 'The contact email address'
|
||||||
type: string
|
type: string
|
||||||
example: harry@windsor.com
|
example: harry@windsor.com
|
||||||
|
email_verified_at:
|
||||||
|
description: 'The date which the contact confirmed their email'
|
||||||
|
type: number
|
||||||
|
format: integer
|
||||||
|
example: '134341234234'
|
||||||
|
readOnly: true
|
||||||
|
password:
|
||||||
|
description: 'The hashed password of the contact'
|
||||||
|
type: string
|
||||||
|
example: '*****'
|
||||||
is_primary:
|
is_primary:
|
||||||
description: 'Boolean flag determining if the contact is the primary contact for the vendor'
|
description: 'Boolean flag determining if the contact is the primary contact for the vendor'
|
||||||
type: boolean
|
type: boolean
|
||||||
|
Loading…
x
Reference in New Issue
Block a user