rwadurian/backend/services/planting-service/prisma/seed.ts

152 lines
9.3 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { PrismaClient } from '@prisma/client';
const prisma = new PrismaClient();
async function main() {
// 创建初始合同模板(基于真实合同文档)
const contractTemplate = await prisma.contractTemplate.upsert({
where: { version: 'v1.0.0' },
update: {},
create: {
version: 'v1.0.0',
title: '榴莲树联合种植协议',
content: `
<div class="contract-container" style="font-family: 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif; padding: 20px; line-height: 1.8;">
<h1 style="text-align: center; font-size: 24px; font-weight: bold; margin-bottom: 30px; letter-spacing: 8px;">榴莲树联合种植协议</h1>
<div class="contract-info" style="margin-bottom: 30px; padding: 15px; background: #f9f9f9; border-radius: 8px;">
<p style="margin: 5px 0;"><strong>协议编号:</strong>{{ORDER_NO}}</p>
</div>
<h2 style="font-size: 16px; font-weight: bold; margin: 20px 0 15px; border-bottom: 1px solid #ddd; padding-bottom: 10px;">甲方(发起方/公司)</h2>
<table style="width: 100%; border-collapse: collapse; margin-bottom: 20px;">
<tr>
<td style="padding: 10px; width: 30%;">名称:</td>
<td style="padding: 10px;">海南民垦农业有限公司</td>
</tr>
<tr>
<td style="padding: 10px;">地址:</td>
<td style="padding: 10px;">海南省海口市秀英区石山镇美社村313号F203</td>
</tr>
<tr>
<td style="padding: 10px;">法定代表人:</td>
<td style="padding: 10px;">肖建</td>
</tr>
</table>
<h2 style="font-size: 16px; font-weight: bold; margin: 20px 0 15px; border-bottom: 1px solid #ddd; padding-bottom: 10px;">乙方(合伙人/投资人)</h2>
<table style="width: 100%; border-collapse: collapse; margin-bottom: 20px;">
<tr>
<td style="padding: 10px; width: 30%;">姓名/名称:</td>
<td style="padding: 10px;">{{USER_REAL_NAME}}</td>
</tr>
<tr>
<td style="padding: 10px;">身份证号:</td>
<td style="padding: 10px;">{{USER_ID_CARD}}</td>
</tr>
<tr>
<td style="padding: 10px;">联系方式:</td>
<td style="padding: 10px;">{{USER_PHONE}}</td>
</tr>
<tr>
<td style="padding: 10px;">账户编号:</td>
<td style="padding: 10px;">{{ACCOUNT_SEQUENCE}}</td>
</tr>
</table>
<p style="text-indent: 2em; margin: 20px 0;">鉴于甲方在榴莲种植、管理和生产销售方面具备专业能力,乙方看好榴莲市场未来的无限价值,甲、乙双方经友好协商,本着平等、互利、共赢的原则,就联合种植榴莲事宜达成如下协议:</p>
<h3 style="font-size: 15px; font-weight: bold; margin: 25px 0 10px;">一、合作事项</h3>
<p style="text-indent: 2em; margin: 10px 0;">1、双方共同合作种植榴莲种植地点为海南省白沙县榴莲种植基地及其他基地首期种植面积4000亩二期种植面积预计100000亩。</p>
<h3 style="font-size: 15px; font-weight: bold; margin: 25px 0 10px;">二、种植周期</h3>
<p style="text-indent: 2em; margin: 10px 0;">1、种植周期五年。</p>
<h3 style="font-size: 15px; font-weight: bold; margin: 25px 0 10px;">三、合作模式</h3>
<p style="text-indent: 2em; margin: 10px 0;">甲方:负责种植、销售等产业具体实施及运营管理。</p>
<p style="text-indent: 2em; margin: 10px 0;">乙方:负责榴莲种植所需资金。</p>
<h3 style="font-size: 15px; font-weight: bold; margin: 25px 0 10px;">四、认种数量</h3>
<p style="text-indent: 2em; margin: 10px 0;">乙方认种 <strong style="color: #e74c3c; font-size: 18px;">{{TREE_COUNT}}</strong> 棵榴莲树苗。</p>
<p style="text-indent: 2em; margin: 10px 0;">认种金额:<strong style="color: #e74c3c; font-size: 18px;">{{TOTAL_AMOUNT}} USDT</strong></p>
<p style="text-indent: 2em; margin: 10px 0;">种植区域:{{PROVINCE_NAME}} {{CITY_NAME}}</p>
<h3 style="font-size: 15px; font-weight: bold; margin: 25px 0 10px;">五、种植标准</h3>
<p style="text-indent: 2em; margin: 10px 0;">1、本项目联合种植地点为海南省白沙县榴莲种植基地及周边地区。</p>
<p style="text-indent: 2em; margin: 10px 0;">2、甲方按照每亩地10棵榴莲的标准进行种植。</p>
<p style="text-indent: 2em; margin: 10px 0;">3、种植期限以5年为标准周期。</p>
<h3 style="font-size: 15px; font-weight: bold; margin: 25px 0 10px;">六、收益分配方案</h3>
<p style="text-indent: 2em; margin: 10px 0;">1、收益计算标准榴莲结果产量作为销售标准。</p>
<p style="text-indent: 2em; margin: 10px 0;">2、分配比例榴莲树产果后乙方享有40%的榴莲果分配比例。</p>
<h3 style="font-size: 15px; font-weight: bold; margin: 25px 0 10px;">七、权利与义务</h3>
<p style="font-weight: bold; margin: 15px 0 5px;">(一)甲方权利与义务</p>
<p style="text-indent: 2em; margin: 5px 0;">1、甲方有权按照本协议约定获取相应收益。</p>
<p style="text-indent: 2em; margin: 5px 0;">2、甲方保证种植技术达标。</p>
<p style="text-indent: 2em; margin: 5px 0;">3、甲方完成种植、养护、生产、销售等一系列流程的顺利进行。</p>
<p style="text-indent: 2em; margin: 5px 0;">4、甲方确保乙方的榴莲树在幼苗期因某些原因生长不良时补给乙方同期种植且正常生长的榴莲树。</p>
<p style="text-indent: 2em; margin: 5px 0;">5、甲方确保乙方的榴莲树在第五年因某些原因不产果时补给乙方同期种植且正常产果的榴莲树。</p>
<p style="font-weight: bold; margin: 15px 0 5px;">(二)乙方权利与义务</p>
<p style="text-indent: 2em; margin: 5px 0;">1、乙方有权按照本协议约定获取20年的榴莲果收益。</p>
<p style="text-indent: 2em; margin: 5px 0;">2、乙方在种植期间不干涉正常种植管理与组织运营。</p>
<p style="text-indent: 2em; margin: 5px 0;">3、乙方对公司采用的联合种植方案进行保密不得泄露。</p>
<h3 style="font-size: 15px; font-weight: bold; margin: 25px 0 10px;">八、保密条款</h3>
<p style="text-indent: 2em; margin: 10px 0;">双方应对本协议涉及的商业秘密、技术秘密等予以保密,未经对方书面同意,不得向任何第三方透露。如有违反保密条款,违约方应向对方赔偿因此造成的全部损失。</p>
<h3 style="font-size: 15px; font-weight: bold; margin: 25px 0 10px;">九、违约责任</h3>
<p style="text-indent: 2em; margin: 10px 0;">若甲方未能履行本协议约定的技术、种植、管理或运营责任导致榴莲产量减少或质量下降,影响项目收益,双方应承担相应的赔偿责任,收益不足由甲方补偿。</p>
<h3 style="font-size: 15px; font-weight: bold; margin: 25px 0 10px;">十、协议变更与解除</h3>
<p style="text-indent: 2em; margin: 10px 0;">1、本协议的变更或补充需经双方书面协商一致并签署相关协议。</p>
<p style="text-indent: 2em; margin: 10px 0;">2、在履行本协议过程中如因不可抗力等不可预见、不可避免的因素导致本协议无法继续履行双方可协商解除本协议互不承担违约责任。</p>
<h3 style="font-size: 15px; font-weight: bold; margin: 25px 0 10px;">十一、争议解决</h3>
<p style="text-indent: 2em; margin: 10px 0;">如双方在本协议履行过程中发生争议,应首先通过友好协商解决;协商不成的,任何一方均有权向甲方所在地的人民法院提起诉讼。</p>
<h3 style="font-size: 15px; font-weight: bold; margin: 25px 0 10px;">十二、其他条款</h3>
<p style="text-indent: 2em; margin: 10px 0;">1、本协议自双方签字或盖章之日起生效有效期至本项目收益分配完毕之日止。</p>
<p style="text-indent: 2em; margin: 10px 0; color: #e74c3c; font-weight: bold;">2、电子合同具有同等法律效力。</p>
<div class="signature-section" style="margin-top: 50px; padding-top: 30px; border-top: 2px solid #333;">
<div style="display: flex; justify-content: space-between; margin-bottom: 40px;">
<div style="width: 45%;">
<p style="margin-bottom: 10px; font-weight: bold;">甲方(签字/盖章):</p>
<p style="margin-bottom: 5px;">海南民垦农业有限公司</p>
<div style="width: 150px; height: 60px; border: 1px dashed #ccc; margin: 10px 0; display: flex; align-items: center; justify-content: center; color: #999;">
[公司电子章]
</div>
</div>
<div style="width: 45%;">
<p style="margin-bottom: 10px; font-weight: bold;">乙方(签字/盖章):</p>
<p style="margin-bottom: 5px;">{{USER_REAL_NAME}}</p>
<div style="width: 200px; height: 80px; border: 1px dashed #ccc; margin: 10px 0;">
{{USER_SIGNATURE}}
</div>
</div>
</div>
<p style="text-align: center; margin-top: 30px;"><strong>签约日期:</strong>{{SIGNING_DATE}}</p>
<p style="text-align: center; color: #666; font-size: 12px; margin-top: 10px;">签署时间戳:{{SIGNING_TIMESTAMP}}</p>
</div>
</div>
`.trim(),
effectiveFrom: new Date('2024-01-01'),
effectiveTo: null,
isActive: true,
},
});
console.log('Created contract template:', contractTemplate.version);
}
main()
.catch((e) => {
console.error(e);
process.exit(1);
})
.finally(async () => {
await prisma.$disconnect();
});