feat:寄卖增加对接客服,db脚本迁移修复
This commit is contained in:
@@ -228,8 +228,6 @@ export function mapConsignmentInventory(row: ConsignmentInventoryRow) {
|
||||
depositAmountFen: Number(row.deposit_amount_fen || 0),
|
||||
contactSupporterId: row.contact_supporter_id ? Number(row.contact_supporter_id) : null,
|
||||
contactSupporterName: row.contact_supporter_name || '',
|
||||
contactSupporterPhone: row.contact_supporter_phone || '',
|
||||
contactSupporterWechat: row.contact_supporter_wechat || '',
|
||||
inboundAt: row.inbound_at || row.created_at,
|
||||
consumedAt: row.consumed_at,
|
||||
createdAt: row.created_at,
|
||||
@@ -272,8 +270,6 @@ export function mapConsignmentSubmission(row: ConsignmentSubmissionRow) {
|
||||
depositAmountFen: Number(row.deposit_amount_fen || 0),
|
||||
contactSupporterId: row.contact_supporter_id ? Number(row.contact_supporter_id) : null,
|
||||
contactSupporterName: row.contact_supporter_name || '',
|
||||
contactSupporterPhone: row.contact_supporter_phone || '',
|
||||
contactSupporterWechat: row.contact_supporter_wechat || '',
|
||||
status: row.status,
|
||||
reviewNote: row.review_note || '',
|
||||
reviewerName: row.reviewer_name || '',
|
||||
|
||||
@@ -18,8 +18,6 @@ export function mapConsignmentContact(row: ConsignmentContactRow) {
|
||||
return {
|
||||
id: Number(row.id),
|
||||
name: row.name,
|
||||
phone: row.phone || '',
|
||||
wechat: row.wechat || '',
|
||||
note: row.note || '',
|
||||
enabled: Boolean(row.enabled),
|
||||
sortOrder: Number(row.sort_order || 0),
|
||||
@@ -92,8 +90,6 @@ export async function createAdminConsignmentContact(payload: JsonObject) {
|
||||
await assertContactNameAvailable(name)
|
||||
const row = await createConsignmentContact({
|
||||
name,
|
||||
phone: normalizeText(payload.phone),
|
||||
wechat: normalizeText(payload.wechat),
|
||||
note: normalizeText(payload.note),
|
||||
enabled: payload.enabled !== false,
|
||||
sortOrder: normalizeSortOrder(payload.sortOrder),
|
||||
@@ -118,8 +114,6 @@ export async function updateAdminConsignmentContact(id: number | string, payload
|
||||
|
||||
const updated = await updateConsignmentContact(id, {
|
||||
name,
|
||||
phone: payload.phone !== undefined ? normalizeText(payload.phone) : undefined,
|
||||
wechat: payload.wechat !== undefined ? normalizeText(payload.wechat) : undefined,
|
||||
note: payload.note !== undefined ? normalizeText(payload.note) : undefined,
|
||||
sortOrder: payload.sortOrder !== undefined ? normalizeSortOrder(payload.sortOrder) : undefined,
|
||||
now: nowIso(),
|
||||
|
||||
@@ -511,8 +511,6 @@ export async function fulfillWorkOrderWithConsignment(input: {
|
||||
? Number(inventory.contact_supporter_id)
|
||||
: null,
|
||||
contactSupporterName: inventory.contact_supporter_name || '',
|
||||
contactSupporterPhone: inventory.contact_supporter_phone || '',
|
||||
contactSupporterWechat: inventory.contact_supporter_wechat || '',
|
||||
workerName: inv.worker_name || '',
|
||||
workerPhone: inv.worker_phone || '',
|
||||
remark: inv.remark || '',
|
||||
@@ -771,8 +769,6 @@ export async function assignWorkOrderWithConsignmentWorker(input: {
|
||||
? Number(inventory.contact_supporter_id)
|
||||
: null,
|
||||
contactSupporterName: inventory.contact_supporter_name || '',
|
||||
contactSupporterPhone: inventory.contact_supporter_phone || '',
|
||||
contactSupporterWechat: inventory.contact_supporter_wechat || '',
|
||||
workerId: Number(targetWorkerId),
|
||||
workerName: claimed.worker_name || '',
|
||||
workerPhone: claimed.worker_phone || '',
|
||||
|
||||
@@ -48,14 +48,10 @@ function toRecord(value: unknown): Record<string, unknown> | null {
|
||||
function mapConsignmentContactSupporter(source: {
|
||||
contact_supporter_id?: string | number | null
|
||||
contact_supporter_name?: string
|
||||
contact_supporter_phone?: string
|
||||
contact_supporter_wechat?: string
|
||||
}) {
|
||||
return {
|
||||
contactSupporterId: source.contact_supporter_id ? Number(source.contact_supporter_id) : null,
|
||||
contactSupporterName: source.contact_supporter_name || '',
|
||||
contactSupporterPhone: source.contact_supporter_phone || '',
|
||||
contactSupporterWechat: source.contact_supporter_wechat || '',
|
||||
}
|
||||
}
|
||||
|
||||
@@ -354,8 +350,6 @@ export async function publishWorkerConsignment(workerId: number, payload: JsonOb
|
||||
? Number(submission.contact_supporter_id)
|
||||
: null,
|
||||
contactSupporterName: contactSupporter.name,
|
||||
contactSupporterPhone: contactSupporter.phone || '',
|
||||
contactSupporterWechat: contactSupporter.wechat || '',
|
||||
createdAt: submission.created_at,
|
||||
}
|
||||
} catch (error) {
|
||||
|
||||
Reference in New Issue
Block a user