Skip to content
Snippets Groups Projects
Verified Commit feda4012 authored by Damien's avatar Damien
Browse files

FEAT #11691 TIME 0:20 Remove is version from v2 + shipping is version

parent 440f6b9d
No related branches found
No related tags found
No related merge requests found
......@@ -1295,7 +1295,6 @@ CREATE TABLE shippings
id serial NOT NULL,
user_id INTEGER NOT NULL,
attachment_id INTEGER NOT NULL,
is_version boolean NOT NULL,
options json DEFAULT '{}',
fee FLOAT NOT NULL,
recipient_entity_id INTEGER NOT NULL,
......
......@@ -39,25 +39,6 @@ abstract class AttachmentModelAbstract
return $attachments;
}
public static function getOnView(array $aArgs)
{
ValidatorModel::notEmpty($aArgs, ['select']);
ValidatorModel::arrayType($aArgs, ['select', 'where', 'data', 'orderBy', 'groupBy']);
ValidatorModel::intType($aArgs, ['limit']);
$aAttachments = DatabaseModel::select([
'select' => $aArgs['select'],
'table' => ['res_view_attachments'],
'where' => empty($aArgs['where']) ? [] : $aArgs['where'],
'data' => empty($aArgs['data']) ? [] : $aArgs['data'],
'groupBy' => empty($aArgs['groupBy']) ? [] : $aArgs['groupBy'],
'order_by' => empty($aArgs['orderBy']) ? [] : $aArgs['orderBy'],
'limit' => empty($aArgs['limit']) ? 0 : $aArgs['limit']
]);
return $aAttachments;
}
public static function getById(array $aArgs)
{
ValidatorModel::notEmpty($aArgs, ['id']);
......
......@@ -128,7 +128,6 @@ class ConvertPdfController
} else {
AdrModel::createAttachAdr([
'resId' => $aArgs['resId'],
'isVersion' => $aArgs['isVersion'],
'type' => 'PDF',
'docserverId' => $storeResult['docserver_id'],
'path' => $storeResult['destination_dir'],
......
......@@ -143,11 +143,7 @@ class EmailController
$document['attachments'] = (array)$document['attachments'];
foreach ($document['attachments'] as $attachment) {
$attachment = (array)$attachment;
if ($attachment['isVersion']) {
$email['attachments_version'][] = $attachment['id'];
} else {
$email['attachments'][] = $attachment['id'];
}
$email['attachments'][] = $attachment['id'];
}
}
......@@ -477,7 +473,6 @@ class EmailController
}
foreach ($args['data']['document']['attachments'] as $attachment) {
$check = Validator::intVal()->notEmpty()->validate($attachment['id']);
$check = $check && Validator::boolType()->validate($attachment['isVersion']);
$check = $check && Validator::boolType()->validate($attachment['original']);
if (!$check) {
return ['errors' => 'Data document[attachments] errors', 'code' => 400];
......
......@@ -24,14 +24,12 @@ class ShippingModel
ValidatorModel::notEmpty($args, ['userId', 'attachmentId', 'accountId']);
ValidatorModel::intVal($args, ['userId', 'attachmentId', 'recipientEntityId']);
ValidatorModel::stringType($args, ['accountId']);
ValidatorModel::boolType($args, ['isVersion']);
DatabaseModel::insert([
'table' => 'shippings',
'columnsValues' => [
'user_id' => $args['userId'],
'attachment_id' => $args['attachmentId'],
'is_version' => empty($args['isVersion']) ? 'false' : 'true',
'options' => $args['options'],
'fee' => $args['fee'],
'recipient_entity_id' => $args['recipientEntityId'],
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment