fix(file): make ocean booking documents platform owned
This commit is contained in:
@@ -15,7 +15,7 @@ enum BusinessFileCategory {
|
||||
DELIVERY_LOADING_PHOTO(true, FormatPolicy.ARBITRARY, Limits.CUSTOMS, BusinessIdPolicy.POSITIVE_LONG),
|
||||
DELIVERY_EXPRESS_RECEIPT(true, FormatPolicy.ARBITRARY, Limits.CUSTOMS, BusinessIdPolicy.POSITIVE_LONG),
|
||||
TRUCK_APPOINTMENT_ATTACHMENT(false, FormatPolicy.STANDARD, Limits.STANDARD, BusinessIdPolicy.POSITIVE_LONG),
|
||||
OCEAN_BOOKING_DOCUMENT(true, FormatPolicy.ARBITRARY, Limits.CUSTOMS, BusinessIdPolicy.POSITIVE_LONG),
|
||||
OCEAN_BOOKING_DOCUMENT(false, FormatPolicy.ARBITRARY, Limits.CUSTOMS, BusinessIdPolicy.POSITIVE_LONG),
|
||||
CUSTOMS_DOCUMENT(false, FormatPolicy.STANDARD, Limits.STANDARD, BusinessIdPolicy.POSITIVE_LONG),
|
||||
CUSTOMS_RECEIPT(false, FormatPolicy.STANDARD, Limits.STANDARD, BusinessIdPolicy.POSITIVE_LONG),
|
||||
FINANCE_VOUCHER(false, FormatPolicy.STANDARD, Limits.STANDARD, BusinessIdPolicy.POSITIVE_LONG),
|
||||
@@ -57,6 +57,9 @@ enum BusinessFileCategory {
|
||||
}
|
||||
|
||||
void validateOwner(long tenantId) {
|
||||
if (this == OCEAN_BOOKING_DOCUMENT && tenantId != 0) {
|
||||
throw new BizException(ResultCode.BAD_REQUEST, "订舱附件必须归属平台");
|
||||
}
|
||||
if (customerOwned && tenantId <= 0) {
|
||||
throw new BizException(ResultCode.BAD_REQUEST, "该附件类型必须归属明确客户");
|
||||
}
|
||||
|
||||
@@ -3,9 +3,9 @@ info:
|
||||
title: Ocean Booking Document Internal API
|
||||
version: 1.0.0
|
||||
description: >-
|
||||
订舱文件归属订舱聚合,不归属拖车。固定ownerScope=CUSTOMER、tenantId=订舱customerId、
|
||||
订舱文件归属订舱聚合,不归属拖车。固定ownerScope=PLATFORM、tenantId=0、
|
||||
businessType=OCEAN_BOOKING_DOCUMENT、businessId=oceanBookingId。BOOKING_CONFIRMATION与
|
||||
BILL_OF_LADING文档类型、版本和有效状态归Firstleg;File不判断订舱业务状态。
|
||||
BILL_OF_LADING文档类型、版本和有效状态归Firstleg;File不判断订舱业务状态。客户为可选快照,有值、为空或清空均不改变文件归属,客户作用域上传读取一律拒绝。
|
||||
x-firstleg-document-types: [BOOKING_CONFIRMATION, BILL_OF_LADING]
|
||||
x-lifecycle-owner: FIRSTLEG
|
||||
x-file-object-semantics: IMMUTABLE_CREATE_ONLY
|
||||
@@ -70,8 +70,8 @@ components:
|
||||
name: tenantId
|
||||
in: path
|
||||
required: true
|
||||
description: 订舱customerId
|
||||
schema: {$ref: '#/components/schemas/Id'}
|
||||
description: 平台固定0,与订舱客户快照无关
|
||||
schema: {type: string, enum: ['0']}
|
||||
OceanBookingId:
|
||||
name: oceanBookingId
|
||||
in: path
|
||||
@@ -100,10 +100,11 @@ components:
|
||||
required: [fileId, ownerScope, tenantId, businessType, businessId, fileName, sha256, contentType, sizeBytes]
|
||||
properties:
|
||||
fileId: {$ref: '#/components/schemas/Id'}
|
||||
ownerScope: {type: string, enum: [CUSTOMER]}
|
||||
ownerScope: {type: string, enum: [PLATFORM]}
|
||||
tenantId:
|
||||
allOf: [{$ref: '#/components/schemas/Id'}]
|
||||
description: 订舱customerId
|
||||
type: string
|
||||
enum: ['0']
|
||||
description: 平台固定0,与订舱客户快照无关
|
||||
businessType: {type: string, enum: [OCEAN_BOOKING_DOCUMENT]}
|
||||
businessId:
|
||||
allOf: [{$ref: '#/components/schemas/Id'}]
|
||||
|
||||
Reference in New Issue
Block a user