#AI法律咨询项目

#数据范式设计
>设定要求
您是一名专业的数据库工程师，熟悉PostgreSQL和ParseSever。
请注意表名用大驼峰，字段小驼峰。
有预留字段：objectId、updatedAt、createdAt。
关于ParseSever中数据类的描述，字段的主要类型有：
String => String
Number => Number
Bool => bool
Array => JSON Array
Object => JSON Object
Date => Date
File => Parse.File
Pointer => other Parse.Object
Relation => Parse.Relation
Null => null
GeoPoint => {latitude: 40.0, longitude: -30.0}

>项目需求
相关法律咨询的辅助AI应用，咨询者（_User）、劳动合同、离婚协议书、借款合同、房屋租赁合同、股东协议、著作权转让协,请您根据法律咨询的行业经验，设计以上7张表，咨询者直接用预留的_User表即可。

>输出结果（uml类图）
请您帮我用plantuml的类图描述设计好的几张表及其关系

>输出结果（信息结构图）
请您帮我用markmap格式表示上面的信息结构图

>输出结果（SQL语句）
请您帮我用SQL格式给我建表语句和测试数据插入语句

#UML类图

```plantuml
@startuml
skinparam groupInheritance 2

class _User {
  + objectId: String <<PK>>
  + username: String
  + password: String
  + email: String
  + phone: String
  + createdAt: Date
  + updatedAt: Date
}

class LaborContract {
  + objectId: String <<PK>>
  + title: String
  + employer: String
  + employee: String
  + contractPeriod: Number
  + probation: Number
  + salaryDetails: JSON Object
  + terminationClauses: String
  + signDate: Date
  + user: Pointer > _User
}

class DivorceAgreement {
  + objectId: String <<PK>>
  + partyA: String
  + partyB: String
  + divisionAssets: JSON Array
  + childCustody: String
  + alimony: Number
  + effectiveDate: Date
  + user: Pointer > _User
}

class LoanContract {
  + objectId: String <<PK>>
  + lender: String
  + borrower: String
  + principal: Number
  + interestRate: Number
  + repaymentSchedule: JSON Object
  + collateral: String
  + dueDate: Date
  + user: Pointer > _User
}

class HouseLease {
  + objectId: String <<PK>>
  + landlord: String
  + tenant: String
  + propertyAddress: JSON Object
  + leaseTerm: Number
  + monthlyRent: Number
  + deposit: Number
  + facilities: JSON Array
  + startDate: Date
  + user: Pointer > _User
}

class ShareholderAgreement {
  + objectId: String <<PK>>
  + companyName: String
  + shareholders: JSON Array
  + capitalContributions: JSON Object
  + votingRights: JSON Object
  + profitDistribution: String
  + disputeResolution: String
  + user: Pointer > _User
}

class CopyrightTransfer {
  + objectId: String <<PK>>
  + copyrightOwner: String
  + transferee: String
  + workTitle: String
  + transferRights: JSON Array
  + territory: String
  + compensation: Number
  + effectiveDate: Date
  + user: Pointer > _User
}

' 关联关系
_User "1" -- "n" LaborContract
_User "1" -- "n" DivorceAgreement
_User "1" -- "n" LoanContract
_User "1" -- "n" HouseLease
_User "1" -- "n" ShareholderAgreement
_User "1" -- "n" CopyrightTransfer
@enduml

```